@sankhyalabs/ezui 1.1.77 → 1.1.80

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 (174) hide show
  1. package/dist/cjs/{AssetsUtils-dd585fba.js → AssetsUtils-02db4f46.js} +1 -1
  2. package/dist/cjs/CSSVarsUtils-66e86394.js +18 -0
  3. package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-application.cjs.entry.js +1 -3
  5. package/dist/cjs/ez-button_3.cjs.entry.js +520 -0
  6. package/dist/cjs/ez-calendar_13.cjs.entry.js +2421 -0
  7. package/dist/cjs/ez-date-time-input.cjs.entry.js +26 -37
  8. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  9. package/dist/cjs/{ez-button_11.cjs.entry.js → ez-grid.cjs.entry.js} +14 -1410
  10. package/dist/cjs/ez-icon.cjs.entry.js +30 -0
  11. package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-modal_2.cjs.entry.js +370 -0
  13. package/dist/cjs/ez-popover.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-time-input.cjs.entry.js +4 -4
  16. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  17. package/dist/cjs/ezui.cjs.js +2 -2
  18. package/dist/cjs/{index-4e4bae01.js → index-2003dec4.js} +0 -10
  19. package/dist/cjs/{index-262d703b.js → index-a2266984.js} +18 -43
  20. package/dist/cjs/loader.cjs.js +2 -2
  21. package/dist/collection/collection-manifest.json +0 -2
  22. package/dist/collection/components/ez-application/ez-application.js +0 -2
  23. package/dist/collection/components/ez-calendar/ez-calendar.js +7 -2
  24. package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -5
  25. package/dist/collection/components/ez-combo-box/ez-combo-box.js +4 -0
  26. package/dist/collection/components/ez-date-input/ez-date-input.css +2 -2
  27. package/dist/collection/components/ez-date-input/ez-date-input.js +1 -1
  28. package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -5
  29. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +23 -34
  30. package/dist/collection/components/ez-form/DataBinder.js +44 -0
  31. package/dist/collection/components/ez-form/ez-form.css +1 -15
  32. package/dist/collection/components/ez-form/ez-form.js +112 -427
  33. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +45 -0
  34. package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +11 -0
  35. package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +14 -0
  36. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +5 -0
  37. package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +5 -0
  38. package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +13 -0
  39. package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +5 -0
  40. package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +5 -0
  41. package/dist/collection/components/ez-form/fieldbuilder/tpl/TextInput.tpl.js +5 -0
  42. package/dist/collection/components/ez-form/store/form.slice.js +38 -0
  43. package/dist/collection/components/ez-form/structure/FormItem.js +11 -0
  44. package/dist/collection/components/ez-form/structure/FormSheet.js +5 -0
  45. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +86 -0
  46. package/dist/collection/components/ez-number-input/ez-number-input.css +0 -9
  47. package/dist/collection/components/ez-number-input/ez-number-input.js +20 -115
  48. package/dist/collection/components/ez-search/ez-search.js +6 -1
  49. package/dist/collection/components/test-du/test-du.js +65 -23
  50. package/dist/collection/utils/CSSVarsUtils.js +6 -6
  51. package/dist/custom-elements/index.d.ts +0 -12
  52. package/dist/custom-elements/index.js +530 -2278
  53. package/dist/esm/{AssetsUtils-3803e935.js → AssetsUtils-76ca41e1.js} +1 -1
  54. package/dist/esm/CSSVarsUtils-aeee9825.js +16 -0
  55. package/dist/esm/ez-action-chip.entry.js +1 -1
  56. package/dist/esm/ez-application.entry.js +1 -3
  57. package/dist/esm/ez-button_3.entry.js +514 -0
  58. package/dist/esm/ez-calendar_13.entry.js +2405 -0
  59. package/dist/esm/ez-date-time-input.entry.js +26 -37
  60. package/dist/esm/ez-dialog.entry.js +1 -1
  61. package/dist/esm/{ez-button_11.entry.js → ez-grid.entry.js} +4 -1390
  62. package/dist/esm/ez-icon.entry.js +26 -0
  63. package/dist/esm/ez-label-chip.entry.js +1 -1
  64. package/dist/esm/ez-modal_2.entry.js +365 -0
  65. package/dist/esm/ez-popover.entry.js +2 -2
  66. package/dist/esm/ez-popup.entry.js +1 -1
  67. package/dist/esm/ez-time-input.entry.js +4 -4
  68. package/dist/esm/ez-toast.entry.js +1 -1
  69. package/dist/esm/ezui.js +2 -2
  70. package/dist/esm/{index-1dacecd3.js → index-077c7fcf.js} +0 -10
  71. package/dist/esm/{index-cfd5e193.js → index-afe19542.js} +17 -40
  72. package/dist/esm/loader.js +2 -2
  73. package/dist/ezui/ezui.esm.js +1 -1
  74. package/dist/ezui/p-00b837e2.js +1 -0
  75. package/dist/ezui/{p-516d0e0f.entry.js → p-0a2056d9.entry.js} +1 -1
  76. package/dist/ezui/p-0d8368fc.entry.js +1 -0
  77. package/dist/ezui/p-1e36e3ff.entry.js +1 -0
  78. package/dist/ezui/p-446ec85b.js +1 -0
  79. package/dist/ezui/p-49f3432a.entry.js +1 -0
  80. package/dist/ezui/{p-1ea8187e.entry.js → p-5509ee41.entry.js} +46 -46
  81. package/dist/ezui/{p-a18a2d7b.entry.js → p-57ea4b84.entry.js} +1 -1
  82. package/dist/ezui/{p-5a86e18a.entry.js → p-6d157776.entry.js} +1 -1
  83. package/dist/ezui/{p-8c51a6aa.entry.js → p-7a1f2e0e.entry.js} +1 -1
  84. package/dist/ezui/p-7de3c95d.js +1 -0
  85. package/dist/ezui/{p-7ef97c5f.entry.js → p-857ead8e.entry.js} +1 -1
  86. package/dist/ezui/p-8b099482.js +1 -0
  87. package/dist/ezui/{p-c6d469fc.entry.js → p-920bb8c9.entry.js} +1 -1
  88. package/dist/ezui/p-a4a39579.entry.js +1 -0
  89. package/dist/ezui/p-d5699f29.entry.js +1 -0
  90. package/dist/ezui/p-d64a3939.entry.js +1 -0
  91. package/dist/ezui/{p-5da66d3e.entry.js → p-da31cd21.entry.js} +1 -1
  92. package/dist/types/components/ez-application/ez-application.d.ts +0 -2
  93. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
  94. package/dist/types/components/ez-form/DataBinder.d.ts +10 -0
  95. package/dist/types/components/ez-form/ez-form.d.ts +25 -32
  96. package/dist/types/components/ez-form/fieldbuilder/FieldBuilder.d.ts +2 -0
  97. package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -0
  98. package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +4 -0
  99. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
  100. package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +4 -0
  101. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +8 -0
  102. package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +4 -0
  103. package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +4 -0
  104. package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +4 -0
  105. package/dist/types/components/ez-form/store/form.slice.d.ts +24 -0
  106. package/dist/types/components/ez-form/structure/FormItem.d.ts +9 -0
  107. package/dist/types/components/ez-form/structure/FormSheet.d.ts +9 -0
  108. package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +27 -0
  109. package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -20
  110. package/dist/types/components/ez-search/ez-search.d.ts +2 -0
  111. package/dist/types/components/test-du/test-du.d.ts +8 -2
  112. package/dist/types/components.d.ts +12 -82
  113. package/dist/types/utils/CSSVarsUtils.d.ts +1 -1
  114. package/package.json +1 -1
  115. package/react/components.d.ts +0 -2
  116. package/react/components.js +0 -2
  117. package/react/components.js.map +1 -1
  118. package/dist/cjs/ApplicationUtils-d1c1db56.js +0 -35
  119. package/dist/cjs/CSSVarsUtils-f8827674.js +0 -18
  120. package/dist/cjs/DataUnit-fdd7c70e.js +0 -474
  121. package/dist/cjs/ez-calendar.cjs.entry.js +0 -212
  122. package/dist/cjs/ez-collapsible-box_6.cjs.entry.js +0 -630
  123. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -250
  124. package/dist/cjs/ez-form.cjs.entry.js +0 -1838
  125. package/dist/cjs/ez-number-input.cjs.entry.js +0 -121
  126. package/dist/cjs/form-metadata.cjs.entry.js +0 -129
  127. package/dist/collection/components/ez-form/assets/trash-can-outline.svg +0 -3
  128. package/dist/collection/components/ez-form/store/Form.actions.js +0 -132
  129. package/dist/collection/components/ez-form/store/Form.reducer.js +0 -194
  130. package/dist/collection/components/ez-form/store/Form.selectors.js +0 -44
  131. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +0 -301
  132. package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +0 -8
  133. package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +0 -24
  134. package/dist/collection/components/ez-form/subcomponents/form-metadata.js +0 -227
  135. package/dist/collection/components/ez-form/subcomponents/place-holder.js +0 -14
  136. package/dist/collection/components/ez-form/subcomponents/structure/Field.js +0 -95
  137. package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +0 -27
  138. package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +0 -41
  139. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +0 -37
  140. package/dist/esm/ApplicationUtils-01280a9d.js +0 -33
  141. package/dist/esm/CSSVarsUtils-e0128b01.js +0 -16
  142. package/dist/esm/DataUnit-1cd45202.js +0 -464
  143. package/dist/esm/ez-calendar.entry.js +0 -208
  144. package/dist/esm/ez-collapsible-box_6.entry.js +0 -621
  145. package/dist/esm/ez-combo-box.entry.js +0 -246
  146. package/dist/esm/ez-form.entry.js +0 -1834
  147. package/dist/esm/ez-number-input.entry.js +0 -117
  148. package/dist/esm/form-metadata.entry.js +0 -125
  149. package/dist/ezui/assets/trash-can-outline.svg +0 -3
  150. package/dist/ezui/p-37a611ea.js +0 -1
  151. package/dist/ezui/p-45689464.entry.js +0 -1
  152. package/dist/ezui/p-57291f97.entry.js +0 -1
  153. package/dist/ezui/p-69416bec.entry.js +0 -1
  154. package/dist/ezui/p-7107d7ef.js +0 -1
  155. package/dist/ezui/p-88f45a83.entry.js +0 -1
  156. package/dist/ezui/p-8f4851a6.js +0 -1
  157. package/dist/ezui/p-9dfd537e.js +0 -1
  158. package/dist/ezui/p-a223eed8.entry.js +0 -1
  159. package/dist/ezui/p-b36308e7.js +0 -1
  160. package/dist/ezui/p-c0af195b.entry.js +0 -1
  161. package/dist/ezui/p-d1889704.js +0 -1
  162. package/dist/ezui/p-e7ee2836.entry.js +0 -1
  163. package/dist/ezui/p-f7b835cf.entry.js +0 -1
  164. package/dist/types/components/ez-form/store/Form.actions.d.ts +0 -111
  165. package/dist/types/components/ez-form/store/Form.reducer.d.ts +0 -20
  166. package/dist/types/components/ez-form/store/Form.selectors.d.ts +0 -14
  167. package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +0 -91
  168. package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +0 -24
  169. package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +0 -16
  170. package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +0 -3
  171. package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +0 -11
  172. package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +0 -13
  173. package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +0 -14
  174. package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +0 -19
@@ -0,0 +1,2421 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-2003dec4.js');
6
+ const index$1 = require('./index-a2266984.js');
7
+ const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
+ const CSSVarsUtils = require('./CSSVarsUtils-66e86394.js');
9
+ const DateUtils = require('./DateUtils-716769e0.js');
10
+
11
+ const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__Time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:2px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--strokes, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}section{display:flex}.calendarTime{margin-left:-10px;display:flex;flex-direction:column;padding:12px 6px;padding-left:16px;padding-bottom:0px;background-color:var(--ez-calendar__Time--background-color);border-top-right-radius:var(--ez-calendar__body--border-radius);border-bottom-right-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__column{height:180px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:6px;padding-right:6px;display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.separatorTime{color:#A2ABB9}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}";
12
+
13
+ let EzCalendar = class {
14
+ constructor(hostRef) {
15
+ index.registerInstance(this, hostRef);
16
+ this.ezChange = index.createEvent(this, "ezChange", 7);
17
+ this._firstRender = true;
18
+ this._todayLabel = "Hoje";
19
+ this._weekDayLabels = ["D", "S", "T", "Q", "Q", "S", "S"];
20
+ this._monthLabels = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
21
+ this._hoursLabel = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"];
22
+ this._minutosLabel = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"];
23
+ /**
24
+ * A data selecionada no calendário
25
+ */
26
+ this.value = new Date();
27
+ /**
28
+ * No modo floating o calendário só se tornará visível
29
+ * quando o método show() for acionado.
30
+ */
31
+ this.floating = false;
32
+ /**
33
+ * Exibe ou não as horas e minutos no calendario
34
+ */
35
+ this.time = false;
36
+ /**
37
+ * Exibe ou não os segundos no calendario
38
+ */
39
+ this.showSeconds = false;
40
+ }
41
+ /**
42
+ * Usado no modo floating. Faz com que o componente seja exibido.
43
+ * É possível determinar ajustes de posicionamento através dos parâmetros
44
+ * top, left, bottom e right. Esses parâmetros devem ser informados como
45
+ * strings no formato css.
46
+ */
47
+ async show(top, left, bottom, right) {
48
+ if (this.floating) {
49
+ this._floatingID = FloatingManager.FloatingManager.float(this._box, this._container, { autoClose: true, top, left, bottom, right });
50
+ window.requestAnimationFrame(() => {
51
+ this._box.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
52
+ });
53
+ }
54
+ }
55
+ /**
56
+ * Método necessário para ajustar o posicionamento do calendar acima ou abaixo do ez-date-input conforme a disponibilidade de espaço.
57
+ */
58
+ async fitVertical(topOffset, bottomOffset) {
59
+ const neededHeight = this._container.getBoundingClientRect().bottom + this._calendarHeight;
60
+ const availableBottom = (window.innerHeight || document.documentElement.clientHeight) > neededHeight;
61
+ if (availableBottom) {
62
+ this.show(topOffset + "px", undefined, "unset");
63
+ }
64
+ else {
65
+ this.show("unset", undefined, bottomOffset + "px");
66
+ }
67
+ }
68
+ /**
69
+ * Usado no modo floating. Faz com que o componente seja ocultado.
70
+ */
71
+ async hide() {
72
+ if (this._floatingID !== undefined) {
73
+ FloatingManager.FloatingManager.close(this._floatingID);
74
+ this._floatingID = undefined;
75
+ }
76
+ }
77
+ valueChanged() {
78
+ if (this.value) {
79
+ this._currentPosition.setTime(this.value.getTime());
80
+ this._currentPosition.setDate(1);
81
+ }
82
+ }
83
+ getMonthLabel() {
84
+ return this._monthLabels[this._currentPosition.getMonth()] + " " + this._currentPosition.getFullYear();
85
+ }
86
+ isSelectedDate(d) {
87
+ if (this.value) {
88
+ return this.value.getDate() == d.getDate() && this.value.getMonth() == d.getMonth() && this.value.getFullYear() == d.getFullYear();
89
+ }
90
+ return false;
91
+ }
92
+ changeMonth(offset) {
93
+ this._currentPosition.setMonth(this._currentPosition.getMonth() + offset);
94
+ index.forceUpdate(this);
95
+ }
96
+ selectDate(d) {
97
+ let newDate = d;
98
+ if (this.value && (this.time || this.showSeconds)) {
99
+ newDate.setHours(this.value.getHours());
100
+ newDate.setMinutes(this.value.getMinutes());
101
+ if (this.showSeconds) {
102
+ newDate.setSeconds(this.value.getSeconds());
103
+ }
104
+ else {
105
+ newDate.setSeconds(0);
106
+ }
107
+ }
108
+ this.value = newDate;
109
+ this.ezChange.emit();
110
+ }
111
+ selectHours(hour) {
112
+ if (!this.value) {
113
+ this.value = new Date();
114
+ }
115
+ this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), hour, this.value.getMinutes(), this.value.getSeconds());
116
+ this.ezChange.emit();
117
+ }
118
+ selectMinutes(minute) {
119
+ if (!this.value) {
120
+ this.value = new Date();
121
+ }
122
+ this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), minute, this.value.getSeconds());
123
+ this.ezChange.emit();
124
+ }
125
+ selectSeconds(second) {
126
+ if (!this.value) {
127
+ this.value = new Date();
128
+ }
129
+ this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), this.value.getMinutes(), second);
130
+ this.ezChange.emit();
131
+ }
132
+ updateScroll(element) {
133
+ if (element) {
134
+ const { scrollHeight, clientHeight, scrollTop } = element;
135
+ const remainingScroll = scrollHeight - clientHeight - Math.ceil(scrollTop);
136
+ if (remainingScroll > 0) {
137
+ element.classList.add("endHidden");
138
+ }
139
+ else {
140
+ element.classList.remove("endHidden");
141
+ }
142
+ }
143
+ }
144
+ componentDidRender() {
145
+ if (this.floating && this._firstRender) {
146
+ this._calendarHeight = this._box.clientHeight;
147
+ this._box.remove();
148
+ this._firstRender = false;
149
+ }
150
+ this.updateScroll(this._hoursScroll);
151
+ this.updateScroll(this._minutesScroll);
152
+ this.updateScroll(this._secondsScroll);
153
+ }
154
+ componentDidLoad() {
155
+ if (this.time || this.showSeconds) {
156
+ this._hoursScroll.scrollTop = this._hoursSelect.offsetTop - 64;
157
+ this._minutesScroll.scrollTop = this._minutesSelect.offsetTop - 64;
158
+ if (this.showSeconds) {
159
+ this._secondsScroll.scrollTop = this._secondsSelect.offsetTop - 64;
160
+ }
161
+ }
162
+ }
163
+ render() {
164
+ if (this._currentPosition == null) {
165
+ this._currentPosition = new Date();
166
+ if (this.value) {
167
+ this._currentPosition.setTime(this.value.getTime());
168
+ }
169
+ this._currentPosition.setDate(1);
170
+ }
171
+ const firstDate = new Date();
172
+ firstDate.setTime(this._currentPosition.getTime());
173
+ firstDate.setDate(1 - firstDate.getDay());
174
+ return (index.h("section", { ref: elem => this._container = elem }, index.h("div", { ref: elem => this._box = elem, style: { display: 'flex' } }, index.h("div", { class: "calendar" }, index.h("div", { class: "calendar__header" }, index.h("button", { class: "calendar__btn-previous", onClick: () => this.changeMonth(-1) }), index.h("label", { class: "calendar__lbl-month" }, this.getMonthLabel()), index.h("button", { class: "calendar__btn-next", onClick: () => this.changeMonth(1) })), index.h("div", { class: "calendar__body" }, index.h("div", { class: "calendar__line" }, this._weekDayLabels.map(day => index.h("div", { class: "calendar__cell calendar__cell--unselectable" }, day))), [0, 7, 14, 21, 28, 35].map(offset => index.h("div", { class: "calendar__line" }, [0, 1, 2, 3, 4, 5, 6].map(index$1 => {
175
+ const date = new Date();
176
+ date.setTime(firstDate.getTime());
177
+ date.setDate(date.getDate() + offset + index$1);
178
+ let classNames = "calendar__cell";
179
+ if (this._currentPosition.getMonth() != date.getMonth()) {
180
+ classNames += " calendar__cell--secondary";
181
+ }
182
+ else if (this.isSelectedDate(date)) {
183
+ classNames += " calendar__cell--selected";
184
+ }
185
+ return index.h("div", { class: classNames, onClick: () => this.selectDate(date) }, date.getDate());
186
+ })))), index.h("div", { class: "calendar__footer" }, index.h("button", { class: "calendar__btn-today", onClick: () => this.selectDate(new Date()) }, this._todayLabel))), (this.time || this.showSeconds) &&
187
+ index.h("div", { class: "calendarTime" }, index.h("div", { class: "calendarTime__header" }, index.h("div", null, "H"), index.h("div", { class: "separatorTime" }, ":"), index.h("div", null, "M"), this.showSeconds &&
188
+ index.h("div", { class: "separatorTime" }, ":"), this.showSeconds &&
189
+ index.h("div", null, "S")), index.h("div", { class: "calendar__body ", style: { display: 'flex', paddingLeft: '6px', paddingRight: '6px' } }, index.h("div", { class: "calendar__column", ref: elem => this._hoursScroll = elem, onScroll: () => this.updateScroll(this._hoursScroll) }, this._hoursLabel.map((offset, index$1) => {
190
+ if (index$1 === this.value.getHours()) {
191
+ return (index.h("div", { style: { display: 'flex' }, ref: elem => this._hoursSelect = elem }, index.h("div", { class: "calendar__cell calendar__cell--selected", onClick: () => this.selectHours(index$1) }, offset), index.h("div", { class: "separatorTime" }, ":")));
192
+ }
193
+ else {
194
+ return (index.h("div", { style: { display: 'flex' } }, index.h("div", { class: "calendar__cell", onClick: () => this.selectHours(index$1) }, offset), index.h("div", { class: "separatorTime" }, ":")));
195
+ }
196
+ })), index.h("div", { class: "calendar__column", ref: elem => this._minutesScroll = elem, onScroll: () => this.updateScroll(this._minutesScroll) }, this._minutosLabel.map((offset, index$1) => {
197
+ if (index$1 === this.value.getMinutes()) {
198
+ return (index.h("div", { style: { display: 'flex' }, ref: elem => this._minutesSelect = elem }, index.h("div", { class: "calendar__cell calendar__cell--selected", onClick: () => this.selectMinutes(index$1) }, offset), this.showSeconds && index.h("div", { class: "separatorTime" }, ":")));
199
+ }
200
+ else {
201
+ return (index.h("div", { style: { display: 'flex' } }, index.h("div", { class: "calendar__cell", onClick: () => this.selectMinutes(index$1) }, offset), this.showSeconds && index.h("div", { class: "separatorTime" }, ":")));
202
+ }
203
+ })), this.showSeconds &&
204
+ index.h("div", { class: "calendar__column", ref: elem => this._secondsScroll = elem, onScroll: () => this.updateScroll(this._secondsScroll) }, this._minutosLabel.map((offset, index$1) => {
205
+ if (index$1 === this.value.getSeconds()) {
206
+ return (index.h("div", { class: "calendar__cell calendar__cell--selected", onClick: () => this.selectSeconds(index$1), ref: elem => this._secondsSelect = elem }, offset));
207
+ }
208
+ else {
209
+ return (index.h("div", { class: "calendar__cell", onClick: () => this.selectSeconds(index$1) }, offset));
210
+ }
211
+ })))))));
212
+ }
213
+ static get watchers() { return {
214
+ "value": ["valueChanged"]
215
+ }; }
216
+ };
217
+ EzCalendar.style = ezCalendarCss;
218
+
219
+ const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:none;transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition);background-color:var(--ez-switch--checked--background-color)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
220
+
221
+ let EzCheck = class {
222
+ constructor(hostRef) {
223
+ index.registerInstance(this, hostRef);
224
+ this.ezChange = index.createEvent(this, "ezChange", 7);
225
+ /**
226
+ * Deixa o campo disponível ou não para interação com o usuário.
227
+ */
228
+ this.enabled = true;
229
+ /**
230
+ * Existem dois modos de visualização: regular e switch.
231
+ * Se esta propriedade for omitida, o componete assume o formato "regular".
232
+ * No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
233
+ * No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
234
+ */
235
+ this.mode = "regular";
236
+ }
237
+ adjustMode() {
238
+ if (this.mode === "switch") {
239
+ this._inputElem.classList.remove("regularMode");
240
+ this._inputElem.classList.add("switchMode");
241
+ }
242
+ else {
243
+ this._inputElem.classList.remove("switchMode");
244
+ this._inputElem.classList.add("regularMode");
245
+ }
246
+ }
247
+ //---------------------------------------------
248
+ // Public methods
249
+ //---------------------------------------------
250
+ /**
251
+ * Devolve o modo escolhido para o componente
252
+ */
253
+ async getMode() {
254
+ return this.mode;
255
+ }
256
+ /**
257
+ * Faz o foco no componente de input
258
+ */
259
+ async setFocus() {
260
+ this._inputElem.focus();
261
+ }
262
+ componentDidLoad() {
263
+ this.adjustMode();
264
+ }
265
+ changeValue() {
266
+ this.value = !this.value;
267
+ this.ezChange.emit(this.value);
268
+ }
269
+ getLabelClasses() {
270
+ let classes = "label";
271
+ if (!this.enabled) {
272
+ classes += " label--disabled";
273
+ }
274
+ return classes;
275
+ }
276
+ render() {
277
+ return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? index.h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
278
+ }
279
+ static get watchers() { return {
280
+ "mode": ["adjustMode"]
281
+ }; }
282
+ };
283
+ EzCheck.style = ezCheckCss;
284
+
285
+ const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--height:42px;--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--ez-collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--ez-collapsible-box__btn--image--medium:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--ez-collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--ez-collapsible-box__btn--fill:var(--ez-collapsible-box--color);--ez-collapsible-box__btn--width:10px;--ez-collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--ez-collapsible-box__btn--fill);width:var(--ez-collapsible-box__btn--width);height:var(--ez-collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xsmall);mask-image:var(--ez-collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--small);mask-image:var(--ez-collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--medium);mask-image:var(--ez-collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--large);mask-image:var(--ez-collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xlarge);mask-image:var(--ez-collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
286
+
287
+ let EzCollapsibleBox = class {
288
+ constructor(hostRef) {
289
+ index.registerInstance(this, hostRef);
290
+ this.ezChange = index.createEvent(this, "ezChange", 7);
291
+ /**
292
+ * Valor externalizado que garante a exibição ou não do componente
293
+ */
294
+ this.value = false;
295
+ /**
296
+ * Define o tamanho do texto e do ícone do componente.
297
+ */
298
+ this.headerSize = "small";
299
+ /**
300
+ * Define o local onde o ícone será renderizado.
301
+ */
302
+ this.iconPlacement = "left";
303
+ }
304
+ observeValue() {
305
+ this.ezChange.emit();
306
+ }
307
+ /**
308
+ * Esconde ou revela o conteúdo do componente
309
+ */
310
+ async showHide() {
311
+ this.value = !this.value;
312
+ }
313
+ render() {
314
+ return (index.h(index.Host, null, this.iconPlacement == "right" ?
315
+ index.h("div", { class: "collapsible-box__title" }, index.h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label), index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }))
316
+ :
317
+ index.h("div", { class: "collapsible-box__title" }, index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }), index.h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label)), !this.value ? index.h("slot", null) : null));
318
+ }
319
+ static get watchers() { return {
320
+ "value": ["observeValue"]
321
+ }; }
322
+ };
323
+ EzCollapsibleBox.style = ezCollapsibleBoxCss;
324
+
325
+ const ezComboBoxCss = ":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__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-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--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));--ez-combo-box__drop-down-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--ez-combo-box__search-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}";
326
+
327
+ let EzComboBox = class {
328
+ constructor(hostRef) {
329
+ index.registerInstance(this, hostRef);
330
+ this.ezChange = index.createEvent(this, "ezChange", 7);
331
+ /**
332
+ * Deixa o campo disponível ou não para interação com usuário.
333
+ */
334
+ this.enabled = true;
335
+ /**
336
+ * Ajusta a opção de mostrar o "value" ao selecionar uma opção. Por padrão não mostra.
337
+ */
338
+ this.showSelectedValue = false;
339
+ /**
340
+ * Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
341
+ */
342
+ this.showOptionValue = false;
343
+ }
344
+ internalUpdate() {
345
+ if (this._inputElement) {
346
+ this._inputElement.value = this.getText();
347
+ }
348
+ this.hideOptions();
349
+ this._criteria = undefined;
350
+ this._preSelection = undefined;
351
+ this.updateVisibleOptions();
352
+ }
353
+ getText() {
354
+ let text = "";
355
+ const selected = this.getSelectedOption();
356
+ if (selected) {
357
+ text = this.showSelectedValue ? `${selected.value} - ${selected.label}` : selected.label;
358
+ }
359
+ return text;
360
+ }
361
+ getSelectedOption() {
362
+ if (typeof this.value === "string" || this.value instanceof String) {
363
+ return this._visibleOptions.find(o => o.value === this.value);
364
+ }
365
+ return this.value;
366
+ }
367
+ updateVisibleOptions() {
368
+ let opts = this._source || [];
369
+ if (!this.searchMode && this._criteria) {
370
+ const upperCriteria = this._criteria.toUpperCase();
371
+ opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
372
+ }
373
+ this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
374
+ }
375
+ buildItem(opt, index$1) {
376
+ return index.h("li", { class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined }, index.h("span", { class: "item--label", title: opt.label }, opt.label), this.showOptionValue ? index.h("span", { class: "item--value", title: opt.value }, opt.value) : undefined);
377
+ }
378
+ showOptions() {
379
+ if (!this.enabled) {
380
+ return;
381
+ }
382
+ //FIXME: Provavelmente isso fará com que o popup abra em uma
383
+ //posição errada no futuro. Preferi fazer simples no começo,
384
+ //porque não quis onerar o text input com essa funcionalidade...
385
+ const top = this.errorMessage ? "0px" : "-17px";
386
+ this._floatingID = FloatingManager.FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
387
+ window.requestAnimationFrame(() => {
388
+ this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
389
+ });
390
+ }
391
+ hideOptions() {
392
+ if (this._floatingID !== undefined) {
393
+ FloatingManager.FloatingManager.close(this._floatingID);
394
+ }
395
+ this._floatingID = undefined;
396
+ }
397
+ isOptionsVisible() {
398
+ return this._floatingID !== undefined && FloatingManager.FloatingManager.isFloating(this._floatingID);
399
+ }
400
+ nextOption() {
401
+ if (this.searchMode && !this.isOptionsVisible()) {
402
+ return;
403
+ }
404
+ this.showOptions();
405
+ this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
406
+ this.scrollToOption(this._visibleOptions[this._preSelection], true);
407
+ }
408
+ previousOption() {
409
+ this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
410
+ this.scrollToOption(this._visibleOptions[this._preSelection], false);
411
+ }
412
+ scrollToOption(opt, down) {
413
+ window.requestAnimationFrame(() => {
414
+ const liElem = this._optionsList.querySelector(`li#item_${opt.value}`);
415
+ if (liElem) {
416
+ const parent = liElem.parentElement;
417
+ const parentRect = parent.getBoundingClientRect();
418
+ const itemRect = liElem.getBoundingClientRect();
419
+ if (down && itemRect.bottom > parentRect.bottom) {
420
+ parent.scrollTop = itemRect.top;
421
+ }
422
+ else if (!down && itemRect.top < parentRect.top) {
423
+ parent.scrollTop = 0;
424
+ }
425
+ }
426
+ });
427
+ }
428
+ selectCurrentOption() {
429
+ if (this._preSelection !== undefined) {
430
+ this.selectOption(this._visibleOptions[this._preSelection]);
431
+ this._preSelection = undefined;
432
+ }
433
+ }
434
+ selectOption(opt) {
435
+ const currentOpt = this.getSelectedOption();
436
+ if (currentOpt !== opt) {
437
+ const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
438
+ this.value = adjustedOpt;
439
+ this.errorMessage = "";
440
+ this.ezChange.emit(adjustedOpt);
441
+ }
442
+ else {
443
+ this.internalUpdate();
444
+ }
445
+ }
446
+ updateSource(source) {
447
+ if (source instanceof Promise) {
448
+ source.then(result => this.updateSource(result));
449
+ this.updateVisibleOptions();
450
+ }
451
+ else {
452
+ this._source = source;
453
+ this.updateVisibleOptions();
454
+ }
455
+ }
456
+ loadOptions(mode, argument = "") {
457
+ this._criteria = argument;
458
+ if (this.optionLoader) {
459
+ this.updateSource(this.optionLoader({ mode, argument }));
460
+ }
461
+ else {
462
+ this.updateSource(this.options);
463
+ }
464
+ }
465
+ cancelPreselection() {
466
+ if (!this._inputElement.value && this.value) {
467
+ this.selectOption(undefined);
468
+ }
469
+ else {
470
+ this.internalUpdate();
471
+ }
472
+ }
473
+ //---------------------------------------------
474
+ // Lifecycle web component
475
+ //---------------------------------------------
476
+ componentWillLoad() {
477
+ if (this.options === undefined) {
478
+ this.options = [];
479
+ const optionsTags = this.el.querySelectorAll("option");
480
+ if (optionsTags) {
481
+ optionsTags.forEach(e => {
482
+ let label = e.innerText;
483
+ let value = e.getAttribute("value");
484
+ if (!value) {
485
+ value = label;
486
+ }
487
+ this.options.push({ label, value });
488
+ e.hidden = true;
489
+ });
490
+ }
491
+ }
492
+ if (this.searchMode) {
493
+ this.updateSource([]);
494
+ }
495
+ else {
496
+ this.loadOptions("PRELOAD");
497
+ }
498
+ }
499
+ componentDidRender() {
500
+ if (this._floatingID === undefined) {
501
+ this._optionsList.remove();
502
+ }
503
+ }
504
+ componentDidLoad() {
505
+ CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this.el, this._inputElement);
506
+ }
507
+ //---------------------------------------------
508
+ // Event handlers
509
+ //---------------------------------------------
510
+ onTextInputChangeHandler(event) {
511
+ if (!this._criteria) {
512
+ this._inputElement.value = event.data;
513
+ }
514
+ const argument = event.target.value;
515
+ this._criteria = argument;
516
+ if (this._criteria) {
517
+ if (this.searchMode) {
518
+ if (this._changeDeboucingTimeout) {
519
+ window.clearTimeout(this._changeDeboucingTimeout);
520
+ }
521
+ this._changeDeboucingTimeout = window.setTimeout(() => {
522
+ this.loadOptions("PREDICTIVE", argument);
523
+ }, 200);
524
+ }
525
+ else {
526
+ this.updateVisibleOptions();
527
+ }
528
+ this.showOptions();
529
+ }
530
+ }
531
+ onTextInputClickHandler() {
532
+ if (!this.searchMode) {
533
+ this.showOptions();
534
+ }
535
+ }
536
+ keyDownHandler(event) {
537
+ switch (event.key) {
538
+ case "ArrowDown":
539
+ this.nextOption();
540
+ break;
541
+ case "ArrowUp":
542
+ this.previousOption();
543
+ break;
544
+ case "Enter":
545
+ this.selectCurrentOption();
546
+ break;
547
+ case "Escape":
548
+ this.cancelPreselection();
549
+ break;
550
+ }
551
+ event.stopPropagation();
552
+ }
553
+ onTextInputFocusOutHandler() {
554
+ this.cancelPreselection();
555
+ }
556
+ render() {
557
+ return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), errorMessage: this.errorMessage }, this.searchMode ?
558
+ index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
559
+ :
560
+ index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })), index.h("section", { class: "list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "options-list", ref: elem => this._optionsList = elem }, this._visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
561
+ }
562
+ get el() { return index.getElement(this); }
563
+ static get watchers() { return {
564
+ "value": ["internalUpdate"]
565
+ }; }
566
+ };
567
+ EzComboBox.style = ezComboBoxCss;
568
+
569
+ const ezDateInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
570
+
571
+ let EzDateInput = class {
572
+ constructor(hostRef) {
573
+ index.registerInstance(this, hostRef);
574
+ this.ezChange = index.createEvent(this, "ezChange", 7);
575
+ /**
576
+ * Deixa o campo disponível ou não para uso.
577
+ */
578
+ this.enabled = true;
579
+ }
580
+ setLabel() {
581
+ this._textInput.label = this.label;
582
+ }
583
+ setErrorMessage() {
584
+ this._textInput.errorMessage = this.errorMessage;
585
+ }
586
+ applyValueToInput() {
587
+ if (this._textInput) {
588
+ this._textInput.value = this.getTextValue(this.value);
589
+ }
590
+ }
591
+ changeValue(newValue) {
592
+ newValue = newValue == null ? null : DateUtils.DateUtils.clearTime(newValue);
593
+ this._textInput.errorMessage = "";
594
+ if (newValue !== this.value) {
595
+ this.value = newValue;
596
+ this.ezChange.emit();
597
+ }
598
+ }
599
+ showCalendar() {
600
+ this.parseDate();
601
+ this._calendar.value = this.value;
602
+ //FIXME: Provavelmente isso fará com que o popup abra em uma
603
+ //posição errada no futuro. Preferi fazer simples no começo,
604
+ //porque não quis onerar o text input com essa funcionalidade...
605
+ const top = this._textInput.errorMessage ? 0 : -17;
606
+ this._calendar.fitVertical(top, this._elem.clientHeight);
607
+ }
608
+ hideCalendar() {
609
+ this.changeValue(this._calendar.value);
610
+ this._calendar.hide();
611
+ }
612
+ parseDate() {
613
+ const strValue = this._textInput.value;
614
+ const parsedDate = DateUtils.DateUtils.strToDate(strValue);
615
+ if (parsedDate || !strValue) {
616
+ if (this.value === parsedDate) {
617
+ this.changeValue(this.value);
618
+ }
619
+ else {
620
+ this.changeValue(parsedDate);
621
+ }
622
+ }
623
+ else {
624
+ this._textInput.errorMessage = "O valor digitado não é uma data válida";
625
+ }
626
+ }
627
+ getTextValue(d) {
628
+ return d ? new Intl.DateTimeFormat("pt-BR").format(d) : null;
629
+ }
630
+ componentDidLoad() {
631
+ CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
632
+ }
633
+ render() {
634
+ return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
635
+ if (event.key === "H" || event.key === "h")
636
+ this.changeValue(new Date());
637
+ }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
638
+ }
639
+ get _elem() { return index.getElement(this); }
640
+ static get watchers() { return {
641
+ "label": ["setLabel"],
642
+ "errorMessage": ["setErrorMessage"],
643
+ "value": ["applyValueToInput"]
644
+ }; }
645
+ };
646
+ EzDateInput.style = ezDateInputCss;
647
+
648
+ const buildTextArea = ({ name, label }) => {
649
+ return (index.h("div", { class: "col col--sd-12 padding--small", key: name },
650
+ index.h("ez-text-area", { label: label, "data-field-name": name })));
651
+ };
652
+
653
+ const buildTextInput = ({ name, label }) => {
654
+ return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
655
+ index.h("ez-text-input", { label: label, "data-field-name": name, key: name })));
656
+ };
657
+
658
+ const buildSwitch = (fieldConfig) => {
659
+ return buildField$1(fieldConfig.name, fieldConfig.label, true);
660
+ };
661
+ const buildCheckBox = (fieldConfig) => {
662
+ return buildField$1(fieldConfig.name, fieldConfig.label, false);
663
+ };
664
+ function buildField$1(fieldName, fieldLabel, switchMode = false) {
665
+ return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" },
666
+ index.h("ez-check", { label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
667
+ }
668
+
669
+ const buildComboBox = ({ name, label }, properties) => {
670
+ const prop = properties === null || properties === void 0 ? void 0 : properties.options;
671
+ let options;
672
+ if (typeof prop === "string") {
673
+ const parsed = JSON.parse(prop);
674
+ options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
675
+ }
676
+ else {
677
+ options = prop;
678
+ }
679
+ return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
680
+ index.h("ez-combo-box", { label: label, "data-field-name": name, key: name, options: options })));
681
+ };
682
+
683
+ const buildSearch = ({ name, label }) => {
684
+ return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
685
+ index.h("ez-search", { label: label, optionLoader: (_argument) => { }, "data-field-name": name, key: name })));
686
+ };
687
+
688
+ const buildFile = ({ name, label }) => {
689
+ return (index.h("div", { class: "col col--sd-12 padding--small" },
690
+ index.h("ez-upload", { label: label, urlUpload: "", requestHeaders: "", maxFiles: 10, "data-field-name": name, key: name })));
691
+ };
692
+
693
+ const buildDate = ({ name, label }) => {
694
+ return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
695
+ index.h("ez-date-input", { label: label, "data-field-name": name, key: name })));
696
+ };
697
+
698
+ const buildDecimal = ({ name, label }, properties) => {
699
+ const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
700
+ const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
701
+ return buildNumeric(name, label, precision, prettyPrecision);
702
+ };
703
+ const buildInteger = ({ name, label }) => {
704
+ return buildNumeric(name, label, 0, 0);
705
+ };
706
+ function buildNumeric(fieldName, fieldLabel, precision, prettyPrecision) {
707
+ return (index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
708
+ index.h("ez-number-input", { label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
709
+ }
710
+
711
+ const uiBuilders = new Map();
712
+ uiBuilders.set(index$1.UserInterface.LONGTEXT, buildTextArea);
713
+ uiBuilders.set(index$1.UserInterface.CHECKBOX, buildCheckBox);
714
+ uiBuilders.set(index$1.UserInterface.SWITCH, buildSwitch);
715
+ uiBuilders.set(index$1.UserInterface.OPTIONSELECTOR, buildComboBox);
716
+ uiBuilders.set(index$1.UserInterface.SEARCH, buildSearch);
717
+ uiBuilders.set(index$1.UserInterface.FILE, buildFile);
718
+ uiBuilders.set(index$1.UserInterface.DATE, buildDate);
719
+ uiBuilders.set(index$1.UserInterface.DECIMALNUMBER, buildDecimal);
720
+ uiBuilders.set(index$1.UserInterface.INTEGERNUMBER, buildInteger);
721
+ const buildField = (field) => {
722
+ const descriptor = field.descriptor;
723
+ const config = Object.assign({}, field.config);
724
+ let builder;
725
+ let props;
726
+ if (descriptor) {
727
+ builder = uiBuilders.get(descriptor.userInterface);
728
+ if (!config.label) {
729
+ config.label = descriptor.label;
730
+ }
731
+ if (!config.name) {
732
+ config.name = descriptor.name;
733
+ }
734
+ if (config.required === undefined) {
735
+ config.required = descriptor.required;
736
+ }
737
+ props = descriptor.properties;
738
+ }
739
+ if (config.required) {
740
+ config.label = `* ${config.label} (obrigatório)`;
741
+ }
742
+ if (!builder) {
743
+ builder = buildTextInput;
744
+ }
745
+ return builder(config, props);
746
+ };
747
+
748
+ const FormItem = ({ source }) => {
749
+ if ("items" in source) {
750
+ const fieldSet = source;
751
+ return index.h("ez-collapsible-box", { label: source.label }, fieldSet.items.map(fi => buildField(fi)));
752
+ }
753
+ else {
754
+ return buildField(source);
755
+ }
756
+ };
757
+
758
+ const FormSheet = ({ store, source }) => {
759
+ return (index.h("div", { class: "box__container" }, source.items.map(item => index.h(FormItem, { store: store, source: item }))));
760
+ };
761
+
762
+ class FormMetadata {
763
+ constructor() {
764
+ this._sheets = new Map();
765
+ this._requiredFields = [];
766
+ }
767
+ getSheet(name) {
768
+ return this._sheets.get(name);
769
+ }
770
+ getAllSheets() {
771
+ return this._sheets;
772
+ }
773
+ addSheet(sheet) {
774
+ this._sheets.set(sheet.name, sheet);
775
+ this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
776
+ }
777
+ getRequiredFields() {
778
+ return this._requiredFields;
779
+ }
780
+ }
781
+ const buildFromDataUnit = (dataUnit) => {
782
+ var _a;
783
+ const unitMD = dataUnit.metadata;
784
+ const metadata = new FormMetadata();
785
+ if (unitMD) {
786
+ const visibleFields = (_a = unitMD.fields) === null || _a === void 0 ? void 0 : _a.filter(descriptor => descriptor.visible !== false);
787
+ metadata.addSheet({
788
+ label: unitMD.label,
789
+ name: unitMD.name,
790
+ items: visibleFields.map(descriptor => { return { descriptor }; }),
791
+ requiredFields: visibleFields
792
+ .filter(descriptor => descriptor.required)
793
+ .map(descriptor => descriptor.name)
794
+ });
795
+ }
796
+ return metadata;
797
+ };
798
+ const buildFromConfig = (fields, dataUnit) => {
799
+ const sheets = new Map();
800
+ const requiredFields = [];
801
+ fields.forEach(config => {
802
+ if (config.visible !== false) {
803
+ const tab = config.tab || "Geral";
804
+ const descriptor = dataUnit.getField(config.name);
805
+ if (!sheets.has(tab)) {
806
+ sheets.set(tab, new Map());
807
+ }
808
+ let isRequired = false;
809
+ if (config.required === undefined) {
810
+ if (descriptor) {
811
+ isRequired = descriptor.required;
812
+ }
813
+ }
814
+ else {
815
+ isRequired = config.required;
816
+ }
817
+ if (isRequired) {
818
+ requiredFields.push(config.name);
819
+ }
820
+ const tabItens = sheets.get(tab);
821
+ const fieldMD = { config, descriptor };
822
+ const group = config.group;
823
+ if (group) {
824
+ const key = `group::${group}`;
825
+ if (!tabItens.has(key)) {
826
+ tabItens.set(key, { label: group, items: [fieldMD] });
827
+ }
828
+ else {
829
+ tabItens.get(key).items.push(fieldMD);
830
+ }
831
+ }
832
+ else {
833
+ tabItens.set(config.name, fieldMD);
834
+ }
835
+ }
836
+ });
837
+ const metadata = new FormMetadata();
838
+ sheets.forEach((value, key) => {
839
+ metadata.addSheet({
840
+ label: key,
841
+ name: key,
842
+ items: Array.from(value.values()),
843
+ requiredFields
844
+ });
845
+ });
846
+ return metadata;
847
+ };
848
+
849
+ /**
850
+ * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
851
+ *
852
+ * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
853
+ * during build.
854
+ * @param {number} code
855
+ */
856
+ function formatProdErrorMessage(code) {
857
+ return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
858
+ }
859
+
860
+ // Inlined version of the `symbol-observable` polyfill
861
+ var $$observable = (function () {
862
+ return typeof Symbol === 'function' && Symbol.observable || '@@observable';
863
+ })();
864
+
865
+ /**
866
+ * These are private action types reserved by Redux.
867
+ * For any unknown actions, you must return the current state.
868
+ * If the current state is undefined, you must return the initial state.
869
+ * Do not reference these action types directly in your code.
870
+ */
871
+ var randomString = function randomString() {
872
+ return Math.random().toString(36).substring(7).split('').join('.');
873
+ };
874
+
875
+ var ActionTypes = {
876
+ INIT: "@@redux/INIT" + randomString(),
877
+ REPLACE: "@@redux/REPLACE" + randomString(),
878
+ PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
879
+ return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
880
+ }
881
+ };
882
+
883
+ /**
884
+ * @param {any} obj The object to inspect.
885
+ * @returns {boolean} True if the argument appears to be a plain object.
886
+ */
887
+ function isPlainObject(obj) {
888
+ if (typeof obj !== 'object' || obj === null) return false;
889
+ var proto = obj;
890
+
891
+ while (Object.getPrototypeOf(proto) !== null) {
892
+ proto = Object.getPrototypeOf(proto);
893
+ }
894
+
895
+ return Object.getPrototypeOf(obj) === proto;
896
+ }
897
+
898
+ /**
899
+ * Creates a Redux store that holds the state tree.
900
+ * The only way to change the data in the store is to call `dispatch()` on it.
901
+ *
902
+ * There should only be a single store in your app. To specify how different
903
+ * parts of the state tree respond to actions, you may combine several reducers
904
+ * into a single reducer function by using `combineReducers`.
905
+ *
906
+ * @param {Function} reducer A function that returns the next state tree, given
907
+ * the current state tree and the action to handle.
908
+ *
909
+ * @param {any} [preloadedState] The initial state. You may optionally specify it
910
+ * to hydrate the state from the server in universal apps, or to restore a
911
+ * previously serialized user session.
912
+ * If you use `combineReducers` to produce the root reducer function, this must be
913
+ * an object with the same shape as `combineReducers` keys.
914
+ *
915
+ * @param {Function} [enhancer] The store enhancer. You may optionally specify it
916
+ * to enhance the store with third-party capabilities such as middleware,
917
+ * time travel, persistence, etc. The only store enhancer that ships with Redux
918
+ * is `applyMiddleware()`.
919
+ *
920
+ * @returns {Store} A Redux store that lets you read the state, dispatch actions
921
+ * and subscribe to changes.
922
+ */
923
+
924
+ function createStore(reducer, preloadedState, enhancer) {
925
+ var _ref2;
926
+
927
+ if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
928
+ throw new Error(formatProdErrorMessage(0) );
929
+ }
930
+
931
+ if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
932
+ enhancer = preloadedState;
933
+ preloadedState = undefined;
934
+ }
935
+
936
+ if (typeof enhancer !== 'undefined') {
937
+ if (typeof enhancer !== 'function') {
938
+ throw new Error(formatProdErrorMessage(1) );
939
+ }
940
+
941
+ return enhancer(createStore)(reducer, preloadedState);
942
+ }
943
+
944
+ if (typeof reducer !== 'function') {
945
+ throw new Error(formatProdErrorMessage(2) );
946
+ }
947
+
948
+ var currentReducer = reducer;
949
+ var currentState = preloadedState;
950
+ var currentListeners = [];
951
+ var nextListeners = currentListeners;
952
+ var isDispatching = false;
953
+ /**
954
+ * This makes a shallow copy of currentListeners so we can use
955
+ * nextListeners as a temporary list while dispatching.
956
+ *
957
+ * This prevents any bugs around consumers calling
958
+ * subscribe/unsubscribe in the middle of a dispatch.
959
+ */
960
+
961
+ function ensureCanMutateNextListeners() {
962
+ if (nextListeners === currentListeners) {
963
+ nextListeners = currentListeners.slice();
964
+ }
965
+ }
966
+ /**
967
+ * Reads the state tree managed by the store.
968
+ *
969
+ * @returns {any} The current state tree of your application.
970
+ */
971
+
972
+
973
+ function getState() {
974
+ if (isDispatching) {
975
+ throw new Error(formatProdErrorMessage(3) );
976
+ }
977
+
978
+ return currentState;
979
+ }
980
+ /**
981
+ * Adds a change listener. It will be called any time an action is dispatched,
982
+ * and some part of the state tree may potentially have changed. You may then
983
+ * call `getState()` to read the current state tree inside the callback.
984
+ *
985
+ * You may call `dispatch()` from a change listener, with the following
986
+ * caveats:
987
+ *
988
+ * 1. The subscriptions are snapshotted just before every `dispatch()` call.
989
+ * If you subscribe or unsubscribe while the listeners are being invoked, this
990
+ * will not have any effect on the `dispatch()` that is currently in progress.
991
+ * However, the next `dispatch()` call, whether nested or not, will use a more
992
+ * recent snapshot of the subscription list.
993
+ *
994
+ * 2. The listener should not expect to see all state changes, as the state
995
+ * might have been updated multiple times during a nested `dispatch()` before
996
+ * the listener is called. It is, however, guaranteed that all subscribers
997
+ * registered before the `dispatch()` started will be called with the latest
998
+ * state by the time it exits.
999
+ *
1000
+ * @param {Function} listener A callback to be invoked on every dispatch.
1001
+ * @returns {Function} A function to remove this change listener.
1002
+ */
1003
+
1004
+
1005
+ function subscribe(listener) {
1006
+ if (typeof listener !== 'function') {
1007
+ throw new Error(formatProdErrorMessage(4) );
1008
+ }
1009
+
1010
+ if (isDispatching) {
1011
+ throw new Error(formatProdErrorMessage(5) );
1012
+ }
1013
+
1014
+ var isSubscribed = true;
1015
+ ensureCanMutateNextListeners();
1016
+ nextListeners.push(listener);
1017
+ return function unsubscribe() {
1018
+ if (!isSubscribed) {
1019
+ return;
1020
+ }
1021
+
1022
+ if (isDispatching) {
1023
+ throw new Error(formatProdErrorMessage(6) );
1024
+ }
1025
+
1026
+ isSubscribed = false;
1027
+ ensureCanMutateNextListeners();
1028
+ var index = nextListeners.indexOf(listener);
1029
+ nextListeners.splice(index, 1);
1030
+ currentListeners = null;
1031
+ };
1032
+ }
1033
+ /**
1034
+ * Dispatches an action. It is the only way to trigger a state change.
1035
+ *
1036
+ * The `reducer` function, used to create the store, will be called with the
1037
+ * current state tree and the given `action`. Its return value will
1038
+ * be considered the **next** state of the tree, and the change listeners
1039
+ * will be notified.
1040
+ *
1041
+ * The base implementation only supports plain object actions. If you want to
1042
+ * dispatch a Promise, an Observable, a thunk, or something else, you need to
1043
+ * wrap your store creating function into the corresponding middleware. For
1044
+ * example, see the documentation for the `redux-thunk` package. Even the
1045
+ * middleware will eventually dispatch plain object actions using this method.
1046
+ *
1047
+ * @param {Object} action A plain object representing “what changed”. It is
1048
+ * a good idea to keep actions serializable so you can record and replay user
1049
+ * sessions, or use the time travelling `redux-devtools`. An action must have
1050
+ * a `type` property which may not be `undefined`. It is a good idea to use
1051
+ * string constants for action types.
1052
+ *
1053
+ * @returns {Object} For convenience, the same action object you dispatched.
1054
+ *
1055
+ * Note that, if you use a custom middleware, it may wrap `dispatch()` to
1056
+ * return something else (for example, a Promise you can await).
1057
+ */
1058
+
1059
+
1060
+ function dispatch(action) {
1061
+ if (!isPlainObject(action)) {
1062
+ throw new Error(formatProdErrorMessage(7) );
1063
+ }
1064
+
1065
+ if (typeof action.type === 'undefined') {
1066
+ throw new Error(formatProdErrorMessage(8) );
1067
+ }
1068
+
1069
+ if (isDispatching) {
1070
+ throw new Error(formatProdErrorMessage(9) );
1071
+ }
1072
+
1073
+ try {
1074
+ isDispatching = true;
1075
+ currentState = currentReducer(currentState, action);
1076
+ } finally {
1077
+ isDispatching = false;
1078
+ }
1079
+
1080
+ var listeners = currentListeners = nextListeners;
1081
+
1082
+ for (var i = 0; i < listeners.length; i++) {
1083
+ var listener = listeners[i];
1084
+ listener();
1085
+ }
1086
+
1087
+ return action;
1088
+ }
1089
+ /**
1090
+ * Replaces the reducer currently used by the store to calculate the state.
1091
+ *
1092
+ * You might need this if your app implements code splitting and you want to
1093
+ * load some of the reducers dynamically. You might also need this if you
1094
+ * implement a hot reloading mechanism for Redux.
1095
+ *
1096
+ * @param {Function} nextReducer The reducer for the store to use instead.
1097
+ * @returns {void}
1098
+ */
1099
+
1100
+
1101
+ function replaceReducer(nextReducer) {
1102
+ if (typeof nextReducer !== 'function') {
1103
+ throw new Error(formatProdErrorMessage(10) );
1104
+ }
1105
+
1106
+ currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
1107
+ // Any reducers that existed in both the new and old rootReducer
1108
+ // will receive the previous state. This effectively populates
1109
+ // the new state tree with any relevant data from the old one.
1110
+
1111
+ dispatch({
1112
+ type: ActionTypes.REPLACE
1113
+ });
1114
+ }
1115
+ /**
1116
+ * Interoperability point for observable/reactive libraries.
1117
+ * @returns {observable} A minimal observable of state changes.
1118
+ * For more information, see the observable proposal:
1119
+ * https://github.com/tc39/proposal-observable
1120
+ */
1121
+
1122
+
1123
+ function observable() {
1124
+ var _ref;
1125
+
1126
+ var outerSubscribe = subscribe;
1127
+ return _ref = {
1128
+ /**
1129
+ * The minimal observable subscription method.
1130
+ * @param {Object} observer Any object that can be used as an observer.
1131
+ * The observer object should have a `next` method.
1132
+ * @returns {subscription} An object with an `unsubscribe` method that can
1133
+ * be used to unsubscribe the observable from the store, and prevent further
1134
+ * emission of values from the observable.
1135
+ */
1136
+ subscribe: function subscribe(observer) {
1137
+ if (typeof observer !== 'object' || observer === null) {
1138
+ throw new Error(formatProdErrorMessage(11) );
1139
+ }
1140
+
1141
+ function observeState() {
1142
+ if (observer.next) {
1143
+ observer.next(getState());
1144
+ }
1145
+ }
1146
+
1147
+ observeState();
1148
+ var unsubscribe = outerSubscribe(observeState);
1149
+ return {
1150
+ unsubscribe: unsubscribe
1151
+ };
1152
+ }
1153
+ }, _ref[$$observable] = function () {
1154
+ return this;
1155
+ }, _ref;
1156
+ } // When a store is created, an "INIT" action is dispatched so that every
1157
+ // reducer returns their initial state. This effectively populates
1158
+ // the initial state tree.
1159
+
1160
+
1161
+ dispatch({
1162
+ type: ActionTypes.INIT
1163
+ });
1164
+ return _ref2 = {
1165
+ dispatch: dispatch,
1166
+ subscribe: subscribe,
1167
+ getState: getState,
1168
+ replaceReducer: replaceReducer
1169
+ }, _ref2[$$observable] = observable, _ref2;
1170
+ }
1171
+
1172
+ const inicialState = {};
1173
+ /////////////////////////////// REDUCERS ///////////////////////////////
1174
+ function formReducer(state = inicialState, action) {
1175
+ switch (action.type) {
1176
+ case FormActions.METADATA_LOADED:
1177
+ return Object.assign(Object.assign({}, state), { formMetadata: action.payload });
1178
+ case FormActions.CHANGE_TAB:
1179
+ return Object.assign(Object.assign({}, state), { currentSheet: action.payload });
1180
+ default:
1181
+ return state;
1182
+ }
1183
+ }
1184
+ /////////////////////////////// ACTION CREATORS ///////////////////////////////
1185
+ function loadMetadata(formMetadata) {
1186
+ return {
1187
+ type: FormActions.METADATA_LOADED,
1188
+ payload: formMetadata
1189
+ };
1190
+ }
1191
+ function changeTab(currentSheet) {
1192
+ return {
1193
+ type: FormActions.CHANGE_TAB,
1194
+ payload: currentSheet
1195
+ };
1196
+ }
1197
+ /////////////////////////////// SELECTORS ///////////////////////////////
1198
+ function selectFormMetadata(state) {
1199
+ return state.formMetadata;
1200
+ }
1201
+ function selectCurrentSheet(state) {
1202
+ return state.currentSheet ? state.formMetadata.getSheet(state.currentSheet) : Array.from(state.formMetadata.getAllSheets().values())[0];
1203
+ }
1204
+ /////////////////////////////// TYPES ///////////////////////////////
1205
+ var FormActions;
1206
+ (function (FormActions) {
1207
+ FormActions["METADATA_LOADED"] = "FORM/METADATA_LOADED";
1208
+ FormActions["CHANGE_TAB"] = "FORM/CHANGE_TAB";
1209
+ })(FormActions || (FormActions = {}));
1210
+
1211
+ class DataBinder {
1212
+ constructor(dataUnit) {
1213
+ this._dataUnit = dataUnit;
1214
+ this._fields = new Map();
1215
+ }
1216
+ bind(fields) {
1217
+ fields.forEach(fieldElement => {
1218
+ const fieldName = fieldElement.dataset.fieldName;
1219
+ this.updateBind(fieldName, fieldElement);
1220
+ this.updateValue(fieldName, fieldElement);
1221
+ });
1222
+ }
1223
+ updateValue(fieldName, field) {
1224
+ field["value"] = this._dataUnit.getFieldValue(fieldName);
1225
+ }
1226
+ updateBind(fieldName, field) {
1227
+ const oldBind = this._fields.get(fieldName);
1228
+ if (oldBind) {
1229
+ oldBind.destroy();
1230
+ }
1231
+ this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
1232
+ }
1233
+ setFieldValue(fieldName, newValue) {
1234
+ if (this._dataUnit.records.length === 0) {
1235
+ this._dataUnit.addRecord();
1236
+ }
1237
+ this._dataUnit.setFieldValue(fieldName, newValue);
1238
+ }
1239
+ }
1240
+ class Bind {
1241
+ destroy() {
1242
+ this.field.removeEventListener(this.eventName, this.eventListener);
1243
+ }
1244
+ static create(fieldName, field, callback) {
1245
+ const b = new Bind();
1246
+ b.fieldName = fieldName;
1247
+ b.field = field;
1248
+ //FIXME: Verificar se o field é um EzField
1249
+ b.eventListener = (evt) => { callback(fieldName, evt.detail); };
1250
+ b.eventName = "ezChange";
1251
+ b.field.addEventListener(b.eventName, b.eventListener);
1252
+ return b;
1253
+ }
1254
+ }
1255
+
1256
+ class ApplicationUtils {
1257
+ static async showDialog(title, message, icon = null, confirm, critical = false) {
1258
+ return new Promise(resolve => {
1259
+ let dialog = document.querySelector("ez-dialog");
1260
+ if (!dialog) {
1261
+ dialog = document.createElement("ez-dialog");
1262
+ window.document.body.appendChild(dialog);
1263
+ }
1264
+ dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
1265
+ });
1266
+ }
1267
+ static async alert(title, message, icon = null) {
1268
+ return ApplicationUtils.showDialog(title, message, icon, false, false);
1269
+ }
1270
+ static async error(title, message, icon = null) {
1271
+ return ApplicationUtils.showDialog(title, message, icon, false, true);
1272
+ }
1273
+ static async confirm(title, message, icon = null, critical = false) {
1274
+ return ApplicationUtils.showDialog(title, message, icon, true, critical);
1275
+ }
1276
+ static async info(message) {
1277
+ let toast = document.querySelector("ez-toast");
1278
+ if (!toast) {
1279
+ toast = document.createElement("ez-toast");
1280
+ window.document.body.appendChild(toast);
1281
+ }
1282
+ toast.message = message;
1283
+ toast.fadeTime = 4000;
1284
+ toast.show();
1285
+ }
1286
+ }
1287
+
1288
+ const ezFormCss = "ez-form{display:flex;flex-direction:column;width:100%}";
1289
+
1290
+ let EzForm = class {
1291
+ constructor(hostRef) {
1292
+ index.registerInstance(this, hostRef);
1293
+ }
1294
+ submit() {
1295
+ return Promise.resolve();
1296
+ }
1297
+ cancel() {
1298
+ return Promise.resolve();
1299
+ }
1300
+ validate() {
1301
+ return new Promise((accept, reject) => {
1302
+ const metadata = selectFormMetadata(this._store.getState());
1303
+ const requiredFields = this._staticFields
1304
+ .filter(f => f.dataset.required)
1305
+ .map(f => f.dataset.fieldName)
1306
+ .concat(metadata.getRequiredFields());
1307
+ const records = this.dataUnit.records;
1308
+ for (let i = 0; i < records.length; i++) {
1309
+ if (!this.validateRequired(requiredFields, records[i])) {
1310
+ reject();
1311
+ break;
1312
+ }
1313
+ }
1314
+ accept();
1315
+ });
1316
+ }
1317
+ validateRequired(requiredFields, record) {
1318
+ const invalidFields = [];
1319
+ requiredFields.forEach(field => {
1320
+ const value = record[field];
1321
+ const fieldElem = this._element.querySelector(`[data-field-name=${field}]`);
1322
+ if (value === null || value === undefined || value === "") {
1323
+ invalidFields.push(field);
1324
+ fieldElem["errorMessage"] = "Essa informação é obrigatória";
1325
+ }
1326
+ else {
1327
+ fieldElem["errorMessage"] = "";
1328
+ }
1329
+ });
1330
+ const isValid = invalidFields.length === 0;
1331
+ if (!isValid) {
1332
+ ApplicationUtils.info("Há pelo menos um campo obrigatório não preenchido.");
1333
+ }
1334
+ return isValid;
1335
+ }
1336
+ getDynamicContent() {
1337
+ var _a;
1338
+ const formMD = selectFormMetadata(this._store.getState());
1339
+ if (!formMD)
1340
+ return null;
1341
+ const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
1342
+ if (!currentSheet) {
1343
+ return null;
1344
+ }
1345
+ const allSheets = Array.from(formMD.getAllSheets().values());
1346
+ const result = [];
1347
+ if (allSheets.length > 1) {
1348
+ result.push(index.h("ez-tabselector", { onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name }, allSheets.map(s => index.h("ez-tab", { tabKey: s.name, label: s.label }))));
1349
+ }
1350
+ result.push(index.h(FormSheet, { store: this._store, source: currentSheet }));
1351
+ return result;
1352
+ }
1353
+ processMetadata() {
1354
+ if (!this.isStatic()) {
1355
+ const metadata = this.config && this.config.length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
1356
+ this._store.dispatch(loadMetadata(metadata));
1357
+ }
1358
+ }
1359
+ isStatic() {
1360
+ var _a;
1361
+ return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
1362
+ }
1363
+ componentWillLoad() {
1364
+ if (this.dataUnit === undefined) {
1365
+ this.dataUnit = new index$1.DataUnit("ez-form");
1366
+ }
1367
+ this.dataUnit.subscribe(action => {
1368
+ if (action.type === index$1.Action.METADATA_LOADED) {
1369
+ this.processMetadata();
1370
+ }
1371
+ });
1372
+ this._dataBinder = new DataBinder(this.dataUnit);
1373
+ this._store = createStore(formReducer);
1374
+ this._store.subscribe(() => index.forceUpdate(this));
1375
+ this._staticFields = Array.from(this._element.querySelectorAll("[data-field-name]"));
1376
+ this.processMetadata();
1377
+ }
1378
+ componentDidRender() {
1379
+ this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
1380
+ }
1381
+ render() {
1382
+ return (index.h(index.Host, null, this.isStatic() ? null : this.getDynamicContent()));
1383
+ }
1384
+ get _element() { return index.getElement(this); }
1385
+ };
1386
+ EzForm.style = ezFormCss;
1387
+
1388
+ const ezNumberInputCss = ":host{display:block;width:100%}";
1389
+
1390
+ let EzNumberInput = class {
1391
+ constructor(hostRef) {
1392
+ index.registerInstance(this, hostRef);
1393
+ this.ezChange = index.createEvent(this, "ezChange", 7);
1394
+ /**
1395
+ * Deixa o campo disponível ou não para uso.
1396
+ */
1397
+ this.enabled = true;
1398
+ }
1399
+ setLabel() {
1400
+ this._textInput.label = this.label;
1401
+ }
1402
+ setErrorMessage() {
1403
+ this._textInput.errorMessage = this.errorMessage;
1404
+ }
1405
+ applyValueToInput() {
1406
+ if (this._textInput) {
1407
+ this._textInput.value = this.getTextValue(this.value);
1408
+ }
1409
+ }
1410
+ changeValue(newValue) {
1411
+ this.errorMessage = "";
1412
+ if (newValue && newValue !== this.value) {
1413
+ this.value = newValue;
1414
+ this.ezChange.emit(this.value);
1415
+ }
1416
+ }
1417
+ parseNumber() {
1418
+ const parsedNumber = this._textInput.value ? index$1.NumberUtils.stringToNumber(this._textInput.value) : null;
1419
+ if (parsedNumber != null && isNaN(parsedNumber)) {
1420
+ this.errorMessage = "O valor digitado não é um número válido";
1421
+ }
1422
+ else {
1423
+ try {
1424
+ this.changeValue(parsedNumber);
1425
+ }
1426
+ catch (e) {
1427
+ this.errorMessage = e.message;
1428
+ return;
1429
+ }
1430
+ }
1431
+ }
1432
+ getTextValue(value) {
1433
+ if (value) {
1434
+ return this.precision > 0 ? index$1.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
1435
+ }
1436
+ return null;
1437
+ }
1438
+ componentDidLoad() {
1439
+ CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
1440
+ }
1441
+ render() {
1442
+ return (index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
1443
+ }
1444
+ get _elem() { return index.getElement(this); }
1445
+ static get watchers() { return {
1446
+ "label": ["setLabel"],
1447
+ "errorMessage": ["setErrorMessage"],
1448
+ "value": ["applyValueToInput"]
1449
+ }; }
1450
+ };
1451
+ EzNumberInput.style = ezNumberInputCss;
1452
+
1453
+ const ezSearchCss = ":host{width:100%}";
1454
+
1455
+ let EzSearch = class {
1456
+ constructor(hostRef) {
1457
+ index.registerInstance(this, hostRef);
1458
+ this.ezChange = index.createEvent(this, "ezChange", 7);
1459
+ this.showPopup = index.createEvent(this, "showPopup", 7);
1460
+ /**
1461
+ * Deixa o campo disponível ou não.
1462
+ */
1463
+ this.enabled = true;
1464
+ /**
1465
+ * Ajusta a opção de mostrar o "value" ao selecionar uma opção.
1466
+ */
1467
+ this.showSelectedValue = true;
1468
+ /**
1469
+ * Ajusta a opção de mostrar o "value" para cada opção.
1470
+ */
1471
+ this.showOptionValue = true;
1472
+ }
1473
+ updateValue() {
1474
+ if (this._comboElement) {
1475
+ this._comboElement.value = this.value;
1476
+ }
1477
+ }
1478
+ onComboChange(evt) {
1479
+ evt.stopPropagation();
1480
+ this.value = evt.detail;
1481
+ this.ezChange.emit(evt.detail);
1482
+ }
1483
+ componentDidLoad() {
1484
+ CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
1485
+ }
1486
+ render() {
1487
+ return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
1488
+ }
1489
+ ;
1490
+ get _elem() { return index.getElement(this); }
1491
+ static get watchers() { return {
1492
+ "value": ["updateValue"]
1493
+ }; }
1494
+ };
1495
+ EzSearch.style = ezSearchCss;
1496
+
1497
+ const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.midle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Sora, Algerian\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}";
1498
+
1499
+ let EzTabselector = class {
1500
+ constructor(hostRef) {
1501
+ index.registerInstance(this, hostRef);
1502
+ this.ezChange = index.createEvent(this, "ezChange", 7);
1503
+ this.setFocusedParam = (ev) => {
1504
+ if (ev.key === "Enter") {
1505
+ this.selectedIndex = this.focusedIndex;
1506
+ this.focusedIndex = undefined;
1507
+ this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
1508
+ this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
1509
+ ev.preventDefault();
1510
+ this.setFocusedTab(this.selectedIndex);
1511
+ }
1512
+ else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
1513
+ let operator = undefined;
1514
+ if (ev.key === "ArrowLeft") {
1515
+ operator = false;
1516
+ }
1517
+ else if (ev.key === "ArrowRight") {
1518
+ operator = true;
1519
+ }
1520
+ else {
1521
+ return;
1522
+ }
1523
+ if (this.focusedIndex === undefined) {
1524
+ if (operator === false) {
1525
+ this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) - 1).toString() : undefined;
1526
+ }
1527
+ else {
1528
+ this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) + 1).toString() : undefined;
1529
+ }
1530
+ }
1531
+ else {
1532
+ if (operator === false) {
1533
+ this.focusedIndex = (parseInt(this.focusedIndex) - 1).toString();
1534
+ }
1535
+ else {
1536
+ this.focusedIndex = (parseInt(this.focusedIndex) + 1).toString();
1537
+ }
1538
+ }
1539
+ if (parseInt(this.focusedIndex) < 0) {
1540
+ this.focusedIndex = "0";
1541
+ }
1542
+ else if (parseInt(this.focusedIndex) > this._processedTabs.length - 1) {
1543
+ this.focusedIndex = (this._processedTabs.length - 1).toString();
1544
+ }
1545
+ this.setFocusedBtn(true, this.focusedIndex);
1546
+ this.setFocusedTab(this.focusedIndex);
1547
+ this.ezChange.emit(this.selectedTab);
1548
+ }
1549
+ else if (ev.key === "Tab" || ev.key === "Escape") {
1550
+ this.focusedIndex = undefined;
1551
+ this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
1552
+ this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
1553
+ ev.preventDefault();
1554
+ this.setFocusedTab(this.selectedIndex);
1555
+ }
1556
+ // this.setFocusedTab();
1557
+ };
1558
+ }
1559
+ handleTabClick(tab, index) {
1560
+ this.selectedIndex = index.toString();
1561
+ this.focusedIndex = undefined;
1562
+ this.selectedTab = tab;
1563
+ this.ezChange.emit(this.selectedTab);
1564
+ this.setFocusedBtn(false, this.selectedIndex);
1565
+ }
1566
+ componentWillRender() {
1567
+ if (!this._processedTabs) {
1568
+ this._processedTabs = [];
1569
+ if (this.tabs) {
1570
+ this.tabs.split(",").forEach((label) => {
1571
+ label = label.trim();
1572
+ this._processedTabs.push(new Tab(label, label));
1573
+ });
1574
+ }
1575
+ this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
1576
+ const tabKey = elem.getAttribute("tabKey");
1577
+ const label = elem.getAttribute("label");
1578
+ const t = new Tab(label, tabKey);
1579
+ const content = elem.firstChild;
1580
+ if (content) {
1581
+ content.setAttribute("slot", "tab" + this._processedTabs.length);
1582
+ this._hostElem.appendChild(content);
1583
+ }
1584
+ this._processedTabs.push(t);
1585
+ });
1586
+ }
1587
+ }
1588
+ handleSlotChange(ev) {
1589
+ const slot = ev.target;
1590
+ const content = slot.assignedElements()[0];
1591
+ if (content) {
1592
+ content.style.marginLeft = "6px";
1593
+ }
1594
+ }
1595
+ scrollBackward() {
1596
+ const container = this._scrollContainer;
1597
+ if (container) {
1598
+ container.scrollLeft -= container.clientWidth;
1599
+ }
1600
+ }
1601
+ scrollFoward() {
1602
+ const container = this._scrollContainer;
1603
+ if (container) {
1604
+ let lastTab = null;
1605
+ container.querySelectorAll(".tab").forEach((tab) => {
1606
+ if (tab.getBoundingClientRect().right < container.clientWidth) {
1607
+ lastTab = tab;
1608
+ }
1609
+ });
1610
+ container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
1611
+ }
1612
+ }
1613
+ componentDidRender() {
1614
+ this.updateScroll();
1615
+ }
1616
+ updateScroll() {
1617
+ const container = this._scrollContainer;
1618
+ if (container) {
1619
+ const { scrollWidth, clientWidth, scrollLeft } = container;
1620
+ const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
1621
+ this._startHidden = container.scrollLeft > 0;
1622
+ this._endHidden = remainingScroll > 0;
1623
+ if (this._startHidden) {
1624
+ this._backwardButton.classList.remove("hidden");
1625
+ }
1626
+ else {
1627
+ this._backwardButton.classList.add("hidden");
1628
+ }
1629
+ if (this._endHidden) {
1630
+ this._forwardButton.classList.remove("hidden");
1631
+ }
1632
+ else {
1633
+ this._forwardButton.classList.add("hidden");
1634
+ }
1635
+ const classNames = ["", "startHidden", "endHidden", "midle"];
1636
+ const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
1637
+ classNames.forEach((name) => {
1638
+ if (name !== currentClass && container.classList.contains(name)) {
1639
+ container.classList.remove(name);
1640
+ }
1641
+ });
1642
+ if (currentClass && !container.classList.contains(currentClass)) {
1643
+ container.classList.add(currentClass);
1644
+ }
1645
+ }
1646
+ }
1647
+ domScrollHandler() {
1648
+ window.clearTimeout(this._scrollCallBack);
1649
+ this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
1650
+ }
1651
+ setFocusedTab(index) {
1652
+ window.clearTimeout(this._scrollCallBackTest);
1653
+ this._scrollCallBackTest = window.setTimeout(() => {
1654
+ const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
1655
+ tabtoscroll.scrollIntoView();
1656
+ }, 200);
1657
+ }
1658
+ getTextWidth(text) {
1659
+ if (this._textMesurement === undefined) {
1660
+ this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
1661
+ }
1662
+ const context = this._textMesurement.getContext("2d");
1663
+ context.font = "14px Sora, Algerian";
1664
+ return Math.min(220, 24 + context.measureText(text).width) + "px";
1665
+ }
1666
+ ;
1667
+ setFocusedBtn(visible, parameter) {
1668
+ const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
1669
+ tabsButtons.forEach((el) => {
1670
+ el.classList.remove("is-focused");
1671
+ if (el.id === "tab" + parameter && visible) {
1672
+ el.classList.add("is-focused");
1673
+ }
1674
+ });
1675
+ }
1676
+ render() {
1677
+ return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index$1) => {
1678
+ const labelStyle = { "min-width": this.getTextWidth(tab.label) };
1679
+ const tabId = "tab" + index$1;
1680
+ const isSelected = index$1 === parseInt(this.selectedIndex) || (this.selectedTab && tab.tabKey === this.selectedTab);
1681
+ if (isSelected) {
1682
+ this.selectedTab = tab.tabKey;
1683
+ this.selectedIndex = index$1.toString();
1684
+ }
1685
+ return index.h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab.tabKey, index$1), style: labelStyle }, index.h("span", { class: "tab-label", title: tab.label }, tab.label), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
1686
+ })), index.h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
1687
+ }
1688
+ get _hostElem() { return index.getElement(this); }
1689
+ };
1690
+ class Tab {
1691
+ constructor(label, tabKey) {
1692
+ this.label = label;
1693
+ this.tabKey = tabKey;
1694
+ }
1695
+ }
1696
+ EzTabselector.style = ezTabselectorCss;
1697
+
1698
+ const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--large, 500);--text-area--color:var(--title--primary, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-weight--large, 600);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color)}";
1699
+
1700
+ let EzTextArea = class {
1701
+ constructor(hostRef) {
1702
+ index.registerInstance(this, hostRef);
1703
+ this.ezChange = index.createEvent(this, "ezChange", 7);
1704
+ /**
1705
+ * Deixa o campo disponível ou não para digitação.
1706
+ */
1707
+ this.enabled = true;
1708
+ /**
1709
+ * Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
1710
+ */
1711
+ this.rows = 4;
1712
+ }
1713
+ showError() {
1714
+ const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
1715
+ if (hasError) {
1716
+ this._container.classList.add('hasError');
1717
+ this._messageBoxElem.classList.add('hasError');
1718
+ }
1719
+ else {
1720
+ this._container.classList.remove('hasError');
1721
+ this._messageBoxElem.classList.remove('hasError');
1722
+ }
1723
+ }
1724
+ updateInputValue() {
1725
+ this._inputElem.value = this.value;
1726
+ this.handleChange();
1727
+ this.adjustFloatingLabel();
1728
+ this.ezChange.emit(this.value);
1729
+ }
1730
+ adjustFloatingLabel() {
1731
+ if (this.label) {
1732
+ const hasValue = this.value && this.value.toString().length > 0;
1733
+ const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
1734
+ if (hasValue || this.isFocused()) {
1735
+ if (!containsFloatedClass) {
1736
+ this._labelElem.classList.add("textarea__label--floated");
1737
+ }
1738
+ }
1739
+ else {
1740
+ if (containsFloatedClass) {
1741
+ this._labelElem.classList.remove("textarea__label--floated");
1742
+ }
1743
+ }
1744
+ }
1745
+ }
1746
+ isFocused() {
1747
+ return this._hostElement.shadowRoot.activeElement !== null;
1748
+ }
1749
+ //---------------------------------------------
1750
+ // Public methods
1751
+ //---------------------------------------------
1752
+ /**
1753
+ * Faz o foco no componente de input
1754
+ */
1755
+ async setFocus() {
1756
+ this._inputElem.focus();
1757
+ }
1758
+ /**
1759
+ * Remove o foco no componente de input
1760
+ */
1761
+ async setBlur() {
1762
+ this._inputElem.blur();
1763
+ }
1764
+ //---------------------------------------------
1765
+ // Event handlers
1766
+ //---------------------------------------------
1767
+ handleFocusout() {
1768
+ this.adjustFloatingLabel();
1769
+ if (this._container && this._container.classList.contains("textarea--focus")) {
1770
+ this._container.classList.remove("textarea--focus");
1771
+ }
1772
+ }
1773
+ handleChange() {
1774
+ this.errorMessage = "";
1775
+ this.value = this._inputElem.value;
1776
+ }
1777
+ handleFocus() {
1778
+ if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {
1779
+ this._labelElem.classList.add("textarea__label--floated");
1780
+ }
1781
+ if (this._container && !this._container.classList.contains("textarea--focus")) {
1782
+ this._container.classList.add("textarea--focus");
1783
+ }
1784
+ }
1785
+ //---------------------------------------------
1786
+ // Lifecycle web component
1787
+ //---------------------------------------------
1788
+ componentDidLoad() {
1789
+ this.showError();
1790
+ this.adjustFloatingLabel();
1791
+ }
1792
+ render() {
1793
+ return (index.h(index.Host, null, index.h("div", { class: "textarea", ref: (el) => this._container = el }, this.label ?
1794
+ index.h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
1795
+ : null, index.h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
1796
+ }
1797
+ get _hostElement() { return index.getElement(this); }
1798
+ static get watchers() { return {
1799
+ "errorMessage": ["showError"],
1800
+ "value": ["updateInputValue"]
1801
+ }; }
1802
+ };
1803
+ EzTextArea.style = ezTextAreaCss;
1804
+
1805
+ const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--large, 500);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--alert-cold-800, #042EFF);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{display:flex;min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
1806
+
1807
+ let EzTextInput = class {
1808
+ constructor(hostRef) {
1809
+ index.registerInstance(this, hostRef);
1810
+ this.ezChange = index.createEvent(this, "ezChange", 7);
1811
+ /**
1812
+ * Deixa o campo disponível ou não para digitação.
1813
+ */
1814
+ this.enabled = true;
1815
+ }
1816
+ showError() {
1817
+ const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
1818
+ if (hasError) {
1819
+ this._inputElem.classList.add("hasError");
1820
+ this._messageBoxElem.classList.add("hasError");
1821
+ }
1822
+ else {
1823
+ this._inputElem.classList.remove("hasError");
1824
+ this._messageBoxElem.classList.remove("hasError");
1825
+ }
1826
+ }
1827
+ prepareMask() {
1828
+ if (this.mask) {
1829
+ if (this._maskFormatter == undefined) {
1830
+ this._maskFormatter = new index$1.MaskFormatter(this.mask);
1831
+ }
1832
+ else {
1833
+ this._maskFormatter.mask = this.mask;
1834
+ }
1835
+ }
1836
+ }
1837
+ updateInputValue() {
1838
+ if (this._inputElem) {
1839
+ this._inputElem.value = this.value;
1840
+ }
1841
+ this.handleChange();
1842
+ this.errorMessage = "";
1843
+ this.ezChange.emit(this.value);
1844
+ this.adjustFloatingLabel();
1845
+ }
1846
+ adjustFloatingLabel() {
1847
+ if (this.label && this._labelElem) {
1848
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
1849
+ this._inputElem.classList.add("input--with--label");
1850
+ }
1851
+ const hasValue = this.value && this.value.toString().length > 0;
1852
+ const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
1853
+ if (hasValue || this.isFocused()) {
1854
+ if (!containsFloatedClass) {
1855
+ this._labelElem.classList.add("input__label--floated");
1856
+ }
1857
+ }
1858
+ else {
1859
+ if (containsFloatedClass) {
1860
+ this._labelElem.classList.remove("input__label--floated");
1861
+ }
1862
+ }
1863
+ }
1864
+ }
1865
+ isFocused() {
1866
+ return this._hostElement.shadowRoot.activeElement !== null;
1867
+ }
1868
+ //---------------------------------------------
1869
+ // Public methods
1870
+ //---------------------------------------------
1871
+ /**
1872
+ * Faz o foco no componente de input
1873
+ */
1874
+ async setFocus() {
1875
+ this._inputElem.focus();
1876
+ }
1877
+ /**
1878
+ * Remove o foco no componente de input
1879
+ */
1880
+ async setBlur() {
1881
+ this._inputElem.blur();
1882
+ }
1883
+ //---------------------------------------------
1884
+ // Event handlers
1885
+ //---------------------------------------------
1886
+ handleFocusout() {
1887
+ const value = this._inputElem.value;
1888
+ if (value && this._maskFormatter) {
1889
+ try {
1890
+ this._inputElem.value = this._maskFormatter.format(value);
1891
+ }
1892
+ catch (e) {
1893
+ this.errorMessage = e.message;
1894
+ }
1895
+ }
1896
+ this.value = this._inputElem.value;
1897
+ this.adjustFloatingLabel();
1898
+ }
1899
+ isValidValue(value) {
1900
+ if (this.restrict) {
1901
+ return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
1902
+ }
1903
+ return true;
1904
+ }
1905
+ handleChange() {
1906
+ if (!this._inputElem) {
1907
+ return;
1908
+ }
1909
+ const value = this._inputElem.value;
1910
+ if (this.isValidValue(value)) {
1911
+ this._lastValidValue = value;
1912
+ }
1913
+ else {
1914
+ this._inputElem.value = this._lastValidValue === undefined ? "" : this._lastValidValue;
1915
+ }
1916
+ this.value = this._inputElem.value;
1917
+ }
1918
+ handleSlotChange(ev) {
1919
+ const slot = ev.target;
1920
+ const content = slot.assignedElements()[0];
1921
+ if (content) {
1922
+ content.style.position = "absolute";
1923
+ content.style.display = "flex";
1924
+ content.style.alignItems = "center";
1925
+ content.style.justifyContent = "center";
1926
+ content.style.overflow = "hidden";
1927
+ content.style.top = "0px";
1928
+ content.style.width = "var(--ez-text-input__icon--width)";
1929
+ content.style.height = "var(--ez-text-input--height)";
1930
+ if (slot.name == "leftIcon") {
1931
+ content.style.left = "0px";
1932
+ content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
1933
+ this._inputElem.classList.add("icon--left");
1934
+ if (this._labelElem) {
1935
+ this._labelElem.classList.add("input__label--left");
1936
+ }
1937
+ }
1938
+ else if (slot.name == "rightIcon") {
1939
+ content.style.right = "0px";
1940
+ content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
1941
+ this._inputElem.classList.add("icon--right");
1942
+ if (this._labelElem) {
1943
+ this._labelElem.classList.add("input__label--right");
1944
+ }
1945
+ }
1946
+ }
1947
+ this.showError();
1948
+ }
1949
+ doFocus() {
1950
+ if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
1951
+ this._labelElem.classList.add("input__label--floated");
1952
+ }
1953
+ }
1954
+ //---------------------------------------------
1955
+ // Lifecycle web component
1956
+ //---------------------------------------------
1957
+ componentDidLoad() {
1958
+ this.showError();
1959
+ this.prepareMask();
1960
+ this.adjustFloatingLabel();
1961
+ }
1962
+ componentWillLoad() {
1963
+ this.prepareMask();
1964
+ if (this.value) {
1965
+ if (this._maskFormatter) {
1966
+ try {
1967
+ this.value = this._maskFormatter.format(this.value);
1968
+ }
1969
+ catch (e) {
1970
+ this.errorMessage = e.message;
1971
+ }
1972
+ }
1973
+ if (!this.isValidValue(this.value)) {
1974
+ this._lastValidValue = "";
1975
+ this.value = "";
1976
+ }
1977
+ }
1978
+ }
1979
+ render() {
1980
+ return (index.h(index.Host, null, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
1981
+ index.h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
1982
+ : null, index.h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
1983
+ }
1984
+ get _hostElement() { return index.getElement(this); }
1985
+ static get watchers() { return {
1986
+ "errorMessage": ["showError"],
1987
+ "mask": ["prepareMask"],
1988
+ "value": ["updateInputValue"]
1989
+ }; }
1990
+ };
1991
+ EzTextInput.style = ezTextInputCss;
1992
+
1993
+ class RemoteFile {
1994
+ constructor(file) {
1995
+ this.file = file;
1996
+ this.size = file.size;
1997
+ this.name = file.name;
1998
+ }
1999
+ abortUpload() {
2000
+ if (this._uploadingXhr) {
2001
+ this._aborted = true;
2002
+ this._uploadingXhr.abort();
2003
+ this._uploadingXhr = undefined;
2004
+ }
2005
+ }
2006
+ isUploading() {
2007
+ return this._uploadingXhr !== undefined;
2008
+ }
2009
+ async upload(server, headers, updateCallBack) {
2010
+ return new Promise((resolve, reject) => {
2011
+ const xhr = new XMLHttpRequest();
2012
+ this._uploadingXhr = xhr;
2013
+ this._aborted = false;
2014
+ this.progress = 0;
2015
+ xhr.upload.onprogress = (e) => {
2016
+ const loaded = e.loaded;
2017
+ const total = e.total;
2018
+ this.progress = ~~((loaded / total) * 100);
2019
+ updateCallBack(this, loaded, total);
2020
+ };
2021
+ xhr.onreadystatechange = () => {
2022
+ if (xhr.readyState == 4) {
2023
+ this._uploadingXhr = undefined;
2024
+ const status = xhr.status;
2025
+ if (!this._aborted) {
2026
+ if (status === 0) {
2027
+ reject("Servidor indisponível");
2028
+ }
2029
+ else if (status >= 500) {
2030
+ reject("Erro inesperado no servidor");
2031
+ }
2032
+ else if (status >= 400) {
2033
+ reject("Operação não permitida");
2034
+ }
2035
+ }
2036
+ const response = xhr.response;
2037
+ if (response) {
2038
+ resolve(JSON.parse(response));
2039
+ }
2040
+ }
2041
+ };
2042
+ xhr.ontimeout = () => {
2043
+ reject("Tempo limite de transferência atingido.");
2044
+ };
2045
+ const formData = new FormData();
2046
+ formData.append("ARQUIVO", this.file, this.file.name);
2047
+ xhr.open("POST", server, true);
2048
+ if (headers) {
2049
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
2050
+ }
2051
+ xhr.send(formData);
2052
+ });
2053
+ }
2054
+ async delete(item, server, headers) {
2055
+ return new Promise((resolve, reject) => {
2056
+ const xhr = new XMLHttpRequest();
2057
+ xhr.onreadystatechange = () => {
2058
+ if (xhr.readyState == 4) {
2059
+ if (xhr.status === 0) {
2060
+ reject("Servidor indisponível");
2061
+ }
2062
+ else if (xhr.status >= 500) {
2063
+ reject("Erro inesperado no servidor");
2064
+ }
2065
+ else if (xhr.status >= 400) {
2066
+ reject("Operação não permitida");
2067
+ }
2068
+ resolve(true);
2069
+ }
2070
+ };
2071
+ xhr.ontimeout = () => {
2072
+ reject("Tempo limite de remoção atingido.");
2073
+ };
2074
+ xhr.open("DELETE", server, true);
2075
+ if (headers) {
2076
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
2077
+ }
2078
+ xhr.send(JSON.stringify(item));
2079
+ });
2080
+ }
2081
+ }
2082
+
2083
+ const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--ez-upload--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.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%}}";
2084
+
2085
+ let EzUpload = class {
2086
+ constructor(hostRef) {
2087
+ index.registerInstance(this, hostRef);
2088
+ this.ezChange = index.createEvent(this, "ezChange", 7);
2089
+ this._filePointers = new Map();
2090
+ /**
2091
+ * Deixa o campo disponível ou não para digitação.
2092
+ */
2093
+ this.enabled = true;
2094
+ }
2095
+ changeValue(newValue) {
2096
+ if (newValue !== this._updatingValue) {
2097
+ this._filePointers.forEach(f => {
2098
+ if (this.isRemoteFile(f)) {
2099
+ f.abortUpload();
2100
+ }
2101
+ });
2102
+ this._filePointers = new Map();
2103
+ this.updateFilePointers();
2104
+ }
2105
+ this._updatingValue = undefined;
2106
+ }
2107
+ updateFilePointers() {
2108
+ if (this.value) {
2109
+ this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
2110
+ }
2111
+ }
2112
+ normalizeRequestHeaders() {
2113
+ this._requestHeaders = new Map();
2114
+ if (typeof this.requestHeaders == "string") {
2115
+ try {
2116
+ this.requestHeaders = JSON.parse(this.requestHeaders);
2117
+ }
2118
+ catch (e) {
2119
+ this.requestHeaders = undefined;
2120
+ }
2121
+ }
2122
+ for (var key in this.requestHeaders) {
2123
+ this._requestHeaders.set(key, this.requestHeaders[key]);
2124
+ }
2125
+ }
2126
+ /**
2127
+ * Método responsável por adicionar um ou mais arquivos ao componente.
2128
+ */
2129
+ async addFiles(files) {
2130
+ if (this.maxFiles > 0) {
2131
+ let countDistinctFiles = this._filePointers.size;
2132
+ files.forEach(file => {
2133
+ if (!this._filePointers.has(file.name)) {
2134
+ countDistinctFiles++;
2135
+ }
2136
+ });
2137
+ if (countDistinctFiles > this.maxFiles) {
2138
+ this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
2139
+ return;
2140
+ }
2141
+ }
2142
+ Array.prototype.forEach.call(files, this.addFile.bind(this));
2143
+ }
2144
+ async addFile(file) {
2145
+ const oldFile = this._filePointers.get(file.name);
2146
+ if (oldFile) {
2147
+ ApplicationUtils.confirm("Substituir arquivo", `Já existe um arquivo chamado "${file.name}". Deseja substituí-lo?`)
2148
+ .then(ok => {
2149
+ if (ok) {
2150
+ if (this.isRemoteFile(oldFile)) {
2151
+ oldFile.abortUpload();
2152
+ }
2153
+ this.doAddFile(file);
2154
+ }
2155
+ });
2156
+ }
2157
+ else {
2158
+ this.doAddFile(file);
2159
+ }
2160
+ }
2161
+ async doAddFile(file) {
2162
+ if (this.validateFile(file)) {
2163
+ const uploadingFile = new RemoteFile(file);
2164
+ this._filePointers.set(file.name, uploadingFile);
2165
+ uploadingFile.upload(this.urlUpload, this._requestHeaders, (file) => this.updateFeedback(file))
2166
+ .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
2167
+ .catch(msg => this.showError(msg));
2168
+ index.forceUpdate(this);
2169
+ }
2170
+ }
2171
+ finishUpload(ezFile) {
2172
+ this._filePointers.set(ezFile.name, ezFile);
2173
+ this.updateValue();
2174
+ }
2175
+ updateValue() {
2176
+ this._updatingValue = [];
2177
+ this._filePointers.forEach(f => {
2178
+ if (!this.isRemoteFile(f)) {
2179
+ this._updatingValue.push(f);
2180
+ }
2181
+ });
2182
+ this.value = this._updatingValue;
2183
+ this.ezChange.emit(this.value);
2184
+ }
2185
+ buildProgressId(uploading) {
2186
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, "_");
2187
+ return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
2188
+ }
2189
+ updateFeedback(uf) {
2190
+ window.requestAnimationFrame(() => {
2191
+ if (this._host) {
2192
+ const progress = this._host.shadowRoot.querySelector("#" + this.buildProgressId(uf));
2193
+ if (progress) {
2194
+ progress.value = uf.progress;
2195
+ }
2196
+ }
2197
+ });
2198
+ }
2199
+ validateFile(file) {
2200
+ if (!this._filePointers.has(file.name) && this.maxFiles > 0 && this._filePointers.size >= this.maxFiles) {
2201
+ this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
2202
+ return false;
2203
+ }
2204
+ if (file.size === 0) {
2205
+ this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
2206
+ return false;
2207
+ }
2208
+ if (!this.urlUpload) {
2209
+ this.showError("Endereço de upload não informado");
2210
+ return false;
2211
+ }
2212
+ if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
2213
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxFileSize));
2214
+ return false;
2215
+ }
2216
+ return true;
2217
+ }
2218
+ showError(message) {
2219
+ ApplicationUtils.alert("Enviando arquivo", message);
2220
+ }
2221
+ formatBytes(bytes, decimals = 1) {
2222
+ if (bytes === 0)
2223
+ return "0 Bytes";
2224
+ const k = 1024;
2225
+ const dm = decimals < 0 ? 0 : decimals;
2226
+ const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
2227
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
2228
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
2229
+ }
2230
+ onFileInputChange(event) {
2231
+ const input = event.target;
2232
+ this.addFiles(Array.from(input.files));
2233
+ this._fileInput.value = "";
2234
+ }
2235
+ isRemoteFile(item) {
2236
+ return "file" in item;
2237
+ }
2238
+ removeFromList(name) {
2239
+ this._filePointers.delete(name);
2240
+ this.updateValue();
2241
+ }
2242
+ removeFile(name) {
2243
+ const item = this._filePointers.get(name);
2244
+ if (this.isRemoteFile(item)) {
2245
+ item.abortUpload();
2246
+ this.removeFromList(name);
2247
+ }
2248
+ else {
2249
+ if (this.urlDelete) {
2250
+ const uploadingFile = new RemoteFile(null);
2251
+ this._filePointers.set(item.name, uploadingFile);
2252
+ uploadingFile.delete(item, this.urlDelete, null)
2253
+ .then(_ok => this.removeFromList(name))
2254
+ .catch(msg => this.showError(msg));
2255
+ }
2256
+ else {
2257
+ this.removeFromList(name);
2258
+ }
2259
+ }
2260
+ }
2261
+ openFilesDialog() {
2262
+ if (this.enabled) {
2263
+ this._fileInput.click();
2264
+ }
2265
+ }
2266
+ componentDidLoad() {
2267
+ if (this.enabled && this._dropZone && window.FileList && window.File) {
2268
+ this._dropZone.addEventListener("dragover", event => {
2269
+ event.stopPropagation();
2270
+ event.preventDefault();
2271
+ event.dataTransfer.dropEffect = "copy";
2272
+ this._dropZone.style.background = "#c2dbff";
2273
+ });
2274
+ this._dropZone.addEventListener("drop", event => {
2275
+ event.stopPropagation();
2276
+ event.preventDefault();
2277
+ this.addFiles(Array.from(event.dataTransfer.files));
2278
+ this._dropZone.style.background = "";
2279
+ });
2280
+ this._dropZone.addEventListener("dragleave", _event => {
2281
+ this._dropZone.style.background = "";
2282
+ });
2283
+ }
2284
+ }
2285
+ componentWillRender() {
2286
+ if (this.value) {
2287
+ if (this._filePointers.size < this.value.length) {
2288
+ this.updateFilePointers();
2289
+ }
2290
+ }
2291
+ }
2292
+ render() {
2293
+ return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu_header" }, this.label ? index.h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, index.h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, index.h("button", { class: "iu__file-icon", disabled: !this.enabled }), index.h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
2294
+ }
2295
+ buildFooter() {
2296
+ if (this._filePointers.size === 0) {
2297
+ return null;
2298
+ }
2299
+ const items = [];
2300
+ this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
2301
+ return (index.h("div", { class: "iu__footer" }, items));
2302
+ }
2303
+ buildFileItem(item) {
2304
+ const fileName = item.name;
2305
+ const progress = Number(item["progress"]);
2306
+ const downloadURL = item["downloadURL"];
2307
+ const label = `${fileName} (${this.formatBytes(item.size)})`;
2308
+ return (index.h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, index.h("div", { class: "iu__item-label modificador" }, index.h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? index.h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
2309
+ ?
2310
+ null
2311
+ :
2312
+ index.h("div", { class: "col col--sd-4 col--stretch align--middle" }, index.h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })), this.enabled
2313
+ ?
2314
+ index.h("div", { class: "col col--stretch align--middle" }, index.h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))
2315
+ :
2316
+ null));
2317
+ }
2318
+ evalDisabledClass(regularClasses, disabledClass) {
2319
+ return this.enabled ? regularClasses : `${regularClasses} ${disabledClass}`;
2320
+ }
2321
+ get _host() { return index.getElement(this); }
2322
+ static get watchers() { return {
2323
+ "value": ["changeValue"],
2324
+ "requestHeaders": ["normalizeRequestHeaders"]
2325
+ }; }
2326
+ };
2327
+ EzUpload.style = ezUploadCss;
2328
+
2329
+ const testDuCss = ":host{display:block}";
2330
+
2331
+ let TestDu = class {
2332
+ constructor(hostRef) {
2333
+ index.registerInstance(this, hostRef);
2334
+ }
2335
+ componentWillLoad() {
2336
+ this.dataUnit = new index$1.DataUnit("testes_com_formulario");
2337
+ this.dataUnit.metadata = {
2338
+ name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
2339
+ label: "Parceiro",
2340
+ fields: [
2341
+ {
2342
+ name: "CODPARC",
2343
+ label: "Parceiro",
2344
+ dataType: index$1.DataType.NUMBER,
2345
+ userInterface: index$1.UserInterface.SEARCH,
2346
+ required: true,
2347
+ properties: {}
2348
+ },
2349
+ {
2350
+ name: "RECDESP",
2351
+ label: "Receita/Despesa",
2352
+ dataType: index$1.DataType.TEXT,
2353
+ userInterface: index$1.UserInterface.OPTIONSELECTOR,
2354
+ required: true,
2355
+ properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
2356
+ },
2357
+ {
2358
+ name: "P",
2359
+ label: "pera",
2360
+ dataType: index$1.DataType.TEXT,
2361
+ userInterface: index$1.UserInterface.OPTIONSELECTOR,
2362
+ properties: { options: `{"M": "Madura", "V": "Verde", "P": "Passada"}` }
2363
+ },
2364
+ {
2365
+ name: "ME",
2366
+ label: "ME",
2367
+ dataType: index$1.DataType.NUMBER,
2368
+ userInterface: index$1.UserInterface.DECIMALNUMBER,
2369
+ properties: { precision: 4, prettyPrecision: 1 }
2370
+ }
2371
+ ]
2372
+ };
2373
+ this.formConfig = [
2374
+ { name: "CODPARC", label: "Parceiro" },
2375
+ { name: "NOMEPARC", label: "Mamão" },
2376
+ { name: "P", label: "Pêra", group: "Grupo 1" },
2377
+ { name: "ME", label: "Melancia", tab: "aba 1", group: "Grupo 2" },
2378
+ { name: "L", label: "Laranja", tab: "aba 1", group: "Grupo 1" },
2379
+ { name: "LI", label: "Limão", tab: "aba 1", group: "Grupo 2" }
2380
+ ];
2381
+ this.dataUnit.records = [
2382
+ {
2383
+ __record__id__: "1321321321321321",
2384
+ CODPARC: 10,
2385
+ NOMEPARC: "Parceiro 10",
2386
+ P: "M",
2387
+ L: "Bagaço",
2388
+ LI: "Azedo"
2389
+ }
2390
+ ];
2391
+ }
2392
+ render() {
2393
+ //return this.conteudoEstatico();
2394
+ //return this.somenteDataUnit();
2395
+ return this.configurado();
2396
+ }
2397
+ conteudoEstatico() {
2398
+ return (index.h("div", null, index.h("button", { onClick: () => this.form.validate() }, "Validate"), index.h("ez-form", { ref: ref => this.form = ref }, index.h("div", null, index.h("ez-text-input", { label: "Nome (Label est\u00E1tico)", "data-field-name": "NOMEPARC", "data-required": "true" }), index.h("ez-text-input", { label: "C\u00F3d parc (Label est\u00E1tico)", "data-field-name": "CODPARC", "data-required": "true" })))));
2399
+ }
2400
+ somenteDataUnit() {
2401
+ return (index.h("ez-form", { dataUnit: this.dataUnit }));
2402
+ }
2403
+ configurado() {
2404
+ return (index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, ref: ref => this.form = ref }));
2405
+ }
2406
+ };
2407
+ TestDu.style = testDuCss;
2408
+
2409
+ exports.ez_calendar = EzCalendar;
2410
+ exports.ez_check = EzCheck;
2411
+ exports.ez_collapsible_box = EzCollapsibleBox;
2412
+ exports.ez_combo_box = EzComboBox;
2413
+ exports.ez_date_input = EzDateInput;
2414
+ exports.ez_form = EzForm;
2415
+ exports.ez_number_input = EzNumberInput;
2416
+ exports.ez_search = EzSearch;
2417
+ exports.ez_tabselector = EzTabselector;
2418
+ exports.ez_text_area = EzTextArea;
2419
+ exports.ez_text_input = EzTextInput;
2420
+ exports.ez_upload = EzUpload;
2421
+ exports.test_du = TestDu;