@sankhyalabs/sankhyablocks 8.16.0-dev.110 → 8.16.0-dev.111

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 (111) hide show
  1. package/dist/cjs/{SnkMessageBuilder-aecd7c18.js → SnkMessageBuilder-9deeae08.js} +4 -3
  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_7.cjs.entry.js → snk-actions-button_8.cjs.entry.js} +61 -0
  6. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-crud.cjs.entry.js +2 -26
  9. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  10. package/dist/cjs/{snk-data-unit-ebfdb9ba.js → snk-data-unit-57916de4.js} +1 -1
  11. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-detail-view.cjs.entry.js +57 -5
  13. package/dist/cjs/snk-form-view.cjs.entry.js +19 -7
  14. package/dist/cjs/snk-grid.cjs.entry.js +22 -23
  15. package/dist/cjs/{snk-guides-viewer-fd39f437.js → snk-guides-viewer-d33379cd.js} +36 -24
  16. package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -3
  17. package/dist/cjs/snk-simple-crud.cjs.entry.js +73 -85
  18. package/dist/cjs/snk-taskbar.cjs.entry.js +7 -3
  19. package/dist/cjs/{taskbar-elements-02379452.js → taskbar-elements-6f4e06af.js} +8 -0
  20. package/dist/cjs/{field-search-68e34bf4.js → taskbar-processor-2fba34a8.js} +0 -35
  21. package/dist/collection/collection-manifest.json +1 -0
  22. package/dist/collection/components/snk-crud/snk-crud.js +2 -26
  23. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +58 -4
  24. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +54 -7
  25. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +36 -40
  26. package/dist/collection/components/snk-grid/snk-grid.js +36 -36
  27. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +75 -85
  28. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +8 -0
  29. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css +0 -0
  30. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +220 -0
  31. package/dist/collection/components/snk-taskbar/snk-taskbar.js +28 -2
  32. package/dist/collection/lib/message/resources/snk-crud.msg.js +1 -1
  33. package/dist/collection/lib/message/resources/snk-grid.msg.js +1 -1
  34. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +2 -1
  35. package/dist/components/ContinuousInsertUtils.js +2 -33
  36. package/dist/components/SnkMessageBuilder.js +4 -3
  37. package/dist/components/index.d.ts +1 -0
  38. package/dist/components/index.js +1 -0
  39. package/dist/components/snk-attach2.js +34 -28
  40. package/dist/components/snk-crud.js +75 -93
  41. package/dist/components/snk-detail-view2.js +193 -117
  42. package/dist/components/snk-form-view2.js +22 -8
  43. package/dist/components/snk-grid2.js +62 -57
  44. package/dist/components/snk-simple-crud2.js +104 -109
  45. package/dist/components/snk-taskbar2.js +29 -10
  46. package/dist/components/taskbar-split-button.d.ts +11 -0
  47. package/dist/components/taskbar-split-button.js +6 -0
  48. package/dist/components/taskbar-split-button2.js +87 -0
  49. package/dist/esm/{SnkMessageBuilder-12f5fe1a.js → SnkMessageBuilder-2dbd8fa2.js} +4 -3
  50. package/dist/esm/index-a7d3d3f1.js +2 -2
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/sankhyablocks.js +1 -1
  53. package/dist/esm/{snk-actions-button_7.entry.js → snk-actions-button_8.entry.js} +61 -1
  54. package/dist/esm/snk-application.entry.js +1 -1
  55. package/dist/esm/snk-attach.entry.js +1 -1
  56. package/dist/esm/snk-crud.entry.js +3 -27
  57. package/dist/esm/snk-data-exporter.entry.js +2 -2
  58. package/dist/esm/{snk-data-unit-03654813.js → snk-data-unit-65c9dd1a.js} +1 -1
  59. package/dist/esm/snk-data-unit.entry.js +2 -2
  60. package/dist/esm/snk-detail-view.entry.js +59 -7
  61. package/dist/esm/snk-form-view.entry.js +19 -7
  62. package/dist/esm/snk-grid.entry.js +20 -21
  63. package/dist/esm/{snk-guides-viewer-75e06feb.js → snk-guides-viewer-72953334.js} +37 -25
  64. package/dist/esm/snk-guides-viewer.entry.js +4 -3
  65. package/dist/esm/snk-simple-crud.entry.js +74 -86
  66. package/dist/esm/snk-taskbar.entry.js +7 -3
  67. package/dist/esm/{taskbar-elements-c62b6c66.js → taskbar-elements-f2cb4922.js} +8 -0
  68. package/dist/esm/{field-search-f8b1d91e.js → taskbar-processor-3436124c.js} +1 -34
  69. package/dist/sankhyablocks/p-0fadb620.js +1 -0
  70. package/dist/sankhyablocks/p-1a0caadb.js +1 -0
  71. package/dist/sankhyablocks/{p-2c08fa3e.entry.js → p-1bdffb17.entry.js} +1 -1
  72. package/dist/sankhyablocks/p-1f80174b.entry.js +1 -0
  73. package/dist/sankhyablocks/p-24a0dbd2.entry.js +1 -0
  74. package/dist/sankhyablocks/p-2f7e2251.entry.js +1 -0
  75. package/dist/sankhyablocks/p-3372178e.entry.js +1 -0
  76. package/dist/sankhyablocks/p-4689c2e6.js +1 -0
  77. package/dist/sankhyablocks/{p-271c86d3.entry.js → p-52d10014.entry.js} +1 -1
  78. package/dist/sankhyablocks/p-6a03b190.entry.js +1 -0
  79. package/dist/sankhyablocks/{p-ad07f0c5.entry.js → p-7beeabc1.entry.js} +1 -1
  80. package/dist/sankhyablocks/{p-4a93daef.entry.js → p-a4ebeec4.entry.js} +1 -1
  81. package/dist/sankhyablocks/p-bc101064.entry.js +1 -0
  82. package/dist/sankhyablocks/{p-f4d5bb7f.js → p-c9675d64.js} +1 -1
  83. package/dist/sankhyablocks/{p-4e861843.entry.js → p-ce94e6c4.entry.js} +1 -1
  84. package/dist/sankhyablocks/p-d07b18a4.js +1 -0
  85. package/dist/sankhyablocks/{p-6a0c8ce0.entry.js → p-ddf93f36.entry.js} +1 -1
  86. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  87. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -3
  88. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -0
  89. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +11 -1
  90. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -6
  91. package/dist/types/components/snk-grid/snk-grid.d.ts +7 -5
  92. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -10
  93. package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +44 -0
  94. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +5 -0
  95. package/dist/types/components.d.ts +107 -8
  96. package/package.json +1 -1
  97. package/react/components.d.ts +1 -0
  98. package/react/components.js +1 -0
  99. package/react/components.js.map +1 -1
  100. package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +0 -31
  101. package/dist/sankhyablocks/p-1a51dfde.entry.js +0 -1
  102. package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
  103. package/dist/sankhyablocks/p-23736d75.js +0 -1
  104. package/dist/sankhyablocks/p-2d6df7e7.entry.js +0 -1
  105. package/dist/sankhyablocks/p-41da5310.js +0 -1
  106. package/dist/sankhyablocks/p-65be98c5.entry.js +0 -1
  107. package/dist/sankhyablocks/p-80f8c22c.js +0 -1
  108. package/dist/sankhyablocks/p-cc8c3bca.entry.js +0 -1
  109. package/dist/sankhyablocks/p-cf1f25ed.entry.js +0 -1
  110. package/dist/sankhyablocks/p-fb0f0087.js +0 -1
  111. package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +0 -4
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
- import { Action } from '@sankhyalabs/core';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
+ import { Action, StringUtils, KeyboardManager } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-be490a33.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import './DataFetcher-88e56266.js';
@@ -11,16 +11,17 @@ import './dataunit-fetcher-0e025732.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
12
  import './form-config-fetcher-fa208a6c.js';
13
13
  import { V as VIEW_MODE } from './constants-7db1128a.js';
14
- import { T as TaskbarElement } from './taskbar-elements-c62b6c66.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-75e06feb.js';
16
- import { S as SnkMessageBuilder } from './SnkMessageBuilder-12f5fe1a.js';
14
+ import { T as TaskbarElement } from './taskbar-elements-f2cb4922.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-72953334.js';
16
+ import { S as SnkMessageBuilder } from './SnkMessageBuilder-2dbd8fa2.js';
17
+ import { buildFieldSearch, SHORTCUT_SEARCH_FIELD, LABEL_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
17
18
  import './ConfigStorage-71e6766f.js';
18
19
  import './PrintUtils-3e4ff0f5.js';
19
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
21
  import '@sankhyalabs/core/dist/utils/SortingUtils';
21
22
  import './ResourceIDUtils-a114189a.js';
22
23
  import './index-bdf75557.js';
23
- import './field-search-f8b1d91e.js';
24
+ import './taskbar-processor-3436124c.js';
24
25
  import '@sankhyalabs/core/dist/dataunit/DataUnit';
25
26
 
26
27
  class GuideBuilder {
@@ -77,6 +78,8 @@ const SnkDetailView = class {
77
78
  this._disabledButtons = undefined;
78
79
  this._currentView = undefined;
79
80
  this.attachmentRegisterKey = undefined;
81
+ this._fieldToGetFocus = undefined;
82
+ this._hasToCreateFieldSearch = true;
80
83
  this.formConfigManager = undefined;
81
84
  this.dataUnitName = undefined;
82
85
  this.resourceID = undefined;
@@ -296,6 +299,11 @@ const SnkDetailView = class {
296
299
  async componentDidLoad() {
297
300
  await this.observerPropsCustomEditor(this.customEditors);
298
301
  await this.observeCustomRenders(this.customRenders);
302
+ this.initKeyboardManager();
303
+ }
304
+ disconnectedCallback() {
305
+ var _a;
306
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
299
307
  }
300
308
  async dataUnitActionHandler(action) {
301
309
  if (action.type === Action.FIELD_INVALIDATED) {
@@ -309,11 +317,55 @@ const SnkDetailView = class {
309
317
  normalizeBranchGuideId(id) {
310
318
  return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
311
319
  }
320
+ getSettingsListForm() {
321
+ const hardList = [{
322
+ value: StringUtils.generateUUID(),
323
+ label: this.messagesBuilder.getMessage("snkCrud.findColumn", undefined),
324
+ disableCloseOnSelect: true,
325
+ eagerInitialize: true,
326
+ itemBuilder: (_, item) => this.getFieldsSearch(item)
327
+ }];
328
+ return hardList;
329
+ }
330
+ getFieldsSearch(item) {
331
+ if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
332
+ this._hasToCreateFieldSearch = false;
333
+ this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
334
+ }
335
+ return this._fieldSearch;
336
+ }
337
+ fieldsOptionLoader(argument) {
338
+ const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
339
+ const allFields = this.getFormFields().map(field => { var _a; return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field.name); });
340
+ const filteredFields = allFields.filter(field => {
341
+ var _a, _b;
342
+ return ((_a = field.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
343
+ ((_b = field.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
344
+ });
345
+ const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
346
+ return Promise.resolve(options);
347
+ }
348
+ onSelectField(option) {
349
+ if (option == undefined) {
350
+ return;
351
+ }
352
+ this._fieldToGetFocus = option.value;
353
+ }
354
+ clearFieldToFocusHandler() {
355
+ this._fieldToGetFocus = undefined;
356
+ }
357
+ async initKeyboardManager() {
358
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
359
+ this._keyboardManager.bind(SHORTCUT_SEARCH_FIELD, async () => {
360
+ await this._snkFormView.showSearchField();
361
+ }, { description: LABEL_SEARCH_FIELD, element: this._element });
362
+ }
312
363
  render() {
313
364
  this.updateLabel();
314
365
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
315
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
366
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems), onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
316
367
  }
368
+ get _element() { return getElement(this); }
317
369
  static get watchers() { return {
318
370
  "dataUnit": ["observeDataUnit"],
319
371
  "dataState": ["observerDataState"],
@@ -1,6 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
+ import { focusOnFieldSerch, SEARCH_FIELD_FULL_WIDTH } from '@sankhyalabs/ezui/dist/collection/utils';
4
5
 
5
6
  const snkFormViewCss = ".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";
6
7
 
@@ -13,6 +14,7 @@ const SnkFormView = class {
13
14
  this._customEditors = new Map();
14
15
  this._fieldProps = new Map();
15
16
  this.levelPath = undefined;
17
+ this.fieldSearch = undefined;
16
18
  this.label = undefined;
17
19
  this.name = undefined;
18
20
  this.fields = undefined;
@@ -45,11 +47,6 @@ const SnkFormView = class {
45
47
  newCustomEditors.set(fieldName, { customEditor, detailContext });
46
48
  this._customEditors = newCustomEditors;
47
49
  }
48
- observePropsCustomEditor(newValue) {
49
- for (const fieldName in newValue) {
50
- this.addCustomEditor(fieldName, newValue[fieldName]);
51
- }
52
- }
53
50
  /**
54
51
  * Altera/adiciona uma propriedade nos metadados do campo.
55
52
  */
@@ -57,6 +54,21 @@ const SnkFormView = class {
57
54
  const props = this._fieldProps.get(fieldName) || [];
58
55
  this._fieldProps.set(fieldName, [...props, { propName, value }]);
59
56
  }
57
+ /**
58
+ * Exibe a busca de campos ancorada ao container de cabeçalho do snk-form-view.
59
+ */
60
+ async showSearchField() {
61
+ if (!this._headerContainer || !this._ezPopoverFieldColumn)
62
+ return;
63
+ const container = this._headerContainer.getBoundingClientRect();
64
+ await focusOnFieldSerch(this.fieldSearch);
65
+ this._ezPopoverFieldColumn.showUnder(this._headerContainer, { horizontalGap: container.width - (SEARCH_FIELD_FULL_WIDTH), verticalGap: container.height * -1 });
66
+ }
67
+ observePropsCustomEditor(newValue) {
68
+ for (const fieldName in newValue) {
69
+ this.addCustomEditor(fieldName, newValue[fieldName]);
70
+ }
71
+ }
60
72
  async observeFieldsProps(newValue) {
61
73
  for (const field in newValue) {
62
74
  const fieldProps = newValue[field];
@@ -163,13 +175,13 @@ const SnkFormView = class {
163
175
  }
164
176
  }
165
177
  render() {
166
- return (h(Host, { class: "ez-box__container" }, h("div", { class: "summary-header ez-flex ez-size-width--full" }, h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
178
+ return (h(Host, { class: "ez-box__container" }, h("div", { class: "summary-header ez-flex ez-size-width--full", ref: ref => this._headerContainer = ref }, h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
167
179
  h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.fixed ? "un-pin" : "push-pin", "data-element-id": ElementIDUtils.getInternalIDInfo("toggleFixed_ezFormCard"), onClick: () => this.changeFix(), title: this.fixed ? "Desafixar" : "Fixar" }), this.canExpand &&
168
180
  h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.contracted ? "chevron-down" : "chevron-up", "data-element-id": ElementIDUtils.getInternalIDInfo("toggleExpand_ezFormCard"), onClick: () => this.changeContracted(), title: this.contracted ? "Expandir" : "Resumir" }))), h("slot", null), this.contracted
169
181
  ?
170
182
  h("snk-form-summary", { summary: this.getCardSummary() })
171
183
  :
172
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
184
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) }), this.fieldSearch && h("ez-popover", { ref: elem => (this._ezPopoverFieldColumn = elem), overlayType: "none" }, this.fieldSearch)));
173
185
  }
174
186
  static get watchers() { return {
175
187
  "customEditors": ["observePropsCustomEditor"],
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
2
- import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
- import { T as TaskbarElement } from './taskbar-elements-c62b6c66.js';
2
+ import { KeyboardManager, Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
+ import { T as TaskbarElement } from './taskbar-elements-f2cb4922.js';
4
4
  import { C as ConfigStorage } from './ConfigStorage-71e6766f.js';
5
5
  import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
6
- import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-f8b1d91e.js';
6
+ import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
8
  import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-b3871edb.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
@@ -16,6 +16,7 @@ import './filter-item-type.enum-d45e026f.js';
16
16
  import './form-config-fetcher-fa208a6c.js';
17
17
  import './constants-7db1128a.js';
18
18
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
19
+ import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
19
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
20
21
  import './IFetchDataExporterParams-d73bed3d.js';
21
22
  import './PrintUtils-3e4ff0f5.js';
@@ -86,6 +87,7 @@ const SnkGrid = class {
86
87
  this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
87
88
  this._customEditors = new Map();
88
89
  this._customRenders = new Map();
90
+ this._keyboardManager = new KeyboardManager();
89
91
  this._topTaskbarProcessor = new TaskbarProcessor({
90
92
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
91
93
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -147,6 +149,7 @@ const SnkGrid = class {
147
149
  this.enableGridInsert = false;
148
150
  this.outlineMode = false;
149
151
  this.strategyExporter = ExporterStrategy.SERVER_SIDE;
152
+ this.useSearchColumn = true;
150
153
  this.multipleEditionEnabled = true;
151
154
  }
152
155
  getGridHeaderSelectedBtns() {
@@ -199,12 +202,6 @@ const SnkGrid = class {
199
202
  async getFilterBar() {
200
203
  return this._snkFilterBar;
201
204
  }
202
- /**
203
- * Abre o localizador de colunas
204
- */
205
- async findColumn() {
206
- await openFieldSearch(this._moreOptions, this._columnSearch);
207
- }
208
205
  /**
209
206
  * Registra um editor customizado para campos da grade e formulário
210
207
  */
@@ -503,11 +500,10 @@ const SnkGrid = class {
503
500
  };
504
501
  return primaryButtonLookup[this.presentationMode];
505
502
  }
506
- getColumnSearch(actionButton, item) {
503
+ getColumnSearch(item) {
507
504
  if (this._columnSearch != undefined) {
508
505
  return this._columnSearch;
509
506
  }
510
- this._moreOptions = actionButton;
511
507
  this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
512
508
  this._grid.filterColumns(argument).then((columns) => {
513
509
  accept(columns
@@ -517,19 +513,12 @@ const SnkGrid = class {
517
513
  }), (option) => {
518
514
  if (option != undefined) {
519
515
  this._grid.locateColumn(option.value);
520
- actionButton.hideActions();
521
516
  }
522
517
  });
523
518
  return this._columnSearch;
524
519
  }
525
520
  getActionsList() {
526
- const hardList = [{
527
- value: StringUtils.generateUUID(),
528
- label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
529
- disableCloseOnSelect: true,
530
- eagerInitialize: true,
531
- itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
532
- }];
521
+ const hardList = [];
533
522
  if (this.enableGridInsert) {
534
523
  hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
535
524
  this._enableContinuousInsert = !this._enableContinuousInsert;
@@ -544,6 +533,16 @@ const SnkGrid = class {
544
533
  }
545
534
  return hardList.concat(this.actionsList);
546
535
  }
536
+ getActionsSettingsList() {
537
+ const hardList = [{
538
+ value: StringUtils.generateUUID(),
539
+ label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
540
+ disableCloseOnSelect: true,
541
+ eagerInitialize: true,
542
+ itemBuilder: (_, item) => this.getColumnSearch(item)
543
+ }];
544
+ return hardList;
545
+ }
547
546
  handleFilterConfigUpdated(filterConfig) {
548
547
  if (!filterConfig.length) {
549
548
  this._showSnkFilterBar = false;
@@ -567,8 +566,8 @@ const SnkGrid = class {
567
566
  if (!this._dataUnit) {
568
567
  return undefined;
569
568
  }
570
- return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
571
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
569
+ return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
570
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, useSearchColumn: this.useSearchColumn }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId, actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
572
571
  }
573
572
  get _element() { return getElement(this); }
574
573
  static get watchers() { return {
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
2
- import { ObjectUtils, Action, ElementIDUtils } from '@sankhyalabs/core';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
2
+ import { ObjectUtils, StringUtils, Action, KeyboardManager, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-be490a33.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-f8b1d91e.js';
6
- import { T as TaskbarElement } from './taskbar-elements-c62b6c66.js';
5
+ import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
6
+ import { T as TaskbarElement } from './taskbar-elements-f2cb4922.js';
7
7
  import { V as VIEW_MODE } from './constants-7db1128a.js';
8
8
  import './DataFetcher-88e56266.js';
9
9
  import './ISave-5efafc97.js';
@@ -14,6 +14,7 @@ import './dataunit-fetcher-0e025732.js';
14
14
  import './filter-item-type.enum-d45e026f.js';
15
15
  import './form-config-fetcher-fa208a6c.js';
16
16
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
17
+ import { buildFieldSearch, SHORTCUT_SEARCH_FIELD, LABEL_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
17
18
 
18
19
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
19
20
 
@@ -53,6 +54,7 @@ const SnkGuidesViewer = class {
53
54
  this._customEditors = undefined;
54
55
  this._customRenders = undefined;
55
56
  this._fieldsProps = {};
57
+ this._mainForm = undefined;
56
58
  }
57
59
  observeDataUnit() {
58
60
  this.loadGuides(true);
@@ -79,12 +81,6 @@ const SnkGuidesViewer = class {
79
81
  this._formEditorConfigManager = masterConfig ? this._configManager : this._currentDetail.formConfigManager;
80
82
  this._formEditorDataUnit = masterConfig ? this.dataUnit : this._currentDetail.dataUnit;
81
83
  }
82
- /**
83
- * Abre o localizador de campos
84
- */
85
- async findField() {
86
- await openFieldSearch(this._moreOptions, this._fieldSearch);
87
- }
88
84
  /**
89
85
  * Registra um editor customizado para campos da grade e formulário
90
86
  */
@@ -329,7 +325,7 @@ const SnkGuidesViewer = class {
329
325
  const sheet = this._masterFormMetadata.getSheet(cardId);
330
326
  if (sheet) {
331
327
  const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
332
- content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
328
+ content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
333
329
  }
334
330
  }
335
331
  return content;
@@ -429,12 +425,10 @@ const SnkGuidesViewer = class {
429
425
  }
430
426
  this._guideHasChanged = false;
431
427
  }
432
- getFieldsSearch(actionButton, item) {
428
+ getFieldsSearch(item) {
433
429
  if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
434
430
  this._hasToCreateFieldSearch = false;
435
- this._moreOptions = actionButton;
436
- actionButton.addEventListener("taskbarActionsButtonDisconnected", () => this._hasToCreateFieldSearch = true);
437
- this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option, actionButton));
431
+ this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
438
432
  }
439
433
  return this._fieldSearch;
440
434
  }
@@ -442,7 +436,7 @@ const SnkGuidesViewer = class {
442
436
  return Promise.resolve(this._configManager.getFieldsList(argument)
443
437
  .map(field => ({ value: field.name, label: field.label })));
444
438
  }
445
- onSelectField(option, actionButton) {
439
+ onSelectField(option) {
446
440
  if (option == undefined) {
447
441
  return;
448
442
  }
@@ -451,24 +445,28 @@ const SnkGuidesViewer = class {
451
445
  if (fieldGuideName !== this.selectedGuide.id) {
452
446
  this.changeGuideHandler(fieldGuideName);
453
447
  }
454
- actionButton.hideActions();
455
448
  }
456
449
  getActionsList() {
450
+ var _a;
451
+ const hardList = [];
452
+ if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
453
+ return hardList.concat((_a = this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList)) !== null && _a !== void 0 ? _a : []);
454
+ }
455
+ return hardList.concat(this.actionsList);
456
+ }
457
+ getSettingsListForm() {
457
458
  const hardList = [{
458
- value: "",
459
+ value: StringUtils.generateUUID(),
459
460
  label: this.getMessage("snkCrud.findColumn"),
460
461
  disableCloseOnSelect: true,
461
462
  eagerInitialize: true,
462
- itemBuilder: (actionButton, item) => this.getFieldsSearch(actionButton, item)
463
+ itemBuilder: (_, item) => this.getFieldsSearch(item)
463
464
  }];
464
- if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
465
- return hardList.concat(this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList));
466
- }
467
- return hardList.concat(this.actionsList);
465
+ return hardList;
468
466
  }
469
467
  buildTaskBar() {
470
468
  var _a;
471
- return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
469
+ return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), actionsSettingsList: this.getSettingsListForm(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
472
470
  }
473
471
  async dataUnitActionHandler(action) {
474
472
  var _a;
@@ -544,11 +542,24 @@ const SnkGuidesViewer = class {
544
542
  }
545
543
  componentDidLoad() {
546
544
  this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
545
+ this.initKeyboardManager();
546
+ }
547
+ disconnectedCallback() {
548
+ var _a;
549
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
550
+ }
551
+ async initKeyboardManager() {
552
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
553
+ this._keyboardManager.bind(SHORTCUT_SEARCH_FIELD, async () => {
554
+ if (!this._mainForm)
555
+ return;
556
+ await this._mainForm.showSearchField();
557
+ }, { description: LABEL_SEARCH_FIELD, element: this._element });
547
558
  }
548
559
  render() {
549
560
  var _a, _b;
550
561
  if (this._formEditorConfigManager != undefined) {
551
- return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }));
562
+ return (h("snk-form-config", { tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }));
552
563
  }
553
564
  if (!this.dataUnit || !this._configManager.isLoaded) {
554
565
  return;
@@ -571,6 +582,7 @@ const SnkGuidesViewer = class {
571
582
  fieldsProps: this._fieldsProps
572
583
  }), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
573
584
  }
585
+ get _element() { return getElement(this); }
574
586
  static get watchers() { return {
575
587
  "dataUnit": ["observeDataUnit"],
576
588
  "dataState": ["observeDataState"],
@@ -1,4 +1,4 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-75e06feb.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-72953334.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import './SnkFormConfigManager-be490a33.js';
@@ -10,8 +10,8 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
11
  import './constants-7db1128a.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/form';
13
- import './field-search-f8b1d91e.js';
14
- import './taskbar-elements-c62b6c66.js';
13
+ import './taskbar-processor-3436124c.js';
14
+ import './taskbar-elements-f2cb4922.js';
15
15
  import './index-b40568ff.js';
16
16
  import './index-bdf75557.js';
17
17
  import './ISave-5efafc97.js';
@@ -21,3 +21,4 @@ import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
21
21
  import '@sankhyalabs/core/dist/utils/SortingUtils';
22
22
  import './ResourceIDUtils-a114189a.js';
23
23
  import '@sankhyalabs/core/dist/dataunit/DataUnit';
24
+ import '@sankhyalabs/ezui/dist/collection/utils';