@webx-ui/core 0.2.0 → 0.3.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/Action/Action.d.ts +35 -0
- package/dist/components/Action/index.d.ts +2 -0
- package/dist/components/Action/types.d.ts +37 -0
- package/dist/components/Actions/Actions.d.ts +45 -0
- package/dist/components/Actions/index.d.ts +2 -0
- package/dist/components/Actions/types.d.ts +20 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +60 -0
- package/dist/components/Autocomplete/index.d.ts +2 -0
- package/dist/components/Autocomplete/types.d.ts +58 -0
- package/dist/components/Badge/Badge.d.ts +31 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/types.d.ts +21 -0
- package/dist/components/Button/Button.d.ts +5 -5
- package/dist/components/Button/types.d.ts +3 -2
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +26 -0
- package/dist/components/ButtonGroup/index.d.ts +2 -0
- package/dist/components/ButtonGroup/types.d.ts +20 -0
- package/dist/components/Cascader/Cascader.d.ts +62 -0
- package/dist/components/Cascader/index.d.ts +2 -0
- package/dist/components/Cascader/types.d.ts +55 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/ColorPicker/ColorPicker.d.ts +5 -5
- package/dist/components/Countdown/Countdown.d.ts +42 -0
- package/dist/components/Countdown/format.d.ts +12 -0
- package/dist/components/Countdown/index.d.ts +3 -0
- package/dist/components/Countdown/types.d.ts +27 -0
- package/dist/components/DatePicker/DatePicker.d.ts +12 -12
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +11 -11
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +5 -5
- package/dist/components/Dropdown/Dropdown.d.ts +46 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Dropdown/types.d.ts +28 -0
- package/dist/components/DropdownItem/DropdownItem.d.ts +32 -0
- package/dist/components/DropdownItem/index.d.ts +2 -0
- package/dist/components/DropdownItem/types.d.ts +20 -0
- package/dist/components/EntityCard/EntityCard.d.ts +40 -0
- package/dist/components/EntityCard/index.d.ts +2 -0
- package/dist/components/EntityCard/types.d.ts +37 -0
- package/dist/components/FormItem/FormItem.d.ts +2 -2
- package/dist/components/Heading/Heading.d.ts +24 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/Heading/types.d.ts +16 -0
- package/dist/components/Icon/Icon.d.ts +8 -0
- package/dist/components/Icon/icons.d.ts +85 -0
- package/dist/components/Icon/index.d.ts +4 -0
- package/dist/components/Icon/types.d.ts +25 -0
- package/dist/components/Indicator/Indicator.d.ts +29 -0
- package/dist/components/Indicator/index.d.ts +2 -0
- package/dist/components/Indicator/types.d.ts +21 -0
- package/dist/components/Input/Input.d.ts +6 -6
- package/dist/components/InputNumber/InputNumber.d.ts +3 -3
- package/dist/components/Link/Link.d.ts +34 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Link/types.d.ts +26 -0
- package/dist/components/Prose/Prose.d.ts +22 -0
- package/dist/components/Prose/index.d.ts +2 -0
- package/dist/components/Prose/types.d.ts +13 -0
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Rate/Rate.d.ts +2 -2
- package/dist/components/RichText/RichText.d.ts +4 -4
- package/dist/components/RichText/ToolbarButton.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +10 -10
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Statistic/Statistic.d.ts +34 -0
- package/dist/components/Statistic/index.d.ts +2 -0
- package/dist/components/Statistic/types.d.ts +24 -0
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/TagsInput/TagsInput.d.ts +4 -4
- package/dist/components/Text/Text.d.ts +27 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/types.d.ts +21 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -3
- package/dist/components/TimePicker/TimePicker.d.ts +5 -5
- package/dist/components/Timeline/Timeline.d.ts +20 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/types.d.ts +6 -0
- package/dist/components/TimelineItem/TimelineItem.d.ts +29 -0
- package/dist/components/TimelineItem/index.d.ts +2 -0
- package/dist/components/TimelineItem/types.d.ts +21 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/composables/useActions.d.ts +8 -0
- package/dist/composables/useButtonGroup.d.ts +15 -0
- package/dist/composables/useDropdown.d.ts +9 -0
- package/dist/composables/useTimeline.d.ts +8 -0
- package/dist/index.js +3226 -1602
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActionProps, ActionTone, ActionType } from './types';
|
|
2
|
+
import { IconName } from '../Icon/types';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<ActionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
click: (event: MouseEvent) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<ActionProps> & Readonly<{
|
|
15
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
size: import('./types').ActionSize;
|
|
18
|
+
label: string;
|
|
19
|
+
type: ActionType;
|
|
20
|
+
title: string;
|
|
21
|
+
icon: IconName;
|
|
22
|
+
tone: ActionTone;
|
|
23
|
+
href: string;
|
|
24
|
+
target: string;
|
|
25
|
+
as: string | import('vue').Component;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
hidden: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { IconName } from '../Icon/types';
|
|
3
|
+
/**
|
|
4
|
+
* What the action does. It picks the icon, the colour and the accessible name, so a
|
|
5
|
+
* row of actions stays consistent across screens — `icon`, `tone` and `label`
|
|
6
|
+
* override any of those when a screen needs something else.
|
|
7
|
+
*/
|
|
8
|
+
export type ActionType = 'add' | 'edit' | 'remove' | 'copy' | 'link' | 'goto' | 'details' | 'view' | 'hide' | 'upload' | 'download' | 'sort' | 'search' | 'restore' | 'settings' | 'send' | 'more';
|
|
9
|
+
export type ActionTone = 'primary' | 'danger' | 'success' | 'warning' | 'neutral';
|
|
10
|
+
export type ActionSize = 'sm' | 'md' | 'lg';
|
|
11
|
+
export interface ActionProps {
|
|
12
|
+
type?: ActionType;
|
|
13
|
+
/** Icon to draw instead of the one the type picks. */
|
|
14
|
+
icon?: IconName;
|
|
15
|
+
/** Colour to use instead of the one the type picks. */
|
|
16
|
+
tone?: ActionTone;
|
|
17
|
+
/** Native tooltip; also the accessible name when `label` is not given. */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Accessible name. Needed whenever `title` is absent and the type is not enough. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Renders an `<a>` instead of a `<button>`. */
|
|
22
|
+
href?: string;
|
|
23
|
+
target?: string;
|
|
24
|
+
/** Renders through another component — `RouterLink`, say, with `to` in the attrs. */
|
|
25
|
+
as?: string | Component;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Keeps the space but draws nothing. A row where one record may not be deleted
|
|
29
|
+
* stays lined up with the rows where it may.
|
|
30
|
+
*/
|
|
31
|
+
hidden?: boolean;
|
|
32
|
+
/** Defaults to the size of the enclosing `WxActions`. */
|
|
33
|
+
size?: ActionSize;
|
|
34
|
+
}
|
|
35
|
+
export interface ActionEmits {
|
|
36
|
+
click: [event: MouseEvent];
|
|
37
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ActionsProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The row is measured against the space its container gives it. When it collapses
|
|
4
|
+
* the row is not unmounted, only taken out of the flow — it keeps its natural width,
|
|
5
|
+
* which is the only way to know when there is room for it again.
|
|
6
|
+
*/
|
|
7
|
+
declare function measure(): void;
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: {
|
|
11
|
+
default?(_: {}): any;
|
|
12
|
+
default?(_: {}): any;
|
|
13
|
+
trigger?(_: {}): any;
|
|
14
|
+
collapsed?(_: {}): any;
|
|
15
|
+
};
|
|
16
|
+
refs: {
|
|
17
|
+
root: HTMLDivElement;
|
|
18
|
+
row: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
rootEl: HTMLDivElement;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<ActionsProps, {
|
|
24
|
+
collapsed: import('vue').Ref<boolean, boolean>;
|
|
25
|
+
measure: typeof measure;
|
|
26
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
collapse: (collapsed: boolean) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<ActionsProps> & Readonly<{
|
|
29
|
+
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
size: import('..').ActionSize;
|
|
32
|
+
align: import('./types').ActionsAlign;
|
|
33
|
+
collapse: boolean;
|
|
34
|
+
ariaLabel: string;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
36
|
+
root: HTMLDivElement;
|
|
37
|
+
row: HTMLDivElement;
|
|
38
|
+
}, HTMLDivElement>;
|
|
39
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ActionSize } from '../Action/types';
|
|
2
|
+
export type ActionsAlign = 'start' | 'center' | 'end';
|
|
3
|
+
export interface ActionsProps {
|
|
4
|
+
/** Where the row sits when it has room to spare. */
|
|
5
|
+
align?: ActionsAlign;
|
|
6
|
+
/** Size handed to every action that does not set its own. */
|
|
7
|
+
size?: ActionSize;
|
|
8
|
+
/**
|
|
9
|
+
* Collapses the row into a dropdown as soon as it no longer fits the container.
|
|
10
|
+
* The container has to have a width of its own — a table cell, a card, a column —
|
|
11
|
+
* otherwise there is nothing to measure against.
|
|
12
|
+
*/
|
|
13
|
+
collapse?: boolean;
|
|
14
|
+
/** Accessible name of the group, e.g. "Row actions". */
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ActionsEmits {
|
|
18
|
+
/** The row collapsed into the dropdown, or came back out of it. */
|
|
19
|
+
collapse: [collapsed: boolean];
|
|
20
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AutocompleteOption, AutocompleteProps } from './types';
|
|
2
|
+
type __VLS_Props = AutocompleteProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
prefix?(_: {}): any;
|
|
10
|
+
suffix?(_: {}): any;
|
|
11
|
+
option?(_: {
|
|
12
|
+
option: AutocompleteOption;
|
|
13
|
+
}): any;
|
|
14
|
+
};
|
|
15
|
+
refs: {};
|
|
16
|
+
rootEl: any;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
close: () => any;
|
|
21
|
+
search: (term: string) => any;
|
|
22
|
+
select: (option: AutocompleteOption) => any;
|
|
23
|
+
clear: () => any;
|
|
24
|
+
open: () => any;
|
|
25
|
+
change: (value: string) => any;
|
|
26
|
+
"update:modelValue": (value: string) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
28
|
+
onClose?: (() => any) | undefined;
|
|
29
|
+
onSearch?: ((term: string) => any) | undefined;
|
|
30
|
+
onSelect?: ((option: AutocompleteOption) => any) | undefined;
|
|
31
|
+
onClear?: (() => any) | undefined;
|
|
32
|
+
onOpen?: (() => any) | undefined;
|
|
33
|
+
onChange?: ((value: string) => any) | undefined;
|
|
34
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
name: string;
|
|
37
|
+
size: import('../..').ControlSize;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
teleport: boolean;
|
|
40
|
+
placeholder: string;
|
|
41
|
+
ariaLabel: string;
|
|
42
|
+
options: AutocompleteOption[];
|
|
43
|
+
remote: boolean;
|
|
44
|
+
debounce: number;
|
|
45
|
+
loading: boolean;
|
|
46
|
+
loadingText: string;
|
|
47
|
+
emptyText: string;
|
|
48
|
+
minLength: number;
|
|
49
|
+
clearable: boolean;
|
|
50
|
+
openOnFocus: boolean;
|
|
51
|
+
status: import('../..').ControlStatus;
|
|
52
|
+
id: string;
|
|
53
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
55
|
+
export default _default;
|
|
56
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
57
|
+
new (): {
|
|
58
|
+
$slots: S;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ControlSize, ControlStatus } from '../../composables/useFormField';
|
|
2
|
+
/**
|
|
3
|
+
* A suggestion. `value` is the text that lands in the input when it is picked, so it
|
|
4
|
+
* is what the user sees after choosing; anything else you attach (an id, a record)
|
|
5
|
+
* comes back untouched in the `select` event and in the `option` slot.
|
|
6
|
+
*/
|
|
7
|
+
export interface AutocompleteOption {
|
|
8
|
+
value: string;
|
|
9
|
+
/** Shown in the list instead of `value`. */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Second line under the label — a hint, a path, a category. */
|
|
12
|
+
description?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface AutocompleteProps {
|
|
17
|
+
/** The suggestions to show. With `remote`, this is whatever the backend returned. */
|
|
18
|
+
options?: AutocompleteOption[];
|
|
19
|
+
/**
|
|
20
|
+
* The list is filtered by the backend: keep every option as given instead of
|
|
21
|
+
* matching it against the typed text again.
|
|
22
|
+
*/
|
|
23
|
+
remote?: boolean;
|
|
24
|
+
/** Milliseconds of quiet typing before `search` fires. */
|
|
25
|
+
debounce?: number;
|
|
26
|
+
/** Shows that a request is in flight. */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
loadingText?: string;
|
|
29
|
+
/** Text shown when nothing matches. */
|
|
30
|
+
emptyText?: string;
|
|
31
|
+
/** Characters needed before the list opens and `search` fires. */
|
|
32
|
+
minLength?: number;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
/** Shows a button that empties the field. */
|
|
35
|
+
clearable?: boolean;
|
|
36
|
+
/** Opens the list as soon as the field is focused. */
|
|
37
|
+
openOnFocus?: boolean;
|
|
38
|
+
/** Render the list in a portal so it escapes `overflow: hidden`. */
|
|
39
|
+
teleport?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
size?: ControlSize;
|
|
42
|
+
status?: ControlStatus;
|
|
43
|
+
id?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
/** Accessible label used when there is no visible `<label>`. */
|
|
46
|
+
ariaLabel?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AutocompleteEmits {
|
|
49
|
+
/** The text changed — typed or picked. */
|
|
50
|
+
change: [value: string];
|
|
51
|
+
/** Debounced search term. Load your options in response to this. */
|
|
52
|
+
search: [term: string];
|
|
53
|
+
/** A suggestion was picked. */
|
|
54
|
+
select: [option: AutocompleteOption];
|
|
55
|
+
clear: [];
|
|
56
|
+
open: [];
|
|
57
|
+
close: [];
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BadgeProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
icon?(_: {}): any;
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: HTMLSpanElement;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<BadgeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
close: (event: MouseEvent) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<BadgeProps> & Readonly<{
|
|
15
|
+
onClose?: ((event: MouseEvent) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
size: import('./types').BadgeSize;
|
|
18
|
+
type: import('./types').BadgeType;
|
|
19
|
+
round: boolean;
|
|
20
|
+
variant: import('./types').BadgeVariant;
|
|
21
|
+
dot: boolean;
|
|
22
|
+
closable: boolean;
|
|
23
|
+
closeLabel: string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
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,21 @@
|
|
|
1
|
+
export type BadgeType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
2
|
+
export type BadgeVariant = 'soft' | 'solid' | 'outline';
|
|
3
|
+
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
/** Semantic colour of the badge. */
|
|
6
|
+
type?: BadgeType;
|
|
7
|
+
/** Visual weight: tinted, filled or bordered. */
|
|
8
|
+
variant?: BadgeVariant;
|
|
9
|
+
size?: BadgeSize;
|
|
10
|
+
/** Pill shape instead of the default rounded rectangle. */
|
|
11
|
+
round?: boolean;
|
|
12
|
+
/** Shows a coloured dot before the label — a status badge rather than a tag. */
|
|
13
|
+
dot?: boolean;
|
|
14
|
+
/** Adds a × that emits `close`; the caller decides what to remove. */
|
|
15
|
+
closable?: boolean;
|
|
16
|
+
/** Label for the close button, for screen readers. */
|
|
17
|
+
closeLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface BadgeEmits {
|
|
20
|
+
close: [event: MouseEvent];
|
|
21
|
+
}
|
|
@@ -14,15 +14,15 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
|
|
|
14
14
|
}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
15
15
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
type: import('./types').ButtonType;
|
|
18
|
-
variant: import('./types').ButtonVariant;
|
|
19
17
|
size: import('./types').ButtonSize;
|
|
20
|
-
|
|
21
|
-
loading: boolean;
|
|
22
|
-
block: boolean;
|
|
18
|
+
type: import('./types').ButtonType;
|
|
23
19
|
round: boolean;
|
|
24
20
|
href: string;
|
|
25
21
|
target: string;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
variant: import('./types').ButtonVariant;
|
|
25
|
+
block: boolean;
|
|
26
26
|
nativeType: import('./types').ButtonNativeType;
|
|
27
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -3,10 +3,11 @@ export type ButtonVariant = 'solid' | 'outline' | 'text';
|
|
|
3
3
|
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
4
4
|
export type ButtonNativeType = 'button' | 'submit' | 'reset';
|
|
5
5
|
export interface ButtonProps {
|
|
6
|
-
/** Semantic colour of the button. */
|
|
6
|
+
/** Semantic colour of the button. Defaults to `default`, or to the group's. */
|
|
7
7
|
type?: ButtonType;
|
|
8
|
-
/** Visual weight: filled, bordered or borderless. */
|
|
8
|
+
/** Visual weight: filled, bordered or borderless. Defaults to `solid`, or to the group's. */
|
|
9
9
|
variant?: ButtonVariant;
|
|
10
|
+
/** Defaults to `md`, or to the enclosing `WxButtonGroup`. */
|
|
10
11
|
size?: ButtonSize;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
/** Shows a spinner and blocks interaction. */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ButtonGroupProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<ButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonGroupProps> & Readonly<{}>, {
|
|
12
|
+
size: import('..').ButtonSize;
|
|
13
|
+
type: import('..').ButtonType;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
variant: import('..').ButtonVariant;
|
|
17
|
+
vertical: boolean;
|
|
18
|
+
attached: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ButtonSize, ButtonType, ButtonVariant } from '../Button/types';
|
|
2
|
+
export interface ButtonGroupProps {
|
|
3
|
+
/** Colour handed to every button that does not set its own. */
|
|
4
|
+
type?: ButtonType;
|
|
5
|
+
/** Variant handed to every button that does not set its own. */
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
/** Size handed to every button that does not set its own. */
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
/** Disables every button in the group. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Stacks the buttons instead of lining them up. */
|
|
12
|
+
vertical?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Joins the buttons into one segmented control — shared borders, rounded only at
|
|
15
|
+
* the ends. Turn it off for a plain row of separate buttons.
|
|
16
|
+
*/
|
|
17
|
+
attached?: boolean;
|
|
18
|
+
/** Accessible name for the group, e.g. "Row actions". */
|
|
19
|
+
ariaLabel?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CascaderModelValue, CascaderOption, CascaderProps } from './types';
|
|
2
|
+
type __VLS_Props = CascaderProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: CascaderModelValue;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
option?(_: {
|
|
10
|
+
option: CascaderOption;
|
|
11
|
+
level: number;
|
|
12
|
+
}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {
|
|
15
|
+
panel: HTMLDivElement;
|
|
16
|
+
};
|
|
17
|
+
rootEl: any;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
close: () => any;
|
|
22
|
+
clear: () => any;
|
|
23
|
+
open: () => any;
|
|
24
|
+
change: (value: CascaderModelValue) => any;
|
|
25
|
+
"update:modelValue": (value: CascaderModelValue) => any;
|
|
26
|
+
expand: (path: CascaderOption[]) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
28
|
+
onClose?: (() => any) | undefined;
|
|
29
|
+
onClear?: (() => any) | undefined;
|
|
30
|
+
onOpen?: (() => any) | undefined;
|
|
31
|
+
onChange?: ((value: CascaderModelValue) => any) | undefined;
|
|
32
|
+
"onUpdate:modelValue"?: ((value: CascaderModelValue) => any) | undefined;
|
|
33
|
+
onExpand?: ((path: CascaderOption[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
name: string;
|
|
36
|
+
size: import('../..').ControlSize;
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
teleport: boolean;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
ariaLabel: string;
|
|
41
|
+
options: CascaderOption[];
|
|
42
|
+
emptyText: string;
|
|
43
|
+
clearable: boolean;
|
|
44
|
+
status: import('../..').ControlStatus;
|
|
45
|
+
id: string;
|
|
46
|
+
expandTrigger: "click" | "hover";
|
|
47
|
+
checkStrictly: boolean;
|
|
48
|
+
emitPath: boolean;
|
|
49
|
+
showAllLevels: boolean;
|
|
50
|
+
separator: string;
|
|
51
|
+
lazy: boolean;
|
|
52
|
+
load: import('./types').CascaderLoader;
|
|
53
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
54
|
+
panel: HTMLDivElement;
|
|
55
|
+
}, any>;
|
|
56
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
57
|
+
export default _default;
|
|
58
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ControlSize, ControlStatus } from '../../composables/useFormField';
|
|
2
|
+
export type CascaderValue = string | number;
|
|
3
|
+
export interface CascaderOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: CascaderValue;
|
|
6
|
+
children?: CascaderOption[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Says this node has nothing under it. Only needed with `lazy`, where an empty
|
|
10
|
+
* `children` cannot tell "not loaded yet" from "nothing there".
|
|
11
|
+
*/
|
|
12
|
+
leaf?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** The whole path by default (`['content', 'news']`), or the last value with `emit-path: false`. */
|
|
15
|
+
export type CascaderModelValue = CascaderValue[] | CascaderValue | null;
|
|
16
|
+
/** Loads one level. Called with `null` for the root, otherwise with the node opened. */
|
|
17
|
+
export type CascaderLoader = (option: CascaderOption | null, path: CascaderOption[]) => CascaderOption[] | Promise<CascaderOption[]>;
|
|
18
|
+
export interface CascaderProps {
|
|
19
|
+
/** The tree. Leave empty and use `lazy` to build it from the backend instead. */
|
|
20
|
+
options?: CascaderOption[];
|
|
21
|
+
/** Whether a child list opens on click or on hover. */
|
|
22
|
+
expandTrigger?: 'click' | 'hover';
|
|
23
|
+
/** Lets a parent be chosen, not only a leaf. */
|
|
24
|
+
checkStrictly?: boolean;
|
|
25
|
+
/** The model is the path of values; turn it off to store the last value alone. */
|
|
26
|
+
emitPath?: boolean;
|
|
27
|
+
/** Shows the whole path in the field; off shows the chosen label alone. */
|
|
28
|
+
showAllLevels?: boolean;
|
|
29
|
+
/** What goes between the levels in the field. */
|
|
30
|
+
separator?: string;
|
|
31
|
+
/** Levels are fetched as they open. Requires `load`. */
|
|
32
|
+
lazy?: boolean;
|
|
33
|
+
/** Fetches one level. Required when `lazy`. */
|
|
34
|
+
load?: CascaderLoader;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
emptyText?: string;
|
|
37
|
+
clearable?: boolean;
|
|
38
|
+
/** Render the panel in a portal so it escapes `overflow: hidden`. */
|
|
39
|
+
teleport?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
size?: ControlSize;
|
|
42
|
+
status?: ControlStatus;
|
|
43
|
+
id?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
/** Accessible label used when there is no visible `<label>`. */
|
|
46
|
+
ariaLabel?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CascaderEmits {
|
|
49
|
+
change: [value: CascaderModelValue];
|
|
50
|
+
/** A level was opened — the path of options leading to it. */
|
|
51
|
+
expand: [path: CascaderOption[]];
|
|
52
|
+
clear: [];
|
|
53
|
+
open: [];
|
|
54
|
+
close: [];
|
|
55
|
+
}
|
|
@@ -23,12 +23,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
23
23
|
}>, {
|
|
24
24
|
name: string;
|
|
25
25
|
size: import('../..').ControlSize;
|
|
26
|
-
disabled: boolean;
|
|
27
26
|
label: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
ariaLabel: string;
|
|
28
29
|
value: import('../../composables/useFormField').ChoiceValue;
|
|
29
|
-
indeterminate: boolean;
|
|
30
30
|
id: string;
|
|
31
|
-
|
|
31
|
+
indeterminate: boolean;
|
|
32
32
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
33
33
|
inputRef: HTMLInputElement;
|
|
34
34
|
}, any>;
|
|
@@ -13,13 +13,13 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
13
13
|
name: string;
|
|
14
14
|
size: import('../..').ControlSize;
|
|
15
15
|
disabled: boolean;
|
|
16
|
-
|
|
16
|
+
teleport: boolean;
|
|
17
|
+
placeholder: string;
|
|
17
18
|
ariaLabel: string;
|
|
18
|
-
presets: string[];
|
|
19
19
|
clearable: boolean;
|
|
20
|
-
placeholder: string;
|
|
21
|
-
teleport: boolean;
|
|
22
|
-
readonly: boolean;
|
|
23
20
|
status: import('../..').ControlStatus;
|
|
21
|
+
id: string;
|
|
22
|
+
presets: string[];
|
|
23
|
+
readonly: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CountdownProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
title?(_: {}): any;
|
|
6
|
+
prefix?(_: {}): any;
|
|
7
|
+
suffix?(_: {}): any;
|
|
8
|
+
value?(_: {
|
|
9
|
+
remaining: number;
|
|
10
|
+
text: string;
|
|
11
|
+
}): any;
|
|
12
|
+
default?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: HTMLDivElement;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<CountdownProps, {
|
|
19
|
+
remaining: import('vue').Ref<number, number>;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
change: (remaining: number) => any;
|
|
22
|
+
finish: () => any;
|
|
23
|
+
}, string, import('vue').PublicProps, Readonly<CountdownProps> & Readonly<{
|
|
24
|
+
onChange?: ((remaining: number) => any) | undefined;
|
|
25
|
+
onFinish?: (() => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
size: import('..').StatisticSize;
|
|
28
|
+
title: string;
|
|
29
|
+
tone: import('..').TextTone;
|
|
30
|
+
align: import('..').TextAlign;
|
|
31
|
+
prefix: string;
|
|
32
|
+
suffix: string;
|
|
33
|
+
format: string;
|
|
34
|
+
interval: number;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
36
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CountdownTarget } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a span of milliseconds against a pattern of `DD`, `HH`, `mm`, `ss`, `SSS`.
|
|
4
|
+
*
|
|
5
|
+
* Only the tokens the pattern actually contains consume time, so `mm:ss` on two hours
|
|
6
|
+
* prints `120:00` rather than silently dropping the hours. Everything else in the
|
|
7
|
+
* pattern is copied through — mind that a literal word containing a token (`ss` in
|
|
8
|
+
* "passed") would be replaced.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatCountdown(ms: number, format?: string): string;
|
|
11
|
+
/** Normalises whatever the caller passed as a target into a timestamp. */
|
|
12
|
+
export declare function toTimestamp(value: CountdownTarget): number;
|