@sankhyalabs/sankhyablocks 10.1.0-dev.57 → 10.1.0-dev.59
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-a28eceb2.js → ConfigStorage-156bfcac.js} +2 -2
- package/dist/cjs/{DataFetcher-98d95e8f.js → DataFetcher-d13b4637.js} +12 -0
- package/dist/cjs/{ISave-a9815bb3.js → ISave-55d9dcc3.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-af47ba2f.js → SnkFormConfigManager-5cb9a39c.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-13774e5f.js → SnkMultiSelectionListDataSource-5c5badfc.js} +5 -5
- package/dist/cjs/{auth-fetcher-9c257a1f.js → auth-fetcher-d1715459.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-afc246d8.js → dataunit-fetcher-fae710c5.js} +1 -1
- package/dist/cjs/{form-config-fetcher-1ce4125c.js → form-config-fetcher-bbebdcb8.js} +1 -1
- package/dist/cjs/{index-e3e39724.js → index-bc950921.js} +6 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_9.cjs.entry.js +9 -9
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach_11.cjs.entry.js +14 -12
- package/dist/cjs/snk-crud.cjs.entry.js +14 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +59 -14
- package/dist/cjs/{snk-data-unit-ab570f87.js → snk-data-unit-32237a2d.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
- package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +33 -10
- package/dist/cjs/{snk-dynaform-guides-view-30ce5a8c.js → snk-dynaform-guides-view-2c7c6ce4.js} +389 -42
- package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-dynaform.cjs.entry.js +14 -10
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +4 -4
- package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +8 -8
- package/dist/cjs/{snk-guides-viewer-2a55fa3a.js → snk-guides-viewer-67b9cca9.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +5 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-80eddec8.js → taskbar-elements-25f800b3.js} +1 -1
- package/dist/cjs/{taskbarUtils-4ca4235e.js → taskbarUtils-99aaa01f.js} +11 -6
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +3 -3
- package/dist/collection/components/snk-crud/snk-crud.css +9 -4
- package/dist/collection/components/snk-crud/snk-crud.js +5 -1
- package/dist/collection/components/snk-crud/utils/taskbarUtils.js +5 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +2 -2
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +8 -4
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +43 -2
- package/dist/collection/components/snk-dynaform/snk-dynaform.css +9 -4
- package/dist/collection/components/snk-dynaform/snk-dynaform.js +5 -1
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.css +71 -1
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.js +23 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.css +35 -1
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.js +3 -1
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.css +229 -6
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.js +458 -38
- package/dist/collection/components/snk-dynaform-form-config/SnkFormConfigManager.js +8 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/lib/@types/index.js +6 -0
- package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +4 -0
- package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +4 -0
- package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +4 -0
- package/dist/components/ISave.js +6 -0
- package/dist/components/SnkMessageBuilder.js +12 -0
- package/dist/components/snk-actions-button2.js +3 -3
- package/dist/components/snk-crud.js +6 -2
- package/dist/components/snk-data-exporter2.js +53 -8
- package/dist/components/snk-dynaform-detail-view2.js +419 -41
- package/dist/components/snk-dynaform-form-view2.js +4 -2
- package/dist/components/snk-dynaform.js +6 -2
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/taskbarUtils.js +5 -0
- package/dist/esm/{ConfigStorage-346d781d.js → ConfigStorage-0d1c0695.js} +2 -2
- package/dist/esm/{DataFetcher-7d8df5a2.js → DataFetcher-70de9419.js} +12 -0
- package/dist/esm/{ISave-2117075a.js → ISave-f5704813.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-066d370b.js → SnkFormConfigManager-e7f05f79.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-7c5ffcd4.js → SnkMultiSelectionListDataSource-6ac291a9.js} +5 -5
- package/dist/esm/{auth-fetcher-5891e22c.js → auth-fetcher-e34880e5.js} +1 -1
- package/dist/esm/{dataunit-fetcher-5dcb0e89.js → dataunit-fetcher-d26e4a08.js} +1 -1
- package/dist/esm/{form-config-fetcher-8e2082f3.js → form-config-fetcher-98c42169.js} +1 -1
- package/dist/esm/{index-b40568ff.js → index-c6721886.js} +6 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +5 -5
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_9.entry.js +9 -9
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach_11.entry.js +14 -12
- package/dist/esm/snk-crud.entry.js +14 -10
- package/dist/esm/snk-data-exporter.entry.js +59 -14
- package/dist/esm/{snk-data-unit-f697345b.js → snk-data-unit-ff57ac90.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +9 -9
- package/dist/esm/snk-dynaform-detail-view_2.entry.js +33 -10
- package/dist/esm/{snk-dynaform-guides-view-6aae38f7.js → snk-dynaform-guides-view-0dfbefc1.js} +390 -43
- package/dist/esm/snk-dynaform-guides-view.entry.js +6 -6
- package/dist/esm/snk-dynaform.entry.js +14 -10
- package/dist/esm/snk-filter-bar_4.entry.js +4 -4
- package/dist/esm/snk-form_2.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +8 -8
- package/dist/esm/{snk-guides-viewer-3ea7e312.js → snk-guides-viewer-31a0a23d.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-layout-form-config.entry.js +5 -5
- package/dist/esm/snk-pesquisa.entry.js +5 -5
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-63651ca7.js → taskbar-elements-ba9d6889.js} +1 -1
- package/dist/esm/{taskbarUtils-a43e4bba.js → taskbarUtils-cb9db0d9.js} +11 -6
- package/dist/sankhyablocks/{p-3190ac29.js → p-097d75b3.js} +2 -2
- package/dist/sankhyablocks/{p-aa9d61fa.entry.js → p-12579574.entry.js} +1 -1
- package/dist/sankhyablocks/{p-741f1ad0.entry.js → p-1d31aec3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6f2de911.entry.js → p-250b273e.entry.js} +1 -1
- package/dist/sankhyablocks/p-2a83f20e.entry.js +1 -0
- package/dist/sankhyablocks/p-2c4f7fdd.entry.js +1 -0
- package/dist/sankhyablocks/{p-3072136e.js → p-2ec98523.js} +1 -1
- package/dist/sankhyablocks/{p-10d883b0.js → p-4dd574d6.js} +1 -1
- package/dist/sankhyablocks/{p-7827871d.entry.js → p-541c72ec.entry.js} +1 -1
- package/dist/sankhyablocks/p-5aeae67f.js +1 -0
- package/dist/sankhyablocks/p-5ef0e9a8.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e97fabb.entry.js → p-6d3bcabf.entry.js} +1 -1
- package/dist/sankhyablocks/p-6f60df43.js +1 -0
- package/dist/sankhyablocks/{p-58e0f14b.entry.js → p-846d8f79.entry.js} +1 -1
- package/dist/sankhyablocks/{p-77f608bc.entry.js → p-885262ce.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c1e168a2.js → p-8d1ef77a.js} +1 -1
- package/dist/sankhyablocks/{p-13f91e7e.js → p-8d81c8d3.js} +1 -1
- package/dist/sankhyablocks/{p-ee192f06.entry.js → p-8f5dd87d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c5889dae.js → p-90037547.js} +1 -1
- package/dist/sankhyablocks/p-9e02a785.js +1 -0
- package/dist/sankhyablocks/{p-5a8390f9.entry.js → p-a25ab2ff.entry.js} +1 -1
- package/dist/sankhyablocks/p-a696bbcd.entry.js +1 -0
- package/dist/sankhyablocks/{p-b3762105.entry.js → p-a9012341.entry.js} +1 -1
- package/dist/sankhyablocks/p-abcb646d.js +1 -0
- package/dist/sankhyablocks/{p-733eba69.js → p-bd2a845c.js} +1 -1
- package/dist/sankhyablocks/p-bfce617e.entry.js +1 -0
- package/dist/sankhyablocks/{p-3630a5ae.entry.js → p-c4b34e2b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8d513b64.js → p-c9440c8a.js} +1 -1
- package/dist/sankhyablocks/p-cd153f71.entry.js +1 -0
- package/dist/sankhyablocks/{p-e91bd00e.js → p-eac48627.js} +1 -1
- package/dist/sankhyablocks/{p-d7657667.js → p-ec7c87bb.js} +1 -1
- package/dist/sankhyablocks/p-fb6e3c65.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +16 -0
- package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +11 -0
- package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +1 -0
- package/dist/types/components.d.ts +32 -0
- package/dist/types/lib/@types/index.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-0f3698af.js +0 -1
- package/dist/sankhyablocks/p-1bc6849e.js +0 -1
- package/dist/sankhyablocks/p-2c65dc01.entry.js +0 -1
- package/dist/sankhyablocks/p-3cc67d50.entry.js +0 -1
- package/dist/sankhyablocks/p-4a53fbeb.entry.js +0 -1
- package/dist/sankhyablocks/p-7e63af25.entry.js +0 -1
- package/dist/sankhyablocks/p-a8a93568.entry.js +0 -1
- package/dist/sankhyablocks/p-acd3adf9.entry.js +0 -1
- package/dist/sankhyablocks/p-c3bc693a.js +0 -1
- package/dist/sankhyablocks/p-c6b6567f.entry.js +0 -1
- package/dist/sankhyablocks/p-ed1b1b14.js +0 -1
package/dist/cjs/{snk-dynaform-guides-view-30ce5a8c.js → snk-dynaform-guides-view-2c7c6ce4.js}
RENAMED
|
@@ -5,9 +5,9 @@ const core = require('@sankhyalabs/core');
|
|
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
7
7
|
const constants = require('./constants-6d82e405.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
9
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
10
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-156bfcac.js');
|
|
9
|
+
const formConfigFetcher = require('./form-config-fetcher-bbebdcb8.js');
|
|
10
|
+
const taskbarElements = require('./taskbar-elements-25f800b3.js');
|
|
11
11
|
|
|
12
12
|
class SnkFormConfigManager {
|
|
13
13
|
constructor(configName, resourceID, onConfigChange, dataUnit) {
|
|
@@ -191,7 +191,9 @@ class SnkFormConfigManager {
|
|
|
191
191
|
return config;
|
|
192
192
|
}
|
|
193
193
|
config = this.getFormConfig(this._dataUnit, false, true);
|
|
194
|
-
|
|
194
|
+
const previousTabs = this.parseObjectList(config.tabs)
|
|
195
|
+
.map(tab => (Object.assign(Object.assign({}, tab), { visible: true })));
|
|
196
|
+
config.tabs = [];
|
|
195
197
|
config.emptyConfig = false;
|
|
196
198
|
config.defaultConfiguration = true;
|
|
197
199
|
const fields = (_b = (_a = this._dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
|
|
@@ -214,12 +216,19 @@ class SnkFormConfigManager {
|
|
|
214
216
|
field.tab = uiTabName;
|
|
215
217
|
}
|
|
216
218
|
}
|
|
219
|
+
for (const prevTab of previousTabs) {
|
|
220
|
+
if (!config.tabs.some(t => t.name === prevTab.name)) {
|
|
221
|
+
config.tabs.push(prevTab);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
217
224
|
return config;
|
|
218
225
|
}
|
|
219
226
|
}
|
|
220
227
|
|
|
221
|
-
const snkDynaformGuidesViewCss = ".sc-snk-dynaform-guides-view-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);display:block;height:100%;min-width:0;overflow-x:hidden}snk-dynaform-form-view.sc-snk-dynaform-guides-view{width:100%}.snk-guides-viewer.sc-snk-dynaform-guides-view{position:relative;display:flex;flex-direction:column;height:100%;overflow:hidden;padding:0px}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view{display:flex;row-gap:24px;flex-direction:column;flex:1;max-height:none;min-height:0;overflow:hidden;
|
|
228
|
+
const snkDynaformGuidesViewCss = ".sc-snk-dynaform-guides-view-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);display:block;height:100%;min-width:0;overflow-x:hidden}snk-dynaform-form-view.sc-snk-dynaform-guides-view{width:100%}.snk-guides-viewer.sc-snk-dynaform-guides-view{position:relative;display:flex;flex-direction:column;height:100%;overflow:hidden;padding:0px;padding:var(--space--8, 8px);padding-top:0}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view{display:flex;row-gap:24px;flex-direction:column;flex:1;max-height:none;min-height:0;overflow:hidden}.snk-guides-viewer__master.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;min-height:0;height:100%}.snk-guides-viewer__split.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__split-master.sc-snk-dynaform-guides-view,.snk-guides-viewer__split-content.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;min-height:0;overflow:hidden}.snk-guides-viewer__split-master.sc-snk-dynaform-guides-view{border-radius:0}.snk-guides-viewer__split-content.snk-guides-viewer__split-content.sc-snk-dynaform-guides-view{box-sizing:border-box;padding-top:var(--space--4, 4px)}.snk-guides-viewer__panel.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;overflow:hidden}.snk-guides-viewer__master.sc-snk-dynaform-guides-view .snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view{display:none}.snk-guides-viewer__master--collapsed.sc-snk-dynaform-guides-view .snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view{display:flex}.snk-guides-viewer__master--collapsed.sc-snk-dynaform-guides-view .snk-guides-viewer__master-expanded.sc-snk-dynaform-guides-view{display:none}.snk-guides-viewer__master-expanded.sc-snk-dynaform-guides-view{position:relative;display:flex;flex-direction:column;min-height:0;flex:1;overflow:visible;margin-top:var(--space--6, 6px)}.snk-guides-viewer__master-expanded.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view,.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view>snk-dynaform-detail-view.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__guide-content.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.snk-guides-viewer__guide-content--hidden.sc-snk-dynaform-guides-view{display:none}.snk-guides-viewer__guide-content.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view,.snk-guides-viewer__guide-content.sc-snk-dynaform-guides-view>snk-dynaform-detail-view.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__header.sc-snk-dynaform-guides-view{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);padding-inline:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-dynaform-guides-view{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-dynaform-guides-view{width:75%}.snk-guides-viewer__container.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden}.snk-guides-viewer__tabselector.sc-snk-dynaform-guides-view{width:100%;min-width:0;box-sizing:border-box;padding:0 var(--space--12, 12px);flex-shrink:0}.snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view{position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--space--12, 12px);box-sizing:border-box;margin:var(--space--2xs, 8px) var(--space--12, 12px);padding:var(--space--2xs, 8px) var(--space--12, 12px);border:1px solid var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-medium, 12px);background:var(--background--medium, #f0f3f7);box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));cursor:pointer;text-align:left;flex-shrink:0;overflow:hidden;transition:background 0.15s ease, border-color 0.15s ease}.snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view:hover,.snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view:focus-visible{background:var(--background--xlight, #fff);border-color:var(--color--primary, #4e4e4e)}.snk-guides-viewer__master-summary-fields.sc-snk-dynaform-guides-view{display:flex;gap:var(--space--large, 24px);flex:1;min-width:0;overflow:hidden;white-space:nowrap;padding:var(--space--4, 4px);margin:calc(-1 * var(--space--4, 4px))}.snk-guides-viewer__master-summary-measure.sc-snk-dynaform-guides-view{position:absolute;top:0;left:0;display:flex;gap:var(--space--large, 24px);white-space:nowrap;visibility:hidden;pointer-events:none;z-index:-1}.snk-guides-viewer__master-summary-item.sc-snk-dynaform-guides-view{display:inline-flex;flex-direction:column;gap:2px;min-width:0;padding:var(--space--4, 4px)}.snk-guides-viewer__master-summary-label.sc-snk-dynaform-guides-view{display:flex;align-items:center;gap:2px;max-width:240px;color:var(--text--primary, #626e82);font-size:var(--title--small, 12px);font-weight:var(--text-weight--medium, 400)}.snk-guides-viewer__master-summary-label-text.sc-snk-dynaform-guides-view{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.snk-guides-viewer__master-summary-required.sc-snk-dynaform-guides-view{flex-shrink:0;color:var(--color--red-600, #BD0025);font-weight:700}.snk-guides-viewer__master-summary-item--invalid.sc-snk-dynaform-guides-view{box-shadow:0 0 0 1px var(--color--red-600, #BD0025);border-radius:var(--border--radius-4, 4px)}.snk-guides-viewer__master-summary-value.sc-snk-dynaform-guides-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large, 14px);font-weight:700;max-width:240px;overflow:hidden;text-overflow:ellipsis}.snk-guides-viewer__master-summary-chevron.sc-snk-dynaform-guides-view{flex-shrink:0;color:var(--title--primary, #2b3a54)}.snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view{position:absolute;top:calc(-1 * var(--space--6, 6px));left:50%;transform:translate(-50%, 0);z-index:1;opacity:0;visibility:hidden;transition:opacity 0.2s ease, visibility 0.2s ease}.snk-guides-viewer__master.sc-snk-dynaform-guides-view:hover .snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view,.snk-guides-viewer__master.sc-snk-dynaform-guides-view:focus-within .snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view,.snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view:hover{opacity:1;visibility:visible}.snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view ez-button.sc-snk-dynaform-guides-view{--ez-button--border:1px solid var(--color--petroleum-100, #C8CCD3);--ez-button--hover--border:1px solid var(--color--petroleum-100, #C8CCD3)}";
|
|
222
229
|
|
|
230
|
+
/** Tamanho inicial (px) do painel master no split; ajustável arrastando o divisor. */
|
|
231
|
+
const MASTER_INITIAL_SIZE = "300px";
|
|
223
232
|
const SnkDynaformGuidesViewer = class {
|
|
224
233
|
constructor(hostRef) {
|
|
225
234
|
index.registerInstance(this, hostRef);
|
|
@@ -228,6 +237,8 @@ const SnkDynaformGuidesViewer = class {
|
|
|
228
237
|
this.exit = index.createEvent(this, "exit", 7);
|
|
229
238
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
230
239
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
240
|
+
/** Refs das abas de detalhe já montadas, por id de guia. */
|
|
241
|
+
this._detailRefs = new Map();
|
|
231
242
|
this.dataUnit = undefined;
|
|
232
243
|
this.dataState = undefined;
|
|
233
244
|
this.configName = undefined;
|
|
@@ -258,25 +269,87 @@ const SnkDynaformGuidesViewer = class {
|
|
|
258
269
|
this._mainFormName = undefined;
|
|
259
270
|
this._errorTabs = new Set();
|
|
260
271
|
this._hasToCreateFieldSearch = true;
|
|
272
|
+
this.collapsibleMaster = true;
|
|
273
|
+
this.masterSummaryFieldCount = 12;
|
|
274
|
+
this.masterCollapseThreshold = 700;
|
|
275
|
+
this.maxOpenedGuides = 4;
|
|
276
|
+
this._masterCollapsed = false;
|
|
277
|
+
this._hostTight = false;
|
|
278
|
+
this._visibleSummaryCount = Number.MAX_SAFE_INTEGER;
|
|
279
|
+
this._openedGuideIds = [];
|
|
280
|
+
}
|
|
281
|
+
/** Aba de detalhe atualmente selecionada (derivada do mapa de refs). */
|
|
282
|
+
get _currentDetail() {
|
|
283
|
+
var _a;
|
|
284
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
285
|
+
return id ? this._detailRefs.get(id) : undefined;
|
|
261
286
|
}
|
|
262
287
|
observeDataUnit() {
|
|
263
288
|
this.loadGuides(true);
|
|
264
289
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
290
|
+
observeSelectedGuide(newGuide) {
|
|
291
|
+
const id = newGuide === null || newGuide === void 0 ? void 0 : newGuide.id;
|
|
292
|
+
if (!id) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
if (!this._openedGuideIds.includes(id)) {
|
|
296
|
+
this._openedGuideIds = [...this._openedGuideIds, id];
|
|
297
|
+
}
|
|
298
|
+
this.enforceOpenedGuidesCap(id);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Aplica o teto `maxOpenedGuides` mantendo a ordem de inserção (não reordena
|
|
302
|
+
* — reordenar moveria os nós no DOM e remontaria as abas sobreviventes,
|
|
303
|
+
* anulando o cache). Retém a aba ativa + as inseridas mais recentemente;
|
|
304
|
+
* desmonta as mais antigas e limpa seus refs. `<= 0` desliga o teto.
|
|
305
|
+
*/
|
|
306
|
+
enforceOpenedGuidesCap(activeId) {
|
|
307
|
+
const cap = this.maxOpenedGuides;
|
|
308
|
+
if (cap <= 0 || this._openedGuideIds.length <= cap) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
// Marca p/ manter: a ativa + as mais recentes (varrendo do fim), até o teto.
|
|
312
|
+
const keep = new Set([activeId]);
|
|
313
|
+
for (let i = this._openedGuideIds.length - 1; i >= 0 && keep.size < cap; i--) {
|
|
314
|
+
keep.add(this._openedGuideIds[i]);
|
|
315
|
+
}
|
|
316
|
+
this._openedGuideIds.forEach(gid => {
|
|
317
|
+
if (!keep.has(gid)) {
|
|
318
|
+
this._detailRefs.delete(gid);
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
this._openedGuideIds = this._openedGuideIds.filter(gid => keep.has(gid));
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Ao recolher/expandir, o master permanece montado; só muda o tamanho do
|
|
325
|
+
* seu painel (auto quando recolhido, {@link MASTER_INITIAL_SIZE} quando
|
|
326
|
+
* expandido). Reconstrói o split para aplicar o novo template.
|
|
327
|
+
*/
|
|
328
|
+
observeMasterCollapsed() {
|
|
329
|
+
if (typeof requestAnimationFrame !== 'undefined') {
|
|
330
|
+
requestAnimationFrame(() => { var _a; return (_a = this._splitPanel) === null || _a === void 0 ? void 0 : _a.rebuildLayout(); });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
observeFormConfigManager(value) {
|
|
334
|
+
var _a;
|
|
335
|
+
(_a = this.formConfigVisibilityChanged) === null || _a === void 0 ? void 0 : _a.emit(!!value);
|
|
272
336
|
}
|
|
273
337
|
observeDataState(newValue, oldValue) {
|
|
274
338
|
var _a, _b, _c, _d, _e, _f;
|
|
275
339
|
const newRecordsIds = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.selectionInfo) === null || _a === void 0 ? void 0 : _a.recordIds) !== null && _b !== void 0 ? _b : (_c = newValue === null || newValue === void 0 ? void 0 : newValue.selectedRecord) === null || _c === void 0 ? void 0 : _c['__record__id__'];
|
|
276
340
|
const oldRecordsIds = (_e = (_d = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectionInfo) === null || _d === void 0 ? void 0 : _d.recordIds) !== null && _e !== void 0 ? _e : (_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectedRecord) === null || _f === void 0 ? void 0 : _f['__record__id__'];
|
|
277
341
|
if (!core.ObjectUtils.equals(newRecordsIds, oldRecordsIds)) {
|
|
342
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) && !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode)) {
|
|
343
|
+
this._manualOverride = undefined;
|
|
344
|
+
}
|
|
278
345
|
this.loadGuides((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) != (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode));
|
|
279
346
|
}
|
|
347
|
+
else if ((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) !== (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode)) {
|
|
348
|
+
if (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) {
|
|
349
|
+
this._manualOverride = undefined;
|
|
350
|
+
}
|
|
351
|
+
this.recomputeMasterCollapse();
|
|
352
|
+
}
|
|
280
353
|
}
|
|
281
354
|
observeMasterFormConfig() {
|
|
282
355
|
var _a;
|
|
@@ -327,6 +400,7 @@ const SnkDynaformGuidesViewer = class {
|
|
|
327
400
|
* Recarrega os guias baseada nos metadados atuais.
|
|
328
401
|
*/
|
|
329
402
|
async reloadGuides() {
|
|
403
|
+
this._manualOverride = undefined;
|
|
330
404
|
this.loadGuides(false);
|
|
331
405
|
}
|
|
332
406
|
exitViewer() {
|
|
@@ -413,11 +487,24 @@ const SnkDynaformGuidesViewer = class {
|
|
|
413
487
|
});
|
|
414
488
|
this._mainFormName = mainFormName;
|
|
415
489
|
this._guides = guides;
|
|
490
|
+
this.pruneOpenedGuides();
|
|
416
491
|
const currentStillExists = this.selectedGuide
|
|
417
492
|
&& this._guides.some(g => g.id === this.selectedGuide.id);
|
|
418
493
|
if (changeSelection || !currentStillExists) {
|
|
419
494
|
this.selectedGuide = this._guides && this._guides.length > 0 ? this._guides[0] : undefined;
|
|
420
495
|
}
|
|
496
|
+
this.recomputeMasterCollapse();
|
|
497
|
+
}
|
|
498
|
+
/** Remove das guias abertas (e dos refs) ids que não existem mais. */
|
|
499
|
+
pruneOpenedGuides() {
|
|
500
|
+
const validIds = new Set(this._guides.map(g => g.id));
|
|
501
|
+
const filtered = this._openedGuideIds.filter(id => validIds.has(id));
|
|
502
|
+
if (filtered.length !== this._openedGuideIds.length) {
|
|
503
|
+
this._openedGuideIds = filtered;
|
|
504
|
+
}
|
|
505
|
+
Array.from(this._detailRefs.keys())
|
|
506
|
+
.filter(id => !validIds.has(id))
|
|
507
|
+
.forEach(id => this._detailRefs.delete(id));
|
|
421
508
|
}
|
|
422
509
|
hasToDisableDetails(currentRecord) {
|
|
423
510
|
return !currentRecord
|
|
@@ -429,14 +516,18 @@ const SnkDynaformGuidesViewer = class {
|
|
|
429
516
|
return form.FormMetadata.getDetailName(formId) != undefined;
|
|
430
517
|
}
|
|
431
518
|
buildTabItems() {
|
|
432
|
-
return this._guides.map((guide, index) =>
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
519
|
+
return this._guides.map((guide, index) => {
|
|
520
|
+
const hasError = this._errorTabs.has(guide.id);
|
|
521
|
+
return {
|
|
522
|
+
tabKey: guide.id,
|
|
523
|
+
label: guide.label,
|
|
524
|
+
index,
|
|
525
|
+
disabled: guide.disabled,
|
|
526
|
+
rightIcon: hasError ? 'alert-circle-inverted' : undefined,
|
|
527
|
+
rightIconError: hasError,
|
|
528
|
+
leftIcon: this.getTabLeftIcon(guide),
|
|
529
|
+
};
|
|
530
|
+
});
|
|
440
531
|
}
|
|
441
532
|
getTabLeftIcon(guide) {
|
|
442
533
|
var _a, _b;
|
|
@@ -464,6 +555,7 @@ const SnkDynaformGuidesViewer = class {
|
|
|
464
555
|
return;
|
|
465
556
|
}
|
|
466
557
|
this.selectedGuide = targetGuide;
|
|
558
|
+
this.recomputeMasterCollapse();
|
|
467
559
|
}
|
|
468
560
|
static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
|
|
469
561
|
return configManager.saveCardState(formName, cardConfig, propertyChanged);
|
|
@@ -502,12 +594,38 @@ const SnkDynaformGuidesViewer = class {
|
|
|
502
594
|
return index.h("snk-dynaform-form-view", { label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath });
|
|
503
595
|
})));
|
|
504
596
|
}
|
|
505
|
-
|
|
506
|
-
|
|
597
|
+
/**
|
|
598
|
+
* Renderiza o conteúdo de TODAS as guias já abertas, mantendo-as montadas.
|
|
599
|
+
* Apenas a guia ativa fica visível (as demais recebem `--hidden` via CSS),
|
|
600
|
+
* então voltar a uma aba já visitada não a recarrega.
|
|
601
|
+
*/
|
|
602
|
+
buildGuidesContent() {
|
|
507
603
|
if (!this.selectedGuide) {
|
|
508
604
|
return undefined;
|
|
509
605
|
}
|
|
510
|
-
const
|
|
606
|
+
const activeId = this.selectedGuide.id;
|
|
607
|
+
// Garante que a aba ativa sempre renderiza, mesmo se o watch não a registrou ainda.
|
|
608
|
+
const ids = this._openedGuideIds.includes(activeId)
|
|
609
|
+
? this._openedGuideIds
|
|
610
|
+
: [...this._openedGuideIds, activeId];
|
|
611
|
+
return (index.h(index.Fragment, null, ids.map((guideId) => {
|
|
612
|
+
const guide = this._guides.find(g => g.id === guideId);
|
|
613
|
+
if (!guide) {
|
|
614
|
+
return undefined;
|
|
615
|
+
}
|
|
616
|
+
const content = this.renderGuideContent(guide);
|
|
617
|
+
if (content == undefined) {
|
|
618
|
+
return undefined;
|
|
619
|
+
}
|
|
620
|
+
return (index.h("div", { key: `guide_${guideId}`, class: {
|
|
621
|
+
"snk-guides-viewer__guide-content": true,
|
|
622
|
+
"snk-guides-viewer__guide-content--hidden": guideId !== activeId
|
|
623
|
+
} }, content));
|
|
624
|
+
})));
|
|
625
|
+
}
|
|
626
|
+
renderGuideContent(guide) {
|
|
627
|
+
var _a;
|
|
628
|
+
const guideId = guide.id;
|
|
511
629
|
if (this.isCustomGuide(guideId)) {
|
|
512
630
|
return index.h("slot", { name: guideId });
|
|
513
631
|
}
|
|
@@ -515,8 +633,8 @@ const SnkDynaformGuidesViewer = class {
|
|
|
515
633
|
if (childEntityName) {
|
|
516
634
|
return (index.h("snk-dynaform-detail-view", { ref: (ref) => {
|
|
517
635
|
if (ref)
|
|
518
|
-
this.
|
|
519
|
-
}, dataUnitName: `${this.entityPath}/${childEntityName}`, entityName: childEntityName, label:
|
|
636
|
+
this._detailRefs.set(guideId, ref);
|
|
637
|
+
}, dataUnitName: `${this.entityPath}/${childEntityName}`, entityName: childEntityName, label: guide.label, key: `detail_${guideId}`, canEdit: this.canEdit, resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode, messagesBuilder: this.messagesBuilder }));
|
|
520
638
|
}
|
|
521
639
|
if (guideId === this._mainFormName) {
|
|
522
640
|
return undefined;
|
|
@@ -555,6 +673,184 @@ const SnkDynaformGuidesViewer = class {
|
|
|
555
673
|
var _a;
|
|
556
674
|
return this.selectedGuide === undefined || constants.TAB_NAMES.main === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
557
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* Indica se a aba ativa disputa espaço vertical com o formulário principal.
|
|
678
|
+
* Vale para qualquer aba diferente da principal: detalhes E abas nomeadas
|
|
679
|
+
* (ex.: "Identificação"). Nesses casos o master pode ser recolhido.
|
|
680
|
+
*/
|
|
681
|
+
isCollapsibleGuideActive() {
|
|
682
|
+
var _a;
|
|
683
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
684
|
+
if (!id) {
|
|
685
|
+
return false;
|
|
686
|
+
}
|
|
687
|
+
return id !== this._mainFormName;
|
|
688
|
+
}
|
|
689
|
+
hasRecordToSummarize() {
|
|
690
|
+
var _a;
|
|
691
|
+
return ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) != undefined;
|
|
692
|
+
}
|
|
693
|
+
hasMainFormFields() {
|
|
694
|
+
var _a, _b;
|
|
695
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
696
|
+
return false;
|
|
697
|
+
}
|
|
698
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
699
|
+
return ((_b = (_a = sheet === null || sheet === void 0 ? void 0 : sheet.fields) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
|
700
|
+
}
|
|
701
|
+
recomputeMasterCollapse() {
|
|
702
|
+
var _a;
|
|
703
|
+
if (!this.collapsibleMaster || !this.isCollapsibleGuideActive() || !this.hasRecordToSummarize()) {
|
|
704
|
+
this._masterCollapsed = false;
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
if (this._manualOverride != undefined) {
|
|
708
|
+
this._masterCollapsed = this._manualOverride;
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
this._masterCollapsed = ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) ? false : this._hostTight;
|
|
712
|
+
}
|
|
713
|
+
/** Pool de campos candidatos (todos do form principal, até o limite máximo). */
|
|
714
|
+
getSummaryFields() {
|
|
715
|
+
var _a;
|
|
716
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
717
|
+
return [];
|
|
718
|
+
}
|
|
719
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
720
|
+
const fields = (_a = sheet === null || sheet === void 0 ? void 0 : sheet.fields) !== null && _a !== void 0 ? _a : [];
|
|
721
|
+
return fields.slice(0, this.masterSummaryFieldCount);
|
|
722
|
+
}
|
|
723
|
+
/** Record atual (para consultar campos inválidos no DataUnit). */
|
|
724
|
+
getCurrentRecordId() {
|
|
725
|
+
var _a, _b;
|
|
726
|
+
return (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) === null || _b === void 0 ? void 0 : _b["__record__id__"];
|
|
727
|
+
}
|
|
728
|
+
/** Mensagem de invalidez do campo no registro atual, se houver. */
|
|
729
|
+
getFieldInvalidMessage(fieldName) {
|
|
730
|
+
var _a;
|
|
731
|
+
const recordId = this.getCurrentRecordId();
|
|
732
|
+
return recordId == undefined ? undefined : (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getInvalidMessage(recordId, fieldName);
|
|
733
|
+
}
|
|
734
|
+
renderSummaryItem(field) {
|
|
735
|
+
var _a;
|
|
736
|
+
const invalidMessage = this.getFieldInvalidMessage(field.name);
|
|
737
|
+
return (index.h("span", { class: {
|
|
738
|
+
"snk-guides-viewer__master-summary-item": true,
|
|
739
|
+
"snk-guides-viewer__master-summary-item--invalid": invalidMessage != undefined
|
|
740
|
+
}, key: field.name, title: invalidMessage }, index.h("span", { class: "snk-guides-viewer__master-summary-label" }, index.h("span", { class: "snk-guides-viewer__master-summary-label-text" }, (_a = field.label) !== null && _a !== void 0 ? _a : field.name), field.required &&
|
|
741
|
+
index.h("span", { class: "snk-guides-viewer__master-summary-required", "aria-hidden": "true" }, "*")), index.h("span", { class: "snk-guides-viewer__master-summary-value" }, this.formatSummaryValue(field.name))));
|
|
742
|
+
}
|
|
743
|
+
buildMasterSummary() {
|
|
744
|
+
var _a;
|
|
745
|
+
const fields = this.getSummaryFields();
|
|
746
|
+
const visible = fields.slice(0, this._visibleSummaryCount);
|
|
747
|
+
return (index.h("button", { type: "button", class: "snk-guides-viewer__master-summary", "aria-expanded": "false", "aria-label": (_a = this.getMessage("snkCrud.master.expand")) !== null && _a !== void 0 ? _a : "Expandir formulário principal", onClick: () => this.toggleMasterCollapse() }, index.h("div", { class: "snk-guides-viewer__master-summary-fields", ref: (el) => this.bindSummaryFields(el) }, visible.map((field) => this.renderSummaryItem(field))), index.h("div", { class: "snk-guides-viewer__master-summary-measure", "aria-hidden": "true", ref: (el) => { this._summaryMeasureEl = el; } }, fields.map((field) => this.renderSummaryItem(field))), index.h("ez-icon", { iconName: "chevron-down", class: "snk-guides-viewer__master-summary-chevron" })));
|
|
748
|
+
}
|
|
749
|
+
bindSummaryFields(el) {
|
|
750
|
+
var _a;
|
|
751
|
+
if (!el || el === this._summaryFieldsEl) {
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
this._summaryFieldsEl = el;
|
|
755
|
+
(_a = this._summaryResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
756
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
this._summaryResizeObserver = new ResizeObserver(() => this.recomputeVisibleSummary());
|
|
760
|
+
this._summaryResizeObserver.observe(el);
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Mede as larguras naturais (via row-fantasma) e calcula quantos campos
|
|
764
|
+
* cabem na largura visível. Só grava no estado quando o número muda, então
|
|
765
|
+
* não há loop de renderização.
|
|
766
|
+
*/
|
|
767
|
+
recomputeVisibleSummary() {
|
|
768
|
+
const wrap = this._summaryFieldsEl;
|
|
769
|
+
const ghost = this._summaryMeasureEl;
|
|
770
|
+
if (!wrap || !ghost) {
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
const avail = wrap.clientWidth;
|
|
774
|
+
if (avail <= 0) {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const items = Array.from(ghost.children);
|
|
778
|
+
if (items.length === 0) {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
const gapStr = getComputedStyle(ghost).columnGap || getComputedStyle(ghost).gap || "0";
|
|
782
|
+
const gap = parseFloat(gapStr) || 0;
|
|
783
|
+
let used = 0;
|
|
784
|
+
let count = 0;
|
|
785
|
+
for (let i = 0; i < items.length; i++) {
|
|
786
|
+
const add = items[i].offsetWidth + (i > 0 ? gap : 0);
|
|
787
|
+
if (used + add > avail && count >= 1) {
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
used += add;
|
|
791
|
+
count++;
|
|
792
|
+
}
|
|
793
|
+
count = Math.max(1, Math.min(count, items.length));
|
|
794
|
+
if (count !== this._visibleSummaryCount) {
|
|
795
|
+
this._visibleSummaryCount = count;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
formatSummaryValue(fieldName) {
|
|
799
|
+
var _a;
|
|
800
|
+
const formatted = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getFormattedValue(fieldName);
|
|
801
|
+
return (formatted == undefined || formatted === "") ? "-" : formatted;
|
|
802
|
+
}
|
|
803
|
+
toggleMasterCollapse() {
|
|
804
|
+
this._masterCollapsed = !this._masterCollapsed;
|
|
805
|
+
this._manualOverride = this._masterCollapsed;
|
|
806
|
+
}
|
|
807
|
+
buildCollapseControl() {
|
|
808
|
+
var _a;
|
|
809
|
+
const label = (_a = this.getMessage("snkCrud.master.collapse")) !== null && _a !== void 0 ? _a : "Recolher";
|
|
810
|
+
return (index.h("div", { class: "snk-guides-viewer__master-collapse-btn" }, index.h("ez-tooltip", { message: label }, index.h("ez-button", { mode: "icon", iconName: "chevron-up", size: "x-small", variant: "secondary", "aria-label": label, onClick: () => this.toggleMasterCollapse() }))));
|
|
811
|
+
}
|
|
812
|
+
/** Bloco master (resumo + form), sempre montado; recolhe só via CSS. */
|
|
813
|
+
renderMaster(params, canCollapseMaster) {
|
|
814
|
+
return (index.h("div", { class: {
|
|
815
|
+
"snk-guides-viewer__master": true,
|
|
816
|
+
"snk-guides-viewer__master--collapsed": canCollapseMaster && this._masterCollapsed
|
|
817
|
+
} }, canCollapseMaster && this.buildMasterSummary(), index.h("div", { class: "snk-guides-viewer__master-expanded" }, SnkDynaformGuidesViewer.buildMainForm(params), canCollapseMaster && this.buildCollapseControl())));
|
|
818
|
+
}
|
|
819
|
+
/** Abas (quando houver) + container de detalhe. */
|
|
820
|
+
renderTabsAndDetail(params, showTabs) {
|
|
821
|
+
var _a;
|
|
822
|
+
return (index.h("div", { class: "snk-guides-viewer__panel" }, showTabs &&
|
|
823
|
+
index.h("ez-tabselector", Object.assign({ class: "snk-guides-viewer__tabselector", tabs: this.buildTabItems(), selectedTab: (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id, onEzChange: (evt) => this.onTabChange(evt.detail) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("tabselector")}` })), index.h("div", { class: "snk-guides-viewer__detail-container" }, SnkDynaformGuidesViewer.buildFixedForms(params), this.buildGuidesContent())));
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Vincula o container e (re)inicia o observador de tamanho. Chamado pelo
|
|
827
|
+
* `ref` da section — o `componentDidLoad` não serve porque o config carrega
|
|
828
|
+
* de forma assíncrona e a section só monta depois de `isLoaded`.
|
|
829
|
+
*/
|
|
830
|
+
bindContainer(el) {
|
|
831
|
+
if (!el || el === this._container) {
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
this._container = el;
|
|
835
|
+
this.setupResizeObserver();
|
|
836
|
+
}
|
|
837
|
+
setupResizeObserver() {
|
|
838
|
+
var _a;
|
|
839
|
+
if (!this._container || typeof ResizeObserver === 'undefined') {
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
843
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
844
|
+
var _a, _b, _c;
|
|
845
|
+
const height = (_c = (_b = (_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 0;
|
|
846
|
+
const tight = height > 0 && height < this.masterCollapseThreshold;
|
|
847
|
+
if (tight !== this._hostTight) {
|
|
848
|
+
this._hostTight = tight;
|
|
849
|
+
this.recomputeMasterCollapse();
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
this._resizeObserver.observe(this._container);
|
|
853
|
+
}
|
|
558
854
|
addFormLegacyConfigName() {
|
|
559
855
|
var _a;
|
|
560
856
|
if (this.formLegacyConfigName) {
|
|
@@ -574,10 +870,11 @@ const SnkDynaformGuidesViewer = class {
|
|
|
574
870
|
this._configManager.loadConfig();
|
|
575
871
|
}
|
|
576
872
|
async dataUnitActionHandler(action) {
|
|
577
|
-
var _a
|
|
873
|
+
var _a;
|
|
578
874
|
switch (action.type) {
|
|
579
875
|
case core.Action.EDITION_CANCELED:
|
|
580
876
|
case core.Action.DATA_SAVED:
|
|
877
|
+
this.refreshValidationState();
|
|
581
878
|
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
|
|
582
879
|
this.exitViewer();
|
|
583
880
|
if (this.dataUnit) {
|
|
@@ -586,10 +883,9 @@ const SnkDynaformGuidesViewer = class {
|
|
|
586
883
|
}
|
|
587
884
|
break;
|
|
588
885
|
case core.Action.FIELD_INVALIDATED:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
886
|
+
case core.Action.INVALIDATE_CLEAN:
|
|
887
|
+
case core.Action.SAVING_CANCELED:
|
|
888
|
+
this.refreshValidationState();
|
|
593
889
|
break;
|
|
594
890
|
case core.Action.METADATA_LOADED:
|
|
595
891
|
case core.Action.MULTIPLE_EDITION_CHANGED:
|
|
@@ -597,6 +893,37 @@ const SnkDynaformGuidesViewer = class {
|
|
|
597
893
|
break;
|
|
598
894
|
}
|
|
599
895
|
}
|
|
896
|
+
/**
|
|
897
|
+
* Reavalia abas com erro e o realce da tira-resumo a partir do estado atual
|
|
898
|
+
* de campos inválidos do DataUnit. Marca abas cujos campos ainda estão
|
|
899
|
+
* inválidos e DESMARCA as que foram preenchidas/limpas ou canceladas.
|
|
900
|
+
*/
|
|
901
|
+
refreshValidationState() {
|
|
902
|
+
var _a, _b, _c;
|
|
903
|
+
const recordId = this.getCurrentRecordId();
|
|
904
|
+
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
905
|
+
const errored = new Set();
|
|
906
|
+
if (recordId != undefined && sheets) {
|
|
907
|
+
for (const sheet of sheets) {
|
|
908
|
+
const guideName = sheet[0];
|
|
909
|
+
const fields = (_b = sheet[1]) === null || _b === void 0 ? void 0 : _b.fields;
|
|
910
|
+
if (!fields) {
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
913
|
+
for (const field of fields) {
|
|
914
|
+
if (((_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.getInvalidMessage(recordId, field.name)) != undefined) {
|
|
915
|
+
errored.add(guideName);
|
|
916
|
+
break;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
const prev = this._errorTabs;
|
|
922
|
+
if (prev.size === errored.size && [...errored].every(id => prev.has(id))) {
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
this._errorTabs = errored;
|
|
926
|
+
}
|
|
600
927
|
getGuideName(fieldName) {
|
|
601
928
|
var _a, _b;
|
|
602
929
|
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
@@ -677,9 +1004,18 @@ const SnkDynaformGuidesViewer = class {
|
|
|
677
1004
|
this.initKeyboardManager();
|
|
678
1005
|
this.getFieldsSearch();
|
|
679
1006
|
}
|
|
1007
|
+
componentDidRender() {
|
|
1008
|
+
if (this._masterCollapsed) {
|
|
1009
|
+
this.recomputeVisibleSummary();
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
680
1012
|
disconnectedCallback() {
|
|
681
|
-
var _a;
|
|
1013
|
+
var _a, _b, _c;
|
|
682
1014
|
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
1015
|
+
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1016
|
+
this._resizeObserver = undefined;
|
|
1017
|
+
(_c = this._summaryResizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
1018
|
+
this._summaryResizeObserver = undefined;
|
|
683
1019
|
}
|
|
684
1020
|
async initKeyboardManager() {
|
|
685
1021
|
this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
|
|
@@ -693,7 +1029,7 @@ const SnkDynaformGuidesViewer = class {
|
|
|
693
1029
|
}
|
|
694
1030
|
}
|
|
695
1031
|
render() {
|
|
696
|
-
var _a, _b
|
|
1032
|
+
var _a, _b;
|
|
697
1033
|
if (this._formEditorConfigManager != undefined) {
|
|
698
1034
|
return (index.h("snk-dynaform-form-config", { ref: (ref) => {
|
|
699
1035
|
if (ref)
|
|
@@ -704,6 +1040,11 @@ const SnkDynaformGuidesViewer = class {
|
|
|
704
1040
|
return undefined;
|
|
705
1041
|
}
|
|
706
1042
|
const showTabs = this._guides && this._guides.length > 0;
|
|
1043
|
+
const showMaster = this.hasMainFormFields();
|
|
1044
|
+
const canCollapseMaster = showMaster && this.collapsibleMaster
|
|
1045
|
+
&& this.isCollapsibleGuideActive()
|
|
1046
|
+
&& this.hasRecordToSummarize();
|
|
1047
|
+
const masterExpandedVisible = !(canCollapseMaster && this._masterCollapsed);
|
|
707
1048
|
const fixedFormsParams = {
|
|
708
1049
|
formConfig: this.masterFormConfig,
|
|
709
1050
|
formMetadata: this._masterFormMetadata,
|
|
@@ -719,28 +1060,34 @@ const SnkDynaformGuidesViewer = class {
|
|
|
719
1060
|
fieldSearch: this._fieldSearch,
|
|
720
1061
|
onMainFormRef: (ref) => { this._mainForm = ref; }
|
|
721
1062
|
};
|
|
722
|
-
return (index.h("section", { class: "snk-guides-viewer", ref: (ref) => {
|
|
1063
|
+
return (index.h("section", { class: "snk-guides-viewer", ref: (ref) => this.bindContainer(ref), tabindex: -1 }, this.getTitle() && (index.h("div", { class: "ez-row snk-guides-viewer__header" }, index.h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center", key: "header" }, index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()))))), index.h("div", { class: "snk-guides-viewer__container" }, showTabs && showMaster ? (
|
|
1064
|
+
/* Master e abas: split redimensionável. Master alterna resumo/expandido via CSS
|
|
1065
|
+
sem remontar o snk-dynaform-form-view (evita recarga/lentidão). */
|
|
1066
|
+
index.h("ez-split-panel", { direction: "row", structural: true, showGutter: masterExpandedVisible, class: {
|
|
1067
|
+
"snk-guides-viewer__split": true,
|
|
1068
|
+
"snk-guides-viewer__split--collapsed": !masterExpandedVisible
|
|
1069
|
+
}, ref: (ref) => {
|
|
723
1070
|
if (ref)
|
|
724
|
-
this.
|
|
725
|
-
}
|
|
726
|
-
|
|
1071
|
+
this._splitPanel = ref;
|
|
1072
|
+
} }, index.h("ez-split-item", { class: "snk-guides-viewer__split-master", structural: true, enableExpand: false, size: masterExpandedVisible ? MASTER_INITIAL_SIZE : "auto" }, this.renderMaster(fixedFormsParams, canCollapseMaster)), index.h("ez-split-item", { class: "snk-guides-viewer__split-content", structural: true, outline: true, enableExpand: false }, this.renderTabsAndDetail(fixedFormsParams, true)))) : showTabs ? (
|
|
1073
|
+
/* Sem campos no master: abas ocupam toda a área. */
|
|
1074
|
+
this.renderTabsAndDetail(fixedFormsParams, true)) : (
|
|
1075
|
+
/* Sem abas: master ocupa toda a área. */
|
|
1076
|
+
this.renderMaster(fixedFormsParams, canCollapseMaster))), index.h("snk-configurator", { ref: (ref) => {
|
|
727
1077
|
if (ref)
|
|
728
1078
|
this._snkConfigurator = ref;
|
|
729
|
-
}, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
|
|
1079
|
+
}, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID, layoutFormConfig: false, showActionButtons: true })));
|
|
730
1080
|
}
|
|
731
1081
|
get _element() { return index.getElement(this); }
|
|
732
1082
|
static get watchers() { return {
|
|
733
1083
|
"dataUnit": ["observeDataUnit"],
|
|
1084
|
+
"selectedGuide": ["observeSelectedGuide"],
|
|
1085
|
+
"_masterCollapsed": ["observeMasterCollapsed"],
|
|
734
1086
|
"_formEditorConfigManager": ["observeFormConfigManager"],
|
|
735
1087
|
"dataState": ["observeDataState"],
|
|
736
1088
|
"masterFormConfig": ["observeMasterFormConfig"]
|
|
737
1089
|
}; }
|
|
738
1090
|
};
|
|
739
|
-
var GUIDES_VIEWER_VIEW_MODE;
|
|
740
|
-
(function (GUIDES_VIEWER_VIEW_MODE) {
|
|
741
|
-
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["GUIDES"] = 0] = "GUIDES";
|
|
742
|
-
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["CONFIG"] = 1] = "CONFIG";
|
|
743
|
-
})(GUIDES_VIEWER_VIEW_MODE || (GUIDES_VIEWER_VIEW_MODE = {}));
|
|
744
1091
|
SnkDynaformGuidesViewer.style = snkDynaformGuidesViewCss;
|
|
745
1092
|
|
|
746
1093
|
exports.SnkDynaformGuidesViewer = SnkDynaformGuidesViewer;
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkDynaformGuidesView = require('./snk-dynaform-guides-view-
|
|
5
|
+
const snkDynaformGuidesView = require('./snk-dynaform-guides-view-2c7c6ce4.js');
|
|
6
6
|
require('./index-1894343a.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
10
10
|
require('./constants-6d82e405.js');
|
|
11
|
-
require('./ConfigStorage-
|
|
12
|
-
require('./form-config-fetcher-
|
|
13
|
-
require('./DataFetcher-
|
|
11
|
+
require('./ConfigStorage-156bfcac.js');
|
|
12
|
+
require('./form-config-fetcher-bbebdcb8.js');
|
|
13
|
+
require('./DataFetcher-d13b4637.js');
|
|
14
14
|
require('./PrintUtils-bcaeb82f.js');
|
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
17
|
-
require('./taskbar-elements-
|
|
18
|
-
require('./index-
|
|
17
|
+
require('./taskbar-elements-25f800b3.js');
|
|
18
|
+
require('./index-bc950921.js');
|
|
19
19
|
require('./index-f0fe7e6e.js');
|
|
20
20
|
|
|
21
21
|
|