@destyler/checkbox 0.0.3 → 0.0.4

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.
@@ -1,4 +1,346 @@
1
- export { DestylerCheckboxIndicator, DestylerCheckboxIndicatorProps, DestylerCheckboxRoot, DestylerCheckboxRootProps } from './index.mjs';
2
- import 'vue';
3
- import '@destyler/primitive';
4
- import '@destyler/shared';
1
+ import * as vue from 'vue';
2
+ import { PropType, Ref } from 'vue';
3
+ import * as _destyler_primitive from '@destyler/primitive';
4
+ import { ExtractPublicPropTypes } from '@destyler/shared';
5
+
6
+ type CheckedState = boolean | 'indeterminate';
7
+
8
+ declare const checkboxRootProps: {
9
+ /**
10
+ * @default button
11
+ */
12
+ readonly as: {
13
+ readonly default: "button";
14
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
15
+ readonly required: false;
16
+ };
17
+ /**
18
+ * The checked state of the checkbox when it is initially rendered.
19
+ * Use when you do not need to control its checked state.
20
+ */
21
+ readonly defaultChecked: {
22
+ readonly type: PropType<boolean>;
23
+ readonly required: false;
24
+ };
25
+ /**
26
+ * The controlled checked state of the checkbox. Can be binded with `v-model`.
27
+ *
28
+ * @default undefined
29
+ */
30
+ readonly checked: {
31
+ readonly type: PropType<boolean | "indeterminate">;
32
+ readonly required: false;
33
+ readonly default: undefined;
34
+ };
35
+ /**
36
+ * When `true`, prevents the user from interacting with the checkbox.
37
+ *
38
+ * @default false
39
+ */
40
+ readonly disabled: {
41
+ readonly type: PropType<boolean>;
42
+ readonly required: false;
43
+ readonly default: false;
44
+ };
45
+ /**
46
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
47
+ */
48
+ readonly required: {
49
+ readonly type: PropType<boolean>;
50
+ readonly required: false;
51
+ };
52
+ /**
53
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
54
+ */
55
+ readonly name: {
56
+ readonly type: PropType<string>;
57
+ readonly required: false;
58
+ };
59
+ /**
60
+ * The value given as data when submitted with a `name`.
61
+ *
62
+ * @default on
63
+ */
64
+ readonly value: {
65
+ readonly type: PropType<string>;
66
+ readonly required: false;
67
+ readonly default: "on";
68
+ };
69
+ /**
70
+ * Id of the element
71
+ */
72
+ readonly id: {
73
+ readonly type: PropType<string>;
74
+ readonly required: false;
75
+ };
76
+ readonly asChild: {
77
+ readonly type: PropType<boolean>;
78
+ readonly required: false;
79
+ readonly default: false;
80
+ };
81
+ };
82
+ type CheckboxRootProps = ExtractPublicPropTypes<typeof checkboxRootProps>;
83
+ declare const checkboxRootEmits: {
84
+ /**
85
+ * Event handler called when the checked state of the checkbox changes.
86
+ */
87
+ 'update:checked': (_checked: boolean) => boolean;
88
+ };
89
+ interface CheckboxRootContext {
90
+ disabled: Ref<boolean>;
91
+ state: Ref<CheckedState>;
92
+ }
93
+ declare const CheckboxRoot: vue.DefineComponent<{
94
+ /**
95
+ * @default button
96
+ */
97
+ readonly as: {
98
+ readonly default: "button";
99
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
100
+ readonly required: false;
101
+ };
102
+ /**
103
+ * The checked state of the checkbox when it is initially rendered.
104
+ * Use when you do not need to control its checked state.
105
+ */
106
+ readonly defaultChecked: {
107
+ readonly type: PropType<boolean>;
108
+ readonly required: false;
109
+ };
110
+ /**
111
+ * The controlled checked state of the checkbox. Can be binded with `v-model`.
112
+ *
113
+ * @default undefined
114
+ */
115
+ readonly checked: {
116
+ readonly type: PropType<boolean | "indeterminate">;
117
+ readonly required: false;
118
+ readonly default: undefined;
119
+ };
120
+ /**
121
+ * When `true`, prevents the user from interacting with the checkbox.
122
+ *
123
+ * @default false
124
+ */
125
+ readonly disabled: {
126
+ readonly type: PropType<boolean>;
127
+ readonly required: false;
128
+ readonly default: false;
129
+ };
130
+ /**
131
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
132
+ */
133
+ readonly required: {
134
+ readonly type: PropType<boolean>;
135
+ readonly required: false;
136
+ };
137
+ /**
138
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
139
+ */
140
+ readonly name: {
141
+ readonly type: PropType<string>;
142
+ readonly required: false;
143
+ };
144
+ /**
145
+ * The value given as data when submitted with a `name`.
146
+ *
147
+ * @default on
148
+ */
149
+ readonly value: {
150
+ readonly type: PropType<string>;
151
+ readonly required: false;
152
+ readonly default: "on";
153
+ };
154
+ /**
155
+ * Id of the element
156
+ */
157
+ readonly id: {
158
+ readonly type: PropType<string>;
159
+ readonly required: false;
160
+ };
161
+ readonly asChild: {
162
+ readonly type: PropType<boolean>;
163
+ readonly required: false;
164
+ readonly default: false;
165
+ };
166
+ }, {
167
+ disabled: Ref<false> | Ref<true>;
168
+ checked: Ref<CheckedState>;
169
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
170
+ isFormControl: vue.ComputedRef<boolean>;
171
+ ariaLabel: vue.ComputedRef<string | null | undefined>;
172
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
173
+ /**
174
+ * Event handler called when the checked state of the checkbox changes.
175
+ */
176
+ 'update:checked': (_checked: boolean) => boolean;
177
+ }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
178
+ /**
179
+ * @default button
180
+ */
181
+ readonly as: {
182
+ readonly default: "button";
183
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
184
+ readonly required: false;
185
+ };
186
+ /**
187
+ * The checked state of the checkbox when it is initially rendered.
188
+ * Use when you do not need to control its checked state.
189
+ */
190
+ readonly defaultChecked: {
191
+ readonly type: PropType<boolean>;
192
+ readonly required: false;
193
+ };
194
+ /**
195
+ * The controlled checked state of the checkbox. Can be binded with `v-model`.
196
+ *
197
+ * @default undefined
198
+ */
199
+ readonly checked: {
200
+ readonly type: PropType<boolean | "indeterminate">;
201
+ readonly required: false;
202
+ readonly default: undefined;
203
+ };
204
+ /**
205
+ * When `true`, prevents the user from interacting with the checkbox.
206
+ *
207
+ * @default false
208
+ */
209
+ readonly disabled: {
210
+ readonly type: PropType<boolean>;
211
+ readonly required: false;
212
+ readonly default: false;
213
+ };
214
+ /**
215
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
216
+ */
217
+ readonly required: {
218
+ readonly type: PropType<boolean>;
219
+ readonly required: false;
220
+ };
221
+ /**
222
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
223
+ */
224
+ readonly name: {
225
+ readonly type: PropType<string>;
226
+ readonly required: false;
227
+ };
228
+ /**
229
+ * The value given as data when submitted with a `name`.
230
+ *
231
+ * @default on
232
+ */
233
+ readonly value: {
234
+ readonly type: PropType<string>;
235
+ readonly required: false;
236
+ readonly default: "on";
237
+ };
238
+ /**
239
+ * Id of the element
240
+ */
241
+ readonly id: {
242
+ readonly type: PropType<string>;
243
+ readonly required: false;
244
+ };
245
+ readonly asChild: {
246
+ readonly type: PropType<boolean>;
247
+ readonly required: false;
248
+ readonly default: false;
249
+ };
250
+ }>> & {
251
+ "onUpdate:checked"?: ((_checked: boolean) => any) | undefined;
252
+ }, {
253
+ readonly checked: boolean | "indeterminate";
254
+ readonly as: _destyler_primitive.AsTag | vue.Component;
255
+ readonly disabled: boolean;
256
+ readonly value: string;
257
+ readonly asChild: boolean;
258
+ }, {}>;
259
+
260
+ declare const checkboxIndicatorProps: {
261
+ /**
262
+ * @default span
263
+ */
264
+ readonly as: {
265
+ readonly default: "span";
266
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
267
+ readonly required: false;
268
+ };
269
+ /**
270
+ * Used to force mounting when more control is needed.
271
+ * Useful when controlling animation with animation libraries.
272
+ *
273
+ * @default false
274
+ */
275
+ readonly forceMount: {
276
+ readonly type: PropType<boolean>;
277
+ readonly required: false;
278
+ readonly default: false;
279
+ };
280
+ readonly asChild: {
281
+ readonly type: PropType<boolean>;
282
+ readonly required: false;
283
+ readonly default: false;
284
+ };
285
+ };
286
+ type CheckboxIndicatorProps = ExtractPublicPropTypes<typeof checkboxIndicatorProps>;
287
+ declare const CheckboxIndicator: vue.DefineComponent<{
288
+ /**
289
+ * @default span
290
+ */
291
+ readonly as: {
292
+ readonly default: "span";
293
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
294
+ readonly required: false;
295
+ };
296
+ /**
297
+ * Used to force mounting when more control is needed.
298
+ * Useful when controlling animation with animation libraries.
299
+ *
300
+ * @default false
301
+ */
302
+ readonly forceMount: {
303
+ readonly type: PropType<boolean>;
304
+ readonly required: false;
305
+ readonly default: false;
306
+ };
307
+ readonly asChild: {
308
+ readonly type: PropType<boolean>;
309
+ readonly required: false;
310
+ readonly default: false;
311
+ };
312
+ }, {
313
+ rootContext: CheckboxRootContext;
314
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
315
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
316
+ /**
317
+ * @default span
318
+ */
319
+ readonly as: {
320
+ readonly default: "span";
321
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
322
+ readonly required: false;
323
+ };
324
+ /**
325
+ * Used to force mounting when more control is needed.
326
+ * Useful when controlling animation with animation libraries.
327
+ *
328
+ * @default false
329
+ */
330
+ readonly forceMount: {
331
+ readonly type: PropType<boolean>;
332
+ readonly required: false;
333
+ readonly default: false;
334
+ };
335
+ readonly asChild: {
336
+ readonly type: PropType<boolean>;
337
+ readonly required: false;
338
+ readonly default: false;
339
+ };
340
+ }>>, {
341
+ readonly as: _destyler_primitive.AsTag | vue.Component;
342
+ readonly asChild: boolean;
343
+ readonly forceMount: boolean;
344
+ }, {}>;
345
+
346
+ export { CheckboxIndicator, type CheckboxIndicatorProps, CheckboxRoot, type CheckboxRootProps, checkboxIndicatorProps, checkboxRootEmits, checkboxRootProps };
@@ -1,4 +1,346 @@
1
- export { DestylerCheckboxIndicator, DestylerCheckboxIndicatorProps, DestylerCheckboxRoot, DestylerCheckboxRootProps } from './index.js';
2
- import 'vue';
3
- import '@destyler/primitive';
4
- import '@destyler/shared';
1
+ import * as vue from 'vue';
2
+ import { PropType, Ref } from 'vue';
3
+ import * as _destyler_primitive from '@destyler/primitive';
4
+ import { ExtractPublicPropTypes } from '@destyler/shared';
5
+
6
+ type CheckedState = boolean | 'indeterminate';
7
+
8
+ declare const checkboxRootProps: {
9
+ /**
10
+ * @default button
11
+ */
12
+ readonly as: {
13
+ readonly default: "button";
14
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
15
+ readonly required: false;
16
+ };
17
+ /**
18
+ * The checked state of the checkbox when it is initially rendered.
19
+ * Use when you do not need to control its checked state.
20
+ */
21
+ readonly defaultChecked: {
22
+ readonly type: PropType<boolean>;
23
+ readonly required: false;
24
+ };
25
+ /**
26
+ * The controlled checked state of the checkbox. Can be binded with `v-model`.
27
+ *
28
+ * @default undefined
29
+ */
30
+ readonly checked: {
31
+ readonly type: PropType<boolean | "indeterminate">;
32
+ readonly required: false;
33
+ readonly default: undefined;
34
+ };
35
+ /**
36
+ * When `true`, prevents the user from interacting with the checkbox.
37
+ *
38
+ * @default false
39
+ */
40
+ readonly disabled: {
41
+ readonly type: PropType<boolean>;
42
+ readonly required: false;
43
+ readonly default: false;
44
+ };
45
+ /**
46
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
47
+ */
48
+ readonly required: {
49
+ readonly type: PropType<boolean>;
50
+ readonly required: false;
51
+ };
52
+ /**
53
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
54
+ */
55
+ readonly name: {
56
+ readonly type: PropType<string>;
57
+ readonly required: false;
58
+ };
59
+ /**
60
+ * The value given as data when submitted with a `name`.
61
+ *
62
+ * @default on
63
+ */
64
+ readonly value: {
65
+ readonly type: PropType<string>;
66
+ readonly required: false;
67
+ readonly default: "on";
68
+ };
69
+ /**
70
+ * Id of the element
71
+ */
72
+ readonly id: {
73
+ readonly type: PropType<string>;
74
+ readonly required: false;
75
+ };
76
+ readonly asChild: {
77
+ readonly type: PropType<boolean>;
78
+ readonly required: false;
79
+ readonly default: false;
80
+ };
81
+ };
82
+ type CheckboxRootProps = ExtractPublicPropTypes<typeof checkboxRootProps>;
83
+ declare const checkboxRootEmits: {
84
+ /**
85
+ * Event handler called when the checked state of the checkbox changes.
86
+ */
87
+ 'update:checked': (_checked: boolean) => boolean;
88
+ };
89
+ interface CheckboxRootContext {
90
+ disabled: Ref<boolean>;
91
+ state: Ref<CheckedState>;
92
+ }
93
+ declare const CheckboxRoot: vue.DefineComponent<{
94
+ /**
95
+ * @default button
96
+ */
97
+ readonly as: {
98
+ readonly default: "button";
99
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
100
+ readonly required: false;
101
+ };
102
+ /**
103
+ * The checked state of the checkbox when it is initially rendered.
104
+ * Use when you do not need to control its checked state.
105
+ */
106
+ readonly defaultChecked: {
107
+ readonly type: PropType<boolean>;
108
+ readonly required: false;
109
+ };
110
+ /**
111
+ * The controlled checked state of the checkbox. Can be binded with `v-model`.
112
+ *
113
+ * @default undefined
114
+ */
115
+ readonly checked: {
116
+ readonly type: PropType<boolean | "indeterminate">;
117
+ readonly required: false;
118
+ readonly default: undefined;
119
+ };
120
+ /**
121
+ * When `true`, prevents the user from interacting with the checkbox.
122
+ *
123
+ * @default false
124
+ */
125
+ readonly disabled: {
126
+ readonly type: PropType<boolean>;
127
+ readonly required: false;
128
+ readonly default: false;
129
+ };
130
+ /**
131
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
132
+ */
133
+ readonly required: {
134
+ readonly type: PropType<boolean>;
135
+ readonly required: false;
136
+ };
137
+ /**
138
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
139
+ */
140
+ readonly name: {
141
+ readonly type: PropType<string>;
142
+ readonly required: false;
143
+ };
144
+ /**
145
+ * The value given as data when submitted with a `name`.
146
+ *
147
+ * @default on
148
+ */
149
+ readonly value: {
150
+ readonly type: PropType<string>;
151
+ readonly required: false;
152
+ readonly default: "on";
153
+ };
154
+ /**
155
+ * Id of the element
156
+ */
157
+ readonly id: {
158
+ readonly type: PropType<string>;
159
+ readonly required: false;
160
+ };
161
+ readonly asChild: {
162
+ readonly type: PropType<boolean>;
163
+ readonly required: false;
164
+ readonly default: false;
165
+ };
166
+ }, {
167
+ disabled: Ref<false> | Ref<true>;
168
+ checked: Ref<CheckedState>;
169
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
170
+ isFormControl: vue.ComputedRef<boolean>;
171
+ ariaLabel: vue.ComputedRef<string | null | undefined>;
172
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
173
+ /**
174
+ * Event handler called when the checked state of the checkbox changes.
175
+ */
176
+ 'update:checked': (_checked: boolean) => boolean;
177
+ }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
178
+ /**
179
+ * @default button
180
+ */
181
+ readonly as: {
182
+ readonly default: "button";
183
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
184
+ readonly required: false;
185
+ };
186
+ /**
187
+ * The checked state of the checkbox when it is initially rendered.
188
+ * Use when you do not need to control its checked state.
189
+ */
190
+ readonly defaultChecked: {
191
+ readonly type: PropType<boolean>;
192
+ readonly required: false;
193
+ };
194
+ /**
195
+ * The controlled checked state of the checkbox. Can be binded with `v-model`.
196
+ *
197
+ * @default undefined
198
+ */
199
+ readonly checked: {
200
+ readonly type: PropType<boolean | "indeterminate">;
201
+ readonly required: false;
202
+ readonly default: undefined;
203
+ };
204
+ /**
205
+ * When `true`, prevents the user from interacting with the checkbox.
206
+ *
207
+ * @default false
208
+ */
209
+ readonly disabled: {
210
+ readonly type: PropType<boolean>;
211
+ readonly required: false;
212
+ readonly default: false;
213
+ };
214
+ /**
215
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
216
+ */
217
+ readonly required: {
218
+ readonly type: PropType<boolean>;
219
+ readonly required: false;
220
+ };
221
+ /**
222
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
223
+ */
224
+ readonly name: {
225
+ readonly type: PropType<string>;
226
+ readonly required: false;
227
+ };
228
+ /**
229
+ * The value given as data when submitted with a `name`.
230
+ *
231
+ * @default on
232
+ */
233
+ readonly value: {
234
+ readonly type: PropType<string>;
235
+ readonly required: false;
236
+ readonly default: "on";
237
+ };
238
+ /**
239
+ * Id of the element
240
+ */
241
+ readonly id: {
242
+ readonly type: PropType<string>;
243
+ readonly required: false;
244
+ };
245
+ readonly asChild: {
246
+ readonly type: PropType<boolean>;
247
+ readonly required: false;
248
+ readonly default: false;
249
+ };
250
+ }>> & {
251
+ "onUpdate:checked"?: ((_checked: boolean) => any) | undefined;
252
+ }, {
253
+ readonly checked: boolean | "indeterminate";
254
+ readonly as: _destyler_primitive.AsTag | vue.Component;
255
+ readonly disabled: boolean;
256
+ readonly value: string;
257
+ readonly asChild: boolean;
258
+ }, {}>;
259
+
260
+ declare const checkboxIndicatorProps: {
261
+ /**
262
+ * @default span
263
+ */
264
+ readonly as: {
265
+ readonly default: "span";
266
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
267
+ readonly required: false;
268
+ };
269
+ /**
270
+ * Used to force mounting when more control is needed.
271
+ * Useful when controlling animation with animation libraries.
272
+ *
273
+ * @default false
274
+ */
275
+ readonly forceMount: {
276
+ readonly type: PropType<boolean>;
277
+ readonly required: false;
278
+ readonly default: false;
279
+ };
280
+ readonly asChild: {
281
+ readonly type: PropType<boolean>;
282
+ readonly required: false;
283
+ readonly default: false;
284
+ };
285
+ };
286
+ type CheckboxIndicatorProps = ExtractPublicPropTypes<typeof checkboxIndicatorProps>;
287
+ declare const CheckboxIndicator: vue.DefineComponent<{
288
+ /**
289
+ * @default span
290
+ */
291
+ readonly as: {
292
+ readonly default: "span";
293
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
294
+ readonly required: false;
295
+ };
296
+ /**
297
+ * Used to force mounting when more control is needed.
298
+ * Useful when controlling animation with animation libraries.
299
+ *
300
+ * @default false
301
+ */
302
+ readonly forceMount: {
303
+ readonly type: PropType<boolean>;
304
+ readonly required: false;
305
+ readonly default: false;
306
+ };
307
+ readonly asChild: {
308
+ readonly type: PropType<boolean>;
309
+ readonly required: false;
310
+ readonly default: false;
311
+ };
312
+ }, {
313
+ rootContext: CheckboxRootContext;
314
+ forwardRef: (ref: Element | vue.ComponentPublicInstance | null) => void;
315
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
316
+ /**
317
+ * @default span
318
+ */
319
+ readonly as: {
320
+ readonly default: "span";
321
+ readonly type: PropType<_destyler_primitive.AsTag | vue.Component>;
322
+ readonly required: false;
323
+ };
324
+ /**
325
+ * Used to force mounting when more control is needed.
326
+ * Useful when controlling animation with animation libraries.
327
+ *
328
+ * @default false
329
+ */
330
+ readonly forceMount: {
331
+ readonly type: PropType<boolean>;
332
+ readonly required: false;
333
+ readonly default: false;
334
+ };
335
+ readonly asChild: {
336
+ readonly type: PropType<boolean>;
337
+ readonly required: false;
338
+ readonly default: false;
339
+ };
340
+ }>>, {
341
+ readonly as: _destyler_primitive.AsTag | vue.Component;
342
+ readonly asChild: boolean;
343
+ readonly forceMount: boolean;
344
+ }, {}>;
345
+
346
+ export { CheckboxIndicator, type CheckboxIndicatorProps, CheckboxRoot, type CheckboxRootProps, checkboxIndicatorProps, checkboxRootEmits, checkboxRootProps };