@sankhyalabs/ezui 6.1.0-dev.1 → 6.1.0-dev.10

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 (133) hide show
  1. package/dist/cjs/RichToolbarHelper-438916fa.js +46 -0
  2. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  3. package/dist/cjs/ez-card-item_2.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-chart.cjs.entry.js +3 -18
  5. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-chip.cjs.entry.js +2 -1
  7. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  8. package/dist/cjs/{ez-combo-box-list_3.cjs.entry.js → ez-combo-box-list_4.cjs.entry.js} +270 -1
  9. package/dist/cjs/ez-combo-box.cjs.entry.js +17 -5
  10. package/dist/cjs/ez-filter-input.cjs.entry.js +129 -0
  11. package/dist/cjs/ez-form-view.cjs.entry.js +8 -1
  12. package/dist/cjs/ez-grid.cjs.entry.js +29 -1
  13. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-link-builder_6.cjs.entry.js +295 -0
  15. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +27 -0
  17. package/dist/cjs/ez-search-plus.cjs.entry.js +4 -1
  18. package/dist/cjs/{ez-filter-input_2.cjs.entry.js → ez-tooltip.cjs.entry.js} +1 -123
  19. package/dist/cjs/ezui.cjs.js +1 -1
  20. package/dist/cjs/index-a7b0c73d.js +20 -8
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/purify-a7dc3a08.js +1354 -0
  23. package/dist/collection/collection-manifest.json +8 -0
  24. package/dist/collection/components/ez-check/ez-check.css +1 -1
  25. package/dist/collection/components/ez-chip/ez-chip.js +20 -1
  26. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -0
  27. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +1 -0
  28. package/dist/collection/components/ez-combo-box/ez-combo-box.js +53 -5
  29. package/dist/collection/components/ez-form-view/ez-form-view.js +2 -1
  30. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -0
  31. package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js +4 -0
  32. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +25 -1
  33. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +4 -1
  34. package/dist/collection/components/ez-icon/ez-icon.css +147 -140
  35. package/dist/collection/components/ez-modal-container/ez-modal-container.css +2 -0
  36. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +3 -2
  37. package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.css +22 -0
  38. package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.js +131 -0
  39. package/dist/collection/components/ez-rich-text/ez-rich-text.css +35 -0
  40. package/dist/collection/components/ez-rich-text/ez-rich-text.js +544 -0
  41. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.js +39 -0
  42. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.css +4 -0
  43. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.js +19 -0
  44. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.css +4 -0
  45. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.js +19 -0
  46. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.css +20 -0
  47. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.js +122 -0
  48. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.css +4 -0
  49. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.js +19 -0
  50. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.css +42 -0
  51. package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.js +183 -0
  52. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.css +70 -0
  53. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.js +216 -0
  54. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.js +1 -0
  55. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.js +14 -0
  56. package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.js +10 -0
  57. package/dist/collection/components/ez-search-plus/ez-search-plus.css +1 -0
  58. package/dist/collection/components/ez-search-plus/ez-search-plus.js +3 -0
  59. package/dist/collection/components/ez-tooltip/ez-tooltip.js +1 -1
  60. package/dist/custom-elements/index.d.ts +48 -0
  61. package/dist/custom-elements/index.js +2048 -19
  62. package/dist/esm/RichToolbarHelper-fd6427df.js +41 -0
  63. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  64. package/dist/esm/ez-card-item_2.entry.js +1 -1
  65. package/dist/esm/ez-chart.entry.js +1 -16
  66. package/dist/esm/ez-check.entry.js +1 -1
  67. package/dist/esm/ez-chip.entry.js +2 -1
  68. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  69. package/dist/esm/{ez-combo-box-list_3.entry.js → ez-combo-box-list_4.entry.js} +271 -3
  70. package/dist/esm/ez-combo-box.entry.js +17 -5
  71. package/dist/esm/ez-filter-input.entry.js +125 -0
  72. package/dist/esm/ez-form-view.entry.js +8 -1
  73. package/dist/esm/ez-grid.entry.js +29 -1
  74. package/dist/esm/ez-icon.entry.js +1 -1
  75. package/dist/esm/ez-link-builder_6.entry.js +286 -0
  76. package/dist/esm/ez-modal-container.entry.js +1 -1
  77. package/dist/esm/ez-rich-toolbar-item.entry.js +23 -0
  78. package/dist/esm/ez-search-plus.entry.js +4 -1
  79. package/dist/esm/{ez-filter-input_2.entry.js → ez-tooltip.entry.js} +3 -124
  80. package/dist/esm/ezui.js +1 -1
  81. package/dist/esm/index-baa5e267.js +20 -8
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/esm/purify-da6317bb.js +1352 -0
  84. package/dist/ezui/ezui.esm.js +1 -1
  85. package/dist/ezui/p-112455b1.js +1 -0
  86. package/dist/ezui/{p-5dde9df3.entry.js → p-1276ef79.entry.js} +1 -1
  87. package/dist/ezui/p-1c55dda0.js +3 -0
  88. package/dist/ezui/p-1cebdc92.js +1 -0
  89. package/dist/ezui/p-20c024f7.entry.js +1 -0
  90. package/dist/ezui/{p-b38411b4.entry.js → p-31f0d5f8.entry.js} +46 -46
  91. package/dist/ezui/{p-26685c50.entry.js → p-454bba13.entry.js} +1 -1
  92. package/dist/ezui/p-5cda9526.entry.js +1 -0
  93. package/dist/ezui/p-6369a0cd.entry.js +1 -0
  94. package/dist/ezui/p-71c2ec1f.entry.js +1 -0
  95. package/dist/ezui/p-79044c3e.entry.js +1 -0
  96. package/dist/ezui/{p-b81881ac.entry.js → p-7f792043.entry.js} +1 -1
  97. package/dist/ezui/p-80461324.entry.js +1 -0
  98. package/dist/ezui/{p-69937816.entry.js → p-8afb6e8a.entry.js} +1 -1
  99. package/dist/ezui/p-91c9d50e.entry.js +1 -0
  100. package/dist/ezui/{p-9567b31a.entry.js → p-a3782637.entry.js} +1 -1
  101. package/dist/ezui/p-beb42de1.entry.js +1 -0
  102. package/dist/ezui/p-dfd9c473.entry.js +1 -0
  103. package/dist/ezui/p-ec0d8122.entry.js +1 -0
  104. package/dist/types/components/ez-chip/ez-chip.d.ts +4 -0
  105. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +10 -0
  106. package/dist/types/components/ez-form-view/fieldbuilder/templates/RichText.tpl.d.ts +2 -0
  107. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
  108. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -0
  109. package/dist/types/components/ez-rich-text/ez-link-builder/ez-link-builder.d.ts +17 -0
  110. package/dist/types/components/ez-rich-text/ez-rich-text.d.ts +98 -0
  111. package/dist/types/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.d.ts +43 -0
  112. package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.d.ts +3 -0
  113. package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.d.ts +3 -0
  114. package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.d.ts +11 -0
  115. package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.d.ts +3 -0
  116. package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.d.ts +33 -0
  117. package/dist/types/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.d.ts +37 -0
  118. package/dist/types/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.d.ts +1 -0
  119. package/dist/types/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.d.ts +1 -0
  120. package/dist/types/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.d.ts +1 -0
  121. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
  122. package/dist/types/components.d.ts +315 -0
  123. package/package.json +2 -1
  124. package/react/components.d.ts +8 -0
  125. package/react/components.js +8 -0
  126. package/react/components.js.map +1 -1
  127. package/dist/ezui/p-2b42abbb.entry.js +0 -1
  128. package/dist/ezui/p-341da682.entry.js +0 -1
  129. package/dist/ezui/p-35115d5d.entry.js +0 -1
  130. package/dist/ezui/p-63cb493e.entry.js +0 -1
  131. package/dist/ezui/p-97c7cf51.entry.js +0 -1
  132. package/dist/ezui/p-d47dabdf.entry.js +0 -1
  133. package/dist/ezui/p-e06a9886.entry.js +0 -1
@@ -0,0 +1,125 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-baa5e267.js';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
+ import { C as CSSVarsUtils } from './CSSVarsUtils-acba92d7.js';
4
+
5
+ const ezFilterInputCss = ":host{display:block;width:100%}";
6
+
7
+ const EzFilterInput = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.ezChange = createEvent(this, "ezChange", 7);
11
+ this.ezSearching = createEvent(this, "ezSearching", 7);
12
+ this.ezFocusIn = createEvent(this, "ezFocusIn", 7);
13
+ this._searchingText = "";
14
+ this.handleFocus = () => {
15
+ if (this._searchingText === "") {
16
+ this._textInput.value = "";
17
+ }
18
+ else {
19
+ this._textInput.value = this._searchingText;
20
+ }
21
+ this.ezFocusIn.emit();
22
+ };
23
+ this.label = undefined;
24
+ this.value = undefined;
25
+ this.enabled = true;
26
+ this.errorMessage = undefined;
27
+ this.restrict = undefined;
28
+ this.mode = "regular";
29
+ this.asyncSearch = false;
30
+ this.canShowError = true;
31
+ this.autoFocus = false;
32
+ }
33
+ observeLabel() {
34
+ if (this._textInput) {
35
+ this._textInput.label = this.label;
36
+ }
37
+ }
38
+ observeErrorMessage() {
39
+ if (this._textInput) {
40
+ this._textInput.errorMessage = this.errorMessage;
41
+ }
42
+ }
43
+ observeValue(newValue, oldValue) {
44
+ if (this._textInput && newValue != oldValue) {
45
+ this._textInput.value = newValue;
46
+ this.ezChange.emit(newValue);
47
+ }
48
+ }
49
+ /**
50
+ * Aplica o foco no campo.
51
+ */
52
+ async setFocus(options) {
53
+ this._textInput.setFocus(options);
54
+ }
55
+ /**
56
+ * Remove o foco do campo.
57
+ */
58
+ async setBlur() {
59
+ this._textInput.setBlur();
60
+ }
61
+ /**
62
+ * Retorna se o conteúdo é inválido.
63
+ */
64
+ async isInvalid() {
65
+ return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
66
+ }
67
+ /**
68
+ * Método responsável por setar um novo valor ao campo.
69
+ */
70
+ async setValue(newValue) {
71
+ if (!this.asyncSearch || this._textInput == undefined) {
72
+ return;
73
+ }
74
+ if (newValue !== this.value) {
75
+ this.value = newValue;
76
+ this._searchingText = "";
77
+ }
78
+ else {
79
+ this._textInput.value = newValue;
80
+ }
81
+ }
82
+ /**
83
+ * Método responsável por resetar o valor do campo para o ultimo valor inputado.
84
+ */
85
+ async endSearch() {
86
+ if (!this.asyncSearch || this._textInput == undefined) {
87
+ return;
88
+ }
89
+ if (this._textInput.value !== this.value) {
90
+ this._textInput.value = this.value;
91
+ }
92
+ }
93
+ handleChange(evt) {
94
+ const newValue = evt.detail;
95
+ this.errorMessage = "";
96
+ if (this.asyncSearch) {
97
+ this._searchingText = newValue;
98
+ this.ezSearching.emit(newValue);
99
+ }
100
+ else if (newValue !== this.value) {
101
+ this.value = newValue;
102
+ }
103
+ }
104
+ componentDidLoad() {
105
+ CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
106
+ if (this.autoFocus) {
107
+ requestAnimationFrame(() => {
108
+ this.setFocus({ selectText: true });
109
+ });
110
+ }
111
+ }
112
+ render() {
113
+ ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
114
+ return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
115
+ }
116
+ get _elem() { return getElement(this); }
117
+ static get watchers() { return {
118
+ "label": ["observeLabel"],
119
+ "errorMessage": ["observeErrorMessage"],
120
+ "value": ["observeValue"]
121
+ }; }
122
+ };
123
+ EzFilterInput.style = ezFilterInputCss;
124
+
125
+ export { EzFilterInput as ez_filter_input };
@@ -95,6 +95,11 @@ const buildSearch = ({ name, label, readOnly, required, contextName, canShowErro
95
95
  h("ez-search", { class: "ez-input__no-margin", enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader, ignoreLimitCharsToSearch: (_a = props === null || props === void 0 ? void 0 : props.ignoreLimitCharsToSearch) !== null && _a !== void 0 ? _a : false })));
96
96
  };
97
97
 
98
+ const buildRichText = ({ name, label, readOnly, contextName, rows, canShowError }) => {
99
+ return (h("div", { class: "ez-col ez-col--sd-12" },
100
+ h("ez-rich-text", { key: name, enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, rows: rows, canShowError: canShowError })));
101
+ };
102
+
98
103
  const uiBuilders = new Map();
99
104
  uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
100
105
  uiBuilders.set(UserInterface.SWITCH, buildSwitch);
@@ -109,6 +114,7 @@ uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
109
114
  uiBuilders.set(UserInterface.SEARCH, buildSearch);
110
115
  uiBuilders.set(UserInterface.SEARCHPLUS, buildSearchPlus);
111
116
  uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
117
+ uiBuilders.set(UserInterface.HTML, buildRichText);
112
118
  const fieldBuilder = (field) => {
113
119
  const builder = uiBuilders.get(field.userInterface) || buildTextInput;
114
120
  const label = field.required ? `${field.label}${REQUIRED_INFO}` : field.label;
@@ -216,7 +222,8 @@ const EzFormView = class {
216
222
  isItemFullWidth(userInterface) {
217
223
  return [
218
224
  UserInterface.FILE,
219
- UserInterface.LONGTEXT
225
+ UserInterface.LONGTEXT,
226
+ UserInterface.HTML,
220
227
  ].includes(userInterface);
221
228
  }
222
229
  buildFormItemElement(item, classItem = "") {
@@ -8,6 +8,8 @@ import { C as CustomEditorSource, a as CustomRenderSource } from './FormLayout-0
8
8
  import { b as buildFieldMetadata, R as RecordValidationProcessor, D as DataBinder, S as SHORTCUT_SEARCH_FIELD, f as focusOnFieldSerch, c as SEARCH_FIELD_FULL_WIDTH, d as LABEL_SEARCH_COLUMN, a as buildFieldSearch } from './search-column-e609d513.js';
9
9
  import { D as DISTINCT_FILTER_NAME_PREFIX, E as EZ_GRID_LOADING_SOURCE, P as PRESENTATION_COL_ID_PROP_NAME, a as PRESENTATION_FROM_COL_PROP_NAME } from './constants-b036528f.js';
10
10
  import { F as FocusResolver } from './FocusResolver-1ccbf850.js';
11
+ import { p as purify } from './purify-da6317bb.js';
12
+ import './_commonjsHelpers-9943807e.js';
11
13
 
12
14
  /**
13
15
  * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
@@ -51275,11 +51277,14 @@ class GridEditionManager {
51275
51277
  }
51276
51278
  isColEditable(fieldName) {
51277
51279
  const fieldDefinition = this._dataUnit.getField(fieldName);
51278
- if (fieldDefinition) {
51280
+ if (fieldDefinition && !this.isTypeFile(fieldDefinition)) {
51279
51281
  return !fieldDefinition.readOnly;
51280
51282
  }
51281
51283
  return false;
51282
51284
  }
51285
+ isTypeFile(file) {
51286
+ return file.userInterface === UserInterface.FILE;
51287
+ }
51283
51288
  isSecondClick(cellClicked) {
51284
51289
  if (!this._lastCellClicked) {
51285
51290
  return false;
@@ -65514,6 +65519,7 @@ class AgGridController {
65514
65519
  cellStyle: {
65515
65520
  'text-align': 'center',
65516
65521
  },
65522
+ suppressNavigable: true,
65517
65523
  });
65518
65524
  }
65519
65525
  cols.forEach(c => {
@@ -65744,6 +65750,10 @@ class AgGridController {
65744
65750
  if (params.value instanceof Promise) {
65745
65751
  return "Carregando...";
65746
65752
  }
65753
+ if (source.userInterface === UserInterface.HTML) {
65754
+ this.setHTMLRender(params, source);
65755
+ return "";
65756
+ }
65747
65757
  const customFormatter = this._customFormatters.get(source.name);
65748
65758
  if (customFormatter) {
65749
65759
  const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
@@ -65760,6 +65770,24 @@ class AgGridController {
65760
65770
  editable: !((_e = source.props) === null || _e === void 0 ? void 0 : _e.has(PRESENTATION_FROM_COL_PROP_NAME))
65761
65771
  });
65762
65772
  }
65773
+ setHTMLRender(params, source) {
65774
+ const htmlSanitized = purify.sanitize(params.value);
65775
+ params.colDef.cellRenderer = (cellParams) => {
65776
+ if (cellParams.node.rowIndex === params.node.rowIndex) {
65777
+ const element = document.createElement('span');
65778
+ element.innerHTML = htmlSanitized;
65779
+ return element;
65780
+ }
65781
+ return cellParams.value;
65782
+ };
65783
+ params.colDef.cellStyle = (cellParams) => {
65784
+ const defaultStyle = this.getStyleByColumn(source);
65785
+ if (cellParams.node.rowIndex === params.node.rowIndex) {
65786
+ return Object.assign(defaultStyle, { padding: 0 });
65787
+ }
65788
+ return defaultStyle;
65789
+ };
65790
+ }
65763
65791
  setCustomFormatters(customFormatters) {
65764
65792
  this._customFormatters = customFormatters;
65765
65793
  }
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-baa5e267.js';
2
2
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
- const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-acao:before{content:\"\\ea03\"}.ez-icon-account-outline:before{content:\"\\ea04\"}.ez-icon-account:before{content:\"\\ea05\"}.ez-icon-add-to-cart:before{content:\"\\ea06\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea07\"}.ez-icon-alert-circle:before{content:\"\\ea08\"}.ez-icon-alert-mail:before{content:\"\\ea09\"}.ez-icon-alert-popup:before{content:\"\\ea0a\"}.ez-icon-anexo:before{content:\"\\ea0b\"}.ez-icon-antecipação:before{content:\"\\ea0c\"}.ez-icon-apps:before{content:\"\\ea0d\"}.ez-icon-arrow-forward:before{content:\"\\ea0e\"}.ez-icon-arrow-upward:before{content:\"\\ea0f\"}.ez-icon-arrow_back:before{content:\"\\ea10\"}.ez-icon-arrow_downward:before{content:\"\\ea11\"}.ez-icon-baixa:before{content:\"\\ea12\"}.ez-icon-balance:before{content:\"\\ea13\"}.ez-icon-bell-inverted:before{content:\"\\ea14\"}.ez-icon-bell:before{content:\"\\ea15\"}.ez-icon-boleto:before{content:\"\\ea16\"}.ez-icon-boolean:before{content:\"\\ea17\"}.ez-icon-business-center:before{content:\"\\ea18\"}.ez-icon-calendar-clock:before{content:\"\\ea19\"}.ez-icon-calendar:before{content:\"\\ea1a\"}.ez-icon-cart-history:before{content:\"\\ea1b\"}.ez-icon-cash-remove:before{content:\"\\ea1c\"}.ez-icon-check-circle-inverted:before{content:\"\\ea1d\"}.ez-icon-check-circle:before{content:\"\\ea1e\"}.ez-icon-check:before{content:\"\\ea1f\"}.ez-icon-chevron-down:before{content:\"\\ea20\"}.ez-icon-chevron-left:before{content:\"\\ea21\"}.ez-icon-chevron-right:before{content:\"\\ea22\"}.ez-icon-chevron-up:before{content:\"\\ea23\"}.ez-icon-circle--medium:before{content:\"\\ea24\"}.ez-icon-circle:before{content:\"\\ea25\"}.ez-icon-clean-cart:before{content:\"\\ea26\"}.ez-icon-cleaning:before{content:\"\\ea27\"}.ez-icon-clipboard:before{content:\"\\ea28\"}.ez-icon-clock-rotate-left:before{content:\"\\ea29\"}.ez-icon-close:before{content:\"\\ea2a\"}.ez-icon-cobrar:before{content:\"\\ea2b\"}.ez-icon-code:before{content:\"\\ea2c\"}.ez-icon-configuration:before{content:\"\\ea2d\"}.ez-icon-content-cut:before{content:\"\\ea2e\"}.ez-icon-copy:before{content:\"\\ea2f\"}.ez-icon-credit_card:before{content:\"\\ea30\"}.ez-icon-crop:before{content:\"\\ea31\"}.ez-icon-custom:before{content:\"\\ea32\"}.ez-icon-delete-file:before{content:\"\\ea33\"}.ez-icon-delete:before{content:\"\\ea34\"}.ez-icon-description:before{content:\"\\ea35\"}.ez-icon-dividir:before{content:\"\\ea36\"}.ez-icon-docx:before{content:\"\\ea37\"}.ez-icon-dot-notification:before{content:\"\\ea38\"}.ez-icon-dots-horizontal:before{content:\"\\ea39\"}.ez-icon-dots-vertical:before{content:\"\\ea3a\"}.ez-icon-drag-indicator:before{content:\"\\ea3b\"}.ez-icon-dual-chevron-down:before{content:\"\\ea3c\"}.ez-icon-dual-chevron-left:before{content:\"\\ea3d\"}.ez-icon-dual-chevron-right:before{content:\"\\ea3e\"}.ez-icon-dual-chevron-up:before{content:\"\\ea3f\"}.ez-icon-edit-file:before{content:\"\\ea40\"}.ez-icon-edit-table:before{content:\"\\ea41\"}.ez-icon-edit-time:before{content:\"\\ea42\"}.ez-icon-edit-value:before{content:\"\\ea43\"}.ez-icon-edit:before{content:\"\\ea44\"}.ez-icon-email:before{content:\"\\ea45\"}.ez-icon-estorno:before{content:\"\\ea46\"}.ez-icon-exe:before{content:\"\\ea47\"}.ez-icon-expand:before{content:\"\\ea48\"}.ez-icon-expandir_card:before{content:\"\\ea49\"}.ez-icon-extrato:before{content:\"\\ea4a\"}.ez-icon-eye-off:before{content:\"\\ea4b\"}.ez-icon-eye:before{content:\"\\ea4c\"}.ez-icon-favorite:before{content:\"\\ea4d\"}.ez-icon-figma:before{content:\"\\ea4e\"}.ez-icon-file-download:before{content:\"\\ea4f\"}.ez-icon-file-upload:before{content:\"\\ea50\"}.ez-icon-filter:before{content:\"\\ea51\"}.ez-icon-find-file:before{content:\"\\ea52\"}.ez-icon-find-page:before{content:\"\\ea53\"}.ez-icon-format-color-fill:before{content:\"\\ea54\"}.ez-icon-generic:before{content:\"\\ea55\"}.ez-icon-gif:before{content:\"\\ea56\"}.ez-icon-graph_bar:before{content:\"\\ea57\"}.ez-icon-handshake:before{content:\"\\ea58\"}.ez-icon-help-inverted:before{content:\"\\ea59\"}.ez-icon-help:before{content:\"\\ea5a\"}.ez-icon-hide-list:before{content:\"\\ea5b\"}.ez-icon-hide_menu:before{content:\"\\ea5c\"}.ez-icon-hierarchical-tree:before{content:\"\\ea5d\"}.ez-icon-home:before{content:\"\\ea5e\"}.ez-icon-icons104:before{content:\"\\ea5f\"}.ez-icon-language:before{content:\"\\ea60\"}.ez-icon-launch:before{content:\"\\ea61\"}.ez-icon-lightbulb:before{content:\"\\ea62\"}.ez-icon-list:before{content:\"\\ea63\"}.ez-icon-location:before{content:\"\\ea64\"}.ez-icon-lock-outline:before{content:\"\\ea65\"}.ez-icon-lock:before{content:\"\\ea66\"}.ez-icon-menu:before{content:\"\\ea67\"}.ez-icon-mid:before{content:\"\\ea68\"}.ez-icon-minus:before{content:\"\\ea69\"}.ez-icon-money-off:before{content:\"\\ea6a\"}.ez-icon-money:before{content:\"\\ea6b\"}.ez-icon-more:before{content:\"\\ea6c\"}.ez-icon-mp3:before{content:\"\\ea6d\"}.ez-icon-mp4:before{content:\"\\ea6e\"}.ez-icon-multiple-files:before{content:\"\\ea6f\"}.ez-icon-north-west:before{content:\"\\ea70\"}.ez-icon-number:before{content:\"\\ea71\"}.ez-icon-ordem-ascendente:before{content:\"\\ea72\"}.ez-icon-ordem-descendente:before{content:\"\\ea73\"}.ez-icon-parcelar:before{content:\"\\ea74\"}.ez-icon-pause:before{content:\"\\ea75\"}.ez-icon-payments:before{content:\"\\ea76\"}.ez-icon-pdf:before{content:\"\\ea77\"}.ez-icon-play:before{content:\"\\ea78\"}.ez-icon-plus:before{content:\"\\ea79\"}.ez-icon-png:before{content:\"\\ea7a\"}.ez-icon-power:before{content:\"\\ea7b\"}.ez-icon-pptx:before{content:\"\\ea7c\"}.ez-icon-preview:before{content:\"\\ea7d\"}.ez-icon-print:before{content:\"\\ea7e\"}.ez-icon-push-pin:before{content:\"\\ea7f\"}.ez-icon-rateio:before{content:\"\\ea80\"}.ez-icon-receipt:before{content:\"\\ea81\"}.ez-icon-recolher_card:before{content:\"\\ea82\"}.ez-icon-remove-from-cart:before{content:\"\\ea83\"}.ez-icon-restore:before{content:\"\\ea84\"}.ez-icon-return:before{content:\"\\ea85\"}.ez-icon-sankhya-place:before{content:\"\\ea86\"}.ez-icon-save:before{content:\"\\ea87\"}.ez-icon-search:before{content:\"\\ea88\"}.ez-icon-settings-inverted:before{content:\"\\ea89\"}.ez-icon-settings:before{content:\"\\ea8a\"}.ez-icon-share:before{content:\"\\ea8b\"}.ez-icon-shield:before{content:\"\\ea8c\"}.ez-icon-show-list:before{content:\"\\ea8d\"}.ez-icon-show_menu:before{content:\"\\ea8e\"}.ez-icon-south-east:before{content:\"\\ea8f\"}.ez-icon-sync:before{content:\"\\ea90\"}.ez-icon-table:before{content:\"\\ea91\"}.ez-icon-tag_code:before{content:\"\\ea92\"}.ez-icon-text:before{content:\"\\ea93\"}.ez-icon-timeline:before{content:\"\\ea94\"}.ez-icon-timer-outline:before{content:\"\\ea95\"}.ez-icon-trending-up:before{content:\"\\ea96\"}.ez-icon-tune:before{content:\"\\ea97\"}.ez-icon-txt:before{content:\"\\ea98\"}.ez-icon-un-pin:before{content:\"\\ea99\"}.ez-icon-unfold_less:before{content:\"\\ea9a\"}.ez-icon-unfold_more:before{content:\"\\ea9b\"}.ez-icon-user-circle:before{content:\"\\ea9c\"}.ez-icon-warning-outline:before{content:\"\\ea9d\"}.ez-icon-warning_triangle:before{content:\"\\ea9e\"}.ez-icon-whatshot:before{content:\"\\ea9f\"}.ez-icon-xlsx:before{content:\"\\eaa0\"}.ez-icon-zip:before{content:\"\\eaa1\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
4
+ const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-acao:before{content:\"\\ea03\"}.ez-icon-account-outline:before{content:\"\\ea04\"}.ez-icon-account:before{content:\"\\ea05\"}.ez-icon-add-to-cart:before{content:\"\\ea06\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea07\"}.ez-icon-alert-circle:before{content:\"\\ea08\"}.ez-icon-alert-mail:before{content:\"\\ea09\"}.ez-icon-alert-popup:before{content:\"\\ea0a\"}.ez-icon-anexo:before{content:\"\\ea0b\"}.ez-icon-antecipação:before{content:\"\\ea0c\"}.ez-icon-apps:before{content:\"\\ea0d\"}.ez-icon-arrow-forward:before{content:\"\\ea0e\"}.ez-icon-arrow-upward:before{content:\"\\ea0f\"}.ez-icon-arrow_back:before{content:\"\\ea10\"}.ez-icon-arrow_downward:before{content:\"\\ea11\"}.ez-icon-baixa:before{content:\"\\ea12\"}.ez-icon-balance:before{content:\"\\ea13\"}.ez-icon-bell-inverted:before{content:\"\\ea14\"}.ez-icon-bell:before{content:\"\\ea15\"}.ez-icon-bold:before{content:\"\\ea16\"}.ez-icon-boleto:before{content:\"\\ea17\"}.ez-icon-boolean:before{content:\"\\ea18\"}.ez-icon-business-center:before{content:\"\\ea19\"}.ez-icon-calendar-clock:before{content:\"\\ea1a\"}.ez-icon-calendar:before{content:\"\\ea1b\"}.ez-icon-cart-history:before{content:\"\\ea1c\"}.ez-icon-cash-remove:before{content:\"\\ea1d\"}.ez-icon-check-circle-inverted:before{content:\"\\ea1e\"}.ez-icon-check-circle:before{content:\"\\ea1f\"}.ez-icon-check:before{content:\"\\ea20\"}.ez-icon-chevron-down:before{content:\"\\ea21\"}.ez-icon-chevron-left:before{content:\"\\ea22\"}.ez-icon-chevron-right:before{content:\"\\ea23\"}.ez-icon-chevron-up:before{content:\"\\ea24\"}.ez-icon-circle--medium:before{content:\"\\ea25\"}.ez-icon-circle:before{content:\"\\ea26\"}.ez-icon-clean-cart:before{content:\"\\ea27\"}.ez-icon-cleaning:before{content:\"\\ea28\"}.ez-icon-clipboard:before{content:\"\\ea29\"}.ez-icon-clock-rotate-left:before{content:\"\\ea2a\"}.ez-icon-close:before{content:\"\\ea2b\"}.ez-icon-cobrar:before{content:\"\\ea2c\"}.ez-icon-code:before{content:\"\\ea2d\"}.ez-icon-configuration:before{content:\"\\ea2e\"}.ez-icon-content-cut:before{content:\"\\ea2f\"}.ez-icon-copy:before{content:\"\\ea30\"}.ez-icon-credit_card:before{content:\"\\ea31\"}.ez-icon-crop:before{content:\"\\ea32\"}.ez-icon-custom:before{content:\"\\ea33\"}.ez-icon-delete-file:before{content:\"\\ea34\"}.ez-icon-delete:before{content:\"\\ea35\"}.ez-icon-description:before{content:\"\\ea36\"}.ez-icon-dividir:before{content:\"\\ea37\"}.ez-icon-docx:before{content:\"\\ea38\"}.ez-icon-dot-notification:before{content:\"\\ea39\"}.ez-icon-dots-horizontal:before{content:\"\\ea3a\"}.ez-icon-dots-vertical:before{content:\"\\ea3b\"}.ez-icon-drag-indicator:before{content:\"\\ea3c\"}.ez-icon-dual-chevron-down:before{content:\"\\ea3d\"}.ez-icon-dual-chevron-left:before{content:\"\\ea3e\"}.ez-icon-dual-chevron-right:before{content:\"\\ea3f\"}.ez-icon-dual-chevron-up:before{content:\"\\ea40\"}.ez-icon-edit-file:before{content:\"\\ea41\"}.ez-icon-edit-table:before{content:\"\\ea42\"}.ez-icon-edit-time:before{content:\"\\ea43\"}.ez-icon-edit-value:before{content:\"\\ea44\"}.ez-icon-edit:before{content:\"\\ea45\"}.ez-icon-email:before{content:\"\\ea46\"}.ez-icon-estorno:before{content:\"\\ea47\"}.ez-icon-exe:before{content:\"\\ea48\"}.ez-icon-expand:before{content:\"\\ea49\"}.ez-icon-expandir_card:before{content:\"\\ea4a\"}.ez-icon-extrato:before{content:\"\\ea4b\"}.ez-icon-eye-off:before{content:\"\\ea4c\"}.ez-icon-eye:before{content:\"\\ea4d\"}.ez-icon-favorite:before{content:\"\\ea4e\"}.ez-icon-figma:before{content:\"\\ea4f\"}.ez-icon-file-download:before{content:\"\\ea50\"}.ez-icon-file-upload:before{content:\"\\ea51\"}.ez-icon-filter:before{content:\"\\ea52\"}.ez-icon-find-file:before{content:\"\\ea53\"}.ez-icon-find-page:before{content:\"\\ea54\"}.ez-icon-format-color-fill:before{content:\"\\ea55\"}.ez-icon-generic:before{content:\"\\ea56\"}.ez-icon-gif:before{content:\"\\ea57\"}.ez-icon-graph_bar:before{content:\"\\ea58\"}.ez-icon-handshake:before{content:\"\\ea59\"}.ez-icon-help-inverted:before{content:\"\\ea5a\"}.ez-icon-help:before{content:\"\\ea5b\"}.ez-icon-hide-list:before{content:\"\\ea5c\"}.ez-icon-hide_menu:before{content:\"\\ea5d\"}.ez-icon-hierarchical-tree:before{content:\"\\ea5e\"}.ez-icon-home:before{content:\"\\ea5f\"}.ez-icon-icons104:before{content:\"\\ea60\"}.ez-icon-image-plus:before{content:\"\\ea61\"}.ez-icon-italic:before{content:\"\\ea62\"}.ez-icon-language:before{content:\"\\ea63\"}.ez-icon-launch:before{content:\"\\ea64\"}.ez-icon-lightbulb:before{content:\"\\ea65\"}.ez-icon-link:before{content:\"\\ea66\"}.ez-icon-list:before{content:\"\\ea67\"}.ez-icon-location:before{content:\"\\ea68\"}.ez-icon-lock-outline:before{content:\"\\ea69\"}.ez-icon-lock:before{content:\"\\ea6a\"}.ez-icon-menu:before{content:\"\\ea6b\"}.ez-icon-mid:before{content:\"\\ea6c\"}.ez-icon-minus:before{content:\"\\ea6d\"}.ez-icon-money-off:before{content:\"\\ea6e\"}.ez-icon-money:before{content:\"\\ea6f\"}.ez-icon-more:before{content:\"\\ea70\"}.ez-icon-mp3:before{content:\"\\ea71\"}.ez-icon-mp4:before{content:\"\\ea72\"}.ez-icon-multiple-files:before{content:\"\\ea73\"}.ez-icon-north-west:before{content:\"\\ea74\"}.ez-icon-number:before{content:\"\\ea75\"}.ez-icon-ordem-ascendente:before{content:\"\\ea76\"}.ez-icon-ordem-descendente:before{content:\"\\ea77\"}.ez-icon-parcelar:before{content:\"\\ea78\"}.ez-icon-pause:before{content:\"\\ea79\"}.ez-icon-payments:before{content:\"\\ea7a\"}.ez-icon-pdf:before{content:\"\\ea7b\"}.ez-icon-play:before{content:\"\\ea7c\"}.ez-icon-plus:before{content:\"\\ea7d\"}.ez-icon-png:before{content:\"\\ea7e\"}.ez-icon-power:before{content:\"\\ea7f\"}.ez-icon-pptx:before{content:\"\\ea80\"}.ez-icon-preview:before{content:\"\\ea81\"}.ez-icon-print:before{content:\"\\ea82\"}.ez-icon-push-pin:before{content:\"\\ea83\"}.ez-icon-rateio:before{content:\"\\ea84\"}.ez-icon-receipt:before{content:\"\\ea85\"}.ez-icon-recolher_card:before{content:\"\\ea86\"}.ez-icon-redo:before{content:\"\\ea87\"}.ez-icon-remove-from-cart:before{content:\"\\ea88\"}.ez-icon-restore:before{content:\"\\ea89\"}.ez-icon-return:before{content:\"\\ea8a\"}.ez-icon-sankhya-place:before{content:\"\\ea8b\"}.ez-icon-save:before{content:\"\\ea8c\"}.ez-icon-search:before{content:\"\\ea8d\"}.ez-icon-settings-inverted:before{content:\"\\ea8e\"}.ez-icon-settings:before{content:\"\\ea8f\"}.ez-icon-share:before{content:\"\\ea90\"}.ez-icon-shield:before{content:\"\\ea91\"}.ez-icon-show-list:before{content:\"\\ea92\"}.ez-icon-show_menu:before{content:\"\\ea93\"}.ez-icon-south-east:before{content:\"\\ea94\"}.ez-icon-sync:before{content:\"\\ea95\"}.ez-icon-table:before{content:\"\\ea96\"}.ez-icon-tag_code:before{content:\"\\ea97\"}.ez-icon-text:before{content:\"\\ea98\"}.ez-icon-timeline:before{content:\"\\ea99\"}.ez-icon-timer-outline:before{content:\"\\ea9a\"}.ez-icon-trending-up:before{content:\"\\ea9b\"}.ez-icon-tune:before{content:\"\\ea9c\"}.ez-icon-txt:before{content:\"\\ea9d\"}.ez-icon-un-pin:before{content:\"\\ea9e\"}.ez-icon-underline:before{content:\"\\ea9f\"}.ez-icon-undo:before{content:\"\\eaa0\"}.ez-icon-unfold_less:before{content:\"\\eaa1\"}.ez-icon-unfold_more:before{content:\"\\eaa2\"}.ez-icon-user-circle:before{content:\"\\eaa3\"}.ez-icon-warning-outline:before{content:\"\\eaa4\"}.ez-icon-warning_triangle:before{content:\"\\eaa5\"}.ez-icon-whatshot:before{content:\"\\eaa6\"}.ez-icon-xlsx:before{content:\"\\eaa7\"}.ez-icon-zip:before{content:\"\\eaa8\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
5
5
 
6
6
  const EzIcon = class {
7
7
  constructor(hostRef) {
@@ -0,0 +1,286 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './index-baa5e267.js';
2
+ import { a as RICH_TOOLBAR_COMMANDS, b as RICH_TOOLBAR_COMMAND_TITLE, c as RICH_TOOLBAR_COMMAND_ICON, R as RICH_TOOLBAR_FORMAT_TAGS } from './RichToolbarHelper-fd6427df.js';
3
+
4
+ const ezLinkBuilderCss = ".link-builder-container.sc-ez-link-builder{font-family:'Roboto';color:#2b3a54;display:flex;flex-direction:column;gap:10px;justify-content:space-between}.header.sc-ez-link-builder{display:flex;font-weight:500;font-size:16px}.actions.sc-ez-link-builder{display:flex;justify-content:flex-end;gap:12px;margin-top:12px;width:100%}";
5
+
6
+ const EzLinkBuilder = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.executeToolbarCommand = createEvent(this, "executeToolbarCommand", 7);
10
+ this.textToShow = undefined;
11
+ this.link = undefined;
12
+ this.openInNewGuide = false;
13
+ }
14
+ async show(text) {
15
+ this._popupElement.opened = true;
16
+ if (text) {
17
+ this.textToShow = text;
18
+ }
19
+ }
20
+ async hide() {
21
+ this._popupElement.opened = false;
22
+ }
23
+ async handleCancel() {
24
+ this.clearValues();
25
+ this.executeToolbarCommand.emit({ command: RICH_TOOLBAR_COMMANDS.FOCUS });
26
+ await this.hide();
27
+ }
28
+ clearValues() {
29
+ this.link = '';
30
+ this.textToShow = '';
31
+ this.openInNewGuide = false;
32
+ }
33
+ async handleCreateLink() {
34
+ const tag = `<a href="${this.link}" ${this.openInNewGuide ? 'target="_blank" rel="noopener noreferrer"' : ''}>${this.textToShow ? this.textToShow : this.link}</a>`;
35
+ this.executeToolbarCommand.emit({ command: RICH_TOOLBAR_COMMANDS.FORMAT, value: tag });
36
+ this.clearValues();
37
+ await this.hide();
38
+ }
39
+ async handleActionPopup(event) {
40
+ if (event.detail === 'OK') {
41
+ await this.handleCreateLink();
42
+ return;
43
+ }
44
+ if (event.detail === 'CANCEL' || event.detail === 'CLOSE') {
45
+ await this.handleCancel();
46
+ }
47
+ }
48
+ getOkButtonStatus() {
49
+ var _a;
50
+ return ((_a = this.link) === null || _a === void 0 ? void 0 : _a.trim()) ? 'ENABLED' : 'DISABLED';
51
+ }
52
+ render() {
53
+ return (h("ez-popup", { heightMode: 'auto', size: 'small', useHeader: false, ref: ref => this._popupElement = ref, onEzClosePopup: () => this.clearValues() }, h("div", null, h("ez-modal-container", { modalTitle: "Adicionar link", modalSubTitle: "Insira um link no texto para abrir novas p\u00E1ginas.", okButtonLabel: "Enviar", cancelButtonLabel: "Cancelar", onEzModalAction: this.handleActionPopup.bind(this), okButtonStatus: this.getOkButtonStatus() }, h("div", { class: 'link-builder-container' }, h("ez-text-input", { id: 'link_url_input', label: 'Insira a URL destino', value: this.link, onEzChange: (e) => this.link = e.detail }), h("ez-text-input", { id: 'link_text_input', label: 'Insira o texto a ser exibido', value: this.textToShow, onEzChange: (e) => this.textToShow = e.detail }), h("ez-check", { label: 'Abrir em uma nova página.', value: this.openInNewGuide, onEzChange: (e) => this.openInNewGuide = e.detail }))))));
54
+ }
55
+ };
56
+ EzLinkBuilder.style = ezLinkBuilderCss;
57
+
58
+ const ezRichToolbarCss = ".sc-ez-rich-toolbar-h{display:block;width:100%}.taskbar.sc-ez-rich-toolbar{display:flex;padding:8px;border-radius:4px 4px 0 0}.taskbar-group.sc-ez-rich-toolbar{display:flex;margin-right:15px;padding-right:15px;border-right:1px solid #ddd}.taskbar-group.sc-ez-rich-toolbar:last-child{border-right:none}.preview-btn.sc-ez-rich-toolbar{font-family:Roboto;font-size:14px;background:none;display:flex;align-items:center;padding:0 8px;border-radius:4px;cursor:pointer;color:var(--color--secondary, #383c45);transition:0.3s all ease-in-out;width:110px;justify-content:center}.preview-btn.sc-ez-rich-toolbar:hover{background-color:#f5f5f5}";
59
+
60
+ const EzRichToolbar = class {
61
+ constructor(hostRef) {
62
+ registerInstance(this, hostRef);
63
+ this.executeToolbarCommand = createEvent(this, "executeToolbarCommand", 7);
64
+ this.showPreview = true;
65
+ this.isPreviewMode = false;
66
+ this.showConfigs = true;
67
+ this.showTextFormat = true;
68
+ this.showUndoRedo = true;
69
+ }
70
+ handleActionTriggered(event) {
71
+ this.executeToolbarCommand.emit({ command: event.detail.command, value: event.detail.value });
72
+ }
73
+ handleClickPreview() {
74
+ this.executeToolbarCommand.emit({ command: RICH_TOOLBAR_COMMANDS.PREVIEW });
75
+ }
76
+ renderArrows() {
77
+ if (!this.showUndoRedo)
78
+ return;
79
+ return (h("div", { id: "rich-toolbar-undo-redo", class: "taskbar-group" }, h("ez-rich-toolbar-arrows", null)));
80
+ }
81
+ renderLetters() {
82
+ if (!this.showTextFormat)
83
+ return;
84
+ return (h("div", { id: "rich-toolbar-text-format", class: "taskbar-group" }, h("ez-rich-toolbar-letters", null)));
85
+ }
86
+ renderConfigs() {
87
+ if (!this.showConfigs)
88
+ return;
89
+ return (h("div", { id: "rich-toolbar-options-configs", class: "taskbar-group" }, h("ez-rich-toolbar-configs", null)));
90
+ }
91
+ renderPreview() {
92
+ if (!this.showPreview)
93
+ return;
94
+ return (h("div", { class: "taskbar-group" }, h("span", { id: 'rich-text-preview-btn', class: "preview-btn", title: this.getPreviewTitle(), onClick: this.handleClickPreview.bind(this) }, this.isPreviewMode ? 'Editar' : 'Pré-visualizar')));
95
+ }
96
+ getPreviewTitle() {
97
+ return this.isPreviewMode
98
+ ? RICH_TOOLBAR_COMMAND_TITLE.EDIT
99
+ : RICH_TOOLBAR_COMMAND_TITLE.PREVIEW;
100
+ }
101
+ render() {
102
+ return (h(Host, null, h("div", { class: "taskbar" }, this.renderPreview(), this.renderArrows(), this.renderLetters(), this.renderConfigs())));
103
+ }
104
+ };
105
+ EzRichToolbar.style = ezRichToolbarCss;
106
+
107
+ const ezRichToolbarArrowsCss = ".sc-ez-rich-toolbar-arrows-h{display:flex;gap:5px}";
108
+
109
+ const EzRichToolbarArrows = class {
110
+ constructor(hostRef) {
111
+ registerInstance(this, hostRef);
112
+ }
113
+ render() {
114
+ return (h(Host, null, h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.UNDO, command: RICH_TOOLBAR_COMMANDS.UNDO, title: RICH_TOOLBAR_COMMAND_TITLE.UNDO }), h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.REDO, command: RICH_TOOLBAR_COMMANDS.REDO, title: RICH_TOOLBAR_COMMAND_TITLE.REDO })));
115
+ }
116
+ };
117
+ EzRichToolbarArrows.style = ezRichToolbarArrowsCss;
118
+
119
+ const ezRichToolbarConfigsCss = ".sc-ez-rich-toolbar-configs-h{display:flex;gap:5px}";
120
+
121
+ const EzRichToolbarConfigs = class {
122
+ constructor(hostRef) {
123
+ registerInstance(this, hostRef);
124
+ }
125
+ render() {
126
+ return (h(Host, null, h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.LIST, command: RICH_TOOLBAR_COMMANDS.FORMAT, value: RICH_TOOLBAR_FORMAT_TAGS.LIST, title: RICH_TOOLBAR_COMMAND_TITLE.LIST }), h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.IMAGE, command: RICH_TOOLBAR_COMMANDS.IMAGE, title: RICH_TOOLBAR_COMMAND_TITLE.IMAGE }), h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.LINK, command: RICH_TOOLBAR_COMMANDS.LINK, title: RICH_TOOLBAR_COMMAND_TITLE.LINK })));
127
+ }
128
+ };
129
+ EzRichToolbarConfigs.style = ezRichToolbarConfigsCss;
130
+
131
+ const ezRichToolbarLettersCss = ".sc-ez-rich-toolbar-letters-h{display:flex;gap:5px}";
132
+
133
+ const EzRichToolbarLetters = class {
134
+ constructor(hostRef) {
135
+ registerInstance(this, hostRef);
136
+ }
137
+ render() {
138
+ return (h(Host, null, h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.BOLD, command: RICH_TOOLBAR_COMMANDS.FORMAT, value: RICH_TOOLBAR_FORMAT_TAGS.BOLD, title: RICH_TOOLBAR_COMMAND_TITLE.BOLD }), h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.ITALIC, command: RICH_TOOLBAR_COMMANDS.FORMAT, value: RICH_TOOLBAR_FORMAT_TAGS.ITALIC, title: RICH_TOOLBAR_COMMAND_TITLE.ITALIC }), h("ez-rich-toolbar-item", { icon: RICH_TOOLBAR_COMMAND_ICON.UNDERLINE, command: RICH_TOOLBAR_COMMANDS.FORMAT, value: RICH_TOOLBAR_FORMAT_TAGS.UNDERLINE, title: RICH_TOOLBAR_COMMAND_TITLE.UNDERLINE })));
139
+ }
140
+ };
141
+ EzRichToolbarLetters.style = ezRichToolbarLettersCss;
142
+
143
+ function formatBytes(bytes, decimals = 1) {
144
+ if (bytes === 0) {
145
+ return "0 Bytes";
146
+ }
147
+ const k = 1024;
148
+ const dm = decimals < 0 ? 0 : decimals;
149
+ const sizes = ["Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Petabytes", "Exabytes", "Zettabytes", "Yottabytes"];
150
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
151
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
152
+ }
153
+
154
+ function fileToBase64(file) {
155
+ return new Promise((resolve, reject) => {
156
+ try {
157
+ const reader = new FileReader();
158
+ reader.onload = () => {
159
+ resolve(reader.result);
160
+ };
161
+ reader.readAsDataURL(file);
162
+ }
163
+ catch (error) {
164
+ reject(error);
165
+ }
166
+ });
167
+ }
168
+
169
+ const ezSimpleImageUploaderCss = ".image-uploader-container.sc-ez-simple-image-uploader{font-family:\"Roboto\";color:#2b3a54;display:flex;flex-direction:column;gap:var(--space--10, 10px);justify-content:space-between;align-items:center;padding-bottom:var(--space--8, 8px)}.header.sc-ez-simple-image-uploader{display:flex;font-weight:500;font-size:var(--font-size--medium, 16px)}.actions.sc-ez-simple-image-uploader{display:flex;justify-content:flex-end;gap:var(--space--12, 12px);margin-top:var(--space--12, 12px);width:100%}.drop-zone-section.sc-ez-simple-image-uploader{width:100%}.drop-zone.sc-ez-simple-image-uploader{display:flex;flex-wrap:wrap;background-color:var(--color--petroleum-70, #F4F6F9);padding:var(--space--6, 6px);width:100%;border-radius:var(--space--12, 12px);box-sizing:border-box;min-height:100px}.clickable.sc-ez-simple-image-uploader{cursor:pointer}.dragging.sc-ez-simple-image-uploader{background-color:var(--color--petroleum-100, #C8CCD3)}.drop-zone-container.sc-ez-simple-image-uploader{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:6px;box-sizing:border-box}.text-error.sc-ez-simple-image-uploader{font-family:var(--font--pattern, \"Roboto\");color:var(--color--red-600, #BD0025);font-size:var(--font-size--small, 12px)}.button-close.sc-ez-simple-image-uploader{border:none;background:none;cursor:pointer}";
170
+
171
+ const EzSimpleImageUploader = class {
172
+ constructor(hostRef) {
173
+ registerInstance(this, hostRef);
174
+ this.executeToolbarCommand = createEvent(this, "executeToolbarCommand", 7);
175
+ this.link = undefined;
176
+ this.base64 = undefined;
177
+ this.messageError = undefined;
178
+ this.selectedFile = undefined;
179
+ this.maxSize = 500;
180
+ }
181
+ /**
182
+ * Método responsável pela abertura do popup.
183
+ */
184
+ async show() {
185
+ this._popupElement.opened = true;
186
+ }
187
+ /**
188
+ * Método responsável pelo fechamento do popup.
189
+ */
190
+ async hide() {
191
+ this._popupElement.opened = false;
192
+ }
193
+ async handleCancel() {
194
+ this.removeSelectedFile();
195
+ this.executeToolbarCommand.emit({ command: RICH_TOOLBAR_COMMANDS.FOCUS });
196
+ await this.hide();
197
+ }
198
+ removeSelectedFile(event) {
199
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
200
+ this.link = undefined;
201
+ this.base64 = undefined;
202
+ this.selectedFile = undefined;
203
+ this.messageError = undefined;
204
+ }
205
+ triggerFileSelect() {
206
+ if (!this.selectedFile) {
207
+ this._fileInput.click();
208
+ }
209
+ }
210
+ async handleImage(files) {
211
+ const file = files && files[0];
212
+ if (!file) {
213
+ return;
214
+ }
215
+ if (file.size < (this.maxSize * 1000)) {
216
+ this.selectedFile = file;
217
+ this.base64 = await fileToBase64(file);
218
+ }
219
+ else {
220
+ this.messageError = `A imagem deve ter menos de ${formatBytes(this.maxSize)}.`;
221
+ }
222
+ }
223
+ getFileList(event) {
224
+ if (event instanceof DragEvent) {
225
+ return Array.from(event.dataTransfer.files);
226
+ }
227
+ else {
228
+ const input = event.target;
229
+ return input.files;
230
+ }
231
+ }
232
+ handleFileChange(event) {
233
+ event.preventDefault();
234
+ this.messageError = undefined;
235
+ this._dropZone.classList.remove("dragging");
236
+ const files = this.getFileList(event);
237
+ this.handleImage(files);
238
+ const input = event.target;
239
+ input.value = "";
240
+ }
241
+ handleDragOver(event) {
242
+ event.stopPropagation();
243
+ event.preventDefault();
244
+ }
245
+ handleDragEnter(event) {
246
+ event.preventDefault();
247
+ this._dropZone.classList.add("dragging");
248
+ }
249
+ handleDragLeave(event) {
250
+ event.preventDefault();
251
+ if (!this._dropZone.contains(event.relatedTarget)) {
252
+ this._dropZone.classList.remove("dragging");
253
+ }
254
+ }
255
+ async handleActionPopup(event) {
256
+ if (event.detail === "OK") {
257
+ await this.handleCreateImgTag();
258
+ }
259
+ else if (event.detail === "CANCEL" || event.detail === "CLOSE") {
260
+ await this.handleCancel();
261
+ }
262
+ }
263
+ async handleCreateImgTag() {
264
+ var _a;
265
+ const tag = `<img src="${(_a = this.base64) !== null && _a !== void 0 ? _a : this.link}" alt="Image" />`;
266
+ this.executeToolbarCommand.emit({ command: RICH_TOOLBAR_COMMANDS.FORMAT, value: tag });
267
+ this.removeSelectedFile();
268
+ await this.hide();
269
+ }
270
+ getOkButtonStatus() {
271
+ var _a;
272
+ return (!this.base64 && !((_a = this.link) === null || _a === void 0 ? void 0 : _a.trim())) ? 'DISABLED' : 'ENABLED';
273
+ }
274
+ render() {
275
+ return (h("ez-popup", { ref: ref => this._popupElement = ref, heightMode: "auto", size: "small", useHeader: false, onEzClosePopup: () => this.handleCancel() }, h("div", null, h("ez-modal-container", { modalTitle: "Upload de imagens", modalSubTitle: "Envie seus arquivos preenchendo apenas 1 campo por vez.", okButtonLabel: "Enviar", cancelButtonLabel: "Cancelar", onEzModalAction: this.handleActionPopup.bind(this), okButtonStatus: this.getOkButtonStatus() }, h("div", { class: "image-uploader-container" }, h("ez-tooltip", { message: "O arquivo selecionado abaixo ser\u00E1 priorizado!", active: !!this.selectedFile }, h("ez-text-input", { label: "Insira a URL da imagem", value: this.link, onEzChange: (e) => this.link = e.detail, enabled: !this.selectedFile })), h("span", null, "OU"), h("section", { class: "drop-zone-section" }, h("div", { ref: (ref) => this._dropZone = ref, class: "drop-zone", onDrop: (ev) => this.handleFileChange(ev), onDragOver: (ev) => this.handleDragOver(ev), onDragEnter: (ev) => this.handleDragEnter(ev), onDragLeave: (ev) => this.handleDragLeave(ev) }, h("div", { class: {
276
+ "drop-zone-container": true,
277
+ "clickable": !this.selectedFile,
278
+ }, onClick: () => this.triggerFileSelect() }, !!this.selectedFile ?
279
+ h(Fragment, null, h("span", { class: "ez-text ez-text--primary ez-text--medium" }, this.selectedFile.name, " (", formatBytes(this.selectedFile.size), ")"), h("button", { class: "button-close", onClick: (event) => this.removeSelectedFile(event), title: "Remover arquivo" }, h("ez-icon", { iconName: "close" })))
280
+ :
281
+ h(Fragment, null, h("ez-icon", { iconName: "anexo" }), h("span", { class: "ez-text ez-text--primary ez-text--medium" }, "Arraste e solte ou clique para adicionar arquivos"))), h("input", { ref: (el) => this._fileInput = el, type: "file", accept: "image/*", style: { display: "none" }, onChange: (ev) => this.handleFileChange(ev) })), !!this.messageError && h("span", { class: "text-error" }, this.messageError)))))));
282
+ }
283
+ };
284
+ EzSimpleImageUploader.style = ezSimpleImageUploaderCss;
285
+
286
+ export { EzLinkBuilder as ez_link_builder, EzRichToolbar as ez_rich_toolbar, EzRichToolbarArrows as ez_rich_toolbar_arrows, EzRichToolbarConfigs as ez_rich_toolbar_configs, EzRichToolbarLetters as ez_rich_toolbar_letters, EzSimpleImageUploader as ez_simple_image_uploader };
@@ -18,7 +18,7 @@ var ModalButtonStatus;
18
18
  })(ModalButtonStatus || (ModalButtonStatus = {}));
19
19
  const ModalButtonStatus$1 = ModalButtonStatus;
20
20
 
21
- const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:hidden;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x);outline:none}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none;outline:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
21
+ const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:hidden;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between;align-items:start}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x);outline:none}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none;outline:none;padding:var(--space--6, 6px) 0px}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
22
22
 
23
23
  const EzModalContainer = class {
24
24
  constructor(hostRef) {
@@ -0,0 +1,23 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-baa5e267.js';
2
+
3
+ const ezRichToolbarItemCss = "ez-icon.sc-ez-rich-toolbar-item{--ez-icon--color:var(--color--secondary, #383c45)}.rich-toolbar-item.sc-ez-rich-toolbar-item{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;border-radius:4px;cursor:pointer;transition:0.3s all ease-in-out}.rich-toolbar-item.sc-ez-rich-toolbar-item:hover{background-color:#f5f5f5}";
4
+
5
+ const EzRichToolbarItem = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.actionTriggered = createEvent(this, "actionTriggered", 7);
9
+ this.icon = undefined;
10
+ this.command = undefined;
11
+ this.title = undefined;
12
+ this.value = undefined;
13
+ }
14
+ async triggerAction() {
15
+ this.actionTriggered.emit({ command: this.command, value: this.value });
16
+ }
17
+ render() {
18
+ return (h("div", { id: `rich-toolbar-item-${this.icon}`, class: `rich-toolbar-item`, title: this.title, onClick: this.triggerAction.bind(this) }, h("ez-icon", { class: 'toolbar-item', iconName: this.icon })));
19
+ }
20
+ };
21
+ EzRichToolbarItem.style = ezRichToolbarItemCss;
22
+
23
+ export { EzRichToolbarItem as ez_rich_toolbar_item };