@vcmap/ui 6.0.0-rc.3 → 6.0.0-rc.6
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/build/buildHelpers.js +60 -11
- package/build/buildTypes.js +9 -5
- package/build/bundle.js +1 -1
- package/build/info/publish.js +25 -31
- package/build/lintTypes.js +5 -0
- package/config/base.config.json +2 -7
- package/config/dev.config.json +11 -1
- package/config/projects.config.json +2 -1
- package/config/theming.config.json +68 -0
- package/config/www.config.json +27 -23
- package/dist/assets/@mdi/font/css/{materialdesignicons.min-7a4f6be0.css → materialdesignicons.min-680621ca.css} +1 -1
- package/dist/assets/{cesium-cb4dbfba.js → cesium-ccb4cc30.js} +272 -385
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core-72f21835.js → core-e06aa7a6.js} +2313 -2321
- package/dist/assets/core.js +1 -1
- package/dist/assets/{ol-2d33bc8b.js → ol-e7981d5c.js} +233 -329
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui-5dda32d2.css +1 -0
- package/dist/assets/{ui-2ab43a16.js → ui-5dda32d2.js} +11344 -11078
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue-87bc6efe.js +6083 -0
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-760ced3b.css → vuetify-4c4e4217.css} +2 -2
- package/dist/assets/{vuetify-760ced3b.js → vuetify-4c4e4217.js} +8063 -8262
- package/dist/assets/vuetify.js +1 -1
- package/index.d.ts +27 -17
- package/index.js +16 -8
- package/package.json +17 -17
- package/plugins/@vcmap-show-case/custom-icons-example/README.md +3 -0
- package/plugins/@vcmap-show-case/custom-icons-example/assets/imageExample.png +0 -0
- package/plugins/@vcmap-show-case/custom-icons-example/assets/svgExample.svg +1 -0
- package/plugins/@vcmap-show-case/custom-icons-example/package.json +5 -0
- package/plugins/@vcmap-show-case/custom-icons-example/src/CustomIconsExample.vue +90 -0
- package/plugins/@vcmap-show-case/custom-icons-example/src/index.js +45 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +2 -3
- package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +11 -7
- package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +18 -11
- package/plugins/@vcmap-show-case/search-example/src/index.js +1 -0
- package/plugins/@vcmap-show-case/search-example/src/searchImpl.js +35 -5
- package/plugins/@vcmap-show-case/theming-example/README.md +3 -0
- package/plugins/@vcmap-show-case/theming-example/package.json +5 -0
- package/plugins/@vcmap-show-case/theming-example/src/ThemingExample.vue +116 -0
- package/plugins/@vcmap-show-case/theming-example/src/index.js +53 -0
- package/plugins/@vcmap-show-case/toolbox-example/src/index.js +2 -1
- package/plugins/package.json +7 -23
- package/public/assets/@mdi/font/css/materialdesignicons.min.css +1 -1
- package/src/actions/StyleSelector.vue +1 -1
- package/src/actions/actionHelper.d.ts +4 -11
- package/src/actions/actionHelper.js +15 -7
- package/src/actions/listActions.d.ts +5 -5
- package/src/actions/listActions.js +2 -2
- package/src/application/VcsApp.vue +113 -50
- package/src/application/VcsApp.vue.d.ts +301 -4
- package/src/application/VcsAttributionsFooter.vue.d.ts +1 -1
- package/src/application/VcsContainer.vue +27 -10
- package/src/application/VcsContainer.vue.d.ts +241 -0
- package/src/application/VcsMainMap.vue +7 -7
- package/src/application/VcsMainMap.vue.d.ts +2 -2
- package/src/application/VcsNavbar.vue +14 -2
- package/src/application/VcsNavbar.vue.d.ts +1 -0
- package/src/application/VcsSplashScreen.vue +33 -26
- package/src/application/VcsTextPageFooter.vue +2 -1
- package/src/application/attributionsHelper.d.ts +20 -22
- package/src/application/attributionsHelper.js +4 -4
- package/src/callback/vcsCallback.d.ts +2 -2
- package/src/callback/vcsCallback.js +1 -1
- package/src/components/buttons/VcsActionButtonList.vue +61 -6
- package/src/components/buttons/VcsActionButtonList.vue.d.ts +28 -0
- package/src/components/buttons/VcsButton.vue +2 -4
- package/src/components/buttons/VcsButton.vue.d.ts +1 -1
- package/src/components/buttons/VcsFormButton.vue +4 -4
- package/src/components/buttons/VcsToolButton.vue +4 -2
- package/src/components/buttons/VcsToolButton.vue.d.ts +2 -2
- package/src/components/composables.d.ts +5 -0
- package/src/components/composables.js +79 -9
- package/src/components/extent/VcsExtent.vue +10 -6
- package/src/components/extent/VcsExtent.vue.d.ts +1 -0
- package/src/components/flight/VcsFlightComponent.vue +13 -13
- package/src/components/flight/VcsFlightComponent.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +8 -3
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +13 -16
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +2 -4
- package/src/components/form-inputs-controls/VcsCoordinate.vue +4 -4
- package/src/components/form-inputs-controls/VcsFileInput.vue +1 -1
- package/src/components/form-inputs-controls/VcsLabel.vue +1 -1
- package/src/components/form-inputs-controls/VcsRadio.vue +8 -6
- package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +1 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +2 -5
- package/src/components/form-inputs-controls/VcsSlider.vue +5 -6
- package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +2 -4
- package/src/components/form-inputs-controls/VcsTextArea.vue +2 -5
- package/src/components/form-inputs-controls/VcsTextField.vue +24 -1
- package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +11 -1
- package/src/components/form-inputs-controls/VcsWizard.vue +3 -3
- package/src/components/form-inputs-controls/VcsWizardStep.vue +6 -5
- package/src/components/form-inputs-controls/vcsTextField.scss +8 -5
- package/src/components/form-output/VcsFormattedNumber.vue +7 -5
- package/src/components/form-output/VcsMarkdown.vue +15 -12
- package/src/components/form-output/VcsMarkdown.vue.d.ts +1 -0
- package/src/components/form-output/markdownHelper.d.ts +30 -0
- package/src/components/form-output/markdownHelper.js +398 -0
- package/src/components/import/VcsFileDrop.vue +8 -5
- package/src/components/import/VcsImportComponent.vue +8 -4
- package/src/components/import/VcsImportComponent.vue.d.ts +1 -2
- package/src/components/lists/VcsActionList.vue +6 -6
- package/src/components/lists/VcsList.vue +22 -37
- package/src/components/lists/VcsList.vue.d.ts +14 -55
- package/src/components/lists/{VcsListItem.vue → VcsListItemComponent.vue} +37 -11
- package/src/components/lists/VcsListItemComponent.vue.d.ts +79 -0
- package/src/components/lists/VcsTreeview.vue +95 -26
- package/src/components/lists/VcsTreeview.vue.d.ts +16 -3
- package/src/components/lists/VcsTreeviewSearchbar.vue +16 -5
- package/src/components/lists/VcsTreeviewSearchbar.vue.d.ts +3 -1
- package/src/components/lists/VcsTreeviewTitle.vue +36 -0
- package/src/components/modelHelper.d.ts +10 -8
- package/src/components/modelHelper.js +8 -6
- package/src/components/notification/VcsHelp.vue +6 -7
- package/src/components/notification/VcsHelp.vue.d.ts +0 -8
- package/src/components/plugins/AbstractConfigEditor.vue +1 -22
- package/src/components/plugins/AbstractConfigEditor.vue.d.ts +6 -29
- package/src/components/section/VcsExpansionPanel.vue +9 -3
- package/src/components/section/VcsExpansionPanel.vue.d.ts +2 -2
- package/src/components/section/VcsFormSection.vue +13 -7
- package/src/components/section/VcsFormSection.vue.d.ts +2 -3
- package/src/components/style/VcsImageSelector.vue +14 -6
- package/src/components/style/VcsImageSelector.vue.d.ts +1 -0
- package/src/components/style/VcsStrokeSelector.vue +5 -2
- package/src/components/style/VcsStrokeSelector.vue.d.ts +1 -0
- package/src/components/style/VcsTextMenu.vue +3 -3
- package/src/components/style/VcsVectorStyleComponent.vue +1 -1
- package/src/components/tables/VcsDataTable.vue +42 -32
- package/src/components/tables/VcsDataTable.vue.d.ts +1 -0
- package/src/components/tables/VcsTable.vue +45 -62
- package/src/components/tables/VcsTable.vue.d.ts +30 -17
- package/src/components/tables/VcsTableCell.vue +72 -0
- package/src/components/tables/VcsTableCell.vue.d.ts +13 -0
- package/src/components/vector-properties/VcsFeatureEditingWindow.vue +6 -5
- package/src/components/vector-properties/VcsFeatureTransforms.vue +5 -0
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +42 -31
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue.d.ts +1 -0
- package/src/components/viewpoint/VcsViewpointComponent.vue +14 -11
- package/src/components/viewpoint/VcsViewpointComponent.vue.d.ts +1 -0
- package/src/components/viewpoint/VcsViewpointEditor.vue +2 -2
- package/src/contentTree/LayerTree.vue +9 -27
- package/src/contentTree/LayerTree.vue.d.ts +1 -1
- package/src/contentTree/contentTreeCollection.d.ts +1 -0
- package/src/contentTree/contentTreeCollection.js +45 -11
- package/src/contentTree/contentTreeItem.d.ts +2 -2
- package/src/contentTree/contentTreeItem.js +1 -1
- package/src/featureInfo/BalloonComponent.vue +32 -25
- package/src/featureInfo/BalloonComponent.vue.d.ts +1 -0
- package/src/featureInfo/MarkdownBalloonComponent.vue +4 -2
- package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +2 -2
- package/src/featureInfo/abstractFeatureInfoView.d.ts +10 -4
- package/src/featureInfo/abstractFeatureInfoView.js +19 -11
- package/src/featureInfo/featureInfo.d.ts +7 -7
- package/src/featureInfo/featureInfo.js +51 -31
- package/src/featureInfo/iframeFeatureInfoView.d.ts +8 -2
- package/src/featureInfo/iframeFeatureInfoView.js +15 -5
- package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +1 -1
- package/src/featureInfo/markdownBalloonFeatureInfoView.js +5 -5
- package/src/featureInfo/markdownFeatureInfoView.d.ts +1 -1
- package/src/featureInfo/markdownFeatureInfoView.js +9 -11
- package/src/featureInfo/tableFeatureInfoView.js +13 -4
- package/src/i18n/i18nCollection.d.ts +9 -15
- package/src/i18n/i18nCollection.js +3 -3
- package/src/legend/VcsLegend.vue +6 -2
- package/src/legend/VcsLegend.vue.d.ts +1 -0
- package/src/manager/collectionManager/CollectionComponentList.vue +2 -2
- package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +2 -2
- package/src/manager/collectionManager/categoryManager.d.ts +1 -1
- package/src/manager/collectionManager/collectionComponentClass.d.ts +3 -3
- package/src/manager/collectionManager/collectionComponentClass.js +6 -6
- package/src/manager/collectionManager/collectionManager.d.ts +1 -1
- package/src/manager/collectionManager/editorCollectionComponentClass.js +2 -1
- package/src/manager/panel/PanelComponent.vue +2 -9
- package/src/manager/panel/PanelManagerComponent.vue +7 -3
- package/src/manager/panel/panelHelper.js +3 -3
- package/src/manager/panel/panelManager.d.ts +9 -1
- package/src/manager/panel/panelManager.js +15 -3
- package/src/manager/toolbox/GroupToolboxComponent.vue +11 -5
- package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +1 -0
- package/src/manager/toolbox/SelectToolboxComponent.vue +11 -6
- package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +1 -0
- package/src/manager/toolbox/{ToolboxManager.vue → ToolboxManagerComponent.vue} +13 -7
- package/src/manager/toolbox/{ToolboxManager.vue.d.ts → ToolboxManagerComponent.vue.d.ts} +1 -0
- package/src/manager/window/WindowComponent.vue +12 -8
- package/src/manager/window/WindowComponentHeader.vue +33 -9
- package/src/manager/window/WindowComponentHeader.vue.d.ts +3 -0
- package/src/manager/window/WindowManager.vue +2 -2
- package/src/manager/window/windowManager.d.ts +6 -6
- package/src/manager/window/windowManager.js +3 -3
- package/src/navigation/MapNavigation.vue +20 -0
- package/src/navigation/OrientationToolsButton.vue +2 -4
- package/src/navigation/TiltSlider.vue +3 -5
- package/src/navigation/locatorHelper.js +1 -1
- package/src/navigation/overviewMap.js +1 -1
- package/src/notifier/NotifierComponent.vue +18 -15
- package/src/search/ResultItem.vue +18 -6
- package/src/search/ResultsComponent.vue +31 -20
- package/src/search/ResultsComponent.vue.d.ts +2 -1
- package/src/search/SearchComponent.vue +11 -15
- package/src/search/SearchComponent.vue.d.ts +1 -0
- package/src/siteConfig.js +8 -8
- package/src/styles/_typography.scss +0 -2
- package/src/styles/main.scss +0 -4
- package/src/styles/vcsList.scss +1 -1
- package/src/uiConfig.d.ts +311 -7
- package/src/uiConfig.js +30 -17
- package/src/vcsUiApp.d.ts +48 -63
- package/src/vcsUiApp.js +44 -37
- package/src/vuePlugins/vuetify.d.ts +88 -62
- package/src/vuePlugins/vuetify.js +119 -20
- package/dist/assets/ui-2ab43a16.css +0 -1
- package/dist/assets/vue-03b265aa.js +0 -6096
- package/plugins/@vcmap-show-case/theme-changer/README.md +0 -23
- package/plugins/@vcmap-show-case/theme-changer/config.json +0 -69
- package/plugins/@vcmap-show-case/theme-changer/package.json +0 -11
- package/plugins/@vcmap-show-case/theme-changer/src/ThemeChangerComponent.vue +0 -120
- package/plugins/@vcmap-show-case/theme-changer/src/index.js +0 -108
- package/src/application/markdownHelper.d.ts +0 -12
- package/src/application/markdownHelper.js +0 -70
- package/src/components/lists/VcsListItem.vue.d.ts +0 -27
- package/src/components/lists/VcsTreeviewLeaf.vue +0 -83
- package/src/components/notification/VcsTooltip.vue +0 -156
- package/src/components/notification/VcsTooltip.vue.d.ts +0 -27
- package/src/featureInfo/MarkdownComponent.vue +0 -16
- package/src/featureInfo/MarkdownComponent.vue.d.ts +0 -7
- package/src/styles/_theming.scss +0 -73
- package/src/styles/settings.scss +0 -6
- package/src/styles/shades.scss +0 -4
- package/src/styles/variables.scss +0 -140
- package/src/styles/vcsFont.scss +0 -2
- package/src/styles/vcsGrid.scss +0 -3
- /package/src/components/lists/{VcsTreeviewLeaf.vue.d.ts → VcsTreeviewTitle.vue.d.ts} +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* @param {import("vue").Ref<VcsListItem[]>} items
|
3
|
-
* @param {import("vue").ShallowRef<VcsListItem[]>} selected
|
2
|
+
* @param {import("vue").Ref<import("./VcsListItemComponent.vue").VcsListItem[]>} items
|
3
|
+
* @param {import("vue").ShallowRef<import("./VcsListItemComponent.vue").VcsListItem[]>} selected
|
4
4
|
* @param {function(string, ...any[]):void} emit
|
5
5
|
* @returns {Array<import("../../actions/actionHelper.js").VcsAction>}
|
6
6
|
*/
|
7
|
-
export function createSelectionActions(items: import("vue").Ref<VcsListItem[]>, selected: import("vue").ShallowRef<VcsListItem[]>, emit: (arg0: string, ...args: any[][]) => void): Array<import("../../actions/actionHelper.js").VcsAction>;
|
7
|
+
export function createSelectionActions(items: import("vue").Ref<import("./VcsListItemComponent.vue").VcsListItem[]>, selected: import("vue").ShallowRef<import("./VcsListItemComponent.vue").VcsListItem[]>, emit: (arg0: string, ...args: any[][]) => void): Array<import("../../actions/actionHelper.js").VcsAction>;
|
8
8
|
declare const _default: import("vue").DefineComponent<{
|
9
9
|
items: {
|
10
10
|
type: ArrayConstructor;
|
@@ -76,26 +76,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
76
76
|
*/
|
77
77
|
renderingActions: import("vue").ComputedRef<Array<import("../../actions/actionHelper.js").VcsAction>>;
|
78
78
|
/**
|
79
|
-
* @type {import("vue").ComputedRef<Array<VcsListItem>>}
|
79
|
+
* @type {import("vue").ComputedRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>}
|
80
80
|
*/
|
81
|
-
renderingItems: import("vue").ComputedRef<Array<VcsListItem>>;
|
82
|
-
/** @type {import("vue").ShallowRef<Array<VcsListItem>>} */
|
83
|
-
selected: import("vue").ShallowRef<Array<VcsListItem>>;
|
81
|
+
renderingItems: import("vue").ComputedRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>;
|
82
|
+
/** @type {import("vue").ShallowRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>} */
|
83
|
+
selected: import("vue").ShallowRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>;
|
84
84
|
/**
|
85
|
-
* @param {import("vue").UnwrapNestedRef<VcsListItem>} item
|
85
|
+
* @param {import("vue").UnwrapNestedRef<import("./VcsListItemComponent.vue").VcsListItem>} item
|
86
86
|
* @param {PointerEvent} event
|
87
87
|
*/
|
88
88
|
select(item: any, event: PointerEvent): void;
|
89
89
|
/**
|
90
|
-
* @param {import("vue").UnwrapNestedRefs<VcsListItem>} item
|
90
|
+
* @param {import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>} item
|
91
91
|
*/
|
92
|
-
add(item: import("vue").UnwrapNestedRefs<VcsListItem>): void;
|
92
|
+
add(item: import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>): void;
|
93
93
|
/**
|
94
|
-
* @param {import("vue").UnwrapNestedRefs<VcsListItem>} item
|
94
|
+
* @param {import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>} item
|
95
95
|
*/
|
96
|
-
remove(item: import("vue").UnwrapNestedRefs<VcsListItem>): void;
|
96
|
+
remove(item: import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>): void;
|
97
97
|
clear(): void;
|
98
|
-
drag: (e: MouseEvent, item: VcsListItem, index: number) => void;
|
98
|
+
drag: (e: MouseEvent, item: import("./VcsListItemComponent.vue").VcsListItem, index: number) => void;
|
99
99
|
drop: (e: MouseEvent, targetIndex: number) => void;
|
100
100
|
listHeader: import("vue").Ref<any>;
|
101
101
|
listHeaderTooltip: import("vue").ComputedRef<string>;
|
@@ -173,48 +173,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
173
173
|
showTitle: boolean;
|
174
174
|
}, {}>;
|
175
175
|
export default _default;
|
176
|
-
export type VcsListItem = {
|
177
|
-
name: string;
|
178
|
-
/**
|
179
|
-
* - Whether to display this item or not.
|
180
|
-
*/
|
181
|
-
visible?: boolean | undefined;
|
182
|
-
/**
|
183
|
-
* - Whether this item should be displayed as disabled.
|
184
|
-
*/
|
185
|
-
disabled?: boolean | undefined;
|
186
|
-
/**
|
187
|
-
* - Whether the title of can be edited. will add a rename action to the end of the action list. This action will call titleChanged with the new title, you must provide the callback yourself, otherwise this does not work as expeted.
|
188
|
-
*/
|
189
|
-
renamable?: boolean | import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).ActionOptions | undefined;
|
190
|
-
/**
|
191
|
-
* - The title to be displayed
|
192
|
-
*/
|
193
|
-
title: string;
|
194
|
-
tooltip?: string | undefined;
|
195
|
-
/**
|
196
|
-
* - An optional icon to display with this item. Can be a URL or HTMLElement.
|
197
|
-
*/
|
198
|
-
icon?: string | HTMLCanvasElement | HTMLImageElement | undefined;
|
199
|
-
/**
|
200
|
-
* - Shows badge, if item has an update.
|
201
|
-
*/
|
202
|
-
hasUpdate?: boolean | undefined;
|
203
|
-
actions?: import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).VcsAction[] | undefined;
|
204
|
-
/**
|
205
|
-
* - An array of callbacks called on item click. called before selection update
|
206
|
-
*/
|
207
|
-
clickedCallbacks?: Array<(arg0: PointerEvent) => void> | undefined;
|
208
|
-
/**
|
209
|
-
* - A callback called if the selection changes with the current selection status. called before value update
|
210
|
-
*/
|
211
|
-
selectionChanged?: ((arg0: boolean) => void) | undefined;
|
212
|
-
/**
|
213
|
-
* - A callback called if the title changes via rename action. only usable with renamble true.
|
214
|
-
*/
|
215
|
-
titleChanged?: ((arg0: string) => void) | undefined;
|
216
|
-
};
|
217
176
|
export type ItemMovedEvent = {
|
218
|
-
item: VcsListItem;
|
177
|
+
item: import("./VcsListItemComponent.vue").VcsListItem;
|
219
178
|
targetIndex: number;
|
220
179
|
};
|
@@ -12,8 +12,24 @@
|
|
12
12
|
import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
|
13
13
|
import { createEllipseTooltip } from '../composables.js';
|
14
14
|
|
15
|
+
/**
|
16
|
+
* @typedef {Object} VcsListItem
|
17
|
+
* @property {string} name
|
18
|
+
* @property {boolean} [visible] - Whether to display this item or not.
|
19
|
+
* @property {boolean} [disabled] - Whether this item should be displayed as disabled.
|
20
|
+
* @property {boolean|import("../../actions/actionHelper.js").ActionOptions} [renamable] - Whether the title of can be edited. will add a rename action to the end of the action list. This action will call titleChanged with the new title, you must provide the callback yourself, otherwise this does not work as expeted.
|
21
|
+
* @property {string} title - The title to be displayed
|
22
|
+
* @property {string} [tooltip]
|
23
|
+
* @property {string|HTMLCanvasElement|HTMLImageElement|undefined} [icon] - An optional icon to display with this item. Can be a URL or HTMLElement.
|
24
|
+
* @property {boolean} [hasUpdate] - Shows badge, if item has an update.
|
25
|
+
* @property {Array<import("../../actions/actionHelper.js").VcsAction>} [actions]
|
26
|
+
* @property {Array<function(PointerEvent):void>|undefined} [clickedCallbacks] - An array of callbacks called on item click. called before selection update
|
27
|
+
* @property {function(boolean):void} [selectionChanged] - A callback called if the selection changes with the current selection status. called before value update
|
28
|
+
* @property {function(string):void} [titleChanged] - A callback called if the title changes via rename action. only usable with renamble true.
|
29
|
+
*/
|
30
|
+
|
15
31
|
const props = defineProps({
|
16
|
-
/** @type {
|
32
|
+
/** @type {VcsListItem} */
|
17
33
|
item: {
|
18
34
|
type: Object,
|
19
35
|
required: true,
|
@@ -111,16 +127,26 @@
|
|
111
127
|
<template #default="scope">
|
112
128
|
<slot name="default" v-bind="{ ...scope, item, dragging, tooltip }" />
|
113
129
|
</template>
|
114
|
-
<template #append>
|
115
|
-
<
|
116
|
-
|
117
|
-
v-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
130
|
+
<template #append="appendScope">
|
131
|
+
<slot
|
132
|
+
name="append"
|
133
|
+
v-bind="{
|
134
|
+
...appendScope,
|
135
|
+
item,
|
136
|
+
actions,
|
137
|
+
actionButtonListOverflowCount,
|
138
|
+
}"
|
139
|
+
>
|
140
|
+
<vcs-badge v-if="item.hasUpdate" class="mr-1" />
|
141
|
+
<vcs-action-button-list
|
142
|
+
v-if="actions.length > 0"
|
143
|
+
:actions="actions"
|
144
|
+
:disabled="item.disabled"
|
145
|
+
:block-overflow="true"
|
146
|
+
:overflow-count="actionButtonListOverflowCount"
|
147
|
+
class="ml-2"
|
148
|
+
/>
|
149
|
+
</slot>
|
124
150
|
</template>
|
125
151
|
</v-list-item>
|
126
152
|
</template>
|
@@ -0,0 +1,79 @@
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly [x: string]: any;
|
4
|
+
};
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
|
6
|
+
title?(_: {
|
7
|
+
item: any;
|
8
|
+
dragging: any;
|
9
|
+
tooltip: string;
|
10
|
+
}): any;
|
11
|
+
subtitle?(_: {
|
12
|
+
item: any;
|
13
|
+
}): any;
|
14
|
+
default?(_: {
|
15
|
+
item: any;
|
16
|
+
dragging: any;
|
17
|
+
tooltip: string;
|
18
|
+
isActive: boolean;
|
19
|
+
isOpen: boolean;
|
20
|
+
isSelected: boolean;
|
21
|
+
isIndeterminate: boolean;
|
22
|
+
select: (value: boolean) => void;
|
23
|
+
}): any;
|
24
|
+
append?(_: {
|
25
|
+
item: any;
|
26
|
+
actions: any[];
|
27
|
+
actionButtonListOverflowCount: any;
|
28
|
+
isActive: boolean;
|
29
|
+
isOpen: boolean;
|
30
|
+
isSelected: boolean;
|
31
|
+
isIndeterminate: boolean;
|
32
|
+
select: (value: boolean) => void;
|
33
|
+
}): any;
|
34
|
+
}>;
|
35
|
+
export default _default;
|
36
|
+
export type VcsListItem = {
|
37
|
+
name: string;
|
38
|
+
/**
|
39
|
+
* - Whether to display this item or not.
|
40
|
+
*/
|
41
|
+
visible?: boolean | undefined;
|
42
|
+
/**
|
43
|
+
* - Whether this item should be displayed as disabled.
|
44
|
+
*/
|
45
|
+
disabled?: boolean | undefined;
|
46
|
+
/**
|
47
|
+
* - Whether the title of can be edited. will add a rename action to the end of the action list. This action will call titleChanged with the new title, you must provide the callback yourself, otherwise this does not work as expeted.
|
48
|
+
*/
|
49
|
+
renamable?: boolean | Omit<import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).VcsAction, "callback"> | undefined;
|
50
|
+
/**
|
51
|
+
* - The title to be displayed
|
52
|
+
*/
|
53
|
+
title: string;
|
54
|
+
tooltip?: string | undefined;
|
55
|
+
/**
|
56
|
+
* - An optional icon to display with this item. Can be a URL or HTMLElement.
|
57
|
+
*/
|
58
|
+
icon?: string | HTMLCanvasElement | HTMLImageElement | undefined;
|
59
|
+
/**
|
60
|
+
* - Shows badge, if item has an update.
|
61
|
+
*/
|
62
|
+
hasUpdate?: boolean | undefined;
|
63
|
+
actions?: import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).VcsAction[] | undefined;
|
64
|
+
/**
|
65
|
+
* - An array of callbacks called on item click. called before selection update
|
66
|
+
*/
|
67
|
+
clickedCallbacks?: Array<(arg0: PointerEvent) => void> | undefined;
|
68
|
+
/**
|
69
|
+
* - A callback called if the selection changes with the current selection status. called before value update
|
70
|
+
*/
|
71
|
+
selectionChanged?: ((arg0: boolean) => void) | undefined;
|
72
|
+
/**
|
73
|
+
* - A callback called if the title changes via rename action. only usable with renamble true.
|
74
|
+
*/
|
75
|
+
titleChanged?: ((arg0: string) => void) | undefined;
|
76
|
+
};
|
77
|
+
type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
78
|
+
$slots: S;
|
79
|
+
});
|
@@ -3,26 +3,55 @@
|
|
3
3
|
<VcsTreeviewSearchbar
|
4
4
|
v-if="showSearchbar"
|
5
5
|
:placeholder="searchbarPlaceholder"
|
6
|
-
v-model="
|
6
|
+
v-model="localSearchValue"
|
7
7
|
/>
|
8
8
|
<v-treeview
|
9
9
|
class="vcs-treeview"
|
10
|
-
|
10
|
+
density="compact"
|
11
11
|
item-value="name"
|
12
12
|
:item-props="true"
|
13
|
-
:search="search"
|
14
13
|
:custom-filter="handleFilter"
|
15
14
|
:selectable="false"
|
16
15
|
:activatable="false"
|
16
|
+
expand-icon="mdi-chevron-right"
|
17
|
+
collapse-icon="mdi-chevron-down"
|
18
|
+
v-bind="{ ...$props, ...$attrs }"
|
19
|
+
:search="localSearchValue"
|
17
20
|
>
|
18
|
-
<template #
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
<template #title="scope">
|
22
|
+
<slot name="title" v-bind="scope ?? {}">
|
23
|
+
<VcsTreeviewTitle :item="scope.item"></VcsTreeviewTitle>
|
24
|
+
</slot>
|
25
|
+
</template>
|
26
|
+
<template v-for="slot of forwardSlots" #[slot]="scope">
|
27
|
+
<slot :name="slot" v-bind="scope ?? {}" />
|
28
|
+
</template>
|
29
|
+
<template #prepend="scope">
|
30
|
+
<slot name="prepend" v-bind="scope ?? {}">
|
31
|
+
<template v-if="scope.item?.icon">
|
32
|
+
<v-icon
|
33
|
+
v-if="typeof scope.item?.icon === 'string'"
|
34
|
+
:size="iconSize"
|
35
|
+
>
|
36
|
+
{{ scope.item.icon }}
|
37
|
+
</v-icon>
|
38
|
+
<ImageElementInjector :element="scope.item.icon" v-else />
|
39
|
+
</template>
|
40
|
+
</slot>
|
23
41
|
</template>
|
24
|
-
<template #
|
25
|
-
|
42
|
+
<template #append="scope">
|
43
|
+
<slot name="append" v-bind="scope ?? {}">
|
44
|
+
<VcsActionButtonList
|
45
|
+
v-if="scope.item.actions?.length > 0"
|
46
|
+
:actions="scope.item.actions"
|
47
|
+
:overflow-count="3"
|
48
|
+
:disabled="scope.item.disabled"
|
49
|
+
right
|
50
|
+
tooltip-position="right"
|
51
|
+
block-overflow
|
52
|
+
class="col-4 pa-0 d-flex align-center"
|
53
|
+
/>
|
54
|
+
</slot>
|
26
55
|
</template>
|
27
56
|
</v-treeview>
|
28
57
|
</div>
|
@@ -32,7 +61,8 @@
|
|
32
61
|
// Root Level Entries should be 40px high
|
33
62
|
> .v-list-item,
|
34
63
|
> .v-list-group > .v-list-item {
|
35
|
-
min-height: calc(var(--v-vcs-
|
64
|
+
min-height: calc(var(--v-vcs-font-size) * 2 + 14px) !important;
|
65
|
+
padding-left: 6px;
|
36
66
|
}
|
37
67
|
// Border around root nodes with children included
|
38
68
|
> .v-list-item:not(:last-child),
|
@@ -46,17 +76,32 @@
|
|
46
76
|
> .v-list-item-title {
|
47
77
|
font-weight: 700 !important;
|
48
78
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
79
|
+
}
|
80
|
+
|
81
|
+
// leaf indent
|
82
|
+
:deep(.v-list--slim .v-treeview-group.v-list-group) {
|
83
|
+
--prepend-width: 0px;
|
84
|
+
}
|
85
|
+
|
86
|
+
// Padding left of root nodes
|
87
|
+
:deep(.v-list-item__prepend) {
|
88
|
+
width: var(--v-vcs-font-size);
|
89
|
+
margin-right: 8px;
|
90
|
+
> .v-list-item-action > .v-btn {
|
91
|
+
width: var(--v-vcs-font-size);
|
92
|
+
height: var(--v-vcs-font-size);
|
93
|
+
margin: auto;
|
58
94
|
}
|
59
95
|
}
|
96
|
+
|
97
|
+
// remove hover shadow over button
|
98
|
+
:deep(.v-btn__overlay) {
|
99
|
+
--v-hover-opacity: 0;
|
100
|
+
}
|
101
|
+
// remove ripple effect
|
102
|
+
:deep(.v-ripple__container) {
|
103
|
+
display: none;
|
104
|
+
}
|
60
105
|
// hide active class
|
61
106
|
:deep(.v-list-item__overlay) {
|
62
107
|
display: none;
|
@@ -68,26 +113,40 @@
|
|
68
113
|
</style>
|
69
114
|
|
70
115
|
<script>
|
71
|
-
import { getCurrentInstance
|
116
|
+
import { getCurrentInstance } from 'vue';
|
117
|
+
import { VIcon } from 'vuetify/components';
|
72
118
|
import { VTreeview } from 'vuetify/labs/VTreeview';
|
119
|
+
import { useProxiedAtomicModel } from '../modelHelper.js';
|
120
|
+
import { useForwardSlots } from '../composables.js';
|
73
121
|
import VcsTreeviewSearchbar from './VcsTreeviewSearchbar.vue';
|
74
|
-
import
|
122
|
+
import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
|
123
|
+
import ImageElementInjector from '../ImageElementInjector.vue';
|
124
|
+
import VcsTreeviewTitle from './VcsTreeviewTitle.vue';
|
125
|
+
import { useIconSize } from '../../vuePlugins/vuetify.js';
|
75
126
|
|
76
127
|
/**
|
77
128
|
* @description extends API of https://vuetifyjs.com/en/api/v-treeview/
|
78
129
|
* Can render dynamic components as leaf items.
|
79
130
|
* In order to display an item needs to be registered and added to `availableComponents`.
|
131
|
+
* Exposes the `search` value for filtering the treeview.
|
80
132
|
* @vue-prop {boolean} [showSearchbar=false] - Whether there is a searchbar for this treeview
|
81
133
|
* @vue-prop {string} [searchbarPlaceholder] - Placeholder text for the searchbar, will be translated
|
82
134
|
*/
|
83
135
|
export default {
|
84
136
|
name: 'VcsTreeview',
|
85
137
|
components: {
|
86
|
-
|
138
|
+
VcsTreeviewTitle,
|
139
|
+
VIcon,
|
140
|
+
ImageElementInjector,
|
141
|
+
VcsActionButtonList,
|
87
142
|
VcsTreeviewSearchbar,
|
88
143
|
VTreeview,
|
89
144
|
},
|
90
145
|
props: {
|
146
|
+
search: {
|
147
|
+
type: String,
|
148
|
+
default: '',
|
149
|
+
},
|
91
150
|
showSearchbar: {
|
92
151
|
type: Boolean,
|
93
152
|
default: false,
|
@@ -97,8 +156,10 @@
|
|
97
156
|
default: undefined,
|
98
157
|
},
|
99
158
|
},
|
100
|
-
|
101
|
-
|
159
|
+
emits: ['update:search'],
|
160
|
+
setup(props, { emit, slots }) {
|
161
|
+
const localSearchValue = useProxiedAtomicModel(props, 'search', emit);
|
162
|
+
|
102
163
|
// TODO properly type the tree view item interface & export in index.d.ts
|
103
164
|
|
104
165
|
const vm = getCurrentInstance().proxy;
|
@@ -118,9 +179,17 @@
|
|
118
179
|
.indexOf(q.toLocaleLowerCase());
|
119
180
|
};
|
120
181
|
|
182
|
+
const forwardSlots = useForwardSlots(slots, [
|
183
|
+
'append',
|
184
|
+
'title',
|
185
|
+
'prepend',
|
186
|
+
]);
|
187
|
+
const iconSize = useIconSize();
|
121
188
|
return {
|
122
|
-
|
189
|
+
iconSize,
|
190
|
+
localSearchValue,
|
123
191
|
handleFilter,
|
192
|
+
forwardSlots,
|
124
193
|
};
|
125
194
|
},
|
126
195
|
};
|
@@ -1,4 +1,8 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
2
|
+
search: {
|
3
|
+
type: StringConstructor;
|
4
|
+
default: string;
|
5
|
+
};
|
2
6
|
showSearchbar: {
|
3
7
|
type: BooleanConstructor;
|
4
8
|
default: boolean;
|
@@ -8,9 +12,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
8
12
|
default: undefined;
|
9
13
|
};
|
10
14
|
}, {
|
11
|
-
|
15
|
+
iconSize: import("vue").ComputedRef<number>;
|
16
|
+
localSearchValue: import("vue").Ref<any>;
|
12
17
|
handleFilter: (value: string, q: string, item: Object) => number;
|
13
|
-
|
18
|
+
forwardSlots: import("vue").ComputedRef<string[]>;
|
19
|
+
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:search"[], "update:search", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
20
|
+
search: {
|
21
|
+
type: StringConstructor;
|
22
|
+
default: string;
|
23
|
+
};
|
14
24
|
showSearchbar: {
|
15
25
|
type: BooleanConstructor;
|
16
26
|
default: boolean;
|
@@ -19,7 +29,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
19
29
|
type: StringConstructor;
|
20
30
|
default: undefined;
|
21
31
|
};
|
22
|
-
}
|
32
|
+
}>> & {
|
33
|
+
"onUpdate:search"?: ((...args: any[]) => any) | undefined;
|
34
|
+
}, {
|
35
|
+
search: string;
|
23
36
|
showSearchbar: boolean;
|
24
37
|
searchbarPlaceholder: string;
|
25
38
|
}, {}>;
|
@@ -3,20 +3,22 @@
|
|
3
3
|
class="pa-2 bg-base-lighten-3 position-relative d-flex flex-row justify-space-between align-center rounded-0"
|
4
4
|
>
|
5
5
|
<slot name="prepend">
|
6
|
-
<v-icon class="search-icon my-0 ml-1" size="
|
6
|
+
<v-icon class="search-icon my-0 ml-1" :size="iconSize - 4">
|
7
|
+
$vcsSearch
|
8
|
+
</v-icon>
|
7
9
|
</slot>
|
8
10
|
|
9
11
|
<slot v-bind="{ ...$props, attrs: $attrs }">
|
10
12
|
<VcsTextField
|
11
13
|
class="searchbar outlined rounded-xl align-center justify-center base-lighten-4 pa-1 pl-6"
|
12
14
|
:placeholder="$st(placeholder)"
|
13
|
-
v-bind="$attrs"
|
14
15
|
clearable
|
16
|
+
v-bind="$attrs"
|
15
17
|
/>
|
16
18
|
</slot>
|
17
19
|
|
18
20
|
<slot name="append" :has-filter="hasFilter">
|
19
|
-
<v-icon v-if="hasFilter" class="ml-2" size="
|
21
|
+
<v-icon v-if="hasFilter" class="ml-2" :size="iconSize">$vcsFilter</v-icon>
|
20
22
|
</slot>
|
21
23
|
</div>
|
22
24
|
</template>
|
@@ -48,7 +50,9 @@
|
|
48
50
|
> .v-field__field
|
49
51
|
> .v-field__input
|
50
52
|
) {
|
51
|
-
--v-input-control-height: calc(
|
53
|
+
--v-input-control-height: calc(
|
54
|
+
var(--v-vcs-font-size) * 2 - 14px
|
55
|
+
) !important;
|
52
56
|
min-height: var(--v-input-control-height);
|
53
57
|
}
|
54
58
|
|
@@ -66,7 +70,7 @@
|
|
66
70
|
// override primary--placeholder of VcsTextField
|
67
71
|
:deep(input::placeholder) {
|
68
72
|
color: rgb(var(--v-theme-base-lighten-1)) !important;
|
69
|
-
font-style:
|
73
|
+
font-style: italic !important;
|
70
74
|
opacity: 0.75 !important;
|
71
75
|
}
|
72
76
|
</style>
|
@@ -74,6 +78,7 @@
|
|
74
78
|
<script>
|
75
79
|
import { VIcon } from 'vuetify/components';
|
76
80
|
import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
|
81
|
+
import { useIconSize } from '../../vuePlugins/vuetify.js';
|
77
82
|
|
78
83
|
/**
|
79
84
|
* @description stylized searchbar used in VcsTreeview, VcsDataTable and VcsList
|
@@ -100,5 +105,11 @@
|
|
100
105
|
default: false,
|
101
106
|
},
|
102
107
|
},
|
108
|
+
setup() {
|
109
|
+
const iconSize = useIconSize();
|
110
|
+
return {
|
111
|
+
iconSize,
|
112
|
+
};
|
113
|
+
},
|
103
114
|
};
|
104
115
|
</script>
|
@@ -7,7 +7,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
7
7
|
type: BooleanConstructor;
|
8
8
|
default: boolean;
|
9
9
|
};
|
10
|
-
},
|
10
|
+
}, {
|
11
|
+
iconSize: import("vue").ComputedRef<number>;
|
12
|
+
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
11
13
|
placeholder: {
|
12
14
|
type: StringConstructor;
|
13
15
|
default: string;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<script setup>
|
2
|
+
import { computed, ref } from 'vue';
|
3
|
+
import { VTooltip } from 'vuetify/components';
|
4
|
+
import { createEllipseTooltip } from '../composables.js';
|
5
|
+
|
6
|
+
const props = defineProps({
|
7
|
+
item: {
|
8
|
+
type: Object,
|
9
|
+
default: undefined,
|
10
|
+
},
|
11
|
+
});
|
12
|
+
|
13
|
+
const titleParent = ref();
|
14
|
+
|
15
|
+
const tooltip = createEllipseTooltip(
|
16
|
+
computed(() => titleParent.value),
|
17
|
+
computed(() => props.item.tooltip),
|
18
|
+
computed(() => props.item.title || props.item.name),
|
19
|
+
);
|
20
|
+
</script>
|
21
|
+
<style lang="scss" scoped>
|
22
|
+
.title-parent {
|
23
|
+
overflow: hidden;
|
24
|
+
text-overflow: ellipsis;
|
25
|
+
}
|
26
|
+
</style>
|
27
|
+
<template>
|
28
|
+
<div class="title-parent pr-2" ref="titleParent">
|
29
|
+
<span>
|
30
|
+
{{ $st(item.title || item.name) }}
|
31
|
+
</span>
|
32
|
+
<v-tooltip v-if="tooltip" activator="parent">
|
33
|
+
{{ $st(tooltip) }}
|
34
|
+
</v-tooltip>
|
35
|
+
</div>
|
36
|
+
</template>
|
@@ -4,25 +4,27 @@
|
|
4
4
|
* getter returns the internal value
|
5
5
|
* setter updates internal value and emits the update event
|
6
6
|
* simplified based on https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/proxiedModel.ts
|
7
|
-
* @param {
|
8
|
-
* @param {
|
9
|
-
* @param {(event: string
|
7
|
+
* @param {{ [k in P]: string extends P ? unknown : T }} props
|
8
|
+
* @param {P} prop
|
9
|
+
* @param {(event: string extends P ? P : `update:${P}`, value: T) => void} emit
|
10
10
|
* @returns {import("vue").Ref<import("vue").UnwrapRef<T>>}
|
11
11
|
* @template T
|
12
|
+
* @template {string} [P=string]
|
12
13
|
*/
|
13
|
-
export function useProxiedAtomicModel<T>(props:
|
14
|
+
export function useProxiedAtomicModel<T, P extends string = string>(props: { [k in P]: string extends P ? unknown : T; }, prop: P, emit: (event: string extends P ? P : `update:${P}`, value: T) => void): import("vue").Ref<import("vue").UnwrapRef<T>>;
|
14
15
|
/**
|
15
16
|
* Can only be used in setup of Vue components!
|
16
17
|
* Provides a ref model for complex properties.
|
17
18
|
* Watches changes on the provided prop and updates the internal ref
|
18
19
|
* Watches changes on the internal ref and emits the change, if prop has not already been updated
|
19
|
-
* @param {
|
20
|
-
* @param {
|
21
|
-
* @param {(event: string
|
20
|
+
* @param {{ [k in P]: string extends P ? unknown : T }} props
|
21
|
+
* @param {P} prop
|
22
|
+
* @param {(event: string extends P ? P : `update:${P}`, value: T) => void} emit
|
22
23
|
* @returns {import("vue").Ref<import("vue").UnwrapRef<T>>}
|
23
24
|
* @template T
|
25
|
+
* @template {string} [P=string]
|
24
26
|
*/
|
25
|
-
export function useProxiedComplexModel<T>(props:
|
27
|
+
export function useProxiedComplexModel<T, P extends string = string>(props: { [k in P]: string extends P ? unknown : T; }, prop: P, emit: (event: string extends P ? P : `update:${P}`, value: T) => void): import("vue").Ref<import("vue").UnwrapRef<T>>;
|
26
28
|
/**
|
27
29
|
* Helper function that returns a modelValue for VcsCheckbox depending on the availability of a specific property within a model object
|
28
30
|
* Getter returns true, if property is available, otherwise false.
|
@@ -8,11 +8,12 @@ import { getLogger } from '@vcsuite/logger';
|
|
8
8
|
* getter returns the internal value
|
9
9
|
* setter updates internal value and emits the update event
|
10
10
|
* simplified based on https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/proxiedModel.ts
|
11
|
-
* @param {
|
12
|
-
* @param {
|
13
|
-
* @param {(event: string
|
11
|
+
* @param {{ [k in P]: string extends P ? unknown : T }} props
|
12
|
+
* @param {P} prop
|
13
|
+
* @param {(event: string extends P ? P : `update:${P}`, value: T) => void} emit
|
14
14
|
* @returns {import("vue").Ref<import("vue").UnwrapRef<T>>}
|
15
15
|
* @template T
|
16
|
+
* @template {string} [P=string]
|
16
17
|
*/
|
17
18
|
export function useProxiedAtomicModel(props, prop, emit) {
|
18
19
|
const internal = ref(props[prop]);
|
@@ -43,11 +44,12 @@ export function useProxiedAtomicModel(props, prop, emit) {
|
|
43
44
|
* Provides a ref model for complex properties.
|
44
45
|
* Watches changes on the provided prop and updates the internal ref
|
45
46
|
* Watches changes on the internal ref and emits the change, if prop has not already been updated
|
46
|
-
* @param {
|
47
|
-
* @param {
|
48
|
-
* @param {(event: string
|
47
|
+
* @param {{ [k in P]: string extends P ? unknown : T }} props
|
48
|
+
* @param {P} prop
|
49
|
+
* @param {(event: string extends P ? P : `update:${P}`, value: T) => void} emit
|
49
50
|
* @returns {import("vue").Ref<import("vue").UnwrapRef<T>>}
|
50
51
|
* @template T
|
52
|
+
* @template {string} [P=string]
|
51
53
|
*/
|
52
54
|
export function useProxiedComplexModel(props, prop, emit) {
|
53
55
|
const internal = ref(structuredClone(toRaw(props[prop])));
|