@plexui/vue 0.1.12 → 0.2.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/es/components/RadioGroup/RadioGroup.js +7 -3
- package/dist/es/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/Sortable/Sortable.js +90 -0
- package/dist/es/components/Sortable/Sortable.js.map +1 -0
- package/dist/es/components/Sortable/index.js +2 -0
- package/dist/es/components/Sortable/index.js.map +1 -0
- package/dist/es/components/TagInput/TagInput.js +3 -0
- package/dist/es/components/TagInput/TagInput.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/lib/sortable.js +406 -0
- package/dist/es/lib/sortable.js.map +1 -0
- package/dist/types/components/Sortable/Sortable.d.ts +94 -0
- package/dist/types/components/Sortable/index.d.ts +1 -0
- package/dist/types/components/TagInput/TagInput.d.ts +12 -1
- package/dist/types/components/Textarea/Textarea.d.ts +3 -3
- package/dist/types/lib/sortable.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type Component, type PropType, type SlotsType, type VNodeChild } from "vue";
|
|
2
|
+
import { type SortableLayout } from "../../lib/sortable.js";
|
|
3
|
+
/** Reorders its direct children by dragging, from anywhere but a control, or by a `SortableHandle` where grips are shown. */
|
|
4
|
+
export declare const Sortable: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
/** The list, in the order of the children. Bind with `v-model:value`. */
|
|
6
|
+
value: {
|
|
7
|
+
type: PropType<readonly unknown[]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
/** `list` for rows one under another, `grid` for items that stand side by side. @default "list" */
|
|
11
|
+
layout: {
|
|
12
|
+
type: PropType<SortableLayout>;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
/** Element to render, such as `TableBody` for table rows. @default "div" */
|
|
16
|
+
as: {
|
|
17
|
+
type: PropType<string | Component>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
/** Turns dragging off. @default false */
|
|
21
|
+
disabled: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Shows the grips of `SortableHandle`. A hidden grip still takes the keyboard, and the item drags from anywhere but a control. @default true in a table, otherwise false */
|
|
26
|
+
handles: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:value": (_value: unknown[]) => true;
|
|
34
|
+
change: (_value: unknown[]) => true;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
/** The list, in the order of the children. Bind with `v-model:value`. */
|
|
37
|
+
value: {
|
|
38
|
+
type: PropType<readonly unknown[]>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
/** `list` for rows one under another, `grid` for items that stand side by side. @default "list" */
|
|
42
|
+
layout: {
|
|
43
|
+
type: PropType<SortableLayout>;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
/** Element to render, such as `TableBody` for table rows. @default "div" */
|
|
47
|
+
as: {
|
|
48
|
+
type: PropType<string | Component>;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
/** Turns dragging off. @default false */
|
|
52
|
+
disabled: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
/** Shows the grips of `SortableHandle`. A hidden grip still takes the keyboard, and the item drags from anywhere but a control. @default true in a table, otherwise false */
|
|
57
|
+
handles: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
default: undefined;
|
|
60
|
+
};
|
|
61
|
+
}>> & Readonly<{
|
|
62
|
+
onChange?: ((_value: unknown[]) => any) | undefined;
|
|
63
|
+
"onUpdate:value"?: ((_value: unknown[]) => any) | undefined;
|
|
64
|
+
}>, {
|
|
65
|
+
disabled: boolean;
|
|
66
|
+
as: string | Component;
|
|
67
|
+
layout: SortableLayout;
|
|
68
|
+
handles: boolean;
|
|
69
|
+
}, SlotsType<{
|
|
70
|
+
/** The items, one direct child per entry of `value`, keyed by the entry and not by its index */
|
|
71
|
+
default?: () => VNodeChild;
|
|
72
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
73
|
+
/** The grip of an item. Arrow keys move the item while the handle has focus. */
|
|
74
|
+
export declare const SortableHandle: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
75
|
+
/** Name of the handle for assistive technology. @default "Reorder" */
|
|
76
|
+
ariaLabel: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
/** Name of the handle for assistive technology. @default "Reorder" */
|
|
84
|
+
ariaLabel: {
|
|
85
|
+
type: StringConstructor;
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
}>> & Readonly<{}>, {
|
|
89
|
+
ariaLabel: string;
|
|
90
|
+
}, SlotsType<{
|
|
91
|
+
/** The grip */
|
|
92
|
+
default?: () => VNodeChild;
|
|
93
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
94
|
+
export type { SortableLayout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sortable, SortableHandle, type SortableLayout } from "./Sortable.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PropType } from "vue";
|
|
2
|
-
import type { Sizes } from "@plexui/styles/types";
|
|
2
|
+
import type { Sizes, Variants } from "@plexui/styles/types";
|
|
3
3
|
export type Tag = {
|
|
4
4
|
value: string;
|
|
5
5
|
valid: boolean;
|
|
@@ -24,6 +24,11 @@ export declare const TagInput: import("vue").DefineComponent<import("vue").Extra
|
|
|
24
24
|
type: PropType<Sizes<"sm" | "md" | "lg" | "xl" | "2xl" | "3xl">>;
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
|
+
/** Visual style. `ghost` has no frame, for a field that its container already frames. @default "outline" */
|
|
28
|
+
variant: {
|
|
29
|
+
type: PropType<Variants<"outline" | "ghost">>;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
27
32
|
/** Placeholder text for the input */
|
|
28
33
|
placeholder: {
|
|
29
34
|
type: StringConstructor;
|
|
@@ -78,6 +83,11 @@ export declare const TagInput: import("vue").DefineComponent<import("vue").Extra
|
|
|
78
83
|
type: PropType<Sizes<"sm" | "md" | "lg" | "xl" | "2xl" | "3xl">>;
|
|
79
84
|
default: string;
|
|
80
85
|
};
|
|
86
|
+
/** Visual style. `ghost` has no frame, for a field that its container already frames. @default "outline" */
|
|
87
|
+
variant: {
|
|
88
|
+
type: PropType<Variants<"outline" | "ghost">>;
|
|
89
|
+
default: string;
|
|
90
|
+
};
|
|
81
91
|
/** Placeholder text for the input */
|
|
82
92
|
placeholder: {
|
|
83
93
|
type: StringConstructor;
|
|
@@ -121,6 +131,7 @@ export declare const TagInput: import("vue").DefineComponent<import("vue").Extra
|
|
|
121
131
|
size: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
122
132
|
delimiters: string[];
|
|
123
133
|
placeholder: string;
|
|
134
|
+
variant: "outline" | "ghost";
|
|
124
135
|
pill: boolean;
|
|
125
136
|
autoFocus: boolean;
|
|
126
137
|
rows: number;
|
|
@@ -3,7 +3,7 @@ import type { ControlSize, Sizes, Variants } from "@plexui/styles/types";
|
|
|
3
3
|
declare const TextareaComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
/** Visual style of the textarea. @default "outline" */
|
|
5
5
|
variant: {
|
|
6
|
-
type: PropType<Variants<"outline" | "soft">>;
|
|
6
|
+
type: PropType<Variants<"outline" | "soft" | "ghost">>;
|
|
7
7
|
default: string;
|
|
8
8
|
};
|
|
9
9
|
/** Controls the size of the textarea. @default "md" */
|
|
@@ -80,7 +80,7 @@ declare const TextareaComponent: import("vue").DefineComponent<import("vue").Ext
|
|
|
80
80
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
81
81
|
/** Visual style of the textarea. @default "outline" */
|
|
82
82
|
variant: {
|
|
83
|
-
type: PropType<Variants<"outline" | "soft">>;
|
|
83
|
+
type: PropType<Variants<"outline" | "soft" | "ghost">>;
|
|
84
84
|
default: string;
|
|
85
85
|
};
|
|
86
86
|
/** Controls the size of the textarea. @default "md" */
|
|
@@ -157,7 +157,7 @@ declare const TextareaComponent: import("vue").DefineComponent<import("vue").Ext
|
|
|
157
157
|
defaultValue: string | number;
|
|
158
158
|
disabled: boolean;
|
|
159
159
|
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
160
|
-
variant: "soft" | "outline";
|
|
160
|
+
variant: "soft" | "outline" | "ghost";
|
|
161
161
|
readOnly: boolean;
|
|
162
162
|
readonly: boolean;
|
|
163
163
|
allowAutofillExtensions: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SortableLayout = "list" | "grid";
|
|
2
|
+
/** Applies a move to the list. Resolves once the DOM shows the new order. */
|
|
3
|
+
export type SortableCommit = (from: number, to: number) => void | Promise<void>;
|
|
4
|
+
/** The order after a move. `to` counts the list without the moved item. */
|
|
5
|
+
export declare const moveItem: <T>(items: readonly T[], from: number, to: number) => T[];
|
|
6
|
+
/** Starts a drag from a press inside the list. Goes on the list's `pointerdown`. */
|
|
7
|
+
export declare function sortablePointerDown(event: PointerEvent, list: HTMLElement, layout: SortableLayout, commit: SortableCommit): void;
|
|
8
|
+
/** Moves the focused handle's item with the arrow keys. Goes on the list's `keydown`. */
|
|
9
|
+
export declare function sortableKeyDown(event: KeyboardEvent, list: HTMLElement, commit: SortableCommit): Promise<void>;
|