@pantograph/vue 0.0.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionButton/ActionButton.d.ts +148 -5
- package/dist/ActionButton/index.cjs.js +1 -1
- package/dist/ActionButton/index.es.js +1 -1
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-9sHS6TT0.js +52 -0
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-BRYxIFQL.js +1 -0
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Avatar/index.cjs.js +1 -1
- package/dist/Avatar/index.es.js +1 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-D72SN0zC.js +1 -0
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-BWeEmazM.js → Avatar.vue_vue_type_style_index_0_lang-RziDt5Qs.js} +19 -18
- package/dist/AvatarGroup/index.cjs.js +1 -1
- package/dist/AvatarGroup/index.es.js +1 -1
- package/dist/Badge/Badge.d.ts +3 -3
- package/dist/Badge/index.cjs.js +1 -1
- package/dist/Badge/index.es.js +1 -1
- package/dist/Badge.vue_vue_type_script_setup_true_lang-DzkeQwzH.js +1 -0
- package/dist/Badge.vue_vue_type_script_setup_true_lang-LwccxMER.js +34 -0
- package/dist/Base/BaseBadge/BaseBadge.d.ts +6 -10
- package/dist/Base/BaseButton/BaseButton.d.ts +13 -15
- package/dist/BaseBadge.vue_vue_type_style_index_0_lang-B1Va5X21.js +1 -0
- package/dist/BaseBadge.vue_vue_type_style_index_0_lang-CHhhflIH.js +107 -0
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-BLGNTber.js +151 -0
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-HdsdAsR3.js +1 -0
- package/dist/Button/Button.d.ts +149 -5
- package/dist/Button/index.cjs.js +1 -1
- package/dist/Button/index.es.js +1 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-DMOtqE4k.js +49 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DNpM6F5j.js +1 -0
- package/dist/ButtonGroup/index.cjs.js +1 -1
- package/dist/ButtonGroup/index.es.js +1 -1
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-BSj1Y1j2.js +1 -0
- package/dist/{ButtonGroup.vue_vue_type_script_setup_true_lang-jtE0Gtp9.js → ButtonGroup.vue_vue_type_script_setup_true_lang-DBq7tYaO.js} +11 -10
- package/dist/Checkbox/Checkbox.d.ts +6 -14
- package/dist/Checkbox/Checkbox.model.d.ts +0 -2
- package/dist/Checkbox/index.cjs.js +1 -1
- package/dist/Checkbox/index.es.js +1 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-BQeNpCYy.js +1 -0
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-gsOfYgHe.js +245 -0
- package/dist/CheckboxGroup/index.cjs.js +1 -1
- package/dist/CheckboxGroup/index.es.js +1 -1
- package/dist/ConfigProvider/index.cjs.js +1 -0
- package/dist/ConfigProvider/index.d.ts +40 -0
- package/dist/ConfigProvider/index.es.js +112 -0
- package/dist/ConfigProvider/utils.d.ts +4 -0
- package/dist/Divider/Divider.d.ts +27 -0
- package/dist/Divider/Divider.model.d.ts +2 -0
- package/dist/Divider/index.cjs.js +1 -0
- package/dist/Divider/index.d.ts +2 -0
- package/dist/Divider/index.es.js +6 -0
- package/dist/Divider.vue_vue_type_style_index_0_lang-C6Suy0tD.js +1 -0
- package/dist/Divider.vue_vue_type_style_index_0_lang-SBMg48di.js +40 -0
- package/dist/FloatButton/FloatButton.d.ts +149 -5
- package/dist/FloatButton/index.cjs.js +1 -1
- package/dist/FloatButton/index.es.js +1 -1
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-BD8KDs-3.js +1 -0
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-CLL_AR_I.js +47 -0
- package/dist/GraphicalObject/GraphicalObject.d.ts +3 -3
- package/dist/GraphicalObject/index.cjs.js +1 -1
- package/dist/GraphicalObject/index.es.js +1 -1
- package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-BKYCNg9l.js +1 -0
- package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-CcI-aIS4.js → GraphicalObject.vue_vue_type_script_setup_true_lang-DqfDSUXz.js} +7 -6
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/Icon/index.cjs.js +1 -1
- package/dist/Icon/index.es.js +1 -1
- package/dist/Icon.vue_vue_type_style_index_0_lang-D-jaUivh.js +1 -0
- package/dist/Icon.vue_vue_type_style_index_0_lang-W7sippxn.js +48 -0
- package/dist/IconButton/IconButton.d.ts +149 -5
- package/dist/IconButton/index.cjs.js +1 -1
- package/dist/IconButton/index.es.js +1 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-DCrUZOP9.js +47 -0
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-DVbz9uji.js +1 -0
- package/dist/Image/Image.d.ts +48 -0
- package/dist/Image/Image.model.d.ts +6 -0
- package/dist/Image/index.cjs.js +1 -0
- package/dist/Image/index.d.ts +2 -0
- package/dist/Image/index.es.js +117 -0
- package/dist/IndentLevel/IndentLevel.d.ts +35 -0
- package/dist/IndentLevel/IndentLevel.model.d.ts +4 -0
- package/dist/IndentLevel/index.cjs.js +1 -0
- package/dist/IndentLevel/index.d.ts +2 -0
- package/dist/IndentLevel/index.es.js +7 -0
- package/dist/IndentLevel.vue_vue_type_style_index_0_lang-B_x8tshB.js +1 -0
- package/dist/IndentLevel.vue_vue_type_style_index_0_lang-jaoDj9GA.js +103 -0
- package/dist/Indicator/Indicator.d.ts +1 -1
- package/dist/Indicator/index.cjs.js +1 -1
- package/dist/Indicator/index.es.js +1 -1
- package/dist/Indicator.vue_vue_type_script_setup_true_lang-D2iFmRna.js +1 -0
- package/dist/Indicator.vue_vue_type_script_setup_true_lang-jv3IND51.js +34 -0
- package/dist/Kbd/Kbd.d.ts +31 -0
- package/dist/Kbd/index.cjs.js +1 -0
- package/dist/Kbd/index.d.ts +1 -0
- package/dist/Kbd/index.es.js +5 -0
- package/dist/Kbd.vue_vue_type_style_index_0_lang-Br1eygIf.js +1 -0
- package/dist/Kbd.vue_vue_type_style_index_0_lang-D5D9tTsQ.js +60 -0
- package/dist/MenuItem/MenuItem.model.d.ts +2 -0
- package/dist/MenuItem/index.cjs.js +1 -0
- package/dist/MenuItem/index.d.ts +1 -0
- package/dist/MenuItem/index.es.js +1 -0
- package/dist/Popover/Popover.d.ts +6 -83
- package/dist/Popover/index.cjs.js +1 -1
- package/dist/Popover/index.es.js +1 -1
- package/dist/Popover.vue_vue_type_style_index_0_lang-BZMSPrfB.js +1 -0
- package/dist/{Popover.vue_vue_type_style_index_0_lang-Jf0LVKU_.js → Popover.vue_vue_type_style_index_0_lang-DTr33v9y.js} +31 -29
- package/dist/RadioGroup/RadioGroup.d.ts +32 -0
- package/dist/RadioGroup/RadioGroup.model.d.ts +2 -0
- package/dist/RadioGroup/RadioGroupItem.d.ts +16 -0
- package/dist/RadioGroup/index.cjs.js +1 -0
- package/dist/RadioGroup/index.d.ts +2 -0
- package/dist/RadioGroup/index.es.js +100 -0
- package/dist/Shortcut/Shortcut.d.ts +12 -0
- package/dist/Shortcut/index.cjs.js +1 -0
- package/dist/Shortcut/index.d.ts +1 -0
- package/dist/Shortcut/index.es.js +42 -0
- package/dist/Skeleton/index.cjs.js +1 -1
- package/dist/Skeleton/index.es.js +1 -1
- package/dist/{Skeleton.vue_vue_type_style_index_0_lang-C56TOumA.js → Skeleton.vue_vue_type_style_index_0_lang-BgVkwMj4.js} +10 -9
- package/dist/Skeleton.vue_vue_type_style_index_0_lang-PNNUgKOq.js +1 -0
- package/dist/Spinner/Spinner.d.ts +2 -10
- package/dist/Spinner/index.cjs.js +1 -1
- package/dist/Spinner/index.es.js +1 -1
- package/dist/Spinner.vue_vue_type_style_index_0_lang-BOXr-RUw.js +85 -0
- package/dist/Spinner.vue_vue_type_style_index_0_lang-DW5QRtWO.js +1 -0
- package/dist/Switch/Switch.d.ts +29 -0
- package/dist/Switch/Switch.model.d.ts +2 -0
- package/dist/Switch/index.cjs.js +1 -0
- package/dist/Switch/index.d.ts +2 -0
- package/dist/Switch/index.es.js +104 -0
- package/dist/Tree/Tree.d.ts +66 -0
- package/dist/Tree/Tree.model.d.ts +71 -0
- package/dist/Tree/TreeNode.d.ts +33 -0
- package/dist/Tree/index.cjs.js +1 -0
- package/dist/Tree/index.d.ts +2 -0
- package/dist/Tree/index.es.js +456 -0
- package/dist/class-CjZYGZDW.js +1 -0
- package/dist/class-DyU-Ox8D.js +24 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +27 -24
- package/dist/omit-C_ZXwm9T.js +1 -0
- package/dist/omit-DtumnYm5.js +760 -0
- package/dist/options-B4iSAKol.js +1 -0
- package/dist/options-JBqnVZUl.js +9 -0
- package/dist/style/index.css +1 -1
- package/dist/utils/element.d.ts +1 -1
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.es.js +7 -4
- package/package.json +61 -16
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-Drb30rfG.js +0 -39
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-dxthnFw4.js +0 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-BB-v9NHG.js +0 -1
- package/dist/Badge.vue_vue_type_script_setup_true_lang-CXfdGkKV.js +0 -33
- package/dist/Badge.vue_vue_type_script_setup_true_lang-sx-dXgFD.js +0 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-B-uDLmB_.js +0 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-F50Tg7IQ.js +0 -151
- package/dist/Button.vue_vue_type_script_setup_true_lang-Crhe5sHQ.js +0 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-XrPBGQq8.js +0 -36
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-DmShg2d-.js +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-BRJhkPIY.js +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-OQRmH46S.js +0 -194
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-Bu9Ndwxm.js +0 -1
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-CCfZsUxy.js +0 -34
- package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-BhMxC00o.js +0 -1
- package/dist/Icon.vue_vue_type_style_index_0_lang-CB4CYuWH.js +0 -47
- package/dist/Icon.vue_vue_type_style_index_0_lang-CV1YvIs-.js +0 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-BTG_oQuF.js +0 -34
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-C93zhnQU.js +0 -1
- package/dist/Indicator.vue_vue_type_script_setup_true_lang-Z02asVPa.js +0 -1
- package/dist/Indicator.vue_vue_type_script_setup_true_lang-qIUYIdkm.js +0 -33
- package/dist/Logotype-Dark.svg +0 -3
- package/dist/Logotype-Light.svg +0 -3
- package/dist/Popover.vue_vue_type_style_index_0_lang-VH8LnLG9.js +0 -1
- package/dist/Skeleton.vue_vue_type_style_index_0_lang-B6-i0F1w.js +0 -1
- package/dist/Spinner.vue_vue_type_style_index_0_lang-B5byV1za.js +0 -75
- package/dist/Spinner.vue_vue_type_style_index_0_lang-Baaz0Dxb.js +0 -1
- package/dist/logo.svg +0 -4
- package/dist/omit-B0hUroNu.js +0 -1
- package/dist/omit-DU39EwuA.js +0 -851
- package/dist/options-B8SF1auT.js +0 -1
- package/dist/options-B8rT2fg0.js +0 -30
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { defineComponent as E, computed as r, useSlots as R, ref as _, openBlock as l, createBlock as c, unref as s, normalizeClass as b, withCtx as v, createElementBlock as j, Fragment as A, renderSlot as u, createCommentVNode as I, createTextVNode as D, toDisplayString as F, normalizeProps as G, mergeProps as L, createVNode as O } from "vue";
|
|
2
|
+
import { Primitive as q } from "radix-vue";
|
|
3
|
+
import { _ as z } from "./Icon.vue_vue_type_style_index_0_lang-W7sippxn.js";
|
|
4
|
+
import { _ as H } from "./Spinner.vue_vue_type_style_index_0_lang-BOXr-RUw.js";
|
|
5
|
+
import { _ as J } from "./Badge.vue_vue_type_script_setup_true_lang-LwccxMER.js";
|
|
6
|
+
import { i as K, a as k, c as $, b as C, B as S } from "./ButtonGroup.vue_vue_type_script_setup_true_lang-DBq7tYaO.js";
|
|
7
|
+
import { g as a, a as M, b as Q } from "./class-DyU-Ox8D.js";
|
|
8
|
+
import { cva as U } from "class-variance-authority";
|
|
9
|
+
import { g as W } from "./options-JBqnVZUl.js";
|
|
10
|
+
const x = "2xsm", ie = /* @__PURE__ */ E({
|
|
11
|
+
...W("BaseButton"),
|
|
12
|
+
__name: "BaseButton",
|
|
13
|
+
props: {
|
|
14
|
+
class: {},
|
|
15
|
+
text: {},
|
|
16
|
+
size: {},
|
|
17
|
+
color: { default: "primary" },
|
|
18
|
+
type: { default: "fill" },
|
|
19
|
+
variant: {},
|
|
20
|
+
loading: { type: Boolean },
|
|
21
|
+
action: { type: Boolean },
|
|
22
|
+
active: { type: Boolean },
|
|
23
|
+
badgeText: {},
|
|
24
|
+
badgeIcon: {},
|
|
25
|
+
icon: {},
|
|
26
|
+
preIcon: {},
|
|
27
|
+
postIcon: {},
|
|
28
|
+
as: { default: "button" }
|
|
29
|
+
},
|
|
30
|
+
setup(T, { expose: h }) {
|
|
31
|
+
const o = T, t = Q("button"), V = U(t, {
|
|
32
|
+
variants: {
|
|
33
|
+
size: a($, t),
|
|
34
|
+
type: a(k, t),
|
|
35
|
+
color: a(C, t),
|
|
36
|
+
variant: a(S, t),
|
|
37
|
+
action: a("action", t),
|
|
38
|
+
active: a("active", t),
|
|
39
|
+
text: a("text", t),
|
|
40
|
+
preIcon: a("preIcon", t),
|
|
41
|
+
postIcon: a("postIcon", t),
|
|
42
|
+
loading: a("loading", t)
|
|
43
|
+
}
|
|
44
|
+
}), B = K({
|
|
45
|
+
size: r(() => o.size),
|
|
46
|
+
variant: r(() => o.variant)
|
|
47
|
+
}), p = r(() => o.variant ?? B.variant.value ?? "simple"), n = r(() => ["icon", "float"].includes(p.value)), i = R(), P = r(() => {
|
|
48
|
+
let e = k.includes(o.type) ? o.type : "fill";
|
|
49
|
+
const m = o.size ?? B.size.value, N = m && $.includes(m) ? m : "md";
|
|
50
|
+
let d = o.color && C.includes(o.color) ? o.color : "primary", f = p.value && S.includes(p.value) ? p.value : "simple";
|
|
51
|
+
return o.action ? (f === "float" && (f = "icon"), e === "fill" && (e = "outline"), d = void 0) : f === "float" && (e === "ghost" && (e = "fill"), ["primary", "gray"].includes(d) || (d = "primary")), {
|
|
52
|
+
size: N,
|
|
53
|
+
type: e,
|
|
54
|
+
color: d,
|
|
55
|
+
variant: f,
|
|
56
|
+
action: o.action,
|
|
57
|
+
active: o.active,
|
|
58
|
+
loading: o.loading,
|
|
59
|
+
text: !n.value && !!(o.text || i.default),
|
|
60
|
+
preIcon: !n.value && !!(o.preIcon || i.preIcon),
|
|
61
|
+
postIcon: !n.value && !!(o.postIcon || i.postIcon)
|
|
62
|
+
};
|
|
63
|
+
}), g = r(() => {
|
|
64
|
+
switch (o.size) {
|
|
65
|
+
case "sm":
|
|
66
|
+
return "3xsm";
|
|
67
|
+
default:
|
|
68
|
+
return "2xsm";
|
|
69
|
+
}
|
|
70
|
+
}), w = r(() => {
|
|
71
|
+
switch (o.size) {
|
|
72
|
+
case "sm":
|
|
73
|
+
return "3xsm";
|
|
74
|
+
case "lg":
|
|
75
|
+
return "xsm";
|
|
76
|
+
case "md":
|
|
77
|
+
default:
|
|
78
|
+
return "2xsm";
|
|
79
|
+
}
|
|
80
|
+
}), y = _();
|
|
81
|
+
return h({
|
|
82
|
+
focus() {
|
|
83
|
+
var e;
|
|
84
|
+
(e = y.value) == null || e.focus();
|
|
85
|
+
},
|
|
86
|
+
blur() {
|
|
87
|
+
var e;
|
|
88
|
+
(e = y.value) == null || e.blur();
|
|
89
|
+
}
|
|
90
|
+
}), (e, m) => (l(), c(s(q), {
|
|
91
|
+
as: e.as,
|
|
92
|
+
class: b([s(V)(P.value), o.class]),
|
|
93
|
+
tabindex: "0",
|
|
94
|
+
ref_key: "buttonRef",
|
|
95
|
+
ref: y
|
|
96
|
+
}, {
|
|
97
|
+
default: v(() => [
|
|
98
|
+
e.loading ? (l(), c(H, {
|
|
99
|
+
key: 1,
|
|
100
|
+
class: b(s(M)(s(t), "loading")),
|
|
101
|
+
size: g.value
|
|
102
|
+
}, null, 8, ["class", "size"])) : (l(), j(A, { key: 0 }, [
|
|
103
|
+
(e.preIcon || s(i).preIcon) && !n.value ? (l(), c(z, {
|
|
104
|
+
key: 0,
|
|
105
|
+
icon: e.preIcon,
|
|
106
|
+
size: g.value
|
|
107
|
+
}, {
|
|
108
|
+
default: v(() => [
|
|
109
|
+
u(e.$slots, "preIcon")
|
|
110
|
+
]),
|
|
111
|
+
_: 3
|
|
112
|
+
}, 8, ["icon", "size"])) : I("", !0),
|
|
113
|
+
n.value ? (l(), c(z, {
|
|
114
|
+
key: 1,
|
|
115
|
+
icon: e.icon,
|
|
116
|
+
size: w.value
|
|
117
|
+
}, {
|
|
118
|
+
default: v(() => [
|
|
119
|
+
u(e.$slots, "icon")
|
|
120
|
+
]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, ["icon", "size"])) : u(e.$slots, "default", { key: 2 }, () => [
|
|
123
|
+
D(F(e.text), 1)
|
|
124
|
+
]),
|
|
125
|
+
e.action && e.active && !n.value && (e.badgeText || s(i).badgeText || e.badgeIcon || s(i).badgeIcon) ? u(e.$slots, "badge", G(L({ key: 3 }, { color: e.$attrs.disabled ? "gray" : "primary", size: x })), () => [
|
|
126
|
+
O(J, {
|
|
127
|
+
text: e.badgeText,
|
|
128
|
+
icon: e.badgeIcon,
|
|
129
|
+
color: e.$attrs.disabled ? "gray" : "primary",
|
|
130
|
+
size: x
|
|
131
|
+
}, null, 8, ["text", "icon", "color"])
|
|
132
|
+
]) : I("", !0),
|
|
133
|
+
(e.postIcon || s(i).postIcon) && !n.value ? (l(), c(z, {
|
|
134
|
+
key: 4,
|
|
135
|
+
icon: e.postIcon,
|
|
136
|
+
size: g.value
|
|
137
|
+
}, {
|
|
138
|
+
default: v(() => [
|
|
139
|
+
u(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
|
+
ie as _
|
|
151
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),k=require("radix-vue"),f=require("./Icon.vue_vue_type_style_index_0_lang-D-jaUivh.js"),b=require("./Spinner.vue_vue_type_style_index_0_lang-DW5QRtWO.js"),V=require("./Badge.vue_vue_type_script_setup_true_lang-DzkeQwzH.js"),s=require("./ButtonGroup.vue_vue_type_script_setup_true_lang-BSj1Y1j2.js"),a=require("./class-CjZYGZDW.js"),S=require("class-variance-authority"),x=require("./options-B4iSAKol.js"),g="2xsm",L=e.defineComponent({...x.getComponentOptions("BaseButton"),__name:"BaseButton",props:{class:{},text:{},size:{},color:{default:"primary"},type:{default:"fill"},variant:{},loading:{type:Boolean},action:{type:Boolean},active:{type:Boolean},badgeText:{},badgeIcon:{},icon:{},preIcon:{},postIcon:{},as:{default:"button"}},setup(B,{expose:y}){const o=B,n=a.getBemBlock("button"),_=S.cva(n,{variants:{size:a.generateVariantClassList(s.ButtonSizes,n),type:a.generateVariantClassList(s.ButtonTypes,n),color:a.generateVariantClassList(s.ButtonColors,n),variant:a.generateVariantClassList(s.ButtonVariants,n),action:a.generateVariantClassList("action",n),active:a.generateVariantClassList("active",n),text:a.generateVariantClassList("text",n),preIcon:a.generateVariantClassList("preIcon",n),postIcon:a.generateVariantClassList("postIcon",n),loading:a.generateVariantClassList("loading",n)}}),v=s.injectButtonGroupContext({size:e.computed(()=>o.size),variant:e.computed(()=>o.variant)}),l=e.computed(()=>o.variant??v.variant.value??"simple"),r=e.computed(()=>["icon","float"].includes(l.value)),i=e.useSlots(),z=e.computed(()=>{let t=s.ButtonTypes.includes(o.type)?o.type:"fill";const c=o.size??v.size.value,C=c&&s.ButtonSizes.includes(c)?c:"md";let u=o.color&&s.ButtonColors.includes(o.color)?o.color:"primary",p=l.value&&s.ButtonVariants.includes(l.value)?l.value:"simple";return o.action?(p==="float"&&(p="icon"),t==="fill"&&(t="outline"),u=void 0):p==="float"&&(t==="ghost"&&(t="fill"),["primary","gray"].includes(u)||(u="primary")),{size:C,type:t,color:u,variant:p,action:o.action,active:o.active,loading:o.loading,text:!r.value&&!!(o.text||i.default),preIcon:!r.value&&!!(o.preIcon||i.preIcon),postIcon:!r.value&&!!(o.postIcon||i.postIcon)}}),d=e.computed(()=>{switch(o.size){case"sm":return"3xsm";default:return"2xsm"}}),I=e.computed(()=>{switch(o.size){case"sm":return"3xsm";case"lg":return"xsm";case"md":default:return"2xsm"}}),m=e.ref();return y({focus(){var t;(t=m.value)==null||t.focus()},blur(){var t;(t=m.value)==null||t.blur()}}),(t,c)=>(e.openBlock(),e.createBlock(e.unref(k.Primitive),{as:t.as,class:e.normalizeClass([e.unref(_)(z.value),o.class]),tabindex:"0",ref_key:"buttonRef",ref:m},{default:e.withCtx(()=>[t.loading?(e.openBlock(),e.createBlock(b._sfc_main,{key:1,class:e.normalizeClass(e.unref(a.getBemElement)(e.unref(n),"loading")),size:d.value},null,8,["class","size"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(t.preIcon||e.unref(i).preIcon)&&!r.value?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,icon:t.preIcon,size:d.value},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"preIcon")]),_:3},8,["icon","size"])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(f._sfc_main,{key:1,icon:t.icon,size:I.value},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"icon")]),_:3},8,["icon","size"])):e.renderSlot(t.$slots,"default",{key:2},()=>[e.createTextVNode(e.toDisplayString(t.text),1)]),t.action&&t.active&&!r.value&&(t.badgeText||e.unref(i).badgeText||t.badgeIcon||e.unref(i).badgeIcon)?e.renderSlot(t.$slots,"badge",e.normalizeProps(e.mergeProps({key:3},{color:t.$attrs.disabled?"gray":"primary",size:g})),()=>[e.createVNode(V._sfc_main,{text:t.badgeText,icon:t.badgeIcon,color:t.$attrs.disabled?"gray":"primary",size:g},null,8,["text","icon","color"])]):e.createCommentVNode("",!0),(t.postIcon||e.unref(i).postIcon)&&!r.value?(e.openBlock(),e.createBlock(f._sfc_main,{key:4,icon:t.postIcon,size:d.value},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"postIcon")]),_:3},8,["icon","size"])):e.createCommentVNode("",!0)],64))]),_:3},8,["as","class"]))}});exports._sfc_main=L;
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,13 +1,157 @@
|
|
|
1
|
-
import { BaseButtonProps } from '../Base/BaseButton/BaseButton';
|
|
2
|
-
export type ButtonProps = Pick<BaseButtonProps, 'as' | 'class' | 'type' | 'color' | 'loading' | 'preIcon' | 'postIcon' | 'size' | 'text'
|
|
1
|
+
import { BaseButtonSlots, BaseButtonProps } from '../Base/BaseButton/BaseButton';
|
|
2
|
+
export type ButtonProps = Partial<Pick<BaseButtonProps, 'as' | 'class' | 'type' | 'color' | 'loading' | 'preIcon' | 'postIcon' | 'size' | 'text'>>;
|
|
3
|
+
type ButtonSlots = Omit<BaseButtonSlots, 'icon' | 'badge'>;
|
|
3
4
|
declare function __VLS_template(): {
|
|
4
5
|
attrs: Partial<{}>;
|
|
5
|
-
slots:
|
|
6
|
-
refs: {
|
|
6
|
+
slots: Readonly<ButtonSlots> & ButtonSlots;
|
|
7
|
+
refs: {
|
|
8
|
+
buttonRef: ({
|
|
9
|
+
$: import('vue').ComponentInternalInstance;
|
|
10
|
+
$data: {};
|
|
11
|
+
$props: {
|
|
12
|
+
readonly class?: import('../index.ts', { with: { "resolution-mode": "import" } }).Class | undefined;
|
|
13
|
+
readonly text?: (string | number) | undefined;
|
|
14
|
+
readonly size?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonSize | undefined;
|
|
15
|
+
readonly color?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonColor | undefined;
|
|
16
|
+
readonly type?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonType | undefined;
|
|
17
|
+
readonly variant?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonVariant | undefined;
|
|
18
|
+
readonly loading?: boolean | undefined;
|
|
19
|
+
readonly action?: boolean | undefined;
|
|
20
|
+
readonly active?: boolean | undefined;
|
|
21
|
+
readonly badgeText?: string | undefined;
|
|
22
|
+
readonly badgeIcon?: string | undefined;
|
|
23
|
+
readonly icon?: string | undefined;
|
|
24
|
+
readonly preIcon?: string | undefined;
|
|
25
|
+
readonly postIcon?: string | undefined;
|
|
26
|
+
readonly as?: (import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component) | undefined;
|
|
27
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
28
|
+
$attrs: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
$refs: any;
|
|
32
|
+
$slots: Readonly<{
|
|
33
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
36
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
37
|
+
$host: Element | null;
|
|
38
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
39
|
+
$el: any;
|
|
40
|
+
$options: import('vue').ComponentOptionsBase<Readonly<BaseButtonProps> & Readonly<{}>, {
|
|
41
|
+
focus(): void;
|
|
42
|
+
blur(): void;
|
|
43
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
44
|
+
type: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonType;
|
|
45
|
+
color: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonColor;
|
|
46
|
+
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
47
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
48
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
49
|
+
created?: (() => void) | (() => void)[];
|
|
50
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
51
|
+
mounted?: (() => void) | (() => void)[];
|
|
52
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
53
|
+
updated?: (() => void) | (() => void)[];
|
|
54
|
+
activated?: (() => void) | (() => void)[];
|
|
55
|
+
deactivated?: (() => void) | (() => void)[];
|
|
56
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
57
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
58
|
+
destroyed?: (() => void) | (() => void)[];
|
|
59
|
+
unmounted?: (() => void) | (() => void)[];
|
|
60
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
61
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
62
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
63
|
+
};
|
|
64
|
+
$forceUpdate: () => void;
|
|
65
|
+
$nextTick: typeof import('vue').nextTick;
|
|
66
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
67
|
+
} & Readonly<{
|
|
68
|
+
type: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonType;
|
|
69
|
+
color: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonColor;
|
|
70
|
+
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
71
|
+
}> & Omit<Readonly<BaseButtonProps> & Readonly<{}>, "blur" | "focus" | ("type" | "color" | "as")> & import('vue').ShallowUnwrapRef<{
|
|
72
|
+
focus(): void;
|
|
73
|
+
blur(): void;
|
|
74
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
75
|
+
$slots: any;
|
|
76
|
+
}) | null;
|
|
77
|
+
};
|
|
7
78
|
rootEl: any;
|
|
8
79
|
};
|
|
9
80
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
81
|
+
declare const __VLS_component: import('vue').DefineComponent<Partial<Pick<BaseButtonProps, "size" | "class" | "type" | "color" | "text" | "as" | "loading" | "preIcon" | "postIcon">>, {
|
|
82
|
+
focus(): void;
|
|
83
|
+
blur(): void;
|
|
84
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Partial<Pick<BaseButtonProps, "size" | "class" | "type" | "color" | "text" | "as" | "loading" | "preIcon" | "postIcon">>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
85
|
+
buttonRef: ({
|
|
86
|
+
$: import('vue').ComponentInternalInstance;
|
|
87
|
+
$data: {};
|
|
88
|
+
$props: {
|
|
89
|
+
readonly class?: import('../index.ts', { with: { "resolution-mode": "import" } }).Class | undefined;
|
|
90
|
+
readonly text?: (string | number) | undefined;
|
|
91
|
+
readonly size?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonSize | undefined;
|
|
92
|
+
readonly color?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonColor | undefined;
|
|
93
|
+
readonly type?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonType | undefined;
|
|
94
|
+
readonly variant?: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonVariant | undefined;
|
|
95
|
+
readonly loading?: boolean | undefined;
|
|
96
|
+
readonly action?: boolean | undefined;
|
|
97
|
+
readonly active?: boolean | undefined;
|
|
98
|
+
readonly badgeText?: string | undefined;
|
|
99
|
+
readonly badgeIcon?: string | undefined;
|
|
100
|
+
readonly icon?: string | undefined;
|
|
101
|
+
readonly preIcon?: string | undefined;
|
|
102
|
+
readonly postIcon?: string | undefined;
|
|
103
|
+
readonly as?: (import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component) | undefined;
|
|
104
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
105
|
+
$attrs: {
|
|
106
|
+
[x: string]: unknown;
|
|
107
|
+
};
|
|
108
|
+
$refs: any;
|
|
109
|
+
$slots: Readonly<{
|
|
110
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
113
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
114
|
+
$host: Element | null;
|
|
115
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
116
|
+
$el: any;
|
|
117
|
+
$options: import('vue').ComponentOptionsBase<Readonly<BaseButtonProps> & Readonly<{}>, {
|
|
118
|
+
focus(): void;
|
|
119
|
+
blur(): void;
|
|
120
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
121
|
+
type: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonType;
|
|
122
|
+
color: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonColor;
|
|
123
|
+
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
124
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
125
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
126
|
+
created?: (() => void) | (() => void)[];
|
|
127
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
128
|
+
mounted?: (() => void) | (() => void)[];
|
|
129
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
130
|
+
updated?: (() => void) | (() => void)[];
|
|
131
|
+
activated?: (() => void) | (() => void)[];
|
|
132
|
+
deactivated?: (() => void) | (() => void)[];
|
|
133
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
134
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
135
|
+
destroyed?: (() => void) | (() => void)[];
|
|
136
|
+
unmounted?: (() => void) | (() => void)[];
|
|
137
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
138
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
139
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
140
|
+
};
|
|
141
|
+
$forceUpdate: () => void;
|
|
142
|
+
$nextTick: typeof import('vue').nextTick;
|
|
143
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
144
|
+
} & Readonly<{
|
|
145
|
+
type: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonType;
|
|
146
|
+
color: import('../index.ts', { with: { "resolution-mode": "import" } }).ButtonColor;
|
|
147
|
+
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
148
|
+
}> & Omit<Readonly<BaseButtonProps> & Readonly<{}>, "blur" | "focus" | ("type" | "color" | "as")> & import('vue').ShallowUnwrapRef<{
|
|
149
|
+
focus(): void;
|
|
150
|
+
blur(): void;
|
|
151
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
152
|
+
$slots: any;
|
|
153
|
+
}) | null;
|
|
154
|
+
}, any>;
|
|
11
155
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
156
|
export default _default;
|
|
13
157
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/dist/Button/index.cjs.js
CHANGED
|
@@ -1 +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-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Button.vue_vue_type_script_setup_true_lang-DNpM6F5j.js");exports.Button=e._sfc_main;exports.default=e._sfc_main;
|
package/dist/Button/index.es.js
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent as i, useAttrs as m, computed as u, ref as l, openBlock as f, createBlock as _, mergeProps as d, createSlots as b, renderList as g, withCtx as v, renderSlot as B, normalizeProps as k, guardReactiveProps as x } from "vue";
|
|
2
|
+
import { o as y } from "./omit-DtumnYm5.js";
|
|
3
|
+
import { _ as C } from "./BaseButton.vue_vue_type_style_index_0_lang-BLGNTber.js";
|
|
4
|
+
import { g as I } from "./options-JBqnVZUl.js";
|
|
5
|
+
const O = /* @__PURE__ */ i({
|
|
6
|
+
...I("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(r, { expose: n }) {
|
|
20
|
+
const s = r, a = m(), c = u(() => ({
|
|
21
|
+
...y(a, "variant", "icon", "action", "active", "badgeText"),
|
|
22
|
+
...s
|
|
23
|
+
})), o = l();
|
|
24
|
+
return n({
|
|
25
|
+
focus() {
|
|
26
|
+
var e;
|
|
27
|
+
(e = o.value) == null || e.focus();
|
|
28
|
+
},
|
|
29
|
+
blur() {
|
|
30
|
+
var e;
|
|
31
|
+
(e = o.value) == null || e.blur();
|
|
32
|
+
}
|
|
33
|
+
}), (e, P) => (f(), _(C, d(c.value, {
|
|
34
|
+
variant: "simple",
|
|
35
|
+
ref_key: "buttonRef",
|
|
36
|
+
ref: o
|
|
37
|
+
}), b({ _: 2 }, [
|
|
38
|
+
g(Object.keys(e.$slots), (t) => ({
|
|
39
|
+
name: t,
|
|
40
|
+
fn: v((p) => [
|
|
41
|
+
B(e.$slots, t, k(x(p)))
|
|
42
|
+
])
|
|
43
|
+
}))
|
|
44
|
+
]), 1040));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
O as _
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),p=require("./omit-C_ZXwm9T.js"),l=require("./BaseButton.vue_vue_type_style_index_0_lang-HdsdAsR3.js"),_=require("./options-B4iSAKol.js"),f=e.defineComponent({..._.getComponentOptions("IconButton",!1),__name:"Button",props:{as:{},class:{},type:{},color:{},loading:{type:Boolean},preIcon:{},postIcon:{},size:{},text:{}},setup(s,{expose:r}){const c=s,a=e.useAttrs(),i=e.computed(()=>({...p.omit(a,"variant","icon","action","active","badgeText"),...c})),o=e.ref();return r({focus(){var t;(t=o.value)==null||t.focus()},blur(){var t;(t=o.value)==null||t.blur()}}),(t,m)=>(e.openBlock(),e.createBlock(l._sfc_main,e.mergeProps(i.value,{variant:"simple",ref_key:"buttonRef",ref:o}),e.createSlots({_:2},[e.renderList(Object.keys(t.$slots),n=>({name:n,fn:e.withCtx(u=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(u)))])}))]),1040))}});exports._sfc_main=f;
|
|
@@ -1 +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-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../ButtonGroup.vue_vue_type_script_setup_true_lang-BSj1Y1j2.js");exports.ButtonGroup=t._sfc_main;exports.default=t._sfc_main;exports.injectButtonGroupContext=t.injectButtonGroupContext;exports.provideButtonGroupContext=t.provideButtonGroupContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),a=require("radix-vue"),o=require("./class-CjZYGZDW.js"),l=require("./options-B4iSAKol.js"),B=require("class-variance-authority"),m=["simple","icon","float"],d=["fill","outline","ghost"],f=["primary","danger","success","warning","gray"],r=["sm","md","lg"],g=[...r,"none"],[C,i]=a.createContext("ButtonGroup"),v=t.defineComponent({...l.getComponentOptions("ButtonGroup"),__name:"ButtonGroup",props:{as:{default:"div"},class:{},size:{default:"md"},variant:{default:"simple"},gap:{},split:{type:Boolean,default:!0}},setup(u){const e=u,p=o.getBemBlock("button"),s=o.getBemElement(p,"group"),c=B.cva(s,{variants:{gap:o.generateVariantClassList(g,s),split:o.generateVariantClassList("split",s)}});return i({size:t.computed(()=>e.size),variant:t.computed(()=>e.variant)}),(n,G)=>(t.openBlock(),t.createBlock(t.unref(a.Primitive),{as:n.as,class:t.normalizeClass([t.unref(c)({gap:e.gap??e.size,split:n.split}),e.class])},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default")]),_:3},8,["as","class"]))}});exports.ButtonColors=f;exports.ButtonSizes=r;exports.ButtonTypes=d;exports.ButtonVariants=m;exports._sfc_main=v;exports.injectButtonGroupContext=C;exports.provideButtonGroupContext=i;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
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
2
|
import { createContext as g, Primitive as d } from "radix-vue";
|
|
3
|
-
import { g as
|
|
3
|
+
import { g as n, a as C, b as v } from "./class-DyU-Ox8D.js";
|
|
4
|
+
import { g as G } from "./options-JBqnVZUl.js";
|
|
4
5
|
import { cva as z } from "class-variance-authority";
|
|
5
|
-
const
|
|
6
|
-
...
|
|
6
|
+
const j = ["simple", "icon", "float"], E = ["fill", "outline", "ghost"], L = ["primary", "danger", "success", "warning", "gray"], x = ["sm", "md", "lg"], _ = [...x, "none"], [O, y] = g("ButtonGroup"), P = /* @__PURE__ */ l({
|
|
7
|
+
...G("ButtonGroup"),
|
|
7
8
|
__name: "ButtonGroup",
|
|
8
9
|
props: {
|
|
9
10
|
as: { default: "div" },
|
|
@@ -11,10 +12,10 @@ const V = ["simple", "icon", "float"], j = ["fill", "outline", "ghost"], E = ["p
|
|
|
11
12
|
size: { default: "md" },
|
|
12
13
|
variant: { default: "simple" },
|
|
13
14
|
gap: {},
|
|
14
|
-
split: { type: Boolean, default: !
|
|
15
|
+
split: { type: Boolean, default: !0 }
|
|
15
16
|
},
|
|
16
17
|
setup(r) {
|
|
17
|
-
const t = r, i =
|
|
18
|
+
const t = r, i = v("button"), s = C(i, "group"), p = z(s, {
|
|
18
19
|
variants: {
|
|
19
20
|
gap: n(_, s),
|
|
20
21
|
split: n("split", s)
|
|
@@ -41,11 +42,11 @@ const V = ["simple", "icon", "float"], j = ["fill", "outline", "ghost"], E = ["p
|
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
j as B,
|
|
46
|
+
P as _,
|
|
47
|
+
E as a,
|
|
48
|
+
L as b,
|
|
48
49
|
x as c,
|
|
49
|
-
|
|
50
|
+
O as i,
|
|
50
51
|
y as p
|
|
51
52
|
};
|
|
@@ -4,22 +4,15 @@ import { Class } from '../types';
|
|
|
4
4
|
export interface CheckboxProps extends Omit<CheckboxRootProps, 'asChild'> {
|
|
5
5
|
size?: CheckboxSize;
|
|
6
6
|
class?: Class;
|
|
7
|
-
|
|
7
|
+
rootCls?: Class;
|
|
8
|
+
indicatorCls?: Class;
|
|
9
|
+
indeterminateCls?: Class;
|
|
10
|
+
labelCls?: Class;
|
|
8
11
|
label?: string;
|
|
12
|
+
id?: string;
|
|
9
13
|
valueAsLabel?: boolean;
|
|
10
14
|
}
|
|
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
|
-
};
|
|
15
|
+
declare function __VLS_template(): any;
|
|
23
16
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
17
|
declare const __VLS_component: import('vue').DefineComponent<CheckboxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
18
|
change: (value: boolean | "indeterminate") => any;
|
|
@@ -31,7 +24,6 @@ declare const __VLS_component: import('vue').DefineComponent<CheckboxProps, {},
|
|
|
31
24
|
size: CheckboxSize;
|
|
32
25
|
as: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
33
26
|
checked: boolean | "indeterminate";
|
|
34
|
-
labelAs: import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component;
|
|
35
27
|
valueAsLabel: boolean;
|
|
36
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -6,7 +6,6 @@ export declare const useColoredPantographCheckbox: (color: string) => {
|
|
|
6
6
|
'--ptc-checkbox-bg-focus': string;
|
|
7
7
|
'--ptc-checkbox-br-focus': string;
|
|
8
8
|
'--ptc-checkbox-bg-active': string;
|
|
9
|
-
'--ptc-checkbox-shadow': string;
|
|
10
9
|
};
|
|
11
10
|
export declare const useColoredPantographCheckboxGroup: (color: string) => {
|
|
12
11
|
'--ptc-group-checkbox-bg': string;
|
|
@@ -14,5 +13,4 @@ export declare const useColoredPantographCheckboxGroup: (color: string) => {
|
|
|
14
13
|
'--ptc-group-checkbox-bg-focus': string;
|
|
15
14
|
'--ptc-group-checkbox-br-focus': string;
|
|
16
15
|
'--ptc-group-checkbox-bg-active': string;
|
|
17
|
-
'--ptc-group-checkbox-shadow': string;
|
|
18
16
|
};
|
|
@@ -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-BQeNpCYy.js");exports.Checkbox=e._sfc_main;exports.CheckboxSizes=e.CheckboxSizes;exports.default=e._sfc_main;exports.useColoredPantographCheckbox=e.useColoredPantographCheckbox;exports.useColoredPantographCheckboxGroup=e.useColoredPantographCheckboxGroup;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e, C as s, _ as r, u as C, a as h } from "../Checkbox.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as e, C as s, _ as r, u as C, a as h } from "../Checkbox.vue_vue_type_style_index_0_lang-gsOfYgHe.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Checkbox,
|
|
4
4
|
s as CheckboxSizes,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),k=require("radix-vue"),p=require("@pantograph/tokens"),I=require("./Icon.vue_vue_type_style_index_0_lang-D-jaUivh.js"),v=require("./class-CjZYGZDW.js"),L=require("class-variance-authority"),_=require("./options-B4iSAKol.js"),l=require("./omit-C_ZXwm9T.js"),$=["2xsm","xsm"],w=t=>({"--ptc-checkbox-bg":`var(--${p.prefixTokens}-${t}-5)`,"--ptc-checkbox-bg-hover":`var(--${p.prefixTokens}-${t}-4)`,"--ptc-checkbox-bg-focus":`var(--${p.prefixTokens}-${t}-6)`,"--ptc-checkbox-br-focus":`var(--${p.prefixTokens}-${t}-6)`,"--ptc-checkbox-bg-active":`var(--${p.prefixTokens}-${t}-7)`}),E=t=>({"--ptc-group-checkbox-bg":`var(--${p.prefixTokens}-${t}-5)`,"--ptc-group-checkbox-bg-hover":`var(--${p.prefixTokens}-${t}-4)`,"--ptc-group-checkbox-bg-focus":`var(--${p.prefixTokens}-${t}-6)`,"--ptc-group-checkbox-br-focus":`var(--${p.prefixTokens}-${t}-6)`,"--ptc-group-checkbox-bg-active":`var(--${p.prefixTokens}-${t}-7)`});function A(t,o,r,n){if(!l.isObject(t))return t;o=l.castPath(o,t);for(var s=-1,u=o.length,d=u-1,i=t;i!=null&&++s<u;){var c=l.toKey(o[s]),f=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(s!=d){var h=i[c];f=void 0,f===void 0&&(f=l.isObject(h)?h:l.isIndex(o[s+1])?[]:{})}l.assignValue(i,c,f),i=i[c]}return t}function O(t,o,r){for(var n=-1,s=o.length,u={};++n<s;){var d=o[n],i=l.baseGet(t,d);r(i,d)&&A(u,l.castPath(d,t),i)}return u}function N(t,o){return t!=null&&o in Object(t)}function V(t,o,r){o=l.castPath(o,t);for(var n=-1,s=o.length,u=!1;++n<s;){var d=l.toKey(o[n]);if(!(u=t!=null&&r(t,d)))break;t=t[d]}return u||++n!=s?u:(s=t==null?0:t.length,!!s&&l.isLength(s)&&l.isIndex(d,s)&&(l.isArray(t)||l.isArguments(t)))}function R(t,o){return t!=null&&V(t,o,N)}function K(t,o){return O(t,o,function(r,n){return R(t,n)})}var D=l.flatRest(function(t,o){return t==null?{}:K(t,o)});const[z,P]=k.createContext("CheckboxGroup"),F=e.defineComponent({..._.getComponentOptions("CheckboxGroup"),__name:"CheckboxGroup",props:{asChild:{type:Boolean,default:!1},as:{},value:{},size:{},disabled:{type:Boolean},name:{},options:{}},emits:["update:value","change"],setup(t,{emit:o}){const r=o,n=t,s=e.computed(()=>D(n,"asChild","as")),u=e.computed({get(){return n.value??[]},set(c){r("update:value",c),r("change",c)}}),d=e.computed(()=>n.size),i=e.computed(()=>n.disabled?!0:void 0);return P({model:u,size:d,disabled:i}),(c,f)=>(e.openBlock(),e.createBlock(e.unref(k.Primitive),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{},()=>{var h;return[(h=c.options)!=null&&h.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.options,x=>(e.openBlock(),e.createBlock(y,e.mergeProps({key:x.value,ref_for:!0},x),null,16))),128)):e.createCommentVNode("",!0)]})]),_:3},16))}}),H=["for"],y=e.defineComponent({..._.getComponentOptions("Checkbox"),__name:"Checkbox",props:{size:{default:"xsm"},class:{},rootCls:{},indicatorCls:{},indeterminateCls:{},labelCls:{},label:{},id:{},valueAsLabel:{type:Boolean,default:!0},defaultChecked:{type:Boolean},checked:{type:[Boolean,String],default:void 0},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},as:{default:"div"}},emits:["update:checked","change"],setup(t,{emit:o}){const r=v.getBemBlock("checkbox"),n=t,s=z({model:e.ref([]),size:e.computed(()=>n.size),disabled:e.computed(()=>n.disabled)}),u=o,d=e.useSlots(),i=e.ref(),c=a=>{var m,g;if(s.model.value&&n.value!==void 0){const B=(g=(m=s.model.value)==null?void 0:m.indexOf)==null?void 0:g.call(m,n.value);a&&B===-1?s.model.value=[...s.model.value,n.value]:!a&&B!==-1&&(s.model.value=s.model.value.filter(S=>S!==n.value))}else n.checked!==void 0?(u("update:checked",a),u("change",a)):i.value=a};e.watch(()=>[s.model,n.checked],()=>{var a,m;s.model.value&&n.value!==void 0?i.value=(m=(a=s.model.value)==null?void 0:a.includes)==null?void 0:m.call(a,n.value):i.value=n.checked},{immediate:!0,deep:!0});const f=e.computed(()=>n.id??k.useId(void 0,r)),h=e.computed(()=>({disabled:s.disabled.value??n.disabled,...l.omit(n,"size","class","label","as","disabled","checked","id","rootCls","indicatorCls","indeterminateCls","labelCls")})),x=L.cva(r,{variants:{size:v.generateVariantClassList($,r)}}),b=e.computed(()=>n.label||d.default||n.value&&n.valueAsLabel),q=e.computed(()=>{if(n.label)return n.label;if(n.value&&n.valueAsLabel)return n.value}),T=e.computed(()=>({asChild:!b.value,as:n.as})),C=e.computed(()=>s.size.value??n.size),G=e.computed(()=>{switch(C.value){case"xsm":return"2xsm";case"2xsm":default:return"3xsm"}});return(a,m)=>(e.openBlock(),e.createBlock(e.unref(k.Primitive),e.mergeProps({key:b.value},T.value,{class:[{[e.unref(v.getBemElement)(e.unref(r),"root")]:b.value},b.value?a.rootCls:void 0]}),{default:e.withCtx(()=>[e.createVNode(e.unref(k.CheckboxRoot),e.mergeProps(h.value,{checked:i.value,id:f.value,"onUpdate:checked":c,class:[e.unref(x)({size:C.value}),n.class]}),{default:e.withCtx(()=>[e.createVNode(e.unref(k.CheckboxIndicator),{class:e.normalizeClass([e.unref(v.getBemElement)(e.unref(r),"indicator"),a.indicatorCls]),asChild:""},{default:e.withCtx(()=>[n.checked!="indeterminate"?(e.openBlock(),e.createBlock(I._sfc_main,{key:0,icon:"tabler:check",size:G.value},null,8,["size"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([e.unref(v.getBemElement)(e.unref(r),"indeterminate"),a.indeterminateCls])},null,2))]),_:1},8,["class"])]),_:1},16,["checked","id","class"]),b.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:f.value,class:e.normalizeClass([e.unref(v.getBemElement)(e.unref(r),"label"),a.labelCls])},[e.renderSlot(a.$slots,"default",{checked:a.checked,disabled:a.disabled,required:a.required},()=>[e.createTextVNode(e.toDisplayString(q.value),1)])],10,H)):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});exports.CheckboxSizes=$;exports._sfc_main=y;exports._sfc_main$1=F;exports.injectCheckboxGroupContext=z;exports.provideCheckboxGroupContext=P;exports.useColoredPantographCheckbox=w;exports.useColoredPantographCheckboxGroup=E;
|