@pantograph/vue 0.10.3 → 0.10.5
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 +5 -1
- package/dist/ActionButton/index.js.js +1 -1
- package/dist/ActionButton/index.umd.cjs.js +1 -1
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-48AXc54q.js +54 -0
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-B3fz9VlS.js +1 -0
- package/dist/Avatar/index.js.js +1 -1
- package/dist/Avatar/index.umd.cjs.js +1 -1
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-ZqNWAzDy.js → Avatar.vue_vue_type_style_index_0_lang-BtPvBDpf.js} +3 -3
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-BBmLnOBV.js → Avatar.vue_vue_type_style_index_0_lang-Dno8MmtN.js} +1 -1
- package/dist/AvatarGroup/index.js.js +1 -1
- package/dist/AvatarGroup/index.umd.cjs.js +1 -1
- package/dist/Badge/Badge.d.ts +2 -2
- package/dist/Badge/index.js.js +1 -1
- package/dist/Badge/index.umd.cjs.js +1 -1
- package/dist/{Badge.vue_vue_type_script_setup_true_lang-CCIamdNB.js → Badge.vue_vue_type_script_setup_true_lang-CQlVTtz6.js} +6 -5
- package/dist/Badge.vue_vue_type_script_setup_true_lang-CrMJ4fbZ.js +1 -0
- package/dist/Base/BaseBadge/BaseBadge.d.ts +3 -1
- package/dist/Base/BaseButton/BaseButton.d.ts +5 -0
- package/dist/{BaseBadge.vue_vue_type_style_index_0_lang-Bh1152XC.js → BaseBadge.vue_vue_type_style_index_0_lang-CKBk5zhg.js} +41 -38
- package/dist/BaseBadge.vue_vue_type_style_index_0_lang-PmBe2V25.js +1 -0
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-CoUA_gDr.js +169 -0
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-D0Qoa28N.js +1 -0
- package/dist/Button/Button.d.ts +7 -3
- package/dist/Button/index.js.js +1 -1
- package/dist/Button/index.umd.cjs.js +1 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-CYNr2NyY.js +1 -0
- package/dist/{Button.vue_vue_type_script_setup_true_lang-BHumLt2E.js → Button.vue_vue_type_script_setup_true_lang-CobnwnGT.js} +15 -13
- package/dist/Checkbox/Checkbox.d.ts +3 -3
- package/dist/Checkbox/index.js.js +1 -1
- package/dist/Checkbox/index.umd.cjs.js +1 -1
- package/dist/{Checkbox.vue_vue_type_style_index_0_lang-CSmeTeZh.js → Checkbox.vue_vue_type_style_index_0_lang-DfpxRngn.js} +69 -67
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-pWUK1jtk.js +1 -0
- package/dist/CheckboxGroup/index.js.js +1 -1
- package/dist/CheckboxGroup/index.umd.cjs.js +1 -1
- package/dist/ColorPicker/index.js.js +1 -1
- package/dist/ColorPicker/index.umd.cjs.js +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-C86gVRVp.js → ColorPicker.vue_vue_type_style_index_0_lang-BNdf9ydf.js} +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-Bj735O4E.js → ColorPicker.vue_vue_type_style_index_0_lang-CMZ6my8r.js} +3 -3
- package/dist/ColorSwatch/ColorSwatch.d.ts +1 -1
- package/dist/ColorSwatch/index.js.js +1 -1
- package/dist/ColorSwatch/index.umd.cjs.js +1 -1
- package/dist/ColorSwatch.vue_vue_type_style_index_0_lang-DWbErEeg.js +1 -0
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-8sQWWbLp.js → ColorSwatch.vue_vue_type_style_index_0_lang-DmWOViyT.js} +22 -21
- package/dist/ColorSwatchGroup/ColorSwatchGroup.d.ts +3 -3
- package/dist/ColorSwatchGroup/index.js.js +1 -1
- package/dist/ColorSwatchGroup/index.umd.cjs.js +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-BiHYDJTg.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-Bqsu2-Pi.js} +7 -7
- package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-CfrcyIa2.js +1 -0
- package/dist/ColorTrigger/index.js.js +1 -1
- package/dist/ColorTrigger/index.umd.cjs.js +1 -1
- package/dist/{ColorTrigger.vue_vue_type_style_index_0_lang-BNFu93Ns.js → ColorTrigger.vue_vue_type_style_index_0_lang-DdGYFQWx.js} +4 -4
- package/dist/ColorTrigger.vue_vue_type_style_index_0_lang-lIncYku3.js +1 -0
- package/dist/ConfigProvider/index.d.ts +10 -2
- package/dist/ConfigProvider/index.js.js +10 -119
- package/dist/ConfigProvider/index.umd.cjs.js +1 -1
- package/dist/ConfigProvider/utils.d.ts +1 -0
- package/dist/Divider/Divider.d.ts +1 -1
- package/dist/Empty/Empty.d.ts +38 -0
- package/dist/Empty/Empty.model.d.ts +2 -0
- package/dist/Empty/index.d.ts +1 -0
- package/dist/Empty/index.js.js +1 -0
- package/dist/Empty/index.umd.cjs.js +1 -0
- package/dist/FloatButton/FloatButton.d.ts +5 -1
- package/dist/FloatButton/index.js.js +1 -1
- package/dist/FloatButton/index.umd.cjs.js +1 -1
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-Bg4MdrWW.js → FloatButton.vue_vue_type_script_setup_true_lang-BZreRcZ1.js} +13 -12
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-io7at7GI.js +1 -0
- package/dist/GraphicalObject/GraphicalObject.d.ts +2 -2
- package/dist/GraphicalObject/index.js.js +1 -1
- package/dist/GraphicalObject/index.umd.cjs.js +1 -1
- package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-CshbWnRl.js +1 -0
- package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-BEZ6FkRf.js → GraphicalObject.vue_vue_type_script_setup_true_lang-D0vD57ET.js} +7 -6
- package/dist/Icon/Icon.d.ts +2 -1
- package/dist/Icon/index.js.js +1 -1
- package/dist/Icon/index.umd.cjs.js +1 -1
- package/dist/Icon.vue_vue_type_style_index_0_lang-BVVc15Aa.js +49 -0
- package/dist/Icon.vue_vue_type_style_index_0_lang-c9NvwoHi.js +1 -0
- package/dist/IconButton/IconButton.d.ts +7 -3
- package/dist/IconButton/index.js.js +1 -1
- package/dist/IconButton/index.umd.cjs.js +1 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-CWqrQ22L.js +1 -0
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-DJGgntqa.js → IconButton.vue_vue_type_script_setup_true_lang-CruPwQ16.js} +7 -6
- package/dist/Image/index.js.js +1 -1
- package/dist/Image/index.umd.cjs.js +1 -1
- package/dist/{Image.vue_vue_type_style_index_0_lang-Hg1jFz-L.js → Image.vue_vue_type_style_index_0_lang-Bu6dc2yW.js} +1 -1
- package/dist/{Image.vue_vue_type_style_index_0_lang-pkzjPQyu.js → Image.vue_vue_type_style_index_0_lang-C8UTT06Z.js} +3 -3
- package/dist/IndentLevel/IndentLevel.d.ts +1 -1
- package/dist/IndentLevel/index.js.js +1 -1
- package/dist/IndentLevel/index.umd.cjs.js +1 -1
- package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-ZZ1uEhji.js → IndentLevel.vue_vue_type_style_index_0_lang-Bgt84fW2.js} +3 -3
- package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-DqqJTrDF.js → IndentLevel.vue_vue_type_style_index_0_lang-D19gT0Bo.js} +1 -1
- package/dist/Indicator/Indicator.d.ts +1 -1
- package/dist/Indicator/index.js.js +1 -1
- package/dist/Indicator/index.umd.cjs.js +1 -1
- package/dist/{Indicator.vue_vue_type_script_setup_true_lang-B16OmZLF.js → Indicator.vue_vue_type_script_setup_true_lang-DX6wYSsL.js} +5 -5
- package/dist/{Indicator.vue_vue_type_script_setup_true_lang-BibzfVax.js → Indicator.vue_vue_type_script_setup_true_lang-DmGmSuAJ.js} +1 -1
- package/dist/Input/index.js.js +1 -1
- package/dist/Input/index.umd.cjs.js +1 -1
- package/dist/Input.vue_vue_type_style_index_0_lang-Bg1yMzU-.js +1 -0
- package/dist/Input.vue_vue_type_style_index_0_lang-CfRRpkAQ.js +269 -0
- package/dist/Kbd/index.js.js +1 -1
- package/dist/Kbd/index.umd.cjs.js +1 -1
- package/dist/{Kbd.vue_vue_type_style_index_0_lang-CpDjSQqg.js → Kbd.vue_vue_type_style_index_0_lang-CUCZZjvw.js} +1 -1
- package/dist/{Kbd.vue_vue_type_style_index_0_lang-D1y-0kBN.js → Kbd.vue_vue_type_style_index_0_lang-C_WG0F7e.js} +1 -1
- package/dist/Menu/Menu.d.ts +43 -6
- package/dist/Menu/index.js.js +1 -1
- package/dist/Menu/index.umd.cjs.js +1 -1
- package/dist/Menu.vue_vue_type_style_index_0_lang-1iiTY68f.js +1 -0
- package/dist/{Menu.vue_vue_type_style_index_0_lang-CtqLC5y9.js → Menu.vue_vue_type_style_index_0_lang-CJAZruBS.js} +154 -153
- package/dist/MenuItem/MenuItem.d.ts +20 -3
- package/dist/MenuItem/MenuItemContent.d.ts +7 -7
- package/dist/MenuItem/index.js.js +1 -1
- package/dist/MenuItem/index.umd.cjs.js +1 -1
- package/dist/Popover/Popover.d.ts +8 -6
- package/dist/Popover/index.js.js +1 -1
- package/dist/Popover/index.umd.cjs.js +1 -1
- package/dist/Popover.vue_vue_type_style_index_0_lang-BmWYJg2M.js +154 -0
- package/dist/Popover.vue_vue_type_style_index_0_lang-C7q9V9tc.js +1 -0
- package/dist/RadioGroup/index.js.js +1 -1
- package/dist/RadioGroup/index.umd.cjs.js +1 -1
- package/dist/RadioGroup.vue_vue_type_script_setup_true_lang-BCj1pwSS.js +1 -0
- package/dist/{RadioGroup.vue_vue_type_script_setup_true_lang-C8nd4TEI.js → RadioGroup.vue_vue_type_script_setup_true_lang-Dmj1c8T_.js} +12 -11
- package/dist/Shortcut/index.js.js +1 -1
- package/dist/Shortcut/index.umd.cjs.js +1 -1
- package/dist/{Shortcut.vue_vue_type_style_index_0_lang-D4xo_UgO.js → Shortcut.vue_vue_type_style_index_0_lang-CmVub9SF.js} +2 -2
- package/dist/{Shortcut.vue_vue_type_style_index_0_lang-D8_aLpYM.js → Shortcut.vue_vue_type_style_index_0_lang-IKgak4ec.js} +1 -1
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/index.js.js +1 -1
- package/dist/Spinner/index.umd.cjs.js +1 -1
- package/dist/{Spinner.vue_vue_type_style_index_0_lang-BP7P5xu8.js → Spinner.vue_vue_type_style_index_0_lang-BFKOyKva.js} +1 -1
- package/dist/{Spinner.vue_vue_type_style_index_0_lang-BYqqSQAx.js → Spinner.vue_vue_type_style_index_0_lang-Birom5mO.js} +1 -1
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/index.js.js +1 -1
- package/dist/Switch/index.umd.cjs.js +1 -1
- package/dist/{Switch.vue_vue_type_style_index_0_lang-CoXu3YJ-.js → Switch.vue_vue_type_style_index_0_lang-BhiOtkMp.js} +1 -1
- package/dist/{Switch.vue_vue_type_style_index_0_lang-CvWay8Wa.js → Switch.vue_vue_type_style_index_0_lang-KnEeVf_H.js} +2 -2
- package/dist/Table/Table.d.ts +67 -0
- package/dist/Table/Table.model.d.ts +57 -0
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.js.js +2650 -0
- package/dist/Table/index.umd.cjs.js +22 -0
- package/dist/Table/useColumn.d.ts +15 -0
- package/dist/Table/useColumnWrap.d.ts +12 -0
- package/dist/Tree/Tree.d.ts +3 -3
- package/dist/Tree/index.js.js +1 -1
- package/dist/Tree/index.umd.cjs.js +1 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-BZVa19t5.js +499 -0
- package/dist/Tree.vue_vue_type_style_index_0_lang-CDS7qhkC.js +1 -0
- package/dist/_baseIsEqual-BTV64KSy.js +144 -0
- package/dist/_baseIsEqual-DP4HkppL.js +1 -0
- package/dist/{_flatRest-CHX8vV1P.js → _flatRest-BzXqWlYG.js} +37 -38
- package/dist/_flatRest-CreY2VBo.js +1 -0
- package/dist/{cloneDeep-BMA7VTX1.js → cloneDeep-D-sgVuxc.js} +1 -1
- package/dist/cloneDeep-DkiDLLTT.js +1 -0
- package/dist/{get-Q8GXlj-L.js → get-CFKlew5d.js} +1 -1
- package/dist/{get-B4UJlXpC.js → get-DhKz3lGB.js} +1 -1
- package/dist/index-BBeDQiz4.js +1 -0
- package/dist/index-iTlmMf0U.js +137 -0
- package/dist/index.js.js +31 -31
- package/dist/index.umd.cjs.js +1 -1
- package/dist/isArray-3RTyNB5p.js +1 -0
- package/dist/isArray-CdbPONHA.js +31 -0
- package/dist/{isNumber-DlKYWCo3.js → isNumber-BopDesuz.js} +1 -1
- package/dist/isNumber-CYWvnzF3.js +1 -0
- package/dist/{omit-BEkBWXra.js → omit-Beooz3Dl.js} +40 -41
- package/dist/omit-C4BrcXKG.js +1 -0
- package/dist/{pick-DLskPTKb.js → pick-Bwh_EsUP.js} +2 -2
- package/dist/{pick-C-ap2Lj0.js → pick-Db06rbL5.js} +1 -1
- package/dist/style/index.css +1 -1
- package/dist/uniq-Bfg4Hn1q.js +56 -0
- package/dist/uniq-ChIEzCZe.js +1 -0
- package/package.json +12 -2
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-Bmld__SV.js +0 -51
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-Bno9iBJg.js +0 -1
- package/dist/Badge.vue_vue_type_script_setup_true_lang-ooDlpl8j.js +0 -1
- package/dist/BaseBadge.vue_vue_type_style_index_0_lang-BNs69VP4.js +0 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-4ju_QUXH.js +0 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-CEY27kcT.js +0 -160
- package/dist/Button.vue_vue_type_script_setup_true_lang-BZ0h9oaW.js +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-D0sF0-hW.js +0 -1
- package/dist/ColorSwatch.vue_vue_type_style_index_0_lang-Bt9Tu3La.js +0 -1
- package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-DmF-FkKK.js +0 -1
- package/dist/ColorTrigger.vue_vue_type_style_index_0_lang-C8kPa338.js +0 -1
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-Bsmuycb8.js +0 -1
- package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-CdO2zArd.js +0 -1
- package/dist/Icon.vue_vue_type_style_index_0_lang-BfPcw6PU.js +0 -48
- package/dist/Icon.vue_vue_type_style_index_0_lang-BvHCdzZP.js +0 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-DU9MPZq2.js +0 -1
- package/dist/Input.vue_vue_type_style_index_0_lang-CcR6oCIR.js +0 -407
- package/dist/Input.vue_vue_type_style_index_0_lang-DVN491cI.js +0 -1
- package/dist/Menu.vue_vue_type_style_index_0_lang-CG9UOulA.js +0 -1
- package/dist/Popover.vue_vue_type_style_index_0_lang-DRMPu5Ij.js +0 -1
- package/dist/Popover.vue_vue_type_style_index_0_lang-vZfwRHoU.js +0 -142
- package/dist/RadioGroup.vue_vue_type_script_setup_true_lang-DjEHmvMo.js +0 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-BCYjSwUH.js +0 -545
- package/dist/Tree.vue_vue_type_style_index_0_lang-CvskECfv.js +0 -1
- package/dist/_flatRest-R59G2N4m.js +0 -1
- package/dist/cloneDeep-BcKVMzWC.js +0 -1
- package/dist/isArray-B7z6QoM5.js +0 -1
- package/dist/isArray-WzO_os3q.js +0 -4
- package/dist/isNumber-eaDdxhkG.js +0 -1
- package/dist/isObjectLike-BatpeCIi.js +0 -29
- package/dist/isObjectLike-kO9e4B7g.js +0 -1
- package/dist/isString-BVAZt9W3.js +0 -9
- package/dist/isString-CKmTJsel.js +0 -1
- package/dist/omit-BKPbELUG.js +0 -1
package/dist/Button/index.js.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-CYNr2NyY.js");exports.Button=e._sfc_main;exports.default=e._sfc_main;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),p=require("./omit-C4BrcXKG.js"),l=require("./BaseButton.vue_vue_type_style_index_0_lang-D0Qoa28N.js"),_=require("./options-B4iSAKol.js"),f=e.defineComponent({..._.getComponentOptions("Button",!1),__name:"Button",props:{class:{},type:{},color:{},loading:{type:Boolean},preIcon:{},postIcon:{},size:{},text:{},postIconFlipOnDir:{},preIconFlipOnDir:{}},setup(s,{expose:r}){const c=s,i=e.useAttrs(),a=e.computed(()=>({...p.omit(i,"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(a.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,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { o as y } from "./omit-
|
|
3
|
-
import { _ as
|
|
4
|
-
import { g as
|
|
5
|
-
const
|
|
6
|
-
...
|
|
1
|
+
import { defineComponent as c, useAttrs as l, computed as m, ref as u, createBlock as f, openBlock 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-Beooz3Dl.js";
|
|
3
|
+
import { _ as I } from "./BaseButton.vue_vue_type_style_index_0_lang-CoUA_gDr.js";
|
|
4
|
+
import { g as O } from "./options-JBqnVZUl.js";
|
|
5
|
+
const z = /* @__PURE__ */ c({
|
|
6
|
+
...O("Button", !1),
|
|
7
7
|
__name: "Button",
|
|
8
8
|
props: {
|
|
9
9
|
class: {},
|
|
@@ -13,13 +13,15 @@ const O = /* @__PURE__ */ i({
|
|
|
13
13
|
preIcon: {},
|
|
14
14
|
postIcon: {},
|
|
15
15
|
size: {},
|
|
16
|
-
text: {}
|
|
16
|
+
text: {},
|
|
17
|
+
postIconFlipOnDir: {},
|
|
18
|
+
preIconFlipOnDir: {}
|
|
17
19
|
},
|
|
18
20
|
setup(r, { expose: n }) {
|
|
19
|
-
const s = r, a =
|
|
21
|
+
const s = r, a = l(), p = m(() => ({
|
|
20
22
|
...y(a, "variant", "icon", "action", "active", "badgeText"),
|
|
21
23
|
...s
|
|
22
|
-
})), o =
|
|
24
|
+
})), o = u();
|
|
23
25
|
return n({
|
|
24
26
|
focus() {
|
|
25
27
|
var e;
|
|
@@ -29,20 +31,20 @@ const O = /* @__PURE__ */ i({
|
|
|
29
31
|
var e;
|
|
30
32
|
(e = o.value) == null || e.blur();
|
|
31
33
|
}
|
|
32
|
-
}), (e,
|
|
34
|
+
}), (e, C) => (_(), f(I, d(p.value, {
|
|
33
35
|
variant: "simple",
|
|
34
36
|
ref_key: "buttonRef",
|
|
35
37
|
ref: o
|
|
36
38
|
}), b({ _: 2 }, [
|
|
37
39
|
g(Object.keys(e.$slots), (t) => ({
|
|
38
40
|
name: t,
|
|
39
|
-
fn: v((
|
|
40
|
-
B(e.$slots, t, k(x(
|
|
41
|
+
fn: v((i) => [
|
|
42
|
+
B(e.$slots, t, k(x(i)))
|
|
41
43
|
])
|
|
42
44
|
}))
|
|
43
45
|
]), 1040));
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
z as _
|
|
48
50
|
};
|
|
@@ -17,19 +17,19 @@ export interface CheckboxSlots {
|
|
|
17
17
|
default?: (props: object) => never;
|
|
18
18
|
}
|
|
19
19
|
export type CheckboxEmits = CheckboxRootEmits & {
|
|
20
|
-
change: [value: boolean
|
|
20
|
+
change: [value: boolean];
|
|
21
21
|
blur: [event: InputEvent];
|
|
22
22
|
focus: [event: InputEvent];
|
|
23
23
|
};
|
|
24
24
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<CheckboxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
25
|
blur: (event: InputEvent) => any;
|
|
26
|
-
change: (value: boolean | "indeterminate") => any;
|
|
27
26
|
focus: (event: InputEvent) => any;
|
|
27
|
+
change: (value: boolean) => any;
|
|
28
28
|
"update:checked": (value: boolean) => any;
|
|
29
29
|
}, string, import('vue').PublicProps, Readonly<CheckboxProps> & Readonly<{
|
|
30
30
|
onBlur?: ((event: InputEvent) => any) | undefined;
|
|
31
|
-
onChange?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
32
31
|
onFocus?: ((event: InputEvent) => any) | undefined;
|
|
32
|
+
onChange?: ((value: boolean) => any) | undefined;
|
|
33
33
|
"onUpdate:checked"?: ((value: boolean) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
35
|
size: CheckboxSize;
|
|
@@ -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-DfpxRngn.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Checkbox,
|
|
4
4
|
s as CheckboxSizes,
|
|
@@ -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-pWUK1jtk.js");exports.Checkbox=e._sfc_main;exports.CheckboxSizes=e.CheckboxSizes;exports.default=e._sfc_main;exports.useColoredPantographCheckbox=e.useColoredPantographCheckbox;exports.useColoredPantographCheckboxGroup=e.useColoredPantographCheckboxGroup;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as S, ref as _, watch as L, computed as c, createElementBlock as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { prefixTokens as
|
|
4
|
-
import { g as
|
|
5
|
-
import { cva as
|
|
1
|
+
import { defineComponent as S, ref as _, watch as L, computed as c, createElementBlock as p, openBlock as i, renderSlot as G, createCommentVNode as w, Fragment as K, renderList as O, createBlock as V, mergeProps as $, useSlots as T, unref as l, createVNode as y, withKeys as j, withCtx as B, normalizeClass as x, createTextVNode as F, toDisplayString as R } from "vue";
|
|
2
|
+
import { createContext as H, CheckboxRoot as J, CheckboxIndicator as M } from "radix-vue";
|
|
3
|
+
import { prefixTokens as n } from "@pantograph/tokens";
|
|
4
|
+
import { g as Q, a as W, b as f } from "./class-DziTeW9B.js";
|
|
5
|
+
import { cva as X } from "class-variance-authority";
|
|
6
6
|
import { g as P } from "./options-JBqnVZUl.js";
|
|
7
|
-
import { o as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { u as
|
|
10
|
-
import { U as
|
|
11
|
-
const
|
|
12
|
-
"--ptc-checkbox-bg": `var(--${
|
|
13
|
-
"--ptc-checkbox-bg-hover": `var(--${
|
|
14
|
-
"--ptc-checkbox-bg-focus": `var(--${
|
|
15
|
-
"--ptc-checkbox-br-focus": `var(--${
|
|
16
|
-
"--ptc-checkbox-bg-active": `var(--${
|
|
17
|
-
}),
|
|
18
|
-
"--ptc-group-checkbox-bg": `var(--${
|
|
19
|
-
"--ptc-group-checkbox-bg-hover": `var(--${
|
|
20
|
-
"--ptc-group-checkbox-bg-focus": `var(--${
|
|
21
|
-
"--ptc-group-checkbox-br-focus": `var(--${
|
|
22
|
-
"--ptc-group-checkbox-bg-active": `var(--${
|
|
23
|
-
}), [
|
|
7
|
+
import { o as Y } from "./omit-Beooz3Dl.js";
|
|
8
|
+
import { _ as Z } from "./Icon.vue_vue_type_style_index_0_lang-BVVc15Aa.js";
|
|
9
|
+
import { u as ee } from "./useId-DvOSMFGX.js";
|
|
10
|
+
import { U as ae } from "./useInputDataStates-CZbdWpyp.js";
|
|
11
|
+
const te = ["2xsm", "xsm"], fe = (t) => ({
|
|
12
|
+
"--ptc-checkbox-bg": `var(--${n}-${t}-5)`,
|
|
13
|
+
"--ptc-checkbox-bg-hover": `var(--${n}-${t}-4)`,
|
|
14
|
+
"--ptc-checkbox-bg-focus": `var(--${n}-${t}-6)`,
|
|
15
|
+
"--ptc-checkbox-br-focus": `var(--${n}-${t}-6)`,
|
|
16
|
+
"--ptc-checkbox-bg-active": `var(--${n}-${t}-7)`
|
|
17
|
+
}), ke = (t) => ({
|
|
18
|
+
"--ptc-group-checkbox-bg": `var(--${n}-${t}-5)`,
|
|
19
|
+
"--ptc-group-checkbox-bg-hover": `var(--${n}-${t}-4)`,
|
|
20
|
+
"--ptc-group-checkbox-bg-focus": `var(--${n}-${t}-6)`,
|
|
21
|
+
"--ptc-group-checkbox-br-focus": `var(--${n}-${t}-6)`,
|
|
22
|
+
"--ptc-group-checkbox-bg-active": `var(--${n}-${t}-7)`
|
|
23
|
+
}), [oe, se] = H("CheckboxGroup"), Ce = /* @__PURE__ */ S({
|
|
24
24
|
...P("CheckboxGroup"),
|
|
25
25
|
__name: "CheckboxGroup",
|
|
26
26
|
props: {
|
|
@@ -32,7 +32,7 @@ const ee = ["2xsm", "xsm"], be = (t) => ({
|
|
|
32
32
|
},
|
|
33
33
|
emits: ["update:value", "change"],
|
|
34
34
|
setup(t, { emit: k }) {
|
|
35
|
-
const
|
|
35
|
+
const r = k, e = t, o = _(e.value ?? []);
|
|
36
36
|
L(
|
|
37
37
|
() => e.value,
|
|
38
38
|
() => {
|
|
@@ -43,27 +43,27 @@ const ee = ["2xsm", "xsm"], be = (t) => ({
|
|
|
43
43
|
get() {
|
|
44
44
|
return e.value ? e.value : o.value;
|
|
45
45
|
},
|
|
46
|
-
set(
|
|
47
|
-
e.value || (o.value =
|
|
46
|
+
set(s) {
|
|
47
|
+
e.value || (o.value = s), r("update:value", s), r("change", s);
|
|
48
48
|
}
|
|
49
49
|
}), C = c(() => e.size), d = c(() => e.disabled ? !0 : void 0);
|
|
50
|
-
return
|
|
50
|
+
return se({
|
|
51
51
|
model: u,
|
|
52
52
|
size: C,
|
|
53
53
|
disabled: d
|
|
54
|
-
}), (
|
|
55
|
-
G(
|
|
54
|
+
}), (s, g) => (i(), p("div", null, [
|
|
55
|
+
G(s.$slots, "default", {}, () => {
|
|
56
56
|
var m;
|
|
57
57
|
return [
|
|
58
|
-
(m =
|
|
58
|
+
(m = s.options) != null && m.length ? (i(!0), p(K, { key: 0 }, O(s.options, (b) => (i(), V(re, $({
|
|
59
59
|
key: b.value,
|
|
60
60
|
ref_for: !0
|
|
61
|
-
}, b), null, 16))), 128)) :
|
|
61
|
+
}, b), null, 16))), 128)) : w("", !0)
|
|
62
62
|
];
|
|
63
63
|
})
|
|
64
64
|
]));
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
66
|
+
}), le = ["for"], re = /* @__PURE__ */ S({
|
|
67
67
|
...P("Checkbox"),
|
|
68
68
|
__name: "Checkbox",
|
|
69
69
|
props: {
|
|
@@ -85,36 +85,36 @@ const ee = ["2xsm", "xsm"], be = (t) => ({
|
|
|
85
85
|
},
|
|
86
86
|
emits: ["update:checked", "change", "blur", "focus"],
|
|
87
87
|
setup(t, { emit: k }) {
|
|
88
|
-
const
|
|
88
|
+
const r = Q("checkbox"), e = t, o = oe({}), u = k, C = T(), d = _(e.checked ?? !1);
|
|
89
89
|
L(
|
|
90
90
|
() => e.checked,
|
|
91
91
|
() => {
|
|
92
92
|
d.value = e.checked ?? !1;
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
const
|
|
95
|
+
const s = c({
|
|
96
96
|
get() {
|
|
97
97
|
var a;
|
|
98
98
|
return (a = o.model) != null && a.value ? e.value !== void 0 && o.model.value.includes(e.value) : e.checked !== void 0 ? e.checked : d.value;
|
|
99
99
|
},
|
|
100
100
|
set(a) {
|
|
101
|
-
var
|
|
102
|
-
if ((
|
|
101
|
+
var v;
|
|
102
|
+
if ((v = o.model) != null && v.value) {
|
|
103
103
|
if (e.value !== void 0) {
|
|
104
104
|
const h = o.model.value.indexOf(e.value);
|
|
105
105
|
a && h === -1 ? o.model.value = [...o.model.value, e.value] : !a && h !== -1 && (o.model.value = o.model.value.filter(
|
|
106
|
-
(
|
|
106
|
+
(E) => E !== e.value
|
|
107
107
|
));
|
|
108
108
|
}
|
|
109
109
|
} else
|
|
110
110
|
e.checked === void 0 && (d.value = a), u("update:checked", a), u("change", a);
|
|
111
111
|
}
|
|
112
|
-
}), g = c(() => e.id ??
|
|
112
|
+
}), g = c(() => e.id ?? ee(r)), m = c(() => {
|
|
113
113
|
var a;
|
|
114
114
|
return {
|
|
115
115
|
disabled: ((a = o.disabled) == null ? void 0 : a.value) ?? e.disabled,
|
|
116
116
|
...N.value,
|
|
117
|
-
...
|
|
117
|
+
...Y(
|
|
118
118
|
e,
|
|
119
119
|
"size",
|
|
120
120
|
"class",
|
|
@@ -128,9 +128,9 @@ const ee = ["2xsm", "xsm"], be = (t) => ({
|
|
|
128
128
|
"labelCls"
|
|
129
129
|
)
|
|
130
130
|
};
|
|
131
|
-
}), b =
|
|
131
|
+
}), b = X(r, {
|
|
132
132
|
variants: {
|
|
133
|
-
size:
|
|
133
|
+
size: W(te, r)
|
|
134
134
|
}
|
|
135
135
|
}), q = c(() => e.label || C.default || e.value && e.valueAsLabel), A = c(() => {
|
|
136
136
|
if (e.label) return e.label;
|
|
@@ -146,35 +146,37 @@ const ee = ["2xsm", "xsm"], be = (t) => ({
|
|
|
146
146
|
default:
|
|
147
147
|
return "3xsm";
|
|
148
148
|
}
|
|
149
|
-
}), { rootBindings: I, inputBindings: N } =
|
|
149
|
+
}), { rootBindings: I, inputBindings: N } = ae({
|
|
150
150
|
getDisabled: () => {
|
|
151
151
|
var a;
|
|
152
152
|
return ((a = o.disabled) == null ? void 0 : a.value) ?? e.disabled;
|
|
153
153
|
},
|
|
154
154
|
emit: u
|
|
155
|
-
});
|
|
156
|
-
return (a,
|
|
157
|
-
class: [
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
}), U = () => s.value = !s.value;
|
|
156
|
+
return (a, v) => (i(), p("div", $({
|
|
157
|
+
class: [l(f)(l(r), "root"), a.rootCls]
|
|
158
|
+
}, l(I)), [
|
|
159
|
+
y(l(J), $({
|
|
160
|
+
onKeyup: j(U, ["enter"])
|
|
161
|
+
}, m.value, {
|
|
162
|
+
checked: s.value,
|
|
163
|
+
"onUpdate:checked": v[0] || (v[0] = (h) => s.value = h),
|
|
162
164
|
id: g.value,
|
|
163
|
-
class: [
|
|
165
|
+
class: [l(b)({ size: z.value }), e.class]
|
|
164
166
|
}), {
|
|
165
|
-
default:
|
|
166
|
-
|
|
167
|
-
class: x([
|
|
167
|
+
default: B(() => [
|
|
168
|
+
y(l(M), {
|
|
169
|
+
class: x([l(f)(l(r), "indicator"), a.indicatorCls]),
|
|
168
170
|
asChild: ""
|
|
169
171
|
}, {
|
|
170
|
-
default:
|
|
171
|
-
e.checked != "indeterminate" ? (
|
|
172
|
+
default: B(() => [
|
|
173
|
+
e.checked != "indeterminate" ? (i(), V(Z, {
|
|
172
174
|
key: 0,
|
|
173
175
|
icon: "tabler:check",
|
|
174
176
|
size: D.value
|
|
175
|
-
}, null, 8, ["size"])) : (
|
|
177
|
+
}, null, 8, ["size"])) : (i(), p("span", {
|
|
176
178
|
key: 1,
|
|
177
|
-
class: x([
|
|
179
|
+
class: x([l(f)(l(r), "indeterminate"), a.indeterminateCls])
|
|
178
180
|
}, null, 2))
|
|
179
181
|
]),
|
|
180
182
|
_: 1
|
|
@@ -182,28 +184,28 @@ const ee = ["2xsm", "xsm"], be = (t) => ({
|
|
|
182
184
|
]),
|
|
183
185
|
_: 1
|
|
184
186
|
}, 16, ["checked", "id", "class"]),
|
|
185
|
-
q.value ? (
|
|
187
|
+
q.value ? (i(), p("label", {
|
|
186
188
|
key: 0,
|
|
187
189
|
for: g.value,
|
|
188
|
-
class: x([
|
|
190
|
+
class: x([l(f)(l(r), "label"), a.labelCls])
|
|
189
191
|
}, [
|
|
190
192
|
G(a.$slots, "default", {
|
|
191
193
|
checked: a.checked,
|
|
192
194
|
disabled: a.disabled,
|
|
193
195
|
required: a.required
|
|
194
196
|
}, () => [
|
|
195
|
-
|
|
197
|
+
F(R(A.value), 1)
|
|
196
198
|
])
|
|
197
|
-
], 10,
|
|
199
|
+
], 10, le)) : w("", !0)
|
|
198
200
|
], 16));
|
|
199
201
|
}
|
|
200
202
|
});
|
|
201
203
|
export {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
te as C,
|
|
205
|
+
re as _,
|
|
206
|
+
ke as a,
|
|
207
|
+
Ce as b,
|
|
208
|
+
oe as i,
|
|
209
|
+
se as p,
|
|
210
|
+
fe as u
|
|
209
211
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),h=require("radix-vue"),l=require("@pantograph/tokens"),r=require("./class-CjZYGZDW.js"),V=require("class-variance-authority"),x=require("./options-B4iSAKol.js"),P=require("./omit-C4BrcXKG.js"),w=require("./Icon.vue_vue_type_style_index_0_lang-c9NvwoHi.js"),L=require("./useId-Ku3O_8TK.js"),I=require("./useInputDataStates-CbRgNQqU.js"),g=["2xsm","xsm"],N=a=>({"--ptc-checkbox-bg":`var(--${l.prefixTokens}-${a}-5)`,"--ptc-checkbox-bg-hover":`var(--${l.prefixTokens}-${a}-4)`,"--ptc-checkbox-bg-focus":`var(--${l.prefixTokens}-${a}-6)`,"--ptc-checkbox-br-focus":`var(--${l.prefixTokens}-${a}-6)`,"--ptc-checkbox-bg-active":`var(--${l.prefixTokens}-${a}-7)`}),A=a=>({"--ptc-group-checkbox-bg":`var(--${l.prefixTokens}-${a}-5)`,"--ptc-group-checkbox-bg-hover":`var(--${l.prefixTokens}-${a}-4)`,"--ptc-group-checkbox-bg-focus":`var(--${l.prefixTokens}-${a}-6)`,"--ptc-group-checkbox-br-focus":`var(--${l.prefixTokens}-${a}-6)`,"--ptc-group-checkbox-bg-active":`var(--${l.prefixTokens}-${a}-7)`}),[B,$]=h.createContext("CheckboxGroup"),D=e.defineComponent({...x.getComponentOptions("CheckboxGroup"),__name:"CheckboxGroup",props:{value:{},size:{},disabled:{type:Boolean},name:{},options:{}},emits:["update:value","change"],setup(a,{emit:m}){const c=m,t=a,s=e.ref(t.value??[]);e.watch(()=>t.value,()=>{s.value=t.value??[]});const u=e.computed({get(){return t.value?t.value:s.value},set(n){t.value||(s.value=n),c("update:value",n),c("change",n)}}),f=e.computed(()=>t.size),i=e.computed(()=>t.disabled?!0:void 0);return $({model:u,size:f,disabled:i}),(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.renderSlot(n.$slots,"default",{},()=>{var p;return[(p=n.options)!=null&&p.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.options,k=>(e.openBlock(),e.createBlock(z,e.mergeProps({key:k.value,ref_for:!0},k),null,16))),128)):e.createCommentVNode("",!0)]})]))}}),O=["for"],z=e.defineComponent({...x.getComponentOptions("Checkbox"),__name:"Checkbox",props:{size:{default:"xsm"},class:{},rootCls:{},indicatorCls:{},indeterminateCls:{},labelCls:{},label:{},value:{},id:{},valueAsLabel:{type:Boolean,default:!0},defaultChecked:{type:Boolean},checked:{type:[Boolean,String],default:void 0},disabled:{type:Boolean},required:{type:Boolean},name:{}},emits:["update:checked","change","blur","focus"],setup(a,{emit:m}){const c=r.getBemBlock("checkbox"),t=a,s=B({}),u=m,f=e.useSlots(),i=e.ref(t.checked??!1);e.watch(()=>t.checked,()=>{i.value=t.checked??!1});const n=e.computed({get(){var o;return(o=s.model)!=null&&o.value?t.value!==void 0&&s.model.value.includes(t.value):t.checked!==void 0?t.checked:i.value},set(o){var d;if((d=s.model)!=null&&d.value){if(t.value!==void 0){const v=s.model.value.indexOf(t.value);o&&v===-1?s.model.value=[...s.model.value,t.value]:!o&&v!==-1&&(s.model.value=s.model.value.filter(G=>G!==t.value))}}else t.checked===void 0&&(i.value=o),u("update:checked",o),u("change",o)}}),b=e.computed(()=>t.id??L.usePCId(c)),p=e.computed(()=>{var o;return{disabled:((o=s.disabled)==null?void 0:o.value)??t.disabled,...T.value,...P.omit(t,"size","class","label","disabled","checked","id","rootCls","indicatorCls","indeterminateCls","labelCls")}}),k=V.cva(c,{variants:{size:r.generateVariantClassList(g,c)}}),_=e.computed(()=>t.label||f.default||t.value&&t.valueAsLabel),y=e.computed(()=>{if(t.label)return t.label;if(t.value&&t.valueAsLabel)return t.value}),C=e.computed(()=>{var o;return((o=s.size)==null?void 0:o.value)??t.size}),q=e.computed(()=>{switch(C.value){case"xsm":return"2xsm";case"2xsm":default:return"3xsm"}}),{rootBindings:S,inputBindings:T}=I.UseInputDataStates({getDisabled:()=>{var o;return((o=s.disabled)==null?void 0:o.value)??t.disabled},emit:u}),E=()=>n.value=!n.value;return(o,d)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:[e.unref(r.getBemElement)(e.unref(c),"root"),o.rootCls]},e.unref(S)),[e.createVNode(e.unref(h.CheckboxRoot),e.mergeProps({onKeyup:e.withKeys(E,["enter"])},p.value,{checked:n.value,"onUpdate:checked":d[0]||(d[0]=v=>n.value=v),id:b.value,class:[e.unref(k)({size:C.value}),t.class]}),{default:e.withCtx(()=>[e.createVNode(e.unref(h.CheckboxIndicator),{class:e.normalizeClass([e.unref(r.getBemElement)(e.unref(c),"indicator"),o.indicatorCls]),asChild:""},{default:e.withCtx(()=>[t.checked!="indeterminate"?(e.openBlock(),e.createBlock(w._sfc_main,{key:0,icon:"tabler:check",size:q.value},null,8,["size"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([e.unref(r.getBemElement)(e.unref(c),"indeterminate"),o.indeterminateCls])},null,2))]),_:1},8,["class"])]),_:1},16,["checked","id","class"]),_.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:b.value,class:e.normalizeClass([e.unref(r.getBemElement)(e.unref(c),"label"),o.labelCls])},[e.renderSlot(o.$slots,"default",{checked:o.checked,disabled:o.disabled,required:o.required},()=>[e.createTextVNode(e.toDisplayString(y.value),1)])],10,O)):e.createCommentVNode("",!0)],16))}});exports.CheckboxSizes=g;exports._sfc_main=z;exports._sfc_main$1=D;exports.injectCheckboxGroupContext=B;exports.provideCheckboxGroupContext=$;exports.useColoredPantographCheckbox=N;exports.useColoredPantographCheckboxGroup=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Checkbox.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Checkbox.vue_vue_type_style_index_0_lang-pWUK1jtk.js");exports.CheckboxGroup=e._sfc_main$1;exports.injectCheckboxGroupContext=e.injectCheckboxGroupContext;exports.provideCheckboxGroupContext=e.provideCheckboxGroupContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorPicker.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorPicker.vue_vue_type_style_index_0_lang-BNdf9ydf.js");exports.ColorPicker=e._sfc_main;exports.default=e._sfc_main;exports.injectColorPickerContext=e.injectColorPickerContext;exports.provideColorPickerContext=e.provideColorPickerContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("vue"),ae=require("./ActionButton.vue_vue_type_script_setup_true_lang-Bno9iBJg.js"),U=require("./Input.vue_vue_type_style_index_0_lang-DVN491cI.js"),ie=require("./Icon.vue_vue_type_style_index_0_lang-BvHCdzZP.js"),j=require("@vueuse/core"),x=require("./class-CjZYGZDW.js"),fe=require("radix-vue");function A(e,t,r){return Math.max(t,Math.min(e,r))}function me(e,t){if(typeof e=="string"||typeof t=="string")return e===t;if(e){if(!t)return!1;for(const r in e)if(e[r]!==t[r])return!1}return!0}function H(e){const t=[],r=e.length>5?2:1;for(let n=1;n<e.length;n+=r){const c=e.substring(n,n+r).repeat(r%2+1),a=parseInt(c,16);t.push(n===3*r+1?a/255:a)}return t.length===3&&t.push(1),{r:t[0],g:t[1],b:t[2],a:t[3]}}function J(e){const t=e.l/100,r=t+e.s/100*Math.min(t,1-t),n=r===0?0:200*(1-t/r);return{h:e.h,s:n,v:r*100,a:e.a}}function L(e){let t=e.h%360;t<0&&(t+=360);const r=e.s/100,n=e.l/100;return{r:$(0,t,r,n)*255,g:$(8,t,r,n)*255,b:$(4,t,r,n)*255,a:e.a}}function $(e,t,r,n){const c=(e+t/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(c-3,9-c,1))}function Q(e){const t=e.s/100,r=e.v/100,n=r*(1-t/2);return{h:e.h,s:n===0||n===1?0:(r-n)/Math.min(n,1-n)*100,l:n*100,a:e.a}}function Z(e){return{h:e.h,w:e.v*(100-e.s)/100,b:100-e.v,a:e.a}}function N(e){return L(Q(e))}function k(e){const t=e.w/100,r=e.b/100;let n,c;const a=t+r;return a>=1?(n=0,c=t/a):(c=1-r,n=(1-t/c)*100),{h:e.h,s:n,v:c*100,a:e.a}}function I(e){const{r:t,g:r,b:n,a:c}=e,a=Math.min(t,r,n),h=Math.max(t,r,n),m=h-a,d=(h+a)/2;let v=0;m!==0&&(h===t?v=(r-n)/m+(r<n?6:0):h===r?v=(n-t)/m+2:h===n&&(v=(t-r)/m+4),v*=60);let b=0;return d!==0&&d!==255&&(b=(h-d)/Math.min(d,255-d)),{h:v,s:b*100,l:d/255*100,a:c}}function S(e){return"#"+Object.values(e).map((t,r)=>Math.round(r===3?t*255:t).toString(16).padStart(2,"0")).join("")}function M(e){return Z(J(I(e)))}const he={hex:{hex:e=>e,hsl:e=>I(H(e)),hsv:e=>k(M(H(e))),hwb:e=>M(H(e)),rgb:H},hsl:{hex:e=>S(L(e)),hsl:e=>e,hsv:J,hwb:e=>M(L(e)),rgb:L},hsv:{hex:e=>S(N(e)),hsl:Q,hsv:e=>e,hwb:Z,rgb:N},hwb:{hex:e=>S(N(k(e))),hsl:e=>I(N(k(e))),hsv:k,hwb:e=>e,rgb:e=>N(k(e))},rgb:{hex:S,hsl:I,hsv:e=>k(M(e)),hwb:M,rgb:e=>e}};function Y(e,t,r){return he[e][t](r)}function de(e,t){const r=e.toFixed(t);return r.includes(".")?r.replace(/\.?0+$/,""):r}const pe={deg:1,grad:.9,rad:180/Math.PI,turn:360},R={from(e){return e.endsWith("%")?E.from(e,{referenceValue:1}):y.from(e,{min:0,max:1})},to(e){return y.to(e)}},K={from(e){const t=e.match(/deg|g?rad|turn$/);if(t===null)return y.from(e);const r=t[0];return y.from(e.slice(0,-r.length))*pe[r]},to(e){return y.to(e)}},y={from(e,{min:t=Number.NEGATIVE_INFINITY,max:r=Number.POSITIVE_INFINITY}={}){return e.endsWith(".")?NaN:A(Number(e),t,r)},to(e){return de(e,2)}},E={from(e,{referenceValue:t=100,min:r=0,max:n=100}={}){return e.endsWith("%")?y.from(e.slice(0,-1),{min:r,max:n})*t/100:NaN},to(e){return y.to(e)+"%"}},z={from(e){return e.endsWith("%")?E.from(e,{referenceValue:255}):y.from(e,{min:0,max:255})},to(e){return y.to(e)}},ve={hsl:{h:K,s:E,l:E},hwb:{h:K,w:E,b:E},rgb:{r:z,g:z,b:z}};function F(e,t){return ve[e][t]}function O({format:e,color:t},r){if(e==="hex")return r&&[5,9].includes(t.length)?t.substring(0,t.length-(t.length-1)/4):t;const n=Object.entries(t).slice(0,r?3:4).map(([c,a])=>{const h=c==="a"?R:F(e,c);return(c==="a"?"/ ":"")+h.to(a)});return`${e}(${n.join(" ")})`}function ee(e){return/^#(?:(?:[A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(e)}function ge(e){return"r"in e?"rgb":"w"in e?"hwb":"v"in e?"hsv":"s"in e?"hsl":null}const G={hsl:["h","s","l","a"],hwb:["h","w","b","a"],rgb:["r","g","b","a"]};function X(e){if(!e)return null;if(typeof e!="string"){const m=ge(e);return m===null?null:{format:m,color:e}}if(e.startsWith("#"))return ee(e)?{format:"hex",color:e}:null;if(!e.includes("(")){const m=document.createElement("canvas").getContext("2d");m.fillStyle=e;const d=m.fillStyle;return d==="#000000"&&e!=="black"?null:{format:"hex",color:d}}const[t,r]=e.split("("),n=t.substring(0,3);if(!(n in G))return null;const c=r.replace(/[,/)]/g," ").replace(/\s+/g," ").trim().split(" ");c.length===3&&c.push("1");const a=G[n],h=Object.fromEntries(a.map((m,d)=>{const v=m==="a"?R:F(n,m);return[m,v.from(c[d])]}));return{format:n,color:h}}const be=typeof window<"u",te=be&&"EyeDropper"in window,we=e=>{const t=new AbortController;o.onUnmounted(()=>t.abort());async function r(){if(!te)return;const n=new window.EyeDropper;try{let a=(await n.open({signal:t.signal})).sRGBHex;if(a.startsWith("rgba")){const h=a.match(/rgba?\((?<r>\d+), (?<g>\d+), (?<b>\d+), (?<a>[\d.]+)\)/);if(h){const[m,d,v,b,i]=h;a=`rgba(${d}, ${v}, ${b}, ${parseFloat(i)===0?"1":i})`}}e(a)}catch(c){console.log("e ===>",c)}}return{openEyeDropper:r,abortController:t}};function ye(e,t,r){const n=e.getBoundingClientRect(),c=t-n.left,a=r-n.top;return{x:n.width===0?0:A(c/n.width*100,0,100),y:n.height===0?0:A((1-a/n.height)*100,0,100)}}const xe=o.defineComponent({__name:"ColorPickerSpace",setup(e){const t=ne();let r=!1,n;function c(i){n=document.body.style.userSelect,document.body.style.userSelect="none",r=!0,m(i)}function a(i){r=!0,d(i)}function h(){document.body.style.userSelect=n,r=!1}function m(i){i.buttons!==1||!r||!(t.colorSpace.value instanceof HTMLElement)||v(t.colorSpace.value,i.clientX,i.clientY)}function d(i){if(!r||!(t.colorSpace.value instanceof HTMLElement))return;i.preventDefault();const g=i.touches[0];v(t.colorSpace.value,g.clientX,g.clientY)}function v(i,g,_){const C=ye(i,g,_),f={...t.colors.hsv};f.s=C.x,f.v=C.y,t.setColor("hsv",f)}function b(i){if(!["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].includes(i.key))return;i.preventDefault();const g=["ArrowLeft","ArrowDown"].includes(i.key)?-1:1,_=["ArrowLeft","ArrowRight"].includes(i.key)?"s":"v",C=i.shiftKey?10:1,f=t.colors.hsv[_]+g*C,w={...t.colors.hsv};w[_]=A(f,0,100),t.setColor("hsv",w)}return o.onMounted(()=>{document.addEventListener("mousemove",m,{passive:!1}),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)}),o.onBeforeUnmount(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h)}),(i,g)=>(o.openBlock(),o.createElementBlock("div",{ref:o.unref(t).colorSpace,class:o.normalizeClass([o.unref(x.getBemElement)(o.unref(V),"space")]),onMousedown:c,onTouchstart:a},[o.createElementVNode("button",{ref:o.unref(t).thumb,class:o.normalizeClass([o.unref(x.getBemElement)(o.unref(V),"thumb")]),tabindex:"0","aria-label":"Color space thumb",onKeydown:b},null,34)],34))}}),Ce=["value"],_e=["value"],[ne,oe]=fe.createContext("ColorPicker"),V=x.getBemBlock("color_picker"),ke=o.defineComponent({__name:"ColorPicker",props:{class:{},color:{},defaultColor:{default:"#ffffffff"},format:{},defaultFormat:{default:"hex"},hideAlpha:{type:Boolean}},emits:["update:color","update:format","change"],setup(e,{emit:t}){const r=["hex","hsl","hsv","hwb","rgb"],n=e,c=t,a=o.ref(null),h=o.ref(null),m=o.ref(null),d=j.useVModel(n,"format",c,{defaultValue:n.defaultFormat,passive:n.format===void 0}),v=o.computed(()=>d.value&&r.includes(d.value)?d.value:"hex"),b=j.useVModel(n,"color",c,{defaultValue:n.defaultColor,passive:n.color===void 0}),i="#ffffffff",g=o.computed(()=>b.value??n.defaultColor??i);o.watch(g,D);const _=o.computed(()=>{const u=v.value,s=f[u];return u.split("").map(l=>{const p=s[l];return{value:F(u,l).to(p),channel:l,label:l.toUpperCase()}}).concat(n.hideAlpha?[]:[{value:R.to(s.a),channel:"a",label:"Alpha"}])}),C=o.computed({get(){return n.hideAlpha&&[5,9].includes(f.hex.length)?f.hex.substring(0,f.hex.length-(f.hex.length-1)/4):f.hex},set(u){ee(u)&&w("hex",u)}}),f=o.reactive({hex:i,hsl:{h:0,s:0,l:100,a:1},hsv:{h:0,s:0,v:100,a:1},hwb:{h:0,w:100,b:0,a:1},rgb:{r:255,g:255,b:255,a:1}});function w(u,s){let l=s;if(n.hideAlpha)if(typeof s!="string")s.a=1,l=s;else if([5,9].includes(s.length)){const p=(s.length-1)/4;l=s.substring(0,s.length-p)+"f".repeat(p)}else[4,7].includes(s.length)&&(l=s+"f".repeat((s.length-1)/3));if(!me(f[u],l)){f[u]=l;for(const p of r)p!==u&&(f[p]=Y(u,p,l));b.value=O({color:Y(u,v.value,l),format:v.value},n.hideAlpha),c("change",ue())}a.value instanceof HTMLElement&&h.value instanceof HTMLElement&&m.value instanceof HTMLElement&&le(a.value,h.value,m.value)}function D(u){const s=X(u);if(s!==null)w(s.format,s.color);else{const l=X(i);l!==null&&w(l.format,l.color)}}function re(u){d.value=u}function W(u,s){const l=u.currentTarget,p={...f.hsv};p[s]=Number(l.value),w("hsv",p)}function se(u,s){const l=v.value,p={...f[l]},P=(s==="a"?R:F(l,s)).from(u);Number.isNaN(u)||u===void 0||(p[s]=P,w(l,p))}function le(u,s,l){const p=O({format:"hsl",color:f.hsl},!0);u.style.setProperty("--vacp-color",p),s.style.position="relative",s.style.backgroundColor=`hsl(${f.hsl.h} 100% 50%)`,s.style.backgroundImage="linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)",l.style.boxSizing="border-box",l.style.position="absolute",l.style.left=`${f.hsv.s}%`,l.style.bottom=`${f.hsv.v}%`}function ue(){const u=O({color:f[v.value],format:v.value},n.hideAlpha);return{colors:f,cssColor:u}}function q(u){if(!["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].includes(u.key)||!u.shiftKey)return;const s=u.currentTarget,l=Number(s.step),p=["ArrowLeft","ArrowDown"].includes(u.key)?-1:1,T=Number(s.value)+p*l*10,P=A(T,Number(s.min),Number(s.max));s.value=String(P-p*l)}const{openEyeDropper:ce}=we(D);o.onMounted(()=>D(g.value)),oe({colorSpace:h,thumb:m,colors:f,setColor:w});const B=x.getBemElement(V,"slider");return(u,s)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"colorPicker",ref:a,class:o.normalizeClass([o.unref(V),n.class])},[o.createVNode(xe),o.createElementVNode("div",{class:o.normalizeClass(o.unref(x.getBemElement)(o.unref(V),"sliders"))},[o.createElementVNode("input",{class:o.normalizeClass([o.unref(B),o.unref(x.getBemModifier)(o.unref(B),"hue")]),value:f.hsv.h,type:"range",min:"0",max:"360",step:"1",onKeydownPassive:q,onInput:s[0]||(s[0]=l=>W(l,"h"))},null,42,Ce),u.hideAlpha?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("input",{key:0,class:o.normalizeClass([o.unref(B),o.unref(x.getBemModifier)(o.unref(B),"alpha")]),value:f.hsv.a,type:"range",min:"0",max:"1",step:"0.01",onKeydownPassive:q,onInput:s[1]||(s[1]=l=>W(l,"a"))},null,42,_e))],2),o.createElementVNode("div",{class:o.normalizeClass(o.unref(x.getBemElement)(o.unref(V),"inputs"))},[o.createElementVNode("button",{disabled:!0,class:"fake-select",onClick:s[2]||(s[2]=l=>re("rgb"))},[s[4]||(s[4]=o.createElementVNode("div",null,"Hex",-1)),o.createVNode(ie._sfc_main,{icon:"tabler:chevron-down",size:"2xsm",class:"fake-select-icon"})]),v.value==="hex"?(o.openBlock(),o.createBlock(U._sfc_main,{key:0,class:"flex-1",size:"sm",modelValue:C.value,"onUpdate:modelValue":s[3]||(s[3]=l=>C.value=l)},null,8,["modelValue"])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(_.value,({value:l,channel:p})=>(o.openBlock(),o.createBlock(U._sfc_main,{modelValue:l,"onUpdate:modelValue":T=>se(T,p),size:"sm"},null,8,["modelValue","onUpdate:modelValue"]))),256)),o.unref(te)?(o.openBlock(),o.createBlock(ae._sfc_main,{key:2,onClick:o.unref(ce),icon:"tabler:color-picker",size:"sm",type:"outline",variant:"icon"},null,8,["onClick"])):o.createCommentVNode("",!0)],2)],2))}});exports._sfc_main=ke;exports.injectColorPickerContext=ne;exports.provideColorPickerContext=oe;
|
|
1
|
+
"use strict";const o=require("vue"),ae=require("./ActionButton.vue_vue_type_script_setup_true_lang-B3fz9VlS.js"),U=require("./Input.vue_vue_type_style_index_0_lang-Bg1yMzU-.js"),ie=require("./Icon.vue_vue_type_style_index_0_lang-c9NvwoHi.js"),j=require("@vueuse/core"),x=require("./class-CjZYGZDW.js"),fe=require("radix-vue");function A(e,t,r){return Math.max(t,Math.min(e,r))}function me(e,t){if(typeof e=="string"||typeof t=="string")return e===t;if(e){if(!t)return!1;for(const r in e)if(e[r]!==t[r])return!1}return!0}function H(e){const t=[],r=e.length>5?2:1;for(let n=1;n<e.length;n+=r){const c=e.substring(n,n+r).repeat(r%2+1),a=parseInt(c,16);t.push(n===3*r+1?a/255:a)}return t.length===3&&t.push(1),{r:t[0],g:t[1],b:t[2],a:t[3]}}function J(e){const t=e.l/100,r=t+e.s/100*Math.min(t,1-t),n=r===0?0:200*(1-t/r);return{h:e.h,s:n,v:r*100,a:e.a}}function L(e){let t=e.h%360;t<0&&(t+=360);const r=e.s/100,n=e.l/100;return{r:$(0,t,r,n)*255,g:$(8,t,r,n)*255,b:$(4,t,r,n)*255,a:e.a}}function $(e,t,r,n){const c=(e+t/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(c-3,9-c,1))}function Q(e){const t=e.s/100,r=e.v/100,n=r*(1-t/2);return{h:e.h,s:n===0||n===1?0:(r-n)/Math.min(n,1-n)*100,l:n*100,a:e.a}}function Z(e){return{h:e.h,w:e.v*(100-e.s)/100,b:100-e.v,a:e.a}}function N(e){return L(Q(e))}function k(e){const t=e.w/100,r=e.b/100;let n,c;const a=t+r;return a>=1?(n=0,c=t/a):(c=1-r,n=(1-t/c)*100),{h:e.h,s:n,v:c*100,a:e.a}}function I(e){const{r:t,g:r,b:n,a:c}=e,a=Math.min(t,r,n),h=Math.max(t,r,n),m=h-a,d=(h+a)/2;let v=0;m!==0&&(h===t?v=(r-n)/m+(r<n?6:0):h===r?v=(n-t)/m+2:h===n&&(v=(t-r)/m+4),v*=60);let b=0;return d!==0&&d!==255&&(b=(h-d)/Math.min(d,255-d)),{h:v,s:b*100,l:d/255*100,a:c}}function S(e){return"#"+Object.values(e).map((t,r)=>Math.round(r===3?t*255:t).toString(16).padStart(2,"0")).join("")}function M(e){return Z(J(I(e)))}const he={hex:{hex:e=>e,hsl:e=>I(H(e)),hsv:e=>k(M(H(e))),hwb:e=>M(H(e)),rgb:H},hsl:{hex:e=>S(L(e)),hsl:e=>e,hsv:J,hwb:e=>M(L(e)),rgb:L},hsv:{hex:e=>S(N(e)),hsl:Q,hsv:e=>e,hwb:Z,rgb:N},hwb:{hex:e=>S(N(k(e))),hsl:e=>I(N(k(e))),hsv:k,hwb:e=>e,rgb:e=>N(k(e))},rgb:{hex:S,hsl:I,hsv:e=>k(M(e)),hwb:M,rgb:e=>e}};function Y(e,t,r){return he[e][t](r)}function de(e,t){const r=e.toFixed(t);return r.includes(".")?r.replace(/\.?0+$/,""):r}const pe={deg:1,grad:.9,rad:180/Math.PI,turn:360},R={from(e){return e.endsWith("%")?E.from(e,{referenceValue:1}):y.from(e,{min:0,max:1})},to(e){return y.to(e)}},K={from(e){const t=e.match(/deg|g?rad|turn$/);if(t===null)return y.from(e);const r=t[0];return y.from(e.slice(0,-r.length))*pe[r]},to(e){return y.to(e)}},y={from(e,{min:t=Number.NEGATIVE_INFINITY,max:r=Number.POSITIVE_INFINITY}={}){return e.endsWith(".")?NaN:A(Number(e),t,r)},to(e){return de(e,2)}},E={from(e,{referenceValue:t=100,min:r=0,max:n=100}={}){return e.endsWith("%")?y.from(e.slice(0,-1),{min:r,max:n})*t/100:NaN},to(e){return y.to(e)+"%"}},z={from(e){return e.endsWith("%")?E.from(e,{referenceValue:255}):y.from(e,{min:0,max:255})},to(e){return y.to(e)}},ve={hsl:{h:K,s:E,l:E},hwb:{h:K,w:E,b:E},rgb:{r:z,g:z,b:z}};function F(e,t){return ve[e][t]}function O({format:e,color:t},r){if(e==="hex")return r&&[5,9].includes(t.length)?t.substring(0,t.length-(t.length-1)/4):t;const n=Object.entries(t).slice(0,r?3:4).map(([c,a])=>{const h=c==="a"?R:F(e,c);return(c==="a"?"/ ":"")+h.to(a)});return`${e}(${n.join(" ")})`}function ee(e){return/^#(?:(?:[A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(e)}function ge(e){return"r"in e?"rgb":"w"in e?"hwb":"v"in e?"hsv":"s"in e?"hsl":null}const G={hsl:["h","s","l","a"],hwb:["h","w","b","a"],rgb:["r","g","b","a"]};function X(e){if(!e)return null;if(typeof e!="string"){const m=ge(e);return m===null?null:{format:m,color:e}}if(e.startsWith("#"))return ee(e)?{format:"hex",color:e}:null;if(!e.includes("(")){const m=document.createElement("canvas").getContext("2d");m.fillStyle=e;const d=m.fillStyle;return d==="#000000"&&e!=="black"?null:{format:"hex",color:d}}const[t,r]=e.split("("),n=t.substring(0,3);if(!(n in G))return null;const c=r.replace(/[,/)]/g," ").replace(/\s+/g," ").trim().split(" ");c.length===3&&c.push("1");const a=G[n],h=Object.fromEntries(a.map((m,d)=>{const v=m==="a"?R:F(n,m);return[m,v.from(c[d])]}));return{format:n,color:h}}const be=typeof window<"u",te=be&&"EyeDropper"in window,we=e=>{const t=new AbortController;o.onUnmounted(()=>t.abort());async function r(){if(!te)return;const n=new window.EyeDropper;try{let a=(await n.open({signal:t.signal})).sRGBHex;if(a.startsWith("rgba")){const h=a.match(/rgba?\((?<r>\d+), (?<g>\d+), (?<b>\d+), (?<a>[\d.]+)\)/);if(h){const[m,d,v,b,i]=h;a=`rgba(${d}, ${v}, ${b}, ${parseFloat(i)===0?"1":i})`}}e(a)}catch(c){console.log("e ===>",c)}}return{openEyeDropper:r,abortController:t}};function ye(e,t,r){const n=e.getBoundingClientRect(),c=t-n.left,a=r-n.top;return{x:n.width===0?0:A(c/n.width*100,0,100),y:n.height===0?0:A((1-a/n.height)*100,0,100)}}const xe=o.defineComponent({__name:"ColorPickerSpace",setup(e){const t=ne();let r=!1,n;function c(i){n=document.body.style.userSelect,document.body.style.userSelect="none",r=!0,m(i)}function a(i){r=!0,d(i)}function h(){document.body.style.userSelect=n,r=!1}function m(i){i.buttons!==1||!r||!(t.colorSpace.value instanceof HTMLElement)||v(t.colorSpace.value,i.clientX,i.clientY)}function d(i){if(!r||!(t.colorSpace.value instanceof HTMLElement))return;i.preventDefault();const g=i.touches[0];v(t.colorSpace.value,g.clientX,g.clientY)}function v(i,g,_){const C=ye(i,g,_),f={...t.colors.hsv};f.s=C.x,f.v=C.y,t.setColor("hsv",f)}function b(i){if(!["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].includes(i.key))return;i.preventDefault();const g=["ArrowLeft","ArrowDown"].includes(i.key)?-1:1,_=["ArrowLeft","ArrowRight"].includes(i.key)?"s":"v",C=i.shiftKey?10:1,f=t.colors.hsv[_]+g*C,w={...t.colors.hsv};w[_]=A(f,0,100),t.setColor("hsv",w)}return o.onMounted(()=>{document.addEventListener("mousemove",m,{passive:!1}),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)}),o.onBeforeUnmount(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h)}),(i,g)=>(o.openBlock(),o.createElementBlock("div",{ref:o.unref(t).colorSpace,class:o.normalizeClass([o.unref(x.getBemElement)(o.unref(V),"space")]),onMousedown:c,onTouchstart:a},[o.createElementVNode("button",{ref:o.unref(t).thumb,class:o.normalizeClass([o.unref(x.getBemElement)(o.unref(V),"thumb")]),tabindex:"0","aria-label":"Color space thumb",onKeydown:b},null,34)],34))}}),Ce=["value"],_e=["value"],[ne,oe]=fe.createContext("ColorPicker"),V=x.getBemBlock("color_picker"),ke=o.defineComponent({__name:"ColorPicker",props:{class:{},color:{},defaultColor:{default:"#ffffffff"},format:{},defaultFormat:{default:"hex"},hideAlpha:{type:Boolean}},emits:["update:color","update:format","change"],setup(e,{emit:t}){const r=["hex","hsl","hsv","hwb","rgb"],n=e,c=t,a=o.ref(null),h=o.ref(null),m=o.ref(null),d=j.useVModel(n,"format",c,{defaultValue:n.defaultFormat,passive:n.format===void 0}),v=o.computed(()=>d.value&&r.includes(d.value)?d.value:"hex"),b=j.useVModel(n,"color",c,{defaultValue:n.defaultColor,passive:n.color===void 0}),i="#ffffffff",g=o.computed(()=>b.value??n.defaultColor??i);o.watch(g,D);const _=o.computed(()=>{const u=v.value,s=f[u];return u.split("").map(l=>{const p=s[l];return{value:F(u,l).to(p),channel:l,label:l.toUpperCase()}}).concat(n.hideAlpha?[]:[{value:R.to(s.a),channel:"a",label:"Alpha"}])}),C=o.computed({get(){return n.hideAlpha&&[5,9].includes(f.hex.length)?f.hex.substring(0,f.hex.length-(f.hex.length-1)/4):f.hex},set(u){ee(u)&&w("hex",u)}}),f=o.reactive({hex:i,hsl:{h:0,s:0,l:100,a:1},hsv:{h:0,s:0,v:100,a:1},hwb:{h:0,w:100,b:0,a:1},rgb:{r:255,g:255,b:255,a:1}});function w(u,s){let l=s;if(n.hideAlpha)if(typeof s!="string")s.a=1,l=s;else if([5,9].includes(s.length)){const p=(s.length-1)/4;l=s.substring(0,s.length-p)+"f".repeat(p)}else[4,7].includes(s.length)&&(l=s+"f".repeat((s.length-1)/3));if(!me(f[u],l)){f[u]=l;for(const p of r)p!==u&&(f[p]=Y(u,p,l));b.value=O({color:Y(u,v.value,l),format:v.value},n.hideAlpha),c("change",ue())}a.value instanceof HTMLElement&&h.value instanceof HTMLElement&&m.value instanceof HTMLElement&&le(a.value,h.value,m.value)}function D(u){const s=X(u);if(s!==null)w(s.format,s.color);else{const l=X(i);l!==null&&w(l.format,l.color)}}function re(u){d.value=u}function W(u,s){const l=u.currentTarget,p={...f.hsv};p[s]=Number(l.value),w("hsv",p)}function se(u,s){const l=v.value,p={...f[l]},P=(s==="a"?R:F(l,s)).from(u);Number.isNaN(u)||u===void 0||(p[s]=P,w(l,p))}function le(u,s,l){const p=O({format:"hsl",color:f.hsl},!0);u.style.setProperty("--vacp-color",p),s.style.position="relative",s.style.backgroundColor=`hsl(${f.hsl.h} 100% 50%)`,s.style.backgroundImage="linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)",l.style.boxSizing="border-box",l.style.position="absolute",l.style.left=`${f.hsv.s}%`,l.style.bottom=`${f.hsv.v}%`}function ue(){const u=O({color:f[v.value],format:v.value},n.hideAlpha);return{colors:f,cssColor:u}}function q(u){if(!["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].includes(u.key)||!u.shiftKey)return;const s=u.currentTarget,l=Number(s.step),p=["ArrowLeft","ArrowDown"].includes(u.key)?-1:1,T=Number(s.value)+p*l*10,P=A(T,Number(s.min),Number(s.max));s.value=String(P-p*l)}const{openEyeDropper:ce}=we(D);o.onMounted(()=>D(g.value)),oe({colorSpace:h,thumb:m,colors:f,setColor:w});const B=x.getBemElement(V,"slider");return(u,s)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"colorPicker",ref:a,class:o.normalizeClass([o.unref(V),n.class])},[o.createVNode(xe),o.createElementVNode("div",{class:o.normalizeClass(o.unref(x.getBemElement)(o.unref(V),"sliders"))},[o.createElementVNode("input",{class:o.normalizeClass([o.unref(B),o.unref(x.getBemModifier)(o.unref(B),"hue")]),value:f.hsv.h,type:"range",min:"0",max:"360",step:"1",onKeydownPassive:q,onInput:s[0]||(s[0]=l=>W(l,"h"))},null,42,Ce),u.hideAlpha?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("input",{key:0,class:o.normalizeClass([o.unref(B),o.unref(x.getBemModifier)(o.unref(B),"alpha")]),value:f.hsv.a,type:"range",min:"0",max:"1",step:"0.01",onKeydownPassive:q,onInput:s[1]||(s[1]=l=>W(l,"a"))},null,42,_e))],2),o.createElementVNode("div",{class:o.normalizeClass(o.unref(x.getBemElement)(o.unref(V),"inputs"))},[o.createElementVNode("button",{disabled:!0,class:"fake-select",onClick:s[2]||(s[2]=l=>re("rgb"))},[s[4]||(s[4]=o.createElementVNode("div",null,"Hex",-1)),o.createVNode(ie._sfc_main,{icon:"tabler:chevron-down",size:"2xsm",class:"fake-select-icon"})]),v.value==="hex"?(o.openBlock(),o.createBlock(U._sfc_main,{key:0,class:"flex-1",size:"sm",modelValue:C.value,"onUpdate:modelValue":s[3]||(s[3]=l=>C.value=l)},null,8,["modelValue"])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(_.value,({value:l,channel:p})=>(o.openBlock(),o.createBlock(U._sfc_main,{modelValue:l,"onUpdate:modelValue":T=>se(T,p),size:"sm"},null,8,["modelValue","onUpdate:modelValue"]))),256)),o.unref(te)?(o.openBlock(),o.createBlock(ae._sfc_main,{key:2,onClick:o.unref(ce),icon:"tabler:color-picker",size:"sm",type:"outline",variant:"icon"},null,8,["onClick"])):o.createCommentVNode("",!0)],2)],2))}});exports._sfc_main=ke;exports.injectColorPickerContext=ne;exports.provideColorPickerContext=oe;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { onUnmounted as we, defineComponent as ue, onMounted as ae, onBeforeUnmount as ye, createElementBlock as D, openBlock as C, normalizeClass as T, unref as v, createElementVNode as E, ref as j, computed as R, watch as xe, reactive as Ce, createVNode as Q, createCommentVNode as Z, createBlock as Y, Fragment as Te, renderList as Ve } from "vue";
|
|
2
|
-
import { _ as ke } from "./ActionButton.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { _ as ee } from "./Input.vue_vue_type_style_index_0_lang-
|
|
4
|
-
import { _ as Ee } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
2
|
+
import { _ as ke } from "./ActionButton.vue_vue_type_script_setup_true_lang-48AXc54q.js";
|
|
3
|
+
import { _ as ee } from "./Input.vue_vue_type_style_index_0_lang-CfRRpkAQ.js";
|
|
4
|
+
import { _ as Ee } from "./Icon.vue_vue_type_style_index_0_lang-BVVc15Aa.js";
|
|
5
5
|
import { useVModel as te } from "@vueuse/core";
|
|
6
6
|
import { b as P, g as Me, c as ne } from "./class-DziTeW9B.js";
|
|
7
7
|
import { createContext as _e } from "radix-vue";
|
|
@@ -21,8 +21,8 @@ declare function __VLS_template(): {
|
|
|
21
21
|
};
|
|
22
22
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
23
|
declare const __VLS_component: import('vue').DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {
|
|
24
|
-
size: "sm" | "md";
|
|
25
24
|
type: ColorSwatchType;
|
|
25
|
+
size: "sm" | "md";
|
|
26
26
|
customPickerIcon: string;
|
|
27
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as s, C as r, a as t, _ as e } from "../ColorSwatch.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as s, C as r, a as t, _ as e } from "../ColorSwatch.vue_vue_type_style_index_0_lang-DmWOViyT.js";
|
|
2
2
|
export {
|
|
3
3
|
s as ColorSwatch,
|
|
4
4
|
r as ColorSwatchSizes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorSwatch.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorSwatch.vue_vue_type_style_index_0_lang-DWbErEeg.js");exports.ColorSwatch=e._sfc_main;exports.ColorSwatchSizes=e.ColorSwatchSizes;exports.ColorSwatchTypes=e.ColorSwatchTypes;exports.default=e._sfc_main;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),v=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-CshbWnRl.js"),k=require("./options-B4iSAKol.js"),_=require("./omit-C4BrcXKG.js"),r=require("./class-CjZYGZDW.js"),C=require("class-variance-authority"),f=require("./IconButton.vue_vue_type_script_setup_true_lang-CWqrQ22L.js"),c=["sm","md"],l=["color","remover","custom-picker"],h={key:1,height:"100%",width:"100%",viewBox:"0 0 19 18",fill:"none"},z=e.defineComponent({...k.getComponentOptions("ColorTrigger"),__name:"ColorSwatch",props:{class:{},icon:{},flipOnDir:{},fg:{},bg:{},br:{},size:{default:"md"},selected:{type:Boolean},type:{default:"color"},customPickerIcon:{default:"tabler:palette"}},setup(p){const o=p,s=r.getBemBlock("color_swatch"),u=C.cva(s,{variants:{selected:r.generateVariantClassList("selected",s),size:r.generateVariantClassList(c,s),type:r.generateVariantClassList(l,s)}}),n=e.computed(()=>o.size&&c.includes(o.size)?o.size:"md"),m=e.computed(()=>({size:n.value,..._.omit(o,"size","class","type","selected")})),d=e.useSlots(),y=e.computed(()=>{switch(o.type){case"color":return"div";case"custom-picker":return f._sfc_main;case"remover":return"div"}}),g=e.computed(()=>{const t={};return o.type==="custom-picker"&&(t.size=n.value,t.icon=o.customPickerIcon,t.color="gray",t.type="outline"),t});return(t,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y.value),e.mergeProps({class:[e.unref(u)({selected:t.type!=="custom-picker"&&o.selected,size:t.size,type:t.type}),o.class]},g.value),{icon:e.withCtx(()=>[e.renderSlot(t.$slots,"icon",e.normalizeProps(e.guardReactiveProps(o)))]),default:e.withCtx(()=>[t.type==="color"?(e.openBlock(),e.createBlock(v._sfc_main,e.normalizeProps(e.mergeProps({key:0},m.value)),e.createSlots({_:2},[e.renderList(Object.keys(d),a=>({name:a,fn:e.withCtx(()=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(o)))])}))]),1040)):t.type==="remover"?(e.openBlock(),e.createElementBlock("svg",h,i[0]||(i[0]=[e.createElementVNode("path",{id:"Empty Indicator",d:"M17.5 1L1.5 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]))):e.createCommentVNode("",!0),t.type==="custom-picker"?e.renderSlot(t.$slots,"default",e.normalizeProps(e.mergeProps({key:2},o))):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});exports.ColorSwatchSizes=c;exports.ColorSwatchTypes=l;exports._sfc_main=z;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as B, computed as s, useSlots as S, createBlock as d, openBlock as
|
|
2
|
-
import { _ as L } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { g as
|
|
4
|
-
import { o as
|
|
5
|
-
import { g as
|
|
6
|
-
import { cva as
|
|
7
|
-
import { _ as
|
|
8
|
-
const g = ["sm", "md"],
|
|
1
|
+
import { defineComponent as B, computed as s, useSlots as S, createBlock as d, openBlock as n, resolveDynamicComponent as _, mergeProps as c, unref as P, withCtx as i, createElementBlock as b, createCommentVNode as f, renderSlot as a, normalizeProps as r, createSlots as $, renderList as E, guardReactiveProps as y, createElementVNode as I } from "vue";
|
|
2
|
+
import { _ as L } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-D0vD57ET.js";
|
|
3
|
+
import { g as O } from "./options-JBqnVZUl.js";
|
|
4
|
+
import { o as V } from "./omit-Beooz3Dl.js";
|
|
5
|
+
import { g as D, a as l } from "./class-DziTeW9B.js";
|
|
6
|
+
import { cva as N } from "class-variance-authority";
|
|
7
|
+
import { _ as T } from "./IconButton.vue_vue_type_script_setup_true_lang-CruPwQ16.js";
|
|
8
|
+
const g = ["sm", "md"], j = ["color", "remover", "custom-picker"], M = {
|
|
9
9
|
key: 1,
|
|
10
10
|
height: "100%",
|
|
11
11
|
width: "100%",
|
|
12
12
|
viewBox: "0 0 19 18",
|
|
13
13
|
fill: "none"
|
|
14
14
|
}, K = /* @__PURE__ */ B({
|
|
15
|
-
...
|
|
15
|
+
...O("ColorTrigger"),
|
|
16
16
|
__name: "ColorSwatch",
|
|
17
17
|
props: {
|
|
18
18
|
class: {},
|
|
19
19
|
icon: {},
|
|
20
|
+
flipOnDir: {},
|
|
20
21
|
fg: {},
|
|
21
22
|
bg: {},
|
|
22
23
|
br: {},
|
|
@@ -26,17 +27,17 @@ const g = ["sm", "md"], D = ["color", "remover", "custom-picker"], M = {
|
|
|
26
27
|
customPickerIcon: { default: "tabler:palette" }
|
|
27
28
|
},
|
|
28
29
|
setup(k) {
|
|
29
|
-
const o = k, t =
|
|
30
|
+
const o = k, t = D("color_swatch"), v = N(t, {
|
|
30
31
|
variants: {
|
|
31
32
|
selected: l("selected", t),
|
|
32
33
|
size: l(g, t),
|
|
33
|
-
type: l(
|
|
34
|
+
type: l(j, t)
|
|
34
35
|
}
|
|
35
|
-
}),
|
|
36
|
+
}), p = s(
|
|
36
37
|
() => o.size && g.includes(o.size) ? o.size : "md"
|
|
37
38
|
), z = s(() => ({
|
|
38
|
-
size:
|
|
39
|
-
...
|
|
39
|
+
size: p.value,
|
|
40
|
+
...V(
|
|
40
41
|
o,
|
|
41
42
|
"size",
|
|
42
43
|
"class",
|
|
@@ -49,15 +50,15 @@ const g = ["sm", "md"], D = ["color", "remover", "custom-picker"], M = {
|
|
|
49
50
|
case "color":
|
|
50
51
|
return "div";
|
|
51
52
|
case "custom-picker":
|
|
52
|
-
return
|
|
53
|
+
return T;
|
|
53
54
|
case "remover":
|
|
54
55
|
return "div";
|
|
55
56
|
}
|
|
56
57
|
}), w = s(() => {
|
|
57
58
|
const e = {};
|
|
58
|
-
return o.type === "custom-picker" && (e.size =
|
|
59
|
+
return o.type === "custom-picker" && (e.size = p.value, e.icon = o.customPickerIcon, e.color = "gray", e.type = "outline"), e;
|
|
59
60
|
});
|
|
60
|
-
return (e,
|
|
61
|
+
return (e, m) => (n(), d(_(h.value), c({
|
|
61
62
|
class: [
|
|
62
63
|
P(v)({
|
|
63
64
|
selected: e.type !== "custom-picker" && o.selected,
|
|
@@ -71,14 +72,14 @@ const g = ["sm", "md"], D = ["color", "remover", "custom-picker"], M = {
|
|
|
71
72
|
a(e.$slots, "icon", r(y(o)))
|
|
72
73
|
]),
|
|
73
74
|
default: i(() => [
|
|
74
|
-
e.type === "color" ? (
|
|
75
|
+
e.type === "color" ? (n(), d(L, r(c({ key: 0 }, z.value)), $({ _: 2 }, [
|
|
75
76
|
E(Object.keys(C), (u) => ({
|
|
76
77
|
name: u,
|
|
77
78
|
fn: i(() => [
|
|
78
79
|
a(e.$slots, u, r(y(o)))
|
|
79
80
|
])
|
|
80
81
|
}))
|
|
81
|
-
]), 1040)) : e.type === "remover" ? (
|
|
82
|
+
]), 1040)) : e.type === "remover" ? (n(), b("svg", M, m[0] || (m[0] = [
|
|
82
83
|
I("path", {
|
|
83
84
|
id: "Empty Indicator",
|
|
84
85
|
d: "M17.5 1L1.5 17",
|
|
@@ -87,7 +88,7 @@ const g = ["sm", "md"], D = ["color", "remover", "custom-picker"], M = {
|
|
|
87
88
|
"stroke-linecap": "round"
|
|
88
89
|
}, null, -1)
|
|
89
90
|
]))) : f("", !0),
|
|
90
|
-
e.type === "custom-picker" ? a(e.$slots, "default", r(
|
|
91
|
+
e.type === "custom-picker" ? a(e.$slots, "default", r(c({ key: 2 }, o))) : f("", !0)
|
|
91
92
|
]),
|
|
92
93
|
_: 3
|
|
93
94
|
}, 16, ["class"]));
|
|
@@ -96,5 +97,5 @@ const g = ["sm", "md"], D = ["color", "remover", "custom-picker"], M = {
|
|
|
96
97
|
export {
|
|
97
98
|
g as C,
|
|
98
99
|
K as _,
|
|
99
|
-
|
|
100
|
+
j as a
|
|
100
101
|
};
|