@stenajs-webui/redux 17.13.0 → 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 CHANGED
@@ -1,476 +1,421 @@
1
- (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode("")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();const createRecordObjectReducer = (reducer) => (state = {}, action) => {
2
- switch (action.type) {
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 } = action;
5
- const newState = { ...state };
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: innerAction } = action;
11
+ const { recordId: E, action: T } = r;
14
12
  return {
15
- ...state,
16
- [recordId]: reducer(state[recordId], innerAction)
13
+ ...t,
14
+ [E]: e(t[E], T)
17
15
  };
18
16
  }
19
17
  default:
20
- return state;
18
+ return t;
21
19
  }
22
- };
23
- const createRecordObjectActions = () => ({
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: (recordId) => ({
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
- const reducerIdGate = (reducerId, reducer) => (state, action) => {
38
- let newState = state == null ? reducer(void 0, {}) : state;
39
- if (!isValidReducerIdGateAction(action)) {
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
- const isValidReducerIdGateAction = (action) => !!action.action && action.type === "REDUCER_ID_GATE:ACTION" && typeof action.reducerId === "string";
53
- const wrapActionWithReducerIdGate = (reducerId, actionCreator) => (...args) => {
54
- return {
55
- type: "REDUCER_ID_GATE:ACTION",
56
- reducerId,
57
- action: actionCreator(...args)
58
- };
59
- };
60
- const wrapActionsWithReducerIdGate = (reducerId, actionCreators) => {
61
- const boundActionCreators = {};
62
- for (const key in actionCreators) {
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
- switch (action.type) {
90
- case `COMMIT_REDUCER.SET_VALUES`: {
91
- const { values } = action;
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
- ...state,
75
+ ...r,
94
76
  workspace: {
95
- ...state.workspace,
96
- ...values
77
+ ...r.workspace,
78
+ ...T
97
79
  }
98
80
  };
99
81
  }
100
- case `COMMIT_REDUCER.CLEAR`: {
82
+ case "COMMIT_REDUCER.CLEAR":
101
83
  return {
102
- ...state,
84
+ ...r,
103
85
  workspace: {
104
- ...initialState.workspace
86
+ ...t.workspace
105
87
  }
106
88
  };
107
- }
108
- case `COMMIT_REDUCER.COMMIT_VALUES`: {
89
+ case "COMMIT_REDUCER.COMMIT_VALUES":
109
90
  return {
110
- ...state,
91
+ ...r,
111
92
  committed: {
112
- ...state.workspace
93
+ ...r.workspace
113
94
  }
114
95
  };
115
- }
116
96
  default:
117
- return state;
97
+ return r;
118
98
  }
119
- };
120
- const createCommitReducerSelectors = (id, stateSelector) => {
121
- return {
122
- getWorkspaceValues: (state) => stateSelector(state, id).workspace,
123
- getCommittedValues: (state) => stateSelector(state, id).committed
124
- };
125
- };
126
- const createEntityListActions = () => {
127
- return {
128
- addAtEnd: (entity) => ({ type: "ENTITY_LIST:ADD_AT_END", entity }),
129
- addAtStart: (entity) => ({
130
- entity,
131
- type: "ENTITY_LIST:ADD_AT_START"
132
- }),
133
- clearList: () => ({ type: "ENTITY_LIST:CLEAR_LIST" }),
134
- removeFirst: () => ({ type: "ENTITY_LIST:REMOVE_FIRST" }),
135
- removeLast: () => ({ type: "ENTITY_LIST:REMOVE_LAST" }),
136
- removeAtIndex: (index) => ({
137
- type: "ENTITY_LIST:REMOVE_AT_INDEX",
138
- index
139
- }),
140
- removeByFieldMatch: (fields) => ({
141
- type: "ENTITY_LIST:REMOVE_BY_FIELD_MATCH",
142
- fields
143
- }),
144
- remove: (entity) => ({ type: "ENTITY_LIST:REMOVE", entity }),
145
- setList: (list) => ({ type: "ENTITY_LIST:SET_LIST", list }),
146
- toggle: (entity) => ({ type: "ENTITY_LIST:TOGGLE", entity }),
147
- actionByFieldsMatch: (fields, action) => ({
148
- type: "ENTITY_LIST:ACTION_BY_FIELDS_MATCH",
149
- fields,
150
- action
151
- }),
152
- actionByIndex: (index, action) => ({
153
- type: "ENTITY_LIST:ACTION_BY_INDEX",
154
- index,
155
- action
156
- }),
157
- actionOnAll: (action) => ({
158
- type: "ENTITY_LIST:ACTION_ON_ALL",
159
- action
160
- })
161
- };
162
- };
163
- const fieldsMatch = (entity, fields) => {
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 true;
175
- };
176
- const createEntityListReducer = (reducer) => (state = [], action) => {
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 } = action;
180
- return list;
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 } = action;
187
- return [...state, entity];
155
+ const { entity: E } = r;
156
+ return [...t, E];
188
157
  }
189
158
  case "ENTITY_LIST:ADD_AT_START": {
190
- const { entity } = action;
191
- return [entity, ...state];
159
+ const { entity: E } = r;
160
+ return [E, ...t];
192
161
  }
193
162
  case "ENTITY_LIST:REMOVE_FIRST": {
194
- if (state.length === 0) {
163
+ if (t.length === 0)
195
164
  throw new Error("Cannot remove, list is empty.");
196
- }
197
- const [, ...list] = state;
198
- return list;
165
+ const [, ...E] = t;
166
+ return E;
199
167
  }
200
168
  case "ENTITY_LIST:REMOVE_LAST": {
201
- if (state.length === 0) {
169
+ if (t.length === 0)
202
170
  throw new Error("Cannot remove, list is empty.");
203
- }
204
- const list = [...state];
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 } = action;
210
- if (index < 0) {
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
- const list = [...state];
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 } = action;
222
- return state.filter((item) => !fieldsMatch(item, fields));
184
+ const { fields: E } = r;
185
+ return t.filter((T) => !c(T, E));
223
186
  }
224
187
  case "ENTITY_LIST:REMOVE": {
225
- const { entity } = action;
226
- return state.filter((item) => item !== entity);
188
+ const { entity: E } = r;
189
+ return t.filter((T) => T !== E);
227
190
  }
228
191
  case "ENTITY_LIST:TOGGLE": {
229
- const { entity } = action;
230
- const index = state.findIndex((item) => item === entity || fieldsMatch(item, entity));
231
- if (index >= 0) {
232
- const list = [...state];
233
- list.splice(index, index);
234
- return list;
235
- } else {
236
- return [...state, entity];
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: innerAction } = action;
241
- if (!reducer) {
242
- throw new Error("No reducer specified, unable to handle 'actionByFieldsMatch'.");
243
- }
244
- return state.map((item) => fieldsMatch(item, fields) ? reducer(item, innerAction) : item);
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: innerAction } = action;
248
- if (!reducer) {
249
- throw new Error("No reducer specified, unable to handle 'actionByIndex'.");
250
- }
251
- return state.map((item, i) => index === i ? reducer(item, innerAction) : item);
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: innerAction } = action;
255
- if (!reducer) {
256
- throw new Error("No reducer specified, unable to handle 'actionByIndex'.");
257
- }
258
- return state.map((item) => reducer(item, innerAction));
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 state;
230
+ return t;
262
231
  }
263
- };
264
- const createEntityListSelectors = (stateSelector) => ({
265
- getList: (store) => stateSelector(store)
266
- });
267
- const entityByIdInitialState = { entities: {} };
268
- const createEntityByIdReducer = () => {
269
- return (state = entityByIdInitialState, action) => {
270
- switch (action.type) {
271
- case "ENTITY_BY_ID:SET_ENTITY": {
272
- const { entity } = action;
273
- return {
274
- ...state,
275
- entities: {
276
- ...state.entities,
277
- [entity.id]: entity
278
- }
279
- };
280
- }
281
- case "ENTITY_BY_ID:SET_ENTITY_FIELDS": {
282
- const { id, fields } = action;
283
- return {
284
- ...state,
285
- entities: {
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
- const createEntityByIdActions = () => ({
317
- setEntity: (entity) => ({
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: (id, fields) => ({
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: (id) => ({
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
- const createEntityByIdSelectors = (stateSelector) => ({
335
- getState: stateSelector
336
- });
337
- const createEntityReducer = (initialEntity) => {
338
- const INITIAL_STATE2 = initialEntity;
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 } = action;
343
- return entity;
300
+ const { entity: T } = E;
301
+ return T;
344
302
  }
345
303
  case "ENTITY:SET_ENTITY_FIELDS": {
346
- const { fields } = action;
304
+ const { fields: T } = E;
347
305
  return {
348
- ...state,
349
- ...fields
306
+ ...r,
307
+ ...T
350
308
  };
351
309
  }
352
310
  default:
353
- return state;
311
+ return r;
354
312
  }
355
313
  };
356
- };
357
- const createEntityActions = () => ({
358
- setEntity: (entity) => ({
314
+ }, F = () => ({
315
+ setEntity: (e) => ({
359
316
  type: "ENTITY:SET_ENTITY",
360
- entity
317
+ entity: e
361
318
  }),
362
- setEntityFields: (fields) => ({
319
+ setEntityFields: (e) => ({
363
320
  type: "ENTITY:SET_ENTITY_FIELDS",
364
- fields
321
+ fields: e
365
322
  })
366
- });
367
- const createEntitySelectors = (stateSelector) => ({
368
- getEntity: (state) => stateSelector(state)
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 createModifiedFieldRedux = (stateSelector) => {
384
- const reducer = createEntityByIdReducer();
385
- const selectors = createEntityByIdSelectors(stateSelector);
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 createEditableEntityReducer = (initialEntity, initialId) => {
394
- const initialState = {
395
- id: initialId,
396
- editable: initialEntity,
397
- persisted: initialEntity
341
+ }, k = (e, t) => {
342
+ const r = {
343
+ id: t,
344
+ editable: e,
345
+ persisted: e
398
346
  };
399
- return (state = initialState, action) => {
400
- switch (action.type) {
347
+ return (E = r, T) => {
348
+ switch (T.type) {
401
349
  case "EDITABLE_ENTITY:SET_ENTITY_ID": {
402
- const { id } = action;
350
+ const { id: n } = T;
403
351
  return {
404
- ...state,
405
- id
352
+ ...E,
353
+ id: n
406
354
  };
407
355
  }
408
356
  case "EDITABLE_ENTITY:SET_ENTITY": {
409
- const { entity } = action;
357
+ const { entity: n } = T;
410
358
  return {
411
- ...state,
412
- persisted: entity,
413
- editable: entity
359
+ ...E,
360
+ persisted: n,
361
+ editable: n
414
362
  };
415
363
  }
416
364
  case "EDITABLE_ENTITY:SET_PERSISTED_ENTITY": {
417
- const { entity } = action;
365
+ const { entity: n } = T;
418
366
  return {
419
- ...state,
420
- persisted: entity
367
+ ...E,
368
+ persisted: n
421
369
  };
422
370
  }
423
371
  case "EDITABLE_ENTITY:SET_EDITABLE_ENTITY": {
424
- const { entity } = action;
372
+ const { entity: n } = T;
425
373
  return {
426
- ...state,
427
- editable: entity
374
+ ...E,
375
+ editable: n
428
376
  };
429
377
  }
430
378
  case "EDITABLE_ENTITY:SET_EDITABLE_ENTITY_FIELDS": {
431
- const { fields } = action;
379
+ const { fields: n } = T;
432
380
  return {
433
- ...state,
381
+ ...E,
434
382
  editable: {
435
- ...state.editable,
436
- ...fields
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
- ...state,
443
- editable: state.persisted
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
- ...state,
449
- persisted: state.editable
395
+ ...E,
396
+ persisted: E.editable
450
397
  };
451
- }
452
398
  default:
453
- return state;
399
+ return E;
454
400
  }
455
401
  };
456
- };
457
- const createEditableEntityActions = () => ({
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: (entity) => ({ type: "EDITABLE_ENTITY:SET_ENTITY", entity }),
463
- setPersistedEntity: (entity) => ({
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: (entity) => ({
412
+ setEditableEntity: (e) => ({
468
413
  type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY",
469
- entity
414
+ entity: e
470
415
  }),
471
- setEditableEntityFields: (fields) => ({
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
- const createSelectedIdsReducerInitialState = (initialSelection = []) => ({
483
- selectedIds: initialSelection
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 } = action;
431
+ const { selectedIds: E } = r;
490
432
  return {
491
- ...state,
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
- ...state,
439
+ ...t,
498
440
  selectedIds: []
499
441
  };
500
- }
501
442
  default:
502
- return state;
443
+ return t;
503
444
  }
504
- };
505
- const selectedIdsReducer = createSelectedIdsReducer();
506
- const createSelectedIdsActions = () => ({
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
- const selectedIdsActions = createSelectedIdsActions();
516
- const createSelectedIdsSelectors = (stateSelector) => ({
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
- const createSortOrderByIdReducer = () => (state = INITIAL_STATE, action) => {
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
- ...state,
527
- ids: action.ids
461
+ ...e,
462
+ ids: t.ids
528
463
  };
529
464
  case "SORT_ORDER_BY_ID:CLEAR_SORT_ORDER":
530
465
  return {
531
- ...state,
466
+ ...e,
532
467
  ids: void 0
533
468
  };
534
469
  default:
535
- return state;
470
+ return e;
536
471
  }
537
- };
538
- const sortOrderByIdReducer = createSortOrderByIdReducer();
539
- const createSortOrderByIdActions = () => {
540
- return {
541
- setSortOrder: (ids) => ({
542
- ids,
543
- type: "SORT_ORDER_BY_ID:SET_SORT_ORDER"
544
- }),
545
- clearSortOrder: () => ({
546
- type: "SORT_ORDER_BY_ID:CLEAR_SORT_ORDER"
547
- })
548
- };
549
- };
550
- const sortOrderByIdActions = createSortOrderByIdActions();
551
- const createSortOrderByIdSelectors = (rootStateProvider) => {
552
- return {
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 } = action;
489
+ const { sortBy: E, desc: T } = r;
569
490
  return {
570
- ...state,
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
- ...state,
498
+ ...t,
578
499
  sortBy: void 0,
579
- desc: false
500
+ desc: !1
580
501
  };
581
- }
582
502
  default:
583
- return state;
503
+ return t;
584
504
  }
585
- };
586
- const createSortOrderActions = () => ({
587
- sortBy: (sortBy, desc) => ({
588
- desc,
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
- const createSortOrderSelectors = (stateProvider) => ({
597
- getState: stateProvider
598
- });
599
- const valueByIdInitialState = { values: {} };
600
- const createValueByIdReducer = (initialValue = valueByIdInitialState) => {
601
- return (state = initialValue, action) => {
602
- switch (action.type) {
603
- case "VALUE_BY_ID:SET_VALUE": {
604
- const { id, value } = action;
605
- return {
606
- ...state,
607
- values: {
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
- const createValueByIdActions = () => ({
636
- setValue: (id, value) => ({
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: (id) => ({
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
- const createValueByIdSelectors = (stateSelector) => ({
650
- getState: stateSelector
651
- });
652
- export { createCommitReducer, createCommitReducerActions, createCommitReducerSelectors, createEditableEntityActions, createEditableEntityReducer, createEntityActions, createEntityByIdActions, createEntityByIdReducer, createEntityByIdSelectors, createEntityCrudStatusActions, createEntityCrudStatusReducer, createEntityCrudStatusRedux, createEntityCrudStatusSelectors, createEntityListActions, createEntityListReducer, createEntityListSelectors, createEntityReducer, createEntitySelectors, createModifiedFieldRedux, createRecordObjectActions, createRecordObjectReducer, createSelectedIdsActions, createSelectedIdsReducer, createSelectedIdsReducerInitialState, createSelectedIdsSelectors, createSortOrderActions, createSortOrderByIdActions, createSortOrderByIdReducer, createSortOrderByIdSelectors, createSortOrderReducer, createSortOrderReducerInitialState, createSortOrderSelectors, createValueByIdActions, createValueByIdReducer, createValueByIdSelectors, entityByIdInitialState, reducerIdGate, reducerIdGateAction, selectedIdsActions, selectedIdsReducer, sortOrderByIdActions, sortOrderByIdReducer, valueByIdInitialState, wrapActionWithReducerIdGate, wrapActionsWithReducerIdGate };
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