@stenajs-webui/redux 17.13.2 → 17.13.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.es.js +423 -468
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,476 +1,421 @@
|
|
|
1
|
-
(function(){ try
|
|
2
|
-
|
|
1
|
+
(function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e)}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
const C = (e) => (t = {}, r) => {
|
|
3
|
+
switch (r.type) {
|
|
3
4
|
case "RECORD_OBJECT:CLEAR_RECORD": {
|
|
4
|
-
const { recordId } =
|
|
5
|
-
|
|
6
|
-
delete newState[recordId];
|
|
7
|
-
return newState;
|
|
5
|
+
const { recordId: E } = r, T = { ...t };
|
|
6
|
+
return delete T[E], T;
|
|
8
7
|
}
|
|
9
|
-
case "RECORD_OBJECT:CLEAR_ALL_RECORDS":
|
|
8
|
+
case "RECORD_OBJECT:CLEAR_ALL_RECORDS":
|
|
10
9
|
return {};
|
|
11
|
-
}
|
|
12
10
|
case "RECORD_OBJECT:ACTION": {
|
|
13
|
-
const { recordId, action:
|
|
11
|
+
const { recordId: E, action: T } = r;
|
|
14
12
|
return {
|
|
15
|
-
...
|
|
16
|
-
[
|
|
13
|
+
...t,
|
|
14
|
+
[E]: e(t[E], T)
|
|
17
15
|
};
|
|
18
16
|
}
|
|
19
17
|
default:
|
|
20
|
-
return
|
|
18
|
+
return t;
|
|
21
19
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
recordAction: (recordId, action) => ({
|
|
20
|
+
}, p = () => ({
|
|
21
|
+
recordAction: (e, t) => ({
|
|
25
22
|
type: "RECORD_OBJECT:ACTION",
|
|
26
|
-
action,
|
|
27
|
-
recordId
|
|
23
|
+
action: t,
|
|
24
|
+
recordId: e
|
|
28
25
|
}),
|
|
29
|
-
clearRecord: (
|
|
26
|
+
clearRecord: (e) => ({
|
|
30
27
|
type: "RECORD_OBJECT:CLEAR_RECORD",
|
|
31
|
-
recordId
|
|
28
|
+
recordId: e
|
|
32
29
|
}),
|
|
33
30
|
clearAllRecords: () => ({
|
|
34
31
|
type: "RECORD_OBJECT:CLEAR_ALL_RECORDS"
|
|
35
32
|
})
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return newState;
|
|
41
|
-
}
|
|
42
|
-
if (reducerId !== action.reducerId || action.type !== "REDUCER_ID_GATE:ACTION") {
|
|
43
|
-
return newState;
|
|
44
|
-
}
|
|
45
|
-
return reducer(newState, action.action);
|
|
46
|
-
};
|
|
47
|
-
const reducerIdGateAction = (reducerId, action) => ({
|
|
33
|
+
}), B = (e, t) => (r, E) => {
|
|
34
|
+
let T = r == null ? t(void 0, {}) : r;
|
|
35
|
+
return !d(E) || e !== E.reducerId || E.type !== "REDUCER_ID_GATE:ACTION" ? T : t(T, E.action);
|
|
36
|
+
}, f = (e, t) => ({
|
|
48
37
|
type: "REDUCER_ID_GATE:ACTION",
|
|
49
|
-
action,
|
|
50
|
-
reducerId
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const actionCreator = actionCreators[key];
|
|
64
|
-
boundActionCreators[key] = wrapActionWithReducerIdGate(reducerId, actionCreator);
|
|
65
|
-
}
|
|
66
|
-
return boundActionCreators;
|
|
67
|
-
};
|
|
68
|
-
const createCommitReducerActions = (id) => {
|
|
69
|
-
return {
|
|
70
|
-
setValues: (values) => ({
|
|
71
|
-
type: "COMMIT_REDUCER.SET_VALUES",
|
|
72
|
-
id,
|
|
73
|
-
values
|
|
74
|
-
}),
|
|
75
|
-
commitValues: () => ({
|
|
76
|
-
type: "COMMIT_REDUCER.COMMIT_VALUES",
|
|
77
|
-
id
|
|
78
|
-
}),
|
|
79
|
-
clearValues: () => ({
|
|
80
|
-
type: "COMMIT_REDUCER.CLEAR",
|
|
81
|
-
id
|
|
82
|
-
})
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
const createCommitReducer = (id, initialState) => (state = initialState, action) => {
|
|
86
|
-
if (action.id !== id) {
|
|
87
|
-
return state;
|
|
38
|
+
action: t,
|
|
39
|
+
reducerId: e
|
|
40
|
+
}), d = (e) => !!e.action && e.type === "REDUCER_ID_GATE:ACTION" && typeof e.reducerId == "string", i = (e, t) => (...r) => ({
|
|
41
|
+
type: "REDUCER_ID_GATE:ACTION",
|
|
42
|
+
reducerId: e,
|
|
43
|
+
action: t(...r)
|
|
44
|
+
}), V = (e, t) => {
|
|
45
|
+
const r = {};
|
|
46
|
+
for (const E in t) {
|
|
47
|
+
const T = t[E];
|
|
48
|
+
r[E] = i(
|
|
49
|
+
e,
|
|
50
|
+
T
|
|
51
|
+
);
|
|
88
52
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
53
|
+
return r;
|
|
54
|
+
}, M = (e) => ({
|
|
55
|
+
setValues: (t) => ({
|
|
56
|
+
type: "COMMIT_REDUCER.SET_VALUES",
|
|
57
|
+
id: e,
|
|
58
|
+
values: t
|
|
59
|
+
}),
|
|
60
|
+
commitValues: () => ({
|
|
61
|
+
type: "COMMIT_REDUCER.COMMIT_VALUES",
|
|
62
|
+
id: e
|
|
63
|
+
}),
|
|
64
|
+
clearValues: () => ({
|
|
65
|
+
type: "COMMIT_REDUCER.CLEAR",
|
|
66
|
+
id: e
|
|
67
|
+
})
|
|
68
|
+
}), w = (e, t) => (r = t, E) => {
|
|
69
|
+
if (E.id !== e)
|
|
70
|
+
return r;
|
|
71
|
+
switch (E.type) {
|
|
72
|
+
case "COMMIT_REDUCER.SET_VALUES": {
|
|
73
|
+
const { values: T } = E;
|
|
92
74
|
return {
|
|
93
|
-
...
|
|
75
|
+
...r,
|
|
94
76
|
workspace: {
|
|
95
|
-
...
|
|
96
|
-
...
|
|
77
|
+
...r.workspace,
|
|
78
|
+
...T
|
|
97
79
|
}
|
|
98
80
|
};
|
|
99
81
|
}
|
|
100
|
-
case
|
|
82
|
+
case "COMMIT_REDUCER.CLEAR":
|
|
101
83
|
return {
|
|
102
|
-
...
|
|
84
|
+
...r,
|
|
103
85
|
workspace: {
|
|
104
|
-
...
|
|
86
|
+
...t.workspace
|
|
105
87
|
}
|
|
106
88
|
};
|
|
107
|
-
|
|
108
|
-
case `COMMIT_REDUCER.COMMIT_VALUES`: {
|
|
89
|
+
case "COMMIT_REDUCER.COMMIT_VALUES":
|
|
109
90
|
return {
|
|
110
|
-
...
|
|
91
|
+
...r,
|
|
111
92
|
committed: {
|
|
112
|
-
...
|
|
93
|
+
...r.workspace
|
|
113
94
|
}
|
|
114
95
|
};
|
|
115
|
-
}
|
|
116
96
|
default:
|
|
117
|
-
return
|
|
97
|
+
return r;
|
|
118
98
|
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const keys = Object.keys(fields);
|
|
165
|
-
if (keys.length === 0) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
for (let i = 0; i < keys.length; i++) {
|
|
169
|
-
const key = keys[i];
|
|
170
|
-
if (entity[key] !== fields[key]) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
99
|
+
}, h = (e, t) => ({
|
|
100
|
+
getWorkspaceValues: (r) => t(r, e).workspace,
|
|
101
|
+
getCommittedValues: (r) => t(r, e).committed
|
|
102
|
+
}), U = () => ({
|
|
103
|
+
addAtEnd: (e) => ({ type: "ENTITY_LIST:ADD_AT_END", entity: e }),
|
|
104
|
+
addAtStart: (e) => ({
|
|
105
|
+
entity: e,
|
|
106
|
+
type: "ENTITY_LIST:ADD_AT_START"
|
|
107
|
+
}),
|
|
108
|
+
clearList: () => ({ type: "ENTITY_LIST:CLEAR_LIST" }),
|
|
109
|
+
removeFirst: () => ({ type: "ENTITY_LIST:REMOVE_FIRST" }),
|
|
110
|
+
removeLast: () => ({ type: "ENTITY_LIST:REMOVE_LAST" }),
|
|
111
|
+
removeAtIndex: (e) => ({
|
|
112
|
+
type: "ENTITY_LIST:REMOVE_AT_INDEX",
|
|
113
|
+
index: e
|
|
114
|
+
}),
|
|
115
|
+
removeByFieldMatch: (e) => ({
|
|
116
|
+
type: "ENTITY_LIST:REMOVE_BY_FIELD_MATCH",
|
|
117
|
+
fields: e
|
|
118
|
+
}),
|
|
119
|
+
remove: (e) => ({ type: "ENTITY_LIST:REMOVE", entity: e }),
|
|
120
|
+
setList: (e) => ({ type: "ENTITY_LIST:SET_LIST", list: e }),
|
|
121
|
+
toggle: (e) => ({ type: "ENTITY_LIST:TOGGLE", entity: e }),
|
|
122
|
+
actionByFieldsMatch: (e, t) => ({
|
|
123
|
+
type: "ENTITY_LIST:ACTION_BY_FIELDS_MATCH",
|
|
124
|
+
fields: e,
|
|
125
|
+
action: t
|
|
126
|
+
}),
|
|
127
|
+
actionByIndex: (e, t) => ({
|
|
128
|
+
type: "ENTITY_LIST:ACTION_BY_INDEX",
|
|
129
|
+
index: e,
|
|
130
|
+
action: t
|
|
131
|
+
}),
|
|
132
|
+
actionOnAll: (e) => ({
|
|
133
|
+
type: "ENTITY_LIST:ACTION_ON_ALL",
|
|
134
|
+
action: e
|
|
135
|
+
})
|
|
136
|
+
}), c = (e, t) => {
|
|
137
|
+
const r = Object.keys(t);
|
|
138
|
+
if (r.length === 0)
|
|
139
|
+
return !1;
|
|
140
|
+
for (let E = 0; E < r.length; E++) {
|
|
141
|
+
const T = r[E];
|
|
142
|
+
if (e[T] !== t[T])
|
|
143
|
+
return !1;
|
|
173
144
|
}
|
|
174
|
-
return
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
switch (action.type) {
|
|
145
|
+
return !0;
|
|
146
|
+
}, m = (e) => (t = [], r) => {
|
|
147
|
+
switch (r.type) {
|
|
178
148
|
case "ENTITY_LIST:SET_LIST": {
|
|
179
|
-
const { list } =
|
|
180
|
-
return
|
|
149
|
+
const { list: E } = r;
|
|
150
|
+
return E;
|
|
181
151
|
}
|
|
182
|
-
case "ENTITY_LIST:CLEAR_LIST":
|
|
152
|
+
case "ENTITY_LIST:CLEAR_LIST":
|
|
183
153
|
return [];
|
|
184
|
-
}
|
|
185
154
|
case "ENTITY_LIST:ADD_AT_END": {
|
|
186
|
-
const { entity } =
|
|
187
|
-
return [...
|
|
155
|
+
const { entity: E } = r;
|
|
156
|
+
return [...t, E];
|
|
188
157
|
}
|
|
189
158
|
case "ENTITY_LIST:ADD_AT_START": {
|
|
190
|
-
const { entity } =
|
|
191
|
-
return [
|
|
159
|
+
const { entity: E } = r;
|
|
160
|
+
return [E, ...t];
|
|
192
161
|
}
|
|
193
162
|
case "ENTITY_LIST:REMOVE_FIRST": {
|
|
194
|
-
if (
|
|
163
|
+
if (t.length === 0)
|
|
195
164
|
throw new Error("Cannot remove, list is empty.");
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return list;
|
|
165
|
+
const [, ...E] = t;
|
|
166
|
+
return E;
|
|
199
167
|
}
|
|
200
168
|
case "ENTITY_LIST:REMOVE_LAST": {
|
|
201
|
-
if (
|
|
169
|
+
if (t.length === 0)
|
|
202
170
|
throw new Error("Cannot remove, list is empty.");
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
list.pop();
|
|
206
|
-
return list;
|
|
171
|
+
const E = [...t];
|
|
172
|
+
return E.pop(), E;
|
|
207
173
|
}
|
|
208
174
|
case "ENTITY_LIST:REMOVE_AT_INDEX": {
|
|
209
|
-
const { index } =
|
|
210
|
-
if (
|
|
175
|
+
const { index: E } = r;
|
|
176
|
+
if (E < 0)
|
|
211
177
|
throw new Error("Index is lower than 0.");
|
|
212
|
-
|
|
213
|
-
if (index >= state.length) {
|
|
178
|
+
if (E >= t.length)
|
|
214
179
|
throw new Error("Index is outside of list bounds.");
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
list.splice(index, 1);
|
|
218
|
-
return list;
|
|
180
|
+
const T = [...t];
|
|
181
|
+
return T.splice(E, 1), T;
|
|
219
182
|
}
|
|
220
183
|
case "ENTITY_LIST:REMOVE_BY_FIELD_MATCH": {
|
|
221
|
-
const { fields } =
|
|
222
|
-
return
|
|
184
|
+
const { fields: E } = r;
|
|
185
|
+
return t.filter((T) => !c(T, E));
|
|
223
186
|
}
|
|
224
187
|
case "ENTITY_LIST:REMOVE": {
|
|
225
|
-
const { entity } =
|
|
226
|
-
return
|
|
188
|
+
const { entity: E } = r;
|
|
189
|
+
return t.filter((T) => T !== E);
|
|
227
190
|
}
|
|
228
191
|
case "ENTITY_LIST:TOGGLE": {
|
|
229
|
-
const { entity } =
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return
|
|
235
|
-
} else
|
|
236
|
-
return [...
|
|
237
|
-
}
|
|
192
|
+
const { entity: E } = r, T = t.findIndex(
|
|
193
|
+
(n) => n === E || c(n, E)
|
|
194
|
+
);
|
|
195
|
+
if (T >= 0) {
|
|
196
|
+
const n = [...t];
|
|
197
|
+
return n.splice(T, T), n;
|
|
198
|
+
} else
|
|
199
|
+
return [...t, E];
|
|
238
200
|
}
|
|
239
201
|
case "ENTITY_LIST:ACTION_BY_FIELDS_MATCH": {
|
|
240
|
-
const { fields, action:
|
|
241
|
-
if (!
|
|
242
|
-
throw new Error(
|
|
243
|
-
|
|
244
|
-
|
|
202
|
+
const { fields: E, action: T } = r;
|
|
203
|
+
if (!e)
|
|
204
|
+
throw new Error(
|
|
205
|
+
"No reducer specified, unable to handle 'actionByFieldsMatch'."
|
|
206
|
+
);
|
|
207
|
+
return t.map(
|
|
208
|
+
(n) => c(n, E) ? e(n, T) : n
|
|
209
|
+
);
|
|
245
210
|
}
|
|
246
211
|
case "ENTITY_LIST:ACTION_BY_INDEX": {
|
|
247
|
-
const { index, action:
|
|
248
|
-
if (!
|
|
249
|
-
throw new Error(
|
|
250
|
-
|
|
251
|
-
|
|
212
|
+
const { index: E, action: T } = r;
|
|
213
|
+
if (!e)
|
|
214
|
+
throw new Error(
|
|
215
|
+
"No reducer specified, unable to handle 'actionByIndex'."
|
|
216
|
+
);
|
|
217
|
+
return t.map(
|
|
218
|
+
(n, o) => E === o ? e(n, T) : n
|
|
219
|
+
);
|
|
252
220
|
}
|
|
253
221
|
case "ENTITY_LIST:ACTION_ON_ALL": {
|
|
254
|
-
const { action:
|
|
255
|
-
if (!
|
|
256
|
-
throw new Error(
|
|
257
|
-
|
|
258
|
-
|
|
222
|
+
const { action: E } = r;
|
|
223
|
+
if (!e)
|
|
224
|
+
throw new Error(
|
|
225
|
+
"No reducer specified, unable to handle 'actionByIndex'."
|
|
226
|
+
);
|
|
227
|
+
return t.map((T) => e(T, E));
|
|
259
228
|
}
|
|
260
229
|
default:
|
|
261
|
-
return
|
|
230
|
+
return t;
|
|
262
231
|
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
...state.entities,
|
|
287
|
-
[id]: {
|
|
288
|
-
...state.entities[id],
|
|
289
|
-
...fields
|
|
290
|
-
}
|
|
232
|
+
}, v = (e) => ({
|
|
233
|
+
getList: (t) => e(t)
|
|
234
|
+
}), S = { entities: {} }, I = () => (e = S, t) => {
|
|
235
|
+
switch (t.type) {
|
|
236
|
+
case "ENTITY_BY_ID:SET_ENTITY": {
|
|
237
|
+
const { entity: r } = t;
|
|
238
|
+
return {
|
|
239
|
+
...e,
|
|
240
|
+
entities: {
|
|
241
|
+
...e.entities,
|
|
242
|
+
[r.id]: r
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
case "ENTITY_BY_ID:SET_ENTITY_FIELDS": {
|
|
247
|
+
const { id: r, fields: E } = t;
|
|
248
|
+
return {
|
|
249
|
+
...e,
|
|
250
|
+
entities: {
|
|
251
|
+
...e.entities,
|
|
252
|
+
[r]: {
|
|
253
|
+
...e.entities[r],
|
|
254
|
+
...E
|
|
291
255
|
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
case "ENTITY_BY_ID:CLEAR_ALL_ENTITIES": {
|
|
295
|
-
return {
|
|
296
|
-
...state,
|
|
297
|
-
entities: {}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
case "ENTITY_BY_ID:CLEAR_ENTITY": {
|
|
301
|
-
const { id } = action;
|
|
302
|
-
const entities = {
|
|
303
|
-
...state.entities
|
|
304
|
-
};
|
|
305
|
-
delete entities[id];
|
|
306
|
-
return {
|
|
307
|
-
...state,
|
|
308
|
-
entities
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
default:
|
|
312
|
-
return state;
|
|
256
|
+
}
|
|
257
|
+
};
|
|
313
258
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
259
|
+
case "ENTITY_BY_ID:CLEAR_ALL_ENTITIES":
|
|
260
|
+
return {
|
|
261
|
+
...e,
|
|
262
|
+
entities: {}
|
|
263
|
+
};
|
|
264
|
+
case "ENTITY_BY_ID:CLEAR_ENTITY": {
|
|
265
|
+
const { id: r } = t, E = {
|
|
266
|
+
...e.entities
|
|
267
|
+
};
|
|
268
|
+
return delete E[r], {
|
|
269
|
+
...e,
|
|
270
|
+
entities: E
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
default:
|
|
274
|
+
return e;
|
|
275
|
+
}
|
|
276
|
+
}, s = () => ({
|
|
277
|
+
setEntity: (e) => ({
|
|
318
278
|
type: "ENTITY_BY_ID:SET_ENTITY",
|
|
319
|
-
entity
|
|
279
|
+
entity: e
|
|
320
280
|
}),
|
|
321
|
-
setEntityFields: (
|
|
281
|
+
setEntityFields: (e, t) => ({
|
|
322
282
|
type: "ENTITY_BY_ID:SET_ENTITY_FIELDS",
|
|
323
|
-
id,
|
|
324
|
-
fields
|
|
283
|
+
id: e,
|
|
284
|
+
fields: t
|
|
325
285
|
}),
|
|
326
|
-
clearEntity: (
|
|
286
|
+
clearEntity: (e) => ({
|
|
327
287
|
type: "ENTITY_BY_ID:CLEAR_ENTITY",
|
|
328
|
-
id
|
|
288
|
+
id: e
|
|
329
289
|
}),
|
|
330
290
|
clearAllEntities: () => ({
|
|
331
291
|
type: "ENTITY_BY_ID:CLEAR_ALL_ENTITIES"
|
|
332
292
|
})
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return (state = INITIAL_STATE2, action) => {
|
|
340
|
-
switch (action.type) {
|
|
293
|
+
}), _ = (e) => ({
|
|
294
|
+
getState: e
|
|
295
|
+
}), b = (e) => {
|
|
296
|
+
const t = e;
|
|
297
|
+
return (r = t, E) => {
|
|
298
|
+
switch (E.type) {
|
|
341
299
|
case "ENTITY:SET_ENTITY": {
|
|
342
|
-
const { entity } =
|
|
343
|
-
return
|
|
300
|
+
const { entity: T } = E;
|
|
301
|
+
return T;
|
|
344
302
|
}
|
|
345
303
|
case "ENTITY:SET_ENTITY_FIELDS": {
|
|
346
|
-
const { fields } =
|
|
304
|
+
const { fields: T } = E;
|
|
347
305
|
return {
|
|
348
|
-
...
|
|
349
|
-
...
|
|
306
|
+
...r,
|
|
307
|
+
...T
|
|
350
308
|
};
|
|
351
309
|
}
|
|
352
310
|
default:
|
|
353
|
-
return
|
|
311
|
+
return r;
|
|
354
312
|
}
|
|
355
313
|
};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
setEntity: (entity) => ({
|
|
314
|
+
}, F = () => ({
|
|
315
|
+
setEntity: (e) => ({
|
|
359
316
|
type: "ENTITY:SET_ENTITY",
|
|
360
|
-
entity
|
|
317
|
+
entity: e
|
|
361
318
|
}),
|
|
362
|
-
setEntityFields: (
|
|
319
|
+
setEntityFields: (e) => ({
|
|
363
320
|
type: "ENTITY:SET_ENTITY_FIELDS",
|
|
364
|
-
fields
|
|
321
|
+
fields: e
|
|
365
322
|
})
|
|
366
|
-
})
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const createEntityCrudStatusReducer = () => createEntityByIdReducer();
|
|
371
|
-
const createEntityCrudStatusActions = () => createEntityByIdActions();
|
|
372
|
-
const createEntityCrudStatusSelectors = (stateSelector) => createEntityByIdSelectors(stateSelector);
|
|
373
|
-
const createEntityCrudStatusRedux = (stateSelector) => {
|
|
374
|
-
const reducer = createEntityCrudStatusReducer();
|
|
375
|
-
const actions = createEntityCrudStatusActions();
|
|
376
|
-
const selectors = createEntityCrudStatusSelectors(stateSelector);
|
|
323
|
+
}), g = (e) => ({
|
|
324
|
+
getEntity: (t) => e(t)
|
|
325
|
+
}), R = () => I(), u = () => s(), A = (e) => _(e), x = (e) => {
|
|
326
|
+
const t = R(), r = u(), E = A(e);
|
|
377
327
|
return {
|
|
378
|
-
reducer,
|
|
379
|
-
actions,
|
|
380
|
-
selectors
|
|
328
|
+
reducer: t,
|
|
329
|
+
actions: r,
|
|
330
|
+
selectors: E
|
|
381
331
|
};
|
|
382
|
-
}
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
const actions = createEntityByIdActions();
|
|
332
|
+
}, G = (e) => {
|
|
333
|
+
const t = I(), r = _(
|
|
334
|
+
e
|
|
335
|
+
), E = s();
|
|
387
336
|
return {
|
|
388
|
-
reducer,
|
|
389
|
-
selectors,
|
|
390
|
-
actions
|
|
337
|
+
reducer: t,
|
|
338
|
+
selectors: r,
|
|
339
|
+
actions: E
|
|
391
340
|
};
|
|
392
|
-
}
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
persisted: initialEntity
|
|
341
|
+
}, k = (e, t) => {
|
|
342
|
+
const r = {
|
|
343
|
+
id: t,
|
|
344
|
+
editable: e,
|
|
345
|
+
persisted: e
|
|
398
346
|
};
|
|
399
|
-
return (
|
|
400
|
-
switch (
|
|
347
|
+
return (E = r, T) => {
|
|
348
|
+
switch (T.type) {
|
|
401
349
|
case "EDITABLE_ENTITY:SET_ENTITY_ID": {
|
|
402
|
-
const { id } =
|
|
350
|
+
const { id: n } = T;
|
|
403
351
|
return {
|
|
404
|
-
...
|
|
405
|
-
id
|
|
352
|
+
...E,
|
|
353
|
+
id: n
|
|
406
354
|
};
|
|
407
355
|
}
|
|
408
356
|
case "EDITABLE_ENTITY:SET_ENTITY": {
|
|
409
|
-
const { entity } =
|
|
357
|
+
const { entity: n } = T;
|
|
410
358
|
return {
|
|
411
|
-
...
|
|
412
|
-
persisted:
|
|
413
|
-
editable:
|
|
359
|
+
...E,
|
|
360
|
+
persisted: n,
|
|
361
|
+
editable: n
|
|
414
362
|
};
|
|
415
363
|
}
|
|
416
364
|
case "EDITABLE_ENTITY:SET_PERSISTED_ENTITY": {
|
|
417
|
-
const { entity } =
|
|
365
|
+
const { entity: n } = T;
|
|
418
366
|
return {
|
|
419
|
-
...
|
|
420
|
-
persisted:
|
|
367
|
+
...E,
|
|
368
|
+
persisted: n
|
|
421
369
|
};
|
|
422
370
|
}
|
|
423
371
|
case "EDITABLE_ENTITY:SET_EDITABLE_ENTITY": {
|
|
424
|
-
const { entity } =
|
|
372
|
+
const { entity: n } = T;
|
|
425
373
|
return {
|
|
426
|
-
...
|
|
427
|
-
editable:
|
|
374
|
+
...E,
|
|
375
|
+
editable: n
|
|
428
376
|
};
|
|
429
377
|
}
|
|
430
378
|
case "EDITABLE_ENTITY:SET_EDITABLE_ENTITY_FIELDS": {
|
|
431
|
-
const { fields } =
|
|
379
|
+
const { fields: n } = T;
|
|
432
380
|
return {
|
|
433
|
-
...
|
|
381
|
+
...E,
|
|
434
382
|
editable: {
|
|
435
|
-
...
|
|
436
|
-
...
|
|
383
|
+
...E.editable,
|
|
384
|
+
...n
|
|
437
385
|
}
|
|
438
386
|
};
|
|
439
387
|
}
|
|
440
|
-
case "EDITABLE_ENTITY:REVERT_EDITABLE_ENTITY":
|
|
388
|
+
case "EDITABLE_ENTITY:REVERT_EDITABLE_ENTITY":
|
|
441
389
|
return {
|
|
442
|
-
...
|
|
443
|
-
editable:
|
|
390
|
+
...E,
|
|
391
|
+
editable: E.persisted
|
|
444
392
|
};
|
|
445
|
-
|
|
446
|
-
case "EDITABLE_ENTITY:COMMIT_EDITABLE_ENTITY_TO_PERSISTED": {
|
|
393
|
+
case "EDITABLE_ENTITY:COMMIT_EDITABLE_ENTITY_TO_PERSISTED":
|
|
447
394
|
return {
|
|
448
|
-
...
|
|
449
|
-
persisted:
|
|
395
|
+
...E,
|
|
396
|
+
persisted: E.editable
|
|
450
397
|
};
|
|
451
|
-
}
|
|
452
398
|
default:
|
|
453
|
-
return
|
|
399
|
+
return E;
|
|
454
400
|
}
|
|
455
401
|
};
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
setEntityId: (id) => ({
|
|
402
|
+
}, J = () => ({
|
|
403
|
+
setEntityId: (e) => ({
|
|
459
404
|
type: "EDITABLE_ENTITY:SET_ENTITY_ID",
|
|
460
|
-
id
|
|
405
|
+
id: e
|
|
461
406
|
}),
|
|
462
|
-
setEntity: (
|
|
463
|
-
setPersistedEntity: (
|
|
407
|
+
setEntity: (e) => ({ type: "EDITABLE_ENTITY:SET_ENTITY", entity: e }),
|
|
408
|
+
setPersistedEntity: (e) => ({
|
|
464
409
|
type: "EDITABLE_ENTITY:SET_PERSISTED_ENTITY",
|
|
465
|
-
entity
|
|
410
|
+
entity: e
|
|
466
411
|
}),
|
|
467
|
-
setEditableEntity: (
|
|
412
|
+
setEditableEntity: (e) => ({
|
|
468
413
|
type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY",
|
|
469
|
-
entity
|
|
414
|
+
entity: e
|
|
470
415
|
}),
|
|
471
|
-
setEditableEntityFields: (
|
|
416
|
+
setEditableEntityFields: (e) => ({
|
|
472
417
|
type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY_FIELDS",
|
|
473
|
-
fields
|
|
418
|
+
fields: e
|
|
474
419
|
}),
|
|
475
420
|
revertEditableEntity: () => ({
|
|
476
421
|
type: "EDITABLE_ENTITY:REVERT_EDITABLE_ENTITY"
|
|
@@ -478,176 +423,186 @@ const createEditableEntityActions = () => ({
|
|
|
478
423
|
commitEditableEntityToPersisted: () => ({
|
|
479
424
|
type: "EDITABLE_ENTITY:COMMIT_EDITABLE_ENTITY_TO_PERSISTED"
|
|
480
425
|
})
|
|
481
|
-
})
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
const INITIAL_STATE$1 = createSelectedIdsReducerInitialState();
|
|
486
|
-
const createSelectedIdsReducer = (initialState = INITIAL_STATE$1) => (state = initialState, action) => {
|
|
487
|
-
switch (action.type) {
|
|
426
|
+
}), L = (e = []) => ({
|
|
427
|
+
selectedIds: e
|
|
428
|
+
}), l = L(), D = (e = l) => (t = e, r) => {
|
|
429
|
+
switch (r.type) {
|
|
488
430
|
case "SELECTED_IDS:SET_SELECTED_IDS": {
|
|
489
|
-
const { selectedIds } =
|
|
431
|
+
const { selectedIds: E } = r;
|
|
490
432
|
return {
|
|
491
|
-
...
|
|
492
|
-
selectedIds
|
|
433
|
+
...t,
|
|
434
|
+
selectedIds: E
|
|
493
435
|
};
|
|
494
436
|
}
|
|
495
|
-
case "SELECTED_IDS:CLEAR_SELECTED_IDS":
|
|
437
|
+
case "SELECTED_IDS:CLEAR_SELECTED_IDS":
|
|
496
438
|
return {
|
|
497
|
-
...
|
|
439
|
+
...t,
|
|
498
440
|
selectedIds: []
|
|
499
441
|
};
|
|
500
|
-
}
|
|
501
442
|
default:
|
|
502
|
-
return
|
|
443
|
+
return t;
|
|
503
444
|
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
setSelectedIds: (selectedIds) => ({
|
|
508
|
-
selectedIds,
|
|
445
|
+
}, P = D(), y = () => ({
|
|
446
|
+
setSelectedIds: (e) => ({
|
|
447
|
+
selectedIds: e,
|
|
509
448
|
type: "SELECTED_IDS:SET_SELECTED_IDS"
|
|
510
449
|
}),
|
|
511
450
|
clearSelectedIds: () => ({
|
|
512
451
|
type: "SELECTED_IDS:CLEAR_SELECTED_IDS"
|
|
513
452
|
})
|
|
514
|
-
})
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
getState: stateSelector
|
|
518
|
-
});
|
|
519
|
-
const INITIAL_STATE = {
|
|
453
|
+
}), H = y(), X = (e) => ({
|
|
454
|
+
getState: e
|
|
455
|
+
}), a = {
|
|
520
456
|
ids: void 0
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
switch (action.type) {
|
|
457
|
+
}, N = () => (e = a, t) => {
|
|
458
|
+
switch (t.type) {
|
|
524
459
|
case "SORT_ORDER_BY_ID:SET_SORT_ORDER":
|
|
525
460
|
return {
|
|
526
|
-
...
|
|
527
|
-
ids:
|
|
461
|
+
...e,
|
|
462
|
+
ids: t.ids
|
|
528
463
|
};
|
|
529
464
|
case "SORT_ORDER_BY_ID:CLEAR_SORT_ORDER":
|
|
530
465
|
return {
|
|
531
|
-
...
|
|
466
|
+
...e,
|
|
532
467
|
ids: void 0
|
|
533
468
|
};
|
|
534
469
|
default:
|
|
535
|
-
return
|
|
470
|
+
return e;
|
|
536
471
|
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
getSortOrderByIdState: (state) => {
|
|
554
|
-
return rootStateProvider(state);
|
|
555
|
-
},
|
|
556
|
-
getSortOrder: (state) => {
|
|
557
|
-
return rootStateProvider(state).ids;
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
};
|
|
561
|
-
const createSortOrderReducerInitialState = (sortBy = void 0, desc = false) => ({
|
|
562
|
-
sortBy,
|
|
563
|
-
desc
|
|
564
|
-
});
|
|
565
|
-
const createSortOrderReducer = (initialState = { sortBy: void 0, desc: false }) => (state = initialState, action) => {
|
|
566
|
-
switch (action.type) {
|
|
472
|
+
}, j = N(), O = () => ({
|
|
473
|
+
setSortOrder: (e) => ({
|
|
474
|
+
ids: e,
|
|
475
|
+
type: "SORT_ORDER_BY_ID:SET_SORT_ORDER"
|
|
476
|
+
}),
|
|
477
|
+
clearSortOrder: () => ({
|
|
478
|
+
type: "SORT_ORDER_BY_ID:CLEAR_SORT_ORDER"
|
|
479
|
+
})
|
|
480
|
+
}), W = O(), $ = (e) => ({
|
|
481
|
+
getSortOrderByIdState: (t) => e(t),
|
|
482
|
+
getSortOrder: (t) => e(t).ids
|
|
483
|
+
}), q = (e = void 0, t = !1) => ({
|
|
484
|
+
sortBy: e,
|
|
485
|
+
desc: t
|
|
486
|
+
}), z = (e = { sortBy: void 0, desc: !1 }) => (t = e, r) => {
|
|
487
|
+
switch (r.type) {
|
|
567
488
|
case "SORT_ORDER:SET_SORT_BY": {
|
|
568
|
-
const { sortBy, desc } =
|
|
489
|
+
const { sortBy: E, desc: T } = r;
|
|
569
490
|
return {
|
|
570
|
-
...
|
|
571
|
-
sortBy,
|
|
572
|
-
desc
|
|
491
|
+
...t,
|
|
492
|
+
sortBy: E,
|
|
493
|
+
desc: T
|
|
573
494
|
};
|
|
574
495
|
}
|
|
575
|
-
case "SORT_ORDER:CLEAR_SORT_ORDER":
|
|
496
|
+
case "SORT_ORDER:CLEAR_SORT_ORDER":
|
|
576
497
|
return {
|
|
577
|
-
...
|
|
498
|
+
...t,
|
|
578
499
|
sortBy: void 0,
|
|
579
|
-
desc:
|
|
500
|
+
desc: !1
|
|
580
501
|
};
|
|
581
|
-
}
|
|
582
502
|
default:
|
|
583
|
-
return
|
|
503
|
+
return t;
|
|
584
504
|
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
sortBy,
|
|
505
|
+
}, K = () => ({
|
|
506
|
+
sortBy: (e, t) => ({
|
|
507
|
+
desc: t,
|
|
508
|
+
sortBy: e,
|
|
590
509
|
type: "SORT_ORDER:SET_SORT_BY"
|
|
591
510
|
}),
|
|
592
511
|
clearSortOrder: () => ({
|
|
593
512
|
type: "SORT_ORDER:CLEAR_SORT_ORDER"
|
|
594
513
|
})
|
|
595
|
-
})
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
...state.values,
|
|
609
|
-
[id]: value
|
|
610
|
-
}
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
case "VALUE_BY_ID:CLEAR_ALL_VALUES": {
|
|
614
|
-
return {
|
|
615
|
-
...state,
|
|
616
|
-
values: {}
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
case "VALUE_BY_ID:CLEAR_VALUE": {
|
|
620
|
-
const { id } = action;
|
|
621
|
-
const values = {
|
|
622
|
-
...state.values
|
|
623
|
-
};
|
|
624
|
-
delete values[id];
|
|
625
|
-
return {
|
|
626
|
-
...state,
|
|
627
|
-
values
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
|
-
default:
|
|
631
|
-
return state;
|
|
514
|
+
}), Q = (e) => ({
|
|
515
|
+
getState: e
|
|
516
|
+
}), Y = { values: {} }, Z = (e = Y) => (t = e, r) => {
|
|
517
|
+
switch (r.type) {
|
|
518
|
+
case "VALUE_BY_ID:SET_VALUE": {
|
|
519
|
+
const { id: E, value: T } = r;
|
|
520
|
+
return {
|
|
521
|
+
...t,
|
|
522
|
+
values: {
|
|
523
|
+
...t.values,
|
|
524
|
+
[E]: T
|
|
525
|
+
}
|
|
526
|
+
};
|
|
632
527
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
528
|
+
case "VALUE_BY_ID:CLEAR_ALL_VALUES":
|
|
529
|
+
return {
|
|
530
|
+
...t,
|
|
531
|
+
values: {}
|
|
532
|
+
};
|
|
533
|
+
case "VALUE_BY_ID:CLEAR_VALUE": {
|
|
534
|
+
const { id: E } = r, T = {
|
|
535
|
+
...t.values
|
|
536
|
+
};
|
|
537
|
+
return delete T[E], {
|
|
538
|
+
...t,
|
|
539
|
+
values: T
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
default:
|
|
543
|
+
return t;
|
|
544
|
+
}
|
|
545
|
+
}, ee = () => ({
|
|
546
|
+
setValue: (e, t) => ({
|
|
637
547
|
type: "VALUE_BY_ID:SET_VALUE",
|
|
638
|
-
id,
|
|
639
|
-
value
|
|
548
|
+
id: e,
|
|
549
|
+
value: t
|
|
640
550
|
}),
|
|
641
|
-
clearValue: (
|
|
551
|
+
clearValue: (e) => ({
|
|
642
552
|
type: "VALUE_BY_ID:CLEAR_VALUE",
|
|
643
|
-
id
|
|
553
|
+
id: e
|
|
644
554
|
}),
|
|
645
555
|
clearAllValues: () => ({
|
|
646
556
|
type: "VALUE_BY_ID:CLEAR_ALL_VALUES"
|
|
647
557
|
})
|
|
558
|
+
}), te = (e) => ({
|
|
559
|
+
getState: e
|
|
648
560
|
});
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
561
|
+
export {
|
|
562
|
+
w as createCommitReducer,
|
|
563
|
+
M as createCommitReducerActions,
|
|
564
|
+
h as createCommitReducerSelectors,
|
|
565
|
+
J as createEditableEntityActions,
|
|
566
|
+
k as createEditableEntityReducer,
|
|
567
|
+
F as createEntityActions,
|
|
568
|
+
s as createEntityByIdActions,
|
|
569
|
+
I as createEntityByIdReducer,
|
|
570
|
+
_ as createEntityByIdSelectors,
|
|
571
|
+
u as createEntityCrudStatusActions,
|
|
572
|
+
R as createEntityCrudStatusReducer,
|
|
573
|
+
x as createEntityCrudStatusRedux,
|
|
574
|
+
A as createEntityCrudStatusSelectors,
|
|
575
|
+
U as createEntityListActions,
|
|
576
|
+
m as createEntityListReducer,
|
|
577
|
+
v as createEntityListSelectors,
|
|
578
|
+
b as createEntityReducer,
|
|
579
|
+
g as createEntitySelectors,
|
|
580
|
+
G as createModifiedFieldRedux,
|
|
581
|
+
p as createRecordObjectActions,
|
|
582
|
+
C as createRecordObjectReducer,
|
|
583
|
+
y as createSelectedIdsActions,
|
|
584
|
+
D as createSelectedIdsReducer,
|
|
585
|
+
L as createSelectedIdsReducerInitialState,
|
|
586
|
+
X as createSelectedIdsSelectors,
|
|
587
|
+
K as createSortOrderActions,
|
|
588
|
+
O as createSortOrderByIdActions,
|
|
589
|
+
N as createSortOrderByIdReducer,
|
|
590
|
+
$ as createSortOrderByIdSelectors,
|
|
591
|
+
z as createSortOrderReducer,
|
|
592
|
+
q as createSortOrderReducerInitialState,
|
|
593
|
+
Q as createSortOrderSelectors,
|
|
594
|
+
ee as createValueByIdActions,
|
|
595
|
+
Z as createValueByIdReducer,
|
|
596
|
+
te as createValueByIdSelectors,
|
|
597
|
+
S as entityByIdInitialState,
|
|
598
|
+
B as reducerIdGate,
|
|
599
|
+
f as reducerIdGateAction,
|
|
600
|
+
H as selectedIdsActions,
|
|
601
|
+
P as selectedIdsReducer,
|
|
602
|
+
W as sortOrderByIdActions,
|
|
603
|
+
j as sortOrderByIdReducer,
|
|
604
|
+
Y as valueByIdInitialState,
|
|
605
|
+
i as wrapActionWithReducerIdGate,
|
|
606
|
+
V as wrapActionsWithReducerIdGate
|
|
607
|
+
};
|
|
653
608
|
//# sourceMappingURL=index.es.js.map
|