@sankhyalabs/sankhyablocks 8.14.1 → 8.15.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/{field-search-ca27041a.js → field-search-f56aa7d6.js} +29 -1
  2. package/dist/cjs/index-f9e81701.js +2 -2
  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.cjs.entry.js → snk-actions-button_2.cjs.entry.js} +113 -0
  6. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  8. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  9. package/dist/cjs/snk-grid.cjs.entry.js +11 -25
  10. package/dist/cjs/{snk-guides-viewer-aea15ee0.js → snk-guides-viewer-9342bca1.js} +6 -16
  11. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  12. package/dist/cjs/snk-simple-crud.cjs.entry.js +15 -36
  13. package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
  14. package/dist/cjs/{taskbar-elements-39949c7a.js → taskbar-elements-b8c428a9.js} +3 -3
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/snk-crud/snk-crud.js +4 -4
  17. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -18
  18. package/dist/collection/components/snk-grid/snk-grid.js +20 -37
  19. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +15 -36
  20. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +6 -0
  21. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +301 -0
  22. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -3
  23. package/dist/collection/components/snk-taskbar/snk-taskbar.js +0 -1
  24. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +28 -1
  25. package/dist/components/field-search.js +29 -2
  26. package/dist/components/index.d.ts +1 -0
  27. package/dist/components/index.js +1 -0
  28. package/dist/components/snk-attach2.js +20 -14
  29. package/dist/components/snk-crud.js +69 -63
  30. package/dist/components/snk-detail-view2.js +95 -94
  31. package/dist/components/snk-grid2.js +53 -61
  32. package/dist/components/snk-simple-crud2.js +31 -46
  33. package/dist/components/snk-taskbar2.js +15 -9
  34. package/dist/components/taskbar-actions-button.d.ts +11 -0
  35. package/dist/components/taskbar-actions-button.js +6 -0
  36. package/dist/components/taskbar-actions-button2.js +137 -0
  37. package/dist/esm/{field-search-c6938ee4.js → field-search-efbe307f.js} +29 -2
  38. package/dist/esm/index-a7d3d3f1.js +2 -2
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/esm/sankhyablocks.js +1 -1
  41. package/dist/esm/{snk-actions-button.entry.js → snk-actions-button_2.entry.js} +114 -2
  42. package/dist/esm/snk-attach.entry.js +1 -1
  43. package/dist/esm/snk-crud.entry.js +5 -5
  44. package/dist/esm/snk-detail-view.entry.js +3 -3
  45. package/dist/esm/snk-grid.entry.js +12 -26
  46. package/dist/esm/{snk-guides-viewer-717a3847.js → snk-guides-viewer-9ce9588c.js} +6 -16
  47. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  48. package/dist/esm/snk-simple-crud.entry.js +16 -37
  49. package/dist/esm/snk-taskbar.entry.js +1 -1
  50. package/dist/esm/{taskbar-elements-0a6b8b95.js → taskbar-elements-26c981af.js} +3 -3
  51. package/dist/sankhyablocks/p-145c4434.js +1 -0
  52. package/dist/sankhyablocks/p-17dda7a2.entry.js +1 -0
  53. package/dist/sankhyablocks/{p-63f56d48.entry.js → p-311c6173.entry.js} +1 -1
  54. package/dist/sankhyablocks/{p-2417c492.entry.js → p-44e894af.entry.js} +1 -1
  55. package/dist/sankhyablocks/p-78777ae0.entry.js +1 -0
  56. package/dist/sankhyablocks/{p-d4fb9642.entry.js → p-953346b9.entry.js} +1 -1
  57. package/dist/sankhyablocks/p-9c3229fc.entry.js +1 -0
  58. package/dist/sankhyablocks/p-c2495304.js +1 -0
  59. package/dist/sankhyablocks/p-dd6a8377.js +1 -0
  60. package/dist/sankhyablocks/p-e138e7d4.entry.js +1 -0
  61. package/dist/sankhyablocks/{p-075eddfd.entry.js → p-e1b29d4c.entry.js} +1 -1
  62. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  63. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -1
  64. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -4
  65. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +6 -5
  66. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +58 -0
  67. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +16 -0
  68. package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
  69. package/dist/types/components.d.ts +65 -0
  70. package/package.json +1 -1
  71. package/react/components.d.ts +1 -0
  72. package/react/components.js +1 -0
  73. package/react/components.js.map +1 -1
  74. package/dist/sankhyablocks/p-1657804e.entry.js +0 -1
  75. package/dist/sankhyablocks/p-3ecd72a4.js +0 -1
  76. package/dist/sankhyablocks/p-6e0cbef1.entry.js +0 -1
  77. package/dist/sankhyablocks/p-7a7607c8.js +0 -1
  78. package/dist/sankhyablocks/p-9f7bc9be.entry.js +0 -1
  79. package/dist/sankhyablocks/p-b525d1ae.entry.js +0 -1
  80. package/dist/sankhyablocks/p-c9841939.js +0 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const constants = require('./constants-35ddd366.js');
8
- const taskbarElements = require('./taskbar-elements-39949c7a.js');
8
+ const taskbarElements = require('./taskbar-elements-b8c428a9.js');
9
9
  require('./DataFetcher-ba94ed5b.js');
10
10
  require('./pesquisa-fetcher-ef050a47.js');
11
11
  const index$1 = require('./index-0e663819.js');
@@ -16,7 +16,7 @@ const dataunitFetcher = require('./dataunit-fetcher-bdaf9482.js');
16
16
  require('./PreloadManager-84466da6.js');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
18
  require('./form-config-fetcher-df043d3d.js');
19
- const fieldSearch = require('./field-search-ca27041a.js');
19
+ const fieldSearch = require('./field-search-f56aa7d6.js');
20
20
  const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-ba5838c2.js');
21
21
  require('./index-102ba62d.js');
22
22
  require('./PrintUtils-bcaeb82f.js');
@@ -204,12 +204,6 @@ const SnkSimpleCrud = class {
204
204
  if (this._columnSearch != undefined) {
205
205
  return this._columnSearch;
206
206
  }
207
- actionButton.addEventListener("ezPopoverOpen", () => {
208
- if (this._columnSearch) {
209
- const realElement = this._columnSearch["$elm$"];
210
- realElement.value = null;
211
- }
212
- });
213
207
  this._moreOptions = actionButton;
214
208
  this._columnSearch = fieldSearch.buildFieldSearch(item, ({ argument }) => new Promise(accept => {
215
209
  this._grid.filterColumns(argument).then((columns) => {
@@ -218,9 +212,10 @@ const SnkSimpleCrud = class {
218
212
  .map(column => ({ label: column.label, value: column.name })));
219
213
  });
220
214
  }), (option) => {
215
+ var _a;
221
216
  if (option != undefined) {
222
217
  this._grid.locateColumn(option.value);
223
- actionButton.hideActions();
218
+ (_a = actionButton["hideActions"]) === null || _a === void 0 ? void 0 : _a.call(actionButton);
224
219
  }
225
220
  });
226
221
  return this._columnSearch;
@@ -262,14 +257,16 @@ const SnkSimpleCrud = class {
262
257
  getActionsList() {
263
258
  var _a, _b;
264
259
  return [{
265
- value: "",
260
+ value: core.StringUtils.generateUUID(),
266
261
  label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
262
+ disableCloseOnSelect: true,
263
+ eagerInitialize: true,
267
264
  itemBuilder: (actionButton, item) => (this._currentViewMode === constants.VIEW_MODE.GRID)
268
265
  ? this.getColumnSearch(actionButton, item)
269
266
  : this.getFieldSearch(actionButton, item)
270
267
  }];
271
268
  }
272
- keyDownListener(event) {
269
+ async keyDownListener(event) {
273
270
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
274
271
  return;
275
272
  }
@@ -281,39 +278,21 @@ const SnkSimpleCrud = class {
281
278
  }
282
279
  core.FloatingManager.closeAll();
283
280
  if (this._currentViewMode === constants.VIEW_MODE.GRID) {
284
- this.findColumn();
281
+ await this.findColumn();
285
282
  }
286
283
  else {
287
- this.findField();
284
+ await this.findField();
288
285
  }
289
286
  event.preventDefault();
290
287
  }
291
288
  async findField() {
292
- if (!this._moreOptions) {
293
- return;
294
- }
295
- if (!(await this._moreOptions.isOpened())) {
296
- this._moreOptions.showActions();
297
- return;
298
- }
299
- if (this._fieldSearch) {
300
- const realElement = this._fieldSearch["$elm$"];
301
- realElement.value = null;
302
- requestAnimationFrame(() => realElement.setFocus());
303
- }
289
+ await this.openSeach(this._fieldSearch);
304
290
  }
305
291
  async findColumn() {
306
- if (!this._moreOptions) {
307
- return;
308
- }
309
- if (!(await this._moreOptions.isOpened())) {
310
- this._moreOptions.showActions();
311
- }
312
- if (this._columnSearch) {
313
- const realElement = this._columnSearch["$elm$"];
314
- realElement.value = null;
315
- requestAnimationFrame(() => realElement.setFocus());
316
- }
292
+ await this.openSeach(this._columnSearch);
293
+ }
294
+ async openSeach(fieldSearch$1) {
295
+ await fieldSearch.openFieldSearch(this._moreOptions, fieldSearch$1);
317
296
  }
318
297
  clearFieldToFocusHandler() {
319
298
  this._fieldToGetFocus = undefined;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
8
- const taskbarElements = require('./taskbar-elements-39949c7a.js');
8
+ const taskbarElements = require('./taskbar-elements-b8c428a9.js');
9
9
  const index$1 = require('./index-0e663819.js');
10
10
  require('./index-102ba62d.js');
11
11
 
@@ -89,7 +89,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
89
89
  case exports.TaskbarElement.CONFIGURATOR:
90
90
  return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
91
91
  case exports.TaskbarElement.MORE_OPTIONS:
92
- return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
92
+ return actionButton(element, dataElementId, title, isEnabled, actions, action);
93
93
  case exports.TaskbarElement.DIVIDER:
94
94
  return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
95
95
  case exports.TaskbarElement.DATA_EXPORTER:
@@ -111,9 +111,9 @@ function iconTextButton(iconName, name, className, dataElementId, text, title, a
111
111
  return index.h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
112
112
  index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
113
113
  }
114
- function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
114
+ function actionButton(element, dataElementId, title, isEnabled, actions, action) {
115
115
  return actions && actions.length > 0
116
- ? index.h("ez-actions-button", { key: dataElementId, title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
116
+ ? index.h("taskbar-actions-button", { key: dataElementId, title: title, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
117
117
  : undefined;
118
118
  }
119
119
 
@@ -50,6 +50,7 @@
50
50
  "./components/snk-print-selector/snk-print-selector.js",
51
51
  "./components/snk-simple-bar/snk-simple-bar.js",
52
52
  "./components/snk-simple-crud/snk-simple-crud.js",
53
+ "./components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js",
53
54
  "./components/teste-pesquisa/teste-pesquisa.js"
54
55
  ],
55
56
  "compiler": {
@@ -11,7 +11,7 @@ import { AutorizationType } from '../../lib/http/data-fetcher/fetchers/auth-fetc
11
11
  */
12
12
  export class SnkCrud {
13
13
  constructor() {
14
- this._keyDownHandler = (event) => this.keyDownListener(event);
14
+ this._keyDownHandler = async (event) => this.keyDownListener(event);
15
15
  this._viewHistory = [];
16
16
  this._dataUnit = undefined;
17
17
  this._dataState = undefined;
@@ -251,7 +251,7 @@ export class SnkCrud {
251
251
  }
252
252
  this.configuratorCancel.emit();
253
253
  }
254
- keyDownListener(event) {
254
+ async keyDownListener(event) {
255
255
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
256
256
  return;
257
257
  }
@@ -263,10 +263,10 @@ export class SnkCrud {
263
263
  }
264
264
  FloatingManager.closeAll();
265
265
  if (this._currentViewMode === VIEW_MODE.GRID) {
266
- this._snkGrid.findColumn();
266
+ await this._snkGrid.findColumn();
267
267
  }
268
268
  else {
269
- this._guidesViewer.findField();
269
+ await this._guidesViewer.findField();
270
270
  }
271
271
  event.preventDefault();
272
272
  }
@@ -7,7 +7,7 @@ import { TaskbarElement } from '../../snk-taskbar/elements/taskbar-elements';
7
7
  import { VIEW_MODE } from '../../../lib/utils/constants';
8
8
  import { PresentationMode } from '../../../lib';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
- import { buildFieldSearch } from '../../snk-taskbar/subcomponents/field-search';
10
+ import { buildFieldSearch, openFieldSearch } from '../../snk-taskbar/subcomponents/field-search';
11
11
  const FORM_NAME_PREFIX = "__FORM:";
12
12
  export class SnkGuidesViewer {
13
13
  constructor() {
@@ -60,18 +60,7 @@ export class SnkGuidesViewer {
60
60
  * Abre o localizador de campos
61
61
  */
62
62
  async findField() {
63
- if (!this._moreOptions) {
64
- return;
65
- }
66
- if (!(await this._moreOptions.isOpened())) {
67
- this._moreOptions.showActions();
68
- return;
69
- }
70
- if (this._fieldSearch) {
71
- const realElement = this._fieldSearch["$elm$"];
72
- realElement.value = null;
73
- requestAnimationFrame(() => realElement.setFocus());
74
- }
63
+ await openFieldSearch(this._moreOptions, this._fieldSearch);
75
64
  }
76
65
  exitViewer() {
77
66
  if (this.dataUnit.isDirty()) {
@@ -359,8 +348,7 @@ export class SnkGuidesViewer {
359
348
  if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
360
349
  this._hasToCreateFieldSearch = false;
361
350
  this._moreOptions = actionButton;
362
- actionButton.addEventListener("ezPopoverOpen", () => this.findField());
363
- actionButton.addEventListener("ezDisconnectedActionButtons", () => this._hasToCreateFieldSearch = true);
351
+ actionButton.addEventListener("taskbarActionsButtonDisconnected", () => this._hasToCreateFieldSearch = true);
364
352
  this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option, actionButton));
365
353
  }
366
354
  return this._fieldSearch;
@@ -384,6 +372,8 @@ export class SnkGuidesViewer {
384
372
  const hardList = [{
385
373
  value: "",
386
374
  label: this.getMessage("snkCrud.findColumn"),
375
+ disableCloseOnSelect: true,
376
+ eagerInitialize: true,
387
377
  itemBuilder: (actionButton, item) => this.getFieldsSearch(actionButton, item)
388
378
  }];
389
379
  if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
@@ -852,9 +842,6 @@ export class SnkGuidesViewer {
852
842
  "references": {
853
843
  "Promise": {
854
844
  "location": "global"
855
- },
856
- "HTMLEzSearchElement": {
857
- "location": "global"
858
845
  }
859
846
  },
860
847
  "return": "Promise<void>"
@@ -1,5 +1,5 @@
1
1
  import { h, Fragment } from '@stencil/core';
2
- import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
3
3
  import { SortMode, UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
5
5
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
@@ -8,7 +8,7 @@ import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
8
8
  import store from "../../lib/store";
9
9
  import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
10
10
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
11
- import { buildFieldSearch } from '../snk-taskbar/subcomponents/field-search';
11
+ import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
12
12
  export class SnkGrid {
13
13
  constructor() {
14
14
  this._topTaskbarProcessor = new TaskbarProcessor({
@@ -77,28 +77,18 @@ export class SnkGrid {
77
77
  var _a;
78
78
  (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.reload();
79
79
  }
80
- /**
81
- * Abre o localizador de colunas
82
- */
83
- async findColumn() {
84
- if (!this._moreOptions) {
85
- return;
86
- }
87
- if (!(await this._moreOptions.isOpened())) {
88
- this._moreOptions.showActions();
89
- }
90
- if (this._columnSearch) {
91
- const realElement = this._columnSearch["$elm$"];
92
- realElement.value = null;
93
- requestAnimationFrame(() => realElement.setFocus());
94
- }
95
- }
96
80
  /**
97
81
  * Retorna o elemento da filter-bar da grade.
98
82
  */
99
83
  async getFilterBar() {
100
84
  return this._snkFilterBar;
101
85
  }
86
+ /**
87
+ * Abre o localizador de colunas
88
+ */
89
+ async findColumn() {
90
+ await openFieldSearch(this._moreOptions, this._columnSearch);
91
+ }
102
92
  openGridConfig() {
103
93
  this._grid.getColumnsState()
104
94
  .then((gridColumns) => {
@@ -341,12 +331,6 @@ export class SnkGrid {
341
331
  if (this._columnSearch != undefined) {
342
332
  return this._columnSearch;
343
333
  }
344
- actionButton.addEventListener("ezPopoverOpen", () => {
345
- if (this._columnSearch) {
346
- const realElement = this._columnSearch["$elm$"];
347
- realElement.value = null;
348
- }
349
- });
350
334
  this._moreOptions = actionButton;
351
335
  this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
352
336
  this._grid.filterColumns(argument).then((columns) => {
@@ -364,8 +348,10 @@ export class SnkGrid {
364
348
  }
365
349
  getActionsList() {
366
350
  const hardList = [{
367
- value: "",
351
+ value: StringUtils.generateUUID(),
368
352
  label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
353
+ disableCloseOnSelect: true,
354
+ eagerInitialize: true,
369
355
  itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
370
356
  }];
371
357
  if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
@@ -851,41 +837,38 @@ export class SnkGrid {
851
837
  "tags": []
852
838
  }
853
839
  },
854
- "findColumn": {
840
+ "getFilterBar": {
855
841
  "complexType": {
856
- "signature": "() => Promise<void>",
842
+ "signature": "() => Promise<HTMLSnkFilterBarElement>",
857
843
  "parameters": [],
858
844
  "references": {
859
845
  "Promise": {
860
846
  "location": "global"
861
847
  },
862
- "HTMLEzSearchElement": {
848
+ "HTMLSnkFilterBarElement": {
863
849
  "location": "global"
864
850
  }
865
851
  },
866
- "return": "Promise<void>"
852
+ "return": "Promise<HTMLSnkFilterBarElement>"
867
853
  },
868
854
  "docs": {
869
- "text": "Abre o localizador de colunas",
855
+ "text": "Retorna o elemento da filter-bar da grade.",
870
856
  "tags": []
871
857
  }
872
858
  },
873
- "getFilterBar": {
859
+ "findColumn": {
874
860
  "complexType": {
875
- "signature": "() => Promise<HTMLSnkFilterBarElement>",
861
+ "signature": "() => Promise<void>",
876
862
  "parameters": [],
877
863
  "references": {
878
864
  "Promise": {
879
865
  "location": "global"
880
- },
881
- "HTMLSnkFilterBarElement": {
882
- "location": "global"
883
866
  }
884
867
  },
885
- "return": "Promise<HTMLSnkFilterBarElement>"
868
+ "return": "Promise<void>"
886
869
  },
887
870
  "docs": {
888
- "text": "Retorna o elemento da filter-bar da grade.",
871
+ "text": "Abre o localizador de colunas",
889
872
  "tags": []
890
873
  }
891
874
  }
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, DataType, FloatingManager, ObjectUtils, UserInterface, JSUtils } from '@sankhyalabs/core';
1
+ import { ApplicationContext, DataType, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
2
2
  import { h } from '@stencil/core';
3
3
  import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
4
4
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
@@ -6,7 +6,7 @@ import { PresentationMode } from '../../lib';
6
6
  import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
7
7
  import InMemoryLoader from '../../lib/dataUnit/InMemoryLoader';
8
8
  import SnkMultiSelectionListDataSource from '../snk-grid/filtercolumn/SnkMultiSelectionListDataSource';
9
- import { buildFieldSearch } from '../snk-taskbar/subcomponents/field-search';
9
+ import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
10
10
  export class SnkSimpleCrud {
11
11
  constructor() {
12
12
  this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
@@ -180,12 +180,6 @@ export class SnkSimpleCrud {
180
180
  if (this._columnSearch != undefined) {
181
181
  return this._columnSearch;
182
182
  }
183
- actionButton.addEventListener("ezPopoverOpen", () => {
184
- if (this._columnSearch) {
185
- const realElement = this._columnSearch["$elm$"];
186
- realElement.value = null;
187
- }
188
- });
189
183
  this._moreOptions = actionButton;
190
184
  this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
191
185
  this._grid.filterColumns(argument).then((columns) => {
@@ -194,9 +188,10 @@ export class SnkSimpleCrud {
194
188
  .map(column => ({ label: column.label, value: column.name })));
195
189
  });
196
190
  }), (option) => {
191
+ var _a;
197
192
  if (option != undefined) {
198
193
  this._grid.locateColumn(option.value);
199
- actionButton.hideActions();
194
+ (_a = actionButton["hideActions"]) === null || _a === void 0 ? void 0 : _a.call(actionButton);
200
195
  }
201
196
  });
202
197
  return this._columnSearch;
@@ -238,14 +233,16 @@ export class SnkSimpleCrud {
238
233
  getActionsList() {
239
234
  var _a, _b;
240
235
  return [{
241
- value: "",
236
+ value: StringUtils.generateUUID(),
242
237
  label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
238
+ disableCloseOnSelect: true,
239
+ eagerInitialize: true,
243
240
  itemBuilder: (actionButton, item) => (this._currentViewMode === VIEW_MODE.GRID)
244
241
  ? this.getColumnSearch(actionButton, item)
245
242
  : this.getFieldSearch(actionButton, item)
246
243
  }];
247
244
  }
248
- keyDownListener(event) {
245
+ async keyDownListener(event) {
249
246
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
250
247
  return;
251
248
  }
@@ -257,39 +254,21 @@ export class SnkSimpleCrud {
257
254
  }
258
255
  FloatingManager.closeAll();
259
256
  if (this._currentViewMode === VIEW_MODE.GRID) {
260
- this.findColumn();
257
+ await this.findColumn();
261
258
  }
262
259
  else {
263
- this.findField();
260
+ await this.findField();
264
261
  }
265
262
  event.preventDefault();
266
263
  }
267
264
  async findField() {
268
- if (!this._moreOptions) {
269
- return;
270
- }
271
- if (!(await this._moreOptions.isOpened())) {
272
- this._moreOptions.showActions();
273
- return;
274
- }
275
- if (this._fieldSearch) {
276
- const realElement = this._fieldSearch["$elm$"];
277
- realElement.value = null;
278
- requestAnimationFrame(() => realElement.setFocus());
279
- }
265
+ await this.openSeach(this._fieldSearch);
280
266
  }
281
267
  async findColumn() {
282
- if (!this._moreOptions) {
283
- return;
284
- }
285
- if (!(await this._moreOptions.isOpened())) {
286
- this._moreOptions.showActions();
287
- }
288
- if (this._columnSearch) {
289
- const realElement = this._columnSearch["$elm$"];
290
- realElement.value = null;
291
- requestAnimationFrame(() => realElement.setFocus());
292
- }
268
+ await this.openSeach(this._columnSearch);
269
+ }
270
+ async openSeach(fieldSearch) {
271
+ await openFieldSearch(this._moreOptions, fieldSearch);
293
272
  }
294
273
  clearFieldToFocusHandler() {
295
274
  this._fieldToGetFocus = undefined;
@@ -0,0 +1,6 @@
1
+ :host {
2
+ /*private*/
3
+ display: flex;
4
+ width: fit-content;
5
+ height: fit-content;
6
+ }