@asam-ui/pro 0.0.0-stage → 2.0.0
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/EDITOR_THIRD_PARTY_NOTICES.md +225 -0
- package/LICENSE +68 -0
- package/README.md +250 -2
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/AsamAdminLayout-DMsByuNN.js +205 -0
- package/dist/Controller-DF6lMt-H.js +3817 -0
- package/dist/Index-DpcRToBH.js +1263 -0
- package/dist/Navigation-D9wz-rqJ.js +202 -0
- package/dist/Resolve-Cq2BDFwo.js +7 -0
- package/dist/_plugin-vue_export-helper-C05QHVBA.js +8 -0
- package/dist/application/composables/environment/index.d.ts +2 -0
- package/dist/application/composables/environment/index.js +2 -0
- package/dist/application/composables/index.d.ts +14 -0
- package/dist/application/composables/index.js +40 -0
- package/dist/application/composables/on-mounted-or-activated/index.d.ts +2 -0
- package/dist/application/composables/on-mounted-or-activated/index.js +2 -0
- package/dist/application/composables/raf/index.d.ts +2 -0
- package/dist/application/composables/raf/index.js +2 -0
- package/dist/application/composables/use-click-away/index.d.ts +3 -0
- package/dist/application/composables/use-click-away/index.js +2 -0
- package/dist/application/composables/use-count-down/index.d.ts +3 -0
- package/dist/application/composables/use-count-down/index.js +2 -0
- package/dist/application/composables/use-custom-field-value/AsamCustomField.vue.d.ts +118 -0
- package/dist/application/composables/use-custom-field-value/Types.d.ts +27 -0
- package/dist/application/composables/use-custom-field-value/index.d.ts +6 -0
- package/dist/application/composables/use-custom-field-value/index.js +2 -0
- package/dist/application/composables/use-event-listener/index.d.ts +5 -0
- package/dist/application/composables/use-event-listener/index.js +7 -0
- package/dist/application/composables/use-page-visibility/index.d.ts +2 -0
- package/dist/application/composables/use-page-visibility/index.js +2 -0
- package/dist/application/composables/use-raf/index.d.ts +2 -0
- package/dist/application/composables/use-raf/index.js +2 -0
- package/dist/application/composables/use-rect/index.d.ts +2 -0
- package/dist/application/composables/use-rect/index.js +2 -0
- package/dist/application/composables/use-relation/index.d.ts +10 -0
- package/dist/application/composables/use-relation/index.js +17 -0
- package/dist/application/composables/use-scroll-parent/index.d.ts +2 -0
- package/dist/application/composables/use-scroll-parent/index.js +2 -0
- package/dist/application/composables/use-toggle/index.d.ts +2 -0
- package/dist/application/composables/use-toggle/index.js +2 -0
- package/dist/application/composables/use-window-size/index.d.ts +2 -0
- package/dist/application/composables/use-window-size/index.js +2 -0
- package/dist/application/index.d.ts +5 -0
- package/dist/application/index.js +16 -0
- package/dist/application/navigation/EmbedPage.vue.d.ts +18 -0
- package/dist/application/navigation/Navigation.d.ts +48 -0
- package/dist/application/navigation/NavigationMenuItems.vue.d.ts +8 -0
- package/dist/application/navigation/NavigationPage.vue.d.ts +10 -0
- package/dist/application/navigation/NavigationShell.vue.d.ts +22 -0
- package/dist/application/navigation/NavigationToolbar.vue.d.ts +11 -0
- package/dist/application/navigation/NavigationView.vue.d.ts +8 -0
- package/dist/application/navigation/Types.d.ts +53 -0
- package/dist/application/navigation/index.d.ts +6 -0
- package/dist/application/navigation/index.js +3 -0
- package/dist/application/preferences/Cache.d.ts +25 -0
- package/dist/application/preferences/I18n.d.ts +25 -0
- package/dist/application/preferences/LocaleLoader.d.ts +22 -0
- package/dist/application/preferences/Preferences.d.ts +16 -0
- package/dist/application/preferences/Storage.d.ts +9 -0
- package/dist/application/preferences/Types.d.ts +38 -0
- package/dist/application/preferences/index.d.ts +9 -0
- package/dist/application/preferences/index.js +2 -0
- package/dist/application/security/Navigation.d.ts +107 -0
- package/dist/application/security/Security.d.ts +74 -0
- package/dist/application/security/Types.d.ts +49 -0
- package/dist/application/security/index.d.ts +4 -0
- package/dist/application/security/index.js +2 -0
- package/dist/application/transport/Client.d.ts +17 -0
- package/dist/application/transport/Latest.d.ts +7 -0
- package/dist/application/transport/Provider.d.ts +4 -0
- package/dist/application/transport/Types.d.ts +60 -0
- package/dist/application/transport/index.d.ts +4 -0
- package/dist/application/transport/index.js +2 -0
- package/dist/chunk-DmhlhrBa.js +11 -0
- package/dist/components/index.d.ts +50 -0
- package/dist/components/index.js +4 -0
- package/dist/components-ST0i0Wqf.js +17084 -0
- package/dist/configuration/AsamApplicationProvider.vue.d.ts +13 -0
- package/dist/configuration/AsamPermission.vue.d.ts +13 -0
- package/dist/configuration/Context.d.ts +7 -0
- package/dist/configuration/Index.d.ts +5 -0
- package/dist/configuration/Permission.d.ts +5 -0
- package/dist/configuration/Types.d.ts +65 -0
- package/dist/detail/AsamDetailDialog.vue.d.ts +26 -0
- package/dist/detail/AsamDetailDrawer.vue.d.ts +26 -0
- package/dist/detail/AsamDetailPanel.vue.d.ts +36 -0
- package/dist/detail/Controller.d.ts +2 -0
- package/dist/detail/OverlayTypes.d.ts +61 -0
- package/dist/detail/Types.d.ts +50 -0
- package/dist/display/cards/Animation.d.ts +6 -0
- package/dist/display/cards/AsamCardGroup.vue.d.ts +14 -0
- package/dist/display/cards/AsamCountTo.vue.d.ts +13 -0
- package/dist/display/cards/AsamDisplayCard.vue.d.ts +15 -0
- package/dist/display/cards/AsamNumberDisplay.vue.d.ts +6 -0
- package/dist/display/cards/AsamProAvatarGroup.vue.d.ts +15 -0
- package/dist/display/cards/AsamStatisticCard.vue.d.ts +13 -0
- package/dist/display/cards/AsamTrend.vue.d.ts +6 -0
- package/dist/display/cards/Format.d.ts +5 -0
- package/dist/display/cards/Index.d.ts +9 -0
- package/dist/display/cards/Types.d.ts +106 -0
- package/dist/display/guidance/AsamGuidedTour.vue.d.ts +29 -0
- package/dist/display/guidance/AsamHelpPanel.vue.d.ts +27 -0
- package/dist/display/guidance/AsamNotificationMenu.vue.d.ts +19 -0
- package/dist/display/guidance/AsamNotificationPanel.vue.d.ts +34 -0
- package/dist/display/guidance/Async.d.ts +9 -0
- package/dist/display/guidance/Focus.d.ts +2 -0
- package/dist/display/guidance/Index.d.ts +5 -0
- package/dist/display/guidance/Model.d.ts +7 -0
- package/dist/display/guidance/Types.d.ts +107 -0
- package/dist/display/shared/OverlayStyle.d.ts +6 -0
- package/dist/display/states/AsamErrorBoundary.vue.d.ts +22 -0
- package/dist/display/states/AsamException.vue.d.ts +21 -0
- package/dist/display/states/AsamFieldAnnotation.vue.d.ts +19 -0
- package/dist/display/states/AsamPageSkeleton.vue.d.ts +20 -0
- package/dist/display/states/AsamPageWatermark.vue.d.ts +16 -0
- package/dist/display/states/AsamStatePanel.vue.d.ts +25 -0
- package/dist/display/states/Index.d.ts +8 -0
- package/dist/display/states/Tools.d.ts +29 -0
- package/dist/display/states/Types.d.ts +114 -0
- package/dist/display/text-time/AsamProCalendar.vue.d.ts +17 -0
- package/dist/display/text-time/AsamProCountdown.vue.d.ts +17 -0
- package/dist/display/text-time/AsamRelativeTime.vue.d.ts +11 -0
- package/dist/display/text-time/AsamTextEllipsis.vue.d.ts +10 -0
- package/dist/display/text-time/AsamWordCount.vue.d.ts +11 -0
- package/dist/display/text-time/Clock.d.ts +6 -0
- package/dist/display/text-time/Core.d.ts +10 -0
- package/dist/display/text-time/Index.d.ts +7 -0
- package/dist/display/text-time/Types.d.ts +99 -0
- package/dist/editor/AsamEditorActions.vue.d.ts +17 -0
- package/dist/editor/AsamEditorFields.vue.d.ts +38 -0
- package/dist/editor/AsamEditorForm.vue.d.ts +32 -0
- package/dist/editor/AsamFormDialog.vue.d.ts +28 -0
- package/dist/editor/Controller.d.ts +2 -0
- package/dist/editor/Coordinator.d.ts +3 -0
- package/dist/editor/EditorFormTypes.d.ts +65 -0
- package/dist/editor/Layout.d.ts +10 -0
- package/dist/editor/Snapshot.d.ts +4 -0
- package/dist/editor/Types.d.ts +92 -0
- package/dist/en-CcfyIwWv.js +1023 -0
- package/dist/fields/AsamField.d.ts +36 -0
- package/dist/fields/I18n.d.ts +70 -0
- package/dist/fields/Model.d.ts +13 -0
- package/dist/fields/Options.d.ts +37 -0
- package/dist/fields/Schema.d.ts +8 -0
- package/dist/fields/Types.d.ts +106 -0
- package/dist/fields/choice/AsamChoiceCard.vue.d.ts +74 -0
- package/dist/fields/choice/AsamChoiceGroup.vue.d.ts +25 -0
- package/dist/fields/choice/Color.d.ts +2 -0
- package/dist/fields/choice/Fields.d.ts +8 -0
- package/dist/fields/choice/Index.d.ts +6 -0
- package/dist/fields/choice/Selection.d.ts +5 -0
- package/dist/fields/choice/Types.d.ts +97 -0
- package/dist/fields/editors/AsamContentEditor.vue.d.ts +25 -0
- package/dist/fields/editors/AsamEditorResourceStatus.vue.d.ts +19 -0
- package/dist/fields/editors/Fields.d.ts +13 -0
- package/dist/fields/editors/Index.d.ts +5 -0
- package/dist/fields/editors/Markdown.d.ts +3 -0
- package/dist/fields/editors/Model.d.ts +5 -0
- package/dist/fields/editors/Types.d.ts +52 -0
- package/dist/fields/modes/AsamFieldView.d.ts +37 -0
- package/dist/fields/modes/Binding.d.ts +2 -0
- package/dist/fields/modes/Index.d.ts +5 -0
- package/dist/fields/modes/Read.d.ts +3 -0
- package/dist/fields/modes/Resource.d.ts +4 -0
- package/dist/fields/modes/Transform.d.ts +21 -0
- package/dist/fields/modes/Types.d.ts +72 -0
- package/dist/fields/numeric/Fields.d.ts +6 -0
- package/dist/fields/numeric/Index.d.ts +3 -0
- package/dist/fields/numeric/MoneyInput.d.ts +3 -0
- package/dist/fields/numeric/Types.d.ts +61 -0
- package/dist/fields/numeric/Validation.d.ts +12 -0
- package/dist/fields/options/Fields.d.ts +15 -0
- package/dist/fields/options/Hierarchy.d.ts +13 -0
- package/dist/fields/options/Index.d.ts +5 -0
- package/dist/fields/options/Paged.d.ts +23 -0
- package/dist/fields/options/Region.d.ts +9 -0
- package/dist/fields/options/Types.d.ts +48 -0
- package/dist/fields/resources/AsamResourceField.vue.d.ts +32 -0
- package/dist/fields/resources/Controller.d.ts +46 -0
- package/dist/fields/resources/Fields.d.ts +5 -0
- package/dist/fields/resources/Index.d.ts +5 -0
- package/dist/fields/resources/Model.d.ts +8 -0
- package/dist/fields/resources/Types.d.ts +86 -0
- package/dist/fields/temporal/Core.d.ts +10 -0
- package/dist/fields/temporal/Fields.d.ts +4 -0
- package/dist/fields/temporal/Index.d.ts +3 -0
- package/dist/fields/temporal/Types.d.ts +48 -0
- package/dist/fields/text/Captcha.d.ts +3 -0
- package/dist/fields/text/Fields.d.ts +6 -0
- package/dist/fields/text/Index.d.ts +3 -0
- package/dist/fields/text/Types.d.ts +80 -0
- package/dist/form/flows/AsamFilterPopover.vue.d.ts +51 -0
- package/dist/form/flows/AsamFormDrawer.vue.d.ts +34 -0
- package/dist/form/flows/AsamLoginForm.vue.d.ts +42 -0
- package/dist/form/flows/AsamLoginPage.vue.d.ts +51 -0
- package/dist/form/flows/AsamStepsForm.vue.d.ts +52 -0
- package/dist/form/flows/FlowFields.vue.d.ts +33 -0
- package/dist/form/flows/Focus.d.ts +2 -0
- package/dist/form/flows/Index.d.ts +6 -0
- package/dist/form/flows/LoginTemplateMessages.d.ts +45 -0
- package/dist/form/flows/OverlayStyle.d.ts +1 -0
- package/dist/form/flows/Session.d.ts +33 -0
- package/dist/form/flows/Types.d.ts +63 -0
- package/dist/form/schema/AsamSchemaForm.vue.d.ts +42 -0
- package/dist/form/schema/Controller.d.ts +47 -0
- package/dist/form/schema/Index.d.ts +6 -0
- package/dist/form/schema/Path.d.ts +10 -0
- package/dist/form/schema/Schema.d.ts +31 -0
- package/dist/form/schema/SchemaNodes.d.ts +34 -0
- package/dist/form/schema/Types.d.ts +114 -0
- package/dist/form/shared/ValidationSummary.vue.d.ts +17 -0
- package/dist/i18n/Parameters.d.ts +78 -0
- package/dist/i18n/Types.d.ts +10 -0
- package/dist/i18n/application/Parameters.d.ts +55 -0
- package/dist/i18n/application/Resolve.d.ts +7 -0
- package/dist/i18n/application/en.d.ts +53 -0
- package/dist/i18n/application/zh-CN.d.ts +53 -0
- package/dist/i18n/en.d.ts +1014 -0
- package/dist/i18n/en.js +2 -0
- package/dist/i18n/fields/Parameters.d.ts +467 -0
- package/dist/i18n/fields/en.d.ts +349 -0
- package/dist/i18n/fields/zh-CN.d.ts +349 -0
- package/dist/i18n/index.d.ts +11 -0
- package/dist/i18n/index.js +4 -0
- package/dist/i18n/tables/Parameters.d.ts +687 -0
- package/dist/i18n/tables/en.d.ts +542 -0
- package/dist/i18n/tables/zh-CN.d.ts +542 -0
- package/dist/i18n/zh-CN.d.ts +1008 -0
- package/dist/i18n/zh-CN.js +2 -0
- package/dist/i18n-CJTJI6vg.js +172 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +13 -0
- package/dist/layout/AsamActionBar.vue.d.ts +16 -0
- package/dist/layout/AsamAdminLayout.vue.d.ts +25 -0
- package/dist/layout/AsamContentGrid.vue.d.ts +14 -0
- package/dist/layout/AsamFooter.vue.d.ts +11 -0
- package/dist/layout/AsamLayoutSettings.vue.d.ts +31 -0
- package/dist/layout/AsamPageContainer.vue.d.ts +20 -0
- package/dist/layout/Context.d.ts +2 -0
- package/dist/layout/Index.d.ts +8 -0
- package/dist/layout/Settings.d.ts +4 -0
- package/dist/layout/Types.d.ts +118 -0
- package/dist/list/AsamListRowActions.d.ts +23 -0
- package/dist/list/AsamProTable.d.ts +29 -0
- package/dist/list/AsamSearchForm.d.ts +67 -0
- package/dist/list/Controller.d.ts +3 -0
- package/dist/list/QueryBoundary.d.ts +8 -0
- package/dist/list/RowActionAdapter.d.ts +9 -0
- package/dist/list/Types.d.ts +134 -0
- package/dist/lists/AsamCardList.d.ts +15 -0
- package/dist/lists/AsamListCover.vue.d.ts +7 -0
- package/dist/lists/AsamProList.d.ts +9 -0
- package/dist/lists/AsamProTaskCard.vue.d.ts +21 -0
- package/dist/lists/Index.d.ts +4 -0
- package/dist/lists/Types.d.ts +135 -0
- package/dist/navigation-BVLFymx7.js +395 -0
- package/dist/preferences-DgHizA2w.js +335 -0
- package/dist/public-api.d.ts +3662 -0
- package/dist/resolver/index.d.ts +33 -0
- package/dist/resolver/index.js +4447 -0
- package/dist/security-B_pdVCWk.js +299 -0
- package/dist/style.css +2 -0
- package/dist/table/ActionIcon.d.ts +5 -0
- package/dist/table/Appearance.d.ts +37 -0
- package/dist/table/ColumnVisibility.d.ts +71 -0
- package/dist/table/Density.d.ts +3 -0
- package/dist/table/Empty.d.ts +14 -0
- package/dist/table/I18n.d.ts +73 -0
- package/dist/table/RowActionPresentation.d.ts +5 -0
- package/dist/table/RowActions.d.ts +80 -0
- package/dist/table/TableDensity.vue.d.ts +19 -0
- package/dist/table/TablePagination.vue.d.ts +24 -0
- package/dist/table/TableToolbar.vue.d.ts +18 -0
- package/dist/table/TableViewport.vue.d.ts +13 -0
- package/dist/table/editing/AsamEditableTable.d.ts +69 -0
- package/dist/table/editing/AsamEditableTable.vue.d.ts +61 -0
- package/dist/table/editing/AsamSortableTable.vue.d.ts +61 -0
- package/dist/table/editing/AsamTableEditingHost.vue.d.ts +52 -0
- package/dist/table/editing/CellEditor.vue.d.ts +20 -0
- package/dist/table/editing/Controller.d.ts +2 -0
- package/dist/table/editing/ControllerCell.vue.d.ts +18 -0
- package/dist/table/editing/Drag.d.ts +29 -0
- package/dist/table/editing/EntryForm.vue.d.ts +20 -0
- package/dist/table/editing/Host.d.ts +11 -0
- package/dist/table/editing/HostTypes.d.ts +53 -0
- package/dist/table/editing/Index.d.ts +9 -0
- package/dist/table/editing/InlineModel.d.ts +24 -0
- package/dist/table/editing/InlineTypes.d.ts +135 -0
- package/dist/table/editing/LegacyEditableTable.d.ts +66 -0
- package/dist/table/editing/LegacyMotion.d.ts +10 -0
- package/dist/table/editing/Motion.d.ts +19 -0
- package/dist/table/editing/Order.d.ts +7 -0
- package/dist/table/editing/SaveFeedback.d.ts +4 -0
- package/dist/table/editing/Types.d.ts +71 -0
- package/dist/table/operations/Coordinator.d.ts +3 -0
- package/dist/table/operations/Index.d.ts +6 -0
- package/dist/table/operations/Preferences.d.ts +7 -0
- package/dist/table/operations/Selection.d.ts +2 -0
- package/dist/table/operations/Snapshot.d.ts +5 -0
- package/dist/table/operations/Types.d.ts +157 -0
- package/dist/table/operations/View.d.ts +108 -0
- package/dist/table/range/AsamTableRange.vue.d.ts +19 -0
- package/dist/table/range/Controller.d.ts +3 -0
- package/dist/table/range/Index.d.ts +3 -0
- package/dist/table/range/Types.d.ts +127 -0
- package/dist/table/renderTableInViewport.d.ts +6 -0
- package/dist/table/structured/AsamStructuredTable.d.ts +2 -0
- package/dist/table/structured/Controller.d.ts +7 -0
- package/dist/table/structured/Forest.d.ts +4 -0
- package/dist/table/structured/Index.d.ts +6 -0
- package/dist/table/structured/Span.d.ts +5 -0
- package/dist/table/structured/Summary.d.ts +8 -0
- package/dist/table/structured/Types.d.ts +137 -0
- package/dist/table/transfer/AsamTableTransfer.vue.d.ts +11 -0
- package/dist/table/transfer/Controller.d.ts +3 -0
- package/dist/table/transfer/Gate.d.ts +3 -0
- package/dist/table/transfer/Index.d.ts +6 -0
- package/dist/table/transfer/Text.d.ts +25 -0
- package/dist/table/transfer/Types.d.ts +170 -0
- package/dist/table/virtual/AsamProVirtualTable.d.ts +22 -0
- package/dist/table/virtual/Index.d.ts +4 -0
- package/dist/table/virtual/Model.d.ts +16 -0
- package/dist/table/virtual/Styles.d.ts +2 -0
- package/dist/table/virtual/Types.d.ts +68 -0
- package/dist/templates/crud/AsamCrudPage.vue.d.ts +52 -0
- package/dist/templates/crud/Controller.d.ts +3 -0
- package/dist/templates/crud/DetailEntry.d.ts +46 -0
- package/dist/templates/crud/Index.d.ts +4 -0
- package/dist/templates/crud/Index.js +2 -0
- package/dist/templates/crud/Readonly.d.ts +3 -0
- package/dist/templates/crud/Structure.d.ts +8 -0
- package/dist/templates/crud/Types.d.ts +272 -0
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.js +10 -0
- package/dist/transport-Cky1a5c-.js +161 -0
- package/dist/types/application.d.ts +5 -0
- package/dist/types/components.d.ts +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +0 -0
- package/dist/types/templates.d.ts +1 -0
- package/dist/use-custom-field-value-DgA3wo05.js +108 -0
- package/dist/zh-CN-B5pAhh4V.js +56 -0
- package/dist/zh-CN-BBWziFEy.js +966 -0
- package/package.json +177 -3
|
@@ -0,0 +1,1263 @@
|
|
|
1
|
+
import { n as e } from "./i18n-CJTJI6vg.js";
|
|
2
|
+
import { B as t, D as n, E as r, F as i, G as a, H as o, J as s, M as c, O as l, R as u, T as d, V as f, X as p, Z as m, a as h, c as g, i as _, l as v, m as y, n as b, p as ee, q as x, r as te, s as S, t as C, tt as w, w as T, z as E } from "./Controller-DF6lMt-H.js";
|
|
3
|
+
import { t as ne } from "./_plugin-vue_export-helper-C05QHVBA.js";
|
|
4
|
+
import { Fragment as D, computed as O, createBlock as k, createCommentVNode as A, createElementBlock as j, createElementVNode as M, createSlots as re, createTextVNode as N, createVNode as ie, defineComponent as P, effectScope as ae, getCurrentScope as oe, guardReactiveProps as se, h as F, mergeProps as ce, nextTick as le, normalizeClass as ue, normalizeProps as de, normalizeStyle as fe, onBeforeUnmount as I, onMounted as L, onScopeDispose as pe, onUpdated as R, openBlock as z, provide as B, readonly as V, ref as H, renderList as U, renderSlot as W, resolveDynamicComponent as G, shallowRef as K, toDisplayString as q, toValue as J, unref as Y, useSlots as me, watch as X, withCtx as Z } from "vue";
|
|
5
|
+
import { AsamButton as Q, AsamCard as he, useAsamControlSize as ge } from "@asam-ui/ui";
|
|
6
|
+
//#region src/templates/crud/Structure.ts
|
|
7
|
+
function _e(e, t, n, r, i) {
|
|
8
|
+
if (!e) return;
|
|
9
|
+
let a = C({
|
|
10
|
+
...e,
|
|
11
|
+
rows: () => t.page.data.value.list,
|
|
12
|
+
rowKey: n,
|
|
13
|
+
scope: () => S([
|
|
14
|
+
r.scope,
|
|
15
|
+
r.epoch,
|
|
16
|
+
t.session.value,
|
|
17
|
+
J(i)
|
|
18
|
+
]),
|
|
19
|
+
preserveExpandedKeys: e.preserveExpandedKeys ?? !0
|
|
20
|
+
}), o = !1;
|
|
21
|
+
return X(() => t.resultReady.value, (t) => {
|
|
22
|
+
!t || o || (o = !0, a.setExpandedKeys(e.initialExpandedKeys ?? []));
|
|
23
|
+
}, {
|
|
24
|
+
immediate: !0,
|
|
25
|
+
flush: "post"
|
|
26
|
+
}), a;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/templates/crud/Controller.ts
|
|
30
|
+
function ve(e) {
|
|
31
|
+
let a = ae(!0), s = K(!1), d = O(() => s.value || !!J(e.disabled)), m = O(() => !!J(e.readonly)), h = K(""), _ = K("create"), v = K({ status: "idle" }), y = !e.list, ee = !1, x = 0, C = e.list ?? a.run(() => r({
|
|
32
|
+
fields: e.queryFields,
|
|
33
|
+
initial: e.queryCodec.encode(e.initial),
|
|
34
|
+
runtime: e.runtime,
|
|
35
|
+
rowKey: e.rowKey,
|
|
36
|
+
pageSize: e.pageSize ?? 20,
|
|
37
|
+
immediate: !1,
|
|
38
|
+
api: (t, n) => {
|
|
39
|
+
let r = C.session.value, i = () => {
|
|
40
|
+
if (d.value || !e.runtime.isCurrent(n) || r !== C.session.value) throw ee || (y = !0), e.runtime.isCurrent(n) && C.page.cancel(), new DOMException("页面或读取身份已失效,尚未发送列表请求", "AbortError");
|
|
41
|
+
};
|
|
42
|
+
i();
|
|
43
|
+
let a = e.queryCodec.decode(t.query);
|
|
44
|
+
return i(), ee = !0, y = !1, e.services.list({
|
|
45
|
+
...t,
|
|
46
|
+
query: a
|
|
47
|
+
}, n);
|
|
48
|
+
}
|
|
49
|
+
})), T = (t) => {
|
|
50
|
+
let n = e.rowKey(t);
|
|
51
|
+
if (!e.isKey(n) || typeof n != "string" && !(typeof n == "number" && Number.isFinite(n))) throw c(/* @__PURE__ */ TypeError("CRUD行键须为字符串或有限数,不能使用Boolean"), "pro.crud.crudRowKeysMustBeStringsOrFinite");
|
|
52
|
+
return n;
|
|
53
|
+
}, ne = a.run(() => _e(e.structure, C, T, e.runtime, e.dataset));
|
|
54
|
+
function D(e, t) {
|
|
55
|
+
return !d.value && C.scopeReady.value && (e === "detail" || !m.value) && W(e, t ? T(t) : void 0) && (!t || C.resultReady.value && C.page.data.value.list.includes(t));
|
|
56
|
+
}
|
|
57
|
+
let k = a.run(() => te({
|
|
58
|
+
controller: C,
|
|
59
|
+
dataset: e.dataset
|
|
60
|
+
})), A = a.run(() => b({
|
|
61
|
+
columns: e.columns,
|
|
62
|
+
...e.preferences
|
|
63
|
+
})), j = () => S({
|
|
64
|
+
scope: e.runtime.scope,
|
|
65
|
+
epoch: e.runtime.epoch,
|
|
66
|
+
session: C.session.value,
|
|
67
|
+
intent: C.intent.value
|
|
68
|
+
}), M = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Set(), N = (e, t) => S([e, t]), ie = /* @__PURE__ */ new Map(), P = K(), se = K(), F, ce;
|
|
69
|
+
function ue(t) {
|
|
70
|
+
try {
|
|
71
|
+
e.feedback?.(t);
|
|
72
|
+
} catch {
|
|
73
|
+
l(h, E("pro.crud.theOperationWasRecordedButTheFeedbackAdapter", "操作已记录,反馈适配器失败"));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function de(t, n) {
|
|
77
|
+
if (d.value || n !== j()) {
|
|
78
|
+
s.value || (v.value = {
|
|
79
|
+
status: "stale",
|
|
80
|
+
operationId: t
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
F = {
|
|
85
|
+
id: t,
|
|
86
|
+
source: n
|
|
87
|
+
};
|
|
88
|
+
let r = S({
|
|
89
|
+
scope: e.runtime.scope,
|
|
90
|
+
epoch: e.runtime.epoch,
|
|
91
|
+
session: C.session.value,
|
|
92
|
+
intent: C.intent.value && {
|
|
93
|
+
...C.intent.value,
|
|
94
|
+
currentPage: 0
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
v.value = {
|
|
98
|
+
status: "refreshing",
|
|
99
|
+
operationId: t
|
|
100
|
+
};
|
|
101
|
+
let i = (async () => {
|
|
102
|
+
let n = await C.refresh();
|
|
103
|
+
s.value || e.runtime.scope !== C.intent.value?.scope || r === S({
|
|
104
|
+
scope: e.runtime.scope,
|
|
105
|
+
epoch: e.runtime.epoch,
|
|
106
|
+
session: C.session.value,
|
|
107
|
+
intent: C.intent.value && {
|
|
108
|
+
...C.intent.value,
|
|
109
|
+
currentPage: 0
|
|
110
|
+
}
|
|
111
|
+
}) && (v.value = n.status === "error" ? {
|
|
112
|
+
status: "error",
|
|
113
|
+
operationId: t,
|
|
114
|
+
error: n.error
|
|
115
|
+
} : {
|
|
116
|
+
status: n.status === "success" ? "success" : "stale",
|
|
117
|
+
operationId: t
|
|
118
|
+
}, n.status === "error" && (F = {
|
|
119
|
+
id: t,
|
|
120
|
+
source: j()
|
|
121
|
+
}), ue({
|
|
122
|
+
kind: "refresh",
|
|
123
|
+
result: v.value
|
|
124
|
+
}));
|
|
125
|
+
})();
|
|
126
|
+
ce = i;
|
|
127
|
+
try {
|
|
128
|
+
await i;
|
|
129
|
+
} finally {
|
|
130
|
+
ce === i && (ce = void 0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function fe(e) {
|
|
134
|
+
re.add(N(e.scope, e.target.operationId));
|
|
135
|
+
let t = M.get(N(e.scope, e.target.operationId));
|
|
136
|
+
!t || t !== j() || s.value || (ue({
|
|
137
|
+
kind: "saved",
|
|
138
|
+
event: e
|
|
139
|
+
}), de(e.target.operationId, t));
|
|
140
|
+
}
|
|
141
|
+
let I, L = K(""), R = K(0), z = {}, B;
|
|
142
|
+
function H(t) {
|
|
143
|
+
return !s.value && t.scope === e.runtime.scope && t.epoch === e.runtime.epoch && t.listSession === C.session.value;
|
|
144
|
+
}
|
|
145
|
+
function U() {
|
|
146
|
+
B = void 0, l(L, "");
|
|
147
|
+
}
|
|
148
|
+
function W(t, n, r = !1) {
|
|
149
|
+
let i = I, a = {
|
|
150
|
+
scope: e.runtime.scope,
|
|
151
|
+
epoch: e.runtime.epoch,
|
|
152
|
+
listSession: C.session.value
|
|
153
|
+
};
|
|
154
|
+
try {
|
|
155
|
+
return e.allowed(t, n);
|
|
156
|
+
} catch (e) {
|
|
157
|
+
let s = `权限判定失败:${e instanceof Error ? e.message : String(e)}`;
|
|
158
|
+
if (r && i && H(i) && i.editorSession === z.editor?.session.value && (i.permissionError ??= s, i.permissionFailure ??= E("pro.crud.permissionCheckFailed", s, { value1: e instanceof Error ? e.message : String(e) })), H(a) && (!B || !H(B) || r && !["create", "edit"].includes(B.action))) {
|
|
159
|
+
let r = u(a, {
|
|
160
|
+
action: t,
|
|
161
|
+
key: n
|
|
162
|
+
}, E("pro.crud.permissionCheckFailed", s, { value1: e instanceof Error ? e.message : String(e) }));
|
|
163
|
+
B = r, le(() => {
|
|
164
|
+
B === r && H(r) && l(L, o(r, r.message));
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return !1;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function G(t) {
|
|
171
|
+
return !s.value && !J(e.disabled) && !J(e.readonly) && C.scopeReady.value && t.editorSession === q.session.value && t.listSession === C.session.value && t.scope === e.runtime.scope && t.epoch === e.runtime.epoch;
|
|
172
|
+
}
|
|
173
|
+
let q = a.run(() => w({
|
|
174
|
+
formatError: (t, n) => i(t, n, e.formatError, t && typeof t == "object" && "message" in t ? String(t.message) : String(t)),
|
|
175
|
+
fields: e.editFields,
|
|
176
|
+
equals: e.equals,
|
|
177
|
+
validatePayload: async (t) => {
|
|
178
|
+
let n = {
|
|
179
|
+
editorSession: q.session.value,
|
|
180
|
+
listSession: C.session.value,
|
|
181
|
+
scope: e.runtime.scope,
|
|
182
|
+
epoch: e.runtime.epoch,
|
|
183
|
+
model: e.editCodec.decode(t)
|
|
184
|
+
};
|
|
185
|
+
if (!G(n)) return [u(E("pro.crud.saveEligibilityChangedNothingWasSentInThis", "保存资格已变化,本次尚未发送"))];
|
|
186
|
+
let r = await e.validatePayload?.(n.model) ?? [];
|
|
187
|
+
return r.length ? r : G(n) ? (I = n, []) : [u(E("pro.crud.saveEligibilityChangedNothingWasSentInThis", "保存资格已变化,本次尚未发送"))];
|
|
188
|
+
},
|
|
189
|
+
runtime: e.runtime,
|
|
190
|
+
coordinator: e.writes,
|
|
191
|
+
canWrite: () => (R.value, !d.value && !m.value && C.scopeReady.value && W(_.value, P.value, !0)),
|
|
192
|
+
defaults: async (t, n) => e.editCodec.encode(await e.services.defaults(n)),
|
|
193
|
+
load: async (t, n) => {
|
|
194
|
+
if (!e.isKey(t.id)) throw c(/* @__PURE__ */ TypeError("编辑键不属于宿主键域"), "pro.crud.theEditKeyIsOutsideTheApplicationS");
|
|
195
|
+
return e.editCodec.encode(await e.services.load(t.id, n));
|
|
196
|
+
},
|
|
197
|
+
save: (t, n, r) => {
|
|
198
|
+
let i = I, a = (e = E("pro.crud.saveEligibilityChangedNothingWasSentInThis", "保存资格已变化,本次尚未发送")) => (I === i && (I = void 0), Promise.resolve(u({ status: "failure" }, e)));
|
|
199
|
+
if (!i) return a();
|
|
200
|
+
if (i.permissionError) return a(E("pro.crud.saveHasNotBeenSent", `保存尚未发送:${i.permissionError}`, { value1: i.permissionError }, { value1: i.permissionFailure ?? { message: i.permissionError } }));
|
|
201
|
+
let o;
|
|
202
|
+
try {
|
|
203
|
+
if (!G(i) || !e.runtime.isCurrent(r)) return a();
|
|
204
|
+
if (n.target.mode === "edit") {
|
|
205
|
+
if (!e.isKey(n.target.id)) return a(E("pro.crud.theEditKeyIsInvalidNothingWasSent", "编辑键无效,本次尚未发送"));
|
|
206
|
+
o = n.target.id;
|
|
207
|
+
}
|
|
208
|
+
let t = W(n.target.mode, o, !0);
|
|
209
|
+
if (i.permissionError) return a(E("pro.crud.saveHasNotBeenSent", `保存尚未发送:${i.permissionError}`, { value1: i.permissionError }, { value1: i.permissionFailure ?? { message: i.permissionError } }));
|
|
210
|
+
if (!t || !G(i) || !e.runtime.isCurrent(r)) return a();
|
|
211
|
+
} catch (e) {
|
|
212
|
+
return a(E("pro.crud.saveHasNotBeenSent", `保存尚未发送:${e instanceof Error ? e.message : String(e)}`, { value1: e instanceof Error ? e.message : String(e) }));
|
|
213
|
+
}
|
|
214
|
+
return I === i && (I = void 0), n.target.mode === "create" ? e.services.create(i.model, n, r) : o === void 0 ? a() : e.services.update(o, i.model, n, r);
|
|
215
|
+
},
|
|
216
|
+
verify: e.services.verify,
|
|
217
|
+
confirmDiscard: e.confirmDiscard,
|
|
218
|
+
onSaved: fe
|
|
219
|
+
}));
|
|
220
|
+
z.editor = q;
|
|
221
|
+
let Y = a.run(() => p({
|
|
222
|
+
fields: e.detailFields,
|
|
223
|
+
runtime: e.runtime
|
|
224
|
+
}));
|
|
225
|
+
async function me(t, n, r) {
|
|
226
|
+
if (U(), !D(t, n) || q.busy.value || q.visible.value && !await q.close() || !D(t, n)) return;
|
|
227
|
+
let i = n ? T(n) : void 0, a = S([
|
|
228
|
+
e.runtime.scope,
|
|
229
|
+
t,
|
|
230
|
+
i ?? null
|
|
231
|
+
]), o = ie.get(a), s = o ? e.writes.get(e.runtime.scope, o) : void 0, l = s && (["saving", "unknown"].includes(s.status) || s.status === "success" && !re.has(N(e.runtime.scope, o))) ? o : r ?? e.operationId(t, i);
|
|
232
|
+
if (!l.trim()) throw c(/* @__PURE__ */ TypeError("operationId不能为空"), "pro.crud.theOperationIdMustNotBeEmpty");
|
|
233
|
+
ie.set(a, l);
|
|
234
|
+
let u = N(e.runtime.scope, l);
|
|
235
|
+
(!s || s.status === "not-applied" || !M.has(u)) && M.set(u, j()), P.value = i, _.value = t, await q.open({
|
|
236
|
+
mode: t,
|
|
237
|
+
...i === void 0 ? {} : { id: i },
|
|
238
|
+
operationId: l
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
let Z = e.services.bulkRemove;
|
|
242
|
+
function Q(t) {
|
|
243
|
+
return g({
|
|
244
|
+
...t,
|
|
245
|
+
targets: t.targets.map((t) => {
|
|
246
|
+
if (!e.isKey(t.key)) throw c(/* @__PURE__ */ TypeError("非法批次删除键"), "pro.crud.invalidBatchDeletionKey");
|
|
247
|
+
return {
|
|
248
|
+
...t,
|
|
249
|
+
key: t.key
|
|
250
|
+
};
|
|
251
|
+
}),
|
|
252
|
+
rejected: t.rejected.map((t) => {
|
|
253
|
+
if (!e.isKey(t.key)) throw c(/* @__PURE__ */ TypeError("非法批次拒绝键"), "pro.crud.invalidBatchRejectionKey");
|
|
254
|
+
return {
|
|
255
|
+
...t,
|
|
256
|
+
key: t.key
|
|
257
|
+
};
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
let he = {
|
|
262
|
+
id: "crud-remove",
|
|
263
|
+
label: "删除",
|
|
264
|
+
busyKey: "crud-remove",
|
|
265
|
+
batch: Z ? {
|
|
266
|
+
execute: (e) => Z.execute(Q(e)),
|
|
267
|
+
verify: (e) => Z.verify(Q(e))
|
|
268
|
+
} : void 0,
|
|
269
|
+
enabled: () => D("remove"),
|
|
270
|
+
allowed: (t, n) => e.isKey(t.key) && D("remove") && W("remove", t.key) && e.allowedRemove({
|
|
271
|
+
...t,
|
|
272
|
+
key: t.key
|
|
273
|
+
}, n),
|
|
274
|
+
resolve: async (t, n) => {
|
|
275
|
+
if (!t.every(e.isKey)) throw c(/* @__PURE__ */ TypeError("删除键不属于宿主键域"), "pro.crud.theDeletionKeyIsOutsideTheApplicationS");
|
|
276
|
+
return e.services.resolve(t, n);
|
|
277
|
+
},
|
|
278
|
+
confirm: (t) => {
|
|
279
|
+
let n = e.operations.records.value.find((e) => e.snapshot.operationId === t.operationId), r = t.targets.filter((e) => {
|
|
280
|
+
let t = n?.results.find((t) => Object.is(t.key, e.key));
|
|
281
|
+
return !t || t.status === "failure" || t.status === "unsent";
|
|
282
|
+
});
|
|
283
|
+
return r.length ? e.confirmRemove(g({
|
|
284
|
+
...t,
|
|
285
|
+
targets: r
|
|
286
|
+
})) : Promise.resolve(!1);
|
|
287
|
+
},
|
|
288
|
+
execute: (t, n) => {
|
|
289
|
+
if (!e.isKey(t.key)) throw c(/* @__PURE__ */ TypeError("非法删除键"), "pro.crud.invalidDeletionKey");
|
|
290
|
+
return e.services.remove({
|
|
291
|
+
...t,
|
|
292
|
+
key: t.key
|
|
293
|
+
}, n);
|
|
294
|
+
},
|
|
295
|
+
verify: (t, n) => {
|
|
296
|
+
if (!e.isKey(t.key)) throw c(/* @__PURE__ */ TypeError("非法核实键"), "pro.crud.invalidVerificationKey");
|
|
297
|
+
return e.services.verifyRemove({
|
|
298
|
+
...t,
|
|
299
|
+
key: t.key
|
|
300
|
+
}, n);
|
|
301
|
+
}
|
|
302
|
+
}, ge = O(() => e.operations.records.value.filter((t) => t.snapshot.action === he.id && t.snapshot.context.dataset === J(e.dataset))), ve = (e) => ge.value.some((t) => t.snapshot.operationId === e), $ = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map();
|
|
303
|
+
async function be(e) {
|
|
304
|
+
if (!e || s.value) return e;
|
|
305
|
+
let t = e.snapshot.operationId, n = $.get(t) ?? /* @__PURE__ */ new Set(), r = e.results.filter((e) => e.status === "success" && !n.has(e.key));
|
|
306
|
+
for (let e of r) n.add(e.key);
|
|
307
|
+
$.set(t, n);
|
|
308
|
+
let i = S(e.snapshot.context) === S(k.context());
|
|
309
|
+
return r.length && i && ye.get(t) === j() && (ue({
|
|
310
|
+
kind: "removed",
|
|
311
|
+
record: e,
|
|
312
|
+
keys: r.map((e) => e.key)
|
|
313
|
+
}), await de(t, j()), !s.value && S(e.snapshot.context) === S(k.context()) && (ye.set(t, j()), e.results.every((e) => e.status === "success") && k.clear())), e;
|
|
314
|
+
}
|
|
315
|
+
function xe() {
|
|
316
|
+
s.value || (x++, I = void 0, U(), s.value = !0, a.stop());
|
|
317
|
+
}
|
|
318
|
+
return a.run(() => {
|
|
319
|
+
X(() => q.session.value, () => {
|
|
320
|
+
I = void 0;
|
|
321
|
+
}, { flush: "sync" }), e.list || X([
|
|
322
|
+
d,
|
|
323
|
+
C.scopeReady,
|
|
324
|
+
C.session,
|
|
325
|
+
C.validating
|
|
326
|
+
], () => {
|
|
327
|
+
let t = ++x;
|
|
328
|
+
if (!y || d.value || !C.scopeReady.value || C.validating.value) return;
|
|
329
|
+
let n = e.runtime.epoch, r = C.session.value;
|
|
330
|
+
le(() => {
|
|
331
|
+
if (!(!y || d.value || t !== x || n !== e.runtime.epoch || r !== C.session.value || !C.scopeReady.value || C.validating.value)) return y = !1, C.submit();
|
|
332
|
+
});
|
|
333
|
+
}, {
|
|
334
|
+
immediate: !0,
|
|
335
|
+
flush: "sync"
|
|
336
|
+
}), X(() => C.session.value, () => {
|
|
337
|
+
I = void 0, U(), l(h, ""), v.value = { status: "idle" }, F = void 0;
|
|
338
|
+
}, { flush: "sync" }), X(() => W("detail", se.value), (e) => {
|
|
339
|
+
e || Y.close();
|
|
340
|
+
}, { flush: "sync" });
|
|
341
|
+
}), oe() && pe(xe), {
|
|
342
|
+
list: C,
|
|
343
|
+
structure: ne,
|
|
344
|
+
editor: {
|
|
345
|
+
...q,
|
|
346
|
+
formatMessage: (e) => L.value && q.status.value !== "unknown" && B?.action === _.value && Object.is(B.key, P.value) ? f(L, e) : q.formatMessage?.(e) ?? q.message.value,
|
|
347
|
+
message: O(() => q.status.value !== "unknown" && B?.action === _.value && Object.is(B.key, P.value) && L.value || q.message.value),
|
|
348
|
+
busy: O(() => d.value || q.busy.value),
|
|
349
|
+
open: (e) => d.value ? Promise.resolve() : (U(), q.open(e)),
|
|
350
|
+
reload: () => d.value ? Promise.resolve() : q.reload(),
|
|
351
|
+
verify: () => d.value ? Promise.resolve() : q.verify(),
|
|
352
|
+
submit: () => d.value ? Promise.resolve() : (q.status.value === "editing" && (U(), R.value++), q.submit())
|
|
353
|
+
},
|
|
354
|
+
detail: {
|
|
355
|
+
...Y,
|
|
356
|
+
canRefresh: O(() => !d.value && Y.canRefresh.value),
|
|
357
|
+
refresh: () => d.value ? Promise.resolve() : Y.refresh(),
|
|
358
|
+
open: (e) => d.value ? Promise.resolve() : Y.open(e)
|
|
359
|
+
},
|
|
360
|
+
selection: k,
|
|
361
|
+
preferences: A,
|
|
362
|
+
operations: e.operations,
|
|
363
|
+
records: ge,
|
|
364
|
+
disabled: d,
|
|
365
|
+
readonly: m,
|
|
366
|
+
refreshState: V(v),
|
|
367
|
+
message: t(() => L.value ? L : h),
|
|
368
|
+
editMode: V(_),
|
|
369
|
+
key: T,
|
|
370
|
+
can: D,
|
|
371
|
+
create: (e) => me("create", void 0, e),
|
|
372
|
+
edit: (e, t) => me("edit", e, t),
|
|
373
|
+
showDetail: async (t) => {
|
|
374
|
+
D("detail", t) && (se.value = T(t), await Y.open(e.detail.mode === "load" ? {
|
|
375
|
+
mode: "load",
|
|
376
|
+
id: T(t),
|
|
377
|
+
load: e.detail.load
|
|
378
|
+
} : {
|
|
379
|
+
mode: "direct",
|
|
380
|
+
id: T(t),
|
|
381
|
+
...e.detail.direct(t)
|
|
382
|
+
}));
|
|
383
|
+
},
|
|
384
|
+
remove: async (t, n) => {
|
|
385
|
+
if (!D("remove")) return null;
|
|
386
|
+
let r = t ?? k.keys.value.filter(e.isKey), i = n ?? e.operationId("remove");
|
|
387
|
+
return ye.has(i) || ye.set(i, j()), be(await e.operations.run(he, i, r, k));
|
|
388
|
+
},
|
|
389
|
+
verifyRemove: async (t) => d.value || !ve(t) ? null : be(await e.operations.verify(t)),
|
|
390
|
+
retryRemove: async (t) => !D("remove") || !k.ready.value || !ve(t) ? null : be(await e.operations.retry(t, k)),
|
|
391
|
+
retryRefresh: async () => {
|
|
392
|
+
ce || !F || d.value || await de(F.id, F.source);
|
|
393
|
+
},
|
|
394
|
+
reset: async () => {
|
|
395
|
+
d.value || await n(C.intent, () => C.reset(), () => k.reset(), () => k.context()?.generation);
|
|
396
|
+
},
|
|
397
|
+
dispose: xe
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/templates/crud/Readonly.ts
|
|
402
|
+
function $(e) {
|
|
403
|
+
if (e.mode !== "readonly") throw c(/* @__PURE__ */ TypeError("只读CRUD必须使用mode: readonly"), "pro.crud.readOnlyCrudRequiresModeReadonly");
|
|
404
|
+
for (let t of [
|
|
405
|
+
"writes",
|
|
406
|
+
"operations",
|
|
407
|
+
"editFields",
|
|
408
|
+
"editCodec",
|
|
409
|
+
"equals",
|
|
410
|
+
"validatePayload",
|
|
411
|
+
"readonly",
|
|
412
|
+
"allowedRemove",
|
|
413
|
+
"confirmRemove",
|
|
414
|
+
"confirmDiscard",
|
|
415
|
+
"operationId",
|
|
416
|
+
"feedback"
|
|
417
|
+
]) if (Reflect.get(e, t) !== void 0) throw c(/* @__PURE__ */ TypeError(`只读CRUD不能配置${t}`), "pro.crud.readOnlyCrudCannotConfigure", { value1: t });
|
|
418
|
+
for (let t of [
|
|
419
|
+
"defaults",
|
|
420
|
+
"load",
|
|
421
|
+
"create",
|
|
422
|
+
"update",
|
|
423
|
+
"verify",
|
|
424
|
+
"resolve",
|
|
425
|
+
"remove",
|
|
426
|
+
"verifyRemove",
|
|
427
|
+
"bulkRemove"
|
|
428
|
+
]) if (Reflect.get(e.services, t) !== void 0) throw c(/* @__PURE__ */ TypeError(`只读CRUD不接受编辑或写服务${t}`), "pro.crud.readOnlyCrudDoesNotAcceptEditOr", { value1: t });
|
|
429
|
+
let i = ae(!0), a = K(!1), o = O(() => a.value || !!J(e.disabled)), s = K(""), u = K(), d = !e.list, f = !1, m = 0, h = e.list ?? i.run(() => r({
|
|
430
|
+
fields: e.queryFields,
|
|
431
|
+
initial: e.queryCodec.encode(e.initial),
|
|
432
|
+
runtime: e.runtime,
|
|
433
|
+
rowKey: e.rowKey,
|
|
434
|
+
pageSize: e.pageSize ?? 20,
|
|
435
|
+
immediate: !1,
|
|
436
|
+
api: (t, n) => {
|
|
437
|
+
let r = h.session.value, i = () => {
|
|
438
|
+
if (o.value || !e.runtime.isCurrent(n) || r !== h.session.value) throw f || (d = !0), e.runtime.isCurrent(n) && h.page.cancel(), new DOMException("只读页面或读取身份已失效,尚未发送请求", "AbortError");
|
|
439
|
+
};
|
|
440
|
+
i();
|
|
441
|
+
let a = e.queryCodec.decode(t.query);
|
|
442
|
+
return i(), f = !0, d = !1, e.services.list({
|
|
443
|
+
...t,
|
|
444
|
+
query: a
|
|
445
|
+
}, n);
|
|
446
|
+
}
|
|
447
|
+
})), g = (t) => {
|
|
448
|
+
let n = e.rowKey(t);
|
|
449
|
+
if (!v(n) || !e.isKey(n)) throw c(/* @__PURE__ */ TypeError("CRUD行键须为字符串或有限数"), "pro.crud.crudRowKeysMustBeStringsOrFinite30be6");
|
|
450
|
+
return n;
|
|
451
|
+
}, _ = i.run(() => _e(e.structure, h, g, e.runtime, e.dataset)), y = i.run(() => te({
|
|
452
|
+
controller: h,
|
|
453
|
+
dataset: e.dataset
|
|
454
|
+
})), ee = i.run(() => b({
|
|
455
|
+
columns: e.columns,
|
|
456
|
+
...e.preferences
|
|
457
|
+
})), x = i.run(() => p({
|
|
458
|
+
fields: e.detailFields,
|
|
459
|
+
runtime: e.runtime
|
|
460
|
+
}));
|
|
461
|
+
function S(t) {
|
|
462
|
+
try {
|
|
463
|
+
let n = e.allowed?.("detail", t) !== !1;
|
|
464
|
+
return l(s, ""), n;
|
|
465
|
+
} catch {
|
|
466
|
+
return l(s, E("pro.crud.detailPermissionEvaluationFailed", "详情权限检查失败")), !1;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function C(e, t) {
|
|
470
|
+
return e !== "detail" || o.value || !h.scopeReady.value ? !1 : S(t ? g(t) : void 0) && !o.value && h.scopeReady.value && (!t || h.resultReady.value && h.page.data.value.list.includes(t));
|
|
471
|
+
}
|
|
472
|
+
function w() {
|
|
473
|
+
a.value || (a.value = !0, m++, x.dispose(), y.dispose(), ee.dispose(), e.list || h.page.cancel(), i.stop());
|
|
474
|
+
}
|
|
475
|
+
return i.run(() => {
|
|
476
|
+
e.list || X([
|
|
477
|
+
o,
|
|
478
|
+
h.scopeReady,
|
|
479
|
+
h.session,
|
|
480
|
+
h.validating
|
|
481
|
+
], () => {
|
|
482
|
+
let t = ++m;
|
|
483
|
+
if (!d || o.value || !h.scopeReady.value || h.validating.value) return;
|
|
484
|
+
let n = e.runtime.epoch, r = h.session.value;
|
|
485
|
+
le(() => {
|
|
486
|
+
if (!(!d || o.value || t !== m || n !== e.runtime.epoch || r !== h.session.value || !h.scopeReady.value || h.validating.value)) return d = !1, h.submit();
|
|
487
|
+
});
|
|
488
|
+
}, {
|
|
489
|
+
immediate: !0,
|
|
490
|
+
flush: "sync"
|
|
491
|
+
}), X(h.session, () => {
|
|
492
|
+
x.close(), l(s, "");
|
|
493
|
+
}, { flush: "sync" }), X(() => !o.value && S(u.value), (e) => {
|
|
494
|
+
e || x.close();
|
|
495
|
+
}, { flush: "sync" });
|
|
496
|
+
}), oe() && pe(w), {
|
|
497
|
+
mode: "readonly",
|
|
498
|
+
list: h,
|
|
499
|
+
structure: _,
|
|
500
|
+
selection: y,
|
|
501
|
+
preferences: ee,
|
|
502
|
+
key: g,
|
|
503
|
+
can: C,
|
|
504
|
+
disabled: o,
|
|
505
|
+
readonly: O(() => !0),
|
|
506
|
+
message: t(s),
|
|
507
|
+
detail: {
|
|
508
|
+
...x,
|
|
509
|
+
canRefresh: O(() => !o.value && x.canRefresh.value),
|
|
510
|
+
open: (e) => o.value ? Promise.resolve() : x.open(e),
|
|
511
|
+
refresh: () => o.value ? Promise.resolve() : x.refresh()
|
|
512
|
+
},
|
|
513
|
+
showDetail: async (t) => {
|
|
514
|
+
if (!C("detail", t)) return;
|
|
515
|
+
let n = e.runtime.epoch, r = h.session.value;
|
|
516
|
+
u.value = g(t);
|
|
517
|
+
let i = e.detail.mode === "load" ? {
|
|
518
|
+
mode: "load",
|
|
519
|
+
id: g(t),
|
|
520
|
+
load: e.detail.load
|
|
521
|
+
} : {
|
|
522
|
+
mode: "direct",
|
|
523
|
+
id: g(t),
|
|
524
|
+
...e.detail.direct(t)
|
|
525
|
+
};
|
|
526
|
+
n !== e.runtime.epoch || r !== h.session.value || !C("detail", t) || await x.open(i);
|
|
527
|
+
},
|
|
528
|
+
reset: async () => {
|
|
529
|
+
o.value || await n(h.intent, () => h.reset(), () => y.reset(), () => y.context()?.generation);
|
|
530
|
+
},
|
|
531
|
+
dispose: w
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/templates/crud/DetailEntry.ts
|
|
536
|
+
var ye = [
|
|
537
|
+
"button",
|
|
538
|
+
"a",
|
|
539
|
+
"input",
|
|
540
|
+
"select",
|
|
541
|
+
"textarea",
|
|
542
|
+
"label",
|
|
543
|
+
"summary",
|
|
544
|
+
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
545
|
+
"[role=\"button\"]",
|
|
546
|
+
"[role=\"link\"]",
|
|
547
|
+
"[role=\"checkbox\"]",
|
|
548
|
+
"[role=\"radio\"]",
|
|
549
|
+
"[role=\"switch\"]",
|
|
550
|
+
"[role=\"slider\"]",
|
|
551
|
+
"[role=\"combobox\"]",
|
|
552
|
+
"[role=\"textbox\"]",
|
|
553
|
+
"[role=\"menuitem\"]",
|
|
554
|
+
"[tabindex]:not([tabindex=\"-1\"])",
|
|
555
|
+
"[draggable=\"true\"]",
|
|
556
|
+
"[data-drag-handle]",
|
|
557
|
+
"[data-resize-handle]",
|
|
558
|
+
"[data-crud-detail-ignore]"
|
|
559
|
+
].join(",");
|
|
560
|
+
function be(e, t) {
|
|
561
|
+
if (e.defaultPrevented) return !0;
|
|
562
|
+
let n = e.target instanceof Element ? e.target : null;
|
|
563
|
+
for (; n && n !== t;) {
|
|
564
|
+
if (n.matches(ye) || n.hasAttribute("data-crud-detail-entry")) return !0;
|
|
565
|
+
n = n.parentElement;
|
|
566
|
+
}
|
|
567
|
+
return !1;
|
|
568
|
+
}
|
|
569
|
+
var xe = P({
|
|
570
|
+
name: "AsamInternalCrudDetailCell",
|
|
571
|
+
props: {
|
|
572
|
+
label: {
|
|
573
|
+
type: String,
|
|
574
|
+
required: !0
|
|
575
|
+
},
|
|
576
|
+
columnLabel: {
|
|
577
|
+
type: String,
|
|
578
|
+
required: !0
|
|
579
|
+
},
|
|
580
|
+
size: {
|
|
581
|
+
type: String,
|
|
582
|
+
default: void 0
|
|
583
|
+
},
|
|
584
|
+
disabled: Boolean,
|
|
585
|
+
retainFocus: Boolean
|
|
586
|
+
},
|
|
587
|
+
emits: { open: (e) => e instanceof HTMLElement },
|
|
588
|
+
setup(e, { slots: t, emit: n }) {
|
|
589
|
+
let r = K(), i = K(), a = K(!0), o, s = () => {
|
|
590
|
+
a.value = !!i.value?.querySelector(ye);
|
|
591
|
+
};
|
|
592
|
+
return L(() => {
|
|
593
|
+
s(), o = new MutationObserver(s), i.value && o.observe(i.value, {
|
|
594
|
+
subtree: !0,
|
|
595
|
+
childList: !0,
|
|
596
|
+
attributes: !0,
|
|
597
|
+
attributeFilter: [
|
|
598
|
+
"role",
|
|
599
|
+
"tabindex",
|
|
600
|
+
"contenteditable",
|
|
601
|
+
"draggable",
|
|
602
|
+
"data-crud-detail-ignore",
|
|
603
|
+
"data-drag-handle",
|
|
604
|
+
"data-resize-handle"
|
|
605
|
+
]
|
|
606
|
+
});
|
|
607
|
+
}), R(s), I(() => o?.disconnect()), () => F("div", {
|
|
608
|
+
ref: r,
|
|
609
|
+
class: "asam-crud-detail-entry",
|
|
610
|
+
"data-crud-detail-entry": "",
|
|
611
|
+
role: a.value ? void 0 : "link",
|
|
612
|
+
tabindex: a.value || e.disabled ? -1 : 0,
|
|
613
|
+
"aria-label": a.value ? void 0 : `${e.label}: ${e.columnLabel}`,
|
|
614
|
+
"aria-disabled": !a.value && e.disabled ? !0 : void 0,
|
|
615
|
+
onClick: (t) => {
|
|
616
|
+
!e.disabled && r.value && !be(t, r.value) && n("open", r.value);
|
|
617
|
+
},
|
|
618
|
+
onKeydown: (t) => {
|
|
619
|
+
e.disabled || a.value || t.repeat || t.target !== r.value || !["Enter", " "].includes(t.key) || (t.preventDefault(), r.value && n("open", r.value));
|
|
620
|
+
}
|
|
621
|
+
}, [F("div", { ref: i }, t.default?.()), a.value ? F(Q, {
|
|
622
|
+
type: "primary",
|
|
623
|
+
size: e.size,
|
|
624
|
+
link: !0,
|
|
625
|
+
class: "asam-crud-detail-link",
|
|
626
|
+
disabled: e.disabled && !e.retainFocus,
|
|
627
|
+
"aria-disabled": e.disabled || void 0,
|
|
628
|
+
onClick: (t) => {
|
|
629
|
+
!e.disabled && t.currentTarget instanceof HTMLElement && n("open", t.currentTarget);
|
|
630
|
+
}
|
|
631
|
+
}, () => e.label) : null]);
|
|
632
|
+
}
|
|
633
|
+
}), Se = ["data-size", "aria-label"], Ce = {
|
|
634
|
+
key: 0,
|
|
635
|
+
class: "asam-crud-heading"
|
|
636
|
+
}, we = { key: 0 }, Te = {
|
|
637
|
+
key: 0,
|
|
638
|
+
class: "asam-crud-eyebrow"
|
|
639
|
+
}, Ee = {
|
|
640
|
+
key: 1,
|
|
641
|
+
class: "asam-crud-navigation"
|
|
642
|
+
}, De = {
|
|
643
|
+
key: 2,
|
|
644
|
+
role: "status"
|
|
645
|
+
}, Oe = {
|
|
646
|
+
key: 3,
|
|
647
|
+
role: "status"
|
|
648
|
+
}, ke = {
|
|
649
|
+
key: 4,
|
|
650
|
+
role: "alert"
|
|
651
|
+
}, Ae = {
|
|
652
|
+
key: 5,
|
|
653
|
+
class: "asam-crud-feedback",
|
|
654
|
+
role: "status",
|
|
655
|
+
"aria-live": "polite"
|
|
656
|
+
}, je = ["disabled", "inert"], Me = { class: "asam-crud-sr" }, Ne = ["data-operation"], Pe = { role: "status" }, Fe = { key: 0 }, Ie = ["inert"], Le = /* @__PURE__ */ ne(/* @__PURE__ */ P({
|
|
657
|
+
name: "AsamCrudPage",
|
|
658
|
+
__name: "AsamCrudPage",
|
|
659
|
+
props: {
|
|
660
|
+
controller: {},
|
|
661
|
+
title: { default: void 0 },
|
|
662
|
+
description: {},
|
|
663
|
+
createLabel: {},
|
|
664
|
+
editLabel: {},
|
|
665
|
+
detailLabel: {},
|
|
666
|
+
size: {},
|
|
667
|
+
tableSize: { default: void 0 },
|
|
668
|
+
viewMode: {},
|
|
669
|
+
presentation: {},
|
|
670
|
+
detailDisplay: {},
|
|
671
|
+
sectionCards: {
|
|
672
|
+
type: Boolean,
|
|
673
|
+
default: void 0
|
|
674
|
+
},
|
|
675
|
+
columnSettings: {},
|
|
676
|
+
operationDetails: {},
|
|
677
|
+
editorColumns: { default: 2 },
|
|
678
|
+
editorWidth: {},
|
|
679
|
+
saveButtonType: {},
|
|
680
|
+
cancelButtonType: {},
|
|
681
|
+
queryColumns: {},
|
|
682
|
+
queryCollapsedCount: {},
|
|
683
|
+
queryFieldLabels: {},
|
|
684
|
+
fieldLabels: {},
|
|
685
|
+
actionButtonType: { default: "primary" },
|
|
686
|
+
tableWidth: { default: "fill" },
|
|
687
|
+
showHeading: {
|
|
688
|
+
type: Boolean,
|
|
689
|
+
default: void 0
|
|
690
|
+
},
|
|
691
|
+
pagePadding: { default: 20 },
|
|
692
|
+
contentWidth: { default: void 0 },
|
|
693
|
+
defaultContentWidth: { default: "full" },
|
|
694
|
+
actionColumnWidth: { default: 280 },
|
|
695
|
+
actionColumnFixed: {
|
|
696
|
+
type: [String, Boolean],
|
|
697
|
+
default: void 0
|
|
698
|
+
},
|
|
699
|
+
pagination: {
|
|
700
|
+
type: Boolean,
|
|
701
|
+
default: void 0
|
|
702
|
+
},
|
|
703
|
+
detailEntry: {
|
|
704
|
+
type: [Boolean, Object],
|
|
705
|
+
default: void 0
|
|
706
|
+
},
|
|
707
|
+
detailOnRowDblclick: {
|
|
708
|
+
type: Boolean,
|
|
709
|
+
default: void 0
|
|
710
|
+
},
|
|
711
|
+
resizable: {
|
|
712
|
+
type: Boolean,
|
|
713
|
+
default: !0
|
|
714
|
+
},
|
|
715
|
+
rowActionSize: {},
|
|
716
|
+
rowActionOverflow: {
|
|
717
|
+
type: Boolean,
|
|
718
|
+
default: void 0
|
|
719
|
+
},
|
|
720
|
+
rowActions: {},
|
|
721
|
+
stripe: {
|
|
722
|
+
type: Boolean,
|
|
723
|
+
default: void 0
|
|
724
|
+
},
|
|
725
|
+
border: {
|
|
726
|
+
type: Boolean,
|
|
727
|
+
default: void 0
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
emits: [
|
|
731
|
+
"refresh-state",
|
|
732
|
+
"update:border",
|
|
733
|
+
"update:contentWidth",
|
|
734
|
+
"expand-change"
|
|
735
|
+
],
|
|
736
|
+
setup(t, { expose: r, emit: i }) {
|
|
737
|
+
let o = e(), l = y();
|
|
738
|
+
B(ee, l);
|
|
739
|
+
let u = t, p = ge(() => u.size), g = O(() => u.viewMode !== "legacy"), v = O(() => ({ padding: typeof u.pagePadding == "number" ? `${u.pagePadding}px` : u.pagePadding })), b = O(() => u.operationDetails === "diagnostic" || u.operationDetails === void 0 && !g.value), te = H(u.defaultContentWidth), S = O({
|
|
740
|
+
get: () => (u.contentWidth ?? te.value) === "full",
|
|
741
|
+
set: (e) => {
|
|
742
|
+
te.value = e ? "full" : "contained", ae("update:contentWidth", te.value);
|
|
743
|
+
}
|
|
744
|
+
}), C = H(u.tableSize ?? "default");
|
|
745
|
+
X(() => u.tableSize, (e) => {
|
|
746
|
+
C.value = e ?? "default";
|
|
747
|
+
});
|
|
748
|
+
let w = O(() => u.sectionCards ?? g.value), E = O(() => u.detailDisplay ?? (g.value ? "drawer" : "dialog")), ne = O(() => u.rowActionSize ?? (g.value ? "small" : p.value)), P = O(() => u.rowActionOverflow ?? g.value), ae = i, oe = me(), I = H(), L = H(), pe = () => u.showHeading !== !1 && (!!u.title?.trim() || !!oe.heading), R = () => L.value ?? I.value ?? null, V = K(), J;
|
|
749
|
+
X(() => u.controller.list.busy.value.has("detail"), (e) => {
|
|
750
|
+
!e && J && J === V.value && (V.value = void 0, J = void 0);
|
|
751
|
+
});
|
|
752
|
+
function _e() {
|
|
753
|
+
let e = V.value, t = e && u.controller.list.page.data.value.list.find((t) => Object.is(u.controller.key(t), e.key));
|
|
754
|
+
return e && e.owner === u.controller && e.session === u.controller.list.session.value && e.source === u.controller.list.successfulSource.value && t && u.controller.can("detail", t) && e.element.isConnected && !e.element.matches(":disabled") && !e.element.closest("[inert]") ? e.element : R();
|
|
755
|
+
}
|
|
756
|
+
async function ve() {
|
|
757
|
+
let e = V.value;
|
|
758
|
+
if (await le(), u.controller.detail.active.value || !e || V.value !== e) return;
|
|
759
|
+
l.dismiss();
|
|
760
|
+
let t = _e();
|
|
761
|
+
t?.focus({ preventScroll: !0 }), t === e.element && u.controller.list.busy.value.has("detail") ? J = e : (V.value = void 0, J = void 0);
|
|
762
|
+
}
|
|
763
|
+
let $ = O(() => u.presentation === "query-table" || u.controller.mode === "readonly" ? void 0 : u.controller), ye = O(() => {
|
|
764
|
+
let e = $.value?.records.value ?? [];
|
|
765
|
+
return b.value ? e : e.filter((e) => e.phase !== "cancelled");
|
|
766
|
+
}), Le = O(() => $.value ? {
|
|
767
|
+
readonly: !1,
|
|
768
|
+
coordinator: {
|
|
769
|
+
...$.value.operations,
|
|
770
|
+
records: ye
|
|
771
|
+
},
|
|
772
|
+
operations: [],
|
|
773
|
+
operationId: He
|
|
774
|
+
} : { readonly: !0 }), Re = O(() => ({
|
|
775
|
+
...u.controller.list,
|
|
776
|
+
canAction: (e, t) => !u.controller.disabled.value && u.controller.list.canAction(e, t),
|
|
777
|
+
runAction: (e, t, n) => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.runAction(e, t, n),
|
|
778
|
+
replaceConditions: (e, t) => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.replaceConditions(e, t),
|
|
779
|
+
submit: (e) => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.submit(e),
|
|
780
|
+
reset: async (e) => {
|
|
781
|
+
let t = u.controller;
|
|
782
|
+
return t.disabled.value ? { status: "blocked" } : n(t.list.intent, () => t.list.reset(e), () => t.selection.reset(), () => t.selection.context()?.generation);
|
|
783
|
+
},
|
|
784
|
+
refresh: () => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.refresh(),
|
|
785
|
+
retry: () => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.retry(),
|
|
786
|
+
setPage: (e) => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.setPage(e),
|
|
787
|
+
setPageSize: (e) => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.setPageSize(e),
|
|
788
|
+
setSort: (e) => u.controller.disabled.value ? Promise.resolve({ status: "blocked" }) : u.controller.list.setSort(e)
|
|
789
|
+
})), ze = (e) => e.results.some((e) => e.status === "unknown"), Be = (e) => e.results.some((e) => e.status === "failure" || e.status === "unsent");
|
|
790
|
+
function Ve(e) {
|
|
791
|
+
let t = e.results.filter((e) => e.status === "unknown").length;
|
|
792
|
+
if (t) return o.t("pro.crud.operationUnknown", { value1: t });
|
|
793
|
+
if (e.phase !== "settled") return o.t("pro.crud.operationRunning");
|
|
794
|
+
let n = e.results.filter((e) => e.status === "failure" || e.status === "unsent").length + e.snapshot.rejected.length;
|
|
795
|
+
return n ? o.t("pro.crud.operationIncomplete", { value1: n }) : o.t("pro.crud.operationFinished");
|
|
796
|
+
}
|
|
797
|
+
let He = () => {
|
|
798
|
+
throw c(/* @__PURE__ */ Error("CRUD使用显式编排入口"), "pro.crud.crudUsesAnExplicitOrchestrationEntry");
|
|
799
|
+
};
|
|
800
|
+
function Ue(e) {
|
|
801
|
+
if (!e) return;
|
|
802
|
+
let t = u.controller.key(e);
|
|
803
|
+
return u.controller.list.page.data.value.list.find((e) => Object.is(u.controller.key(e), t));
|
|
804
|
+
}
|
|
805
|
+
let We = O(() => {
|
|
806
|
+
let e = u.detailEntry ?? {};
|
|
807
|
+
if (!e) return;
|
|
808
|
+
let t = u.controller.preferences.columns.value;
|
|
809
|
+
return t.find((t) => t.key === e.column) ?? t[0];
|
|
810
|
+
});
|
|
811
|
+
function Ge(e) {
|
|
812
|
+
let t = V.value;
|
|
813
|
+
return !!(u.controller.detail.active.value && t && t.owner === u.controller && t.session === u.controller.list.session.value && t.source === u.controller.list.successfulSource.value && Object.is(t.key, u.controller.key(e)));
|
|
814
|
+
}
|
|
815
|
+
let Ke = O(() => {
|
|
816
|
+
let e = [{
|
|
817
|
+
id: "detail",
|
|
818
|
+
label: o.t("pro.crud.details"),
|
|
819
|
+
button: {
|
|
820
|
+
type: "primary",
|
|
821
|
+
link: !0
|
|
822
|
+
},
|
|
823
|
+
retainFocusWhileBusy: !0,
|
|
824
|
+
visible: (e) => !!e && u.controller.can("detail", e),
|
|
825
|
+
run: async ({ row: e, trigger: t }) => {
|
|
826
|
+
let n = Ue(e);
|
|
827
|
+
if (n && u.controller.can("detail", n) && !Ge(n)) {
|
|
828
|
+
let e = t ?? (document.activeElement instanceof HTMLElement ? document.activeElement : void 0);
|
|
829
|
+
J = void 0, V.value = e ? {
|
|
830
|
+
element: e,
|
|
831
|
+
key: u.controller.key(n),
|
|
832
|
+
owner: u.controller,
|
|
833
|
+
session: u.controller.list.session.value,
|
|
834
|
+
source: u.controller.list.successfulSource.value
|
|
835
|
+
} : void 0, await u.controller.showDetail(n);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}];
|
|
839
|
+
return $.value && e.push({
|
|
840
|
+
id: "edit",
|
|
841
|
+
label: o.t("pro.crud.edit"),
|
|
842
|
+
visible: (e) => !!e && !!$.value?.can("edit", e),
|
|
843
|
+
run: async ({ row: e }) => {
|
|
844
|
+
let t = Ue(e);
|
|
845
|
+
t && await $.value?.edit(t);
|
|
846
|
+
}
|
|
847
|
+
}, {
|
|
848
|
+
id: "remove",
|
|
849
|
+
label: o.t("pro.crud.delete"),
|
|
850
|
+
button: {
|
|
851
|
+
type: "danger",
|
|
852
|
+
plain: !0
|
|
853
|
+
},
|
|
854
|
+
retainFocusWhileBusy: !0,
|
|
855
|
+
enabled: () => !u.controller.disabled.value,
|
|
856
|
+
visible: (e) => !!e && !!$.value?.can("remove", e),
|
|
857
|
+
run: async ({ row: e, trigger: t }) => {
|
|
858
|
+
let n = Ue(e);
|
|
859
|
+
if (!n) return;
|
|
860
|
+
let r = await $.value?.remove([u.controller.key(n)]);
|
|
861
|
+
await le(), r?.phase === "cancelled" && t && (!t.isConnected || t.matches(":disabled")) && R()?.focus({ preventScroll: !0 });
|
|
862
|
+
}
|
|
863
|
+
}), [...e, ...u.rowActions ?? []];
|
|
864
|
+
}), qe = O(() => Ke.value.filter((e) => e.id !== "detail"));
|
|
865
|
+
function Je(e) {
|
|
866
|
+
return u.presentation !== "query-table" && u.controller.list.page.data.value.list.includes(e) && Re.value.canAction(Ke.value[0], e) && !Ge(e);
|
|
867
|
+
}
|
|
868
|
+
function Ye(e, t) {
|
|
869
|
+
return !Je(e) || Ge(e) ? Promise.resolve({ status: "blocked" }) : Re.value.runAction(Ke.value[0], e, t);
|
|
870
|
+
}
|
|
871
|
+
function Xe(e) {
|
|
872
|
+
if (u.presentation === "query-table" || !(u.detailOnRowDblclick ?? g.value) || e.button !== 0 || e.detail < 2) return;
|
|
873
|
+
let t = e.target instanceof Element ? e.target : null, n = t?.closest("td.asam-pro-data-column"), r = n?.parentElement;
|
|
874
|
+
r && t?.closest("td") === n && r.closest(".asam-operations-table") === e.currentTarget && !be(e, r) && e.preventDefault();
|
|
875
|
+
}
|
|
876
|
+
function Ze(...[e, t, n]) {
|
|
877
|
+
if (!(u.detailOnRowDblclick ?? g.value) || !Je(e) || n.button !== 0) return;
|
|
878
|
+
let r = n.target instanceof Element ? n.target : null, i = t ? t.type !== "selection" && u.controller.preferences.columns.value.some((e) => e.key === t.property) : !!u.controller.structure && !!r?.closest("td.asam-pro-data-column"), a = n.currentTarget, o = a instanceof HTMLElement && a.matches("tr") ? a : r?.closest("tr");
|
|
879
|
+
!i || !(o instanceof HTMLElement) || !I.value?.contains(o) || r?.closest("tr") !== o || be(n, o) || (o.hasAttribute("tabindex") || (o.tabIndex = -1), Ye(e, o));
|
|
880
|
+
}
|
|
881
|
+
function Qe(e) {
|
|
882
|
+
let { row: t, column: n } = e;
|
|
883
|
+
if (!u.controller.list.page.data.value.list.includes(t)) return null;
|
|
884
|
+
let r = oe.cell?.(e) ?? n.render?.(t) ?? String(Reflect.get(t, n.key) ?? "—"), i = Ke.value[0];
|
|
885
|
+
if (n.key !== We.value?.key || i.visible?.(t) === !1) return r;
|
|
886
|
+
let a = !Re.value.canAction(i, t), s = V.value?.owner === u.controller && Object.is(V.value.key, u.controller.key(t)) && u.controller.list.busy.value.has(i.busyKey ?? i.id) && u.controller.can("detail", t);
|
|
887
|
+
return oe.cell || n.render ? F(xe, {
|
|
888
|
+
label: o.t("pro.crud.details"),
|
|
889
|
+
columnLabel: n.label,
|
|
890
|
+
size: p.value,
|
|
891
|
+
disabled: a,
|
|
892
|
+
retainFocus: s,
|
|
893
|
+
onOpen: (e) => void Ye(t, e)
|
|
894
|
+
}, () => r) : F(Q, {
|
|
895
|
+
class: "asam-crud-detail-link",
|
|
896
|
+
type: "primary",
|
|
897
|
+
link: !0,
|
|
898
|
+
size: p.value,
|
|
899
|
+
disabled: a && !s,
|
|
900
|
+
"aria-disabled": a || void 0,
|
|
901
|
+
onClick: (e) => Ye(t, e.currentTarget instanceof HTMLElement ? e.currentTarget : void 0)
|
|
902
|
+
}, () => r);
|
|
903
|
+
}
|
|
904
|
+
function $e(e) {
|
|
905
|
+
!e && !u.controller.disabled.value && (l.dismiss(), u.controller.detail.close());
|
|
906
|
+
}
|
|
907
|
+
let et = O(() => {
|
|
908
|
+
let e = V.value;
|
|
909
|
+
return e && u.controller.detail.active.value ? u.controller.list.page.data.value.list.find((t) => Object.is(u.controller.key(t), e.key)) : void 0;
|
|
910
|
+
});
|
|
911
|
+
async function tt() {
|
|
912
|
+
let e = et.value;
|
|
913
|
+
!e || !$.value?.can("edit", e) || (u.controller.detail.close(), await $.value.edit(e));
|
|
914
|
+
}
|
|
915
|
+
X(() => $.value?.refreshState.value.status ?? "idle", (e) => ae("refresh-state", e)), X(() => $.value?.refreshState.value.status ?? "idle", async (e) => {
|
|
916
|
+
e === "success" && (await le(), R()?.focus({ preventScroll: !0 }));
|
|
917
|
+
}), r({
|
|
918
|
+
controller: u.controller,
|
|
919
|
+
focus: () => R()?.focus()
|
|
920
|
+
});
|
|
921
|
+
let nt = O(() => u.title ?? o.t("pro.crud.dataManagement"));
|
|
922
|
+
return (e, n) => (z(), j("section", {
|
|
923
|
+
ref_key: "root",
|
|
924
|
+
ref: I,
|
|
925
|
+
class: ue(["asam-crud", {
|
|
926
|
+
"asam-crud-standard": g.value,
|
|
927
|
+
"asam-crud-wide": S.value
|
|
928
|
+
}]),
|
|
929
|
+
"data-size": Y(p),
|
|
930
|
+
style: fe(v.value),
|
|
931
|
+
"aria-label": nt.value,
|
|
932
|
+
tabindex: "-1"
|
|
933
|
+
}, [
|
|
934
|
+
pe() ? (z(), j("header", Ce, [nt.value?.trim() ? (z(), j("div", we, [t.description?.trim() ? (z(), j("p", Te, q(t.description), 1)) : A("", !0), M("h2", {
|
|
935
|
+
ref_key: "heading",
|
|
936
|
+
ref: L,
|
|
937
|
+
tabindex: "-1"
|
|
938
|
+
}, q(nt.value), 513)])) : A("", !0), W(e.$slots, "heading", { controller: t.controller }, void 0, !0)])) : A("", !0),
|
|
939
|
+
e.$slots.navigation ? (z(), j("div", Ee, [W(e.$slots, "navigation", {}, void 0, !0)])) : A("", !0),
|
|
940
|
+
t.controller.disabled.value ? (z(), j("p", De, q(Y(o).t("pro.crud.thePageIsDisabledNewRequestsCannotBe")), 1)) : A("", !0),
|
|
941
|
+
t.controller.list.scopeReady.value ? A("", !0) : (z(), j("p", Oe, q(Y(o).t("pro.crud.theDataScopeChangedTheApplicationMustRestore")), 1)),
|
|
942
|
+
Y(f)(t.controller.message, Y(o)) ? (z(), j("p", ke, q(Y(f)(t.controller.message, Y(o))), 1)) : A("", !0),
|
|
943
|
+
$.value && $.value.refreshState.value.status !== "idle" ? (z(), j("div", Ae, [$.value.refreshState.value.status === "error" ? (z(), j(D, { key: 0 }, [N(q(Y(o).t("pro.crud.theWriteSucceededButTheListRefreshFailed")) + " ", 1), ie(Y(Q), {
|
|
944
|
+
class: "asam-pro-message-button",
|
|
945
|
+
size: Y(p),
|
|
946
|
+
disabled: t.controller.disabled.value,
|
|
947
|
+
onClick: n[0] ||= (e) => $.value.retryRefresh()
|
|
948
|
+
}, {
|
|
949
|
+
default: Z(() => [N(q(Y(o).t("pro.crud.retryListRefresh")), 1)]),
|
|
950
|
+
_: 1
|
|
951
|
+
}, 8, ["size", "disabled"])], 64)) : $.value.refreshState.value.status === "refreshing" ? (z(), j(D, { key: 1 }, [N(q(Y(o).t("pro.crud.theWriteSucceededRefreshingTheList")), 1)], 64)) : $.value.refreshState.value.status === "success" ? (z(), j(D, { key: 2 }, [N(q(Y(o).t("pro.crud.theWriteSucceededAndTheListWasRefreshed")), 1)], 64)) : $.value.refreshState.value.status === "stale" ? (z(), j(D, { key: 3 }, [N(q(Y(o).t("pro.crud.theOriginalOperationWasRecordedTheCurrentScope")), 1)], 64)) : A("", !0)])) : A("", !0),
|
|
952
|
+
M("fieldset", {
|
|
953
|
+
class: "asam-crud-body",
|
|
954
|
+
disabled: t.controller.disabled.value,
|
|
955
|
+
inert: t.controller.disabled.value
|
|
956
|
+
}, [
|
|
957
|
+
M("legend", Me, q(Y(o).t("pro.crud.searchAndDataActions")), 1),
|
|
958
|
+
e.$slots.query ? W(e.$slots, "query", {
|
|
959
|
+
key: 0,
|
|
960
|
+
controller: t.controller,
|
|
961
|
+
list: Re.value,
|
|
962
|
+
rowActions: qe.value,
|
|
963
|
+
detailColumn: We.value?.key,
|
|
964
|
+
openDetail: Ye,
|
|
965
|
+
canOpenDetail: Je
|
|
966
|
+
}, void 0, !0) : (z(), k(Y(d), {
|
|
967
|
+
key: 1,
|
|
968
|
+
class: "asam-crud-query",
|
|
969
|
+
controller: Re.value,
|
|
970
|
+
size: Y(p),
|
|
971
|
+
columns: t.queryColumns ?? (g.value ? 3 : 2),
|
|
972
|
+
"collapsed-count": t.queryCollapsedCount ?? (g.value ? 3 : 4),
|
|
973
|
+
compact: g.value,
|
|
974
|
+
card: w.value,
|
|
975
|
+
"field-labels": t.queryFieldLabels,
|
|
976
|
+
"action-button-type": t.actionButtonType
|
|
977
|
+
}, null, 8, [
|
|
978
|
+
"controller",
|
|
979
|
+
"size",
|
|
980
|
+
"columns",
|
|
981
|
+
"collapsed-count",
|
|
982
|
+
"compact",
|
|
983
|
+
"card",
|
|
984
|
+
"field-labels",
|
|
985
|
+
"action-button-type"
|
|
986
|
+
])),
|
|
987
|
+
e.$slots.content ? W(e.$slots, "content", {
|
|
988
|
+
key: 2,
|
|
989
|
+
controller: t.controller,
|
|
990
|
+
list: Re.value,
|
|
991
|
+
rowActions: qe.value,
|
|
992
|
+
detailColumn: We.value?.key,
|
|
993
|
+
openDetail: Ye,
|
|
994
|
+
canOpenDetail: Je
|
|
995
|
+
}, void 0, !0) : (z(), k(G(w.value ? Y(he) : "div"), ce({ key: 3 }, w.value ? {
|
|
996
|
+
bordered: !g.value,
|
|
997
|
+
shadow: "never",
|
|
998
|
+
bodyStyle: g.value ? { padding: "0" } : void 0
|
|
999
|
+
} : {}, { class: ["asam-crud-content", { "asam-crud-section-plain": !w.value }] }), {
|
|
1000
|
+
default: Z(() => [ie(Y(h), ce({
|
|
1001
|
+
class: "asam-crud-data-table",
|
|
1002
|
+
controller: Re.value,
|
|
1003
|
+
selection: t.controller.selection,
|
|
1004
|
+
structure: t.controller.structure,
|
|
1005
|
+
pagination: t.pagination ?? !t.controller.structure,
|
|
1006
|
+
preferences: t.controller.preferences
|
|
1007
|
+
}, Le.value, {
|
|
1008
|
+
"row-actions": qe.value,
|
|
1009
|
+
size: Y(p),
|
|
1010
|
+
"table-size": C.value,
|
|
1011
|
+
"row-action-size": ne.value,
|
|
1012
|
+
"row-action-overflow": P.value,
|
|
1013
|
+
resizable: t.resizable,
|
|
1014
|
+
"column-settings": t.columnSettings ?? (g.value ? "popover" : "panel"),
|
|
1015
|
+
"column-settings-disabled": t.controller.disabled.value,
|
|
1016
|
+
"operation-record-label": b.value ? void 0 : Y(o).t("pro.crud.operationFeedback"),
|
|
1017
|
+
"width-mode": t.tableWidth,
|
|
1018
|
+
"action-column-width": t.actionColumnWidth,
|
|
1019
|
+
"action-column-fixed": t.actionColumnFixed,
|
|
1020
|
+
stripe: u.stripe,
|
|
1021
|
+
border: u.border,
|
|
1022
|
+
"onUpdate:border": n[4] ||= (e) => ae("update:border", e),
|
|
1023
|
+
onMousedownCapture: Xe,
|
|
1024
|
+
onRowDblclick: Ze,
|
|
1025
|
+
onExpandChange: n[5] ||= (e, t) => ae("expand-change", e, t)
|
|
1026
|
+
}), re({
|
|
1027
|
+
toolbar: Z(() => [
|
|
1028
|
+
$.value?.can("create") ? (z(), k(Y(Q), {
|
|
1029
|
+
key: 0,
|
|
1030
|
+
class: "asam-pro-message-button",
|
|
1031
|
+
size: Y(p),
|
|
1032
|
+
type: t.actionButtonType,
|
|
1033
|
+
onClick: n[2] ||= (e) => $.value?.create()
|
|
1034
|
+
}, re({
|
|
1035
|
+
default: Z(() => [N(" " + q(t.createLabel ?? Y(o).t("pro.crud.createRecord")), 1)]),
|
|
1036
|
+
_: 2
|
|
1037
|
+
}, [g.value ? {
|
|
1038
|
+
name: "icon",
|
|
1039
|
+
fn: Z(() => [n[7] ||= M("svg", {
|
|
1040
|
+
width: "16",
|
|
1041
|
+
height: "16",
|
|
1042
|
+
viewBox: "0 0 24 24",
|
|
1043
|
+
fill: "none",
|
|
1044
|
+
stroke: "currentColor",
|
|
1045
|
+
"stroke-width": "1.8",
|
|
1046
|
+
"aria-hidden": "true"
|
|
1047
|
+
}, [M("path", { d: "M12 4v16M4 12h16" })], -1)]),
|
|
1048
|
+
key: "0"
|
|
1049
|
+
} : void 0]), 1032, ["size", "type"])) : A("", !0),
|
|
1050
|
+
g.value ? W(e.$slots, "toolbar", {
|
|
1051
|
+
key: 1,
|
|
1052
|
+
controller: t.controller
|
|
1053
|
+
}, void 0, !0) : A("", !0),
|
|
1054
|
+
$.value?.can("remove") ? (z(), k(Y(Q), {
|
|
1055
|
+
key: 2,
|
|
1056
|
+
class: "asam-pro-message-button",
|
|
1057
|
+
size: Y(p),
|
|
1058
|
+
type: "danger",
|
|
1059
|
+
plain: g.value,
|
|
1060
|
+
disabled: !t.controller.selection.ready.value || !t.controller.selection.keys.value.length || !!$.value?.operations.busy.value.length,
|
|
1061
|
+
onClick: n[3] ||= (e) => $.value?.remove()
|
|
1062
|
+
}, {
|
|
1063
|
+
default: Z(() => [N(q(Y(o).t(g.value ? "pro.crud.delete" : "pro.crud.deleteSelected")) + " ", 1), g.value ? A("", !0) : (z(), j(D, { key: 0 }, [N(q(t.controller.selection.keys.value.length) + " " + q(Y(o).t("pro.crud.items")), 1)], 64))]),
|
|
1064
|
+
_: 1
|
|
1065
|
+
}, 8, [
|
|
1066
|
+
"size",
|
|
1067
|
+
"plain",
|
|
1068
|
+
"disabled"
|
|
1069
|
+
])) : A("", !0),
|
|
1070
|
+
g.value ? A("", !0) : W(e.$slots, "toolbar", {
|
|
1071
|
+
key: 3,
|
|
1072
|
+
controller: t.controller
|
|
1073
|
+
}, void 0, !0)
|
|
1074
|
+
]),
|
|
1075
|
+
record: Z(({ record: n }) => [M("div", {
|
|
1076
|
+
class: "asam-crud-record",
|
|
1077
|
+
"data-operation": n.snapshot.operationId
|
|
1078
|
+
}, [
|
|
1079
|
+
b.value ? (z(), j(D, { key: 0 }, [
|
|
1080
|
+
M("p", null, q(n.snapshot.operationId) + " " + q(Y(o).t("pro.crud.originalScope")) + " " + q(n.snapshot.context.scope) + " · " + q(Y(a)(Y(o), n.phase)), 1),
|
|
1081
|
+
M("p", null, q(Y(f)(n, Y(o))), 1),
|
|
1082
|
+
M("ul", null, [(z(!0), j(D, null, U(n.results, (e) => (z(), j("li", { key: `${typeof e.key}:${e.key}` }, q(typeof e.key) + ":" + q(e.key) + " — " + q(Y(a)(Y(o), e.status)) + " " + q(Y(f)(e, Y(o))), 1))), 128))]),
|
|
1083
|
+
(z(!0), j(D, null, U(n.snapshot.rejected, (e) => (z(), j("p", { key: `${typeof e.key}:${e.key}` }, q(Y(o).t("pro.crud.rejected")) + " " + q(typeof e.key) + ":" + q(e.key) + ":" + q(Y(f)(e, Y(o))), 1))), 128))
|
|
1084
|
+
], 64)) : (z(), j(D, { key: 1 }, [M("p", Pe, q(Ve(n)), 1), n.message ? (z(), j("p", Fe, q(Y(f)(n, Y(o))), 1)) : A("", !0)], 64)),
|
|
1085
|
+
b.value || ze(n) ? (z(), k(Y(Q), {
|
|
1086
|
+
key: 2,
|
|
1087
|
+
class: "asam-pro-message-button",
|
|
1088
|
+
size: Y(p),
|
|
1089
|
+
disabled: !ze(n) || !!$.value?.operations.busy.value.length,
|
|
1090
|
+
onClick: (e) => $.value?.verifyRemove(n.snapshot.operationId)
|
|
1091
|
+
}, {
|
|
1092
|
+
default: Z(() => [N(q(Y(o).t("pro.crud.verifyDeletionResult")), 1)]),
|
|
1093
|
+
_: 1
|
|
1094
|
+
}, 8, [
|
|
1095
|
+
"size",
|
|
1096
|
+
"disabled",
|
|
1097
|
+
"onClick"
|
|
1098
|
+
])) : A("", !0),
|
|
1099
|
+
b.value || n.phase === "settled" && Be(n) && !ze(n) ? (z(), k(Y(Q), {
|
|
1100
|
+
key: 3,
|
|
1101
|
+
class: "asam-pro-message-button",
|
|
1102
|
+
size: Y(p),
|
|
1103
|
+
disabled: !$.value?.can("remove") || !t.controller.selection.ready.value || n.phase !== "settled" || !!$.value?.operations.busy.value.length || ze(n) || !Be(n),
|
|
1104
|
+
onClick: (e) => $.value?.retryRemove(n.snapshot.operationId)
|
|
1105
|
+
}, {
|
|
1106
|
+
default: Z(() => [N(q(Y(o).t("pro.crud.retryUnappliedItems")), 1)]),
|
|
1107
|
+
_: 1
|
|
1108
|
+
}, 8, [
|
|
1109
|
+
"size",
|
|
1110
|
+
"disabled",
|
|
1111
|
+
"onClick"
|
|
1112
|
+
])) : A("", !0),
|
|
1113
|
+
W(e.$slots, "record", { record: n }, void 0, !0)
|
|
1114
|
+
], 8, Ne)]),
|
|
1115
|
+
_: 2
|
|
1116
|
+
}, [
|
|
1117
|
+
g.value ? {
|
|
1118
|
+
name: "tools",
|
|
1119
|
+
fn: Z(() => [ie(_, {
|
|
1120
|
+
size: C.value,
|
|
1121
|
+
"control-size": Y(p),
|
|
1122
|
+
disabled: t.controller.disabled.value,
|
|
1123
|
+
session: t.controller.list.session.value,
|
|
1124
|
+
"onUpdate:size": n[1] ||= (e) => C.value = e
|
|
1125
|
+
}, null, 8, [
|
|
1126
|
+
"size",
|
|
1127
|
+
"control-size",
|
|
1128
|
+
"disabled",
|
|
1129
|
+
"session"
|
|
1130
|
+
])]),
|
|
1131
|
+
key: "0"
|
|
1132
|
+
} : void 0,
|
|
1133
|
+
g.value ? {
|
|
1134
|
+
name: "tools-end",
|
|
1135
|
+
fn: Z(() => [(z(), k(G(Y(T)(Y(o).t(S.value ? "pro.crud.restoreWidth" : "pro.crud.fullWidth"), () => {
|
|
1136
|
+
S.value = !S.value;
|
|
1137
|
+
}, "fullscreen", Y(p), t.controller.disabled.value, void 0, S.value))))]),
|
|
1138
|
+
key: "1"
|
|
1139
|
+
} : void 0,
|
|
1140
|
+
e.$slots.cell || We.value ? {
|
|
1141
|
+
name: "cell",
|
|
1142
|
+
fn: Z((e) => [(z(), k(G(Qe), de(se(e)), null, 16))]),
|
|
1143
|
+
key: "2"
|
|
1144
|
+
} : void 0
|
|
1145
|
+
]), 1040, [
|
|
1146
|
+
"controller",
|
|
1147
|
+
"selection",
|
|
1148
|
+
"structure",
|
|
1149
|
+
"pagination",
|
|
1150
|
+
"preferences",
|
|
1151
|
+
"row-actions",
|
|
1152
|
+
"size",
|
|
1153
|
+
"table-size",
|
|
1154
|
+
"row-action-size",
|
|
1155
|
+
"row-action-overflow",
|
|
1156
|
+
"resizable",
|
|
1157
|
+
"column-settings",
|
|
1158
|
+
"column-settings-disabled",
|
|
1159
|
+
"operation-record-label",
|
|
1160
|
+
"width-mode",
|
|
1161
|
+
"action-column-width",
|
|
1162
|
+
"action-column-fixed",
|
|
1163
|
+
"stripe",
|
|
1164
|
+
"border"
|
|
1165
|
+
])]),
|
|
1166
|
+
_: 3
|
|
1167
|
+
}, 16, ["class"])),
|
|
1168
|
+
W(e.$slots, "default", { controller: t.controller }, void 0, !0)
|
|
1169
|
+
], 8, je),
|
|
1170
|
+
t.presentation === "query-table" ? A("", !0) : (z(), j("div", {
|
|
1171
|
+
key: 6,
|
|
1172
|
+
inert: t.controller.disabled.value
|
|
1173
|
+
}, [$.value && e.$slots.editor ? W(e.$slots, "editor", {
|
|
1174
|
+
key: 0,
|
|
1175
|
+
controller: t.controller,
|
|
1176
|
+
fallbackFocus: R
|
|
1177
|
+
}, void 0, !0) : $.value ? (z(), k(m, {
|
|
1178
|
+
key: 1,
|
|
1179
|
+
class: ue({ "asam-crud-editor-dialog": g.value }),
|
|
1180
|
+
top: g.value ? "4vh" : void 0,
|
|
1181
|
+
controller: $.value.editor,
|
|
1182
|
+
columns: t.editorColumns,
|
|
1183
|
+
width: t.editorWidth ?? (g.value ? "min(860px, calc(100vw - 24px))" : void 0),
|
|
1184
|
+
"save-button-type": t.saveButtonType,
|
|
1185
|
+
"cancel-button-type": t.cancelButtonType,
|
|
1186
|
+
"field-labels": t.fieldLabels,
|
|
1187
|
+
title: $.value.editMode.value === "create" ? t.createLabel ?? Y(o).t("pro.crud.createRecord") : t.editLabel ?? Y(o).t("pro.crud.editRecord"),
|
|
1188
|
+
size: Y(p),
|
|
1189
|
+
"fallback-focus": R
|
|
1190
|
+
}, {
|
|
1191
|
+
"unknown-help": Z(() => [M("p", null, q(Y(o).t("pro.crud.closingDoesNotUndoAServerWriteReopening")), 1)]),
|
|
1192
|
+
_: 1
|
|
1193
|
+
}, 8, [
|
|
1194
|
+
"class",
|
|
1195
|
+
"top",
|
|
1196
|
+
"controller",
|
|
1197
|
+
"columns",
|
|
1198
|
+
"width",
|
|
1199
|
+
"save-button-type",
|
|
1200
|
+
"cancel-button-type",
|
|
1201
|
+
"field-labels",
|
|
1202
|
+
"title",
|
|
1203
|
+
"size"
|
|
1204
|
+
])) : A("", !0), e.$slots.detail ? W(e.$slots, "detail", {
|
|
1205
|
+
key: 2,
|
|
1206
|
+
controller: t.controller,
|
|
1207
|
+
trigger: V.value?.element,
|
|
1208
|
+
fallbackFocus: _e
|
|
1209
|
+
}, void 0, !0) : (z(), k(G(E.value === "drawer" ? x : s), ce({
|
|
1210
|
+
key: 3,
|
|
1211
|
+
class: { "asam-crud-detail-overlay": g.value },
|
|
1212
|
+
controller: t.controller.detail,
|
|
1213
|
+
title: t.detailLabel ?? Y(o).t("pro.crud.recordDetails"),
|
|
1214
|
+
appearance: g.value ? "grouped" : "plain",
|
|
1215
|
+
columns: 2,
|
|
1216
|
+
"field-labels": t.fieldLabels,
|
|
1217
|
+
"close-disabled": t.controller.disabled.value
|
|
1218
|
+
}, E.value === "drawer" ? {
|
|
1219
|
+
size: g.value ? "min(800px, 100vw)" : "min(720px, 100%)",
|
|
1220
|
+
direction: "rtl",
|
|
1221
|
+
resizable: g.value ? !0 : void 0
|
|
1222
|
+
} : { width: "min(900px, calc(100% - 24px))" }, { onClosed: ve }), re({
|
|
1223
|
+
footer: Z(() => [ie(Y(Q), {
|
|
1224
|
+
class: "asam-pro-message-button",
|
|
1225
|
+
size: Y(p),
|
|
1226
|
+
type: "primary",
|
|
1227
|
+
plain: g.value,
|
|
1228
|
+
onClick: n[6] ||= (e) => $e(!1)
|
|
1229
|
+
}, {
|
|
1230
|
+
default: Z(() => [N(q(Y(o).t("pro.crud.closeDetails")), 1)]),
|
|
1231
|
+
_: 1
|
|
1232
|
+
}, 8, ["size", "plain"]), g.value && et.value && $.value?.can("edit", et.value) ? (z(), k(Y(Q), {
|
|
1233
|
+
key: 0,
|
|
1234
|
+
type: "primary",
|
|
1235
|
+
size: Y(p),
|
|
1236
|
+
disabled: t.controller.disabled.value,
|
|
1237
|
+
onClick: tt
|
|
1238
|
+
}, {
|
|
1239
|
+
default: Z(() => [N(q(Y(o).t("pro.crud.edit")), 1)]),
|
|
1240
|
+
_: 1
|
|
1241
|
+
}, 8, ["size", "disabled"])) : A("", !0)]),
|
|
1242
|
+
_: 2
|
|
1243
|
+
}, [e.$slots["detail-content"] ? {
|
|
1244
|
+
name: "content",
|
|
1245
|
+
fn: Z(() => [W(e.$slots, "detail-content", {
|
|
1246
|
+
trigger: V.value?.element,
|
|
1247
|
+
controller: t.controller,
|
|
1248
|
+
fallbackFocus: _e
|
|
1249
|
+
}, void 0, !0)]),
|
|
1250
|
+
key: "0"
|
|
1251
|
+
} : void 0]), 1040, [
|
|
1252
|
+
"class",
|
|
1253
|
+
"controller",
|
|
1254
|
+
"title",
|
|
1255
|
+
"appearance",
|
|
1256
|
+
"field-labels",
|
|
1257
|
+
"close-disabled"
|
|
1258
|
+
]))], 8, Ie))
|
|
1259
|
+
], 14, Se));
|
|
1260
|
+
}
|
|
1261
|
+
}), [["__scopeId", "data-v-055798b0"]]);
|
|
1262
|
+
//#endregion
|
|
1263
|
+
export { $ as n, ve as r, Le as t };
|