@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.
- package/dist/cjs/{field-search-ca27041a.js → field-search-f56aa7d6.js} +29 -1
- package/dist/cjs/index-f9e81701.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button.cjs.entry.js → snk-actions-button_2.cjs.entry.js} +113 -0
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +11 -25
- package/dist/cjs/{snk-guides-viewer-aea15ee0.js → snk-guides-viewer-9342bca1.js} +6 -16
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +15 -36
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-39949c7a.js → taskbar-elements-b8c428a9.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +4 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -18
- package/dist/collection/components/snk-grid/snk-grid.js +20 -37
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +15 -36
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +6 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +301 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +0 -1
- package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +28 -1
- package/dist/components/field-search.js +29 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-attach2.js +20 -14
- package/dist/components/snk-crud.js +69 -63
- package/dist/components/snk-detail-view2.js +95 -94
- package/dist/components/snk-grid2.js +53 -61
- package/dist/components/snk-simple-crud2.js +31 -46
- package/dist/components/snk-taskbar2.js +15 -9
- package/dist/components/taskbar-actions-button.d.ts +11 -0
- package/dist/components/taskbar-actions-button.js +6 -0
- package/dist/components/taskbar-actions-button2.js +137 -0
- package/dist/esm/{field-search-c6938ee4.js → field-search-efbe307f.js} +29 -2
- package/dist/esm/index-a7d3d3f1.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button.entry.js → snk-actions-button_2.entry.js} +114 -2
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +12 -26
- package/dist/esm/{snk-guides-viewer-717a3847.js → snk-guides-viewer-9ce9588c.js} +6 -16
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +16 -37
- package/dist/esm/snk-taskbar.entry.js +1 -1
- package/dist/esm/{taskbar-elements-0a6b8b95.js → taskbar-elements-26c981af.js} +3 -3
- package/dist/sankhyablocks/p-145c4434.js +1 -0
- package/dist/sankhyablocks/p-17dda7a2.entry.js +1 -0
- package/dist/sankhyablocks/{p-63f56d48.entry.js → p-311c6173.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2417c492.entry.js → p-44e894af.entry.js} +1 -1
- package/dist/sankhyablocks/p-78777ae0.entry.js +1 -0
- package/dist/sankhyablocks/{p-d4fb9642.entry.js → p-953346b9.entry.js} +1 -1
- package/dist/sankhyablocks/p-9c3229fc.entry.js +1 -0
- package/dist/sankhyablocks/p-c2495304.js +1 -0
- package/dist/sankhyablocks/p-dd6a8377.js +1 -0
- package/dist/sankhyablocks/p-e138e7d4.entry.js +1 -0
- package/dist/sankhyablocks/{p-075eddfd.entry.js → p-e1b29d4c.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -4
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +6 -5
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +58 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +16 -0
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
- package/dist/types/components.d.ts +65 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-1657804e.entry.js +0 -1
- package/dist/sankhyablocks/p-3ecd72a4.js +0 -1
- package/dist/sankhyablocks/p-6e0cbef1.entry.js +0 -1
- package/dist/sankhyablocks/p-7a7607c8.js +0 -1
- package/dist/sankhyablocks/p-9f7bc9be.entry.js +0 -1
- package/dist/sankhyablocks/p-b525d1ae.entry.js +0 -1
- package/dist/sankhyablocks/p-c9841939.js +0 -1
@@ -1,28 +1,29 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
|
2
|
-
import { ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
|
2
|
+
import { ElementIDUtils, ApplicationContext, StringUtils, DataType } from '@sankhyalabs/core';
|
3
3
|
import { SortMode, UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
|
-
import { d as defineCustomElement$
|
4
|
+
import { d as defineCustomElement$2, T as TaskbarElement } from './snk-taskbar2.js';
|
5
5
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
6
6
|
import { P as PresentationMode } from './index2.js';
|
7
|
-
import { T as TaskbarProcessor, S as SnkMultiSelectionListDataSource, b as buildFieldSearch } from './field-search.js';
|
7
|
+
import { T as TaskbarProcessor, S as SnkMultiSelectionListDataSource, o as openFieldSearch, b as buildFieldSearch } from './field-search.js';
|
8
8
|
import { s as store } from './index3.js';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
|
-
import { d as defineCustomElement$
|
11
|
-
import { d as defineCustomElement$
|
12
|
-
import { d as defineCustomElement$
|
13
|
-
import { d as defineCustomElement$
|
14
|
-
import { d as defineCustomElement$
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import { d as defineCustomElement$
|
17
|
-
import { d as defineCustomElement$
|
18
|
-
import { d as defineCustomElement$
|
19
|
-
import { d as defineCustomElement$
|
20
|
-
import { d as defineCustomElement$
|
21
|
-
import { d as defineCustomElement$
|
22
|
-
import { d as defineCustomElement$
|
23
|
-
import { d as defineCustomElement$
|
24
|
-
import { d as defineCustomElement$
|
25
|
-
import { d as defineCustomElement$
|
10
|
+
import { d as defineCustomElement$i } from './snk-actions-button2.js';
|
11
|
+
import { d as defineCustomElement$h } from './snk-data-exporter2.js';
|
12
|
+
import { d as defineCustomElement$g } from './snk-exporter-email-sender2.js';
|
13
|
+
import { d as defineCustomElement$f } from './snk-expression-group2.js';
|
14
|
+
import { d as defineCustomElement$e } from './snk-expression-item2.js';
|
15
|
+
import { d as defineCustomElement$d } from './snk-filter-advanced-mode2.js';
|
16
|
+
import { d as defineCustomElement$c } from './snk-filter-assistent-mode2.js';
|
17
|
+
import { d as defineCustomElement$b } from './snk-filter-bar2.js';
|
18
|
+
import { d as defineCustomElement$a } from './snk-filter-detail2.js';
|
19
|
+
import { d as defineCustomElement$9 } from './snk-filter-field-search2.js';
|
20
|
+
import { d as defineCustomElement$8 } from './snk-filter-item2.js';
|
21
|
+
import { d as defineCustomElement$7 } from './snk-filter-param-config2.js';
|
22
|
+
import { d as defineCustomElement$6 } from './snk-grid-config2.js';
|
23
|
+
import { d as defineCustomElement$5 } from './snk-personalized-filter2.js';
|
24
|
+
import { d as defineCustomElement$4 } from './snk-select-box2.js';
|
25
|
+
import { d as defineCustomElement$3 } from './snk-simple-bar2.js';
|
26
|
+
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
26
27
|
|
27
28
|
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
28
29
|
|
@@ -98,28 +99,18 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
98
99
|
var _a;
|
99
100
|
(_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.reload();
|
100
101
|
}
|
101
|
-
/**
|
102
|
-
* Abre o localizador de colunas
|
103
|
-
*/
|
104
|
-
async findColumn() {
|
105
|
-
if (!this._moreOptions) {
|
106
|
-
return;
|
107
|
-
}
|
108
|
-
if (!(await this._moreOptions.isOpened())) {
|
109
|
-
this._moreOptions.showActions();
|
110
|
-
}
|
111
|
-
if (this._columnSearch) {
|
112
|
-
const realElement = this._columnSearch["$elm$"];
|
113
|
-
realElement.value = null;
|
114
|
-
requestAnimationFrame(() => realElement.setFocus());
|
115
|
-
}
|
116
|
-
}
|
117
102
|
/**
|
118
103
|
* Retorna o elemento da filter-bar da grade.
|
119
104
|
*/
|
120
105
|
async getFilterBar() {
|
121
106
|
return this._snkFilterBar;
|
122
107
|
}
|
108
|
+
/**
|
109
|
+
* Abre o localizador de colunas
|
110
|
+
*/
|
111
|
+
async findColumn() {
|
112
|
+
await openFieldSearch(this._moreOptions, this._columnSearch);
|
113
|
+
}
|
123
114
|
openGridConfig() {
|
124
115
|
this._grid.getColumnsState()
|
125
116
|
.then((gridColumns) => {
|
@@ -362,12 +353,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
362
353
|
if (this._columnSearch != undefined) {
|
363
354
|
return this._columnSearch;
|
364
355
|
}
|
365
|
-
actionButton.addEventListener("ezPopoverOpen", () => {
|
366
|
-
if (this._columnSearch) {
|
367
|
-
const realElement = this._columnSearch["$elm$"];
|
368
|
-
realElement.value = null;
|
369
|
-
}
|
370
|
-
});
|
371
356
|
this._moreOptions = actionButton;
|
372
357
|
this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
373
358
|
this._grid.filterColumns(argument).then((columns) => {
|
@@ -385,8 +370,10 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
385
370
|
}
|
386
371
|
getActionsList() {
|
387
372
|
const hardList = [{
|
388
|
-
value:
|
373
|
+
value: StringUtils.generateUUID(),
|
389
374
|
label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
|
375
|
+
disableCloseOnSelect: true,
|
376
|
+
eagerInitialize: true,
|
390
377
|
itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
|
391
378
|
}];
|
392
379
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
@@ -442,14 +429,14 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
442
429
|
"hideConfig": [64],
|
443
430
|
"setConfig": [64],
|
444
431
|
"reloadFilterBar": [64],
|
445
|
-
"
|
446
|
-
"
|
432
|
+
"getFilterBar": [64],
|
433
|
+
"findColumn": [64]
|
447
434
|
}]);
|
448
435
|
function defineCustomElement() {
|
449
436
|
if (typeof customElements === "undefined") {
|
450
437
|
return;
|
451
438
|
}
|
452
|
-
const components = ["snk-grid", "snk-actions-button", "snk-data-exporter", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-grid-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-taskbar"];
|
439
|
+
const components = ["snk-grid", "snk-actions-button", "snk-data-exporter", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-grid-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-taskbar", "taskbar-actions-button"];
|
453
440
|
components.forEach(tagName => { switch (tagName) {
|
454
441
|
case "snk-grid":
|
455
442
|
if (!customElements.get(tagName)) {
|
@@ -458,85 +445,90 @@ function defineCustomElement() {
|
|
458
445
|
break;
|
459
446
|
case "snk-actions-button":
|
460
447
|
if (!customElements.get(tagName)) {
|
461
|
-
defineCustomElement$
|
448
|
+
defineCustomElement$i();
|
462
449
|
}
|
463
450
|
break;
|
464
451
|
case "snk-data-exporter":
|
465
452
|
if (!customElements.get(tagName)) {
|
466
|
-
defineCustomElement$
|
453
|
+
defineCustomElement$h();
|
467
454
|
}
|
468
455
|
break;
|
469
456
|
case "snk-exporter-email-sender":
|
470
457
|
if (!customElements.get(tagName)) {
|
471
|
-
defineCustomElement$
|
458
|
+
defineCustomElement$g();
|
472
459
|
}
|
473
460
|
break;
|
474
461
|
case "snk-expression-group":
|
475
462
|
if (!customElements.get(tagName)) {
|
476
|
-
defineCustomElement$
|
463
|
+
defineCustomElement$f();
|
477
464
|
}
|
478
465
|
break;
|
479
466
|
case "snk-expression-item":
|
480
467
|
if (!customElements.get(tagName)) {
|
481
|
-
defineCustomElement$
|
468
|
+
defineCustomElement$e();
|
482
469
|
}
|
483
470
|
break;
|
484
471
|
case "snk-filter-advanced-mode":
|
485
472
|
if (!customElements.get(tagName)) {
|
486
|
-
defineCustomElement$
|
473
|
+
defineCustomElement$d();
|
487
474
|
}
|
488
475
|
break;
|
489
476
|
case "snk-filter-assistent-mode":
|
490
477
|
if (!customElements.get(tagName)) {
|
491
|
-
defineCustomElement$
|
478
|
+
defineCustomElement$c();
|
492
479
|
}
|
493
480
|
break;
|
494
481
|
case "snk-filter-bar":
|
495
482
|
if (!customElements.get(tagName)) {
|
496
|
-
defineCustomElement$
|
483
|
+
defineCustomElement$b();
|
497
484
|
}
|
498
485
|
break;
|
499
486
|
case "snk-filter-detail":
|
500
487
|
if (!customElements.get(tagName)) {
|
501
|
-
defineCustomElement$
|
488
|
+
defineCustomElement$a();
|
502
489
|
}
|
503
490
|
break;
|
504
491
|
case "snk-filter-field-search":
|
505
492
|
if (!customElements.get(tagName)) {
|
506
|
-
defineCustomElement$
|
493
|
+
defineCustomElement$9();
|
507
494
|
}
|
508
495
|
break;
|
509
496
|
case "snk-filter-item":
|
510
497
|
if (!customElements.get(tagName)) {
|
511
|
-
defineCustomElement$
|
498
|
+
defineCustomElement$8();
|
512
499
|
}
|
513
500
|
break;
|
514
501
|
case "snk-filter-param-config":
|
515
502
|
if (!customElements.get(tagName)) {
|
516
|
-
defineCustomElement$
|
503
|
+
defineCustomElement$7();
|
517
504
|
}
|
518
505
|
break;
|
519
506
|
case "snk-grid-config":
|
520
507
|
if (!customElements.get(tagName)) {
|
521
|
-
defineCustomElement$
|
508
|
+
defineCustomElement$6();
|
522
509
|
}
|
523
510
|
break;
|
524
511
|
case "snk-personalized-filter":
|
525
512
|
if (!customElements.get(tagName)) {
|
526
|
-
defineCustomElement$
|
513
|
+
defineCustomElement$5();
|
527
514
|
}
|
528
515
|
break;
|
529
516
|
case "snk-select-box":
|
530
517
|
if (!customElements.get(tagName)) {
|
531
|
-
defineCustomElement$
|
518
|
+
defineCustomElement$4();
|
532
519
|
}
|
533
520
|
break;
|
534
521
|
case "snk-simple-bar":
|
535
522
|
if (!customElements.get(tagName)) {
|
536
|
-
defineCustomElement$
|
523
|
+
defineCustomElement$3();
|
537
524
|
}
|
538
525
|
break;
|
539
526
|
case "snk-taskbar":
|
527
|
+
if (!customElements.get(tagName)) {
|
528
|
+
defineCustomElement$2();
|
529
|
+
}
|
530
|
+
break;
|
531
|
+
case "taskbar-actions-button":
|
540
532
|
if (!customElements.get(tagName)) {
|
541
533
|
defineCustomElement$1();
|
542
534
|
}
|
@@ -1,19 +1,20 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { ObjectUtils, ApplicationContext, DataType, UserInterface, JSUtils, FloatingManager } from '@sankhyalabs/core';
|
2
|
+
import { ObjectUtils, ApplicationContext, DataType, UserInterface, StringUtils, JSUtils, FloatingManager } from '@sankhyalabs/core';
|
3
3
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
|
4
|
-
import { T as TaskbarElement, d as defineCustomElement$
|
4
|
+
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
5
5
|
import './DataFetcher.js';
|
6
6
|
import { I as InMemoryLoader } from './dataunit-fetcher.js';
|
7
7
|
import { P as PresentationMode } from './index2.js';
|
8
|
-
import { d as defineCustomElement$
|
8
|
+
import { d as defineCustomElement$6 } from './snk-actions-button2.js';
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './filter-item-type.enum.js';
|
12
12
|
import './form-config-fetcher.js';
|
13
|
-
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, b as buildFieldSearch } from './field-search.js';
|
14
|
-
import { d as defineCustomElement$
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import { d as defineCustomElement$
|
13
|
+
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search.js';
|
14
|
+
import { d as defineCustomElement$5 } from './snk-data-exporter2.js';
|
15
|
+
import { d as defineCustomElement$4 } from './snk-data-unit2.js';
|
16
|
+
import { d as defineCustomElement$3 } from './snk-exporter-email-sender2.js';
|
17
|
+
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
17
18
|
|
18
19
|
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
|
19
20
|
|
@@ -196,12 +197,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
196
197
|
if (this._columnSearch != undefined) {
|
197
198
|
return this._columnSearch;
|
198
199
|
}
|
199
|
-
actionButton.addEventListener("ezPopoverOpen", () => {
|
200
|
-
if (this._columnSearch) {
|
201
|
-
const realElement = this._columnSearch["$elm$"];
|
202
|
-
realElement.value = null;
|
203
|
-
}
|
204
|
-
});
|
205
200
|
this._moreOptions = actionButton;
|
206
201
|
this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
207
202
|
this._grid.filterColumns(argument).then((columns) => {
|
@@ -210,9 +205,10 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
210
205
|
.map(column => ({ label: column.label, value: column.name })));
|
211
206
|
});
|
212
207
|
}), (option) => {
|
208
|
+
var _a;
|
213
209
|
if (option != undefined) {
|
214
210
|
this._grid.locateColumn(option.value);
|
215
|
-
actionButton.
|
211
|
+
(_a = actionButton["hideActions"]) === null || _a === void 0 ? void 0 : _a.call(actionButton);
|
216
212
|
}
|
217
213
|
});
|
218
214
|
return this._columnSearch;
|
@@ -254,14 +250,16 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
254
250
|
getActionsList() {
|
255
251
|
var _a, _b;
|
256
252
|
return [{
|
257
|
-
value:
|
253
|
+
value: StringUtils.generateUUID(),
|
258
254
|
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
|
255
|
+
disableCloseOnSelect: true,
|
256
|
+
eagerInitialize: true,
|
259
257
|
itemBuilder: (actionButton, item) => (this._currentViewMode === VIEW_MODE.GRID)
|
260
258
|
? this.getColumnSearch(actionButton, item)
|
261
259
|
: this.getFieldSearch(actionButton, item)
|
262
260
|
}];
|
263
261
|
}
|
264
|
-
keyDownListener(event) {
|
262
|
+
async keyDownListener(event) {
|
265
263
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
266
264
|
return;
|
267
265
|
}
|
@@ -273,39 +271,21 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
273
271
|
}
|
274
272
|
FloatingManager.closeAll();
|
275
273
|
if (this._currentViewMode === VIEW_MODE.GRID) {
|
276
|
-
this.findColumn();
|
274
|
+
await this.findColumn();
|
277
275
|
}
|
278
276
|
else {
|
279
|
-
this.findField();
|
277
|
+
await this.findField();
|
280
278
|
}
|
281
279
|
event.preventDefault();
|
282
280
|
}
|
283
281
|
async findField() {
|
284
|
-
|
285
|
-
return;
|
286
|
-
}
|
287
|
-
if (!(await this._moreOptions.isOpened())) {
|
288
|
-
this._moreOptions.showActions();
|
289
|
-
return;
|
290
|
-
}
|
291
|
-
if (this._fieldSearch) {
|
292
|
-
const realElement = this._fieldSearch["$elm$"];
|
293
|
-
realElement.value = null;
|
294
|
-
requestAnimationFrame(() => realElement.setFocus());
|
295
|
-
}
|
282
|
+
await this.openSeach(this._fieldSearch);
|
296
283
|
}
|
297
284
|
async findColumn() {
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
this._moreOptions.showActions();
|
303
|
-
}
|
304
|
-
if (this._columnSearch) {
|
305
|
-
const realElement = this._columnSearch["$elm$"];
|
306
|
-
realElement.value = null;
|
307
|
-
requestAnimationFrame(() => realElement.setFocus());
|
308
|
-
}
|
285
|
+
await this.openSeach(this._columnSearch);
|
286
|
+
}
|
287
|
+
async openSeach(fieldSearch) {
|
288
|
+
await openFieldSearch(this._moreOptions, fieldSearch);
|
309
289
|
}
|
310
290
|
clearFieldToFocusHandler() {
|
311
291
|
this._fieldToGetFocus = undefined;
|
@@ -352,7 +332,7 @@ function defineCustomElement() {
|
|
352
332
|
if (typeof customElements === "undefined") {
|
353
333
|
return;
|
354
334
|
}
|
355
|
-
const components = ["snk-simple-crud", "snk-actions-button", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-taskbar"];
|
335
|
+
const components = ["snk-simple-crud", "snk-actions-button", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-taskbar", "taskbar-actions-button"];
|
356
336
|
components.forEach(tagName => { switch (tagName) {
|
357
337
|
case "snk-simple-crud":
|
358
338
|
if (!customElements.get(tagName)) {
|
@@ -361,25 +341,30 @@ function defineCustomElement() {
|
|
361
341
|
break;
|
362
342
|
case "snk-actions-button":
|
363
343
|
if (!customElements.get(tagName)) {
|
364
|
-
defineCustomElement$
|
344
|
+
defineCustomElement$6();
|
365
345
|
}
|
366
346
|
break;
|
367
347
|
case "snk-data-exporter":
|
368
348
|
if (!customElements.get(tagName)) {
|
369
|
-
defineCustomElement$
|
349
|
+
defineCustomElement$5();
|
370
350
|
}
|
371
351
|
break;
|
372
352
|
case "snk-data-unit":
|
373
353
|
if (!customElements.get(tagName)) {
|
374
|
-
defineCustomElement$
|
354
|
+
defineCustomElement$4();
|
375
355
|
}
|
376
356
|
break;
|
377
357
|
case "snk-exporter-email-sender":
|
378
358
|
if (!customElements.get(tagName)) {
|
379
|
-
defineCustomElement$
|
359
|
+
defineCustomElement$3();
|
380
360
|
}
|
381
361
|
break;
|
382
362
|
case "snk-taskbar":
|
363
|
+
if (!customElements.get(tagName)) {
|
364
|
+
defineCustomElement$2();
|
365
|
+
}
|
366
|
+
break;
|
367
|
+
case "taskbar-actions-button":
|
383
368
|
if (!customElements.get(tagName)) {
|
384
369
|
defineCustomElement$1();
|
385
370
|
}
|
@@ -3,9 +3,10 @@ import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/co
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
4
4
|
import { P as PresentationMode } from './index2.js';
|
5
5
|
import { s as store } from './index3.js';
|
6
|
-
import { d as defineCustomElement$
|
7
|
-
import { d as defineCustomElement$
|
8
|
-
import { d as defineCustomElement$
|
6
|
+
import { d as defineCustomElement$4 } from './snk-actions-button2.js';
|
7
|
+
import { d as defineCustomElement$3 } from './snk-data-exporter2.js';
|
8
|
+
import { d as defineCustomElement$2 } from './snk-exporter-email-sender2.js';
|
9
|
+
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
9
10
|
|
10
11
|
var TaskbarElement;
|
11
12
|
(function (TaskbarElement) {
|
@@ -92,7 +93,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
92
93
|
case TaskbarElement.CONFIGURATOR:
|
93
94
|
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
94
95
|
case TaskbarElement.MORE_OPTIONS:
|
95
|
-
return actionButton(element,
|
96
|
+
return actionButton(element, dataElementId, title, isEnabled, actions, action);
|
96
97
|
case TaskbarElement.DIVIDER:
|
97
98
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
|
98
99
|
case TaskbarElement.DATA_EXPORTER:
|
@@ -114,9 +115,9 @@ function iconTextButton(iconName, name, className, dataElementId, text, title, a
|
|
114
115
|
return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
115
116
|
h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
116
117
|
}
|
117
|
-
function actionButton(element,
|
118
|
+
function actionButton(element, dataElementId, title, isEnabled, actions, action) {
|
118
119
|
return actions && actions.length > 0
|
119
|
-
? h("
|
120
|
+
? h("taskbar-actions-button", { key: dataElementId, title: title, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value) })
|
120
121
|
: undefined;
|
121
122
|
}
|
122
123
|
|
@@ -416,7 +417,7 @@ function defineCustomElement() {
|
|
416
417
|
if (typeof customElements === "undefined") {
|
417
418
|
return;
|
418
419
|
}
|
419
|
-
const components = ["snk-taskbar", "snk-actions-button", "snk-data-exporter", "snk-exporter-email-sender"];
|
420
|
+
const components = ["snk-taskbar", "snk-actions-button", "snk-data-exporter", "snk-exporter-email-sender", "taskbar-actions-button"];
|
420
421
|
components.forEach(tagName => { switch (tagName) {
|
421
422
|
case "snk-taskbar":
|
422
423
|
if (!customElements.get(tagName)) {
|
@@ -425,15 +426,20 @@ function defineCustomElement() {
|
|
425
426
|
break;
|
426
427
|
case "snk-actions-button":
|
427
428
|
if (!customElements.get(tagName)) {
|
428
|
-
defineCustomElement$
|
429
|
+
defineCustomElement$4();
|
429
430
|
}
|
430
431
|
break;
|
431
432
|
case "snk-data-exporter":
|
432
433
|
if (!customElements.get(tagName)) {
|
433
|
-
defineCustomElement$
|
434
|
+
defineCustomElement$3();
|
434
435
|
}
|
435
436
|
break;
|
436
437
|
case "snk-exporter-email-sender":
|
438
|
+
if (!customElements.get(tagName)) {
|
439
|
+
defineCustomElement$2();
|
440
|
+
}
|
441
|
+
break;
|
442
|
+
case "taskbar-actions-button":
|
437
443
|
if (!customElements.get(tagName)) {
|
438
444
|
defineCustomElement$1();
|
439
445
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface TaskbarActionsButton extends Components.TaskbarActionsButton, HTMLElement {}
|
4
|
+
export const TaskbarActionsButton: {
|
5
|
+
prototype: TaskbarActionsButton;
|
6
|
+
new (): TaskbarActionsButton;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { T as TaskbarActionsButton$1, d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
2
|
+
|
3
|
+
const TaskbarActionsButton = TaskbarActionsButton$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { TaskbarActionsButton, defineCustomElement };
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
+
|
3
|
+
const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";
|
4
|
+
|
5
|
+
const TaskbarActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
6
|
+
constructor() {
|
7
|
+
super();
|
8
|
+
this.__registerHost();
|
9
|
+
this.taskbarActionSelected = createEvent(this, "taskbarActionSelected", 7);
|
10
|
+
this.taskbarActionsOpened = createEvent(this, "taskbarActionsOpened", 7);
|
11
|
+
this.taskbarActionsButtonDisconnected = createEvent(this, "taskbarActionsButtonDisconnected", 7);
|
12
|
+
this._showDropdown = false;
|
13
|
+
this.title = undefined;
|
14
|
+
this.enabled = undefined;
|
15
|
+
this.actions = undefined;
|
16
|
+
}
|
17
|
+
async handleKeyDown(event) {
|
18
|
+
if (event.key === 'Escape' || event.key === 'Esc') {
|
19
|
+
await this.hideActions();
|
20
|
+
}
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* Exibe a lista de ações.
|
24
|
+
*/
|
25
|
+
async showActions() {
|
26
|
+
this._showDropdown = true;
|
27
|
+
requestAnimationFrame(() => {
|
28
|
+
this._element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
|
29
|
+
});
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Esaconde a lista de ações.
|
33
|
+
*/
|
34
|
+
async hideActions() {
|
35
|
+
this._showDropdown = false;
|
36
|
+
}
|
37
|
+
/**
|
38
|
+
* Informa se a lista de ações está aberta.
|
39
|
+
*/
|
40
|
+
async isOpened() {
|
41
|
+
return this._showDropdown;
|
42
|
+
}
|
43
|
+
controlDropdown() {
|
44
|
+
this._showDropdown = !this._showDropdown;
|
45
|
+
}
|
46
|
+
loadItems() {
|
47
|
+
return this.actions.filter(action => action !== undefined).map(action => {
|
48
|
+
var _a;
|
49
|
+
return {
|
50
|
+
id: action.value,
|
51
|
+
label: action.label,
|
52
|
+
value: action.value,
|
53
|
+
type: (_a = action.type) !== null && _a !== void 0 ? _a : 'item',
|
54
|
+
children: action.children,
|
55
|
+
iconName: action.iconName,
|
56
|
+
subAction: action.subAction,
|
57
|
+
group: action.group,
|
58
|
+
disableCloseOnSelect: action.disableCloseOnSelect,
|
59
|
+
};
|
60
|
+
});
|
61
|
+
}
|
62
|
+
canShowDropdown() {
|
63
|
+
var _a;
|
64
|
+
return this._showDropdown && ((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
65
|
+
}
|
66
|
+
onSelectAction(iAction) {
|
67
|
+
const selectedAction = this.actions.find(action => action.value === iAction.id);
|
68
|
+
this.taskbarActionSelected.emit(selectedAction);
|
69
|
+
if (!selectedAction.disableCloseOnSelect) {
|
70
|
+
this._showDropdown = false;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
dropdownItemBuilder(item, _level) {
|
74
|
+
const itemAction = this.actions.find(action => action.value === item.id);
|
75
|
+
if (!itemAction || !itemAction.itemBuilder) {
|
76
|
+
return undefined;
|
77
|
+
}
|
78
|
+
const customContent = itemAction.itemBuilder(this._element, itemAction);
|
79
|
+
if (typeof customContent === 'string') {
|
80
|
+
return h("div", { innerHTML: customContent });
|
81
|
+
}
|
82
|
+
return customContent;
|
83
|
+
}
|
84
|
+
/**
|
85
|
+
* Existem algumas actions que precisam ser inicializadas assim que o componente é carregado,
|
86
|
+
* pois necessitam de algumas informações, como por exemplo a referência do elemento taskbar-actions-button na tela.
|
87
|
+
* É o caso do searchColumn/searhField
|
88
|
+
*/
|
89
|
+
initializeEagerItems() {
|
90
|
+
var _a;
|
91
|
+
(_a = this.actions) === null || _a === void 0 ? void 0 : _a.forEach(action => {
|
92
|
+
var _a;
|
93
|
+
if (action && action.eagerInitialize && action.itemBuilder) {
|
94
|
+
(_a = action.itemBuilder) === null || _a === void 0 ? void 0 : _a.call(action, this._element, action);
|
95
|
+
}
|
96
|
+
});
|
97
|
+
}
|
98
|
+
componentDidLoad() {
|
99
|
+
this.initializeEagerItems();
|
100
|
+
}
|
101
|
+
componentDidRender() {
|
102
|
+
if (this._showDropdown) {
|
103
|
+
this.taskbarActionsOpened.emit(this._element);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
disconnectedCallback() {
|
107
|
+
this.taskbarActionsButtonDisconnected.emit();
|
108
|
+
}
|
109
|
+
render() {
|
110
|
+
return (h(Host, null, h("div", { class: `ez-padding-left--medium ${this.canShowDropdown() ? ' ez-elevation--16' : ''}` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
|
111
|
+
}
|
112
|
+
get _element() { return this; }
|
113
|
+
static get style() { return taskbarActionsButtonCss; }
|
114
|
+
}, [2, "taskbar-actions-button", {
|
115
|
+
"title": [1],
|
116
|
+
"enabled": [4],
|
117
|
+
"actions": [16],
|
118
|
+
"_showDropdown": [32],
|
119
|
+
"showActions": [64],
|
120
|
+
"hideActions": [64],
|
121
|
+
"isOpened": [64]
|
122
|
+
}, [[8, "keydown", "handleKeyDown"]]]);
|
123
|
+
function defineCustomElement() {
|
124
|
+
if (typeof customElements === "undefined") {
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
const components = ["taskbar-actions-button"];
|
128
|
+
components.forEach(tagName => { switch (tagName) {
|
129
|
+
case "taskbar-actions-button":
|
130
|
+
if (!customElements.get(tagName)) {
|
131
|
+
customElements.define(tagName, TaskbarActionsButton);
|
132
|
+
}
|
133
|
+
break;
|
134
|
+
} });
|
135
|
+
}
|
136
|
+
|
137
|
+
export { TaskbarActionsButton as T, defineCustomElement as d };
|
@@ -46,8 +46,35 @@ class TaskbarProcessor {
|
|
46
46
|
}
|
47
47
|
}
|
48
48
|
|
49
|
+
const EVENT_NAME = 'taskbarActionsOpened';
|
49
50
|
const buildFieldSearch = (action, optionLoader, onSelectField) => {
|
50
|
-
return h("ez-search", { class:
|
51
|
+
return h("ez-search", { class: 'ez-actions-button--bottom-padding', canShowError: 'false', showSelectedValue: 'false', showOptionValue: 'false', suppressEmptyOption: 'true', label: action.label, value: '', optionLoader: optionLoader, onEzChange: (evt) => onSelectField(evt.detail), ignoreLimitCharsToSearch: true });
|
52
|
+
};
|
53
|
+
async function focusOnFieldSerch(field) {
|
54
|
+
requestAnimationFrame(async () => {
|
55
|
+
if (field) {
|
56
|
+
const realElement = field['$elm$'];
|
57
|
+
if (!realElement)
|
58
|
+
return;
|
59
|
+
realElement.value = null;
|
60
|
+
await realElement.setFocus();
|
61
|
+
}
|
62
|
+
});
|
63
|
+
}
|
64
|
+
const openFieldSearch = async (moreOptions, field) => {
|
65
|
+
if (!moreOptions) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
if ((await moreOptions.isOpened())) {
|
69
|
+
await focusOnFieldSerch(field);
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
const eventHandler = () => {
|
73
|
+
focusOnFieldSerch(field);
|
74
|
+
moreOptions.removeEventListener(EVENT_NAME, eventHandler);
|
75
|
+
};
|
76
|
+
moreOptions.addEventListener(EVENT_NAME, eventHandler);
|
77
|
+
await moreOptions.showActions();
|
51
78
|
};
|
52
79
|
|
53
|
-
export { TaskbarProcessor as T, buildFieldSearch as b };
|
80
|
+
export { TaskbarProcessor as T, buildFieldSearch as b, openFieldSearch as o };
|