pukaad-ui-lib 1.30.0 → 1.32.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/input/input-file.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-password.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-password.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-slider.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-slider.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-personal-card-ID.vue +34 -61
- package/dist/runtime/components/modal/modal.d.vue.ts +9 -7
- package/dist/runtime/components/modal/modal.vue +5 -1
- package/dist/runtime/components/modal/modal.vue.d.ts +9 -7
- package/dist/runtime/components/picker/picker-image-profile.vue +100 -57
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu.d.vue.ts +0 -1
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu.vue +27 -32
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu.vue.d.ts +0 -1
- package/dist/runtime/components/ui/dialog/DialogContent.d.vue.ts +2 -0
- package/dist/runtime/components/ui/dialog/DialogContent.vue +5 -1
- package/dist/runtime/components/ui/dialog/DialogContent.vue.d.ts +2 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
label: string;
|
|
28
28
|
name: string;
|
|
29
29
|
limit: number;
|
|
30
|
-
accept: string;
|
|
31
30
|
disabledErrorMessage: boolean;
|
|
31
|
+
accept: string;
|
|
32
32
|
labelIcon: string;
|
|
33
33
|
disabledDrop: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
label: string;
|
|
28
28
|
name: string;
|
|
29
29
|
limit: number;
|
|
30
|
-
accept: string;
|
|
31
30
|
disabledErrorMessage: boolean;
|
|
31
|
+
accept: string;
|
|
32
32
|
labelIcon: string;
|
|
33
33
|
disabledDrop: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
18
18
|
}>, {
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
|
-
disabledForgotPassword: boolean;
|
|
22
21
|
new: boolean;
|
|
22
|
+
disabledForgotPassword: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
18
18
|
}>, {
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
|
-
disabledForgotPassword: boolean;
|
|
22
21
|
new: boolean;
|
|
22
|
+
disabledForgotPassword: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
color: InputSliderColor;
|
|
13
13
|
fullWidth: boolean;
|
|
14
14
|
label: string;
|
|
15
|
-
step: number;
|
|
16
15
|
min: number;
|
|
17
16
|
max: number;
|
|
17
|
+
step: number;
|
|
18
18
|
lineHeight: number | string;
|
|
19
19
|
appearance: boolean;
|
|
20
20
|
thumbSize: number | string;
|
|
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
color: InputSliderColor;
|
|
13
13
|
fullWidth: boolean;
|
|
14
14
|
label: string;
|
|
15
|
-
step: number;
|
|
16
15
|
min: number;
|
|
17
16
|
max: number;
|
|
17
|
+
step: number;
|
|
18
18
|
lineHeight: number | string;
|
|
19
19
|
appearance: boolean;
|
|
20
20
|
thumbSize: number | string;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Modal
|
|
3
3
|
:title="props.item ? '\u0E41\u0E01\u0E49\u0E44\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E1B\u0E23\u0E30\u0E0A\u0E32\u0E0A\u0E19' : '\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E1A\u0E31\u0E15\u0E23\u0E1B\u0E23\u0E30\u0E0A\u0E32\u0E0A\u0E19'"
|
|
4
|
-
|
|
5
|
-
divider
|
|
6
|
-
:gap="imageFile ? 0 : 16"
|
|
4
|
+
class="lg:max-w-[512px] gap-[24px]"
|
|
7
5
|
@close="onCancel"
|
|
8
6
|
v-model="isOpenModal"
|
|
9
7
|
>
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<div v-if="props.item"
|
|
8
|
+
<template #description v-if="!imageFile">
|
|
9
|
+
<ul
|
|
10
|
+
class="list-disc list-inside flex flex-col gap-[8px] font-body-medium-prominent text-gray"
|
|
11
|
+
>
|
|
12
|
+
<li>จัดวางรูปหน้าและตราครุฑตรงช่องกรอบ</li>
|
|
13
|
+
<li>ต้องชัดเจน อ่านง่าย ไม่เบลอ</li>
|
|
14
|
+
<li>มีแสงสว่างเพียงพอ และไม่มีแสงสะท้อน</li>
|
|
15
|
+
<li>ไม่มีนิ้วมือมาปิดบังบัตรประชาชน</li>
|
|
16
|
+
<li>บัตรประชาชนต้องไม่หมดอายุ</li>
|
|
17
|
+
</ul>
|
|
18
|
+
</template>
|
|
19
|
+
<div v-if="!imageFile" class="flex flex-col">
|
|
20
|
+
<div v-if="props.item">
|
|
23
21
|
<div class="relative w-[467px] h-[263px]">
|
|
24
22
|
<Image
|
|
25
23
|
:src="props.item"
|
|
@@ -47,7 +45,7 @@
|
|
|
47
45
|
</div>
|
|
48
46
|
</div>
|
|
49
47
|
</div>
|
|
50
|
-
<div v-else
|
|
48
|
+
<div v-else>
|
|
51
49
|
<input
|
|
52
50
|
ref="fileInputRef"
|
|
53
51
|
type="file"
|
|
@@ -112,20 +110,13 @@
|
|
|
112
110
|
</div>
|
|
113
111
|
</div>
|
|
114
112
|
<div class="p-[16px] flex gap-[40px] items-center">
|
|
115
|
-
<div class="flex gap-[
|
|
113
|
+
<div class="flex gap-[8px] items-center">
|
|
116
114
|
<div>
|
|
117
115
|
<Icon name="lucide:zoom-in" :size="20" />
|
|
118
116
|
</div>
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
:disabled="!imageFile"
|
|
123
|
-
@click="onZoomOut"
|
|
124
|
-
>
|
|
125
|
-
<div>
|
|
126
|
-
<Icon name="f7:minus" :size="16" />
|
|
127
|
-
</div>
|
|
128
|
-
</Button>
|
|
117
|
+
<div class="cursor-pointer" @click="onZoomOut">
|
|
118
|
+
<Icon name="f7:minus" :size="20" />
|
|
119
|
+
</div>
|
|
129
120
|
<InputSlider
|
|
130
121
|
:thumb-size="16"
|
|
131
122
|
:min="isZoomMin"
|
|
@@ -135,31 +126,17 @@
|
|
|
135
126
|
full-width
|
|
136
127
|
v-model="isZoom"
|
|
137
128
|
/>
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
:disabled="!imageFile"
|
|
142
|
-
@click="onZoomIn"
|
|
143
|
-
>
|
|
144
|
-
<div>
|
|
145
|
-
<Icon name="f7:plus" :size="16" />
|
|
146
|
-
</div>
|
|
147
|
-
</Button>
|
|
129
|
+
<div class="cursor-pointer" @click="onZoomIn">
|
|
130
|
+
<Icon name="f7:plus" :size="20" />
|
|
131
|
+
</div>
|
|
148
132
|
</div>
|
|
149
|
-
<div class="flex gap-[
|
|
133
|
+
<div class="flex gap-[8px] items-center">
|
|
150
134
|
<div>
|
|
151
135
|
<Icon name="lucide:refresh-cw" :size="20" />
|
|
152
136
|
</div>
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
:disabled="!imageFile"
|
|
157
|
-
@click="onRotateLeft"
|
|
158
|
-
>
|
|
159
|
-
<div>
|
|
160
|
-
<Icon name="f7:minus" size="16" />
|
|
161
|
-
</div>
|
|
162
|
-
</Button>
|
|
137
|
+
<div class="cursor-pointer" @click="onRotateLeft">
|
|
138
|
+
<Icon name="f7:minus" :size="20" />
|
|
139
|
+
</div>
|
|
163
140
|
<InputSlider
|
|
164
141
|
:thumb-size="16"
|
|
165
142
|
:min="isRotateMin"
|
|
@@ -169,24 +146,20 @@
|
|
|
169
146
|
full-width
|
|
170
147
|
v-model="isRotate"
|
|
171
148
|
/>
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
:disabled="!imageFile"
|
|
176
|
-
@click="onRotateRight"
|
|
177
|
-
aria-label="หมุนขวา"
|
|
178
|
-
>
|
|
179
|
-
<Icon name="f7:plus" :size="16" />
|
|
180
|
-
</Button>
|
|
149
|
+
<div class="cursor-pointer" @click="onRotateRight">
|
|
150
|
+
<Icon name="f7:plus" :size="20" />
|
|
151
|
+
</div>
|
|
181
152
|
</div>
|
|
182
153
|
</div>
|
|
183
154
|
</div>
|
|
184
155
|
<template #footer>
|
|
185
|
-
<div class="flex gap-[16px]
|
|
186
|
-
<Button variant="outline"
|
|
156
|
+
<div class="flex gap-[16px]">
|
|
157
|
+
<Button variant="outline" class="w-[224px]" @click="onCancel"
|
|
158
|
+
>ยกเลิก</Button
|
|
159
|
+
>
|
|
187
160
|
<Button
|
|
188
161
|
color="primary"
|
|
189
|
-
|
|
162
|
+
class="w-[224px]"
|
|
190
163
|
:disabled="!imageFile"
|
|
191
164
|
@click="onCropImage"
|
|
192
165
|
>
|
|
@@ -11,29 +11,31 @@ type __VLS_ModelProps = {
|
|
|
11
11
|
modelValue?: boolean;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
-
declare var
|
|
14
|
+
declare var __VLS_21: {}, __VLS_28: {}, __VLS_35: {}, __VLS_37: {
|
|
15
15
|
meta: any;
|
|
16
|
-
},
|
|
16
|
+
}, __VLS_44: {
|
|
17
17
|
meta: any;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
20
|
-
header?: (props: typeof
|
|
20
|
+
header?: (props: typeof __VLS_21) => any;
|
|
21
21
|
} & {
|
|
22
|
-
title?: (props: typeof
|
|
22
|
+
title?: (props: typeof __VLS_28) => any;
|
|
23
23
|
} & {
|
|
24
|
-
description?: (props: typeof
|
|
24
|
+
description?: (props: typeof __VLS_35) => any;
|
|
25
25
|
} & {
|
|
26
|
-
default?: (props: typeof
|
|
26
|
+
default?: (props: typeof __VLS_37) => any;
|
|
27
27
|
} & {
|
|
28
|
-
footer?: (props: typeof
|
|
28
|
+
footer?: (props: typeof __VLS_44) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
31
|
"update:modelValue": (value: boolean) => any;
|
|
32
32
|
} & {
|
|
33
33
|
submit: () => any;
|
|
34
|
+
close: () => any;
|
|
34
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
36
|
onSubmit?: (() => any) | undefined;
|
|
36
37
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
onClose?: (() => any) | undefined;
|
|
37
39
|
}>, {
|
|
38
40
|
disabledCloseBtn: boolean;
|
|
39
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:disabled-close-btn="props.disabledCloseBtn"
|
|
6
6
|
v-slot="{ meta }"
|
|
7
7
|
@submit="onSubmit"
|
|
8
|
+
@close="onClose"
|
|
8
9
|
>
|
|
9
10
|
<ShadDialogHeader>
|
|
10
11
|
<slot name="header">
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
</template>
|
|
30
31
|
|
|
31
32
|
<script setup>
|
|
32
|
-
const emits = defineEmits(["submit"]);
|
|
33
|
+
const emits = defineEmits(["submit", "close"]);
|
|
33
34
|
const props = defineProps({
|
|
34
35
|
class: { type: null, required: false },
|
|
35
36
|
title: { type: String, required: false },
|
|
@@ -43,4 +44,7 @@ const isOpen = defineModel({ type: Boolean, ...{
|
|
|
43
44
|
const onSubmit = (e) => {
|
|
44
45
|
emits("submit");
|
|
45
46
|
};
|
|
47
|
+
const onClose = () => {
|
|
48
|
+
emits("close");
|
|
49
|
+
};
|
|
46
50
|
</script>
|
|
@@ -11,29 +11,31 @@ type __VLS_ModelProps = {
|
|
|
11
11
|
modelValue?: boolean;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
-
declare var
|
|
14
|
+
declare var __VLS_21: {}, __VLS_28: {}, __VLS_35: {}, __VLS_37: {
|
|
15
15
|
meta: any;
|
|
16
|
-
},
|
|
16
|
+
}, __VLS_44: {
|
|
17
17
|
meta: any;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
20
|
-
header?: (props: typeof
|
|
20
|
+
header?: (props: typeof __VLS_21) => any;
|
|
21
21
|
} & {
|
|
22
|
-
title?: (props: typeof
|
|
22
|
+
title?: (props: typeof __VLS_28) => any;
|
|
23
23
|
} & {
|
|
24
|
-
description?: (props: typeof
|
|
24
|
+
description?: (props: typeof __VLS_35) => any;
|
|
25
25
|
} & {
|
|
26
|
-
default?: (props: typeof
|
|
26
|
+
default?: (props: typeof __VLS_37) => any;
|
|
27
27
|
} & {
|
|
28
|
-
footer?: (props: typeof
|
|
28
|
+
footer?: (props: typeof __VLS_44) => any;
|
|
29
29
|
};
|
|
30
30
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
31
|
"update:modelValue": (value: boolean) => any;
|
|
32
32
|
} & {
|
|
33
33
|
submit: () => any;
|
|
34
|
+
close: () => any;
|
|
34
35
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
36
|
onSubmit?: (() => any) | undefined;
|
|
36
37
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
onClose?: (() => any) | undefined;
|
|
37
39
|
}>, {
|
|
38
40
|
disabledCloseBtn: boolean;
|
|
39
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -14,73 +14,93 @@
|
|
|
14
14
|
</label>
|
|
15
15
|
|
|
16
16
|
<Modal
|
|
17
|
-
title="
|
|
18
|
-
|
|
19
|
-
title-position="left"
|
|
20
|
-
divider-header
|
|
21
|
-
divider-footer
|
|
22
|
-
disabled-padding-content
|
|
17
|
+
title="ปรับแต่งรูปภาพหน้าโปรไฟล์"
|
|
18
|
+
class="lg:max-w-[512px] gap-[24px]"
|
|
23
19
|
v-model="isOpenModal"
|
|
24
20
|
>
|
|
25
|
-
<div
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
<div class="flex flex-col gap-[16px]">
|
|
22
|
+
<div
|
|
23
|
+
class="flex justify-center items-center overflow-hidden circular-cropper-container"
|
|
24
|
+
>
|
|
25
|
+
<ImageCropper
|
|
26
|
+
v-if="imageFile"
|
|
27
|
+
ref="cropperRef"
|
|
28
|
+
dragMode="move"
|
|
29
|
+
:container-style="{
|
|
33
30
|
width: '320px',
|
|
34
31
|
height: '320px',
|
|
35
32
|
overflow: 'visible',
|
|
36
33
|
position: 'relative'
|
|
37
34
|
}"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
35
|
+
:img-style="{ display: 'block', maxWidth: '100%', maxHeight: '100%' }"
|
|
36
|
+
:src="imageUrl"
|
|
37
|
+
:aspect-ratio="1"
|
|
38
|
+
:initial-aspect-ratio="1"
|
|
39
|
+
:view-mode="3"
|
|
40
|
+
:guides="false"
|
|
41
|
+
:movable="true"
|
|
42
|
+
:crop-box-movable="false"
|
|
43
|
+
:crop-box-resizable="false"
|
|
44
|
+
:background="false"
|
|
45
|
+
:center="false"
|
|
46
|
+
:min-crop-box-width="320"
|
|
47
|
+
:min-crop-box-height="320"
|
|
48
|
+
:min-canvas-width="320"
|
|
49
|
+
:min-canvas-height="320"
|
|
50
|
+
:auto-crop-area="1"
|
|
51
|
+
:responsive="true"
|
|
52
|
+
:zoom-on-wheel="false"
|
|
53
|
+
:zoom-on-touch="false"
|
|
54
|
+
@zoom="onZoom"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="flex gap-[40px] items-center p-[16px]">
|
|
58
|
+
<div class="flex gap-[8px] items-center w-full">
|
|
59
|
+
<Icon name="lucide:zoom-in" size="20" />
|
|
60
|
+
<div @click="onZoomOut">
|
|
61
|
+
<Icon name="f7:minus" size="20" />
|
|
62
|
+
</div>
|
|
63
|
+
<InputSlider
|
|
64
|
+
thumb-size="16"
|
|
65
|
+
:min="isZoomMin"
|
|
66
|
+
:max="isZoomMax"
|
|
67
|
+
:step="isZoomStep"
|
|
68
|
+
full-width
|
|
69
|
+
v-model="isZoom"
|
|
70
|
+
/>
|
|
71
|
+
<div @click="onZoomIn">
|
|
72
|
+
<Icon name="f7:plus" size="20" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="flex gap-[8px] items-center w-full">
|
|
76
|
+
<Icon name="lucide:rotate-cw" size="20" />
|
|
77
|
+
<div @click="onRotateLeft" class="cursor-pointer">
|
|
78
|
+
<Icon name="f7:minus" size="20" />
|
|
79
|
+
</div>
|
|
80
|
+
<InputSlider
|
|
81
|
+
thumb-size="16"
|
|
82
|
+
:min="isRotateMin"
|
|
83
|
+
:max="isRotateMax"
|
|
84
|
+
:step="isRotateStep"
|
|
85
|
+
full-width
|
|
86
|
+
v-model="isRotate"
|
|
87
|
+
/>
|
|
88
|
+
<div @click="onRotateRight" class="cursor-pointer">
|
|
89
|
+
<Icon name="f7:plus" size="20" />
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
76
93
|
</div>
|
|
77
|
-
|
|
78
94
|
<template #footer>
|
|
79
|
-
<div class="flex items-center gap-[16px]">
|
|
80
|
-
<Button
|
|
95
|
+
<div class="flex items-center gap-[16px] w-[464px]">
|
|
96
|
+
<Button
|
|
97
|
+
variant="outline"
|
|
98
|
+
class="w-[224px]"
|
|
99
|
+
@click="isOpenModal = false"
|
|
100
|
+
>
|
|
81
101
|
ยกเลิก
|
|
82
102
|
</Button>
|
|
83
|
-
<Button color="primary"
|
|
103
|
+
<Button color="primary" class="w-[224px]" @click="onCropImage">
|
|
84
104
|
บันทึก
|
|
85
105
|
</Button>
|
|
86
106
|
</div>
|
|
@@ -99,6 +119,10 @@ const isZoom = ref(0);
|
|
|
99
119
|
const isZoomMin = 0;
|
|
100
120
|
const isZoomMax = 5;
|
|
101
121
|
const isZoomStep = 1;
|
|
122
|
+
const isRotate = ref(0);
|
|
123
|
+
const isRotateMin = -180;
|
|
124
|
+
const isRotateMax = 180;
|
|
125
|
+
const isRotateStep = 15;
|
|
102
126
|
const fileCrop = defineModel({ type: null });
|
|
103
127
|
const onTriggerFileInput = (event) => {
|
|
104
128
|
event.preventDefault();
|
|
@@ -114,6 +138,16 @@ const onZoomIn = () => {
|
|
|
114
138
|
isZoom.value += isZoomStep;
|
|
115
139
|
}
|
|
116
140
|
};
|
|
141
|
+
const onRotateLeft = () => {
|
|
142
|
+
if (isRotate.value > isRotateMin) {
|
|
143
|
+
isRotate.value -= isRotateStep;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const onRotateRight = () => {
|
|
147
|
+
if (isRotate.value < isRotateMax) {
|
|
148
|
+
isRotate.value += isRotateStep;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
117
151
|
const onChange = (event) => {
|
|
118
152
|
const input = event.target;
|
|
119
153
|
if (input.files && input.files.length > 0) {
|
|
@@ -165,8 +199,17 @@ watch(
|
|
|
165
199
|
}
|
|
166
200
|
}
|
|
167
201
|
);
|
|
202
|
+
watch(
|
|
203
|
+
() => isRotate.value,
|
|
204
|
+
(newRotate) => {
|
|
205
|
+
if (cropperRef.value) {
|
|
206
|
+
const cropper = cropperRef.value;
|
|
207
|
+
cropper.rotateTo(newRotate);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
);
|
|
168
211
|
</script>
|
|
169
212
|
|
|
170
213
|
<style>
|
|
171
|
-
.circular-cropper-container .cropper-view-box{border:2px solid var(--color-
|
|
214
|
+
.circular-cropper-container .cropper-view-box{border:2px solid var(--color-transparent)!important;border-radius:50%!important}.circular-cropper-container .cropper-face,.circular-cropper-container .cropper-modal{background-color:transparent!important}.circular-cropper-container .cropper-wrap-box{opacity:.25!important;overflow:visible!important}.circular-cropper-container .cropper-view-box{outline-color:transparent!important}.circular-cropper-container .cropper-line,.circular-cropper-container .cropper-point{background-color:transparent!important}
|
|
172
215
|
</style>
|
|
@@ -1,54 +1,49 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<ShadDropdownMenu>
|
|
3
|
+
<ShadDropdownMenuTrigger as-child>
|
|
4
|
+
<Button
|
|
5
|
+
:variant="props.variant"
|
|
6
|
+
:class="[
|
|
7
|
+
props.circle ? 'rounded-full bg-mercury' : 'rounded-md',
|
|
8
|
+
props.disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer',
|
|
9
|
+
props.disabledPadding ? 'p-0' : ''
|
|
10
|
+
]"
|
|
11
|
+
>
|
|
12
|
+
<Icon
|
|
13
|
+
:name="
|
|
11
14
|
props.horizontal ? 'lucide:ellipsis' : 'lucide:ellipsis-vertical'
|
|
12
15
|
"
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
:size="props.iconSize"
|
|
17
|
+
/>
|
|
18
|
+
</Button>
|
|
19
|
+
</ShadDropdownMenuTrigger>
|
|
15
20
|
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
'flex gap-[4px] p-[8px] items-center cursor-pointer hover:bg-smoke',
|
|
21
|
-
i == 0 && 'rounded-t-[8px]',
|
|
22
|
-
i == props.items.length - 1 && 'rounded-b-[8px]'
|
|
23
|
-
]"
|
|
21
|
+
<ShadDropdownMenuContent align="start">
|
|
22
|
+
<template v-for="(item, i) in props.items" :key="i">
|
|
23
|
+
<ShadDropdownMenuItem
|
|
24
|
+
class="flex gap-[4px] items-center cursor-pointer hover:bg-smoke"
|
|
24
25
|
@click="onAction(item)"
|
|
25
26
|
>
|
|
26
|
-
<Icon :name="item.icon" size="16" />
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
</Dropdown>
|
|
27
|
+
<Icon :name="item.icon" :size="16" />
|
|
28
|
+
<span class="font-body-large">{{ item.label }}</span>
|
|
29
|
+
</ShadDropdownMenuItem>
|
|
30
|
+
</template>
|
|
31
|
+
</ShadDropdownMenuContent>
|
|
32
|
+
</ShadDropdownMenu>
|
|
35
33
|
</template>
|
|
36
34
|
|
|
37
35
|
<script setup>
|
|
38
|
-
import { ref } from "vue";
|
|
39
36
|
const props = defineProps({
|
|
40
37
|
items: { type: Array, required: false, default: () => [] },
|
|
41
38
|
variant: { type: null, required: false, default: "text" },
|
|
42
39
|
circle: { type: Boolean, required: false, default: false },
|
|
43
40
|
horizontal: { type: Boolean, required: false, default: false },
|
|
44
|
-
size: { type: null, required: false
|
|
41
|
+
size: { type: null, required: false },
|
|
45
42
|
iconSize: { type: String, required: false, default: "20" },
|
|
46
43
|
disabledPadding: { type: Boolean, required: false, default: false },
|
|
47
44
|
disabled: { type: Boolean, required: false, default: false }
|
|
48
45
|
});
|
|
49
|
-
const isOpenDrawer = ref(false);
|
|
50
46
|
const onAction = (item) => {
|
|
51
47
|
item.action();
|
|
52
|
-
isOpenDrawer.value = false;
|
|
53
48
|
};
|
|
54
49
|
</script>
|
|
@@ -12,6 +12,7 @@ type __VLS_Slots = {} & {
|
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
14
|
submit: (event: Event) => any;
|
|
15
|
+
close: (event: Event) => any;
|
|
15
16
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
16
17
|
pointerDownOutside: (event: import("reka-ui").PointerDownOutsideEvent) => any;
|
|
17
18
|
focusOutside: (event: import("reka-ui").FocusOutsideEvent) => any;
|
|
@@ -20,6 +21,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
20
21
|
closeAutoFocus: (event: Event) => any;
|
|
21
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
23
|
onSubmit?: ((event: Event) => any) | undefined;
|
|
24
|
+
onClose?: ((event: Event) => any) | undefined;
|
|
23
25
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
24
26
|
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
25
27
|
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
<DialogClose
|
|
19
19
|
v-if="!props.disabledCloseBtn"
|
|
20
20
|
class="absolute top-4 right-4 rounded-xs opacity-70 cursor-pointer transition-opacity hover:opacity-100 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6"
|
|
21
|
+
@click="onClose"
|
|
21
22
|
>
|
|
22
23
|
<Icon name="lucide:x" size="24" />
|
|
23
24
|
<span class="sr-only">Close</span>
|
|
@@ -45,7 +46,7 @@ const props = defineProps({
|
|
|
45
46
|
class: { type: null, required: false },
|
|
46
47
|
disabledCloseBtn: { type: Boolean, required: false, default: false }
|
|
47
48
|
});
|
|
48
|
-
const emits = defineEmits(["submit", "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"]);
|
|
49
|
+
const emits = defineEmits(["submit", "close", "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"]);
|
|
49
50
|
const delegatedProps = reactiveOmit(props, "class");
|
|
50
51
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
51
52
|
const onOutSideClick = (e) => {
|
|
@@ -54,4 +55,7 @@ const onOutSideClick = (e) => {
|
|
|
54
55
|
const onSubmit = (e) => {
|
|
55
56
|
emits("submit", e);
|
|
56
57
|
};
|
|
58
|
+
const onClose = (e) => {
|
|
59
|
+
emits("close", e);
|
|
60
|
+
};
|
|
57
61
|
</script>
|
|
@@ -12,6 +12,7 @@ type __VLS_Slots = {} & {
|
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
14
|
submit: (event: Event) => any;
|
|
15
|
+
close: (event: Event) => any;
|
|
15
16
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
16
17
|
pointerDownOutside: (event: import("reka-ui").PointerDownOutsideEvent) => any;
|
|
17
18
|
focusOutside: (event: import("reka-ui").FocusOutsideEvent) => any;
|
|
@@ -20,6 +21,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
20
21
|
closeAutoFocus: (event: Event) => any;
|
|
21
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
23
|
onSubmit?: ((event: Event) => any) | undefined;
|
|
24
|
+
onClose?: ((event: Event) => any) | undefined;
|
|
23
25
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
24
26
|
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
25
27
|
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|