vlite3 0.2.6 → 0.2.8
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 +42 -33
- package/components/Carousel/Carousel.vue.d.ts +14 -0
- 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/DataTable/DataTable.vue.js +2 -2
- package/components/DataTable/DataTable.vue2.js +18 -15
- package/components/DataTable/DataTableRow.vue.js +47 -44
- package/components/Kanban/Kanban.vue.d.ts +60 -0
- package/components/Kanban/Kanban.vue.js +7 -0
- package/components/Kanban/Kanban.vue2.js +62 -0
- package/components/Kanban/KanbanBoard.vue.d.ts +59 -0
- package/components/Kanban/KanbanBoard.vue.js +7 -0
- package/components/Kanban/KanbanBoard.vue2.js +132 -0
- package/components/Kanban/index.d.ts +4 -0
- package/components/Kanban/types.d.ts +32 -0
- package/components/Kanban/useKanbanBoard.d.ts +13 -0
- package/components/Kanban/useKanbanBoard.js +43 -0
- package/components/Tabes/Tabes.vue.js +10 -10
- package/components/Workbook/Sheet.vue.d.ts +6 -0
- package/components/Workbook/Sheet.vue.js +63 -55
- package/components/Workbook/Workbook.vue.d.ts +3 -2
- package/components/Workbook/Workbook.vue.js +152 -5
- package/components/Workbook/Workbook.vue2.js +2 -146
- package/components/Workbook/types.d.ts +3 -0
- package/index.d.ts +1 -1
- package/index.js +120 -114
- package/package.json +3 -3
- package/style.css +5 -1
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",
|
|
@@ -43,13 +43,13 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
|
|
|
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
|
}
|
|
@@ -50,6 +50,7 @@ declare function __VLS_template(): {
|
|
|
50
50
|
readonly autoFocus: boolean;
|
|
51
51
|
readonly wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
52
52
|
readonly paginationPosition?: import('vue-carousel-lite').PaginationPosition | import('vue-carousel-lite').PaginationPosition[];
|
|
53
|
+
readonly updateKey?: string | number;
|
|
53
54
|
readonly paginationBackground?: boolean;
|
|
54
55
|
readonly "onSlide-change"?: ((index: number) => any) | undefined;
|
|
55
56
|
} & 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">;
|
|
@@ -147,6 +148,9 @@ declare function __VLS_template(): {
|
|
|
147
148
|
type: import('vue').PropType<number>;
|
|
148
149
|
default: number;
|
|
149
150
|
};
|
|
151
|
+
updateKey: {
|
|
152
|
+
type: import('vue').PropType<string | number>;
|
|
153
|
+
};
|
|
150
154
|
autoFocus: {
|
|
151
155
|
type: import('vue').PropType<boolean>;
|
|
152
156
|
default: boolean;
|
|
@@ -325,6 +329,9 @@ declare function __VLS_template(): {
|
|
|
325
329
|
type: import('vue').PropType<number>;
|
|
326
330
|
default: number;
|
|
327
331
|
};
|
|
332
|
+
updateKey: {
|
|
333
|
+
type: import('vue').PropType<string | number>;
|
|
334
|
+
};
|
|
328
335
|
autoFocus: {
|
|
329
336
|
type: import('vue').PropType<boolean>;
|
|
330
337
|
default: boolean;
|
|
@@ -469,6 +476,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
469
476
|
readonly autoFocus: boolean;
|
|
470
477
|
readonly wheelOptions: import('vue-carousel-lite/types').WheelOptions;
|
|
471
478
|
readonly paginationPosition?: import('vue-carousel-lite').PaginationPosition | import('vue-carousel-lite').PaginationPosition[];
|
|
479
|
+
readonly updateKey?: string | number;
|
|
472
480
|
readonly paginationBackground?: boolean;
|
|
473
481
|
readonly "onSlide-change"?: ((index: number) => any) | undefined;
|
|
474
482
|
} & 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">;
|
|
@@ -566,6 +574,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
566
574
|
type: import('vue').PropType<number>;
|
|
567
575
|
default: number;
|
|
568
576
|
};
|
|
577
|
+
updateKey: {
|
|
578
|
+
type: import('vue').PropType<string | number>;
|
|
579
|
+
};
|
|
569
580
|
autoFocus: {
|
|
570
581
|
type: import('vue').PropType<boolean>;
|
|
571
582
|
default: boolean;
|
|
@@ -744,6 +755,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
744
755
|
type: import('vue').PropType<number>;
|
|
745
756
|
default: number;
|
|
746
757
|
};
|
|
758
|
+
updateKey: {
|
|
759
|
+
type: import('vue').PropType<string | number>;
|
|
760
|
+
};
|
|
747
761
|
autoFocus: {
|
|
748
762
|
type: import('vue').PropType<boolean>;
|
|
749
763
|
default: boolean;
|
|
@@ -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
|
};
|
|
@@ -6,6 +6,7 @@ interface Props {
|
|
|
6
6
|
size?: 'sm' | 'md' | 'lg';
|
|
7
7
|
position?: TooltTipPlacement;
|
|
8
8
|
btnProps?: ButtonProps;
|
|
9
|
+
showInput?: boolean;
|
|
9
10
|
}
|
|
10
11
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
11
12
|
"update:modelValue": (value: string) => any;
|
|
@@ -18,5 +19,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
18
19
|
size: "sm" | "md" | "lg";
|
|
19
20
|
modelValue: string;
|
|
20
21
|
position: TooltTipPlacement;
|
|
22
|
+
showInput: boolean;
|
|
21
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
22
24
|
export default _default;
|
|
@@ -1,56 +1,111 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as z, ref as p, watch as i, openBlock as a, createBlock as f, unref as v, withCtx as u, createElementBlock as h, createVNode as c, createCommentVNode as d, createElementVNode as $, mergeProps as w } from "vue";
|
|
2
|
+
import B from "../Dropdown/Dropdown.vue.js";
|
|
3
3
|
import "@iconify/vue";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import O from "../Input.vue.js";
|
|
5
|
+
import y from "../Button.vue.js";
|
|
6
|
+
import E from "./ColorIro.vue.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
|
|
8
|
+
import { useEyeDropper as P } from "@vueuse/core";
|
|
9
|
+
const I = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "p-2 w-max flex flex-col justify-center"
|
|
12
|
+
}, N = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "flex items-center gap-1.5 w-full"
|
|
15
|
+
}, D = { class: "w-32" }, q = /* @__PURE__ */ z({
|
|
8
16
|
__name: "ColorPicker",
|
|
9
17
|
props: {
|
|
10
18
|
modelValue: { default: "#000000" },
|
|
11
19
|
disabled: { type: Boolean, default: !1 },
|
|
12
20
|
size: { default: "md" },
|
|
13
21
|
position: { default: "bottom" },
|
|
14
|
-
btnProps: {}
|
|
22
|
+
btnProps: {},
|
|
23
|
+
showInput: { type: Boolean, default: !0 }
|
|
15
24
|
},
|
|
16
25
|
emits: ["update:modelValue", "change"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
|
|
26
|
+
setup(o, { emit: V }) {
|
|
27
|
+
const n = o, m = V, r = p(!1), t = p(n.modelValue || "#000000"), { isSupported: b, open: g, sRGBHex: k } = P();
|
|
28
|
+
i(k, (e) => {
|
|
29
|
+
e && (t.value = e);
|
|
30
|
+
});
|
|
31
|
+
const x = async () => {
|
|
32
|
+
try {
|
|
33
|
+
await g();
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error("Error opening eyedropper:", e);
|
|
36
|
+
}
|
|
20
37
|
};
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
i(
|
|
39
|
+
() => n.modelValue,
|
|
40
|
+
(e) => {
|
|
41
|
+
e && e !== t.value && (t.value = e);
|
|
42
|
+
}
|
|
43
|
+
), i(t, (e) => {
|
|
44
|
+
/^#([0-9A-F]{3,8})$/i.test(e) && e !== n.modelValue && (m("update:modelValue", e), m("change", e));
|
|
45
|
+
});
|
|
46
|
+
const C = (e) => {
|
|
47
|
+
t.value = e;
|
|
48
|
+
};
|
|
49
|
+
return (e, l) => (a(), f(v(B), {
|
|
50
|
+
disabled: o.disabled,
|
|
23
51
|
class: "w-auto",
|
|
24
|
-
position:
|
|
52
|
+
position: o.position,
|
|
25
53
|
offset: [0, 8],
|
|
26
54
|
searchable: !1,
|
|
27
|
-
"close-on-select": !1
|
|
55
|
+
"close-on-select": !1,
|
|
56
|
+
onOnOpen: l[1] || (l[1] = (s) => r.value = !0),
|
|
57
|
+
onOnClose: l[2] || (l[2] = (s) => r.value = !1)
|
|
28
58
|
}, {
|
|
29
|
-
trigger:
|
|
30
|
-
|
|
31
|
-
style: { backgroundColor:
|
|
59
|
+
trigger: u(({ isOpen: s }) => [
|
|
60
|
+
c(y, w({
|
|
61
|
+
style: { backgroundColor: o.modelValue }
|
|
32
62
|
}, {
|
|
33
63
|
rounded: "full",
|
|
34
64
|
size: "xs",
|
|
35
65
|
icon: " ",
|
|
36
66
|
variant: "outline",
|
|
37
|
-
...
|
|
67
|
+
...o.btnProps || {}
|
|
38
68
|
}), null, 16, ["style"])
|
|
39
69
|
]),
|
|
40
|
-
default:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
color:
|
|
70
|
+
default: u(() => [
|
|
71
|
+
r.value ? (a(), h("div", I, [
|
|
72
|
+
c(E, {
|
|
73
|
+
color: o.modelValue,
|
|
44
74
|
"show-header": !1,
|
|
45
|
-
size:
|
|
46
|
-
"onUpdate:color":
|
|
47
|
-
},
|
|
48
|
-
|
|
75
|
+
size: o.size,
|
|
76
|
+
"onUpdate:color": C
|
|
77
|
+
}, {
|
|
78
|
+
bottom: u(() => [
|
|
79
|
+
o.showInput ? (a(), h("div", N, [
|
|
80
|
+
v(b) ? (a(), f(y, {
|
|
81
|
+
key: 0,
|
|
82
|
+
onClick: x,
|
|
83
|
+
icon: "pepicons-pop:color-picker",
|
|
84
|
+
variant: "outline",
|
|
85
|
+
size: "sm",
|
|
86
|
+
class: "px-2 shrink-0"
|
|
87
|
+
})) : d("", !0),
|
|
88
|
+
$("div", D, [
|
|
89
|
+
c(O, {
|
|
90
|
+
modelValue: t.value,
|
|
91
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => t.value = s),
|
|
92
|
+
size: "sm",
|
|
93
|
+
"show-clear-button": !1,
|
|
94
|
+
placeholder: "#000000",
|
|
95
|
+
class: "flex-1 w-full",
|
|
96
|
+
"input-class": "font-mono text-xs uppercase "
|
|
97
|
+
}, null, 8, ["modelValue"])
|
|
98
|
+
])
|
|
99
|
+
])) : d("", !0)
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 8, ["color", "size"])
|
|
103
|
+
])) : d("", !0)
|
|
49
104
|
]),
|
|
50
105
|
_: 1
|
|
51
106
|
}, 8, ["disabled", "position"]));
|
|
52
107
|
}
|
|
53
108
|
});
|
|
54
109
|
export {
|
|
55
|
-
|
|
110
|
+
q as default
|
|
56
111
|
};
|