@pantograph/vue 0.0.2 → 0.0.3
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/ActionButton/ActionButton.d.ts +21 -0
- package/dist/ActionButton/index.cjs.js +1 -0
- package/dist/ActionButton/index.d.ts +1 -0
- package/dist/ActionButton/index.es.js +5 -0
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-Drb30rfG.js +39 -0
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-dxthnFw4.js +1 -0
- package/dist/Avatar/Avatar.d.ts +48 -0
- package/dist/Avatar/Avatar.model.d.ts +11 -0
- package/dist/Avatar/index.cjs.js +1 -0
- package/dist/Avatar/index.d.ts +2 -0
- package/dist/Avatar/index.es.js +9 -0
- package/dist/Avatar.vue_vue_type_style_index_0_lang-BB-v9NHG.js +1 -0
- package/dist/Avatar.vue_vue_type_style_index_0_lang-BWeEmazM.js +187 -0
- package/dist/AvatarGroup/AvatarGroup.d.ts +21 -0
- package/dist/AvatarGroup/index.cjs.js +1 -0
- package/dist/AvatarGroup/index.d.ts +1 -0
- package/dist/AvatarGroup/index.es.js +6 -0
- package/dist/Badge/Badge.d.ts +20 -0
- package/dist/Badge/index.cjs.js +1 -0
- package/dist/Badge/index.d.ts +1 -0
- package/dist/Badge/index.es.js +5 -0
- package/dist/Badge.vue_vue_type_script_setup_true_lang-CXfdGkKV.js +33 -0
- package/dist/Badge.vue_vue_type_script_setup_true_lang-sx-dXgFD.js +1 -0
- package/dist/Base/BaseBadge/BaseBadge.d.ts +36 -0
- package/dist/Base/BaseBadge/BaseBadge.model.d.ts +8 -0
- package/dist/Base/BaseButton/BaseButton.d.ts +45 -0
- package/dist/Base/BaseButton/BaseButton.model.d.ts +8 -0
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-B-uDLmB_.js +1 -0
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-F50Tg7IQ.js +151 -0
- package/dist/Button/Button.d.ts +17 -0
- package/dist/Button/index.cjs.js +1 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Button/index.es.js +5 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-Crhe5sHQ.js +1 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-XrPBGQq8.js +36 -0
- package/dist/ButtonGroup/ButtonGroup.d.ts +45 -0
- package/dist/ButtonGroup/index.cjs.js +1 -0
- package/dist/ButtonGroup/index.d.ts +1 -0
- package/dist/ButtonGroup/index.es.js +7 -0
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-DmShg2d-.js +1 -0
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-jtE0Gtp9.js +51 -0
- package/dist/Checkbox/Checkbox.d.ts +43 -0
- package/dist/Checkbox/Checkbox.model.d.ts +18 -0
- package/dist/Checkbox/index.cjs.js +1 -1
- package/dist/Checkbox/index.d.ts +2 -0
- package/dist/Checkbox/index.es.js +5 -3
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-BRJhkPIY.js +1 -0
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-OQRmH46S.js +194 -0
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +38 -0
- package/dist/CheckboxGroup/index.cjs.js +1 -0
- package/dist/CheckboxGroup/index.d.ts +1 -0
- package/dist/CheckboxGroup/index.es.js +6 -0
- package/dist/FloatButton/FloatButton.d.ts +19 -0
- package/dist/FloatButton/index.cjs.js +1 -0
- package/dist/FloatButton/index.d.ts +1 -0
- package/dist/FloatButton/index.es.js +5 -0
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-Bu9Ndwxm.js +1 -0
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-CCfZsUxy.js +34 -0
- package/dist/GraphicalObject/GraphicalObject.d.ts +19 -0
- package/dist/GraphicalObject/index.cjs.js +1 -0
- package/dist/GraphicalObject/index.d.ts +1 -0
- package/dist/GraphicalObject/index.es.js +5 -0
- package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-BhMxC00o.js +1 -0
- package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-CcI-aIS4.js +32 -0
- package/dist/Icon/Icon.d.ts +29 -0
- package/dist/Icon/Icon.model.d.ts +2 -0
- package/dist/Icon/index.cjs.js +1 -1
- package/dist/Icon/index.d.ts +5 -0
- package/dist/Icon/index.es.js +1 -1
- package/dist/Icon.vue_vue_type_style_index_0_lang-CB4CYuWH.js +47 -0
- package/dist/Icon.vue_vue_type_style_index_0_lang-CV1YvIs-.js +1 -0
- package/dist/IconButton/IconButton.d.ts +17 -0
- package/dist/IconButton/index.cjs.js +1 -0
- package/dist/IconButton/index.d.ts +1 -0
- package/dist/IconButton/index.es.js +5 -0
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-BTG_oQuF.js +34 -0
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-C93zhnQU.js +1 -0
- package/dist/Indicator/Indicator.d.ts +20 -0
- package/dist/Indicator/index.cjs.js +1 -0
- package/dist/Indicator/index.d.ts +1 -0
- package/dist/Indicator/index.es.js +5 -0
- package/dist/Indicator.vue_vue_type_script_setup_true_lang-Z02asVPa.js +1 -0
- package/dist/Indicator.vue_vue_type_script_setup_true_lang-qIUYIdkm.js +33 -0
- package/dist/Logotype-Dark.svg +3 -0
- package/dist/Logotype-Light.svg +3 -0
- package/dist/Popover/Popover.d.ts +122 -0
- package/dist/Popover/Popover.model.d.ts +4 -0
- package/dist/Popover/index.cjs.js +1 -0
- package/dist/Popover/index.d.ts +2 -0
- package/dist/Popover/index.es.js +7 -0
- package/dist/Popover.vue_vue_type_style_index_0_lang-Jf0LVKU_.js +127 -0
- package/dist/Popover.vue_vue_type_style_index_0_lang-VH8LnLG9.js +1 -0
- package/dist/Skeleton/Skeleton.d.ts +20 -0
- package/dist/Skeleton/Skeleton.model.d.ts +4 -0
- package/dist/Skeleton/index.cjs.js +1 -1
- package/dist/Skeleton/index.d.ts +2 -0
- package/dist/Skeleton/index.es.js +1 -1
- package/dist/Skeleton.vue_vue_type_style_index_0_lang-B6-i0F1w.js +1 -0
- package/dist/Skeleton.vue_vue_type_style_index_0_lang-C56TOumA.js +65 -0
- package/dist/Spinner/Spinner.d.ts +31 -0
- package/dist/Spinner/Spinner.model.d.ts +2 -0
- package/dist/Spinner/index.cjs.js +1 -0
- package/dist/Spinner/index.d.ts +2 -0
- package/dist/Spinner/index.es.js +6 -0
- package/dist/Spinner.vue_vue_type_style_index_0_lang-B5byV1za.js +75 -0
- package/dist/Spinner.vue_vue_type_style_index_0_lang-Baaz0Dxb.js +1 -0
- package/dist/Tabs/Tab.model.d.ts +2 -0
- package/dist/Tabs/index.cjs.js +1 -0
- package/dist/Tabs/index.d.ts +1 -0
- package/dist/Tabs/index.es.js +4 -0
- package/dist/Tag/Tag.model.d.ts +4 -0
- package/dist/Tag/index.cjs.js +1 -0
- package/dist/Tag/index.d.ts +1 -0
- package/dist/Tag/index.es.js +21 -0
- package/dist/element-BSTINJi_.js +1 -0
- package/dist/element-Cf07a63h.js +22 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.es.js +60 -10
- package/dist/logo.svg +4 -0
- package/dist/omit-B0hUroNu.js +1 -0
- package/dist/omit-DU39EwuA.js +851 -0
- package/dist/options-B8SF1auT.js +1 -0
- package/dist/options-B8rT2fg0.js +30 -0
- package/dist/style/index.css +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/element.d.ts +4 -0
- package/dist/utils/index.cjs.js +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.es.js +7 -0
- package/dist/utils/options.d.ts +6 -0
- package/package.json +117 -17
- package/dist/Checkbox/index.css +0 -1
- package/dist/Checkbox.d.ts +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-BLvqKFXl.js +0 -3
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-DxEbn-Bk.js +0 -474
- package/dist/Icon/index.css +0 -1
- package/dist/Icon.d.ts +0 -1
- package/dist/Icon.vue_vue_type_style_index_0_lang-EkZalwcR.js +0 -50
- package/dist/Icon.vue_vue_type_style_index_0_lang-wnLu7tWh.js +0 -1
- package/dist/Primitive-CSm3KbEm.js +0 -1
- package/dist/Primitive-DVdcdPSP.js +0 -50
- package/dist/Skeleton/index.css +0 -1
- package/dist/Skeleton.d.ts +0 -1
- package/dist/Skeleton.vue_vue_type_style_index_0_lang-CDohV4V1.js +0 -70
- package/dist/Skeleton.vue_vue_type_style_index_0_lang-CY6NdYvf.js +0 -1
- package/dist/class-BGw-1EB2.js +0 -29
- package/dist/class-vyfpYITq.js +0 -1
- package/dist/styles/index.css +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { defineComponent as w, computed as l, useSlots as E, openBlock as r, createBlock as c, unref as n, normalizeClass as B, withCtx as u, createElementBlock as N, Fragment as P, renderSlot as p, createCommentVNode as I, createTextVNode as j, toDisplayString as A, createSlots as D } from "vue";
|
|
2
|
+
import { Primitive as F } from "radix-vue";
|
|
3
|
+
import { _ as y } from "./Icon.vue_vue_type_style_index_0_lang-CB4CYuWH.js";
|
|
4
|
+
import { _ as G } from "./Spinner.vue_vue_type_style_index_0_lang-B5byV1za.js";
|
|
5
|
+
import { _ as L } from "./Badge.vue_vue_type_script_setup_true_lang-CXfdGkKV.js";
|
|
6
|
+
import { i as O, a as b, c as k, b as $, B as C } from "./ButtonGroup.vue_vue_type_script_setup_true_lang-jtE0Gtp9.js";
|
|
7
|
+
import { g as _, a, b as q, c as H } from "./options-B8rT2fg0.js";
|
|
8
|
+
import { cva as J } from "class-variance-authority";
|
|
9
|
+
const Z = /* @__PURE__ */ w({
|
|
10
|
+
..._("BaseButton"),
|
|
11
|
+
__name: "BaseButton",
|
|
12
|
+
props: {
|
|
13
|
+
class: {},
|
|
14
|
+
text: {},
|
|
15
|
+
size: {},
|
|
16
|
+
color: { default: "primary" },
|
|
17
|
+
type: { default: "fill" },
|
|
18
|
+
variant: {},
|
|
19
|
+
loading: { type: Boolean },
|
|
20
|
+
action: { type: Boolean },
|
|
21
|
+
active: { type: Boolean },
|
|
22
|
+
badgeText: {},
|
|
23
|
+
badgeIcon: {},
|
|
24
|
+
icon: {},
|
|
25
|
+
preIcon: {},
|
|
26
|
+
postIcon: {},
|
|
27
|
+
as: { default: "button" }
|
|
28
|
+
},
|
|
29
|
+
setup(S) {
|
|
30
|
+
const t = H("button"), o = S, T = J(t, {
|
|
31
|
+
variants: {
|
|
32
|
+
size: a(k, t),
|
|
33
|
+
type: a(b, t),
|
|
34
|
+
color: a($, t),
|
|
35
|
+
variant: a(C, t),
|
|
36
|
+
action: a("action", t),
|
|
37
|
+
active: a("active", t),
|
|
38
|
+
text: a("text", t),
|
|
39
|
+
preIcon: a("preIcon", t),
|
|
40
|
+
postIcon: a("postIcon", t),
|
|
41
|
+
loading: a("loading", t)
|
|
42
|
+
}
|
|
43
|
+
}), z = O({
|
|
44
|
+
size: l(() => o.size),
|
|
45
|
+
variant: l(() => o.variant)
|
|
46
|
+
}), d = l(() => o.variant ?? z.variant.value ?? "simple"), i = l(() => ["icon", "float"].includes(d.value)), s = E(), h = l(() => {
|
|
47
|
+
let e = b.includes(o.type) ? o.type : "fill";
|
|
48
|
+
const m = o.size ?? z.size.value, V = m && k.includes(m) ? m : "md";
|
|
49
|
+
let f = o.color && $.includes(o.color) ? o.color : "primary", v = d.value && C.includes(d.value) ? d.value : "simple";
|
|
50
|
+
return o.action ? (v === "float" && (v = "icon"), e === "fill" && (e = "outline"), f = void 0) : v === "float" && (e === "ghost" && (e = "fill"), ["primary", "gray"].includes(f) || (f = "primary")), {
|
|
51
|
+
size: V,
|
|
52
|
+
type: e,
|
|
53
|
+
color: f,
|
|
54
|
+
variant: v,
|
|
55
|
+
action: o.action,
|
|
56
|
+
active: o.active,
|
|
57
|
+
loading: o.loading,
|
|
58
|
+
text: !i.value && !!(o.text || s.default),
|
|
59
|
+
preIcon: !i.value && !!(o.preIcon || s.preIcon),
|
|
60
|
+
postIcon: !i.value && !!(o.postIcon || s.postIcon)
|
|
61
|
+
};
|
|
62
|
+
}), g = l(() => {
|
|
63
|
+
switch (o.size) {
|
|
64
|
+
case "sm":
|
|
65
|
+
return "3xsm";
|
|
66
|
+
default:
|
|
67
|
+
return "2xsm";
|
|
68
|
+
}
|
|
69
|
+
}), x = l(() => {
|
|
70
|
+
switch (o.size) {
|
|
71
|
+
case "sm":
|
|
72
|
+
return "3xsm";
|
|
73
|
+
case "lg":
|
|
74
|
+
return "xsm";
|
|
75
|
+
case "md":
|
|
76
|
+
default:
|
|
77
|
+
return "2xsm";
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return (e, m) => (r(), c(n(F), {
|
|
81
|
+
as: e.as,
|
|
82
|
+
class: B([n(T)(h.value), o.class]),
|
|
83
|
+
tabindex: "0"
|
|
84
|
+
}, {
|
|
85
|
+
default: u(() => [
|
|
86
|
+
e.loading ? (r(), c(G, {
|
|
87
|
+
key: 1,
|
|
88
|
+
class: B(n(q)(n(t), "loading")),
|
|
89
|
+
size: g.value
|
|
90
|
+
}, null, 8, ["class", "size"])) : (r(), N(P, { key: 0 }, [
|
|
91
|
+
(e.preIcon || n(s).preIcon) && !i.value ? (r(), c(y, {
|
|
92
|
+
key: 0,
|
|
93
|
+
icon: e.preIcon,
|
|
94
|
+
size: g.value
|
|
95
|
+
}, {
|
|
96
|
+
default: u(() => [
|
|
97
|
+
p(e.$slots, "preIcon")
|
|
98
|
+
]),
|
|
99
|
+
_: 3
|
|
100
|
+
}, 8, ["icon", "size"])) : I("", !0),
|
|
101
|
+
i.value ? (r(), c(y, {
|
|
102
|
+
key: 1,
|
|
103
|
+
icon: e.icon,
|
|
104
|
+
size: x.value
|
|
105
|
+
}, {
|
|
106
|
+
default: u(() => [
|
|
107
|
+
p(e.$slots, "icon")
|
|
108
|
+
]),
|
|
109
|
+
_: 3
|
|
110
|
+
}, 8, ["icon", "size"])) : p(e.$slots, "default", { key: 2 }, () => [
|
|
111
|
+
j(A(e.text), 1)
|
|
112
|
+
]),
|
|
113
|
+
e.action && e.active && !i.value && (e.badgeText || n(s).badgeText || e.badgeIcon || n(s).badgeIcon) ? (r(), c(L, {
|
|
114
|
+
key: 3,
|
|
115
|
+
text: e.badgeText,
|
|
116
|
+
icon: e.badgeIcon,
|
|
117
|
+
color: e.$attrs.disabled ? "gray" : "primary",
|
|
118
|
+
size: "2xsm"
|
|
119
|
+
}, D({
|
|
120
|
+
default: u(() => [
|
|
121
|
+
p(e.$slots, "badgeText")
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
}, [
|
|
125
|
+
e.badgeIcon || n(s).badgeIcon ? {
|
|
126
|
+
name: "icon",
|
|
127
|
+
fn: u(() => [
|
|
128
|
+
p(e.$slots, "badgeIcon")
|
|
129
|
+
]),
|
|
130
|
+
key: "0"
|
|
131
|
+
} : void 0
|
|
132
|
+
]), 1032, ["text", "icon", "color"])) : I("", !0),
|
|
133
|
+
(e.postIcon || n(s).postIcon) && !i.value ? (r(), c(y, {
|
|
134
|
+
key: 4,
|
|
135
|
+
icon: e.postIcon,
|
|
136
|
+
size: g.value
|
|
137
|
+
}, {
|
|
138
|
+
default: u(() => [
|
|
139
|
+
p(e.$slots, "postIcon")
|
|
140
|
+
]),
|
|
141
|
+
_: 3
|
|
142
|
+
}, 8, ["icon", "size"])) : I("", !0)
|
|
143
|
+
], 64))
|
|
144
|
+
]),
|
|
145
|
+
_: 3
|
|
146
|
+
}, 8, ["as", "class"]));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
export {
|
|
150
|
+
Z as _
|
|
151
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseButtonProps } from '../Base/BaseButton/BaseButton';
|
|
2
|
+
export type ButtonProps = Pick<BaseButtonProps, 'as' | 'class' | 'type' | 'color' | 'loading' | 'preIcon' | 'postIcon' | 'size' | 'text'>;
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: Partial<Record<string, (_: any) => any>>;
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Button.vue_vue_type_script_setup_true_lang-Crhe5sHQ.js");exports.Button=e._sfc_main;exports.default=e._sfc_main;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button, type ButtonProps, default } from './Button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),a=require("./BaseButton.vue_vue_type_style_index_0_lang-B-uDLmB_.js"),p=require("./options-B8SF1auT.js"),u=require("./omit-B0hUroNu.js"),_=e.defineComponent({...p.getComponentOptions("IconButton",!1),__name:"Button",props:{as:{},class:{},type:{},color:{},loading:{type:Boolean},preIcon:{},postIcon:{},size:{},text:{}},setup(o){const s=o,r=e.useAttrs(),c=e.computed(()=>({...u.omit(r,"variant","icon","action","active","badgeText"),...s}));return(t,l)=>(e.openBlock(),e.createBlock(a._sfc_main,e.mergeProps(c.value,{variant:"simple"}),e.createSlots({_:2},[e.renderList(Object.keys(t.$slots),n=>({name:n,fn:e.withCtx(i=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(i)))])}))]),1040))}});exports._sfc_main=_;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as i, useAttrs as p, computed as c, openBlock as m, createBlock as l, mergeProps as u, createSlots as f, renderList as _, withCtx as d, renderSlot as g, normalizeProps as v, guardReactiveProps as B } from "vue";
|
|
2
|
+
import { _ as b } from "./BaseButton.vue_vue_type_style_index_0_lang-F50Tg7IQ.js";
|
|
3
|
+
import { g as k } from "./options-B8rT2fg0.js";
|
|
4
|
+
import { o as x } from "./omit-DU39EwuA.js";
|
|
5
|
+
const h = /* @__PURE__ */ i({
|
|
6
|
+
...k("IconButton", !1),
|
|
7
|
+
__name: "Button",
|
|
8
|
+
props: {
|
|
9
|
+
as: {},
|
|
10
|
+
class: {},
|
|
11
|
+
type: {},
|
|
12
|
+
color: {},
|
|
13
|
+
loading: { type: Boolean },
|
|
14
|
+
preIcon: {},
|
|
15
|
+
postIcon: {},
|
|
16
|
+
size: {},
|
|
17
|
+
text: {}
|
|
18
|
+
},
|
|
19
|
+
setup(e) {
|
|
20
|
+
const n = e, r = p(), s = c(() => ({
|
|
21
|
+
...x(r, "variant", "icon", "action", "active", "badgeText"),
|
|
22
|
+
...n
|
|
23
|
+
}));
|
|
24
|
+
return (o, y) => (m(), l(b, u(s.value, { variant: "simple" }), f({ _: 2 }, [
|
|
25
|
+
_(Object.keys(o.$slots), (t) => ({
|
|
26
|
+
name: t,
|
|
27
|
+
fn: d((a) => [
|
|
28
|
+
g(o.$slots, t, v(B(a)))
|
|
29
|
+
])
|
|
30
|
+
}))
|
|
31
|
+
]), 1040));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
h as _
|
|
36
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ButtonSize, ButtonVariant } from '../Base/BaseButton/BaseButton.model';
|
|
2
|
+
import { PrimitiveProps } from 'radix-vue';
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
|
+
import { Class } from '../types';
|
|
5
|
+
declare const ButtonGroupGaps: readonly ["sm", "md", "lg", "none"];
|
|
6
|
+
export type ButtonGroupProps = Omit<PrimitiveProps, 'asChild'> & {
|
|
7
|
+
class?: Class;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
variant?: ButtonVariant;
|
|
10
|
+
gap?: (typeof ButtonGroupGaps)[number];
|
|
11
|
+
split?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const injectButtonGroupContext: <T extends {
|
|
14
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
15
|
+
variant: ComputedRef<ButtonVariant | undefined>;
|
|
16
|
+
} | null | undefined = {
|
|
17
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
18
|
+
variant: ComputedRef<ButtonVariant | undefined>;
|
|
19
|
+
}>(fallback?: T | undefined) => T extends null ? {
|
|
20
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
21
|
+
variant: ComputedRef<ButtonVariant | undefined>;
|
|
22
|
+
} | null : {
|
|
23
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
24
|
+
variant: ComputedRef<ButtonVariant | undefined>;
|
|
25
|
+
}, provideButtonGroupContext: (contextValue: {
|
|
26
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
27
|
+
variant: ComputedRef<ButtonVariant | undefined>;
|
|
28
|
+
}) => {
|
|
29
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
30
|
+
variant: ComputedRef<ButtonVariant | undefined>;
|
|
31
|
+
};
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<ButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonGroupProps> & Readonly<{}>, {
|
|
33
|
+
size: ButtonSize;
|
|
34
|
+
split: boolean;
|
|
35
|
+
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
36
|
+
variant: ButtonVariant;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
38
|
+
default?(_: {}): any;
|
|
39
|
+
}>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../ButtonGroup.vue_vue_type_script_setup_true_lang-DmShg2d-.js");exports.ButtonGroup=t._sfc_main;exports.default=t._sfc_main;exports.injectButtonGroupContext=t.injectButtonGroupContext;exports.provideButtonGroupContext=t.provideButtonGroupContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ButtonGroup, provideButtonGroupContext, injectButtonGroupContext, type ButtonGroupProps, default, } from './ButtonGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),a=require("radix-vue"),o=require("./options-B8SF1auT.js"),c=require("class-variance-authority"),B=["simple","icon","float"],m=["fill","outline","ghost"],d=["primary","danger","success","warning","gray"],r=["sm","md","lg"],f=[...r,"none"],[g,i]=a.createContext("ButtonGroup"),C=t.defineComponent({...o.getComponentOptions("ButtonGroup"),__name:"ButtonGroup",props:{as:{default:"div"},class:{},size:{default:"md"},variant:{default:"simple"},gap:{},split:{type:Boolean,default:!1}},setup(u){const e=u,p=o.getBemBlock("button"),n=o.getBemElement(p,"group"),l=c.cva(n,{variants:{gap:o.generateVariantClassList(f,n),split:o.generateVariantClassList("split",n)}});return i({size:t.computed(()=>e.size),variant:t.computed(()=>e.variant)}),(s,v)=>(t.openBlock(),t.createBlock(t.unref(a.Primitive),{as:s.as,class:t.normalizeClass([t.unref(l)({gap:e.gap??e.size,split:s.split}),e.class])},{default:t.withCtx(()=>[t.renderSlot(s.$slots,"default")]),_:3},8,["as","class"]))}});exports.ButtonColors=d;exports.ButtonSizes=r;exports.ButtonTypes=m;exports.ButtonVariants=B;exports._sfc_main=C;exports.injectButtonGroupContext=g;exports.provideButtonGroupContext=i;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as l, computed as a, openBlock as u, createBlock as c, unref as e, normalizeClass as m, withCtx as f, renderSlot as B } from "vue";
|
|
2
|
+
import { createContext as g, Primitive as d } from "radix-vue";
|
|
3
|
+
import { g as C, a as n, b as v, c as G } from "./options-B8rT2fg0.js";
|
|
4
|
+
import { cva as z } from "class-variance-authority";
|
|
5
|
+
const V = ["simple", "icon", "float"], j = ["fill", "outline", "ghost"], E = ["primary", "danger", "success", "warning", "gray"], x = ["sm", "md", "lg"], _ = [...x, "none"], [L, y] = g("ButtonGroup"), O = /* @__PURE__ */ l({
|
|
6
|
+
...C("ButtonGroup"),
|
|
7
|
+
__name: "ButtonGroup",
|
|
8
|
+
props: {
|
|
9
|
+
as: { default: "div" },
|
|
10
|
+
class: {},
|
|
11
|
+
size: { default: "md" },
|
|
12
|
+
variant: { default: "simple" },
|
|
13
|
+
gap: {},
|
|
14
|
+
split: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
setup(r) {
|
|
17
|
+
const t = r, i = G("button"), s = v(i, "group"), p = z(s, {
|
|
18
|
+
variants: {
|
|
19
|
+
gap: n(_, s),
|
|
20
|
+
split: n("split", s)
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return y({
|
|
24
|
+
size: a(() => t.size),
|
|
25
|
+
variant: a(() => t.variant)
|
|
26
|
+
}), (o, b) => (u(), c(e(d), {
|
|
27
|
+
as: o.as,
|
|
28
|
+
class: m([
|
|
29
|
+
e(p)({
|
|
30
|
+
gap: t.gap ?? t.size,
|
|
31
|
+
split: o.split
|
|
32
|
+
}),
|
|
33
|
+
t.class
|
|
34
|
+
])
|
|
35
|
+
}, {
|
|
36
|
+
default: f(() => [
|
|
37
|
+
B(o.$slots, "default")
|
|
38
|
+
]),
|
|
39
|
+
_: 3
|
|
40
|
+
}, 8, ["as", "class"]));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
V as B,
|
|
45
|
+
O as _,
|
|
46
|
+
j as a,
|
|
47
|
+
E as b,
|
|
48
|
+
x as c,
|
|
49
|
+
L as i,
|
|
50
|
+
y as p
|
|
51
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CheckboxRootProps } from 'radix-vue';
|
|
2
|
+
import { CheckboxSize } from './Checkbox.model';
|
|
3
|
+
import { Class } from '../types';
|
|
4
|
+
export interface CheckboxProps extends Omit<CheckboxRootProps, 'asChild'> {
|
|
5
|
+
size?: CheckboxSize;
|
|
6
|
+
class?: Class;
|
|
7
|
+
labelAs?: CheckboxRootProps['as'];
|
|
8
|
+
label?: string;
|
|
9
|
+
valueAsLabel?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function __VLS_template(): {
|
|
12
|
+
attrs: Partial<{}>;
|
|
13
|
+
slots: {
|
|
14
|
+
default?(_: {
|
|
15
|
+
checked: boolean | "indeterminate";
|
|
16
|
+
disabled: boolean | undefined;
|
|
17
|
+
required: boolean | undefined;
|
|
18
|
+
}): any;
|
|
19
|
+
};
|
|
20
|
+
refs: {};
|
|
21
|
+
rootEl: any;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
|
+
declare const __VLS_component: import('vue').DefineComponent<CheckboxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
|
+
change: (value: boolean | "indeterminate") => any;
|
|
26
|
+
"update:checked": (value: boolean) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<CheckboxProps> & Readonly<{
|
|
28
|
+
onChange?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
29
|
+
"onUpdate:checked"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
size: CheckboxSize;
|
|
32
|
+
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
33
|
+
checked: boolean | "indeterminate";
|
|
34
|
+
labelAs: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
35
|
+
valueAsLabel: boolean;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const CheckboxSizes: readonly ["2xsm", "xsm"];
|
|
2
|
+
export type CheckboxSize = (typeof CheckboxSizes)[number];
|
|
3
|
+
export declare const useColoredPantographCheckbox: (color: string) => {
|
|
4
|
+
'--ptc-checkbox-bg': string;
|
|
5
|
+
'--ptc-checkbox-bg-hover': string;
|
|
6
|
+
'--ptc-checkbox-bg-focus': string;
|
|
7
|
+
'--ptc-checkbox-br-focus': string;
|
|
8
|
+
'--ptc-checkbox-bg-active': string;
|
|
9
|
+
'--ptc-checkbox-shadow': string;
|
|
10
|
+
};
|
|
11
|
+
export declare const useColoredPantographCheckboxGroup: (color: string) => {
|
|
12
|
+
'--ptc-group-checkbox-bg': string;
|
|
13
|
+
'--ptc-group-checkbox-bg-hover': string;
|
|
14
|
+
'--ptc-group-checkbox-bg-focus': string;
|
|
15
|
+
'--ptc-group-checkbox-br-focus': string;
|
|
16
|
+
'--ptc-group-checkbox-bg-active': string;
|
|
17
|
+
'--ptc-group-checkbox-shadow': string;
|
|
18
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Checkbox.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Checkbox.vue_vue_type_style_index_0_lang-BRJhkPIY.js");exports.Checkbox=e._sfc_main;exports.CheckboxSizes=e.CheckboxSizes;exports.default=e._sfc_main;exports.useColoredPantographCheckbox=e.useColoredPantographCheckbox;exports.useColoredPantographCheckboxGroup=e.useColoredPantographCheckboxGroup;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as e, C as s, _ as r, u as C, a as h } from "../Checkbox.vue_vue_type_style_index_0_lang-OQRmH46S.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
e as Checkbox,
|
|
4
4
|
s as CheckboxSizes,
|
|
5
|
-
|
|
5
|
+
r as default,
|
|
6
|
+
C as useColoredPantographCheckbox,
|
|
7
|
+
h as useColoredPantographCheckboxGroup
|
|
6
8
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),m=require("radix-vue"),c=require("@pantograph/tokens"),G=require("./Icon.vue_vue_type_style_index_0_lang-CV1YvIs-.js"),u=require("./options-B8SF1auT.js"),S=require("class-variance-authority"),B=["2xsm","xsm"],A=o=>({"--ptc-checkbox-bg":`var(--${c.prefixTokens}-${o}-5)`,"--ptc-checkbox-bg-hover":`var(--${c.prefixTokens}-${o}-4)`,"--ptc-checkbox-bg-focus":`var(--${c.prefixTokens}-${o}-6)`,"--ptc-checkbox-br-focus":`var(--${c.prefixTokens}-${o}-6)`,"--ptc-checkbox-bg-active":`var(--${c.prefixTokens}-${o}-7)`,"--ptc-checkbox-shadow":`var(--${c.prefixTokens}-${o}-3)`}),E=o=>({"--ptc-group-checkbox-bg":`var(--${c.prefixTokens}-${o}-5)`,"--ptc-group-checkbox-bg-hover":`var(--${c.prefixTokens}-${o}-4)`,"--ptc-group-checkbox-bg-focus":`var(--${c.prefixTokens}-${o}-6)`,"--ptc-group-checkbox-br-focus":`var(--${c.prefixTokens}-${o}-6)`,"--ptc-group-checkbox-bg-active":`var(--${c.prefixTokens}-${o}-7)`,"--ptc-group-checkbox-shadow":`var(--${c.prefixTokens}-${o}-3)`}),[$,_]=m.createContext("CheckboxGroup"),L=e.defineComponent({...u.getComponentOptions("CheckboxGroup"),__name:"CheckboxGroup",props:{asChild:{type:Boolean,default:!1},as:{},value:{},size:{},disabled:{type:Boolean},name:{},options:{}},emits:["update:value","change"],setup(o,{emit:b}){const n=b,t=o,s=e.computed(()=>{const{size:l,disabled:v,...p}=t;return p}),k=e.computed({get(){return t.value??[]},set(l){n("update:value",l),n("change",l)}}),h=e.computed(()=>t.size),d=e.computed(()=>t.disabled?!0:void 0);return _({model:k,size:h,disabled:d}),(l,v)=>(e.openBlock(),e.createBlock(e.unref(m.Primitive),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>{var p;return[(p=l.options)!=null&&p.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,i=>(e.openBlock(),e.createBlock(z,e.mergeProps({key:i.value,ref_for:!0},i),null,16))),128)):e.createCommentVNode("",!0)]})]),_:3},16))}}),z=e.defineComponent({...u.getComponentOptions("Checkbox"),__name:"Checkbox",props:{size:{default:"xsm"},class:{},labelAs:{default:"span"},label:{},valueAsLabel:{type:Boolean,default:!0},defaultChecked:{type:Boolean},checked:{type:[Boolean,String],default:void 0},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},as:{default:"label"}},emits:["update:checked","change"],setup(o,{emit:b}){const n=u.getBemBlock("checkbox"),t=o,s=$({model:e.ref([]),size:e.computed(()=>t.size),disabled:e.computed(()=>t.disabled)}),k=b,h=e.useSlots(),d=e.ref(),l=a=>{var r,f;if(s.model.value&&t.value!==void 0){const x=(f=(r=s.model.value)==null?void 0:r.indexOf)==null?void 0:f.call(r,t.value);a&&x===-1?s.model.value=[...s.model.value,t.value]:!a&&x!==-1&&(s.model.value=s.model.value.filter(C=>C!==t.value))}else t.checked!==void 0?(k("update:checked",a),k("change",a)):d.value=a};e.watch(()=>[s.model,t.checked],()=>{var a,r;s.model.value&&t.value!==void 0?d.value=(r=(a=s.model.value)==null?void 0:a.includes)==null?void 0:r.call(a,t.value):d.value=t.checked},{immediate:!0,deep:!0});const v=e.computed(()=>{const{size:a,class:r,labelAs:f,label:x,as:C,disabled:V,checked:N,...q}=t;return{disabled:s.disabled.value??t.disabled,...q}}),p=S.cva(n,{variants:{size:u.generateVariantClassList(B,n)}}),i=e.computed(()=>t.label||h.default||t.value&&t.valueAsLabel),y=e.computed(()=>({asChild:!i.value,as:t.labelAs})),P=e.computed(()=>{if(t.label)return t.label;if(t.value&&t.valueAsLabel)return t.value}),T=e.computed(()=>({asChild:!i.value,as:t.as})),g=e.computed(()=>s.size.value??t.size),w=e.computed(()=>{switch(g.value){case"xsm":return"2xsm";case"2xsm":default:return"3xsm"}});return(a,r)=>(e.openBlock(),e.createBlock(e.unref(m.Primitive),e.mergeProps({key:i.value},T.value,{class:[e.unref(u.getBemElement)(e.unref(n),"root"),t.class]}),{default:e.withCtx(()=>[e.createVNode(e.unref(m.CheckboxRoot),e.mergeProps(v.value,{checked:d.value,"onUpdate:checked":l,class:e.unref(p)({size:g.value})}),{default:e.withCtx(()=>[e.createVNode(e.unref(m.CheckboxIndicator),{class:e.normalizeClass(e.unref(u.getBemElement)(e.unref(n),"indicator")),asChild:""},{default:e.withCtx(()=>[t.checked!="indeterminate"?(e.openBlock(),e.createBlock(G._sfc_main,{key:0,icon:"tabler:check",class:e.normalizeClass(e.unref(u.getBemElement)(e.unref(n),"icon")),"flip-on-dir":"rtl",size:w.value},null,8,["class","size"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(u.getBemElement)(e.unref(n),"indeterminate"))},null,2))]),_:1},8,["class"])]),_:1},16,["checked","class"]),(e.openBlock(),e.createBlock(e.unref(m.Primitive),e.mergeProps({key:i.value},y.value,{class:e.unref(u.getBemElement)(e.unref(n),"label")}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{checked:a.checked,disabled:a.disabled,required:a.required},()=>[e.createTextVNode(e.toDisplayString(P.value),1)])]),_:3},16,["class"]))]),_:3},16,["class"]))}});exports.CheckboxSizes=B;exports._sfc_main=z;exports._sfc_main$1=L;exports.injectCheckboxGroupContext=$;exports.provideCheckboxGroupContext=_;exports.useColoredPantographCheckbox=A;exports.useColoredPantographCheckboxGroup=E;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { defineComponent as A, computed as l, openBlock as u, createBlock as m, unref as t, normalizeProps as T, guardReactiveProps as j, withCtx as h, renderSlot as G, createElementBlock as P, Fragment as D, renderList as F, mergeProps as f, createCommentVNode as I, ref as S, useSlots as U, watch as H, createVNode as w, normalizeClass as _, createTextVNode as J, toDisplayString as K } from "vue";
|
|
2
|
+
import { createContext as M, Primitive as y, CheckboxRoot as Q, CheckboxIndicator as W } from "radix-vue";
|
|
3
|
+
import { prefixTokens as c } from "@pantograph/tokens";
|
|
4
|
+
import { _ as X } from "./Icon.vue_vue_type_style_index_0_lang-CB4CYuWH.js";
|
|
5
|
+
import { g as V, a as Y, b as v, c as Z } from "./options-B8rT2fg0.js";
|
|
6
|
+
import { cva as ee } from "class-variance-authority";
|
|
7
|
+
const ae = ["2xsm", "xsm"], be = (a) => ({
|
|
8
|
+
"--ptc-checkbox-bg": `var(--${c}-${a}-5)`,
|
|
9
|
+
"--ptc-checkbox-bg-hover": `var(--${c}-${a}-4)`,
|
|
10
|
+
"--ptc-checkbox-bg-focus": `var(--${c}-${a}-6)`,
|
|
11
|
+
"--ptc-checkbox-br-focus": `var(--${c}-${a}-6)`,
|
|
12
|
+
"--ptc-checkbox-bg-active": `var(--${c}-${a}-7)`,
|
|
13
|
+
"--ptc-checkbox-shadow": `var(--${c}-${a}-3)`
|
|
14
|
+
}), ve = (a) => ({
|
|
15
|
+
"--ptc-group-checkbox-bg": `var(--${c}-${a}-5)`,
|
|
16
|
+
"--ptc-group-checkbox-bg-hover": `var(--${c}-${a}-4)`,
|
|
17
|
+
"--ptc-group-checkbox-bg-focus": `var(--${c}-${a}-6)`,
|
|
18
|
+
"--ptc-group-checkbox-br-focus": `var(--${c}-${a}-6)`,
|
|
19
|
+
"--ptc-group-checkbox-bg-active": `var(--${c}-${a}-7)`,
|
|
20
|
+
"--ptc-group-checkbox-shadow": `var(--${c}-${a}-3)`
|
|
21
|
+
}), [se, te] = M("CheckboxGroup"), he = /* @__PURE__ */ A({
|
|
22
|
+
...V("CheckboxGroup"),
|
|
23
|
+
__name: "CheckboxGroup",
|
|
24
|
+
props: {
|
|
25
|
+
asChild: { type: Boolean, default: !1 },
|
|
26
|
+
as: {},
|
|
27
|
+
value: {},
|
|
28
|
+
size: {},
|
|
29
|
+
disabled: { type: Boolean },
|
|
30
|
+
name: {},
|
|
31
|
+
options: {}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:value", "change"],
|
|
34
|
+
setup(a, { emit: g }) {
|
|
35
|
+
const r = g, e = a, o = l(() => {
|
|
36
|
+
const { size: n, disabled: C, ...b } = e;
|
|
37
|
+
return b;
|
|
38
|
+
}), k = l({
|
|
39
|
+
get() {
|
|
40
|
+
return e.value ?? [];
|
|
41
|
+
},
|
|
42
|
+
set(n) {
|
|
43
|
+
r("update:value", n), r("change", n);
|
|
44
|
+
}
|
|
45
|
+
}), x = l(() => e.size), p = l(() => e.disabled ? !0 : void 0);
|
|
46
|
+
return te({
|
|
47
|
+
model: k,
|
|
48
|
+
size: x,
|
|
49
|
+
disabled: p
|
|
50
|
+
}), (n, C) => (u(), m(t(y), T(j(o.value)), {
|
|
51
|
+
default: h(() => [
|
|
52
|
+
G(n.$slots, "default", {}, () => {
|
|
53
|
+
var b;
|
|
54
|
+
return [
|
|
55
|
+
(b = n.options) != null && b.length ? (u(!0), P(D, { key: 0 }, F(n.options, (i) => (u(), m(oe, f({
|
|
56
|
+
key: i.value,
|
|
57
|
+
ref_for: !0
|
|
58
|
+
}, i), null, 16))), 128)) : I("", !0)
|
|
59
|
+
];
|
|
60
|
+
})
|
|
61
|
+
]),
|
|
62
|
+
_: 3
|
|
63
|
+
}, 16));
|
|
64
|
+
}
|
|
65
|
+
}), oe = /* @__PURE__ */ A({
|
|
66
|
+
...V("Checkbox"),
|
|
67
|
+
__name: "Checkbox",
|
|
68
|
+
props: {
|
|
69
|
+
size: { default: "xsm" },
|
|
70
|
+
class: {},
|
|
71
|
+
labelAs: { default: "span" },
|
|
72
|
+
label: {},
|
|
73
|
+
valueAsLabel: { type: Boolean, default: !0 },
|
|
74
|
+
defaultChecked: { type: Boolean },
|
|
75
|
+
checked: { type: [Boolean, String], default: void 0 },
|
|
76
|
+
disabled: { type: Boolean },
|
|
77
|
+
required: { type: Boolean },
|
|
78
|
+
name: {},
|
|
79
|
+
value: {},
|
|
80
|
+
id: {},
|
|
81
|
+
as: { default: "label" }
|
|
82
|
+
},
|
|
83
|
+
emits: ["update:checked", "change"],
|
|
84
|
+
setup(a, { emit: g }) {
|
|
85
|
+
const r = Z("checkbox"), e = a, o = se({
|
|
86
|
+
model: S([]),
|
|
87
|
+
size: l(() => e.size),
|
|
88
|
+
disabled: l(() => e.disabled)
|
|
89
|
+
}), k = g, x = U(), p = S(), n = (s) => {
|
|
90
|
+
var d, $;
|
|
91
|
+
if (o.model.value && e.value !== void 0) {
|
|
92
|
+
const z = ($ = (d = o.model.value) == null ? void 0 : d.indexOf) == null ? void 0 : $.call(d, e.value);
|
|
93
|
+
s && z === -1 ? o.model.value = [...o.model.value, e.value] : !s && z !== -1 && (o.model.value = o.model.value.filter((L) => L !== e.value));
|
|
94
|
+
} else e.checked !== void 0 ? (k("update:checked", s), k("change", s)) : p.value = s;
|
|
95
|
+
};
|
|
96
|
+
H(
|
|
97
|
+
() => [o.model, e.checked],
|
|
98
|
+
() => {
|
|
99
|
+
var s, d;
|
|
100
|
+
o.model.value && e.value !== void 0 ? p.value = (d = (s = o.model.value) == null ? void 0 : s.includes) == null ? void 0 : d.call(s, e.value) : p.value = e.checked;
|
|
101
|
+
},
|
|
102
|
+
{ immediate: !0, deep: !0 }
|
|
103
|
+
);
|
|
104
|
+
const C = l(() => {
|
|
105
|
+
const { size: s, class: d, labelAs: $, label: z, as: L, disabled: le, checked: ce, ...R } = e;
|
|
106
|
+
return {
|
|
107
|
+
disabled: o.disabled.value ?? e.disabled,
|
|
108
|
+
...R
|
|
109
|
+
};
|
|
110
|
+
}), b = ee(r, {
|
|
111
|
+
variants: {
|
|
112
|
+
size: Y(ae, r)
|
|
113
|
+
}
|
|
114
|
+
}), i = l(() => e.label || x.default || e.value && e.valueAsLabel), q = l(() => ({
|
|
115
|
+
asChild: !i.value,
|
|
116
|
+
as: e.labelAs
|
|
117
|
+
})), N = l(() => {
|
|
118
|
+
if (e.label) return e.label;
|
|
119
|
+
if (e.value && e.valueAsLabel) return e.value;
|
|
120
|
+
}), E = l(() => ({
|
|
121
|
+
asChild: !i.value,
|
|
122
|
+
as: e.as
|
|
123
|
+
})), B = l(() => o.size.value ?? e.size), O = l(() => {
|
|
124
|
+
switch (B.value) {
|
|
125
|
+
case "xsm":
|
|
126
|
+
return "2xsm";
|
|
127
|
+
case "2xsm":
|
|
128
|
+
default:
|
|
129
|
+
return "3xsm";
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return (s, d) => (u(), m(t(y), f({
|
|
133
|
+
key: i.value
|
|
134
|
+
}, E.value, {
|
|
135
|
+
class: [t(v)(t(r), "root"), e.class]
|
|
136
|
+
}), {
|
|
137
|
+
default: h(() => [
|
|
138
|
+
w(t(Q), f(C.value, {
|
|
139
|
+
checked: p.value,
|
|
140
|
+
"onUpdate:checked": n,
|
|
141
|
+
class: t(b)({ size: B.value })
|
|
142
|
+
}), {
|
|
143
|
+
default: h(() => [
|
|
144
|
+
w(t(W), {
|
|
145
|
+
class: _(t(v)(t(r), "indicator")),
|
|
146
|
+
asChild: ""
|
|
147
|
+
}, {
|
|
148
|
+
default: h(() => [
|
|
149
|
+
e.checked != "indeterminate" ? (u(), m(X, {
|
|
150
|
+
key: 0,
|
|
151
|
+
icon: "tabler:check",
|
|
152
|
+
class: _(t(v)(t(r), "icon")),
|
|
153
|
+
"flip-on-dir": "rtl",
|
|
154
|
+
size: O.value
|
|
155
|
+
}, null, 8, ["class", "size"])) : (u(), P("span", {
|
|
156
|
+
key: 1,
|
|
157
|
+
class: _(t(v)(t(r), "indeterminate"))
|
|
158
|
+
}, null, 2))
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
}, 8, ["class"])
|
|
162
|
+
]),
|
|
163
|
+
_: 1
|
|
164
|
+
}, 16, ["checked", "class"]),
|
|
165
|
+
(u(), m(t(y), f({
|
|
166
|
+
key: i.value
|
|
167
|
+
}, q.value, {
|
|
168
|
+
class: t(v)(t(r), "label")
|
|
169
|
+
}), {
|
|
170
|
+
default: h(() => [
|
|
171
|
+
G(s.$slots, "default", {
|
|
172
|
+
checked: s.checked,
|
|
173
|
+
disabled: s.disabled,
|
|
174
|
+
required: s.required
|
|
175
|
+
}, () => [
|
|
176
|
+
J(K(N.value), 1)
|
|
177
|
+
])
|
|
178
|
+
]),
|
|
179
|
+
_: 3
|
|
180
|
+
}, 16, ["class"]))
|
|
181
|
+
]),
|
|
182
|
+
_: 3
|
|
183
|
+
}, 16, ["class"]));
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
export {
|
|
187
|
+
ae as C,
|
|
188
|
+
oe as _,
|
|
189
|
+
ve as a,
|
|
190
|
+
he as b,
|
|
191
|
+
se as i,
|
|
192
|
+
te as p,
|
|
193
|
+
be as u
|
|
194
|
+
};
|