hisonvue 1.1.39 → 1.1.41
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/{HAccordion-BkEvH6Ey.mjs → HAccordion-BPdV7a2W.mjs} +2 -2
- package/dist/{HAccordion-Bb5EQl3Q.js → HAccordion-CdANXmbD.js} +1 -1
- package/dist/{HBaggie-CfeAvM0z.mjs → HBaggie-CGqKXPiZ.mjs} +2 -2
- package/dist/{HBaggie-e3WlKWB5.js → HBaggie-WCBpNoUo.js} +1 -1
- package/dist/{HBanner-CkDsf505.js → HBanner-9vR9yrV-.js} +1 -1
- package/dist/{HBanner-xCcVSety.mjs → HBanner-DbXA5COI.mjs} +2 -2
- package/dist/{HButton-BK77iM6O.mjs → HButton-BbxLtmRr.mjs} +2 -2
- package/dist/{HButton-pdDP3xI3.js → HButton-CVWLkF4B.js} +1 -1
- package/dist/{HCalendar-k8W3KKtT.js → HCalendar-DE1RLJRV.js} +1 -1
- package/dist/{HCalendar-D5o7cn04.mjs → HCalendar-DWLHVlx_.mjs} +1 -1
- package/dist/{HCaption-CVmGUpim.mjs → HCaption-4uc6nL4A.mjs} +1 -1
- package/dist/{HCaption-SDbWenvp.js → HCaption-w-X8fLBw.js} +1 -1
- package/dist/{HChart-BAZ_mje0.mjs → HChart-BDITHtsj.mjs} +1 -1
- package/dist/{HChart-Cg6WvF-m.js → HChart-DDC8arLU.js} +1 -1
- package/dist/{HDrawer-CuYTcazp.mjs → HDrawer-3GiwT60E.mjs} +1 -1
- package/dist/{HDrawer-CdXPUYKs.js → HDrawer-C1C_I6ZW.js} +1 -1
- package/dist/HDropdown-CMvFAXr9.js +1 -0
- package/dist/{HDropdown-trpRIODH.mjs → HDropdown-zB6_-GNT.mjs} +132 -114
- package/dist/{HFileset-yDnoWeFJ.mjs → HFileset-BsN3h5mB.mjs} +1 -1
- package/dist/{HFileset-CQPVTrc0.js → HFileset-CPMtrk2d.js} +1 -1
- package/dist/{HGap-DM1hp0HZ.mjs → HGap-BiAAjXc2.mjs} +1 -1
- package/dist/{HGap-D2VPEhTy.js → HGap-CAEmqnLB.js} +1 -1
- package/dist/{HGrid-9WW04j6i.js → HGrid-7a376g49.js} +1 -1
- package/dist/{HGrid-OT55Vyqy.mjs → HGrid-BbgsmcyM.mjs} +1 -1
- package/dist/{HImagebox-Dn6okVVd.js → HImagebox-YkMSH8t3.js} +1 -1
- package/dist/{HImagebox-DXnfszdl.mjs → HImagebox-wFCbPtEa.mjs} +1 -1
- package/dist/{HInput-DxqBZopO.mjs → HInput-CeSjeLqo.mjs} +108 -106
- package/dist/HInput-xg-pCCTH.js +1 -0
- package/dist/{HInputGroup-CMOBOaIy.js → HInputGroup-B5PxqG3_.js} +1 -1
- package/dist/{HInputGroup-kjL_gkY3.mjs → HInputGroup-DOFwnbQY.mjs} +1 -1
- package/dist/{HLabel-CdRo92gc.js → HLabel-CafqKGdK.js} +1 -1
- package/dist/{HLabel-CuOsomVK.mjs → HLabel-CyBFpiBi.mjs} +2 -2
- package/dist/{HLayout-BCjLoYqu.js → HLayout-CZ_Lavhh.js} +1 -1
- package/dist/{HLayout-SDUsOGH9.mjs → HLayout-Cqr_6VcR.mjs} +1 -1
- package/dist/{HList-BARBWvNB.js → HList-DRtW3MYz.js} +1 -1
- package/dist/{HList-Cebfzf83.mjs → HList-DTAkipAc.mjs} +2 -2
- package/dist/{HModal-BPmK-z7W.mjs → HModal-BLmtVwQ4.mjs} +1 -1
- package/dist/{HModal-BQC6Dwcw.js → HModal-CHWez8oN.js} +1 -1
- package/dist/{HNote-DpqAofRU.js → HNote-CYQTP_XV.js} +1 -1
- package/dist/{HNote-DcZpFM82.mjs → HNote-DHegRrB6.mjs} +1 -1
- package/dist/{HPagination-DzGUrGXP.mjs → HPagination-CjT_YrHm.mjs} +2 -2
- package/dist/{HPagination-v-NFDeDA.js → HPagination-Dj3BGXk-.js} +1 -1
- package/dist/{HParagraph-W9TnHmze.mjs → HParagraph-BcYzFF2n.mjs} +1 -1
- package/dist/{HParagraph-CdOVGIlk.js → HParagraph-C9pHDlin.js} +1 -1
- package/dist/{HPopup-CXxinQhO.mjs → HPopup-BvtPV72x.mjs} +1 -1
- package/dist/{HPopup-CNt-lvtH.js → HPopup-C54E3Anx.js} +1 -1
- package/dist/{HSpinner-meptBXhz.js → HSpinner-BD3SWWOl.js} +1 -1
- package/dist/{HSpinner-DsolJ5Oc.mjs → HSpinner-CRrlblv4.mjs} +1 -1
- package/dist/{HTable-f_QsXz2G.mjs → HTable-D9Ls6N7P.mjs} +1 -1
- package/dist/{HTable-TGIonXp7.js → HTable-XVuifCzm.js} +1 -1
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.css +1 -1
- package/dist/hisonvue.d.ts +34 -0
- package/dist/hisonvue.es.js +2 -2
- package/dist/{index-DvM-XIAr.js → index-B79IAYbU.js} +1 -1
- package/dist/{index-CjHzPazZ.mjs → index-Btyg21iV.mjs} +1 -1
- package/dist/{setButtonCssEvent-C2lqu16u.js → setButtonCssEvent-Dz8jsNwB.js} +1 -1
- package/dist/{setButtonCssEvent-DzgOFy1K.mjs → setButtonCssEvent-b8kbf0T8.mjs} +1 -1
- package/package.json +1 -1
- package/dist/HDropdown-Crtq97na.js +0 -1
- package/dist/HInput-D-WhZgWg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./index-B79IAYbU.js"),Z=require("./setButtonCssEvent-Dz8jsNwB.js"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.js"),fe={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},toggleStyle:{type:[String,Object,Array],required:!1},menuStyle:{type:[String,Object,Array],required:!1},itemStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},editMode:{type:String,default:o.EditMode.editable,validator:n=>o.EDIT_MODE_VALUES.includes(n)},placeholder:{type:String,default:""},trigger:{type:String,default:o.DropdownTrigger.click,validator:n=>o.DROPDOWN_TRIGGER_VALUES.includes(n)},modelValue:{type:Object,required:!0},maxHeight:{type:Number,default:240,validator:n=>Number.isFinite(n)&&n>=0},closeOnSelect:{type:Boolean,default:!0},textAlign:{type:String,default:o.TextAlign.left,validator:n=>o.TEXT_ALIGN_VALUES.includes(n)},animate:{type:Boolean,default:!0},duration:{type:Number,default:500,validator:n=>Number.isFinite(n)&&n>=0},easing:{type:String,default:"ease"},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)},zIndex:{type:Number,default:1050}},me=t.defineComponent({name:"HDropdown",props:fe,inheritAttrs:!1,emits:["mounted","responsive-change","open","close","toggle-click","item-click","change","update:modelValue"],setup(n,{emit:i}){var Y,W;const g=n.id||o.getUUID(),V=`hdropdown:${g}`,s=t.ref(null),p=t.ref(null),a=o.useDevice(),r=t.ref(!1),c=t.ref(((Y=n.modelValue)==null?void 0:Y.options)??[]),d=t.ref(((W=n.modelValue)==null?void 0:W.value)??null),y=t.ref(!!n.visible),b=t.ref(n.editMode),S=t.computed(()=>b.value===o.EditMode.disable),C=t.computed(()=>b.value===o.EditMode.readonly),B=t.ref(n.placeholder||""),T=t.ref(n.trigger),N=t.ref(n.textAlign??o.TextAlign.left),J=t.computed(()=>({textAlign:N.value})),A=t.ref(n.animate??!0),E=t.ref(n.duration??500),k=t.ref(n.easing??"ease"),x=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),I=t.ref(n.zIndex??1100),Q=t.computed(()=>({"--hdd-duration":`${E.value}ms`,"--hdd-easing":k.value})),_=t.computed(()=>y.value?"":"hison-display-none"),ee=t.computed(()=>S.value?"hison-disable":""),te=t.computed(()=>C.value?"hison-readonly":""),L=t.ref([]),D=()=>{L.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",a.value),o.addComponentNameToClass(L.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(L.value,"color","primary")},F=t.computed(()=>c.value.find(e=>e.value===d.value)??null),j=t.computed(()=>{var e;return((e=F.value)==null?void 0:e.label)??""}),h=t.ref(n.maxHeight??240),ne=t.computed(()=>({maxHeight:`${h.value}px`,overflowY:"auto"})),O=t.ref(n.closeOnSelect??!0),le=t.computed(()=>{const e=c.value.findIndex(l=>l.value===d.value);return e>=0?`opt-${e}`:void 0}),U=t.ref({}),w=t.ref(!0),z=0,oe=120;function ie(){if(!p.value)return 0;const e=p.value.querySelector(".hison-dropdown-panel-inner");return e&&e.scrollHeight||0}function u(){if(!r.value||!s.value)return;const e=s.value.getBoundingClientRect(),l=window.innerHeight,v=e.width,m=e.left,X=l-e.bottom,re=e.top;w.value=X>=oe;const ue=ie(),de=w.value?X-z:re-z,q=Math.max(0,Math.min(ue||h.value,h.value,de)),ce=w.value?e.bottom+z:e.top-q-z,ve=getComputedStyle(s.value).fontSize||"inherit";U.value={position:"fixed",left:`${m}px`,top:`${ce}px`,width:`${v}px`,height:w.value?"auto":`${q}px`,maxHeight:`${q}px`,overflowY:"auto",zIndex:String(I.value),fontSize:ve,transformOrigin:w.value?"top center":"bottom center"}}function H(){r.value&&u()}const P=e=>{if(!r.value)return;const l=e.target,v=!!s.value&&!!l&&s.value.contains(l),m=!!p.value&&!!l&&p.value.contains(l);!v&&!m&&M()},$=e=>{S.value||C.value||!y.value||r.value||(r.value=!0,t.nextTick(()=>{u(),requestAnimationFrame(()=>u())}),i("open",e??null,f.value))},M=e=>{var m;if(!r.value)return;const l=document.activeElement,v=p.value;v&&l&&v.contains(l)&&((m=s.value)==null||m.focus()),r.value=!1,i("close",e??null,f.value)},R=e=>r.value?M(e):$(e),ae=e=>{T.value==="click"&&(S.value||C.value||(i("toggle-click",e,f.value),R(e)))},se=(e,l)=>{if(e.disabled||S.value||C.value)return;l&&i("item-click",l,f.value,e);const v=d.value;if(e.value!==v){d.value=e.value;const m={value:d.value,options:t.unref(c)};i("update:modelValue",m),i("change",v,d.value,f.value)}O.value&&M(l)},f=t.ref(null),G=()=>{o.hisonCloser.component.dropdownList[g]&&o.hisonCloser.component.dropdownList[g].isHisonvueComponent&&console.warn(`[Hisonvue] The dropdown ID is at risk of being duplicated. ${g}`),o.registerReloadable(V,()=>{K(),t.nextTick(G)}),s.value&&Z.addButtonCssEvent(s.value),D(),f.value={isHisonvueComponent:!0,getId:()=>g,getType:()=>"dropdown",isVisible:()=>y.value,setVisible:e=>{y.value=e},getEditMode:()=>b.value,setEditMode:e=>{b.value=e},isOpen:()=>r.value,open:$,close:M,toggle:R,getValue:()=>d.value,setValue:e=>{d.value=e},getText:()=>j.value,getOptions:()=>t.unref(c),setOptions:e=>{c.value=Array.isArray(e)?e:[]},setTriggerType:e=>{T.value=e},getMaxHeight:()=>h.value,setMaxHeight:e=>{const l=Number(e);!Number.isFinite(l)||l<0||(h.value=l,t.nextTick(u))},isCloseOnSelect:()=>O.value,setCloseOnSelect:e=>{O.value=!!e},getTextAlign:()=>N.value,setTextAlign:e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(N.value=e,t.nextTick(u))},getAnimate:()=>A.value,setAnimate:e=>{A.value=!!e},getDuration:()=>E.value,setDuration:e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&(E.value=l)},getEasing:()=>k.value,setEasing:e=>{typeof e=="string"&&(k.value=e)},getTabIndex:()=>x.value,setTabIndex:e=>{x.value=e!=null?Number(e):null},getZIndex:()=>I.value,setZIndex:e=>{I.value=e},focus:()=>{var e;(e=s.value)==null||e.focus()},reload:()=>o.reloadHisonComponent(V)},o.hisonCloser.component.dropdownList[g]=f.value,document.addEventListener("pointerdown",P),window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),t.nextTick(u),i("mounted",f.value)},K=()=>{var e;o.unregisterReloadable(V);try{document.removeEventListener("pointerdown",P)}catch{}try{window.removeEventListener("scroll",H,!0)}catch{}try{window.removeEventListener("resize",H)}catch{}s.value&&Z.removeButtonCssEvent(s.value),(e=o.hisonCloser.component)!=null&&e.dropdownList&&delete o.hisonCloser.component.dropdownList[g]};return t.onMounted(G),t.onBeforeUnmount(K),t.watch(()=>n.modelValue,e=>{!e||typeof e!="object"||(Array.isArray(e.options)&&(c.value=e.options),d.value=e.value,t.nextTick(u))},{deep:!0}),t.watch(a,e=>{D(),i("responsive-change",e),t.nextTick(u)}),t.watch(()=>n.visible,e=>{!!e!==y.value&&(y.value=!!e)}),t.watch(()=>n.editMode,e=>{e&&e!==b.value&&(b.value=e)}),t.watch(()=>n.placeholder,e=>{const l=e??"";l!==B.value&&(B.value=l)}),t.watch(()=>n.trigger,e=>{e&&e!==T.value&&(T.value=e)}),t.watch(()=>n.textAlign,e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&e!==N.value&&(N.value=e,t.nextTick(u))}),t.watch(()=>n.animate,e=>{const l=!!e;l!==A.value&&(A.value=l)}),t.watch(()=>n.duration,e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&l!==E.value&&(E.value=l)}),t.watch(()=>n.easing,e=>{const l=typeof e=="string"?e:"ease";l!==k.value&&(k.value=l)}),t.watch(()=>n.tabIndex,e=>{const l=e===null||e===""?null:Number(e);l!==x.value&&(x.value=l)}),t.watch(()=>n.maxHeight,e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&l!==h.value&&(h.value=l,t.nextTick(u))}),t.watch(()=>n.closeOnSelect,e=>{const l=!!e;l!==O.value&&(O.value=l)}),t.watch(()=>n.class,()=>{D(),t.nextTick(u)}),t.watch(()=>n.zIndex,e=>{const l=Number(e);Number.isFinite(l)&&l!==I.value&&(I.value=l)}),{toggleRef:s,menuRef:p,props:n,isDisabled:S,isReadonly:C,visibleClass:_,disableClass:ee,readonlyClass:te,responsiveClassList:L,isOpen:r,trigger:T,selectedValue:d,selectedOption:F,selectedLabel:j,placeholder:B,activeDescId:le,menuInlineStyle:ne,options:c,animate:A,rootInlineStyle:Q,tabIndex:x,fixedMenuStyle:U,openBelow:w,onToggleClick:ae,onSelect:se,textAlignStyle:J,open:$,close:M,toggle:R}}}),pe=["aria-expanded","aria-disabled","tabindex"],he={class:"hison-dropdown-label"},ye=["aria-activedescendant","inert"],be={class:"hison-dropdown-panel"},we=["aria-selected","onClick"],Se={key:0,class:"hison-dropdown-empty"};function Ce(n,i,g,V,s,p){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-dropdown",...n.responsiveClassList,n.visibleClass,n.disableClass,n.readonlyClass,n.isOpen?"hison-open":"",n.animate?"":"hison-no-anim"]),style:t.normalizeStyle([n.rootInlineStyle,n.props.style]),onMouseenter:i[3]||(i[3]=a=>n.trigger==="hover"?n.open(a):null),onMouseleave:i[4]||(i[4]=a=>n.trigger==="hover"?n.close(a):null)},[t.createElementVNode("div",{ref:"toggleRef",class:t.normalizeClass(["hison-dropdown-toggle",[n.isDisabled?"hison-disable":"",n.isReadonly?"hison-readonly":""]]),"aria-expanded":n.isOpen,role:"combobox","aria-disabled":n.isDisabled||n.isReadonly?"true":"false",tabindex:n.tabIndex??void 0,style:t.normalizeStyle([n.textAlignStyle,n.props.toggleStyle]),onClick:i[0]||(i[0]=a=>n.onToggleClick(a)),onKeydown:[i[1]||(i[1]=t.withKeys(t.withModifiers(a=>n.onToggleClick(a),["prevent"]),["enter"])),i[2]||(i[2]=t.withKeys(t.withModifiers(a=>n.onToggleClick(a),["prevent"]),["space"]))]},[t.createElementVNode("span",he,[t.renderSlot(n.$slots,"toggle-label",{option:n.selectedOption,label:n.selectedLabel,placeholder:n.placeholder},()=>[t.createTextVNode(t.toDisplayString(n.selectedLabel||n.placeholder),1)])]),t.renderSlot(n.$slots,"caret",{},()=>[i[5]||(i[5]=t.createElementVNode("span",{class:"hison-dropdown-caret"},"▾",-1))])],46,pe),t.createElementVNode("div",{ref:"menuRef",class:t.normalizeClass(["hison-dropdown-menu hison-dropdown-menu-fixed",[n.isOpen?"hison-open":"",n.openBelow?"hison-open-below":"hison-open-above"]]),style:t.normalizeStyle([n.fixedMenuStyle,n.textAlignStyle,n.props.menuStyle]),role:"listbox","aria-activedescendant":n.activeDescId,inert:!n.isOpen||void 0},[t.createElementVNode("div",be,[t.createElementVNode("div",{class:"hison-dropdown-panel-inner",style:t.normalizeStyle(n.menuInlineStyle)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.options,(a,r)=>(t.openBlock(),t.createElementBlock("div",{key:`opt-${r}`,class:t.normalizeClass(["hison-dropdown-item",[a.disabled?"hison-disable":"",a.value===n.selectedValue?"hison-selected":""]]),style:t.normalizeStyle(n.props.itemStyle),role:"option","aria-selected":a.value===n.selectedValue?"true":"false",onClick:c=>n.onSelect(a,c)},[t.renderSlot(n.$slots,"item",{option:a,index:r,selected:a.value===n.selectedValue},()=>[t.createTextVNode(t.toDisplayString(a.label),1)])],14,we))),128)),n.options.length===0?(t.openBlock(),t.createElementBlock("div",Se,"No options")):t.createCommentVNode("",!0)],4)])],14,ye)],38)}const Te=ge._export_sfc(me,[["render",Ce]]);exports.default=Te;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { y
|
|
3
|
-
import { a as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as Me, ref as o, computed as d, onMounted as Le, onBeforeUnmount as Ve, watch as i, nextTick as c, unref as se, openBlock as j, createElementBlock as U, normalizeStyle as R, normalizeClass as P, createElementVNode as A, withKeys as ue, withModifiers as re, renderSlot as Z, createTextVNode as de, toDisplayString as ve, Fragment as De, renderList as He, createCommentVNode as ke } from "vue";
|
|
2
|
+
import { y, D as $e, E as J, T as xe, z as Re, A as ze, g as Be, u as Fe, e as qe, t as je, b as ce, h as N, r as Ue, c as Pe, d as Ge } from "./index-Btyg21iV.mjs";
|
|
3
|
+
import { a as Ye, r as Ke } from "./setButtonCssEvent-b8kbf0T8.mjs";
|
|
4
|
+
import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const Xe = {
|
|
6
6
|
/**
|
|
7
7
|
* Unique identifier for the dropdown instance.
|
|
8
8
|
* - Retrieve methods via `hison.component.getDropdown(id)`
|
|
@@ -56,8 +56,8 @@ const Ke = {
|
|
|
56
56
|
*/
|
|
57
57
|
editMode: {
|
|
58
58
|
type: String,
|
|
59
|
-
default:
|
|
60
|
-
validator: (n) =>
|
|
59
|
+
default: J.editable,
|
|
60
|
+
validator: (n) => ze.includes(n)
|
|
61
61
|
},
|
|
62
62
|
/**
|
|
63
63
|
* Placeholder text shown when no value selected
|
|
@@ -70,13 +70,14 @@ const Ke = {
|
|
|
70
70
|
*/
|
|
71
71
|
trigger: {
|
|
72
72
|
type: String,
|
|
73
|
-
default:
|
|
74
|
-
validator: (n) =>
|
|
73
|
+
default: $e.click,
|
|
74
|
+
validator: (n) => Re.includes(n)
|
|
75
75
|
},
|
|
76
76
|
/**
|
|
77
77
|
* Model: { value, options }
|
|
78
78
|
* - value: selected value
|
|
79
|
-
* - options: array of { label, value, disabled
|
|
79
|
+
* - options: array of { label, value, disabled?, ...customFields }
|
|
80
|
+
* (custom fields are passed through to the `item` / `toggle-label` scoped slots)
|
|
80
81
|
* - Supports v-model
|
|
81
82
|
*/
|
|
82
83
|
modelValue: { type: Object, required: !0 },
|
|
@@ -99,8 +100,8 @@ const Ke = {
|
|
|
99
100
|
*/
|
|
100
101
|
textAlign: {
|
|
101
102
|
type: String,
|
|
102
|
-
default:
|
|
103
|
-
validator: (n) =>
|
|
103
|
+
default: y.left,
|
|
104
|
+
validator: (n) => xe.includes(n)
|
|
104
105
|
},
|
|
105
106
|
/**
|
|
106
107
|
* Animate menu open/close & caret rotation.
|
|
@@ -136,44 +137,44 @@ const Ke = {
|
|
|
136
137
|
* - Default: `1100`
|
|
137
138
|
*/
|
|
138
139
|
zIndex: { type: Number, default: 1050 }
|
|
139
|
-
},
|
|
140
|
+
}, Ze = Me({
|
|
140
141
|
name: "HDropdown",
|
|
141
|
-
props:
|
|
142
|
+
props: Xe,
|
|
142
143
|
inheritAttrs: !1,
|
|
143
144
|
emits: ["mounted", "responsive-change", "open", "close", "toggle-click", "item-click", "change", "update:modelValue"],
|
|
144
145
|
setup(n, { emit: l }) {
|
|
145
|
-
var
|
|
146
|
-
const m = n.id ||
|
|
146
|
+
var oe, ae;
|
|
147
|
+
const m = n.id || Be(), z = `hdropdown:${m}`, s = o(null), h = o(null), a = Fe(), u = o(!1), g = o(((oe = n.modelValue) == null ? void 0 : oe.options) ?? []), v = o(((ae = n.modelValue) == null ? void 0 : ae.value) ?? null), S = o(!!n.visible), C = o(n.editMode), O = d(() => C.value === J.disable), E = d(() => C.value === J.readonly), G = o(n.placeholder || ""), T = o(n.trigger), M = o(n.textAlign ?? y.left), ge = d(() => ({ textAlign: M.value })), L = o(n.animate ?? !0), V = o(n.duration ?? 500), D = o(n.easing ?? "ease"), H = o(
|
|
147
148
|
n.tabIndex !== null && n.tabIndex !== "" ? Number(n.tabIndex) : null
|
|
148
|
-
), k = o(n.zIndex ?? 1100),
|
|
149
|
-
"--hdd-duration": `${
|
|
149
|
+
), k = o(n.zIndex ?? 1100), fe = d(() => ({
|
|
150
|
+
"--hdd-duration": `${V.value}ms`,
|
|
150
151
|
"--hdd-easing": D.value
|
|
151
|
-
})),
|
|
152
|
-
B.value =
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
return (e == null ? void 0 : e.label) ?? "";
|
|
156
|
-
}), w = o(n.maxHeight ?? 240),
|
|
152
|
+
})), me = d(() => S.value ? "" : "hison-display-none"), pe = d(() => O.value ? "hison-disable" : ""), be = d(() => E.value ? "hison-readonly" : ""), B = o([]), Y = () => {
|
|
153
|
+
B.value = qe(je(n.class) || "", a.value), ce(B.value, "size", N.componentStyle.size), ce(B.value, "color", "primary");
|
|
154
|
+
}, Q = d(() => g.value.find((e) => e.value === v.value) ?? null), _ = d(() => {
|
|
155
|
+
var e;
|
|
156
|
+
return ((e = Q.value) == null ? void 0 : e.label) ?? "";
|
|
157
|
+
}), w = o(n.maxHeight ?? 240), ye = d(() => ({
|
|
157
158
|
maxHeight: `${w.value}px`,
|
|
158
159
|
overflowY: "auto"
|
|
159
|
-
})),
|
|
160
|
-
const e = g.value.findIndex((t) => t.value ===
|
|
160
|
+
})), $ = o(n.closeOnSelect ?? !0), he = d(() => {
|
|
161
|
+
const e = g.value.findIndex((t) => t.value === v.value);
|
|
161
162
|
return e >= 0 ? `opt-${e}` : void 0;
|
|
162
|
-
}),
|
|
163
|
-
function
|
|
163
|
+
}), ee = o({}), I = o(!0), F = 0, we = 120;
|
|
164
|
+
function Se() {
|
|
164
165
|
if (!h.value) return 0;
|
|
165
166
|
const e = h.value.querySelector(".hison-dropdown-panel-inner");
|
|
166
167
|
return e && e.scrollHeight || 0;
|
|
167
168
|
}
|
|
168
169
|
function r() {
|
|
169
170
|
if (!u.value || !s.value) return;
|
|
170
|
-
const e = s.value.getBoundingClientRect(), t = window.innerHeight, f = e.width,
|
|
171
|
-
I.value =
|
|
172
|
-
const
|
|
173
|
-
|
|
171
|
+
const e = s.value.getBoundingClientRect(), t = window.innerHeight, f = e.width, b = e.left, ie = t - e.bottom, Ae = e.top;
|
|
172
|
+
I.value = ie >= we;
|
|
173
|
+
const Ne = Se(), Oe = I.value ? ie - F : Ae - F, X = Math.max(0, Math.min(Ne || w.value, w.value, Oe)), Ee = I.value ? e.bottom + F : e.top - X - F, Te = getComputedStyle(s.value).fontSize || "inherit";
|
|
174
|
+
ee.value = {
|
|
174
175
|
position: "fixed",
|
|
175
|
-
left: `${
|
|
176
|
-
top: `${
|
|
176
|
+
left: `${b}px`,
|
|
177
|
+
top: `${Ee}px`,
|
|
177
178
|
width: `${f}px`,
|
|
178
179
|
// 중요: 위로 열릴 때는 컨테이너 높이를 '고정'해서 기준점이 안 흔들리게
|
|
179
180
|
// (아래로 열릴 때는 auto여도 무방)
|
|
@@ -181,42 +182,42 @@ const Ke = {
|
|
|
181
182
|
maxHeight: `${X}px`,
|
|
182
183
|
overflowY: "auto",
|
|
183
184
|
zIndex: String(k.value),
|
|
184
|
-
fontSize:
|
|
185
|
+
fontSize: Te,
|
|
185
186
|
transformOrigin: I.value ? "top center" : "bottom center"
|
|
186
187
|
};
|
|
187
188
|
}
|
|
188
189
|
function q() {
|
|
189
190
|
u.value && r();
|
|
190
191
|
}
|
|
191
|
-
const
|
|
192
|
+
const ne = (e) => {
|
|
192
193
|
if (!u.value) return;
|
|
193
|
-
const t = e.target, f = !!s.value && !!t && s.value.contains(t),
|
|
194
|
-
!f && !
|
|
194
|
+
const t = e.target, f = !!s.value && !!t && s.value.contains(t), b = !!h.value && !!t && h.value.contains(t);
|
|
195
|
+
!f && !b && x();
|
|
195
196
|
}, K = (e) => {
|
|
196
197
|
O.value || E.value || !S.value || u.value || (u.value = !0, c(() => {
|
|
197
198
|
r(), requestAnimationFrame(() => r());
|
|
198
199
|
}), l("open", e ?? null, p.value));
|
|
199
|
-
},
|
|
200
|
-
var
|
|
200
|
+
}, x = (e) => {
|
|
201
|
+
var b;
|
|
201
202
|
if (!u.value) return;
|
|
202
203
|
const t = document.activeElement, f = h.value;
|
|
203
|
-
f && t && f.contains(t) && ((
|
|
204
|
-
}, W = (e) => u.value ?
|
|
205
|
-
|
|
206
|
-
},
|
|
204
|
+
f && t && f.contains(t) && ((b = s.value) == null || b.focus()), u.value = !1, l("close", e ?? null, p.value);
|
|
205
|
+
}, W = (e) => u.value ? x(e) : K(e), Ce = (e) => {
|
|
206
|
+
T.value === "click" && (O.value || E.value || (l("toggle-click", e, p.value), W(e)));
|
|
207
|
+
}, Ie = (e, t) => {
|
|
207
208
|
if (e.disabled || O.value || E.value) return;
|
|
208
209
|
t && l("item-click", t, p.value, e);
|
|
209
|
-
const f =
|
|
210
|
+
const f = v.value;
|
|
210
211
|
if (e.value !== f) {
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
l("update:modelValue",
|
|
212
|
+
v.value = e.value;
|
|
213
|
+
const b = { value: v.value, options: se(g) };
|
|
214
|
+
l("update:modelValue", b), l("change", f, v.value, p.value);
|
|
214
215
|
}
|
|
215
|
-
|
|
216
|
-
}, p = o(null),
|
|
217
|
-
N.component.dropdownList[m] && N.component.dropdownList[m].isHisonvueComponent && console.warn(`[Hisonvue] The dropdown ID is at risk of being duplicated. ${m}`),
|
|
218
|
-
|
|
219
|
-
}), s.value &&
|
|
216
|
+
$.value && x(t);
|
|
217
|
+
}, p = o(null), te = () => {
|
|
218
|
+
N.component.dropdownList[m] && N.component.dropdownList[m].isHisonvueComponent && console.warn(`[Hisonvue] The dropdown ID is at risk of being duplicated. ${m}`), Ue(z, () => {
|
|
219
|
+
le(), c(te);
|
|
220
|
+
}), s.value && Ye(s.value), Y(), p.value = {
|
|
220
221
|
isHisonvueComponent: !0,
|
|
221
222
|
getId: () => m,
|
|
222
223
|
getType: () => "dropdown",
|
|
@@ -230,41 +231,41 @@ const Ke = {
|
|
|
230
231
|
},
|
|
231
232
|
isOpen: () => u.value,
|
|
232
233
|
open: K,
|
|
233
|
-
close:
|
|
234
|
+
close: x,
|
|
234
235
|
toggle: W,
|
|
235
|
-
getValue: () =>
|
|
236
|
+
getValue: () => v.value,
|
|
236
237
|
setValue: (e) => {
|
|
237
|
-
|
|
238
|
+
v.value = e;
|
|
238
239
|
},
|
|
239
|
-
getText: () =>
|
|
240
|
-
getOptions: () =>
|
|
240
|
+
getText: () => _.value,
|
|
241
|
+
getOptions: () => se(g),
|
|
241
242
|
setOptions: (e) => {
|
|
242
243
|
g.value = Array.isArray(e) ? e : [];
|
|
243
244
|
},
|
|
244
245
|
setTriggerType: (e) => {
|
|
245
|
-
|
|
246
|
+
T.value = e;
|
|
246
247
|
},
|
|
247
248
|
getMaxHeight: () => w.value,
|
|
248
249
|
setMaxHeight: (e) => {
|
|
249
250
|
const t = Number(e);
|
|
250
251
|
!Number.isFinite(t) || t < 0 || (w.value = t, c(r));
|
|
251
252
|
},
|
|
252
|
-
isCloseOnSelect: () =>
|
|
253
|
+
isCloseOnSelect: () => $.value,
|
|
253
254
|
setCloseOnSelect: (e) => {
|
|
254
|
-
|
|
255
|
+
$.value = !!e;
|
|
255
256
|
},
|
|
256
|
-
getTextAlign: () =>
|
|
257
|
+
getTextAlign: () => M.value,
|
|
257
258
|
setTextAlign: (e) => {
|
|
258
|
-
(e ===
|
|
259
|
+
(e === y.left || e === y.center || e === y.right) && (M.value = e, c(r));
|
|
259
260
|
},
|
|
260
|
-
getAnimate: () =>
|
|
261
|
+
getAnimate: () => L.value,
|
|
261
262
|
setAnimate: (e) => {
|
|
262
|
-
|
|
263
|
+
L.value = !!e;
|
|
263
264
|
},
|
|
264
|
-
getDuration: () =>
|
|
265
|
+
getDuration: () => V.value,
|
|
265
266
|
setDuration: (e) => {
|
|
266
267
|
const t = Number(e);
|
|
267
|
-
Number.isFinite(t) && t >= 0 && (
|
|
268
|
+
Number.isFinite(t) && t >= 0 && (V.value = t);
|
|
268
269
|
},
|
|
269
270
|
getEasing: () => D.value,
|
|
270
271
|
setEasing: (e) => {
|
|
@@ -282,13 +283,13 @@ const Ke = {
|
|
|
282
283
|
var e;
|
|
283
284
|
(e = s.value) == null || e.focus();
|
|
284
285
|
},
|
|
285
|
-
reload: () =>
|
|
286
|
-
}, N.component.dropdownList[m] = p.value, document.addEventListener("pointerdown",
|
|
287
|
-
},
|
|
286
|
+
reload: () => Pe(z)
|
|
287
|
+
}, N.component.dropdownList[m] = p.value, document.addEventListener("pointerdown", ne), window.addEventListener("scroll", q, !0), window.addEventListener("resize", q), c(r), l("mounted", p.value);
|
|
288
|
+
}, le = () => {
|
|
288
289
|
var e;
|
|
289
|
-
|
|
290
|
+
Ge(z);
|
|
290
291
|
try {
|
|
291
|
-
document.removeEventListener("pointerdown",
|
|
292
|
+
document.removeEventListener("pointerdown", ne);
|
|
292
293
|
} catch {
|
|
293
294
|
}
|
|
294
295
|
try {
|
|
@@ -299,10 +300,10 @@ const Ke = {
|
|
|
299
300
|
window.removeEventListener("resize", q);
|
|
300
301
|
} catch {
|
|
301
302
|
}
|
|
302
|
-
s.value &&
|
|
303
|
+
s.value && Ke(s.value), (e = N.component) != null && e.dropdownList && delete N.component.dropdownList[m];
|
|
303
304
|
};
|
|
304
|
-
return
|
|
305
|
-
!e || typeof e != "object" || (Array.isArray(e.options) && (g.value = e.options),
|
|
305
|
+
return Le(te), Ve(le), i(() => n.modelValue, (e) => {
|
|
306
|
+
!e || typeof e != "object" || (Array.isArray(e.options) && (g.value = e.options), v.value = e.value, c(r));
|
|
306
307
|
}, { deep: !0 }), i(a, (e) => {
|
|
307
308
|
Y(), l("responsive-change", e), c(r);
|
|
308
309
|
}), i(() => n.visible, (e) => {
|
|
@@ -313,15 +314,15 @@ const Ke = {
|
|
|
313
314
|
const t = e ?? "";
|
|
314
315
|
t !== G.value && (G.value = t);
|
|
315
316
|
}), i(() => n.trigger, (e) => {
|
|
316
|
-
e && e !==
|
|
317
|
+
e && e !== T.value && (T.value = e);
|
|
317
318
|
}), i(() => n.textAlign, (e) => {
|
|
318
|
-
(e ===
|
|
319
|
+
(e === y.left || e === y.center || e === y.right) && e !== M.value && (M.value = e, c(r));
|
|
319
320
|
}), i(() => n.animate, (e) => {
|
|
320
321
|
const t = !!e;
|
|
321
|
-
t !==
|
|
322
|
+
t !== L.value && (L.value = t);
|
|
322
323
|
}), i(() => n.duration, (e) => {
|
|
323
324
|
const t = Number(e);
|
|
324
|
-
Number.isFinite(t) && t >= 0 && t !==
|
|
325
|
+
Number.isFinite(t) && t >= 0 && t !== V.value && (V.value = t);
|
|
325
326
|
}), i(() => n.easing, (e) => {
|
|
326
327
|
const t = typeof e == "string" ? e : "ease";
|
|
327
328
|
t !== D.value && (D.value = t);
|
|
@@ -333,7 +334,7 @@ const Ke = {
|
|
|
333
334
|
Number.isFinite(t) && t >= 0 && t !== w.value && (w.value = t, c(r));
|
|
334
335
|
}), i(() => n.closeOnSelect, (e) => {
|
|
335
336
|
const t = !!e;
|
|
336
|
-
t !==
|
|
337
|
+
t !== $.value && ($.value = t);
|
|
337
338
|
}), i(() => n.class, () => {
|
|
338
339
|
Y(), c(r);
|
|
339
340
|
}), i(() => n.zIndex, (e) => {
|
|
@@ -345,36 +346,37 @@ const Ke = {
|
|
|
345
346
|
props: n,
|
|
346
347
|
isDisabled: O,
|
|
347
348
|
isReadonly: E,
|
|
348
|
-
visibleClass:
|
|
349
|
-
disableClass:
|
|
350
|
-
readonlyClass:
|
|
349
|
+
visibleClass: me,
|
|
350
|
+
disableClass: pe,
|
|
351
|
+
readonlyClass: be,
|
|
351
352
|
responsiveClassList: B,
|
|
352
353
|
isOpen: u,
|
|
353
|
-
trigger:
|
|
354
|
-
selectedValue:
|
|
355
|
-
|
|
354
|
+
trigger: T,
|
|
355
|
+
selectedValue: v,
|
|
356
|
+
selectedOption: Q,
|
|
357
|
+
selectedLabel: _,
|
|
356
358
|
placeholder: G,
|
|
357
|
-
activeDescId:
|
|
358
|
-
menuInlineStyle:
|
|
359
|
+
activeDescId: he,
|
|
360
|
+
menuInlineStyle: ye,
|
|
359
361
|
options: g,
|
|
360
|
-
animate:
|
|
361
|
-
rootInlineStyle:
|
|
362
|
+
animate: L,
|
|
363
|
+
rootInlineStyle: fe,
|
|
362
364
|
tabIndex: H,
|
|
363
|
-
fixedMenuStyle:
|
|
365
|
+
fixedMenuStyle: ee,
|
|
364
366
|
openBelow: I,
|
|
365
|
-
onToggleClick:
|
|
366
|
-
onSelect:
|
|
367
|
-
textAlignStyle:
|
|
367
|
+
onToggleClick: Ce,
|
|
368
|
+
onSelect: Ie,
|
|
369
|
+
textAlignStyle: ge,
|
|
368
370
|
open: K,
|
|
369
|
-
close:
|
|
371
|
+
close: x,
|
|
370
372
|
toggle: W
|
|
371
373
|
};
|
|
372
374
|
}
|
|
373
|
-
}),
|
|
375
|
+
}), Je = ["aria-expanded", "aria-disabled", "tabindex"], Qe = { class: "hison-dropdown-label" }, _e = ["aria-activedescendant", "inert"], en = { class: "hison-dropdown-panel" }, nn = ["aria-selected", "onClick"], tn = {
|
|
374
376
|
key: 0,
|
|
375
377
|
class: "hison-dropdown-empty"
|
|
376
378
|
};
|
|
377
|
-
function
|
|
379
|
+
function ln(n, l, m, z, s, h) {
|
|
378
380
|
return j(), U("div", {
|
|
379
381
|
class: P([
|
|
380
382
|
"hison-dropdown",
|
|
@@ -385,7 +387,7 @@ function nn(n, l, m, z, s, h) {
|
|
|
385
387
|
n.isOpen ? "hison-open" : "",
|
|
386
388
|
n.animate ? "" : "hison-no-anim"
|
|
387
389
|
]),
|
|
388
|
-
style:
|
|
390
|
+
style: R([n.rootInlineStyle, n.props.style]),
|
|
389
391
|
onMouseenter: l[3] || (l[3] = (a) => n.trigger === "hover" ? n.open(a) : null),
|
|
390
392
|
onMouseleave: l[4] || (l[4] = (a) => n.trigger === "hover" ? n.close(a) : null)
|
|
391
393
|
}, [
|
|
@@ -399,52 +401,68 @@ function nn(n, l, m, z, s, h) {
|
|
|
399
401
|
role: "combobox",
|
|
400
402
|
"aria-disabled": n.isDisabled || n.isReadonly ? "true" : "false",
|
|
401
403
|
tabindex: n.tabIndex ?? void 0,
|
|
402
|
-
style:
|
|
404
|
+
style: R([n.textAlignStyle, n.props.toggleStyle]),
|
|
403
405
|
onClick: l[0] || (l[0] = (a) => n.onToggleClick(a)),
|
|
404
406
|
onKeydown: [
|
|
405
|
-
l[1] || (l[1] =
|
|
406
|
-
l[2] || (l[2] =
|
|
407
|
+
l[1] || (l[1] = ue(re((a) => n.onToggleClick(a), ["prevent"]), ["enter"])),
|
|
408
|
+
l[2] || (l[2] = ue(re((a) => n.onToggleClick(a), ["prevent"]), ["space"]))
|
|
407
409
|
]
|
|
408
410
|
}, [
|
|
409
|
-
A("span",
|
|
410
|
-
|
|
411
|
+
A("span", Qe, [
|
|
412
|
+
Z(n.$slots, "toggle-label", {
|
|
413
|
+
option: n.selectedOption,
|
|
414
|
+
label: n.selectedLabel,
|
|
415
|
+
placeholder: n.placeholder
|
|
416
|
+
}, () => [
|
|
417
|
+
de(ve(n.selectedLabel || n.placeholder), 1)
|
|
418
|
+
])
|
|
419
|
+
]),
|
|
420
|
+
Z(n.$slots, "caret", {}, () => [
|
|
411
421
|
l[5] || (l[5] = A("span", { class: "hison-dropdown-caret" }, "▾", -1))
|
|
412
422
|
])
|
|
413
|
-
], 46,
|
|
423
|
+
], 46, Je),
|
|
414
424
|
A("div", {
|
|
415
425
|
ref: "menuRef",
|
|
416
426
|
class: P(["hison-dropdown-menu hison-dropdown-menu-fixed", [
|
|
417
427
|
n.isOpen ? "hison-open" : "",
|
|
418
428
|
n.openBelow ? "hison-open-below" : "hison-open-above"
|
|
419
429
|
]]),
|
|
420
|
-
style:
|
|
430
|
+
style: R([n.fixedMenuStyle, n.textAlignStyle, n.props.menuStyle]),
|
|
421
431
|
role: "listbox",
|
|
422
432
|
"aria-activedescendant": n.activeDescId,
|
|
423
433
|
inert: !n.isOpen || void 0
|
|
424
434
|
}, [
|
|
425
|
-
A("div",
|
|
435
|
+
A("div", en, [
|
|
426
436
|
A("div", {
|
|
427
437
|
class: "hison-dropdown-panel-inner",
|
|
428
|
-
style:
|
|
438
|
+
style: R(n.menuInlineStyle)
|
|
429
439
|
}, [
|
|
430
|
-
(j(!0), U(
|
|
440
|
+
(j(!0), U(De, null, He(n.options, (a, u) => (j(), U("div", {
|
|
431
441
|
key: `opt-${u}`,
|
|
432
442
|
class: P(["hison-dropdown-item", [
|
|
433
443
|
a.disabled ? "hison-disable" : "",
|
|
434
444
|
a.value === n.selectedValue ? "hison-selected" : ""
|
|
435
445
|
]]),
|
|
436
|
-
style:
|
|
446
|
+
style: R(n.props.itemStyle),
|
|
437
447
|
role: "option",
|
|
438
448
|
"aria-selected": a.value === n.selectedValue ? "true" : "false",
|
|
439
449
|
onClick: (g) => n.onSelect(a, g)
|
|
440
|
-
},
|
|
441
|
-
|
|
450
|
+
}, [
|
|
451
|
+
Z(n.$slots, "item", {
|
|
452
|
+
option: a,
|
|
453
|
+
index: u,
|
|
454
|
+
selected: a.value === n.selectedValue
|
|
455
|
+
}, () => [
|
|
456
|
+
de(ve(a.label), 1)
|
|
457
|
+
])
|
|
458
|
+
], 14, nn))), 128)),
|
|
459
|
+
n.options.length === 0 ? (j(), U("div", tn, "No options")) : ke("", !0)
|
|
442
460
|
], 4)
|
|
443
461
|
])
|
|
444
|
-
], 14,
|
|
462
|
+
], 14, _e)
|
|
445
463
|
], 38);
|
|
446
464
|
}
|
|
447
|
-
const
|
|
465
|
+
const rn = /* @__PURE__ */ We(Ze, [["render", ln]]);
|
|
448
466
|
export {
|
|
449
|
-
|
|
467
|
+
rn as default
|
|
450
468
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as Oe, ref as s, computed as D, onMounted as Le, onBeforeUnmount as Ee, watch as d, nextTick as ie, resolveComponent as je, openBlock as y, createElementBlock as b, Fragment as Y, createBlock as Re, normalizeStyle as me, normalizeClass as M, withCtx as be, renderSlot as Z, toDisplayString as K, createCommentVNode as ae, createElementVNode as j, withModifiers as _, renderList as Pe, createVNode as He } from "vue";
|
|
2
|
-
import { E as N, A as Ve, g as Ue, l as g, u as Je, j as ge, t as ee, h as z, e as qe, a as We, b as pe, r as Ge, c as Ke, d as Qe } from "./index-
|
|
2
|
+
import { E as N, A as Ve, g as Ue, l as g, u as Je, j as ge, t as ee, h as z, e as qe, a as We, b as pe, r as Ge, c as Ke, d as Qe } from "./index-Btyg21iV.mjs";
|
|
3
3
|
import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const Ye = {
|
|
5
5
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),n=require("./index-B79IAYbU.js"),be=require("./_plugin-vue_export-helper-BHFhmbuH.js"),he={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},editMode:{type:String,default:n.EditMode.editable,validator:t=>n.EDIT_MODE_VALUES.includes(t)},modelValue:{type:Array,default:()=>[]},attId:{type:String,default:""},addButtonText:{type:String,default:"Add"},removeButtonText:{type:String,default:"x"},placeholder:{type:String,default:"There are no files."},enableDrop:{type:Boolean,default:!0},downloadHandler:{type:Function,default:void 0},buttonOnly:{type:Boolean,default:!1},multiCols:{type:Boolean,default:!1},multiple:{type:Boolean,default:!0},allowedTypes:{type:[String,Array],default:void 0,validator:t=>t===void 0||typeof t=="string"||Array.isArray(t)&&t.every(o=>typeof o=="string")},disallowedTypes:{type:[String,Array],default:void 0,validator:t=>t===void 0||typeof t=="string"||Array.isArray(t)&&t.every(o=>typeof o=="string")},maxFileSize:{type:Number,default:1/0,validator:t=>Number.isFinite(t)&&t>=0||t===1/0},maxTotalFileSize:{type:Number,default:1/0,validator:t=>Number.isFinite(t)&&t>=0||t===1/0},maxFileCount:{type:Number,default:0,validator:t=>Number.isInteger(t)&&t>=0},onDisallowedType:{type:Function,default:void 0},onMaxFileSizeExceeded:{type:Function,default:void 0},onMaxTotalSizeExceeded:{type:Function,default:void 0},tabIndex:{type:[Number,String],default:null,validator:t=>t===null||t===""||!isNaN(+t)&&isFinite(+t)}},ge=l.defineComponent({name:"HFileset",props:he,emits:["mounted","responsive-change","update:modelValue","add","remove","focus","blur","download","change"],setup(t,{emit:o}){const T=l.ref(null),d=l.ref([...t.modelValue]),y=l.ref(null),v=t.id?t.id:n.getUUID(),I=`hfileset:${v}`,u=l.ref(t.visible),f=l.ref(t.editMode),N=l.computed(()=>f.value===n.EditMode.disable),ee=l.computed(()=>f.value===n.EditMode.readonly),te=l.computed(()=>f.value!==n.EditMode.editable?`hison-fileset-${f.value}`:""),q=l.computed(()=>u.value?"":"hison-display-none"),P=l.ref(t.attId||""),E=l.ref(t.addButtonText||""),x=l.ref(t.removeButtonText||""),$=l.ref(t.placeholder??""),H=l.ref(!1),D=l.ref(t.enableDrop),O=l.ref(typeof t.downloadHandler=="function"?t.downloadHandler:void 0),A=l.ref(t.multiCols??!1),C=l.ref(t.multiple??!1),L=l.ref(!!t.buttonOnly),R=l.ref(!1),h=l.ref(Array.isArray(t.allowedTypes)?t.allowedTypes:t.allowedTypes?t.allowedTypes.split(","):[]),S=l.ref(Array.isArray(t.disallowedTypes)?t.disallowedTypes:t.disallowedTypes?t.disallowedTypes.split(","):[]),g=l.ref(t.maxFileSize??n.hison.getMaxFilesetSize()),F=l.ref(t.maxTotalFileSize??n.hison.getMaxFilesetTotalSize()),k=l.ref(t.maxFileCount),p=l.ref(typeof t.onDisallowedType=="function"?t.onDisallowedType:void 0),M=l.ref(typeof t.onMaxFileSizeExceeded=="function"?t.onMaxFileSizeExceeded:void 0),B=l.ref(typeof t.onMaxTotalSizeExceeded=="function"?t.onMaxTotalSizeExceeded:void 0),V=l.ref(t.tabIndex!==null&&t.tabIndex!==""?Number(t.tabIndex):null),J=n.useDevice(),z=l.ref([]),U=()=>{z.value=n.extractResponsiveClasses(n.toClassString(t.class)||"",J.value),n.getIndexSpecificClassNameFromClassList(z.value,"col")===-1&&z.value.push("hison-col-12"),n.addComponentNameToClass(z.value,"size",n.hisonCloser.componentStyle.size),n.addComponentNameToClass(z.value,"color","primary")},le=l.computed(()=>{const e=[];return e.push(...n.extractPrefixedClasses(n.toClassString(t.class)||"","size")),e.push(...n.extractPrefixedClasses(n.toClassString(t.class)||"","color")),e}),ie=l.computed(()=>["fileset-add-btn",n.toClassString(t.class)||"",q.value].filter(Boolean).join(" ")),ne=l.computed(()=>{if(h.value.length===0)return"";const e=new Set(S.value.map(a=>a.toLowerCase())),i=h.value.filter(a=>!e.has(a.toLowerCase()));return i.length>0?i.join(","):void 0}),ae=()=>{var e;(e=T.value)==null||e.click()},W=(e,i,a)=>{const s=e.trim().toLowerCase();return s.endsWith("/*")?i.toLowerCase().startsWith(s.slice(0,-1)):s===i.toLowerCase()||s===a},oe=e=>{var s,b,r;const i=e.type,a="."+((s=e.name.split(".").pop())==null?void 0:s.toLowerCase());return h.value.length>0&&!h.value.some(j=>W(j,i,a))?(console.warn(`File type not in allowedTypes: ${i} / ${a}`),(b=p.value)==null||b.call(p,e,h.value,null),!1):S.value.length>0&&S.value.some(j=>W(j,i,a))?(console.warn(`File type is in disallowedTypes: ${i} / ${a}`),(r=p.value)==null||r.call(p,e,null,S.value),!1):!0},se=e=>{var i;return typeof g.value=="number"&&Number.isFinite(g.value)&&e.size>g.value?(console.warn(`File too large: ${e.name}
|
|
2
2
|
Max size: ${g.value} Byte`),(i=M.value)==null||i.call(M,e,e.size,g.value),!1):!0},G=e=>{var b;let i=e.filter(r=>se(r)&&oe(r));!C.value&&i.length>1&&(i=[i[0]]);let a=!1;const s=[];for(const r of i){const c=d.value.filter(m=>!m.isDeleted),j=c.length,Z=c.reduce((m,w)=>m+(w.fileSize??0),0)+r.size;if(F.value>0&&Z>F.value){(b=B.value)==null||b.call(B,r,Z,F.value),console.warn("Total file size exceeds limit.");break}if(!C.value){for(const m of c)if(m.isNew){const w=d.value.indexOf(m);w!==-1&&d.value.splice(w,1)}else m.isDeleted=!0;a=!0}if(C.value&&k.value>0&&j>=k.value){const m=d.value.findIndex(w=>!w.isDeleted);if(m!==-1){const w=d.value[m];w.isNew?d.value.splice(m,1):w.isDeleted=!0,a=!0}else{console.warn("No replaceable file found for maxFileCount overflow.");break}}const _={fileName:r.name,fileSize:r.size,extension:r.name.split(".").pop(),file:r,isNew:!0};d.value.push(_),a=!0,s.push(_)}a&&(R.value=!0,o("update:modelValue",[...d.value]),s.length&&o("add",n.hison.utils.deepCopyObject(s),y.value),o("change",n.hison.utils.deepCopyObject(d.value),y.value))},de=e=>{const i=d.value.indexOf(e);if(i!==-1)return i;if(e.fileId){const a=d.value.findIndex(s=>s.fileId===e.fileId);if(a!==-1)return a}if(e.file){const a=d.value.findIndex(s=>s.file===e.file);if(a!==-1)return a}if(e.filePath){const a=d.value.findIndex(s=>s.filePath===e.filePath);if(a!==-1)return a}return-1},ue=e=>{if(f.value!==n.EditMode.editable)return;const i=de(e);if(i===-1)return;const a=d.value[i];a.fileId?a.isDeleted=!0:d.value.splice(i,1),R.value=!0,o("update:modelValue",[...d.value]),o("remove",n.hison.utils.deepCopyObject(a),i,y.value),o("change",n.hison.utils.deepCopyObject(d.value),y.value)},re=e=>{if(f.value!==n.EditMode.editable)return;const i=e.target.files;!i||i.length===0||(G(Array.from(i)),l.nextTick(()=>{T.value&&(T.value.value="")}))},fe=l.computed(()=>d.value.filter(e=>!e.isDeleted)),ce=e=>{if(o("download",n.hison.utils.deepCopyObject(e),y.value),O.value){O.value(e);return}let i="";const a=e.fileName||"download";if(e.file)i=URL.createObjectURL(e.file);else if(e.filePath)i=e.filePath;else{console.warn("Download failed: no filePath or file object.");return}const s=document.createElement("a");s.href=i,s.download=a,s.click(),e.file&&URL.revokeObjectURL(i)},ve=()=>{!D.value||f.value!==n.EditMode.editable||(H.value=!0)},me=e=>{var i;H.value=!1,!(!D.value||f.value!==n.EditMode.editable)&&(i=e.dataTransfer)!=null&&i.files&&G(Array.from(e.dataTransfer.files))},K=e=>{if(!e||!e.getIsDataModel||!e.getIsDataModel()||e.getRowCount&&e.getRowCount()===0)return;const i=e.getRows();d.value=[...i]},Q=e=>(e||[]).map(i=>({fileId:i.fileId??"",fileName:i.fileName??"",fileSize:Number(i.fileSize??0),filePath:i.filePath??"",isDeleted:!!i.isDeleted,isNew:!!i.isNew,fileMeta:i.file?`${i.file.name}|${i.file.size}|${i.file.type}`:""})),ye=(e,i)=>{const a=Q(e),s=Q(i);if(a.length!==s.length)return!1;for(let b=0;b<a.length;b++){const r=a[b],c=s[b];if(r.fileId!==c.fileId||r.fileName!==c.fileName||r.fileSize!==c.fileSize||r.filePath!==c.filePath||r.isDeleted!==c.isDeleted||r.isNew!==c.isNew||r.fileMeta!==c.fileMeta)return!1}return!0},X=()=>{n.hisonCloser.component.filesetList[v]&&n.hisonCloser.component.filesetList[v].isHisonvueComponent&&console.warn(`[Hisonvue] The fileset ID is at risk of being duplicated. ${v}`),n.registerReloadable(I,()=>{Y(),l.nextTick(X)}),T.value&&(U(),y.value={isHisonvueComponent:!0,getId:()=>v,getType:()=>"fileset",isVisible:()=>u.value,setVisible:e=>{u.value=e},getEditMode:()=>f.value,setEditMode:e=>{var i;f.value=e,(i=n.hisonCloser.component.buttonList[`hison_fileset_add_button_${v}`])==null||i.setDisable(N.value)},getValue:()=>n.hison.utils.deepCopyObject(d.value),setValue:e=>{d.value=n.hison.utils.deepCopyObject([...e??[]])},getDataModel:()=>d.value.length>0?new n.hison.data.DataModel(d.value):null,setDataModel:e=>{K(e)},load:e=>{e&&e.getIsDataModel&&e.getIsDataModel()?K(e):d.value=n.hison.utils.deepCopyObject([...e])},getAttId:()=>P.value,setAttId:e=>{P.value=e},getAddButtonText:()=>E.value,setAddButtonText:e=>{E.value=e},getRemoveButtonText:()=>x.value,setRemoveButtonText:e=>{x.value=e},isEnableDrop:()=>D.value,setEnableDrop:e=>{D.value=e},setDownloadHandler:e=>{O.value=e},isMultiCols:()=>A.value,setMultiCols:e=>{A.value=e},isMultiple:()=>C.value,setMultiple:e=>{C.value=e},getPlaceholder:()=>$.value,setPlaceholder:e=>{$.value=e},getAllowedTypes:()=>h.value,setAllowedTypes:e=>{h.value=e??[]},getDisallowedTypes:()=>S.value,setDisallowedTypes:e=>{S.value=e??[]},getMaxFileSize:()=>g.value,setMaxFileSize:e=>{g.value=e},getMaxTotalFileSize:()=>F.value,setMaxTotalFileSize:e=>{F.value=e},getMaxFileCount:()=>k.value,setMaxFileCount:e=>{k.value=e},setOnDisallowedType:e=>{p.value=e},setOnMaxFileSizeExceeded:e=>{M.value=e},setOnMaxTotalSizeExceeded:e=>{B.value=e},isModified:()=>R.value,setModified:e=>{R.value=e},getTabIndex:()=>V.value,setTabIndex:e=>{V.value=e!=null?Number(e):null},isButtonOnly:()=>L.value,setButtonOnly:e=>{L.value=!!e},focus:()=>{var e;(e=n.hisonCloser.component.buttonList[`hison_fileset_add_button_${v}`])==null||e.focus()},reload:()=>n.reloadHisonComponent(I)},n.hisonCloser.component.filesetList[v]=y.value,o("mounted",y.value))},Y=()=>{n.unregisterReloadable(I),delete n.hisonCloser.component.filesetList[v]};return l.onMounted(X),l.onBeforeUnmount(Y),l.watch(()=>t.modelValue,e=>{const i=Array.isArray(e)?e:[];ye(i,d.value)||(d.value=[...i])},{deep:!0}),l.watch(J,e=>{U(),o("responsive-change",e)}),l.watch(()=>t.visible,e=>{const i=!!e;i!==u.value&&(u.value=i)}),l.watch(()=>t.editMode,e=>{e&&e!==f.value&&(f.value=e,l.nextTick(()=>{var i;return(i=n.hisonCloser.component.buttonList[`hison_fileset_add_button_${v}`])==null?void 0:i.setDisable(N.value)}))}),l.watch(()=>t.attId,e=>{const i=e??"";i!==P.value&&(P.value=i)}),l.watch(()=>t.addButtonText,e=>{const i=e??"";i!==E.value&&(E.value=i)}),l.watch(()=>t.removeButtonText,e=>{const i=e??"";i!==x.value&&(x.value=i)}),l.watch(()=>t.placeholder,e=>{const i=e??"";i!==$.value&&($.value=i)}),l.watch(()=>t.enableDrop,e=>{const i=!!e;i!==D.value&&(D.value=i)}),l.watch(()=>t.downloadHandler,e=>{const i=typeof e=="function"?e:void 0;i!==O.value&&(O.value=i)}),l.watch(()=>t.multiCols,e=>{const i=!!e;i!==A.value&&(A.value=i)}),l.watch(()=>t.multiple,e=>{const i=!!e;i!==C.value&&(C.value=i)}),l.watch(()=>t.buttonOnly,e=>{const i=!!e;i!==L.value&&(L.value=i)}),l.watch(()=>t.allowedTypes,e=>{const a=(Array.isArray(e)?e:typeof e=="string"?e.split(","):[]).map(s=>String(s).trim()).filter(Boolean);JSON.stringify(a)!==JSON.stringify(h.value)&&(h.value=a)}),l.watch(()=>t.disallowedTypes,e=>{const a=(Array.isArray(e)?e:typeof e=="string"?e.split(","):[]).map(s=>String(s).trim()).filter(Boolean);JSON.stringify(a)!==JSON.stringify(S.value)&&(S.value=a)}),l.watch(()=>t.maxFileSize,e=>{const i=e===1/0?1/0:Number(e);(Number.isFinite(i)||i===1/0)&&i!==g.value&&(g.value=i)}),l.watch(()=>t.maxTotalFileSize,e=>{const i=e===1/0?1/0:Number(e);(Number.isFinite(i)||i===1/0)&&i!==F.value&&(F.value=i)}),l.watch(()=>t.maxFileCount,e=>{const i=Number(e);Number.isInteger(i)&&i>=0&&i!==k.value&&(k.value=i)}),l.watch(()=>t.onDisallowedType,e=>{const i=typeof e=="function"?e:void 0;i!==p.value&&(p.value=i)}),l.watch(()=>t.onMaxFileSizeExceeded,e=>{const i=typeof e=="function"?e:void 0;i!==M.value&&(M.value=i)}),l.watch(()=>t.onMaxTotalSizeExceeded,e=>{const i=typeof e=="function"?e:void 0;i!==B.value&&(B.value=i)}),l.watch(()=>t.tabIndex,e=>{const i=e===null||e===""?null:Number(e);i!==V.value&&(V.value=i)}),l.watch(()=>t.class,()=>{U()}),{fileInputRef:T,id:v,props:t,visibleFiles:fe,filesetMethods:y,responsiveClassList:z,buttonClassList:le,visibleClass:q,editModeClass:te,disable:N,readonly:ee,addButtonText:E,removeButtonText:x,placeholder:$,isDragging:H,multiCols:A,multiple:C,accept:ne,tabIndex:V,buttonOnly:L,buttonOnlyClass:ie,openFileDialog:ae,removeFile:ue,onFileChange:re,downloadFile:ce,handleDragEnter:ve,handleDrop:me}}}),pe={key:1,class:"hison-fileset-add-text"},we={key:0,class:"file-placeholder"},Ce=["onClick"],Se=["disabled","onClick"],Fe={class:"hison-fileset-remove-text"},Te={key:0,class:"add-btn-container"},Ie={key:1,class:"hison-fileset-add-text"},De=["id","accept","multiple"];function ke(t,o,T,d,y,v){const I=l.resolveComponent("HButton");return l.openBlock(),l.createElementBlock(l.Fragment,null,[t.buttonOnly?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[t.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(I,{key:0,onClick:t.openFileDialog,onFocus:o[0]||(o[0]=u=>t.$emit("focus",t.filesetMethods)),onBlur:o[1]||(o[1]=u=>t.$emit("blur",t.filesetMethods)),id:`hison_fileset_add_button_${t.id}`,disable:t.disable,class:l.normalizeClass(t.buttonOnlyClass),style:l.normalizeStyle(t.props.style),tabIndex:t.tabIndex??void 0},{default:l.withCtx(()=>[t.$slots["add-button"]?l.renderSlot(t.$slots,"add-button",{key:0,add:t.openFileDialog,disable:t.disable}):(l.openBlock(),l.createElementBlock("span",pe,l.toDisplayString(t.addButtonText),1))]),_:3},8,["onClick","id","disable","class","style","tabIndex"]))],64)):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["hison-wrapper",...t.responsiveClassList,t.visibleClass])},[l.createElementVNode("div",{class:l.normalizeClass(["hison-fileset",t.editModeClass]),style:l.normalizeStyle(t.props.style)},[l.createElementVNode("div",{class:l.normalizeClass(["file-list-wrapper",{"drag-over":t.isDragging}]),onDragover:o[2]||(o[2]=l.withModifiers(()=>{},["prevent"])),onDragenter:o[3]||(o[3]=l.withModifiers((...u)=>t.handleDragEnter&&t.handleDragEnter(...u),["prevent"])),onDragleave:o[4]||(o[4]=l.withModifiers(u=>t.isDragging=!1,["prevent"])),onDrop:o[5]||(o[5]=l.withModifiers((...u)=>t.handleDrop&&t.handleDrop(...u),["prevent"]))},[l.createElementVNode("div",{class:l.normalizeClass(["file-list",{"multi-cols":t.multiCols}])},[t.visibleFiles.length===0&&t.placeholder?(l.openBlock(),l.createElementBlock("div",we,l.toDisplayString(t.placeholder),1)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(t.visibleFiles,(u,f)=>(l.openBlock(),l.createElementBlock("div",{key:f,class:"file-item"},[l.renderSlot(t.$slots,"file-icon",{file:u}),l.createElementVNode("span",{class:l.normalizeClass(["file-name",{clickable:u.file||u.filePath}]),onClick:N=>t.downloadFile(u)},l.toDisplayString(u.fileName),11,Ce),t.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[t.$slots["remove-button"]?l.renderSlot(t.$slots,"remove-button",{key:0,file:u,index:f,remove:()=>t.removeFile(u),disable:t.disable}):(l.openBlock(),l.createElementBlock("button",{key:1,class:l.normalizeClass(["delete-btn",{"hison-disable":t.disable}]),disabled:t.disable,onClick:N=>t.removeFile(u)},[l.createElementVNode("span",Fe,l.toDisplayString(t.removeButtonText),1)],10,Se))],64))]))),128))],2)],34),t.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Te,[l.createVNode(I,{onClick:t.openFileDialog,onFocus:o[6]||(o[6]=u=>t.$emit("focus",t.filesetMethods)),onBlur:o[7]||(o[7]=u=>t.$emit("blur",t.filesetMethods)),id:`hison_fileset_add_button_${t.id}`,disable:t.disable,class:l.normalizeClass([...t.buttonClassList]),tabIndex:t.tabIndex??void 0},{default:l.withCtx(()=>[t.$slots["add-button"]?l.renderSlot(t.$slots,"add-button",{key:0,add:t.openFileDialog,disable:t.disable}):(l.openBlock(),l.createElementBlock("span",Ie,l.toDisplayString(t.addButtonText),1))]),_:3},8,["onClick","id","disable","class","tabIndex"])]))],6)],2)),l.createElementVNode("input",{id:`hison_fileset_${t.id}`,ref:"fileInputRef",type:"file",accept:t.accept||void 0,multiple:t.multiple,hidden:"",onChange:o[8]||(o[8]=(...u)=>t.onFileChange&&t.onFileChange(...u))},null,40,De)],64)}const Me=be._export_sfc(ge,[["render",ke]]);exports.default=Me;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as D, ref as n, computed as i, onMounted as P, onBeforeUnmount as q, watch as s, nextTick as O, openBlock as S, createElementBlock as L, normalizeClass as U, createElementVNode as j, normalizeStyle as T, createCommentVNode as M } from "vue";
|
|
2
|
-
import { B as b, F as Y, G as K, f as J, g as Q, u as X, I as V, o as Z, h as c, e as ee, t as te, b as I, a as le, r as ne, c as se, d as ae } from "./index-
|
|
2
|
+
import { B as b, F as Y, G as K, f as J, g as Q, u as X, I as V, o as Z, h as c, e as ee, t as te, b as I, a as le, r as ne, c as se, d as ae } from "./index-Btyg21iV.mjs";
|
|
3
3
|
import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const ie = {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("./index-B79IAYbU.js"),A=require("./_plugin-vue_export-helper-BHFhmbuH.js"),R={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},border:{type:Boolean,default:!1},backgroundType:{type:String,default:n.BackgroundType.empty,validator:l=>n.BACKGROUND_TYPE_VALUES.includes(l)},line:{type:String,default:"none",validator:l=>n.H_GAP_RULE_VALUES.includes(l)},lineStyle:{type:String,default:"solid",validator:l=>n.H_GAP_LINE_STYLE_VALUES.includes(l)},lineWidth:{type:[Number,String],default:1},lineColor:{type:String,default:""}},V=t.defineComponent({name:"HGap",props:R,inheritAttrs:!1,emits:["mounted","responsive-change"],setup(l,{emit:y}){const h=t.ref(null),g=t.ref(null),a=l.id?l.id:n.getUUID(),f=`hgap:${a}`,C=n.useDevice(),u=t.ref(l.visible),c=t.ref(l.border??!1),d=t.ref(l.backgroundType??n.BackgroundType.empty),v=t.ref(l.line),i=t.ref(l.lineStyle||"solid"),r=t.ref(l.lineWidth??1),p=t.ref(l.lineColor||""),b=t.computed(()=>{var w,$;const e=String(p.value||"").trim(),o=n.getHexCodeFromColorText(e);if(o)return o;if(e)return e;const k=n.getSpecificClassValueFromClassList(s.value,"color"),B=k?n.getHexCodeFromColorText(k):null;return B||(($=(w=n.hisonCloser)==null?void 0:w.componentStyle)==null?void 0:$.mutedColor)||"#999999"}),S=t.computed(()=>{const e=r.value;return typeof e=="number"?`${e}px`:String(e||"1px")}),z=t.computed(()=>({borderTop:`${S.value} ${i.value} ${b.value}`})),E=t.computed(()=>({borderLeft:`${S.value} ${i.value} ${b.value}`})),H=t.computed(()=>u.value?"":"hison-display-none"),N=t.computed(()=>c.value?"hison-border":""),_=t.computed(()=>{switch(d.value){case n.BackgroundType.empty:return"hison-bg-empty";case n.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),s=t.ref([]),m=()=>{s.value=n.extractResponsiveClasses(n.toClassString(l.class)||"",C.value),n.addComponentNameToClass(s.value,"size",n.hisonCloser.componentStyle.size),n.addComponentNameToClass(s.value,"color","primary"),n.getIndexSpecificClassNameFromClassList(s.value,"col")===-1&&s.value.push("hison-col-12")},L=()=>{n.hisonCloser.component.gapList[a]&&n.hisonCloser.component.gapList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The gap ID is at risk of being duplicated. ${a}`),n.registerReloadable(f,()=>{T(),t.nextTick(L)}),m(),g.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"gap",isVisible:()=>u.value,setVisible:e=>{u.value=e},isBorder:()=>c.value,setBorder:e=>{c.value=e},getBackgroundType:()=>d.value,setBackgroundType:e=>{d.value=e},getLine:()=>v.value,setLine:e=>{v.value=e},getLineStyle:()=>i.value,setLineStyle:e=>{i.value=e},getLineWidth:()=>r.value,setLineWidth:e=>{r.value=e},getLineColor:()=>p.value,setLineColor:e=>{p.value=e??""},reload:()=>n.reloadHisonComponent(f)},n.hisonCloser.component.gapList[a]=g.value,y("mounted",g.value)},T=()=>{n.unregisterReloadable(f),delete n.hisonCloser.component.gapList[a]};return t.onMounted(L),t.onBeforeUnmount(T),t.watch(C,e=>{m(),y("responsive-change",e)}),t.watch(()=>l.visible,e=>{const o=!!e;o!==u.value&&(u.value=o)}),t.watch(()=>l.border,e=>{const o=!!e;o!==c.value&&(c.value=o)}),t.watch(()=>l.backgroundType,e=>{e&&e!==d.value&&(d.value=e)}),t.watch(()=>l.line,e=>{(e==="none"||e==="horizontal"||e==="vertical")&&e!==v.value&&(v.value=e)}),t.watch(()=>l.lineStyle,e=>{["solid","dashed","dotted","double","groove","ridge","inset","outset"].includes(e)&&e!==i.value&&(i.value=e)}),t.watch(()=>l.lineWidth,e=>{const o=typeof e=="number"&&Number.isFinite(e)&&e>=0||typeof e=="string"?e:r.value;o!==r.value&&(r.value=o)}),t.watch(()=>l.lineColor,e=>{const o=(e??"").toString();o!==p.value&&(p.value=o)}),t.watch(()=>l.class,()=>{m()}),{gapRef:h,props:l,line:v,visibleClass:H,borderClass:N,backgroundTypeClass:_,responsiveClassList:s,horizontalStyle:z,verticalStyle:E}}});function U(l,y,h,g,a,f){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...l.responsiveClassList,l.visibleClass])},[t.createElementVNode("div",{ref:"gapRef",class:t.normalizeClass(["hison-gap",l.borderClass,l.backgroundTypeClass]),style:t.normalizeStyle(l.props.style)},[l.line==="horizontal"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-gap-line-horizontal",style:t.normalizeStyle(l.horizontalStyle)},null,4)):l.line==="vertical"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"hison-gap-line-vertical",style:t.normalizeStyle(l.verticalStyle)},null,4)):t.createCommentVNode("",!0)],6)],2)}const x=A._export_sfc(V,[["render",U]]);exports.default=x;
|