@pantograph/vue 0.28.0 → 0.28.2
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/index.js +1 -1
- package/dist/ActionButton/index.umd.cjs +1 -1
- package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-C0xZ6m49.js → ActionButton.vue_vue_type_script_setup_true_lang-B58mCIDb.js} +1 -1
- package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-CyCrRVTK.js → ActionButton.vue_vue_type_script_setup_true_lang-Dd2-pYUT.js} +1 -1
- package/dist/Alert/index.js +1 -1
- package/dist/Alert/index.umd.cjs +1 -1
- package/dist/{Alert.vue_vue_type_style_index_0_lang-Dh2G44fS.js → Alert.vue_vue_type_style_index_0_lang-CAX3NQfW.js} +1 -1
- package/dist/{Alert.vue_vue_type_style_index_0_lang-_hTeoKJU.js → Alert.vue_vue_type_style_index_0_lang-CDmiw-No.js} +1 -1
- package/dist/Avatar/Avatar.d.ts +2 -0
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar/index.umd.cjs +1 -1
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-D_SXlwkT.js → Avatar.vue_vue_type_style_index_0_lang-BKqLMGIV.js} +56 -55
- package/dist/Avatar.vue_vue_type_style_index_0_lang-BY1eF6-d.js +1 -0
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/AvatarGroup/index.umd.cjs +1 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-D2WO6pVz.js +1 -0
- package/dist/{BaseButton.vue_vue_type_style_index_0_lang-D2cKm_bz.js → BaseButton.vue_vue_type_style_index_0_lang-QDColA3Q.js} +23 -20
- package/dist/Button/index.js +1 -1
- package/dist/Button/index.umd.cjs +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-CrVAgpiG.js → Button.vue_vue_type_script_setup_true_lang-DQ2-TroH.js} +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-De3yMf4x.js → Button.vue_vue_type_script_setup_true_lang-DVzErXxg.js} +1 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts +6 -13
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonGroup/index.umd.cjs +1 -1
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-9R8RwIc-.js +1 -0
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-CJQAJRHk.js +57 -0
- package/dist/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Checkbox/index.js +1 -1
- package/dist/Checkbox/index.umd.cjs +1 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-9avqxpeP.js +1 -0
- package/dist/{Checkbox.vue_vue_type_style_index_0_lang-DoCCVxxa.js → Checkbox.vue_vue_type_style_index_0_lang-BOJNThUz.js} +71 -70
- package/dist/CheckboxGroup/index.js +1 -1
- package/dist/CheckboxGroup/index.umd.cjs +1 -1
- package/dist/Chip/Chip.d.ts +2 -0
- package/dist/Chip/index.js +1 -1
- package/dist/Chip/index.umd.cjs +1 -1
- package/dist/Chip.vue_vue_type_style_index_0_lang-By6XfEP4.js +1 -0
- package/dist/Chip.vue_vue_type_style_index_0_lang-ChpNdGGi.js +212 -0
- package/dist/ChipGroup/index.js +1 -1
- package/dist/ChipGroup/index.umd.cjs +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ColorPicker/index.umd.cjs +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-C1ED1wUI.js → ColorPicker.vue_vue_type_style_index_0_lang-B7dGfThP.js} +2 -2
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-CeigXw6s.js → ColorPicker.vue_vue_type_style_index_0_lang-DIRCDxKf.js} +1 -1
- package/dist/ColorSwatch/index.js +1 -1
- package/dist/ColorSwatch/index.umd.cjs +1 -1
- package/dist/{ColorSwatch-B_ppanPj.js → ColorSwatch--yfIrKW6.js} +1 -1
- package/dist/{ColorSwatch-CHLKl-fv.js → ColorSwatch-Bm4Di1MW.js} +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-UDZgDNhI.js → ColorSwatch.vue_vue_type_style_index_0_lang-BdcJgZOU.js} +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-C-nnAfDb.js → ColorSwatch.vue_vue_type_style_index_0_lang-Bx4uQ2xB.js} +1 -1
- package/dist/ColorSwatchGroup/index.js +1 -1
- package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-GxsDdWAE.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-CCsHoBii.js} +2 -2
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-D2HxdxgJ.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-DMJ78NIH.js} +1 -1
- package/dist/Combobox/Combobox.d.ts +2 -2
- package/dist/Combobox/index.js +1 -1
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/Combobox/types.d.ts +1 -1
- package/dist/Combobox.vue_vue_type_style_index_0_lang-Df2a52vJ.js +1 -0
- package/dist/Combobox.vue_vue_type_style_index_0_lang-Dz3b5KT0.js +1130 -0
- package/dist/Comment/Comment.d.ts +6 -1
- package/dist/Comment/CommentEditor.d.ts +16 -296
- package/dist/Comment/CommentFileList.d.ts +2 -0
- package/dist/Comment/CommentMention.d.ts +10 -10
- package/dist/Comment/index.js +334 -312
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/DataTable/index.js +1 -1
- package/dist/DataTable/index.umd.cjs +1 -1
- package/dist/{DataTable.vue_vue_type_style_index_0_lang-D3bUDHDD.js → DataTable.vue_vue_type_style_index_0_lang-C0rFGm6z.js} +8 -7
- package/dist/DataTable.vue_vue_type_style_index_0_lang-DgqSk7Yr.js +1 -0
- package/dist/DropZone/index.js +1 -1
- package/dist/DropZone/index.umd.cjs +1 -1
- package/dist/{DropZone.vue_vue_type_style_index_0_lang-DY2CfU4s.js → DropZone.vue_vue_type_style_index_0_lang-CTIzH7sl.js} +1 -1
- package/dist/{DropZone.vue_vue_type_style_index_0_lang-ClY42FKh.js → DropZone.vue_vue_type_style_index_0_lang-lzDvfWK_.js} +1 -1
- package/dist/FloatButton/index.js +1 -1
- package/dist/FloatButton/index.umd.cjs +1 -1
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-93Z6n8ML.js → FloatButton.vue_vue_type_script_setup_true_lang-CxxpozWM.js} +1 -1
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-D6sOckSj.js → FloatButton.vue_vue_type_script_setup_true_lang-D14UFHEA.js} +1 -1
- package/dist/GOPicker/index.js +1 -1
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-ymr7zTCT.js → GOPicker.vue_vue_type_style_index_0_lang-GG3UoK9I.js} +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-BYuk9Ta8.js → GOPicker.vue_vue_type_style_index_0_lang-nrryxeQq.js} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/IconButton/index.umd.cjs +1 -1
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-Duk4aN8-.js → IconButton.vue_vue_type_script_setup_true_lang-BHP9OGT0.js} +1 -1
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-BUIJKHGa.js → IconButton.vue_vue_type_script_setup_true_lang-BmqsHwgy.js} +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/Menu/index.umd.cjs +1 -1
- package/dist/MenuItem/MenuItem.d.ts +4 -1
- package/dist/MenuItem/index.js +1 -1
- package/dist/MenuItem/index.umd.cjs +1 -1
- package/dist/MenuItem.vue_vue_type_style_index_0_lang-BE56NdMb.js +1 -0
- package/dist/{MenuItem.vue_vue_type_style_index_0_lang-DD8kfks-.js → MenuItem.vue_vue_type_style_index_0_lang-CW-70qfj.js} +192 -189
- package/dist/Pagination/index.js +1 -1
- package/dist/Pagination/index.umd.cjs +1 -1
- package/dist/{Pagination.vue_vue_type_style_index_0_lang-BCtSnM0p.js → Pagination.vue_vue_type_style_index_0_lang-CQ_E2g4L.js} +1 -1
- package/dist/{Pagination.vue_vue_type_style_index_0_lang-BPqz0l4L.js → Pagination.vue_vue_type_style_index_0_lang-zo_9zmac.js} +1 -1
- package/dist/ScrollContainer/index.js +1 -1
- package/dist/ScrollContainer/index.umd.cjs +1 -1
- package/dist/ScrollContainer.vue_vue_type_style_index_0_lang-CanbeDed.js +1 -0
- package/dist/{ScrollContainer.vue_vue_type_style_index_0_lang-uN8OhXm4.js → ScrollContainer.vue_vue_type_style_index_0_lang-CzUFQ8vU.js} +29 -29
- package/dist/Select/index.js +1 -1
- package/dist/Select/index.umd.cjs +1 -1
- package/dist/{Select.vue_vue_type_style_index_0_lang-FNin5p3N.js → Select.vue_vue_type_style_index_0_lang-DnqLUNf5.js} +24 -24
- package/dist/Select.vue_vue_type_style_index_0_lang-nm65VAKf.js +1 -0
- package/dist/SubMenu/SubMenu.d.ts +2 -0
- package/dist/SubMenu/index.js +1 -1
- package/dist/SubMenu/index.umd.cjs +1 -1
- package/dist/{TabContent.vue_vue_type_script_setup_true_lang-oU5diNub.js → TabContent.vue_vue_type_script_setup_true_lang-BDgE6XJO.js} +1 -1
- package/dist/{TabContent.vue_vue_type_script_setup_true_lang-BTJvJkMW.js → TabContent.vue_vue_type_script_setup_true_lang-C8Ms0E-d.js} +2 -2
- package/dist/Tabs/index.js +1 -1
- package/dist/Tabs/index.umd.cjs +1 -1
- package/dist/Textarea/Textarea.d.ts +2 -582
- package/dist/Textarea/index.d.ts +1 -1
- package/dist/Textarea/index.js +1 -1
- package/dist/Textarea/index.umd.cjs +1 -1
- package/dist/Textarea.vue_vue_type_style_index_0_lang-BTRLsidO.js +118 -0
- package/dist/Textarea.vue_vue_type_style_index_0_lang-Ox5GgXqZ.js +1 -0
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/index.umd.cjs +1 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-CzL-skk8.js +1 -0
- package/dist/{Tree.vue_vue_type_style_index_0_lang-BFHerbO8.js → Tree.vue_vue_type_style_index_0_lang-EGhpYqca.js} +95 -94
- package/dist/Upload/Upload.d.ts +2 -2
- package/dist/Upload/UploadList.d.ts +2 -2
- package/dist/Upload/index.d.ts +1 -0
- package/dist/Upload/index.js +15 -14
- package/dist/Upload/index.umd.cjs +1 -1
- package/dist/{Upload.vue_vue_type_style_index_0_lang-CNL2WWLb.js → Upload.vue_vue_type_style_index_0_lang-DIBLYxag.js} +1 -1
- package/dist/{Upload.vue_vue_type_style_index_0_lang-zNnaGyQW.js → Upload.vue_vue_type_style_index_0_lang-DQiIPST1.js} +11 -10
- package/dist/index.js +46 -45
- package/dist/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/package.json +1 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-DFFrnopY.js +0 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-BghRlm-s.js +0 -1
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-DGuzTQhm.js +0 -58
- package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-aMsUnJ9c.js +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_lang-B9bgtU46.js +0 -1
- package/dist/Chip.vue_vue_type_style_index_0_lang-B0bD8fOk.js +0 -1
- package/dist/Chip.vue_vue_type_style_index_0_lang-kxWOoU3I.js +0 -210
- package/dist/Combobox.vue_vue_type_style_index_0_lang-CFQPY_5A.js +0 -1
- package/dist/Combobox.vue_vue_type_style_index_0_lang-R4jyjKx0.js +0 -1124
- package/dist/DataTable.vue_vue_type_style_index_0_lang-Ix_14tDu.js +0 -1
- package/dist/MenuItem.vue_vue_type_style_index_0_lang-BnzgoZlS.js +0 -1
- package/dist/ScrollContainer.vue_vue_type_style_index_0_lang-oFYBYAHr.js +0 -1
- package/dist/Select.vue_vue_type_style_index_0_lang-DxySmS5O.js +0 -1
- package/dist/Textarea.vue_vue_type_style_index_0_lang-De3Hf7KF.js +0 -167
- package/dist/Textarea.vue_vue_type_style_index_0_lang-i_ao8fj2.js +0 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-DabHAmO4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ActionButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ActionButton.vue_vue_type_script_setup_true_lang-Dd2-pYUT.js");exports.ActionButton=e._sfc_main;exports.default=e._sfc_main;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as c, useAttrs as l, computed as f, ref as m, createBlock as u, openBlock as d, mergeProps as b, createSlots as y, renderList as g, withCtx as B, renderSlot as _, normalizeProps as v, guardReactiveProps as I } from "vue";
|
|
2
2
|
import { omit as O } from "es-toolkit";
|
|
3
|
-
import { _ as h } from "./BaseButton.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import { _ as h } from "./BaseButton.vue_vue_type_style_index_0_lang-QDColA3Q.js";
|
|
4
4
|
import { getComponentOptions as k } from "@pantograph/utils-vue";
|
|
5
5
|
const F = /* @__PURE__ */ c({
|
|
6
6
|
...k("ActionButton", !1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),p=require("es-toolkit"),u=require("./BaseButton.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";const e=require("vue"),p=require("es-toolkit"),u=require("./BaseButton.vue_vue_type_style_index_0_lang-D2WO6pVz.js"),_=require("@pantograph/utils-vue"),f=e.defineComponent({..._.getComponentOptions("ActionButton",!1),__name:"ActionButton",props:{as:{},class:{},text:{},size:{},noRing:{type:Boolean},loading:{type:Boolean},active:{type:Boolean},badgeText:{},badgeIcon:{},icon:{},preIcon:{},postIcon:{},flipOnDir:{},preIconFlipOnDir:{},postIconFlipOnDir:{},badgeIconFlipOnDir:{},htmlType:{},block:{type:Boolean},disabled:{type:Boolean,default:void 0},hover:{type:Boolean},href:{},target:{},type:{},variant:{}},setup(r,{expose:s}){const i=r,a=e.useAttrs(),c=e.computed(()=>({...p.omit(a,["color","type","variant","action"]),...i})),o=e.ref();return s({focus(){var t;(t=o.value)==null||t.focus()},blur(){var t;(t=o.value)==null||t.blur()}}),(t,d)=>(e.openBlock(),e.createBlock(u._sfc_main,e.mergeProps(c.value,{action:"",ref_key:"buttonRef",ref:o}),e.createSlots({_:2},[e.renderList(Object.keys(t.$slots),n=>({name:n,fn:e.withCtx(l=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(l)))])}))]),1040))}});exports._sfc_main=f;
|
package/dist/Alert/index.js
CHANGED
package/dist/Alert/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Alert.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Alert.vue_vue_type_style_index_0_lang-CAX3NQfW.js");exports.Alert=e._sfc_main;exports.AlertTypes=e.AlertTypes;exports.default=e._sfc_main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),l=require("@pantograph/utils"),C=require("class-variance-authority"),g=require("@pantograph/utils-vue"),y=require("./IconButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";const e=require("vue"),l=require("@pantograph/utils"),C=require("class-variance-authority"),g=require("@pantograph/utils-vue"),y=require("./IconButton.vue_vue_type_script_setup_true_lang-BHP9OGT0.js"),B=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-B1yA0-fJ.js"),k=require("./Link.vue_vue_type_style_index_0_lang-CZKJpHXw.js"),i=["info","success","danger","warning","hint"],b=e.defineComponent({...g.getComponentOptions("Alert"),__name:"Alert",props:{type:{default:"hint"},closeable:{type:Boolean},class:{},icon:{},iconCls:{},bodyCls:{},closeableCls:{},fg:{},br:{},bg:{},title:{},titleCls:{},description:{},descriptionCls:{},link:{type:Boolean},linkProps:{}},emits:["close"],setup(c,{emit:u}){const r=c,m=u,n=l.getBemBlock("alert"),p=C.cva(n,{variants:{type:l.generateVariantClassList(i,n)}}),o=e.useSlots(),d={success:"tabler:circle-check",warning:"tabler:alert-triangle",danger:"tabler:circle-x",hint:"tabler:bulb",info:"tabler:info-circle"},s=e.computed(()=>r.icon??d[r.type]);return(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(p)({type:t.type}),r.class)),style:e.normalizeStyle({"--ptc-alert-fg":t.fg,"--ptc-alert-bg":t.bg,"--ptc-alert-br":t.br})},[o.icon||s.value?(e.openBlock(),e.createBlock(B._sfc_main,{key:0,size:"md",icon:s.value,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(n),"icon"),t.iconCls))},e.createSlots({_:2},[o.icon?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"icon")]),key:"0"}:void 0]),1032,["icon","class"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(n),"body"),t.bodyCls))},[e.renderSlot(t.$slots,"default",{},()=>[t.title||o.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(n),"title"),t.titleCls,"paragraph"))},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),t.description||o.description?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(n),"description"),t.descriptionCls,"paragraph"))},[e.renderSlot(t.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)])],2)):e.createCommentVNode("",!0),t.link||o.link?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(n),"action"))},[e.renderSlot(t.$slots,"link",{},()=>[e.createVNode(e.unref(k._sfc_main),e.normalizeProps(e.guardReactiveProps(t.linkProps)),null,16)])],2)):e.createCommentVNode("",!0)])],2),r.closeable||o.closeable?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(n),"closeable"),t.closeableCls))},[e.renderSlot(t.$slots,"closeable",{},()=>[e.createVNode(y._sfc_main,{icon:"tabler:x",color:"neutral",type:"ghost",onClick:a[0]||(a[0]=f=>m("close",f))})])],2)):e.createCommentVNode("",!0)],6))}});exports.AlertTypes=i;exports._sfc_main=b;
|
|
@@ -2,7 +2,7 @@ import { defineComponent as h, useSlots as S, computed as V, createElementBlock
|
|
|
2
2
|
import { getBemBlock as T, generateVariantClassList as D, normCls as r, getBemElement as a } from "@pantograph/utils";
|
|
3
3
|
import { cva as L } from "class-variance-authority";
|
|
4
4
|
import { getComponentOptions as M } from "@pantograph/utils-vue";
|
|
5
|
-
import { _ as O } from "./IconButton.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as O } from "./IconButton.vue_vue_type_script_setup_true_lang-BmqsHwgy.js";
|
|
6
6
|
import { _ as R } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-CeT1O_S8.js";
|
|
7
7
|
import { _ as j } from "./Link.vue_vue_type_style_index_0_lang-C9Cgyex5.js";
|
|
8
8
|
const q = ["info", "success", "danger", "warning", "hint"], W = /* @__PURE__ */ h({
|
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface AvatarProps extends Omit<AvatarImageProps, 'asChild' | 'as' | '
|
|
|
10
10
|
stroke?: AvatarStroke;
|
|
11
11
|
shape?: AvatarShape;
|
|
12
12
|
online?: boolean;
|
|
13
|
+
unExtendParent?: boolean;
|
|
13
14
|
alt?: string;
|
|
14
15
|
fallback?: string;
|
|
15
16
|
text?: string;
|
|
@@ -37,6 +38,7 @@ declare const __VLS_component: import('vue').DefineComponent<AvatarProps, {}, {}
|
|
|
37
38
|
shape: AvatarShape;
|
|
38
39
|
src: string;
|
|
39
40
|
onlineColor: BadgeColor;
|
|
41
|
+
unExtendParent: boolean;
|
|
40
42
|
onlineAlignment: AvatarOnlineAlignment;
|
|
41
43
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
42
44
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
package/dist/Avatar/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as t, c as r, b as e, A, a as v, _ as n } from "../Avatar.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as t, c as r, b as e, A, a as v, _ as n } from "../Avatar.vue_vue_type_style_index_0_lang-BKqLMGIV.js";
|
|
2
2
|
export {
|
|
3
3
|
t as Avatar,
|
|
4
4
|
r as AvatarOnlineAlignments,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Avatar.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Avatar.vue_vue_type_style_index_0_lang-BY1eF6-d.js");exports.Avatar=e._sfc_main;exports.AvatarOnlineAlignments=e.AvatarOnlineAlignments;exports.AvatarShapes=e.AvatarShapes;exports.AvatarSizes=e.AvatarSizes;exports.AvatarStrokes=e.AvatarStrokes;exports.default=e._sfc_main;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as O, useSlots as F, computed as
|
|
1
|
+
import { defineComponent as O, useSlots as F, computed as o, createElementBlock as y, openBlock as c, normalizeClass as v, unref as t, createVNode as I, h as x, createBlock as A, withCtx as B, createCommentVNode as _, Fragment as R, mergeProps as T, renderSlot as b, createTextVNode as $, toDisplayString as w } from "vue";
|
|
2
2
|
import { createContext as H, useEmitAsProps as J, AvatarRoot as K, AvatarImage as Q, AvatarFallback as U } from "reka-ui";
|
|
3
|
-
import { getBemBlock as j, getBemElement as f, generateVariantClassList as d, normCls as
|
|
3
|
+
import { getBemBlock as j, getBemElement as f, generateVariantClassList as d, normCls as P } from "@pantograph/utils";
|
|
4
4
|
import { cva as q } from "class-variance-authority";
|
|
5
5
|
import { getComponentOptions as D, flattenChildren as W } from "@pantograph/utils-vue";
|
|
6
6
|
import { _ as X } from "./HoverCard.vue_vue_type_style_index_0_lang-DJYtpCcR.js";
|
|
@@ -20,21 +20,21 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
20
20
|
noPopover: { type: Boolean }
|
|
21
21
|
},
|
|
22
22
|
setup(C) {
|
|
23
|
-
const
|
|
23
|
+
const a = C, g = F(), r = o(() => a.size), s = o(() => a.shape), S = j("avatar"), h = f(S, "group"), z = q(h, {
|
|
24
24
|
variants: {
|
|
25
25
|
gutter: d("gutter", h)
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
te({
|
|
29
|
-
size:
|
|
30
|
-
shape:
|
|
29
|
+
size: r,
|
|
30
|
+
shape: s
|
|
31
31
|
});
|
|
32
|
-
const
|
|
32
|
+
const n = o(() => a.maxCount ? Number(a.maxCount) : 0), i = o(
|
|
33
33
|
() => z({
|
|
34
|
-
gutter:
|
|
34
|
+
gutter: a.gutter
|
|
35
35
|
})
|
|
36
|
-
), m =
|
|
37
|
-
switch (
|
|
36
|
+
), m = o(() => {
|
|
37
|
+
switch (a.size) {
|
|
38
38
|
case "2xsm":
|
|
39
39
|
case "xsm":
|
|
40
40
|
case "sm":
|
|
@@ -46,35 +46,35 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
46
46
|
return "md";
|
|
47
47
|
}
|
|
48
48
|
}), k = () => {
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
...
|
|
52
|
-
|
|
49
|
+
const l = W(g.default ? g.default() : []), p = () => x(se, { text: `+${l.length - n.value}` });
|
|
50
|
+
return n.value >= 1 && l.length > n.value ? [
|
|
51
|
+
...l.filter((e, u) => u < n.value),
|
|
52
|
+
a.noPopover ? p() : x(
|
|
53
53
|
X,
|
|
54
54
|
{
|
|
55
55
|
size: m.value,
|
|
56
|
-
...
|
|
56
|
+
...a.popoverProps ?? {}
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
default: p,
|
|
60
60
|
content: () => x(
|
|
61
61
|
"div",
|
|
62
|
-
{ class:
|
|
62
|
+
{ class: P(i.value, a.class) },
|
|
63
63
|
{
|
|
64
|
-
default: () =>
|
|
64
|
+
default: () => l.filter((e, u) => u >= n.value)
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
}
|
|
68
68
|
)
|
|
69
|
-
] :
|
|
69
|
+
] : l;
|
|
70
70
|
};
|
|
71
|
-
return (
|
|
72
|
-
class: v(t(
|
|
71
|
+
return (l, p) => (c(), y("div", {
|
|
72
|
+
class: v(t(P)(i.value, a.class))
|
|
73
73
|
}, [
|
|
74
|
-
I(k, { maxCount:
|
|
74
|
+
I(k, { maxCount: l.maxCount }, null, 8, ["maxCount"])
|
|
75
75
|
], 2));
|
|
76
76
|
}
|
|
77
|
-
}),
|
|
77
|
+
}), E = ["2xsm", "xsm", "sm", "md", "lg", "xlg"], G = ["gray", "white"], N = ["circle", "square", "rect"], V = {
|
|
78
78
|
start: "online-start",
|
|
79
79
|
end: "online-end"
|
|
80
80
|
}, se = /* @__PURE__ */ O({
|
|
@@ -88,6 +88,7 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
88
88
|
stroke: {},
|
|
89
89
|
shape: { default: "circle" },
|
|
90
90
|
online: { type: Boolean },
|
|
91
|
+
unExtendParent: { type: Boolean, default: !1 },
|
|
91
92
|
alt: {},
|
|
92
93
|
fallback: {},
|
|
93
94
|
text: {},
|
|
@@ -98,38 +99,38 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
98
99
|
delayMs: {}
|
|
99
100
|
},
|
|
100
101
|
emits: ["loadingStatusChange"],
|
|
101
|
-
setup(C, { emit:
|
|
102
|
-
const g = F(),
|
|
102
|
+
setup(C, { emit: a }) {
|
|
103
|
+
const g = F(), r = j("avatar"), s = C, h = J(a), z = q(r, {
|
|
103
104
|
variants: {
|
|
104
|
-
size: d(
|
|
105
|
-
stroke: d(
|
|
106
|
-
shape: d(
|
|
105
|
+
size: d(E, r),
|
|
106
|
+
stroke: d(G, r),
|
|
107
|
+
shape: d(N, r),
|
|
107
108
|
onlineAlignment: d(
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
V,
|
|
110
|
+
r
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
|
-
}),
|
|
113
|
-
size:
|
|
114
|
-
shape:
|
|
115
|
-
}),
|
|
116
|
-
const e =
|
|
113
|
+
}), n = s.unExtendParent ? void 0 : ee({
|
|
114
|
+
size: o(() => s.size),
|
|
115
|
+
shape: o(() => s.shape)
|
|
116
|
+
}), i = o(() => (n == null ? void 0 : n.size.value) ?? s.size), m = o(() => (n == null ? void 0 : n.shape.value) ?? s.shape), k = o(() => {
|
|
117
|
+
const e = i.value && E.includes(i.value) ? i.value : "md", u = s.stroke && G.includes(s.stroke) ? s.stroke : "none", L = m.value && N.includes(m.value) ? m.value : "circle", M = V[s.onlineAlignment] ? s.onlineAlignment : "start";
|
|
117
118
|
return {
|
|
118
119
|
size: e,
|
|
119
120
|
stroke: u,
|
|
120
121
|
shape: L,
|
|
121
122
|
onlineAlignment: M
|
|
122
123
|
};
|
|
123
|
-
}),
|
|
124
|
-
switch (
|
|
124
|
+
}), l = o(() => {
|
|
125
|
+
switch (i.value) {
|
|
125
126
|
case "lg":
|
|
126
127
|
case "xlg":
|
|
127
128
|
return "tiny";
|
|
128
129
|
default:
|
|
129
130
|
return "tinier";
|
|
130
131
|
}
|
|
131
|
-
}), p =
|
|
132
|
-
switch (
|
|
132
|
+
}), p = o(() => {
|
|
133
|
+
switch (i.value) {
|
|
133
134
|
case "lg":
|
|
134
135
|
case "xlg":
|
|
135
136
|
return "sm";
|
|
@@ -142,23 +143,23 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
142
143
|
return "xsm";
|
|
143
144
|
}
|
|
144
145
|
});
|
|
145
|
-
return (e, u) => (
|
|
146
|
+
return (e, u) => (c(), A(t(K), {
|
|
146
147
|
as: "div",
|
|
147
|
-
class: v(t(
|
|
148
|
+
class: v(t(P)(t(z)(k.value), s.class))
|
|
148
149
|
}, {
|
|
149
|
-
default:
|
|
150
|
-
!g.default && !e.text ? (
|
|
151
|
-
e.src ? (
|
|
150
|
+
default: B(() => [
|
|
151
|
+
!g.default && !e.text ? (c(), y(R, { key: 0 }, [
|
|
152
|
+
e.src ? (c(), A(t(Q), T({ key: 0 }, t(h), {
|
|
152
153
|
src: e.src,
|
|
153
154
|
alt: e.alt,
|
|
154
|
-
class: t(f)(t(
|
|
155
|
+
class: t(f)(t(r), "image")
|
|
155
156
|
}), null, 16, ["src", "alt", "class"])) : _("", !0),
|
|
156
157
|
I(t(U), {
|
|
157
|
-
class: v(t(f)(t(
|
|
158
|
+
class: v(t(f)(t(r), "fallback"))
|
|
158
159
|
}, {
|
|
159
|
-
default:
|
|
160
|
+
default: B(() => [
|
|
160
161
|
b(e.$slots, "fallback", {}, () => [
|
|
161
|
-
e.fallback ? _("", !0) : (
|
|
162
|
+
e.fallback ? _("", !0) : (c(), A(t(Y), {
|
|
162
163
|
key: 0,
|
|
163
164
|
icon: e.icon,
|
|
164
165
|
size: p.value
|
|
@@ -168,19 +169,19 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
168
169
|
]),
|
|
169
170
|
_: 3
|
|
170
171
|
}, 8, ["class"])
|
|
171
|
-
], 64)) : (
|
|
172
|
+
], 64)) : (c(), y("span", {
|
|
172
173
|
key: 1,
|
|
173
|
-
class: v(t(f)(t(
|
|
174
|
+
class: v(t(f)(t(r), "image"))
|
|
174
175
|
}, [
|
|
175
176
|
b(e.$slots, "default", {}, () => [
|
|
176
177
|
$(w(e.text), 1)
|
|
177
178
|
])
|
|
178
179
|
], 2)),
|
|
179
|
-
e.online ? (
|
|
180
|
+
e.online ? (c(), A(Z, {
|
|
180
181
|
key: 2,
|
|
181
182
|
color: e.onlineColor,
|
|
182
|
-
size:
|
|
183
|
-
class: v(t(f)(t(
|
|
183
|
+
size: l.value,
|
|
184
|
+
class: v(t(f)(t(r), "online"))
|
|
184
185
|
}, null, 8, ["color", "size", "class"])) : _("", !0)
|
|
185
186
|
]),
|
|
186
187
|
_: 3
|
|
@@ -188,11 +189,11 @@ const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
|
188
189
|
}
|
|
189
190
|
});
|
|
190
191
|
export {
|
|
191
|
-
|
|
192
|
+
E as A,
|
|
192
193
|
se as _,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
G as a,
|
|
195
|
+
N as b,
|
|
196
|
+
V as c,
|
|
196
197
|
pe as d,
|
|
197
198
|
ee as i,
|
|
198
199
|
te as p
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),p=require("reka-ui"),a=require("@pantograph/utils"),x=require("class-variance-authority"),_=require("@pantograph/utils-vue"),q=require("./HoverCard.vue_vue_type_style_index_0_lang-CQw5rAAp.js");require("./Popover.vue_vue_type_style_index_0_lang-DQJCWgtP.js");const b=require("./Icon.vue_vue_type_style_index_0_lang-Df7xWWKv.js"),N=require("./Indicator.vue_vue_type_script_setup_true_lang-lWlckYfr.js"),[y,S]=p.createContext("AvatarGroup"),G=e.defineComponent({..._.getComponentOptions("AvatarGroup"),__name:"AvatarGroup",props:{class:{},gutter:{type:Boolean},size:{},shape:{},popoverProps:{},maxCount:{},noPopover:{type:Boolean}},setup(f){const n=f,v=e.useSlots(),o=e.computed(()=>n.size),s=e.computed(()=>n.shape),g=a.getBemBlock("avatar"),d=a.getBemElement(g,"group"),C=x.cva(d,{variants:{gutter:a.generateVariantClassList("gutter",d)}});S({size:o,shape:s});const r=e.computed(()=>n.maxCount?Number(n.maxCount):0),c=e.computed(()=>C({gutter:n.gutter})),i=e.computed(()=>{switch(n.size){case"2xsm":case"xsm":case"sm":return"sm";case"lg":case"xlg":return"lg";default:return"md"}}),k=()=>{const l=_.flattenChildren(v.default?v.default():[]),m=()=>e.h(V,{text:`+${l.length-r.value}`});return r.value>=1&&l.length>r.value?[...l.filter((t,u)=>u<r.value),n.noPopover?m():e.h(q._sfc_main,{size:i.value,...n.popoverProps??{}},{default:m,content:()=>e.h("div",{class:a.normCls(c.value,n.class)},{default:()=>l.filter((t,u)=>u>=r.value)})})]:l};return(l,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a.normCls)(c.value,n.class))},[e.createVNode(k,{maxCount:l.maxCount},null,8,["maxCount"])],2))}}),A=["2xsm","xsm","sm","md","lg","xlg"],h=["gray","white"],z=["circle","square","rect"],B={start:"online-start",end:"online-end"},V=e.defineComponent({..._.getComponentOptions("Avatar"),__name:"Avatar",props:{src:{default:""},class:{},onlineColor:{default:"lime"},size:{default:"md"},stroke:{},shape:{default:"circle"},online:{type:Boolean},unExtendParent:{type:Boolean,default:!1},alt:{},fallback:{},text:{},icon:{default:"tabler:user"},onlineAlignment:{default:"start"},referrerPolicy:{},crossOrigin:{},delayMs:{}},emits:["loadingStatusChange"],setup(f,{emit:n}){const v=e.useSlots(),o=a.getBemBlock("avatar"),s=f,g=n,d=p.useEmitAsProps(g),C=x.cva(o,{variants:{size:a.generateVariantClassList(A,o),stroke:a.generateVariantClassList(h,o),shape:a.generateVariantClassList(z,o),onlineAlignment:a.generateVariantClassList(B,o)}}),r=s.unExtendParent?void 0:y({size:e.computed(()=>s.size),shape:e.computed(()=>s.shape)}),c=e.computed(()=>(r==null?void 0:r.size.value)??s.size),i=e.computed(()=>(r==null?void 0:r.shape.value)??s.shape),k=e.computed(()=>{const t=c.value&&A.includes(c.value)?c.value:"md",u=s.stroke&&h.includes(s.stroke)?s.stroke:"none",P=i.value&&z.includes(i.value)?i.value:"circle",E=B[s.onlineAlignment]?s.onlineAlignment:"start";return{size:t,stroke:u,shape:P,onlineAlignment:E}}),l=e.computed(()=>{switch(c.value){case"lg":case"xlg":return"tiny";default:return"tinier"}}),m=e.computed(()=>{switch(c.value){case"lg":case"xlg":return"sm";case"xsm":case"2xsm":return"3xsm";case"sm":case"md":default:return"xsm"}});return(t,u)=>(e.openBlock(),e.createBlock(e.unref(p.AvatarRoot),{as:"div",class:e.normalizeClass(e.unref(a.normCls)(e.unref(C)(k.value),s.class))},{default:e.withCtx(()=>[!v.default&&!t.text?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.src?(e.openBlock(),e.createBlock(e.unref(p.AvatarImage),e.mergeProps({key:0},e.unref(d),{src:t.src,alt:t.alt,class:e.unref(a.getBemElement)(e.unref(o),"image")}),null,16,["src","alt","class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(p.AvatarFallback),{class:e.normalizeClass(e.unref(a.getBemElement)(e.unref(o),"fallback"))},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"fallback",{},()=>[t.fallback?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,icon:t.icon,size:m.value},null,8,["icon","size"])),e.createTextVNode(" "+e.toDisplayString(t.fallback),1)])]),_:3},8,["class"])],64)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a.getBemElement)(e.unref(o),"image"))},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])],2)),t.online?(e.openBlock(),e.createBlock(N._sfc_main,{key:2,color:t.onlineColor,size:l.value,class:e.normalizeClass(e.unref(a.getBemElement)(e.unref(o),"online"))},null,8,["color","size","class"])):e.createCommentVNode("",!0)]),_:3},8,["class"]))}});exports.AvatarOnlineAlignments=B;exports.AvatarShapes=z;exports.AvatarSizes=A;exports.AvatarStrokes=h;exports._sfc_main=V;exports._sfc_main$1=G;exports.injectAvatarGroupContext=y;exports.provideAvatarGroupContext=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../Avatar.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../Avatar.vue_vue_type_style_index_0_lang-BY1eF6-d.js");exports.AvatarGroup=t._sfc_main$1;exports.injectAvatarGroupContext=t.injectAvatarGroupContext;exports.provideAvatarGroupContext=t.provideAvatarGroupContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),B=require("./Icon.vue_vue_type_style_index_0_lang-Df7xWWKv.js"),N=require("./Spinner.vue_vue_type_style_index_0_lang-CxxeJ0kY.js"),$=require("./Badge.vue_vue_type_script_setup_true_lang-DWxSrLnd.js"),G=require("reka-ui"),s=require("./ButtonGroup.vue_vue_type_script_setup_true_lang-9R8RwIc-.js"),i=require("@pantograph/utils"),A=require("./ConfigProvider.vue_vue_type_script_setup_true_lang-Dn5qxQ1y.js"),I=require("@pantograph/utils-vue"),j=require("class-variance-authority"),a=i.getBemBlock("button"),x=j.cva(a,{variants:{size:i.generateVariantClassList(s.ButtonSizes,a),type:i.generateVariantClassList(s.ButtonTypes,a),color:i.generateVariantClassList(s.ButtonColors,a),variant:i.generateVariantClassList(s.ButtonVariants,a),action:i.generateVariantClassList("action",a),active:i.generateVariantClassList("active",a),text:i.generateVariantClassList("text",a),preIcon:i.generateVariantClassList("preIcon",a),postIcon:i.generateVariantClassList("postIcon",a),loading:i.generateVariantClassList("loading",a),block:i.generateVariantClassList("block",a),noRing:i.generateVariantClassList("no-ring",a)}}),K=e.defineComponent({...I.getComponentOptions("BaseButton"),__name:"BaseButton",props:{as:{},class:{},text:{},size:{},color:{default:"primary"},noRing:{type:Boolean},type:{default:"fill"},variant:{},loading:{type:Boolean},action:{type:Boolean},active:{type:Boolean},badgeText:{},badgeIcon:{},icon:{},preIcon:{},postIcon:{},flipOnDir:{},preIconFlipOnDir:{},postIconFlipOnDir:{},badgeIconFlipOnDir:{},htmlType:{default:"button"},block:{type:Boolean},disabled:{type:Boolean,default:void 0},hover:{type:Boolean},href:{},target:{}},emits:["click"],setup(z,{expose:V,emit:D}){const t=z,{getFlipOnDir:p}=A.useConfig(),S=p("flipOnDir"),O=p("preIconFlipOnDir"),T=p("postIconFlipOnDir"),L=p("badgeIconFlipOnDir"),y=s.injectButtonGroupContext({}),d=e.computed(()=>{var n;return t.variant??((n=y.props)==null?void 0:n.variant)??"simple"}),r=e.computed(()=>["icon","float"].includes(d.value)||(o.icon||t.icon)&&!(t.text||o.default||t.preIcon||o.preIcon||t.postIcon||o.postIcon)),o=e.useSlots(),{getDisabled:g,getSize:v}=I.useFormInput({getSize:()=>{var n;return t.size??((n=y.props)==null?void 0:n.size)}}),q=e.computed(()=>{let n=s.ButtonTypes.includes(t.type)?t.type:"fill";const l=v.value,f=l&&s.ButtonSizes.includes(l)?l:"md";let c=t.color&&s.ButtonColors.includes(t.color)?t.color:"primary",u=d.value&&s.ButtonVariants.includes(d.value)?d.value:"simple";return t.action?((u==="float"||r.value)&&(u="icon"),n==="fill"&&(n="outline"),c=void 0):u==="float"&&(n==="ghost"&&(n="fill"),["primary","neutral"].includes(c)||(c="primary")),{size:f,type:n,color:c,variant:u,action:!!t.action,active:!!t.active,loading:!!t.loading,block:!!t.block,noRing:!!t.noRing,text:!r.value&&!!(t.text||o.default),preIcon:!r.value&&!!(t.preIcon||o.preIcon),postIcon:!r.value&&!!(t.postIcon||o.postIcon)}}),m=e.computed(()=>{switch(v.value){case"lg":return"sm";case"sm":return"2xsm";default:return"xsm"}}),F=e.computed(()=>{switch(v.value){case"sm":return"3xsm";case"lg":return"xsm";case"md":default:return"2xsm"}}),b="2xsm",k=e.ref(0),C=e.computed(()=>t.as?t.as:t.href?"a":"button");e.watch(C,()=>{k.value++});const P=e.computed(()=>{const n={disabled:g.value};return t.href&&(n.href=t.href,n.target=t.target),t.htmlType&&(n.type=t.htmlType),t.hover&&(n["data-hover"]=""),n}),_=e.ref();V({focus(){var n;(n=_.value)==null||n.focus()},blur(){var n;(n=_.value)==null||n.blur()}});const w=D,R=n=>{if(t.loading||t.disabled){n.preventDefault(),n.stopPropagation();return}w("click",n)};e.computed(()=>t.action&&t.active&&!r.value&&(t.badgeText||o.badgeText||t.badgeIcon||o.badgeIcon||o.badge));const E=()=>{var n,l,f;if(t.action&&t.active&&!r.value){const c=(n=o.badge)==null?void 0:n.call(o,{color:g.value?"gray":"primary",size:b});if(!I.isEmptyElement(c))return c;const u=(l=o.badgeText)==null?void 0:l.call(o,{}),h=(f=o.badgeIcon)==null?void 0:f.call(o,{});if(t.badgeText||u||t.badgeIcon||h)return e.h($._sfc_main,{text:t.badgeText,icon:t.badgeIcon,flipOnDir:L.value,color:g.value?"gray":"primary",size:b},{default:u?o.badgeText:void 0,icon:h?o.badgeIcon:void 0})}return null};return(n,l)=>(e.openBlock(),e.createBlock(e.unref(G.Primitive),e.mergeProps({as:C.value,key:String(k.value),class:e.unref(i.normCls)(e.unref(x)(q.value),t.class),ref_key:"buttonRef",ref:_},P.value,{onClick:R}),{default:e.withCtx(()=>[n.loading?(e.openBlock(),e.createBlock(N._sfc_main,{key:1,class:e.normalizeClass(e.unref(i.getBemElement)(e.unref(a),"loading")),size:m.value},null,8,["class","size"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(n.preIcon||o.preIcon)&&!r.value?(e.openBlock(),e.createBlock(B._sfc_main,{key:0,flipOnDir:e.unref(O),icon:n.preIcon,size:m.value},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"preIcon")]),_:3},8,["flipOnDir","icon","size"])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(B._sfc_main,{key:1,icon:n.icon,size:F.value,flipOnDir:e.unref(S)},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"icon")]),_:3},8,["icon","size","flipOnDir"])):e.renderSlot(n.$slots,"default",{key:2},()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),e.createVNode(E),(n.postIcon||o.postIcon)&&!r.value?(e.openBlock(),e.createBlock(B._sfc_main,{key:3,flipOnDir:e.unref(T),icon:n.postIcon,size:m.value},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"postIcon")]),_:3},8,["flipOnDir","icon","size"])):e.createCommentVNode("",!0)],64))]),_:3},16,["as","class"]))}});exports._sfc_main=K;exports.buttonPrefix=a;exports.buttonVariantsClass=x;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as M, computed as
|
|
1
|
+
import { defineComponent as M, computed as l, useSlots as Q, ref as T, watch as U, createBlock as f, openBlock as u, unref as r, mergeProps as W, withCtx as v, createElementBlock as X, Fragment as Y, createCommentVNode as C, renderSlot as I, createVNode as Z, createTextVNode as ee, toDisplayString as oe, normalizeClass as te, h as ne } from "vue";
|
|
2
2
|
import { _ as h } from "./Icon.vue_vue_type_style_index_0_lang-DPe3mUfh.js";
|
|
3
3
|
import { _ as ae } from "./Spinner.vue_vue_type_style_index_0_lang-Cgo_qdud.js";
|
|
4
4
|
import { _ as ie } from "./Badge.vue_vue_type_script_setup_true_lang-C1_SBsMO.js";
|
|
5
5
|
import { Primitive as le } from "reka-ui";
|
|
6
|
-
import { B as _, b as F, a as P, c as $, i as re } from "./ButtonGroup.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { B as _, b as F, a as P, c as $, i as re } from "./ButtonGroup.vue_vue_type_script_setup_true_lang-CJQAJRHk.js";
|
|
7
7
|
import { getBemBlock as se, generateVariantClassList as a, normCls as ce, getBemElement as pe } from "@pantograph/utils";
|
|
8
8
|
import { u as ue } from "./ConfigProvider.vue_vue_type_script_setup_true_lang-C-xm8OzO.js";
|
|
9
9
|
import { getComponentOptions as fe, useFormInput as de, isEmptyElement as me } from "@pantograph/utils-vue";
|
|
@@ -56,16 +56,19 @@ const n = se("button"), ve = ge(n, {
|
|
|
56
56
|
},
|
|
57
57
|
emits: ["click"],
|
|
58
58
|
setup(R, { expose: V, emit: w }) {
|
|
59
|
-
const e = R, { getFlipOnDir: d } = ue(), E = d("flipOnDir"), N = d("preIconFlipOnDir"), G = d("postIconFlipOnDir"), j = d("badgeIconFlipOnDir"), k = re({
|
|
60
|
-
|
|
61
|
-
variant
|
|
62
|
-
}),
|
|
59
|
+
const e = R, { getFlipOnDir: d } = ue(), E = d("flipOnDir"), N = d("preIconFlipOnDir"), G = d("postIconFlipOnDir"), j = d("badgeIconFlipOnDir"), k = re({}), m = l(() => {
|
|
60
|
+
var o;
|
|
61
|
+
return e.variant ?? ((o = k.props) == null ? void 0 : o.variant) ?? "simple";
|
|
62
|
+
}), i = l(
|
|
63
63
|
() => ["icon", "float"].includes(m.value) || (t.icon || e.icon) && !(e.text || t.default || e.preIcon || t.preIcon || e.postIcon || t.postIcon)
|
|
64
|
-
), t = Q(), { getDisabled: b, getSize: y } = de({ getSize: () =>
|
|
64
|
+
), t = Q(), { getDisabled: b, getSize: y } = de({ getSize: () => {
|
|
65
|
+
var o;
|
|
66
|
+
return e.size ?? ((o = k.props) == null ? void 0 : o.size);
|
|
67
|
+
} }), A = l(() => {
|
|
65
68
|
let o = P.includes(e.type) ? e.type : "fill";
|
|
66
69
|
const s = y.value, g = s && $.includes(s) ? s : "md";
|
|
67
70
|
let c = e.color && F.includes(e.color) ? e.color : "primary", p = m.value && _.includes(m.value) ? m.value : "simple";
|
|
68
|
-
return e.action ? ((p === "float" ||
|
|
71
|
+
return e.action ? ((p === "float" || i.value) && (p = "icon"), o === "fill" && (o = "outline"), c = void 0) : p === "float" && (o === "ghost" && (o = "fill"), ["primary", "neutral"].includes(c) || (c = "primary")), {
|
|
69
72
|
size: g,
|
|
70
73
|
type: o,
|
|
71
74
|
color: c,
|
|
@@ -75,11 +78,11 @@ const n = se("button"), ve = ge(n, {
|
|
|
75
78
|
loading: !!e.loading,
|
|
76
79
|
block: !!e.block,
|
|
77
80
|
noRing: !!e.noRing,
|
|
78
|
-
text: !
|
|
79
|
-
preIcon: !
|
|
80
|
-
postIcon: !
|
|
81
|
+
text: !i.value && !!(e.text || t.default),
|
|
82
|
+
preIcon: !i.value && !!(e.preIcon || t.preIcon),
|
|
83
|
+
postIcon: !i.value && !!(e.postIcon || t.postIcon)
|
|
81
84
|
};
|
|
82
|
-
}), B =
|
|
85
|
+
}), B = l(() => {
|
|
83
86
|
switch (y.value) {
|
|
84
87
|
case "lg":
|
|
85
88
|
return "sm";
|
|
@@ -88,7 +91,7 @@ const n = se("button"), ve = ge(n, {
|
|
|
88
91
|
default:
|
|
89
92
|
return "xsm";
|
|
90
93
|
}
|
|
91
|
-
}), K =
|
|
94
|
+
}), K = l(() => {
|
|
92
95
|
switch (y.value) {
|
|
93
96
|
case "sm":
|
|
94
97
|
return "3xsm";
|
|
@@ -98,11 +101,11 @@ const n = se("button"), ve = ge(n, {
|
|
|
98
101
|
default:
|
|
99
102
|
return "2xsm";
|
|
100
103
|
}
|
|
101
|
-
}), x = "2xsm", D = T(0), O =
|
|
104
|
+
}), x = "2xsm", D = T(0), O = l(() => e.as ? e.as : e.href ? "a" : "button");
|
|
102
105
|
U(O, () => {
|
|
103
106
|
D.value++;
|
|
104
107
|
});
|
|
105
|
-
const L =
|
|
108
|
+
const L = l(() => {
|
|
106
109
|
const o = {
|
|
107
110
|
disabled: b.value
|
|
108
111
|
};
|
|
@@ -125,10 +128,10 @@ const n = se("button"), ve = ge(n, {
|
|
|
125
128
|
}
|
|
126
129
|
q("click", o);
|
|
127
130
|
};
|
|
128
|
-
|
|
131
|
+
l(() => e.action && e.active && !i.value && (e.badgeText || t.badgeText || e.badgeIcon || t.badgeIcon || t.badge));
|
|
129
132
|
const J = () => {
|
|
130
133
|
var o, s, g;
|
|
131
|
-
if (e.action && e.active && !
|
|
134
|
+
if (e.action && e.active && !i.value) {
|
|
132
135
|
const c = (o = t.badge) == null ? void 0 : o.call(t, {
|
|
133
136
|
color: b.value ? "gray" : "primary",
|
|
134
137
|
size: x
|
|
@@ -166,7 +169,7 @@ const n = se("button"), ve = ge(n, {
|
|
|
166
169
|
class: te(r(pe)(r(n), "loading")),
|
|
167
170
|
size: B.value
|
|
168
171
|
}, null, 8, ["class", "size"])) : (u(), X(Y, { key: 0 }, [
|
|
169
|
-
(o.preIcon || t.preIcon) && !
|
|
172
|
+
(o.preIcon || t.preIcon) && !i.value ? (u(), f(h, {
|
|
170
173
|
key: 0,
|
|
171
174
|
flipOnDir: r(N),
|
|
172
175
|
icon: o.preIcon,
|
|
@@ -177,7 +180,7 @@ const n = se("button"), ve = ge(n, {
|
|
|
177
180
|
]),
|
|
178
181
|
_: 3
|
|
179
182
|
}, 8, ["flipOnDir", "icon", "size"])) : C("", !0),
|
|
180
|
-
|
|
183
|
+
i.value ? (u(), f(h, {
|
|
181
184
|
key: 1,
|
|
182
185
|
icon: o.icon,
|
|
183
186
|
size: K.value,
|
|
@@ -191,7 +194,7 @@ const n = se("button"), ve = ge(n, {
|
|
|
191
194
|
ee(oe(o.text), 1)
|
|
192
195
|
]),
|
|
193
196
|
Z(J),
|
|
194
|
-
(o.postIcon || t.postIcon) && !
|
|
197
|
+
(o.postIcon || t.postIcon) && !i.value ? (u(), f(h, {
|
|
195
198
|
key: 3,
|
|
196
199
|
flipOnDir: r(G),
|
|
197
200
|
icon: o.postIcon,
|
package/dist/Button/index.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-DVzErXxg.js");exports.Button=e._sfc_main;exports.default=e._sfc_main;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as c, useAttrs as l, computed as m, ref as f, createBlock as u, openBlock as d, mergeProps as b, createSlots as g, renderList as _, withCtx as v, renderSlot as y, normalizeProps as B, guardReactiveProps as I } from "vue";
|
|
2
2
|
import { omit as O } from "es-toolkit";
|
|
3
|
-
import { _ as h } from "./BaseButton.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import { _ as h } from "./BaseButton.vue_vue_type_style_index_0_lang-QDColA3Q.js";
|
|
4
4
|
import { getComponentOptions as k } from "@pantograph/utils-vue";
|
|
5
5
|
const P = /* @__PURE__ */ c({
|
|
6
6
|
...k("Button", !1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),p=require("es-toolkit"),u=require("./BaseButton.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";const e=require("vue"),p=require("es-toolkit"),u=require("./BaseButton.vue_vue_type_style_index_0_lang-D2WO6pVz.js"),_=require("@pantograph/utils-vue"),f=e.defineComponent({..._.getComponentOptions("Button",!1),__name:"Button",props:{as:{},class:{},text:{},size:{},color:{},noRing:{type:Boolean},type:{},loading:{type:Boolean},preIcon:{},postIcon:{},preIconFlipOnDir:{},postIconFlipOnDir:{},htmlType:{},block:{type:Boolean},disabled:{type:Boolean,default:void 0},hover:{type:Boolean},href:{},target:{}},setup(r,{expose:s}){const i=r,a=e.useAttrs(),c=e.computed(()=>({...p.omit(a,["variant","action","active","badgeText","badgeIcon","icon","flipOnDir","badgeIconFlipOnDir"]),...i})),o=e.ref();return s({focus(){var t;(t=o.value)==null||t.focus()},blur(){var t;(t=o.value)==null||t.blur()}}),(t,d)=>(e.openBlock(),e.createBlock(u._sfc_main,e.mergeProps(c.value,{variant:"simple",ref_key:"buttonRef",ref:o}),e.createSlots({_:2},[e.renderList(Object.keys(t.$slots),n=>({name:n,fn:e.withCtx(l=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(l)))])}))]),1040))}});exports._sfc_main=f;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonSize, ButtonVariant } from '../Base/BaseButton/BaseButton.model';
|
|
2
|
-
import { ComputedRef } from 'vue';
|
|
3
2
|
import { ClassValue } from 'class-variance-authority/types';
|
|
4
3
|
declare const ButtonGroupGaps: readonly ["sm", "md", "lg", "none"];
|
|
5
4
|
export type ButtonGroupProps = {
|
|
@@ -10,23 +9,17 @@ export type ButtonGroupProps = {
|
|
|
10
9
|
split?: boolean;
|
|
11
10
|
};
|
|
12
11
|
export declare const injectButtonGroupContext: <T extends {
|
|
13
|
-
|
|
14
|
-
variant: ComputedRef<ButtonVariant | undefined>;
|
|
12
|
+
props?: ButtonGroupProps;
|
|
15
13
|
} | null | undefined = {
|
|
16
|
-
|
|
17
|
-
variant: ComputedRef<ButtonVariant | undefined>;
|
|
14
|
+
props?: ButtonGroupProps;
|
|
18
15
|
}>(fallback?: T | undefined) => T extends null ? {
|
|
19
|
-
|
|
20
|
-
variant: ComputedRef<ButtonVariant | undefined>;
|
|
16
|
+
props?: ButtonGroupProps;
|
|
21
17
|
} | null : {
|
|
22
|
-
|
|
23
|
-
variant: ComputedRef<ButtonVariant | undefined>;
|
|
18
|
+
props?: ButtonGroupProps;
|
|
24
19
|
}, provideButtonGroupContext: (contextValue: {
|
|
25
|
-
|
|
26
|
-
variant: ComputedRef<ButtonVariant | undefined>;
|
|
20
|
+
props?: ButtonGroupProps;
|
|
27
21
|
}) => {
|
|
28
|
-
|
|
29
|
-
variant: ComputedRef<ButtonVariant | undefined>;
|
|
22
|
+
props?: ButtonGroupProps;
|
|
30
23
|
};
|
|
31
24
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<ButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonGroupProps> & Readonly<{}>, {
|
|
32
25
|
split: boolean;
|
|
@@ -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-9R8RwIc-.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"),e=require("@pantograph/utils"),p=require("@pantograph/utils-vue"),c=require("class-variance-authority"),B=require("reka-ui"),m=require("./BaseBadge.model-DecqxaGN.js"),g=["simple","icon","float"],C=["fill","outline","ghost"],d=["primary","danger","success","warning","neutral",...m.PrimitiveColors,"gray"],r=["sm","md","lg"],f=[...r,"none"],[v,a]=B.createContext("ButtonGroup"),G=t.defineComponent({...p.getComponentOptions("ButtonGroup"),__name:"ButtonGroup",props:{class:{},size:{default:"md"},variant:{default:"simple"},gap:{},split:{type:Boolean,default:!0}},setup(i){const o=i,u=e.getBemBlock("button"),n=e.getBemElement(u,"group"),l=c.cva(n,{variants:{gap:e.generateVariantClassList(f,n),split:e.generateVariantClassList("split",n)}});return a({props:o}),(s,_)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(e.normCls)(t.unref(l)({gap:o.gap??o.size,split:s.split}),o.class))},[t.renderSlot(s.$slots,"default")],2))}});exports.ButtonColors=d;exports.ButtonSizes=r;exports.ButtonTypes=C;exports.ButtonVariants=g;exports._sfc_main=G;exports.injectButtonGroupContext=v;exports.provideButtonGroupContext=a;
|