@sankhyalabs/sankhyablocks 10.1.0-dev.57 → 10.1.0-dev.58
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-8d426f44.js} +4 -4
- 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/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_9.cjs.entry.js +8 -8
- package/dist/cjs/snk-application.cjs.entry.js +6 -6
- package/dist/cjs/snk-attach_11.cjs.entry.js +12 -10
- package/dist/cjs/snk-crud.cjs.entry.js +12 -8
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- 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 +7 -7
- package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +31 -8
- package/dist/cjs/{snk-dynaform-guides-view-30ce5a8c.js → snk-dynaform-guides-view-c956fdd4.js} +388 -41
- package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +4 -4
- package/dist/cjs/snk-dynaform.cjs.entry.js +12 -8
- 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 +6 -6
- package/dist/cjs/{snk-guides-viewer-2a55fa3a.js → snk-guides-viewer-727cc1b6.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -5
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +4 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
- package/dist/cjs/{taskbarUtils-4ca4235e.js → taskbarUtils-be0fb299.js} +9 -4
- 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-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/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/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-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-eefb24b4.js} +4 -4
- 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/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +4 -4
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_9.entry.js +8 -8
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach_11.entry.js +12 -10
- package/dist/esm/snk-crud.entry.js +12 -8
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- 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 +7 -7
- package/dist/esm/snk-dynaform-detail-view_2.entry.js +31 -8
- package/dist/esm/{snk-dynaform-guides-view-6aae38f7.js → snk-dynaform-guides-view-9977a60e.js} +389 -42
- package/dist/esm/snk-dynaform-guides-view.entry.js +4 -4
- package/dist/esm/snk-dynaform.entry.js +12 -8
- 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 +6 -6
- package/dist/esm/{snk-guides-viewer-3ea7e312.js → snk-guides-viewer-d512dc7a.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +5 -5
- package/dist/esm/snk-layout-form-config.entry.js +4 -4
- package/dist/esm/snk-pesquisa.entry.js +4 -4
- package/dist/esm/{taskbarUtils-a43e4bba.js → taskbarUtils-c08efdbb.js} +9 -4
- 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-1567aaf9.entry.js +1 -0
- package/dist/sankhyablocks/p-2a83f20e.entry.js +1 -0
- package/dist/sankhyablocks/{p-5a8390f9.entry.js → p-30570022.entry.js} +1 -1
- package/dist/sankhyablocks/p-33f84e69.entry.js +1 -0
- package/dist/sankhyablocks/p-4299bcbb.js +1 -0
- package/dist/sankhyablocks/{p-10d883b0.js → p-4dd574d6.js} +1 -1
- package/dist/sankhyablocks/{p-c5889dae.js → p-59717928.js} +1 -1
- package/dist/sankhyablocks/{p-7e63af25.entry.js → p-62601ac6.entry.js} +1 -1
- package/dist/sankhyablocks/p-64f14e9c.entry.js +1 -0
- package/dist/sankhyablocks/{p-b3762105.entry.js → p-69f1b522.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ee192f06.entry.js → p-711508e7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-733eba69.js → p-75f261aa.js} +1 -1
- package/dist/sankhyablocks/{p-9e97fabb.entry.js → p-8be9d886.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-9a0e5bdf.js +1 -0
- package/dist/sankhyablocks/{p-741f1ad0.entry.js → p-9b5c9387.entry.js} +1 -1
- package/dist/sankhyablocks/p-9e02a785.js +1 -0
- package/dist/sankhyablocks/{p-c6b6567f.entry.js → p-a9330ce9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6f2de911.entry.js → p-af58b0d9.entry.js} +1 -1
- 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-58e0f14b.entry.js → p-d10df418.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4a53fbeb.entry.js → p-d622b92c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7827871d.entry.js → p-d8361914.entry.js} +1 -1
- 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/sankhyablocks.esm.js +1 -1
- 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/package.json +1 -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-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-ed1b1b14.js +0 -1
package/dist/esm/{snk-dynaform-guides-view-6aae38f7.js → snk-dynaform-guides-view-9977a60e.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, e as createEvent, h, F as Fragment, g as getElement } from './index-04f73a26.js';
|
|
2
|
-
import { ObjectUtils, StringUtils, Action, KeyboardManager
|
|
2
|
+
import { ObjectUtils, StringUtils, ElementIDUtils, Action, KeyboardManager } from '@sankhyalabs/core';
|
|
3
3
|
import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
5
5
|
import { a as TAB_NAMES, V as VIEW_MODE } from './constants-7b422de0.js';
|
|
6
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
7
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
|
6
|
+
import { C as ConfigStorage } from './ConfigStorage-0d1c0695.js';
|
|
7
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-98c42169.js';
|
|
8
8
|
import { T as TaskbarElement } from './taskbar-elements-63651ca7.js';
|
|
9
9
|
|
|
10
10
|
class SnkFormConfigManager {
|
|
@@ -189,7 +189,9 @@ class SnkFormConfigManager {
|
|
|
189
189
|
return config;
|
|
190
190
|
}
|
|
191
191
|
config = this.getFormConfig(this._dataUnit, false, true);
|
|
192
|
-
|
|
192
|
+
const previousTabs = this.parseObjectList(config.tabs)
|
|
193
|
+
.map(tab => (Object.assign(Object.assign({}, tab), { visible: true })));
|
|
194
|
+
config.tabs = [];
|
|
193
195
|
config.emptyConfig = false;
|
|
194
196
|
config.defaultConfiguration = true;
|
|
195
197
|
const fields = (_b = (_a = this._dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
|
|
@@ -212,12 +214,19 @@ class SnkFormConfigManager {
|
|
|
212
214
|
field.tab = uiTabName;
|
|
213
215
|
}
|
|
214
216
|
}
|
|
217
|
+
for (const prevTab of previousTabs) {
|
|
218
|
+
if (!config.tabs.some(t => t.name === prevTab.name)) {
|
|
219
|
+
config.tabs.push(prevTab);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
215
222
|
return config;
|
|
216
223
|
}
|
|
217
224
|
}
|
|
218
225
|
|
|
219
|
-
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;
|
|
226
|
+
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)}";
|
|
220
227
|
|
|
228
|
+
/** Tamanho inicial (px) do painel master no split; ajustável arrastando o divisor. */
|
|
229
|
+
const MASTER_INITIAL_SIZE = "300px";
|
|
221
230
|
const SnkDynaformGuidesViewer = class {
|
|
222
231
|
constructor(hostRef) {
|
|
223
232
|
registerInstance(this, hostRef);
|
|
@@ -226,6 +235,8 @@ const SnkDynaformGuidesViewer = class {
|
|
|
226
235
|
this.exit = createEvent(this, "exit", 7);
|
|
227
236
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
228
237
|
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
|
238
|
+
/** Refs das abas de detalhe já montadas, por id de guia. */
|
|
239
|
+
this._detailRefs = new Map();
|
|
229
240
|
this.dataUnit = undefined;
|
|
230
241
|
this.dataState = undefined;
|
|
231
242
|
this.configName = undefined;
|
|
@@ -256,25 +267,87 @@ const SnkDynaformGuidesViewer = class {
|
|
|
256
267
|
this._mainFormName = undefined;
|
|
257
268
|
this._errorTabs = new Set();
|
|
258
269
|
this._hasToCreateFieldSearch = true;
|
|
270
|
+
this.collapsibleMaster = true;
|
|
271
|
+
this.masterSummaryFieldCount = 12;
|
|
272
|
+
this.masterCollapseThreshold = 700;
|
|
273
|
+
this.maxOpenedGuides = 4;
|
|
274
|
+
this._masterCollapsed = false;
|
|
275
|
+
this._hostTight = false;
|
|
276
|
+
this._visibleSummaryCount = Number.MAX_SAFE_INTEGER;
|
|
277
|
+
this._openedGuideIds = [];
|
|
278
|
+
}
|
|
279
|
+
/** Aba de detalhe atualmente selecionada (derivada do mapa de refs). */
|
|
280
|
+
get _currentDetail() {
|
|
281
|
+
var _a;
|
|
282
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
283
|
+
return id ? this._detailRefs.get(id) : undefined;
|
|
259
284
|
}
|
|
260
285
|
observeDataUnit() {
|
|
261
286
|
this.loadGuides(true);
|
|
262
287
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
288
|
+
observeSelectedGuide(newGuide) {
|
|
289
|
+
const id = newGuide === null || newGuide === void 0 ? void 0 : newGuide.id;
|
|
290
|
+
if (!id) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (!this._openedGuideIds.includes(id)) {
|
|
294
|
+
this._openedGuideIds = [...this._openedGuideIds, id];
|
|
295
|
+
}
|
|
296
|
+
this.enforceOpenedGuidesCap(id);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Aplica o teto `maxOpenedGuides` mantendo a ordem de inserção (não reordena
|
|
300
|
+
* — reordenar moveria os nós no DOM e remontaria as abas sobreviventes,
|
|
301
|
+
* anulando o cache). Retém a aba ativa + as inseridas mais recentemente;
|
|
302
|
+
* desmonta as mais antigas e limpa seus refs. `<= 0` desliga o teto.
|
|
303
|
+
*/
|
|
304
|
+
enforceOpenedGuidesCap(activeId) {
|
|
305
|
+
const cap = this.maxOpenedGuides;
|
|
306
|
+
if (cap <= 0 || this._openedGuideIds.length <= cap) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
// Marca p/ manter: a ativa + as mais recentes (varrendo do fim), até o teto.
|
|
310
|
+
const keep = new Set([activeId]);
|
|
311
|
+
for (let i = this._openedGuideIds.length - 1; i >= 0 && keep.size < cap; i--) {
|
|
312
|
+
keep.add(this._openedGuideIds[i]);
|
|
313
|
+
}
|
|
314
|
+
this._openedGuideIds.forEach(gid => {
|
|
315
|
+
if (!keep.has(gid)) {
|
|
316
|
+
this._detailRefs.delete(gid);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
this._openedGuideIds = this._openedGuideIds.filter(gid => keep.has(gid));
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Ao recolher/expandir, o master permanece montado; só muda o tamanho do
|
|
323
|
+
* seu painel (auto quando recolhido, {@link MASTER_INITIAL_SIZE} quando
|
|
324
|
+
* expandido). Reconstrói o split para aplicar o novo template.
|
|
325
|
+
*/
|
|
326
|
+
observeMasterCollapsed() {
|
|
327
|
+
if (typeof requestAnimationFrame !== 'undefined') {
|
|
328
|
+
requestAnimationFrame(() => { var _a; return (_a = this._splitPanel) === null || _a === void 0 ? void 0 : _a.rebuildLayout(); });
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
observeFormConfigManager(value) {
|
|
332
|
+
var _a;
|
|
333
|
+
(_a = this.formConfigVisibilityChanged) === null || _a === void 0 ? void 0 : _a.emit(!!value);
|
|
270
334
|
}
|
|
271
335
|
observeDataState(newValue, oldValue) {
|
|
272
336
|
var _a, _b, _c, _d, _e, _f;
|
|
273
337
|
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__'];
|
|
274
338
|
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__'];
|
|
275
339
|
if (!ObjectUtils.equals(newRecordsIds, oldRecordsIds)) {
|
|
340
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) && !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode)) {
|
|
341
|
+
this._manualOverride = undefined;
|
|
342
|
+
}
|
|
276
343
|
this.loadGuides((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) != (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode));
|
|
277
344
|
}
|
|
345
|
+
else if ((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) !== (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode)) {
|
|
346
|
+
if (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) {
|
|
347
|
+
this._manualOverride = undefined;
|
|
348
|
+
}
|
|
349
|
+
this.recomputeMasterCollapse();
|
|
350
|
+
}
|
|
278
351
|
}
|
|
279
352
|
observeMasterFormConfig() {
|
|
280
353
|
var _a;
|
|
@@ -325,6 +398,7 @@ const SnkDynaformGuidesViewer = class {
|
|
|
325
398
|
* Recarrega os guias baseada nos metadados atuais.
|
|
326
399
|
*/
|
|
327
400
|
async reloadGuides() {
|
|
401
|
+
this._manualOverride = undefined;
|
|
328
402
|
this.loadGuides(false);
|
|
329
403
|
}
|
|
330
404
|
exitViewer() {
|
|
@@ -411,11 +485,24 @@ const SnkDynaformGuidesViewer = class {
|
|
|
411
485
|
});
|
|
412
486
|
this._mainFormName = mainFormName;
|
|
413
487
|
this._guides = guides;
|
|
488
|
+
this.pruneOpenedGuides();
|
|
414
489
|
const currentStillExists = this.selectedGuide
|
|
415
490
|
&& this._guides.some(g => g.id === this.selectedGuide.id);
|
|
416
491
|
if (changeSelection || !currentStillExists) {
|
|
417
492
|
this.selectedGuide = this._guides && this._guides.length > 0 ? this._guides[0] : undefined;
|
|
418
493
|
}
|
|
494
|
+
this.recomputeMasterCollapse();
|
|
495
|
+
}
|
|
496
|
+
/** Remove das guias abertas (e dos refs) ids que não existem mais. */
|
|
497
|
+
pruneOpenedGuides() {
|
|
498
|
+
const validIds = new Set(this._guides.map(g => g.id));
|
|
499
|
+
const filtered = this._openedGuideIds.filter(id => validIds.has(id));
|
|
500
|
+
if (filtered.length !== this._openedGuideIds.length) {
|
|
501
|
+
this._openedGuideIds = filtered;
|
|
502
|
+
}
|
|
503
|
+
Array.from(this._detailRefs.keys())
|
|
504
|
+
.filter(id => !validIds.has(id))
|
|
505
|
+
.forEach(id => this._detailRefs.delete(id));
|
|
419
506
|
}
|
|
420
507
|
hasToDisableDetails(currentRecord) {
|
|
421
508
|
return !currentRecord
|
|
@@ -427,14 +514,18 @@ const SnkDynaformGuidesViewer = class {
|
|
|
427
514
|
return FormMetadata.getDetailName(formId) != undefined;
|
|
428
515
|
}
|
|
429
516
|
buildTabItems() {
|
|
430
|
-
return this._guides.map((guide, index) =>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
517
|
+
return this._guides.map((guide, index) => {
|
|
518
|
+
const hasError = this._errorTabs.has(guide.id);
|
|
519
|
+
return {
|
|
520
|
+
tabKey: guide.id,
|
|
521
|
+
label: guide.label,
|
|
522
|
+
index,
|
|
523
|
+
disabled: guide.disabled,
|
|
524
|
+
rightIcon: hasError ? 'alert-circle-inverted' : undefined,
|
|
525
|
+
rightIconError: hasError,
|
|
526
|
+
leftIcon: this.getTabLeftIcon(guide),
|
|
527
|
+
};
|
|
528
|
+
});
|
|
438
529
|
}
|
|
439
530
|
getTabLeftIcon(guide) {
|
|
440
531
|
var _a, _b;
|
|
@@ -462,6 +553,7 @@ const SnkDynaformGuidesViewer = class {
|
|
|
462
553
|
return;
|
|
463
554
|
}
|
|
464
555
|
this.selectedGuide = targetGuide;
|
|
556
|
+
this.recomputeMasterCollapse();
|
|
465
557
|
}
|
|
466
558
|
static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
|
|
467
559
|
return configManager.saveCardState(formName, cardConfig, propertyChanged);
|
|
@@ -500,12 +592,38 @@ const SnkDynaformGuidesViewer = class {
|
|
|
500
592
|
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 });
|
|
501
593
|
})));
|
|
502
594
|
}
|
|
503
|
-
|
|
504
|
-
|
|
595
|
+
/**
|
|
596
|
+
* Renderiza o conteúdo de TODAS as guias já abertas, mantendo-as montadas.
|
|
597
|
+
* Apenas a guia ativa fica visível (as demais recebem `--hidden` via CSS),
|
|
598
|
+
* então voltar a uma aba já visitada não a recarrega.
|
|
599
|
+
*/
|
|
600
|
+
buildGuidesContent() {
|
|
505
601
|
if (!this.selectedGuide) {
|
|
506
602
|
return undefined;
|
|
507
603
|
}
|
|
508
|
-
const
|
|
604
|
+
const activeId = this.selectedGuide.id;
|
|
605
|
+
// Garante que a aba ativa sempre renderiza, mesmo se o watch não a registrou ainda.
|
|
606
|
+
const ids = this._openedGuideIds.includes(activeId)
|
|
607
|
+
? this._openedGuideIds
|
|
608
|
+
: [...this._openedGuideIds, activeId];
|
|
609
|
+
return (h(Fragment, null, ids.map((guideId) => {
|
|
610
|
+
const guide = this._guides.find(g => g.id === guideId);
|
|
611
|
+
if (!guide) {
|
|
612
|
+
return undefined;
|
|
613
|
+
}
|
|
614
|
+
const content = this.renderGuideContent(guide);
|
|
615
|
+
if (content == undefined) {
|
|
616
|
+
return undefined;
|
|
617
|
+
}
|
|
618
|
+
return (h("div", { key: `guide_${guideId}`, class: {
|
|
619
|
+
"snk-guides-viewer__guide-content": true,
|
|
620
|
+
"snk-guides-viewer__guide-content--hidden": guideId !== activeId
|
|
621
|
+
} }, content));
|
|
622
|
+
})));
|
|
623
|
+
}
|
|
624
|
+
renderGuideContent(guide) {
|
|
625
|
+
var _a;
|
|
626
|
+
const guideId = guide.id;
|
|
509
627
|
if (this.isCustomGuide(guideId)) {
|
|
510
628
|
return h("slot", { name: guideId });
|
|
511
629
|
}
|
|
@@ -513,8 +631,8 @@ const SnkDynaformGuidesViewer = class {
|
|
|
513
631
|
if (childEntityName) {
|
|
514
632
|
return (h("snk-dynaform-detail-view", { ref: (ref) => {
|
|
515
633
|
if (ref)
|
|
516
|
-
this.
|
|
517
|
-
}, dataUnitName: `${this.entityPath}/${childEntityName}`, entityName: childEntityName, label:
|
|
634
|
+
this._detailRefs.set(guideId, ref);
|
|
635
|
+
}, 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 }));
|
|
518
636
|
}
|
|
519
637
|
if (guideId === this._mainFormName) {
|
|
520
638
|
return undefined;
|
|
@@ -553,6 +671,184 @@ const SnkDynaformGuidesViewer = class {
|
|
|
553
671
|
var _a;
|
|
554
672
|
return this.selectedGuide === undefined || TAB_NAMES.main === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
555
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* Indica se a aba ativa disputa espaço vertical com o formulário principal.
|
|
676
|
+
* Vale para qualquer aba diferente da principal: detalhes E abas nomeadas
|
|
677
|
+
* (ex.: "Identificação"). Nesses casos o master pode ser recolhido.
|
|
678
|
+
*/
|
|
679
|
+
isCollapsibleGuideActive() {
|
|
680
|
+
var _a;
|
|
681
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
682
|
+
if (!id) {
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
return id !== this._mainFormName;
|
|
686
|
+
}
|
|
687
|
+
hasRecordToSummarize() {
|
|
688
|
+
var _a;
|
|
689
|
+
return ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) != undefined;
|
|
690
|
+
}
|
|
691
|
+
hasMainFormFields() {
|
|
692
|
+
var _a, _b;
|
|
693
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
694
|
+
return false;
|
|
695
|
+
}
|
|
696
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
697
|
+
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;
|
|
698
|
+
}
|
|
699
|
+
recomputeMasterCollapse() {
|
|
700
|
+
var _a;
|
|
701
|
+
if (!this.collapsibleMaster || !this.isCollapsibleGuideActive() || !this.hasRecordToSummarize()) {
|
|
702
|
+
this._masterCollapsed = false;
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (this._manualOverride != undefined) {
|
|
706
|
+
this._masterCollapsed = this._manualOverride;
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
this._masterCollapsed = ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) ? false : this._hostTight;
|
|
710
|
+
}
|
|
711
|
+
/** Pool de campos candidatos (todos do form principal, até o limite máximo). */
|
|
712
|
+
getSummaryFields() {
|
|
713
|
+
var _a;
|
|
714
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
715
|
+
return [];
|
|
716
|
+
}
|
|
717
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
718
|
+
const fields = (_a = sheet === null || sheet === void 0 ? void 0 : sheet.fields) !== null && _a !== void 0 ? _a : [];
|
|
719
|
+
return fields.slice(0, this.masterSummaryFieldCount);
|
|
720
|
+
}
|
|
721
|
+
/** Record atual (para consultar campos inválidos no DataUnit). */
|
|
722
|
+
getCurrentRecordId() {
|
|
723
|
+
var _a, _b;
|
|
724
|
+
return (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) === null || _b === void 0 ? void 0 : _b["__record__id__"];
|
|
725
|
+
}
|
|
726
|
+
/** Mensagem de invalidez do campo no registro atual, se houver. */
|
|
727
|
+
getFieldInvalidMessage(fieldName) {
|
|
728
|
+
var _a;
|
|
729
|
+
const recordId = this.getCurrentRecordId();
|
|
730
|
+
return recordId == undefined ? undefined : (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getInvalidMessage(recordId, fieldName);
|
|
731
|
+
}
|
|
732
|
+
renderSummaryItem(field) {
|
|
733
|
+
var _a;
|
|
734
|
+
const invalidMessage = this.getFieldInvalidMessage(field.name);
|
|
735
|
+
return (h("span", { class: {
|
|
736
|
+
"snk-guides-viewer__master-summary-item": true,
|
|
737
|
+
"snk-guides-viewer__master-summary-item--invalid": invalidMessage != undefined
|
|
738
|
+
}, 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 &&
|
|
739
|
+
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))));
|
|
740
|
+
}
|
|
741
|
+
buildMasterSummary() {
|
|
742
|
+
var _a;
|
|
743
|
+
const fields = this.getSummaryFields();
|
|
744
|
+
const visible = fields.slice(0, this._visibleSummaryCount);
|
|
745
|
+
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" })));
|
|
746
|
+
}
|
|
747
|
+
bindSummaryFields(el) {
|
|
748
|
+
var _a;
|
|
749
|
+
if (!el || el === this._summaryFieldsEl) {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
this._summaryFieldsEl = el;
|
|
753
|
+
(_a = this._summaryResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
754
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
this._summaryResizeObserver = new ResizeObserver(() => this.recomputeVisibleSummary());
|
|
758
|
+
this._summaryResizeObserver.observe(el);
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Mede as larguras naturais (via row-fantasma) e calcula quantos campos
|
|
762
|
+
* cabem na largura visível. Só grava no estado quando o número muda, então
|
|
763
|
+
* não há loop de renderização.
|
|
764
|
+
*/
|
|
765
|
+
recomputeVisibleSummary() {
|
|
766
|
+
const wrap = this._summaryFieldsEl;
|
|
767
|
+
const ghost = this._summaryMeasureEl;
|
|
768
|
+
if (!wrap || !ghost) {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
const avail = wrap.clientWidth;
|
|
772
|
+
if (avail <= 0) {
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
const items = Array.from(ghost.children);
|
|
776
|
+
if (items.length === 0) {
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
const gapStr = getComputedStyle(ghost).columnGap || getComputedStyle(ghost).gap || "0";
|
|
780
|
+
const gap = parseFloat(gapStr) || 0;
|
|
781
|
+
let used = 0;
|
|
782
|
+
let count = 0;
|
|
783
|
+
for (let i = 0; i < items.length; i++) {
|
|
784
|
+
const add = items[i].offsetWidth + (i > 0 ? gap : 0);
|
|
785
|
+
if (used + add > avail && count >= 1) {
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
used += add;
|
|
789
|
+
count++;
|
|
790
|
+
}
|
|
791
|
+
count = Math.max(1, Math.min(count, items.length));
|
|
792
|
+
if (count !== this._visibleSummaryCount) {
|
|
793
|
+
this._visibleSummaryCount = count;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
formatSummaryValue(fieldName) {
|
|
797
|
+
var _a;
|
|
798
|
+
const formatted = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getFormattedValue(fieldName);
|
|
799
|
+
return (formatted == undefined || formatted === "") ? "-" : formatted;
|
|
800
|
+
}
|
|
801
|
+
toggleMasterCollapse() {
|
|
802
|
+
this._masterCollapsed = !this._masterCollapsed;
|
|
803
|
+
this._manualOverride = this._masterCollapsed;
|
|
804
|
+
}
|
|
805
|
+
buildCollapseControl() {
|
|
806
|
+
var _a;
|
|
807
|
+
const label = (_a = this.getMessage("snkCrud.master.collapse")) !== null && _a !== void 0 ? _a : "Recolher";
|
|
808
|
+
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() }))));
|
|
809
|
+
}
|
|
810
|
+
/** Bloco master (resumo + form), sempre montado; recolhe só via CSS. */
|
|
811
|
+
renderMaster(params, canCollapseMaster) {
|
|
812
|
+
return (h("div", { class: {
|
|
813
|
+
"snk-guides-viewer__master": true,
|
|
814
|
+
"snk-guides-viewer__master--collapsed": canCollapseMaster && this._masterCollapsed
|
|
815
|
+
} }, canCollapseMaster && this.buildMasterSummary(), h("div", { class: "snk-guides-viewer__master-expanded" }, SnkDynaformGuidesViewer.buildMainForm(params), canCollapseMaster && this.buildCollapseControl())));
|
|
816
|
+
}
|
|
817
|
+
/** Abas (quando houver) + container de detalhe. */
|
|
818
|
+
renderTabsAndDetail(params, showTabs) {
|
|
819
|
+
var _a;
|
|
820
|
+
return (h("div", { class: "snk-guides-viewer__panel" }, showTabs &&
|
|
821
|
+
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())));
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Vincula o container e (re)inicia o observador de tamanho. Chamado pelo
|
|
825
|
+
* `ref` da section — o `componentDidLoad` não serve porque o config carrega
|
|
826
|
+
* de forma assíncrona e a section só monta depois de `isLoaded`.
|
|
827
|
+
*/
|
|
828
|
+
bindContainer(el) {
|
|
829
|
+
if (!el || el === this._container) {
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
this._container = el;
|
|
833
|
+
this.setupResizeObserver();
|
|
834
|
+
}
|
|
835
|
+
setupResizeObserver() {
|
|
836
|
+
var _a;
|
|
837
|
+
if (!this._container || typeof ResizeObserver === 'undefined') {
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
841
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
842
|
+
var _a, _b, _c;
|
|
843
|
+
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;
|
|
844
|
+
const tight = height > 0 && height < this.masterCollapseThreshold;
|
|
845
|
+
if (tight !== this._hostTight) {
|
|
846
|
+
this._hostTight = tight;
|
|
847
|
+
this.recomputeMasterCollapse();
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
this._resizeObserver.observe(this._container);
|
|
851
|
+
}
|
|
556
852
|
addFormLegacyConfigName() {
|
|
557
853
|
var _a;
|
|
558
854
|
if (this.formLegacyConfigName) {
|
|
@@ -572,10 +868,11 @@ const SnkDynaformGuidesViewer = class {
|
|
|
572
868
|
this._configManager.loadConfig();
|
|
573
869
|
}
|
|
574
870
|
async dataUnitActionHandler(action) {
|
|
575
|
-
var _a
|
|
871
|
+
var _a;
|
|
576
872
|
switch (action.type) {
|
|
577
873
|
case Action.EDITION_CANCELED:
|
|
578
874
|
case Action.DATA_SAVED:
|
|
875
|
+
this.refreshValidationState();
|
|
579
876
|
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
|
|
580
877
|
this.exitViewer();
|
|
581
878
|
if (this.dataUnit) {
|
|
@@ -584,10 +881,9 @@ const SnkDynaformGuidesViewer = class {
|
|
|
584
881
|
}
|
|
585
882
|
break;
|
|
586
883
|
case Action.FIELD_INVALIDATED:
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}
|
|
884
|
+
case Action.INVALIDATE_CLEAN:
|
|
885
|
+
case Action.SAVING_CANCELED:
|
|
886
|
+
this.refreshValidationState();
|
|
591
887
|
break;
|
|
592
888
|
case Action.METADATA_LOADED:
|
|
593
889
|
case Action.MULTIPLE_EDITION_CHANGED:
|
|
@@ -595,6 +891,37 @@ const SnkDynaformGuidesViewer = class {
|
|
|
595
891
|
break;
|
|
596
892
|
}
|
|
597
893
|
}
|
|
894
|
+
/**
|
|
895
|
+
* Reavalia abas com erro e o realce da tira-resumo a partir do estado atual
|
|
896
|
+
* de campos inválidos do DataUnit. Marca abas cujos campos ainda estão
|
|
897
|
+
* inválidos e DESMARCA as que foram preenchidas/limpas ou canceladas.
|
|
898
|
+
*/
|
|
899
|
+
refreshValidationState() {
|
|
900
|
+
var _a, _b, _c;
|
|
901
|
+
const recordId = this.getCurrentRecordId();
|
|
902
|
+
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
903
|
+
const errored = new Set();
|
|
904
|
+
if (recordId != undefined && sheets) {
|
|
905
|
+
for (const sheet of sheets) {
|
|
906
|
+
const guideName = sheet[0];
|
|
907
|
+
const fields = (_b = sheet[1]) === null || _b === void 0 ? void 0 : _b.fields;
|
|
908
|
+
if (!fields) {
|
|
909
|
+
continue;
|
|
910
|
+
}
|
|
911
|
+
for (const field of fields) {
|
|
912
|
+
if (((_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.getInvalidMessage(recordId, field.name)) != undefined) {
|
|
913
|
+
errored.add(guideName);
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
const prev = this._errorTabs;
|
|
920
|
+
if (prev.size === errored.size && [...errored].every(id => prev.has(id))) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
this._errorTabs = errored;
|
|
924
|
+
}
|
|
598
925
|
getGuideName(fieldName) {
|
|
599
926
|
var _a, _b;
|
|
600
927
|
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
@@ -675,9 +1002,18 @@ const SnkDynaformGuidesViewer = class {
|
|
|
675
1002
|
this.initKeyboardManager();
|
|
676
1003
|
this.getFieldsSearch();
|
|
677
1004
|
}
|
|
1005
|
+
componentDidRender() {
|
|
1006
|
+
if (this._masterCollapsed) {
|
|
1007
|
+
this.recomputeVisibleSummary();
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
678
1010
|
disconnectedCallback() {
|
|
679
|
-
var _a;
|
|
1011
|
+
var _a, _b, _c;
|
|
680
1012
|
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
1013
|
+
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1014
|
+
this._resizeObserver = undefined;
|
|
1015
|
+
(_c = this._summaryResizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
1016
|
+
this._summaryResizeObserver = undefined;
|
|
681
1017
|
}
|
|
682
1018
|
async initKeyboardManager() {
|
|
683
1019
|
this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
|
|
@@ -691,7 +1027,7 @@ const SnkDynaformGuidesViewer = class {
|
|
|
691
1027
|
}
|
|
692
1028
|
}
|
|
693
1029
|
render() {
|
|
694
|
-
var _a, _b
|
|
1030
|
+
var _a, _b;
|
|
695
1031
|
if (this._formEditorConfigManager != undefined) {
|
|
696
1032
|
return (h("snk-dynaform-form-config", { ref: (ref) => {
|
|
697
1033
|
if (ref)
|
|
@@ -702,6 +1038,11 @@ const SnkDynaformGuidesViewer = class {
|
|
|
702
1038
|
return undefined;
|
|
703
1039
|
}
|
|
704
1040
|
const showTabs = this._guides && this._guides.length > 0;
|
|
1041
|
+
const showMaster = this.hasMainFormFields();
|
|
1042
|
+
const canCollapseMaster = showMaster && this.collapsibleMaster
|
|
1043
|
+
&& this.isCollapsibleGuideActive()
|
|
1044
|
+
&& this.hasRecordToSummarize();
|
|
1045
|
+
const masterExpandedVisible = !(canCollapseMaster && this._masterCollapsed);
|
|
705
1046
|
const fixedFormsParams = {
|
|
706
1047
|
formConfig: this.masterFormConfig,
|
|
707
1048
|
formMetadata: this._masterFormMetadata,
|
|
@@ -717,28 +1058,34 @@ const SnkDynaformGuidesViewer = class {
|
|
|
717
1058
|
fieldSearch: this._fieldSearch,
|
|
718
1059
|
onMainFormRef: (ref) => { this._mainForm = ref; }
|
|
719
1060
|
};
|
|
720
|
-
return (h("section", { class: "snk-guides-viewer", ref: (ref) => {
|
|
1061
|
+
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 ? (
|
|
1062
|
+
/* Master e abas: split redimensionável. Master alterna resumo/expandido via CSS
|
|
1063
|
+
sem remontar o snk-dynaform-form-view (evita recarga/lentidão). */
|
|
1064
|
+
h("ez-split-panel", { direction: "row", structural: true, showGutter: masterExpandedVisible, class: {
|
|
1065
|
+
"snk-guides-viewer__split": true,
|
|
1066
|
+
"snk-guides-viewer__split--collapsed": !masterExpandedVisible
|
|
1067
|
+
}, ref: (ref) => {
|
|
721
1068
|
if (ref)
|
|
722
|
-
this.
|
|
723
|
-
}
|
|
724
|
-
|
|
1069
|
+
this._splitPanel = ref;
|
|
1070
|
+
} }, 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 ? (
|
|
1071
|
+
/* Sem campos no master: abas ocupam toda a área. */
|
|
1072
|
+
this.renderTabsAndDetail(fixedFormsParams, true)) : (
|
|
1073
|
+
/* Sem abas: master ocupa toda a área. */
|
|
1074
|
+
this.renderMaster(fixedFormsParams, canCollapseMaster))), h("snk-configurator", { ref: (ref) => {
|
|
725
1075
|
if (ref)
|
|
726
1076
|
this._snkConfigurator = ref;
|
|
727
|
-
}, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
|
|
1077
|
+
}, 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 })));
|
|
728
1078
|
}
|
|
729
1079
|
get _element() { return getElement(this); }
|
|
730
1080
|
static get watchers() { return {
|
|
731
1081
|
"dataUnit": ["observeDataUnit"],
|
|
1082
|
+
"selectedGuide": ["observeSelectedGuide"],
|
|
1083
|
+
"_masterCollapsed": ["observeMasterCollapsed"],
|
|
732
1084
|
"_formEditorConfigManager": ["observeFormConfigManager"],
|
|
733
1085
|
"dataState": ["observeDataState"],
|
|
734
1086
|
"masterFormConfig": ["observeMasterFormConfig"]
|
|
735
1087
|
}; }
|
|
736
1088
|
};
|
|
737
|
-
var GUIDES_VIEWER_VIEW_MODE;
|
|
738
|
-
(function (GUIDES_VIEWER_VIEW_MODE) {
|
|
739
|
-
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["GUIDES"] = 0] = "GUIDES";
|
|
740
|
-
GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["CONFIG"] = 1] = "CONFIG";
|
|
741
|
-
})(GUIDES_VIEWER_VIEW_MODE || (GUIDES_VIEWER_VIEW_MODE = {}));
|
|
742
1089
|
SnkDynaformGuidesViewer.style = snkDynaformGuidesViewCss;
|
|
743
1090
|
|
|
744
1091
|
export { SnkDynaformGuidesViewer as S, SnkFormConfigManager as a };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { S as snk_dynaform_guides_view } from './snk-dynaform-guides-view-
|
|
1
|
+
export { S as snk_dynaform_guides_view } from './snk-dynaform-guides-view-9977a60e.js';
|
|
2
2
|
import './index-04f73a26.js';
|
|
3
3
|
import '@sankhyalabs/core';
|
|
4
4
|
import '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
6
6
|
import './constants-7b422de0.js';
|
|
7
|
-
import './ConfigStorage-
|
|
8
|
-
import './form-config-fetcher-
|
|
9
|
-
import './DataFetcher-
|
|
7
|
+
import './ConfigStorage-0d1c0695.js';
|
|
8
|
+
import './form-config-fetcher-98c42169.js';
|
|
9
|
+
import './DataFetcher-70de9419.js';
|
|
10
10
|
import './PrintUtils-3e4ff0f5.js';
|
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|