@pantograph/vue 0.25.0 → 0.25.1
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/Comment/CommentEditor.d.ts +5 -4
- package/dist/Comment/index.js +1 -1
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/Upload/UploadTrigger.d.ts +2 -2
- package/dist/Upload/index.js +1 -1
- package/dist/Upload/index.umd.cjs +1 -1
- package/dist/Upload/types.d.ts +4 -1
- package/dist/{Upload.vue_vue_type_style_index_0_lang-DXBaIH16.js → Upload.vue_vue_type_style_index_0_lang-DC0jVRjM.js} +215 -211
- package/dist/{Upload.vue_vue_type_style_index_0_lang-6dbdVoDr.js → Upload.vue_vue_type_style_index_0_lang-oVgy1020.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +6 -1
|
@@ -36,9 +36,10 @@ declare function __VLS_template(): {
|
|
|
36
36
|
readonly maxCount?: number | string | undefined;
|
|
37
37
|
readonly action: (config: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadActionParams) => Promise<any>;
|
|
38
38
|
readonly getFileIcon?: ((file: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadFile) => string) | undefined;
|
|
39
|
-
readonly
|
|
40
|
-
readonly multiple?: boolean | undefined;
|
|
39
|
+
readonly triggerCls?: import('clsx').ClassValue;
|
|
41
40
|
readonly disabled?: boolean | undefined;
|
|
41
|
+
readonly multiple?: boolean | undefined;
|
|
42
|
+
readonly directory?: boolean | undefined;
|
|
42
43
|
readonly accept?: string | undefined;
|
|
43
44
|
readonly onChange?: ((data: {
|
|
44
45
|
file: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadFile;
|
|
@@ -84,7 +85,7 @@ declare function __VLS_template(): {
|
|
|
84
85
|
props: UploadProps;
|
|
85
86
|
attrs: object;
|
|
86
87
|
slots: UploadSlots;
|
|
87
|
-
progressSize: import('vue').ComputedRef<import('../
|
|
88
|
+
progressSize: import('vue').ComputedRef<import('../index.ts', { with: { "resolution-mode": "import" } }).ProgressSize>;
|
|
88
89
|
emit: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadEmits;
|
|
89
90
|
createRequest: (uploadFile: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadFile) => Promise<void>;
|
|
90
91
|
resetRequest: (uploadFile: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadFile) => Promise<void>;
|
|
@@ -155,7 +156,7 @@ declare function __VLS_template(): {
|
|
|
155
156
|
props: UploadProps;
|
|
156
157
|
attrs: object;
|
|
157
158
|
slots: UploadSlots;
|
|
158
|
-
progressSize: import('vue').ComputedRef<import('../
|
|
159
|
+
progressSize: import('vue').ComputedRef<import('../index.ts', { with: { "resolution-mode": "import" } }).ProgressSize>;
|
|
159
160
|
emit: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadEmits;
|
|
160
161
|
createRequest: (uploadFile: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadFile) => Promise<void>;
|
|
161
162
|
resetRequest: (uploadFile: import('../Upload/types.js', { with: { "resolution-mode": "import" } }).UploadFile) => Promise<void>;
|
package/dist/Comment/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { _ as Se } from "../Combobox.vue_vue_type_style_index_0_lang-BsO5vzLB.js
|
|
|
17
17
|
import { _ as ke } from "../Divider.vue_vue_type_style_index_0_lang-CfBklijs.js";
|
|
18
18
|
import { U as Pe } from "../useInputDataStates-RRZVY4Vg.js";
|
|
19
19
|
import { _ as xe } from "../ScrollContainer.vue_vue_type_style_index_0_lang-DqLbpFbD.js";
|
|
20
|
-
import { _ as Te, a as $e } from "../Upload.vue_vue_type_style_index_0_lang-
|
|
20
|
+
import { _ as Te, a as $e } from "../Upload.vue_vue_type_style_index_0_lang-DC0jVRjM.js";
|
|
21
21
|
import { _ as Oe } from "../Shortcut.vue_vue_type_style_index_0_lang-D0pRaguA.js";
|
|
22
22
|
const Ee = /* @__PURE__ */ A({
|
|
23
23
|
...z("CommentActions"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("../Icon.vue_vue_type_style_index_0_lang-CPuN4R-k.js"),R=require("../options-CY2uxp5A.js"),M=require("../Avatar.vue_vue_type_style_index_0_lang-YkXWR99l.js"),I=require("../Badge.vue_vue_type_script_setup_true_lang-BAQIKtam.js"),$=require("class-variance-authority"),H=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-EviuZ52W.js");require("@iconify/vue");const r=require("@pantograph/utils"),P=require("../IconButton.vue_vue_type_script_setup_true_lang-DynLmo_n.js"),L=require("../ActionButton.vue_vue_type_script_setup_true_lang-BGrL1xRj.js"),j=require("reka-ui"),U=require("../Popover.vue_vue_type_style_index_0_lang-qJ0psPTx.js"),O=require("../MenuItem.vue_vue_type_style_index_0_lang-fYybuhKO.js"),F=require("../GOPicker.vue_vue_type_style_index_0_lang-Bb05nUVP.js"),G=require("../Combobox.vue_vue_type_style_index_0_lang-Dtf_JcyR.js"),K=require("../Divider.vue_vue_type_style_index_0_lang-B1VnMpBg.js"),W=require("../useInputDataStates-CXaVG_o2.js"),Q=require("../ScrollContainer.vue_vue_type_style_index_0_lang-BLFtmUwR.js"),z=require("../Upload.vue_vue_type_style_index_0_lang-6dbdVoDr.js"),J=require("../Shortcut.vue_vue_type_style_index_0_lang-maaUKoPJ.js"),X=e.defineComponent({...R.getComponentOptions("CommentActions"),__name:"CommentActions",setup(f){const l=N(),n=e.ref(),t=e.ref(),u=()=>{l.emit("openActions",t.value)},s=()=>{l.emit("openReaction",n.value)},i=()=>{l.emit("reply")};return(p,o)=>e.unref(l).props.hasReaction||e.unref(l).props.hasEdit||e.unref(l).props.hasDelete?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(g),"actions"),e.unref(l).props.actionsCls))},[e.unref(l).props.hasReply?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:corner-up-left",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:n,flipOnDir:"rtl",onClick:i},null,512)):e.createCommentVNode("",!0),e.unref(l).props.hasReaction?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:n,onClick:s},null,512)):e.createCommentVNode("",!0),e.unref(l).props.hasEdit||e.unref(l).props.hasDelete?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"tabler:dots-vertical",color:"neutral",type:"ghost",ref_key:"actionRef",ref:t,onClick:u},null,512)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),Y=e.defineComponent({...R.getComponentOptions("CommentReactions"),__name:"CommentReactions",setup(f){const l=N(),n=e.ref(),t=()=>{l.emit("openReaction",n.value)},u=s=>{s&&!s.active&&l.emit("reaction",s.emoji)};return(s,i)=>{var p;return e.unref(l).props.hasReaction&&((p=e.unref(l).props.reactions)!=null&&p.some(o=>o.count&&o.emoji))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(g),"reactions"),e.unref(l).props.reactionsCls))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).props.reactions,o=>(e.openBlock(),e.createBlock(L._sfc_main,{key:o==null?void 0:o.emoji,active:o==null?void 0:o.active,onClick:h=>u(o)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o==null?void 0:o.emoji)+" "+e.toDisplayString(o==null?void 0:o.count),1)]),_:2},1032,["active","onClick"]))),128)),e.createVNode(P._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"outline",ref_key:"reactionRef",ref:n,onClick:t},null,512)],2)):e.createCommentVNode("",!0)}}}),g=r.getBemBlock("comment"),[N,D]=j.createContext("Comment"),Z=e.defineComponent({...R.getComponentOptions("Comment"),__name:"Comment",props:{class:{},headerCls:{},actionsCls:{},bodyCls:{},datetimeCls:{},contentCls:{},authorCls:{},repliesCls:{},headerContentCls:{},reactionsCls:{},repliesHeaderCls:{},repliesTitleCls:{},repliesContentCls:{},author:{},avatar:{},content:{},datetime:{},repliesCount:{},repliesTitle:{default:"Replies"},avatarProps:{},open:{type:Boolean,default:void 0},hasReaction:{type:Boolean,default:!0},hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},hasReply:{type:Boolean,default:!0},reactions:{}},emits:["update:open","openActions","reaction","reply","openReaction"],setup(f,{emit:l}){const n=f,t=e.useSlots(),u=l,s=y.useVModel(n,"open",u,{passive:n.open===void 0}),i=()=>{var d;let c;const C=(d=t.author)==null?void 0:d.call(t,{});return!y.isEmptyElement(C)?c=C:c=n.author,c?e.h("div",{class:r.normCls(r.getBemElement(g,"author"),n.authorCls)},c):null},p=()=>{var d;let c;const C=(d=t.datetime)==null?void 0:d.call(t,{});return!y.isEmptyElement(C)?c=C:c=n.datetime,c?e.h("div",{class:r.normCls(r.getBemElement(g,"datetime"),n.datetimeCls)},c):null},o=()=>{var d,v;const c=(d=t.header)==null?void 0:d.call(t,{}),C=!y.isEmptyElement(c);let m;if(C)m=c;else{m=[];const k=(v=t.avatar)==null?void 0:v.call(t,{});!y.isEmptyElement(k)?m.push(k):n.avatar&&m.push(e.h(M._sfc_main,{...n.avatarProps??{},src:n.avatar}));const E=i(),S=p();(E||S)&&m.push(e.h("div",{class:r.normCls(r.getBemElement(g,"header__content"),n.headerContentCls)},[E,S])),m.length||(m=void 0)}return m?(m.push(e.h(X)),e.h("div",{class:r.normCls(r.getBemElement(g,"header"),n.headerCls)},m)):null},h=()=>{var m;const c=(m=t.content)==null?void 0:m.call(t,{}),C=!y.isEmptyElement(c);if(C||n.content)return e.h("div",{class:r.normCls(r.getBemElement(g,"content"),n.contentCls,"paragraph"),innerHTML:C?void 0:n.content},C?c:void 0)},_=r.getBemElement(g,"replies"),B=$.cva(_,{variants:{open:r.generateVariantClassList("open",_)}}),b=()=>{var v;const c=(v=t.replies)==null?void 0:v.call(t,{}),C=!y.isEmptyElement(c),m=()=>{var E,S,x;const k=(E=t.repliesHeader)==null?void 0:E.call(t,{open:!!s.value}),a=[];if(!y.isEmptyElement(k))a.push(k);else{a.push(e.h(H._sfc_main,{size:"xsm",bg:"transparent",br:"transparent"},{default:()=>e.h(y._sfc_main$3,{icon:"tabler:chevron-down",class:r.getBemElement(_,"icon"),size:"2xsm"})}));const T=(S=t.repliesCount)==null?void 0:S.call(t,{}),A=!y.isEmptyElement(T),w=(x=t.repliesTitle)==null?void 0:x.call(t,{}),q=!y.isEmptyElement(w);let V;q?V=w:V=n.repliesTitle,a.push(e.h("div",{class:r.normCls(r.getBemElement(_,"title"),n.repliesTitleCls)},V)),(A||n.repliesCount)&&a.push(e.h(I._sfc_main,{color:"primary-subtle",text:n.repliesCount,size:"xsm"},{text:()=>T}))}return e.h("div",{class:r.normCls(r.getBemElement(_,"header"),n.repliesHeaderCls),onClick:()=>{s.value=!s.value}},a)},d=()=>{if(s.value)return[e.h("div",{class:r.normCls(r.getBemElement(_,"content"),n.repliesContentCls)},c),e.h("div",{class:r.getBemElement(_,"line")})]};return C?e.h("div",{class:r.normCls(B({open:!!s.value}),n.repliesCls)},[m(),d()]):null};return D({emit:u,props:n,slots:t}),(c,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(g),n.class))},[e.createVNode(o),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(g),"body"),n.bodyCls))},[e.createVNode(h),e.createVNode(Y),e.createVNode(b)],2)],2))}}),ee=e.defineComponent({...R.getComponentOptions("CommentAction"),__name:"CommentAction",props:{hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},editText:{default:"Edit"},deleteText:{default:"Delete"},dir:{},class:{},containerCls:{},containerClass:{},containerProps:{},trigger:{},size:{},to:{},placement:{},reversePlacementOnDir:{},autoFocusInside:{type:Boolean},zIndex:{},useReferenceAttribute:{type:Boolean},defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},openDelay:{},closeDelay:{},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},disableOutsidePointerEvents:{type:Boolean}},emits:["edit","delete","update:open"],setup(f,{emit:l}){const n=f,t=l,u=()=>{t("edit"),i.value=!1},s=()=>{t("delete"),i.value=!1},i=y.useVModel(n,"open",t,{passive:n.open===void 0});return(p,o)=>(e.openBlock(),e.createBlock(e.unref(U._sfc_main),e.mergeProps(n,{open:e.unref(i),"onUpdate:open":o[0]||(o[0]=h=>e.isRef(i)?i.value=h:null),placement:"bottom-end",sideOffset:3,trigger:"click",openDelay:0}),{content:e.withCtx(()=>[e.createVNode(O._sfc_main,{style:{width:"116px"}},{default:e.withCtx(()=>[p.hasEdit?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"edit",title:p.editText,onClick:u},{leading:e.withCtx(({iconSize:h})=>[e.createVNode(y._sfc_main$3,{icon:"tabler:edit",size:h},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0),p.hasDelete?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"delete",title:p.deleteText,danger:"",onClick:s},{leading:e.withCtx(({iconSize:h})=>[e.createVNode(y._sfc_main$3,{icon:"tabler:trash",size:h},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})]),_:1},16,["open"]))}}),te=e.defineComponent({...R.getComponentOptions("CommentReaction"),__name:"CommentReaction",props:{reference:{},open:{type:Boolean,default:void 0},icons:{},emojis:{},group:{},modelValue:{},defaultValue:{},visibleTabs:{},noTrigger:{type:Boolean},noModel:{type:Boolean},hideClear:{type:Boolean},hideColor:{type:Boolean},hideGroup:{type:Boolean},hideIcons:{type:Boolean},hideEmojis:{type:Boolean},hideSearch:{type:Boolean},hideRandom:{type:Boolean},disabled:{type:Boolean},borderless:{type:Boolean},popoverProps:{},colorPopoverProps:{},fgColorSwatchGroupProps:{},bgColorSwatchGroupProps:{},brColorSwatchGroupProps:{},visibleColorPickers:{},contentCls:{},headerCls:{},groupCls:{},searchCls:{},colorsCls:{},emptyCls:{},gridCls:{},scrollContainerProps:{},size:{},id:{},resetColorsOnChangeType:{}},emits:["reaction","update:open"],setup(f,{emit:l}){const n=f,t=l,u=i=>{t("reaction",i.value),s.value=!1},s=y.useVModel(n,"open",t,{passive:n.open===void 0});return(i,p)=>(e.openBlock(),e.createBlock(F._sfc_main,e.mergeProps(n,{noTrigger:"",hideClear:"",hideGroup:"",hideIcons:"",hideRandom:"",group:"emoji",popoverProps:{...i.popoverProps??{},reference:i.reference},placement:"bottom-end",visibleColorPickers:[],noModel:"",onSelect:u,open:e.unref(s),"onUpdate:open":p[0]||(p[0]=o=>e.isRef(s)?s.value=o:null)}),null,16,["popoverProps","open"]))}}),oe=e.defineComponent({...R.getComponentOptions("CommentMention"),__name:"CommentMention",props:{size:{},status:{},multiple:{type:Boolean},noLastValueOnPlaceholder:{type:Boolean},showLabelValueOnHeaderSearch:{type:Boolean},zIndex:{},checkbox:{type:Boolean},tagRenderMode:{},getTagProps:{type:Function},tree:{type:Boolean},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{},selectedItemIconAsTrailingIcon:{type:Boolean},maxCount:{},to:{type:[String,Function]},placeholder:{},indicatorIcon:{},options:{},getDisabled:{},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{},getSingle:{},getClear:{},getGroupOptions:{},getGroupLabel:{},getIcon:{},placement:{},reversePlacementOnDir:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{},lazyLoading:{type:Boolean},bordered:{type:Boolean},clearOnChangeMultiple:{type:Boolean},triggerCls:{},triggerLeadingCls:{},triggerContentCls:{},triggerContentPlaceholderCls:{},triggerContentValueCls:{},triggerTrailingCls:{},itemLeadingCls:{},optionCls:{},tagCls:{},popupCls:{},labelCls:{},optionsCls:{},optionTextCls:{},optionContentCls:{},emptyCls:{},skeletonCls:{},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean},popupHeight:{},popupWidth:{},minWidth:{},headerSearch:{type:Boolean},search:{},noTrigger:{type:Boolean},open:{type:Boolean},defaultOpen:{type:Boolean},resetSearchTermOnBlur:{type:Boolean},resetSearchTermOnSelect:{type:Boolean},modelValue:{},defaultValue:{},dir:{},disabled:{type:Boolean},highlightOnHover:{type:Boolean},by:{type:[String,Function]},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},reference:{},forceMount:{type:Boolean},position:{},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},defer:{type:Boolean}},emits:["mention"],setup(f,{emit:l}){const n=f,t=l,u=e.useSlots(),s=(i,p,o)=>{t("mention",i,o)};return(i,p)=>(e.openBlock(),e.createBlock(G._sfc_main,e.mergeProps(n,{modelValue:"",onSelect:s,noTrigger:""}),e.createSlots({_:2},[e.renderList(Object.keys(u),o=>({name:o,fn:e.withCtx(h=>[e.renderSlot(i.$slots,o,e.normalizeProps(e.guardReactiveProps(h)))])}))]),1040))}}),ne=e.defineComponent({...R.getComponentOptions("CommentEditor"),__name:"CommentEditor",props:{class:{},actionsCls:{},editorCls:{},footerCls:{},disabled:{type:Boolean},isEmpty:{type:Boolean},mentionsReference:{},uploadProps:{},maxHeight:{default:100}},emits:["openReaction","openMention","blur","focus","mention","submit"],setup(f,{emit:l}){const n=e.useSlots(),t=f,u=l,s=r.getBemElement(g,"editor"),i=e.ref(),p=()=>{u("openReaction",i.value)},o=e.ref(),h=()=>{u("openMention",o.value)},{rootBindings:_,inputBindings:B}=W.UseInputDataStates({getDisabled:()=>t.disabled,emit:u}),b=()=>u("submit"),c=e.computed(()=>{if(Number(t.maxHeight)>0)return`${t.maxHeight}px`;if(typeof t.maxHeight=="string")return t.maxHeight}),C=e.ref(),m=d=>{var v;(v=C.value)!=null&&v.addFiles&&d.length&&C.value.addFiles(d)};return(d,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(r.normCls)(e.unref(s),t.class)},e.unref(_)),[e.createVNode(Q._sfc_main,{overlay:!1,hasMask:!1,class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(s),"editor"),"paragraph",t.editorCls)),style:e.normalizeStyle({maxHeight:c.value})},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(B))))]),_:3},8,["class","style"]),e.createVNode(z._sfc_main,e.mergeProps({noTrigger:""},d.uploadProps,{ref_key:"uploadRef",ref:C}),e.createSlots({_:2},[e.renderList(Object.keys(e.unref(y.omit)(n,"default")),k=>({name:k,fn:e.withCtx(a=>[e.renderSlot(d.$slots,k,e.normalizeProps(e.guardReactiveProps(a)))])}))]),1040),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(s),"footer"),t.footerCls))},[e.createVNode(K._sfc_main),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(s),"actions"),t.actionsCls))},[e.createElementVNode("div",null,[e.createVNode(P._sfc_main,{icon:"tabler:at",color:"neutral",type:"ghost",ref_key:"mentionRef",ref:o,onClick:h},null,512),e.createVNode(z._sfc_main$1,{accept:"image/*",multiple:"",onAddFiles:m},{default:e.withCtx(()=>[e.createVNode(P._sfc_main,{icon:"tabler:photo",color:"neutral",type:"ghost"})]),_:1}),e.createVNode(P._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:i,onClick:p},null,512)]),e.createVNode(P._sfc_main,{disabled:d.isEmpty,icon:"tabler:arrow-up",onClick:b},null,8,["disabled"])],2)],2)],16))}}),re=["tabindex","disabled"],le=e.defineComponent({...R.getComponentOptions("CommentTrigger"),__name:"CommentTrigger",props:{class:{},text:{default:"Add a Comment or type @ to Mention..."},src:{},withShortcut:{type:Boolean},ignoeShortcut:{type:Boolean},disabled:{type:Boolean},avatarProps:{},shortcutProps:{}},emits:["add"],setup(f,{emit:l}){const n=e.useSlots(),t=f,u=l,s=r.getBemElement(g,"trigger"),i=o=>{!t.ignoeShortcut&&o.code==="KeyC"&&o.altKey&&p(o)};e.onMounted(()=>{t.withShortcut&&addEventListener("keyup",i)}),e.onBeforeUnmount(()=>{t.withShortcut&&removeEventListener("keyup",i)}),t.withShortcut;const p=o=>u("add",o);return(o,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(s),t.class)),tabindex:o.disabled?-1:0,disabled:o.disabled?"":void 0,onPointerdown:e.withModifiers(p,["stop"]),onKeyup:e.withModifiers(p,["stop"])},[e.createVNode(M._sfc_main,e.mergeProps(o.avatarProps??{},{size:"sm",src:o.src}),e.createSlots({_:2},[e.renderList(Object.keys(n),_=>({name:_,fn:e.withCtx(B=>[e.renderSlot(o.$slots,_,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040,["src"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(s),"text"))},[e.renderSlot(o.$slots,"text",{},()=>[e.createTextVNode(e.toDisplayString(o.text),1)])],2),e.createVNode(J._sfc_main,e.mergeProps(o.shortcutProps??{},{items:[{text:"Alt"},{text:"C"}]}),null,16)],42,re))}}),se=f=>{const l=e.ref(!1),n=e.ref(),t=e.ref(!1),u=(a,E=!1)=>{l.value=!0,t.value=E,n.value=a},s=e.ref(!1),i=e.ref(),p=a=>{s.value=!0,i.value=a},o=e.computed(()=>({open:l.value,reference:n.value,"onUpdate:open":a=>l.value=a,onReaction:a=>{var E,S;if(t.value)try{(E=f.addEmoji)==null||E.call(f,a)}catch(x){console.log("error on reaction ===>",x)}try{(S=f.onReaction)==null||S.call(f,a)}catch(x){console.log("error on reaction ===>",x)}}})),h=e.computed(()=>({open:s.value,reference:i.value,"onUpdate:open":a=>s.value=a})),_=e.ref(!1),B=e.ref(),b=e.ref(),c=e.ref(!1),C=e.computed(()=>({open:_.value,"onUpdate:open":a=>_.value=a,search:B.value,"onUpdate:search":a=>B.value=a,reference:b.value,headerSearch:c.value,onPointerDownOutside:d,onEscapeKeyDown:d})),m=a=>{a&&(b.value={getBoundingClientRect:a},_.value=!0,c.value=!1)},d=()=>{b.value=void 0,_.value=!1,B.value=void 0},v=a=>{B.value=a},k=e.computed(()=>({onOpenReaction:a=>u(a,!0),onOpenMention:a=>{a&&(b.value=a,_.value=!0,c.value=!0)}}));return{reactionBinding:o,actionBinding:h,editorBinding:k,mentionBinding:C,openActions:p,openReaction:u,openMentionInEditor:m,closeMentionInEditor:d,updateMentionQuery:v}};exports.Comment=Z;exports.CommentAction=ee;exports.CommentEditor=ne;exports.CommentMention=oe;exports.CommentReaction=te;exports.CommentTrigger=le;exports.commentPrefix=g;exports.injectCommentContext=N;exports.provideCommentContext=D;exports.useComment=se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("../Icon.vue_vue_type_style_index_0_lang-CPuN4R-k.js"),R=require("../options-CY2uxp5A.js"),M=require("../Avatar.vue_vue_type_style_index_0_lang-YkXWR99l.js"),I=require("../Badge.vue_vue_type_script_setup_true_lang-BAQIKtam.js"),$=require("class-variance-authority"),H=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-EviuZ52W.js");require("@iconify/vue");const r=require("@pantograph/utils"),P=require("../IconButton.vue_vue_type_script_setup_true_lang-DynLmo_n.js"),L=require("../ActionButton.vue_vue_type_script_setup_true_lang-BGrL1xRj.js"),j=require("reka-ui"),U=require("../Popover.vue_vue_type_style_index_0_lang-qJ0psPTx.js"),O=require("../MenuItem.vue_vue_type_style_index_0_lang-fYybuhKO.js"),F=require("../GOPicker.vue_vue_type_style_index_0_lang-Bb05nUVP.js"),G=require("../Combobox.vue_vue_type_style_index_0_lang-Dtf_JcyR.js"),K=require("../Divider.vue_vue_type_style_index_0_lang-B1VnMpBg.js"),W=require("../useInputDataStates-CXaVG_o2.js"),Q=require("../ScrollContainer.vue_vue_type_style_index_0_lang-BLFtmUwR.js"),z=require("../Upload.vue_vue_type_style_index_0_lang-oVgy1020.js"),J=require("../Shortcut.vue_vue_type_style_index_0_lang-maaUKoPJ.js"),X=e.defineComponent({...R.getComponentOptions("CommentActions"),__name:"CommentActions",setup(f){const l=N(),n=e.ref(),t=e.ref(),u=()=>{l.emit("openActions",t.value)},s=()=>{l.emit("openReaction",n.value)},i=()=>{l.emit("reply")};return(p,o)=>e.unref(l).props.hasReaction||e.unref(l).props.hasEdit||e.unref(l).props.hasDelete?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(g),"actions"),e.unref(l).props.actionsCls))},[e.unref(l).props.hasReply?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:corner-up-left",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:n,flipOnDir:"rtl",onClick:i},null,512)):e.createCommentVNode("",!0),e.unref(l).props.hasReaction?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:n,onClick:s},null,512)):e.createCommentVNode("",!0),e.unref(l).props.hasEdit||e.unref(l).props.hasDelete?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"tabler:dots-vertical",color:"neutral",type:"ghost",ref_key:"actionRef",ref:t,onClick:u},null,512)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),Y=e.defineComponent({...R.getComponentOptions("CommentReactions"),__name:"CommentReactions",setup(f){const l=N(),n=e.ref(),t=()=>{l.emit("openReaction",n.value)},u=s=>{s&&!s.active&&l.emit("reaction",s.emoji)};return(s,i)=>{var p;return e.unref(l).props.hasReaction&&((p=e.unref(l).props.reactions)!=null&&p.some(o=>o.count&&o.emoji))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(g),"reactions"),e.unref(l).props.reactionsCls))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).props.reactions,o=>(e.openBlock(),e.createBlock(L._sfc_main,{key:o==null?void 0:o.emoji,active:o==null?void 0:o.active,onClick:h=>u(o)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o==null?void 0:o.emoji)+" "+e.toDisplayString(o==null?void 0:o.count),1)]),_:2},1032,["active","onClick"]))),128)),e.createVNode(P._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"outline",ref_key:"reactionRef",ref:n,onClick:t},null,512)],2)):e.createCommentVNode("",!0)}}}),g=r.getBemBlock("comment"),[N,D]=j.createContext("Comment"),Z=e.defineComponent({...R.getComponentOptions("Comment"),__name:"Comment",props:{class:{},headerCls:{},actionsCls:{},bodyCls:{},datetimeCls:{},contentCls:{},authorCls:{},repliesCls:{},headerContentCls:{},reactionsCls:{},repliesHeaderCls:{},repliesTitleCls:{},repliesContentCls:{},author:{},avatar:{},content:{},datetime:{},repliesCount:{},repliesTitle:{default:"Replies"},avatarProps:{},open:{type:Boolean,default:void 0},hasReaction:{type:Boolean,default:!0},hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},hasReply:{type:Boolean,default:!0},reactions:{}},emits:["update:open","openActions","reaction","reply","openReaction"],setup(f,{emit:l}){const n=f,t=e.useSlots(),u=l,s=y.useVModel(n,"open",u,{passive:n.open===void 0}),i=()=>{var d;let c;const C=(d=t.author)==null?void 0:d.call(t,{});return!y.isEmptyElement(C)?c=C:c=n.author,c?e.h("div",{class:r.normCls(r.getBemElement(g,"author"),n.authorCls)},c):null},p=()=>{var d;let c;const C=(d=t.datetime)==null?void 0:d.call(t,{});return!y.isEmptyElement(C)?c=C:c=n.datetime,c?e.h("div",{class:r.normCls(r.getBemElement(g,"datetime"),n.datetimeCls)},c):null},o=()=>{var d,v;const c=(d=t.header)==null?void 0:d.call(t,{}),C=!y.isEmptyElement(c);let m;if(C)m=c;else{m=[];const k=(v=t.avatar)==null?void 0:v.call(t,{});!y.isEmptyElement(k)?m.push(k):n.avatar&&m.push(e.h(M._sfc_main,{...n.avatarProps??{},src:n.avatar}));const E=i(),S=p();(E||S)&&m.push(e.h("div",{class:r.normCls(r.getBemElement(g,"header__content"),n.headerContentCls)},[E,S])),m.length||(m=void 0)}return m?(m.push(e.h(X)),e.h("div",{class:r.normCls(r.getBemElement(g,"header"),n.headerCls)},m)):null},h=()=>{var m;const c=(m=t.content)==null?void 0:m.call(t,{}),C=!y.isEmptyElement(c);if(C||n.content)return e.h("div",{class:r.normCls(r.getBemElement(g,"content"),n.contentCls,"paragraph"),innerHTML:C?void 0:n.content},C?c:void 0)},_=r.getBemElement(g,"replies"),B=$.cva(_,{variants:{open:r.generateVariantClassList("open",_)}}),b=()=>{var v;const c=(v=t.replies)==null?void 0:v.call(t,{}),C=!y.isEmptyElement(c),m=()=>{var E,S,x;const k=(E=t.repliesHeader)==null?void 0:E.call(t,{open:!!s.value}),a=[];if(!y.isEmptyElement(k))a.push(k);else{a.push(e.h(H._sfc_main,{size:"xsm",bg:"transparent",br:"transparent"},{default:()=>e.h(y._sfc_main$3,{icon:"tabler:chevron-down",class:r.getBemElement(_,"icon"),size:"2xsm"})}));const T=(S=t.repliesCount)==null?void 0:S.call(t,{}),A=!y.isEmptyElement(T),w=(x=t.repliesTitle)==null?void 0:x.call(t,{}),q=!y.isEmptyElement(w);let V;q?V=w:V=n.repliesTitle,a.push(e.h("div",{class:r.normCls(r.getBemElement(_,"title"),n.repliesTitleCls)},V)),(A||n.repliesCount)&&a.push(e.h(I._sfc_main,{color:"primary-subtle",text:n.repliesCount,size:"xsm"},{text:()=>T}))}return e.h("div",{class:r.normCls(r.getBemElement(_,"header"),n.repliesHeaderCls),onClick:()=>{s.value=!s.value}},a)},d=()=>{if(s.value)return[e.h("div",{class:r.normCls(r.getBemElement(_,"content"),n.repliesContentCls)},c),e.h("div",{class:r.getBemElement(_,"line")})]};return C?e.h("div",{class:r.normCls(B({open:!!s.value}),n.repliesCls)},[m(),d()]):null};return D({emit:u,props:n,slots:t}),(c,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(g),n.class))},[e.createVNode(o),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(g),"body"),n.bodyCls))},[e.createVNode(h),e.createVNode(Y),e.createVNode(b)],2)],2))}}),ee=e.defineComponent({...R.getComponentOptions("CommentAction"),__name:"CommentAction",props:{hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},editText:{default:"Edit"},deleteText:{default:"Delete"},dir:{},class:{},containerCls:{},containerClass:{},containerProps:{},trigger:{},size:{},to:{},placement:{},reversePlacementOnDir:{},autoFocusInside:{type:Boolean},zIndex:{},useReferenceAttribute:{type:Boolean},defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},openDelay:{},closeDelay:{},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},disableOutsidePointerEvents:{type:Boolean}},emits:["edit","delete","update:open"],setup(f,{emit:l}){const n=f,t=l,u=()=>{t("edit"),i.value=!1},s=()=>{t("delete"),i.value=!1},i=y.useVModel(n,"open",t,{passive:n.open===void 0});return(p,o)=>(e.openBlock(),e.createBlock(e.unref(U._sfc_main),e.mergeProps(n,{open:e.unref(i),"onUpdate:open":o[0]||(o[0]=h=>e.isRef(i)?i.value=h:null),placement:"bottom-end",sideOffset:3,trigger:"click",openDelay:0}),{content:e.withCtx(()=>[e.createVNode(O._sfc_main,{style:{width:"116px"}},{default:e.withCtx(()=>[p.hasEdit?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"edit",title:p.editText,onClick:u},{leading:e.withCtx(({iconSize:h})=>[e.createVNode(y._sfc_main$3,{icon:"tabler:edit",size:h},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0),p.hasDelete?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"delete",title:p.deleteText,danger:"",onClick:s},{leading:e.withCtx(({iconSize:h})=>[e.createVNode(y._sfc_main$3,{icon:"tabler:trash",size:h},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})]),_:1},16,["open"]))}}),te=e.defineComponent({...R.getComponentOptions("CommentReaction"),__name:"CommentReaction",props:{reference:{},open:{type:Boolean,default:void 0},icons:{},emojis:{},group:{},modelValue:{},defaultValue:{},visibleTabs:{},noTrigger:{type:Boolean},noModel:{type:Boolean},hideClear:{type:Boolean},hideColor:{type:Boolean},hideGroup:{type:Boolean},hideIcons:{type:Boolean},hideEmojis:{type:Boolean},hideSearch:{type:Boolean},hideRandom:{type:Boolean},disabled:{type:Boolean},borderless:{type:Boolean},popoverProps:{},colorPopoverProps:{},fgColorSwatchGroupProps:{},bgColorSwatchGroupProps:{},brColorSwatchGroupProps:{},visibleColorPickers:{},contentCls:{},headerCls:{},groupCls:{},searchCls:{},colorsCls:{},emptyCls:{},gridCls:{},scrollContainerProps:{},size:{},id:{},resetColorsOnChangeType:{}},emits:["reaction","update:open"],setup(f,{emit:l}){const n=f,t=l,u=i=>{t("reaction",i.value),s.value=!1},s=y.useVModel(n,"open",t,{passive:n.open===void 0});return(i,p)=>(e.openBlock(),e.createBlock(F._sfc_main,e.mergeProps(n,{noTrigger:"",hideClear:"",hideGroup:"",hideIcons:"",hideRandom:"",group:"emoji",popoverProps:{...i.popoverProps??{},reference:i.reference},placement:"bottom-end",visibleColorPickers:[],noModel:"",onSelect:u,open:e.unref(s),"onUpdate:open":p[0]||(p[0]=o=>e.isRef(s)?s.value=o:null)}),null,16,["popoverProps","open"]))}}),oe=e.defineComponent({...R.getComponentOptions("CommentMention"),__name:"CommentMention",props:{size:{},status:{},multiple:{type:Boolean},noLastValueOnPlaceholder:{type:Boolean},showLabelValueOnHeaderSearch:{type:Boolean},zIndex:{},checkbox:{type:Boolean},tagRenderMode:{},getTagProps:{type:Function},tree:{type:Boolean},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{},selectedItemIconAsTrailingIcon:{type:Boolean},maxCount:{},to:{type:[String,Function]},placeholder:{},indicatorIcon:{},options:{},getDisabled:{},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{},getSingle:{},getClear:{},getGroupOptions:{},getGroupLabel:{},getIcon:{},placement:{},reversePlacementOnDir:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{},lazyLoading:{type:Boolean},bordered:{type:Boolean},clearOnChangeMultiple:{type:Boolean},triggerCls:{},triggerLeadingCls:{},triggerContentCls:{},triggerContentPlaceholderCls:{},triggerContentValueCls:{},triggerTrailingCls:{},itemLeadingCls:{},optionCls:{},tagCls:{},popupCls:{},labelCls:{},optionsCls:{},optionTextCls:{},optionContentCls:{},emptyCls:{},skeletonCls:{},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean},popupHeight:{},popupWidth:{},minWidth:{},headerSearch:{type:Boolean},search:{},noTrigger:{type:Boolean},open:{type:Boolean},defaultOpen:{type:Boolean},resetSearchTermOnBlur:{type:Boolean},resetSearchTermOnSelect:{type:Boolean},modelValue:{},defaultValue:{},dir:{},disabled:{type:Boolean},highlightOnHover:{type:Boolean},by:{type:[String,Function]},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},reference:{},forceMount:{type:Boolean},position:{},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},defer:{type:Boolean}},emits:["mention"],setup(f,{emit:l}){const n=f,t=l,u=e.useSlots(),s=(i,p,o)=>{t("mention",i,o)};return(i,p)=>(e.openBlock(),e.createBlock(G._sfc_main,e.mergeProps(n,{modelValue:"",onSelect:s,noTrigger:""}),e.createSlots({_:2},[e.renderList(Object.keys(u),o=>({name:o,fn:e.withCtx(h=>[e.renderSlot(i.$slots,o,e.normalizeProps(e.guardReactiveProps(h)))])}))]),1040))}}),ne=e.defineComponent({...R.getComponentOptions("CommentEditor"),__name:"CommentEditor",props:{class:{},actionsCls:{},editorCls:{},footerCls:{},disabled:{type:Boolean},isEmpty:{type:Boolean},mentionsReference:{},uploadProps:{},maxHeight:{default:100}},emits:["openReaction","openMention","blur","focus","mention","submit"],setup(f,{emit:l}){const n=e.useSlots(),t=f,u=l,s=r.getBemElement(g,"editor"),i=e.ref(),p=()=>{u("openReaction",i.value)},o=e.ref(),h=()=>{u("openMention",o.value)},{rootBindings:_,inputBindings:B}=W.UseInputDataStates({getDisabled:()=>t.disabled,emit:u}),b=()=>u("submit"),c=e.computed(()=>{if(Number(t.maxHeight)>0)return`${t.maxHeight}px`;if(typeof t.maxHeight=="string")return t.maxHeight}),C=e.ref(),m=d=>{var v;(v=C.value)!=null&&v.addFiles&&d.length&&C.value.addFiles(d)};return(d,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(r.normCls)(e.unref(s),t.class)},e.unref(_)),[e.createVNode(Q._sfc_main,{overlay:!1,hasMask:!1,class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(s),"editor"),"paragraph",t.editorCls)),style:e.normalizeStyle({maxHeight:c.value})},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(B))))]),_:3},8,["class","style"]),e.createVNode(z._sfc_main,e.mergeProps({noTrigger:""},d.uploadProps,{ref_key:"uploadRef",ref:C}),e.createSlots({_:2},[e.renderList(Object.keys(e.unref(y.omit)(n,"default")),k=>({name:k,fn:e.withCtx(a=>[e.renderSlot(d.$slots,k,e.normalizeProps(e.guardReactiveProps(a)))])}))]),1040),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(s),"footer"),t.footerCls))},[e.createVNode(K._sfc_main),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(s),"actions"),t.actionsCls))},[e.createElementVNode("div",null,[e.createVNode(P._sfc_main,{icon:"tabler:at",color:"neutral",type:"ghost",ref_key:"mentionRef",ref:o,onClick:h},null,512),e.createVNode(z._sfc_main$1,{accept:"image/*",multiple:"",onAddFiles:m},{default:e.withCtx(()=>[e.createVNode(P._sfc_main,{icon:"tabler:photo",color:"neutral",type:"ghost"})]),_:1}),e.createVNode(P._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:i,onClick:p},null,512)]),e.createVNode(P._sfc_main,{disabled:d.isEmpty,icon:"tabler:arrow-up",onClick:b},null,8,["disabled"])],2)],2)],16))}}),re=["tabindex","disabled"],le=e.defineComponent({...R.getComponentOptions("CommentTrigger"),__name:"CommentTrigger",props:{class:{},text:{default:"Add a Comment or type @ to Mention..."},src:{},withShortcut:{type:Boolean},ignoeShortcut:{type:Boolean},disabled:{type:Boolean},avatarProps:{},shortcutProps:{}},emits:["add"],setup(f,{emit:l}){const n=e.useSlots(),t=f,u=l,s=r.getBemElement(g,"trigger"),i=o=>{!t.ignoeShortcut&&o.code==="KeyC"&&o.altKey&&p(o)};e.onMounted(()=>{t.withShortcut&&addEventListener("keyup",i)}),e.onBeforeUnmount(()=>{t.withShortcut&&removeEventListener("keyup",i)}),t.withShortcut;const p=o=>u("add",o);return(o,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(s),t.class)),tabindex:o.disabled?-1:0,disabled:o.disabled?"":void 0,onPointerdown:e.withModifiers(p,["stop"]),onKeyup:e.withModifiers(p,["stop"])},[e.createVNode(M._sfc_main,e.mergeProps(o.avatarProps??{},{size:"sm",src:o.src}),e.createSlots({_:2},[e.renderList(Object.keys(n),_=>({name:_,fn:e.withCtx(B=>[e.renderSlot(o.$slots,_,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040,["src"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(s),"text"))},[e.renderSlot(o.$slots,"text",{},()=>[e.createTextVNode(e.toDisplayString(o.text),1)])],2),e.createVNode(J._sfc_main,e.mergeProps(o.shortcutProps??{},{items:[{text:"Alt"},{text:"C"}]}),null,16)],42,re))}}),se=f=>{const l=e.ref(!1),n=e.ref(),t=e.ref(!1),u=(a,E=!1)=>{l.value=!0,t.value=E,n.value=a},s=e.ref(!1),i=e.ref(),p=a=>{s.value=!0,i.value=a},o=e.computed(()=>({open:l.value,reference:n.value,"onUpdate:open":a=>l.value=a,onReaction:a=>{var E,S;if(t.value)try{(E=f.addEmoji)==null||E.call(f,a)}catch(x){console.log("error on reaction ===>",x)}try{(S=f.onReaction)==null||S.call(f,a)}catch(x){console.log("error on reaction ===>",x)}}})),h=e.computed(()=>({open:s.value,reference:i.value,"onUpdate:open":a=>s.value=a})),_=e.ref(!1),B=e.ref(),b=e.ref(),c=e.ref(!1),C=e.computed(()=>({open:_.value,"onUpdate:open":a=>_.value=a,search:B.value,"onUpdate:search":a=>B.value=a,reference:b.value,headerSearch:c.value,onPointerDownOutside:d,onEscapeKeyDown:d})),m=a=>{a&&(b.value={getBoundingClientRect:a},_.value=!0,c.value=!1)},d=()=>{b.value=void 0,_.value=!1,B.value=void 0},v=a=>{B.value=a},k=e.computed(()=>({onOpenReaction:a=>u(a,!0),onOpenMention:a=>{a&&(b.value=a,_.value=!0,c.value=!0)}}));return{reactionBinding:o,actionBinding:h,editorBinding:k,mentionBinding:C,openActions:p,openReaction:u,openMentionInEditor:m,closeMentionInEditor:d,updateMentionQuery:v}};exports.Comment=Z;exports.CommentAction=ee;exports.CommentEditor=ne;exports.CommentMention=oe;exports.CommentReaction=te;exports.CommentTrigger=le;exports.commentPrefix=g;exports.injectCommentContext=N;exports.provideCommentContext=D;exports.useComment=se;
|
|
@@ -3,18 +3,18 @@ declare function __VLS_template(): {
|
|
|
3
3
|
slots: {
|
|
4
4
|
default?(_: {
|
|
5
5
|
disabled: boolean | undefined;
|
|
6
|
+
tabindex: string;
|
|
6
7
|
onClick?: undefined;
|
|
7
8
|
onKeydown?: undefined;
|
|
8
9
|
onDrop?: undefined;
|
|
9
10
|
onDragover?: undefined;
|
|
10
|
-
tabindex?: undefined;
|
|
11
11
|
} | {
|
|
12
12
|
disabled: boolean | undefined;
|
|
13
|
+
tabindex: string;
|
|
13
14
|
onClick: () => void;
|
|
14
15
|
onKeydown: (e: KeyboardEvent) => void;
|
|
15
16
|
onDrop: (e: DragEvent) => Promise<void>;
|
|
16
17
|
onDragover: (e: DragEvent) => Promise<void>;
|
|
17
|
-
tabindex: string;
|
|
18
18
|
}): any;
|
|
19
19
|
};
|
|
20
20
|
refs: {
|
package/dist/Upload/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as o, e as p, d as e, U as d, a as t, f as i, i as l, p as U, c as r, b as x, u as f } from "../Upload.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as o, e as p, d as e, U as d, a as t, f as i, i as l, p as U, c as r, b as x, u as f } from "../Upload.vue_vue_type_style_index_0_lang-DC0jVRjM.js";
|
|
2
2
|
export {
|
|
3
3
|
o as Upload,
|
|
4
4
|
p as UploadListTypes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Upload.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Upload.vue_vue_type_style_index_0_lang-oVgy1020.js");exports.Upload=e._sfc_main;exports.UploadListTypes=e.UploadListTypes;exports.UploadSizes=e.UploadSizes;exports.UploadStatuses=e.UploadStatuses;exports.UploadTrigger=e._sfc_main$1;exports.UploadTypes=e.UploadTypes;exports.injectUploadContext=e.injectUploadContext;exports.provideUploadContext=e.provideUploadContext;exports.uploadListItemPrefix=e.uploadListItemPrefix;exports.uploadListPrefix=e.uploadListPrefix;exports.uploadPrefix=e.uploadPrefix;
|
package/dist/Upload/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UploadListType, UploadSize, UploadStatus, UploadType } from './Upload.model.js';
|
|
2
2
|
import { ComputedRef, WritableComputedRef } from 'vue';
|
|
3
3
|
import { ProgressSize } from '../Progress/Progress.model.js';
|
|
4
|
+
import { ClassValue } from 'class-variance-authority/types';
|
|
4
5
|
export interface UploadFileBase {
|
|
5
6
|
uid: string;
|
|
6
7
|
percent?: number;
|
|
@@ -39,8 +40,9 @@ export interface UploadBaseProps {
|
|
|
39
40
|
multiple?: boolean;
|
|
40
41
|
disabled?: boolean;
|
|
41
42
|
accept?: string;
|
|
43
|
+
class?: ClassValue;
|
|
42
44
|
}
|
|
43
|
-
export interface UploadProps extends UploadBaseProps {
|
|
45
|
+
export interface UploadProps extends Omit<UploadBaseProps, 'class'> {
|
|
44
46
|
onDownload?: (uploadFile: UploadFile) => void;
|
|
45
47
|
parallelUpload?: boolean;
|
|
46
48
|
uploadOnSelect?: boolean;
|
|
@@ -55,6 +57,7 @@ export interface UploadProps extends UploadBaseProps {
|
|
|
55
57
|
maxCount?: number | string;
|
|
56
58
|
action: (config: UploadActionParams) => Promise<any>;
|
|
57
59
|
getFileIcon?: (file: UploadFile) => string;
|
|
60
|
+
triggerCls?: ClassValue;
|
|
58
61
|
}
|
|
59
62
|
export interface UploadEmits {
|
|
60
63
|
(e: 'update:fileList', value: UploadFile[]): void;
|