hisonvue 1.1.35 → 1.1.36
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-CbiNQNVm.js → HAccordion-DixsCUcr.js} +1 -1
- package/dist/{HAccordion-DXRQb9yg.mjs → HAccordion-ytVlk-Xi.mjs} +14 -14
- package/dist/{HBaggie-DnRLwCcg.mjs → HBaggie-BrCu_FNI.mjs} +2 -2
- package/dist/{HBaggie-CxPeEJRI.js → HBaggie-Cr1eSSDU.js} +1 -1
- package/dist/{HBanner-B3667mzk.mjs → HBanner-DCiAm75f.mjs} +134 -130
- package/dist/HBanner-DaC5Oy1V.js +1 -0
- package/dist/{HButton-BEGcwebD.mjs → HButton-D65DShY1.mjs} +2 -2
- package/dist/{HButton-Dk3vLq-o.js → HButton-DDJAFzUI.js} +1 -1
- package/dist/{HCalendar-BKlShQeg.mjs → HCalendar-CeZZf3xz.mjs} +347 -351
- package/dist/{HCalendar-75Ep1aPT.js → HCalendar-DECGRlgj.js} +2 -2
- package/dist/{HCaption-Btt9VhYM.mjs → HCaption-DZLKWjtz.mjs} +1 -1
- package/dist/{HCaption-Dhmaxm4f.js → HCaption-Jegrstl5.js} +1 -1
- package/dist/HChart-D7rvsMsp.mjs +187 -0
- package/dist/HChart-DVm_avSs.js +1 -0
- package/dist/{HDrawer-B8bp9Qud.mjs → HDrawer-CvdRPfyZ.mjs} +147 -143
- package/dist/HDrawer-D2zd1yDo.js +1 -0
- package/dist/{HDropdown-40IcjK7V.mjs → HDropdown-17OmtEW8.mjs} +14 -14
- package/dist/HDropdown-T3cVNNh9.js +1 -0
- package/dist/{HFileset-D1Vxkiy1.js → HFileset-BWTm9OAG.js} +1 -1
- package/dist/{HFileset-BzRhq5PI.mjs → HFileset-DfR0gjej.mjs} +1 -1
- package/dist/{HGap-C4vKrzuT.js → HGap-BoMAxrlN.js} +1 -1
- package/dist/{HGap-BjEurhEB.mjs → HGap-EJFErp9_.mjs} +9 -9
- package/dist/{HGrid-CGeW2Hwi.mjs → HGrid-DdKPAgjN.mjs} +76 -68
- package/dist/HGrid-mA1pH4dd.js +1 -0
- package/dist/HImagebox-DLeTAc72.js +2 -0
- package/dist/{HImagebox-CzZl1WJb.mjs → HImagebox-q1mOYu7E.mjs} +50 -50
- package/dist/{HInput-0RbHI_Qs.mjs → HInput-BpQ6MC-_.mjs} +40 -35
- package/dist/HInput-Cv4evHaU.js +1 -0
- package/dist/{HInputGroup-DHesVRQ7.js → HInputGroup-BsNMWqWN.js} +1 -1
- package/dist/{HInputGroup-eYNveFVt.mjs → HInputGroup-DgZA6kZ_.mjs} +24 -24
- package/dist/{HLabel-CrflCwXe.js → HLabel-BAsvE9fS.js} +1 -1
- package/dist/{HLabel-DDl6qrdU.mjs → HLabel-BvnTFgx_.mjs} +15 -15
- package/dist/{HLayout-DVxV5-6x.mjs → HLayout-ByN_Ix7K.mjs} +7 -7
- package/dist/{HLayout-CBcpglbn.js → HLayout-itGAI89b.js} +1 -1
- package/dist/{HList-XJscoaAR.mjs → HList-BSVs18Un.mjs} +120 -118
- package/dist/HList-C7BYiLjn.js +1 -0
- package/dist/{HModal-Cw-mlzGi.mjs → HModal-BDk-6i91.mjs} +3 -3
- package/dist/HModal-DUfORCKz.js +1 -0
- package/dist/{HNote-DZh2WN1u.mjs → HNote-DiGJSDy_.mjs} +155 -137
- package/dist/HNote-Dn2kWhEB.js +1 -0
- package/dist/{HPagination-DdXhdCX-.mjs → HPagination-9T3ATteg.mjs} +15 -15
- package/dist/{HPagination-DVOHUomx.js → HPagination-Bye5T0KA.js} +1 -1
- package/dist/{HParagraph-zg0a6Ply.js → HParagraph-DyGyWAnU.js} +1 -1
- package/dist/{HParagraph-MyfLmh5T.mjs → HParagraph-nFPcm_h8.mjs} +1 -1
- package/dist/{HPopup-Dto_3SYT.mjs → HPopup-DA1ipgYG.mjs} +116 -108
- package/dist/HPopup-cMETJesL.js +1 -0
- package/dist/{HSpinner-BQdzR5gJ.js → HSpinner-BQhgToQE.js} +1 -1
- package/dist/{HSpinner-F5xTLG1L.mjs → HSpinner-CB39WNyR.mjs} +7 -7
- package/dist/{HTable-Ai9ASd3s.js → HTable-B9015YGO.js} +1 -1
- package/dist/{HTable-q6s_bCP3.mjs → HTable-DWU9zpAd.mjs} +16 -16
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.css +1 -1
- package/dist/hisonvue.d.ts +7 -9
- package/dist/hisonvue.es.js +20 -20
- package/dist/index-C8V9Uq5K.mjs +19823 -0
- package/dist/index-zy0OgBxq.js +208 -0
- package/dist/scrollManager-BnsMLx8W.js +1 -0
- package/dist/scrollManager-DRtkc7Rn.mjs +14 -0
- package/dist/{setButtonCssEvent-Bo9odR4-.mjs → setButtonCssEvent-CvF5MJ-D.mjs} +14 -11
- package/dist/setButtonCssEvent-D0RjMXa-.js +1 -0
- package/package.json +10 -8
- package/dist/HBanner-BWE_86RI.js +0 -1
- package/dist/HChart-Dvf7Zyqo.js +0 -1
- package/dist/HChart-PikIcmDe.mjs +0 -187
- package/dist/HDrawer-Dx3zE9Xo.js +0 -1
- package/dist/HDropdown-Hqm-zyOJ.js +0 -1
- package/dist/HGrid-B3HTamqm.js +0 -1
- package/dist/HImagebox-DgsAgGn5.js +0 -2
- package/dist/HInput-DpRQnm3P.js +0 -1
- package/dist/HList-CfKwZvpP.js +0 -1
- package/dist/HModal-CVU4jzWa.js +0 -1
- package/dist/HNote-DFz0WKL7.js +0 -1
- package/dist/HPopup-BB3t6DNz.js +0 -1
- package/dist/index-C9k8o7VC.mjs +0 -20260
- package/dist/index-DXTro6wG.js +0 -205
- package/dist/scrollManager-BGnq4wyt.mjs +0 -14
- package/dist/scrollManager-CEEWQwoK.js +0 -1
- package/dist/setButtonCssEvent-D3asJxEn.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),l=require("./index-zy0OgBxq.js"),V=require("./setButtonCssEvent-D0RjMXa-.js"),q=require("./_plugin-vue_export-helper-BHFhmbuH.js"),z={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},headerStyle:{type:[String,Object,Array],required:!1},contentStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},defaultOpen:{type:Boolean,default:!1},title:{type:String,default:""},textAlign:{type:String,default:"left",validator:n=>l.TEXT_ALIGN_VALUES.includes(n)},animate:{type:Boolean,default:!0},duration:{type:Number,default:220,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)}},R=t.defineComponent({name:"HAccordion",props:z,inheritAttrs:!1,emits:["mounted","responsive-change","open","close","toggle"],setup(n,{emit:i}){const a=n.id||l.getUUID(),b=`haccordion:${a}`,s=t.ref(null),N=t.ref(null),r=l.useDevice(),v=t.ref(!!n.visible),f=t.ref(n.title??""),u=t.ref(!!n.defaultOpen),g=t.ref(n.textAlign??"left"),m=t.ref(n.animate??!0),h=t.ref(n.duration??500),y=t.ref(n.easing??"ease"),p=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),B=t.computed(()=>v.value?"":"hison-display-none"),c=t.ref([]),I=()=>{c.value=l.extractResponsiveClasses(l.toClassString(n.class)||"",r.value),l.getIndexSpecificClassNameFromClassList(c.value,"col")===-1&&c.value.push("hison-col-12"),l.addComponentNameToClass(c.value,"size",l.hisonCloser.componentStyle.size),l.addComponentNameToClass(c.value,"color","primary")},L=t.computed(()=>({"--hacc-duration":`${h.value}ms`,"--hacc-easing":y.value})),x=t.computed(()=>({})),$=t.computed(()=>({textAlign:g.value})),C=e=>{u.value||(u.value,u.value=!0,i("open",e??null,d.value))},S=e=>{var O;if(!u.value)return;const o=document.activeElement,E=N.value;E&&o&&E.contains(o)&&((O=s.value)==null||O.focus()),u.value=!1,i("close",e??null,d.value)},T=e=>u.value?S(e):C(e),k=e=>{i("toggle",e,d.value),T(e)},d=t.ref(null),w=()=>{l.hisonCloser.component.accordionList[a]&&l.hisonCloser.component.accordionList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The accordion ID is at risk of being duplicated. ${a}`),l.registerReloadable(b,()=>{A(),t.nextTick(w)}),s.value&&V.addButtonCssEvent(s.value),I(),d.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"accordion",isVisible:()=>v.value,setVisible:e=>{v.value=!!e},isOpen:()=>u.value,open:C,close:S,toggle:T,getTitle:()=>f.value,setTitle:e=>{f.value=e??""},getTextAlign:()=>g.value,setTextAlign:e=>{(e==="left"||e==="center"||e==="right")&&(g.value=e)},getAnimate:()=>m.value,setAnimate:e=>{m.value=!!e},getDuration:()=>h.value,setDuration:e=>{const o=Number(e);Number.isFinite(o)&&o>=0&&(h.value=o)},getEasing:()=>y.value,setEasing:e=>{typeof e=="string"&&(y.value=e)},getTabIndex:()=>p.value,setTabIndex:e=>{p.value=e!=null?Number(e):null},focus:()=>{var e;(e=s.value)==null||e.focus()},reload:()=>l.reloadHisonComponent(b)},l.hisonCloser.component.accordionList[a]=d.value,i("mounted",d.value)},A=()=>{var e;l.unregisterReloadable(b),s.value&&V.removeButtonCssEvent(s.value),(e=l.hisonCloser.component)!=null&&e.accordionList&&delete l.hisonCloser.component.accordionList[a]};return t.onMounted(w),t.onBeforeUnmount(A),t.watch(r,e=>{I(),i("responsive-change",e)}),t.watch(()=>n.visible,e=>{e!==v.value&&(v.value=!!e)}),t.watch(()=>n.title,e=>{const o=e??"";o!==f.value&&(f.value=o)}),t.watch(()=>n.defaultOpen,e=>e?C(null):S(null)),t.watch(()=>n.textAlign,e=>{(e==="left"||e==="center"||e==="right")&&e!==g.value&&(g.value=e)}),t.watch(()=>n.animate,e=>{const o=!!e;o!==m.value&&(m.value=o)}),t.watch(()=>n.duration,e=>{const o=Number(e);Number.isFinite(o)&&o>=0&&o!==h.value&&(h.value=o)}),t.watch(()=>n.easing,e=>{typeof e=="string"&&e!==y.value&&(y.value=e)}),t.watch(()=>n.tabIndex,e=>{const o=e===null||e===""?null:Number(e);o!==p.value&&(p.value=o)}),t.watch(()=>n.class,()=>I()),{headerRef:s,contentRef:N,props:n,visibleClass:B,responsiveClassList:c,isOpen:u,title:f,headerBoxStyle:x,titleInlineStyle:$,rootInlineStyle:L,animate:m,tabIndex:p,onToggleClick:k,open:C,close:S,toggle:T}}}),H=["aria-expanded","tabindex"],D={class:"hison-accordion-toggle"},j=["inert"],F={class:"hison-accordion-panel"},M={class:"hison-accordion-panel-inner"};function U(n,i,a,b,s,N){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[t.createElementVNode("div",{class:t.normalizeClass(["hison-accordion",n.isOpen?"hison-open":"",n.animate?"":"hison-no-anim"]),style:t.normalizeStyle([n.rootInlineStyle,n.props.style])},[t.createElementVNode("div",{ref:"headerRef",class:"hison-accordion-header",style:t.normalizeStyle([n.headerBoxStyle,n.props.headerStyle]),role:"button","aria-expanded":n.isOpen?"true":"false",tabindex:n.tabIndex??void 0,onClick:i[0]||(i[0]=r=>n.onToggleClick(r)),onKeydown:[i[1]||(i[1]=t.withKeys(t.withModifiers(r=>n.onToggleClick(r),["prevent"]),["enter"])),i[2]||(i[2]=t.withKeys(t.withModifiers(r=>n.onToggleClick(r),["prevent"]),["space"]))]},[t.createElementVNode("div",{class:"hison-accordion-title",style:t.normalizeStyle([n.titleInlineStyle])},[t.renderSlot(n.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(n.title),1)])],4),t.createElementVNode("div",D,[t.renderSlot(n.$slots,"toggle",{},()=>[i[3]||(i[3]=t.createElementVNode("span",{class:"hison-dropdown-caret"},"▾",-1))])])],44,H),t.createElementVNode("div",{ref:"contentRef",class:"hison-accordion-content",style:t.normalizeStyle(n.props.contentStyle),role:"region",inert:!n.isOpen||void 0},[t.createElementVNode("div",F,[t.createElementVNode("div",M,[t.renderSlot(n.$slots,"default")])])],12,j)],6)],2)}const K=q._export_sfc(R,[["render",U]]);exports.default=K;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as M, ref as o, computed as T, onMounted as K, onBeforeUnmount as G, watch as i, nextTick as P, openBlock as X, createElementBlock as J, normalizeClass as w, createElementVNode as c, normalizeStyle as N, withKeys as D, withModifiers as H, renderSlot as
|
|
2
|
-
import { T as Y, g as Z, u as _, e as ee, t as te, a as ne, b as q, h as f, r as le, c as oe, d as ie } from "./index-
|
|
3
|
-
import { a as ae, r as se } from "./setButtonCssEvent-
|
|
1
|
+
import { defineComponent as M, ref as o, computed as T, onMounted as K, onBeforeUnmount as G, watch as i, nextTick as P, openBlock as X, createElementBlock as J, normalizeClass as w, createElementVNode as c, normalizeStyle as N, withKeys as D, withModifiers as H, renderSlot as E, createTextVNode as Q, toDisplayString as W } from "vue";
|
|
2
|
+
import { T as Y, g as Z, u as _, e as ee, t as te, a as ne, b as q, h as f, r as le, c as oe, d as ie } from "./index-C8V9Uq5K.mjs";
|
|
3
|
+
import { a as ae, r as se } from "./setButtonCssEvent-CvF5MJ-D.mjs";
|
|
4
4
|
import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const ue = {
|
|
6
6
|
/**
|
|
@@ -93,7 +93,7 @@ const ue = {
|
|
|
93
93
|
setup(t, { emit: l }) {
|
|
94
94
|
const a = t.id || Z(), C = `haccordion:${a}`, s = o(null), O = o(null), r = _(), g = o(!!t.visible), m = o(t.title ?? ""), u = o(!!t.defaultOpen), y = o(t.textAlign ?? "left"), p = o(t.animate ?? !0), b = o(t.duration ?? 500), h = o(t.easing ?? "ease"), S = o(
|
|
95
95
|
t.tabIndex !== null && t.tabIndex !== "" ? Number(t.tabIndex) : null
|
|
96
|
-
), F = T(() => g.value ? "" : "hison-display-none"), d = o([]),
|
|
96
|
+
), F = T(() => g.value ? "" : "hison-display-none"), d = o([]), L = () => {
|
|
97
97
|
d.value = ee(te(t.class) || "", r.value), ne(d.value, "col") === -1 && d.value.push("hison-col-12"), q(d.value, "size", f.componentStyle.size), q(d.value, "color", "primary");
|
|
98
98
|
}, V = T(() => ({
|
|
99
99
|
"--hacc-duration": `${b.value}ms`,
|
|
@@ -105,12 +105,12 @@ const ue = {
|
|
|
105
105
|
if (!u.value) return;
|
|
106
106
|
const n = document.activeElement, x = O.value;
|
|
107
107
|
x && n && x.contains(n) && ((R = s.value) == null || R.focus()), u.value = !1, l("close", e ?? null, v.value);
|
|
108
|
-
},
|
|
109
|
-
l("toggle", e, v.value),
|
|
108
|
+
}, B = (e) => u.value ? A(e) : I(e), U = (e) => {
|
|
109
|
+
l("toggle", e, v.value), B(e);
|
|
110
110
|
}, v = o(null), $ = () => {
|
|
111
111
|
f.component.accordionList[a] && f.component.accordionList[a].isHisonvueComponent && console.warn(`[Hisonvue] The accordion ID is at risk of being duplicated. ${a}`), le(C, () => {
|
|
112
112
|
k(), P($);
|
|
113
|
-
}), s.value && ae(s.value),
|
|
113
|
+
}), s.value && ae(s.value), L(), v.value = {
|
|
114
114
|
isHisonvueComponent: !0,
|
|
115
115
|
getId: () => a,
|
|
116
116
|
getType: () => "accordion",
|
|
@@ -121,7 +121,7 @@ const ue = {
|
|
|
121
121
|
isOpen: () => u.value,
|
|
122
122
|
open: I,
|
|
123
123
|
close: A,
|
|
124
|
-
toggle:
|
|
124
|
+
toggle: B,
|
|
125
125
|
getTitle: () => m.value,
|
|
126
126
|
setTitle: (e) => {
|
|
127
127
|
m.value = e ?? "";
|
|
@@ -158,7 +158,7 @@ const ue = {
|
|
|
158
158
|
ie(C), s.value && se(s.value), (e = f.component) != null && e.accordionList && delete f.component.accordionList[a];
|
|
159
159
|
};
|
|
160
160
|
return K($), G(k), i(r, (e) => {
|
|
161
|
-
|
|
161
|
+
L(), l("responsive-change", e);
|
|
162
162
|
}), i(() => t.visible, (e) => {
|
|
163
163
|
e !== g.value && (g.value = !!e);
|
|
164
164
|
}), i(() => t.title, (e) => {
|
|
@@ -177,7 +177,7 @@ const ue = {
|
|
|
177
177
|
}), i(() => t.tabIndex, (e) => {
|
|
178
178
|
const n = e === null || e === "" ? null : Number(e);
|
|
179
179
|
n !== S.value && (S.value = n);
|
|
180
|
-
}), i(() => t.class, () =>
|
|
180
|
+
}), i(() => t.class, () => L()), {
|
|
181
181
|
headerRef: s,
|
|
182
182
|
contentRef: O,
|
|
183
183
|
props: t,
|
|
@@ -193,7 +193,7 @@ const ue = {
|
|
|
193
193
|
onToggleClick: U,
|
|
194
194
|
open: I,
|
|
195
195
|
close: A,
|
|
196
|
-
toggle:
|
|
196
|
+
toggle: B
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
}), de = ["aria-expanded", "tabindex"], ve = { class: "hison-accordion-toggle" }, fe = ["inert"], ge = { class: "hison-accordion-panel" }, me = { class: "hison-accordion-panel-inner" };
|
|
@@ -230,12 +230,12 @@ function ye(t, l, a, C, s, O) {
|
|
|
230
230
|
class: "hison-accordion-title",
|
|
231
231
|
style: N([t.titleInlineStyle])
|
|
232
232
|
}, [
|
|
233
|
-
|
|
233
|
+
E(t.$slots, "title", {}, () => [
|
|
234
234
|
Q(W(t.title), 1)
|
|
235
235
|
])
|
|
236
236
|
], 4),
|
|
237
237
|
c("div", ve, [
|
|
238
|
-
|
|
238
|
+
E(t.$slots, "toggle", {}, () => [
|
|
239
239
|
l[3] || (l[3] = c("span", { class: "hison-dropdown-caret" }, "▾", -1))
|
|
240
240
|
])
|
|
241
241
|
])
|
|
@@ -249,7 +249,7 @@ function ye(t, l, a, C, s, O) {
|
|
|
249
249
|
}, [
|
|
250
250
|
c("div", ge, [
|
|
251
251
|
c("div", me, [
|
|
252
|
-
|
|
252
|
+
E(t.$slots, "default")
|
|
253
253
|
])
|
|
254
254
|
])
|
|
255
255
|
], 12, fe)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as W, ref as o, computed as u, onMounted as X, onBeforeUnmount as _, watch as i, nextTick as C, unref as z, openBlock as V, createElementBlock as $, normalizeStyle as L, normalizeClass as q, createElementVNode as ee, renderSlot as K, withKeys as H, withModifiers as P, toDisplayString as se, createCommentVNode as te } from "vue";
|
|
2
|
-
import { B as T, S as ne, f as ae, i as oe, g as ie, u as le, e as ue, t as re, b as U, h as S, r as de, c as ge, d as be } from "./index-
|
|
3
|
-
import { r as D, a as ve } from "./setButtonCssEvent-
|
|
2
|
+
import { B as T, S as ne, f as ae, i as oe, g as ie, u as le, e as ue, t as re, b as U, h as S, r as de, c as ge, d as be } from "./index-C8V9Uq5K.mjs";
|
|
3
|
+
import { r as D, a as ve } from "./setButtonCssEvent-CvF5MJ-D.mjs";
|
|
4
4
|
import { _ as ce } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const fe = {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("./index-zy0OgBxq.js"),T=require("./setButtonCssEvent-D0RjMXa-.js"),H=require("./_plugin-vue_export-helper-BHFhmbuH.js"),P={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},baggieVisible:{type:Boolean,default:!0},zIndex:{type:Number,default:1e3},position:{type:String,default:s.ScreenPosition.topRight,validator:e=>s.SCREEN_POSITION_VALUES.includes(e)},text:{type:String,required:!1},backgroundType:{type:String,default:s.BackgroundType.filled,validator:e=>s.BACKGROUND_TYPE_VALUES.includes(e)},border:{type:Boolean,default:!0},shape:{type:String,default:"rounded",validator:e=>["square","rounded","circle"].includes(e)},tabIndex:{type:[Number,String],default:null,validator:e=>e===null||e===""||!isNaN(+e)&&isFinite(+e)},buttonEnabled:{type:Boolean,default:!1}},x=t.defineComponent({name:"HBaggie",props:P,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(e,{emit:a}){const l=e.id||s.getUUID(),h=`hbaggie:${l}`,B=s.useDevice(),w=t.ref(null),i=t.ref(null),g=t.ref(e.visible),b=t.ref(e.baggieVisible),r=t.ref(e.zIndex??1e3),c=t.ref(e.position),v=t.ref(e.text??""),f=t.ref(e.border??!0),m=t.ref(e.backgroundType||s.BackgroundType.filled),d=t.ref(e.shape||"rounded"),y=t.ref(e.tabIndex!==null&&e.tabIndex!==""?Number(e.tabIndex):null),u=t.ref(e.buttonEnabled??!1),V=t.computed(()=>g.value?"":"hison-display-none"),M=t.computed(()=>b.value?"":"hison-display-none"),$=t.computed(()=>f.value?"hison-border":""),q=t.computed(()=>{switch(m.value){case s.BackgroundType.transparent:return"hison-bg-transparent";case s.BackgroundType.empty:return"hison-bg-empty";default:return"hison-bg-filled"}}),z=t.computed(()=>d.value==="circle"?"hison-baggie-shape-circle":d.value==="square"?"hison-baggie-shape-square":"hison-baggie-shape-rounded"),C=t.ref([]),S=()=>{C.value=s.extractResponsiveClasses(s.toClassString(e.class)||"",B.value),s.addComponentNameToClass(C.value,"size",s.hisonCloser.componentStyle.size),s.addComponentNameToClass(C.value,"color","primary")},A=t.computed(()=>`hison-baggie-pos-${c.value}`),R=t.computed(()=>({zIndex:r.value})),K=t.computed(()=>({zIndex:r.value+1})),k=(n=!0)=>{const o=i.value;o&&(T.removeButtonCssEvent(o),n&&u.value&&T.addButtonCssEvent(o))},I=n=>{u.value&&a("click",n,t.unref(p))},L=()=>{u.value&&I(new MouseEvent("click"))},p=t.ref(null),E=()=>{s.hisonCloser.component.baggieList[l]&&s.hisonCloser.component.baggieList[l].isHisonvueComponent&&console.warn(`[Hisonvue] The baggie ID is at risk of being duplicated. ${l}`),s.registerReloadable(h,()=>{N(),t.nextTick(E)}),S(),t.nextTick(()=>k(!0)),p.value={isHisonvueComponent:!0,getId:()=>l,getType:()=>"baggie",isVisible:()=>g.value,setVisible:n=>{g.value=n},isBaggieVisible:()=>b.value,setBaggieVisible:n=>{b.value=n},getZIndex:()=>r.value,setZIndex:n=>{r.value=n},getPosition:()=>c.value,setPosition:n=>{c.value=n},getText:()=>v.value,setText:n=>{v.value=n},isBorder:()=>f.value,setBorder:n=>{f.value=n},getBackgroundType:()=>m.value,setBackgroundType:n=>{m.value=n},getShape:()=>d.value,setShape:n=>{d.value=n},getTabIndex:()=>y.value,setTabIndex:n=>{y.value=n!=null?Number(n):null},isButtonEnabled:()=>u.value,setButtonEnabled:n=>{u.value=n,t.nextTick(()=>k(!0))},reload:()=>s.reloadHisonComponent(h)},s.hisonCloser.component.baggieList[l]=p.value,a("mounted",p.value)},N=()=>{s.unregisterReloadable(h);const n=i.value;n&&T.removeButtonCssEvent(n),delete s.hisonCloser.component.baggieList[l]};return t.onMounted(E),t.onBeforeUnmount(N),t.watch(B,n=>{S(),a("responsive-change",n)}),t.watch(()=>e.visible,n=>{n!==g.value&&(g.value=!!n)}),t.watch(()=>e.baggieVisible,n=>{n!==b.value&&(b.value=!!n,t.nextTick(()=>k(!0)))}),t.watch(()=>e.zIndex,n=>{const o=Number(n);Number.isFinite(o)&&o!==r.value&&(r.value=o)}),t.watch(()=>e.position,n=>{typeof n=="string"&&n!==c.value&&(c.value=n)}),t.watch(()=>e.text,n=>{const o=n??"";o!==v.value&&(v.value=o)}),t.watch(()=>e.border,n=>{const o=!!n;o!==f.value&&(f.value=o)}),t.watch(()=>e.backgroundType,n=>{n&&n!==m.value&&(m.value=n)}),t.watch(()=>e.shape,n=>{(n==="square"||n==="rounded"||n==="circle")&&n!==d.value&&(d.value=n)}),t.watch(()=>e.tabIndex,n=>{const o=n===null||n===""?null:Number(n);o!==y.value&&(y.value=o)}),t.watch(()=>e.buttonEnabled,n=>{const o=!!n;o!==u.value&&(u.value=o,t.nextTick(()=>k(!0)))}),t.watch(()=>e.class,()=>S()),{id:l,props:e,anchorRef:w,baggieRef:i,text:v,visibleClass:V,baggieVisibleClass:M,responsiveClassList:C,backgroundTypeClass:q,borderClass:$,shapeClass:z,positionClass:A,anchorStyle:R,badgeStyle:K,baggieMethods:t.computed(()=>t.unref(p)),tabIndex:y,buttonEnabled:u,onClick:I,onKeyActivate:L}}}),O={class:"hison-baggie-target"},U=["tabindex"],D={key:1,class:"hison-baggie-text"};function j(e,a,l,h,B,w){return t.openBlock(),t.createElementBlock("span",{ref:"anchorRef",class:t.normalizeClass(["hison-baggie-anchor",e.visibleClass,...e.responsiveClassList]),style:t.normalizeStyle(e.anchorStyle),onMousedown:a[3]||(a[3]=i=>e.$emit("mousedown",i,e.baggieMethods)),onMouseup:a[4]||(a[4]=i=>e.$emit("mouseup",i,e.baggieMethods)),onMouseover:a[5]||(a[5]=i=>e.$emit("mouseover",i,e.baggieMethods)),onMouseout:a[6]||(a[6]=i=>e.$emit("mouseout",i,e.baggieMethods))},[t.createElementVNode("span",O,[t.renderSlot(e.$slots,"default")]),e.baggieVisible?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"baggieRef",class:t.normalizeClass(["hison-baggie",e.positionClass,e.backgroundTypeClass,e.borderClass,e.shapeClass,e.baggieVisibleClass,e.buttonEnabled?"hison-baggie-button":null]),style:t.normalizeStyle([e.badgeStyle,e.props.style]),role:"status",tabindex:e.tabIndex??void 0,onClick:a[0]||(a[0]=(...i)=>e.onClick&&e.onClick(...i)),onKeydown:[a[1]||(a[1]=t.withKeys(t.withModifiers((...i)=>e.onKeyActivate&&e.onKeyActivate(...i),["prevent"]),["enter"])),a[2]||(a[2]=t.withKeys(t.withModifiers((...i)=>e.onKeyActivate&&e.onKeyActivate(...i),["prevent"]),["space"]))]},[e.$slots.badge?t.renderSlot(e.$slots,"badge",{key:0}):(t.openBlock(),t.createElementBlock("span",D,t.toDisplayString(e.text),1))],46,U)):t.createCommentVNode("",!0)],38)}const F=H._export_sfc(x,[["render",j]]);exports.default=F;
|