@synopackageland/ui 0.4.2 → 0.5.3
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/README.md +21 -0
- package/dist/components/advanced-panel/AdvancePanelColumns.vue.d.ts +19 -0
- package/dist/components/advanced-panel/AdvancePanelForm.vue.d.ts +21 -0
- package/dist/components/advanced-panel/AdvancePanelGrid.vue.d.ts +44 -0
- package/dist/components/advanced-panel/types.d.ts +50 -0
- package/dist/components/app/app-action-bar/AppActionBar.vue.d.ts +13 -3
- package/dist/components/app/app-layout/AppLayout.vue.d.ts +1 -1
- package/dist/components/app/app-sidebar/AppSidebar.vue.d.ts +12 -13
- package/dist/components/app/app-sidebar/AppSidebarItems.vue.d.ts +17 -0
- package/dist/components/app/app-sidebar/types.d.ts +16 -0
- package/dist/components/app/section-tabs/SectionTabs.vue.d.ts +11 -1
- package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +78 -0
- package/dist/components/composite/about-dialog/types.d.ts +6 -0
- package/dist/components/composite/callout/Callout.vue.d.ts +12 -2
- package/dist/components/composite/config-provider/ConfigProvider.vue.d.ts +19 -0
- package/dist/components/composite/copy-cut-field/CopyCutField.vue.d.ts +44 -0
- package/dist/components/composite/data-grid/DataGrid.vue.d.ts +150 -25
- package/dist/components/composite/data-grid/labels.d.ts +15 -1
- package/dist/components/composite/data-view/DataView.vue.d.ts +54 -0
- package/dist/components/composite/footbar/Footbar.vue.d.ts +13 -0
- package/dist/components/composite/footbar/FootbarButtons.vue.d.ts +13 -0
- package/dist/components/composite/footbar/types.d.ts +32 -0
- package/dist/components/composite/form/Form.vue.d.ts +49 -0
- package/dist/components/composite/form/FormItem.vue.d.ts +132 -0
- package/dist/components/composite/form/context.d.ts +61 -0
- package/dist/components/composite/form/rules.d.ts +17 -0
- package/dist/components/composite/form/types.d.ts +50 -0
- package/dist/components/composite/message-box/MessageBox.vue.d.ts +34 -0
- package/dist/components/composite/message-box/MessageBoxProvider.vue.d.ts +13 -0
- package/dist/components/composite/message-box/controller.d.ts +20 -0
- package/dist/components/composite/message-box/types.d.ts +97 -0
- package/dist/components/composite/overflow-list/OverflowList.vue.d.ts +40 -0
- package/dist/components/composite/overflow-list/OverflowListItem.vue.d.ts +18 -0
- package/dist/components/composite/overflow-toolbar/OverflowToolbar.vue.d.ts +46 -0
- package/dist/components/composite/overflow-toolbar/overflow.d.ts +25 -0
- package/dist/components/composite/overflow-toolbar/types.d.ts +27 -0
- package/dist/components/composite/settings-section/SettingsSection.vue.d.ts +18 -3
- package/dist/components/composite/tree-view/TreeView.vue.d.ts +64 -12
- package/dist/components/composite/tree-view/treeUtils.d.ts +15 -0
- package/dist/components/composite/tree-view/types.d.ts +38 -0
- package/dist/components/composite/virtual-list/VirtualList.vue.d.ts +44 -0
- package/dist/components/composite/wizard/Wizard.vue.d.ts +68 -0
- package/dist/components/composite/wizard/WizardStep.vue.d.ts +20 -0
- package/dist/components/composite/wizard/types.d.ts +32 -0
- package/dist/components/composite/wizard/wizardContext.d.ts +17 -0
- package/dist/components/containers/card/Card.vue.d.ts +42 -0
- package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +79 -0
- package/dist/components/containers/fieldset/Fieldset.vue.d.ts +58 -0
- package/dist/components/containers/highlight-box/HighlightBox.vue.d.ts +23 -0
- package/dist/components/containers/panel/Panel.vue.d.ts +59 -0
- package/dist/components/feedback/info-mask/InfoMask.vue.d.ts +22 -0
- package/dist/components/feedback/info-tip/InfoTip.vue.d.ts +53 -0
- package/dist/components/feedback/notification/Notification.vue.d.ts +50 -0
- package/dist/components/feedback/notification/NotificationProvider.vue.d.ts +36 -0
- package/dist/components/feedback/notification/notification.d.ts +45 -0
- package/dist/components/feedback/validation-popup/ValidationPopup.vue.d.ts +41 -0
- package/dist/components/primitives/affix/Affix.vue.d.ts +40 -0
- package/dist/components/primitives/affix/affixPosition.d.ts +35 -0
- package/dist/components/primitives/breadcrumb/Breadcrumb.vue.d.ts +38 -0
- package/dist/components/primitives/breadcrumb/BreadcrumbCrumb.vue.d.ts +13 -0
- package/dist/components/primitives/breadcrumb/collapse.d.ts +25 -0
- package/dist/components/primitives/breadcrumb/types.d.ts +14 -0
- package/dist/components/primitives/color-picker/ColorPicker.vue.d.ts +70 -0
- package/dist/components/primitives/color-picker/palette.d.ts +2 -0
- package/dist/components/primitives/combobox/Combobox.vue.d.ts +33 -0
- package/dist/components/primitives/date-picker/DatePicker.vue.d.ts +39 -1
- package/dist/components/primitives/date-picker/dateTime.d.ts +44 -0
- package/dist/components/primitives/dialog/Dialog.vue.d.ts +6 -3
- package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +18 -13
- package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +20 -0
- package/dist/components/primitives/dropdown-menu/types.d.ts +38 -0
- package/dist/components/primitives/ghost/Ghost.vue.d.ts +30 -0
- package/dist/components/primitives/icon/Icon.vue.d.ts +40 -0
- package/dist/components/primitives/icon/icon.d.ts +19 -0
- package/dist/components/primitives/icon/iconRegistry.d.ts +9 -0
- package/dist/components/primitives/icon/useIconButton.d.ts +30 -0
- package/dist/components/primitives/input/Input.vue.d.ts +6 -0
- package/dist/components/primitives/input/Textarea.vue.d.ts +6 -0
- package/dist/components/primitives/input-steppers/InputSteppers.vue.d.ts +60 -0
- package/dist/components/primitives/layout/Col.vue.d.ts +24 -0
- package/dist/components/primitives/layout/Grid.vue.d.ts +35 -0
- package/dist/components/primitives/layout/Row.vue.d.ts +23 -0
- package/dist/components/primitives/layout/breakpoints.d.ts +24 -0
- package/dist/components/primitives/layout/context.d.ts +22 -0
- package/dist/components/primitives/layout/gap.d.ts +12 -0
- package/dist/components/primitives/multiple-select/MultipleSelect.vue.d.ts +32 -0
- package/dist/components/primitives/pagination/Pagination.vue.d.ts +111 -0
- package/dist/components/primitives/pagination/labels.d.ts +18 -0
- package/dist/components/primitives/pagination/model.d.ts +13 -0
- package/dist/components/primitives/progress/Progress.vue.d.ts +2 -0
- package/dist/components/primitives/rich-text/RichText.vue.d.ts +57 -0
- package/dist/components/primitives/rich-text/parseRichText.d.ts +31 -0
- package/dist/components/primitives/schedule-table/ScheduleTable.vue.d.ts +65 -0
- package/dist/components/primitives/schedule-table/schedule.d.ts +55 -0
- package/dist/components/primitives/scrollbar/Scrollbar.vue.d.ts +110 -0
- package/dist/components/primitives/scrollbar/types.d.ts +10 -0
- package/dist/components/primitives/segment-control/SegmentControl.vue.d.ts +32 -0
- package/dist/components/primitives/segment-control/SegmentItem.vue.d.ts +32 -0
- package/dist/components/primitives/segment-control/context.d.ts +19 -0
- package/dist/components/primitives/select/Select.vue.d.ts +15 -1
- package/dist/components/primitives/select/internal/ComboboxField.vue.d.ts +46 -0
- package/dist/components/primitives/select/internal/SelectTag.vue.d.ts +15 -0
- package/dist/components/primitives/select/internal/options.d.ts +17 -0
- package/dist/components/primitives/select/internal/types.d.ts +43 -0
- package/dist/components/primitives/select/internal/useSelectSearch.d.ts +20 -0
- package/dist/components/primitives/sheet/Sheet.vue.d.ts +3 -3
- package/dist/components/primitives/skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/components/primitives/slider/Slider.vue.d.ts +56 -0
- package/dist/components/primitives/space/Space.vue.d.ts +27 -0
- package/dist/components/primitives/space/space.d.ts +10 -0
- package/dist/components/primitives/superbox-select/SuperboxSelect.vue.d.ts +33 -0
- package/dist/components/primitives/tag/Tag.vue.d.ts +59 -0
- package/dist/components/primitives/toggle-button/ToggleButton.vue.d.ts +43 -0
- package/dist/components/primitives/toggle-button/ToggleButtonGroup.vue.d.ts +38 -0
- package/dist/components/primitives/toggle-button/toggleButton.d.ts +9 -0
- package/dist/components/primitives/tooltip/Tooltip.vue.d.ts +3 -0
- package/dist/components/primitives/typography/TypoA.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoBlockquote.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoCode.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoDivider.vue.d.ts +3 -0
- package/dist/components/primitives/typography/TypoHeader.vue.d.ts +32 -0
- package/dist/components/primitives/typography/TypoHr.vue.d.ts +3 -0
- package/dist/components/primitives/typography/TypoLi.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoList.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoP.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoTable.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoText.vue.d.ts +26 -0
- package/dist/components/primitives/typography/TypoTip.vue.d.ts +21 -0
- package/dist/components/primitives/typography/typography.d.ts +12 -0
- package/dist/composables/configCascade.d.ts +42 -0
- package/dist/composables/tabIndicator.d.ts +18 -0
- package/dist/index.d.ts +122 -2
- package/dist/index.js +22765 -10938
- package/dist/lib/controllable.d.ts +19 -0
- package/dist/lib/numberField.d.ts +24 -0
- package/dist/lib/overflow.d.ts +13 -0
- package/dist/reka-runtime.json +5 -3
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/app-local-modal.md +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FormFieldHandle } from './context';
|
|
2
|
+
export type ValidateTrigger = 'blur' | 'change';
|
|
3
|
+
export type ValidateStatus = '' | 'success' | 'error' | 'warning' | 'validating';
|
|
4
|
+
/** How a failed rule message is surfaced: a floating hint or text below the field. */
|
|
5
|
+
export type ValidateMessageDisplayMode = 'popup' | 'text';
|
|
6
|
+
/** FormItem-level value: `'form'` inherits the enclosing form's mode. */
|
|
7
|
+
export type FormItemValidateMessageDisplayMode = ValidateMessageDisplayMode | 'form';
|
|
8
|
+
export type FormDirection = 'horizontal' | 'vertical';
|
|
9
|
+
export type FormSpacing = 'none' | 'dense' | 'compact' | 'regular' | 'relaxed' | number | 'auto';
|
|
10
|
+
export type FormRuleType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'email' | 'url' | 'date';
|
|
11
|
+
export type FormRuleCallback = (error?: Error | string | void) => void;
|
|
12
|
+
/**
|
|
13
|
+
* One validation rule. A rule may be asynchronous: return a promise from
|
|
14
|
+
* `validator`, reject it, or resolve it with an error message; the callback
|
|
15
|
+
* form still works and wins when it is called.
|
|
16
|
+
*/
|
|
17
|
+
export type FormRule = {
|
|
18
|
+
/** Marks the value as mandatory. `false` is a present value, not an empty one. */
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/** Message used when this rule fails; built-in defaults are English. */
|
|
21
|
+
message?: string;
|
|
22
|
+
/** When the rule runs on its own; falls back to FormItem's `defaultValidateTrigger`. Explicit `validate()` calls always run every rule. */
|
|
23
|
+
trigger?: ValidateTrigger | ValidateTrigger[];
|
|
24
|
+
/** Custom check. Called with `(rule, value, callback)` like async-validator. */
|
|
25
|
+
validator?: (rule: FormRule, value: unknown, callback: FormRuleCallback) => unknown;
|
|
26
|
+
/** Promise-flavoured custom check; `validator` wins when both are set. */
|
|
27
|
+
asyncValidator?: (rule: FormRule, value: unknown, callback: FormRuleCallback) => unknown;
|
|
28
|
+
pattern?: RegExp;
|
|
29
|
+
type?: FormRuleType;
|
|
30
|
+
/** Minimum length (string/array) or value (number/date). */
|
|
31
|
+
min?: number;
|
|
32
|
+
/** Maximum length (string/array) or value (number/date). */
|
|
33
|
+
max?: number;
|
|
34
|
+
/** Exact length (string/array). */
|
|
35
|
+
len?: number;
|
|
36
|
+
/** Allowed values. */
|
|
37
|
+
enum?: readonly unknown[];
|
|
38
|
+
/** Normalises the value before the built-in checks run. */
|
|
39
|
+
transform?: (value: unknown) => unknown;
|
|
40
|
+
};
|
|
41
|
+
export type FormRules = Record<string, FormRule | FormRule[]>;
|
|
42
|
+
export type FormValidateError = {
|
|
43
|
+
error: string | undefined;
|
|
44
|
+
field: FormFieldHandle;
|
|
45
|
+
};
|
|
46
|
+
export type FormValidatedResult = {
|
|
47
|
+
valid: boolean;
|
|
48
|
+
errResults: FormValidateError[];
|
|
49
|
+
};
|
|
50
|
+
export type { FormFieldHandle };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MessageBoxKind, MessageBoxOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* One app-local message box. It is fully controlled: it never closes itself,
|
|
4
|
+
* it emits `settle` with the button id (or typed value) the user chose and the
|
|
5
|
+
* host removes it. See `types.ts` for the awaited API.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
kind: MessageBoxKind;
|
|
10
|
+
title?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
options?: MessageBoxOptions;
|
|
13
|
+
phrase?: string;
|
|
14
|
+
progress?: {
|
|
15
|
+
percent: number;
|
|
16
|
+
info?: string;
|
|
17
|
+
percentText?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
settle: (value: unknown) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onSettle?: ((value: unknown) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
progress: {
|
|
26
|
+
percent: number;
|
|
27
|
+
info?: string;
|
|
28
|
+
percentText?: string;
|
|
29
|
+
};
|
|
30
|
+
open: boolean;
|
|
31
|
+
options: MessageBoxOptions;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import('vue').DefineComponent<{}, import('./types').MessageBox, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { MessageBox, MessageBoxRequest } from './types';
|
|
3
|
+
export type MessageBoxHost = {
|
|
4
|
+
box: MessageBox;
|
|
5
|
+
requests: Ref<MessageBoxRequest[]>;
|
|
6
|
+
settle: (id: number, value: unknown) => void;
|
|
7
|
+
dispose: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type { LostChangeResult, MessageBox, MessageBoxButtonId, MessageBoxHandler, MessageBoxKind, MessageBoxOptions, MessageBoxPromptOptions, MessageBoxTextResult, MessageBoxTone, MessageBoxVerify, ProgressResult, } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Owns the queue of active app-local message boxes. `MessageBoxProvider` renders
|
|
12
|
+
* the queue and calls `settle` with the button id or typed value a box resolved.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMessageBoxHost(): MessageBoxHost;
|
|
15
|
+
/** The awaitable dialog API. Call it in `setup()`; a `MessageBoxProvider` must be an ancestor. */
|
|
16
|
+
export declare function useDialog(): MessageBox;
|
|
17
|
+
/** Alias of `useDialog()` that names the message-box family explicitly. */
|
|
18
|
+
export declare function useMessageBox(): MessageBox;
|
|
19
|
+
/** Registers `host.dispose` for the component that owns the host. */
|
|
20
|
+
export declare function useMessageBoxHost(): MessageBoxHost;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Fixed message-box flows. Every flow is an app-local modal dialog; none of
|
|
4
|
+
* them creates a DSM window or a draggable frame.
|
|
5
|
+
*/
|
|
6
|
+
export type MessageBoxKind = 'alert' | 'confirm' | 'confirmDelete' | 'confirmLostChange' | 'prompt' | 'password' | 'progress' | 'wait';
|
|
7
|
+
/**
|
|
8
|
+
* Result of a box without a custom handler. It is a button id, never a
|
|
9
|
+
* boolean: `if (result)` is always true, compare with `=== 'confirm'`.
|
|
10
|
+
*/
|
|
11
|
+
export type MessageBoxButtonId = 'confirm' | 'cancel' | 'leftCustom';
|
|
12
|
+
/** Discriminated result of the unsaved-change flow. */
|
|
13
|
+
export type LostChangeResult = 'save' | 'dont_save' | 'cancel';
|
|
14
|
+
/** Discriminated result of the progress / wait flows. */
|
|
15
|
+
export type ProgressResult = 'closed' | 'cancel';
|
|
16
|
+
/**
|
|
17
|
+
* Discriminated result of the prompt / password flows. The typed text and the
|
|
18
|
+
* dismissal are different shapes, so typing the literal text `cancel` is never
|
|
19
|
+
* mistaken for a dismissed box.
|
|
20
|
+
*/
|
|
21
|
+
export type MessageBoxTextResult = {
|
|
22
|
+
status: 'submitted';
|
|
23
|
+
value: string;
|
|
24
|
+
} | {
|
|
25
|
+
status: 'cancel';
|
|
26
|
+
};
|
|
27
|
+
export type MessageBoxTone = 'info' | 'warning' | 'danger';
|
|
28
|
+
/**
|
|
29
|
+
* Prompt verification. Returning / resolving `false` (or throwing / rejecting)
|
|
30
|
+
* keeps the box open and shows `invalidMessage`.
|
|
31
|
+
*/
|
|
32
|
+
export type MessageBoxVerify = (value: string) => unknown | Promise<unknown>;
|
|
33
|
+
export type MessageBoxPromptOptions = {
|
|
34
|
+
/** `false` hides the label. Defaults to `false` for `prompt()` and `"Password:"` for `password()`. */
|
|
35
|
+
label?: string | false;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
type?: 'text' | 'password';
|
|
38
|
+
verify?: MessageBoxVerify;
|
|
39
|
+
invalidMessage?: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Custom button handler. Return `false` to keep the box open; return any other
|
|
43
|
+
* value to resolve the awaiting call with that value; return `undefined` to
|
|
44
|
+
* fall back to the button id. A pending handler puts the box in a busy state,
|
|
45
|
+
* so a second activation is ignored until it settles.
|
|
46
|
+
*/
|
|
47
|
+
export type MessageBoxHandler = () => unknown | Promise<unknown>;
|
|
48
|
+
export type MessageBoxOptions = {
|
|
49
|
+
width?: string;
|
|
50
|
+
tone?: MessageBoxTone;
|
|
51
|
+
confirmLabel?: string;
|
|
52
|
+
cancelLabel?: string;
|
|
53
|
+
/** Shows a leading custom button that resolves to `'leftCustom'`. */
|
|
54
|
+
leftCustomLabel?: string;
|
|
55
|
+
prompt?: MessageBoxPromptOptions;
|
|
56
|
+
doConfirm?: MessageBoxHandler;
|
|
57
|
+
doCancel?: MessageBoxHandler;
|
|
58
|
+
doLeftCustom?: MessageBoxHandler;
|
|
59
|
+
onClose?: (result: unknown) => void;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Awaited API returned by `useDialog()` / `MessageBoxProvider`. Every method
|
|
63
|
+
* opens one app-local modal and resolves when the user settles it.
|
|
64
|
+
*/
|
|
65
|
+
export type MessageBox = {
|
|
66
|
+
alert: (title: string, message?: string, options?: MessageBoxOptions) => Promise<MessageBoxButtonId>;
|
|
67
|
+
confirm: (title: string, message?: string, options?: MessageBoxOptions) => Promise<MessageBoxButtonId>;
|
|
68
|
+
confirmDelete: (title: string, message?: string, options?: MessageBoxOptions) => Promise<MessageBoxButtonId>;
|
|
69
|
+
confirmLostChange: (title?: string, message?: string, options?: MessageBoxOptions) => Promise<LostChangeResult>;
|
|
70
|
+
/** Resolves `{ status: 'submitted', value }`, or `{ status: 'cancel' }` when dismissed. */
|
|
71
|
+
prompt: (message: string, phrase?: string, options?: MessageBoxOptions) => Promise<MessageBoxTextResult>;
|
|
72
|
+
/** Resolves `{ status: 'submitted', value }`, or `{ status: 'cancel' }` when dismissed. */
|
|
73
|
+
password: (title?: string, message?: string, options?: MessageBoxOptions) => Promise<MessageBoxTextResult>;
|
|
74
|
+
progress: (title: string, percent: number, info?: string, percentText?: string, options?: MessageBoxOptions) => Promise<ProgressResult>;
|
|
75
|
+
wait: (title: string, info?: string, options?: MessageBoxOptions) => Promise<ProgressResult>;
|
|
76
|
+
/** Updates the newest open progress / wait box; a no-op when there is none. */
|
|
77
|
+
updateProgress: (title: string, percent: number, info?: string, percentText?: string, options?: MessageBoxOptions) => void;
|
|
78
|
+
/** Closes the newest open progress / wait box (or the newest box), resolving it with `'closed'`. */
|
|
79
|
+
onClose: () => void;
|
|
80
|
+
/** Compatibility shim: the controller is a single long-lived instance, so this returns itself. */
|
|
81
|
+
getMsgBox: () => MessageBox;
|
|
82
|
+
};
|
|
83
|
+
/** One active box handed from the controller to `MessageBoxProvider`. */
|
|
84
|
+
export type MessageBoxRequest = {
|
|
85
|
+
id: number;
|
|
86
|
+
kind: MessageBoxKind;
|
|
87
|
+
title?: string;
|
|
88
|
+
message?: string;
|
|
89
|
+
phrase?: string;
|
|
90
|
+
progress: {
|
|
91
|
+
percent: number;
|
|
92
|
+
info?: string;
|
|
93
|
+
percentText?: string;
|
|
94
|
+
};
|
|
95
|
+
options: MessageBoxOptions;
|
|
96
|
+
};
|
|
97
|
+
export declare const messageBoxKey: InjectionKey<MessageBox>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<{
|
|
3
|
+
items?: T[];
|
|
4
|
+
collapseDirection?: "start" | "end";
|
|
5
|
+
minVisibleItemsNum?: number;
|
|
6
|
+
}> & (typeof globalThis extends {
|
|
7
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
8
|
+
} ? P : {});
|
|
9
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
10
|
+
refresh: () => Promise<void>;
|
|
11
|
+
visibleCount: import('vue').Ref<number, number>;
|
|
12
|
+
overflowItems: import('vue').ComputedRef<T[]>;
|
|
13
|
+
visibleItems: import('vue').ComputedRef<T[]>;
|
|
14
|
+
}>) => void;
|
|
15
|
+
attrs: any;
|
|
16
|
+
slots: {
|
|
17
|
+
default?: (props: {
|
|
18
|
+
item: T;
|
|
19
|
+
visibleIndex: number;
|
|
20
|
+
visibleItems: T[];
|
|
21
|
+
overflowItems: T[];
|
|
22
|
+
}) => unknown;
|
|
23
|
+
'overflow-item'?: (props: {
|
|
24
|
+
visibleItems: T[];
|
|
25
|
+
overflowItems: T[];
|
|
26
|
+
}) => unknown;
|
|
27
|
+
'overflow-start-anchor'?: () => unknown;
|
|
28
|
+
'overflow-end-anchor'?: () => unknown;
|
|
29
|
+
};
|
|
30
|
+
emit: {};
|
|
31
|
+
}>) => import('vue').VNode & {
|
|
32
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
33
|
+
};
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
37
|
+
[K in keyof T]: T[K];
|
|
38
|
+
} : {
|
|
39
|
+
[K in keyof T as K]: T[K];
|
|
40
|
+
}) & {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
visible?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OverflowToolbarItem, OverflowToolbarMenuEntry, OverflowToolbarMoreMenu, OverflowToolbarMoreState } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* An item-driven toolbar: anything that does not fit moves into a right-hand
|
|
4
|
+
* More menu, including the submenu entries of an overflowed dropdown item.
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
items?: OverflowToolbarItem[];
|
|
8
|
+
/** Items kept in the row even when the row is too narrow for them. */
|
|
9
|
+
minVisibleItemsNum?: number;
|
|
10
|
+
moreMenu?: OverflowToolbarMoreMenu;
|
|
11
|
+
/** Custom More label, e.g. `({ overflowItems }) => `More (${overflowItems.length})``. */
|
|
12
|
+
getMoreButtonText?: (state: OverflowToolbarMoreState) => string;
|
|
13
|
+
};
|
|
14
|
+
declare var __VLS_1: {}, __VLS_4: string, __VLS_5: {
|
|
15
|
+
item: OverflowToolbarItem;
|
|
16
|
+
}, __VLS_35: {}, __VLS_37: {}, __VLS_124: {
|
|
17
|
+
item: OverflowToolbarItem;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_Slots = {} & {
|
|
20
|
+
[K in NonNullable<typeof __VLS_4>]?: (props: typeof __VLS_5) => any;
|
|
21
|
+
} & {
|
|
22
|
+
'overflow-start-anchor'?: (props: typeof __VLS_1) => any;
|
|
23
|
+
} & {
|
|
24
|
+
'overflow-end-anchor'?: (props: typeof __VLS_35) => any;
|
|
25
|
+
} & {
|
|
26
|
+
right?: (props: typeof __VLS_37) => any;
|
|
27
|
+
} & {
|
|
28
|
+
'overflow-item'?: (props: typeof __VLS_124) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
31
|
+
clickItem: (item: OverflowToolbarMenuEntry | OverflowToolbarItem) => any;
|
|
32
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
+
onClickItem?: ((item: OverflowToolbarMenuEntry | OverflowToolbarItem) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
items: OverflowToolbarItem[];
|
|
36
|
+
minVisibleItemsNum: number;
|
|
37
|
+
moreMenu: OverflowToolbarMoreMenu;
|
|
38
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The gap between two toolbar items; the More button reserves one more. */
|
|
2
|
+
export declare const ITEM_GAP = 4;
|
|
3
|
+
export type OverflowFitInput = {
|
|
4
|
+
/** Measured widths of every item, in row order. */
|
|
5
|
+
widths: number[];
|
|
6
|
+
/** The row's own width, which the absolutely positioned More button never changes. */
|
|
7
|
+
availableWidth: number;
|
|
8
|
+
/** Measured width of the widest More button the current label can produce. */
|
|
9
|
+
moreWidth: number;
|
|
10
|
+
gap: number;
|
|
11
|
+
minVisibleItems: number;
|
|
12
|
+
};
|
|
13
|
+
export type OverflowFit = {
|
|
14
|
+
visibleCount: number;
|
|
15
|
+
needsMore: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* How many items fit next to the More button. Pure arithmetic over measured
|
|
19
|
+
* widths, so the toolbar only has to feed it numbers and can be tested without
|
|
20
|
+
* a layout engine.
|
|
21
|
+
*
|
|
22
|
+
* `More` is reserved as soon as the row cannot hold everything, and at least
|
|
23
|
+
* `minVisibleItems` items stay out of it even when they do not fit.
|
|
24
|
+
*/
|
|
25
|
+
export declare function computeOverflowFit({ widths, availableWidth, moreWidth, gap, minVisibleItems }: OverflowFitInput): OverflowFit;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** An entry of an item's dropdown, or of the overflowed item's submenu. */
|
|
2
|
+
export type OverflowToolbarMenuEntry = {
|
|
3
|
+
id: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
/** `divider` renders a separator and carries no action. */
|
|
6
|
+
type?: 'item' | 'divider';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type OverflowToolbarItem = OverflowToolbarMenuEntry & {
|
|
10
|
+
/** Entries of this item's dropdown; they become a submenu once it overflows. */
|
|
11
|
+
menuItems?: OverflowToolbarMenuEntry[];
|
|
12
|
+
/** Name of a slot that renders this item in the toolbar row. */
|
|
13
|
+
slot?: string;
|
|
14
|
+
/** Extra props forwarded to the item's button. */
|
|
15
|
+
bind?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
/** Options for the More dropdown. `align` defaults to `end`, against the right edge. */
|
|
18
|
+
export type OverflowToolbarMoreMenu = {
|
|
19
|
+
align?: 'start' | 'center' | 'end';
|
|
20
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
21
|
+
sideOffset?: number;
|
|
22
|
+
};
|
|
23
|
+
export type OverflowToolbarMoreState = {
|
|
24
|
+
visibleItems: OverflowToolbarItem[];
|
|
25
|
+
overflowItems: OverflowToolbarItem[];
|
|
26
|
+
};
|
|
27
|
+
export type OverflowToolbarMoreText = (state: OverflowToolbarMoreState) => string;
|
|
@@ -2,13 +2,28 @@ type __VLS_Props = {
|
|
|
2
2
|
title: string;
|
|
3
3
|
collapsible?: boolean;
|
|
4
4
|
defaultOpen?: boolean;
|
|
5
|
+
/** Bound with `v-model:open` for controlled collapse. */
|
|
6
|
+
open?: boolean;
|
|
5
7
|
};
|
|
6
|
-
declare var __VLS_6: {};
|
|
8
|
+
declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
|
|
7
9
|
type __VLS_Slots = {} & {
|
|
8
|
-
|
|
10
|
+
title?: (props: typeof __VLS_6) => any;
|
|
11
|
+
} & {
|
|
12
|
+
actions?: (props: typeof __VLS_8) => any;
|
|
13
|
+
} & {
|
|
14
|
+
title?: (props: typeof __VLS_10) => any;
|
|
15
|
+
} & {
|
|
16
|
+
actions?: (props: typeof __VLS_12) => any;
|
|
17
|
+
} & {
|
|
18
|
+
default?: (props: typeof __VLS_14) => any;
|
|
9
19
|
};
|
|
10
|
-
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
"update:open": (value: boolean) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
24
|
+
}>, {
|
|
11
25
|
defaultOpen: boolean;
|
|
26
|
+
open: boolean;
|
|
12
27
|
collapsible: boolean;
|
|
13
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,38 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type TreeNode
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
children?: TreeNode[];
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
icon?: Component;
|
|
8
|
-
data?: unknown;
|
|
9
|
-
};
|
|
1
|
+
import { TreeViewCheckPayload, TreeViewDraggableConfig, TreeViewPosition, TreeNode } from './types';
|
|
2
|
+
export type { TreeNode, TreeViewCheckPayload, TreeViewDraggableConfig, TreeViewPosition, TreeViewReorder } from './types';
|
|
10
3
|
type __VLS_Props = {
|
|
11
4
|
nodes: TreeNode[];
|
|
12
5
|
modelValue?: string | string[];
|
|
13
6
|
expanded?: string[];
|
|
14
7
|
multiple?: boolean;
|
|
15
8
|
showIcons?: boolean;
|
|
9
|
+
/** Show a leaf-based checkbox per node, with parent tri-state roll-up. */
|
|
10
|
+
checkable?: boolean;
|
|
11
|
+
checkedKeys?: string[];
|
|
12
|
+
defaultCheckedKeys?: string[];
|
|
13
|
+
/** Drag nodes to reorder, nest or move them next to a target. */
|
|
14
|
+
draggable?: boolean | TreeViewDraggableConfig;
|
|
15
|
+
/** Fetch children the first time a node without children is expanded. */
|
|
16
|
+
loadChildren?: (node: TreeNode) => Promise<TreeNode[] | undefined>;
|
|
17
|
+
/** Localise the expand/collapse control. */
|
|
18
|
+
expandLabel?: (node: TreeNode, expanded: boolean) => string;
|
|
16
19
|
};
|
|
17
|
-
declare
|
|
20
|
+
declare function nodeById(id: string): TreeNode | undefined;
|
|
21
|
+
declare function getCheckedNodes(includeHalf?: boolean): TreeNode[];
|
|
22
|
+
/** Moves a node among its siblings; used by the Alt+Arrow keys and the exposed API. */
|
|
23
|
+
declare function moveSiblingBy(node: TreeNode, delta: number): void;
|
|
24
|
+
declare function moveNode(sourceId: string, targetId: string, position: TreeViewPosition): void;
|
|
25
|
+
declare var __VLS_63: {
|
|
18
26
|
node: TreeNode;
|
|
19
27
|
selected: boolean;
|
|
20
28
|
};
|
|
21
29
|
type __VLS_Slots = {} & {
|
|
22
|
-
trailing?: (props: typeof
|
|
30
|
+
trailing?: (props: typeof __VLS_63) => any;
|
|
23
31
|
};
|
|
24
|
-
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
32
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
33
|
+
getNodes: () => TreeNode[];
|
|
34
|
+
nodeById: typeof nodeById;
|
|
35
|
+
getCheckedNodes: typeof getCheckedNodes;
|
|
36
|
+
moveNode: typeof moveNode;
|
|
37
|
+
moveSiblingBy: typeof moveSiblingBy;
|
|
38
|
+
expandNode: (id: string) => void;
|
|
39
|
+
collapseNode: (id: string) => void;
|
|
40
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
41
|
select: (node: TreeNode) => any;
|
|
26
42
|
"update:modelValue": (value: string | string[] | undefined) => any;
|
|
43
|
+
"update:checkedKeys": (value: string[]) => any;
|
|
44
|
+
load: (payload: {
|
|
45
|
+
node: TreeNode;
|
|
46
|
+
children: TreeNode[];
|
|
47
|
+
}) => any;
|
|
48
|
+
reorder: (payload: {
|
|
49
|
+
node: TreeNode;
|
|
50
|
+
target: TreeNode;
|
|
51
|
+
position: TreeViewPosition;
|
|
52
|
+
nodes: TreeNode[];
|
|
53
|
+
}) => any;
|
|
54
|
+
expand: (node: TreeNode) => any;
|
|
27
55
|
"update:expanded": (value: string[]) => any;
|
|
56
|
+
"update:nodes": (value: TreeNode[]) => any;
|
|
57
|
+
check: (payload: TreeViewCheckPayload) => any;
|
|
58
|
+
collapse: (node: TreeNode) => any;
|
|
28
59
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
60
|
onSelect?: ((node: TreeNode) => any) | undefined;
|
|
30
61
|
"onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
|
|
62
|
+
"onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
63
|
+
onLoad?: ((payload: {
|
|
64
|
+
node: TreeNode;
|
|
65
|
+
children: TreeNode[];
|
|
66
|
+
}) => any) | undefined;
|
|
67
|
+
onReorder?: ((payload: {
|
|
68
|
+
node: TreeNode;
|
|
69
|
+
target: TreeNode;
|
|
70
|
+
position: TreeViewPosition;
|
|
71
|
+
nodes: TreeNode[];
|
|
72
|
+
}) => any) | undefined;
|
|
73
|
+
onExpand?: ((node: TreeNode) => any) | undefined;
|
|
31
74
|
"onUpdate:expanded"?: ((value: string[]) => any) | undefined;
|
|
75
|
+
"onUpdate:nodes"?: ((value: TreeNode[]) => any) | undefined;
|
|
76
|
+
onCheck?: ((payload: TreeViewCheckPayload) => any) | undefined;
|
|
77
|
+
onCollapse?: ((node: TreeNode) => any) | undefined;
|
|
32
78
|
}>, {
|
|
33
79
|
multiple: boolean;
|
|
80
|
+
checkedKeys: string[];
|
|
81
|
+
draggable: boolean | TreeViewDraggableConfig;
|
|
34
82
|
expanded: string[];
|
|
35
83
|
showIcons: boolean;
|
|
84
|
+
checkable: boolean;
|
|
85
|
+
defaultCheckedKeys: string[];
|
|
86
|
+
loadChildren: (node: TreeNode) => Promise<TreeNode[] | undefined>;
|
|
87
|
+
expandLabel: (node: TreeNode, expanded: boolean) => string;
|
|
36
88
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
89
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
38
90
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TreeNode, TreeViewPosition } from './types';
|
|
2
|
+
export declare function cloneTree(nodes: TreeNode[]): TreeNode[];
|
|
3
|
+
export declare function findNode(nodes: TreeNode[], id: string): TreeNode | undefined;
|
|
4
|
+
export declare function flattenNodes(nodes: TreeNode[]): TreeNode[];
|
|
5
|
+
export declare function containsId(node: TreeNode, id: string): boolean;
|
|
6
|
+
/** Ids of the enabled leaves below (or at) a node; disabled subtrees are skipped. */
|
|
7
|
+
export declare function enabledLeafIds(node: TreeNode): string[];
|
|
8
|
+
/** The sibling array that holds `id`, anywhere in the tree, or `undefined`. */
|
|
9
|
+
export declare function parentList(nodes: TreeNode[], id: string): TreeNode[] | undefined;
|
|
10
|
+
/** A copy of `nodes` with `sourceId` moved next to or inside `targetId`. */
|
|
11
|
+
export declare function moveNode(nodes: TreeNode[], sourceId: string, targetId: string, position: TreeViewPosition): TreeNode[];
|
|
12
|
+
/** Moves a node one sibling up (`delta < 0`) or down. */
|
|
13
|
+
export declare function moveSibling(nodes: TreeNode[], id: string, delta: number): TreeNode[];
|
|
14
|
+
/** A copy of `nodes` with the children of `id` replaced. */
|
|
15
|
+
export declare function setChildren(nodes: TreeNode[], id: string, children: TreeNode[]): TreeNode[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export type TreeNode = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
children?: TreeNode[];
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
icon?: Component;
|
|
8
|
+
data?: unknown;
|
|
9
|
+
/** Marks a real leaf; `loadChildren` is never called for it. */
|
|
10
|
+
isLeaf?: boolean;
|
|
11
|
+
/** Reject drops that would nest other nodes inside this one. */
|
|
12
|
+
canAppend?: boolean;
|
|
13
|
+
/** Set `false` to keep this node from being dragged. */
|
|
14
|
+
draggable?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** Where a dragged node lands relative to the drop target. */
|
|
17
|
+
export type TreeViewPosition = 'top' | 'bottom' | 'inner';
|
|
18
|
+
export type TreeViewDraggableConfig = {
|
|
19
|
+
/** `append-only` only allows dropping inside a node. */
|
|
20
|
+
type?: 'full' | 'append-only';
|
|
21
|
+
canDrag?: (node: TreeNode) => boolean;
|
|
22
|
+
canDrop?: (info: {
|
|
23
|
+
node: TreeNode;
|
|
24
|
+
target: TreeNode;
|
|
25
|
+
position: TreeViewPosition;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
};
|
|
28
|
+
export type TreeViewReorder = {
|
|
29
|
+
node: TreeNode;
|
|
30
|
+
target: TreeNode;
|
|
31
|
+
position: TreeViewPosition;
|
|
32
|
+
nodes: TreeNode[];
|
|
33
|
+
};
|
|
34
|
+
export type TreeViewCheckPayload = {
|
|
35
|
+
node: TreeNode;
|
|
36
|
+
checked: boolean;
|
|
37
|
+
keys: string[];
|
|
38
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StyleValue } from 'vue';
|
|
2
|
+
import { ScrollBehaviorOption, ScrollToPositionOptions } from '../../primitives/scrollbar/types';
|
|
3
|
+
export type VirtualItem<T = unknown> = {
|
|
4
|
+
data: T;
|
|
5
|
+
index: number | string;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<{
|
|
9
|
+
items?: VirtualItem<T>[];
|
|
10
|
+
keyField?: string;
|
|
11
|
+
minSize?: number;
|
|
12
|
+
willResize?: boolean;
|
|
13
|
+
bufferSize?: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
viewStyle?: StyleValue;
|
|
16
|
+
}> & (typeof globalThis extends {
|
|
17
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
18
|
+
} ? P : {});
|
|
19
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
20
|
+
scrollTo: (options: ScrollToPositionOptions) => void;
|
|
21
|
+
ensureVisible: (key: string | number, behavior?: ScrollBehaviorOption) => boolean;
|
|
22
|
+
ensureIndexVisible: (index: number, behavior?: ScrollBehaviorOption) => boolean;
|
|
23
|
+
refresh: () => Promise<void>;
|
|
24
|
+
getScrollEl: () => HTMLElement | null;
|
|
25
|
+
totalSize: import('vue').ComputedRef<number>;
|
|
26
|
+
}>) => void;
|
|
27
|
+
attrs: any;
|
|
28
|
+
slots: {
|
|
29
|
+
default?: (props: {
|
|
30
|
+
item: T;
|
|
31
|
+
index: number | string;
|
|
32
|
+
}) => unknown;
|
|
33
|
+
};
|
|
34
|
+
emit: {};
|
|
35
|
+
}>) => import('vue').VNode & {
|
|
36
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
37
|
+
};
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} : {
|
|
43
|
+
[K in keyof T as K]: T[K];
|
|
44
|
+
}) & {};
|