@sankhyalabs/ezui 1.1.101 → 1.1.104

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.
Files changed (29) hide show
  1. package/dist/cjs/{UnitMetadata-63c56042.js → UnitMetadata-4b90ead3.js} +43 -8
  2. package/dist/cjs/ez-calendar_16.cjs.entry.js +16 -13
  3. package/dist/cjs/ez-grid.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-modal_2.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  6. package/dist/collection/components/ez-calendar/ez-calendar.js +11 -7
  7. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +3 -3
  8. package/dist/collection/components/ez-date-input/ez-date-input.js +12 -6
  9. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +10 -5
  10. package/dist/custom-elements/index.js +58 -20
  11. package/dist/esm/{UnitMetadata-109880b0.js → UnitMetadata-8951d803.js} +43 -8
  12. package/dist/esm/ez-calendar_16.entry.js +16 -13
  13. package/dist/esm/ez-grid.entry.js +1 -1
  14. package/dist/esm/ez-modal_2.entry.js +1 -1
  15. package/dist/esm/ez-popover.entry.js +1 -1
  16. package/dist/ezui/ezui.esm.js +1 -1
  17. package/dist/ezui/{p-afb820c1.entry.js → p-18c00d88.entry.js} +1 -1
  18. package/dist/ezui/p-2259c926.entry.js +1 -0
  19. package/dist/ezui/{p-a30309ce.entry.js → p-7294c815.entry.js} +1 -1
  20. package/dist/ezui/p-c6760545.js +1 -0
  21. package/dist/ezui/{p-cae8b8a2.entry.js → p-da0f5393.entry.js} +1 -1
  22. package/dist/types/components/ez-calendar/ez-calendar.d.ts +1 -1
  23. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +1 -1
  24. package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -1
  25. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +1 -1
  26. package/dist/types/components.d.ts +4 -4
  27. package/package.json +3 -3
  28. package/dist/ezui/p-9fab5606.js +0 -1
  29. package/dist/ezui/p-b9982bf0.entry.js +0 -1
@@ -572,6 +572,7 @@ exports.Action = void 0;
572
572
  Action["DATA_LOADED"] = "dataLoaded";
573
573
  Action["SAVING_DATA"] = "savingData";
574
574
  Action["DATA_SAVED"] = "dataSaved";
575
+ Action["REMOVING_RECORDS"] = "removingRecords";
575
576
  Action["RECORDS_REMOVED"] = "recordsRemoved";
576
577
  Action["RECORDS_ADDED"] = "recordsAdded";
577
578
  Action["RECORDS_COPIED"] = "recordsCopied";
@@ -736,7 +737,11 @@ class RemovedRecordsReducerImpl {
736
737
  reduce(_stateManager, currentState, action) {
737
738
  switch (action.type) {
738
739
  case exports.Action.RECORDS_REMOVED:
739
- return (currentState || []).concat(action.payload);
740
+ const { records, buffered } = action.payload;
741
+ if (buffered) {
742
+ return (currentState || []).concat(records);
743
+ }
744
+ return currentState;
740
745
  case exports.Action.EDITION_CANCELED:
741
746
  case exports.Action.DATA_SAVED:
742
747
  return undefined;
@@ -757,6 +762,12 @@ class RecordsReducerImpl {
757
762
  switch (action.type) {
758
763
  case exports.Action.DATA_LOADED:
759
764
  return action.payload;
765
+ case exports.Action.RECORDS_REMOVED:
766
+ const { records, buffered } = action.payload;
767
+ if (!buffered) {
768
+ return currentState.filter(r => !records.includes(r.__record__id__));
769
+ }
770
+ return currentState;
760
771
  case exports.Action.DATA_SAVED:
761
772
  const recordsMap = new Map();
762
773
  const currentRecords = getRecords(stateManager);
@@ -930,7 +941,7 @@ class SelectionReducerImpl {
930
941
  case exports.Action.DATA_SAVED:
931
942
  return updateSavedIds(stateManager, action.payload.records);
932
943
  case exports.Action.RECORDS_REMOVED:
933
- const removed = action.payload;
944
+ const removed = action.payload.records;
934
945
  if (currentState && removed) {
935
946
  return currentState.filter(recordId => !removed.includes(recordId));
936
947
  }
@@ -1120,6 +1131,36 @@ class DataUnit {
1120
1131
  return Promise.resolve();
1121
1132
  });
1122
1133
  }
1134
+ removeSelectedRecords(buffered = false) {
1135
+ return __awaiter(this, void 0, void 0, function* () {
1136
+ const selection = getSelection(this._stateManager);
1137
+ if (selection) {
1138
+ return this.removeRecords(selection, buffered);
1139
+ }
1140
+ return Promise.resolve(selection);
1141
+ });
1142
+ }
1143
+ removeRecords(records, buffered = false) {
1144
+ return __awaiter(this, void 0, void 0, function* () {
1145
+ if (records) {
1146
+ if (buffered || !this.removeLoader) {
1147
+ this.dispatchAction(exports.Action.RECORDS_REMOVED, { records, buffered: true });
1148
+ }
1149
+ else {
1150
+ this.dispatchAction(exports.Action.REMOVING_RECORDS);
1151
+ return new Promise((resolve, fail) => {
1152
+ if (this.removeLoader) {
1153
+ this.removeLoader(this, records).then(records => {
1154
+ this.dispatchAction(exports.Action.RECORDS_REMOVED, { records, buffered: false });
1155
+ resolve(records);
1156
+ }).catch(error => fail(error));
1157
+ }
1158
+ });
1159
+ }
1160
+ }
1161
+ return Promise.resolve(records);
1162
+ });
1163
+ }
1123
1164
  // API
1124
1165
  valueFromString(fieldName, value) {
1125
1166
  const descriptor = this.getField(fieldName);
@@ -1159,12 +1200,6 @@ class DataUnit {
1159
1200
  this.dispatchAction(exports.Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
1160
1201
  }
1161
1202
  }
1162
- removeSelectedRecords() {
1163
- const selection = getSelection(this._stateManager);
1164
- if (selection) {
1165
- this.dispatchAction(exports.Action.RECORDS_REMOVED, selection);
1166
- }
1167
- }
1168
1203
  getFieldValue(fieldName) {
1169
1204
  return getFieldValue(this._stateManager, fieldName);
1170
1205
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-88286449.js');
6
- const UnitMetadata = require('./UnitMetadata-63c56042.js');
6
+ const UnitMetadata = require('./UnitMetadata-4b90ead3.js');
7
7
  const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
8
  const AssetsUtils = require('./AssetsUtils-69356e76.js');
9
9
 
@@ -52,10 +52,10 @@ class DateUtils {
52
52
 
53
53
  class ApplicationContext {
54
54
  static getContextValue(key) {
55
- return ApplicationContext.getCtx()[key].deref();
55
+ return ApplicationContext.getCtx()[key];
56
56
  }
57
57
  static setContextValue(key, value) {
58
- ApplicationContext.getCtx()[key] = new WeakRef(value);
58
+ ApplicationContext.getCtx()[key] = value;
59
59
  }
60
60
  static getCtx() {
61
61
  let ctx = window.___snkcore___ctx___;
@@ -166,28 +166,28 @@ let EzCalendar = class {
166
166
  }
167
167
  }
168
168
  this.value = newDate;
169
- this.ezChange.emit();
169
+ this.ezChange.emit(this.value);
170
170
  }
171
171
  selectHours(hour) {
172
172
  if (!this.value) {
173
173
  this.value = new Date();
174
174
  }
175
175
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), hour, this.value.getMinutes(), this.value.getSeconds());
176
- this.ezChange.emit();
176
+ this.ezChange.emit(this.value);
177
177
  }
178
178
  selectMinutes(minute) {
179
179
  if (!this.value) {
180
180
  this.value = new Date();
181
181
  }
182
182
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), minute, this.value.getSeconds());
183
- this.ezChange.emit();
183
+ this.ezChange.emit(this.value);
184
184
  }
185
185
  selectSeconds(second) {
186
186
  if (!this.value) {
187
187
  this.value = new Date();
188
188
  }
189
189
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), this.value.getMinutes(), second);
190
- this.ezChange.emit();
190
+ this.ezChange.emit(this.value);
191
191
  }
192
192
  updateScroll(element) {
193
193
  if (element) {
@@ -368,7 +368,7 @@ let EzCollapsibleBox = class {
368
368
  this.iconPlacement = "left";
369
369
  }
370
370
  observeValue() {
371
- this.ezChange.emit();
371
+ this.ezChange.emit(this.value);
372
372
  }
373
373
  /**
374
374
  * Esconde ou revela o conteúdo do componente
@@ -708,11 +708,13 @@ let EzDateInput = class {
708
708
  this._textInput.setBlur();
709
709
  }
710
710
  changeValue(newValue) {
711
- newValue = newValue == null ? null : DateUtils.clearTime(newValue);
711
+ var _a;
712
+ newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
713
+ this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
712
714
  this._textInput.errorMessage = "";
713
- if (newValue !== this.value) {
715
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
714
716
  this.value = newValue;
715
- this.ezChange.emit();
717
+ this.ezChange.emit(this.value);
716
718
  }
717
719
  }
718
720
  showCalendar() {
@@ -842,10 +844,11 @@ let EzDateTimeInput = class {
842
844
  input.setSelectionRange(selectIni, selectFin);
843
845
  }
844
846
  changeValue(newValue) {
847
+ var _a;
845
848
  this._textInput.errorMessage = "";
846
- if (newValue !== this.value) {
849
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
847
850
  this.value = newValue;
848
- this.ezChange.emit();
851
+ this.ezChange.emit(this.value);
849
852
  }
850
853
  }
851
854
  showCalendar() {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-88286449.js');
6
- const UnitMetadata = require('./UnitMetadata-63c56042.js');
6
+ const UnitMetadata = require('./UnitMetadata-4b90ead3.js');
7
7
 
8
8
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
9
9
 
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-88286449.js');
6
6
  const AssetsUtils = require('./AssetsUtils-69356e76.js');
7
- require('./UnitMetadata-63c56042.js');
7
+ require('./UnitMetadata-4b90ead3.js');
8
8
 
9
9
  const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
10
10
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-88286449.js');
6
- require('./UnitMetadata-63c56042.js');
6
+ require('./UnitMetadata-4b90ead3.js');
7
7
  const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
8
 
9
9
  const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";
@@ -95,28 +95,28 @@ export class EzCalendar {
95
95
  }
96
96
  }
97
97
  this.value = newDate;
98
- this.ezChange.emit();
98
+ this.ezChange.emit(this.value);
99
99
  }
100
100
  selectHours(hour) {
101
101
  if (!this.value) {
102
102
  this.value = new Date();
103
103
  }
104
104
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), hour, this.value.getMinutes(), this.value.getSeconds());
105
- this.ezChange.emit();
105
+ this.ezChange.emit(this.value);
106
106
  }
107
107
  selectMinutes(minute) {
108
108
  if (!this.value) {
109
109
  this.value = new Date();
110
110
  }
111
111
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), minute, this.value.getSeconds());
112
- this.ezChange.emit();
112
+ this.ezChange.emit(this.value);
113
113
  }
114
114
  selectSeconds(second) {
115
115
  if (!this.value) {
116
116
  this.value = new Date();
117
117
  }
118
118
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), this.value.getMinutes(), second);
119
- this.ezChange.emit();
119
+ this.ezChange.emit(this.value);
120
120
  }
121
121
  updateScroll(element) {
122
122
  if (element) {
@@ -330,9 +330,13 @@ export class EzCalendar {
330
330
  "text": "Quando o usu\u00E1rio escolhe uma data, esse evento \u00E9 emitido."
331
331
  },
332
332
  "complexType": {
333
- "original": "string",
334
- "resolved": "string",
335
- "references": {}
333
+ "original": "Date",
334
+ "resolved": "Date",
335
+ "references": {
336
+ "Date": {
337
+ "location": "global"
338
+ }
339
+ }
336
340
  }
337
341
  }]; }
338
342
  static get methods() { return {
@@ -15,7 +15,7 @@ export class EzCollapsibleBox {
15
15
  this.iconPlacement = "left";
16
16
  }
17
17
  observeValue() {
18
- this.ezChange.emit();
18
+ this.ezChange.emit(this.value);
19
19
  }
20
20
  /**
21
21
  * Esconde ou revela o conteúdo do componente
@@ -127,8 +127,8 @@ export class EzCollapsibleBox {
127
127
  "text": "Evento disparado ao mudar o estado do componente (onEzChange)."
128
128
  },
129
129
  "complexType": {
130
- "original": "string",
131
- "resolved": "string",
130
+ "original": "boolean",
131
+ "resolved": "boolean",
132
132
  "references": {}
133
133
  }
134
134
  }]; }
@@ -32,11 +32,13 @@ export class EzDateInput {
32
32
  this._textInput.setBlur();
33
33
  }
34
34
  changeValue(newValue) {
35
- newValue = newValue == null ? null : DateUtils.clearTime(newValue);
35
+ var _a;
36
+ newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
37
+ this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
36
38
  this._textInput.errorMessage = "";
37
- if (newValue !== this.value) {
39
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
38
40
  this.value = newValue;
39
- this.ezChange.emit();
41
+ this.ezChange.emit(this.value);
40
42
  }
41
43
  }
42
44
  showCalendar() {
@@ -172,9 +174,13 @@ export class EzDateInput {
172
174
  "text": "Evento disparado ao mudar o estado do componente(onEzChange)."
173
175
  },
174
176
  "complexType": {
175
- "original": "string",
176
- "resolved": "string",
177
- "references": {}
177
+ "original": "Date",
178
+ "resolved": "Date",
179
+ "references": {
180
+ "Date": {
181
+ "location": "global"
182
+ }
183
+ }
178
184
  }
179
185
  }]; }
180
186
  static get methods() { return {
@@ -75,10 +75,11 @@ export class EzDateTimeInput {
75
75
  input.setSelectionRange(selectIni, selectFin);
76
76
  }
77
77
  changeValue(newValue) {
78
+ var _a;
78
79
  this._textInput.errorMessage = "";
79
- if (newValue !== this.value) {
80
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
80
81
  this.value = newValue;
81
- this.ezChange.emit();
82
+ this.ezChange.emit(this.value);
82
83
  }
83
84
  }
84
85
  showCalendar() {
@@ -236,9 +237,13 @@ export class EzDateTimeInput {
236
237
  "text": "Evento disparado ao mudar o estado do componente(onEzChange)."
237
238
  },
238
239
  "complexType": {
239
- "original": "string",
240
- "resolved": "string",
241
- "references": {}
240
+ "original": "Date",
241
+ "resolved": "Date",
242
+ "references": {
243
+ "Date": {
244
+ "location": "global"
245
+ }
246
+ }
242
247
  }
243
248
  }]; }
244
249
  static get methods() { return {
@@ -909,6 +909,7 @@ var Action;
909
909
  Action["DATA_LOADED"] = "dataLoaded";
910
910
  Action["SAVING_DATA"] = "savingData";
911
911
  Action["DATA_SAVED"] = "dataSaved";
912
+ Action["REMOVING_RECORDS"] = "removingRecords";
912
913
  Action["RECORDS_REMOVED"] = "recordsRemoved";
913
914
  Action["RECORDS_ADDED"] = "recordsAdded";
914
915
  Action["RECORDS_COPIED"] = "recordsCopied";
@@ -1073,7 +1074,11 @@ class RemovedRecordsReducerImpl {
1073
1074
  reduce(_stateManager, currentState, action) {
1074
1075
  switch (action.type) {
1075
1076
  case Action.RECORDS_REMOVED:
1076
- return (currentState || []).concat(action.payload);
1077
+ const { records, buffered } = action.payload;
1078
+ if (buffered) {
1079
+ return (currentState || []).concat(records);
1080
+ }
1081
+ return currentState;
1077
1082
  case Action.EDITION_CANCELED:
1078
1083
  case Action.DATA_SAVED:
1079
1084
  return undefined;
@@ -1094,6 +1099,12 @@ class RecordsReducerImpl {
1094
1099
  switch (action.type) {
1095
1100
  case Action.DATA_LOADED:
1096
1101
  return action.payload;
1102
+ case Action.RECORDS_REMOVED:
1103
+ const { records, buffered } = action.payload;
1104
+ if (!buffered) {
1105
+ return currentState.filter(r => !records.includes(r.__record__id__));
1106
+ }
1107
+ return currentState;
1097
1108
  case Action.DATA_SAVED:
1098
1109
  const recordsMap = new Map();
1099
1110
  const currentRecords = getRecords(stateManager);
@@ -1267,7 +1278,7 @@ class SelectionReducerImpl {
1267
1278
  case Action.DATA_SAVED:
1268
1279
  return updateSavedIds(stateManager, action.payload.records);
1269
1280
  case Action.RECORDS_REMOVED:
1270
- const removed = action.payload;
1281
+ const removed = action.payload.records;
1271
1282
  if (currentState && removed) {
1272
1283
  return currentState.filter(recordId => !removed.includes(recordId));
1273
1284
  }
@@ -1457,6 +1468,36 @@ class DataUnit {
1457
1468
  return Promise.resolve();
1458
1469
  });
1459
1470
  }
1471
+ removeSelectedRecords(buffered = false) {
1472
+ return __awaiter(this, void 0, void 0, function* () {
1473
+ const selection = getSelection(this._stateManager);
1474
+ if (selection) {
1475
+ return this.removeRecords(selection, buffered);
1476
+ }
1477
+ return Promise.resolve(selection);
1478
+ });
1479
+ }
1480
+ removeRecords(records, buffered = false) {
1481
+ return __awaiter(this, void 0, void 0, function* () {
1482
+ if (records) {
1483
+ if (buffered || !this.removeLoader) {
1484
+ this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: true });
1485
+ }
1486
+ else {
1487
+ this.dispatchAction(Action.REMOVING_RECORDS);
1488
+ return new Promise((resolve, fail) => {
1489
+ if (this.removeLoader) {
1490
+ this.removeLoader(this, records).then(records => {
1491
+ this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: false });
1492
+ resolve(records);
1493
+ }).catch(error => fail(error));
1494
+ }
1495
+ });
1496
+ }
1497
+ }
1498
+ return Promise.resolve(records);
1499
+ });
1500
+ }
1460
1501
  // API
1461
1502
  valueFromString(fieldName, value) {
1462
1503
  const descriptor = this.getField(fieldName);
@@ -1496,12 +1537,6 @@ class DataUnit {
1496
1537
  this.dispatchAction(Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
1497
1538
  }
1498
1539
  }
1499
- removeSelectedRecords() {
1500
- const selection = getSelection(this._stateManager);
1501
- if (selection) {
1502
- this.dispatchAction(Action.RECORDS_REMOVED, selection);
1503
- }
1504
- }
1505
1540
  getFieldValue(fieldName) {
1506
1541
  return getFieldValue(this._stateManager, fieldName);
1507
1542
  }
@@ -1643,10 +1678,10 @@ var UserInterface;
1643
1678
 
1644
1679
  class ApplicationContext {
1645
1680
  static getContextValue(key) {
1646
- return ApplicationContext.getCtx()[key].deref();
1681
+ return ApplicationContext.getCtx()[key];
1647
1682
  }
1648
1683
  static setContextValue(key, value) {
1649
- ApplicationContext.getCtx()[key] = new WeakRef(value);
1684
+ ApplicationContext.getCtx()[key] = value;
1650
1685
  }
1651
1686
  static getCtx() {
1652
1687
  let ctx = window.___snkcore___ctx___;
@@ -1759,28 +1794,28 @@ let EzCalendar$1 = class extends HTMLElement$1 {
1759
1794
  }
1760
1795
  }
1761
1796
  this.value = newDate;
1762
- this.ezChange.emit();
1797
+ this.ezChange.emit(this.value);
1763
1798
  }
1764
1799
  selectHours(hour) {
1765
1800
  if (!this.value) {
1766
1801
  this.value = new Date();
1767
1802
  }
1768
1803
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), hour, this.value.getMinutes(), this.value.getSeconds());
1769
- this.ezChange.emit();
1804
+ this.ezChange.emit(this.value);
1770
1805
  }
1771
1806
  selectMinutes(minute) {
1772
1807
  if (!this.value) {
1773
1808
  this.value = new Date();
1774
1809
  }
1775
1810
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), minute, this.value.getSeconds());
1776
- this.ezChange.emit();
1811
+ this.ezChange.emit(this.value);
1777
1812
  }
1778
1813
  selectSeconds(second) {
1779
1814
  if (!this.value) {
1780
1815
  this.value = new Date();
1781
1816
  }
1782
1817
  this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), this.value.getMinutes(), second);
1783
- this.ezChange.emit();
1818
+ this.ezChange.emit(this.value);
1784
1819
  }
1785
1820
  updateScroll(element) {
1786
1821
  if (element) {
@@ -1965,7 +2000,7 @@ let EzCollapsibleBox$1 = class extends HTMLElement$1 {
1965
2000
  this.iconPlacement = "left";
1966
2001
  }
1967
2002
  observeValue() {
1968
- this.ezChange.emit();
2003
+ this.ezChange.emit(this.value);
1969
2004
  }
1970
2005
  /**
1971
2006
  * Esconde ou revela o conteúdo do componente
@@ -2309,11 +2344,13 @@ let EzDateInput$1 = class extends HTMLElement$1 {
2309
2344
  this._textInput.setBlur();
2310
2345
  }
2311
2346
  changeValue(newValue) {
2312
- newValue = newValue == null ? null : DateUtils.clearTime(newValue);
2347
+ var _a;
2348
+ newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
2349
+ this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
2313
2350
  this._textInput.errorMessage = "";
2314
- if (newValue !== this.value) {
2351
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
2315
2352
  this.value = newValue;
2316
- this.ezChange.emit();
2353
+ this.ezChange.emit(this.value);
2317
2354
  }
2318
2355
  }
2319
2356
  showCalendar() {
@@ -2445,10 +2482,11 @@ let EzDateTimeInput$1 = class extends HTMLElement$1 {
2445
2482
  input.setSelectionRange(selectIni, selectFin);
2446
2483
  }
2447
2484
  changeValue(newValue) {
2485
+ var _a;
2448
2486
  this._textInput.errorMessage = "";
2449
- if (newValue !== this.value) {
2487
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
2450
2488
  this.value = newValue;
2451
- this.ezChange.emit();
2489
+ this.ezChange.emit(this.value);
2452
2490
  }
2453
2491
  }
2454
2492
  showCalendar() {
@@ -570,6 +570,7 @@ var Action;
570
570
  Action["DATA_LOADED"] = "dataLoaded";
571
571
  Action["SAVING_DATA"] = "savingData";
572
572
  Action["DATA_SAVED"] = "dataSaved";
573
+ Action["REMOVING_RECORDS"] = "removingRecords";
573
574
  Action["RECORDS_REMOVED"] = "recordsRemoved";
574
575
  Action["RECORDS_ADDED"] = "recordsAdded";
575
576
  Action["RECORDS_COPIED"] = "recordsCopied";
@@ -734,7 +735,11 @@ class RemovedRecordsReducerImpl {
734
735
  reduce(_stateManager, currentState, action) {
735
736
  switch (action.type) {
736
737
  case Action.RECORDS_REMOVED:
737
- return (currentState || []).concat(action.payload);
738
+ const { records, buffered } = action.payload;
739
+ if (buffered) {
740
+ return (currentState || []).concat(records);
741
+ }
742
+ return currentState;
738
743
  case Action.EDITION_CANCELED:
739
744
  case Action.DATA_SAVED:
740
745
  return undefined;
@@ -755,6 +760,12 @@ class RecordsReducerImpl {
755
760
  switch (action.type) {
756
761
  case Action.DATA_LOADED:
757
762
  return action.payload;
763
+ case Action.RECORDS_REMOVED:
764
+ const { records, buffered } = action.payload;
765
+ if (!buffered) {
766
+ return currentState.filter(r => !records.includes(r.__record__id__));
767
+ }
768
+ return currentState;
758
769
  case Action.DATA_SAVED:
759
770
  const recordsMap = new Map();
760
771
  const currentRecords = getRecords(stateManager);
@@ -928,7 +939,7 @@ class SelectionReducerImpl {
928
939
  case Action.DATA_SAVED:
929
940
  return updateSavedIds(stateManager, action.payload.records);
930
941
  case Action.RECORDS_REMOVED:
931
- const removed = action.payload;
942
+ const removed = action.payload.records;
932
943
  if (currentState && removed) {
933
944
  return currentState.filter(recordId => !removed.includes(recordId));
934
945
  }
@@ -1118,6 +1129,36 @@ class DataUnit {
1118
1129
  return Promise.resolve();
1119
1130
  });
1120
1131
  }
1132
+ removeSelectedRecords(buffered = false) {
1133
+ return __awaiter(this, void 0, void 0, function* () {
1134
+ const selection = getSelection(this._stateManager);
1135
+ if (selection) {
1136
+ return this.removeRecords(selection, buffered);
1137
+ }
1138
+ return Promise.resolve(selection);
1139
+ });
1140
+ }
1141
+ removeRecords(records, buffered = false) {
1142
+ return __awaiter(this, void 0, void 0, function* () {
1143
+ if (records) {
1144
+ if (buffered || !this.removeLoader) {
1145
+ this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: true });
1146
+ }
1147
+ else {
1148
+ this.dispatchAction(Action.REMOVING_RECORDS);
1149
+ return new Promise((resolve, fail) => {
1150
+ if (this.removeLoader) {
1151
+ this.removeLoader(this, records).then(records => {
1152
+ this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: false });
1153
+ resolve(records);
1154
+ }).catch(error => fail(error));
1155
+ }
1156
+ });
1157
+ }
1158
+ }
1159
+ return Promise.resolve(records);
1160
+ });
1161
+ }
1121
1162
  // API
1122
1163
  valueFromString(fieldName, value) {
1123
1164
  const descriptor = this.getField(fieldName);
@@ -1157,12 +1198,6 @@ class DataUnit {
1157
1198
  this.dispatchAction(Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
1158
1199
  }
1159
1200
  }
1160
- removeSelectedRecords() {
1161
- const selection = getSelection(this._stateManager);
1162
- if (selection) {
1163
- this.dispatchAction(Action.RECORDS_REMOVED, selection);
1164
- }
1165
- }
1166
1201
  getFieldValue(fieldName) {
1167
1202
  return getFieldValue(this._stateManager, fieldName);
1168
1203
  }