@sankhyalabs/ezui 1.2.0-beta.4 → 1.2.0-beta.7
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/cjs/{ApplicationUtils-483c0a9e.js → ApplicationUtils-2ac1b73e.js} +2 -1
- package/dist/cjs/ApplicationUtils-475b50d9.js +63 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-3bfdba4f.js +6 -0
- package/dist/cjs/dom-8ac1ad03.js +75 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +7 -6
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +4 -4
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +7 -6
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -6
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +460 -49
- package/dist/cjs/ez-grid-config.cjs.entry.js +5 -5
- package/dist/cjs/ez-grid.cjs.entry.js +1167 -985
- package/dist/cjs/ez-icon.cjs.entry.js +3 -3
- package/dist/cjs/ez-list.cjs.entry.js +3 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-popover.cjs.entry.js +5 -5
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-select-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +2 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +3 -3
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ez-view-stack.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +112 -4
- package/dist/cjs/index-0ad7c3e4.js +6 -0
- package/dist/cjs/index-2ec1da82.js +2307 -0
- package/dist/cjs/index-d9c5cb88.js +3068 -0
- package/dist/cjs/loader.cjs.js +18 -2
- package/dist/cjs/shadow-css-41d9783d.js +390 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +19 -1
- package/dist/collection/utils/ApplicationUtils.js +2 -1
- package/dist/custom-elements/index.js +3863 -968
- package/dist/esm/ApplicationUtils-30a69eb0.js +61 -0
- package/dist/esm/{ApplicationUtils-5f87ae60.js → ApplicationUtils-a4a76132.js} +2 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-20dbffa5.js +4 -0
- package/dist/esm/dom-c5ed0ba5.js +73 -0
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +2 -2
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +4 -3
- package/dist/esm/ez-date-input.entry.js +2 -2
- package/dist/esm/ez-date-time-input.entry.js +2 -2
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +426 -15
- package/dist/esm/ez-grid-config.entry.js +3 -3
- package/dist/esm/ez-grid.entry.js +1138 -956
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +3 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-select-box.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +2 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ez-view-stack.entry.js +2 -1
- package/dist/esm/ezui.js +112 -4
- package/dist/esm/index-12b43518.js +3 -0
- package/dist/esm/index-1e9d524f.js +3031 -0
- package/dist/esm/index-b96183c8.js +2295 -0
- package/dist/esm/loader.js +18 -2
- package/dist/esm/shadow-css-8c625855.js +388 -0
- package/dist/ezui/ApplicationUtils-30a69eb0.js +61 -0
- package/dist/ezui/CSSVarsUtils-499b75c2.js +53 -0
- package/dist/ezui/DialogType-72afa679.js +8 -0
- package/dist/ezui/app-globals-0f993ce5.js +3 -0
- package/dist/ezui/css-shim-20dbffa5.js +4 -0
- package/dist/ezui/dom-c5ed0ba5.js +73 -0
- package/dist/ezui/ez-actions-button.entry.js +98 -0
- package/dist/ezui/ez-application.entry.js +22 -0
- package/dist/ezui/ez-button.entry.js +73 -0
- package/dist/ezui/ez-calendar.entry.js +219 -0
- package/dist/ezui/ez-card-item.entry.js +40 -0
- package/dist/ezui/ez-check.entry.js +72 -0
- package/dist/ezui/ez-chip.entry.js +97 -0
- package/dist/ezui/ez-collapsible-box.entry.js +57 -0
- package/dist/ezui/ez-combo-box.entry.js +439 -0
- package/dist/ezui/ez-date-input.entry.js +159 -0
- package/dist/ezui/ez-date-time-input.entry.js +214 -0
- package/dist/ezui/ez-dialog.entry.js +108 -0
- package/dist/ezui/ez-filter-input.entry.js +75 -0
- package/dist/ezui/ez-form.entry.js +1395 -0
- package/dist/ezui/ez-grid-config.entry.js +433 -0
- package/dist/ezui/ez-grid.entry.js +115419 -0
- package/dist/ezui/ez-icon.entry.js +37 -0
- package/dist/ezui/ez-list.entry.js +516 -0
- package/dist/ezui/ez-loading-bar.entry.js +24 -0
- package/dist/ezui/ez-modal.entry.js +67 -0
- package/dist/ezui/ez-number-input.entry.js +148 -0
- package/dist/ezui/ez-popover.entry.js +141 -0
- package/dist/ezui/ez-popup.entry.js +49 -0
- package/dist/ezui/ez-radio-button.entry.js +45 -0
- package/dist/ezui/ez-scroller.entry.js +101 -0
- package/dist/ezui/ez-search.entry.js +83 -0
- package/dist/ezui/ez-select-box.entry.js +18 -0
- package/dist/ezui/ez-tabselector.entry.js +195 -0
- package/dist/ezui/ez-text-area.entry.js +158 -0
- package/dist/ezui/ez-text-input.entry.js +235 -0
- package/dist/ezui/ez-time-input.entry.js +164 -0
- package/dist/ezui/ez-toast.entry.js +84 -0
- package/dist/ezui/ez-upload.entry.js +379 -0
- package/dist/ezui/ez-view-stack.entry.js +74 -0
- package/dist/ezui/ezui.esm.js +125 -1
- package/dist/ezui/index-12b43518.js +3 -0
- package/dist/ezui/index-1e9d524f.js +3031 -0
- package/dist/ezui/index-b96183c8.js +2295 -0
- package/dist/ezui/index.esm.js +1 -0
- package/dist/ezui/{p-72ab066f.entry.js → p-4eb273f8.entry.js} +1 -1
- package/dist/ezui/{p-d9c72ff7.entry.js → p-88bfdea4.entry.js} +1 -1
- package/dist/ezui/p-adbe4188.js +1 -0
- package/dist/ezui/{p-6cfe20a0.entry.js → p-af43be42.entry.js} +1 -1
- package/dist/ezui/{p-47e06040.entry.js → p-c9d2060e.entry.js} +1 -1
- package/dist/ezui/{p-3ae441ec.entry.js → p-d836f546.entry.js} +1 -1
- package/dist/ezui/{p-7fe1ac9a.entry.js → p-e55fc20f.entry.js} +1 -1
- package/dist/ezui/shadow-css-8c625855.js +388 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/package.json +2 -2
- package/dist/ezui/p-898b9906.js +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const
|
|
7
|
-
const ApplicationUtils = require('./ApplicationUtils-
|
|
5
|
+
const index = require('./index-d9c5cb88.js');
|
|
6
|
+
const index$1 = require('./index-2ec1da82.js');
|
|
7
|
+
const ApplicationUtils = require('./ApplicationUtils-475b50d9.js');
|
|
8
8
|
require('./DialogType-a1e288e6.js');
|
|
9
9
|
|
|
10
10
|
const buildTextArea = ({ name, label, readOnly }) => {
|
|
@@ -79,17 +79,17 @@ function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecisio
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
const uiBuilders = new Map();
|
|
82
|
-
uiBuilders.set(
|
|
83
|
-
uiBuilders.set(
|
|
84
|
-
uiBuilders.set(
|
|
85
|
-
uiBuilders.set(
|
|
86
|
-
uiBuilders.set(
|
|
87
|
-
uiBuilders.set(
|
|
88
|
-
uiBuilders.set(
|
|
89
|
-
uiBuilders.set(
|
|
90
|
-
uiBuilders.set(
|
|
91
|
-
uiBuilders.set(
|
|
92
|
-
uiBuilders.set(
|
|
82
|
+
uiBuilders.set(index$1.UserInterface.LONGTEXT, buildTextArea);
|
|
83
|
+
uiBuilders.set(index$1.UserInterface.CHECKBOX, buildCheckBox);
|
|
84
|
+
uiBuilders.set(index$1.UserInterface.SWITCH, buildSwitch);
|
|
85
|
+
uiBuilders.set(index$1.UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
86
|
+
uiBuilders.set(index$1.UserInterface.SEARCH, buildSearch);
|
|
87
|
+
uiBuilders.set(index$1.UserInterface.FILE, buildFile);
|
|
88
|
+
uiBuilders.set(index$1.UserInterface.DATE, buildDate);
|
|
89
|
+
uiBuilders.set(index$1.UserInterface.TIME, buildTime);
|
|
90
|
+
uiBuilders.set(index$1.UserInterface.DATETIME, buildTimeDate);
|
|
91
|
+
uiBuilders.set(index$1.UserInterface.DECIMALNUMBER, buildDecimal);
|
|
92
|
+
uiBuilders.set(index$1.UserInterface.INTEGERNUMBER, buildInteger);
|
|
93
93
|
const buildField = (field) => {
|
|
94
94
|
const descriptor = field.descriptor;
|
|
95
95
|
const config = Object.assign({}, field.config);
|
|
@@ -256,6 +256,59 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
256
256
|
return metadata;
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
+
function _defineProperty(obj, key, value) {
|
|
260
|
+
if (key in obj) {
|
|
261
|
+
Object.defineProperty(obj, key, {
|
|
262
|
+
value: value,
|
|
263
|
+
enumerable: true,
|
|
264
|
+
configurable: true,
|
|
265
|
+
writable: true
|
|
266
|
+
});
|
|
267
|
+
} else {
|
|
268
|
+
obj[key] = value;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return obj;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function ownKeys(object, enumerableOnly) {
|
|
275
|
+
var keys = Object.keys(object);
|
|
276
|
+
|
|
277
|
+
if (Object.getOwnPropertySymbols) {
|
|
278
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
279
|
+
|
|
280
|
+
if (enumerableOnly) {
|
|
281
|
+
symbols = symbols.filter(function (sym) {
|
|
282
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
keys.push.apply(keys, symbols);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return keys;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function _objectSpread2(target) {
|
|
293
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
294
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
295
|
+
|
|
296
|
+
if (i % 2) {
|
|
297
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
298
|
+
_defineProperty(target, key, source[key]);
|
|
299
|
+
});
|
|
300
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
301
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
302
|
+
} else {
|
|
303
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
304
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return target;
|
|
310
|
+
}
|
|
311
|
+
|
|
259
312
|
/**
|
|
260
313
|
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
|
|
261
314
|
*
|
|
@@ -305,6 +358,65 @@ function isPlainObject(obj) {
|
|
|
305
358
|
return Object.getPrototypeOf(obj) === proto;
|
|
306
359
|
}
|
|
307
360
|
|
|
361
|
+
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
|
|
362
|
+
function miniKindOf(val) {
|
|
363
|
+
if (val === void 0) return 'undefined';
|
|
364
|
+
if (val === null) return 'null';
|
|
365
|
+
var type = typeof val;
|
|
366
|
+
|
|
367
|
+
switch (type) {
|
|
368
|
+
case 'boolean':
|
|
369
|
+
case 'string':
|
|
370
|
+
case 'number':
|
|
371
|
+
case 'symbol':
|
|
372
|
+
case 'function':
|
|
373
|
+
{
|
|
374
|
+
return type;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (Array.isArray(val)) return 'array';
|
|
379
|
+
if (isDate(val)) return 'date';
|
|
380
|
+
if (isError(val)) return 'error';
|
|
381
|
+
var constructorName = ctorName(val);
|
|
382
|
+
|
|
383
|
+
switch (constructorName) {
|
|
384
|
+
case 'Symbol':
|
|
385
|
+
case 'Promise':
|
|
386
|
+
case 'WeakMap':
|
|
387
|
+
case 'WeakSet':
|
|
388
|
+
case 'Map':
|
|
389
|
+
case 'Set':
|
|
390
|
+
return constructorName;
|
|
391
|
+
} // other
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function ctorName(val) {
|
|
398
|
+
return typeof val.constructor === 'function' ? val.constructor.name : null;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function isError(val) {
|
|
402
|
+
return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function isDate(val) {
|
|
406
|
+
if (val instanceof Date) return true;
|
|
407
|
+
return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function kindOf(val) {
|
|
411
|
+
var typeOfVal = typeof val;
|
|
412
|
+
|
|
413
|
+
if ("development" !== 'production') {
|
|
414
|
+
typeOfVal = miniKindOf(val);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return typeOfVal;
|
|
418
|
+
}
|
|
419
|
+
|
|
308
420
|
/**
|
|
309
421
|
* Creates a Redux store that holds the state tree.
|
|
310
422
|
* The only way to change the data in the store is to call `dispatch()` on it.
|
|
@@ -335,7 +447,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
335
447
|
var _ref2;
|
|
336
448
|
|
|
337
449
|
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
|
|
338
|
-
throw new Error(formatProdErrorMessage(0) );
|
|
450
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
|
|
339
451
|
}
|
|
340
452
|
|
|
341
453
|
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
|
@@ -345,14 +457,14 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
345
457
|
|
|
346
458
|
if (typeof enhancer !== 'undefined') {
|
|
347
459
|
if (typeof enhancer !== 'function') {
|
|
348
|
-
throw new Error(formatProdErrorMessage(1) );
|
|
460
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
|
|
349
461
|
}
|
|
350
462
|
|
|
351
463
|
return enhancer(createStore)(reducer, preloadedState);
|
|
352
464
|
}
|
|
353
465
|
|
|
354
466
|
if (typeof reducer !== 'function') {
|
|
355
|
-
throw new Error(formatProdErrorMessage(2) );
|
|
467
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
|
|
356
468
|
}
|
|
357
469
|
|
|
358
470
|
var currentReducer = reducer;
|
|
@@ -382,7 +494,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
382
494
|
|
|
383
495
|
function getState() {
|
|
384
496
|
if (isDispatching) {
|
|
385
|
-
throw new Error(formatProdErrorMessage(3) );
|
|
497
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
|
|
386
498
|
}
|
|
387
499
|
|
|
388
500
|
return currentState;
|
|
@@ -414,11 +526,11 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
414
526
|
|
|
415
527
|
function subscribe(listener) {
|
|
416
528
|
if (typeof listener !== 'function') {
|
|
417
|
-
throw new Error(formatProdErrorMessage(4) );
|
|
529
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
|
|
418
530
|
}
|
|
419
531
|
|
|
420
532
|
if (isDispatching) {
|
|
421
|
-
throw new Error(formatProdErrorMessage(5) );
|
|
533
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
|
|
422
534
|
}
|
|
423
535
|
|
|
424
536
|
var isSubscribed = true;
|
|
@@ -430,7 +542,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
430
542
|
}
|
|
431
543
|
|
|
432
544
|
if (isDispatching) {
|
|
433
|
-
throw new Error(formatProdErrorMessage(6) );
|
|
545
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
|
|
434
546
|
}
|
|
435
547
|
|
|
436
548
|
isSubscribed = false;
|
|
@@ -469,15 +581,15 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
469
581
|
|
|
470
582
|
function dispatch(action) {
|
|
471
583
|
if (!isPlainObject(action)) {
|
|
472
|
-
throw new Error(formatProdErrorMessage(7) );
|
|
584
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
|
|
473
585
|
}
|
|
474
586
|
|
|
475
587
|
if (typeof action.type === 'undefined') {
|
|
476
|
-
throw new Error(formatProdErrorMessage(8) );
|
|
588
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
|
|
477
589
|
}
|
|
478
590
|
|
|
479
591
|
if (isDispatching) {
|
|
480
|
-
throw new Error(formatProdErrorMessage(9) );
|
|
592
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
|
|
481
593
|
}
|
|
482
594
|
|
|
483
595
|
try {
|
|
@@ -510,7 +622,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
510
622
|
|
|
511
623
|
function replaceReducer(nextReducer) {
|
|
512
624
|
if (typeof nextReducer !== 'function') {
|
|
513
|
-
throw new Error(formatProdErrorMessage(10) );
|
|
625
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
|
|
514
626
|
}
|
|
515
627
|
|
|
516
628
|
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
|
|
@@ -545,7 +657,7 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
545
657
|
*/
|
|
546
658
|
subscribe: function subscribe(observer) {
|
|
547
659
|
if (typeof observer !== 'object' || observer === null) {
|
|
548
|
-
throw new Error(formatProdErrorMessage(11) );
|
|
660
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
|
|
549
661
|
}
|
|
550
662
|
|
|
551
663
|
function observeState() {
|
|
@@ -579,6 +691,305 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
579
691
|
}, _ref2[$$observable] = observable, _ref2;
|
|
580
692
|
}
|
|
581
693
|
|
|
694
|
+
/**
|
|
695
|
+
* Prints a warning in the console if it exists.
|
|
696
|
+
*
|
|
697
|
+
* @param {String} message The warning message.
|
|
698
|
+
* @returns {void}
|
|
699
|
+
*/
|
|
700
|
+
function warning(message) {
|
|
701
|
+
/* eslint-disable no-console */
|
|
702
|
+
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
703
|
+
console.error(message);
|
|
704
|
+
}
|
|
705
|
+
/* eslint-enable no-console */
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
try {
|
|
709
|
+
// This error was thrown as a convenience so that if you enable
|
|
710
|
+
// "break on all exceptions" in your console,
|
|
711
|
+
// it would pause the execution at this line.
|
|
712
|
+
throw new Error(message);
|
|
713
|
+
} catch (e) {} // eslint-disable-line no-empty
|
|
714
|
+
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
718
|
+
var reducerKeys = Object.keys(reducers);
|
|
719
|
+
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
|
720
|
+
|
|
721
|
+
if (reducerKeys.length === 0) {
|
|
722
|
+
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
if (!isPlainObject(inputState)) {
|
|
726
|
+
return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
|
|
730
|
+
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
|
731
|
+
});
|
|
732
|
+
unexpectedKeys.forEach(function (key) {
|
|
733
|
+
unexpectedKeyCache[key] = true;
|
|
734
|
+
});
|
|
735
|
+
if (action && action.type === ActionTypes.REPLACE) return;
|
|
736
|
+
|
|
737
|
+
if (unexpectedKeys.length > 0) {
|
|
738
|
+
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
function assertReducerShape(reducers) {
|
|
743
|
+
Object.keys(reducers).forEach(function (key) {
|
|
744
|
+
var reducer = reducers[key];
|
|
745
|
+
var initialState = reducer(undefined, {
|
|
746
|
+
type: ActionTypes.INIT
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
if (typeof initialState === 'undefined') {
|
|
750
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(12) : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
if (typeof reducer(undefined, {
|
|
754
|
+
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
|
755
|
+
}) === 'undefined') {
|
|
756
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(13) : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Turns an object whose values are different reducer functions, into a single
|
|
762
|
+
* reducer function. It will call every child reducer, and gather their results
|
|
763
|
+
* into a single state object, whose keys correspond to the keys of the passed
|
|
764
|
+
* reducer functions.
|
|
765
|
+
*
|
|
766
|
+
* @param {Object} reducers An object whose values correspond to different
|
|
767
|
+
* reducer functions that need to be combined into one. One handy way to obtain
|
|
768
|
+
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
|
769
|
+
* undefined for any action. Instead, they should return their initial state
|
|
770
|
+
* if the state passed to them was undefined, and the current state for any
|
|
771
|
+
* unrecognized action.
|
|
772
|
+
*
|
|
773
|
+
* @returns {Function} A reducer function that invokes every reducer inside the
|
|
774
|
+
* passed object, and builds a state object with the same shape.
|
|
775
|
+
*/
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
function combineReducers(reducers) {
|
|
779
|
+
var reducerKeys = Object.keys(reducers);
|
|
780
|
+
var finalReducers = {};
|
|
781
|
+
|
|
782
|
+
for (var i = 0; i < reducerKeys.length; i++) {
|
|
783
|
+
var key = reducerKeys[i];
|
|
784
|
+
|
|
785
|
+
if ("development" !== 'production') {
|
|
786
|
+
if (typeof reducers[key] === 'undefined') {
|
|
787
|
+
warning("No reducer provided for key \"" + key + "\"");
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
if (typeof reducers[key] === 'function') {
|
|
792
|
+
finalReducers[key] = reducers[key];
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
|
|
797
|
+
// keys multiple times.
|
|
798
|
+
|
|
799
|
+
var unexpectedKeyCache;
|
|
800
|
+
|
|
801
|
+
if ("development" !== 'production') {
|
|
802
|
+
unexpectedKeyCache = {};
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
var shapeAssertionError;
|
|
806
|
+
|
|
807
|
+
try {
|
|
808
|
+
assertReducerShape(finalReducers);
|
|
809
|
+
} catch (e) {
|
|
810
|
+
shapeAssertionError = e;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
return function combination(state, action) {
|
|
814
|
+
if (state === void 0) {
|
|
815
|
+
state = {};
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (shapeAssertionError) {
|
|
819
|
+
throw shapeAssertionError;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
if ("development" !== 'production') {
|
|
823
|
+
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
824
|
+
|
|
825
|
+
if (warningMessage) {
|
|
826
|
+
warning(warningMessage);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
var hasChanged = false;
|
|
831
|
+
var nextState = {};
|
|
832
|
+
|
|
833
|
+
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
|
834
|
+
var _key = finalReducerKeys[_i];
|
|
835
|
+
var reducer = finalReducers[_key];
|
|
836
|
+
var previousStateForKey = state[_key];
|
|
837
|
+
var nextStateForKey = reducer(previousStateForKey, action);
|
|
838
|
+
|
|
839
|
+
if (typeof nextStateForKey === 'undefined') {
|
|
840
|
+
var actionType = action && action.type;
|
|
841
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
nextState[_key] = nextStateForKey;
|
|
845
|
+
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
|
849
|
+
return hasChanged ? nextState : state;
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
function bindActionCreator(actionCreator, dispatch) {
|
|
854
|
+
return function () {
|
|
855
|
+
return dispatch(actionCreator.apply(this, arguments));
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Turns an object whose values are action creators, into an object with the
|
|
860
|
+
* same keys, but with every function wrapped into a `dispatch` call so they
|
|
861
|
+
* may be invoked directly. This is just a convenience method, as you can call
|
|
862
|
+
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
|
863
|
+
*
|
|
864
|
+
* For convenience, you can also pass an action creator as the first argument,
|
|
865
|
+
* and get a dispatch wrapped function in return.
|
|
866
|
+
*
|
|
867
|
+
* @param {Function|Object} actionCreators An object whose values are action
|
|
868
|
+
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
|
869
|
+
* syntax. You may also pass a single function.
|
|
870
|
+
*
|
|
871
|
+
* @param {Function} dispatch The `dispatch` function available on your Redux
|
|
872
|
+
* store.
|
|
873
|
+
*
|
|
874
|
+
* @returns {Function|Object} The object mimicking the original object, but with
|
|
875
|
+
* every action creator wrapped into the `dispatch` call. If you passed a
|
|
876
|
+
* function as `actionCreators`, the return value will also be a single
|
|
877
|
+
* function.
|
|
878
|
+
*/
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
function bindActionCreators(actionCreators, dispatch) {
|
|
882
|
+
if (typeof actionCreators === 'function') {
|
|
883
|
+
return bindActionCreator(actionCreators, dispatch);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
if (typeof actionCreators !== 'object' || actionCreators === null) {
|
|
887
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(16) : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
var boundActionCreators = {};
|
|
891
|
+
|
|
892
|
+
for (var key in actionCreators) {
|
|
893
|
+
var actionCreator = actionCreators[key];
|
|
894
|
+
|
|
895
|
+
if (typeof actionCreator === 'function') {
|
|
896
|
+
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
return boundActionCreators;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Composes single-argument functions from right to left. The rightmost
|
|
905
|
+
* function can take multiple arguments as it provides the signature for
|
|
906
|
+
* the resulting composite function.
|
|
907
|
+
*
|
|
908
|
+
* @param {...Function} funcs The functions to compose.
|
|
909
|
+
* @returns {Function} A function obtained by composing the argument functions
|
|
910
|
+
* from right to left. For example, compose(f, g, h) is identical to doing
|
|
911
|
+
* (...args) => f(g(h(...args))).
|
|
912
|
+
*/
|
|
913
|
+
function compose() {
|
|
914
|
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
915
|
+
funcs[_key] = arguments[_key];
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
if (funcs.length === 0) {
|
|
919
|
+
return function (arg) {
|
|
920
|
+
return arg;
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
if (funcs.length === 1) {
|
|
925
|
+
return funcs[0];
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return funcs.reduce(function (a, b) {
|
|
929
|
+
return function () {
|
|
930
|
+
return a(b.apply(void 0, arguments));
|
|
931
|
+
};
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Creates a store enhancer that applies middleware to the dispatch method
|
|
937
|
+
* of the Redux store. This is handy for a variety of tasks, such as expressing
|
|
938
|
+
* asynchronous actions in a concise manner, or logging every action payload.
|
|
939
|
+
*
|
|
940
|
+
* See `redux-thunk` package as an example of the Redux middleware.
|
|
941
|
+
*
|
|
942
|
+
* Because middleware is potentially asynchronous, this should be the first
|
|
943
|
+
* store enhancer in the composition chain.
|
|
944
|
+
*
|
|
945
|
+
* Note that each middleware will be given the `dispatch` and `getState` functions
|
|
946
|
+
* as named arguments.
|
|
947
|
+
*
|
|
948
|
+
* @param {...Function} middlewares The middleware chain to be applied.
|
|
949
|
+
* @returns {Function} A store enhancer applying the middleware.
|
|
950
|
+
*/
|
|
951
|
+
|
|
952
|
+
function applyMiddleware() {
|
|
953
|
+
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
954
|
+
middlewares[_key] = arguments[_key];
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
return function (createStore) {
|
|
958
|
+
return function () {
|
|
959
|
+
var store = createStore.apply(void 0, arguments);
|
|
960
|
+
|
|
961
|
+
var _dispatch = function dispatch() {
|
|
962
|
+
throw new Error("development" === "production" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
var middlewareAPI = {
|
|
966
|
+
getState: store.getState,
|
|
967
|
+
dispatch: function dispatch() {
|
|
968
|
+
return _dispatch.apply(void 0, arguments);
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
var chain = middlewares.map(function (middleware) {
|
|
972
|
+
return middleware(middlewareAPI);
|
|
973
|
+
});
|
|
974
|
+
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
|
975
|
+
return _objectSpread2(_objectSpread2({}, store), {}, {
|
|
976
|
+
dispatch: _dispatch
|
|
977
|
+
});
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/*
|
|
983
|
+
* This is a dummy function to check if the function name has been altered by minification.
|
|
984
|
+
* If the function has been minified and NODE_ENV !== 'production', warn the user.
|
|
985
|
+
*/
|
|
986
|
+
|
|
987
|
+
function isCrushed() {}
|
|
988
|
+
|
|
989
|
+
if ("development" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
|
|
990
|
+
warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
|
|
991
|
+
}
|
|
992
|
+
|
|
582
993
|
const inicialState = {};
|
|
583
994
|
/////////////////////////////// REDUCERS ///////////////////////////////
|
|
584
995
|
function formReducer(state = inicialState, action) {
|
|
@@ -624,19 +1035,19 @@ class DataBinder {
|
|
|
624
1035
|
this.onDataUnitEvent = (action) => {
|
|
625
1036
|
var _a;
|
|
626
1037
|
switch (action.type) {
|
|
627
|
-
case
|
|
628
|
-
case
|
|
629
|
-
case
|
|
630
|
-
case
|
|
631
|
-
case
|
|
632
|
-
case
|
|
633
|
-
case
|
|
634
|
-
case
|
|
635
|
-
case
|
|
1038
|
+
case index$1.Action.DATA_LOADED:
|
|
1039
|
+
case index$1.Action.DATA_SAVED:
|
|
1040
|
+
case index$1.Action.RECORDS_REMOVED:
|
|
1041
|
+
case index$1.Action.RECORDS_ADDED:
|
|
1042
|
+
case index$1.Action.RECORDS_COPIED:
|
|
1043
|
+
case index$1.Action.EDITION_CANCELED:
|
|
1044
|
+
case index$1.Action.SELECTION_CHANGED:
|
|
1045
|
+
case index$1.Action.NEXT_SELECTED:
|
|
1046
|
+
case index$1.Action.PREVIOUS_SELECTED:
|
|
636
1047
|
this.clearInvalid();
|
|
637
|
-
case
|
|
638
|
-
case
|
|
639
|
-
case
|
|
1048
|
+
case index$1.Action.DATA_CHANGED:
|
|
1049
|
+
case index$1.Action.CHANGE_UNDONE:
|
|
1050
|
+
case index$1.Action.CHANGE_REDONE:
|
|
640
1051
|
(_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
641
1052
|
this.updateValue(field.fieldName, field.field);
|
|
642
1053
|
});
|
|
@@ -727,7 +1138,7 @@ class DataBinder {
|
|
|
727
1138
|
this._dataUnit.cancelWaitingChange(fieldName);
|
|
728
1139
|
const bind = this._fields.get(fieldName);
|
|
729
1140
|
if (bind) {
|
|
730
|
-
bind.rejectWaitingChange(new
|
|
1141
|
+
bind.rejectWaitingChange(new index$1.WaitingChangeException("Change canceled", fieldName));
|
|
731
1142
|
}
|
|
732
1143
|
}
|
|
733
1144
|
}
|
|
@@ -746,7 +1157,7 @@ class DataBinder {
|
|
|
746
1157
|
}
|
|
747
1158
|
bindSearchOptionsLoader(fieldName, field) {
|
|
748
1159
|
if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] == undefined) {
|
|
749
|
-
const loader =
|
|
1160
|
+
const loader = index$1.ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
|
|
750
1161
|
if (loader) {
|
|
751
1162
|
field["optionLoader"] = (arg) => {
|
|
752
1163
|
return loader(arg, fieldName, this._dataUnit);
|
|
@@ -757,8 +1168,8 @@ class DataBinder {
|
|
|
757
1168
|
applyEzUploadContext(fieldName, field) {
|
|
758
1169
|
var _a, _b;
|
|
759
1170
|
if (field.nodeName === "EZ-UPLOAD") {
|
|
760
|
-
field["urlUpload"] =
|
|
761
|
-
field["urlDelete"] =
|
|
1171
|
+
field["urlUpload"] = index$1.ApplicationContext.getContextValue("__EZUI__UPLOAD__ADD__URL__");
|
|
1172
|
+
field["urlDelete"] = index$1.ApplicationContext.getContextValue("__EZUI__UPLOAD__DEL__URL__");
|
|
762
1173
|
const descriptor = this._dataUnit.getField(fieldName);
|
|
763
1174
|
const destination = (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.DESTINATION;
|
|
764
1175
|
if (destination) {
|
|
@@ -818,7 +1229,7 @@ let EzForm = class {
|
|
|
818
1229
|
index.registerInstance(this, hostRef);
|
|
819
1230
|
this.ezReady = index.createEvent(this, "ezReady", 7);
|
|
820
1231
|
this.onDataUnitAction = (action) => {
|
|
821
|
-
if (action.type ===
|
|
1232
|
+
if (action.type === index$1.Action.METADATA_LOADED) {
|
|
822
1233
|
this.processMetadata();
|
|
823
1234
|
}
|
|
824
1235
|
};
|
|
@@ -919,31 +1330,31 @@ let EzForm = class {
|
|
|
919
1330
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
920
1331
|
}
|
|
921
1332
|
interceptAction(action) {
|
|
922
|
-
if (action.type ===
|
|
1333
|
+
if (action.type === index$1.Action.RECORDS_COPIED) {
|
|
923
1334
|
const metadata = selectFormMetadata(this._store.getState());
|
|
924
1335
|
const cleanFields = metadata.getCleanOnCopyFields();
|
|
925
1336
|
if (cleanFields) {
|
|
926
1337
|
const records = action.payload;
|
|
927
|
-
return new
|
|
1338
|
+
return new index$1.DataUnitAction(index$1.Action.RECORDS_COPIED, records.map(record => {
|
|
928
1339
|
const newRecord = Object.assign({}, record);
|
|
929
1340
|
cleanFields.forEach(fieldName => delete newRecord[fieldName]);
|
|
930
1341
|
return newRecord;
|
|
931
1342
|
}));
|
|
932
1343
|
}
|
|
933
1344
|
}
|
|
934
|
-
if (action.type ===
|
|
1345
|
+
if (action.type === index$1.Action.SAVING_DATA) {
|
|
935
1346
|
return new Promise((resolve) => {
|
|
936
1347
|
this.validate()
|
|
937
1348
|
.then(() => resolve(action))
|
|
938
1349
|
.catch(() => { });
|
|
939
1350
|
});
|
|
940
1351
|
}
|
|
941
|
-
if (action.type ===
|
|
1352
|
+
if (action.type === index$1.Action.RECORDS_ADDED) {
|
|
942
1353
|
const metadata = selectFormMetadata(this._store.getState());
|
|
943
1354
|
const defaultValues = metadata.getDefaultValues();
|
|
944
1355
|
if (defaultValues) {
|
|
945
1356
|
const records = action.payload;
|
|
946
|
-
return new
|
|
1357
|
+
return new index$1.DataUnitAction(index$1.Action.RECORDS_ADDED, records.map(record => {
|
|
947
1358
|
const newRecord = Object.assign({}, record);
|
|
948
1359
|
for (const field in defaultValues) {
|
|
949
1360
|
newRecord[field] = this.dataUnit.valueFromString(field, defaultValues[field]);
|
|
@@ -956,7 +1367,7 @@ let EzForm = class {
|
|
|
956
1367
|
}
|
|
957
1368
|
componentWillLoad() {
|
|
958
1369
|
if (this.dataUnit === undefined) {
|
|
959
|
-
this.dataUnit = new
|
|
1370
|
+
this.dataUnit = new index$1.DataUnit("ez-form");
|
|
960
1371
|
}
|
|
961
1372
|
this.dataUnit.addInterceptor(this);
|
|
962
1373
|
this.dataUnit.subscribe(this.onDataUnitAction);
|