@flowerforce/flower-core 3.0.1-beta.1 → 3.0.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        package/dist/index.cjs.js
    CHANGED
    
    | @@ -818,7 +818,7 @@ const FlowerCoreReducers = { | |
| 818 818 | 
             
                  }
         | 
| 819 819 | 
             
                });
         | 
| 820 820 | 
             
              },
         | 
| 821 | 
            -
               | 
| 821 | 
            +
              restart: (state, {
         | 
| 822 822 | 
             
                payload
         | 
| 823 823 | 
             
              }) => {
         | 
| 824 824 | 
             
                const {
         | 
| @@ -831,6 +831,23 @@ const FlowerCoreReducers = { | |
| 831 831 | 
             
                    name: name || flowName || ''
         | 
| 832 832 | 
             
                  }
         | 
| 833 833 | 
             
                });
         | 
| 834 | 
            +
              },
         | 
| 835 | 
            +
              reset: (state, {
         | 
| 836 | 
            +
                payload
         | 
| 837 | 
            +
              }) => {
         | 
| 838 | 
            +
                const {
         | 
| 839 | 
            +
                  name,
         | 
| 840 | 
            +
                  flowName,
         | 
| 841 | 
            +
                  initialData
         | 
| 842 | 
            +
                } = payload;
         | 
| 843 | 
            +
                FlowerCoreReducers.restoreHistory(state, {
         | 
| 844 | 
            +
                  type: 'restoreHistory',
         | 
| 845 | 
            +
                  payload: {
         | 
| 846 | 
            +
                    name: name || flowName || ''
         | 
| 847 | 
            +
                  }
         | 
| 848 | 
            +
                });
         | 
| 849 | 
            +
                _set(state, [name || flowName || '', 'form'], {});
         | 
| 850 | 
            +
                _set(state, [name || flowName || '', 'data'], initialData);
         | 
| 834 851 | 
             
              }
         | 
| 835 852 | 
             
            };
         | 
| 836 853 |  | 
    
        package/dist/index.esm.js
    CHANGED
    
    | @@ -816,7 +816,7 @@ const FlowerCoreReducers = { | |
| 816 816 | 
             
                  }
         | 
| 817 817 | 
             
                });
         | 
| 818 818 | 
             
              },
         | 
| 819 | 
            -
               | 
| 819 | 
            +
              restart: (state, {
         | 
| 820 820 | 
             
                payload
         | 
| 821 821 | 
             
              }) => {
         | 
| 822 822 | 
             
                const {
         | 
| @@ -829,6 +829,23 @@ const FlowerCoreReducers = { | |
| 829 829 | 
             
                    name: name || flowName || ''
         | 
| 830 830 | 
             
                  }
         | 
| 831 831 | 
             
                });
         | 
| 832 | 
            +
              },
         | 
| 833 | 
            +
              reset: (state, {
         | 
| 834 | 
            +
                payload
         | 
| 835 | 
            +
              }) => {
         | 
| 836 | 
            +
                const {
         | 
| 837 | 
            +
                  name,
         | 
| 838 | 
            +
                  flowName,
         | 
| 839 | 
            +
                  initialData
         | 
| 840 | 
            +
                } = payload;
         | 
| 841 | 
            +
                FlowerCoreReducers.restoreHistory(state, {
         | 
| 842 | 
            +
                  type: 'restoreHistory',
         | 
| 843 | 
            +
                  payload: {
         | 
| 844 | 
            +
                    name: name || flowName || ''
         | 
| 845 | 
            +
                  }
         | 
| 846 | 
            +
                });
         | 
| 847 | 
            +
                _set(state, [name || flowName || '', 'form'], {});
         | 
| 848 | 
            +
                _set(state, [name || flowName || '', 'data'], initialData);
         | 
| 832 849 | 
             
              }
         | 
| 833 850 | 
             
            };
         | 
| 834 851 |  | 
| @@ -115,9 +115,14 @@ export type ReducersFunctions<T extends Record<string, any> = Record<string, Flo | |
| 115 115 | 
             
                    name?: string;
         | 
| 116 116 | 
             
                    flowName?: string;
         | 
| 117 117 | 
             
                }>;
         | 
| 118 | 
            +
                restart: ReducerFunctionSign<T, {
         | 
| 119 | 
            +
                    name?: string;
         | 
| 120 | 
            +
                    flowName?: string;
         | 
| 121 | 
            +
                }>;
         | 
| 118 122 | 
             
                reset: ReducerFunctionSign<T, {
         | 
| 119 123 | 
             
                    name?: string;
         | 
| 120 124 | 
             
                    flowName?: string;
         | 
| 125 | 
            +
                    initialData?: Record<string, any>;
         | 
| 121 126 | 
             
                }>;
         | 
| 122 127 | 
             
            };
         | 
| 123 128 | 
             
            export {};
         | 
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            import { RulesByNodeId | 
| 1 | 
            +
            import { RulesByNodeId } from './CoreInterface';
         | 
| 2 2 | 
             
            export declare enum RulesOperators {
         | 
| 3 3 | 
             
                $exist = "$exist",
         | 
| 4 4 | 
             
                $eq = "$eq",
         | 
| @@ -16,17 +16,6 @@ export declare enum RulesOperators { | |
| 16 16 | 
             
                $all = "$all",
         | 
| 17 17 | 
             
                $regex = "$regex"
         | 
| 18 18 | 
             
            }
         | 
| 19 | 
            -
            type RulesValuesType<T> = {
         | 
| 20 | 
            -
                '$form.isValid': boolean;
         | 
| 21 | 
            -
            } & T;
         | 
| 22 | 
            -
            type RulesOperatorsInArray<T> = Partial<{
         | 
| 23 | 
            -
                [KEY in keyof T]: Partial<{
         | 
| 24 | 
            -
                    [K in keyof typeof RulesOperators]: T[KEY];
         | 
| 25 | 
            -
                }>;
         | 
| 26 | 
            -
            }>;
         | 
| 27 | 
            -
            export type RulesObject<T> = {
         | 
| 28 | 
            -
                [K in keyof typeof RulesModes]: Array<RulesOperatorsInArray<RulesValuesType<T>>> | Array<RulesObject<RulesValuesType<T>>>;
         | 
| 29 | 
            -
            } | Array<RulesOperatorsInArray<RulesValuesType<T>>>;
         | 
| 30 19 | 
             
            export interface StoreRoot<T extends Record<string, any>> {
         | 
| 31 20 | 
             
                flower: {
         | 
| 32 21 | 
             
                    [x: string]: Flower<T>;
         | 
| @@ -61,4 +50,3 @@ export type Form<T> = { | |
| 61 50 | 
             
                    [K in keyof T]: Array<string>;
         | 
| 62 51 | 
             
                };
         | 
| 63 52 | 
             
            };
         | 
| 64 | 
            -
            export {};
         |