@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, forceUpdate, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { ObjectUtils, StringUtils, Action, KeyboardManager
|
|
2
|
+
import { ObjectUtils, StringUtils, ElementIDUtils, Action, KeyboardManager } from '@sankhyalabs/core';
|
|
3
3
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
4
4
|
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
|
5
5
|
import { T as TAB_NAMES, V as VIEW_MODE } from './constants.js';
|
|
@@ -238,7 +238,9 @@ class SnkFormConfigManager {
|
|
|
238
238
|
return config;
|
|
239
239
|
}
|
|
240
240
|
config = this.getFormConfig(this._dataUnit, false, true);
|
|
241
|
-
|
|
241
|
+
const previousTabs = this.parseObjectList(config.tabs)
|
|
242
|
+
.map(tab => (Object.assign(Object.assign({}, tab), { visible: true })));
|
|
243
|
+
config.tabs = [];
|
|
242
244
|
config.emptyConfig = false;
|
|
243
245
|
config.defaultConfiguration = true;
|
|
244
246
|
const fields = (_b = (_a = this._dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
|
|
@@ -261,12 +263,19 @@ class SnkFormConfigManager {
|
|
|
261
263
|
field.tab = uiTabName;
|
|
262
264
|
}
|
|
263
265
|
}
|
|
266
|
+
for (const prevTab of previousTabs) {
|
|
267
|
+
if (!config.tabs.some(t => t.name === prevTab.name)) {
|
|
268
|
+
config.tabs.push(prevTab);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
264
271
|
return config;
|
|
265
272
|
}
|
|
266
273
|
}
|
|
267
274
|
|
|
268
|
-
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;
|
|
275
|
+
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)}";
|
|
269
276
|
|
|
277
|
+
/** Tamanho inicial (px) do painel master no split; ajustável arrastando o divisor. */
|
|
278
|
+
const MASTER_INITIAL_SIZE = "300px";
|
|
270
279
|
const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
271
280
|
constructor() {
|
|
272
281
|
super();
|
|
@@ -276,6 +285,8 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
276
285
|
this.exit = createEvent(this, "exit", 7);
|
|
277
286
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
278
287
|
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
|
288
|
+
/** Refs das abas de detalhe já montadas, por id de guia. */
|
|
289
|
+
this._detailRefs = new Map();
|
|
279
290
|
this.dataUnit = undefined;
|
|
280
291
|
this.dataState = undefined;
|
|
281
292
|
this.configName = undefined;
|
|
@@ -306,25 +317,87 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
306
317
|
this._mainFormName = undefined;
|
|
307
318
|
this._errorTabs = new Set();
|
|
308
319
|
this._hasToCreateFieldSearch = true;
|
|
320
|
+
this.collapsibleMaster = true;
|
|
321
|
+
this.masterSummaryFieldCount = 12;
|
|
322
|
+
this.masterCollapseThreshold = 700;
|
|
323
|
+
this.maxOpenedGuides = 4;
|
|
324
|
+
this._masterCollapsed = false;
|
|
325
|
+
this._hostTight = false;
|
|
326
|
+
this._visibleSummaryCount = Number.MAX_SAFE_INTEGER;
|
|
327
|
+
this._openedGuideIds = [];
|
|
328
|
+
}
|
|
329
|
+
/** Aba de detalhe atualmente selecionada (derivada do mapa de refs). */
|
|
330
|
+
get _currentDetail() {
|
|
331
|
+
var _a;
|
|
332
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
333
|
+
return id ? this._detailRefs.get(id) : undefined;
|
|
309
334
|
}
|
|
310
335
|
observeDataUnit() {
|
|
311
336
|
this.loadGuides(true);
|
|
312
337
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
338
|
+
observeSelectedGuide(newGuide) {
|
|
339
|
+
const id = newGuide === null || newGuide === void 0 ? void 0 : newGuide.id;
|
|
340
|
+
if (!id) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (!this._openedGuideIds.includes(id)) {
|
|
344
|
+
this._openedGuideIds = [...this._openedGuideIds, id];
|
|
345
|
+
}
|
|
346
|
+
this.enforceOpenedGuidesCap(id);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Aplica o teto `maxOpenedGuides` mantendo a ordem de inserção (não reordena
|
|
350
|
+
* — reordenar moveria os nós no DOM e remontaria as abas sobreviventes,
|
|
351
|
+
* anulando o cache). Retém a aba ativa + as inseridas mais recentemente;
|
|
352
|
+
* desmonta as mais antigas e limpa seus refs. `<= 0` desliga o teto.
|
|
353
|
+
*/
|
|
354
|
+
enforceOpenedGuidesCap(activeId) {
|
|
355
|
+
const cap = this.maxOpenedGuides;
|
|
356
|
+
if (cap <= 0 || this._openedGuideIds.length <= cap) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
// Marca p/ manter: a ativa + as mais recentes (varrendo do fim), até o teto.
|
|
360
|
+
const keep = new Set([activeId]);
|
|
361
|
+
for (let i = this._openedGuideIds.length - 1; i >= 0 && keep.size < cap; i--) {
|
|
362
|
+
keep.add(this._openedGuideIds[i]);
|
|
363
|
+
}
|
|
364
|
+
this._openedGuideIds.forEach(gid => {
|
|
365
|
+
if (!keep.has(gid)) {
|
|
366
|
+
this._detailRefs.delete(gid);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
this._openedGuideIds = this._openedGuideIds.filter(gid => keep.has(gid));
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Ao recolher/expandir, o master permanece montado; só muda o tamanho do
|
|
373
|
+
* seu painel (auto quando recolhido, {@link MASTER_INITIAL_SIZE} quando
|
|
374
|
+
* expandido). Reconstrói o split para aplicar o novo template.
|
|
375
|
+
*/
|
|
376
|
+
observeMasterCollapsed() {
|
|
377
|
+
if (typeof requestAnimationFrame !== 'undefined') {
|
|
378
|
+
requestAnimationFrame(() => { var _a; return (_a = this._splitPanel) === null || _a === void 0 ? void 0 : _a.rebuildLayout(); });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
observeFormConfigManager(value) {
|
|
382
|
+
var _a;
|
|
383
|
+
(_a = this.formConfigVisibilityChanged) === null || _a === void 0 ? void 0 : _a.emit(!!value);
|
|
320
384
|
}
|
|
321
385
|
observeDataState(newValue, oldValue) {
|
|
322
386
|
var _a, _b, _c, _d, _e, _f;
|
|
323
387
|
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__'];
|
|
324
388
|
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__'];
|
|
325
389
|
if (!ObjectUtils.equals(newRecordsIds, oldRecordsIds)) {
|
|
390
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) && !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode)) {
|
|
391
|
+
this._manualOverride = undefined;
|
|
392
|
+
}
|
|
326
393
|
this.loadGuides((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) != (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode));
|
|
327
394
|
}
|
|
395
|
+
else if ((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) !== (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode)) {
|
|
396
|
+
if (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) {
|
|
397
|
+
this._manualOverride = undefined;
|
|
398
|
+
}
|
|
399
|
+
this.recomputeMasterCollapse();
|
|
400
|
+
}
|
|
328
401
|
}
|
|
329
402
|
observeMasterFormConfig() {
|
|
330
403
|
var _a;
|
|
@@ -375,6 +448,7 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
375
448
|
* Recarrega os guias baseada nos metadados atuais.
|
|
376
449
|
*/
|
|
377
450
|
async reloadGuides() {
|
|
451
|
+
this._manualOverride = undefined;
|
|
378
452
|
this.loadGuides(false);
|
|
379
453
|
}
|
|
380
454
|
exitViewer() {
|
|
@@ -461,11 +535,24 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
461
535
|
});
|
|
462
536
|
this._mainFormName = mainFormName;
|
|
463
537
|
this._guides = guides;
|
|
538
|
+
this.pruneOpenedGuides();
|
|
464
539
|
const currentStillExists = this.selectedGuide
|
|
465
540
|
&& this._guides.some(g => g.id === this.selectedGuide.id);
|
|
466
541
|
if (changeSelection || !currentStillExists) {
|
|
467
542
|
this.selectedGuide = this._guides && this._guides.length > 0 ? this._guides[0] : undefined;
|
|
468
543
|
}
|
|
544
|
+
this.recomputeMasterCollapse();
|
|
545
|
+
}
|
|
546
|
+
/** Remove das guias abertas (e dos refs) ids que não existem mais. */
|
|
547
|
+
pruneOpenedGuides() {
|
|
548
|
+
const validIds = new Set(this._guides.map(g => g.id));
|
|
549
|
+
const filtered = this._openedGuideIds.filter(id => validIds.has(id));
|
|
550
|
+
if (filtered.length !== this._openedGuideIds.length) {
|
|
551
|
+
this._openedGuideIds = filtered;
|
|
552
|
+
}
|
|
553
|
+
Array.from(this._detailRefs.keys())
|
|
554
|
+
.filter(id => !validIds.has(id))
|
|
555
|
+
.forEach(id => this._detailRefs.delete(id));
|
|
469
556
|
}
|
|
470
557
|
hasToDisableDetails(currentRecord) {
|
|
471
558
|
return !currentRecord
|
|
@@ -477,14 +564,18 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
477
564
|
return FormMetadata.getDetailName(formId) != undefined;
|
|
478
565
|
}
|
|
479
566
|
buildTabItems() {
|
|
480
|
-
return this._guides.map((guide, index) =>
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
567
|
+
return this._guides.map((guide, index) => {
|
|
568
|
+
const hasError = this._errorTabs.has(guide.id);
|
|
569
|
+
return {
|
|
570
|
+
tabKey: guide.id,
|
|
571
|
+
label: guide.label,
|
|
572
|
+
index,
|
|
573
|
+
disabled: guide.disabled,
|
|
574
|
+
rightIcon: hasError ? 'alert-circle-inverted' : undefined,
|
|
575
|
+
rightIconError: hasError,
|
|
576
|
+
leftIcon: this.getTabLeftIcon(guide),
|
|
577
|
+
};
|
|
578
|
+
});
|
|
488
579
|
}
|
|
489
580
|
getTabLeftIcon(guide) {
|
|
490
581
|
var _a, _b;
|
|
@@ -512,6 +603,7 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
512
603
|
return;
|
|
513
604
|
}
|
|
514
605
|
this.selectedGuide = targetGuide;
|
|
606
|
+
this.recomputeMasterCollapse();
|
|
515
607
|
}
|
|
516
608
|
static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
|
|
517
609
|
return configManager.saveCardState(formName, cardConfig, propertyChanged);
|
|
@@ -550,12 +642,38 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
550
642
|
return 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 });
|
|
551
643
|
})));
|
|
552
644
|
}
|
|
553
|
-
|
|
554
|
-
|
|
645
|
+
/**
|
|
646
|
+
* Renderiza o conteúdo de TODAS as guias já abertas, mantendo-as montadas.
|
|
647
|
+
* Apenas a guia ativa fica visível (as demais recebem `--hidden` via CSS),
|
|
648
|
+
* então voltar a uma aba já visitada não a recarrega.
|
|
649
|
+
*/
|
|
650
|
+
buildGuidesContent() {
|
|
555
651
|
if (!this.selectedGuide) {
|
|
556
652
|
return undefined;
|
|
557
653
|
}
|
|
558
|
-
const
|
|
654
|
+
const activeId = this.selectedGuide.id;
|
|
655
|
+
// Garante que a aba ativa sempre renderiza, mesmo se o watch não a registrou ainda.
|
|
656
|
+
const ids = this._openedGuideIds.includes(activeId)
|
|
657
|
+
? this._openedGuideIds
|
|
658
|
+
: [...this._openedGuideIds, activeId];
|
|
659
|
+
return (h(Fragment, null, ids.map((guideId) => {
|
|
660
|
+
const guide = this._guides.find(g => g.id === guideId);
|
|
661
|
+
if (!guide) {
|
|
662
|
+
return undefined;
|
|
663
|
+
}
|
|
664
|
+
const content = this.renderGuideContent(guide);
|
|
665
|
+
if (content == undefined) {
|
|
666
|
+
return undefined;
|
|
667
|
+
}
|
|
668
|
+
return (h("div", { key: `guide_${guideId}`, class: {
|
|
669
|
+
"snk-guides-viewer__guide-content": true,
|
|
670
|
+
"snk-guides-viewer__guide-content--hidden": guideId !== activeId
|
|
671
|
+
} }, content));
|
|
672
|
+
})));
|
|
673
|
+
}
|
|
674
|
+
renderGuideContent(guide) {
|
|
675
|
+
var _a;
|
|
676
|
+
const guideId = guide.id;
|
|
559
677
|
if (this.isCustomGuide(guideId)) {
|
|
560
678
|
return h("slot", { name: guideId });
|
|
561
679
|
}
|
|
@@ -563,8 +681,8 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
563
681
|
if (childEntityName) {
|
|
564
682
|
return (h("snk-dynaform-detail-view", { ref: (ref) => {
|
|
565
683
|
if (ref)
|
|
566
|
-
this.
|
|
567
|
-
}, dataUnitName: `${this.entityPath}/${childEntityName}`, entityName: childEntityName, label:
|
|
684
|
+
this._detailRefs.set(guideId, ref);
|
|
685
|
+
}, 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 }));
|
|
568
686
|
}
|
|
569
687
|
if (guideId === this._mainFormName) {
|
|
570
688
|
return undefined;
|
|
@@ -603,6 +721,184 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
603
721
|
var _a;
|
|
604
722
|
return this.selectedGuide === undefined || TAB_NAMES.main === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
605
723
|
}
|
|
724
|
+
/**
|
|
725
|
+
* Indica se a aba ativa disputa espaço vertical com o formulário principal.
|
|
726
|
+
* Vale para qualquer aba diferente da principal: detalhes E abas nomeadas
|
|
727
|
+
* (ex.: "Identificação"). Nesses casos o master pode ser recolhido.
|
|
728
|
+
*/
|
|
729
|
+
isCollapsibleGuideActive() {
|
|
730
|
+
var _a;
|
|
731
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
732
|
+
if (!id) {
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
735
|
+
return id !== this._mainFormName;
|
|
736
|
+
}
|
|
737
|
+
hasRecordToSummarize() {
|
|
738
|
+
var _a;
|
|
739
|
+
return ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) != undefined;
|
|
740
|
+
}
|
|
741
|
+
hasMainFormFields() {
|
|
742
|
+
var _a, _b;
|
|
743
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
744
|
+
return false;
|
|
745
|
+
}
|
|
746
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
747
|
+
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;
|
|
748
|
+
}
|
|
749
|
+
recomputeMasterCollapse() {
|
|
750
|
+
var _a;
|
|
751
|
+
if (!this.collapsibleMaster || !this.isCollapsibleGuideActive() || !this.hasRecordToSummarize()) {
|
|
752
|
+
this._masterCollapsed = false;
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
if (this._manualOverride != undefined) {
|
|
756
|
+
this._masterCollapsed = this._manualOverride;
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
this._masterCollapsed = ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) ? false : this._hostTight;
|
|
760
|
+
}
|
|
761
|
+
/** Pool de campos candidatos (todos do form principal, até o limite máximo). */
|
|
762
|
+
getSummaryFields() {
|
|
763
|
+
var _a;
|
|
764
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
765
|
+
return [];
|
|
766
|
+
}
|
|
767
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
768
|
+
const fields = (_a = sheet === null || sheet === void 0 ? void 0 : sheet.fields) !== null && _a !== void 0 ? _a : [];
|
|
769
|
+
return fields.slice(0, this.masterSummaryFieldCount);
|
|
770
|
+
}
|
|
771
|
+
/** Record atual (para consultar campos inválidos no DataUnit). */
|
|
772
|
+
getCurrentRecordId() {
|
|
773
|
+
var _a, _b;
|
|
774
|
+
return (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) === null || _b === void 0 ? void 0 : _b["__record__id__"];
|
|
775
|
+
}
|
|
776
|
+
/** Mensagem de invalidez do campo no registro atual, se houver. */
|
|
777
|
+
getFieldInvalidMessage(fieldName) {
|
|
778
|
+
var _a;
|
|
779
|
+
const recordId = this.getCurrentRecordId();
|
|
780
|
+
return recordId == undefined ? undefined : (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getInvalidMessage(recordId, fieldName);
|
|
781
|
+
}
|
|
782
|
+
renderSummaryItem(field) {
|
|
783
|
+
var _a;
|
|
784
|
+
const invalidMessage = this.getFieldInvalidMessage(field.name);
|
|
785
|
+
return (h("span", { class: {
|
|
786
|
+
"snk-guides-viewer__master-summary-item": true,
|
|
787
|
+
"snk-guides-viewer__master-summary-item--invalid": invalidMessage != undefined
|
|
788
|
+
}, key: field.name, title: invalidMessage }, h("span", { class: "snk-guides-viewer__master-summary-label" }, h("span", { class: "snk-guides-viewer__master-summary-label-text" }, (_a = field.label) !== null && _a !== void 0 ? _a : field.name), field.required &&
|
|
789
|
+
h("span", { class: "snk-guides-viewer__master-summary-required", "aria-hidden": "true" }, "*")), h("span", { class: "snk-guides-viewer__master-summary-value" }, this.formatSummaryValue(field.name))));
|
|
790
|
+
}
|
|
791
|
+
buildMasterSummary() {
|
|
792
|
+
var _a;
|
|
793
|
+
const fields = this.getSummaryFields();
|
|
794
|
+
const visible = fields.slice(0, this._visibleSummaryCount);
|
|
795
|
+
return (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() }, h("div", { class: "snk-guides-viewer__master-summary-fields", ref: (el) => this.bindSummaryFields(el) }, visible.map((field) => this.renderSummaryItem(field))), h("div", { class: "snk-guides-viewer__master-summary-measure", "aria-hidden": "true", ref: (el) => { this._summaryMeasureEl = el; } }, fields.map((field) => this.renderSummaryItem(field))), h("ez-icon", { iconName: "chevron-down", class: "snk-guides-viewer__master-summary-chevron" })));
|
|
796
|
+
}
|
|
797
|
+
bindSummaryFields(el) {
|
|
798
|
+
var _a;
|
|
799
|
+
if (!el || el === this._summaryFieldsEl) {
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
this._summaryFieldsEl = el;
|
|
803
|
+
(_a = this._summaryResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
804
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
this._summaryResizeObserver = new ResizeObserver(() => this.recomputeVisibleSummary());
|
|
808
|
+
this._summaryResizeObserver.observe(el);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Mede as larguras naturais (via row-fantasma) e calcula quantos campos
|
|
812
|
+
* cabem na largura visível. Só grava no estado quando o número muda, então
|
|
813
|
+
* não há loop de renderização.
|
|
814
|
+
*/
|
|
815
|
+
recomputeVisibleSummary() {
|
|
816
|
+
const wrap = this._summaryFieldsEl;
|
|
817
|
+
const ghost = this._summaryMeasureEl;
|
|
818
|
+
if (!wrap || !ghost) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
const avail = wrap.clientWidth;
|
|
822
|
+
if (avail <= 0) {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
const items = Array.from(ghost.children);
|
|
826
|
+
if (items.length === 0) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
const gapStr = getComputedStyle(ghost).columnGap || getComputedStyle(ghost).gap || "0";
|
|
830
|
+
const gap = parseFloat(gapStr) || 0;
|
|
831
|
+
let used = 0;
|
|
832
|
+
let count = 0;
|
|
833
|
+
for (let i = 0; i < items.length; i++) {
|
|
834
|
+
const add = items[i].offsetWidth + (i > 0 ? gap : 0);
|
|
835
|
+
if (used + add > avail && count >= 1) {
|
|
836
|
+
break;
|
|
837
|
+
}
|
|
838
|
+
used += add;
|
|
839
|
+
count++;
|
|
840
|
+
}
|
|
841
|
+
count = Math.max(1, Math.min(count, items.length));
|
|
842
|
+
if (count !== this._visibleSummaryCount) {
|
|
843
|
+
this._visibleSummaryCount = count;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
formatSummaryValue(fieldName) {
|
|
847
|
+
var _a;
|
|
848
|
+
const formatted = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getFormattedValue(fieldName);
|
|
849
|
+
return (formatted == undefined || formatted === "") ? "-" : formatted;
|
|
850
|
+
}
|
|
851
|
+
toggleMasterCollapse() {
|
|
852
|
+
this._masterCollapsed = !this._masterCollapsed;
|
|
853
|
+
this._manualOverride = this._masterCollapsed;
|
|
854
|
+
}
|
|
855
|
+
buildCollapseControl() {
|
|
856
|
+
var _a;
|
|
857
|
+
const label = (_a = this.getMessage("snkCrud.master.collapse")) !== null && _a !== void 0 ? _a : "Recolher";
|
|
858
|
+
return (h("div", { class: "snk-guides-viewer__master-collapse-btn" }, h("ez-tooltip", { message: label }, h("ez-button", { mode: "icon", iconName: "chevron-up", size: "x-small", variant: "secondary", "aria-label": label, onClick: () => this.toggleMasterCollapse() }))));
|
|
859
|
+
}
|
|
860
|
+
/** Bloco master (resumo + form), sempre montado; recolhe só via CSS. */
|
|
861
|
+
renderMaster(params, canCollapseMaster) {
|
|
862
|
+
return (h("div", { class: {
|
|
863
|
+
"snk-guides-viewer__master": true,
|
|
864
|
+
"snk-guides-viewer__master--collapsed": canCollapseMaster && this._masterCollapsed
|
|
865
|
+
} }, canCollapseMaster && this.buildMasterSummary(), h("div", { class: "snk-guides-viewer__master-expanded" }, SnkDynaformGuidesViewer.buildMainForm(params), canCollapseMaster && this.buildCollapseControl())));
|
|
866
|
+
}
|
|
867
|
+
/** Abas (quando houver) + container de detalhe. */
|
|
868
|
+
renderTabsAndDetail(params, showTabs) {
|
|
869
|
+
var _a;
|
|
870
|
+
return (h("div", { class: "snk-guides-viewer__panel" }, showTabs &&
|
|
871
|
+
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) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("tabselector")}` })), h("div", { class: "snk-guides-viewer__detail-container" }, SnkDynaformGuidesViewer.buildFixedForms(params), this.buildGuidesContent())));
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Vincula o container e (re)inicia o observador de tamanho. Chamado pelo
|
|
875
|
+
* `ref` da section — o `componentDidLoad` não serve porque o config carrega
|
|
876
|
+
* de forma assíncrona e a section só monta depois de `isLoaded`.
|
|
877
|
+
*/
|
|
878
|
+
bindContainer(el) {
|
|
879
|
+
if (!el || el === this._container) {
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
this._container = el;
|
|
883
|
+
this.setupResizeObserver();
|
|
884
|
+
}
|
|
885
|
+
setupResizeObserver() {
|
|
886
|
+
var _a;
|
|
887
|
+
if (!this._container || typeof ResizeObserver === 'undefined') {
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
891
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
892
|
+
var _a, _b, _c;
|
|
893
|
+
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;
|
|
894
|
+
const tight = height > 0 && height < this.masterCollapseThreshold;
|
|
895
|
+
if (tight !== this._hostTight) {
|
|
896
|
+
this._hostTight = tight;
|
|
897
|
+
this.recomputeMasterCollapse();
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
this._resizeObserver.observe(this._container);
|
|
901
|
+
}
|
|
606
902
|
addFormLegacyConfigName() {
|
|
607
903
|
var _a;
|
|
608
904
|
if (this.formLegacyConfigName) {
|
|
@@ -622,10 +918,11 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
622
918
|
this._configManager.loadConfig();
|
|
623
919
|
}
|
|
624
920
|
async dataUnitActionHandler(action) {
|
|
625
|
-
var _a
|
|
921
|
+
var _a;
|
|
626
922
|
switch (action.type) {
|
|
627
923
|
case Action.EDITION_CANCELED:
|
|
628
924
|
case Action.DATA_SAVED:
|
|
925
|
+
this.refreshValidationState();
|
|
629
926
|
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
|
|
630
927
|
this.exitViewer();
|
|
631
928
|
if (this.dataUnit) {
|
|
@@ -634,10 +931,9 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
634
931
|
}
|
|
635
932
|
break;
|
|
636
933
|
case Action.FIELD_INVALIDATED:
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
934
|
+
case Action.INVALIDATE_CLEAN:
|
|
935
|
+
case Action.SAVING_CANCELED:
|
|
936
|
+
this.refreshValidationState();
|
|
641
937
|
break;
|
|
642
938
|
case Action.METADATA_LOADED:
|
|
643
939
|
case Action.MULTIPLE_EDITION_CHANGED:
|
|
@@ -645,6 +941,37 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
645
941
|
break;
|
|
646
942
|
}
|
|
647
943
|
}
|
|
944
|
+
/**
|
|
945
|
+
* Reavalia abas com erro e o realce da tira-resumo a partir do estado atual
|
|
946
|
+
* de campos inválidos do DataUnit. Marca abas cujos campos ainda estão
|
|
947
|
+
* inválidos e DESMARCA as que foram preenchidas/limpas ou canceladas.
|
|
948
|
+
*/
|
|
949
|
+
refreshValidationState() {
|
|
950
|
+
var _a, _b, _c;
|
|
951
|
+
const recordId = this.getCurrentRecordId();
|
|
952
|
+
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
953
|
+
const errored = new Set();
|
|
954
|
+
if (recordId != undefined && sheets) {
|
|
955
|
+
for (const sheet of sheets) {
|
|
956
|
+
const guideName = sheet[0];
|
|
957
|
+
const fields = (_b = sheet[1]) === null || _b === void 0 ? void 0 : _b.fields;
|
|
958
|
+
if (!fields) {
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
for (const field of fields) {
|
|
962
|
+
if (((_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.getInvalidMessage(recordId, field.name)) != undefined) {
|
|
963
|
+
errored.add(guideName);
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
const prev = this._errorTabs;
|
|
970
|
+
if (prev.size === errored.size && [...errored].every(id => prev.has(id))) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
this._errorTabs = errored;
|
|
974
|
+
}
|
|
648
975
|
getGuideName(fieldName) {
|
|
649
976
|
var _a, _b;
|
|
650
977
|
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
@@ -725,9 +1052,18 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
725
1052
|
this.initKeyboardManager();
|
|
726
1053
|
this.getFieldsSearch();
|
|
727
1054
|
}
|
|
1055
|
+
componentDidRender() {
|
|
1056
|
+
if (this._masterCollapsed) {
|
|
1057
|
+
this.recomputeVisibleSummary();
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
728
1060
|
disconnectedCallback() {
|
|
729
|
-
var _a;
|
|
1061
|
+
var _a, _b, _c;
|
|
730
1062
|
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
1063
|
+
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1064
|
+
this._resizeObserver = undefined;
|
|
1065
|
+
(_c = this._summaryResizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
1066
|
+
this._summaryResizeObserver = undefined;
|
|
731
1067
|
}
|
|
732
1068
|
async initKeyboardManager() {
|
|
733
1069
|
this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
|
|
@@ -741,7 +1077,7 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
741
1077
|
}
|
|
742
1078
|
}
|
|
743
1079
|
render() {
|
|
744
|
-
var _a, _b
|
|
1080
|
+
var _a, _b;
|
|
745
1081
|
if (this._formEditorConfigManager != undefined) {
|
|
746
1082
|
return (h("snk-dynaform-form-config", { ref: (ref) => {
|
|
747
1083
|
if (ref)
|
|
@@ -752,6 +1088,11 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
752
1088
|
return undefined;
|
|
753
1089
|
}
|
|
754
1090
|
const showTabs = this._guides && this._guides.length > 0;
|
|
1091
|
+
const showMaster = this.hasMainFormFields();
|
|
1092
|
+
const canCollapseMaster = showMaster && this.collapsibleMaster
|
|
1093
|
+
&& this.isCollapsibleGuideActive()
|
|
1094
|
+
&& this.hasRecordToSummarize();
|
|
1095
|
+
const masterExpandedVisible = !(canCollapseMaster && this._masterCollapsed);
|
|
755
1096
|
const fixedFormsParams = {
|
|
756
1097
|
formConfig: this.masterFormConfig,
|
|
757
1098
|
formMetadata: this._masterFormMetadata,
|
|
@@ -767,18 +1108,29 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
767
1108
|
fieldSearch: this._fieldSearch,
|
|
768
1109
|
onMainFormRef: (ref) => { this._mainForm = ref; }
|
|
769
1110
|
};
|
|
770
|
-
return (h("section", { class: "snk-guides-viewer", ref: (ref) => {
|
|
1111
|
+
return (h("section", { class: "snk-guides-viewer", ref: (ref) => this.bindContainer(ref), tabindex: -1 }, this.getTitle() && (h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center", key: "header" }, h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()))))), h("div", { class: "snk-guides-viewer__container" }, showTabs && showMaster ? (
|
|
1112
|
+
/* Master e abas: split redimensionável. Master alterna resumo/expandido via CSS
|
|
1113
|
+
sem remontar o snk-dynaform-form-view (evita recarga/lentidão). */
|
|
1114
|
+
h("ez-split-panel", { direction: "row", structural: true, showGutter: masterExpandedVisible, class: {
|
|
1115
|
+
"snk-guides-viewer__split": true,
|
|
1116
|
+
"snk-guides-viewer__split--collapsed": !masterExpandedVisible
|
|
1117
|
+
}, ref: (ref) => {
|
|
771
1118
|
if (ref)
|
|
772
|
-
this.
|
|
773
|
-
}
|
|
774
|
-
|
|
1119
|
+
this._splitPanel = ref;
|
|
1120
|
+
} }, h("ez-split-item", { class: "snk-guides-viewer__split-master", structural: true, enableExpand: false, size: masterExpandedVisible ? MASTER_INITIAL_SIZE : "auto" }, this.renderMaster(fixedFormsParams, canCollapseMaster)), h("ez-split-item", { class: "snk-guides-viewer__split-content", structural: true, outline: true, enableExpand: false }, this.renderTabsAndDetail(fixedFormsParams, true)))) : showTabs ? (
|
|
1121
|
+
/* Sem campos no master: abas ocupam toda a área. */
|
|
1122
|
+
this.renderTabsAndDetail(fixedFormsParams, true)) : (
|
|
1123
|
+
/* Sem abas: master ocupa toda a área. */
|
|
1124
|
+
this.renderMaster(fixedFormsParams, canCollapseMaster))), h("snk-configurator", { ref: (ref) => {
|
|
775
1125
|
if (ref)
|
|
776
1126
|
this._snkConfigurator = ref;
|
|
777
|
-
}, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
|
|
1127
|
+
}, 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 })));
|
|
778
1128
|
}
|
|
779
1129
|
get _element() { return this; }
|
|
780
1130
|
static get watchers() { return {
|
|
781
1131
|
"dataUnit": ["observeDataUnit"],
|
|
1132
|
+
"selectedGuide": ["observeSelectedGuide"],
|
|
1133
|
+
"_masterCollapsed": ["observeMasterCollapsed"],
|
|
782
1134
|
"_formEditorConfigManager": ["observeFormConfigManager"],
|
|
783
1135
|
"dataState": ["observeDataState"],
|
|
784
1136
|
"masterFormConfig": ["observeMasterFormConfig"]
|
|
@@ -804,6 +1156,10 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
804
1156
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
|
805
1157
|
"getCustomTitle": [16],
|
|
806
1158
|
"customGuidesConfig": [16],
|
|
1159
|
+
"collapsibleMaster": [4, "collapsible-master"],
|
|
1160
|
+
"masterSummaryFieldCount": [2, "master-summary-field-count"],
|
|
1161
|
+
"masterCollapseThreshold": [2, "master-collapse-threshold"],
|
|
1162
|
+
"maxOpenedGuides": [2, "max-opened-guides"],
|
|
807
1163
|
"_guides": [32],
|
|
808
1164
|
"_formEditorConfigManager": [32],
|
|
809
1165
|
"_formEditorDataUnit": [32],
|
|
@@ -815,6 +1171,10 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
815
1171
|
"_mainFormName": [32],
|
|
816
1172
|
"_errorTabs": [32],
|
|
817
1173
|
"_hasToCreateFieldSearch": [32],
|
|
1174
|
+
"_masterCollapsed": [32],
|
|
1175
|
+
"_hostTight": [32],
|
|
1176
|
+
"_visibleSummaryCount": [32],
|
|
1177
|
+
"_openedGuideIds": [32],
|
|
818
1178
|
"showFormConfig": [64],
|
|
819
1179
|
"addCustomEditor": [64],
|
|
820
1180
|
"addGridCustomRender": [64],
|
|
@@ -822,11 +1182,6 @@ const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
822
1182
|
"setFocus": [64],
|
|
823
1183
|
"reloadGuides": [64]
|
|
824
1184
|
}, [[2, "actionClick", "onActionClick"], [0, "snkContentCardChanged", "onContentCardChanged"]]]);
|
|
825
|
-
var GUIDES_VIEWER_VIEW_MODE;
|
|
826
|
-
(function (GUIDES_VIEWER_VIEW_MODE) {
|
|
827
|
-
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["GUIDES"] = 0] = "GUIDES";
|
|
828
|
-
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["CONFIG"] = 1] = "CONFIG";
|
|
829
|
-
})(GUIDES_VIEWER_VIEW_MODE || (GUIDES_VIEWER_VIEW_MODE = {}));
|
|
830
1185
|
function defineCustomElement$1() {
|
|
831
1186
|
if (typeof customElements === "undefined") {
|
|
832
1187
|
return;
|
|
@@ -1056,13 +1411,15 @@ function defineCustomElement$1() {
|
|
|
1056
1411
|
} });
|
|
1057
1412
|
}
|
|
1058
1413
|
|
|
1059
|
-
const snkDynaformDetailViewCss = ".sc-snk-dynaform-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%;overflow:hidden}.level-path.sc-snk-dynaform-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.grid-container.sc-snk-dynaform-detail-view{min-height:100px;height:100%;width:100%;display:flex;flex-wrap:wrap;text-decoration:none;border-radius:var(--border--radius-medium);background-color:var(--color--gray-70, #FFFFFF);border:1px solid var(--color--petroleum-100, #C8CCD3)}.detail-header.sc-snk-dynaform-detail-view{padding-bottom:0}snk-data-unit.sc-snk-dynaform-detail-view{flex:1;gap:var(--space--12, 12px);display:flex;flex-direction:column}snk-grid.sc-snk-dynaform-detail-view{height:100%;--snk-grid-margin:0px;--snk-grid-box-shadow:none}.form-and-detail-container.sc-snk-dynaform-detail-view{display:flex;flex-direction:column;height:100%;width:100%;overflow:auto;padding:var(--space--12, 12px)}.ez-tabselector-internal.sc-snk-dynaform-detail-view{margin:var(--space--8, 8px) 0}.selected-record-header.sc-snk-dynaform-detail-view{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space--8, 8px) var(--space--12, 12px);padding:var(--space--12, 12px) var(--space--16, 16px);margin-bottom:var(--space--12, 12px);background:var(--color--gray-80, #F9F9F9);border-radius:var(--border--radius-12, 12px);font-family:var(--font--pattern);border:1px solid var(--color--petroleum-100, #C8CCD3);border-left:4px solid var(--color--ocean-green-500, #00B07E)}.selected-record-header--message.sc-snk-dynaform-detail-view{border-left-color:var(--color--primary, #007EFF)}.selected-record-header__message.sc-snk-dynaform-detail-view{font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--medium, 500);color:var(--color--title-primary, #2B3A54)}.selected-record-header__chip.sc-snk-dynaform-detail-view{display:inline-flex;flex-direction:row;align-items:center;gap:var(--space--4, 4px);min-width:0}.selected-record-header__label.sc-snk-dynaform-detail-view{font-size:var(--font-size--xs, 11px);font-weight:var(--font-weight--medium, 500);text-transform:uppercase;letter-spacing:0.04em;color:var(--color--text-secondary, #6E7A8A)}.selected-record-header__value.sc-snk-dynaform-detail-view{font-size:var(--font-size--md, 15px);font-weight:var(--font-weight--semibold, 600);color:var(--color--ocean-green-1000, #00281D);line-height:1.2;word-break:break-word}.selected-record-header__separator.sc-snk-dynaform-detail-view{display:inline-block;align-self:stretch;width:1px;background:var(--color--petroleum-100, #C8CCD3);margin:0 var(--space--4, 4px)}";
|
|
1414
|
+
const snkDynaformDetailViewCss = ".sc-snk-dynaform-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;padding:var(--space--4, 4px);scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar{width:var(--space--14, 14px);height:var(--space--14, 14px)}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-track{background:transparent}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-100, 100px);border:2px solid transparent;background-clip:padding-box}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-corner{background:transparent}.level-path.sc-snk-dynaform-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.grid-container.sc-snk-dynaform-detail-view{min-height:100px;height:100%;width:100%;display:flex;flex-wrap:wrap;text-decoration:none;border-radius:var(--border--radius-medium);background-color:var(--color--gray-70, #FFFFFF);border:1px solid var(--color--petroleum-100, #C8CCD3)}.detail-header.sc-snk-dynaform-detail-view{padding-bottom:0}snk-data-unit.sc-snk-dynaform-detail-view{flex:1;min-height:0;gap:var(--space--12, 12px);display:flex;flex-direction:column}snk-data-unit.sc-snk-dynaform-detail-view ez-view-stack.sc-snk-dynaform-detail-view{flex:1;min-height:0}snk-grid.sc-snk-dynaform-detail-view{height:100%;--snk-grid-margin:0px;--snk-grid-box-shadow:none;--snk-grid-min-height:135px}.form-and-detail-container.sc-snk-dynaform-detail-view>ez-tabselector.sc-snk-dynaform-detail-view{flex-shrink:0}.form-and-detail-container.sc-snk-dynaform-detail-view{display:flex;flex-direction:column;height:100%;width:100%;overflow:auto;padding:var(--space--12, 12px);scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar{width:var(--space--14, 14px);height:var(--space--14, 14px)}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-track{background:transparent}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-100, 100px);border:2px solid transparent;background-clip:padding-box}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-corner{background:transparent}.ez-tabselector-internal.sc-snk-dynaform-detail-view{margin:var(--space--8, 8px) 0}.selected-record-header.sc-snk-dynaform-detail-view{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space--8, 8px) var(--space--12, 12px);padding:var(--space--12, 12px) var(--space--16, 16px);margin-bottom:var(--space--12, 12px);background:var(--color--gray-80, #F9F9F9);border-radius:var(--border--radius-12, 12px);font-family:var(--font--pattern);border:1px solid var(--color--petroleum-100, #C8CCD3);border-left:4px solid var(--color--ocean-green-500, #00B07E)}.selected-record-header--message.sc-snk-dynaform-detail-view{border-left-color:var(--color--primary, #007EFF)}.selected-record-header__message.sc-snk-dynaform-detail-view{font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--medium, 500);color:var(--color--title-primary, #2B3A54)}.selected-record-header__chip.sc-snk-dynaform-detail-view{display:inline-flex;flex-direction:row;align-items:center;gap:var(--space--4, 4px);min-width:0}.selected-record-header__label.sc-snk-dynaform-detail-view{font-size:var(--font-size--xs, 11px);font-weight:var(--font-weight--medium, 500);text-transform:uppercase;letter-spacing:0.04em;color:var(--color--text-secondary, #6E7A8A)}.selected-record-header__value.sc-snk-dynaform-detail-view{font-size:var(--font-size--md, 15px);font-weight:var(--font-weight--semibold, 600);color:var(--color--ocean-green-1000, #00281D);line-height:1.2;word-break:break-word}.selected-record-header__separator.sc-snk-dynaform-detail-view{display:inline-block;align-self:stretch;width:1px;background:var(--color--petroleum-100, #C8CCD3);margin:0 var(--space--4, 4px)}";
|
|
1060
1415
|
|
|
1061
1416
|
const SnkDynaformDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
1062
1417
|
constructor() {
|
|
1063
1418
|
super();
|
|
1064
1419
|
this.__registerHost();
|
|
1065
1420
|
this._taskbarProcessor = new SimpleTaskbarProcessor(DEFAULT_TASKBAR_BUTTONS);
|
|
1421
|
+
/** Evita repetir a carga inicial da grade no mesmo mount da aba. */
|
|
1422
|
+
this._didInitialLoad = false;
|
|
1066
1423
|
this._currentView = 0;
|
|
1067
1424
|
this.attachmentRegisterKey = undefined;
|
|
1068
1425
|
this._fieldToGetFocus = undefined;
|
|
@@ -1211,6 +1568,27 @@ const SnkDynaformDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
1211
1568
|
dataUnitReadyHandler(evt) {
|
|
1212
1569
|
this.dataUnit = evt.detail;
|
|
1213
1570
|
this.loadMetadata();
|
|
1571
|
+
this.ensureInitialLoad();
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* Dispara a carga inicial da grade quando a aba é montada com o master já
|
|
1575
|
+
* selecionado. A carga do filho normalmente é disparada pelo evento de troca
|
|
1576
|
+
* de seleção do master; uma aba montada tardiamente (aberta depois que o
|
|
1577
|
+
* registro master já estava selecionado) não recebe esse evento e ficaria
|
|
1578
|
+
* vazia até um refresh manual. Navegações seguintes do master continuam
|
|
1579
|
+
* recarregando pela assinatura existente do DataUnit.
|
|
1580
|
+
*/
|
|
1581
|
+
ensureInitialLoad() {
|
|
1582
|
+
var _a, _b, _c, _d, _e;
|
|
1583
|
+
if (this._didInitialLoad) {
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
const dataUnit = this.dataUnit;
|
|
1587
|
+
const parentDataUnit = (_a = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getParentDataUnit) === null || _a === void 0 ? void 0 : _a.call(dataUnit);
|
|
1588
|
+
if (((_b = parentDataUnit === null || parentDataUnit === void 0 ? void 0 : parentDataUnit.getSelectedRecord) === null || _b === void 0 ? void 0 : _b.call(parentDataUnit)) && ((_d = (_c = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.records) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) === 0) {
|
|
1589
|
+
this._didInitialLoad = true;
|
|
1590
|
+
(_e = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.loadData) === null || _e === void 0 ? void 0 : _e.call(dataUnit);
|
|
1591
|
+
}
|
|
1214
1592
|
}
|
|
1215
1593
|
getFormFields() {
|
|
1216
1594
|
var _a, _b, _c;
|