@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.esm.js +138 -1526
- package/components/avatar/index.umd.cjs +1 -6
- package/components/button/index.css +1 -1
- package/components/button/index.esm.js +15951 -15410
- package/components/button/index.umd.cjs +27 -27
- package/components/calendar/index.esm.js +269 -255
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +243 -229
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +32 -32
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +473 -456
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.css +1 -1
- package/components/component/index.esm.js +2503 -2239
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +1064 -954
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +1 -1
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +3894 -3058
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +91 -77
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +220 -215
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +145 -131
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +336 -329
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1611 -1536
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +219 -219
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/external-container/index.esm.js +179 -178
- package/components/external-container/index.umd.cjs +1 -1
- package/components/fieldset/index.esm.js +285 -221
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -0
- package/components/filter-bar/index.esm.js +1512 -1290
- package/components/filter-bar/index.umd.cjs +7 -7
- package/components/filter-condition-editor/index.esm.js +851 -831
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +520 -501
- package/components/flow-canvas/index.umd.cjs +8 -8
- package/components/image/index.esm.js +101 -79
- package/components/image/index.umd.cjs +3 -3
- package/components/language-textbox/index.esm.js +330 -251
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-nav/index.esm.js +399 -313
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +3 -0
- package/components/locale/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +997 -976
- package/components/lookup/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +725 -705
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +542 -522
- package/components/message-box/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +95 -308
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +115 -107
- package/components/number-range/index.umd.cjs +2 -2
- package/components/order/index.esm.js +56 -54
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +135 -123
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +266 -222
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +402 -375
- package/components/property-panel/index.umd.cjs +4 -4
- package/components/query-solution/index.esm.js +3171 -3061
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1620 -1608
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/scroll-navbar/index.esm.js +150 -136
- package/components/scroll-navbar/index.umd.cjs +2 -2
- package/components/section/index.esm.js +323 -311
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +850 -830
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/step/index.esm.js +991 -224
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +356 -334
- package/components/tabs/index.umd.cjs +1 -1
- package/components/wizard/index.esm.js +159 -162
- package/components/wizard/index.umd.cjs +1 -1
- package/designer/avatar/index.esm.js +1721 -0
- package/designer/avatar/index.umd.cjs +6 -0
- package/designer/button-edit/index.esm.js +2 -1
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +693 -659
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +90 -78
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/date-picker/index.esm.js +203 -203
- package/designer/date-picker/index.umd.cjs +1 -1
- package/designer/drawer/index.esm.js +181 -167
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +228 -206
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +10014 -9692
- package/designer/farris-designer.all.umd.cjs +18 -18
- package/designer/index.css +1 -1
- package/designer/input-group/index.esm.js +15 -15
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/nav/index.esm.js +1719 -0
- package/designer/nav/index.umd.cjs +6 -0
- package/designer/number-spinner/index.esm.js +8 -7
- package/designer/number-spinner/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +133 -125
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +864 -863
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +245 -183
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.css +1 -1
- package/designer/tabs/index.esm.js +3667 -2810
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +26 -17
- package/designer/time-picker/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +69 -37
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/designer/wizard/index.esm.js +110 -110
- package/designer/wizard/index.umd.cjs +3 -3
- package/farris.all.esm.js +39993 -39089
- package/farris.all.umd.cjs +36 -36
- package/index.css +1 -1
- package/locales/filter-bar/ui/en.json +1 -0
- package/locales/filter-bar/ui/zh-CHS.json +1 -0
- package/locales/filter-bar/ui/zh-CHT.json +1 -0
- package/locales/ui/en.json +1 -0
- package/locales/ui/zh-CHS.json +1 -0
- package/locales/ui/zh-CHT.json +1 -0
- package/package.json +1 -1
- package/types/avatar/designer.d.ts +28 -0
- package/types/avatar/index.d.ts +0 -15
- package/types/avatar/src/composition/types.d.ts +3 -0
- package/types/avatar/src/composition/use-file.d.ts +19 -0
- package/types/avatar/src/composition/use-image.d.ts +1 -1
- package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
- package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
- package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
- package/types/components.d.ts +3 -0
- package/types/condition/index.d.ts +18 -6
- package/types/condition/src/condition-fields.component.d.ts +9 -3
- package/types/condition/src/condition-fields.design.component.d.ts +9 -3
- package/types/condition/src/condition-list.component.d.ts +9 -3
- package/types/condition/src/condition.props.d.ts +11 -0
- package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
- package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
- package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
- package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
- package/types/dynamic-view/src/components/maps.d.ts +130 -4
- package/types/filter-bar/src/composition/types.d.ts +2 -0
- package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
- package/types/filter-bar/src/locale/locale.d.ts +2 -1
- package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
- package/types/language-textbox/index.d.ts +65 -2
- package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
- package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
- package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/lookup/src/composition/use-compat.d.ts +28 -0
- package/types/lookup/src/composition/use-state.d.ts +1 -0
- package/types/message-box/src/message-box.service.d.ts +2 -1
- package/types/nav/designer.d.ts +28 -0
- package/types/nav/index.d.ts +24 -20
- package/types/nav/src/designer/nav.design.props.d.ts +29 -0
- package/types/nav/src/designer/use-design-rules.d.ts +3 -0
- package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
- package/types/nav/src/schema/schema-mapper.d.ts +4 -0
- package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
- package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
- package/types/section/src/designer/section.design.props.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +39 -0
- package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
- package/types/step/src/designer/use-designer-rules.d.ts +3 -0
- package/types/step/src/designer/use-step-creator.d.ts +6 -0
- package/types/step/src/property-config/step.property-config.d.ts +15 -0
- package/types/step/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +4 -0
- package/types/tabs/src/tabs.props.d.ts +6 -0
- package/types/tooltip/index.d.ts +3 -3
- package/types/tooltip/src/tooltip.component.d.ts +2 -2
|
@@ -71,7 +71,7 @@ class fe {
|
|
|
71
71
|
];
|
|
72
72
|
Object.keys(s).filter((w) => i.indexOf(w) > -1).forEach((w) => {
|
|
73
73
|
w === "visible" ? this[w] = s[w] === void 0 ? !0 : s[w] : this[w] = s[w];
|
|
74
|
-
}), this.shown = this.visible, (g = s.appearance) != null && g.class && (this.class = (p = s.appearance) == null ? void 0 : p.class);
|
|
74
|
+
}), this.shown = this.visible, (g = s.appearance) != null && g.class && (this.class = (p = s.appearance) == null ? void 0 : p.class), this.class || (this.class = "btn-secondary");
|
|
75
75
|
}
|
|
76
76
|
/** 是否可用 */
|
|
77
77
|
get enable() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(y,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("../common/index.umd.js"),require("vue"),require("../locale/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../common/index.umd.js","vue","../locale/index.umd.js"],g):(y=typeof globalThis<"u"?globalThis:y||self,g(y["response-toolbar"]={},y.common,y.Vue,y.locale))})(this,function(y,g,n,pe){"use strict";var ke=Object.defineProperty;var De=(y,g,n)=>g in y?ke(y,g,{enumerable:!0,configurable:!0,writable:!0,value:n}):y[g]=n;var h=(y,g,n)=>De(y,typeof g!="symbol"?g+"":g,n);const re={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0},buttonSize:{type:String,default:""}};class ie{constructor(l){h(this,"id","");h(this,"class","btn-secondary");h(this,"icon","");h(this,"groupId","");h(this,"order",-1);h(this,"asDropDownTop",!1);h(this,"text","");h(this,"visible",!0);h(this,"shown",!0);h(this,"responsed",!1);h(this,"tipsEnable",!1);h(this,"tipsText","");h(this,"width",0);h(this,"dropdownClass","");h(this,"onClick",()=>{});h(this,"options");var w,p;this.options=l;const a=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","dropdownClass","onClick"];Object.keys(l).filter(x=>a.indexOf(x)>-1).forEach(x=>{x==="visible"?this[x]=l[x]===void 0?!0:l[x]:this[x]=l[x]}),this.shown=this.visible,(w=l.appearance)!=null&&w.class&&(this.class=(p=l.appearance)==null?void 0:p.class)}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:n.computed(()=>!0)}setWidth(l){this.width=parseInt(l,10)}getWidth(){return this.visible?this.width:!1}}class de extends ie{constructor(l){super(l)}}function ce(){function c(l){const a=[];return l.reduce((w,p)=>(p.children&&p.children.length>0?w.push(new U(p)):w.push(new de(p)),w),a),a}return{buildResponseToolbarItems:c}}const{buildResponseToolbarItems:fe}=ce();class U extends ie{constructor(a){super(a);h(this,"placement","");h(this,"visible",!0);h(this,"dropdownClass","");h(this,"menuClass","");h(this,"split",!1);h(this,"children",[]);h(this,"expanded",!1);h(this,"shown",!0);const w=["visible","icon","isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(a).filter(p=>w.indexOf(p)>-1).forEach(p=>{p==="visible"?this[p]=a[p]===void 0?!0:a[p]:this[p]=a[p]}),this.shown=this.visible,a.children&&a.children.length&&(this.children=fe(a.children))}}function he(){function c(a){const w={"f-icon":!0};if(a.icon){const p=a.icon.trim().split(" ");p&&p.length&&p.reduce((x,R)=>(x[R]=!0,x),w)}return w}function l(a){return!!(a.icon&&a.icon.trim())}return{iconClass:c,shouldShowIcon:l}}function be(c,l){function a(o){const e={"dropdown-menu":!0};return g.getCustomClass(e,o.menuClass)}function w(o){const e={disabled:!o.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return g.getCustomClass(e,o.dropdownClass)}function p(o){const e={disabled:!o.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return g.getCustomClass(e,o.dropdownClass)}function x(o){const e={disabled:!o.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0,"f-rt-toggle":!o.split,"btn-icontext":!!(o.icon&&o.icon.trim()),"dropdown-toggle":!o.split,"btn-secondary":!0};return g.getCustomClass(e,o.dropdownClass)}function R(o){const e={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(o.icon&&o.icon.trim()),"d-block":!0};return g.getCustomClass(e,o.dropdownClass)}let M;const C=new Map;let _="";function v(o){_="#"+o}function O(o,e,u){o.stopPropagation();const r=u?u.id:"__top_item__";if(e.children&&e.children.length&&(e.expanded=!e.expanded,e.expanded)){if(C.has(r)&&C.get(r)!==e){const b=C.get(r);b&&(b.expanded=!1,C.delete(r))}C.set(r,e)}}function A(o,e){document.body.click(),e.enable&&(o.stopPropagation(),typeof e.onClick=="function"&&e.onClick(o,e.id),c.emit("click",o,e.id))}function $(o,e){const u=o.target;u.className.indexOf("dropdown-item")<0||(u.title=u.scrollWidth>u.clientWidth?e:"")}function Y(o,e,u){if(e.tipsEnable&&e.tipsText){const r=n.reactive({content:e.tipsText,enable:e.tipsEnable});return n.withDirectives(n.createVNode("li",{class:p(e),id:e.id,key:e.id+"_"+u,onClick:b=>A(b,e)},[n.createVNode("span",{class:R(e)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text])]),[[n.resolveDirective("tooltip"),r]])}return n.createVNode("li",{class:p(e),id:e.id,onClick:r=>A(r,e)},[n.createVNode("span",{class:R(e),onMouseenter:r=>$(r,e.text)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text])])}function s(o,e,u){e.enable&&(typeof e.onClick=="function"&&u.onClick(o,e.id),c.emit("click",o,e.id),u.split||O(o,e,u))}function f(o,e,u){o&&o.stopPropagation(),O(o,e,u)}function S(o,e){o.stopPropagation();const u=e.id;if(e.children&&e.children.length&&e.expanded&&C.has(u)){const r=C.get(u);r&&(r.expanded=!1,C.delete(u))}}function H(o,e,u){if(e.tipsEnable&&e.tipsText){const r=n.reactive({content:e.tipsText,enable:e.tipsEnable});return n.createVNode("li",{class:w(e),id:e.id,key:e.id+"_"+u,onClick:b=>s(b,e,o)},[n.withDirectives(n.createVNode("span",{class:x(e)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text]),[[n.resolveDirective("tooltip"),r]]),e.split&&n.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:b=>f(b,e,o)},null),M(e,e)])}return n.createVNode("li",{class:w(e),id:e.id,onClick:r=>s(r,e,o),onMouseenter:r=>$(r,e.text)},[n.createVNode("span",{class:x(e)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text]),e.split&&n.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:r=>f(r,e,o)},null),M(e,e)])}function te(o){return o.children.filter(e=>e.visible).map((e,u)=>e.children&&e.children.length?H(o,e,u):Y(o,e,u))}function ne(o,e){if(!o)return 1080;let u=-1;const r=o.children.length;for(let b=0;b<r;b++)if(o.children[b].id===e){u=b;break}return 1080+r-u}function oe(o,e,u){var q,Z;const r={display:o.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1080,overflowY:"auto",maxHeight:"none"},b=document.querySelector(_);if(!b)return r;const F=n.getCurrentInstance();let V=(Z=(q=F==null?void 0:F.exposed)==null?void 0:q.elementRef.value)==null?void 0:Z.querySelector("#"+e);if(V||(V=b==null?void 0:b.querySelector("#"+e)),!V)return r;const le=window.innerWidth,W=window.innerHeight,T=V==null?void 0:V.getClientRects();if(V&&T&&T.length){const{top:E,width:J,left:I,right:m,height:z}=T[0],L=Math.ceil(z+E);r.top=`${L}px`,r.left=`${I}px`;const Q=o.id+"_menu",P=(V==null?void 0:V.querySelector("#"+Q))||(b==null?void 0:b.querySelector("#"+Q))||null;if(P){P.style.visibility="hidden",P.style.display="block";const G=P.offsetHeight;r.zIndex=o.expanded?ne(b,Q):1080,r.display==="block"&&(P.style.display="block");const t=P.getBoundingClientRect();if(u){r.top=`${E-6}px`;const i=Math.ceil(J+I);r.left=`${i}px`}le-I-J<t.width&&(r.left=`${(u?I:m)-t.width}px`),W-E-z<G?E>G?(r.top=`${E-G-6}px`,r.maxHeight=`${E-16}px`):(r.maxHeight=`${W-L}px`,E>W-E-z&&(r.top="10px",r.maxHeight=`${E-16}px`)):r.maxHeight=`${W-L}px`,P.style.visibility="visible"}}return r}M=function(o,e){const u=e?e.id:o.id;return n.createVNode(n.Teleport,{to:_,disabled:!o.expanded},{default:()=>[n.createVNode("ul",{class:a(o),style:oe(o,u,e),id:o.id+"_menu",onWheel:r=>S(r,o)},[te(o)])]})};function se(){C.forEach(o=>{o.expanded=!1}),C.clear()}return{renderDropdownMenu:M,clearAllDropDownMenu:se,updateContainerId:v}}function ge(c,l,a){const w=n.ref(c.alignment),{renderDropdownMenu:p,clearAllDropDownMenu:x,updateContainerId:R}=be(l,a);function M(s){const f={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":w.value==="right"||w.value==="center","f-btn-mr":w.value==="left"};return g.getCustomClass(f,s.dropdownClass)}function C(s){const f={btn:!0,disabled:!s.enable,"f-rt-btn":!0,"btn-icontext":!!(s.icon&&s.icon.trim())&&s.text,"f-rt-toggle":!s.split,"dropdown-toggle":!s.split,"f-btn-icon":s.icon&&!s.text};return g.getCustomClass(f,s.class)}function _(s){const f={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return g.getCustomClass(f,s.class)}function v(s){return s.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function O(s,f){s.stopPropagation();const S=f.expanded;document.body.click(),typeof f.onClick=="function"&&f.onClick(s,f.id),l.emit("click",s,f.id),f.split||(f.expanded=!S)}function A(s,f){s.stopPropagation();const S=f.expanded;document.body.click(),f.expanded=!S}function $(s,f=!0){if(s.tipsEnable&&s.tipsText){const S=n.reactive({content:s.tipsText,enable:s.tipsEnable});return n.createVNode("div",{id:s.id,class:M(s)},[n.withDirectives(n.createVNode("div",{class:C(s),style:v(s),onClick:H=>s.enable&&O(H,s)},[a.shouldShowIcon(s)&&n.createVNode("i",{class:a.iconClass(s)},null),s.text&&n.createVNode("span",null,[s.text])]),[[n.resolveDirective("tooltip"),S]]),s.split&&n.createVNode("button",{class:_(s),style:"border-radius:0 6px 6px 0;",onClick:H=>A(H,s)},null),f&&p(s)])}return n.createVNode("div",{id:s.id,class:M(s)},[n.createVNode("div",{class:C(s),style:v(s),onClick:S=>s.enable&&O(S,s)},[a.shouldShowIcon(s)&&n.createVNode("i",{class:a.iconClass(s)},null),s.text&&n.createVNode("span",null,[s.text])]),s.split&&n.createVNode("button",{class:_(s),style:"border-radius:0 6px 6px 0;",onClick:S=>A(S,s)},null),f&&p(s)])}function Y(){x()}return{renderToolbarDropdown:$,clearAllDropDown:Y,updateContainerId:R}}const{buildResponseToolbarItems:ae}=ce(),ue=n.defineComponent({name:"FResponseToolbar",props:re,emits:["click"],setup(c,l){const a=n.ref(ae(c.items)),w=n.ref(),p=n.ref(),x=n.ref(),R=g.isMobilePhone(),M={id:"__more_buttons__",text:R?"":pe.LocaleService.getLocaleValue("responseToolbar.more"),icon:R?"f-icon-more-horizontal":""},C=n.ref(new U(M)),_=Object.assign({},M,{id:M.id+"width"}),v=n.ref(-1),O=he();let A=!1;const{guid:$,uuid:Y}=g.useGuid(),s=c.id?c.id:"toolbar-"+$(),f=n.ref(),S="dropdown-container-"+s+"-"+Y(4),{renderToolbarDropdown:H,clearAllDropDown:te,updateContainerId:ne}=ge(c,l,O);ne(S);const oe=n.computed(()=>C.value.children.length>0),se=n.computed(()=>c.visible?C.value.children.length>0?!0:a.value.findIndex(t=>t.shown&&t.children&&t.children.length>0)>-1:!1);function o(){c.visible&&!f.value&&document&&(f.value=document.createElement("div"),f.value.id=S,document.body.appendChild(f.value))}o();function e(){f.value&&document.body.contains(f.value)&&(document.body.removeChild(f.value),f.value=null)}n.watch(se,(t,i)=>{t?o():e()});const u=n.computed(()=>{const t={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":c.buttonSize==="sm","f-response-toolbar-lg":c.buttonSize==="lg","d-none":!c.visible};return g.getCustomClass(t,c.customClass)}),r=n.computed(()=>({"w-100":!0,"d-flex":!0,"flex-nowrap":!0,"justify-content-end":c.alignment==="right","justify-content-start":c.alignment==="left","justify-content-center":c.alignment==="center"}));function b(t){t&&t.target.closest("ul.dropdown-menu")&&t.type==="wheel"||(a.value.filter(i=>i.children&&i.children.length>0).forEach(i=>{i.expanded=!1}),C.value.expanded=!1,te())}function F(t,i){var k;const d={btn:!0,"f-rt-btn":!0,"f-btn-ml":c.alignment==="right"||i>0&&c.alignment==="center","f-btn-mr":c.alignment==="left","btn-icontext":!!(t.icon&&t.icon.trim())},D=((k=t==null?void 0:t.appearance)==null?void 0:k.class)||t.class||"btn-secondary";return g.getCustomClass(d,D)}function V(t,i){document.body.click(),typeof i.onClick=="function"&&i.onClick(t,i.id),l.emit("click",t,i.id)}function le(t,i){if(t.tipsEnable&&t.tipsText){const d=n.reactive({content:t.tipsText,enable:t.tipsEnable});return n.withDirectives(n.createVNode("button",{type:"button",class:F(t,i),id:t.id,disabled:!t.enable,onClick:D=>V(D,t)},[O.shouldShowIcon(t)&&n.createVNode("i",{class:O.iconClass(t)},null),t.text]),[[n.resolveDirective("tooltip"),d]])}return n.createVNode("button",{type:"button",class:F(t,i),id:t.id,disabled:!t.enable,onClick:d=>V(d,t)},[O.shouldShowIcon(t)&&n.createVNode("i",{class:O.iconClass(t)},null),t.text])}let W=new Map,T=[];function q(t){const i=Math.ceil(parseFloat(getComputedStyle(t).getPropertyValue("margin-left"))),d=Math.ceil(parseFloat(getComputedStyle(t).getPropertyValue("margin-right")));return(i||0)+t.getBoundingClientRect().width+(d||0)}function Z(t,i,d){if(i<v.value){let D=d-1;for(;D>=0;D--){const k=t[D],N=q(k);if(i+=N,i>=v.value)break}d=D}return i-=v.value,d=d<0?0:d,{start:d,space:i}}function E(t){const i=x.value;let d=t;const k=Array.from(i.children).filter(B=>B.id!=="__more_buttons__"),N=k.length;let ee=!1,j=0;for(;j<N;j++){const B=k[j],X=q(B);if(X<=d)d-=X;else{const K=Z(k,d,j);j=K.start,d=K.space,ee=!0;break}}if(!ee&&T.length>0){const B=Z(k,d,j);j=B.start,d=B.space}const Ce=T.length>0;for(;j<N;j++){const B=k[j],X=q(B);W.set(B.id,!0);const K=T.find(ye=>ye.id===B.id);K?K.width=X:T[Ce?"unshift":"push"]({id:B.id,width:X})}return d}function J(){W=new Map,T=[]}function I(t=!1){const i=Object.assign({},C.value);i.children=[];const d=new U(i),D=a.value.reduce((k,N)=>{const ee=c.items.find(j=>j.id===N.id);return t?(d.children.push(N),N.shown=!1,k):(W.has(N.id)?(d.children.push(N),N.shown=!1):N.shown=ee.visible!==!1,k.push(N),k)},[]);C.value=d,a.value=D}function m(t){if(R){J(),I(!0);return}let i=E(t);if(T.length){let d=0;for(;d<T.length;d++){const D=c.items.find(k=>k.id===T[d].id);if(D&&D.visible!==!1){const k=T[d].width;if(i>=k||d===T.length-1&&i+v.value>=k)i-=k;else break}}for(let D=0;D<d;D++)W.delete(T[D].id);T.splice(0,d-1)}I()}function z(){if(w.value&&v.value<0){const t=w.value.querySelector("#"+_.id);if(!t)return;t.getBoundingClientRect().width===0?v.value=-1:v.value=q(t)}}function L(t=-1){if(t===0||!x.value||!p.value)return;t<0&&(t=p.value.getBoundingClientRect().width);const i=x.value.getBoundingClientRect().width;if(R){m(t),b();return}(t>=0&&t<i||T.length)&&(z(),m(t),b())}function Q(){return v.value<0&&n.createVNode("div",{style:"position:fixed;top:-40px;visibility:hidden;"},[H(new U(_))])}const P=new ResizeObserver(t=>{if(t.length){if(R)return;const d=t[0].contentRect.width;L(d)}});function G(){p.value&&!A&&(P.observe(p.value),A=!0)}return n.onMounted(()=>{z(),L(),G(),document.body.addEventListener("click",b),document.body.addEventListener("wheel",b)}),n.onUnmounted(()=>{P.disconnect(),e(),document.body.removeEventListener("click",b),document.body.removeEventListener("wheel",b)}),n.watch(()=>c.items,()=>{a.value=ae(c.items),C.value.children=[],n.nextTick(()=>{z(),J(),L()})},{deep:!0}),n.watch(()=>c.visible,t=>{t&&n.nextTick(()=>{z(),L(),G()})}),l.expose({elementRef:w}),()=>n.createVNode("div",{class:u.value,id:s,ref:w,style:{"overflow-y":v.value<0?"hidden":"initial"}},[c.visible&&Q(),c.visible&&n.createVNode("div",{ref:p,class:r.value},[n.createVNode("div",{ref:x,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[a.value.filter(t=>t.shown).map((t,i)=>t.children&&t.children.length>0?H(t):le(t,i)),oe.value&&H(C.value)])])])}});class we{constructor(l,a){h(this,"id");h(this,"name");h(this,"presetId",[]);h(this,"responsedIndex",[]);h(this,"width");this.id=l,this.name=a,this.width=0}setWidth(l){this.width=parseInt(l+"",10)}getWidth(){return this.width}setPreset(l){Array.isArray(l)?this.presetId=this.presetId.concat(l):this.presetId.push(l)}delPreset(){this.presetId=[]}removeResponsed(l){this.responsedIndex.splice(l,1)}setResponsed(l){Array.isArray(l)?this.responsedIndex=this.responsedIndex.concat(l):this.responsedIndex.push(l)}isResponsing(){return this.responsedIndex.length>0}isResponsed(){return this.presetId.length===this.responsedIndex.length}}const xe=g.withInstall(ue);y.FResponseToolbar=ue,y.ResponseToolbarDropDownItem=U,y.ResponseToolbarGroup=we,y.ResponseToolbarItem=de,y.default=xe,y.responseToolbarProps=re,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(y,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("../common/index.umd.js"),require("vue"),require("../locale/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../common/index.umd.js","vue","../locale/index.umd.js"],g):(y=typeof globalThis<"u"?globalThis:y||self,g(y["response-toolbar"]={},y.common,y.Vue,y.locale))})(this,function(y,g,n,pe){"use strict";var ke=Object.defineProperty;var De=(y,g,n)=>g in y?ke(y,g,{enumerable:!0,configurable:!0,writable:!0,value:n}):y[g]=n;var h=(y,g,n)=>De(y,typeof g!="symbol"?g+"":g,n);const re={id:{type:String,default:""},customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]},visible:{type:Boolean,default:!0},buttonSize:{type:String,default:""}};class ie{constructor(l){h(this,"id","");h(this,"class","btn-secondary");h(this,"icon","");h(this,"groupId","");h(this,"order",-1);h(this,"asDropDownTop",!1);h(this,"text","");h(this,"visible",!0);h(this,"shown",!0);h(this,"responsed",!1);h(this,"tipsEnable",!1);h(this,"tipsText","");h(this,"width",0);h(this,"dropdownClass","");h(this,"onClick",()=>{});h(this,"options");var w,p;this.options=l;const a=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","dropdownClass","onClick"];Object.keys(l).filter(x=>a.indexOf(x)>-1).forEach(x=>{x==="visible"?this[x]=l[x]===void 0?!0:l[x]:this[x]=l[x]}),this.shown=this.visible,(w=l.appearance)!=null&&w.class&&(this.class=(p=l.appearance)==null?void 0:p.class),this.class||(this.class="btn-secondary")}get enable(){return Object.keys(this.options).indexOf("disabled")>-1?!this.options.disabled:n.computed(()=>!0)}setWidth(l){this.width=parseInt(l,10)}getWidth(){return this.visible?this.width:!1}}class de extends ie{constructor(l){super(l)}}function ce(){function c(l){const a=[];return l.reduce((w,p)=>(p.children&&p.children.length>0?w.push(new U(p)):w.push(new de(p)),w),a),a}return{buildResponseToolbarItems:c}}const{buildResponseToolbarItems:fe}=ce();class U extends ie{constructor(a){super(a);h(this,"placement","");h(this,"visible",!0);h(this,"dropdownClass","");h(this,"menuClass","");h(this,"split",!1);h(this,"children",[]);h(this,"expanded",!1);h(this,"shown",!0);const w=["visible","icon","isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(a).filter(p=>w.indexOf(p)>-1).forEach(p=>{p==="visible"?this[p]=a[p]===void 0?!0:a[p]:this[p]=a[p]}),this.shown=this.visible,a.children&&a.children.length&&(this.children=fe(a.children))}}function he(){function c(a){const w={"f-icon":!0};if(a.icon){const p=a.icon.trim().split(" ");p&&p.length&&p.reduce((x,R)=>(x[R]=!0,x),w)}return w}function l(a){return!!(a.icon&&a.icon.trim())}return{iconClass:c,shouldShowIcon:l}}function be(c,l){function a(o){const e={"dropdown-menu":!0};return g.getCustomClass(e,o.menuClass)}function w(o){const e={disabled:!o.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0,"text-truncate":!0};return g.getCustomClass(e,o.dropdownClass)}function p(o){const e={disabled:!o.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0};return g.getCustomClass(e,o.dropdownClass)}function x(o){const e={disabled:!o.enable,"dropdown-item":!0,"f-rt-btn":!0,"text-truncate":!0,"f-rt-toggle":!o.split,"btn-icontext":!!(o.icon&&o.icon.trim()),"dropdown-toggle":!o.split,"btn-secondary":!0};return g.getCustomClass(e,o.dropdownClass)}function R(o){const e={"f-rt-btn":!0,"text-truncate":!0,"btn-icontext":!!(o.icon&&o.icon.trim()),"d-block":!0};return g.getCustomClass(e,o.dropdownClass)}let M;const C=new Map;let _="";function v(o){_="#"+o}function O(o,e,u){o.stopPropagation();const r=u?u.id:"__top_item__";if(e.children&&e.children.length&&(e.expanded=!e.expanded,e.expanded)){if(C.has(r)&&C.get(r)!==e){const b=C.get(r);b&&(b.expanded=!1,C.delete(r))}C.set(r,e)}}function A(o,e){document.body.click(),e.enable&&(o.stopPropagation(),typeof e.onClick=="function"&&e.onClick(o,e.id),c.emit("click",o,e.id))}function $(o,e){const u=o.target;u.className.indexOf("dropdown-item")<0||(u.title=u.scrollWidth>u.clientWidth?e:"")}function Y(o,e,u){if(e.tipsEnable&&e.tipsText){const r=n.reactive({content:e.tipsText,enable:e.tipsEnable});return n.withDirectives(n.createVNode("li",{class:p(e),id:e.id,key:e.id+"_"+u,onClick:b=>A(b,e)},[n.createVNode("span",{class:R(e)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text])]),[[n.resolveDirective("tooltip"),r]])}return n.createVNode("li",{class:p(e),id:e.id,onClick:r=>A(r,e)},[n.createVNode("span",{class:R(e),onMouseenter:r=>$(r,e.text)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text])])}function s(o,e,u){e.enable&&(typeof e.onClick=="function"&&u.onClick(o,e.id),c.emit("click",o,e.id),u.split||O(o,e,u))}function f(o,e,u){o&&o.stopPropagation(),O(o,e,u)}function S(o,e){o.stopPropagation();const u=e.id;if(e.children&&e.children.length&&e.expanded&&C.has(u)){const r=C.get(u);r&&(r.expanded=!1,C.delete(u))}}function H(o,e,u){if(e.tipsEnable&&e.tipsText){const r=n.reactive({content:e.tipsText,enable:e.tipsEnable});return n.createVNode("li",{class:w(e),id:e.id,key:e.id+"_"+u,onClick:b=>s(b,e,o)},[n.withDirectives(n.createVNode("span",{class:x(e)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text]),[[n.resolveDirective("tooltip"),r]]),e.split&&n.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:b=>f(b,e,o)},null),M(e,e)])}return n.createVNode("li",{class:w(e),id:e.id,onClick:r=>s(r,e,o),onMouseenter:r=>$(r,e.text)},[n.createVNode("span",{class:x(e)},[l.shouldShowIcon(e)&&n.createVNode("i",{class:l.iconClass(e)},null),e.text]),e.split&&n.createVNode("span",{class:"dropdown-toggle dropdown-toggle-split f-rt-toggle",onClick:r=>f(r,e,o)},null),M(e,e)])}function te(o){return o.children.filter(e=>e.visible).map((e,u)=>e.children&&e.children.length?H(o,e,u):Y(o,e,u))}function ne(o,e){if(!o)return 1080;let u=-1;const r=o.children.length;for(let b=0;b<r;b++)if(o.children[b].id===e){u=b;break}return 1080+r-u}function oe(o,e,u){var q,Z;const r={display:o.expanded?"block":"none",position:"fixed",maxWidth:"300px",minWidth:"120px",zIndex:1080,overflowY:"auto",maxHeight:"none"},b=document.querySelector(_);if(!b)return r;const F=n.getCurrentInstance();let V=(Z=(q=F==null?void 0:F.exposed)==null?void 0:q.elementRef.value)==null?void 0:Z.querySelector("#"+e);if(V||(V=b==null?void 0:b.querySelector("#"+e)),!V)return r;const le=window.innerWidth,W=window.innerHeight,T=V==null?void 0:V.getClientRects();if(V&&T&&T.length){const{top:E,width:J,left:I,right:m,height:z}=T[0],L=Math.ceil(z+E);r.top=`${L}px`,r.left=`${I}px`;const Q=o.id+"_menu",P=(V==null?void 0:V.querySelector("#"+Q))||(b==null?void 0:b.querySelector("#"+Q))||null;if(P){P.style.visibility="hidden",P.style.display="block";const G=P.offsetHeight;r.zIndex=o.expanded?ne(b,Q):1080,r.display==="block"&&(P.style.display="block");const t=P.getBoundingClientRect();if(u){r.top=`${E-6}px`;const i=Math.ceil(J+I);r.left=`${i}px`}le-I-J<t.width&&(r.left=`${(u?I:m)-t.width}px`),W-E-z<G?E>G?(r.top=`${E-G-6}px`,r.maxHeight=`${E-16}px`):(r.maxHeight=`${W-L}px`,E>W-E-z&&(r.top="10px",r.maxHeight=`${E-16}px`)):r.maxHeight=`${W-L}px`,P.style.visibility="visible"}}return r}M=function(o,e){const u=e?e.id:o.id;return n.createVNode(n.Teleport,{to:_,disabled:!o.expanded},{default:()=>[n.createVNode("ul",{class:a(o),style:oe(o,u,e),id:o.id+"_menu",onWheel:r=>S(r,o)},[te(o)])]})};function se(){C.forEach(o=>{o.expanded=!1}),C.clear()}return{renderDropdownMenu:M,clearAllDropDownMenu:se,updateContainerId:v}}function ge(c,l,a){const w=n.ref(c.alignment),{renderDropdownMenu:p,clearAllDropDownMenu:x,updateContainerId:R}=be(l,a);function M(s){const f={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":w.value==="right"||w.value==="center","f-btn-mr":w.value==="left"};return g.getCustomClass(f,s.dropdownClass)}function C(s){const f={btn:!0,disabled:!s.enable,"f-rt-btn":!0,"btn-icontext":!!(s.icon&&s.icon.trim())&&s.text,"f-rt-toggle":!s.split,"dropdown-toggle":!s.split,"f-btn-icon":s.icon&&!s.text};return g.getCustomClass(f,s.class)}function _(s){const f={btn:!0,"dropdown-toggle":!0,"dropdown-toggle-split":!0};return g.getCustomClass(f,s.class)}function v(s){return s.split?{display:"flex"}:{display:"flex","border-radius":"6px"}}function O(s,f){s.stopPropagation();const S=f.expanded;document.body.click(),typeof f.onClick=="function"&&f.onClick(s,f.id),l.emit("click",s,f.id),f.split||(f.expanded=!S)}function A(s,f){s.stopPropagation();const S=f.expanded;document.body.click(),f.expanded=!S}function $(s,f=!0){if(s.tipsEnable&&s.tipsText){const S=n.reactive({content:s.tipsText,enable:s.tipsEnable});return n.createVNode("div",{id:s.id,class:M(s)},[n.withDirectives(n.createVNode("div",{class:C(s),style:v(s),onClick:H=>s.enable&&O(H,s)},[a.shouldShowIcon(s)&&n.createVNode("i",{class:a.iconClass(s)},null),s.text&&n.createVNode("span",null,[s.text])]),[[n.resolveDirective("tooltip"),S]]),s.split&&n.createVNode("button",{class:_(s),style:"border-radius:0 6px 6px 0;",onClick:H=>A(H,s)},null),f&&p(s)])}return n.createVNode("div",{id:s.id,class:M(s)},[n.createVNode("div",{class:C(s),style:v(s),onClick:S=>s.enable&&O(S,s)},[a.shouldShowIcon(s)&&n.createVNode("i",{class:a.iconClass(s)},null),s.text&&n.createVNode("span",null,[s.text])]),s.split&&n.createVNode("button",{class:_(s),style:"border-radius:0 6px 6px 0;",onClick:S=>A(S,s)},null),f&&p(s)])}function Y(){x()}return{renderToolbarDropdown:$,clearAllDropDown:Y,updateContainerId:R}}const{buildResponseToolbarItems:ae}=ce(),ue=n.defineComponent({name:"FResponseToolbar",props:re,emits:["click"],setup(c,l){const a=n.ref(ae(c.items)),w=n.ref(),p=n.ref(),x=n.ref(),R=g.isMobilePhone(),M={id:"__more_buttons__",text:R?"":pe.LocaleService.getLocaleValue("responseToolbar.more"),icon:R?"f-icon-more-horizontal":""},C=n.ref(new U(M)),_=Object.assign({},M,{id:M.id+"width"}),v=n.ref(-1),O=he();let A=!1;const{guid:$,uuid:Y}=g.useGuid(),s=c.id?c.id:"toolbar-"+$(),f=n.ref(),S="dropdown-container-"+s+"-"+Y(4),{renderToolbarDropdown:H,clearAllDropDown:te,updateContainerId:ne}=ge(c,l,O);ne(S);const oe=n.computed(()=>C.value.children.length>0),se=n.computed(()=>c.visible?C.value.children.length>0?!0:a.value.findIndex(t=>t.shown&&t.children&&t.children.length>0)>-1:!1);function o(){c.visible&&!f.value&&document&&(f.value=document.createElement("div"),f.value.id=S,document.body.appendChild(f.value))}o();function e(){f.value&&document.body.contains(f.value)&&(document.body.removeChild(f.value),f.value=null)}n.watch(se,(t,i)=>{t?o():e()});const u=n.computed(()=>{const t={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0,"f-response-toolbar-sm":c.buttonSize==="sm","f-response-toolbar-lg":c.buttonSize==="lg","d-none":!c.visible};return g.getCustomClass(t,c.customClass)}),r=n.computed(()=>({"w-100":!0,"d-flex":!0,"flex-nowrap":!0,"justify-content-end":c.alignment==="right","justify-content-start":c.alignment==="left","justify-content-center":c.alignment==="center"}));function b(t){t&&t.target.closest("ul.dropdown-menu")&&t.type==="wheel"||(a.value.filter(i=>i.children&&i.children.length>0).forEach(i=>{i.expanded=!1}),C.value.expanded=!1,te())}function F(t,i){var k;const d={btn:!0,"f-rt-btn":!0,"f-btn-ml":c.alignment==="right"||i>0&&c.alignment==="center","f-btn-mr":c.alignment==="left","btn-icontext":!!(t.icon&&t.icon.trim())},D=((k=t==null?void 0:t.appearance)==null?void 0:k.class)||t.class||"btn-secondary";return g.getCustomClass(d,D)}function V(t,i){document.body.click(),typeof i.onClick=="function"&&i.onClick(t,i.id),l.emit("click",t,i.id)}function le(t,i){if(t.tipsEnable&&t.tipsText){const d=n.reactive({content:t.tipsText,enable:t.tipsEnable});return n.withDirectives(n.createVNode("button",{type:"button",class:F(t,i),id:t.id,disabled:!t.enable,onClick:D=>V(D,t)},[O.shouldShowIcon(t)&&n.createVNode("i",{class:O.iconClass(t)},null),t.text]),[[n.resolveDirective("tooltip"),d]])}return n.createVNode("button",{type:"button",class:F(t,i),id:t.id,disabled:!t.enable,onClick:d=>V(d,t)},[O.shouldShowIcon(t)&&n.createVNode("i",{class:O.iconClass(t)},null),t.text])}let W=new Map,T=[];function q(t){const i=Math.ceil(parseFloat(getComputedStyle(t).getPropertyValue("margin-left"))),d=Math.ceil(parseFloat(getComputedStyle(t).getPropertyValue("margin-right")));return(i||0)+t.getBoundingClientRect().width+(d||0)}function Z(t,i,d){if(i<v.value){let D=d-1;for(;D>=0;D--){const k=t[D],N=q(k);if(i+=N,i>=v.value)break}d=D}return i-=v.value,d=d<0?0:d,{start:d,space:i}}function E(t){const i=x.value;let d=t;const k=Array.from(i.children).filter(B=>B.id!=="__more_buttons__"),N=k.length;let ee=!1,j=0;for(;j<N;j++){const B=k[j],X=q(B);if(X<=d)d-=X;else{const K=Z(k,d,j);j=K.start,d=K.space,ee=!0;break}}if(!ee&&T.length>0){const B=Z(k,d,j);j=B.start,d=B.space}const Ce=T.length>0;for(;j<N;j++){const B=k[j],X=q(B);W.set(B.id,!0);const K=T.find(ye=>ye.id===B.id);K?K.width=X:T[Ce?"unshift":"push"]({id:B.id,width:X})}return d}function J(){W=new Map,T=[]}function I(t=!1){const i=Object.assign({},C.value);i.children=[];const d=new U(i),D=a.value.reduce((k,N)=>{const ee=c.items.find(j=>j.id===N.id);return t?(d.children.push(N),N.shown=!1,k):(W.has(N.id)?(d.children.push(N),N.shown=!1):N.shown=ee.visible!==!1,k.push(N),k)},[]);C.value=d,a.value=D}function m(t){if(R){J(),I(!0);return}let i=E(t);if(T.length){let d=0;for(;d<T.length;d++){const D=c.items.find(k=>k.id===T[d].id);if(D&&D.visible!==!1){const k=T[d].width;if(i>=k||d===T.length-1&&i+v.value>=k)i-=k;else break}}for(let D=0;D<d;D++)W.delete(T[D].id);T.splice(0,d-1)}I()}function z(){if(w.value&&v.value<0){const t=w.value.querySelector("#"+_.id);if(!t)return;t.getBoundingClientRect().width===0?v.value=-1:v.value=q(t)}}function L(t=-1){if(t===0||!x.value||!p.value)return;t<0&&(t=p.value.getBoundingClientRect().width);const i=x.value.getBoundingClientRect().width;if(R){m(t),b();return}(t>=0&&t<i||T.length)&&(z(),m(t),b())}function Q(){return v.value<0&&n.createVNode("div",{style:"position:fixed;top:-40px;visibility:hidden;"},[H(new U(_))])}const P=new ResizeObserver(t=>{if(t.length){if(R)return;const d=t[0].contentRect.width;L(d)}});function G(){p.value&&!A&&(P.observe(p.value),A=!0)}return n.onMounted(()=>{z(),L(),G(),document.body.addEventListener("click",b),document.body.addEventListener("wheel",b)}),n.onUnmounted(()=>{P.disconnect(),e(),document.body.removeEventListener("click",b),document.body.removeEventListener("wheel",b)}),n.watch(()=>c.items,()=>{a.value=ae(c.items),C.value.children=[],n.nextTick(()=>{z(),J(),L()})},{deep:!0}),n.watch(()=>c.visible,t=>{t&&n.nextTick(()=>{z(),L(),G()})}),l.expose({elementRef:w}),()=>n.createVNode("div",{class:u.value,id:s,ref:w,style:{"overflow-y":v.value<0?"hidden":"initial"}},[c.visible&&Q(),c.visible&&n.createVNode("div",{ref:p,class:r.value},[n.createVNode("div",{ref:x,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[a.value.filter(t=>t.shown).map((t,i)=>t.children&&t.children.length>0?H(t):le(t,i)),oe.value&&H(C.value)])])])}});class we{constructor(l,a){h(this,"id");h(this,"name");h(this,"presetId",[]);h(this,"responsedIndex",[]);h(this,"width");this.id=l,this.name=a,this.width=0}setWidth(l){this.width=parseInt(l+"",10)}getWidth(){return this.width}setPreset(l){Array.isArray(l)?this.presetId=this.presetId.concat(l):this.presetId.push(l)}delPreset(){this.presetId=[]}removeResponsed(l){this.responsedIndex.splice(l,1)}setResponsed(l){Array.isArray(l)?this.responsedIndex=this.responsedIndex.concat(l):this.responsedIndex.push(l)}isResponsing(){return this.responsedIndex.length>0}isResponsed(){return this.presetId.length===this.responsedIndex.length}}const xe=g.withInstall(ue);y.FResponseToolbar=ue,y.ResponseToolbarDropDownItem=U,y.ResponseToolbarGroup=we,y.ResponseToolbarItem=de,y.default=xe,y.responseToolbarProps=re,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|