hisonvue 1.1.2 → 1.1.3
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-nste-gIh.js → HAccordion-Bc8LHllz.js} +1 -1
- package/dist/{HAccordion-DXkKdzdS.mjs → HAccordion-CYdLZCoO.mjs} +2 -2
- package/dist/{HBaggie-D9XHuvli.js → HBaggie-XgHTnkp2.js} +1 -1
- package/dist/{HBaggie-CNEAlhu4.mjs → HBaggie-Ywgz5nvV.mjs} +2 -2
- package/dist/{HBanner-B8DynVnX.js → HBanner-BcDU3AwV.js} +1 -1
- package/dist/{HBanner-Bh1c1LQ0.mjs → HBanner-CidWbYwG.mjs} +2 -2
- package/dist/{HButton-eTsFKKnM.js → HButton-B6af0nzb.js} +1 -1
- package/dist/{HButton-9dYGtsQK.mjs → HButton-Bf1WiQNr.mjs} +2 -2
- package/dist/{HCalendar-Cq5zpcAr.js → HCalendar-BiiLjDq7.js} +1 -1
- package/dist/{HCalendar-UVAkYS-W.mjs → HCalendar-CQs3-lsy.mjs} +1 -1
- package/dist/{HCaption-C51bVq01.mjs → HCaption-CJD8YqTy.mjs} +1 -1
- package/dist/{HCaption-uIKYMMan.js → HCaption-DxXZw4pH.js} +1 -1
- package/dist/{HChart-B5ejc-SG.mjs → HChart-Br_mONmh.mjs} +1 -1
- package/dist/{HChart-oEkG07OJ.js → HChart-CLxSeQfB.js} +1 -1
- package/dist/{HDrawer-DHJl-quY.mjs → HDrawer-C_zCEAoj.mjs} +1 -1
- package/dist/{HDrawer-Cc3jqUlQ.js → HDrawer-QSVck31B.js} +1 -1
- package/dist/{HDropdown-Dtw78Nkz.mjs → HDropdown-CzKF2cyh.mjs} +2 -2
- package/dist/{HDropdown-CU3zKxJ3.js → HDropdown-l_g96ufU.js} +1 -1
- package/dist/{HFileset-CthT1M21.mjs → HFileset-B6ezY9_O.mjs} +1 -1
- package/dist/{HFileset-BTxxYDz4.js → HFileset-CnM1z10l.js} +1 -1
- package/dist/{HGap-B-PVteyd.mjs → HGap--qHusiKo.mjs} +1 -1
- package/dist/{HGap-BWYEUzBg.js → HGap-D9TgBL0P.js} +1 -1
- package/dist/{HGrid-BdSoZ3Df.mjs → HGrid-DWFs2PVH.mjs} +1 -1
- package/dist/{HGrid-V2xOmqxp.js → HGrid-DZT6UYsc.js} +1 -1
- package/dist/{HImagebox-Cy1XmZOi.mjs → HImagebox-B6DkNa0s.mjs} +1 -1
- package/dist/{HImagebox-Rjlk6PO-.js → HImagebox-C-kUyV2a.js} +1 -1
- package/dist/HInput-DF_oPvVG.js +1 -0
- package/dist/HInput-Dih14jAK.mjs +1217 -0
- package/dist/{HInputGroup-C5CCa_H8.js → HInputGroup-CxiRFkpV.js} +1 -1
- package/dist/{HInputGroup-CVVIbprI.mjs → HInputGroup-Czqo_DBM.mjs} +1 -1
- package/dist/HLabel-BFuX1v46.js +1 -0
- package/dist/HLabel-x3QyAn-P.mjs +400 -0
- package/dist/{HLayout-BbYIgmYy.js → HLayout-DHwcSj6Y.js} +1 -1
- package/dist/{HLayout-DXRXlsWL.mjs → HLayout-DbIW32b3.mjs} +1 -1
- package/dist/{HList-BdC2kv9A.mjs → HList-B0_bqe2X.mjs} +2 -2
- package/dist/{HList-BbhTZa3d.js → HList-CGt8QYPb.js} +1 -1
- package/dist/{HModal-BuIgfi_-.js → HModal-Bbq2SffE.js} +1 -1
- package/dist/{HModal-4ABSx2me.mjs → HModal-DaQTId_h.mjs} +1 -1
- package/dist/{HNote-DSQJDOUy.mjs → HNote-BxjGgGT6.mjs} +1 -1
- package/dist/{HNote-h-lB6QZv.js → HNote-CHa35R5J.js} +1 -1
- package/dist/{HPagination-BqoDaVlP.mjs → HPagination-BZpSWEEW.mjs} +2 -2
- package/dist/{HPagination-CostpT0D.js → HPagination-OwLtKBDy.js} +1 -1
- package/dist/{HParagraph-BGOLdRFM.mjs → HParagraph-BiOV9AaX.mjs} +1 -1
- package/dist/{HParagraph-C_afHbvS.js → HParagraph-DA30mUOK.js} +1 -1
- package/dist/{HPopup-B7lscsTs.mjs → HPopup-CSWCs1bC.mjs} +1 -1
- package/dist/{HPopup-BBpZXoYa.js → HPopup-CXsLCjT7.js} +1 -1
- package/dist/{HSpinner--MbdeUop.js → HSpinner-B6mWhGkj.js} +1 -1
- package/dist/{HSpinner-CYbVuwRT.mjs → HSpinner-DEHdIFhp.mjs} +1 -1
- package/dist/{HTable-DI9-1vqI.js → HTable-BoUCH2Zf.js} +1 -1
- package/dist/{HTable-CJFft6Z1.mjs → HTable-By0pF5zV.mjs} +1 -1
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.css +1 -1
- package/dist/hisonvue.d.ts +60 -0
- package/dist/hisonvue.es.js +2 -2
- package/dist/{index-lqOpF_Ng.mjs → index-BC8m9ivd.mjs} +1 -1
- package/dist/{index-nNWQ7mcU.js → index-CyZluKOE.js} +1 -1
- package/dist/{setButtonCssEvent-Ba1z9cap.mjs → setButtonCssEvent-DzPansSE.mjs} +1 -1
- package/dist/{setButtonCssEvent-DLH6Bh2r.js → setButtonCssEvent-fXHkzhY1.js} +1 -1
- package/package.json +1 -1
- package/dist/HInput-CEtGDqFm.mjs +0 -1103
- package/dist/HInput-DATgRssT.js +0 -1
- package/dist/HLabel-DZA3unsC.mjs +0 -369
- package/dist/HLabel-Dn0SXEHh.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),n=require("./index-CyZluKOE.js"),C=require("./_plugin-vue_export-helper-BHFhmbuH.js"),G={id:{type:String,required:!1},editMode:{type:String,required:!1,validator:l=>l==null||n.EDIT_MODE_VALUES.includes(l)},status:{type:String,required:!1,default:n.DataStatus.R,validator:l=>n.DATA_STATUS_VALUES.includes(l)},modelValue:{type:Object,default:()=>({})}},O=s.defineComponent({name:"HInputGroup",props:G,emits:["update:modelValue","mounted"],setup(l,{emit:m}){const b=s.ref(null),S=s.ref(null),h=l.id??n.getUUID(),V=`hinputGroup:${h}`,D=s.ref(l.editMode??n.EditMode.editable),g=s.ref(l.status??n.DataStatus.R),d=s.ref([]),r=s.ref({}),p=s.ref({});s.provide("registerToInputGroup",e=>{var t,o,u,i,f;if(!d.value.includes(e)){d.value.push(e),d.value.sort((v,_)=>v.localeCompare(_));const c=l.modelValue??{};c&&Object.prototype.hasOwnProperty.call(c,e)&&((o=(t=n.hison.component.getInput(e))==null?void 0:t.setValue)==null||o.call(t,c[e]));const a=n.hison.component.getInput(e);if(((u=a==null?void 0:a.getInputType)==null?void 0:u.call(a))==="radio"){const v=((i=a.getName)==null?void 0:i.call(a))||e;r.value[v]||(r.value[v]=[]),r.value[v].includes(e)||r.value[v].push(e),(f=a.getValue)!=null&&f.call(a)?p.value[v]=e:Object.prototype.hasOwnProperty.call(p.value,v)||(p.value[v]=null)}}}),s.provide("radioMembershipChanged",(e,t,o,u)=>{var i,f;if(t!==o){if(t&&r.value[t]){if(r.value[t]=r.value[t].filter(c=>c!==e),p.value[t]===e){p.value[t]=null;const c={...l.modelValue||{}};c[t]=null,m("update:modelValue",c)}r.value[t].length===0&&(delete r.value[t],delete p.value[t])}if(r.value[o]||(r.value[o]=[]),r.value[o].includes(e)||r.value[o].push(e),u){p.value[o]=e;for(const a of r.value[o])(f=(i=n.hison.component.getInput(a))==null?void 0:i.setValue)==null||f.call(i,a===e);const c={...l.modelValue||{}};c[o]=e,m("update:modelValue",c),g.value!==n.DataStatus.U&&(g.value=n.DataStatus.U)}else Object.prototype.hasOwnProperty.call(p.value,o)||(p.value[o]=null)}}),s.provide("notifyInputGroupStatus",(e,t)=>{var u,i;if(r.value[e]){const f=e,c=t;p.value[f]=c;for(const v of r.value[f])(i=(u=n.hison.component.getInput(v))==null?void 0:u.setValue)==null||i.call(u,v===c);const a={...l.modelValue||{}};a[f]=c,m("update:modelValue",a),g.value!==n.DataStatus.U&&(g.value=n.DataStatus.U);return}g.value!==n.DataStatus.U&&(g.value=n.DataStatus.U);const o={...l.modelValue,[e]:t};m("update:modelValue",o)});const y=()=>{const e={};if(!d.value)return e;d.value.forEach(t=>{var u,i;const o=n.hison.component.getInput(t);o&&((u=o.getInputType)==null?void 0:u.call(o))!=="radio"&&(e[t]=(i=o.getValue)==null?void 0:i.call(o))});for(const[t,o]of Object.entries(r.value)){let u=p.value[t]??null;u&&!o.includes(u)&&(u=null),e[t]=u}return e},M=e=>{if(!(!e||typeof e!="object")){Object.keys(e).forEach(t=>{var o,u;if(d.value.includes(t)){const i=e[t];(u=(o=n.hison.component.getInput(t))==null?void 0:o.setValue)==null||u.call(o,i)}});for(const[t,o]of Object.entries(r.value)){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const u=e[t];o.forEach(i=>{var a;const f=n.hison.component.getInput(i);if(!f)return;const c=u===i;(a=f.setValue)==null||a.call(f,c)}),p.value[t]=u??null}}},E=()=>{n.hisonCloser.component.inputGroupList[h]&&n.hisonCloser.component.inputGroupList[h].isHisonvueComponent&&console.warn(`[Hisonvue] The input group ID is at risk of being duplicated. ${h}`),n.registerReloadable(V,()=>{I(),setTimeout(E)}),b.value&&(S.value={isHisonvueComponent:!0,getId:()=>h,getType:()=>"inputGroup",clear:(e=!0)=>{d.value.forEach(t=>{const o=n.hison.component.getInput(t);o&&o.setValue(null)}),e&&(g.value=n.DataStatus.C)},getDataModel:()=>new n.hison.data.DataModel(y()),setDataModel:e=>{if(e.getRowCount()>0)return M(e.getRow(0))},getDataObject:()=>y(),setDataObject:e=>M(e),load:e=>{if(e&&e.getIsDataModel&&e.getIsDataModel()){const t=e;if(t.getColumnCount()===0||t.getRowCount()===0)return;M(t.getRow(0))}else e&&typeof e=="object"&&M(e)},getStatus:()=>g.value,setStatus:e=>{g.value=n.DataStatus[e]},isModified:()=>{for(const e of d.value){const t=n.hison.component.getInput(e);if(t&&t.isModified())return!0}return!1},initModified:()=>{d.value.forEach(e=>{const t=n.hison.component.getInput(e);t&&t.setModified(!1)})},checkRequired:()=>{var e,t;for(const o of d.value){const u=n.hison.component.getInput(o);if((e=u==null?void 0:u.getRequired)!=null&&e.call(u)&&!((t=u.getValue)!=null&&t.call(u)))return u}return null},getEditMode:()=>D.value,setEditMode:e=>{D.value=e,d.value.forEach(t=>{const o=n.hison.component.getInput(t);o&&o.setEditMode(e)})},focus:e=>{var t;if(e)return(t=n.hison.component.getInput(e))==null?void 0:t.focus();for(const o of d.value){const u=n.hison.component.getInput(o);if(u&&u.getEditMode()===n.EditMode.editable)return u.focus()}},reload:()=>n.reloadHisonComponent(V)},n.hisonCloser.component.inputGroupList[h]=S.value,m("mounted",S.value))},I=()=>{n.unregisterReloadable(V),delete n.hisonCloser.component.inputGroupList[h],d.value=[]};return s.onMounted(E),s.onBeforeUnmount(I),s.watch(()=>l.modelValue,e=>{M(e)},{deep:!0}),s.watch(()=>l.modelValue,e=>{M(e)},{deep:!0}),s.watch(()=>l.editMode,e=>{e&&e!==D.value&&(D.value=e,d.value.forEach(t=>{var o,u;return(u=(o=n.hison.component.getInput(t))==null?void 0:o.setEditMode)==null?void 0:u.call(o,D.value)}))}),s.watch(()=>l.status,e=>{e&&e!==g.value&&(g.value=e)}),{inputGroupRef:b,props:l}}}),j={ref:"inputGroupRef",class:"hison-data-group"};function R(l,m,b,S,h,V){return s.openBlock(),s.createElementBlock("div",j,[s.renderSlot(l.$slots,"default")],512)}const U=C._export_sfc(O,[["render",R]]);exports.default=U;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as U, ref as h, provide as G, onMounted as T, onBeforeUnmount as $, watch as I, createElementBlock as H, openBlock as L, renderSlot as q } from "vue";
|
|
2
|
-
import { V as A, W as g, E as P, g as k, y as C, l as c, h as _, r as B, c as w, d as x } from "./index-
|
|
2
|
+
import { V as A, W as g, E as P, g as k, y as C, l as c, h as _, r as B, c as w, d as x } from "./index-BC8m9ivd.mjs";
|
|
3
3
|
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const z = {
|
|
5
5
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./index-CyZluKOE.js"),E=require("./setButtonCssEvent-fXHkzhY1.js"),se=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ue={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},title:{type:String,required:!1},text:{type:String,required:!1},href:{type:String,default:null},anchorAttrs:{type:Object,default:()=>({})},fontBold:{type:Boolean,default:!1},fontItalic:{type:Boolean,default:!1},fontThruline:{type:Boolean,default:!1},fontUnderline:{type:Boolean,default:!1},textAlign:{type:String,default:null,validator:n=>n==null||o.TEXT_ALIGN_VALUES.includes(n)},border:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:n=>o.BACKGROUND_TYPE_VALUES.includes(n)},toggleTarget:{type:String,default:null},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)}},re=t.defineComponent({name:"HLabel",props:ue,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(n,{emit:a,slots:z}){const v=t.ref(null),g=t.ref(null),r=n.id?n.id:o.getUUID(),s=`hlabel:${r}`,$=o.useDevice(),M=t.useSlots(),b=t.ref(n.visible),c=t.ref(n.title||""),T=t.ref(n.textAlign??o.TextAlign.left),G=t.computed(()=>({textAlign:T.value})),d=t.ref(n.href??null),u=t.ref({...n.anchorAttrs||{}}),h=t.computed(()=>!!(d.value&&String(d.value).trim())),J=t.computed(()=>{const e={...u.value};return c.value&&e.title==null&&(e.title=c.value),e.href=d.value||void 0,e.download===!0&&(e.download=""),String(e.target||"")==="_blank"&&(e.rel==null||String(e.rel).trim()==="")&&(e.rel="noopener noreferrer"),e}),x=t.computed(()=>M.default?M.default():[]),U=t.computed(()=>x.value.length>0&&x.value.every(e=>e.type===t.Text)),y=t.computed(()=>!!M.default&&!U.value),X=t.computed(()=>y.value?"div":h.value?"a":"span"),A=t.ref(n.fontBold),Y=t.computed(()=>{if(A.value)return"hison-font-bold"}),C=t.ref(n.fontItalic),Q=t.computed(()=>{if(C.value)return"hison-font-italic"}),p=t.ref(n.fontThruline),W=t.computed(()=>{if(p.value)return"hison-font-thruline-important"}),k=t.ref(n.fontUnderline),Z=t.computed(()=>{if(k.value)return"hison-font-underline-important"}),B=t.ref(n.border??!1),w=t.ref(n.backgroundType||o.BackgroundType.empty),_=t.computed(()=>b.value?"":"hison-display-none"),ee=t.computed(()=>B.value?"hison-border":""),te=t.computed(()=>{switch(w.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),i=t.ref(n.text||"");t.onMounted(()=>{if(U.value){const e=x.value.map(l=>String(l.children??"")).join("");i.value=e}});const f=t.ref(n.toggleTarget??null),m=t.computed(()=>!!(f.value&&String(f.value).trim())),S=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),N=t.ref([]),H=()=>{N.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",$.value),o.addComponentNameToClass(N.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(N.value,"color","primary")},F=()=>{var K,O,D,R,j,P;if(!m.value)return;const e=String(f.value),l=(K=o.hisonCloser.component.inputList)==null?void 0:K[e];if(!l||!l.isHisonvueComponent)return;const I=(O=l.getInputType)==null?void 0:O.call(l),oe=(D=l.getEditMode)==null?void 0:D.call(l);if(I!=="checkbox"&&I!=="radio"||oe!=="editable")return;const ae=!!((R=l.getValue)!=null&&R.call(l));I==="checkbox"?(j=l.setValue)==null||j.call(l,!ae):(P=l.setValue)==null||P.call(l,!0)},ne=e=>{m.value&&F(),a("click",e,g.value)},le=e=>{if(m.value&&F(),!h.value)return;const l=v.value;l&&l.tagName==="A"&&l.click()},L=(e=!0)=>{const l=v.value;if(l){if(E.removeButtonCssEvent(l),m.value){E.addButtonCssEvent(l);return}e&&h.value&&l.tagName==="A"&&E.addButtonCssEvent(l)}},q=()=>{o.hisonCloser.component.labelList[r]&&o.hisonCloser.component.labelList[r].isHisonvueComponent&&console.warn(`[Hisonvue] The label ID is at risk of being duplicated. ${r}`),o.registerReloadable(s,()=>{V(),t.nextTick(q)}),H(),t.nextTick(()=>L(!0)),g.value={isHisonvueComponent:!0,getId:()=>r,getType:()=>"label",isVisible:()=>b.value,setVisible:e=>{b.value=e},getTitle:()=>c.value,setTitle:e=>{c.value=e},getText:()=>y.value?"":i.value,setText:e=>{y.value||(i.value=e)},getHref:()=>d.value??"",setHref:e=>{d.value=e??null},getAnchorAttrs:()=>({...u.value}),replaceAnchorAttrs:e=>{u.value={...e}},mergeAnchorAttrs:e=>{u.value={...u.value,...e}},setAnchorAttr:(e,l)=>{u.value={...u.value,[e]:l}},removeAnchorAttr:e=>{const l={...u.value};delete l[e],u.value=l},isFontBold:()=>A.value,setFontBold:e=>{A.value=e},isFontItalic:()=>C.value,setFontItalic:e=>{C.value=e},isFontThruline:()=>p.value,setFontThruline:e=>{p.value=e},isFontUnderline:()=>k.value,setFontUnderline:e=>{k.value=e},getTextAlign:()=>T.value,setTextAlign:e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(T.value=e)},isBorder:()=>B.value,setBorder:e=>{B.value=e},getBackgroundType:()=>w.value,setBackgroundType:e=>{w.value=e},getToggleTarget:()=>f.value,setToggleTarget:e=>{f.value=e},reload:()=>o.reloadHisonComponent(s),getTabIndex:()=>S.value,setTabIndex:e=>{S.value=e!=null?Number(e):null},focus:()=>{const e=v.value;e&&h.value&&e.tagName==="A"&&e.focus()}},o.hisonCloser.component.labelList[r]=g.value,a("mounted",g.value)},V=()=>{o.unregisterReloadable(s);const e=v.value;e&&E.removeButtonCssEvent(e),delete o.hisonCloser.component.labelList[r]};return t.onMounted(q),t.onBeforeUnmount(V),t.watch($,e=>{H(),a("responsive-change",e)}),t.watch(h,e=>{t.nextTick(()=>L(e))},{flush:"post"}),t.watch(m,e=>{t.nextTick(()=>L(e))},{flush:"post"}),t.watch(()=>n.visible,e=>{const l=!!e;l!==b.value&&(b.value=l)}),t.watch(()=>n.title,e=>{const l=e??"";l!==c.value&&(c.value=l)}),t.watch(()=>n.text,e=>{if(!y.value){const l=e??"";l!==i.value&&(i.value=l)}}),t.watch(x,e=>{if(U.value){const l=e.map(I=>String(I.children??"")).join("");l!==i.value&&(i.value=l)}}),t.watch(()=>n.href,e=>{const l=e??null;l!==d.value&&(d.value=l)}),t.watch(()=>n.anchorAttrs,e=>{const l={...e||{}};JSON.stringify(l)!==JSON.stringify(u.value)&&(u.value=l)}),t.watch(()=>n.fontBold,e=>{const l=!!e;l!==A.value&&(A.value=l)}),t.watch(()=>n.fontItalic,e=>{const l=!!e;l!==C.value&&(C.value=l)}),t.watch(()=>n.fontThruline,e=>{const l=!!e;l!==p.value&&(p.value=l)}),t.watch(()=>n.fontUnderline,e=>{const l=!!e;l!==k.value&&(k.value=l)}),t.watch(()=>n.textAlign,e=>{e&&e!==T.value&&(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(T.value=e)}),t.watch(()=>n.border,e=>{const l=!!e;l!==B.value&&(B.value=l)}),t.watch(()=>n.backgroundType,e=>{e&&e!==w.value&&(w.value=e)}),t.watch(()=>n.toggleTarget,e=>{const l=e??null;l!==f.value&&(f.value=l)}),t.watch(()=>n.tabIndex,e=>{const l=e===null||e===""?null:Number(e);l!==S.value&&(S.value=l)}),t.watch(()=>n.class,()=>{H()}),{labelRef:v,labelMethods:t.computed(()=>t.unref(g)),props:n,title:c,hasHref:h,hasToggleTarget:m,hasElementSlot:y,renderTag:X,internalText:i,computedAnchorAttrs:J,visibleClass:_,fontBoldClass:Y,fontItalicClass:Q,fontThrulineClass:W,fontUnderlineClass:Z,textAlignStyle:G,borderClass:ee,backgroundTypeClass:te,responsiveClassList:N,tabIndex:S,onClick:ne,onKeyActivate:le}}}),ie={key:2,class:"hison-label-text"};function ce(n,a,z,v,g,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.renderTag),t.mergeProps({ref:"labelRef",class:["hison-label",n.hasHref?"hison-label-link":null,n.hasToggleTarget?"hison-label-has-toggle-target":null,n.fontBoldClass,n.fontItalicClass,n.fontThrulineClass,n.fontUnderlineClass,n.borderClass,n.backgroundTypeClass],style:[n.textAlignStyle,n.props.style],title:n.title||void 0,tabindex:n.tabIndex??void 0},n.renderTag==="a"?n.computedAnchorAttrs:void 0,{onClick:n.onClick,onMousedown:a[0]||(a[0]=s=>n.$emit("mousedown",s,n.labelMethods)),onMouseup:a[1]||(a[1]=s=>n.$emit("mouseup",s,n.labelMethods)),onMouseover:a[2]||(a[2]=s=>n.$emit("mouseover",s,n.labelMethods)),onMouseout:a[3]||(a[3]=s=>n.$emit("mouseout",s,n.labelMethods)),onKeydown:[t.withKeys(t.withModifiers(n.onKeyActivate,["prevent"]),["enter"]),t.withKeys(t.withModifiers(n.onKeyActivate,["prevent"]),["space"])]}),{default:t.withCtx(()=>[n.hasElementSlot?t.renderSlot(n.$slots,"default",{key:0}):n.hasHref?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(n.internalText),1)],64)):(t.openBlock(),t.createElementBlock("span",ie,t.toDisplayString(n.internalText),1))]),_:3},16,["class","style","title","tabindex","onClick","onKeydown"]))],2)}const de=se._export_sfc(re,[["render",ce]]);exports.default=de;
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { defineComponent as Te, ref as a, useSlots as Ae, computed as o, Text as Ce, onMounted as W, onBeforeUnmount as Se, watch as n, nextTick as x, unref as ke, createElementBlock as R, openBlock as E, normalizeClass as Be, createBlock as Ie, resolveDynamicComponent as pe, mergeProps as we, withKeys as Z, withModifiers as _, withCtx as Ne, renderSlot as Ue, Fragment as Le, createTextVNode as Me, toDisplayString as ee } from "vue";
|
|
2
|
+
import { B as He, f as $, T as xe, g as Ee, u as $e, w as g, e as Fe, t as Ve, b as te, h as T, r as Ke, c as Oe, d as Re } from "./index-BC8m9ivd.mjs";
|
|
3
|
+
import { r as le, a as ne } from "./setButtonCssEvent-DzPansSE.mjs";
|
|
4
|
+
import { _ as De } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const je = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the label.
|
|
8
|
+
* - Access methods via `hison.component.getLabel(id)`
|
|
9
|
+
* - Duplicate `id` will throw at mount time
|
|
10
|
+
*/
|
|
11
|
+
id: { type: String, required: !1 },
|
|
12
|
+
/**
|
|
13
|
+
* Custom class applied to the label (string / array / object all supported).
|
|
14
|
+
* - Works with responsive classes like `hison-col-*`, `hison-size-*`, etc.
|
|
15
|
+
*/
|
|
16
|
+
class: {
|
|
17
|
+
type: [String, Array, Object],
|
|
18
|
+
required: !1
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Inline style for the label (string, object, or an array of objects).
|
|
22
|
+
*/
|
|
23
|
+
style: {
|
|
24
|
+
type: [String, Object, Array],
|
|
25
|
+
required: !1
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Controls visibility of the label.
|
|
29
|
+
* - Boolean only. Use `:visible="false"` (with a colon).
|
|
30
|
+
*/
|
|
31
|
+
visible: { type: Boolean, default: !0 },
|
|
32
|
+
/**
|
|
33
|
+
* Tooltip text shown on hover (maps to `title` attribute).
|
|
34
|
+
*/
|
|
35
|
+
title: { type: String, required: !1 },
|
|
36
|
+
/**
|
|
37
|
+
* Text content of the label (alternative to default slot).
|
|
38
|
+
*/
|
|
39
|
+
text: { type: String, required: !1 },
|
|
40
|
+
/**
|
|
41
|
+
* When provided (non-empty), label renders an <a> instead of <span>.
|
|
42
|
+
*/
|
|
43
|
+
href: { type: String, default: null },
|
|
44
|
+
/**
|
|
45
|
+
* Extra attributes forwarded to the underlying `<a>` element when `href` is set.
|
|
46
|
+
* - Maps directly to native anchor/ARIA attributes (e.g., `target`, `rel`, `download`, `aria-label`, ...).
|
|
47
|
+
* - Use this to control accessibility and advanced link behavior.
|
|
48
|
+
*
|
|
49
|
+
* Example:
|
|
50
|
+
* { target: '_blank', rel: 'noopener noreferrer', download: true, 'aria-label': 'External link' }
|
|
51
|
+
*/
|
|
52
|
+
anchorAttrs: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => ({})
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Bold font style toggle.
|
|
58
|
+
* - Boolean only
|
|
59
|
+
* - Adds `hison-font-bold` class when enabled
|
|
60
|
+
*/
|
|
61
|
+
fontBold: { type: Boolean, default: !1 },
|
|
62
|
+
/**
|
|
63
|
+
* Italic font style toggle.
|
|
64
|
+
* - Boolean only
|
|
65
|
+
* - Adds `hison-font-italic` class when enabled
|
|
66
|
+
*/
|
|
67
|
+
fontItalic: { type: Boolean, default: !1 },
|
|
68
|
+
/**
|
|
69
|
+
* Strikethrough font style toggle.
|
|
70
|
+
* - Boolean only
|
|
71
|
+
* - Adds `hison-font-thruline` class when enabled
|
|
72
|
+
*/
|
|
73
|
+
fontThruline: { type: Boolean, default: !1 },
|
|
74
|
+
/**
|
|
75
|
+
* Underline font style toggle.
|
|
76
|
+
* - Boolean only
|
|
77
|
+
* - Adds `hison-font-underline` class when enabled
|
|
78
|
+
*/
|
|
79
|
+
fontUnderline: { type: Boolean, default: !1 },
|
|
80
|
+
/**
|
|
81
|
+
* Text alignment for the input’s display text.
|
|
82
|
+
* - 'left' | 'center' | 'right'
|
|
83
|
+
* - Accepts enum `TextAlign` or its literal strings
|
|
84
|
+
*/
|
|
85
|
+
textAlign: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: null,
|
|
88
|
+
validator: (t) => t == null || xe.includes(t)
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* Whether to show border (rendered as subtle box-shadow).
|
|
92
|
+
* - Default: false (no border)
|
|
93
|
+
*/
|
|
94
|
+
border: { type: Boolean, default: !1 },
|
|
95
|
+
/**
|
|
96
|
+
* Label background type.
|
|
97
|
+
* - 'filled' | 'empty' | 'transparent'
|
|
98
|
+
* - Default: 'empty'
|
|
99
|
+
*/
|
|
100
|
+
backgroundType: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: $.empty,
|
|
103
|
+
validator: (t) => He.includes(t)
|
|
104
|
+
},
|
|
105
|
+
toggleTarget: {
|
|
106
|
+
/** When set, clicking the label (or Enter/Space) will toggle the target HInput (checkbox/radio) by id. */
|
|
107
|
+
type: String,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Controls keyboard focus order of the element.
|
|
112
|
+
* - `0` enables natural tab navigation, positive numbers set custom order.
|
|
113
|
+
* - `null` or `''` removes tabindex (not focusable).
|
|
114
|
+
*/
|
|
115
|
+
tabIndex: {
|
|
116
|
+
type: [Number, String],
|
|
117
|
+
default: null,
|
|
118
|
+
validator: (t) => t === null || t === "" || !isNaN(+t) && isFinite(+t)
|
|
119
|
+
}
|
|
120
|
+
}, qe = Te({
|
|
121
|
+
name: "HLabel",
|
|
122
|
+
props: je,
|
|
123
|
+
inheritAttrs: !1,
|
|
124
|
+
emits: ["mounted", "responsive-change", "click", "mousedown", "mouseup", "mouseover", "mouseout"],
|
|
125
|
+
setup(t, { emit: s, slots: ae }) {
|
|
126
|
+
const b = a(null), m = a(null), r = t.id ? t.id : Ee(), u = `hlabel:${r}`, D = $e(), F = Ae(), A = a(t.visible), f = a(t.title || ""), C = a(t.textAlign ?? g.left), oe = o(() => ({ textAlign: C.value })), v = a(t.href ?? null), i = a({ ...t.anchorAttrs || {} }), h = o(() => !!(v.value && String(v.value).trim())), se = o(() => {
|
|
127
|
+
const e = { ...i.value };
|
|
128
|
+
return f.value && e.title == null && (e.title = f.value), e.href = v.value || void 0, e.download === !0 && (e.download = ""), String(e.target || "") === "_blank" && (e.rel == null || String(e.rel).trim() === "") && (e.rel = "noopener noreferrer"), e;
|
|
129
|
+
}), M = o(() => F.default ? F.default() : []), V = o(
|
|
130
|
+
() => M.value.length > 0 && M.value.every((e) => e.type === Ce)
|
|
131
|
+
), S = o(
|
|
132
|
+
() => !!F.default && !V.value
|
|
133
|
+
), ue = o(() => S.value ? "div" : h.value ? "a" : "span"), k = a(t.fontBold), ie = o(() => {
|
|
134
|
+
if (k.value) return "hison-font-bold";
|
|
135
|
+
}), B = a(t.fontItalic), re = o(() => {
|
|
136
|
+
if (B.value) return "hison-font-italic";
|
|
137
|
+
}), I = a(t.fontThruline), de = o(() => {
|
|
138
|
+
if (I.value) return "hison-font-thruline-important";
|
|
139
|
+
}), p = a(t.fontUnderline), fe = o(() => {
|
|
140
|
+
if (p.value) return "hison-font-underline-important";
|
|
141
|
+
}), w = a(t.border ?? !1), N = a(t.backgroundType || $.empty), ve = o(() => A.value ? "" : "hison-display-none"), ce = o(() => w.value ? "hison-border" : ""), ge = o(() => {
|
|
142
|
+
switch (N.value) {
|
|
143
|
+
case $.empty:
|
|
144
|
+
return "hison-bg-empty";
|
|
145
|
+
case $.transparent:
|
|
146
|
+
return "hison-bg-transparent";
|
|
147
|
+
default:
|
|
148
|
+
return "hison-bg-filled";
|
|
149
|
+
}
|
|
150
|
+
}), d = a(t.text || "");
|
|
151
|
+
W(() => {
|
|
152
|
+
if (V.value) {
|
|
153
|
+
const e = M.value.map((l) => String(l.children ?? "")).join("");
|
|
154
|
+
d.value = e;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
const c = a(t.toggleTarget ?? null), y = o(() => !!(c.value && String(c.value).trim())), U = a(
|
|
158
|
+
t.tabIndex !== null && t.tabIndex !== "" ? Number(t.tabIndex) : null
|
|
159
|
+
), H = a([]), K = () => {
|
|
160
|
+
H.value = Fe(Ve(t.class) || "", D.value), te(H.value, "size", T.componentStyle.size), te(H.value, "color", "primary");
|
|
161
|
+
}, j = () => {
|
|
162
|
+
var P, G, J, X, Y, Q;
|
|
163
|
+
if (!y.value) return;
|
|
164
|
+
const e = String(c.value), l = (P = T.component.inputList) == null ? void 0 : P[e];
|
|
165
|
+
if (!l || !l.isHisonvueComponent) return;
|
|
166
|
+
const L = (G = l.getInputType) == null ? void 0 : G.call(l), he = (J = l.getEditMode) == null ? void 0 : J.call(l);
|
|
167
|
+
if (L !== "checkbox" && L !== "radio" || he !== "editable") return;
|
|
168
|
+
const ye = !!((X = l.getValue) != null && X.call(l));
|
|
169
|
+
L === "checkbox" ? (Y = l.setValue) == null || Y.call(l, !ye) : (Q = l.setValue) == null || Q.call(l, !0);
|
|
170
|
+
}, be = (e) => {
|
|
171
|
+
y.value && j(), s("click", e, m.value);
|
|
172
|
+
}, me = (e) => {
|
|
173
|
+
if (y.value && j(), !h.value) return;
|
|
174
|
+
const l = b.value;
|
|
175
|
+
l && l.tagName === "A" && l.click();
|
|
176
|
+
}, O = (e = !0) => {
|
|
177
|
+
const l = b.value;
|
|
178
|
+
if (l) {
|
|
179
|
+
if (le(l), y.value) {
|
|
180
|
+
ne(l);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
e && h.value && l.tagName === "A" && ne(l);
|
|
184
|
+
}
|
|
185
|
+
}, q = () => {
|
|
186
|
+
T.component.labelList[r] && T.component.labelList[r].isHisonvueComponent && console.warn(`[Hisonvue] The label ID is at risk of being duplicated. ${r}`), Ke(u, () => {
|
|
187
|
+
z(), x(q);
|
|
188
|
+
}), K(), x(() => O(!0)), m.value = {
|
|
189
|
+
isHisonvueComponent: !0,
|
|
190
|
+
getId: () => r,
|
|
191
|
+
getType: () => "label",
|
|
192
|
+
isVisible: () => A.value,
|
|
193
|
+
setVisible: (e) => {
|
|
194
|
+
A.value = e;
|
|
195
|
+
},
|
|
196
|
+
getTitle: () => f.value,
|
|
197
|
+
setTitle: (e) => {
|
|
198
|
+
f.value = e;
|
|
199
|
+
},
|
|
200
|
+
getText: () => S.value ? "" : d.value,
|
|
201
|
+
setText: (e) => {
|
|
202
|
+
S.value || (d.value = e);
|
|
203
|
+
},
|
|
204
|
+
getHref: () => v.value ?? "",
|
|
205
|
+
setHref: (e) => {
|
|
206
|
+
v.value = e ?? null;
|
|
207
|
+
},
|
|
208
|
+
getAnchorAttrs: () => ({ ...i.value }),
|
|
209
|
+
replaceAnchorAttrs: (e) => {
|
|
210
|
+
i.value = { ...e };
|
|
211
|
+
},
|
|
212
|
+
mergeAnchorAttrs: (e) => {
|
|
213
|
+
i.value = { ...i.value, ...e };
|
|
214
|
+
},
|
|
215
|
+
setAnchorAttr: (e, l) => {
|
|
216
|
+
i.value = { ...i.value, [e]: l };
|
|
217
|
+
},
|
|
218
|
+
removeAnchorAttr: (e) => {
|
|
219
|
+
const l = { ...i.value };
|
|
220
|
+
delete l[e], i.value = l;
|
|
221
|
+
},
|
|
222
|
+
isFontBold: () => k.value,
|
|
223
|
+
setFontBold: (e) => {
|
|
224
|
+
k.value = e;
|
|
225
|
+
},
|
|
226
|
+
isFontItalic: () => B.value,
|
|
227
|
+
setFontItalic: (e) => {
|
|
228
|
+
B.value = e;
|
|
229
|
+
},
|
|
230
|
+
isFontThruline: () => I.value,
|
|
231
|
+
setFontThruline: (e) => {
|
|
232
|
+
I.value = e;
|
|
233
|
+
},
|
|
234
|
+
isFontUnderline: () => p.value,
|
|
235
|
+
setFontUnderline: (e) => {
|
|
236
|
+
p.value = e;
|
|
237
|
+
},
|
|
238
|
+
getTextAlign: () => C.value,
|
|
239
|
+
setTextAlign: (e) => {
|
|
240
|
+
(e === g.left || e === g.center || e === g.right) && (C.value = e);
|
|
241
|
+
},
|
|
242
|
+
isBorder: () => w.value,
|
|
243
|
+
setBorder: (e) => {
|
|
244
|
+
w.value = e;
|
|
245
|
+
},
|
|
246
|
+
getBackgroundType: () => N.value,
|
|
247
|
+
setBackgroundType: (e) => {
|
|
248
|
+
N.value = e;
|
|
249
|
+
},
|
|
250
|
+
getToggleTarget: () => c.value,
|
|
251
|
+
setToggleTarget: (e) => {
|
|
252
|
+
c.value = e;
|
|
253
|
+
},
|
|
254
|
+
reload: () => Oe(u),
|
|
255
|
+
getTabIndex: () => U.value,
|
|
256
|
+
setTabIndex: (e) => {
|
|
257
|
+
U.value = e != null ? Number(e) : null;
|
|
258
|
+
},
|
|
259
|
+
focus: () => {
|
|
260
|
+
const e = b.value;
|
|
261
|
+
e && h.value && e.tagName === "A" && e.focus();
|
|
262
|
+
}
|
|
263
|
+
}, T.component.labelList[r] = m.value, s("mounted", m.value);
|
|
264
|
+
}, z = () => {
|
|
265
|
+
Re(u);
|
|
266
|
+
const e = b.value;
|
|
267
|
+
e && le(e), delete T.component.labelList[r];
|
|
268
|
+
};
|
|
269
|
+
return W(q), Se(z), n(D, (e) => {
|
|
270
|
+
K(), s("responsive-change", e);
|
|
271
|
+
}), n(h, (e) => {
|
|
272
|
+
x(() => O(e));
|
|
273
|
+
}, { flush: "post" }), n(y, (e) => {
|
|
274
|
+
x(() => O(e));
|
|
275
|
+
}, { flush: "post" }), n(() => t.visible, (e) => {
|
|
276
|
+
const l = !!e;
|
|
277
|
+
l !== A.value && (A.value = l);
|
|
278
|
+
}), n(() => t.title, (e) => {
|
|
279
|
+
const l = e ?? "";
|
|
280
|
+
l !== f.value && (f.value = l);
|
|
281
|
+
}), n(() => t.text, (e) => {
|
|
282
|
+
if (!S.value) {
|
|
283
|
+
const l = e ?? "";
|
|
284
|
+
l !== d.value && (d.value = l);
|
|
285
|
+
}
|
|
286
|
+
}), n(M, (e) => {
|
|
287
|
+
if (V.value) {
|
|
288
|
+
const l = e.map((L) => String(L.children ?? "")).join("");
|
|
289
|
+
l !== d.value && (d.value = l);
|
|
290
|
+
}
|
|
291
|
+
}), n(() => t.href, (e) => {
|
|
292
|
+
const l = e ?? null;
|
|
293
|
+
l !== v.value && (v.value = l);
|
|
294
|
+
}), n(() => t.anchorAttrs, (e) => {
|
|
295
|
+
const l = { ...e || {} };
|
|
296
|
+
JSON.stringify(l) !== JSON.stringify(i.value) && (i.value = l);
|
|
297
|
+
}), n(() => t.fontBold, (e) => {
|
|
298
|
+
const l = !!e;
|
|
299
|
+
l !== k.value && (k.value = l);
|
|
300
|
+
}), n(() => t.fontItalic, (e) => {
|
|
301
|
+
const l = !!e;
|
|
302
|
+
l !== B.value && (B.value = l);
|
|
303
|
+
}), n(() => t.fontThruline, (e) => {
|
|
304
|
+
const l = !!e;
|
|
305
|
+
l !== I.value && (I.value = l);
|
|
306
|
+
}), n(() => t.fontUnderline, (e) => {
|
|
307
|
+
const l = !!e;
|
|
308
|
+
l !== p.value && (p.value = l);
|
|
309
|
+
}), n(() => t.textAlign, (e) => {
|
|
310
|
+
e && e !== C.value && (e === g.left || e === g.center || e === g.right) && (C.value = e);
|
|
311
|
+
}), n(() => t.border, (e) => {
|
|
312
|
+
const l = !!e;
|
|
313
|
+
l !== w.value && (w.value = l);
|
|
314
|
+
}), n(() => t.backgroundType, (e) => {
|
|
315
|
+
e && e !== N.value && (N.value = e);
|
|
316
|
+
}), n(() => t.toggleTarget, (e) => {
|
|
317
|
+
const l = e ?? null;
|
|
318
|
+
l !== c.value && (c.value = l);
|
|
319
|
+
}), n(() => t.tabIndex, (e) => {
|
|
320
|
+
const l = e === null || e === "" ? null : Number(e);
|
|
321
|
+
l !== U.value && (U.value = l);
|
|
322
|
+
}), n(() => t.class, () => {
|
|
323
|
+
K();
|
|
324
|
+
}), {
|
|
325
|
+
labelRef: b,
|
|
326
|
+
labelMethods: o(() => ke(m)),
|
|
327
|
+
props: t,
|
|
328
|
+
title: f,
|
|
329
|
+
hasHref: h,
|
|
330
|
+
hasToggleTarget: y,
|
|
331
|
+
hasElementSlot: S,
|
|
332
|
+
renderTag: ue,
|
|
333
|
+
internalText: d,
|
|
334
|
+
computedAnchorAttrs: se,
|
|
335
|
+
visibleClass: ve,
|
|
336
|
+
fontBoldClass: ie,
|
|
337
|
+
fontItalicClass: re,
|
|
338
|
+
fontThrulineClass: de,
|
|
339
|
+
fontUnderlineClass: fe,
|
|
340
|
+
textAlignStyle: oe,
|
|
341
|
+
borderClass: ce,
|
|
342
|
+
backgroundTypeClass: ge,
|
|
343
|
+
responsiveClassList: H,
|
|
344
|
+
tabIndex: U,
|
|
345
|
+
onClick: be,
|
|
346
|
+
onKeyActivate: me
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}), ze = {
|
|
350
|
+
key: 2,
|
|
351
|
+
class: "hison-label-text"
|
|
352
|
+
};
|
|
353
|
+
function Pe(t, s, ae, b, m, r) {
|
|
354
|
+
return E(), R("div", {
|
|
355
|
+
class: Be([
|
|
356
|
+
"hison-wrapper",
|
|
357
|
+
...t.responsiveClassList,
|
|
358
|
+
t.visibleClass
|
|
359
|
+
])
|
|
360
|
+
}, [
|
|
361
|
+
(E(), Ie(pe(t.renderTag), we({
|
|
362
|
+
ref: "labelRef",
|
|
363
|
+
class: [
|
|
364
|
+
"hison-label",
|
|
365
|
+
t.hasHref ? "hison-label-link" : null,
|
|
366
|
+
t.hasToggleTarget ? "hison-label-has-toggle-target" : null,
|
|
367
|
+
t.fontBoldClass,
|
|
368
|
+
t.fontItalicClass,
|
|
369
|
+
t.fontThrulineClass,
|
|
370
|
+
t.fontUnderlineClass,
|
|
371
|
+
t.borderClass,
|
|
372
|
+
t.backgroundTypeClass
|
|
373
|
+
],
|
|
374
|
+
style: [t.textAlignStyle, t.props.style],
|
|
375
|
+
title: t.title || void 0,
|
|
376
|
+
tabindex: t.tabIndex ?? void 0
|
|
377
|
+
}, t.renderTag === "a" ? t.computedAnchorAttrs : void 0, {
|
|
378
|
+
onClick: t.onClick,
|
|
379
|
+
onMousedown: s[0] || (s[0] = (u) => t.$emit("mousedown", u, t.labelMethods)),
|
|
380
|
+
onMouseup: s[1] || (s[1] = (u) => t.$emit("mouseup", u, t.labelMethods)),
|
|
381
|
+
onMouseover: s[2] || (s[2] = (u) => t.$emit("mouseover", u, t.labelMethods)),
|
|
382
|
+
onMouseout: s[3] || (s[3] = (u) => t.$emit("mouseout", u, t.labelMethods)),
|
|
383
|
+
onKeydown: [
|
|
384
|
+
Z(_(t.onKeyActivate, ["prevent"]), ["enter"]),
|
|
385
|
+
Z(_(t.onKeyActivate, ["prevent"]), ["space"])
|
|
386
|
+
]
|
|
387
|
+
}), {
|
|
388
|
+
default: Ne(() => [
|
|
389
|
+
t.hasElementSlot ? Ue(t.$slots, "default", { key: 0 }) : t.hasHref ? (E(), R(Le, { key: 1 }, [
|
|
390
|
+
Me(ee(t.internalText), 1)
|
|
391
|
+
], 64)) : (E(), R("span", ze, ee(t.internalText), 1))
|
|
392
|
+
]),
|
|
393
|
+
_: 3
|
|
394
|
+
}, 16, ["class", "style", "title", "tabindex", "onClick", "onKeydown"]))
|
|
395
|
+
], 2);
|
|
396
|
+
}
|
|
397
|
+
const Qe = /* @__PURE__ */ De(qe, [["render", Pe]]);
|
|
398
|
+
export {
|
|
399
|
+
Qe as default
|
|
400
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),l=require("./index-CyZluKOE.js"),C=require("./_plugin-vue_export-helper-BHFhmbuH.js"),h={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},backImageSrc:{type:String,required:!1},backImageRepeat:{type:String,required:!1,validator:e=>e==null||l.BACK_IMAGE_STYLE_VALUES.includes(e)?!0:/^(repeat-x|repeat-y|repeat|no-repeat)(\s+\S+\/\S+)?$/.test(e)||/^(cover|contain)$/.test(e)||/[\/\s]/.test(e)},backImageWidth:{type:String,required:!1},backImageAlign:{type:String,required:!1,validator:e=>e==null||l.BACK_IMAGE_ALIGN_VALUES.includes(e)},backImageVerticalAlign:{type:String,required:!1,validator:e=>e==null||l.BACK_IMAGE_VERTICAL_ALIGN_VALUES.includes(e)},backColor:{type:String,required:!1},border:{type:Boolean,default:!1},height:{type:String,required:!1}},S=a.defineComponent({name:"HLayout",props:h,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(e,{emit:o}){const n=a.ref(null),u=a.ref(null),r=e.id?e.id:l.getUUID(),m=`hlayout:${r}`,s=l.useDevice(),c=a.ref(e.visible),v=a.computed(()=>c.value?"":"hison-display-none"),d=a.ref(e.border??!1),f=a.computed(()=>d.value?"hison-border":""),I=a.computed(()=>{const t={};if(e.backImageSrc&&(t.backgroundImage=`url(${e.backImageSrc})`,t.backgroundRepeat=e.backImageRepeat||"no-repeat",t.backgroundSize=e.backImageWidth||"auto",t.backgroundPosition=`${e.backImageAlign||"center"} ${e.backImageVerticalAlign||"center"}`),e.backColor){const i=l.getHexCodeFromColorText(e.backColor)||e.backColor;t.backgroundColor=i}return e.height&&(t.height=e.height),t}),g=a.ref([]),b=()=>{g.value=l.extractResponsiveClasses(l.toClassString(e.class)||"",s.value),l.getIndexSpecificClassNameFromClassList(g.value,"col")===-1&&g.value.push("hison-col-12"),l.addComponentNameToClass(g.value,"color","primary")},y=()=>{l.hisonCloser.component.layoutList[r]&&l.hisonCloser.component.layoutList[r].isHisonvueComponent&&console.warn(`[Hisonvue] The layout ID is at risk of being duplicated. ${r}`),l.registerReloadable(m,()=>{k(),a.nextTick(y)}),n.value&&(b(),u.value={isHisonvueComponent:!0,getId:()=>r,getType:()=>"layout",isVisible:()=>c.value,setVisible:t=>{c.value=t},getBackImageSrc:()=>e.backImageSrc||"",setBackImageSrc:t=>{n.value&&(n.value.style.backgroundImage=`url(${t})`)},getBackImageRepeat:()=>e.backImageRepeat||"",setBackImageRepeat:t=>{n.value&&(n.value.style.backgroundRepeat=t)},getBackImageWidth:()=>e.backImageWidth||"",setBackImageWidth:t=>{n.value&&(n.value.style.backgroundSize=t)},getBackImageAlign:()=>e.backImageAlign||"",setBackImageAlign:t=>{if(n.value){const i=e.backImageVerticalAlign||"center";n.value.style.backgroundPosition=`${t} ${i}`}},getBackImageVerticalAlign:()=>e.backImageVerticalAlign||"",setBackImageVerticalAlign:t=>{if(n.value){const i=e.backImageAlign||"center";n.value.style.backgroundPosition=`${i} ${t}`}},getBackColor:()=>e.backColor||"",setBackColor:t=>{n.value&&(n.value.style.backgroundColor=l.getHexCodeFromColorText(t)||t)},isBorder:()=>d.value,setBorder:t=>{d.value=t},getHeight:()=>e.height||"",setHeight:t=>{n.value&&(n.value.style.height=t)},reload:()=>l.reloadHisonComponent(m)},l.hisonCloser.component.layoutList[r]=u.value,o("mounted",u.value))},k=()=>{l.unregisterReloadable(m),delete l.hisonCloser.component.layoutList[r]};return a.onMounted(y),a.onBeforeUnmount(k),a.watch(s,t=>{b(),o("responsive-change",t)}),a.watch(()=>e.visible,t=>{const i=!!t;i!==c.value&&(c.value=i)}),a.watch(()=>e.border,t=>{const i=!!t;i!==d.value&&(d.value=i)}),a.watch(()=>e.class,()=>{b()}),{layoutRef:n,layoutMethods:a.computed(()=>a.unref(u)),props:e,responsiveClassList:g,visibleClass:v,borderClass:f,computedBackStyle:I}}});function A(e,o,n,u,r,m){return a.openBlock(),a.createElementBlock("div",{ref:"layoutRef",class:a.normalizeClass(["hison-layout",...e.responsiveClassList,e.visibleClass,e.borderClass]),style:a.normalizeStyle([e.props.style,e.computedBackStyle]),onClick:o[0]||(o[0]=s=>e.$emit("click",s,e.layoutMethods)),onMousedown:o[1]||(o[1]=s=>e.$emit("mousedown",s,e.layoutMethods)),onMouseup:o[2]||(o[2]=s=>e.$emit("mouseup",s,e.layoutMethods)),onMouseover:o[3]||(o[3]=s=>e.$emit("mouseover",s,e.layoutMethods)),onMouseout:o[4]||(o[4]=s=>e.$emit("mouseout",s,e.layoutMethods))},[o[6]||(o[6]=a.createElementVNode("div",{class:"hison-layout-frame-adjust"},null,-1)),a.renderSlot(e.$slots,"default",{},()=>[o[5]||(o[5]=a.createTextVNode("Hison Layout"))])],38)}const B=C._export_sfc(S,[["render",A]]);exports.default=B;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as A, ref as d, computed as m, onMounted as B, onBeforeUnmount as $, watch as b, unref as L, nextTick as M, createElementBlock as R, openBlock as V, normalizeStyle as p, normalizeClass as q, createElementVNode as E, renderSlot as H, createTextVNode as T } from "vue";
|
|
2
|
-
import { X as N, Y as U, Z as w, g as G, u as W, F as I, e as z, t as P, a as j, b as D, h as k, r as F, c as K, d as Y } from "./index-
|
|
2
|
+
import { X as N, Y as U, Z as w, g as G, u as W, F as I, e as z, t as P, a as j, b as D, h as k, r as F, c as K, d as Y } from "./index-BC8m9ivd.mjs";
|
|
3
3
|
import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const X = {
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as ye, ref as o, computed as f, onMounted as ce, onBeforeUnmount as be, watch as r, Comment as ge, Text as pe, Fragment as U, nextTick as Y, createElementBlock as u, openBlock as i, normalizeClass as H, createBlock as J, resolveDynamicComponent as Q, withKeys as W, normalizeStyle as z, withModifiers as X, withCtx as he, renderList as Z, createElementVNode as D, createCommentVNode as x, toDisplayString as w, renderSlot as ke } from "vue";
|
|
2
|
-
import { B as _, f as c, g as Ie, u as Ce, e as Te, t as Be, b as ee, h as E, r as Le, c as Se, d as we } from "./index-
|
|
3
|
-
import { r as te, a as Ee } from "./setButtonCssEvent-
|
|
2
|
+
import { B as _, f as c, g as Ie, u as Ce, e as Te, t as Be, b as ee, h as E, r as Le, c as Se, d as we } from "./index-BC8m9ivd.mjs";
|
|
3
|
+
import { r as te, a as Ee } from "./setButtonCssEvent-DzPansSE.mjs";
|
|
4
4
|
import { _ as Me } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const Ae = {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CyZluKOE.js"),N=require("./setButtonCssEvent-fXHkzhY1.js"),W=require("./_plugin-vue_export-helper-BHFhmbuH.js"),X={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},listItemStyle:{type:[String,Object,Array],required:!1},listItemInnerStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},border:{type:Boolean,default:!1},listBorder:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:n=>o.BACKGROUND_TYPE_VALUES.includes(n)},listBackgroundType:{type:String,default:o.BackgroundType.empty,validator:n=>o.BACKGROUND_TYPE_VALUES.includes(n)},listType:{type:String,default:"ul",validator:n=>n==="ul"||n==="ol"},bulletChar:{type:String,default:"•"},showMarker:{type:Boolean,default:!0},textList:{type:Array,default:()=>[]},addEvent:{type:Boolean,default:!1},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)}},Z=e.defineComponent({name:"HList",props:X,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(n,{emit:l,slots:I}){const A=e.ref(null),i=e.ref([]),T=e.ref([]),a=n.id?n.id:o.getUUID(),d=`hlist:${a}`,r=o.useDevice(),v=e.ref(null),y=e.ref(n.visible),$=e.computed(()=>y.value?"":"hison-display-none"),m=e.ref(n.listType||"ul"),p=e.ref(n.bulletChar||"•"),k=e.ref(n.showMarker!==!1),g=e.ref(n.border??!1),h=e.ref(n.listBorder??!1),B=e.ref(n.backgroundType||o.BackgroundType.empty),b=e.ref(n.listBackgroundType||o.BackgroundType.empty),c=e.ref(!!n.addEvent),H=e.computed(()=>g.value?"hison-border":""),O=e.computed(()=>h.value?"hison-border":""),U=e.computed(()=>{switch(B.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),K=e.computed(()=>{switch(b.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),j=e.computed(()=>{var t;return((t=I.default)==null?void 0:t.call(I))??[]}),f=e.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),R=(t,s=[])=>{if(!t||t.length===0)return s;for(const u of t)if(u.type!==e.Comment&&u.type!==e.Text)if(u.type===e.Fragment){const S=u.children;R(S,s)}else s.push(u);return s},L=e.computed(()=>R(j.value)),F=e.computed(()=>L.value.length>0),w=e.ref(Array.isArray(n.textList)?n.textList:[]),z=e.computed(()=>w.value??[]),P=e.computed(()=>m.value),E=e.ref([]),M=()=>{E.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",r.value),o.addComponentNameToClass(E.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(E.value,"color","primary")},C=(t=!0)=>{e.nextTick(()=>{i.value.forEach(s=>{s&&(N.removeButtonCssEvent(s),t&&c.value&&N.addButtonCssEvent(s))})})},G=t=>{c.value&&l("click",t,v.value)},Y=(t,s)=>{c.value&&l(t,s,v.value)},D=()=>{o.hisonCloser.component.listList[a]&&o.hisonCloser.component.listList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The list ID is at risk of being duplicated. ${a}`),o.registerReloadable(d,()=>{V(),e.nextTick(D)}),M(),C(!0),v.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"list",isVisible:()=>y.value,setVisible:t=>{y.value=t},getListType:()=>m.value,setListType:t=>{m.value=t},isShowMarker:()=>k.value,setShowMarker:t=>{k.value=t},getBulletChar:()=>p.value,setBulletChar:t=>{p.value=t},isBorder:()=>g.value,setBorder:t=>{g.value=t},isListBorder:()=>h.value,setListBorder:t=>{h.value=t},getBackgroundType:()=>B.value,setBackgroundType:t=>{B.value=t},getListBackgroundType:()=>b.value,setListBackgroundType:t=>{b.value=t},getTextList:()=>[...z.value],setTextList:t=>{w.value=Array.isArray(t)?t:[]},isAddEvent:()=>c.value,setAddEvent:t=>{c.value=!!t,C(!0)},getTabIndex:()=>f.value,setTabIndex:t=>{f.value=t!=null?Number(t):null},getListRowCount:()=>i.value.length,getListItem:t=>!Number.isInteger(t)||t<0||t>=i.value.length?null:i.value[t]??null,focus:(t=0)=>{var S;if(!c.value)return;const s=f.value;if(s==null||s===-1||!Number.isInteger(t)||t<0||t>=i.value.length)return;const u=i.value[t];(S=u==null?void 0:u.focus)==null||S.call(u)},reload:()=>o.reloadHisonComponent(d)},o.hisonCloser.component.listList[a]=v.value,l("mounted",v.value)},V=()=>{o.unregisterReloadable(d),i.value.forEach(t=>t&&N.removeButtonCssEvent(t)),delete o.hisonCloser.component.listList[a]};e.onMounted(D),e.onBeforeUnmount(V);const q=t=>{if(!t)return null;if(t instanceof Element)return t;const s=t.$el;return s instanceof Element?s:null},J=t=>{const s=q(t);s&&(i.value.includes(s)||i.value.push(s))},Q=t=>{const s=q(t);s&&(T.value.includes(s)||T.value.push(s))};return e.watch(r,t=>{M(),l("responsive-change",t)}),e.watch(()=>n.visible,t=>{const s=!!t;s!==y.value&&(y.value=s)}),e.watch(()=>n.border,t=>{const s=!!t;s!==g.value&&(g.value=s)}),e.watch(()=>n.listBorder,t=>{const s=!!t;s!==h.value&&(h.value=s)}),e.watch(()=>n.backgroundType,t=>{t&&t!==B.value&&(B.value=t)}),e.watch(()=>n.listBackgroundType,t=>{t&&t!==b.value&&(b.value=t)}),e.watch(()=>n.listType,t=>{const s=t==="ol"?"ol":"ul";s!==m.value&&(m.value=s)}),e.watch(()=>n.bulletChar,t=>{const s=t??"•";s!==p.value&&(p.value=s)}),e.watch(()=>n.showMarker,t=>{const s=t!==!1;s!==k.value&&(k.value=s)}),e.watch(()=>n.textList,t=>{w.value=Array.isArray(t)?t:[]}),e.watch(()=>n.addEvent,t=>{const s=!!t;s!==c.value&&(c.value=s,C(!0))}),e.watch(()=>n.tabIndex,t=>{const s=t===null||t===""?null:Number(t);s!==f.value&&(f.value=s)}),e.watch(()=>n.class,()=>{M()}),e.watch(L,()=>{C(!0)}),e.watch(w,()=>{C(!0)},{deep:!0}),{props:n,listRef:A,itemRefs:i,itemInnerRefs:T,renderTag:P,listType:m,bulletChar:p,showMarker:k,visibleClass:$,borderClass:H,listBorderClass:O,backgroundTypeClass:U,listBackgroundTypeClass:K,responsiveClassList:E,hasElementSlot:F,elementNodes:L,normalizedItems:z,tabIndex:f,setItemRef:J,setItemInnerRef:Q,onItemClick:G,emitItem:Y}}}),x=["tabindex"],_={key:0,class:"hison-list-marker"},ee={key:0},te={key:1},ne={class:"hison-list-content"},se=["tabindex"],le={key:0,class:"hison-list-marker"},oe={key:0},re={key:1},ae={class:"hison-list-content"},ie={key:1,class:"hison-list-item-text"};function ue(n,l,I,A,i,T){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderTag),{ref:"listRef",class:e.normalizeClass(["hison-list",n.borderClass,n.backgroundTypeClass]),style:e.normalizeStyle(n.props.style),onKeydown:[e.withKeys(e.withModifiers(n.onItemClick,["prevent"]),["enter"]),e.withKeys(e.withModifiers(n.onItemClick,["prevent"]),["space"])]},{default:e.withCtx(()=>[n.hasElementSlot?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.elementNodes,(a,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(["hison-list-item",n.listBorderClass,n.listBackgroundTypeClass]),style:e.normalizeStyle(n.props.listItemStyle),ref_for:!0,ref:n.setItemRef,tabindex:n.tabIndex??void 0,onClick:l[0]||(l[0]=(...r)=>n.onItemClick&&n.onItemClick(...r)),onMousedown:l[1]||(l[1]=r=>n.emitItem("mousedown",r)),onMouseup:l[2]||(l[2]=r=>n.emitItem("mouseup",r)),onMouseover:l[3]||(l[3]=r=>n.emitItem("mouseover",r)),onMouseout:l[4]||(l[4]=r=>n.emitItem("mouseout",r))},[e.createElementVNode("div",{class:"hison-list-item-inner",style:e.normalizeStyle(n.props.listItemInnerStyle),ref_for:!0,ref:n.setItemInnerRef},[n.showMarker?(e.openBlock(),e.createElementBlock("div",_,[n.listType==="ol"?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(d+1)+".",1)):(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(n.bulletChar),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a)))])],4)],46,x))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.normalizedItems,(a,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(["hison-list-item",n.listBorderClass,n.listBackgroundTypeClass]),ref_for:!0,ref:n.setItemRef,tabindex:n.tabIndex??void 0,onClick:l[5]||(l[5]=(...r)=>n.onItemClick&&n.onItemClick(...r)),onMousedown:l[6]||(l[6]=r=>n.emitItem("mousedown",r)),onMouseup:l[7]||(l[7]=r=>n.emitItem("mouseup",r)),onMouseover:l[8]||(l[8]=r=>n.emitItem("mouseover",r)),onMouseout:l[9]||(l[9]=r=>n.emitItem("mouseout",r))},[e.createElementVNode("div",{class:"hison-list-item-inner",style:e.normalizeStyle(n.props.listItemInnerStyle),ref_for:!0,ref:n.setItemInnerRef},[n.showMarker?(e.openBlock(),e.createElementBlock("div",le,[n.listType==="ol"?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(d+1)+".",1)):(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(n.bulletChar),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[n.$slots.item?e.renderSlot(n.$slots,"item",{key:0,item:a,index:d}):(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(String(a??"")),1))])],4)],42,se))),128))]),_:3},40,["class","style","onKeydown"]))],2)}const de=W._export_sfc(Z,[["render",ue]]);exports.default=de;
|