@webx-ui/core 0.7.0 → 0.9.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/dist/components/Affix/Affix.d.ts +37 -0
- package/dist/components/Affix/index.d.ts +2 -0
- package/dist/components/Affix/types.d.ts +14 -0
- package/dist/components/Avatar/Avatar.d.ts +31 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/types.d.ts +30 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +8 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/AvatarGroup/types.d.ts +12 -0
- package/dist/components/Backtop/Backtop.d.ts +31 -0
- package/dist/components/Backtop/index.d.ts +2 -0
- package/dist/components/Backtop/types.d.ts +19 -0
- package/dist/components/Cascader/Cascader.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/Container/Container.d.ts +1 -0
- package/dist/components/Container/types.d.ts +10 -0
- package/dist/components/Descriptions/Descriptions.d.ts +33 -0
- package/dist/components/Descriptions/context.d.ts +5 -0
- package/dist/components/Descriptions/index.d.ts +2 -0
- package/dist/components/Descriptions/types.d.ts +30 -0
- package/dist/components/DescriptionsItem/DescriptionsItem.d.ts +25 -0
- package/dist/components/DescriptionsItem/index.d.ts +1 -0
- package/dist/components/Empty/Empty.d.ts +38 -0
- package/dist/components/Empty/index.d.ts +2 -0
- package/dist/components/Empty/types.d.ts +20 -0
- package/dist/components/EntityCard/EntityCard.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +1 -1
- package/dist/components/Image/Image.d.ts +43 -0
- package/dist/components/Image/index.d.ts +2 -0
- package/dist/components/Image/types.d.ts +26 -0
- package/dist/components/Indicator/Indicator.d.ts +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +2 -2
- package/dist/components/ListDetail/ListDetail.d.ts +73 -0
- package/dist/components/ListDetail/index.d.ts +2 -0
- package/dist/components/ListDetail/types.d.ts +19 -0
- package/dist/components/Loading/Loading.d.ts +34 -0
- package/dist/components/Loading/index.d.ts +2 -0
- package/dist/components/Loading/types.d.ts +25 -0
- package/dist/components/Menu/Menu.d.ts +8 -2
- package/dist/components/Menu/types.d.ts +10 -0
- package/dist/components/Popconfirm/Popconfirm.d.ts +69 -0
- package/dist/components/Popconfirm/index.d.ts +2 -0
- package/dist/components/Popconfirm/types.d.ts +33 -0
- package/dist/components/Progress/Progress.d.ts +41 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/types.d.ts +26 -0
- package/dist/components/Rate/Rate.d.ts +1 -1
- package/dist/components/Result/Result.d.ts +38 -0
- package/dist/components/Result/index.d.ts +2 -0
- package/dist/components/Result/types.d.ts +15 -0
- package/dist/components/Segmented/Segmented.d.ts +44 -0
- package/dist/components/Segmented/index.d.ts +2 -0
- package/dist/components/Segmented/types.d.ts +23 -0
- package/dist/components/SelectionArea/SelectionArea.d.ts +48 -0
- package/dist/components/SelectionArea/directive.d.ts +19 -0
- package/dist/components/SelectionArea/index.d.ts +3 -0
- package/dist/components/SelectionArea/types.d.ts +26 -0
- package/dist/components/Skeleton/Skeleton.d.ts +33 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/types.d.ts +31 -0
- package/dist/components/SkeletonItem/SkeletonItem.d.ts +8 -0
- package/dist/components/SkeletonItem/index.d.ts +1 -0
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/SortableList/SortableList.d.ts +53 -0
- package/dist/components/SortableList/index.d.ts +2 -0
- package/dist/components/SortableList/types.d.ts +38 -0
- package/dist/components/Step/Step.d.ts +38 -0
- package/dist/components/Step/index.d.ts +1 -0
- package/dist/components/Steps/Steps.d.ts +31 -0
- package/dist/components/Steps/context.d.ts +5 -0
- package/dist/components/Steps/index.d.ts +2 -0
- package/dist/components/Steps/types.d.ts +44 -0
- package/dist/components/Table/types.d.ts +4 -3
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Toaster/Toaster.d.ts +9 -0
- package/dist/components/Toaster/index.d.ts +2 -0
- package/dist/components/Toaster/types.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip.d.ts +44 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/types.d.ts +25 -0
- package/dist/components/Upload/Upload.d.ts +74 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/components/Upload/types.d.ts +54 -0
- package/dist/components/index.d.ts +23 -0
- package/dist/composables/confirm.d.ts +23 -0
- package/dist/composables/useControlAttrs.d.ts +35 -0
- package/dist/composables/useElementWidth.d.ts +17 -0
- package/dist/composables/useModal.d.ts +68 -0
- package/dist/composables/useToast.d.ts +66 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6154 -3775
- package/dist/index.js.map +1 -1
- package/dist/internal/ConfirmDialog.d.ts +18 -0
- package/dist/internal/nodes.d.ts +30 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SortableListProps } from './types';
|
|
2
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
5
|
+
readonly onMove?: ((move: import('./types').SortableMove<T>) => any) | undefined;
|
|
6
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onMove"> & ({
|
|
7
|
+
modelValue?: T[];
|
|
8
|
+
} & SortableListProps<T>) & Partial<{}>> & import('vue').PublicProps;
|
|
9
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
10
|
+
attrs: any;
|
|
11
|
+
slots: Readonly<{
|
|
12
|
+
/** Replaces the title. */
|
|
13
|
+
header?: () => unknown;
|
|
14
|
+
/** The end of the heading — a search button, a menu, whatever the list can do. */
|
|
15
|
+
extra?: () => unknown;
|
|
16
|
+
/** One row. */
|
|
17
|
+
default?: (props: {
|
|
18
|
+
item: T;
|
|
19
|
+
index: number;
|
|
20
|
+
}) => unknown;
|
|
21
|
+
/** The end of a row, where the buttons that act on it go. */
|
|
22
|
+
actions?: (props: {
|
|
23
|
+
item: T;
|
|
24
|
+
index: number;
|
|
25
|
+
}) => unknown;
|
|
26
|
+
/** Shown in place of an empty list. */
|
|
27
|
+
empty?: () => unknown;
|
|
28
|
+
}> & {
|
|
29
|
+
/** Replaces the title. */
|
|
30
|
+
header?: () => unknown;
|
|
31
|
+
/** The end of the heading — a search button, a menu, whatever the list can do. */
|
|
32
|
+
extra?: () => unknown;
|
|
33
|
+
/** One row. */
|
|
34
|
+
default?: (props: {
|
|
35
|
+
item: T;
|
|
36
|
+
index: number;
|
|
37
|
+
}) => unknown;
|
|
38
|
+
/** The end of a row, where the buttons that act on it go. */
|
|
39
|
+
actions?: (props: {
|
|
40
|
+
item: T;
|
|
41
|
+
index: number;
|
|
42
|
+
}) => unknown;
|
|
43
|
+
/** Shown in place of an empty list. */
|
|
44
|
+
empty?: () => unknown;
|
|
45
|
+
};
|
|
46
|
+
emit: ((evt: "move", move: import('./types').SortableMove<T>) => void) & ((evt: "update:modelValue", value: T[]) => void);
|
|
47
|
+
}>) => import('vue').VNode & {
|
|
48
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_PrettifyLocal<T> = {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} & {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type SortableListSize = 'sm' | 'md';
|
|
2
|
+
/** How something was moved — worth knowing when you animate or undo. */
|
|
3
|
+
export type SortableVia = 'pointer' | 'keyboard';
|
|
4
|
+
/** Where a row came from and where it went. */
|
|
5
|
+
export interface SortableMove<T = unknown> {
|
|
6
|
+
item: T;
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
via: SortableVia;
|
|
10
|
+
}
|
|
11
|
+
export interface SortableListProps<T = unknown> {
|
|
12
|
+
/** Heading above the list. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* What a drag starts from: the grip at the start of every row (`grip`), anywhere on
|
|
16
|
+
* the row (`row`), or a CSS selector for a handle of your own.
|
|
17
|
+
*/
|
|
18
|
+
handle?: 'grip' | 'row' | string;
|
|
19
|
+
/** Field to key a row by, or a function. Falls back to the position. */
|
|
20
|
+
itemKey?: string | ((item: T, index: number) => string | number);
|
|
21
|
+
/** Lists that share a name pass rows between them. */
|
|
22
|
+
group?: string;
|
|
23
|
+
/** Nothing can be moved. */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
size?: SortableListSize;
|
|
26
|
+
/** Drops the frame, for a list that already sits in a card. */
|
|
27
|
+
plain?: boolean;
|
|
28
|
+
/** Shown when there is nothing in the list. */
|
|
29
|
+
emptyText?: string;
|
|
30
|
+
/** What the grip is called, before the name of the row it holds. */
|
|
31
|
+
dragLabel?: string;
|
|
32
|
+
/** Accessible name for the list. */
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface SortableListEmits<T = unknown> {
|
|
36
|
+
/** A row changed position. The list has already been reordered. */
|
|
37
|
+
move: [move: SortableMove<T>];
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StepProps } from '../Steps/types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<{
|
|
5
|
+
title?: () => unknown;
|
|
6
|
+
/** The explanation. Overrides `description`. */
|
|
7
|
+
default?: () => unknown;
|
|
8
|
+
/** Replaces the marker — a number by default, a tick once it is done. */
|
|
9
|
+
marker?: (props: {
|
|
10
|
+
index: number;
|
|
11
|
+
state: string;
|
|
12
|
+
}) => unknown;
|
|
13
|
+
}> & {
|
|
14
|
+
title?: () => unknown;
|
|
15
|
+
/** The explanation. Overrides `description`. */
|
|
16
|
+
default?: () => unknown;
|
|
17
|
+
/** Replaces the marker — a number by default, a tick once it is done. */
|
|
18
|
+
marker?: (props: {
|
|
19
|
+
index: number;
|
|
20
|
+
state: string;
|
|
21
|
+
}) => unknown;
|
|
22
|
+
};
|
|
23
|
+
refs: {};
|
|
24
|
+
rootEl: HTMLLIElement;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
+
declare const __VLS_component: import('vue').DefineComponent<StepProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<StepProps> & Readonly<{}>, {
|
|
28
|
+
title: string;
|
|
29
|
+
icon: import('..').IconName;
|
|
30
|
+
description: string;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLIElement>;
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as WxStep } from './Step';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StepsProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<{
|
|
5
|
+
default?: () => unknown;
|
|
6
|
+
}> & {
|
|
7
|
+
default?: () => unknown;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: HTMLOListElement;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<StepsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
change: (index: number) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<StepsProps> & Readonly<{
|
|
16
|
+
onChange?: ((index: number) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
size: import('./types').StepsSize;
|
|
19
|
+
ariaLabel: string;
|
|
20
|
+
error: boolean;
|
|
21
|
+
current: number;
|
|
22
|
+
direction: import('./types').StepsDirection;
|
|
23
|
+
clickable: boolean;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLOListElement>;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IconName } from '../Icon/types';
|
|
2
|
+
export type StepsDirection = 'horizontal' | 'vertical';
|
|
3
|
+
export type StepsSize = 'sm' | 'md';
|
|
4
|
+
/** Where a step stands relative to the one the reader is on. */
|
|
5
|
+
export type StepState = 'done' | 'current' | 'todo' | 'error';
|
|
6
|
+
export interface StepsProps {
|
|
7
|
+
/** Which step the reader is on, counting from zero. */
|
|
8
|
+
current?: number;
|
|
9
|
+
direction?: StepsDirection;
|
|
10
|
+
size?: StepsSize;
|
|
11
|
+
/** Marks the current step as gone wrong, without moving off it. */
|
|
12
|
+
error?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Lets a finished step be clicked to go back to it. Going forward is never
|
|
15
|
+
* offered: the steps ahead are the ones that have not been filled in.
|
|
16
|
+
*/
|
|
17
|
+
clickable?: boolean;
|
|
18
|
+
/** Accessible name of the sequence. */
|
|
19
|
+
ariaLabel?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface StepsEmits {
|
|
22
|
+
/** A step was chosen. Only fires for steps that are behind the current one. */
|
|
23
|
+
change: [index: number];
|
|
24
|
+
}
|
|
25
|
+
export interface StepProps {
|
|
26
|
+
/** What this step is. */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** What it involves, in a few words. */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Icon instead of the number. */
|
|
31
|
+
icon?: IconName;
|
|
32
|
+
}
|
|
33
|
+
/** What `WxSteps` hands down to each step. */
|
|
34
|
+
export interface StepsContext {
|
|
35
|
+
register: (id: symbol) => void;
|
|
36
|
+
unregister: (id: symbol) => void;
|
|
37
|
+
indexOf: (id: symbol) => number;
|
|
38
|
+
stateOf: (index: number) => StepState;
|
|
39
|
+
choose: (index: number) => void;
|
|
40
|
+
direction: StepsDirection;
|
|
41
|
+
size: StepsSize;
|
|
42
|
+
clickable: boolean;
|
|
43
|
+
total: number;
|
|
44
|
+
}
|
|
@@ -36,9 +36,10 @@ export interface TableColumn<T = TableRow> {
|
|
|
36
36
|
/** Adds a sort control to the heading. The table reports, it does not reorder. */
|
|
37
37
|
sortable?: boolean;
|
|
38
38
|
/**
|
|
39
|
-
* Pins the column to an edge while the rest scrolls sideways.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* Pins the column to an edge while the rest scrolls sideways. Give it a `width` as
|
|
40
|
+
* well: the table measures where each pinned column comes to rest, but the declared
|
|
41
|
+
* width is what the offsets fall back on before the first measurement — and what
|
|
42
|
+
* decides how wide the column is in the first place.
|
|
42
43
|
*/
|
|
43
44
|
fixed?: 'left' | 'right';
|
|
44
45
|
/** Turns the raw value into the text of the cell. */
|
|
@@ -27,8 +27,8 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
27
27
|
ariaLabel: string;
|
|
28
28
|
status: import('../..').ControlStatus;
|
|
29
29
|
id: string;
|
|
30
|
-
readonly: boolean;
|
|
31
30
|
resize: "none" | "vertical" | "both";
|
|
31
|
+
readonly: boolean;
|
|
32
32
|
maxlength: number;
|
|
33
33
|
showCount: boolean;
|
|
34
34
|
rows: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ToasterProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ToasterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
3
|
+
label: string;
|
|
4
|
+
width: number | string;
|
|
5
|
+
max: number;
|
|
6
|
+
placement: import('./types').ToasterPlacement;
|
|
7
|
+
hotkey: string[];
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Which corner — or edge — the toasts stack in. */
|
|
2
|
+
export type ToasterPlacement = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
3
|
+
export interface ToasterProps {
|
|
4
|
+
placement?: ToasterPlacement;
|
|
5
|
+
/** Width of a toast: a number in pixels, or any CSS length. */
|
|
6
|
+
width?: number | string;
|
|
7
|
+
/** Accessible name of the region the toasts land in. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* How many are shown at once. The rest wait their turn rather than covering the
|
|
11
|
+
* screen — a hundred failed requests is one problem, not a hundred notifications.
|
|
12
|
+
*/
|
|
13
|
+
max?: number;
|
|
14
|
+
/** Key that dismisses everything on screen, e.g. `F8`. */
|
|
15
|
+
hotkey?: string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TooltipProps } from './types';
|
|
2
|
+
type __VLS_Props = TooltipProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
'open'?: boolean | undefined;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: Readonly<{
|
|
9
|
+
/** The control the tip belongs to. Exactly one element. */
|
|
10
|
+
default?: () => unknown;
|
|
11
|
+
/** The tip itself, when the text is not enough. */
|
|
12
|
+
content?: () => unknown;
|
|
13
|
+
}> & {
|
|
14
|
+
/** The control the tip belongs to. Exactly one element. */
|
|
15
|
+
default?: () => unknown;
|
|
16
|
+
/** The tip itself, when the text is not enough. */
|
|
17
|
+
content?: () => unknown;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
"update:open": (value: boolean | undefined) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
"onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
content: string;
|
|
30
|
+
side: import('./types').TooltipSide;
|
|
31
|
+
align: import('./types').TooltipAlign;
|
|
32
|
+
offset: number;
|
|
33
|
+
teleport: boolean;
|
|
34
|
+
delay: number;
|
|
35
|
+
maxWidth: number | string;
|
|
36
|
+
arrow: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
|
|
2
|
+
export type TooltipAlign = 'start' | 'center' | 'end';
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
/** The text. Use the `content` slot for anything richer. */
|
|
5
|
+
content?: string;
|
|
6
|
+
/** Which side of the trigger it prefers; it flips when there is no room. */
|
|
7
|
+
side?: TooltipSide;
|
|
8
|
+
align?: TooltipAlign;
|
|
9
|
+
/** Distance from the trigger, in pixels. */
|
|
10
|
+
offset?: number;
|
|
11
|
+
/**
|
|
12
|
+
* How long the pointer has to rest before the tip appears, in milliseconds. The
|
|
13
|
+
* first tip in a group waits; the ones after it come at once, because by then the
|
|
14
|
+
* reader has said what they are doing.
|
|
15
|
+
*/
|
|
16
|
+
delay?: number;
|
|
17
|
+
/** Draws the little pointer at the trigger. */
|
|
18
|
+
arrow?: boolean;
|
|
19
|
+
/** Largest width the tip takes before it wraps. */
|
|
20
|
+
maxWidth?: number | string;
|
|
21
|
+
/** Nothing opens. For a tip whose trigger is temporarily meaningless. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Render the tip in a portal so it escapes `overflow: hidden`. */
|
|
24
|
+
teleport?: boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { UploadFile, UploadProps } from './types';
|
|
2
|
+
type __VLS_Props = UploadProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: UploadFile[];
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: Readonly<{
|
|
9
|
+
/** Replaces the inside of the drop zone. */
|
|
10
|
+
default?: (props: {
|
|
11
|
+
open: () => void;
|
|
12
|
+
dragging: boolean;
|
|
13
|
+
}) => unknown;
|
|
14
|
+
/** Replaces the row a file is shown as. */
|
|
15
|
+
file?: (props: {
|
|
16
|
+
file: UploadFile;
|
|
17
|
+
remove: () => void;
|
|
18
|
+
}) => unknown;
|
|
19
|
+
/** Under the zone: a note about formats or sizes. */
|
|
20
|
+
footer?: () => unknown;
|
|
21
|
+
}> & {
|
|
22
|
+
/** Replaces the inside of the drop zone. */
|
|
23
|
+
default?: (props: {
|
|
24
|
+
open: () => void;
|
|
25
|
+
dragging: boolean;
|
|
26
|
+
}) => unknown;
|
|
27
|
+
/** Replaces the row a file is shown as. */
|
|
28
|
+
file?: (props: {
|
|
29
|
+
file: UploadFile;
|
|
30
|
+
remove: () => void;
|
|
31
|
+
}) => unknown;
|
|
32
|
+
/** Under the zone: a note about formats or sizes. */
|
|
33
|
+
footer?: () => unknown;
|
|
34
|
+
};
|
|
35
|
+
refs: {
|
|
36
|
+
input: HTMLInputElement;
|
|
37
|
+
};
|
|
38
|
+
rootEl: HTMLDivElement;
|
|
39
|
+
};
|
|
40
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
41
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
42
|
+
"update:modelValue": (value: UploadFile[]) => any;
|
|
43
|
+
select: (file: UploadFile) => any;
|
|
44
|
+
add: (files: UploadFile[]) => any;
|
|
45
|
+
remove: (file: UploadFile) => any;
|
|
46
|
+
reject: (file: File, reason: "size" | "type" | "count" | "rejected") => any;
|
|
47
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
48
|
+
"onUpdate:modelValue"?: ((value: UploadFile[]) => any) | undefined;
|
|
49
|
+
onSelect?: ((file: UploadFile) => any) | undefined;
|
|
50
|
+
onAdd?: ((files: UploadFile[]) => any) | undefined;
|
|
51
|
+
onRemove?: ((file: UploadFile) => any) | undefined;
|
|
52
|
+
onReject?: ((file: File, reason: "size" | "type" | "count" | "rejected") => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
multiple: boolean;
|
|
55
|
+
disabled: boolean;
|
|
56
|
+
max: number;
|
|
57
|
+
accept: string;
|
|
58
|
+
maxSize: number;
|
|
59
|
+
buttonOnly: boolean;
|
|
60
|
+
buttonText: string;
|
|
61
|
+
hint: string;
|
|
62
|
+
gallery: boolean;
|
|
63
|
+
removable: boolean;
|
|
64
|
+
beforeAdd: (file: File) => boolean | Promise<boolean>;
|
|
65
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
66
|
+
input: HTMLInputElement;
|
|
67
|
+
}, HTMLDivElement>;
|
|
68
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
69
|
+
export default _default;
|
|
70
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
71
|
+
new (): {
|
|
72
|
+
$slots: S;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Where a file has got to. */
|
|
2
|
+
export type UploadStatus = 'ready' | 'uploading' | 'done' | 'error';
|
|
3
|
+
export interface UploadFile {
|
|
4
|
+
/** Stable across the file's whole life, including a retry. */
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
/** In bytes. `0` for a file that arrived as a URL rather than from disk. */
|
|
8
|
+
size: number;
|
|
9
|
+
type: string;
|
|
10
|
+
status: UploadStatus;
|
|
11
|
+
/** How far along, 0–100. Meaningful while `uploading`. */
|
|
12
|
+
progress: number;
|
|
13
|
+
/** What went wrong, for a file that failed. */
|
|
14
|
+
error?: string;
|
|
15
|
+
/** Where it ended up, once the caller knows. */
|
|
16
|
+
url?: string;
|
|
17
|
+
/** The file itself, for anything picked from disk. */
|
|
18
|
+
raw?: File;
|
|
19
|
+
}
|
|
20
|
+
export interface UploadProps {
|
|
21
|
+
/** What the file input accepts, e.g. `image/*,.pdf`. */
|
|
22
|
+
accept?: string;
|
|
23
|
+
multiple?: boolean;
|
|
24
|
+
/** Largest file, in bytes. Anything over it is refused before it is added. */
|
|
25
|
+
maxSize?: number;
|
|
26
|
+
/** Largest number of files. */
|
|
27
|
+
max?: number;
|
|
28
|
+
/** Drops the drop zone and leaves a button. */
|
|
29
|
+
buttonOnly?: boolean;
|
|
30
|
+
/** Label of the button. */
|
|
31
|
+
buttonText?: string;
|
|
32
|
+
/** The line inside the drop zone. */
|
|
33
|
+
hint?: string;
|
|
34
|
+
/** Shows each file as a thumbnail rather than a row. For pictures. */
|
|
35
|
+
gallery?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** Whether a file can be taken off the list once it is there. */
|
|
38
|
+
removable?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Asked about every file before it joins the list. Return `false` — or a rejected
|
|
41
|
+
* promise — to refuse it. This is where a caller checks dimensions, or renames.
|
|
42
|
+
*/
|
|
43
|
+
beforeAdd?: (file: File) => boolean | Promise<boolean>;
|
|
44
|
+
}
|
|
45
|
+
export interface UploadEmits {
|
|
46
|
+
/** Files that passed the checks and joined the list. */
|
|
47
|
+
add: [files: UploadFile[]];
|
|
48
|
+
/** A file was taken off the list. */
|
|
49
|
+
remove: [file: UploadFile];
|
|
50
|
+
/** A file was refused, and why. */
|
|
51
|
+
reject: [file: File, reason: 'size' | 'count' | 'type' | 'rejected'];
|
|
52
|
+
/** A file in the list was chosen — to preview it, usually. */
|
|
53
|
+
select: [file: UploadFile];
|
|
54
|
+
}
|
|
@@ -2,9 +2,13 @@ export * from './Accordion';
|
|
|
2
2
|
export * from './AccordionItem';
|
|
3
3
|
export * from './Action';
|
|
4
4
|
export * from './Actions';
|
|
5
|
+
export * from './Affix';
|
|
5
6
|
export * from './Alert';
|
|
6
7
|
export * from './Aside';
|
|
7
8
|
export * from './Autocomplete';
|
|
9
|
+
export * from './Avatar';
|
|
10
|
+
export * from './AvatarGroup';
|
|
11
|
+
export * from './Backtop';
|
|
8
12
|
export * from './Badge';
|
|
9
13
|
export * from './Breadcrumb';
|
|
10
14
|
export * from './BreadcrumbItem';
|
|
@@ -21,11 +25,14 @@ export * from './Countdown';
|
|
|
21
25
|
export * from './DatePicker';
|
|
22
26
|
export * from './DateRangePicker';
|
|
23
27
|
export * from './DateTimePicker';
|
|
28
|
+
export * from './Descriptions';
|
|
29
|
+
export * from './DescriptionsItem';
|
|
24
30
|
export * from './Dialog';
|
|
25
31
|
export * from './Divider';
|
|
26
32
|
export * from './Drawer';
|
|
27
33
|
export * from './Dropdown';
|
|
28
34
|
export * from './DropdownItem';
|
|
35
|
+
export * from './Empty';
|
|
29
36
|
export * from './EntityCard';
|
|
30
37
|
export * from './Footer';
|
|
31
38
|
export * from './Form';
|
|
@@ -33,28 +40,41 @@ export * from './FormItem';
|
|
|
33
40
|
export * from './Header';
|
|
34
41
|
export * from './Heading';
|
|
35
42
|
export * from './Icon';
|
|
43
|
+
export * from './Image';
|
|
36
44
|
export * from './Indicator';
|
|
37
45
|
export * from './Input';
|
|
38
46
|
export * from './InputNumber';
|
|
39
47
|
export * from './Kanban';
|
|
40
48
|
export * from './Link';
|
|
49
|
+
export * from './ListDetail';
|
|
50
|
+
export * from './Loading';
|
|
41
51
|
export * from './Main';
|
|
42
52
|
export * from './Menu';
|
|
43
53
|
export * from './MenuGroup';
|
|
44
54
|
export * from './MenuItem';
|
|
45
55
|
export * from './Pagination';
|
|
56
|
+
export * from './Popconfirm';
|
|
46
57
|
export * from './Popover';
|
|
58
|
+
export * from './Progress';
|
|
47
59
|
export * from './Prose';
|
|
48
60
|
export * from './Radio';
|
|
49
61
|
export * from './RadioGroup';
|
|
50
62
|
export * from './Rate';
|
|
63
|
+
export * from './Result';
|
|
51
64
|
export * from './RichText';
|
|
52
65
|
export * from './Row';
|
|
53
66
|
export * from './Scrollbar';
|
|
67
|
+
export * from './Segmented';
|
|
54
68
|
export * from './Select';
|
|
69
|
+
export * from './SelectionArea';
|
|
70
|
+
export * from './Skeleton';
|
|
71
|
+
export * from './SkeletonItem';
|
|
55
72
|
export * from './Slider';
|
|
73
|
+
export * from './SortableList';
|
|
56
74
|
export * from './Space';
|
|
57
75
|
export * from './Statistic';
|
|
76
|
+
export * from './Step';
|
|
77
|
+
export * from './Steps';
|
|
58
78
|
export * from './Submenu';
|
|
59
79
|
export * from './Switch';
|
|
60
80
|
export * from './Tab';
|
|
@@ -66,3 +86,6 @@ export * from './Textarea';
|
|
|
66
86
|
export * from './Timeline';
|
|
67
87
|
export * from './TimelineItem';
|
|
68
88
|
export * from './TimePicker';
|
|
89
|
+
export * from './Toaster';
|
|
90
|
+
export * from './Tooltip';
|
|
91
|
+
export * from './Upload';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonType } from '../components/Button/types';
|
|
2
|
+
export interface ConfirmOptions {
|
|
3
|
+
/** The question, as the heading. Defaults to "Are you sure?" */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** What is at stake, under the question. */
|
|
6
|
+
message?: string;
|
|
7
|
+
confirmText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
/** Colour of the confirming button. `danger` for anything that destroys something. */
|
|
10
|
+
tone?: ButtonType;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Asks, and answers `true` or `false`.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* if (await confirm('Delete this product?')) remove(product)
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* It never rejects. A question that throws when the answer is no turns every call site
|
|
21
|
+
* into a `try` block, and a forgotten `catch` into an unhandled rejection.
|
|
22
|
+
*/
|
|
23
|
+
export declare function confirm(message?: string | ConfirmOptions, options?: ConfirmOptions): Promise<boolean>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Splits what the caller wrote on a control between its two halves.
|
|
4
|
+
*
|
|
5
|
+
* Every control here sets `inheritAttrs: false` and hands `$attrs` to the element
|
|
6
|
+
* inside it, so that `placeholder`, `autocomplete`, `data-*` and the ARIA attributes
|
|
7
|
+
* reach the real `<input>` rather than the wrapper around it. Taken literally that
|
|
8
|
+
* sends `class` and `style` there too, and both are then in the wrong place:
|
|
9
|
+
*
|
|
10
|
+
* - The caller means the control, not its input. `class="w-60"` on a `<wx-select>` is
|
|
11
|
+
* asking for a narrower select, and the select is the wrapper.
|
|
12
|
+
* - A parent's scoped CSS cannot reach it. Scoped styles carry an attribute that is
|
|
13
|
+
* stamped on a child component's *root*, so a class that lands three elements deep
|
|
14
|
+
* matches nothing — silently.
|
|
15
|
+
* - And where `$attrs` is bound to an element that is only sometimes rendered — the
|
|
16
|
+
* search field of a filterable `WxSelect` — the class disappears altogether.
|
|
17
|
+
*
|
|
18
|
+
* So `class` and `style` go on the root, and everything else goes on the control.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const { rootAttrs, controlAttrs } = useControlAttrs()
|
|
22
|
+
* ```
|
|
23
|
+
* ```vue
|
|
24
|
+
* <div :class="classes" v-bind="rootAttrs">
|
|
25
|
+
* <input v-bind="controlAttrs" />
|
|
26
|
+
* </div>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export interface ControlAttrs {
|
|
30
|
+
/** `class` and `style` — for the wrapper the caller can see. */
|
|
31
|
+
rootAttrs: ComputedRef<Record<string, unknown>>;
|
|
32
|
+
/** Everything else — for the element the browser focuses and reads out. */
|
|
33
|
+
controlAttrs: ComputedRef<Record<string, unknown>>;
|
|
34
|
+
}
|
|
35
|
+
export declare function useControlAttrs(): ControlAttrs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The width of an element, kept up to date — the measurement every layout that
|
|
4
|
+
* answers to its own box rather than to the window is built on.
|
|
5
|
+
*
|
|
6
|
+
* `0` means nothing has been measured yet: on the server, and until the element is
|
|
7
|
+
* mounted. Treat it as "assume the roomy case" rather than as zero width, the way
|
|
8
|
+
* `useResponsiveShell` does — the real number arrives before paint.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const el = ref<HTMLElement | null>(null)
|
|
12
|
+
* const width = useElementWidth(el)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Pass nothing to measure the page itself.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useElementWidth(target?: Ref<HTMLElement | null | undefined>): Ref<number>;
|