@sankhyalabs/ezui 1.1.82 → 1.1.85

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 (31) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/ez-button_11.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-form.cjs.entry.js +20 -26
  7. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  9. package/dist/cjs/{index-d5d5a77c.js → index-789fa661.js} +40 -26
  10. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +19 -25
  11. package/dist/custom-elements/index.js +59 -51
  12. package/dist/esm/ez-button_11.entry.js +1 -1
  13. package/dist/esm/ez-calendar.entry.js +1 -1
  14. package/dist/esm/ez-collapsible-box_7.entry.js +1 -1
  15. package/dist/esm/ez-combo-box.entry.js +1 -1
  16. package/dist/esm/ez-form.entry.js +20 -26
  17. package/dist/esm/ez-popover.entry.js +1 -1
  18. package/dist/esm/ez-time-input.entry.js +1 -1
  19. package/dist/esm/{index-2bb35caf.js → index-461f1302.js} +40 -26
  20. package/dist/ezui/ezui.esm.js +1 -1
  21. package/dist/ezui/p-7c4d4946.js +1 -0
  22. package/dist/ezui/{p-c151c043.entry.js → p-88e84ff2.entry.js} +1 -1
  23. package/dist/ezui/{p-e346a7ff.entry.js → p-8b7a4a16.entry.js} +1 -1
  24. package/dist/ezui/{p-513f2d2e.entry.js → p-9f98c4d1.entry.js} +1 -1
  25. package/dist/ezui/{p-da6ac011.entry.js → p-b1d7488d.entry.js} +1 -1
  26. package/dist/ezui/{p-48eddf77.entry.js → p-ca6240ff.entry.js} +1 -1
  27. package/dist/ezui/{p-2bb74de5.entry.js → p-cc448554.entry.js} +1 -1
  28. package/dist/ezui/{p-ec261c08.entry.js → p-d93a3e2b.entry.js} +1 -1
  29. package/package.json +3 -3
  30. package/react/{readme.md → .keepfolder} +0 -0
  31. package/dist/ezui/p-3749c696.js +0 -1
package/README.md CHANGED
@@ -62,7 +62,8 @@ Hoje estamos utilizando o padrão de semantic release baseado no [angular](https
62
62
  * `watch`: Task que monitora alterações no diretório /dist fazendo a cópia dos mesmos para a pasta .diststorybook/
63
63
  * `watch-global-css`: Monitora depedência @sankhyalabs/ez-design e realiza a cópia dos arquivos pra a pasta .diststorybook/themes/
64
64
  * `css-docs`: Monitora arquivos de CSS e SASS do projeto, quando houver alterações no mesmo é gerada a documentação referente a temas.
65
- - `npm run link`
65
+ - `npm run link`: Esse comando deve ser utilizado em ambiente de desenvolvimento, ele facilita o build e o link entre os projetos ezui e react-output, executando em um só comando:
66
+ o build do ezui, link do react-output e ezui, build do react-output e a disponibilização da dist do react-output no diretório correto do ezui.
66
67
  - `npm run build`
67
68
 
68
69
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- const index$1 = require('./index-d5d5a77c.js');
6
+ const index$1 = require('./index-789fa661.js');
7
7
  const AssetsUtils = require('./AssetsUtils-caf95dab.js');
8
8
 
9
9
  const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- require('./index-d5d5a77c.js');
6
+ require('./index-789fa661.js');
7
7
  const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
8
 
9
9
  const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__Time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:2px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}section{display:flex}.calendarTime{margin-left:-10px;display:flex;flex-direction:column;padding:12px 6px;padding-left:16px;padding-bottom:0px;background-color:var(--ez-calendar__Time--background-color);border-top-right-radius:var(--ez-calendar__body--border-radius);border-bottom-right-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__column{height:180px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:6px;padding-right:6px;display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.separatorTime{color:#A2ABB9}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- const index$1 = require('./index-d5d5a77c.js');
6
+ const index$1 = require('./index-789fa661.js');
7
7
  const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
8
8
  const ApplicationUtils = require('./ApplicationUtils-d1c1db56.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- require('./index-d5d5a77c.js');
6
+ require('./index-789fa661.js');
7
7
  const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
8
  const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- const index$1 = require('./index-d5d5a77c.js');
6
+ const index$1 = require('./index-789fa661.js');
7
7
  const ApplicationUtils = require('./ApplicationUtils-d1c1db56.js');
8
8
 
9
9
  const buildTextArea = ({ name, label }) => {
@@ -168,36 +168,30 @@ const buildFromConfig = (fields, dataUnit) => {
168
168
  if (config.visible !== false) {
169
169
  const tab = config.tab || "Geral";
170
170
  const descriptor = dataUnit.getField(config.name);
171
- if (!sheets.has(tab)) {
172
- sheets.set(tab, new Map());
173
- }
174
- let isRequired = false;
175
- if (config.required === undefined) {
176
- if (descriptor) {
177
- isRequired = descriptor.required;
171
+ if (descriptor) {
172
+ if (!sheets.has(tab)) {
173
+ sheets.set(tab, new Map());
178
174
  }
179
- }
180
- else {
181
- isRequired = config.required;
182
- }
183
- if (isRequired) {
184
- requiredFields.push(config.name);
185
- }
186
- const tabItens = sheets.get(tab);
187
- const fieldMD = { config, descriptor };
188
- const group = config.group;
189
- if (group) {
190
- const key = `group::${group}`;
191
- if (!tabItens.has(key)) {
192
- tabItens.set(key, { label: group, items: [fieldMD] });
175
+ const isRequired = config.required === undefined ? descriptor.required : config.required;
176
+ if (isRequired) {
177
+ requiredFields.push(config.name);
178
+ }
179
+ const tabItens = sheets.get(tab);
180
+ const fieldMD = { config, descriptor };
181
+ const group = config.group;
182
+ if (group) {
183
+ const key = `group::${group}`;
184
+ if (!tabItens.has(key)) {
185
+ tabItens.set(key, { label: group, items: [fieldMD] });
186
+ }
187
+ else {
188
+ tabItens.get(key).items.push(fieldMD);
189
+ }
193
190
  }
194
191
  else {
195
- tabItens.get(key).items.push(fieldMD);
192
+ tabItens.set(config.name, fieldMD);
196
193
  }
197
194
  }
198
- else {
199
- tabItens.set(config.name, fieldMD);
200
- }
201
195
  }
202
196
  });
203
197
  const metadata = new FormMetadata();
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- require('./index-d5d5a77c.js');
6
+ require('./index-789fa661.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%}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0bce1636.js');
6
- const index$1 = require('./index-d5d5a77c.js');
6
+ const index$1 = require('./index-789fa661.js');
7
7
  const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
8
8
  const AssetsUtils = require('./AssetsUtils-caf95dab.js');
9
9
 
@@ -590,6 +590,7 @@ exports.Action = void 0;
590
590
  Action["DATA_SAVED"] = "dataSaved";
591
591
  Action["RECORDS_REMOVED"] = "recordsRemoved";
592
592
  Action["RECORDS_ADDED"] = "recordsAdded";
593
+ Action["RECORDS_COPIED"] = "recordsCopied";
593
594
  Action["DATA_CHANGED"] = "dataChanged";
594
595
  Action["EDITION_CANCELED"] = "editionCanceled";
595
596
  Action["CHANGE_UNDONE"] = "changeUndone";
@@ -628,7 +629,6 @@ class StateManager {
628
629
  }
629
630
  process(action) {
630
631
  const oldPresent = this._present;
631
- let hasChange = false;
632
632
  let hasHistChange = false;
633
633
  this._histClean = false;
634
634
  this._reducers.forEach(reducer => {
@@ -638,7 +638,6 @@ class StateManager {
638
638
  const newSlice = reducer.reduce(this, oldSlice, action);
639
639
  if (newSlice !== oldSlice) {
640
640
  this.updateSlice(sliceName, newSlice, isHistoric);
641
- hasChange = true;
642
641
  hasHistChange || (hasHistChange = isHistoric);
643
642
  }
644
643
  });
@@ -647,16 +646,6 @@ class StateManager {
647
646
  this._future = [];
648
647
  document.dispatchEvent(new CustomEvent("undoableAction", { detail: this }));
649
648
  }
650
- if (hasChange) {
651
- console.log(JSON.stringify(this, (_key, value) => {
652
- if (value instanceof Map) {
653
- return { dataType: "Map", value: Array.from(value.entries()) };
654
- }
655
- else {
656
- return value;
657
- }
658
- }, 3));
659
- }
660
649
  }
661
650
  select(sliceName, selector) {
662
651
  const isHistoric = this.isHistoric(sliceName);
@@ -819,6 +808,7 @@ class AddedRecordsReducerImpl {
819
808
  reduce(_stateManager, currentState, action) {
820
809
  switch (action.type) {
821
810
  case exports.Action.RECORDS_ADDED:
811
+ case exports.Action.RECORDS_COPIED:
822
812
  return (currentState || []).concat(action.payload);
823
813
  case exports.Action.DATA_SAVED:
824
814
  case exports.Action.EDITION_CANCELED:
@@ -951,6 +941,7 @@ class SelectionReducerImpl {
951
941
  reduce(stateManager, currentState, action) {
952
942
  switch (action.type) {
953
943
  case exports.Action.RECORDS_ADDED:
944
+ case exports.Action.RECORDS_COPIED:
954
945
  return action.payload.map((r) => r.__record__id__);
955
946
  case exports.Action.DATA_SAVED:
956
947
  return updateSavedIds(stateManager, action.payload.records);
@@ -1078,6 +1069,7 @@ class DataUnit {
1078
1069
  this._observers = [];
1079
1070
  this._filterProviders = [];
1080
1071
  this._sortingProvider = undefined;
1072
+ this._interceptors = [];
1081
1073
  }
1082
1074
  get name() {
1083
1075
  return this._name;
@@ -1145,6 +1137,9 @@ class DataUnit {
1145
1137
  });
1146
1138
  }
1147
1139
  // API
1140
+ addInterceptor(interceptor) {
1141
+ this._interceptors.push(interceptor);
1142
+ }
1148
1143
  addFilterProvider(provider) {
1149
1144
  this._filterProviders.push(provider);
1150
1145
  }
@@ -1170,6 +1165,12 @@ class DataUnit {
1170
1165
  addRecord() {
1171
1166
  this.dispatchAction(exports.Action.RECORDS_ADDED, prepareAddedRecordId(this._stateManager, [{}]));
1172
1167
  }
1168
+ copySelected() {
1169
+ const selectedRecords = this.getSelectedRecords();
1170
+ if (selectedRecords) {
1171
+ this.dispatchAction(exports.Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
1172
+ }
1173
+ }
1173
1174
  removeSelectedRecords() {
1174
1175
  const selection = getSelection(this._stateManager);
1175
1176
  if (selection) {
@@ -1195,6 +1196,13 @@ class DataUnit {
1195
1196
  setSelectionByIndex(selection) {
1196
1197
  this.dispatchAction(exports.Action.SELECTION_CHANGED, { type: "index", selection });
1197
1198
  }
1199
+ getSelectedRecords() {
1200
+ const selection = this.getSelection();
1201
+ if (selection) {
1202
+ const currentRecords = this.records;
1203
+ return currentRecords === null || currentRecords === void 0 ? void 0 : currentRecords.filter(r => selection.includes(r.__record__id__));
1204
+ }
1205
+ }
1198
1206
  nextRecord() {
1199
1207
  this.dispatchAction(exports.Action.NEXT_SELECTED);
1200
1208
  }
@@ -1227,10 +1235,17 @@ class DataUnit {
1227
1235
  }
1228
1236
  // Actions / State manager
1229
1237
  dispatchAction(actionType, payload) {
1230
- const action = new DataUnitAction(actionType, payload);
1231
- //interceptor
1232
- this._stateManager.process(action);
1233
- this._observers.forEach(f => f(action));
1238
+ var _a;
1239
+ let action = new DataUnitAction(actionType, payload);
1240
+ (_a = this._interceptors) === null || _a === void 0 ? void 0 : _a.forEach(interceptor => {
1241
+ if (action) {
1242
+ action = interceptor.interceptAction(action);
1243
+ }
1244
+ });
1245
+ if (action) {
1246
+ this._stateManager.process(action);
1247
+ this._observers.forEach(f => f(action));
1248
+ }
1234
1249
  }
1235
1250
  subscribe(observer) {
1236
1251
  this._observers.push(observer);
@@ -2030,7 +2045,7 @@ exports.printError = printError;
2030
2045
 
2031
2046
 
2032
2047
 
2033
- function toNormalizedArgs(args) {
2048
+ function toNormalizedOptions(args) {
2034
2049
  const firstArg = args[0];
2035
2050
 
2036
2051
  if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
@@ -2097,13 +2112,13 @@ class GraphQLError extends Error {
2097
2112
  */
2098
2113
 
2099
2114
  /**
2100
- * @deprecated Please use the `GraphQLErrorArgs` constructor overload instead.
2115
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
2101
2116
  */
2102
2117
  constructor(message, ...rawArgs) {
2103
2118
  var _this$nodes, _nodeLocations$, _ref;
2104
2119
 
2105
2120
  const { nodes, source, positions, path, originalError, extensions } =
2106
- toNormalizedArgs(rawArgs);
2121
+ toNormalizedOptions(rawArgs);
2107
2122
  super(message);
2108
2123
  this.name = 'GraphQLError';
2109
2124
  this.path = path !== null && path !== void 0 ? path : undefined;
@@ -2276,7 +2291,7 @@ function printError(error) {
2276
2291
  * Given a GraphQLError, format it according to the rules described by the
2277
2292
  * Response Format, Errors section of the GraphQL Specification.
2278
2293
  *
2279
- * @deprecated Please use `error.toString` instead. Will be removed in v17
2294
+ * @deprecated Please use `error.toJSON` instead. Will be removed in v17
2280
2295
  */
2281
2296
 
2282
2297
  function formatError(error) {
@@ -2298,12 +2313,10 @@ exports.syntaxError = syntaxError;
2298
2313
  * descriptive information about the syntax error's position in the source.
2299
2314
  */
2300
2315
  function syntaxError(source, position, description) {
2301
- return new GraphQLError_1.GraphQLError(
2302
- `Syntax Error: ${description}`,
2303
- undefined,
2316
+ return new GraphQLError_1.GraphQLError(`Syntax Error: ${description}`, {
2304
2317
  source,
2305
- [position],
2306
- );
2318
+ positions: [position],
2319
+ });
2307
2320
  }
2308
2321
  });
2309
2322
 
@@ -4124,8 +4137,9 @@ exports.instanceOf = void 0;
4124
4137
  * See: https://webpack.js.org/guides/production/
4125
4138
  */
4126
4139
  const instanceOf =
4127
- /* c8 ignore next 5 */
4140
+ /* c8 ignore next 6 */
4128
4141
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
4142
+ // eslint-disable-next-line no-undef
4129
4143
  function instanceOf(value, constructor) {
4130
4144
  return value instanceof constructor;
4131
4145
  }
@@ -41,36 +41,30 @@ export const buildFromConfig = (fields, dataUnit) => {
41
41
  if (config.visible !== false) {
42
42
  const tab = config.tab || "Geral";
43
43
  const descriptor = dataUnit.getField(config.name);
44
- if (!sheets.has(tab)) {
45
- sheets.set(tab, new Map());
46
- }
47
- let isRequired = false;
48
- if (config.required === undefined) {
49
- if (descriptor) {
50
- isRequired = descriptor.required;
44
+ if (descriptor) {
45
+ if (!sheets.has(tab)) {
46
+ sheets.set(tab, new Map());
51
47
  }
52
- }
53
- else {
54
- isRequired = config.required;
55
- }
56
- if (isRequired) {
57
- requiredFields.push(config.name);
58
- }
59
- const tabItens = sheets.get(tab);
60
- const fieldMD = { config, descriptor };
61
- const group = config.group;
62
- if (group) {
63
- const key = `group::${group}`;
64
- if (!tabItens.has(key)) {
65
- tabItens.set(key, { label: group, items: [fieldMD] });
48
+ const isRequired = config.required === undefined ? descriptor.required : config.required;
49
+ if (isRequired) {
50
+ requiredFields.push(config.name);
51
+ }
52
+ const tabItens = sheets.get(tab);
53
+ const fieldMD = { config, descriptor };
54
+ const group = config.group;
55
+ if (group) {
56
+ const key = `group::${group}`;
57
+ if (!tabItens.has(key)) {
58
+ tabItens.set(key, { label: group, items: [fieldMD] });
59
+ }
60
+ else {
61
+ tabItens.get(key).items.push(fieldMD);
62
+ }
66
63
  }
67
64
  else {
68
- tabItens.get(key).items.push(fieldMD);
65
+ tabItens.set(config.name, fieldMD);
69
66
  }
70
67
  }
71
- else {
72
- tabItens.set(config.name, fieldMD);
73
- }
74
68
  }
75
69
  });
76
70
  const metadata = new FormMetadata();
@@ -899,6 +899,7 @@ var Action;
899
899
  Action["DATA_SAVED"] = "dataSaved";
900
900
  Action["RECORDS_REMOVED"] = "recordsRemoved";
901
901
  Action["RECORDS_ADDED"] = "recordsAdded";
902
+ Action["RECORDS_COPIED"] = "recordsCopied";
902
903
  Action["DATA_CHANGED"] = "dataChanged";
903
904
  Action["EDITION_CANCELED"] = "editionCanceled";
904
905
  Action["CHANGE_UNDONE"] = "changeUndone";
@@ -937,7 +938,6 @@ class StateManager {
937
938
  }
938
939
  process(action) {
939
940
  const oldPresent = this._present;
940
- let hasChange = false;
941
941
  let hasHistChange = false;
942
942
  this._histClean = false;
943
943
  this._reducers.forEach(reducer => {
@@ -947,7 +947,6 @@ class StateManager {
947
947
  const newSlice = reducer.reduce(this, oldSlice, action);
948
948
  if (newSlice !== oldSlice) {
949
949
  this.updateSlice(sliceName, newSlice, isHistoric);
950
- hasChange = true;
951
950
  hasHistChange || (hasHistChange = isHistoric);
952
951
  }
953
952
  });
@@ -956,16 +955,6 @@ class StateManager {
956
955
  this._future = [];
957
956
  document.dispatchEvent(new CustomEvent("undoableAction", { detail: this }));
958
957
  }
959
- if (hasChange) {
960
- console.log(JSON.stringify(this, (_key, value) => {
961
- if (value instanceof Map) {
962
- return { dataType: "Map", value: Array.from(value.entries()) };
963
- }
964
- else {
965
- return value;
966
- }
967
- }, 3));
968
- }
969
958
  }
970
959
  select(sliceName, selector) {
971
960
  const isHistoric = this.isHistoric(sliceName);
@@ -1128,6 +1117,7 @@ class AddedRecordsReducerImpl {
1128
1117
  reduce(_stateManager, currentState, action) {
1129
1118
  switch (action.type) {
1130
1119
  case Action.RECORDS_ADDED:
1120
+ case Action.RECORDS_COPIED:
1131
1121
  return (currentState || []).concat(action.payload);
1132
1122
  case Action.DATA_SAVED:
1133
1123
  case Action.EDITION_CANCELED:
@@ -1260,6 +1250,7 @@ class SelectionReducerImpl {
1260
1250
  reduce(stateManager, currentState, action) {
1261
1251
  switch (action.type) {
1262
1252
  case Action.RECORDS_ADDED:
1253
+ case Action.RECORDS_COPIED:
1263
1254
  return action.payload.map((r) => r.__record__id__);
1264
1255
  case Action.DATA_SAVED:
1265
1256
  return updateSavedIds(stateManager, action.payload.records);
@@ -1387,6 +1378,7 @@ class DataUnit {
1387
1378
  this._observers = [];
1388
1379
  this._filterProviders = [];
1389
1380
  this._sortingProvider = undefined;
1381
+ this._interceptors = [];
1390
1382
  }
1391
1383
  get name() {
1392
1384
  return this._name;
@@ -1454,6 +1446,9 @@ class DataUnit {
1454
1446
  });
1455
1447
  }
1456
1448
  // API
1449
+ addInterceptor(interceptor) {
1450
+ this._interceptors.push(interceptor);
1451
+ }
1457
1452
  addFilterProvider(provider) {
1458
1453
  this._filterProviders.push(provider);
1459
1454
  }
@@ -1479,6 +1474,12 @@ class DataUnit {
1479
1474
  addRecord() {
1480
1475
  this.dispatchAction(Action.RECORDS_ADDED, prepareAddedRecordId(this._stateManager, [{}]));
1481
1476
  }
1477
+ copySelected() {
1478
+ const selectedRecords = this.getSelectedRecords();
1479
+ if (selectedRecords) {
1480
+ this.dispatchAction(Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
1481
+ }
1482
+ }
1482
1483
  removeSelectedRecords() {
1483
1484
  const selection = getSelection(this._stateManager);
1484
1485
  if (selection) {
@@ -1504,6 +1505,13 @@ class DataUnit {
1504
1505
  setSelectionByIndex(selection) {
1505
1506
  this.dispatchAction(Action.SELECTION_CHANGED, { type: "index", selection });
1506
1507
  }
1508
+ getSelectedRecords() {
1509
+ const selection = this.getSelection();
1510
+ if (selection) {
1511
+ const currentRecords = this.records;
1512
+ return currentRecords === null || currentRecords === void 0 ? void 0 : currentRecords.filter(r => selection.includes(r.__record__id__));
1513
+ }
1514
+ }
1507
1515
  nextRecord() {
1508
1516
  this.dispatchAction(Action.NEXT_SELECTED);
1509
1517
  }
@@ -1536,10 +1544,17 @@ class DataUnit {
1536
1544
  }
1537
1545
  // Actions / State manager
1538
1546
  dispatchAction(actionType, payload) {
1539
- const action = new DataUnitAction(actionType, payload);
1540
- //interceptor
1541
- this._stateManager.process(action);
1542
- this._observers.forEach(f => f(action));
1547
+ var _a;
1548
+ let action = new DataUnitAction(actionType, payload);
1549
+ (_a = this._interceptors) === null || _a === void 0 ? void 0 : _a.forEach(interceptor => {
1550
+ if (action) {
1551
+ action = interceptor.interceptAction(action);
1552
+ }
1553
+ });
1554
+ if (action) {
1555
+ this._stateManager.process(action);
1556
+ this._observers.forEach(f => f(action));
1557
+ }
1543
1558
  }
1544
1559
  subscribe(observer) {
1545
1560
  this._observers.push(observer);
@@ -2355,7 +2370,7 @@ exports.printError = printError;
2355
2370
 
2356
2371
 
2357
2372
 
2358
- function toNormalizedArgs(args) {
2373
+ function toNormalizedOptions(args) {
2359
2374
  const firstArg = args[0];
2360
2375
 
2361
2376
  if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
@@ -2422,13 +2437,13 @@ class GraphQLError extends Error {
2422
2437
  */
2423
2438
 
2424
2439
  /**
2425
- * @deprecated Please use the `GraphQLErrorArgs` constructor overload instead.
2440
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
2426
2441
  */
2427
2442
  constructor(message, ...rawArgs) {
2428
2443
  var _this$nodes, _nodeLocations$, _ref;
2429
2444
 
2430
2445
  const { nodes, source, positions, path, originalError, extensions } =
2431
- toNormalizedArgs(rawArgs);
2446
+ toNormalizedOptions(rawArgs);
2432
2447
  super(message);
2433
2448
  this.name = 'GraphQLError';
2434
2449
  this.path = path !== null && path !== void 0 ? path : undefined;
@@ -2601,7 +2616,7 @@ function printError(error) {
2601
2616
  * Given a GraphQLError, format it according to the rules described by the
2602
2617
  * Response Format, Errors section of the GraphQL Specification.
2603
2618
  *
2604
- * @deprecated Please use `error.toString` instead. Will be removed in v17
2619
+ * @deprecated Please use `error.toJSON` instead. Will be removed in v17
2605
2620
  */
2606
2621
 
2607
2622
  function formatError(error) {
@@ -2623,12 +2638,10 @@ exports.syntaxError = syntaxError;
2623
2638
  * descriptive information about the syntax error's position in the source.
2624
2639
  */
2625
2640
  function syntaxError(source, position, description) {
2626
- return new GraphQLError_1.GraphQLError(
2627
- `Syntax Error: ${description}`,
2628
- undefined,
2641
+ return new GraphQLError_1.GraphQLError(`Syntax Error: ${description}`, {
2629
2642
  source,
2630
- [position],
2631
- );
2643
+ positions: [position],
2644
+ });
2632
2645
  }
2633
2646
  });
2634
2647
 
@@ -4449,8 +4462,9 @@ exports.instanceOf = void 0;
4449
4462
  * See: https://webpack.js.org/guides/production/
4450
4463
  */
4451
4464
  const instanceOf =
4452
- /* c8 ignore next 5 */
4465
+ /* c8 ignore next 6 */
4453
4466
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
4467
+ // eslint-disable-next-line no-undef
4454
4468
  function instanceOf(value, constructor) {
4455
4469
  return value instanceof constructor;
4456
4470
  }
@@ -8795,36 +8809,30 @@ const buildFromConfig = (fields, dataUnit) => {
8795
8809
  if (config.visible !== false) {
8796
8810
  const tab = config.tab || "Geral";
8797
8811
  const descriptor = dataUnit.getField(config.name);
8798
- if (!sheets.has(tab)) {
8799
- sheets.set(tab, new Map());
8800
- }
8801
- let isRequired = false;
8802
- if (config.required === undefined) {
8803
- if (descriptor) {
8804
- isRequired = descriptor.required;
8812
+ if (descriptor) {
8813
+ if (!sheets.has(tab)) {
8814
+ sheets.set(tab, new Map());
8805
8815
  }
8806
- }
8807
- else {
8808
- isRequired = config.required;
8809
- }
8810
- if (isRequired) {
8811
- requiredFields.push(config.name);
8812
- }
8813
- const tabItens = sheets.get(tab);
8814
- const fieldMD = { config, descriptor };
8815
- const group = config.group;
8816
- if (group) {
8817
- const key = `group::${group}`;
8818
- if (!tabItens.has(key)) {
8819
- tabItens.set(key, { label: group, items: [fieldMD] });
8816
+ const isRequired = config.required === undefined ? descriptor.required : config.required;
8817
+ if (isRequired) {
8818
+ requiredFields.push(config.name);
8819
+ }
8820
+ const tabItens = sheets.get(tab);
8821
+ const fieldMD = { config, descriptor };
8822
+ const group = config.group;
8823
+ if (group) {
8824
+ const key = `group::${group}`;
8825
+ if (!tabItens.has(key)) {
8826
+ tabItens.set(key, { label: group, items: [fieldMD] });
8827
+ }
8828
+ else {
8829
+ tabItens.get(key).items.push(fieldMD);
8830
+ }
8820
8831
  }
8821
8832
  else {
8822
- tabItens.get(key).items.push(fieldMD);
8833
+ tabItens.set(config.name, fieldMD);
8823
8834
  }
8824
8835
  }
8825
- else {
8826
- tabItens.set(config.name, fieldMD);
8827
- }
8828
8836
  }
8829
8837
  });
8830
8838
  const metadata = new FormMetadata();
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './index-d80a8d1f.js';
2
- import { c as createCommonjsModule, a as commonjsGlobal, A as Action, M as MaskFormatter, D as DataUnit, b as DataType, U as UserInterface } from './index-2bb35caf.js';
2
+ import { c as createCommonjsModule, a as commonjsGlobal, A as Action, M as MaskFormatter, D as DataUnit, b as DataType, U as UserInterface } from './index-461f1302.js';
3
3
  import { g as getSpritePath } from './AssetsUtils-9b1d9c38.js';
4
4
 
5
5
  const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";