{"version":3,"file":"FormReducer.cjs","sources":["../../../../src/lib/Form/FormReducer.ts"],"sourcesContent":["/**\n * Action names collection\n * @example\n * import { Actions } from './FormReducer';\n * dispatch({ type: Actions.FORM_SET_PRISTINE})\n * */\nexport enum Actions {\n    FORM_SET_PRISTINE = 'FORM_SET_PRISTINE',\n}\n\n/** Form state type */\nexport type FormState = {\n    /** Defines if form is rendered or was reset to pristine state */\n    pristine: boolean;\n};\n\nexport const initialState = {\n    pristine: true,\n} as FormState;\n\nexport type FormAction = {\n    /** Action name */\n    type: Actions;\n    pristine: boolean;\n};\n\nexport const FormReducer = (state = initialState, action: FormAction): FormState => {\n    switch (action.type) {\n        case Actions.FORM_SET_PRISTINE: {\n            return {\n                ...state,\n                pristine: action.pristine,\n            };\n        }\n        default:\n            return state;\n    }\n};\n"],"names":["Actions","initialState","FormReducer","state","action"],"mappings":"6FAMO,IAAKA,GAAAA,IACRA,EAAA,kBAAoB,oBADZA,IAAAA,GAAA,CAAA,CAAA,EAUL,MAAMC,EAAe,CACxB,SAAU,EACd,EAQaC,EAAc,CAACC,EAAQF,EAAcG,IAAkC,CAChF,OAAQA,EAAO,KAAA,CACX,IAAK,oBACD,MAAO,CACH,GAAGD,EACH,SAAUC,EAAO,QAAA,EAGzB,QACI,OAAOD,CAAA,CAEnB"}