@softpak/components 20.12.16 → 20.12.17

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.
@@ -9,17 +9,7 @@ const spxCreateApiActions = () => {
9
9
  };
10
10
  };
11
11
 
12
- const spxCreateInitialStateForReducer = () => ({
13
- data: null,
14
- error: null,
15
- loading: false,
16
- loaded: false,
17
- query: null,
18
- queryNext: null,
19
- });
20
-
21
- function spxCreateApiReducer(actions) {
22
- const initialState = spxCreateInitialStateForReducer();
12
+ function spxCreateApiReducer(actions, initialState) {
23
13
  return createReducer(initialState, on(actions.load, (state, { query }) => ({
24
14
  ...state,
25
15
  loading: true,
@@ -44,6 +34,15 @@ function spxCreateApiReducer(actions) {
44
34
  })), on(actions.reset, () => initialState));
45
35
  }
46
36
 
37
+ const spxCreateInitialStateForReducer = () => ({
38
+ data: null,
39
+ error: null,
40
+ loading: false,
41
+ loaded: false,
42
+ query: null,
43
+ queryNext: null,
44
+ });
45
+
47
46
  /**
48
47
  * Generated bundle index. Do not edit.
49
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-redux.mjs","sources":["../../../../projects/softpak/components/spx-redux/src/spx-create-api-actions.ts","../../../../projects/softpak/components/spx-redux/src/spx-create-initial-state.ts","../../../../projects/softpak/components/spx-redux/src/spx-create-api-reducer.ts","../../../../projects/softpak/components/spx-redux/softpak-components-spx-redux.ts"],"sourcesContent":["import { ActionCreator, emptyProps, props } from \"@ngrx/store\";\n\nexport type WithProps<P extends object> = ActionCreator<string, (props: P) => P>;\nexport type WithoutProps = ActionCreator<string, () => object>;\n\nexport const spxCreateApiActions = <TQuery, TResult, TMsg = string>() => {\n return {\n Error: props<{ error: TMsg }>(),\n Load: props<{ query: TQuery }>(),\n Received: props<{ result: TResult }>(),\n Reset: emptyProps(),\n };\n}","import { SpxState } from \"./spx-state.interface\";\n\nexport const spxCreateInitialStateForReducer = <TQuery, TData, TError>(): SpxState<TQuery, TData, TError> => ({\n data: null,\n error: null,\n loading: false,\n loaded: false,\n query: null,\n queryNext: null,\n});\n","import { WithProps, WithoutProps } from \"./spx-create-api-actions\";\nimport { createReducer, on } from \"@ngrx/store\";\n\nimport { SpxState } from \"./spx-state.interface\";\nimport { spxCreateInitialStateForReducer } from \"./spx-create-initial-state\";\n\nexport interface SpxApiActions<TQuery, TData, TError> {\n error: WithProps<{ error: TError }>;\n load: WithProps<{ query: TQuery }>;\n received: WithProps<{ result: TData }>;\n reset: WithoutProps;\n}\n\nexport function spxCreateApiReducer<TQuery, TData, TError>(\n actions: SpxApiActions<TQuery, TData, TError>\n) {\n const initialState = spxCreateInitialStateForReducer<TQuery, TData, TError>();\n\n return createReducer(\n initialState,\n\n on(actions.load, (state: SpxState<TQuery, TData, TError>, { query }): SpxState<TQuery, TData, TError> => ({\n ...state,\n loading: true,\n loaded: false,\n queryNext: query,\n })),\n\n on(actions.received, (state: SpxState<TQuery, TData, TError>, { result }): SpxState<TQuery, TData, TError> => ({\n ...state,\n data: result as TData,\n error: null,\n loading: false,\n loaded: true,\n query: state.queryNext,\n queryNext: null,\n })),\n\n on(actions.error, (state: SpxState<TQuery, TData, TError>, { error }): SpxState<TQuery, TData, TError> => ({\n ...state,\n error,\n data: null,\n loading: false,\n loaded: false,\n query: state.queryNext,\n queryNext: null,\n })),\n\n on(actions.reset, (): SpxState<TQuery, TData, TError> => initialState)\n );\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAKO,MAAM,mBAAmB,GAAG,MAAqC;IACtE,OAAO;QACL,KAAK,EAAE,KAAK,EAAmB;QAC/B,IAAI,EAAE,KAAK,EAAqB;QAChC,QAAQ,EAAE,KAAK,EAAuB;QACtC,KAAK,EAAE,UAAU,EAAE;KACpB;AACH;;ACVO,MAAM,+BAA+B,GAAG,OAA+D;AAC5G,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,OAAO,EAAE,KA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-api-actions.ts","../../../../projects/softpak/components/spx-redux/src/spx-create-api-reducer.ts","../../../../projects/softpak/components/spx-redux/src/spx-create-initial-state.ts","../../../../projects/softpak/components/spx-redux/softpak-components-spx-redux.ts"],"sourcesContent":["import { ActionCreator, emptyProps, props } from \"@ngrx/store\";\n\nexport type WithProps<P extends object> = ActionCreator<string, (props: P) => P>;\nexport type WithoutProps = ActionCreator<string, () => object>;\n\nexport const spxCreateApiActions = <TQuery, TResult, TMsg = string>() => {\n return {\n Error: props<{ error: TMsg }>(),\n Load: props<{ query: TQuery }>(),\n Received: props<{ result: TResult }>(),\n Reset: emptyProps(),\n };\n}","import { WithProps, WithoutProps } from \"./spx-create-api-actions\";\nimport { createReducer, on } from \"@ngrx/store\";\n\nimport { SpxState } from \"./spx-state.interface\";\nimport { spxCreateInitialStateForReducer } from \"./spx-create-initial-state\";\n\nexport interface SpxApiActions<TQuery, TData, TError> {\n error: WithProps<{ error: TError }>;\n load: WithProps<{ query: TQuery }>;\n received: WithProps<{ result: TData }>;\n reset: WithoutProps;\n}\n\nexport function spxCreateApiReducer<TQuery, TData, TError>(\n actions: SpxApiActions<TQuery, TData, TError>,\n initialState: SpxState<TQuery, TData, TError>,\n) {\n return createReducer(\n initialState,\n\n on(actions.load, (state: SpxState<TQuery, TData, TError>, { query }): SpxState<TQuery, TData, TError> => ({\n ...state,\n loading: true,\n loaded: false,\n queryNext: query,\n })),\n\n on(actions.received, (state: SpxState<TQuery, TData, TError>, { result }): SpxState<TQuery, TData, TError> => ({\n ...state,\n data: result as TData,\n error: null,\n loading: false,\n loaded: true,\n query: state.queryNext,\n queryNext: null,\n })),\n\n on(actions.error, (state: SpxState<TQuery, TData, TError>, { error }): SpxState<TQuery, TData, TError> => ({\n ...state,\n error,\n data: null,\n loading: false,\n loaded: false,\n query: state.queryNext,\n queryNext: null,\n })),\n\n on(actions.reset, (): SpxState<TQuery, TData, TError> => initialState)\n );\n}","import { SpxState } from \"./spx-state.interface\";\n\nexport const spxCreateInitialStateForReducer = <TQuery, TData, TError>(): SpxState<TQuery, TData, TError> => ({\n data: null,\n error: null,\n loading: false,\n loaded: false,\n query: null,\n queryNext: null,\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAKO,MAAM,mBAAmB,GAAG,MAAqC;IACtE,OAAO;QACL,KAAK,EAAE,KAAK,EAAmB;QAC/B,IAAI,EAAE,KAAK,EAAqB;QAChC,QAAQ,EAAE,KAAK,EAAuB;QACtC,KAAK,EAAE,UAAU,EAAE;KACpB;AACH;;ACCM,SAAU,mBAAmB,CACjC,OAA6C,EAC7C,YAA6C,EAAA;AAE7C,IAAA,OAAO,aAAa,CAClB,YAAY,EAEZ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAsC,EAAE,EAAE,KAAK,EAAE,MAAuC;AACxG,QAAA,GAAG,KAAK;AACR,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,SAAS,EAAE,KAAK;AACjB,KAAA,CAAC,CAAC,EAEH,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAsC,EAAE,EAAE,MAAM,EAAE,MAAuC;AAC7G,QAAA,GAAG,KAAK;AACR,QAAA,IAAI,EAAE,MAAe;AACrB,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,KAAK,CAAC,SAAS;AACtB,QAAA,SAAS,EAAE,IAAI;AAChB,KAAA,CAAC,CAAC,EAEH,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,KAAsC,EAAE,EAAE,KAAK,EAAE,MAAuC;AACzG,QAAA,GAAG,KAAK;QACR,KAAK;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;AACtB,QAAA,SAAS,EAAE,IAAI;AAChB,KAAA,CAAC,CAAC,EAEH,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,MAAuC,YAAY,CAAC,CACvE;AACH;;AC/CO,MAAM,+BAA+B,GAAG,OAA+D;AAC5G,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,SAAS,EAAE,IAAI;AAChB,CAAA;;ACTD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softpak/components",
3
- "version": "20.12.16",
3
+ "version": "20.12.17",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "20.x.x",
@@ -40,14 +40,14 @@
40
40
  "types": "./spx-alert/index.d.ts",
41
41
  "default": "./fesm2022/softpak-components-spx-alert.mjs"
42
42
  },
43
- "./spx-button": {
44
- "types": "./spx-button/index.d.ts",
45
- "default": "./fesm2022/softpak-components-spx-button.mjs"
46
- },
47
43
  "./spx-app-expiry": {
48
44
  "types": "./spx-app-expiry/index.d.ts",
49
45
  "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
50
46
  },
47
+ "./spx-button": {
48
+ "types": "./spx-button/index.d.ts",
49
+ "default": "./fesm2022/softpak-components-spx-button.mjs"
50
+ },
51
51
  "./spx-app-configuration": {
52
52
  "types": "./spx-app-configuration/index.d.ts",
53
53
  "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
@@ -56,14 +56,6 @@
56
56
  "types": "./spx-capitalize/index.d.ts",
57
57
  "default": "./fesm2022/softpak-components-spx-capitalize.mjs"
58
58
  },
59
- "./spx-change-details": {
60
- "types": "./spx-change-details/index.d.ts",
61
- "default": "./fesm2022/softpak-components-spx-change-details.mjs"
62
- },
63
- "./spx-channel-selection": {
64
- "types": "./spx-channel-selection/index.d.ts",
65
- "default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
66
- },
67
59
  "./spx-card": {
68
60
  "types": "./spx-card/index.d.ts",
69
61
  "default": "./fesm2022/softpak-components-spx-card.mjs"
@@ -72,25 +64,29 @@
72
64
  "types": "./spx-check-digit/index.d.ts",
73
65
  "default": "./fesm2022/softpak-components-spx-check-digit.mjs"
74
66
  },
67
+ "./spx-channel-selection": {
68
+ "types": "./spx-channel-selection/index.d.ts",
69
+ "default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
70
+ },
71
+ "./spx-change-details": {
72
+ "types": "./spx-change-details/index.d.ts",
73
+ "default": "./fesm2022/softpak-components-spx-change-details.mjs"
74
+ },
75
75
  "./spx-confirm": {
76
76
  "types": "./spx-confirm/index.d.ts",
77
77
  "default": "./fesm2022/softpak-components-spx-confirm.mjs"
78
78
  },
79
- "./spx-form-view": {
80
- "types": "./spx-form-view/index.d.ts",
81
- "default": "./fesm2022/softpak-components-spx-form-view.mjs"
79
+ "./spx-helpers": {
80
+ "types": "./spx-helpers/index.d.ts",
81
+ "default": "./fesm2022/softpak-components-spx-helpers.mjs"
82
82
  },
83
83
  "./spx-form-section": {
84
84
  "types": "./spx-form-section/index.d.ts",
85
85
  "default": "./fesm2022/softpak-components-spx-form-section.mjs"
86
86
  },
87
- "./spx-helpers": {
88
- "types": "./spx-helpers/index.d.ts",
89
- "default": "./fesm2022/softpak-components-spx-helpers.mjs"
90
- },
91
- "./spx-navigation": {
92
- "types": "./spx-navigation/index.d.ts",
93
- "default": "./fesm2022/softpak-components-spx-navigation.mjs"
87
+ "./spx-form-view": {
88
+ "types": "./spx-form-view/index.d.ts",
89
+ "default": "./fesm2022/softpak-components-spx-form-view.mjs"
94
90
  },
95
91
  "./spx-inputs": {
96
92
  "types": "./spx-inputs/index.d.ts",
@@ -100,42 +96,42 @@
100
96
  "types": "./spx-number-check/index.d.ts",
101
97
  "default": "./fesm2022/softpak-components-spx-number-check.mjs"
102
98
  },
99
+ "./spx-navigation": {
100
+ "types": "./spx-navigation/index.d.ts",
101
+ "default": "./fesm2022/softpak-components-spx-navigation.mjs"
102
+ },
103
+ "./spx-patch": {
104
+ "types": "./spx-patch/index.d.ts",
105
+ "default": "./fesm2022/softpak-components-spx-patch.mjs"
106
+ },
103
107
  "./spx-pagination": {
104
108
  "types": "./spx-pagination/index.d.ts",
105
109
  "default": "./fesm2022/softpak-components-spx-pagination.mjs"
106
110
  },
107
- "./spx-progress-bar": {
108
- "types": "./spx-progress-bar/index.d.ts",
109
- "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
110
- },
111
111
  "./spx-pipes": {
112
112
  "types": "./spx-pipes/index.d.ts",
113
113
  "default": "./fesm2022/softpak-components-spx-pipes.mjs"
114
114
  },
115
- "./spx-patch": {
116
- "types": "./spx-patch/index.d.ts",
117
- "default": "./fesm2022/softpak-components-spx-patch.mjs"
115
+ "./spx-progress-bar": {
116
+ "types": "./spx-progress-bar/index.d.ts",
117
+ "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
118
118
  },
119
119
  "./spx-redux": {
120
120
  "types": "./spx-redux/index.d.ts",
121
121
  "default": "./fesm2022/softpak-components-spx-redux.mjs"
122
122
  },
123
- "./spx-stock-info": {
124
- "types": "./spx-stock-info/index.d.ts",
125
- "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
126
- },
127
123
  "./spx-spinner": {
128
124
  "types": "./spx-spinner/index.d.ts",
129
125
  "default": "./fesm2022/softpak-components-spx-spinner.mjs"
130
126
  },
127
+ "./spx-stock-info": {
128
+ "types": "./spx-stock-info/index.d.ts",
129
+ "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
130
+ },
131
131
  "./spx-storage": {
132
132
  "types": "./spx-storage/index.d.ts",
133
133
  "default": "./fesm2022/softpak-components-spx-storage.mjs"
134
134
  },
135
- "./spx-toaster": {
136
- "types": "./spx-toaster/index.d.ts",
137
- "default": "./fesm2022/softpak-components-spx-toaster.mjs"
138
- },
139
135
  "./spx-suggestion": {
140
136
  "types": "./spx-suggestion/index.d.ts",
141
137
  "default": "./fesm2022/softpak-components-spx-suggestion.mjs"
@@ -148,17 +144,21 @@
148
144
  "types": "./spx-toggle/index.d.ts",
149
145
  "default": "./fesm2022/softpak-components-spx-toggle.mjs"
150
146
  },
151
- "./spx-validation": {
152
- "types": "./spx-validation/index.d.ts",
153
- "default": "./fesm2022/softpak-components-spx-validation.mjs"
147
+ "./spx-toaster": {
148
+ "types": "./spx-toaster/index.d.ts",
149
+ "default": "./fesm2022/softpak-components-spx-toaster.mjs"
150
+ },
151
+ "./spx-translate": {
152
+ "types": "./spx-translate/index.d.ts",
153
+ "default": "./fesm2022/softpak-components-spx-translate.mjs"
154
154
  },
155
155
  "./spx-update": {
156
156
  "types": "./spx-update/index.d.ts",
157
157
  "default": "./fesm2022/softpak-components-spx-update.mjs"
158
158
  },
159
- "./spx-translate": {
160
- "types": "./spx-translate/index.d.ts",
161
- "default": "./fesm2022/softpak-components-spx-translate.mjs"
159
+ "./spx-validation": {
160
+ "types": "./spx-validation/index.d.ts",
161
+ "default": "./fesm2022/softpak-components-spx-validation.mjs"
162
162
  },
163
163
  "./spx-validation-messages": {
164
164
  "types": "./spx-validation-messages/index.d.ts",
@@ -37,7 +37,7 @@ interface SpxApiActions<TQuery, TData, TError> {
37
37
  }>;
38
38
  reset: WithoutProps;
39
39
  }
40
- declare function spxCreateApiReducer<TQuery, TData, TError>(actions: SpxApiActions<TQuery, TData, TError>): _ngrx_store.ActionReducer<SpxState<TQuery, TData, TError>, _ngrx_store.Action<string>>;
40
+ declare function spxCreateApiReducer<TQuery, TData, TError>(actions: SpxApiActions<TQuery, TData, TError>, initialState: SpxState<TQuery, TData, TError>): _ngrx_store.ActionReducer<SpxState<TQuery, TData, TError>, _ngrx_store.Action<string>>;
41
41
 
42
42
  declare const spxCreateInitialStateForReducer: <TQuery, TData, TError>() => SpxState<TQuery, TData, TError>;
43
43