vlite3 0.2.5 → 0.2.7
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/components/Button.vue.js +43 -34
- package/components/Carousel/Carousel.vue.d.ts +10 -42
- package/components/ChoiceBox/ChoiceBox.vue.js +19 -19
- package/components/ColorPicker/ColorIro.vue.d.ts +18 -1
- package/components/ColorPicker/ColorIro.vue.js +59 -61
- package/components/ColorPicker/ColorPicker.vue.d.ts +2 -0
- package/components/ColorPicker/ColorPicker.vue.js +81 -26
- package/components/Input.vue.js +1 -1
- package/components/Tabes/Tabes.vue.js +10 -10
- package/components/ThemeToggle.vue.d.ts +1 -1
- package/components/ThemeToggle.vue.js +10 -12
- package/components/Workbook/Sheet.vue.d.ts +6 -0
- package/components/Workbook/Sheet.vue.js +69 -54
- package/components/Workbook/Workbook.vue.d.ts +3 -0
- package/components/Workbook/Workbook.vue.js +2 -2
- package/components/Workbook/Workbook.vue2.js +69 -63
- package/components/Workbook/types.d.ts +3 -0
- package/package.json +2 -2
- package/style.css +4 -0
package/components/Button.vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as v, useSlots as x, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as v, useSlots as x, computed as c, withDirectives as w, openBlock as i, createElementBlock as y, normalizeClass as o, createBlock as l, createCommentVNode as u, renderSlot as p, createTextVNode as z, toDisplayString as k, unref as B } from "vue";
|
|
2
|
+
import d from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as C } from "../directives/vRipple.js";
|
|
4
|
-
const
|
|
4
|
+
const S = ["type", "disabled"], D = /* @__PURE__ */ v({
|
|
5
5
|
__name: "Button",
|
|
6
6
|
props: {
|
|
7
7
|
variant: { default: "primary" },
|
|
@@ -16,8 +16,8 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
|
|
|
16
16
|
rounded: { default: "md" }
|
|
17
17
|
},
|
|
18
18
|
setup(e) {
|
|
19
|
-
const t = e, g = x(),
|
|
20
|
-
const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2",
|
|
19
|
+
const t = e, g = x(), s = c(() => t.icon && !t.text && !g.default), h = c(() => {
|
|
20
|
+
const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", r = {
|
|
21
21
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
22
22
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
|
|
23
23
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -39,17 +39,17 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
|
|
|
39
39
|
link: "text-primary underline-offset-4 hover:underline"
|
|
40
40
|
}, f = {
|
|
41
41
|
xs: "h-6.5 px-2",
|
|
42
|
-
sm: "h-
|
|
42
|
+
sm: "h-7.5 px-3",
|
|
43
43
|
md: "h-9 px-4 py-2",
|
|
44
44
|
lg: "h-10 px-6",
|
|
45
45
|
xl: "h-12 px-10"
|
|
46
|
-
}, b = {
|
|
47
|
-
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
48
|
-
sm: "h-8 w-8 min-h-9 min-w-9",
|
|
49
|
-
md: "h-9 w-9 min-h-9 min-w-9",
|
|
50
|
-
lg: "h-10 w-10 min-h-11 min-w-11",
|
|
51
|
-
xl: "h-12 w-12 min-h-12 min-w-12"
|
|
52
46
|
}, m = {
|
|
47
|
+
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
48
|
+
sm: "h-7 w-7 min-h-7 min-w-7",
|
|
49
|
+
md: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
50
|
+
lg: "h-8 w-8 min-h-8 min-w-8",
|
|
51
|
+
xl: "h-8.5 w-8.5 min-h-8.5 min-w-8.5"
|
|
52
|
+
}, b = {
|
|
53
53
|
none: "rounded-none",
|
|
54
54
|
sm: "rounded-sm",
|
|
55
55
|
md: "rounded",
|
|
@@ -60,44 +60,53 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
|
|
|
60
60
|
};
|
|
61
61
|
return [
|
|
62
62
|
n,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
r[t.variant],
|
|
64
|
+
b[t.rounded],
|
|
65
|
+
s.value ? m[t.size] : f[t.size],
|
|
66
66
|
t.class
|
|
67
67
|
].join(" ");
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
}), a = c(() => {
|
|
69
|
+
const n = {
|
|
70
|
+
xs: "w-3 h-3",
|
|
71
|
+
sm: "w-4 h-4",
|
|
72
|
+
md: "w-4 h-4",
|
|
73
|
+
lg: "w-4 h-4",
|
|
74
|
+
xl: "w-4 h-4"
|
|
75
|
+
}, r = {
|
|
76
|
+
xs: "w-3 h-3",
|
|
77
|
+
sm: "w-3.5 h-3.5",
|
|
78
|
+
md: "w-3.5 h-3.5",
|
|
79
|
+
lg: "w-4 h-4",
|
|
80
|
+
xl: "w-4 h-4"
|
|
81
|
+
};
|
|
82
|
+
return s.value ? r[t.size] : n[t.size];
|
|
83
|
+
});
|
|
84
|
+
return (n, r) => w((i(), y("button", {
|
|
76
85
|
type: e.type,
|
|
77
|
-
class:
|
|
86
|
+
class: o(h.value),
|
|
78
87
|
disabled: e.disabled || e.loading
|
|
79
88
|
}, [
|
|
80
|
-
e.loading ? (
|
|
89
|
+
e.loading ? (i(), l(d, {
|
|
81
90
|
key: 0,
|
|
82
91
|
icon: "lucide:loader-2",
|
|
83
|
-
class:
|
|
84
|
-
}, null, 8, ["class"])) : e.icon ? (
|
|
92
|
+
class: o(["animate-spin", { [a.value]: !0 }])
|
|
93
|
+
}, null, 8, ["class"])) : e.icon ? (i(), l(d, {
|
|
85
94
|
key: 1,
|
|
86
95
|
icon: e.icon,
|
|
87
|
-
class:
|
|
88
|
-
"mx-auto":
|
|
89
|
-
[
|
|
96
|
+
class: o({
|
|
97
|
+
"mx-auto": s.value,
|
|
98
|
+
[a.value]: !0
|
|
90
99
|
})
|
|
91
100
|
}, null, 8, ["icon", "class"])) : u("", !0),
|
|
92
101
|
p(n.$slots, "default", {}, () => [
|
|
93
|
-
k(
|
|
102
|
+
z(k(e.text), 1)
|
|
94
103
|
]),
|
|
95
|
-
e.iconRight && !e.loading ? (
|
|
104
|
+
e.iconRight && !e.loading ? (i(), l(d, {
|
|
96
105
|
key: 2,
|
|
97
106
|
icon: e.iconRight,
|
|
98
|
-
class:
|
|
107
|
+
class: o([a.value, "h-4 w-4"])
|
|
99
108
|
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
100
|
-
], 10,
|
|
109
|
+
], 10, S)), [
|
|
101
110
|
[B(C)]
|
|
102
111
|
]);
|
|
103
112
|
}
|
|
@@ -27,7 +27,6 @@ declare function __VLS_template(): {
|
|
|
27
27
|
wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
28
28
|
bufferSize: number;
|
|
29
29
|
maxDomElements: number;
|
|
30
|
-
updateKey: string | number;
|
|
31
30
|
}> & Omit<{
|
|
32
31
|
readonly data: any[];
|
|
33
32
|
readonly direction: "horizontal" | "vertical";
|
|
@@ -51,10 +50,9 @@ declare function __VLS_template(): {
|
|
|
51
50
|
readonly autoFocus: boolean;
|
|
52
51
|
readonly wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
53
52
|
readonly paginationPosition?: import('vue-carousel-lite').PaginationPosition | import('vue-carousel-lite').PaginationPosition[];
|
|
54
|
-
readonly updateKey?: string | number;
|
|
55
53
|
readonly paginationBackground?: boolean;
|
|
56
|
-
readonly "onSlide-change"?: (index: number) => any;
|
|
57
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "
|
|
54
|
+
readonly "onSlide-change"?: ((index: number) => any) | undefined;
|
|
55
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "autoFocus" | "wheelOptions">;
|
|
58
56
|
$attrs: {
|
|
59
57
|
[x: string]: unknown;
|
|
60
58
|
};
|
|
@@ -149,10 +147,6 @@ declare function __VLS_template(): {
|
|
|
149
147
|
type: import('vue').PropType<number>;
|
|
150
148
|
default: number;
|
|
151
149
|
};
|
|
152
|
-
updateKey: {
|
|
153
|
-
type: import('vue').PropType<string | number>;
|
|
154
|
-
default: any;
|
|
155
|
-
};
|
|
156
150
|
autoFocus: {
|
|
157
151
|
type: import('vue').PropType<boolean>;
|
|
158
152
|
default: boolean;
|
|
@@ -167,14 +161,12 @@ declare function __VLS_template(): {
|
|
|
167
161
|
velocityThreshold: number;
|
|
168
162
|
pageScrollThreshold: number;
|
|
169
163
|
debounceTime: number;
|
|
170
|
-
scrollByPage: boolean;
|
|
171
|
-
lockDuringTransition: boolean;
|
|
172
164
|
preventDefault: boolean;
|
|
173
165
|
stopPropagation: boolean;
|
|
174
166
|
};
|
|
175
167
|
};
|
|
176
168
|
}>> & Readonly<{
|
|
177
|
-
"onSlide-change"?: (index: number) => any;
|
|
169
|
+
"onSlide-change"?: ((index: number) => any) | undefined;
|
|
178
170
|
}>, {
|
|
179
171
|
goToSlide: (index: number, smooth?: boolean) => void;
|
|
180
172
|
goNext: (smooth?: boolean) => void;
|
|
@@ -212,7 +204,6 @@ declare function __VLS_template(): {
|
|
|
212
204
|
wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
213
205
|
bufferSize: number;
|
|
214
206
|
maxDomElements: number;
|
|
215
|
-
updateKey: string | number;
|
|
216
207
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
217
208
|
beforeCreate?: (() => void) | (() => void)[];
|
|
218
209
|
created?: (() => void) | (() => void)[];
|
|
@@ -254,7 +245,6 @@ declare function __VLS_template(): {
|
|
|
254
245
|
wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
255
246
|
bufferSize: number;
|
|
256
247
|
maxDomElements: number;
|
|
257
|
-
updateKey: string | number;
|
|
258
248
|
}> & Omit<Readonly<import('vue').ExtractPropTypes<{
|
|
259
249
|
data: {
|
|
260
250
|
type: import('vue').PropType<any[]>;
|
|
@@ -335,10 +325,6 @@ declare function __VLS_template(): {
|
|
|
335
325
|
type: import('vue').PropType<number>;
|
|
336
326
|
default: number;
|
|
337
327
|
};
|
|
338
|
-
updateKey: {
|
|
339
|
-
type: import('vue').PropType<string | number>;
|
|
340
|
-
default: any;
|
|
341
|
-
};
|
|
342
328
|
autoFocus: {
|
|
343
329
|
type: import('vue').PropType<boolean>;
|
|
344
330
|
default: boolean;
|
|
@@ -353,15 +339,13 @@ declare function __VLS_template(): {
|
|
|
353
339
|
velocityThreshold: number;
|
|
354
340
|
pageScrollThreshold: number;
|
|
355
341
|
debounceTime: number;
|
|
356
|
-
scrollByPage: boolean;
|
|
357
|
-
lockDuringTransition: boolean;
|
|
358
342
|
preventDefault: boolean;
|
|
359
343
|
stopPropagation: boolean;
|
|
360
344
|
};
|
|
361
345
|
};
|
|
362
346
|
}>> & Readonly<{
|
|
363
|
-
"onSlide-change"?: (index: number) => any;
|
|
364
|
-
}>, "focus" | "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "
|
|
347
|
+
"onSlide-change"?: ((index: number) => any) | undefined;
|
|
348
|
+
}>, "focus" | "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goNext" | "goPrev" | "autoFocus" | "wheelOptions" | "state" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
|
|
365
349
|
goToSlide: (index: number, smooth?: boolean) => void;
|
|
366
350
|
goNext: (smooth?: boolean) => void;
|
|
367
351
|
goPrev: (smooth?: boolean) => void;
|
|
@@ -462,7 +446,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
462
446
|
wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
463
447
|
bufferSize: number;
|
|
464
448
|
maxDomElements: number;
|
|
465
|
-
updateKey: string | number;
|
|
466
449
|
}> & Omit<{
|
|
467
450
|
readonly data: any[];
|
|
468
451
|
readonly direction: "horizontal" | "vertical";
|
|
@@ -486,10 +469,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
486
469
|
readonly autoFocus: boolean;
|
|
487
470
|
readonly wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
488
471
|
readonly paginationPosition?: import('vue-carousel-lite').PaginationPosition | import('vue-carousel-lite').PaginationPosition[];
|
|
489
|
-
readonly updateKey?: string | number;
|
|
490
472
|
readonly paginationBackground?: boolean;
|
|
491
|
-
readonly "onSlide-change"?: (index: number) => any;
|
|
492
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "
|
|
473
|
+
readonly "onSlide-change"?: ((index: number) => any) | undefined;
|
|
474
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "autoFocus" | "wheelOptions">;
|
|
493
475
|
$attrs: {
|
|
494
476
|
[x: string]: unknown;
|
|
495
477
|
};
|
|
@@ -584,10 +566,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
584
566
|
type: import('vue').PropType<number>;
|
|
585
567
|
default: number;
|
|
586
568
|
};
|
|
587
|
-
updateKey: {
|
|
588
|
-
type: import('vue').PropType<string | number>;
|
|
589
|
-
default: any;
|
|
590
|
-
};
|
|
591
569
|
autoFocus: {
|
|
592
570
|
type: import('vue').PropType<boolean>;
|
|
593
571
|
default: boolean;
|
|
@@ -602,14 +580,12 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
602
580
|
velocityThreshold: number;
|
|
603
581
|
pageScrollThreshold: number;
|
|
604
582
|
debounceTime: number;
|
|
605
|
-
scrollByPage: boolean;
|
|
606
|
-
lockDuringTransition: boolean;
|
|
607
583
|
preventDefault: boolean;
|
|
608
584
|
stopPropagation: boolean;
|
|
609
585
|
};
|
|
610
586
|
};
|
|
611
587
|
}>> & Readonly<{
|
|
612
|
-
"onSlide-change"?: (index: number) => any;
|
|
588
|
+
"onSlide-change"?: ((index: number) => any) | undefined;
|
|
613
589
|
}>, {
|
|
614
590
|
goToSlide: (index: number, smooth?: boolean) => void;
|
|
615
591
|
goNext: (smooth?: boolean) => void;
|
|
@@ -647,7 +623,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
647
623
|
wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
648
624
|
bufferSize: number;
|
|
649
625
|
maxDomElements: number;
|
|
650
|
-
updateKey: string | number;
|
|
651
626
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
652
627
|
beforeCreate?: (() => void) | (() => void)[];
|
|
653
628
|
created?: (() => void) | (() => void)[];
|
|
@@ -689,7 +664,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
689
664
|
wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
690
665
|
bufferSize: number;
|
|
691
666
|
maxDomElements: number;
|
|
692
|
-
updateKey: string | number;
|
|
693
667
|
}> & Omit<Readonly<import('vue').ExtractPropTypes<{
|
|
694
668
|
data: {
|
|
695
669
|
type: import('vue').PropType<any[]>;
|
|
@@ -770,10 +744,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
770
744
|
type: import('vue').PropType<number>;
|
|
771
745
|
default: number;
|
|
772
746
|
};
|
|
773
|
-
updateKey: {
|
|
774
|
-
type: import('vue').PropType<string | number>;
|
|
775
|
-
default: any;
|
|
776
|
-
};
|
|
777
747
|
autoFocus: {
|
|
778
748
|
type: import('vue').PropType<boolean>;
|
|
779
749
|
default: boolean;
|
|
@@ -788,15 +758,13 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
788
758
|
velocityThreshold: number;
|
|
789
759
|
pageScrollThreshold: number;
|
|
790
760
|
debounceTime: number;
|
|
791
|
-
scrollByPage: boolean;
|
|
792
|
-
lockDuringTransition: boolean;
|
|
793
761
|
preventDefault: boolean;
|
|
794
762
|
stopPropagation: boolean;
|
|
795
763
|
};
|
|
796
764
|
};
|
|
797
765
|
}>> & Readonly<{
|
|
798
|
-
"onSlide-change"?: (index: number) => any;
|
|
799
|
-
}>, "focus" | "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "
|
|
766
|
+
"onSlide-change"?: ((index: number) => any) | undefined;
|
|
767
|
+
}>, "focus" | "direction" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "draggable" | "autoPlayInterval" | "itemsToShow" | "gap" | "speed" | "easing" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goNext" | "goPrev" | "autoFocus" | "wheelOptions" | "state" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
|
|
800
768
|
goToSlide: (index: number, smooth?: boolean) => void;
|
|
801
769
|
goNext: (smooth?: boolean) => void;
|
|
802
770
|
goPrev: (smooth?: boolean) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as w, computed as
|
|
1
|
+
import { defineComponent as w, computed as x, openBlock as t, createElementBlock as i, toDisplayString as o, createCommentVNode as a, createElementVNode as c, normalizeClass as u, Fragment as V, renderList as _, withKeys as C, withModifiers as B, createVNode as A, createBlock as y } from "vue";
|
|
2
2
|
import m from "../Icon.vue.js";
|
|
3
3
|
const K = { class: "w-full" }, N = {
|
|
4
4
|
key: 0,
|
|
@@ -14,7 +14,7 @@ const K = { class: "w-full" }, N = {
|
|
|
14
14
|
class: "shrink-0 pt-0.5"
|
|
15
15
|
}, q = { class: "flex flex-col" }, z = { class: "flex items-center gap-2" }, D = {
|
|
16
16
|
key: 0,
|
|
17
|
-
class: "mt-1 text-
|
|
17
|
+
class: "mt-1 -text-fs-3 text-muted leading-relaxed"
|
|
18
18
|
}, F = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "absolute top-4 right-4 text-primary"
|
|
@@ -31,18 +31,18 @@ const K = { class: "w-full" }, N = {
|
|
|
31
31
|
gap: { default: 4 }
|
|
32
32
|
},
|
|
33
33
|
emits: ["update:modelValue", "change"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
34
|
+
setup(s, { emit: h }) {
|
|
35
|
+
const r = s, g = h, n = (l) => Array.isArray(r.modelValue) ? r.modelValue.includes(l) : r.modelValue === l, f = (l) => {
|
|
36
|
+
if (r.disabled || r.options.find((d) => d.id === l)?.disabled) return;
|
|
37
37
|
let e;
|
|
38
|
-
if (
|
|
39
|
-
const d = Array.isArray(
|
|
38
|
+
if (r.multiple) {
|
|
39
|
+
const d = Array.isArray(r.modelValue) ? [...r.modelValue] : [], p = d.indexOf(l);
|
|
40
40
|
p === -1 ? d.push(l) : d.splice(p, 1), e = d;
|
|
41
41
|
} else
|
|
42
42
|
e = l;
|
|
43
43
|
g("update:modelValue", e), g("change", e);
|
|
44
|
-
}, b =
|
|
45
|
-
switch (
|
|
44
|
+
}, b = x(() => {
|
|
45
|
+
switch (r.grid) {
|
|
46
46
|
case 1:
|
|
47
47
|
return "grid-cols-1";
|
|
48
48
|
case 2:
|
|
@@ -54,8 +54,8 @@ const K = { class: "w-full" }, N = {
|
|
|
54
54
|
default:
|
|
55
55
|
return "grid-cols-1";
|
|
56
56
|
}
|
|
57
|
-
}), v =
|
|
58
|
-
switch (
|
|
57
|
+
}), v = x(() => {
|
|
58
|
+
switch (r.gap) {
|
|
59
59
|
case 2:
|
|
60
60
|
return "gap-2";
|
|
61
61
|
case 3:
|
|
@@ -71,18 +71,18 @@ const K = { class: "w-full" }, N = {
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
return (l, k) => (t(), i("div", K, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
s.title || s.description ? (t(), i("div", N, [
|
|
75
|
+
s.title ? (t(), i("h3", $, o(s.title), 1)) : a("", !0),
|
|
76
|
+
s.description ? (t(), i("p", E, o(s.description), 1)) : a("", !0)
|
|
77
77
|
])) : a("", !0),
|
|
78
78
|
c("div", {
|
|
79
79
|
class: u(["grid", [b.value, v.value]])
|
|
80
80
|
}, [
|
|
81
|
-
(t(!0), i(V, null, _(
|
|
81
|
+
(t(!0), i(V, null, _(s.options, (e) => (t(), i("div", {
|
|
82
82
|
key: e.id,
|
|
83
83
|
class: u(["relative flex cursor-pointer rounded-xl border border-border p-4 transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", [
|
|
84
84
|
n(e.id) ? "border-primary bg-accent" : "bg-card hover:border-primary/50 hover:bg-accent",
|
|
85
|
-
|
|
85
|
+
s.disabled || e.disabled ? "opacity-50 cursor-not-allowed grayscale" : ""
|
|
86
86
|
]]),
|
|
87
87
|
onClick: (d) => f(e.id),
|
|
88
88
|
tabindex: "0",
|
|
@@ -105,7 +105,7 @@ const K = { class: "w-full" }, N = {
|
|
|
105
105
|
c("div", q, [
|
|
106
106
|
c("div", z, [
|
|
107
107
|
c("span", {
|
|
108
|
-
class: u(["font-semibold text-foreground", {
|
|
108
|
+
class: u(["font-semibold text-foreground text-fs-1", {
|
|
109
109
|
"text-primary": n(e.id)
|
|
110
110
|
}])
|
|
111
111
|
}, o(e.title), 3),
|
|
@@ -121,11 +121,11 @@ const K = { class: "w-full" }, N = {
|
|
|
121
121
|
])
|
|
122
122
|
]),
|
|
123
123
|
n(e.id) ? (t(), i("div", F, [
|
|
124
|
-
|
|
124
|
+
s.multiple ? (t(), y(m, {
|
|
125
125
|
key: 0,
|
|
126
126
|
icon: "lucide:check-square",
|
|
127
127
|
class: "h-5 w-5"
|
|
128
|
-
})) : (t(),
|
|
128
|
+
})) : (t(), y(m, {
|
|
129
129
|
key: 1,
|
|
130
130
|
icon: "lucide:check-circle-2",
|
|
131
131
|
class: "h-5 w-5"
|
|
@@ -3,7 +3,18 @@ type __VLS_Props = {
|
|
|
3
3
|
showHeader?: boolean;
|
|
4
4
|
size?: 'sm' | 'md' | 'lg';
|
|
5
5
|
};
|
|
6
|
-
declare
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
bottom?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {
|
|
12
|
+
pickerRef: HTMLDivElement;
|
|
13
|
+
};
|
|
14
|
+
rootEl: HTMLDivElement;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
18
|
close: () => any;
|
|
8
19
|
"update:color": (color: string) => any;
|
|
9
20
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -15,4 +26,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
15
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
27
|
pickerRef: HTMLDivElement;
|
|
17
28
|
}, HTMLDivElement>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
30
|
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useEyeDropper as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as H, defineAsyncComponent as B, ref as g, computed as E, watch as p, onMounted as T, onUnmounted as C, openBlock as a, createElementBlock as x, createVNode as P, unref as c, createBlock as b, createCommentVNode as d, createElementVNode as M, normalizeStyle as N, renderSlot as R, nextTick as V } from "vue";
|
|
2
|
+
import i from "@jaames/iro";
|
|
3
|
+
import { useEyeDropper as D } from "@vueuse/core";
|
|
4
|
+
const L = { class: "space-y-3 w-max" }, _ = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex gap-2 mb-2.5 -text-fs-3 pr-0.5"
|
|
7
|
-
},
|
|
7
|
+
}, I = /* @__PURE__ */ H({
|
|
8
8
|
__name: "ColorIro",
|
|
9
9
|
props: {
|
|
10
10
|
color: {},
|
|
@@ -12,9 +12,9 @@ const D = { class: "space-y-3" }, $ = {
|
|
|
12
12
|
size: { default: "md" }
|
|
13
13
|
},
|
|
14
14
|
emits: ["update:color", "close"],
|
|
15
|
-
setup(l, { emit:
|
|
16
|
-
const
|
|
17
|
-
switch (
|
|
15
|
+
setup(l, { emit: S }) {
|
|
16
|
+
const s = B(() => import("../Button.vue2.js")), n = l, u = S, r = g(), e = g(null), { isSupported: m, open: z, sRGBHex: w } = D(), f = E(() => {
|
|
17
|
+
switch (n.size) {
|
|
18
18
|
case "sm":
|
|
19
19
|
return 140;
|
|
20
20
|
case "lg":
|
|
@@ -22,121 +22,119 @@ const D = { class: "space-y-3" }, $ = {
|
|
|
22
22
|
default:
|
|
23
23
|
return 162;
|
|
24
24
|
}
|
|
25
|
-
}),
|
|
25
|
+
}), v = {
|
|
26
26
|
sm: 120,
|
|
27
27
|
md: 140,
|
|
28
28
|
lg: 150
|
|
29
|
-
},
|
|
30
|
-
if (!(!
|
|
31
|
-
await
|
|
29
|
+
}, y = async () => {
|
|
30
|
+
if (!(!r.value || e.value)) {
|
|
31
|
+
await V();
|
|
32
32
|
try {
|
|
33
|
-
e.value && (e.value.off("color:change"), e.value = null), e.value =
|
|
33
|
+
e.value && (e.value.off("color:change"), e.value = null), r.value && (r.value.innerHTML = ""), e.value = i.ColorPicker(r.value, {
|
|
34
34
|
width: f.value,
|
|
35
|
-
color:
|
|
35
|
+
color: n.color,
|
|
36
36
|
margin: 9,
|
|
37
|
-
boxHeight:
|
|
38
|
-
// Auto-scale or keep ratio? default is usually width.
|
|
39
|
-
// Let's rely on default square-ish box unless specified.
|
|
40
|
-
// But for small size, maybe we want to keep it compact.
|
|
41
|
-
// iro defaults boxHeight to width if not specified.
|
|
37
|
+
boxHeight: v[n.size],
|
|
42
38
|
sliderSize: 14,
|
|
43
39
|
layout: [
|
|
44
40
|
{
|
|
45
|
-
component:
|
|
41
|
+
component: i.ui.Box
|
|
46
42
|
},
|
|
47
43
|
{
|
|
48
|
-
component:
|
|
44
|
+
component: i.ui.Slider,
|
|
49
45
|
options: {
|
|
50
46
|
sliderType: "hue"
|
|
51
47
|
}
|
|
52
48
|
},
|
|
53
49
|
{
|
|
54
|
-
component:
|
|
50
|
+
component: i.ui.Slider,
|
|
55
51
|
options: {
|
|
56
52
|
sliderType: "saturation"
|
|
57
53
|
}
|
|
58
54
|
},
|
|
59
55
|
{
|
|
60
|
-
component:
|
|
56
|
+
component: i.ui.Slider,
|
|
61
57
|
options: {
|
|
62
58
|
sliderType: "value"
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
]
|
|
66
62
|
}), e.value.on("color:change", (o) => {
|
|
67
|
-
|
|
63
|
+
u("update:color", o.hexString);
|
|
68
64
|
});
|
|
69
65
|
} catch (o) {
|
|
70
66
|
console.error("Failed to initialize color picker:", o);
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
|
-
},
|
|
74
|
-
e.value && (e.value.off("color:change"), e.value = null);
|
|
69
|
+
}, h = () => {
|
|
70
|
+
e.value && (e.value.off("color:change"), e.value = null), r.value && (r.value.innerHTML = "");
|
|
75
71
|
};
|
|
76
|
-
|
|
77
|
-
() =>
|
|
72
|
+
p(
|
|
73
|
+
() => n.color,
|
|
78
74
|
(o) => {
|
|
79
75
|
if (e.value && e.value.color.hexString !== o)
|
|
80
76
|
try {
|
|
81
77
|
e.value.color.hexString = o;
|
|
82
|
-
} catch (
|
|
83
|
-
console.error("Error updating color:",
|
|
78
|
+
} catch (t) {
|
|
79
|
+
console.error("Error updating color:", t);
|
|
84
80
|
}
|
|
85
81
|
}
|
|
86
|
-
),
|
|
87
|
-
() =>
|
|
82
|
+
), p(
|
|
83
|
+
() => n.size,
|
|
88
84
|
() => {
|
|
89
|
-
|
|
85
|
+
h(), y();
|
|
90
86
|
}
|
|
91
|
-
),
|
|
92
|
-
if (o && (
|
|
87
|
+
), p(w, (o) => {
|
|
88
|
+
if (o && (u("update:color", o), e.value))
|
|
93
89
|
try {
|
|
94
90
|
e.value.color.hexString = o;
|
|
95
|
-
} catch (
|
|
96
|
-
console.error("Error updating color from eyedropper:",
|
|
91
|
+
} catch (t) {
|
|
92
|
+
console.error("Error updating color from eyedropper:", t);
|
|
97
93
|
}
|
|
98
94
|
});
|
|
99
|
-
const
|
|
95
|
+
const k = async () => {
|
|
100
96
|
try {
|
|
101
97
|
await z();
|
|
102
98
|
} catch (o) {
|
|
103
99
|
console.error("Error opening eyedropper:", o);
|
|
104
100
|
}
|
|
105
101
|
};
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
}),
|
|
109
|
-
|
|
110
|
-
}), (o,
|
|
111
|
-
l.showHeader ? (
|
|
112
|
-
P(c(
|
|
102
|
+
return T(() => {
|
|
103
|
+
y();
|
|
104
|
+
}), C(() => {
|
|
105
|
+
h();
|
|
106
|
+
}), (o, t) => (a(), x("div", L, [
|
|
107
|
+
l.showHeader ? (a(), x("div", _, [
|
|
108
|
+
P(c(s), {
|
|
113
109
|
icon: "typcn:arrow-back",
|
|
114
|
-
onClick:
|
|
110
|
+
onClick: t[0] || (t[0] = ($) => u("close")),
|
|
115
111
|
class: "flex-1 px-2 py-1 bg-background hover:bg-accent rounded text-xs border border-border transition-colors"
|
|
116
112
|
}),
|
|
117
|
-
c(m) ? (
|
|
113
|
+
c(m) ? (a(), b(c(s), {
|
|
118
114
|
key: 0,
|
|
119
|
-
onClick:
|
|
115
|
+
onClick: k,
|
|
120
116
|
icon: "pepicons-pop:color-picker",
|
|
121
117
|
class: "flex-1 px-2 py-1 bg-background hover:bg-accent rounded text-xs border border-border transition-colors"
|
|
122
118
|
})) : d("", !0)
|
|
123
119
|
])) : d("", !0),
|
|
124
|
-
|
|
120
|
+
M("div", {
|
|
125
121
|
ref_key: "pickerRef",
|
|
126
|
-
ref:
|
|
127
|
-
|
|
128
|
-
}, null,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
122
|
+
ref: r,
|
|
123
|
+
style: N({ width: f.value + "px", minHeight: v[l.size] + "px" })
|
|
124
|
+
}, null, 4),
|
|
125
|
+
R(o.$slots, "bottom", {}, () => [
|
|
126
|
+
c(m) && !l.showHeader ? (a(), b(c(s), {
|
|
127
|
+
key: 0,
|
|
128
|
+
onClick: k,
|
|
129
|
+
icon: "pepicons-pop:color-picker",
|
|
130
|
+
variant: "outline",
|
|
131
|
+
size: "sm",
|
|
132
|
+
class: "w-full"
|
|
133
|
+
})) : d("", !0)
|
|
134
|
+
])
|
|
137
135
|
]));
|
|
138
136
|
}
|
|
139
137
|
});
|
|
140
138
|
export {
|
|
141
|
-
|
|
139
|
+
I as default
|
|
142
140
|
};
|