@ui-sdk/vue 0.0.0-stage → 0.1.0-beta.1
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/LICENSE +202 -0
- package/README.md +10 -2
- package/dist/accordion.d.ts +561 -0
- package/dist/accordion.js +24 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +7 -0
- package/dist/alert-dialog.d.ts +231 -0
- package/dist/alert-dialog.js +33 -0
- package/dist/async-options.d.ts +18 -0
- package/dist/async-options.js +40 -0
- package/dist/autocomplete.d.ts +384 -0
- package/dist/autocomplete.js +344 -0
- package/dist/avatar.d.ts +40 -0
- package/dist/avatar.js +28 -0
- package/dist/button.d.ts +52 -0
- package/dist/button.js +43 -0
- package/dist/calendar-context.d.ts +10 -0
- package/dist/calendar-context.js +7 -0
- package/dist/calendar.d.ts +311 -0
- package/dist/calendar.js +349 -0
- package/dist/carousel.d.ts +236 -0
- package/dist/carousel.js +204 -0
- package/dist/checkbox.d.ts +211 -0
- package/dist/checkbox.js +151 -0
- package/dist/children.d.ts +41 -0
- package/dist/children.js +135 -0
- package/dist/collapsible.d.ts +54 -0
- package/dist/collapsible.js +18 -0
- package/dist/color-picker.d.ts +187 -0
- package/dist/color-picker.js +158 -0
- package/dist/color.d.ts +2 -0
- package/dist/color.js +21 -0
- package/dist/combobox.d.ts +517 -0
- package/dist/combobox.js +531 -0
- package/dist/command.d.ts +322 -0
- package/dist/command.js +345 -0
- package/dist/controller-target.d.ts +49 -0
- package/dist/controller-target.js +112 -0
- package/dist/create-parts.d.ts +126 -0
- package/dist/create-parts.js +206 -0
- package/dist/date-input.d.ts +133 -0
- package/dist/date-input.js +31 -0
- package/dist/date-picker.d.ts +328 -0
- package/dist/date-picker.js +354 -0
- package/dist/date.d.ts +2 -0
- package/dist/date.js +59 -0
- package/dist/dialog-parts.d.ts +259 -0
- package/dist/dialog-parts.js +300 -0
- package/dist/dialog.d.ts +251 -0
- package/dist/dialog.js +25 -0
- package/dist/drawer.d.ts +304 -0
- package/dist/drawer.js +373 -0
- package/dist/editor-context.d.ts +4 -0
- package/dist/editor-context.js +5 -0
- package/dist/field-context.d.ts +26 -0
- package/dist/field-context.js +44 -0
- package/dist/field.d.ts +154 -0
- package/dist/field.js +240 -0
- package/dist/file-input.d.ts +212 -0
- package/dist/file-input.js +255 -0
- package/dist/form-inputs.d.ts +16 -0
- package/dist/form-inputs.js +25 -0
- package/dist/gesture.d.ts +1 -0
- package/dist/gesture.js +15 -0
- package/dist/history.d.ts +2 -0
- package/dist/history.js +11 -0
- package/dist/hover-card.d.ts +137 -0
- package/dist/hover-card.js +153 -0
- package/dist/image-cropper.d.ts +74 -0
- package/dist/image-cropper.js +36 -0
- package/dist/image.d.ts +2 -0
- package/dist/image.js +5 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +60 -0
- package/dist/input.d.ts +120 -0
- package/dist/input.js +73 -0
- package/dist/item-icon.d.ts +34 -0
- package/dist/item-icon.js +63 -0
- package/dist/label.d.ts +16 -0
- package/dist/label.js +8 -0
- package/dist/lifecycle.d.ts +11 -0
- package/dist/lifecycle.js +91 -0
- package/dist/list-items.d.ts +38 -0
- package/dist/list-items.js +59 -0
- package/dist/list-text.d.ts +7 -0
- package/dist/list-text.js +15 -0
- package/dist/listbox.d.ts +273 -0
- package/dist/listbox.js +126 -0
- package/dist/menu.d.ts +678 -0
- package/dist/menu.js +607 -0
- package/dist/menubar-context.d.ts +5 -0
- package/dist/menubar-context.js +5 -0
- package/dist/menubar.d.ts +61 -0
- package/dist/menubar.js +48 -0
- package/dist/meter.d.ts +41 -0
- package/dist/meter.js +37 -0
- package/dist/navigation-menu.d.ts +228 -0
- package/dist/navigation-menu.js +195 -0
- package/dist/number-input.d.ts +176 -0
- package/dist/number-input.js +231 -0
- package/dist/number.d.ts +2 -0
- package/dist/number.js +39 -0
- package/dist/nuxt/entries.json +977 -0
- package/dist/nuxt/module.d.ts +18 -0
- package/dist/nuxt/module.js +31 -0
- package/dist/nuxt/registrations.d.ts +22 -0
- package/dist/nuxt/registrations.js +22 -0
- package/dist/observe.d.ts +2 -0
- package/dist/observe.js +7 -0
- package/dist/otp-input.d.ts +142 -0
- package/dist/otp-input.js +130 -0
- package/dist/overlays.d.ts +40 -0
- package/dist/overlays.js +118 -0
- package/dist/pagination.d.ts +201 -0
- package/dist/pagination.js +146 -0
- package/dist/password-input.d.ts +144 -0
- package/dist/password-input.js +134 -0
- package/dist/popover.d.ts +211 -0
- package/dist/popover.js +258 -0
- package/dist/popup.d.ts +60 -0
- package/dist/popup.js +89 -0
- package/dist/preferences.d.ts +44 -0
- package/dist/preferences.js +102 -0
- package/dist/primitive.d.ts +2 -0
- package/dist/primitive.js +11 -0
- package/dist/progress.d.ts +41 -0
- package/dist/progress.js +37 -0
- package/dist/radio.d.ts +164 -0
- package/dist/radio.js +145 -0
- package/dist/rating.d.ts +149 -0
- package/dist/rating.js +146 -0
- package/dist/renderless.d.ts +4 -0
- package/dist/renderless.js +28 -0
- package/dist/resizable.d.ts +54 -0
- package/dist/resizable.js +22 -0
- package/dist/scroll-area.d.ts +72 -0
- package/dist/scroll-area.js +77 -0
- package/dist/segmented-control.d.ts +151 -0
- package/dist/segmented-control.js +110 -0
- package/dist/segmented-input.d.ts +76 -0
- package/dist/segmented-input.js +115 -0
- package/dist/select.d.ts +458 -0
- package/dist/select.js +468 -0
- package/dist/separator.d.ts +14 -0
- package/dist/separator.js +8 -0
- package/dist/shortcuts.d.ts +32 -0
- package/dist/shortcuts.js +56 -0
- package/dist/slider.d.ts +65 -0
- package/dist/slider.js +194 -0
- package/dist/switch.d.ts +103 -0
- package/dist/switch.js +71 -0
- package/dist/tabs.d.ts +338 -0
- package/dist/tabs.js +27 -0
- package/dist/text-control.d.ts +89 -0
- package/dist/text-control.js +51 -0
- package/dist/text-match.d.ts +2 -0
- package/dist/text-match.js +7 -0
- package/dist/textarea.d.ts +106 -0
- package/dist/textarea.js +68 -0
- package/dist/time-input.d.ts +131 -0
- package/dist/time-input.js +32 -0
- package/dist/timeline.d.ts +81 -0
- package/dist/timeline.js +30 -0
- package/dist/toast-parts.d.ts +203 -0
- package/dist/toast-parts.js +270 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +21 -0
- package/dist/toggle-props.d.ts +22 -0
- package/dist/toggle-props.js +14 -0
- package/dist/toggle.d.ts +199 -0
- package/dist/toggle.js +129 -0
- package/dist/token-input.d.ts +136 -0
- package/dist/token-input.js +214 -0
- package/dist/toolbar-context.d.ts +7 -0
- package/dist/toolbar-context.js +20 -0
- package/dist/toolbar.d.ts +120 -0
- package/dist/toolbar.js +77 -0
- package/dist/tooltip.d.ts +160 -0
- package/dist/tooltip.js +224 -0
- package/dist/tree.d.ts +300 -0
- package/dist/tree.js +209 -0
- package/dist/trigger-menu.d.ts +452 -0
- package/dist/trigger-menu.js +254 -0
- package/dist/use-primitive.d.ts +132 -0
- package/dist/use-primitive.js +462 -0
- package/dist/waterfall.d.ts +201 -0
- package/dist/waterfall.js +171 -0
- package/docs/README.md +89 -0
- package/docs/agents.md +1523 -0
- package/docs/components/accordion.md +1369 -0
- package/docs/components/alert-dialog.md +799 -0
- package/docs/components/autocomplete.md +1857 -0
- package/docs/components/avatar.md +272 -0
- package/docs/components/button.md +435 -0
- package/docs/components/calendar.md +1589 -0
- package/docs/components/carousel.md +1171 -0
- package/docs/components/checkbox.md +1008 -0
- package/docs/components/collapsible.md +536 -0
- package/docs/components/color-picker.md +706 -0
- package/docs/components/combobox.md +3504 -0
- package/docs/components/command.md +1481 -0
- package/docs/components/date-input.md +536 -0
- package/docs/components/date-picker.md +1244 -0
- package/docs/components/dialog.md +1397 -0
- package/docs/components/drawer.md +1166 -0
- package/docs/components/field.md +538 -0
- package/docs/components/file-input.md +611 -0
- package/docs/components/hover-card.md +505 -0
- package/docs/components/image-cropper.md +556 -0
- package/docs/components/input.md +306 -0
- package/docs/components/label.md +203 -0
- package/docs/components/listbox.md +1004 -0
- package/docs/components/menu.md +1229 -0
- package/docs/components/menubar.md +443 -0
- package/docs/components/meter.md +315 -0
- package/docs/components/navigation-menu.md +1523 -0
- package/docs/components/number-input.md +1029 -0
- package/docs/components/otp-input.md +512 -0
- package/docs/components/pagination.md +613 -0
- package/docs/components/password-input.md +649 -0
- package/docs/components/popover.md +1448 -0
- package/docs/components/preferences.md +208 -0
- package/docs/components/progress.md +423 -0
- package/docs/components/radio.md +785 -0
- package/docs/components/rating.md +416 -0
- package/docs/components/resizable.md +910 -0
- package/docs/components/scroll-area.md +915 -0
- package/docs/components/segmented-control.md +435 -0
- package/docs/components/select.md +2015 -0
- package/docs/components/separator.md +229 -0
- package/docs/components/slider.md +1084 -0
- package/docs/components/switch.md +565 -0
- package/docs/components/tabs.md +944 -0
- package/docs/components/textarea.md +299 -0
- package/docs/components/time-input.md +224 -0
- package/docs/components/timeline.md +654 -0
- package/docs/components/toast.md +1224 -0
- package/docs/components/toggle.md +500 -0
- package/docs/components/token-input.md +953 -0
- package/docs/components/toolbar.md +739 -0
- package/docs/components/tooltip.md +818 -0
- package/docs/components/tree.md +1306 -0
- package/docs/components/trigger-menu.md +1223 -0
- package/docs/components/waterfall.md +717 -0
- package/docs/controllers.md +71 -0
- package/docs/core.md +8027 -0
- package/docs/custom-parts.md +89 -0
- package/docs/first-component.md +83 -0
- package/docs/forms.md +122 -0
- package/docs/installation.md +72 -0
- package/docs/introduction.md +32 -0
- package/docs/lists-and-menus.md +122 -0
- package/docs/llms.txt +1502 -0
- package/docs/parts-and-composition.md +85 -0
- package/docs/popups.md +108 -0
- package/docs/rendering.md +56 -0
- package/docs/server-rendering.md +180 -0
- package/docs/state-and-events.md +100 -0
- package/docs/styling-and-animation.md +148 -0
- package/docs/utilities/async-options.md +348 -0
- package/docs/utilities/shortcuts.md +159 -0
- package/package.json +352 -3
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { ChangeDetails } from "@ui-sdk/core";
|
|
2
|
+
import { type PaginationController, type PaginationPageChangeReason } from "@ui-sdk/core/pagination";
|
|
3
|
+
import { type PropType } from "vue";
|
|
4
|
+
import { type PartSlots } from "./use-primitive.js";
|
|
5
|
+
/**
|
|
6
|
+
* A navigation landmark around the page links. Name it with `aria-label`.
|
|
7
|
+
* @stable
|
|
8
|
+
*/
|
|
9
|
+
declare const Pagination: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
page: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
defaultPage: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
default: undefined;
|
|
21
|
+
};
|
|
22
|
+
pageCount: {
|
|
23
|
+
type: NumberConstructor;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
total: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
pageSize: {
|
|
31
|
+
type: NumberConstructor;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
siblings: {
|
|
35
|
+
type: NumberConstructor;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
boundaries: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
getHref: PropType<(page: number) => string>;
|
|
43
|
+
controller: PropType<PaginationController>;
|
|
44
|
+
debug: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
}>, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}>[] | null) & {
|
|
53
|
+
state: NoInfer<import("@ui-sdk/core/pagination").PaginationState>;
|
|
54
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
55
|
+
"update:page": (_page: number) => true;
|
|
56
|
+
"update:modelValue": (_page: number) => true;
|
|
57
|
+
pageChange: (_page: number, _details: ChangeDetails<PaginationPageChangeReason>) => true;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
59
|
+
page: {
|
|
60
|
+
type: NumberConstructor;
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
63
|
+
modelValue: {
|
|
64
|
+
type: NumberConstructor;
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
67
|
+
defaultPage: {
|
|
68
|
+
type: NumberConstructor;
|
|
69
|
+
default: undefined;
|
|
70
|
+
};
|
|
71
|
+
pageCount: {
|
|
72
|
+
type: NumberConstructor;
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
75
|
+
total: {
|
|
76
|
+
type: NumberConstructor;
|
|
77
|
+
default: undefined;
|
|
78
|
+
};
|
|
79
|
+
pageSize: {
|
|
80
|
+
type: NumberConstructor;
|
|
81
|
+
default: undefined;
|
|
82
|
+
};
|
|
83
|
+
siblings: {
|
|
84
|
+
type: NumberConstructor;
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
87
|
+
boundaries: {
|
|
88
|
+
type: NumberConstructor;
|
|
89
|
+
default: undefined;
|
|
90
|
+
};
|
|
91
|
+
getHref: PropType<(page: number) => string>;
|
|
92
|
+
controller: PropType<PaginationController>;
|
|
93
|
+
debug: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: undefined;
|
|
96
|
+
};
|
|
97
|
+
}>> & Readonly<{
|
|
98
|
+
"onUpdate:modelValue"?: ((_page: number) => any) | undefined;
|
|
99
|
+
"onUpdate:page"?: ((_page: number) => any) | undefined;
|
|
100
|
+
onPageChange?: ((_page: number, _details: ChangeDetails<PaginationPageChangeReason>) => any) | undefined;
|
|
101
|
+
}>, {
|
|
102
|
+
debug: boolean;
|
|
103
|
+
total: number;
|
|
104
|
+
page: number;
|
|
105
|
+
siblings: number;
|
|
106
|
+
modelValue: number;
|
|
107
|
+
pageCount: number;
|
|
108
|
+
defaultPage: number;
|
|
109
|
+
boundaries: number;
|
|
110
|
+
pageSize: number;
|
|
111
|
+
}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "root">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "nav">;
|
|
112
|
+
/**
|
|
113
|
+
* The list of pages and steps. Its default slot gets `{ state }`, whose `items` are the pages to show.
|
|
114
|
+
* @stable
|
|
115
|
+
*/
|
|
116
|
+
declare const PaginationList: Pick<import("vue").DefineSetupFnComponent<Omit<import("@ui-sdk/core/renderer").BaseSlotProps, never>, {} & {}, import("./use-primitive.js").StateSlots<NoInfer<import("@ui-sdk/core/pagination").PaginationState>>>, never> & import("./create-parts.js").ElementConstructor<import("vue").DefineSetupFnComponent<Omit<import("@ui-sdk/core/renderer").BaseSlotProps, never>, {} & {}, import("./use-primitive.js").StateSlots<NoInfer<import("@ui-sdk/core/pagination").PaginationState>>>, "ul">;
|
|
117
|
+
/**
|
|
118
|
+
* One entry in the list, around a link, a step or an ellipsis.
|
|
119
|
+
* @stable
|
|
120
|
+
*/
|
|
121
|
+
declare const PaginationItem: Pick<import("vue").DefineSetupFnComponent<Omit<import("@ui-sdk/core/renderer").BaseSlotProps, never>, {} & {}, import("./use-primitive.js").StateSlots<{}>>, never> & import("./create-parts.js").ElementConstructor<import("vue").DefineSetupFnComponent<Omit<import("@ui-sdk/core/renderer").BaseSlotProps, never>, {} & {}, import("./use-primitive.js").StateSlots<{}>>, "li">;
|
|
122
|
+
/**
|
|
123
|
+
* A gap in the range. Hidden from screen readers, since the links around it
|
|
124
|
+
* say which pages there are. Shows "…" unless it has content.
|
|
125
|
+
* @stable
|
|
126
|
+
*/
|
|
127
|
+
declare const PaginationEllipsis: import("./create-parts.js").ElementPart<import("vue").DefineComponent<{}, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
128
|
+
[key: string]: any;
|
|
129
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
130
|
+
[key: string]: any;
|
|
131
|
+
}>[] | null) & {
|
|
132
|
+
state: {};
|
|
133
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "ellipsis">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "span">;
|
|
134
|
+
/**
|
|
135
|
+
* A page. The current one has `aria-current="page"`. Shows its number unless it has content.
|
|
136
|
+
* @stable
|
|
137
|
+
*/
|
|
138
|
+
declare const PaginationLink: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
139
|
+
page: {
|
|
140
|
+
type: NumberConstructor;
|
|
141
|
+
required: true;
|
|
142
|
+
};
|
|
143
|
+
}>, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
144
|
+
[key: string]: any;
|
|
145
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
146
|
+
[key: string]: any;
|
|
147
|
+
}>[] | null) & {
|
|
148
|
+
state: NoInfer<import("@ui-sdk/core/pagination").PaginationLinkState>;
|
|
149
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
150
|
+
page: {
|
|
151
|
+
type: NumberConstructor;
|
|
152
|
+
required: true;
|
|
153
|
+
};
|
|
154
|
+
}>> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "link">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "a">;
|
|
155
|
+
/**
|
|
156
|
+
* Goes to the previous page. `aria-disabled` on the first page, where it stays focusable.
|
|
157
|
+
* @stable
|
|
158
|
+
*/
|
|
159
|
+
declare const PaginationPrevious: import("./create-parts.js").ElementPart<import("vue").DefineComponent<{}, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
}>[] | null) & {
|
|
164
|
+
state: NoInfer<import("@ui-sdk/core/pagination").PaginationStepState>;
|
|
165
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "previous">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "a">;
|
|
166
|
+
/**
|
|
167
|
+
* Goes to the next page. `aria-disabled` on the last page, where it stays focusable.
|
|
168
|
+
* @stable
|
|
169
|
+
*/
|
|
170
|
+
declare const PaginationNext: import("./create-parts.js").ElementPart<import("vue").DefineComponent<{}, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
171
|
+
[key: string]: any;
|
|
172
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
173
|
+
[key: string]: any;
|
|
174
|
+
}>[] | null) & {
|
|
175
|
+
state: NoInfer<import("@ui-sdk/core/pagination").PaginationStepState>;
|
|
176
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "next">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "a">;
|
|
177
|
+
/**
|
|
178
|
+
* Goes to the first page. `aria-disabled` there.
|
|
179
|
+
* @stable
|
|
180
|
+
*/
|
|
181
|
+
declare const PaginationFirst: import("./create-parts.js").ElementPart<import("vue").DefineComponent<{}, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
182
|
+
[key: string]: any;
|
|
183
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
184
|
+
[key: string]: any;
|
|
185
|
+
}>[] | null) & {
|
|
186
|
+
state: NoInfer<import("@ui-sdk/core/pagination").PaginationStepState>;
|
|
187
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "first">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "a">;
|
|
188
|
+
/**
|
|
189
|
+
* Goes to the last page. `aria-disabled` there.
|
|
190
|
+
* @stable
|
|
191
|
+
*/
|
|
192
|
+
declare const PaginationLast: import("./create-parts.js").ElementPart<import("vue").DefineComponent<{}, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
193
|
+
[key: string]: any;
|
|
194
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
195
|
+
[key: string]: any;
|
|
196
|
+
}>[] | null) & {
|
|
197
|
+
state: NoInfer<import("@ui-sdk/core/pagination").PaginationStepState>;
|
|
198
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/pagination").PaginationPrimitive, "last">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "a">;
|
|
199
|
+
export { createPaginationController, paginationRange, } from "@ui-sdk/core/pagination";
|
|
200
|
+
export type { PaginationChangeOptions, PaginationController, PaginationLinkProps, PaginationLinkState, PaginationOptions, PaginationPageChangeReason, PaginationPrimitive, PaginationRangeItem, PaginationRangeOptions, PaginationState, PaginationStepState, } from "@ui-sdk/core/pagination";
|
|
201
|
+
export { Pagination, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationList, PaginationNext, PaginationPrevious, };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// src/pagination.ts
|
|
2
|
+
import {
|
|
3
|
+
pagination as paginationPrimitive
|
|
4
|
+
} from "@ui-sdk/core/pagination";
|
|
5
|
+
import {
|
|
6
|
+
defineComponent,
|
|
7
|
+
inject,
|
|
8
|
+
provide
|
|
9
|
+
} from "vue";
|
|
10
|
+
import { slotContent } from "./children.js";
|
|
11
|
+
import { createParts, withElement } from "./create-parts.js";
|
|
12
|
+
import { orModel, usePart, usePrimitive } from "./use-primitive.js";
|
|
13
|
+
import {
|
|
14
|
+
createPaginationController,
|
|
15
|
+
paginationRange
|
|
16
|
+
} from "@ui-sdk/core/pagination";
|
|
17
|
+
var TagKey = /* @__PURE__ */ Symbol("pagination-tag");
|
|
18
|
+
function useTag(part) {
|
|
19
|
+
const tag = inject(TagKey, null);
|
|
20
|
+
if (!tag) {
|
|
21
|
+
throw new Error(`${part} must be used inside <Pagination>.`);
|
|
22
|
+
}
|
|
23
|
+
return tag;
|
|
24
|
+
}
|
|
25
|
+
var parts = createParts(paginationPrimitive, { list: "ul", item: "li" });
|
|
26
|
+
var Pagination = withElement(
|
|
27
|
+
"nav",
|
|
28
|
+
defineComponent({
|
|
29
|
+
name: "Pagination",
|
|
30
|
+
inheritAttrs: false,
|
|
31
|
+
props: {
|
|
32
|
+
page: { type: Number, default: void 0 },
|
|
33
|
+
modelValue: { type: Number, default: void 0 },
|
|
34
|
+
defaultPage: { type: Number, default: void 0 },
|
|
35
|
+
pageCount: { type: Number, default: void 0 },
|
|
36
|
+
total: { type: Number, default: void 0 },
|
|
37
|
+
pageSize: { type: Number, default: void 0 },
|
|
38
|
+
siblings: { type: Number, default: void 0 },
|
|
39
|
+
boundaries: { type: Number, default: void 0 },
|
|
40
|
+
getHref: Function,
|
|
41
|
+
controller: Object,
|
|
42
|
+
debug: { type: Boolean, default: void 0 }
|
|
43
|
+
},
|
|
44
|
+
emits: {
|
|
45
|
+
"update:page": (_page) => true,
|
|
46
|
+
"update:modelValue": (_page) => true,
|
|
47
|
+
pageChange: (_page, _details) => true
|
|
48
|
+
},
|
|
49
|
+
slots: Object,
|
|
50
|
+
setup(props, { emit }) {
|
|
51
|
+
const pagination = usePrimitive(paginationPrimitive, () => ({
|
|
52
|
+
page: orModel(props.page, props.modelValue),
|
|
53
|
+
defaultPage: props.defaultPage,
|
|
54
|
+
pageCount: props.pageCount,
|
|
55
|
+
total: props.total,
|
|
56
|
+
pageSize: props.pageSize,
|
|
57
|
+
siblings: props.siblings,
|
|
58
|
+
boundaries: props.boundaries,
|
|
59
|
+
getHref: props.getHref,
|
|
60
|
+
controller: props.controller,
|
|
61
|
+
debug: props.debug,
|
|
62
|
+
// The change event runs first, so canceling it also keeps v-model as it was.
|
|
63
|
+
onPageChange: (page, details) => {
|
|
64
|
+
emit("pageChange", page, details);
|
|
65
|
+
if (details.canceled) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
emit("update:page", page);
|
|
69
|
+
emit("update:modelValue", page);
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
provide(TagKey, () => props.getHref ? "a" : "button");
|
|
73
|
+
return usePart(pagination, "root", void 0, void 0, "nav");
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
var PaginationList = parts.List;
|
|
78
|
+
var PaginationItem = parts.Item;
|
|
79
|
+
var PaginationEllipsis = withElement(
|
|
80
|
+
"span",
|
|
81
|
+
defineComponent({
|
|
82
|
+
name: "PaginationEllipsis",
|
|
83
|
+
inheritAttrs: false,
|
|
84
|
+
slots: Object,
|
|
85
|
+
setup(_, { slots }) {
|
|
86
|
+
return usePart(paginationPrimitive, "ellipsis", void 0, void 0, {
|
|
87
|
+
tag: "span",
|
|
88
|
+
children: (state) => slotContent(slots.default, { state }) ?? "\u2026"
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
var PaginationLink = withElement(
|
|
94
|
+
"a",
|
|
95
|
+
defineComponent({
|
|
96
|
+
name: "PaginationLink",
|
|
97
|
+
inheritAttrs: false,
|
|
98
|
+
props: { page: { type: Number, required: true } },
|
|
99
|
+
slots: Object,
|
|
100
|
+
setup(props, { slots }) {
|
|
101
|
+
const tag = useTag("PaginationLink");
|
|
102
|
+
const part = () => ({ page: props.page, id: String(props.page) });
|
|
103
|
+
return usePart(paginationPrimitive, "link", part, void 0, {
|
|
104
|
+
get tag() {
|
|
105
|
+
return tag();
|
|
106
|
+
},
|
|
107
|
+
children: (state) => slotContent(slots.default, { state }) ?? String(props.page)
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
function stepPart(name, slot) {
|
|
113
|
+
return withElement(
|
|
114
|
+
"a",
|
|
115
|
+
defineComponent({
|
|
116
|
+
name,
|
|
117
|
+
inheritAttrs: false,
|
|
118
|
+
slots: Object,
|
|
119
|
+
setup() {
|
|
120
|
+
const tag = useTag(name);
|
|
121
|
+
return usePart(paginationPrimitive, slot, void 0, void 0, {
|
|
122
|
+
get tag() {
|
|
123
|
+
return tag();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
var PaginationPrevious = stepPart("PaginationPrevious", "previous");
|
|
131
|
+
var PaginationNext = stepPart("PaginationNext", "next");
|
|
132
|
+
var PaginationFirst = stepPart("PaginationFirst", "first");
|
|
133
|
+
var PaginationLast = stepPart("PaginationLast", "last");
|
|
134
|
+
export {
|
|
135
|
+
Pagination,
|
|
136
|
+
PaginationEllipsis,
|
|
137
|
+
PaginationFirst,
|
|
138
|
+
PaginationItem,
|
|
139
|
+
PaginationLast,
|
|
140
|
+
PaginationLink,
|
|
141
|
+
PaginationList,
|
|
142
|
+
PaginationNext,
|
|
143
|
+
PaginationPrevious,
|
|
144
|
+
createPaginationController,
|
|
145
|
+
paginationRange
|
|
146
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { ChangeDetails } from "@ui-sdk/core";
|
|
2
|
+
import { type InputValueChangeReason, type PasswordInputController, type PasswordInputOptions, type PasswordInputVisibleChangeReason } from "@ui-sdk/core/password-input";
|
|
3
|
+
import { type PropType } from "vue";
|
|
4
|
+
import { type PartSlots } from "./use-primitive.js";
|
|
5
|
+
/**
|
|
6
|
+
* Holds the field and its toggle. Presses on its own text and icons focus the field.
|
|
7
|
+
* @stable
|
|
8
|
+
*/
|
|
9
|
+
declare const PasswordInput: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
value: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
defaultValue: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: undefined;
|
|
21
|
+
};
|
|
22
|
+
visible: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
defaultVisible: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
autoComplete: PropType<PasswordInputOptions["autoComplete"]>;
|
|
31
|
+
name: StringConstructor;
|
|
32
|
+
form: StringConstructor;
|
|
33
|
+
required: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
disabled: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
readOnly: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
controller: PropType<PasswordInputController>;
|
|
46
|
+
debug: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
}>, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}>[] | null) & {
|
|
55
|
+
state: NoInfer<import("@ui-sdk/core/password-input").PasswordInputState>;
|
|
56
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
|
+
"update:value": (_value: string) => true;
|
|
58
|
+
"update:modelValue": (_value: string) => true;
|
|
59
|
+
valueChange: (_value: string, _details: ChangeDetails<InputValueChangeReason>) => true;
|
|
60
|
+
"update:visible": (_visible: boolean) => true;
|
|
61
|
+
visibleChange: (_visible: boolean, _details: ChangeDetails<PasswordInputVisibleChangeReason>) => true;
|
|
62
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
|
+
value: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
67
|
+
modelValue: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
default: undefined;
|
|
70
|
+
};
|
|
71
|
+
defaultValue: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
75
|
+
visible: {
|
|
76
|
+
type: BooleanConstructor;
|
|
77
|
+
default: undefined;
|
|
78
|
+
};
|
|
79
|
+
defaultVisible: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: undefined;
|
|
82
|
+
};
|
|
83
|
+
autoComplete: PropType<PasswordInputOptions["autoComplete"]>;
|
|
84
|
+
name: StringConstructor;
|
|
85
|
+
form: StringConstructor;
|
|
86
|
+
required: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
disabled: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
readOnly: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: undefined;
|
|
97
|
+
};
|
|
98
|
+
controller: PropType<PasswordInputController>;
|
|
99
|
+
debug: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: undefined;
|
|
102
|
+
};
|
|
103
|
+
}>> & Readonly<{
|
|
104
|
+
"onUpdate:modelValue"?: ((_value: string) => any) | undefined;
|
|
105
|
+
"onUpdate:value"?: ((_value: string) => any) | undefined;
|
|
106
|
+
onValueChange?: ((_value: string, _details: ChangeDetails<InputValueChangeReason>) => any) | undefined;
|
|
107
|
+
"onUpdate:visible"?: ((_visible: boolean) => any) | undefined;
|
|
108
|
+
onVisibleChange?: ((_visible: boolean, _details: ChangeDetails<PasswordInputVisibleChangeReason>) => any) | undefined;
|
|
109
|
+
}>, {
|
|
110
|
+
value: string;
|
|
111
|
+
disabled: boolean;
|
|
112
|
+
debug: boolean;
|
|
113
|
+
defaultValue: string;
|
|
114
|
+
required: boolean;
|
|
115
|
+
visible: boolean;
|
|
116
|
+
readOnly: boolean;
|
|
117
|
+
modelValue: string;
|
|
118
|
+
defaultVisible: boolean;
|
|
119
|
+
}, PartSlots<import("@ui-sdk/core/password-input").PasswordInputPrimitive, "root">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "div">;
|
|
120
|
+
/**
|
|
121
|
+
* The native <input>. Its type follows whether the password is shown, and
|
|
122
|
+
* form attributes come from <PasswordInput>.
|
|
123
|
+
* @stable
|
|
124
|
+
*/
|
|
125
|
+
declare const PasswordInputControl: import("./create-parts.js").ElementPart<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
126
|
+
id: StringConstructor;
|
|
127
|
+
}>, (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
128
|
+
[key: string]: any;
|
|
129
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
130
|
+
[key: string]: any;
|
|
131
|
+
}>[] | null) & {
|
|
132
|
+
state: NoInfer<import("@ui-sdk/core/password-input").PasswordInputState>;
|
|
133
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
134
|
+
id: StringConstructor;
|
|
135
|
+
}>> & Readonly<{}>, {}, PartSlots<import("@ui-sdk/core/password-input").PasswordInputPrimitive, "control">, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, "input">;
|
|
136
|
+
/**
|
|
137
|
+
* Shows and hides the password. Name it by what it does, like "Show password":
|
|
138
|
+
* it's a toggle button, and `aria-pressed` says whether the password is shown.
|
|
139
|
+
* @stable
|
|
140
|
+
*/
|
|
141
|
+
declare const PasswordInputToggle: Pick<import("vue").DefineSetupFnComponent<Omit<import("@ui-sdk/core/renderer").BaseSlotProps, never>, {} & {}, import("./use-primitive.js").StateSlots<NoInfer<import("@ui-sdk/core/password-input").PasswordInputState>>>, never> & import("./create-parts.js").ElementConstructor<import("vue").DefineSetupFnComponent<Omit<import("@ui-sdk/core/renderer").BaseSlotProps, never>, {} & {}, import("./use-primitive.js").StateSlots<NoInfer<import("@ui-sdk/core/password-input").PasswordInputState>>>, "button">;
|
|
142
|
+
export { createPasswordInputController } from "@ui-sdk/core/password-input";
|
|
143
|
+
export type { InputValueChangeReason, PasswordInputController, PasswordInputOptions, PasswordInputPrimitive, PasswordInputState, PasswordInputVisibleChangeReason, } from "@ui-sdk/core/password-input";
|
|
144
|
+
export { PasswordInput, PasswordInputControl, PasswordInputToggle };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// src/password-input.ts
|
|
2
|
+
import {
|
|
3
|
+
passwordInput as passwordInputPrimitive
|
|
4
|
+
} from "@ui-sdk/core/password-input";
|
|
5
|
+
import {
|
|
6
|
+
defineComponent,
|
|
7
|
+
inject,
|
|
8
|
+
provide
|
|
9
|
+
} from "vue";
|
|
10
|
+
import { useFieldControl, useFieldControlId } from "./field-context.js";
|
|
11
|
+
import { createParts, withElement } from "./create-parts.js";
|
|
12
|
+
import {
|
|
13
|
+
optionalBoolean,
|
|
14
|
+
orModel,
|
|
15
|
+
usePart,
|
|
16
|
+
usePrimitive
|
|
17
|
+
} from "./use-primitive.js";
|
|
18
|
+
import { readOnlyOf } from "./text-control.js";
|
|
19
|
+
import { createPasswordInputController } from "@ui-sdk/core/password-input";
|
|
20
|
+
var ControlKey = /* @__PURE__ */ Symbol(
|
|
21
|
+
"password-input-control"
|
|
22
|
+
);
|
|
23
|
+
var parts = createParts(passwordInputPrimitive, { toggle: "button" });
|
|
24
|
+
var PasswordInput = withElement(
|
|
25
|
+
"div",
|
|
26
|
+
defineComponent({
|
|
27
|
+
name: "PasswordInput",
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
props: {
|
|
30
|
+
value: { type: String, default: void 0 },
|
|
31
|
+
modelValue: { type: String, default: void 0 },
|
|
32
|
+
defaultValue: { type: String, default: void 0 },
|
|
33
|
+
visible: optionalBoolean,
|
|
34
|
+
defaultVisible: optionalBoolean,
|
|
35
|
+
autoComplete: String,
|
|
36
|
+
name: String,
|
|
37
|
+
form: String,
|
|
38
|
+
required: optionalBoolean,
|
|
39
|
+
disabled: optionalBoolean,
|
|
40
|
+
readOnly: optionalBoolean,
|
|
41
|
+
controller: Object,
|
|
42
|
+
debug: optionalBoolean
|
|
43
|
+
},
|
|
44
|
+
emits: {
|
|
45
|
+
"update:value": (_value) => true,
|
|
46
|
+
"update:modelValue": (_value) => true,
|
|
47
|
+
valueChange: (_value, _details) => true,
|
|
48
|
+
"update:visible": (_visible) => true,
|
|
49
|
+
visibleChange: (_visible, _details) => true
|
|
50
|
+
},
|
|
51
|
+
slots: Object,
|
|
52
|
+
setup(props, { attrs, emit }) {
|
|
53
|
+
const field = useFieldControl();
|
|
54
|
+
const controlId = useFieldControlId();
|
|
55
|
+
const passwordInput = usePrimitive(passwordInputPrimitive, () => ({
|
|
56
|
+
value: orModel(props.value, props.modelValue),
|
|
57
|
+
defaultValue: props.defaultValue,
|
|
58
|
+
visible: props.visible,
|
|
59
|
+
defaultVisible: props.defaultVisible,
|
|
60
|
+
autoComplete: props.autoComplete,
|
|
61
|
+
name: props.name ?? field?.name(),
|
|
62
|
+
form: props.form,
|
|
63
|
+
required: props.required,
|
|
64
|
+
disabled: props.disabled || field?.disabled(),
|
|
65
|
+
readOnly: readOnlyOf(props, attrs),
|
|
66
|
+
controller: props.controller,
|
|
67
|
+
controlId,
|
|
68
|
+
debug: props.debug,
|
|
69
|
+
// The change events run first, so canceling one also keeps v-model as it was.
|
|
70
|
+
onValueChange: (value, details) => {
|
|
71
|
+
emit("valueChange", value, details);
|
|
72
|
+
if (details.canceled) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
emit("update:value", value);
|
|
76
|
+
emit("update:modelValue", value);
|
|
77
|
+
},
|
|
78
|
+
onVisibleChange: (visible, details) => {
|
|
79
|
+
emit("visibleChange", visible, details);
|
|
80
|
+
if (!details.canceled) {
|
|
81
|
+
emit("update:visible", visible);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
provide(ControlKey, {
|
|
86
|
+
field,
|
|
87
|
+
value: () => orModel(props.value, props.modelValue),
|
|
88
|
+
defaultValue: () => props.defaultValue
|
|
89
|
+
});
|
|
90
|
+
return usePart(passwordInput, "root");
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
var PasswordInputControl = withElement(
|
|
95
|
+
"input",
|
|
96
|
+
defineComponent({
|
|
97
|
+
name: "PasswordInputControl",
|
|
98
|
+
inheritAttrs: false,
|
|
99
|
+
props: { id: String },
|
|
100
|
+
slots: Object,
|
|
101
|
+
setup(props, { attrs }) {
|
|
102
|
+
const context = inject(ControlKey);
|
|
103
|
+
if (!context) {
|
|
104
|
+
throw new Error(
|
|
105
|
+
"PasswordInputControl must be used inside <PasswordInput>."
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
const element = () => {
|
|
109
|
+
const value = context.value();
|
|
110
|
+
return {
|
|
111
|
+
...attrs,
|
|
112
|
+
...value !== void 0 ? { value } : { "^value": context.defaultValue() }
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
return usePart(
|
|
116
|
+
passwordInputPrimitive,
|
|
117
|
+
"control",
|
|
118
|
+
() => ({ id: props.id }),
|
|
119
|
+
element,
|
|
120
|
+
{
|
|
121
|
+
tag: "input",
|
|
122
|
+
extend: context.field?.props
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
);
|
|
128
|
+
var PasswordInputToggle = parts.Toggle;
|
|
129
|
+
export {
|
|
130
|
+
PasswordInput,
|
|
131
|
+
PasswordInputControl,
|
|
132
|
+
PasswordInputToggle,
|
|
133
|
+
createPasswordInputController
|
|
134
|
+
};
|