@sankhyalabs/sankhyablocks 8.9.2 → 8.9.4
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/{ConfigStorage-c15716fd.js → ConfigStorage-90552fe8.js} +2 -2
- package/dist/cjs/{DataFetcher-713f0749.js → DataFetcher-1b1e9ff0.js} +58 -43
- package/dist/cjs/{SnkFormConfigManager-29101e20.js → SnkFormConfigManager-0561602d.js} +2 -2
- package/dist/cjs/Sortable-fb1c4cbb.js +2853 -0
- package/dist/cjs/{auth-fetcher-555ff856.js → auth-fetcher-eee6ec18.js} +1 -1
- package/dist/cjs/{constants-d187e03e.js → constants-35ddd366.js} +4 -0
- package/dist/cjs/{dataunit-fetcher-a0079a6f.js → dataunit-fetcher-38233d72.js} +1 -1
- package/dist/cjs/{form-config-fetcher-17775a75.js → form-config-fetcher-00372ac0.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-34922b83.js → pesquisa-fetcher-8bc6d0a5.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -5
- package/dist/cjs/snk-application.cjs.entry.js +6 -7
- package/dist/cjs/snk-attach.cjs.entry.js +3 -4
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +6 -7
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -4
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -4
- package/dist/cjs/snk-form-config.cjs.entry.js +15 -14
- package/dist/cjs/snk-form.cjs.entry.js +4 -5
- package/dist/cjs/snk-grid-config.cjs.entry.js +4 -5
- package/dist/cjs/snk-grid.cjs.entry.js +3 -4
- package/dist/cjs/{snk-guides-viewer-f7ef9607.js → snk-guides-viewer-676dd526.js} +6 -6
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -4
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -6
- package/dist/cjs/snk-tab-config.cjs.entry.js +12 -11
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +10 -8
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +10 -8
- package/dist/collection/lib/utils/constants.js +3 -0
- package/dist/components/DataFetcher.js +16 -1
- package/dist/components/constants.js +4 -1
- package/dist/components/snk-form-config2.js +13 -11
- package/dist/components/snk-tab-config2.js +2203 -6233
- package/dist/esm/{ConfigStorage-79c81f36.js → ConfigStorage-84abda58.js} +2 -2
- package/dist/esm/{DataFetcher-79f78222.js → DataFetcher-7814568f.js} +16 -1
- package/dist/esm/{SnkFormConfigManager-7723f3ec.js → SnkFormConfigManager-655943d0.js} +2 -2
- package/dist/esm/Sortable-83960219.js +2851 -0
- package/dist/esm/{auth-fetcher-e260d0cd.js → auth-fetcher-06354710.js} +1 -1
- package/dist/esm/{constants-3644f1b6.js → constants-8457af36.js} +4 -1
- package/dist/esm/{dataunit-fetcher-a2e763f3.js → dataunit-fetcher-aa70ea72.js} +1 -1
- package/dist/esm/{form-config-fetcher-e1603e66.js → form-config-fetcher-24f43afd.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-8e922c9d.js → pesquisa-fetcher-f7aaf727.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -5
- package/dist/esm/snk-application.entry.js +6 -7
- package/dist/esm/snk-attach.entry.js +3 -4
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +6 -7
- package/dist/esm/snk-data-exporter.entry.js +2 -3
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +3 -4
- package/dist/esm/snk-filter-modal-item.entry.js +3 -4
- package/dist/esm/snk-form-config.entry.js +15 -14
- package/dist/esm/snk-form.entry.js +4 -5
- package/dist/esm/snk-grid-config.entry.js +4 -5
- package/dist/esm/snk-grid.entry.js +3 -4
- package/dist/esm/{snk-guides-viewer-9f5dfbcc.js → snk-guides-viewer-746e2547.js} +6 -6
- package/dist/esm/snk-guides-viewer.entry.js +8 -9
- package/dist/esm/snk-personalized-filter.entry.js +3 -4
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +5 -6
- package/dist/esm/snk-tab-config.entry.js +12 -11
- package/dist/sankhyablocks/p-0d5e8a37.entry.js +1 -0
- package/dist/sankhyablocks/p-1a991d41.entry.js +1 -0
- package/dist/sankhyablocks/p-1ae31937.entry.js +1 -0
- package/dist/sankhyablocks/p-25df73bf.entry.js +1 -0
- package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
- package/dist/sankhyablocks/p-3f0fe056.js +1 -0
- package/dist/sankhyablocks/{p-2e6f1666.js → p-5eb3ac18.js} +1 -1
- package/dist/sankhyablocks/{p-73d3daa8.entry.js → p-5f74c859.entry.js} +1 -1
- package/dist/sankhyablocks/p-6e32de4b.entry.js +1 -0
- package/dist/sankhyablocks/p-718ecd01.entry.js +1 -0
- package/dist/sankhyablocks/p-809a09ac.entry.js +1 -0
- package/dist/sankhyablocks/p-88039a7f.js +1 -0
- package/dist/sankhyablocks/p-8eb67fa4.entry.js +1 -0
- package/dist/sankhyablocks/p-8f307ef2.entry.js +1 -0
- package/dist/sankhyablocks/{p-f30526a7.entry.js → p-95df461f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-838f8234.entry.js → p-98674137.entry.js} +1 -1
- package/dist/sankhyablocks/p-993e27ad.entry.js +1 -0
- package/dist/sankhyablocks/p-a3868fbc.entry.js +1 -0
- package/dist/sankhyablocks/p-a3fbded7.entry.js +1 -0
- package/dist/sankhyablocks/p-a4401f5f.entry.js +1 -0
- package/dist/sankhyablocks/{p-29176742.js → p-a9b6acf1.js} +1 -1
- package/dist/sankhyablocks/p-b0ef4383.js +1 -0
- package/dist/sankhyablocks/{p-80e9773f.js → p-b54e06ca.js} +1 -1
- package/dist/sankhyablocks/p-c6800fd4.entry.js +1 -0
- package/dist/sankhyablocks/p-d7665a57.entry.js +1 -0
- package/dist/sankhyablocks/{p-41d156dd.js → p-e38f28ae.js} +2 -2
- package/dist/sankhyablocks/{p-4651b43f.js → p-e47d966c.js} +1 -1
- package/dist/sankhyablocks/{p-839da75f.js → p-ee49df44.js} +1 -1
- package/dist/sankhyablocks/{p-6a33f844.entry.js → p-f3479d53.entry.js} +2 -2
- package/dist/sankhyablocks/p-fa816fb2.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/utils/constants.d.ts +3 -4
- package/package.json +2 -2
- package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
- package/dist/cjs/draggable.bundle-82a25c06.js +0 -6886
- package/dist/components/_commonjsHelpers.js +0 -17
- package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
- package/dist/esm/draggable.bundle-41d56f06.js +0 -6884
- package/dist/sankhyablocks/p-06e76ed2.entry.js +0 -1
- package/dist/sankhyablocks/p-112455b1.js +0 -1
- package/dist/sankhyablocks/p-1e8262a0.entry.js +0 -1
- package/dist/sankhyablocks/p-32b0a5e1.entry.js +0 -1
- package/dist/sankhyablocks/p-47e4b6c9.entry.js +0 -1
- package/dist/sankhyablocks/p-4a78e118.js +0 -1
- package/dist/sankhyablocks/p-51529d47.entry.js +0 -1
- package/dist/sankhyablocks/p-6bdb1068.entry.js +0 -1
- package/dist/sankhyablocks/p-80692cbd.entry.js +0 -1
- package/dist/sankhyablocks/p-94c532bb.entry.js +0 -1
- package/dist/sankhyablocks/p-9cbf6c15.entry.js +0 -1
- package/dist/sankhyablocks/p-b2ce189a.entry.js +0 -1
- package/dist/sankhyablocks/p-b6d6b172.js +0 -1
- package/dist/sankhyablocks/p-bd628455.entry.js +0 -1
- package/dist/sankhyablocks/p-c1e50dda.entry.js +0 -1
- package/dist/sankhyablocks/p-c9399ce6.js +0 -1
- package/dist/sankhyablocks/p-cead4799.entry.js +0 -1
- package/dist/sankhyablocks/p-d0b36421.js +0 -1
- package/dist/sankhyablocks/p-d3ec3586.entry.js +0 -1
- package/dist/sankhyablocks/p-e60325bc.entry.js +0 -1
- package/dist/sankhyablocks/p-fda8c84c.entry.js +0 -1
@@ -3,10 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const
|
6
|
+
const Sortable = require('./Sortable-fb1c4cbb.js');
|
7
7
|
const core = require('@sankhyalabs/core');
|
8
|
-
const constants = require('./constants-
|
9
|
-
require('./_commonjsHelpers-537d719a.js');
|
8
|
+
const constants = require('./constants-35ddd366.js');
|
10
9
|
|
11
10
|
const snkTabConfigCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--snk-tab-config--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--snk-tab-config__lower-bar--background-color:var(--color--disable-primary, #e5eaf0);--snk-tab-config__lower-bar--border:2px solid var(--color--disable-primary, #e5eaf0);--snk-tab-config__tab--color:var(--text--primary, #626e82);--snk-tab-config__tab--font-family:var(--font-pattern, \"Roboto\");--snk-tab-config__tab--font-size:var(--title--small, 14px);--snk-tab-config__tab--padding:var(--space--small, 6px) var(--space--medium, 12px);--snk-tab-config__tab-is-active--color:var(--color--primary, #008561);--snk-tab-config__tab-hover--color:var(--color--secondary, #383c45);--snk-tab-config__tab-is-focused--border:1px dashed var(--color--primary, #008561);--snk-tab-config__tab-label--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--snk-tab-config__tab-label--margin-bottom:var(--space--extra-small, 3px);--snk-tab-config__new-button-icon--color:var(--color--secondary-700, #1C1D22);--snk-tab-config__forward-button--background-color:var(--text--primary, #626e82);--snk-tab-config__forward-button-hover--background-color:var(--color--primary, #008561);--snk-tab-config__left-icon--padding-right:var(--space--small, 6px);--snk-tab-config__left-icon--color:var(--text--disable, #AFB6C0);--snk-tab-config__tab-label-disabled--color:var(--text--disable, #AFB6C0);--snk-tab-config__slot--margin-left:var(--space--small, 6px);display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background-color:var(--snk-tab-config__lower-bar--background-color);border:var(--snk-tab-config__lower-bar--border)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--snk-tab-config__tab--color);font-family:var(--snk-tab-config__tab--font-family);font-size:var(--snk-tab-config__tab--font-size);padding:var(--snk-tab-config__tab--padding)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:\"\";position:absolute;width:100%;height:100%;clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out;background-color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-focused.sc-snk-tab-config{border:var(--snk-tab-config__tab-is-focused--border)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--snk-tab-config__tab-label--text-shadow);margin-bottom:var(--snk-tab-config__tab-label--margin-bottom)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__new-button-icon--color)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:'';display:flex;width:10px;height:16px;background-color:var(--snk-tab-config__forward-button--background-color)}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--snk-tab-config__left-icon--padding-right);--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--snk-tab-config__left-icon--padding-right)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear, opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--snk-tab-config__tab-label-disabled--color)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--snk-tab-config__slot--margin-left)}";
|
12
11
|
|
@@ -44,14 +43,15 @@ const SnkTabConfig = class {
|
|
44
43
|
if (this._sortableTab) {
|
45
44
|
this._sortableTab.destroy();
|
46
45
|
}
|
47
|
-
this._sortableTab = new
|
46
|
+
this._sortableTab = new Sortable.Sortable(this._hostElem.querySelectorAll('[data-draggable-parent="tab"]'), {
|
48
47
|
draggable: '[data-draggable-element="tab"]',
|
49
48
|
mirror: {
|
50
49
|
constrainDimensions: true
|
51
|
-
}
|
50
|
+
},
|
51
|
+
distance: constants.CONFIG_EVENTS.dragStartDistance
|
52
52
|
});
|
53
|
-
this._sortableTab.on(constants.
|
54
|
-
this._sortableTab.on(constants.
|
53
|
+
this._sortableTab.on(constants.CONFIG_SORTABLE_EVENTS.dragStart, (evt) => this.controlStartDraggingTab(evt));
|
54
|
+
this._sortableTab.on(constants.CONFIG_SORTABLE_EVENTS.dragStop, (evt) => this.controlStopDraggingTab(evt));
|
55
55
|
}
|
56
56
|
controlStartDraggingTab(evt) {
|
57
57
|
var _a, _b;
|
@@ -226,8 +226,9 @@ const SnkTabConfig = class {
|
|
226
226
|
};
|
227
227
|
return styledLabel;
|
228
228
|
}
|
229
|
-
cancelEditText() {
|
229
|
+
cancelEditText(cancelTextEdition) {
|
230
230
|
var _a;
|
231
|
+
cancelTextEdition.stopPropagation();
|
231
232
|
this._activeEditText = false;
|
232
233
|
if (this._scrollContainer != undefined) {
|
233
234
|
(_a = this._scrollContainer.querySelector('.tab-config__tab--is-active')) === null || _a === void 0 ? void 0 : _a.focus();
|
@@ -249,13 +250,13 @@ const SnkTabConfig = class {
|
|
249
250
|
handleSaveEditionText(editDetails) {
|
250
251
|
const { value, newValue } = editDetails.detail;
|
251
252
|
if (value === newValue) {
|
252
|
-
this.cancelEditText();
|
253
|
+
this.cancelEditText(editDetails);
|
253
254
|
return;
|
254
255
|
}
|
255
256
|
this._processedTabs.forEach((tab) => {
|
256
257
|
if (tab.label === value) {
|
257
258
|
tab.label = newValue;
|
258
|
-
this.cancelEditText();
|
259
|
+
this.cancelEditText(editDetails);
|
259
260
|
this.editionTitleTab.emit(editDetails);
|
260
261
|
}
|
261
262
|
});
|
@@ -321,7 +322,7 @@ const SnkTabConfig = class {
|
|
321
322
|
return index.h("button", { id: tabId, class: `tab-config__tab${isSelected ? " tab-config__tab--is-active" : ""}`, onClick: () => this.handleTabClick(tab), onDblClick: () => { this._activeEditText = true; this._activeEditTextIndex = index$1; }, "data-draggable-element": index$1 > 0 ? "tab" : "", onMouseLeave: () => this.onHideActions(index$1), key: tab.label }, (this._activeEditText === true && this._activeEditTextIndex === index$1 && index$1 > 0) ||
|
322
323
|
index.h(index.Fragment, null, index$1 > 0 && index.h("ez-icon", { iconName: tab.leftIcon || "drag-indicator", class: "tab-config__left-icon" }), (tab.visible === false && index$1 > 0) && index.h("ez-icon", { iconName: tab.leftIcon || "eye-off", class: "tab-config__left-icon tab-config__left-icon--eye-off" }), index.h("span", { class: "tab-config__tab-label" + (tab.visible === false && index$1 > 0 ? " tab-config__tab-label-disabled" : ""), title: tab.label }, tab.label), index$1 > 0 &&
|
323
324
|
index.h("ez-actions-button", { class: "tab-config__actions-button", size: "small", ref: elem => this._refTabActions[index$1] = elem, actions: tab.visible === false ? this._actionsShow : this._actionsHide, isTransparent: true, arrowActive: true, onEzAction: (ev) => this.handleActions(ev, tab) }), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } })), (this._activeEditText === true && index$1 > 0 && this._activeEditTextIndex === index$1) &&
|
324
|
-
index.h("ez-text-edit", { value: tab.label, styled: this.getStyledLabel(tabId), class: "tab-config__edit-text", onSaveEdition: (ev) => this.handleSaveEditionText(ev), onCancelEdition: () => this.cancelEditText() }));
|
325
|
+
index.h("ez-text-edit", { value: tab.label, styled: this.getStyledLabel(tabId), class: "tab-config__edit-text", onSaveEdition: (ev) => this.handleSaveEditionText(ev), onCancelEdition: (ev) => this.cancelEditText(ev) }));
|
325
326
|
})), index.h("button", { class: "tab-config__forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
|
326
327
|
}
|
327
328
|
get _hostElem() { return index.getElement(this); }
|
package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js
CHANGED
@@ -2,7 +2,7 @@ import { h, Host } from "@stencil/core";
|
|
2
2
|
import { Sortable } from '@shopify/draggable';
|
3
3
|
import { ObjectUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from "@sankhyalabs/ezui/dist/collection/utils";
|
5
|
-
import { ACTION_CONFIG, CONFIG_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "../../../../lib/utils/constants";
|
5
|
+
import { ACTION_CONFIG, CONFIG_EVENTS, CONFIG_SORTABLE_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "../../../../lib/utils/constants";
|
6
6
|
import { UserConfigType } from "../../../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
7
7
|
import { buildFormConfigFromDataUnit } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
8
8
|
const CONTAINER_ID = {
|
@@ -410,11 +410,12 @@ export class SnkFormConfig {
|
|
410
410
|
draggable: '[data-draggable-element="field"]',
|
411
411
|
mirror: {
|
412
412
|
constrainDimensions: true
|
413
|
-
}
|
413
|
+
},
|
414
|
+
distance: CONFIG_EVENTS.dragStartDistance
|
414
415
|
});
|
415
|
-
this._sortableField.on(
|
416
|
-
this._sortableField.on(
|
417
|
-
this._sortableField.on(
|
416
|
+
this._sortableField.on(CONFIG_SORTABLE_EVENTS.dragStart, (evt) => this.controlStartDraggingField(evt));
|
417
|
+
this._sortableField.on(CONFIG_SORTABLE_EVENTS.dragSorted, (evt) => this.controlSortedDraggingField(evt));
|
418
|
+
this._sortableField.on(CONFIG_SORTABLE_EVENTS.dragStop, (evt) => this.controlStopDraggingField(evt));
|
418
419
|
}
|
419
420
|
controlStartDraggingGroup(evt) {
|
420
421
|
if (this._mouseOnFieldConfig || this._editingTitleGroup) {
|
@@ -440,10 +441,11 @@ export class SnkFormConfig {
|
|
440
441
|
draggable: '[data-draggable-element="group"]',
|
441
442
|
mirror: {
|
442
443
|
constrainDimensions: true
|
443
|
-
}
|
444
|
+
},
|
445
|
+
distance: CONFIG_EVENTS.dragStartDistance
|
444
446
|
});
|
445
|
-
this._sortableGroup.on(
|
446
|
-
this._sortableGroup.on(
|
447
|
+
this._sortableGroup.on(CONFIG_SORTABLE_EVENTS.dragStart, (evt) => this.controlStartDraggingGroup(evt));
|
448
|
+
this._sortableGroup.on(CONFIG_SORTABLE_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
|
447
449
|
}
|
448
450
|
loadUserConfig() {
|
449
451
|
if (this.configManager == undefined) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { h, Host, Fragment } from "@stencil/core";
|
2
2
|
import { Sortable } from '@shopify/draggable';
|
3
3
|
import { ApplicationContext, ElementIDUtils } from "@sankhyalabs/core";
|
4
|
-
import { CONFIG_EVENTS, KEY_EVENTS, TAB_NAMES, TYPE_ACTIONS } from "../../../../lib/utils/constants";
|
4
|
+
import { CONFIG_EVENTS, CONFIG_SORTABLE_EVENTS, KEY_EVENTS, TAB_NAMES, TYPE_ACTIONS } from "../../../../lib/utils/constants";
|
5
5
|
export class SnkTabConfig {
|
6
6
|
constructor() {
|
7
7
|
this._refTabActions = [];
|
@@ -33,10 +33,11 @@ export class SnkTabConfig {
|
|
33
33
|
draggable: '[data-draggable-element="tab"]',
|
34
34
|
mirror: {
|
35
35
|
constrainDimensions: true
|
36
|
-
}
|
36
|
+
},
|
37
|
+
distance: CONFIG_EVENTS.dragStartDistance
|
37
38
|
});
|
38
|
-
this._sortableTab.on(
|
39
|
-
this._sortableTab.on(
|
39
|
+
this._sortableTab.on(CONFIG_SORTABLE_EVENTS.dragStart, (evt) => this.controlStartDraggingTab(evt));
|
40
|
+
this._sortableTab.on(CONFIG_SORTABLE_EVENTS.dragStop, (evt) => this.controlStopDraggingTab(evt));
|
40
41
|
}
|
41
42
|
controlStartDraggingTab(evt) {
|
42
43
|
var _a, _b;
|
@@ -211,8 +212,9 @@ export class SnkTabConfig {
|
|
211
212
|
};
|
212
213
|
return styledLabel;
|
213
214
|
}
|
214
|
-
cancelEditText() {
|
215
|
+
cancelEditText(cancelTextEdition) {
|
215
216
|
var _a;
|
217
|
+
cancelTextEdition.stopPropagation();
|
216
218
|
this._activeEditText = false;
|
217
219
|
if (this._scrollContainer != undefined) {
|
218
220
|
(_a = this._scrollContainer.querySelector('.tab-config__tab--is-active')) === null || _a === void 0 ? void 0 : _a.focus();
|
@@ -234,13 +236,13 @@ export class SnkTabConfig {
|
|
234
236
|
handleSaveEditionText(editDetails) {
|
235
237
|
const { value, newValue } = editDetails.detail;
|
236
238
|
if (value === newValue) {
|
237
|
-
this.cancelEditText();
|
239
|
+
this.cancelEditText(editDetails);
|
238
240
|
return;
|
239
241
|
}
|
240
242
|
this._processedTabs.forEach((tab) => {
|
241
243
|
if (tab.label === value) {
|
242
244
|
tab.label = newValue;
|
243
|
-
this.cancelEditText();
|
245
|
+
this.cancelEditText(editDetails);
|
244
246
|
this.editionTitleTab.emit(editDetails);
|
245
247
|
}
|
246
248
|
});
|
@@ -306,7 +308,7 @@ export class SnkTabConfig {
|
|
306
308
|
return h("button", { id: tabId, class: `tab-config__tab${isSelected ? " tab-config__tab--is-active" : ""}`, onClick: () => this.handleTabClick(tab), onDblClick: () => { this._activeEditText = true; this._activeEditTextIndex = index; }, "data-draggable-element": index > 0 ? "tab" : "", onMouseLeave: () => this.onHideActions(index), key: tab.label }, (this._activeEditText === true && this._activeEditTextIndex === index && index > 0) ||
|
307
309
|
h(Fragment, null, index > 0 && h("ez-icon", { iconName: tab.leftIcon || "drag-indicator", class: "tab-config__left-icon" }), (tab.visible === false && index > 0) && h("ez-icon", { iconName: tab.leftIcon || "eye-off", class: "tab-config__left-icon tab-config__left-icon--eye-off" }), h("span", { class: "tab-config__tab-label" + (tab.visible === false && index > 0 ? " tab-config__tab-label-disabled" : ""), title: tab.label }, tab.label), index > 0 &&
|
308
310
|
h("ez-actions-button", { class: "tab-config__actions-button", size: "small", ref: elem => this._refTabActions[index] = elem, actions: tab.visible === false ? this._actionsShow : this._actionsHide, isTransparent: true, arrowActive: true, onEzAction: (ev) => this.handleActions(ev, tab) }), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } })), (this._activeEditText === true && index > 0 && this._activeEditTextIndex === index) &&
|
309
|
-
h("ez-text-edit", { value: tab.label, styled: this.getStyledLabel(tabId), class: "tab-config__edit-text", onSaveEdition: (ev) => this.handleSaveEditionText(ev), onCancelEdition: () => this.cancelEditText() }));
|
311
|
+
h("ez-text-edit", { value: tab.label, styled: this.getStyledLabel(tabId), class: "tab-config__edit-text", onSaveEdition: (ev) => this.handleSaveEditionText(ev), onCancelEdition: (ev) => this.cancelEditText(ev) }));
|
310
312
|
})), h("button", { class: "tab-config__forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
|
311
313
|
}
|
312
314
|
static get is() { return "snk-tab-config"; }
|
@@ -35,6 +35,9 @@ export const CONFIG_EVENTS = {
|
|
35
35
|
changeConfig: "changeConfig",
|
36
36
|
configChanged: "configChanged",
|
37
37
|
fieldChanged: "ezChange",
|
38
|
+
dragStartDistance: 40
|
39
|
+
};
|
40
|
+
export const CONFIG_SORTABLE_EVENTS = {
|
38
41
|
dragStart: "sortable:start",
|
39
42
|
dragSort: "sortable:sort",
|
40
43
|
dragSorted: "sortable:sorted",
|
@@ -1,8 +1,23 @@
|
|
1
1
|
import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
|
2
|
-
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
|
3
2
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
3
|
import { P as PrintUtils } from './PrintUtils.js';
|
5
4
|
|
5
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
6
|
+
|
7
|
+
function createCommonjsModule(fn, basedir, module) {
|
8
|
+
return module = {
|
9
|
+
path: basedir,
|
10
|
+
exports: {},
|
11
|
+
require: function (path, base) {
|
12
|
+
return commonjsRequire();
|
13
|
+
}
|
14
|
+
}, fn(module, module.exports), module.exports;
|
15
|
+
}
|
16
|
+
|
17
|
+
function commonjsRequire () {
|
18
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
19
|
+
}
|
20
|
+
|
6
21
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
7
22
|
var global = typeof self !== 'undefined' ? self : commonjsGlobal;
|
8
23
|
var __self__ = (function () {
|
@@ -32,6 +32,9 @@ const CONFIG_EVENTS = {
|
|
32
32
|
changeConfig: "changeConfig",
|
33
33
|
configChanged: "configChanged",
|
34
34
|
fieldChanged: "ezChange",
|
35
|
+
dragStartDistance: 40
|
36
|
+
};
|
37
|
+
const CONFIG_SORTABLE_EVENTS = {
|
35
38
|
dragStart: "sortable:start",
|
36
39
|
dragSort: "sortable:sort",
|
37
40
|
dragSorted: "sortable:sorted",
|
@@ -87,4 +90,4 @@ var SIMPLE_CRUD_MODE;
|
|
87
90
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["IN_MEMORY"] = 1] = "IN_MEMORY";
|
88
91
|
})(SIMPLE_CRUD_MODE || (SIMPLE_CRUD_MODE = {}));
|
89
92
|
|
90
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, SIMPLE_CRUD_MODE as S, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a,
|
93
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, SIMPLE_CRUD_MODE as S, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a, CONFIG_SORTABLE_EVENTS as b, TAB_NAMES as c, TYPE_ACTIONS as d };
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { a as
|
2
|
+
import { a as Sortable, d as defineCustomElement$1 } from './snk-tab-config2.js';
|
3
3
|
import { ObjectUtils, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
|
-
import { C as CONFIG_EVENTS, b as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants.js';
|
5
|
+
import { C as CONFIG_EVENTS, b as CONFIG_SORTABLE_EVENTS, c as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants.js';
|
6
6
|
import { U as UserConfigType } from './form-config-fetcher.js';
|
7
7
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
8
8
|
import { d as defineCustomElement$3 } from './snk-config-options2.js';
|
@@ -412,15 +412,16 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
412
412
|
if (this._sortableField) {
|
413
413
|
this._sortableField.destroy();
|
414
414
|
}
|
415
|
-
this._sortableField = new
|
415
|
+
this._sortableField = new Sortable(this._sortableContainer.querySelectorAll('[data-draggable-parent="field"]'), {
|
416
416
|
draggable: '[data-draggable-element="field"]',
|
417
417
|
mirror: {
|
418
418
|
constrainDimensions: true
|
419
|
-
}
|
419
|
+
},
|
420
|
+
distance: CONFIG_EVENTS.dragStartDistance
|
420
421
|
});
|
421
|
-
this._sortableField.on(
|
422
|
-
this._sortableField.on(
|
423
|
-
this._sortableField.on(
|
422
|
+
this._sortableField.on(CONFIG_SORTABLE_EVENTS.dragStart, (evt) => this.controlStartDraggingField(evt));
|
423
|
+
this._sortableField.on(CONFIG_SORTABLE_EVENTS.dragSorted, (evt) => this.controlSortedDraggingField(evt));
|
424
|
+
this._sortableField.on(CONFIG_SORTABLE_EVENTS.dragStop, (evt) => this.controlStopDraggingField(evt));
|
424
425
|
}
|
425
426
|
controlStartDraggingGroup(evt) {
|
426
427
|
if (this._mouseOnFieldConfig || this._editingTitleGroup) {
|
@@ -442,14 +443,15 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
442
443
|
if (this._sortableGroup) {
|
443
444
|
this._sortableGroup.destroy();
|
444
445
|
}
|
445
|
-
this._sortableGroup = new
|
446
|
+
this._sortableGroup = new Sortable(this._sortableContainer.querySelectorAll('[data-draggable-parent="group"]'), {
|
446
447
|
draggable: '[data-draggable-element="group"]',
|
447
448
|
mirror: {
|
448
449
|
constrainDimensions: true
|
449
|
-
}
|
450
|
+
},
|
451
|
+
distance: CONFIG_EVENTS.dragStartDistance
|
450
452
|
});
|
451
|
-
this._sortableGroup.on(
|
452
|
-
this._sortableGroup.on(
|
453
|
+
this._sortableGroup.on(CONFIG_SORTABLE_EVENTS.dragStart, (evt) => this.controlStartDraggingGroup(evt));
|
454
|
+
this._sortableGroup.on(CONFIG_SORTABLE_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
|
453
455
|
}
|
454
456
|
loadUserConfig() {
|
455
457
|
if (this.configManager == undefined) {
|