@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-77074.0 → 0.0.0-bugfix-dev-KB-75047.0

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 (144) hide show
  1. package/dist/cjs/{SnkMessageBuilder-7691a2c1.js → SnkMessageBuilder-bae64d0d.js} +0 -10
  2. package/dist/cjs/index-f9e81701.js +0 -8
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  5. package/dist/cjs/snk-actions-button_4.cjs.entry.js +25 -22
  6. package/dist/cjs/snk-application.cjs.entry.js +18 -2
  7. package/dist/cjs/snk-config-options_3.cjs.entry.js +17 -5
  8. package/dist/cjs/snk-crud.cjs.entry.js +8 -2
  9. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  10. package/dist/cjs/{snk-data-unit-7dbdad0e.js → snk-data-unit-3d9b6ed4.js} +26 -14
  11. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +9 -0
  14. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -1
  15. package/dist/cjs/snk-grid.cjs.entry.js +10 -2
  16. package/dist/cjs/{snk-guides-viewer-eee43c8b.js → snk-guides-viewer-2139481c.js} +1 -1
  17. package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -4
  19. package/dist/cjs/snk-taskbar.cjs.entry.js +40 -37
  20. package/dist/collection/collection-manifest.json +0 -3
  21. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
  22. package/dist/collection/components/snk-application/snk-application.js +41 -1
  23. package/dist/collection/components/snk-crud/snk-crud.js +26 -2
  24. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  25. package/dist/collection/components/snk-data-unit/snk-data-unit.js +25 -13
  26. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +2 -1
  27. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +8 -0
  28. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +5 -1
  29. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +20 -0
  30. package/dist/collection/components/snk-form-config/snk-form-config.js +17 -5
  31. package/dist/collection/components/snk-grid/snk-grid.js +28 -2
  32. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +25 -4
  33. package/dist/collection/components/snk-taskbar/snk-taskbar.js +41 -38
  34. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +7 -1
  35. package/dist/collection/lib/message/SnkMessageBuilder.js +0 -2
  36. package/dist/components/SnkMessageBuilder.js +0 -10
  37. package/dist/components/index.d.ts +0 -3
  38. package/dist/components/index.js +0 -3
  39. package/dist/components/snk-actions-button2.js +27 -26
  40. package/dist/components/snk-application2.js +19 -2
  41. package/dist/components/snk-crud.js +9 -2
  42. package/dist/components/snk-data-unit2.js +25 -13
  43. package/dist/components/snk-detail-view2.js +1 -1
  44. package/dist/components/snk-filter-bar2.js +6 -0
  45. package/dist/components/snk-filter-item2.js +5 -1
  46. package/dist/components/snk-filter-text.js +2 -1
  47. package/dist/components/snk-form-config2.js +17 -5
  48. package/dist/components/snk-grid2.js +11 -2
  49. package/dist/components/snk-simple-crud2.js +8 -4
  50. package/dist/components/snk-taskbar2.js +41 -38
  51. package/dist/esm/{SnkMessageBuilder-7ace6803.js → SnkMessageBuilder-6fff4a4c.js} +0 -10
  52. package/dist/esm/index-a7d3d3f1.js +0 -8
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/esm/sankhyablocks.js +1 -1
  55. package/dist/esm/snk-actions-button_4.entry.js +26 -23
  56. package/dist/esm/snk-application.entry.js +19 -3
  57. package/dist/esm/snk-config-options_3.entry.js +17 -5
  58. package/dist/esm/snk-crud.entry.js +8 -2
  59. package/dist/esm/snk-data-exporter.entry.js +2 -2
  60. package/dist/esm/{snk-data-unit-7a579dbd.js → snk-data-unit-9fa7d2b9.js} +26 -14
  61. package/dist/esm/snk-data-unit.entry.js +2 -2
  62. package/dist/esm/snk-detail-view.entry.js +2 -2
  63. package/dist/esm/snk-filter-bar_4.entry.js +10 -1
  64. package/dist/esm/snk-filter-text.entry.js +2 -1
  65. package/dist/esm/snk-grid.entry.js +10 -2
  66. package/dist/esm/{snk-guides-viewer-e8ca764a.js → snk-guides-viewer-b7ed39eb.js} +1 -1
  67. package/dist/esm/snk-guides-viewer.entry.js +1 -1
  68. package/dist/esm/snk-simple-crud.entry.js +7 -4
  69. package/dist/esm/snk-taskbar.entry.js +41 -38
  70. package/dist/sankhyablocks/{p-f4e221b2.entry.js → p-0d2a2e9e.entry.js} +1 -1
  71. package/dist/sankhyablocks/p-17425c72.js +1 -0
  72. package/dist/sankhyablocks/p-1d3ce0d9.entry.js +1 -0
  73. package/dist/sankhyablocks/p-342eeb3b.js +1 -0
  74. package/dist/sankhyablocks/p-3728d2aa.entry.js +11 -0
  75. package/dist/sankhyablocks/{p-42130213.entry.js → p-4138da61.entry.js} +1 -1
  76. package/dist/sankhyablocks/p-4e1f992e.entry.js +1 -0
  77. package/dist/sankhyablocks/p-619aeac8.entry.js +1 -0
  78. package/dist/sankhyablocks/{p-00f9fe5c.entry.js → p-7075b789.entry.js} +1 -1
  79. package/dist/sankhyablocks/p-83e71703.entry.js +1 -0
  80. package/dist/sankhyablocks/p-89c92727.entry.js +1 -0
  81. package/dist/sankhyablocks/p-a3fadd0b.entry.js +1 -0
  82. package/dist/sankhyablocks/p-af7f7b3e.entry.js +1 -0
  83. package/dist/sankhyablocks/{p-b389ed49.entry.js → p-e390641b.entry.js} +1 -1
  84. package/dist/sankhyablocks/{p-e3a285a2.js → p-e97be1c8.js} +1 -1
  85. package/dist/sankhyablocks/p-ec43fcc8.entry.js +1 -0
  86. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  87. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
  88. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
  89. package/dist/types/components/snk-application/snk-application.d.ts +6 -1
  90. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  91. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +7 -0
  92. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  93. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  94. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  95. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +2 -0
  96. package/dist/types/components.d.ts +31 -393
  97. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  98. package/package.json +1 -1
  99. package/react/components.d.ts +0 -3
  100. package/react/components.js +0 -3
  101. package/react/components.js.map +1 -1
  102. package/dist/cjs/input-distinct-search_2.cjs.entry.js +0 -469
  103. package/dist/cjs/snk-distinct-search.cjs.entry.js +0 -123
  104. package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +0 -4
  105. package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +0 -372
  106. package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +0 -109
  107. package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +0 -542
  108. package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +0 -27
  109. package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +0 -600
  110. package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +0 -13
  111. package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +0 -25
  112. package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +0 -9
  113. package/dist/components/filter-distinct-search.js +0 -15
  114. package/dist/components/input-distinct-search.d.ts +0 -11
  115. package/dist/components/input-distinct-search.js +0 -6
  116. package/dist/components/input-distinct-search2.js +0 -262
  117. package/dist/components/search-modal.d.ts +0 -11
  118. package/dist/components/search-modal.js +0 -6
  119. package/dist/components/search-modal2.js +0 -264
  120. package/dist/components/snk-distinct-search.d.ts +0 -11
  121. package/dist/components/snk-distinct-search.js +0 -163
  122. package/dist/esm/input-distinct-search_2.entry.js +0 -464
  123. package/dist/esm/snk-distinct-search.entry.js +0 -119
  124. package/dist/sankhyablocks/p-0e250436.entry.js +0 -1
  125. package/dist/sankhyablocks/p-154aa2a6.entry.js +0 -11
  126. package/dist/sankhyablocks/p-18cb1acb.entry.js +0 -1
  127. package/dist/sankhyablocks/p-1dbd5c18.entry.js +0 -1
  128. package/dist/sankhyablocks/p-2aae03a1.entry.js +0 -1
  129. package/dist/sankhyablocks/p-30ebcbe0.entry.js +0 -1
  130. package/dist/sankhyablocks/p-37074cc3.entry.js +0 -1
  131. package/dist/sankhyablocks/p-3858a2e4.entry.js +0 -1
  132. package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
  133. package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
  134. package/dist/sankhyablocks/p-c75fae8e.js +0 -1
  135. package/dist/sankhyablocks/p-d8665750.js +0 -1
  136. package/dist/sankhyablocks/p-f0aaad2b.entry.js +0 -1
  137. package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +0 -83
  138. package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +0 -105
  139. package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +0 -126
  140. package/dist/types/components/snk-distinct-search/types/index.d.ts +0 -8
  141. package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +0 -3
  142. package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +0 -6
  143. package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +0 -2
  144. /package/dist/collection/components/{snk-distinct-search/types → snk-actions-button/interfaces}/index.js +0 -0
@@ -1,600 +0,0 @@
1
- import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
2
- import { Host, h } from '@stencil/core';
3
- import { KeyboardManager } from '@sankhyalabs/core';
4
- import { filterItems, getMatchOption, normalizeString } from '../../utils/filter-distinct-search';
5
- export class SearchModal {
6
- constructor() {
7
- this._searchFocus = false;
8
- this.debounceTimeout = null;
9
- this.filteredItems = [];
10
- this.application = undefined;
11
- this.listItens = [];
12
- this.opened = false;
13
- this.value = undefined;
14
- this.canShowError = false;
15
- this.emptyMessage = undefined;
16
- this.debounceTime = 300;
17
- this.maxItens = 100;
18
- this.label = 'Pesquisar';
19
- this.mode = 'regular';
20
- this.restrict = undefined;
21
- this.errorMessage = undefined;
22
- }
23
- /**
24
- * Método para adicionar a nova palavra e chamar o método closeModal() para fechar o modal
25
- */
26
- addNewItem() {
27
- this.closeModal();
28
- this.changeValue.emit({ isNewItem: true, value: this.value });
29
- }
30
- /**
31
- * Método para limpa o campo de entrada de pesquisa
32
- */
33
- clearInput() {
34
- this._refFilterInput.setValue("");
35
- }
36
- /**
37
- * Método para fechar o modal
38
- */
39
- closeModal() {
40
- this._popupElement.opened = false;
41
- this.popupClose.emit(false);
42
- }
43
- /**
44
- * Método para abrir o modal
45
- */
46
- openModal() {
47
- this._popupElement.opened = true;
48
- setTimeout(() => this.setFocus(), 100);
49
- }
50
- /**
51
- * Retorna se o conteúdo é inválido.
52
- */
53
- isInvalid() {
54
- this._refFilterInput.isInvalid();
55
- }
56
- /**
57
- * Remove o foco do campo
58
- */
59
- async setBlur() {
60
- this._searchFocus = false;
61
- }
62
- /**
63
- * Aplica o foco do campo
64
- */
65
- async setFocus() {
66
- this._searchFocus = true;
67
- await this._refFilterInput.setFocus();
68
- }
69
- /**
70
- * Método para tratar a mensagem de erro
71
- */
72
- watchPropErrorMessage() {
73
- this._refFilterInput.errorMessage = this.errorMessage;
74
- }
75
- /**
76
- * Método para tratar o value do input
77
- */
78
- watchPropValue() {
79
- this._refFilterInput.value = this.value;
80
- }
81
- /**
82
- * Atualiza a lista de itens à medida que o usuário digita no campo de pesquisa.
83
- */
84
- async handleInput(event) {
85
- var _a;
86
- if (this.debounceTimeout) {
87
- clearTimeout(this.debounceTimeout);
88
- }
89
- this.value = event.detail;
90
- await ((_a = this._refList) === null || _a === void 0 ? void 0 : _a.removeSelection());
91
- this.debounceTimeout = setTimeout(() => {
92
- this.filteredItems = filterItems(event.detail, this.listItens, this.maxItens);
93
- }, this.debounceTime);
94
- }
95
- initializeComponent() {
96
- this.filteredItems = this.listItens;
97
- }
98
- getMessage(key) {
99
- return this.application.messagesBuilder.getMessage(key, null);
100
- }
101
- componentWillLoad() {
102
- this.initializeComponent();
103
- }
104
- componentDidLoad() {
105
- this.bindKeyboardManager();
106
- this._refFilterInput.value = this.value;
107
- this.filteredItems = filterItems(this.value, this.listItens, this.maxItens);
108
- }
109
- disconnectedCallback() {
110
- this.unbindKeyboardManager();
111
- }
112
- buildItems() {
113
- var _a;
114
- const items = (_a = this.filteredItems) === null || _a === void 0 ? void 0 : _a.map((item) => ({
115
- label: item,
116
- id: normalizeString(item),
117
- }));
118
- return items;
119
- }
120
- async tabSelect() {
121
- var _a;
122
- const selectedValue = await this._refList.getSelection();
123
- if (this._searchFocus) {
124
- await this.setBlur();
125
- await this.selectFirstItem();
126
- }
127
- else if (selectedValue) {
128
- await ((_a = this._refList) === null || _a === void 0 ? void 0 : _a.removeSelection());
129
- await this._refButton.setFocus();
130
- }
131
- else {
132
- await this._refButton.setBlur();
133
- await this.setFocus();
134
- }
135
- }
136
- bindKeyboardManager() {
137
- this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
138
- this._keyboardManager
139
- .bind("ArrowDown", () => { this.selectNextItem(); })
140
- .bind("ArrowUp", () => { this.selectPreviousItem(); })
141
- .bind("Enter", () => { this.setSelectedValue(); })
142
- .bind("Tab", () => { this.tabSelect(); });
143
- }
144
- unbindKeyboardManager() {
145
- this._keyboardManager
146
- .unbind("ArrowDown")
147
- .unbind("ArrowUp")
148
- .unbind("Enter")
149
- .unbind("Tab");
150
- }
151
- async setSelectedValue() {
152
- var _a;
153
- const selectedValue = await ((_a = this._refList) === null || _a === void 0 ? void 0 : _a.getSelection());
154
- if (selectedValue) {
155
- this.changeValue.emit({ isNewItem: false, value: selectedValue.label });
156
- this.closeModal();
157
- }
158
- else if (this.enabledButtonNewItem()) {
159
- this.addNewItem();
160
- }
161
- }
162
- async selectNextItem() {
163
- var _a;
164
- if (this._searchFocus) {
165
- this.setBlur();
166
- }
167
- if (!this._refList) {
168
- await this._refButton.setFocus();
169
- return;
170
- }
171
- await ((_a = this._refList) === null || _a === void 0 ? void 0 : _a.selectNextItem());
172
- }
173
- async selectPreviousItem() {
174
- var _a;
175
- const itemSelected = await ((_a = this._refList) === null || _a === void 0 ? void 0 : _a.getSelection());
176
- if (!itemSelected) {
177
- return;
178
- }
179
- if (itemSelected.label === this.filteredItems[0]) {
180
- await this._refList.removeSelection();
181
- await this._refFilterInput.setFocus();
182
- return;
183
- }
184
- await this._refList.selectPreviousItem();
185
- }
186
- async selectFirstItem() {
187
- var _a;
188
- if (!this.filteredItems.length) {
189
- await ((_a = this._refList) === null || _a === void 0 ? void 0 : _a.removeSelection());
190
- return;
191
- }
192
- const firstItem = this.filteredItems[0];
193
- await this._refList.setSelection({
194
- id: normalizeString(firstItem),
195
- label: firstItem,
196
- });
197
- }
198
- enabledButtonNewItem() {
199
- if (this.value === undefined)
200
- return false;
201
- if (getMatchOption(this.value, this.listItens))
202
- return false;
203
- return this.value.trim().length === 0 ? false : true;
204
- }
205
- async handleActionPopUp({ detail }) {
206
- if (detail === "OK") {
207
- await this.setSelectedValue();
208
- }
209
- }
210
- render() {
211
- var _a;
212
- return (h(Host, null, h("ez-popup", { ref: (ref) => this._popupElement = ref, size: "x-small", "ez-title": this.label, onEzClosePopup: () => this.popupClose.emit(false), "height-mode": "auto", onEzPopupAction: this.handleActionPopUp.bind(this) }, h("div", null, h("ez-filter-input", { ref: (ref) => this._refFilterInput = ref, label: "Pesquisar", onEzChange: this.handleInput.bind(this), onBlur: () => this._searchFocus = false, onEzFocusIn: () => this._searchFocus = true, errorMessage: this.errorMessage, canShowError: this.canShowError, mode: this.mode, value: this.value, restrict: this.restrict }), this.buildItems().length === 0 ? (h("div", { class: "ez-content" }, h("div", { class: "ez-text--center search-modal-text" }, this.emptyMessage))) : (h("div", null, h("div", { class: "search-modal-text ez-padding-vertical--medium" }, this.listItens.length > this.maxItens ? this.getMessage("snkDistinctSearch.limitResult") :
213
- this.buildItems().length, " ", this.buildItems().length > 1 ? this.getMessage("snkDistinctSearch.availableResults") : this.getMessage("snkDistinctSearch.availableResult")), h("ez-scroller", { class: "search-modal-scroller", direction: EzScrollDirection.VERTICAL }, h("ez-list", { ref: (ref) => this._refList = ref, dataSource: this.buildItems(), onEzClickItem: ({ label }) => this.setSelectedValue.bind(this)(label), ezSelectable: true, hoverFeedback: true, disableShortcuts: true })))), h("div", { class: "ez-flex ez-flex--justify-end" }, h("ez-button", { ref: (ref) => this._refButton = ref, class: "ez-button--tertiary", enabled: this.enabledButtonNewItem(), label: `${this.getMessage("snkDistinctSearch.titleAdd")} ${(_a = this.label) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()}`, onClick: () => this.addNewItem() }))))));
214
- }
215
- static get is() { return "search-modal"; }
216
- static get encapsulation() { return "scoped"; }
217
- static get originalStyleUrls() {
218
- return {
219
- "$": ["search-modal.css"]
220
- };
221
- }
222
- static get styleUrls() {
223
- return {
224
- "$": ["search-modal.css"]
225
- };
226
- }
227
- static get properties() {
228
- return {
229
- "application": {
230
- "type": "unknown",
231
- "mutable": false,
232
- "complexType": {
233
- "original": "SnkApplication",
234
- "resolved": "SnkApplication",
235
- "references": {
236
- "SnkApplication": {
237
- "location": "import",
238
- "path": "../../../snk-application/snk-application"
239
- }
240
- }
241
- },
242
- "required": false,
243
- "optional": false,
244
- "docs": {
245
- "tags": [],
246
- "text": "SnkApplication"
247
- }
248
- },
249
- "listItens": {
250
- "type": "unknown",
251
- "mutable": true,
252
- "complexType": {
253
- "original": "string[]",
254
- "resolved": "string[]",
255
- "references": {}
256
- },
257
- "required": false,
258
- "optional": false,
259
- "docs": {
260
- "tags": [],
261
- "text": "Lista de itens exibidas conforme o usu\u00E1rio digita."
262
- },
263
- "defaultValue": "[]"
264
- },
265
- "opened": {
266
- "type": "boolean",
267
- "mutable": true,
268
- "complexType": {
269
- "original": "boolean",
270
- "resolved": "boolean",
271
- "references": {}
272
- },
273
- "required": false,
274
- "optional": false,
275
- "docs": {
276
- "tags": [],
277
- "text": "Define se o ez-popover est\u00E1 aberto."
278
- },
279
- "attribute": "opened",
280
- "reflect": true,
281
- "defaultValue": "false"
282
- },
283
- "value": {
284
- "type": "string",
285
- "mutable": false,
286
- "complexType": {
287
- "original": "string",
288
- "resolved": "string",
289
- "references": {}
290
- },
291
- "required": false,
292
- "optional": false,
293
- "docs": {
294
- "tags": [],
295
- "text": "Define o valor do campo."
296
- },
297
- "attribute": "value",
298
- "reflect": false,
299
- "defaultValue": "undefined"
300
- },
301
- "canShowError": {
302
- "type": "boolean",
303
- "mutable": false,
304
- "complexType": {
305
- "original": "boolean",
306
- "resolved": "boolean",
307
- "references": {}
308
- },
309
- "required": false,
310
- "optional": false,
311
- "docs": {
312
- "tags": [],
313
- "text": "Se false deixa de exibir a mensagem de erro dentro do campo."
314
- },
315
- "attribute": "can-show-error",
316
- "reflect": false,
317
- "defaultValue": "false"
318
- },
319
- "emptyMessage": {
320
- "type": "string",
321
- "mutable": false,
322
- "complexType": {
323
- "original": "HTMLElement | string",
324
- "resolved": "HTMLElement | string",
325
- "references": {
326
- "HTMLElement": {
327
- "location": "global"
328
- }
329
- }
330
- },
331
- "required": false,
332
- "optional": false,
333
- "docs": {
334
- "tags": [],
335
- "text": "Recebe a mensagem de vazio ou personalizada"
336
- },
337
- "attribute": "empty-message",
338
- "reflect": false,
339
- "defaultValue": "undefined"
340
- },
341
- "debounceTime": {
342
- "type": "number",
343
- "mutable": false,
344
- "complexType": {
345
- "original": "number",
346
- "resolved": "number",
347
- "references": {}
348
- },
349
- "required": false,
350
- "optional": false,
351
- "docs": {
352
- "tags": [],
353
- "text": "Tempo em milissegundos para debouncing das chamadas de busca de sugest\u00F5es."
354
- },
355
- "attribute": "debounce-time",
356
- "reflect": false,
357
- "defaultValue": "300"
358
- },
359
- "maxItens": {
360
- "type": "number",
361
- "mutable": false,
362
- "complexType": {
363
- "original": "number",
364
- "resolved": "number",
365
- "references": {}
366
- },
367
- "required": false,
368
- "optional": false,
369
- "docs": {
370
- "tags": [],
371
- "text": "Limita a quantidade de registros apresentados na tela"
372
- },
373
- "attribute": "max-itens",
374
- "reflect": false,
375
- "defaultValue": "100"
376
- },
377
- "label": {
378
- "type": "string",
379
- "mutable": false,
380
- "complexType": {
381
- "original": "string",
382
- "resolved": "string",
383
- "references": {}
384
- },
385
- "required": false,
386
- "optional": false,
387
- "docs": {
388
- "tags": [],
389
- "text": "Texto exibido como placeholder no campo de pesquisa."
390
- },
391
- "attribute": "label",
392
- "reflect": false,
393
- "defaultValue": "'Pesquisar'"
394
- },
395
- "mode": {
396
- "type": "string",
397
- "mutable": false,
398
- "complexType": {
399
- "original": "'slim' | 'regular'",
400
- "resolved": "\"regular\" | \"slim\"",
401
- "references": {}
402
- },
403
- "required": false,
404
- "optional": false,
405
- "docs": {
406
- "tags": [],
407
- "text": "Define o tamanho do campo."
408
- },
409
- "attribute": "mode",
410
- "reflect": false,
411
- "defaultValue": "'regular'"
412
- },
413
- "restrict": {
414
- "type": "string",
415
- "mutable": false,
416
- "complexType": {
417
- "original": "string",
418
- "resolved": "string",
419
- "references": {}
420
- },
421
- "required": false,
422
- "optional": false,
423
- "docs": {
424
- "tags": [],
425
- "text": "Express\u00E3o que define os caracteres permitidos na entrada."
426
- },
427
- "attribute": "restrict",
428
- "reflect": false,
429
- "defaultValue": "undefined"
430
- },
431
- "errorMessage": {
432
- "type": "string",
433
- "mutable": false,
434
- "complexType": {
435
- "original": "string",
436
- "resolved": "string",
437
- "references": {}
438
- },
439
- "required": false,
440
- "optional": false,
441
- "docs": {
442
- "tags": [],
443
- "text": "Define uma mensagem de orienta\u00E7\u00E3o ao usu\u00E1rio, colocando o campo em modo inv\u00E1lido."
444
- },
445
- "attribute": "error-message",
446
- "reflect": false,
447
- "defaultValue": "undefined"
448
- }
449
- };
450
- }
451
- static get states() {
452
- return {
453
- "filteredItems": {}
454
- };
455
- }
456
- static get events() {
457
- return [{
458
- "method": "popupClose",
459
- "name": "popupClose",
460
- "bubbles": true,
461
- "cancelable": true,
462
- "composed": true,
463
- "docs": {
464
- "tags": [],
465
- "text": "Emitido ao fechar o popup"
466
- },
467
- "complexType": {
468
- "original": "boolean",
469
- "resolved": "boolean",
470
- "references": {}
471
- }
472
- }, {
473
- "method": "changeValue",
474
- "name": "changeValue",
475
- "bubbles": true,
476
- "cancelable": true,
477
- "composed": true,
478
- "docs": {
479
- "tags": [],
480
- "text": "Emitido quando h\u00E1 uma altera\u00E7\u00E3o no valor do campo."
481
- },
482
- "complexType": {
483
- "original": "IDistinctValue",
484
- "resolved": "IDistinctValue",
485
- "references": {
486
- "IDistinctValue": {
487
- "location": "import",
488
- "path": "../../types"
489
- }
490
- }
491
- }
492
- }];
493
- }
494
- static get methods() {
495
- return {
496
- "addNewItem": {
497
- "complexType": {
498
- "signature": "() => Promise<void>",
499
- "parameters": [],
500
- "references": {},
501
- "return": "Promise<void>"
502
- },
503
- "docs": {
504
- "text": "M\u00E9todo para adicionar a nova palavra e chamar o m\u00E9todo closeModal() para fechar o modal",
505
- "tags": []
506
- }
507
- },
508
- "clearInput": {
509
- "complexType": {
510
- "signature": "() => Promise<void>",
511
- "parameters": [],
512
- "references": {},
513
- "return": "Promise<void>"
514
- },
515
- "docs": {
516
- "text": "M\u00E9todo para limpa o campo de entrada de pesquisa",
517
- "tags": []
518
- }
519
- },
520
- "closeModal": {
521
- "complexType": {
522
- "signature": "() => Promise<void>",
523
- "parameters": [],
524
- "references": {},
525
- "return": "Promise<void>"
526
- },
527
- "docs": {
528
- "text": "M\u00E9todo para fechar o modal",
529
- "tags": []
530
- }
531
- },
532
- "openModal": {
533
- "complexType": {
534
- "signature": "() => Promise<void>",
535
- "parameters": [],
536
- "references": {},
537
- "return": "Promise<void>"
538
- },
539
- "docs": {
540
- "text": "M\u00E9todo para abrir o modal",
541
- "tags": []
542
- }
543
- },
544
- "isInvalid": {
545
- "complexType": {
546
- "signature": "() => Promise<void>",
547
- "parameters": [],
548
- "references": {},
549
- "return": "Promise<void>"
550
- },
551
- "docs": {
552
- "text": "Retorna se o conte\u00FAdo \u00E9 inv\u00E1lido.",
553
- "tags": []
554
- }
555
- },
556
- "setBlur": {
557
- "complexType": {
558
- "signature": "() => Promise<void>",
559
- "parameters": [],
560
- "references": {
561
- "Promise": {
562
- "location": "global"
563
- }
564
- },
565
- "return": "Promise<void>"
566
- },
567
- "docs": {
568
- "text": "Remove o foco do campo",
569
- "tags": []
570
- }
571
- },
572
- "setFocus": {
573
- "complexType": {
574
- "signature": "() => Promise<void>",
575
- "parameters": [],
576
- "references": {
577
- "Promise": {
578
- "location": "global"
579
- }
580
- },
581
- "return": "Promise<void>"
582
- },
583
- "docs": {
584
- "text": "Aplica o foco do campo",
585
- "tags": []
586
- }
587
- }
588
- };
589
- }
590
- static get elementRef() { return "_element"; }
591
- static get watchers() {
592
- return [{
593
- "propName": "errorMessage",
594
- "methodName": "watchPropErrorMessage"
595
- }, {
596
- "propName": "value",
597
- "methodName": "watchPropValue"
598
- }];
599
- }
600
- }
@@ -1,13 +0,0 @@
1
- export function normalizeString(text = "") {
2
- return text.normalize('NFD').replace(/[\u0300-\u036f/\s'"&.-]/g, "").toUpperCase();
3
- }
4
- export function filterItems(searchArgument, distinctItems, maxItems) {
5
- const normalizedSearch = normalizeString(searchArgument);
6
- const filteredDistincts = distinctItems.filter((item) => normalizeString(item).startsWith(normalizedSearch));
7
- return filteredDistincts.slice(0, maxItems - 1);
8
- }
9
- export function getMatchOption(value, distinctItems) {
10
- const normalizedSearch = normalizeString(value);
11
- const item = distinctItems.find((item) => normalizeString(item) === normalizedSearch);
12
- return item;
13
- }
@@ -1,25 +0,0 @@
1
- import { DataFetcher } from "../DataFetcher";
2
- export default class DistinctSearchFetcher {
3
- constructor() {
4
- this.SERVICE = 'mge@Pesquisa.getSelectDistinct';
5
- }
6
- buildRequestBody(coluna, instancia) {
7
- return {
8
- selectDistinct: {
9
- instancia,
10
- coluna,
11
- }
12
- };
13
- }
14
- parseResponseBody(response) {
15
- var _a, _b, _c;
16
- const ocorrencias = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.ocorrencias) === null || _a === void 0 ? void 0 : _a.ocorrencia) === null || _b === void 0 ? void 0 : _b.map(({ $ }) => $)) !== null && _c !== void 0 ? _c : [];
17
- return ocorrencias;
18
- }
19
- async fetchItens(coluna, instancia) {
20
- const requestBody = this.buildRequestBody(coluna, instancia);
21
- const response = await DataFetcher.get().callServiceBroker(this.SERVICE, requestBody);
22
- const parsedResponse = this.parseResponseBody(response);
23
- return parsedResponse;
24
- }
25
- }
@@ -1,9 +0,0 @@
1
- const snkDistinctSearchMessages = {
2
- titleBadgeNew: "novo",
3
- titleAdd: "Adicionar",
4
- availableResults: "resultados disponíveis",
5
- availableResult: "resultado disponível",
6
- limitResult: "Esta pesquisa foi limitada, existem mais resultados",
7
- emptyResult: "Nenhum resultado disponível. <br/>Você pode adicionar um novo termo",
8
- };
9
- export default snkDistinctSearchMessages;
@@ -1,15 +0,0 @@
1
- function normalizeString(text = "") {
2
- return text.normalize('NFD').replace(/[\u0300-\u036f/\s'"&.-]/g, "").toUpperCase();
3
- }
4
- function filterItems(searchArgument, distinctItems, maxItems) {
5
- const normalizedSearch = normalizeString(searchArgument);
6
- const filteredDistincts = distinctItems.filter((item) => normalizeString(item).startsWith(normalizedSearch));
7
- return filteredDistincts.slice(0, maxItems - 1);
8
- }
9
- function getMatchOption(value, distinctItems) {
10
- const normalizedSearch = normalizeString(value);
11
- const item = distinctItems.find((item) => normalizeString(item) === normalizedSearch);
12
- return item;
13
- }
14
-
15
- export { filterItems as f, getMatchOption as g, normalizeString as n };
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface InputDistinctSearch extends Components.InputDistinctSearch, HTMLElement {}
4
- export const InputDistinctSearch: {
5
- prototype: InputDistinctSearch;
6
- new (): InputDistinctSearch;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,6 +0,0 @@
1
- import { I as InputDistinctSearch$1, d as defineCustomElement$1 } from './input-distinct-search2.js';
2
-
3
- const InputDistinctSearch = InputDistinctSearch$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { InputDistinctSearch, defineCustomElement };