@hawiyah/vue 0.0.0-stage → 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/LICENSE +73 -0
- package/NOTICE +19 -0
- package/PORTAL.md +70 -0
- package/README.md +388 -2
- package/dist/calendar.d.ts +183 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +448 -0
- package/dist/calendar.js.map +1 -0
- package/dist/content-navigation.d.ts +61 -0
- package/dist/content-navigation.d.ts.map +1 -0
- package/dist/content-navigation.js +31 -0
- package/dist/content-navigation.js.map +1 -0
- package/dist/content.d.ts +392 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +305 -0
- package/dist/content.js.map +1 -0
- package/dist/controls.d.ts +657 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +679 -0
- package/dist/controls.js.map +1 -0
- package/dist/display.d.ts +387 -0
- package/dist/display.d.ts.map +1 -0
- package/dist/display.js +293 -0
- package/dist/display.js.map +1 -0
- package/dist/expansion-interactive.d.ts +476 -0
- package/dist/expansion-interactive.d.ts.map +1 -0
- package/dist/expansion-interactive.js +613 -0
- package/dist/expansion-interactive.js.map +1 -0
- package/dist/file-upload-list.d.ts +54 -0
- package/dist/file-upload-list.d.ts.map +1 -0
- package/dist/file-upload-list.js +21 -0
- package/dist/file-upload-list.js.map +1 -0
- package/dist/forms.d.ts +388 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.js +156 -0
- package/dist/forms.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive.d.ts +240 -0
- package/dist/interactive.d.ts.map +1 -0
- package/dist/interactive.js +341 -0
- package/dist/interactive.js.map +1 -0
- package/dist/layout.d.ts +755 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +101 -0
- package/dist/layout.js.map +1 -0
- package/dist/mobile-top-bar.d.ts +47 -0
- package/dist/mobile-top-bar.d.ts.map +1 -0
- package/dist/mobile-top-bar.js +18 -0
- package/dist/mobile-top-bar.js.map +1 -0
- package/dist/native-attributes.d.ts +38 -0
- package/dist/native-attributes.d.ts.map +1 -0
- package/dist/native-attributes.js +27 -0
- package/dist/native-attributes.js.map +1 -0
- package/dist/navigation-drawer.d.ts +87 -0
- package/dist/navigation-drawer.d.ts.map +1 -0
- package/dist/navigation-drawer.js +56 -0
- package/dist/navigation-drawer.js.map +1 -0
- package/dist/patterns.d.ts +455 -0
- package/dist/patterns.d.ts.map +1 -0
- package/dist/patterns.js +355 -0
- package/dist/patterns.js.map +1 -0
- package/dist/portal.d.ts +174 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +36 -0
- package/dist/portal.js.map +1 -0
- package/dist/search-field.d.ts +87 -0
- package/dist/search-field.d.ts.map +1 -0
- package/dist/search-field.js +123 -0
- package/dist/search-field.js.map +1 -0
- package/dist/shared.d.ts +46 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +40 -0
- package/dist/shared.js.map +1 -0
- package/dist/site-verification.d.ts +63 -0
- package/dist/site-verification.d.ts.map +1 -0
- package/dist/site-verification.js +34 -0
- package/dist/site-verification.js.map +1 -0
- package/package.json +53 -3
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type FileUploadItem, type FileUploadLabels } from '@hawiyah/core';
|
|
3
|
+
export declare const FileUploadList: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
items: {
|
|
5
|
+
type: PropType<readonly FileUploadItem[]>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
labels: {
|
|
9
|
+
type: PropType<FileUploadLabels>;
|
|
10
|
+
default: () => {
|
|
11
|
+
selected: string;
|
|
12
|
+
uploading: string;
|
|
13
|
+
complete: string;
|
|
14
|
+
error: string;
|
|
15
|
+
remove: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
disabled: BooleanConstructor;
|
|
19
|
+
removable: BooleanConstructor;
|
|
20
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
remove: (_id: string) => true;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
items: {
|
|
26
|
+
type: PropType<readonly FileUploadItem[]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
labels: {
|
|
30
|
+
type: PropType<FileUploadLabels>;
|
|
31
|
+
default: () => {
|
|
32
|
+
selected: string;
|
|
33
|
+
uploading: string;
|
|
34
|
+
complete: string;
|
|
35
|
+
error: string;
|
|
36
|
+
remove: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
disabled: BooleanConstructor;
|
|
40
|
+
removable: BooleanConstructor;
|
|
41
|
+
}>> & Readonly<{
|
|
42
|
+
onRemove?: ((_id: string) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
labels: {
|
|
46
|
+
selected: string;
|
|
47
|
+
uploading: string;
|
|
48
|
+
complete: string;
|
|
49
|
+
error: string;
|
|
50
|
+
remove: string;
|
|
51
|
+
};
|
|
52
|
+
removable: boolean;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
54
|
+
//# sourceMappingURL=file-upload-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload-list.d.ts","sourceRoot":"","sources":["../src/file-upload-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAAwC,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjH,eAAO,MAAM,cAAc;;cAGC,QAAQ,CAAC,SAAS,cAAc,EAAE,CAAC;;;;cACjC,QAAQ,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;kBAI/B,MAAM;;;cALH,QAAQ,CAAC,SAAS,cAAc,EAAE,CAAC;;;;cACjC,QAAQ,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;4EAatD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { fileUploadLabels, fileUploadProgress } from '@hawiyah/core';
|
|
3
|
+
export const FileUploadList = defineComponent({
|
|
4
|
+
name: 'HwFileUploadList',
|
|
5
|
+
props: {
|
|
6
|
+
items: { type: Array, required: true },
|
|
7
|
+
labels: { type: Object, default: () => fileUploadLabels },
|
|
8
|
+
disabled: Boolean,
|
|
9
|
+
removable: Boolean,
|
|
10
|
+
},
|
|
11
|
+
emits: { remove: (_id) => true },
|
|
12
|
+
setup(props, { emit }) {
|
|
13
|
+
return () => h('ul', { class: 'hw-upload-list' }, props.items.map(item => h('li', { key: item.id, class: 'hw-upload-item', 'data-status': item.status, 'data-message': item.message ? true : undefined }, [
|
|
14
|
+
h('span', { class: 'hw-upload-name' }, item.name),
|
|
15
|
+
h('span', { class: 'hw-upload-status', role: 'status' }, item.message || props.labels[item.status]),
|
|
16
|
+
item.status === 'uploading' ? h('progress', { max: 100, value: fileUploadProgress(item.progress), 'aria-label': `${props.labels.uploading} ${item.name}` }) : null,
|
|
17
|
+
props.removable && item.removable !== false ? h('button', { type: 'button', class: 'hw-button', 'data-variant': 'subtle', disabled: props.disabled, 'aria-label': `${props.labels.remove} ${item.name}`, onClick: () => emit('remove', item.id) }, props.labels.remove) : null,
|
|
18
|
+
])));
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=file-upload-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload-list.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CAAC,MAAM,CAAC,CAAC;YACnG,IAAI,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;YAClK,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;SAC/Q,CAAC,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAC,CAAC"}
|
package/dist/forms.d.ts
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import type { PropType, VNodeChild } from 'vue';
|
|
2
|
+
import { type Option } from '@hawiyah/core';
|
|
3
|
+
import type { FieldDecoration } from './shared.js';
|
|
4
|
+
export declare const Button: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
variant: {
|
|
6
|
+
type: PropType<"primary" | "default" | "secondary" | "outline" | "outline-white" | "light" | "danger" | "ghost" | "soft" | "link">;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
size: {
|
|
10
|
+
type: PropType<"sm" | "md" | "lg">;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
loading: BooleanConstructor;
|
|
14
|
+
disabled: BooleanConstructor;
|
|
15
|
+
type: {
|
|
16
|
+
type: PropType<"button" | "submit" | "reset">;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
variant: {
|
|
23
|
+
type: PropType<"primary" | "default" | "secondary" | "outline" | "outline-white" | "light" | "danger" | "ghost" | "soft" | "link">;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
type: PropType<"sm" | "md" | "lg">;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
loading: BooleanConstructor;
|
|
31
|
+
disabled: BooleanConstructor;
|
|
32
|
+
type: {
|
|
33
|
+
type: PropType<"button" | "submit" | "reset">;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
size: "sm" | "md" | "lg";
|
|
38
|
+
loading: boolean;
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
variant: "primary" | "default" | "secondary" | "outline" | "outline-white" | "light" | "danger" | "ghost" | "soft" | "link";
|
|
41
|
+
type: "reset" | "submit" | "button";
|
|
42
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
43
|
+
export declare const Field: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
44
|
+
controlId: StringConstructor;
|
|
45
|
+
label: StringConstructor;
|
|
46
|
+
hint: StringConstructor;
|
|
47
|
+
error: StringConstructor;
|
|
48
|
+
required: {
|
|
49
|
+
readonly type: BooleanConstructor;
|
|
50
|
+
readonly default: undefined;
|
|
51
|
+
};
|
|
52
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
|
+
controlId: StringConstructor;
|
|
56
|
+
label: StringConstructor;
|
|
57
|
+
hint: StringConstructor;
|
|
58
|
+
error: StringConstructor;
|
|
59
|
+
required: {
|
|
60
|
+
readonly type: BooleanConstructor;
|
|
61
|
+
readonly default: undefined;
|
|
62
|
+
};
|
|
63
|
+
}>> & Readonly<{}>, {
|
|
64
|
+
required: boolean;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export declare function decorate(props: FieldDecoration, id: string, content: VNodeChild, extraClass?: string, decorationId?: string): string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
}> | import("vue").VNodeArrayChildren | null;
|
|
69
|
+
export declare const TextField: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
70
|
+
options: {
|
|
71
|
+
type: PropType<readonly Option[]>;
|
|
72
|
+
default: () => never[];
|
|
73
|
+
};
|
|
74
|
+
modelValue: StringConstructor;
|
|
75
|
+
defaultValue: StringConstructor;
|
|
76
|
+
placeholder: StringConstructor;
|
|
77
|
+
label: StringConstructor;
|
|
78
|
+
hint: StringConstructor;
|
|
79
|
+
error: StringConstructor;
|
|
80
|
+
required: {
|
|
81
|
+
readonly type: BooleanConstructor;
|
|
82
|
+
readonly default: undefined;
|
|
83
|
+
};
|
|
84
|
+
}>, () => string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}> | import("vue").VNodeArrayChildren | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
87
|
+
'update:modelValue': (_value: string) => true;
|
|
88
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
89
|
+
options: {
|
|
90
|
+
type: PropType<readonly Option[]>;
|
|
91
|
+
default: () => never[];
|
|
92
|
+
};
|
|
93
|
+
modelValue: StringConstructor;
|
|
94
|
+
defaultValue: StringConstructor;
|
|
95
|
+
placeholder: StringConstructor;
|
|
96
|
+
label: StringConstructor;
|
|
97
|
+
hint: StringConstructor;
|
|
98
|
+
error: StringConstructor;
|
|
99
|
+
required: {
|
|
100
|
+
readonly type: BooleanConstructor;
|
|
101
|
+
readonly default: undefined;
|
|
102
|
+
};
|
|
103
|
+
}>> & Readonly<{
|
|
104
|
+
"onUpdate:modelValue"?: ((_value: string) => any) | undefined;
|
|
105
|
+
}>, {
|
|
106
|
+
required: boolean;
|
|
107
|
+
options: readonly Option[];
|
|
108
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
109
|
+
export declare const Textarea: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
110
|
+
options: {
|
|
111
|
+
type: PropType<readonly Option[]>;
|
|
112
|
+
default: () => never[];
|
|
113
|
+
};
|
|
114
|
+
modelValue: StringConstructor;
|
|
115
|
+
defaultValue: StringConstructor;
|
|
116
|
+
placeholder: StringConstructor;
|
|
117
|
+
label: StringConstructor;
|
|
118
|
+
hint: StringConstructor;
|
|
119
|
+
error: StringConstructor;
|
|
120
|
+
required: {
|
|
121
|
+
readonly type: BooleanConstructor;
|
|
122
|
+
readonly default: undefined;
|
|
123
|
+
};
|
|
124
|
+
}>, () => string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
125
|
+
[key: string]: any;
|
|
126
|
+
}> | import("vue").VNodeArrayChildren | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
127
|
+
'update:modelValue': (_value: string) => true;
|
|
128
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
129
|
+
options: {
|
|
130
|
+
type: PropType<readonly Option[]>;
|
|
131
|
+
default: () => never[];
|
|
132
|
+
};
|
|
133
|
+
modelValue: StringConstructor;
|
|
134
|
+
defaultValue: StringConstructor;
|
|
135
|
+
placeholder: StringConstructor;
|
|
136
|
+
label: StringConstructor;
|
|
137
|
+
hint: StringConstructor;
|
|
138
|
+
error: StringConstructor;
|
|
139
|
+
required: {
|
|
140
|
+
readonly type: BooleanConstructor;
|
|
141
|
+
readonly default: undefined;
|
|
142
|
+
};
|
|
143
|
+
}>> & Readonly<{
|
|
144
|
+
"onUpdate:modelValue"?: ((_value: string) => any) | undefined;
|
|
145
|
+
}>, {
|
|
146
|
+
required: boolean;
|
|
147
|
+
options: readonly Option[];
|
|
148
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
149
|
+
export declare const Select: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
150
|
+
options: {
|
|
151
|
+
type: PropType<readonly Option[]>;
|
|
152
|
+
default: () => never[];
|
|
153
|
+
};
|
|
154
|
+
modelValue: StringConstructor;
|
|
155
|
+
defaultValue: StringConstructor;
|
|
156
|
+
placeholder: StringConstructor;
|
|
157
|
+
label: StringConstructor;
|
|
158
|
+
hint: StringConstructor;
|
|
159
|
+
error: StringConstructor;
|
|
160
|
+
required: {
|
|
161
|
+
readonly type: BooleanConstructor;
|
|
162
|
+
readonly default: undefined;
|
|
163
|
+
};
|
|
164
|
+
}>, () => string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
}> | import("vue").VNodeArrayChildren | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
167
|
+
'update:modelValue': (_value: string) => true;
|
|
168
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
169
|
+
options: {
|
|
170
|
+
type: PropType<readonly Option[]>;
|
|
171
|
+
default: () => never[];
|
|
172
|
+
};
|
|
173
|
+
modelValue: StringConstructor;
|
|
174
|
+
defaultValue: StringConstructor;
|
|
175
|
+
placeholder: StringConstructor;
|
|
176
|
+
label: StringConstructor;
|
|
177
|
+
hint: StringConstructor;
|
|
178
|
+
error: StringConstructor;
|
|
179
|
+
required: {
|
|
180
|
+
readonly type: BooleanConstructor;
|
|
181
|
+
readonly default: undefined;
|
|
182
|
+
};
|
|
183
|
+
}>> & Readonly<{
|
|
184
|
+
"onUpdate:modelValue"?: ((_value: string) => any) | undefined;
|
|
185
|
+
}>, {
|
|
186
|
+
required: boolean;
|
|
187
|
+
options: readonly Option[];
|
|
188
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
189
|
+
export declare const Checkbox: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
190
|
+
modelValue: {
|
|
191
|
+
type: PropType<boolean | string>;
|
|
192
|
+
default: undefined;
|
|
193
|
+
};
|
|
194
|
+
defaultValue: {
|
|
195
|
+
type: PropType<boolean | string>;
|
|
196
|
+
default: boolean;
|
|
197
|
+
};
|
|
198
|
+
value: {
|
|
199
|
+
type: StringConstructor;
|
|
200
|
+
default: string;
|
|
201
|
+
};
|
|
202
|
+
readOnly: BooleanConstructor;
|
|
203
|
+
indeterminate: BooleanConstructor;
|
|
204
|
+
label: StringConstructor;
|
|
205
|
+
hint: StringConstructor;
|
|
206
|
+
error: StringConstructor;
|
|
207
|
+
required: {
|
|
208
|
+
readonly type: BooleanConstructor;
|
|
209
|
+
readonly default: undefined;
|
|
210
|
+
};
|
|
211
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
212
|
+
[key: string]: any;
|
|
213
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
214
|
+
'update:modelValue': (_value: boolean) => true;
|
|
215
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
216
|
+
modelValue: {
|
|
217
|
+
type: PropType<boolean | string>;
|
|
218
|
+
default: undefined;
|
|
219
|
+
};
|
|
220
|
+
defaultValue: {
|
|
221
|
+
type: PropType<boolean | string>;
|
|
222
|
+
default: boolean;
|
|
223
|
+
};
|
|
224
|
+
value: {
|
|
225
|
+
type: StringConstructor;
|
|
226
|
+
default: string;
|
|
227
|
+
};
|
|
228
|
+
readOnly: BooleanConstructor;
|
|
229
|
+
indeterminate: BooleanConstructor;
|
|
230
|
+
label: StringConstructor;
|
|
231
|
+
hint: StringConstructor;
|
|
232
|
+
error: StringConstructor;
|
|
233
|
+
required: {
|
|
234
|
+
readonly type: BooleanConstructor;
|
|
235
|
+
readonly default: undefined;
|
|
236
|
+
};
|
|
237
|
+
}>> & Readonly<{
|
|
238
|
+
"onUpdate:modelValue"?: ((_value: boolean) => any) | undefined;
|
|
239
|
+
}>, {
|
|
240
|
+
required: boolean;
|
|
241
|
+
modelValue: string | boolean;
|
|
242
|
+
defaultValue: string | boolean;
|
|
243
|
+
value: string;
|
|
244
|
+
readOnly: boolean;
|
|
245
|
+
indeterminate: boolean;
|
|
246
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
247
|
+
export declare const Radio: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
248
|
+
modelValue: {
|
|
249
|
+
type: PropType<boolean | string>;
|
|
250
|
+
default: undefined;
|
|
251
|
+
};
|
|
252
|
+
defaultValue: {
|
|
253
|
+
type: PropType<boolean | string>;
|
|
254
|
+
default: boolean;
|
|
255
|
+
};
|
|
256
|
+
value: {
|
|
257
|
+
type: StringConstructor;
|
|
258
|
+
default: string;
|
|
259
|
+
};
|
|
260
|
+
readOnly: BooleanConstructor;
|
|
261
|
+
indeterminate: BooleanConstructor;
|
|
262
|
+
label: StringConstructor;
|
|
263
|
+
hint: StringConstructor;
|
|
264
|
+
error: StringConstructor;
|
|
265
|
+
required: {
|
|
266
|
+
readonly type: BooleanConstructor;
|
|
267
|
+
readonly default: undefined;
|
|
268
|
+
};
|
|
269
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
270
|
+
[key: string]: any;
|
|
271
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
272
|
+
'update:modelValue': (_value: string) => true;
|
|
273
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
274
|
+
modelValue: {
|
|
275
|
+
type: PropType<boolean | string>;
|
|
276
|
+
default: undefined;
|
|
277
|
+
};
|
|
278
|
+
defaultValue: {
|
|
279
|
+
type: PropType<boolean | string>;
|
|
280
|
+
default: boolean;
|
|
281
|
+
};
|
|
282
|
+
value: {
|
|
283
|
+
type: StringConstructor;
|
|
284
|
+
default: string;
|
|
285
|
+
};
|
|
286
|
+
readOnly: BooleanConstructor;
|
|
287
|
+
indeterminate: BooleanConstructor;
|
|
288
|
+
label: StringConstructor;
|
|
289
|
+
hint: StringConstructor;
|
|
290
|
+
error: StringConstructor;
|
|
291
|
+
required: {
|
|
292
|
+
readonly type: BooleanConstructor;
|
|
293
|
+
readonly default: undefined;
|
|
294
|
+
};
|
|
295
|
+
}>> & Readonly<{
|
|
296
|
+
"onUpdate:modelValue"?: ((_value: string) => any) | undefined;
|
|
297
|
+
}>, {
|
|
298
|
+
required: boolean;
|
|
299
|
+
modelValue: string | boolean;
|
|
300
|
+
defaultValue: string | boolean;
|
|
301
|
+
value: string;
|
|
302
|
+
readOnly: boolean;
|
|
303
|
+
indeterminate: boolean;
|
|
304
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
305
|
+
export declare const Switch: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
306
|
+
modelValue: {
|
|
307
|
+
type: PropType<boolean | string>;
|
|
308
|
+
default: undefined;
|
|
309
|
+
};
|
|
310
|
+
defaultValue: {
|
|
311
|
+
type: PropType<boolean | string>;
|
|
312
|
+
default: boolean;
|
|
313
|
+
};
|
|
314
|
+
value: {
|
|
315
|
+
type: StringConstructor;
|
|
316
|
+
default: string;
|
|
317
|
+
};
|
|
318
|
+
readOnly: BooleanConstructor;
|
|
319
|
+
indeterminate: BooleanConstructor;
|
|
320
|
+
label: StringConstructor;
|
|
321
|
+
hint: StringConstructor;
|
|
322
|
+
error: StringConstructor;
|
|
323
|
+
required: {
|
|
324
|
+
readonly type: BooleanConstructor;
|
|
325
|
+
readonly default: undefined;
|
|
326
|
+
};
|
|
327
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
328
|
+
[key: string]: any;
|
|
329
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
330
|
+
'update:modelValue': (_value: boolean) => true;
|
|
331
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
332
|
+
modelValue: {
|
|
333
|
+
type: PropType<boolean | string>;
|
|
334
|
+
default: undefined;
|
|
335
|
+
};
|
|
336
|
+
defaultValue: {
|
|
337
|
+
type: PropType<boolean | string>;
|
|
338
|
+
default: boolean;
|
|
339
|
+
};
|
|
340
|
+
value: {
|
|
341
|
+
type: StringConstructor;
|
|
342
|
+
default: string;
|
|
343
|
+
};
|
|
344
|
+
readOnly: BooleanConstructor;
|
|
345
|
+
indeterminate: BooleanConstructor;
|
|
346
|
+
label: StringConstructor;
|
|
347
|
+
hint: StringConstructor;
|
|
348
|
+
error: StringConstructor;
|
|
349
|
+
required: {
|
|
350
|
+
readonly type: BooleanConstructor;
|
|
351
|
+
readonly default: undefined;
|
|
352
|
+
};
|
|
353
|
+
}>> & Readonly<{
|
|
354
|
+
"onUpdate:modelValue"?: ((_value: boolean) => any) | undefined;
|
|
355
|
+
}>, {
|
|
356
|
+
required: boolean;
|
|
357
|
+
modelValue: string | boolean;
|
|
358
|
+
defaultValue: string | boolean;
|
|
359
|
+
value: string;
|
|
360
|
+
readOnly: boolean;
|
|
361
|
+
indeterminate: boolean;
|
|
362
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
363
|
+
export declare const FileUpload: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
364
|
+
readonly label: StringConstructor;
|
|
365
|
+
readonly hint: StringConstructor;
|
|
366
|
+
readonly error: StringConstructor;
|
|
367
|
+
readonly required: {
|
|
368
|
+
readonly type: BooleanConstructor;
|
|
369
|
+
readonly default: undefined;
|
|
370
|
+
};
|
|
371
|
+
}>, () => string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
372
|
+
[key: string]: any;
|
|
373
|
+
}> | import("vue").VNodeArrayChildren | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
374
|
+
'update:files': (_files: File[]) => true;
|
|
375
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
376
|
+
readonly label: StringConstructor;
|
|
377
|
+
readonly hint: StringConstructor;
|
|
378
|
+
readonly error: StringConstructor;
|
|
379
|
+
readonly required: {
|
|
380
|
+
readonly type: BooleanConstructor;
|
|
381
|
+
readonly default: undefined;
|
|
382
|
+
};
|
|
383
|
+
}>> & Readonly<{
|
|
384
|
+
"onUpdate:files"?: ((_files: File[]) => any) | undefined;
|
|
385
|
+
}>, {
|
|
386
|
+
readonly required: boolean;
|
|
387
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
388
|
+
//# sourceMappingURL=forms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../src/forms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAyB,KAAK,MAAM,EAAE,MA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Props, nextTick, ref, useId, watchEffect } from 'vue';
|
|
2
|
+
import { observeReadonlyChoice } from '@hawiyah/core';
|
|
3
|
+
import { decorationProps, joinIds, provideField, useField, useFormReset, useValue } from './shared.js';
|
|
4
|
+
export const Button = defineComponent({
|
|
5
|
+
name: 'HwButton', inheritAttrs: false,
|
|
6
|
+
props: { variant: { type: String, default: 'primary' }, size: { type: String, default: 'md' }, loading: Boolean, disabled: Boolean, type: { type: String, default: 'button' } },
|
|
7
|
+
setup(props, { attrs, slots, expose }) {
|
|
8
|
+
const element = ref();
|
|
9
|
+
expose({ element, focus: () => element.value?.focus() });
|
|
10
|
+
return () => h('button', mergeProps(attrs, { ref: element, class: 'hw-button', type: props.type, disabled: props.disabled || props.loading, 'aria-busy': props.loading || attrs['aria-busy'], 'data-variant': props.variant, 'data-size': props.size }), slots.default?.());
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const Field = defineComponent({
|
|
14
|
+
name: 'HwField', inheritAttrs: false, props: { ...decorationProps, controlId: String },
|
|
15
|
+
setup(props, { attrs, slots }) {
|
|
16
|
+
const generated = `hw-${useId()}`;
|
|
17
|
+
const context = computed(() => ({ id: props.controlId ?? generated, labelId: props.label ? `${props.controlId ?? generated}-label` : undefined,
|
|
18
|
+
describedby: joinIds(props.hint && `${props.controlId ?? generated}-hint`, props.error && `${props.controlId ?? generated}-error`), invalid: Boolean(props.error), required: props.required }));
|
|
19
|
+
provideField(context);
|
|
20
|
+
return () => h('div', mergeProps(attrs, { class: 'hw-field' }), [
|
|
21
|
+
props.label && h('label', { class: 'hw-label', id: context.value.labelId, for: context.value.id }, [props.label, props.required && h('span', { class: 'hw-required-marker', 'aria-hidden': 'true' }, ' *')]),
|
|
22
|
+
slots.default?.(context.value),
|
|
23
|
+
props.hint && h('span', { class: 'hw-hint', id: `${context.value.id}-hint` }, props.hint),
|
|
24
|
+
props.error && h('span', { class: 'hw-error', id: `${context.value.id}-error` }, props.error),
|
|
25
|
+
]);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export function decorate(props, id, content, extraClass, decorationId = id) {
|
|
29
|
+
if (!props.label && !props.hint && !props.error && !extraClass)
|
|
30
|
+
return content;
|
|
31
|
+
return h('div', { class: ['hw-field', extraClass] }, [
|
|
32
|
+
props.label && h('label', { class: 'hw-label', id: `${decorationId}-label`, for: id }, [props.label, props.required && h('span', { class: 'hw-required-marker', 'aria-hidden': 'true' }, ' *')]), content,
|
|
33
|
+
props.hint && h('span', { class: 'hw-hint', id: `${decorationId}-hint` }, props.hint),
|
|
34
|
+
props.error && h('span', { class: 'hw-error', id: `${decorationId}-error` }, props.error),
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
const valueProps = { ...decorationProps, modelValue: String, defaultValue: String, placeholder: String };
|
|
38
|
+
function textControl(tag, className, name) {
|
|
39
|
+
return defineComponent({
|
|
40
|
+
name, inheritAttrs: false,
|
|
41
|
+
props: { ...valueProps, options: { type: Array, default: () => [] } },
|
|
42
|
+
emits: { 'update:modelValue': (_value) => true },
|
|
43
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
44
|
+
const field = useField(props, attrs, true);
|
|
45
|
+
const element = ref();
|
|
46
|
+
// Without a value or prompt, let a native select choose its first enabled option.
|
|
47
|
+
const initial = props.defaultValue ?? (tag === 'select' ? undefined : '');
|
|
48
|
+
const model = useValue(() => props.modelValue, initial, value => {
|
|
49
|
+
if (value !== undefined)
|
|
50
|
+
emit('update:modelValue', value);
|
|
51
|
+
});
|
|
52
|
+
const syncSelect = () => nextTick(() => {
|
|
53
|
+
if (element.value && model.value.value !== undefined)
|
|
54
|
+
element.value.value = model.value.value;
|
|
55
|
+
});
|
|
56
|
+
useFormReset(element, () => {
|
|
57
|
+
model.set(props.defaultValue ?? (tag === 'select' ? element.value?.value : '') ?? '');
|
|
58
|
+
if (tag === 'select')
|
|
59
|
+
void syncSelect();
|
|
60
|
+
});
|
|
61
|
+
expose({ element, focus: () => element.value?.focus() });
|
|
62
|
+
return () => {
|
|
63
|
+
const slotOptions = tag === 'select' ? slots.default?.() : undefined;
|
|
64
|
+
const hasEmptyOption = props.options.some(option => option.value === '') || slotOptions?.some(node => node.type === 'option' && node.props?.value === '');
|
|
65
|
+
const prompt = props.placeholder && !hasEmptyOption && (attrs.multiple == null || attrs.multiple === false) ? h('option', { value: '' }, props.placeholder) : null;
|
|
66
|
+
const options = tag === 'select' ? [prompt, ...props.options.map(option => h('option', {
|
|
67
|
+
key: option.value, value: option.value, disabled: option.disabled,
|
|
68
|
+
selected: model.value.value === undefined ? undefined : model.value.value === option.value,
|
|
69
|
+
}, option.label)), slotOptions] : undefined;
|
|
70
|
+
const control = h(tag, mergeProps(attrs, field.controlAttrs.value, {
|
|
71
|
+
ref: element, class: className, placeholder: tag === 'select' ? undefined : props.placeholder,
|
|
72
|
+
...(model.value.value === undefined ? {} : { value: model.value.value }),
|
|
73
|
+
[tag === 'select' ? 'onChange' : 'onInput']: (event) => {
|
|
74
|
+
model.set(event.target.value);
|
|
75
|
+
if (tag === 'select')
|
|
76
|
+
void syncSelect();
|
|
77
|
+
},
|
|
78
|
+
}), options);
|
|
79
|
+
return decorate(props, field.id.value, control, undefined, field.decorationId.value);
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
export const TextField = textControl('input', 'hw-input', 'HwTextField');
|
|
85
|
+
export const Textarea = textControl('textarea', 'hw-textarea', 'HwTextarea');
|
|
86
|
+
export const Select = textControl('select', 'hw-select', 'HwSelect');
|
|
87
|
+
function choice(kind, normalize) {
|
|
88
|
+
return defineComponent({
|
|
89
|
+
name: `Hw${kind[0].toUpperCase()}${kind.slice(1)}`, inheritAttrs: false,
|
|
90
|
+
props: { ...decorationProps, modelValue: { type: [Boolean, String], default: undefined }, defaultValue: { type: [Boolean, String], default: false }, value: { type: String, default: 'on' }, readOnly: Boolean, indeterminate: Boolean },
|
|
91
|
+
emits: { 'update:modelValue': (_value) => true },
|
|
92
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
93
|
+
const field = useField(props, attrs);
|
|
94
|
+
const element = ref();
|
|
95
|
+
const model = useValue(() => props.modelValue, props.defaultValue, value => emit('update:modelValue', normalize(value)));
|
|
96
|
+
const syncDefault = () => {
|
|
97
|
+
const input = element.value;
|
|
98
|
+
if (kind !== 'radio' || !input)
|
|
99
|
+
return;
|
|
100
|
+
const selected = props.defaultValue === props.value;
|
|
101
|
+
if (input.defaultChecked !== selected)
|
|
102
|
+
input.defaultChecked = selected;
|
|
103
|
+
};
|
|
104
|
+
useFormReset(element, () => {
|
|
105
|
+
const input = element.value;
|
|
106
|
+
if (kind !== 'radio' || !input?.form) {
|
|
107
|
+
model.set(props.defaultValue);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const peers = input.name ? Array.from(input.form.elements).filter((node) => node.matches('input[type="radio" i]') && node.getAttribute('name') === input.name) : [input];
|
|
111
|
+
const checked = peers.find(peer => peer.checked);
|
|
112
|
+
const restored = checked?.value ?? '';
|
|
113
|
+
// A group has one reset result. Its other members synchronize silently
|
|
114
|
+
// so an unchecked sibling cannot replace the selected default.
|
|
115
|
+
if ((checked ?? peers[0]) === input)
|
|
116
|
+
model.set(restored);
|
|
117
|
+
else
|
|
118
|
+
model.sync(restored);
|
|
119
|
+
});
|
|
120
|
+
let readonlyGuard;
|
|
121
|
+
onMounted(() => { if (element.value)
|
|
122
|
+
readonlyGuard = observeReadonlyChoice(element.value); syncDefault(); });
|
|
123
|
+
onUpdated(() => { readonlyGuard?.refresh(); syncDefault(); });
|
|
124
|
+
onBeforeUnmount(() => readonlyGuard?.destroy());
|
|
125
|
+
watchEffect(() => { if (element.value)
|
|
126
|
+
element.value.indeterminate = kind === 'checkbox' && props.indeterminate; });
|
|
127
|
+
expose({ element, focus: () => element.value?.focus() });
|
|
128
|
+
return () => h('div', { class: 'hw-field' }, [
|
|
129
|
+
h('label', { class: 'hw-choice', for: field.id.value, id: props.label ? `${field.id.value}-label` : undefined }, [
|
|
130
|
+
h('input', mergeProps(attrs, field.controlAttrs.value, { ref: element, class: `hw-${kind}`, type: kind === 'radio' ? 'radio' : 'checkbox', role: kind === 'switch' ? 'switch' : attrs.role,
|
|
131
|
+
readOnly: props.readOnly, 'aria-disabled': props.readOnly || attrs['aria-disabled'], value: props.value, checked: kind === 'radio' ? model.value.value === props.value : Boolean(model.value.value),
|
|
132
|
+
onChange: (event) => { if (!props.readOnly)
|
|
133
|
+
model.set(kind === 'radio' ? props.value : event.target.checked); } })),
|
|
134
|
+
props.label ?? slots.default?.(),
|
|
135
|
+
]),
|
|
136
|
+
props.hint && h('span', { class: 'hw-hint', id: `${field.id.value}-hint` }, props.hint),
|
|
137
|
+
props.error && h('span', { class: 'hw-error', id: `${field.id.value}-error` }, props.error),
|
|
138
|
+
]);
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
export const Checkbox = choice('checkbox', Boolean);
|
|
143
|
+
export const Radio = choice('radio', value => typeof value === 'string' ? value : '');
|
|
144
|
+
export const Switch = choice('switch', Boolean);
|
|
145
|
+
export const FileUpload = defineComponent({
|
|
146
|
+
name: 'HwFileUpload', inheritAttrs: false, props: decorationProps,
|
|
147
|
+
emits: { 'update:files': (_files) => true },
|
|
148
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
149
|
+
const field = useField(props, attrs);
|
|
150
|
+
const element = ref();
|
|
151
|
+
useFormReset(element, () => emit('update:files', []));
|
|
152
|
+
expose({ element, focus: () => element.value?.focus() });
|
|
153
|
+
return () => decorate(props, field.id.value, [h('input', mergeProps(attrs, field.controlAttrs.value, { ref: element, class: 'hw-input', type: 'file', onChange: (event) => emit('update:files', Array.from(event.target.files ?? [])) })), slots.default?.()], 'hw-upload');
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../src/forms.ts"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