@sankhyalabs/ezui 4.12.0 → 4.12.2

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/dist/cjs/ez-combo-box.cjs.entry.js +23 -22
  2. package/dist/cjs/ez-dialog.cjs.entry.js +12 -0
  3. package/dist/cjs/ez-form.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-popover.cjs.entry.js +10 -1
  5. package/dist/cjs/ez-popup.cjs.entry.js +12 -0
  6. package/dist/collection/components/ez-combo-box/ez-combo-box.js +23 -22
  7. package/dist/collection/components/ez-dialog/ez-dialog.js +15 -0
  8. package/dist/collection/components/ez-popover/ez-popover.js +12 -0
  9. package/dist/collection/components/ez-popup/ez-popup.js +15 -0
  10. package/dist/collection/utils/form/FormMetadata.js +1 -1
  11. package/dist/custom-elements/index.js +58 -24
  12. package/dist/esm/ez-combo-box.entry.js +23 -22
  13. package/dist/esm/ez-dialog.entry.js +12 -0
  14. package/dist/esm/ez-form.entry.js +1 -1
  15. package/dist/esm/ez-popover.entry.js +10 -1
  16. package/dist/esm/ez-popup.entry.js +12 -0
  17. package/dist/ezui/ezui.esm.js +1 -1
  18. package/dist/ezui/p-144d1ff7.entry.js +1 -0
  19. package/dist/ezui/{p-ea5a5236.entry.js → p-18d7de85.entry.js} +1 -1
  20. package/dist/ezui/p-45040b18.entry.js +1 -0
  21. package/dist/ezui/p-62ebbd06.entry.js +1 -0
  22. package/dist/ezui/p-bd1d887a.entry.js +1 -0
  23. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -1
  24. package/dist/types/components/ez-dialog/ez-dialog.d.ts +5 -2
  25. package/dist/types/components/ez-popover/ez-popover.d.ts +3 -0
  26. package/dist/types/components/ez-popup/ez-popup.d.ts +3 -0
  27. package/package.json +1 -1
  28. package/dist/ezui/p-19995acb.entry.js +0 -1
  29. package/dist/ezui/p-709067e4.entry.js +0 -1
  30. package/dist/ezui/p-82a60d38.entry.js +0 -1
  31. package/dist/ezui/p-fc2faf3a.entry.js +0 -1
@@ -23,6 +23,7 @@ const EzComboBox = class {
23
23
  this._tabPressed = false;
24
24
  this._textEmptyList = "Nenhum resultado encontrado";
25
25
  this._textEmptySearch = "Nenhum resultado de {0} encontrado";
26
+ this._lookupMode = false;
26
27
  this._preSelection = undefined;
27
28
  this._visibleOptions = undefined;
28
29
  this._startLoading = false;
@@ -53,24 +54,29 @@ const EzComboBox = class {
53
54
  }
54
55
  observeValue(newValue, oldValue) {
55
56
  if (this._textInput && newValue != oldValue) {
56
- if (this.searchMode && typeof newValue === "string") {
57
- this.setInputValue();
58
- return;
59
- }
60
- const newValueSelected = this.getSelectedOption(newValue);
61
- const oldValueSelected = this.getSelectedOption(oldValue);
62
- const currentValue = this.getSelectedOption(this.value);
63
- if (this.isDifferentValues(currentValue, newValueSelected)) {
64
- this.value = newValueSelected;
65
- }
66
- if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
67
- this.setInputValue();
68
- const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
69
- if (!this.isLookUpSearch(newValue, oldValue)) {
70
- this.ezChange.emit(valueEmitted);
57
+ try {
58
+ if (this.searchMode && typeof newValue === "string") {
59
+ this.setInputValue();
60
+ return;
61
+ }
62
+ const newValueSelected = this.getSelectedOption(newValue);
63
+ const oldValueSelected = this.getSelectedOption(oldValue);
64
+ const currentValue = this.getSelectedOption(this.value);
65
+ if (this.isDifferentValues(currentValue, newValueSelected)) {
66
+ this.value = newValueSelected;
71
67
  }
68
+ if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
69
+ this.setInputValue();
70
+ const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
71
+ if (!this._lookupMode) {
72
+ this.ezChange.emit(valueEmitted);
73
+ }
74
+ }
75
+ this.resetOptions();
76
+ }
77
+ finally {
78
+ this._lookupMode = false;
72
79
  }
73
- this.resetOptions();
74
80
  }
75
81
  }
76
82
  /**
@@ -383,6 +389,7 @@ const EzComboBox = class {
383
389
  if (!value.label) {
384
390
  value.label = `<SEM ${this.getFieldLabel()}>`;
385
391
  }
392
+ this._lookupMode = true;
386
393
  this.value = value;
387
394
  }
388
395
  loadOptionValue(argument) {
@@ -552,12 +559,6 @@ const EzComboBox = class {
552
559
  onTextInputFocusOutHandler() {
553
560
  this.cancelPreselection();
554
561
  }
555
- isLookUpSearch(newValue, oldValue) {
556
- return this.searchMode &&
557
- typeof oldValue !== "object" &&
558
- typeof newValue === "object" &&
559
- oldValue == newValue.value;
560
- }
561
562
  render() {
562
563
  var _a;
563
564
  core.ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
@@ -31,6 +31,7 @@ const EzDialog = class {
31
31
  this.labelCancel = 'Não';
32
32
  this.btnConfirmDanger = false;
33
33
  this._messageQueue = [];
34
+ this._bodyOverflow = '';
34
35
  this.confirm = false;
35
36
  this.dialogType = undefined;
36
37
  this.message = undefined;
@@ -39,6 +40,14 @@ const EzDialog = class {
39
40
  this.ezTitle = undefined;
40
41
  this.beforeClose = undefined;
41
42
  }
43
+ observeConfig() {
44
+ this.manageOverflow();
45
+ }
46
+ manageOverflow() {
47
+ if (this.opened)
48
+ this._bodyOverflow = window.document.body.style.overflow;
49
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
50
+ }
42
51
  handleButtonClick(selectedOption) {
43
52
  if (this._currentMessage.beforeClose && this._currentMessage.beforeClose(selectedOption) === false) {
44
53
  return;
@@ -144,6 +153,9 @@ const EzDialog = class {
144
153
  return null;
145
154
  }
146
155
  get _element() { return index.getElement(this); }
156
+ static get watchers() { return {
157
+ "opened": ["observeConfig"]
158
+ }; }
147
159
  };
148
160
  EzDialog.style = ezDialogCss;
149
161
 
@@ -118,7 +118,7 @@ const buildFormMetadata = (config, dataUnit, includeDetails = false) => {
118
118
  cleanOnCopyFields.push(field.name);
119
119
  }
120
120
  let defaultValue = field.defaultValue == undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : field.defaultValue;
121
- if (defaultValue) {
121
+ if (defaultValue && defaultValue.value != undefined) {
122
122
  const { type, value } = defaultValue;
123
123
  if (type) {
124
124
  if (type === "V") {
@@ -12,6 +12,7 @@ const EzPopover = class {
12
12
  index.registerInstance(this, hostRef);
13
13
  this.ezVisibilityChange = index.createEvent(this, "ezVisibilityChange", 7);
14
14
  this._firstRender = true;
15
+ this._bodyOverflow = '';
15
16
  this.innerClickTest = (_popOvercontainer, node, eventOrigin) => {
16
17
  const innerContainers = [_popOvercontainer];
17
18
  if (this.innerElement) {
@@ -74,6 +75,14 @@ const EzPopover = class {
74
75
  this.ezVisibilityChange.emit(newValue);
75
76
  }
76
77
  }
78
+ observeConfig() {
79
+ this.manageOverflow();
80
+ }
81
+ manageOverflow() {
82
+ if (this.opened)
83
+ this._bodyOverflow = window.document.body.style.overflow;
84
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
85
+ }
77
86
  /**
78
87
  * Atualiza a posição do popover.
79
88
  */
@@ -132,7 +141,7 @@ const EzPopover = class {
132
141
  }
133
142
  get _host() { return index.getElement(this); }
134
143
  static get watchers() { return {
135
- "opened": ["observeOpened"]
144
+ "opened": ["observeOpened", "observeConfig"]
136
145
  }; }
137
146
  };
138
147
  EzPopover.style = ezPopoverCss;
@@ -17,12 +17,21 @@ const EzPopup = class {
17
17
  "large": "col--sd-9",
18
18
  "x-large": "col--sd-11"
19
19
  };
20
+ this._bodyOverflow = '';
20
21
  this.size = "medium";
21
22
  this.opened = false;
22
23
  this.useHeader = true;
23
24
  this.heightMode = "full";
24
25
  this.ezTitle = undefined;
25
26
  }
27
+ observeConfig() {
28
+ this.manageOverflow();
29
+ }
30
+ manageOverflow() {
31
+ if (this.opened)
32
+ this._bodyOverflow = window.document.body.style.overflow;
33
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
34
+ }
26
35
  getGridSize() {
27
36
  return this._sizeClasses[this.size] || this._sizeClasses["medium"];
28
37
  }
@@ -39,6 +48,9 @@ const EzPopup = class {
39
48
  }
40
49
  return null;
41
50
  }
51
+ static get watchers() { return {
52
+ "opened": ["observeConfig"]
53
+ }; }
42
54
  };
43
55
  EzPopup.style = ezPopupCss;
44
56
 
@@ -11,6 +11,7 @@ export class EzComboBox {
11
11
  this._tabPressed = false;
12
12
  this._textEmptyList = "Nenhum resultado encontrado";
13
13
  this._textEmptySearch = "Nenhum resultado de {0} encontrado";
14
+ this._lookupMode = false;
14
15
  this._preSelection = undefined;
15
16
  this._visibleOptions = undefined;
16
17
  this._startLoading = false;
@@ -41,24 +42,29 @@ export class EzComboBox {
41
42
  }
42
43
  observeValue(newValue, oldValue) {
43
44
  if (this._textInput && newValue != oldValue) {
44
- if (this.searchMode && typeof newValue === "string") {
45
- this.setInputValue();
46
- return;
47
- }
48
- const newValueSelected = this.getSelectedOption(newValue);
49
- const oldValueSelected = this.getSelectedOption(oldValue);
50
- const currentValue = this.getSelectedOption(this.value);
51
- if (this.isDifferentValues(currentValue, newValueSelected)) {
52
- this.value = newValueSelected;
53
- }
54
- if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
55
- this.setInputValue();
56
- const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
57
- if (!this.isLookUpSearch(newValue, oldValue)) {
58
- this.ezChange.emit(valueEmitted);
45
+ try {
46
+ if (this.searchMode && typeof newValue === "string") {
47
+ this.setInputValue();
48
+ return;
49
+ }
50
+ const newValueSelected = this.getSelectedOption(newValue);
51
+ const oldValueSelected = this.getSelectedOption(oldValue);
52
+ const currentValue = this.getSelectedOption(this.value);
53
+ if (this.isDifferentValues(currentValue, newValueSelected)) {
54
+ this.value = newValueSelected;
59
55
  }
56
+ if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
57
+ this.setInputValue();
58
+ const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
59
+ if (!this._lookupMode) {
60
+ this.ezChange.emit(valueEmitted);
61
+ }
62
+ }
63
+ this.resetOptions();
64
+ }
65
+ finally {
66
+ this._lookupMode = false;
60
67
  }
61
- this.resetOptions();
62
68
  }
63
69
  }
64
70
  /**
@@ -371,6 +377,7 @@ export class EzComboBox {
371
377
  if (!value.label) {
372
378
  value.label = `<SEM ${this.getFieldLabel()}>`;
373
379
  }
380
+ this._lookupMode = true;
374
381
  this.value = value;
375
382
  }
376
383
  loadOptionValue(argument) {
@@ -540,12 +547,6 @@ export class EzComboBox {
540
547
  onTextInputFocusOutHandler() {
541
548
  this.cancelPreselection();
542
549
  }
543
- isLookUpSearch(newValue, oldValue) {
544
- return this.searchMode &&
545
- typeof oldValue !== "object" &&
546
- typeof newValue === "object" &&
547
- oldValue == newValue.value;
548
- }
549
550
  render() {
550
551
  var _a;
551
552
  ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
@@ -21,6 +21,7 @@ export class EzDialog {
21
21
  this.labelCancel = 'Não';
22
22
  this.btnConfirmDanger = false;
23
23
  this._messageQueue = [];
24
+ this._bodyOverflow = '';
24
25
  this.confirm = false;
25
26
  this.dialogType = undefined;
26
27
  this.message = undefined;
@@ -29,6 +30,14 @@ export class EzDialog {
29
30
  this.ezTitle = undefined;
30
31
  this.beforeClose = undefined;
31
32
  }
33
+ observeConfig() {
34
+ this.manageOverflow();
35
+ }
36
+ manageOverflow() {
37
+ if (this.opened)
38
+ this._bodyOverflow = window.document.body.style.overflow;
39
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
40
+ }
32
41
  handleButtonClick(selectedOption) {
33
42
  if (this._currentMessage.beforeClose && this._currentMessage.beforeClose(selectedOption) === false) {
34
43
  return;
@@ -365,4 +374,10 @@ export class EzDialog {
365
374
  };
366
375
  }
367
376
  static get elementRef() { return "_element"; }
377
+ static get watchers() {
378
+ return [{
379
+ "propName": "opened",
380
+ "methodName": "observeConfig"
381
+ }];
382
+ }
368
383
  }
@@ -3,6 +3,7 @@ import { FloatingManager } from "@sankhyalabs/core";
3
3
  export class EzPopover {
4
4
  constructor() {
5
5
  this._firstRender = true;
6
+ this._bodyOverflow = '';
6
7
  this.innerClickTest = (_popOvercontainer, node, eventOrigin) => {
7
8
  const innerContainers = [_popOvercontainer];
8
9
  if (this.innerElement) {
@@ -65,6 +66,14 @@ export class EzPopover {
65
66
  this.ezVisibilityChange.emit(newValue);
66
67
  }
67
68
  }
69
+ observeConfig() {
70
+ this.manageOverflow();
71
+ }
72
+ manageOverflow() {
73
+ if (this.opened)
74
+ this._bodyOverflow = window.document.body.style.overflow;
75
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
76
+ }
68
77
  /**
69
78
  * Atualiza a posição do popover.
70
79
  */
@@ -400,6 +409,9 @@ export class EzPopover {
400
409
  return [{
401
410
  "propName": "opened",
402
411
  "methodName": "observeOpened"
412
+ }, {
413
+ "propName": "opened",
414
+ "methodName": "observeConfig"
403
415
  }];
404
416
  }
405
417
  }
@@ -8,12 +8,21 @@ export class EzPopup {
8
8
  "large": "col--sd-9",
9
9
  "x-large": "col--sd-11"
10
10
  };
11
+ this._bodyOverflow = '';
11
12
  this.size = "medium";
12
13
  this.opened = false;
13
14
  this.useHeader = true;
14
15
  this.heightMode = "full";
15
16
  this.ezTitle = undefined;
16
17
  }
18
+ observeConfig() {
19
+ this.manageOverflow();
20
+ }
21
+ manageOverflow() {
22
+ if (this.opened)
23
+ this._bodyOverflow = window.document.body.style.overflow;
24
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
25
+ }
17
26
  getGridSize() {
18
27
  return this._sizeClasses[this.size] || this._sizeClasses["medium"];
19
28
  }
@@ -153,4 +162,10 @@ export class EzPopup {
153
162
  }
154
163
  }];
155
164
  }
165
+ static get watchers() {
166
+ return [{
167
+ "propName": "opened",
168
+ "methodName": "observeConfig"
169
+ }];
170
+ }
156
171
  }
@@ -110,7 +110,7 @@ export const buildFormMetadata = (config, dataUnit, includeDetails = false) => {
110
110
  cleanOnCopyFields.push(field.name);
111
111
  }
112
112
  let defaultValue = field.defaultValue == undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : field.defaultValue;
113
- if (defaultValue) {
113
+ if (defaultValue && defaultValue.value != undefined) {
114
114
  const { type, value } = defaultValue;
115
115
  if (type) {
116
116
  if (type === "V") {
@@ -353,7 +353,7 @@ const buildFormMetadata = (config, dataUnit, includeDetails = false) => {
353
353
  cleanOnCopyFields.push(field.name);
354
354
  }
355
355
  let defaultValue = field.defaultValue == undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : field.defaultValue;
356
- if (defaultValue) {
356
+ if (defaultValue && defaultValue.value != undefined) {
357
357
  const { type, value } = defaultValue;
358
358
  if (type) {
359
359
  if (type === "V") {
@@ -2069,6 +2069,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2069
2069
  this._tabPressed = false;
2070
2070
  this._textEmptyList = "Nenhum resultado encontrado";
2071
2071
  this._textEmptySearch = "Nenhum resultado de {0} encontrado";
2072
+ this._lookupMode = false;
2072
2073
  this._preSelection = undefined;
2073
2074
  this._visibleOptions = undefined;
2074
2075
  this._startLoading = false;
@@ -2099,24 +2100,29 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2099
2100
  }
2100
2101
  observeValue(newValue, oldValue) {
2101
2102
  if (this._textInput && newValue != oldValue) {
2102
- if (this.searchMode && typeof newValue === "string") {
2103
- this.setInputValue();
2104
- return;
2105
- }
2106
- const newValueSelected = this.getSelectedOption(newValue);
2107
- const oldValueSelected = this.getSelectedOption(oldValue);
2108
- const currentValue = this.getSelectedOption(this.value);
2109
- if (this.isDifferentValues(currentValue, newValueSelected)) {
2110
- this.value = newValueSelected;
2111
- }
2112
- if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
2113
- this.setInputValue();
2114
- const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
2115
- if (!this.isLookUpSearch(newValue, oldValue)) {
2116
- this.ezChange.emit(valueEmitted);
2103
+ try {
2104
+ if (this.searchMode && typeof newValue === "string") {
2105
+ this.setInputValue();
2106
+ return;
2117
2107
  }
2108
+ const newValueSelected = this.getSelectedOption(newValue);
2109
+ const oldValueSelected = this.getSelectedOption(oldValue);
2110
+ const currentValue = this.getSelectedOption(this.value);
2111
+ if (this.isDifferentValues(currentValue, newValueSelected)) {
2112
+ this.value = newValueSelected;
2113
+ }
2114
+ if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
2115
+ this.setInputValue();
2116
+ const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
2117
+ if (!this._lookupMode) {
2118
+ this.ezChange.emit(valueEmitted);
2119
+ }
2120
+ }
2121
+ this.resetOptions();
2122
+ }
2123
+ finally {
2124
+ this._lookupMode = false;
2118
2125
  }
2119
- this.resetOptions();
2120
2126
  }
2121
2127
  }
2122
2128
  /**
@@ -2429,6 +2435,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2429
2435
  if (!value.label) {
2430
2436
  value.label = `<SEM ${this.getFieldLabel()}>`;
2431
2437
  }
2438
+ this._lookupMode = true;
2432
2439
  this.value = value;
2433
2440
  }
2434
2441
  loadOptionValue(argument) {
@@ -2598,12 +2605,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2598
2605
  onTextInputFocusOutHandler() {
2599
2606
  this.cancelPreselection();
2600
2607
  }
2601
- isLookUpSearch(newValue, oldValue) {
2602
- return this.searchMode &&
2603
- typeof oldValue !== "object" &&
2604
- typeof newValue === "object" &&
2605
- oldValue == newValue.value;
2606
- }
2607
2608
  render() {
2608
2609
  var _a;
2609
2610
  ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
@@ -3008,6 +3009,7 @@ const EzDialog$1 = class extends HTMLElement$1 {
3008
3009
  this.labelCancel = 'Não';
3009
3010
  this.btnConfirmDanger = false;
3010
3011
  this._messageQueue = [];
3012
+ this._bodyOverflow = '';
3011
3013
  this.confirm = false;
3012
3014
  this.dialogType = undefined;
3013
3015
  this.message = undefined;
@@ -3016,6 +3018,14 @@ const EzDialog$1 = class extends HTMLElement$1 {
3016
3018
  this.ezTitle = undefined;
3017
3019
  this.beforeClose = undefined;
3018
3020
  }
3021
+ observeConfig() {
3022
+ this.manageOverflow();
3023
+ }
3024
+ manageOverflow() {
3025
+ if (this.opened)
3026
+ this._bodyOverflow = window.document.body.style.overflow;
3027
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
3028
+ }
3019
3029
  handleButtonClick(selectedOption) {
3020
3030
  if (this._currentMessage.beforeClose && this._currentMessage.beforeClose(selectedOption) === false) {
3021
3031
  return;
@@ -3121,6 +3131,9 @@ const EzDialog$1 = class extends HTMLElement$1 {
3121
3131
  return null;
3122
3132
  }
3123
3133
  get _element() { return this; }
3134
+ static get watchers() { return {
3135
+ "opened": ["observeConfig"]
3136
+ }; }
3124
3137
  static get style() { return ezDialogCss; }
3125
3138
  };
3126
3139
 
@@ -125408,6 +125421,7 @@ const EzPopover$1 = class extends HTMLElement$1 {
125408
125421
  this.__attachShadow();
125409
125422
  this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
125410
125423
  this._firstRender = true;
125424
+ this._bodyOverflow = '';
125411
125425
  this.innerClickTest = (_popOvercontainer, node, eventOrigin) => {
125412
125426
  const innerContainers = [_popOvercontainer];
125413
125427
  if (this.innerElement) {
@@ -125470,6 +125484,14 @@ const EzPopover$1 = class extends HTMLElement$1 {
125470
125484
  this.ezVisibilityChange.emit(newValue);
125471
125485
  }
125472
125486
  }
125487
+ observeConfig() {
125488
+ this.manageOverflow();
125489
+ }
125490
+ manageOverflow() {
125491
+ if (this.opened)
125492
+ this._bodyOverflow = window.document.body.style.overflow;
125493
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
125494
+ }
125473
125495
  /**
125474
125496
  * Atualiza a posição do popover.
125475
125497
  */
@@ -125528,7 +125550,7 @@ const EzPopover$1 = class extends HTMLElement$1 {
125528
125550
  }
125529
125551
  get _host() { return this; }
125530
125552
  static get watchers() { return {
125531
- "opened": ["observeOpened"]
125553
+ "opened": ["observeOpened", "observeConfig"]
125532
125554
  }; }
125533
125555
  static get style() { return ezPopoverCss; }
125534
125556
  };
@@ -125548,12 +125570,21 @@ const EzPopup$1 = class extends HTMLElement$1 {
125548
125570
  "large": "col--sd-9",
125549
125571
  "x-large": "col--sd-11"
125550
125572
  };
125573
+ this._bodyOverflow = '';
125551
125574
  this.size = "medium";
125552
125575
  this.opened = false;
125553
125576
  this.useHeader = true;
125554
125577
  this.heightMode = "full";
125555
125578
  this.ezTitle = undefined;
125556
125579
  }
125580
+ observeConfig() {
125581
+ this.manageOverflow();
125582
+ }
125583
+ manageOverflow() {
125584
+ if (this.opened)
125585
+ this._bodyOverflow = window.document.body.style.overflow;
125586
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
125587
+ }
125557
125588
  getGridSize() {
125558
125589
  return this._sizeClasses[this.size] || this._sizeClasses["medium"];
125559
125590
  }
@@ -125570,6 +125601,9 @@ const EzPopup$1 = class extends HTMLElement$1 {
125570
125601
  }
125571
125602
  return null;
125572
125603
  }
125604
+ static get watchers() { return {
125605
+ "opened": ["observeConfig"]
125606
+ }; }
125573
125607
  static get style() { return ezPopupCss; }
125574
125608
  };
125575
125609
 
@@ -19,6 +19,7 @@ const EzComboBox = class {
19
19
  this._tabPressed = false;
20
20
  this._textEmptyList = "Nenhum resultado encontrado";
21
21
  this._textEmptySearch = "Nenhum resultado de {0} encontrado";
22
+ this._lookupMode = false;
22
23
  this._preSelection = undefined;
23
24
  this._visibleOptions = undefined;
24
25
  this._startLoading = false;
@@ -49,24 +50,29 @@ const EzComboBox = class {
49
50
  }
50
51
  observeValue(newValue, oldValue) {
51
52
  if (this._textInput && newValue != oldValue) {
52
- if (this.searchMode && typeof newValue === "string") {
53
- this.setInputValue();
54
- return;
55
- }
56
- const newValueSelected = this.getSelectedOption(newValue);
57
- const oldValueSelected = this.getSelectedOption(oldValue);
58
- const currentValue = this.getSelectedOption(this.value);
59
- if (this.isDifferentValues(currentValue, newValueSelected)) {
60
- this.value = newValueSelected;
61
- }
62
- if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
63
- this.setInputValue();
64
- const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
65
- if (!this.isLookUpSearch(newValue, oldValue)) {
66
- this.ezChange.emit(valueEmitted);
53
+ try {
54
+ if (this.searchMode && typeof newValue === "string") {
55
+ this.setInputValue();
56
+ return;
57
+ }
58
+ const newValueSelected = this.getSelectedOption(newValue);
59
+ const oldValueSelected = this.getSelectedOption(oldValue);
60
+ const currentValue = this.getSelectedOption(this.value);
61
+ if (this.isDifferentValues(currentValue, newValueSelected)) {
62
+ this.value = newValueSelected;
67
63
  }
64
+ if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
65
+ this.setInputValue();
66
+ const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
67
+ if (!this._lookupMode) {
68
+ this.ezChange.emit(valueEmitted);
69
+ }
70
+ }
71
+ this.resetOptions();
72
+ }
73
+ finally {
74
+ this._lookupMode = false;
68
75
  }
69
- this.resetOptions();
70
76
  }
71
77
  }
72
78
  /**
@@ -379,6 +385,7 @@ const EzComboBox = class {
379
385
  if (!value.label) {
380
386
  value.label = `<SEM ${this.getFieldLabel()}>`;
381
387
  }
388
+ this._lookupMode = true;
382
389
  this.value = value;
383
390
  }
384
391
  loadOptionValue(argument) {
@@ -548,12 +555,6 @@ const EzComboBox = class {
548
555
  onTextInputFocusOutHandler() {
549
556
  this.cancelPreselection();
550
557
  }
551
- isLookUpSearch(newValue, oldValue) {
552
- return this.searchMode &&
553
- typeof oldValue !== "object" &&
554
- typeof newValue === "object" &&
555
- oldValue == newValue.value;
556
- }
557
558
  render() {
558
559
  var _a;
559
560
  ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
@@ -27,6 +27,7 @@ const EzDialog = class {
27
27
  this.labelCancel = 'Não';
28
28
  this.btnConfirmDanger = false;
29
29
  this._messageQueue = [];
30
+ this._bodyOverflow = '';
30
31
  this.confirm = false;
31
32
  this.dialogType = undefined;
32
33
  this.message = undefined;
@@ -35,6 +36,14 @@ const EzDialog = class {
35
36
  this.ezTitle = undefined;
36
37
  this.beforeClose = undefined;
37
38
  }
39
+ observeConfig() {
40
+ this.manageOverflow();
41
+ }
42
+ manageOverflow() {
43
+ if (this.opened)
44
+ this._bodyOverflow = window.document.body.style.overflow;
45
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
46
+ }
38
47
  handleButtonClick(selectedOption) {
39
48
  if (this._currentMessage.beforeClose && this._currentMessage.beforeClose(selectedOption) === false) {
40
49
  return;
@@ -140,6 +149,9 @@ const EzDialog = class {
140
149
  return null;
141
150
  }
142
151
  get _element() { return getElement(this); }
152
+ static get watchers() { return {
153
+ "opened": ["observeConfig"]
154
+ }; }
143
155
  };
144
156
  EzDialog.style = ezDialogCss;
145
157
 
@@ -114,7 +114,7 @@ const buildFormMetadata = (config, dataUnit, includeDetails = false) => {
114
114
  cleanOnCopyFields.push(field.name);
115
115
  }
116
116
  let defaultValue = field.defaultValue == undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : field.defaultValue;
117
- if (defaultValue) {
117
+ if (defaultValue && defaultValue.value != undefined) {
118
118
  const { type, value } = defaultValue;
119
119
  if (type) {
120
120
  if (type === "V") {
@@ -8,6 +8,7 @@ const EzPopover = class {
8
8
  registerInstance(this, hostRef);
9
9
  this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
10
10
  this._firstRender = true;
11
+ this._bodyOverflow = '';
11
12
  this.innerClickTest = (_popOvercontainer, node, eventOrigin) => {
12
13
  const innerContainers = [_popOvercontainer];
13
14
  if (this.innerElement) {
@@ -70,6 +71,14 @@ const EzPopover = class {
70
71
  this.ezVisibilityChange.emit(newValue);
71
72
  }
72
73
  }
74
+ observeConfig() {
75
+ this.manageOverflow();
76
+ }
77
+ manageOverflow() {
78
+ if (this.opened)
79
+ this._bodyOverflow = window.document.body.style.overflow;
80
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
81
+ }
73
82
  /**
74
83
  * Atualiza a posição do popover.
75
84
  */
@@ -128,7 +137,7 @@ const EzPopover = class {
128
137
  }
129
138
  get _host() { return getElement(this); }
130
139
  static get watchers() { return {
131
- "opened": ["observeOpened"]
140
+ "opened": ["observeOpened", "observeConfig"]
132
141
  }; }
133
142
  };
134
143
  EzPopover.style = ezPopoverCss;
@@ -13,12 +13,21 @@ const EzPopup = class {
13
13
  "large": "col--sd-9",
14
14
  "x-large": "col--sd-11"
15
15
  };
16
+ this._bodyOverflow = '';
16
17
  this.size = "medium";
17
18
  this.opened = false;
18
19
  this.useHeader = true;
19
20
  this.heightMode = "full";
20
21
  this.ezTitle = undefined;
21
22
  }
23
+ observeConfig() {
24
+ this.manageOverflow();
25
+ }
26
+ manageOverflow() {
27
+ if (this.opened)
28
+ this._bodyOverflow = window.document.body.style.overflow;
29
+ window.document.body.style.overflow = this.opened ? 'hidden' : this._bodyOverflow;
30
+ }
22
31
  getGridSize() {
23
32
  return this._sizeClasses[this.size] || this._sizeClasses["medium"];
24
33
  }
@@ -35,6 +44,9 @@ const EzPopup = class {
35
44
  }
36
45
  return null;
37
46
  }
47
+ static get watchers() { return {
48
+ "opened": ["observeConfig"]
49
+ }; }
38
50
  };
39
51
  EzPopup.style = ezPopupCss;
40
52
 
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-bfc7b8ca.js";export{s as setNonce}from"./p-bfc7b8ca.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-2756003d",[[1,"ez-guide-navigator",{open:[1540],selectedId:[1537,"selected-id"],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],selectGuide:[64],getParent:[64]}]]],["p-370ad5c9",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-b01e05a1",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-fc2faf3a",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],beforeClose:[1040],show:[64]}]]],["p-3a41181c",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],_showSelectionCounter:[32],_isAllSelection:[32],_currentPageSelected:[32],_selectionCount:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-f71f0aa2",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-997b2df9",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-6adf3791",[[1,"ez-badge",{size:[513],label:[513],iconLeft:[513,"icon-left"],iconRight:[513,"icon-right"],position:[1040],hasSlot:[32]}]]],["p-d892dc4f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-2f80d68c",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-11431283",[[1,"ez-list",{dataSource:[1040],listMode:[1,"list-mode"],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],hoverFeedback:[1028,"hover-feedback"],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-e8e7ec07",[[0,"ez-application"]]],["p-848bc350",[[1,"ez-card-item",{item:[16]}]]],["p-1ac06223",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-bef2df29",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],heightMode:[1,"height-mode"],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-19995acb",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-82a60d38",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-6e453307",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-672c1fba",[[0,"ez-skeleton",{count:[2],variant:[1],width:[1],height:[1],marginBottom:[1,"margin-bottom"],animation:[1]}]]],["p-0c2187a1",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-a279fbc2",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-41e82662",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-fc71f135",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-c00e734a",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-805ee4c2",[[1,"ez-collapsible-box",{value:[1540],label:[513],subtitle:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-5d8d9a2e",[[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressEmptyOption:[4,"suppress-empty-option"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-15e29287",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-751aa882",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-ff4141d8",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-a9f0f910",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-6f11ddf8",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-60e30f92",[[1,"ez-upload",{label:[1],subtitle:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-22b106d7",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-709067e4",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressSearch:[4,"suppress-search"],optionLoader:[16],suppressEmptyOption:[4,"suppress-empty-option"],canShowError:[516,"can-show-error"],mode:[513],_preSelection:[32],_visibleOptions:[32],_startLoading:[32],_showLoading:[32],_criteria:[32],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-c99bca75",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[1540],mode:[513],getMode:[64],setFocus:[64]}]]],["p-55cd357c",[[2,"ez-form-view",{fields:[16],showUp:[64]}]]],["p-4ebb1d15",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],asyncSearch:[516,"async-search"],canShowError:[516,"can-show-error"],setFocus:[64],setBlur:[64],isInvalid:[64],setValue:[64],endSearch:[64]}],[1,"ez-tree",{items:[1040],value:[1040],selectedId:[1537,"selected-id"],iconResolver:[16],tooltipResolver:[16],_tree:[32],_waintingForLoad:[32],selectItem:[64],openItem:[64],disableItem:[64],enableItem:[64],addChild:[64],applyFilter:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],getParent:[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{direction:[1],locked:[4],activeShadow:[4,"active-shadow"],isActive:[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-994c4934",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-1a902d0e",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-9a9cca48",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]},[[2,"click","clickListener"]]]]],["p-ea5a5236",[[2,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],validate:[64]}]]]],e)));
1
+ import{p as e,b as o}from"./p-bfc7b8ca.js";export{s as setNonce}from"./p-bfc7b8ca.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-2756003d",[[1,"ez-guide-navigator",{open:[1540],selectedId:[1537,"selected-id"],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],selectGuide:[64],getParent:[64]}]]],["p-370ad5c9",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-b01e05a1",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-144d1ff7",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],beforeClose:[1040],show:[64]}]]],["p-3a41181c",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],_showSelectionCounter:[32],_isAllSelection:[32],_currentPageSelected:[32],_selectionCount:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-f71f0aa2",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-997b2df9",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-6adf3791",[[1,"ez-badge",{size:[513],label:[513],iconLeft:[513,"icon-left"],iconRight:[513,"icon-right"],position:[1040],hasSlot:[32]}]]],["p-d892dc4f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-2f80d68c",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-11431283",[[1,"ez-list",{dataSource:[1040],listMode:[1,"list-mode"],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],hoverFeedback:[1028,"hover-feedback"],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-e8e7ec07",[[0,"ez-application"]]],["p-848bc350",[[1,"ez-card-item",{item:[16]}]]],["p-1ac06223",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-bef2df29",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],heightMode:[1,"height-mode"],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-62ebbd06",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-45040b18",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-6e453307",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-672c1fba",[[0,"ez-skeleton",{count:[2],variant:[1],width:[1],height:[1],marginBottom:[1,"margin-bottom"],animation:[1]}]]],["p-0c2187a1",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-a279fbc2",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-41e82662",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-fc71f135",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-c00e734a",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-805ee4c2",[[1,"ez-collapsible-box",{value:[1540],label:[513],subtitle:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-5d8d9a2e",[[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressEmptyOption:[4,"suppress-empty-option"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-15e29287",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-751aa882",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-ff4141d8",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-a9f0f910",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-6f11ddf8",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-60e30f92",[[1,"ez-upload",{label:[1],subtitle:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-22b106d7",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-bd1d887a",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressSearch:[4,"suppress-search"],optionLoader:[16],suppressEmptyOption:[4,"suppress-empty-option"],canShowError:[516,"can-show-error"],mode:[513],_preSelection:[32],_visibleOptions:[32],_startLoading:[32],_showLoading:[32],_criteria:[32],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-c99bca75",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[1540],mode:[513],getMode:[64],setFocus:[64]}]]],["p-55cd357c",[[2,"ez-form-view",{fields:[16],showUp:[64]}]]],["p-4ebb1d15",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],asyncSearch:[516,"async-search"],canShowError:[516,"can-show-error"],setFocus:[64],setBlur:[64],isInvalid:[64],setValue:[64],endSearch:[64]}],[1,"ez-tree",{items:[1040],value:[1040],selectedId:[1537,"selected-id"],iconResolver:[16],tooltipResolver:[16],_tree:[32],_waintingForLoad:[32],selectItem:[64],openItem:[64],disableItem:[64],enableItem:[64],addChild:[64],applyFilter:[64],updateItem:[64],getItem:[64],getCurrentPath:[64],getParent:[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{direction:[1],locked:[4],activeShadow:[4,"active-shadow"],isActive:[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-994c4934",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-1a902d0e",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-9a9cca48",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]},[[2,"click","clickListener"]]]]],["p-18d7de85",[[2,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],validate:[64]}]]]],e)));
@@ -0,0 +1 @@
1
+ import{r as i,c as t,f as o,h as a,g as e}from"./p-bfc7b8ca.js";import{D as l}from"./p-ab574d59.js";import{ElementIDUtils as d}from"@sankhyalabs/core";class r{constructor(i,t,o,a,e,l,d,r,n,c){this.title=i,this.message=t,this.dialogType=o,this.confirm=a,this.icon=e,this.labelCancel=l,this.labelConfirm=d,this.btnConfirmDanger=r,this.callBack=n,this.beforeClose=c}}const n=class{constructor(o){i(this,o),this.ezCancel=t(this,"ezCancel",7),this.ezAccept=t(this,"ezAccept",7),this.labelConfirm="Sim",this.labelCancel="Não",this.btnConfirmDanger=!1,this._messageQueue=[],this._bodyOverflow="",this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(){this.manageOverflow()}manageOverflow(){this.opened&&(this._bodyOverflow=window.document.body.style.overflow),window.document.body.style.overflow=this.opened?"hidden":this._bodyOverflow}handleButtonClick(i){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(i)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(i),i?this.ezAccept.emit(i):this.ezCancel.emit(i),this._currentMessage=this._messageQueue.shift(),o(this))}async show(i,t,o,a,e,l,d,n,c){return this.opened=!0,new Promise((s=>{this._messageQueue.push(new r(i,t,o,a,e,l,d,n,s,c))}))}isCritical(i){return i===l.CRITICAL}getIconElement(i){if(i.dialogType!==l.DEFAULT)return a("ez-icon",{class:"changeable__icon "+this.getIconClass(i.dialogType),size:"small",iconName:this.getIconName(i)})}getIconClass(i){return this.isCritical(i)?"title-icon--critical":i===l.SUCCESS?"title-icon--success":i===l.WARN?"title-icon--warn":""}getIconName(i){return i.icon?i.icon:this.isCritical(i.dialogType)?"alert-circle-inverted":i.dialogType===l.WARN?"warning-outline":i.dialogType===l.SUCCESS?"check":void 0}getTypeIndicatorElement(i){if(i.dialogType!==l.DEFAULT)return a("div",{class:this.getClassIconIndicator(i.dialogType)})}getClassIconIndicator(i){return this.isCritical(i)?"dialog__critical--indicator":i==l.SUCCESS?"dialog__success--indicator":i==l.WARN?"dialog__warning--indicator":""}getClassContainer(i){return(i.dialogType||l.DEFAULT)===l.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(i){return null==this.getIconElement(i)?"title title__label title__label--no-icon":"title title__label"}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new r(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.labelCancel,this.labelConfirm,this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){d.addIDInfo(this._element)}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay"},a("div",{class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":d.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":d.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":d.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":d.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":d.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{label:"Ok","data-element-id":d.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return e(this)}static get watchers(){return{opened:["observeConfig"]}}};n.style=':host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:0}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.title-icon--success{background-color:var(--dialog__success--background-color)}.title-icon--warn{background-color:var(--dialog__warning--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.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%}}';export{n as ez_dialog}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,f as s,H as n,g as r}from"./p-bfc7b8ca.js";import{UserInterface as o,DateUtils as a,Action as l,WaitingChangeException as h,ApplicationContext as c,DataUnitAction as u,StringUtils as d,DataUnit as f,ElementIDUtils as v}from"@sankhyalabs/core";import{A as p}from"./p-41ce6f98.js";import"./p-ab574d59.js";const b=/child\[([^\]]+)\]/,m=/\$\{.+\}/;class g{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const e=b.exec(t);return e?e[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([e,i])=>{if("string"==typeof i){const t=m.exec(i);t&&(i=this.getDefaultVar(t[0]))}t[e]=i})),t}getDefaultVar(t){return"${data}"===t?a.getToday():"${datahora}"===t?a.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const y=(t,e)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(e[0].order||1e4);class _{constructor(t){this.onDataUnitEvent=t=>{var e,i;switch(t.type){case l.DATA_LOADED:case l.DATA_SAVED:case l.RECORDS_REMOVED:case l.RECORDS_ADDED:case l.RECORDS_COPIED:case l.EDITION_CANCELED:case l.SELECTION_CHANGED:case l.NEXT_SELECTED:case l.PREVIOUS_SELECTED:this.clearInvalid();case l.DATA_CHANGED:case l.CHANGE_UNDONE:case l.CHANGE_REDONE:case l.RECORD_LOADED:null===(e=this._fields)||void 0===e||e.forEach((t=>{this.updateValue(t.fieldName,t.field)}));break;case l.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const e=this.getDefaultValues();e&&Object.keys(e).forEach((i=>{this._dataUnit.setFieldValue(i,e[i],t)}))}}bind(t,e,i,s){t.forEach((t=>{const{fieldName:i,contextName:s}=t.dataset;null!=s&&s!==e||this.updateBind(i,t)})),this._formMetadata=i,this._recordsValidator=s}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this)}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._dataUnit.setInvalidField(t.name,t.message,this.getCurrentRecordId()),this._fields.has(t.name)){const e=this._fields.get(t.name).field;this.updateErrorMessage(t.name,e,t.message)}}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}updateValue(t,e){const i=this._fields.get(t);try{i&&(i.listen=!1),e.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,e)}finally{i&&(i.listen=!0)}}validate(){return new Promise(((t,e)=>{var i;const s=this._dataUnit.getModifiedRecords();for(let t=0;t<s.length;t++){const n=s[t],r=[];let o=this.validateRequired(n);if(o&&!o.isValid&&r.push(o),o=null===(i=this._recordsValidator)||void 0===i?void 0:i.validateRecord(n),o&&!o.isValid&&r.push(o),r.length>0){this.processValidationResult(r),e();break}}return t()}))}validateRequired(t){const e=this._formMetadata.getRequiredFields(),i=[];if(new Set(e).forEach((e=>{const s=t[e];if(null==s||""===s){const t=this.getErrorMessage(e);i.push(t?{name:e,message:t}:{name:e,message:"Essa informação é obrigatória"})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(t){t.forEach((t=>{const e=t.invalidFields;if(e&&e.forEach((t=>{this.markInvalid(t)})),t.infoMessage&&p.info(t.infoMessage),t.errorMessage){const{errorTitle:e,errorMessage:i}=t;p.error(e,i)}}))}updateErrorMessage(t,e,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),e.errorMessage||(e.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,e){const i=this._fields.get(t);i&&i.destroy(),e.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,e),this._fields.set(t,w.create(t,e,((t,e)=>this.changeStarted(t,e)),(t=>this.cancelWaitingChange(t)),((t,e)=>this.setFieldValue(t,e)))),this.bindSearchOptionsLoader(t,e),this.applyEzUploadContext(t,e)}changeStarted(t,e){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!e.blocking&&null==e.promise){const i=this._fields.get(t);i&&(e.promise=new Promise(((t,e)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=e})))}this._dataUnit.startChange(t,e)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const e=this._fields.get(t);e&&e.rejectWaitingChange(new h("Change canceled",t))}}setFieldValue(t,e){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.setFieldValue(t,e),this._dataUnit.waitingForChange(t)){const e=this._fields.get(t);e&&e.acceptWaitingChange()}}bindSearchOptionsLoader(t,e){if("EZ-SEARCH"===e.nodeName&&null==e.optionLoader){const i=c.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");i&&(e.optionLoader=e=>i(e,t,this._dataUnit))}}applyEzUploadContext(t,e){var i,s;if("EZ-UPLOAD"===e.nodeName){e.urlUpload=c.getContextValue("__EZUI__UPLOAD__ADD__URL__"),e.urlDelete=c.getContextValue("__EZUI__UPLOAD__DEL__URL__");const n=this._dataUnit.getField(t),r=null===(i=n.properties)||void 0===i?void 0:i.DESTINATION;r&&(e.requestHeaders={XTRAINF:`{"destination": "${r}"}`}),e.maxFiles=(null===(s=n.properties)||void 0===s?void 0:s.MAX_FILES)||0}}interceptAction(t){if(t.type===l.RECORDS_COPIED){const e=this._formMetadata.getCleanOnCopyFields();if(e)return new u(l.RECORDS_COPIED,t.payload.map((t=>{const i=Object.assign({},t);return e.forEach((t=>delete i[t])),i})))}if(t.type===l.SAVING_DATA)return new Promise((e=>{this.validate().then((()=>e(t))).catch((()=>{}))}));if(t.type===l.RECORDS_ADDED){const e=this.getDefaultValues();if(e)return new u(l.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),e))))}return t}getDefaultValues(){var t;const e=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(e){const t={};for(const i in e)t[i]=this._dataUnit.valueFromString(i,e[i]);return t}}}class w{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,e,i,s,n){const r=new w;return r.field=e,r.fieldName=t,r.startChangeListener=e=>{r.listen&&i(t,e.detail)},r.field.addEventListener(r.startChangeEventName,r.startChangeListener),r.cancelWaitingChangeListener=()=>{r.listen&&s(t)},r.field.addEventListener(r.cancelWaitingChangeEventName,r.cancelWaitingChangeListener),r.changeListener=e=>{r.listen&&n(t,e.detail)},r.field.addEventListener(r.changeEventName,r.changeListener),r}}function O(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var E="function"==typeof Symbol&&Symbol.observable||"@@observable",C=function(){return Math.random().toString(36).substring(7).split("").join(".")},A={INIT:"@@redux/INIT"+C(),REPLACE:"@@redux/REPLACE"+C(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+C()}};function j(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function R(t,e,i){var s;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(O(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(O(1));return i(R)(t,e)}if("function"!=typeof t)throw new Error(O(2));var n=t,r=e,o=[],a=o,l=!1;function h(){a===o&&(a=o.slice())}function c(){if(l)throw new Error(O(3));return r}function u(t){if("function"!=typeof t)throw new Error(O(4));if(l)throw new Error(O(5));var e=!0;return h(),a.push(t),function(){if(e){if(l)throw new Error(O(6));e=!1,h();var i=a.indexOf(t);a.splice(i,1),o=null}}}function d(t){if(!j(t))throw new Error(O(7));if(void 0===t.type)throw new Error(O(8));if(l)throw new Error(O(9));try{l=!0,r=n(r,t)}finally{l=!1}for(var e=o=a,i=0;i<e.length;i++)(0,e[i])();return t}function f(t){if("function"!=typeof t)throw new Error(O(10));n=t,d({type:A.REPLACE})}function v(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(O(11));function i(){t.next&&t.next(c())}return i(),{unsubscribe:e(i)}}})[E]=function(){return this},t}return d({type:A.INIT}),(s={dispatch:d,subscribe:u,getState:c,replaceReducer:f})[E]=v,s}const D={};function z(t=D,e){switch(e.type){case S.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:e.payload,currentSheet:void 0});case S.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:e.payload});default:return t}}function N(t){return t.formMetadata}var S;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(S||(S={}));const x=class{constructor(i){t(this,i),this.ezReady=e(this,"ezReady",7),this.onDataUnitAction=t=>{t.type===l.METADATA_LOADED&&this.processMetadata()},this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0}validate(){return this._dataBinder.validate()}observeConfig(){this.processMetadata()}getDynamicContent(){var t;const e=N(this._store.getState());if(!e)return null;const s=Array.from(e.getAllSheets().values()),n=function(t){const e=function(t){return t.currentSheet}(t);return e?t.formMetadata.getSheet(e):Array.from(t.formMetadata.getAllSheets().values())[0]}(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(s.length>1){const t=s.map(((t,e)=>({tabKey:t.name,label:t.label,index:e}))),e="selector";r.push(i("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:S.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:n.name,"data-element-id":e}))}return r=r.concat(this.buildFormContent(n)),r}buildFormContent(t){const e=null==t?void 0:t.fields;if(null==t)return;const s=`${d.replaceAccentuatedChars(d.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return i("div",{class:"dynamic-content","data-element-id":s},i("ez-form-view",{class:"ez-row ez-padding-vertical--small",fields:e}))}processMetadata(){if(!this.isStatic()&&this.dataUnit&&this._store){const t=((t,e,i=!1)=>{var s,n;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const e=t.metadata;let i;return e&&(i=e.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:i}})(e));const r=new Map,a=new Map,l=[],h=[],c={};null===(s=null==t?void 0:t.tabs)||void 0===s||s.forEach((t=>{a.has(t.label)||!1!==t.visible||a.set(t.label,t)})),null===(n=null==t?void 0:t.fields)||void 0===n||n.forEach((t=>{var i,s,n;if(!1!==t.visible){const u=((t,e)=>("string"==typeof t?Array.from(e.keys()).find((e=>e.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",r);if(a.has(u.label))return;const d=e.getField(t.name);if(d&&u.visible){r.has(u)||r.set(u,[]);const e=((t,e)=>{let i,s,{name:n,label:r,group:a}=Object.assign({},e),{readOnly:l,required:h}=Object.assign({},e);return t&&(r=r||t.label,n=n||t.name,h=t.required||(null==e?void 0:e.required),l=t.readOnly||(null==e?void 0:e.readOnly),i=t.properties,s=t.userInterface),{name:n,label:r,group:a,readOnly:l,required:h,props:i,userInterface:s||o.SHORTTEXT}})(d,t);r.get(u).push(e),e.required&&l.push(t.name),((null==t.cleanOnCopy?null===(i=d.properties)||void 0===i?void 0:i.cleanOnCopy:t.cleanOnCopy)||(null===(s=d.properties)||void 0===s?void 0:s.cleanOnCopy))&&h.push(t.name);let a=null==t.defaultValue?null===(n=d.properties)||void 0===n?void 0:n.defaultValue:t.defaultValue;if(a){const{type:e,value:i}=a;if(e)if("V"===e)a=i;else try{const t=JSON.parse(i);a=t&&"value"in t?t:i}catch(t){}c[t.name]=a}}}}));const u=new g;if(u.setDefaultVars(t.defaultVars),i){const t=e.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:e,name:i,fields:s}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);r.set({name:i,label:e},s)}))}return Array.from(r.entries()).sort(y).forEach((([t,e])=>{u.addSheet({label:"__main"===t.label?"Principal":t.label,name:t.name||t.label,fields:e})})),u.addRequiredFields(l),u.addCleanOnCopyFields(h),u.addDefaultValues(c),u})(this.config,this.dataUnit);this._store.dispatch({type:S.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new f("ez-form")),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new _(this.dataUnit),this._store=R(z),this._store.subscribe((()=>s(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),v.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){const t=N(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback()}buildIdTabSelector(t){return t&&t.forEach((t=>t[v.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=d.toCamelCase(t.label))),t}render(){return i(n,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};x.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{x as ez_form}
1
+ import{r as t,c as e,h as i,f as s,H as n,g as r}from"./p-bfc7b8ca.js";import{UserInterface as o,DateUtils as a,Action as l,WaitingChangeException as h,ApplicationContext as c,DataUnitAction as u,StringUtils as d,DataUnit as f,ElementIDUtils as v}from"@sankhyalabs/core";import{A as p}from"./p-41ce6f98.js";import"./p-ab574d59.js";const b=/child\[([^\]]+)\]/,m=/\$\{.+\}/;class g{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const e=b.exec(t);return e?e[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([e,i])=>{if("string"==typeof i){const t=m.exec(i);t&&(i=this.getDefaultVar(t[0]))}t[e]=i})),t}getDefaultVar(t){return"${data}"===t?a.getToday():"${datahora}"===t?a.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const y=(t,e)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(e[0].order||1e4);class _{constructor(t){this.onDataUnitEvent=t=>{var e,i;switch(t.type){case l.DATA_LOADED:case l.DATA_SAVED:case l.RECORDS_REMOVED:case l.RECORDS_ADDED:case l.RECORDS_COPIED:case l.EDITION_CANCELED:case l.SELECTION_CHANGED:case l.NEXT_SELECTED:case l.PREVIOUS_SELECTED:this.clearInvalid();case l.DATA_CHANGED:case l.CHANGE_UNDONE:case l.CHANGE_REDONE:case l.RECORD_LOADED:null===(e=this._fields)||void 0===e||e.forEach((t=>{this.updateValue(t.fieldName,t.field)}));break;case l.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const e=this.getDefaultValues();e&&Object.keys(e).forEach((i=>{this._dataUnit.setFieldValue(i,e[i],t)}))}}bind(t,e,i,s){t.forEach((t=>{const{fieldName:i,contextName:s}=t.dataset;null!=s&&s!==e||this.updateBind(i,t)})),this._formMetadata=i,this._recordsValidator=s}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this)}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._dataUnit.setInvalidField(t.name,t.message,this.getCurrentRecordId()),this._fields.has(t.name)){const e=this._fields.get(t.name).field;this.updateErrorMessage(t.name,e,t.message)}}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}updateValue(t,e){const i=this._fields.get(t);try{i&&(i.listen=!1),e.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,e)}finally{i&&(i.listen=!0)}}validate(){return new Promise(((t,e)=>{var i;const s=this._dataUnit.getModifiedRecords();for(let t=0;t<s.length;t++){const n=s[t],r=[];let o=this.validateRequired(n);if(o&&!o.isValid&&r.push(o),o=null===(i=this._recordsValidator)||void 0===i?void 0:i.validateRecord(n),o&&!o.isValid&&r.push(o),r.length>0){this.processValidationResult(r),e();break}}return t()}))}validateRequired(t){const e=this._formMetadata.getRequiredFields(),i=[];if(new Set(e).forEach((e=>{const s=t[e];if(null==s||""===s){const t=this.getErrorMessage(e);i.push(t?{name:e,message:t}:{name:e,message:"Essa informação é obrigatória"})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(t){t.forEach((t=>{const e=t.invalidFields;if(e&&e.forEach((t=>{this.markInvalid(t)})),t.infoMessage&&p.info(t.infoMessage),t.errorMessage){const{errorTitle:e,errorMessage:i}=t;p.error(e,i)}}))}updateErrorMessage(t,e,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),e.errorMessage||(e.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,e){const i=this._fields.get(t);i&&i.destroy(),e.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,e),this._fields.set(t,w.create(t,e,((t,e)=>this.changeStarted(t,e)),(t=>this.cancelWaitingChange(t)),((t,e)=>this.setFieldValue(t,e)))),this.bindSearchOptionsLoader(t,e),this.applyEzUploadContext(t,e)}changeStarted(t,e){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!e.blocking&&null==e.promise){const i=this._fields.get(t);i&&(e.promise=new Promise(((t,e)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=e})))}this._dataUnit.startChange(t,e)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const e=this._fields.get(t);e&&e.rejectWaitingChange(new h("Change canceled",t))}}setFieldValue(t,e){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.setFieldValue(t,e),this._dataUnit.waitingForChange(t)){const e=this._fields.get(t);e&&e.acceptWaitingChange()}}bindSearchOptionsLoader(t,e){if("EZ-SEARCH"===e.nodeName&&null==e.optionLoader){const i=c.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");i&&(e.optionLoader=e=>i(e,t,this._dataUnit))}}applyEzUploadContext(t,e){var i,s;if("EZ-UPLOAD"===e.nodeName){e.urlUpload=c.getContextValue("__EZUI__UPLOAD__ADD__URL__"),e.urlDelete=c.getContextValue("__EZUI__UPLOAD__DEL__URL__");const n=this._dataUnit.getField(t),r=null===(i=n.properties)||void 0===i?void 0:i.DESTINATION;r&&(e.requestHeaders={XTRAINF:`{"destination": "${r}"}`}),e.maxFiles=(null===(s=n.properties)||void 0===s?void 0:s.MAX_FILES)||0}}interceptAction(t){if(t.type===l.RECORDS_COPIED){const e=this._formMetadata.getCleanOnCopyFields();if(e)return new u(l.RECORDS_COPIED,t.payload.map((t=>{const i=Object.assign({},t);return e.forEach((t=>delete i[t])),i})))}if(t.type===l.SAVING_DATA)return new Promise((e=>{this.validate().then((()=>e(t))).catch((()=>{}))}));if(t.type===l.RECORDS_ADDED){const e=this.getDefaultValues();if(e)return new u(l.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),e))))}return t}getDefaultValues(){var t;const e=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(e){const t={};for(const i in e)t[i]=this._dataUnit.valueFromString(i,e[i]);return t}}}class w{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,e,i,s,n){const r=new w;return r.field=e,r.fieldName=t,r.startChangeListener=e=>{r.listen&&i(t,e.detail)},r.field.addEventListener(r.startChangeEventName,r.startChangeListener),r.cancelWaitingChangeListener=()=>{r.listen&&s(t)},r.field.addEventListener(r.cancelWaitingChangeEventName,r.cancelWaitingChangeListener),r.changeListener=e=>{r.listen&&n(t,e.detail)},r.field.addEventListener(r.changeEventName,r.changeListener),r}}function O(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var E="function"==typeof Symbol&&Symbol.observable||"@@observable",C=function(){return Math.random().toString(36).substring(7).split("").join(".")},A={INIT:"@@redux/INIT"+C(),REPLACE:"@@redux/REPLACE"+C(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+C()}};function j(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function R(t,e,i){var s;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(O(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(O(1));return i(R)(t,e)}if("function"!=typeof t)throw new Error(O(2));var n=t,r=e,o=[],a=o,l=!1;function h(){a===o&&(a=o.slice())}function c(){if(l)throw new Error(O(3));return r}function u(t){if("function"!=typeof t)throw new Error(O(4));if(l)throw new Error(O(5));var e=!0;return h(),a.push(t),function(){if(e){if(l)throw new Error(O(6));e=!1,h();var i=a.indexOf(t);a.splice(i,1),o=null}}}function d(t){if(!j(t))throw new Error(O(7));if(void 0===t.type)throw new Error(O(8));if(l)throw new Error(O(9));try{l=!0,r=n(r,t)}finally{l=!1}for(var e=o=a,i=0;i<e.length;i++)(0,e[i])();return t}function f(t){if("function"!=typeof t)throw new Error(O(10));n=t,d({type:A.REPLACE})}function v(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(O(11));function i(){t.next&&t.next(c())}return i(),{unsubscribe:e(i)}}})[E]=function(){return this},t}return d({type:A.INIT}),(s={dispatch:d,subscribe:u,getState:c,replaceReducer:f})[E]=v,s}const D={};function z(t=D,e){switch(e.type){case S.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:e.payload,currentSheet:void 0});case S.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:e.payload});default:return t}}function N(t){return t.formMetadata}var S;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(S||(S={}));const x=class{constructor(i){t(this,i),this.ezReady=e(this,"ezReady",7),this.onDataUnitAction=t=>{t.type===l.METADATA_LOADED&&this.processMetadata()},this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0}validate(){return this._dataBinder.validate()}observeConfig(){this.processMetadata()}getDynamicContent(){var t;const e=N(this._store.getState());if(!e)return null;const s=Array.from(e.getAllSheets().values()),n=function(t){const e=function(t){return t.currentSheet}(t);return e?t.formMetadata.getSheet(e):Array.from(t.formMetadata.getAllSheets().values())[0]}(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(s.length>1){const t=s.map(((t,e)=>({tabKey:t.name,label:t.label,index:e}))),e="selector";r.push(i("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:S.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:n.name,"data-element-id":e}))}return r=r.concat(this.buildFormContent(n)),r}buildFormContent(t){const e=null==t?void 0:t.fields;if(null==t)return;const s=`${d.replaceAccentuatedChars(d.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return i("div",{class:"dynamic-content","data-element-id":s},i("ez-form-view",{class:"ez-row ez-padding-vertical--small",fields:e}))}processMetadata(){if(!this.isStatic()&&this.dataUnit&&this._store){const t=((t,e,i=!1)=>{var s,n;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const e=t.metadata;let i;return e&&(i=e.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:i}})(e));const r=new Map,a=new Map,l=[],h=[],c={};null===(s=null==t?void 0:t.tabs)||void 0===s||s.forEach((t=>{a.has(t.label)||!1!==t.visible||a.set(t.label,t)})),null===(n=null==t?void 0:t.fields)||void 0===n||n.forEach((t=>{var i,s,n;if(!1!==t.visible){const u=((t,e)=>("string"==typeof t?Array.from(e.keys()).find((e=>e.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",r);if(a.has(u.label))return;const d=e.getField(t.name);if(d&&u.visible){r.has(u)||r.set(u,[]);const e=((t,e)=>{let i,s,{name:n,label:r,group:a}=Object.assign({},e),{readOnly:l,required:h}=Object.assign({},e);return t&&(r=r||t.label,n=n||t.name,h=t.required||(null==e?void 0:e.required),l=t.readOnly||(null==e?void 0:e.readOnly),i=t.properties,s=t.userInterface),{name:n,label:r,group:a,readOnly:l,required:h,props:i,userInterface:s||o.SHORTTEXT}})(d,t);r.get(u).push(e),e.required&&l.push(t.name),((null==t.cleanOnCopy?null===(i=d.properties)||void 0===i?void 0:i.cleanOnCopy:t.cleanOnCopy)||(null===(s=d.properties)||void 0===s?void 0:s.cleanOnCopy))&&h.push(t.name);let a=null==t.defaultValue?null===(n=d.properties)||void 0===n?void 0:n.defaultValue:t.defaultValue;if(a&&null!=a.value){const{type:e,value:i}=a;if(e)if("V"===e)a=i;else try{const t=JSON.parse(i);a=t&&"value"in t?t:i}catch(t){}c[t.name]=a}}}}));const u=new g;if(u.setDefaultVars(t.defaultVars),i){const t=e.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:e,name:i,fields:s}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);r.set({name:i,label:e},s)}))}return Array.from(r.entries()).sort(y).forEach((([t,e])=>{u.addSheet({label:"__main"===t.label?"Principal":t.label,name:t.name||t.label,fields:e})})),u.addRequiredFields(l),u.addCleanOnCopyFields(h),u.addDefaultValues(c),u})(this.config,this.dataUnit);this._store.dispatch({type:S.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new f("ez-form")),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new _(this.dataUnit),this._store=R(z),this._store.subscribe((()=>s(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),v.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){const t=N(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback()}buildIdTabSelector(t){return t&&t.forEach((t=>t[v.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=d.toCamelCase(t.label))),t}render(){return i(n,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};x.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{x as ez_form}
@@ -0,0 +1 @@
1
+ import{r as t,c as o,h as i,H as e}from"./p-bfc7b8ca.js";const l=class{constructor(i){t(this,i),this.ezClosePopup=o(this,"ezClosePopup",7),this._sizeClasses={"x-small":"col--sd-3",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11"},this._bodyOverflow="",this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0}observeConfig(){this.manageOverflow()}manageOverflow(){this.opened&&(this._bodyOverflow=window.document.body.style.overflow),window.document.body.style.overflow=this.opened?"hidden":this._bodyOverflow}getGridSize(){return this._sizeClasses[this.size]||this._sizeClasses.medium}componentDidRender(){this._container&&this._container.focus()}render(){return this.opened?i(e,null,i("div",{class:"overlay"},i("div",{class:"popup col "+this.getGridSize()},i("div",{class:"popup__container "+("auto"===this.heightMode?"popup__container--auto":""),ref:t=>this._container=t,tabIndex:-1},i("div",{class:"popup__content"},this.useHeader&&i("div",{class:"popup__header"},this.ezTitle?i("div",{class:"popup__title"},this.ezTitle):void 0,i("button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",onClick:()=>{this.opened=!1,this.ezClosePopup.emit()}})),i("div",{class:"popup__expandable-content"},i("slot",null))))))):null}static get watchers(){return{opened:["observeConfig"]}}};l.style=':host{display:flex;--ez-popup-z-index:var(--most-visible, 3);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, "Roboto");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url(\'data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z"/></svg>\')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__container--auto{height:auto}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:grid;grid-template-rows:auto 1fr}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;height:100%;width:100%}.popup__header{padding-bottom:var(--ez-popup__header--padding-bottom);width:100%;display:flex}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.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%}}';export{l as ez_popup}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as o,H as s,g as e}from"./p-bfc7b8ca.js";import{FloatingManager as r}from"@sankhyalabs/core";const h=class{constructor(o){t(this,o),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this._firstRender=!0,this._bodyOverflow="",this.innerClickTest=(t,i,o)=>{const s=[t];this.innerElement&&("string"==typeof this.innerElement?s.push(document.querySelector(`#${this.innerElement}`)):this.innerElement.forEach((t=>{s.push(document.querySelector(`#${t}`))})));for(var e=0;e<s.length;e++){let t=s[e];if(null!=t){if(t.contains(i))return!0;if(o&&"nodeType"in(null==o?void 0:o.target)&&t.contains(o.target))return!0;if(t.shadowRoot&&t.shadowRoot.contains(i))return!0;if(t=this._host,t.lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))return!0;const s=i.getRootNode();if(s instanceof ShadowRoot&&o.composedPath().includes(s.host))return!0}}return!1},this.backClickListener=()=>{this.ezVisibilityChange.emit(!1)},this.autoClose=!0,this.top="0px",this.left="0px",this.bottom="0px",this.right="0px",this.boxWidth="fit-content",this.opened=void 0,this.innerElement=void 0,this.overlayType="light"}observeOpened(t,i){t!=i&&(i?this.hide():this.show(),this.ezVisibilityChange.emit(t))}observeConfig(){this.manageOverflow()}manageOverflow(){this.opened&&(this._bodyOverflow=window.document.body.style.overflow),window.document.body.style.overflow=this.opened?"hidden":this._bodyOverflow}async updatePosition(t=this.top,i=this.left,o=this.bottom,s=this.right){r.updateFloatPosition(this._box,this._container,{autoClose:this.autoClose,top:t,left:i,bottom:o,right:s,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener})}async show(t=this.top,i=this.left,o=this.bottom,s=this.right){const e="none"!==this.overlayType,h=`ez-scrim ez-scrim--${this.overlayType}`;let n={autoClose:this.autoClose,top:t,left:i,bottom:o,right:s,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener};e&&(n=Object.assign(Object.assign({},n),{autoClose:!0,useOverlay:e,overlayClassName:h})),this._floatingID=r.float(this._box,this._container,n),this.opened=!0}async hide(){void 0!==this._floatingID&&(r.close(this._floatingID),this._floatingID=void 0,this.opened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return o(s,null,o("section",{ref:t=>this._container=t},o("div",{class:"popover__box "+("fit-content"===this.boxWidth?"popover__box--fit-content":"popover__box--full-width"),ref:t=>this._box=t},o("slot",null))))}get _host(){return e(this)}static get watchers(){return{opened:["observeOpened","observeConfig"]}}};h.style=":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(--most-visible, 3);position:relative;display:flex;user-select:none}.popover__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)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";export{h as ez_popover}
@@ -0,0 +1 @@
1
+ import{r as i,c as o,h as t,H as s,g as e}from"./p-bfc7b8ca.js";import{ObjectUtils as r,FloatingManager as l,StringUtils as a,ElementIDUtils as h}from"@sankhyalabs/core";import{A as n}from"./p-41ce6f98.js";import{C as c}from"./p-4a5e37a7.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as b}from"./p-3f4ae3a3.js";const d=class{constructor(t){i(this,t),this.ezChange=o(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._lookupMode=!1,this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.searchMode=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var i;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(i=this.errorMessage)||void 0===i?void 0:i.trim())||this.setInputValue())}observeValue(i,o){if(this._textInput&&i!=o)try{if(this.searchMode&&"string"==typeof i)return void this.setInputValue();const t=this.getSelectedOption(i),s=this.getSelectedOption(o),e=this.getSelectedOption(this.value);this.isDifferentValues(e,t)&&(this.value=t),this.isDifferentValues(t,s)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===t?void 0:t)),this.resetOptions()}finally{this._lookupMode=!1}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}isDifferentValues(i,o){return r.objectToString(i||{})!==r.objectToString(o||{})}getFormattedText(i){if(null!=i){if(!this.showSelectedValue||null==i.value)return i.label;if(i.label)return`${i.value} - ${i.label}`}}getText(){const i=this.getSelectedOption(this.value),o=this.getFormattedText(i);if(null!=o)return String(o).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')}getSelectedOption(i){return"string"==typeof i||i instanceof String?this._visibleOptions.find((o=>o.value===i)):i}updateVisibleOptions(){let i=this._source||[];if(!this.searchMode&&this._criteria){const o=this._criteria.toUpperCase();i=i.filter((i=>i.label.toLocaleUpperCase().indexOf(o)>-1))}this._visibleOptions=this.suppressEmptyOption?i:[{value:void 0,label:""}].concat(i),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var i;if(this.showOptionValue){const o=[];return null===(i=this._visibleOptions)||void 0===i||i.forEach((i=>{const t=this.getWidthValue(i.value);o.includes(t)||o.push(t)})),o.length>1?Math.max(...o):0}return 0}getWidthValue(i){if(null!=this._itemValueBasis){const o=this._itemValueBasis;if(null!=i)return o.innerHTML=i,o.clientWidth>0?o.clientWidth+2:0;o.innerHTML=""}return 0}buildItem(i,o){const s=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return i.label=i.label||(i.value?`<SEM ${this.getFieldLabel()}>`:""),t("li",{class:o===this._preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.selectOption(i),onMouseOver:()=>this._preSelection=o},this.showOptionValue?t("span",{class:"item__value",title:i.value,style:{width:s,minWidth:s,maxWidth:s}},i.value):void 0,t("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:i.label},i.label))}showOptions(){this.enabled&&(this._floatingID=l.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"6px":"-13px"}),this.setFocus(),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&l.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&l.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(i,o){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`li#item_${i.value}`):void 0;if(t){const i=t.parentElement,s=i.getBoundingClientRect(),e=t.getBoundingClientRect();o&&e.bottom>s.bottom?i.scrollTop=e.height*(this._preSelection-3):!o&&e.top<s.top&&(i.scrollTop=e.height*this._preSelection)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(i){this._startLoading=!1,i instanceof Promise?(this._showLoading=!0,i.then((i=>{this._showLoading=!1,this.updateSource(i)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(i)?(this._source=i,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(i))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(i){var o,t;const s=this.getSelectedOption(this.value);(null===(o=null==s?void 0:s.value)||void 0===o?void 0:o.toString())!==(null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.toString())||null==s&&null!=i&&"value"in i?this.value=(null==i?void 0:i.value)?i:void 0:this.resetOptions(),this.searchMode&&(this._visibleOptions=[],this.clearSource())}loadOptions(i,o=""){this._criteria=o,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:i,argument:o}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(i=!0){const o=this.getText();(this._textInput.value||"")!==o&&(this._textInput.value=o,i&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var i;if(this.searchMode){const o=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((i=>""!==i.label&&null!=i.value));1===(null==o?void 0:o.length)&&this.selectOption(o[0])}}controlEmptySearch(){var i;this.searchMode&&((null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne():(this.clearSearch(),n.info(this._textEmptyList)))}validateDescriptionValue(){if(!this.searchMode||a.isEmpty(this.value))return;let i=this.value;if("object"==typeof i){if(!a.isEmpty(i.label))return;i=i.value}a.isEmpty(i)||this.loadDescriptionValue(i)}async loadDescriptionValue(i){var o,t;if(null==i)return;if((null===(o=this.options)||void 0===o?void 0:o.length)>0)return void this.loadOptionValue(i);const s={mode:m.PREDICTIVE,argument:i},e=await(null===(t=this.optionLoader)||void 0===t?void 0:t.call(this,s));null!=e&&(e instanceof Promise?e.then((i=>{this.setDescriptionValue(i)})):this.setDescriptionValue(e))}setDescriptionValue(i){const o=(null==i?void 0:i[0])||i;null!=o&&Object.keys(o).length?(o.label||(o.label=`<SEM ${this.getFieldLabel()}>`),this._lookupMode=!0,this.value=o):this.showNoResultMessage()}loadOptionValue(i){var o;const t=null===(o=this.options)||void 0===o?void 0:o.find((o=>o.value===i));null!=t?this.selectOption(t):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),n.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var i;return null===(i=this.label)||void 0===i?void 0:i.replace(b,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const i=this.el.querySelectorAll("option");i&&i.forEach((i=>{let o=i.innerText,t=i.getAttribute("value");t||(t=o),this.options.push({label:o,value:t}),i.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(m.PRELOAD)}componentDidRender(){var i;void 0===this._floatingID&&this._listWrapper.remove(),null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{h.addIDInfoIfNotExists(i,"itemComboBox")})),this.validateDescriptionValue()}componentDidLoad(){c.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}handlerIconClick(){this.searchMode?this.loadOptions(m.ADVANCED):this.showOptions()}onTextInputChangeHandler(i){var o;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(i)}),this._deboucingTime));const t=null===(o=i.target.value)||void 0===o?void 0:o.trim(),s=Number(t||void 0);this._criteria||(this._textInput.value=i.data||t),this._criteria=t,t?this.searchMode?(this._showLoading=!1,this.clearSource(),!isNaN(s)||t.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(m.PREDICTIVE,isNaN(s)?t:s.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.updateVisibleOptions(),this.showOptions()):(this.hideOptions(),this.searchMode?(this._showLoading=!1,this.clearSource()):this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(i){switch(this._tabPressed=!1,i.ctrlKey&&("f"!==i.key&&"F"!==i.key||(this.loadOptions(m.ADVANCED),i.stopPropagation(),i.stopImmediatePropagation(),i.preventDefault())),i.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){var i;return h.addIDInfoIfNotExists(this.el,"input"),t(s,null,t("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:i=>this._textInput=i,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:i=>this.onTextInputChangeHandler(i),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:i=>this.keyDownHandler(i),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(i=this._textInput)||void 0===i?void 0:i.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:i=>this._listContainer=i},t("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},t("div",{class:"list-options",ref:i=>this._optionsList=i},!this._showLoading&&0===this._visibleOptions.length&&t("div",{class:"message"},t("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&t("div",{class:"message"},t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:i=>this._itemValueBasis=i}):void 0,!this._showLoading&&this._visibleOptions.length>0&&this._visibleOptions.map(((i,o)=>this.buildItem(i,o)))))))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var m;!function(i){i.ADVANCED="ADVANCED",i.PRELOAD="PRELOAD",i.PREDICTIVE="PREDICTIVE"}(m||(m={})),d.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{d as ez_combo_box}
@@ -14,6 +14,7 @@ export declare class EzComboBox {
14
14
  private _tabPressed;
15
15
  private _textEmptyList;
16
16
  private _textEmptySearch;
17
+ private _lookupMode;
17
18
  private el;
18
19
  private _preSelection;
19
20
  private _visibleOptions;
@@ -131,7 +132,6 @@ export declare class EzComboBox {
131
132
  private onTextInputClickHandler;
132
133
  private keyDownHandler;
133
134
  private onTextInputFocusOutHandler;
134
- private isLookUpSearch;
135
135
  render(): any;
136
136
  }
137
137
  export interface IOption {
@@ -17,6 +17,9 @@ export declare class EzDialog {
17
17
  private labelConfirm;
18
18
  private labelCancel;
19
19
  private btnConfirmDanger;
20
+ private _messageQueue;
21
+ private _currentMessage;
22
+ private _bodyOverflow;
20
23
  private _element;
21
24
  /**
22
25
  * Define se o ez-dialog será utilizado no modo de confirmação.
@@ -54,8 +57,8 @@ export declare class EzDialog {
54
57
  * Define função a ser executada antes de fechar o modal
55
58
  */
56
59
  beforeClose: Function;
57
- private _messageQueue;
58
- private _currentMessage;
60
+ observeConfig(): void;
61
+ private manageOverflow;
59
62
  private handleButtonClick;
60
63
  /**
61
64
  * Exibe o ez-dialog.
@@ -4,6 +4,7 @@ export declare class EzPopover {
4
4
  private _box;
5
5
  private _floatingID;
6
6
  private _firstRender;
7
+ private _bodyOverflow;
7
8
  _host: any;
8
9
  /**
9
10
  * Define que será fechado automaticamente quando o usuário clicar fora do conteúdo.
@@ -46,6 +47,8 @@ export declare class EzPopover {
46
47
  */
47
48
  ezVisibilityChange: EventEmitter<boolean>;
48
49
  observeOpened(newValue: boolean, oldValue: boolean): void;
50
+ observeConfig(): void;
51
+ private manageOverflow;
49
52
  innerClickTest: (_popOvercontainer: HTMLElement, node: HTMLElement, eventOrigin?: MouseEvent) => boolean;
50
53
  backClickListener: () => void;
51
54
  /**
@@ -2,6 +2,7 @@ import { EventEmitter } from "../../stencil-public-runtime";
2
2
  export declare class EzPopup {
3
3
  private _container;
4
4
  private _sizeClasses;
5
+ private _bodyOverflow;
5
6
  /**
6
7
  * Define a largura do ez-popup.
7
8
  */
@@ -26,6 +27,8 @@ export declare class EzPopup {
26
27
  * Emitido ao clicar no botão de fechar (onEzClosePopup).
27
28
  */
28
29
  ezClosePopup: EventEmitter;
30
+ observeConfig(): void;
31
+ private manageOverflow;
29
32
  getGridSize(): string;
30
33
  componentDidRender(): void;
31
34
  render(): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "4.12.0",
3
+ "version": "4.12.2",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as o,h as i,H as s,g as e}from"./p-bfc7b8ca.js";import{FloatingManager as r}from"@sankhyalabs/core";const h=class{constructor(i){t(this,i),this.ezVisibilityChange=o(this,"ezVisibilityChange",7),this._firstRender=!0,this.innerClickTest=(t,o,i)=>{const s=[t];this.innerElement&&("string"==typeof this.innerElement?s.push(document.querySelector(`#${this.innerElement}`)):this.innerElement.forEach((t=>{s.push(document.querySelector(`#${t}`))})));for(var e=0;e<s.length;e++){let t=s[e];if(null!=t){if(t.contains(o))return!0;if(i&&"nodeType"in(null==i?void 0:i.target)&&t.contains(i.target))return!0;if(t.shadowRoot&&t.shadowRoot.contains(o))return!0;if(t=this._host,t.lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(o):t.contains(o))return!0;const s=o.getRootNode();if(s instanceof ShadowRoot&&i.composedPath().includes(s.host))return!0}}return!1},this.backClickListener=()=>{this.ezVisibilityChange.emit(!1)},this.autoClose=!0,this.top="0px",this.left="0px",this.bottom="0px",this.right="0px",this.boxWidth="fit-content",this.opened=void 0,this.innerElement=void 0,this.overlayType="light"}observeOpened(t,o){t!=o&&(o?this.hide():this.show(),this.ezVisibilityChange.emit(t))}async updatePosition(t=this.top,o=this.left,i=this.bottom,s=this.right){r.updateFloatPosition(this._box,this._container,{autoClose:this.autoClose,top:t,left:o,bottom:i,right:s,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener})}async show(t=this.top,o=this.left,i=this.bottom,s=this.right){const e="none"!==this.overlayType,h=`ez-scrim ez-scrim--${this.overlayType}`;let n={autoClose:this.autoClose,top:t,left:o,bottom:i,right:s,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener};e&&(n=Object.assign(Object.assign({},n),{autoClose:!0,useOverlay:e,overlayClassName:h})),this._floatingID=r.float(this._box,this._container,n),this.opened=!0}async hide(){void 0!==this._floatingID&&(r.close(this._floatingID),this._floatingID=void 0,this.opened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return i(s,null,i("section",{ref:t=>this._container=t},i("div",{class:"popover__box "+("fit-content"===this.boxWidth?"popover__box--fit-content":"popover__box--full-width"),ref:t=>this._box=t},i("slot",null))))}get _host(){return e(this)}static get watchers(){return{opened:["observeOpened"]}}};h.style=":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(--most-visible, 3);position:relative;display:flex;user-select:none}.popover__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)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";export{h as ez_popover}
@@ -1 +0,0 @@
1
- import{r as o,c as i,h as t,H as s,g as e}from"./p-bfc7b8ca.js";import{ObjectUtils as r,FloatingManager as l,StringUtils as a,ElementIDUtils as h}from"@sankhyalabs/core";import{A as n}from"./p-41ce6f98.js";import{C as c}from"./p-4a5e37a7.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as b}from"./p-3f4ae3a3.js";const d=class{constructor(t){o(this,t),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.searchMode=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var o;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(o=this.errorMessage)||void 0===o?void 0:o.trim())||this.setInputValue())}observeValue(o,i){if(this._textInput&&o!=i){if(this.searchMode&&"string"==typeof o)return void this.setInputValue();const t=this.getSelectedOption(o),s=this.getSelectedOption(i),e=this.getSelectedOption(this.value);if(this.isDifferentValues(e,t)&&(this.value=t),this.isDifferentValues(t,s)){this.setInputValue();const s=null===t?void 0:t;this.isLookUpSearch(o,i)||this.ezChange.emit(s)}this.resetOptions()}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}isDifferentValues(o,i){return r.objectToString(o||{})!==r.objectToString(i||{})}getFormattedText(o){if(null!=o){if(!this.showSelectedValue||null==o.value)return o.label;if(o.label)return`${o.value} - ${o.label}`}}getText(){const o=this.getSelectedOption(this.value),i=this.getFormattedText(o);if(null!=i)return String(i).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')}getSelectedOption(o){return"string"==typeof o||o instanceof String?this._visibleOptions.find((i=>i.value===o)):o}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const i=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(i)>-1))}this._visibleOptions=this.suppressEmptyOption?o:[{value:void 0,label:""}].concat(o),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var o;if(this.showOptionValue){const i=[];return null===(o=this._visibleOptions)||void 0===o||o.forEach((o=>{const t=this.getWidthValue(o.value);i.includes(t)||i.push(t)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(o){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=o)return i.innerHTML=o,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}buildItem(o,i){const s=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return o.label=o.label||(o.value?`<SEM ${this.getFieldLabel()}>`:""),t("li",{class:i===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=i},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:s,minWidth:s,maxWidth:s}},o.value):void 0,t("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:o.label},o.label))}showOptions(){this.enabled&&(this._floatingID=l.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"6px":"-13px"}),this.setFocus(),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&l.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&l.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,i){window.requestAnimationFrame((()=>{const t=(null==o?void 0:o.value)?this._optionsList.querySelector(`li#item_${o.value}`):void 0;if(t){const o=t.parentElement,s=o.getBoundingClientRect(),e=t.getBoundingClientRect();i&&e.bottom>s.bottom?o.scrollTop=e.height*(this._preSelection-3):!i&&e.top<s.top&&(o.scrollTop=e.height*this._preSelection)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(o){this._startLoading=!1,o instanceof Promise?(this._showLoading=!0,o.then((o=>{this._showLoading=!1,this.updateSource(o)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(o)?(this._source=o,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(o))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(o){var i,t;const s=this.getSelectedOption(this.value);(null===(i=null==s?void 0:s.value)||void 0===i?void 0:i.toString())!==(null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.toString())||null==s&&null!=o&&"value"in o?this.value=(null==o?void 0:o.value)?o:void 0:this.resetOptions(),this.searchMode&&(this._visibleOptions=[],this.clearSource())}loadOptions(o,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(o=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,o&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var o;if(this.searchMode){const i=null===(o=this._visibleOptions)||void 0===o?void 0:o.filter((o=>""!==o.label&&null!=o.value));1===(null==i?void 0:i.length)&&this.selectOption(i[0])}}controlEmptySearch(){var o;this.searchMode&&((null===(o=this._visibleOptions)||void 0===o?void 0:o.length)?this.controlListWithOnlyOne():(this.clearSearch(),n.info(this._textEmptyList)))}validateDescriptionValue(){if(!this.searchMode||a.isEmpty(this.value))return;let o=this.value;if("object"==typeof o){if(!a.isEmpty(o.label))return;o=o.value}a.isEmpty(o)||this.loadDescriptionValue(o)}async loadDescriptionValue(o){var i,t;if(null==o)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(o);const s={mode:m.PREDICTIVE,argument:o},e=await(null===(t=this.optionLoader)||void 0===t?void 0:t.call(this,s));null!=e&&(e instanceof Promise?e.then((o=>{this.setDescriptionValue(o)})):this.setDescriptionValue(e))}setDescriptionValue(o){const i=(null==o?void 0:o[0])||o;null!=i&&Object.keys(i).length?(i.label||(i.label=`<SEM ${this.getFieldLabel()}>`),this.value=i):this.showNoResultMessage()}loadOptionValue(o){var i;const t=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===o));null!=t?this.selectOption(t):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),n.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var o;return null===(o=this.label)||void 0===o?void 0:o.replace(b,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let i=o.innerText,t=o.getAttribute("value");t||(t=i),this.options.push({label:i,value:t}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(m.PRELOAD)}componentDidRender(){var o;void 0===this._floatingID&&this._listWrapper.remove(),null===(o=this._optionsList)||void 0===o||o.querySelectorAll(".item").forEach((o=>{h.addIDInfoIfNotExists(o,"itemComboBox")})),this.validateDescriptionValue()}componentDidLoad(){c.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}handlerIconClick(){this.searchMode?this.loadOptions(m.ADVANCED):this.showOptions()}onTextInputChangeHandler(o){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(o)}),this._deboucingTime));const t=null===(i=o.target.value)||void 0===i?void 0:i.trim(),s=Number(t||void 0);this._criteria||(this._textInput.value=o.data||t),this._criteria=t,t?this.searchMode?(this._showLoading=!1,this.clearSource(),!isNaN(s)||t.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(m.PREDICTIVE,isNaN(s)?t:s.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.updateVisibleOptions(),this.showOptions()):(this.hideOptions(),this.searchMode?(this._showLoading=!1,this.clearSource()):this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(this._tabPressed=!1,o.ctrlKey&&("f"!==o.key&&"F"!==o.key||(this.loadOptions(m.ADVANCED),o.stopPropagation(),o.stopImmediatePropagation(),o.preventDefault())),o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}isLookUpSearch(o,i){return this.searchMode&&"object"!=typeof i&&"object"==typeof o&&i==o.value}render(){var o;return h.addIDInfoIfNotExists(this.el,"input"),t(s,null,t("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:o=>this._textInput=o,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(o=this._textInput)||void 0===o?void 0:o.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:o=>this._listContainer=o},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("div",{class:"list-options",ref:o=>this._optionsList=o},!this._showLoading&&0===this._visibleOptions.length&&t("div",{class:"message"},t("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&t("div",{class:"message"},t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:o=>this._itemValueBasis=o}):void 0,!this._showLoading&&this._visibleOptions.length>0&&this._visibleOptions.map(((o,i)=>this.buildItem(o,i)))))))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var m;!function(o){o.ADVANCED="ADVANCED",o.PRELOAD="PRELOAD",o.PREDICTIVE="PREDICTIVE"}(m||(m={})),d.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{d as ez_combo_box}
@@ -1 +0,0 @@
1
- import{r as t,c as o,h as i,H as e}from"./p-bfc7b8ca.js";const l=class{constructor(i){t(this,i),this.ezClosePopup=o(this,"ezClosePopup",7),this._sizeClasses={"x-small":"col--sd-3",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11"},this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0}getGridSize(){return this._sizeClasses[this.size]||this._sizeClasses.medium}componentDidRender(){this._container&&this._container.focus()}render(){return this.opened?i(e,null,i("div",{class:"overlay"},i("div",{class:"popup col "+this.getGridSize()},i("div",{class:"popup__container "+("auto"===this.heightMode?"popup__container--auto":""),ref:t=>this._container=t,tabIndex:-1},i("div",{class:"popup__content"},this.useHeader&&i("div",{class:"popup__header"},this.ezTitle?i("div",{class:"popup__title"},this.ezTitle):void 0,i("button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",onClick:()=>{this.opened=!1,this.ezClosePopup.emit()}})),i("div",{class:"popup__expandable-content"},i("slot",null))))))):null}};l.style=':host{display:flex;--ez-popup-z-index:var(--most-visible, 3);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, "Roboto");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url(\'data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z"/></svg>\')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__container--auto{height:auto}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:grid;grid-template-rows:auto 1fr}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;height:100%;width:100%}.popup__header{padding-bottom:var(--ez-popup__header--padding-bottom);width:100%;display:flex}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.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%}}';export{l as ez_popup}
@@ -1 +0,0 @@
1
- import{r as i,c as t,f as o,h as a,g as l}from"./p-bfc7b8ca.js";import{D as e}from"./p-ab574d59.js";import{ElementIDUtils as d}from"@sankhyalabs/core";class r{constructor(i,t,o,a,l,e,d,r,n,c){this.title=i,this.message=t,this.dialogType=o,this.confirm=a,this.icon=l,this.labelCancel=e,this.labelConfirm=d,this.btnConfirmDanger=r,this.callBack=n,this.beforeClose=c}}const n=class{constructor(o){i(this,o),this.ezCancel=t(this,"ezCancel",7),this.ezAccept=t(this,"ezAccept",7),this.labelConfirm="Sim",this.labelCancel="Não",this.btnConfirmDanger=!1,this._messageQueue=[],this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}handleButtonClick(i){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(i)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(i),i?this.ezAccept.emit(i):this.ezCancel.emit(i),this._currentMessage=this._messageQueue.shift(),o(this))}async show(i,t,o,a,l,e,d,n,c){return this.opened=!0,new Promise((s=>{this._messageQueue.push(new r(i,t,o,a,l,e,d,n,s,c))}))}isCritical(i){return i===e.CRITICAL}getIconElement(i){if(i.dialogType!==e.DEFAULT)return a("ez-icon",{class:"changeable__icon "+this.getIconClass(i.dialogType),size:"small",iconName:this.getIconName(i)})}getIconClass(i){return this.isCritical(i)?"title-icon--critical":i===e.SUCCESS?"title-icon--success":i===e.WARN?"title-icon--warn":""}getIconName(i){return i.icon?i.icon:this.isCritical(i.dialogType)?"alert-circle-inverted":i.dialogType===e.WARN?"warning-outline":i.dialogType===e.SUCCESS?"check":void 0}getTypeIndicatorElement(i){if(i.dialogType!==e.DEFAULT)return a("div",{class:this.getClassIconIndicator(i.dialogType)})}getClassIconIndicator(i){return this.isCritical(i)?"dialog__critical--indicator":i==e.SUCCESS?"dialog__success--indicator":i==e.WARN?"dialog__warning--indicator":""}getClassContainer(i){return(i.dialogType||e.DEFAULT)===e.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(i){return null==this.getIconElement(i)?"title title__label title__label--no-icon":"title title__label"}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new r(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.labelCancel,this.labelConfirm,this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){d.addIDInfo(this._element)}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay"},a("div",{class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":d.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":d.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":d.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":d.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":d.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{label:"Ok","data-element-id":d.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return l(this)}};n.style=':host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:0}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.title-icon--success{background-color:var(--dialog__success--background-color)}.title-icon--warn{background-color:var(--dialog__warning--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.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%}}';export{n as ez_dialog}