@softpak/components 20.12.18 → 20.12.19
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.
|
@@ -6,6 +6,7 @@ const spxCreateApiActions = () => {
|
|
|
6
6
|
Load: props(),
|
|
7
7
|
Received: props(),
|
|
8
8
|
Reset: emptyProps(),
|
|
9
|
+
NoResults: emptyProps(),
|
|
9
10
|
};
|
|
10
11
|
};
|
|
11
12
|
|
|
@@ -21,6 +22,7 @@ function spxCreateApiReducer(actions, initialState) {
|
|
|
21
22
|
error: null,
|
|
22
23
|
loading: false,
|
|
23
24
|
loaded: true,
|
|
25
|
+
noResults: false,
|
|
24
26
|
query: state.queryNext,
|
|
25
27
|
queryNext: null,
|
|
26
28
|
})), on(actions.error, (state, { error }) => ({
|
|
@@ -29,6 +31,16 @@ function spxCreateApiReducer(actions, initialState) {
|
|
|
29
31
|
data: null,
|
|
30
32
|
loading: false,
|
|
31
33
|
loaded: false,
|
|
34
|
+
noResults: false,
|
|
35
|
+
query: state.queryNext,
|
|
36
|
+
queryNext: null,
|
|
37
|
+
})), on(actions.noResults, (state) => ({
|
|
38
|
+
...state,
|
|
39
|
+
error: null,
|
|
40
|
+
data: null,
|
|
41
|
+
loading: false,
|
|
42
|
+
loaded: true,
|
|
43
|
+
noResults: true,
|
|
32
44
|
query: state.queryNext,
|
|
33
45
|
queryNext: null,
|
|
34
46
|
})), on(actions.reset, () => initialState));
|
|
@@ -39,6 +51,7 @@ const spxCreateInitialStateForReducer = () => ({
|
|
|
39
51
|
error: null,
|
|
40
52
|
loading: false,
|
|
41
53
|
loaded: false,
|
|
54
|
+
noResults: false,
|
|
42
55
|
query: null,
|
|
43
56
|
queryNext: null,
|
|
44
57
|
});
|
|
@@ -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-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\";\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;
|
|
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-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 NoResults: emptyProps(),\n };\n}","import { WithProps, WithoutProps } from \"./spx-create-api-actions\";\nimport { createReducer, on } from \"@ngrx/store\";\n\nimport { SpxState } from \"./spx-state.interface\";\n\nexport interface SpxApiActions<TQuery, TData, TError> {\n error: WithProps<{ error: TError }>;\n load: WithProps<{ query: TQuery }>;\n noResults: WithoutProps;\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 noResults: false,\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 noResults: false,\n query: state.queryNext,\n queryNext: null,\n })),\n\n on(actions.noResults, (state: SpxState<TQuery, TData, TError>): SpxState<TQuery, TData, TError> => ({\n ...state,\n error: null,\n data: null,\n loading: false,\n loaded: true,\n noResults: true,\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 noResults: 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;QACnB,SAAS,EAAE,UAAU,EAAE;KACxB;AACH;;ACAM,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,CAA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AAI;AACX,IAAA,SAAS,EAAE,IAAI;AAChB,CAAA;;ACVD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softpak/components",
|
|
3
|
-
"version": "20.12.
|
|
3
|
+
"version": "20.12.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "20.x.x",
|
|
@@ -36,10 +36,6 @@
|
|
|
36
36
|
"types": "./spx-404-page/index.d.ts",
|
|
37
37
|
"default": "./fesm2022/softpak-components-spx-404-page.mjs"
|
|
38
38
|
},
|
|
39
|
-
"./spx-alert": {
|
|
40
|
-
"types": "./spx-alert/index.d.ts",
|
|
41
|
-
"default": "./fesm2022/softpak-components-spx-alert.mjs"
|
|
42
|
-
},
|
|
43
39
|
"./spx-app-configuration": {
|
|
44
40
|
"types": "./spx-app-configuration/index.d.ts",
|
|
45
41
|
"default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
|
|
@@ -48,10 +44,18 @@
|
|
|
48
44
|
"types": "./spx-button/index.d.ts",
|
|
49
45
|
"default": "./fesm2022/softpak-components-spx-button.mjs"
|
|
50
46
|
},
|
|
47
|
+
"./spx-app-expiry": {
|
|
48
|
+
"types": "./spx-app-expiry/index.d.ts",
|
|
49
|
+
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
50
|
+
},
|
|
51
51
|
"./spx-capitalize": {
|
|
52
52
|
"types": "./spx-capitalize/index.d.ts",
|
|
53
53
|
"default": "./fesm2022/softpak-components-spx-capitalize.mjs"
|
|
54
54
|
},
|
|
55
|
+
"./spx-alert": {
|
|
56
|
+
"types": "./spx-alert/index.d.ts",
|
|
57
|
+
"default": "./fesm2022/softpak-components-spx-alert.mjs"
|
|
58
|
+
},
|
|
55
59
|
"./spx-card": {
|
|
56
60
|
"types": "./spx-card/index.d.ts",
|
|
57
61
|
"default": "./fesm2022/softpak-components-spx-card.mjs"
|
|
@@ -64,18 +68,14 @@
|
|
|
64
68
|
"types": "./spx-channel-selection/index.d.ts",
|
|
65
69
|
"default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
|
|
66
70
|
},
|
|
67
|
-
"./spx-check-digit": {
|
|
68
|
-
"types": "./spx-check-digit/index.d.ts",
|
|
69
|
-
"default": "./fesm2022/softpak-components-spx-check-digit.mjs"
|
|
70
|
-
},
|
|
71
|
-
"./spx-app-expiry": {
|
|
72
|
-
"types": "./spx-app-expiry/index.d.ts",
|
|
73
|
-
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
74
|
-
},
|
|
75
71
|
"./spx-confirm": {
|
|
76
72
|
"types": "./spx-confirm/index.d.ts",
|
|
77
73
|
"default": "./fesm2022/softpak-components-spx-confirm.mjs"
|
|
78
74
|
},
|
|
75
|
+
"./spx-check-digit": {
|
|
76
|
+
"types": "./spx-check-digit/index.d.ts",
|
|
77
|
+
"default": "./fesm2022/softpak-components-spx-check-digit.mjs"
|
|
78
|
+
},
|
|
79
79
|
"./spx-form-view": {
|
|
80
80
|
"types": "./spx-form-view/index.d.ts",
|
|
81
81
|
"default": "./fesm2022/softpak-components-spx-form-view.mjs"
|
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
"types": "./spx-pagination/index.d.ts",
|
|
101
101
|
"default": "./fesm2022/softpak-components-spx-pagination.mjs"
|
|
102
102
|
},
|
|
103
|
+
"./spx-number-check": {
|
|
104
|
+
"types": "./spx-number-check/index.d.ts",
|
|
105
|
+
"default": "./fesm2022/softpak-components-spx-number-check.mjs"
|
|
106
|
+
},
|
|
103
107
|
"./spx-patch": {
|
|
104
108
|
"types": "./spx-patch/index.d.ts",
|
|
105
109
|
"default": "./fesm2022/softpak-components-spx-patch.mjs"
|
|
@@ -108,22 +112,18 @@
|
|
|
108
112
|
"types": "./spx-pipes/index.d.ts",
|
|
109
113
|
"default": "./fesm2022/softpak-components-spx-pipes.mjs"
|
|
110
114
|
},
|
|
111
|
-
"./spx-number-check": {
|
|
112
|
-
"types": "./spx-number-check/index.d.ts",
|
|
113
|
-
"default": "./fesm2022/softpak-components-spx-number-check.mjs"
|
|
114
|
-
},
|
|
115
115
|
"./spx-spinner": {
|
|
116
116
|
"types": "./spx-spinner/index.d.ts",
|
|
117
117
|
"default": "./fesm2022/softpak-components-spx-spinner.mjs"
|
|
118
118
|
},
|
|
119
|
-
"./spx-redux": {
|
|
120
|
-
"types": "./spx-redux/index.d.ts",
|
|
121
|
-
"default": "./fesm2022/softpak-components-spx-redux.mjs"
|
|
122
|
-
},
|
|
123
119
|
"./spx-progress-bar": {
|
|
124
120
|
"types": "./spx-progress-bar/index.d.ts",
|
|
125
121
|
"default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
|
|
126
122
|
},
|
|
123
|
+
"./spx-redux": {
|
|
124
|
+
"types": "./spx-redux/index.d.ts",
|
|
125
|
+
"default": "./fesm2022/softpak-components-spx-redux.mjs"
|
|
126
|
+
},
|
|
127
127
|
"./spx-stock-info": {
|
|
128
128
|
"types": "./spx-stock-info/index.d.ts",
|
|
129
129
|
"default": "./fesm2022/softpak-components-spx-stock-info.mjs"
|
|
@@ -140,25 +140,21 @@
|
|
|
140
140
|
"types": "./spx-tabs/index.d.ts",
|
|
141
141
|
"default": "./fesm2022/softpak-components-spx-tabs.mjs"
|
|
142
142
|
},
|
|
143
|
-
"./spx-toggle": {
|
|
144
|
-
"types": "./spx-toggle/index.d.ts",
|
|
145
|
-
"default": "./fesm2022/softpak-components-spx-toggle.mjs"
|
|
146
|
-
},
|
|
147
143
|
"./spx-translate": {
|
|
148
144
|
"types": "./spx-translate/index.d.ts",
|
|
149
145
|
"default": "./fesm2022/softpak-components-spx-translate.mjs"
|
|
150
146
|
},
|
|
151
|
-
"./spx-
|
|
152
|
-
"types": "./spx-
|
|
153
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
147
|
+
"./spx-toggle": {
|
|
148
|
+
"types": "./spx-toggle/index.d.ts",
|
|
149
|
+
"default": "./fesm2022/softpak-components-spx-toggle.mjs"
|
|
154
150
|
},
|
|
155
151
|
"./spx-toaster": {
|
|
156
152
|
"types": "./spx-toaster/index.d.ts",
|
|
157
153
|
"default": "./fesm2022/softpak-components-spx-toaster.mjs"
|
|
158
154
|
},
|
|
159
|
-
"./spx-
|
|
160
|
-
"types": "./spx-
|
|
161
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
155
|
+
"./spx-update": {
|
|
156
|
+
"types": "./spx-update/index.d.ts",
|
|
157
|
+
"default": "./fesm2022/softpak-components-spx-update.mjs"
|
|
162
158
|
},
|
|
163
159
|
"./spx-validation-messages": {
|
|
164
160
|
"types": "./spx-validation-messages/index.d.ts",
|
|
@@ -167,6 +163,10 @@
|
|
|
167
163
|
"./spx-welcome": {
|
|
168
164
|
"types": "./spx-welcome/index.d.ts",
|
|
169
165
|
"default": "./fesm2022/softpak-components-spx-welcome.mjs"
|
|
166
|
+
},
|
|
167
|
+
"./spx-validation": {
|
|
168
|
+
"types": "./spx-validation/index.d.ts",
|
|
169
|
+
"default": "./fesm2022/softpak-components-spx-validation.mjs"
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}
|
package/spx-redux/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare const spxCreateApiActions: <TQuery, TResult, TMsg = string>() => {
|
|
|
14
14
|
result: TResult;
|
|
15
15
|
}>;
|
|
16
16
|
Reset: _ngrx_store.ActionCreatorProps<void>;
|
|
17
|
+
NoResults: _ngrx_store.ActionCreatorProps<void>;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
interface SpxState<TQuery, TData, TError> {
|
|
@@ -21,6 +22,7 @@ interface SpxState<TQuery, TData, TError> {
|
|
|
21
22
|
error: TError | null;
|
|
22
23
|
loading: boolean;
|
|
23
24
|
loaded: boolean;
|
|
25
|
+
noResults: boolean;
|
|
24
26
|
queryNext: TQuery | null;
|
|
25
27
|
query: TQuery | null;
|
|
26
28
|
}
|
|
@@ -32,6 +34,7 @@ interface SpxApiActions<TQuery, TData, TError> {
|
|
|
32
34
|
load: WithProps<{
|
|
33
35
|
query: TQuery;
|
|
34
36
|
}>;
|
|
37
|
+
noResults: WithoutProps;
|
|
35
38
|
received: WithProps<{
|
|
36
39
|
result: TData;
|
|
37
40
|
}>;
|