@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,48 @@
|
|
|
1
|
+
import type { ApplicationTextKey } from '../../i18n/application/Resolve.js';
|
|
2
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
3
|
+
import type { NavigationItem, NavigationOptions, NavigationTab } from './Types.js';
|
|
4
|
+
/** One application module. The host owns the router and all routes outside this module. */
|
|
5
|
+
export declare function createNavigation(options: NavigationOptions): {
|
|
6
|
+
menu: Readonly<import("vue").ShallowRef<readonly NavigationItem[], readonly NavigationItem[]>>;
|
|
7
|
+
tabs: Readonly<import("vue").Ref<readonly {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly routeId: string;
|
|
10
|
+
readonly fullPath: string;
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly cacheKey: string;
|
|
13
|
+
readonly cache: boolean;
|
|
14
|
+
readonly pinned: boolean;
|
|
15
|
+
readonly epoch: number;
|
|
16
|
+
}[], readonly {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly routeId: string;
|
|
19
|
+
readonly fullPath: string;
|
|
20
|
+
readonly title: string;
|
|
21
|
+
readonly cacheKey: string;
|
|
22
|
+
readonly cache: boolean;
|
|
23
|
+
readonly pinned: boolean;
|
|
24
|
+
readonly epoch: number;
|
|
25
|
+
}[]>>;
|
|
26
|
+
pages: import("vue").ComputedRef<NavigationTab[]>;
|
|
27
|
+
active: Readonly<import("vue").Ref<string, string>>;
|
|
28
|
+
error: import("vue").ComputedRef<string>;
|
|
29
|
+
errorDiagnostic: import("vue").ComputedRef<string>;
|
|
30
|
+
errorCode: Readonly<import("vue").Ref<"" | ApplicationTextKey, "" | ApplicationTextKey>>;
|
|
31
|
+
loading: Readonly<import("vue").Ref<boolean, boolean>>;
|
|
32
|
+
revision: Readonly<import("vue").Ref<number, number>>;
|
|
33
|
+
router: import("vue-router").Router;
|
|
34
|
+
visibleMenu: import("vue").ComputedRef<NavigationItem[]>;
|
|
35
|
+
navigate: (target: RouteLocationRaw, replace?: boolean) => Promise<boolean>;
|
|
36
|
+
reload: (nextScope?: string) => Promise<boolean>;
|
|
37
|
+
close: (ids: readonly string[]) => Promise<boolean>;
|
|
38
|
+
refresh: (id?: string) => Promise<boolean>;
|
|
39
|
+
move: (id: string, targetId: string) => void;
|
|
40
|
+
dispose: () => void;
|
|
41
|
+
closeOthers: () => Promise<boolean>;
|
|
42
|
+
closeAll: () => Promise<boolean>;
|
|
43
|
+
component: (id: string) => import("vue").Component;
|
|
44
|
+
location: (id: string) => {
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export type NavigationController = ReturnType<typeof createNavigation>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavigationItem } from './Types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
items: readonly NavigationItem[];
|
|
4
|
+
parentId?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NavigationTab } from './Types.js';
|
|
2
|
+
import type { NavigationController } from './Navigation.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
controller: NavigationController;
|
|
5
|
+
tab: NavigationTab;
|
|
6
|
+
active: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { AsamControlSize } from '@asam-ui/ui';
|
|
3
|
+
import type { NavigationController } from './Navigation.js';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
controller: NavigationController;
|
|
6
|
+
size?: AsamControlSize;
|
|
7
|
+
headerTabs?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Slots = {
|
|
10
|
+
header?: () => VNode[];
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
13
|
+
focusActive: () => Promise<void>;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NavigationController } from './Navigation.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
controller: NavigationController;
|
|
4
|
+
inHeader?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function focusActive(): Promise<void>;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
8
|
+
focusActive: typeof focusActive;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavigationController } from './Navigation.js';
|
|
2
|
+
/** 自定义布局的公开页面出口;缓存身份与释放仍由同一导航控制器维护。 */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
controller: NavigationController;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { AsamI18n } from '@asam-ui/ui/i18n';
|
|
3
|
+
import type { Router, RouteLocationNormalizedLoaded, RouteLocationNormalized, RouteLocationRaw } from 'vue-router';
|
|
4
|
+
export interface NavigationItem {
|
|
5
|
+
id: string;
|
|
6
|
+
parentId?: string;
|
|
7
|
+
path: string;
|
|
8
|
+
/** Optional menu landing location for a parameterized route. */
|
|
9
|
+
location?: RouteLocationRaw;
|
|
10
|
+
title: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
resource: string;
|
|
13
|
+
cache?: boolean;
|
|
14
|
+
pinned?: boolean;
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
iframe?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface NavigationTab {
|
|
19
|
+
id: string;
|
|
20
|
+
routeId: string;
|
|
21
|
+
fullPath: string;
|
|
22
|
+
title: string;
|
|
23
|
+
cacheKey: string;
|
|
24
|
+
cache: boolean;
|
|
25
|
+
pinned: boolean;
|
|
26
|
+
epoch: number;
|
|
27
|
+
}
|
|
28
|
+
export type NavigationAction = 'navigate' | 'close' | 'refresh' | 'update';
|
|
29
|
+
export interface NavigationOptions {
|
|
30
|
+
/** Explicit component-language scope; omitted retains historical Chinese diagnostics. */
|
|
31
|
+
i18n?: AsamI18n;
|
|
32
|
+
router: Router;
|
|
33
|
+
/** Explicit allowlist. Remote strings never become import paths. */
|
|
34
|
+
components: Readonly<Record<string, Component>>;
|
|
35
|
+
load: (context: {
|
|
36
|
+
signal: AbortSignal;
|
|
37
|
+
scope: string;
|
|
38
|
+
}) => Promise<readonly NavigationItem[]>;
|
|
39
|
+
fallback: RouteLocationRaw;
|
|
40
|
+
scope?: string;
|
|
41
|
+
confirm?: (action: NavigationAction, from: RouteLocationNormalizedLoaded) => boolean | Promise<boolean>;
|
|
42
|
+
visible?: (item: Readonly<NavigationItem>) => boolean;
|
|
43
|
+
cacheKey?: (route: RouteLocationNormalized, item: Readonly<NavigationItem>) => string;
|
|
44
|
+
/** Number of retained page instances; default 10. */
|
|
45
|
+
maxCache?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface EmbedPolicy {
|
|
48
|
+
resolve: (input: string) => string;
|
|
49
|
+
allow: (url: URL) => boolean;
|
|
50
|
+
sandbox?: string;
|
|
51
|
+
permissions?: string;
|
|
52
|
+
referrerPolicy?: ReferrerPolicy;
|
|
53
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './Types.js';
|
|
2
|
+
export { createNavigation } from './Navigation.js';
|
|
3
|
+
export type { NavigationController } from './Navigation.js';
|
|
4
|
+
export { default as NavigationShell } from './NavigationShell.vue';
|
|
5
|
+
export { default as EmbedPage } from './EmbedPage.vue';
|
|
6
|
+
export { default as NavigationView } from './NavigationView.vue';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Scope, StorageAdapter, StorageStatus, Result } from './Types.js';
|
|
2
|
+
export interface CacheOptions<T> {
|
|
3
|
+
app: string;
|
|
4
|
+
owner: Scope;
|
|
5
|
+
scope: Scope;
|
|
6
|
+
storage?: StorageAdapter;
|
|
7
|
+
version: number;
|
|
8
|
+
ttl: number;
|
|
9
|
+
validate: (value: unknown) => value is T;
|
|
10
|
+
now?: () => number;
|
|
11
|
+
}
|
|
12
|
+
/** One envelope per scope; clear never enumerates or clears another owner's storage. */
|
|
13
|
+
export declare function createBusinessCache<T>(options: CacheOptions<T>): {
|
|
14
|
+
value: Readonly<import("vue").Ref<import("vue").DeepReadonly<T> | undefined, import("vue").DeepReadonly<T> | undefined>>;
|
|
15
|
+
status: Readonly<import("vue").Ref<StorageStatus, StorageStatus>>;
|
|
16
|
+
key: () => string;
|
|
17
|
+
read: (name: string) => Result<T>;
|
|
18
|
+
write: (name: string, data: T) => StorageStatus;
|
|
19
|
+
clear: () => "missing" | "unavailable" | "disposed";
|
|
20
|
+
reset: () => "missing" | "unavailable" | "disposed";
|
|
21
|
+
invalidate: () => "missing" | "unavailable" | "disposed";
|
|
22
|
+
switchScope(next: Scope): void;
|
|
23
|
+
remember(name: string, loader: () => Promise<T>): Promise<Result<T>>;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { AsamI18nOptions } from '@asam-ui/ui/i18n';
|
|
3
|
+
import type { PreferenceController } from './Preferences.js';
|
|
4
|
+
import type { PreferenceOptions } from './Types.js';
|
|
5
|
+
/** Bind component messages to the existing preference owner; never write its locale back. */
|
|
6
|
+
export declare function bindPreferencesI18n(preferences: Pick<PreferenceController, 'locale'>, options?: MaybeRefOrGetter<Omit<AsamI18nOptions, 'locale'> | undefined>): import("@asam-ui/ui").AsamI18n;
|
|
7
|
+
/** One owner for stored preferences and component scope; business dictionaries remain separate. */
|
|
8
|
+
export declare function createPreferencesI18n(options: PreferenceOptions, i18nOptions?: MaybeRefOrGetter<Omit<AsamI18nOptions, 'locale'> | undefined>): {
|
|
9
|
+
preferences: {
|
|
10
|
+
key: string;
|
|
11
|
+
locale: import("vue").ComputedRef<string>;
|
|
12
|
+
theme: import("vue").ComputedRef<import("./Types.js").ThemeChoice>;
|
|
13
|
+
colorMode: import("vue").ComputedRef<"light" | "dark">;
|
|
14
|
+
status: Readonly<import("vue").Ref<import("./Types.js").StorageStatus, import("./Types.js").StorageStatus>>;
|
|
15
|
+
issues: Readonly<import("vue").Ref<readonly string[], readonly string[]>>;
|
|
16
|
+
choose: (next: Partial<import("./Types.js").Preferences>) => boolean;
|
|
17
|
+
t: (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
18
|
+
number: (value: number, format?: Intl.NumberFormatOptions) => string;
|
|
19
|
+
date: (value: Date, format?: Intl.DateTimeFormatOptions) => string;
|
|
20
|
+
reset(): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
};
|
|
23
|
+
i18n: import("@asam-ui/ui").AsamI18n;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type LocaleLoadStatus = 'idle' | 'loading' | 'ready' | 'failed' | 'unsupported' | 'stale' | 'disposed';
|
|
2
|
+
export interface LocaleLoadResult {
|
|
3
|
+
readonly status: Exclude<LocaleLoadStatus, 'idle' | 'loading'>;
|
|
4
|
+
readonly locale: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LocaleLoaderOptions<Resource> {
|
|
7
|
+
/** Host allowlist; preferences dictionaries must contain each selectable language. */
|
|
8
|
+
readonly locales: readonly string[];
|
|
9
|
+
readonly load: (locale: string, context: {
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
}) => Promise<Resource>;
|
|
12
|
+
/** Synchronous host registration; no preference write occurs until registration succeeds. */
|
|
13
|
+
readonly register: (locale: string, resource: Resource) => void;
|
|
14
|
+
readonly choose: (locale: string) => boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Latest selection wins; the host supplies loading and registration, with no built-in network. */
|
|
17
|
+
export declare function createLocaleLoader<Resource>(options: LocaleLoaderOptions<Resource>): {
|
|
18
|
+
status: Readonly<import("vue").Ref<LocaleLoadStatus, LocaleLoadStatus>>;
|
|
19
|
+
requestedLocale: Readonly<import("vue").Ref<string | undefined, string | undefined>>;
|
|
20
|
+
choose: (locale: string) => Promise<LocaleLoadResult>;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PreferenceOptions, Preferences, ThemeChoice, StorageStatus } from './Types.js';
|
|
2
|
+
export declare function createPreferences(options: PreferenceOptions): {
|
|
3
|
+
key: string;
|
|
4
|
+
locale: import("vue").ComputedRef<string>;
|
|
5
|
+
theme: import("vue").ComputedRef<ThemeChoice>;
|
|
6
|
+
colorMode: import("vue").ComputedRef<"light" | "dark">;
|
|
7
|
+
status: Readonly<import("vue").Ref<StorageStatus, StorageStatus>>;
|
|
8
|
+
issues: Readonly<import("vue").Ref<readonly string[], readonly string[]>>;
|
|
9
|
+
choose: (next: Partial<Preferences>) => boolean;
|
|
10
|
+
t: (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
11
|
+
number: (value: number, format?: Intl.NumberFormatOptions) => string;
|
|
12
|
+
date: (value: Date, format?: Intl.DateTimeFormatOptions) => string;
|
|
13
|
+
reset(): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
};
|
|
16
|
+
export type PreferenceController = ReturnType<typeof createPreferences>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Scope, StorageAdapter, Result } from './Types.js';
|
|
2
|
+
/** JSON tuple preserves types and field boundaries. Undefined/nonfinite numbers are rejected. */
|
|
3
|
+
export declare function encodeScope(scope: Scope): string;
|
|
4
|
+
export declare function storageKey(app: string, kind: 'preferences' | 'business', owner: Scope, scope?: Scope): string;
|
|
5
|
+
export declare function memoryStorage(): StorageAdapter;
|
|
6
|
+
/** Access can itself throw (privacy mode); callers observe unavailable and continue in session. */
|
|
7
|
+
export declare function browserStorage(): StorageAdapter | undefined;
|
|
8
|
+
export declare function readJson(storage: StorageAdapter | undefined, key: string): Result<unknown>;
|
|
9
|
+
export declare function record(value: unknown): value is Record<string, unknown>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type ScopePart = string | number | null;
|
|
2
|
+
export type Scope = readonly ScopePart[];
|
|
3
|
+
export type ThemeChoice = 'light' | 'dark' | 'system';
|
|
4
|
+
export interface StorageAdapter {
|
|
5
|
+
getItem(key: string): string | null;
|
|
6
|
+
setItem(key: string, value: string): void;
|
|
7
|
+
removeItem(key: string): void;
|
|
8
|
+
}
|
|
9
|
+
export type StorageStatus = 'missing' | 'ok' | 'migrated' | 'invalid' | 'future' | 'expired' | 'unavailable' | 'disposed' | 'stale';
|
|
10
|
+
export interface Result<T> {
|
|
11
|
+
status: StorageStatus;
|
|
12
|
+
value?: T;
|
|
13
|
+
}
|
|
14
|
+
export interface Preferences {
|
|
15
|
+
locale: string;
|
|
16
|
+
theme: ThemeChoice;
|
|
17
|
+
}
|
|
18
|
+
export interface SystemTheme {
|
|
19
|
+
matches: boolean;
|
|
20
|
+
addEventListener(type: 'change', listener: (event: {
|
|
21
|
+
matches: boolean;
|
|
22
|
+
}) => void): void;
|
|
23
|
+
removeEventListener(type: 'change', listener: (event: {
|
|
24
|
+
matches: boolean;
|
|
25
|
+
}) => void): void;
|
|
26
|
+
}
|
|
27
|
+
export interface PreferenceOptions {
|
|
28
|
+
app: string;
|
|
29
|
+
owner: Scope;
|
|
30
|
+
storage?: StorageAdapter;
|
|
31
|
+
dictionaries: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
32
|
+
fallbackLocale: string;
|
|
33
|
+
initial?: Partial<Preferences>;
|
|
34
|
+
/** Explicit host policy, separate from initial defaults. */
|
|
35
|
+
force?: Partial<Preferences>;
|
|
36
|
+
system?: SystemTheme;
|
|
37
|
+
onIssue?: (issue: string) => void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { bindPreferencesI18n, createPreferencesI18n } from './I18n.js';
|
|
2
|
+
export { createLocaleLoader } from './LocaleLoader.js';
|
|
3
|
+
export type { LocaleLoadStatus, LocaleLoadResult, LocaleLoaderOptions } from './LocaleLoader.js';
|
|
4
|
+
export { browserStorage, memoryStorage, encodeScope, storageKey } from './Storage.js';
|
|
5
|
+
export { createPreferences } from './Preferences.js';
|
|
6
|
+
export type { PreferenceController } from './Preferences.js';
|
|
7
|
+
export { createBusinessCache } from './Cache.js';
|
|
8
|
+
export type { CacheOptions } from './Cache.js';
|
|
9
|
+
export type * from './Types.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, u as c } from "../../preferences-DgHizA2w.js";
|
|
2
|
+
export { n as bindPreferencesI18n, s as browserStorage, i as createBusinessCache, o as createLocaleLoader, a as createPreferences, e as createPreferencesI18n, t as encodeScope, r as memoryStorage, c as storageKey };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { AsamI18n } from '@asam-ui/ui/i18n';
|
|
3
|
+
import type { Router } from 'vue-router';
|
|
4
|
+
import type { NavigationItem } from '../navigation/Types.js';
|
|
5
|
+
import type { SecurityController } from './Security.js';
|
|
6
|
+
import type { SecurityRule } from './Types.js';
|
|
7
|
+
/** Public paths are explicit; all other paths require a rule, including direct history access. */
|
|
8
|
+
export declare function createSecurityNavigation(options: {
|
|
9
|
+
security: Pick<SecurityController, 'state' | 'check' | 'onInvalidate'>;
|
|
10
|
+
router: Router;
|
|
11
|
+
components: Readonly<Record<string, Component>>;
|
|
12
|
+
items: readonly NavigationItem[];
|
|
13
|
+
rules: Readonly<Record<string, SecurityRule>>;
|
|
14
|
+
publicPaths: readonly string[];
|
|
15
|
+
safePage: string;
|
|
16
|
+
i18n?: AsamI18n;
|
|
17
|
+
}): {
|
|
18
|
+
navigation: import("vue").ShallowRef<{
|
|
19
|
+
menu: Readonly<import("vue").ShallowRef<readonly NavigationItem[], readonly NavigationItem[]>>;
|
|
20
|
+
tabs: Readonly<import("vue").Ref<readonly {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly routeId: string;
|
|
23
|
+
readonly fullPath: string;
|
|
24
|
+
readonly title: string;
|
|
25
|
+
readonly cacheKey: string;
|
|
26
|
+
readonly cache: boolean;
|
|
27
|
+
readonly pinned: boolean;
|
|
28
|
+
readonly epoch: number;
|
|
29
|
+
}[], readonly {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly routeId: string;
|
|
32
|
+
readonly fullPath: string;
|
|
33
|
+
readonly title: string;
|
|
34
|
+
readonly cacheKey: string;
|
|
35
|
+
readonly cache: boolean;
|
|
36
|
+
readonly pinned: boolean;
|
|
37
|
+
readonly epoch: number;
|
|
38
|
+
}[]>>;
|
|
39
|
+
pages: import("vue").ComputedRef<import("../navigation/Types.js").NavigationTab[]>;
|
|
40
|
+
active: Readonly<import("vue").Ref<string, string>>;
|
|
41
|
+
error: import("vue").ComputedRef<string>;
|
|
42
|
+
errorDiagnostic: import("vue").ComputedRef<string>;
|
|
43
|
+
errorCode: Readonly<import("vue").Ref<"" | import("../../i18n/application/Resolve.js").ApplicationTextKey, "" | import("../../i18n/application/Resolve.js").ApplicationTextKey>>;
|
|
44
|
+
loading: Readonly<import("vue").Ref<boolean, boolean>>;
|
|
45
|
+
revision: Readonly<import("vue").Ref<number, number>>;
|
|
46
|
+
router: Router;
|
|
47
|
+
visibleMenu: import("vue").ComputedRef<NavigationItem[]>;
|
|
48
|
+
navigate: (target: import("vue-router").RouteLocationRaw, replace?: boolean) => Promise<boolean>;
|
|
49
|
+
reload: (nextScope?: string) => Promise<boolean>;
|
|
50
|
+
close: (ids: readonly string[]) => Promise<boolean>;
|
|
51
|
+
refresh: (id?: string) => Promise<boolean>;
|
|
52
|
+
move: (id: string, targetId: string) => void;
|
|
53
|
+
dispose: () => void;
|
|
54
|
+
closeOthers: () => Promise<boolean>;
|
|
55
|
+
closeAll: () => Promise<boolean>;
|
|
56
|
+
component: (id: string) => Component;
|
|
57
|
+
location: (id: string) => {
|
|
58
|
+
name: string;
|
|
59
|
+
};
|
|
60
|
+
} | null, {
|
|
61
|
+
menu: Readonly<import("vue").ShallowRef<readonly NavigationItem[], readonly NavigationItem[]>>;
|
|
62
|
+
tabs: Readonly<import("vue").Ref<readonly {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly routeId: string;
|
|
65
|
+
readonly fullPath: string;
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly cacheKey: string;
|
|
68
|
+
readonly cache: boolean;
|
|
69
|
+
readonly pinned: boolean;
|
|
70
|
+
readonly epoch: number;
|
|
71
|
+
}[], readonly {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly routeId: string;
|
|
74
|
+
readonly fullPath: string;
|
|
75
|
+
readonly title: string;
|
|
76
|
+
readonly cacheKey: string;
|
|
77
|
+
readonly cache: boolean;
|
|
78
|
+
readonly pinned: boolean;
|
|
79
|
+
readonly epoch: number;
|
|
80
|
+
}[]>>;
|
|
81
|
+
pages: import("vue").ComputedRef<import("../navigation/Types.js").NavigationTab[]>;
|
|
82
|
+
active: Readonly<import("vue").Ref<string, string>>;
|
|
83
|
+
error: import("vue").ComputedRef<string>;
|
|
84
|
+
errorDiagnostic: import("vue").ComputedRef<string>;
|
|
85
|
+
errorCode: Readonly<import("vue").Ref<"" | import("../../i18n/application/Resolve.js").ApplicationTextKey, "" | import("../../i18n/application/Resolve.js").ApplicationTextKey>>;
|
|
86
|
+
loading: Readonly<import("vue").Ref<boolean, boolean>>;
|
|
87
|
+
revision: Readonly<import("vue").Ref<number, number>>;
|
|
88
|
+
router: Router;
|
|
89
|
+
visibleMenu: import("vue").ComputedRef<NavigationItem[]>;
|
|
90
|
+
navigate: (target: import("vue-router").RouteLocationRaw, replace?: boolean) => Promise<boolean>;
|
|
91
|
+
reload: (nextScope?: string) => Promise<boolean>;
|
|
92
|
+
close: (ids: readonly string[]) => Promise<boolean>;
|
|
93
|
+
refresh: (id?: string) => Promise<boolean>;
|
|
94
|
+
move: (id: string, targetId: string) => void;
|
|
95
|
+
dispose: () => void;
|
|
96
|
+
closeOthers: () => Promise<boolean>;
|
|
97
|
+
closeAll: () => Promise<boolean>;
|
|
98
|
+
component: (id: string) => Component;
|
|
99
|
+
location: (id: string) => {
|
|
100
|
+
name: string;
|
|
101
|
+
};
|
|
102
|
+
} | null>;
|
|
103
|
+
/** Logout/expiry intentionally forget any previous protected destination. */
|
|
104
|
+
forgetReturn: () => void;
|
|
105
|
+
resume: (path: unknown) => void;
|
|
106
|
+
dispose: () => void;
|
|
107
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AsamI18n } from '@asam-ui/ui/i18n';
|
|
2
|
+
import type { SecurityAdapter, SecurityId, SecurityRule, SecurityScope, SecurityStatus, SecuritySubject } from './Types.js';
|
|
3
|
+
export declare const scopeKey: (subject: Pick<SecuritySubject, "id" | "scope">) => string;
|
|
4
|
+
/** One controller per application/SSR request. Host adapter owns all credentials. */
|
|
5
|
+
export declare function createSecurity<Credentials>(options: {
|
|
6
|
+
adapter: SecurityAdapter<Credentials>;
|
|
7
|
+
now?: () => number;
|
|
8
|
+
/** Explicit per-owner language binding; never changes authentication or storage. */
|
|
9
|
+
i18n?: AsamI18n;
|
|
10
|
+
}): {
|
|
11
|
+
state: Readonly<import("vue").Ref<{
|
|
12
|
+
readonly status: SecurityStatus;
|
|
13
|
+
readonly subject: {
|
|
14
|
+
readonly id: SecurityId;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly roles: readonly string[];
|
|
17
|
+
readonly permissions: readonly string[];
|
|
18
|
+
readonly scope: {
|
|
19
|
+
readonly tenant: SecurityId | null;
|
|
20
|
+
readonly organization: SecurityId | null;
|
|
21
|
+
};
|
|
22
|
+
readonly contexts: readonly {
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly tenant: SecurityId | null;
|
|
25
|
+
readonly organization: SecurityId | null;
|
|
26
|
+
}[];
|
|
27
|
+
readonly expiresAt: number;
|
|
28
|
+
readonly readOnly?: boolean | undefined;
|
|
29
|
+
} | null;
|
|
30
|
+
readonly error: string;
|
|
31
|
+
readonly errorDiagnostic?: string | undefined;
|
|
32
|
+
readonly errorCode?: import("./Types.js").SecurityErrorCode | undefined;
|
|
33
|
+
readonly epoch: number;
|
|
34
|
+
}, {
|
|
35
|
+
readonly status: SecurityStatus;
|
|
36
|
+
readonly subject: {
|
|
37
|
+
readonly id: SecurityId;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly roles: readonly string[];
|
|
40
|
+
readonly permissions: readonly string[];
|
|
41
|
+
readonly scope: {
|
|
42
|
+
readonly tenant: SecurityId | null;
|
|
43
|
+
readonly organization: SecurityId | null;
|
|
44
|
+
};
|
|
45
|
+
readonly contexts: readonly {
|
|
46
|
+
readonly label: string;
|
|
47
|
+
readonly tenant: SecurityId | null;
|
|
48
|
+
readonly organization: SecurityId | null;
|
|
49
|
+
}[];
|
|
50
|
+
readonly expiresAt: number;
|
|
51
|
+
readonly readOnly?: boolean | undefined;
|
|
52
|
+
} | null;
|
|
53
|
+
readonly error: string;
|
|
54
|
+
readonly errorDiagnostic?: string | undefined;
|
|
55
|
+
readonly errorCode?: import("./Types.js").SecurityErrorCode | undefined;
|
|
56
|
+
readonly epoch: number;
|
|
57
|
+
}>>;
|
|
58
|
+
check: (rule: SecurityRule) => "allowed" | "denied" | "pending" | "error";
|
|
59
|
+
permission: (permission: string) => "error" | "allowed" | "pending" | "denied";
|
|
60
|
+
login: (credentials: Credentials) => Promise<boolean>;
|
|
61
|
+
restore: () => Promise<boolean>;
|
|
62
|
+
refresh: () => Promise<boolean>;
|
|
63
|
+
switchContext: (scope: SecurityScope) => Promise<boolean>;
|
|
64
|
+
logout: () => Promise<boolean>;
|
|
65
|
+
expire: () => void;
|
|
66
|
+
reset: () => void;
|
|
67
|
+
onInvalidate: (listener: () => void) => () => boolean;
|
|
68
|
+
dispose: () => void;
|
|
69
|
+
};
|
|
70
|
+
export type SecurityController = ReturnType<typeof createSecurity<unknown>>;
|
|
71
|
+
/** Presentation-only label; machine status and session identity are unchanged. */
|
|
72
|
+
export declare function formatSecurityStatus(status: SecurityStatus, scope?: AsamI18n): string;
|
|
73
|
+
/** Only canonical application-relative paths; never use an untrusted redirect verbatim. */
|
|
74
|
+
export declare function safeReturnPath(input: unknown, fallback?: string): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type SecurityId = string | number;
|
|
2
|
+
export type SecurityErrorCode = 'cleanup' | 'authentication' | 'logout';
|
|
3
|
+
export interface SecurityScope {
|
|
4
|
+
tenant: SecurityId | null;
|
|
5
|
+
organization: SecurityId | null;
|
|
6
|
+
}
|
|
7
|
+
export interface SecurityContext extends SecurityScope {
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
/** Display-safe normalized backend result. Never include credentials or raw DTOs. */
|
|
11
|
+
export interface SecuritySubject {
|
|
12
|
+
id: SecurityId;
|
|
13
|
+
name: string;
|
|
14
|
+
roles: readonly string[];
|
|
15
|
+
permissions: readonly string[];
|
|
16
|
+
scope: SecurityScope;
|
|
17
|
+
contexts: readonly SecurityContext[];
|
|
18
|
+
expiresAt: number;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SecurityRequest {
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
/** False immediately after supersession, including synchronous abort/state/listener reentry.
|
|
24
|
+
* Host must also use this before committing credential/storage side effects. */
|
|
25
|
+
isCurrent: () => boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface SecurityAdapter<Credentials> {
|
|
28
|
+
login: (credentials: Credentials, request: SecurityRequest) => Promise<SecuritySubject>;
|
|
29
|
+
restore: (request: SecurityRequest) => Promise<SecuritySubject | null>;
|
|
30
|
+
refresh: (subject: SecuritySubject, request: SecurityRequest) => Promise<SecuritySubject>;
|
|
31
|
+
switchContext: (subject: SecuritySubject, scope: SecurityScope, request: SecurityRequest) => Promise<SecuritySubject>;
|
|
32
|
+
logout: (request: SecurityRequest) => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export type SecurityStatus = 'anonymous' | 'restoring' | 'authenticating' | 'refreshing' | 'switching' | 'authenticated' | 'expired' | 'error' | 'logging-out' | 'disposed';
|
|
35
|
+
export interface SecurityState {
|
|
36
|
+
status: SecurityStatus;
|
|
37
|
+
subject: SecuritySubject | null;
|
|
38
|
+
/** Fixed local message, never the adapter's exception text. */
|
|
39
|
+
error: string;
|
|
40
|
+
/** Original local diagnostic is separate from the scope-bound display getter. */
|
|
41
|
+
errorDiagnostic?: string;
|
|
42
|
+
errorCode?: SecurityErrorCode;
|
|
43
|
+
epoch: number;
|
|
44
|
+
}
|
|
45
|
+
export interface SecurityRule {
|
|
46
|
+
permission?: string;
|
|
47
|
+
role?: string;
|
|
48
|
+
write?: boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AsamI18n } from '@asam-ui/ui/i18n';
|
|
2
|
+
import type { ClientOptions, ErrorKind, RequestClient, SafeError } from './Types.js';
|
|
3
|
+
/** 应用适配器用有限分类报告错误,不接受原始业务消息或 cause。 */
|
|
4
|
+
export declare class TransportFault extends Error {
|
|
5
|
+
readonly kind: ErrorKind;
|
|
6
|
+
constructor(kind: ErrorKind);
|
|
7
|
+
}
|
|
8
|
+
export declare class RequestFailure extends Error implements SafeError {
|
|
9
|
+
readonly kind: ErrorKind;
|
|
10
|
+
readonly traceId: string;
|
|
11
|
+
constructor(kind: ErrorKind, traceId: string);
|
|
12
|
+
}
|
|
13
|
+
/** Translate only known local error classes. Host and server messages are never interpreted. */
|
|
14
|
+
export declare function formatRequestFailure(error: {
|
|
15
|
+
readonly message: string;
|
|
16
|
+
}, scope?: AsamI18n): string;
|
|
17
|
+
export declare function createRequestClient(options: ClientOptions): RequestClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RequestClient, RequestInput, RequestOptions } from './Types.js';
|
|
2
|
+
/** 每个消费容器独立创建。旧响应不能写当前 UI,卸载 dispose 后不可复用。 */
|
|
3
|
+
export declare function createLatestRequest<T>(client: RequestClient, commit: (data: T) => void): {
|
|
4
|
+
load(input: RequestInput, options: RequestOptions<T>): Promise<T>;
|
|
5
|
+
cancel(): void;
|
|
6
|
+
dispose(): void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AsamDataProvider } from '@asam-ui/ui';
|
|
2
|
+
import type { RequestClient } from './Types.js';
|
|
3
|
+
/** request 返回业务 data。组件 transform 只映射选项/分页,不再解 HTTP/业务包。 */
|
|
4
|
+
export declare function createTransportProvider(client: RequestClient, unwrap?: (body: unknown) => unknown): AsamDataProvider;
|