pukaad-ui-lib 1.249.0 → 1.251.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/image/image-cropper.d.vue.ts +2 -2
- package/dist/runtime/components/image/image-cropper.vue.d.ts +2 -2
- package/dist/runtime/components/input/input-checkbox.d.vue.ts +4 -0
- package/dist/runtime/components/input/input-checkbox.vue +13 -14
- package/dist/runtime/components/input/input-checkbox.vue.d.ts +4 -0
- package/dist/runtime/components/input/input-radio.vue +23 -55
- package/dist/runtime/components/ui/checkbox/Checkbox.vue +4 -11
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
+
background: boolean;
|
|
68
|
+
modal: boolean;
|
|
67
69
|
responsive: boolean;
|
|
68
70
|
restore: boolean;
|
|
69
71
|
checkCrossOrigin: boolean;
|
|
70
72
|
checkOrientation: boolean;
|
|
71
73
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
-
modal: boolean;
|
|
73
74
|
guides: boolean;
|
|
74
75
|
highlight: boolean;
|
|
75
|
-
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
|
|
|
64
64
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
|
|
65
65
|
src: string;
|
|
66
66
|
center: boolean;
|
|
67
|
+
background: boolean;
|
|
68
|
+
modal: boolean;
|
|
67
69
|
responsive: boolean;
|
|
68
70
|
restore: boolean;
|
|
69
71
|
checkCrossOrigin: boolean;
|
|
70
72
|
checkOrientation: boolean;
|
|
71
73
|
crossorigin: "" | "anonymous" | "use-credentials";
|
|
72
|
-
modal: boolean;
|
|
73
74
|
guides: boolean;
|
|
74
75
|
highlight: boolean;
|
|
75
|
-
background: boolean;
|
|
76
76
|
autoCrop: boolean;
|
|
77
77
|
movable: boolean;
|
|
78
78
|
rotatable: boolean;
|
|
@@ -4,6 +4,8 @@ export interface InputCheckboxProps {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
rules?: object | string | Function;
|
|
6
6
|
indeterminate?: boolean;
|
|
7
|
+
labelPosition?: 'left' | 'right';
|
|
8
|
+
size?: number;
|
|
7
9
|
}
|
|
8
10
|
type __VLS_Props = InputCheckboxProps;
|
|
9
11
|
type __VLS_ModelProps = {
|
|
@@ -15,8 +17,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
15
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
18
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
17
19
|
}>, {
|
|
20
|
+
size: number;
|
|
18
21
|
name: string;
|
|
19
22
|
indeterminate: boolean;
|
|
23
|
+
labelPosition: "left" | "right";
|
|
20
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
25
|
declare const _default: typeof __VLS_export;
|
|
22
26
|
export default _default;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ShadFormField
|
|
3
|
-
:name="props.name"
|
|
4
|
-
:rules="props.rules || defaultRules"
|
|
5
|
-
v-slot="{ componentField }"
|
|
6
|
-
>
|
|
2
|
+
<ShadFormField :name="props.name" :rules="props.rules || defaultRules" v-slot="{ componentField }">
|
|
7
3
|
<ShadFormItem>
|
|
8
4
|
<ShadFormControl>
|
|
9
|
-
<div class="flex gap-2 items-center"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
:
|
|
14
|
-
/>
|
|
5
|
+
<div class="flex gap-2 items-center" :class="[
|
|
6
|
+
props.labelPosition === 'left' ? 'flex-row-reverse justify-between w-full' : ''
|
|
7
|
+
]">
|
|
8
|
+
<ShadCheckbox v-bind="componentField" v-model="modelValue" :indeterminate="props.indeterminate"
|
|
9
|
+
:style="{ width: `${props.size}px`, height: `${props.size}px` }" />
|
|
15
10
|
<ShadFormLabel
|
|
16
|
-
class="font-body-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
17
|
-
|
|
11
|
+
class="font-body-medium text-black leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer"
|
|
12
|
+
:class="[
|
|
13
|
+
props.labelPosition === 'left' ? 'flex-1' : ''
|
|
14
|
+
]">
|
|
18
15
|
{{ props.label }}
|
|
19
16
|
</ShadFormLabel>
|
|
20
17
|
</div>
|
|
@@ -29,7 +26,9 @@ const props = defineProps({
|
|
|
29
26
|
name: { type: String, required: false, default: "input-checkbox" },
|
|
30
27
|
label: { type: String, required: false },
|
|
31
28
|
rules: { type: [Object, String, Function], required: false },
|
|
32
|
-
indeterminate: { type: Boolean, required: false, default: false }
|
|
29
|
+
indeterminate: { type: Boolean, required: false, default: false },
|
|
30
|
+
labelPosition: { type: String, required: false, default: "right" },
|
|
31
|
+
size: { type: Number, required: false, default: 18 }
|
|
33
32
|
});
|
|
34
33
|
const defaultRules = () => true;
|
|
35
34
|
const modelValue = defineModel({ type: Boolean, ...{
|
|
@@ -4,6 +4,8 @@ export interface InputCheckboxProps {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
rules?: object | string | Function;
|
|
6
6
|
indeterminate?: boolean;
|
|
7
|
+
labelPosition?: 'left' | 'right';
|
|
8
|
+
size?: number;
|
|
7
9
|
}
|
|
8
10
|
type __VLS_Props = InputCheckboxProps;
|
|
9
11
|
type __VLS_ModelProps = {
|
|
@@ -15,8 +17,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
15
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
18
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
17
19
|
}>, {
|
|
20
|
+
size: number;
|
|
18
21
|
name: string;
|
|
19
22
|
indeterminate: boolean;
|
|
23
|
+
labelPosition: "left" | "right";
|
|
20
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
25
|
declare const _default: typeof __VLS_export;
|
|
22
26
|
export default _default;
|
|
@@ -1,54 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Field
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
:standalone="props.standalone"
|
|
6
|
-
:rules="rules"
|
|
7
|
-
v-model="modelValue"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
:class="[layout, layoutGapClass]"
|
|
11
|
-
:style="{
|
|
2
|
+
<Field :name="props.name" v-slot="{ field, errorMessage }" :standalone="props.standalone" :rules="rules"
|
|
3
|
+
v-model="modelValue">
|
|
4
|
+
<div :class="[layout, layoutGapClass]" :style="{
|
|
12
5
|
gap: layoutGapStyle
|
|
13
|
-
}"
|
|
14
|
-
>
|
|
6
|
+
}">
|
|
15
7
|
<template v-if="items.length > 0" v-for="(item, i) in items" :key="i">
|
|
16
8
|
<slot name="default" :item="item">
|
|
17
|
-
<label
|
|
18
|
-
|
|
19
|
-
'flex items-center font-body-large',
|
|
9
|
+
<label :class="[
|
|
10
|
+
'flex items-center font-body-medium text-black',
|
|
20
11
|
columnGapClass,
|
|
21
12
|
cursor
|
|
22
|
-
]"
|
|
23
|
-
:style="{ gap: columnGapStyle }"
|
|
24
|
-
>
|
|
13
|
+
]" :style="{ gap: columnGapStyle }">
|
|
25
14
|
<template v-if="props.labelPosition == 'left'">
|
|
26
|
-
<slot
|
|
27
|
-
:name="`label-${typeof item === 'object' ? item.value : item}-text`"
|
|
28
|
-
>
|
|
15
|
+
<slot :name="`label-${typeof item === 'object' ? item.value : item}-text`">
|
|
29
16
|
{{ typeof item === "object" ? item.label : item }}
|
|
30
17
|
</slot>
|
|
31
18
|
</template>
|
|
32
19
|
|
|
33
|
-
<input
|
|
34
|
-
|
|
35
|
-
:
|
|
36
|
-
|
|
37
|
-
:name="props.name"
|
|
38
|
-
:style="{ width: `${props.size}px`, height: `${props.size}px` }"
|
|
39
|
-
:value="typeof item === 'object' ? item.value : item"
|
|
40
|
-
:disabled="
|
|
20
|
+
<input v-bind="field"
|
|
21
|
+
:class="['appearance-none rounded-full border border-black bg-white shrink-0 checked:border-primary checked:border-[5px] cursor-pointer', cursor]"
|
|
22
|
+
type="radio" :name="props.name" :style="{ width: `${props.size}px`, height: `${props.size}px` }"
|
|
23
|
+
:value="typeof item === 'object' ? item.value : item" :disabled="
|
|
41
24
|
props.disabled || typeof item === 'object' && item.disabled
|
|
42
|
-
"
|
|
43
|
-
:checked="
|
|
25
|
+
" :checked="
|
|
44
26
|
modelValue === (typeof item === 'object' ? item.value : item)
|
|
45
|
-
"
|
|
46
|
-
/>
|
|
27
|
+
" />
|
|
47
28
|
|
|
48
29
|
<template v-if="props.labelPosition == 'right'">
|
|
49
|
-
<slot
|
|
50
|
-
:name="`label-${typeof item === 'object' ? item.value : item}-text`"
|
|
51
|
-
>
|
|
30
|
+
<slot :name="`label-${typeof item === 'object' ? item.value : item}-text`">
|
|
52
31
|
{{ typeof item === "object" ? item.label : item }}
|
|
53
32
|
</slot>
|
|
54
33
|
</template>
|
|
@@ -57,29 +36,21 @@
|
|
|
57
36
|
</template>
|
|
58
37
|
<template v-else>
|
|
59
38
|
<slot name="default" :item="item">
|
|
60
|
-
<label
|
|
61
|
-
|
|
62
|
-
'flex items-center font-body-large',
|
|
39
|
+
<label :class="[
|
|
40
|
+
'flex items-center font-body-medium text-black',
|
|
63
41
|
columnGapClass,
|
|
64
42
|
cursor
|
|
65
|
-
]"
|
|
66
|
-
:style="{ gap: columnGapStyle }"
|
|
67
|
-
>
|
|
43
|
+
]" :style="{ gap: columnGapStyle }">
|
|
68
44
|
<template v-if="props.labelPosition == 'left'">
|
|
69
45
|
<slot :name="`label-${item}-text`">
|
|
70
46
|
{{ item }}
|
|
71
47
|
</slot>
|
|
72
48
|
</template>
|
|
73
49
|
|
|
74
|
-
<input
|
|
75
|
-
|
|
76
|
-
:
|
|
77
|
-
|
|
78
|
-
:name="props.name"
|
|
79
|
-
:style="{ width: `${props.size}px`, height: `${props.size}px` }"
|
|
80
|
-
:value="item"
|
|
81
|
-
:disabled="props.disabled"
|
|
82
|
-
/>
|
|
50
|
+
<input v-bind="field"
|
|
51
|
+
:class="['appearance-none rounded-full border border-black bg-white shrink-0 checked:border-primary checked:border-[5px] cursor-pointer', cursor]"
|
|
52
|
+
type="radio" :name="props.name" :style="{ width: `${props.size}px`, height: `${props.size}px` }"
|
|
53
|
+
:value="item" :disabled="props.disabled" />
|
|
83
54
|
|
|
84
55
|
<template v-if="props.labelPosition == 'right'">
|
|
85
56
|
<slot :name="`label-${item}-text`">
|
|
@@ -90,10 +61,7 @@
|
|
|
90
61
|
</slot>
|
|
91
62
|
</template>
|
|
92
63
|
|
|
93
|
-
<div
|
|
94
|
-
v-if="!props.disabledErrorMessage && errorMessage"
|
|
95
|
-
class="font-body-small text-error"
|
|
96
|
-
>
|
|
64
|
+
<div v-if="!props.disabledErrorMessage && errorMessage" class="font-body-small text-error">
|
|
97
65
|
<slot name="error">
|
|
98
66
|
{{ errorMessage }}
|
|
99
67
|
</slot>
|
|
@@ -21,20 +21,13 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<template>
|
|
24
|
-
<CheckboxRoot
|
|
25
|
-
data-slot="checkbox"
|
|
26
|
-
v-bind="forwarded"
|
|
27
|
-
:class="
|
|
24
|
+
<CheckboxRoot data-slot="checkbox" v-bind="forwarded" :class="
|
|
28
25
|
cn(
|
|
29
|
-
'flex items-center justify-center peer border-
|
|
26
|
+
'flex items-center justify-center peer border-black data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[2px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
30
27
|
props.class
|
|
31
28
|
)
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
<CheckboxIndicator
|
|
35
|
-
data-slot="checkbox-indicator"
|
|
36
|
-
class="grid place-content-center text-current transition-none"
|
|
37
|
-
>
|
|
29
|
+
">
|
|
30
|
+
<CheckboxIndicator data-slot="checkbox-indicator" class="grid place-content-center text-current transition-none">
|
|
38
31
|
<slot>
|
|
39
32
|
<Icon v-if="props.indeterminate" name="lucide:minus" size="16" />
|
|
40
33
|
<Icon v-else name="lucide:check" />
|