@ibiz-template/mob-vue3-components 0.7.41-alpha.13 → 0.7.41-alpha.16

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.
Files changed (86) hide show
  1. package/dist/{index-OsiEgFnw.js → index-5DjmQP8W.js} +2 -2
  2. package/dist/index-5DjmQP8W.js.map +1 -0
  3. package/dist/index-fAu1z4L0.js +2 -0
  4. package/dist/index-fAu1z4L0.js.map +1 -0
  5. package/dist/index-yjjy8EQH.js +76 -0
  6. package/dist/index-yjjy8EQH.js.map +1 -0
  7. package/dist/index.min.css +4 -4
  8. package/dist/index.system.min.js +1 -1
  9. package/dist/{quill-editor-VqApoQJq.js → quill-editor-6a0LLTGQ.js} +2 -2
  10. package/dist/{quill-editor-VqApoQJq.js.map → quill-editor-6a0LLTGQ.js.map} +1 -1
  11. package/dist/{quill-editor-preview-G0MpMJzC.js → quill-editor-preview-PFiM-IPE.js} +2 -2
  12. package/dist/{quill-editor-preview-G0MpMJzC.js.map → quill-editor-preview-PFiM-IPE.js.map} +1 -1
  13. package/dist/{quill-wfN-3C_3.js → quill-n54HJUg2.js} +2 -2
  14. package/dist/{quill-wfN-3C_3.js.map → quill-n54HJUg2.js.map} +1 -1
  15. package/dist/tree-4CqtwsXL.js +2 -0
  16. package/dist/tree-4CqtwsXL.js.map +1 -0
  17. package/es/common/action-group/action-group.css +1 -0
  18. package/es/common/action-group/action-group.d.ts +55 -0
  19. package/es/common/action-group/action-group.mjs +174 -0
  20. package/es/common/action-toolbar/action-toolbar.d.ts +1 -0
  21. package/es/common/action-toolbar/action-toolbar.mjs +20 -8
  22. package/es/common/button-list/button-list.css +1 -1
  23. package/es/common/button-list/button-list.d.ts +3 -2
  24. package/es/common/button-list/button-list.mjs +83 -63
  25. package/es/common/index.mjs +2 -0
  26. package/es/common/rawitem/rawitem.mjs +2 -2
  27. package/es/control/list/md-ctrl/md-ctrl.mjs +13 -15
  28. package/es/control/tab-exp-panel/index.d.ts +1 -0
  29. package/es/control/tab-exp-panel/tab-exp-panel.css +1 -0
  30. package/es/control/tab-exp-panel/tab-exp-panel.d.ts +2 -0
  31. package/es/control/tab-exp-panel/tab-exp-panel.mjs +28 -1
  32. package/es/control/tree/tree.css +1 -1
  33. package/es/control/tree/tree.d.ts +15 -0
  34. package/es/control/tree/tree.mjs +14 -2
  35. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.d.ts +5 -7
  36. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.mjs +18 -0
  37. package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +2 -1
  38. package/es/editor/rate/ibiz-rate/ibiz-rate.mjs +3 -0
  39. package/es/editor/raw/ibiz-raw/ibiz-raw.d.ts +2 -2
  40. package/es/editor/span/span/span.d.ts +5 -3
  41. package/es/editor/span/span/span.mjs +5 -5
  42. package/es/editor/stepper/ibiz-stepper/ibiz-stepper.d.ts +4 -3
  43. package/es/editor/stepper/ibiz-stepper/ibiz-stepper.mjs +9 -0
  44. package/es/editor/switch/ibiz-switch/ibiz-switch.d.ts +1 -0
  45. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.d.ts +2 -1
  46. package/es/editor/text-box/input/input.d.ts +2 -0
  47. package/es/editor/upload/upload-editor.controller.d.ts +23 -2
  48. package/es/editor/upload/upload-editor.controller.mjs +46 -15
  49. package/es/editor/upload/use/use-van-upload.mjs +35 -3
  50. package/es/locale/en/index.d.ts +2 -0
  51. package/es/locale/en/index.mjs +2 -1
  52. package/es/locale/zh-CN/index.d.ts +2 -0
  53. package/es/locale/zh-CN/index.mjs +2 -1
  54. package/es/panel-component/panel-button-list/panel-button-list.controller.d.ts +1 -1
  55. package/es/panel-component/panel-button-list/panel-button-list.controller.mjs +19 -18
  56. package/es/util/store/view-stack/view-stack.mjs +11 -1
  57. package/lib/common/action-group/action-group.cjs +176 -0
  58. package/lib/common/action-group/action-group.css +1 -0
  59. package/lib/common/action-toolbar/action-toolbar.cjs +20 -8
  60. package/lib/common/button-list/button-list.cjs +82 -62
  61. package/lib/common/button-list/button-list.css +1 -1
  62. package/lib/common/index.cjs +2 -0
  63. package/lib/common/rawitem/rawitem.cjs +2 -2
  64. package/lib/control/list/md-ctrl/md-ctrl.cjs +12 -14
  65. package/lib/control/tab-exp-panel/tab-exp-panel.cjs +27 -0
  66. package/lib/control/tab-exp-panel/tab-exp-panel.css +1 -0
  67. package/lib/control/tree/tree.cjs +14 -2
  68. package/lib/control/tree/tree.css +1 -1
  69. package/lib/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.cjs +18 -0
  70. package/lib/editor/rate/ibiz-rate/ibiz-rate.cjs +3 -0
  71. package/lib/editor/span/span/span.cjs +5 -5
  72. package/lib/editor/stepper/ibiz-stepper/ibiz-stepper.cjs +9 -0
  73. package/lib/editor/upload/upload-editor.controller.cjs +46 -15
  74. package/lib/editor/upload/use/use-van-upload.cjs +35 -3
  75. package/lib/locale/en/index.cjs +2 -1
  76. package/lib/locale/zh-CN/index.cjs +2 -1
  77. package/lib/panel-component/panel-button-list/panel-button-list.controller.cjs +18 -17
  78. package/lib/util/store/view-stack/view-stack.cjs +11 -1
  79. package/package.json +6 -6
  80. package/dist/index-JSf84k9b.js +0 -2
  81. package/dist/index-JSf84k9b.js.map +0 -1
  82. package/dist/index-OsiEgFnw.js.map +0 -1
  83. package/dist/index-TTGYeV0q.js +0 -76
  84. package/dist/index-TTGYeV0q.js.map +0 -1
  85. package/dist/tree-nburezSg.js +0 -2
  86. package/dist/tree-nburezSg.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ System.register(["vue","@ibiz-template/vue3-util","@ibiz-template/runtime","lodash-es","qx-util","@ibiz-template-package/vs-tree-ex"],function(M){"use strict";var N,v,l,D,a,u,k,x,S,E,L,I,z,T,d,A;return{setters:[function(s){N=s.defineComponent,v=s.computed,l=s.ref,D=s.onUnmounted,a=s.createVNode,u=s.resolveComponent,k=s.isVNode,x=s.h,S=s.createApp},function(s){E=s.useControlController,L=s.useNamespace,I=s.IBizIcon},function(s){z=s.TreeController},function(s){T=s.debounce},function(s){d=s.createUUID},function(s){A=s.VsTreeComponent}],execute:function(){function s(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!k(i)}const B=N({name:"IBizTreeControl",components:{"vs-tree":A},props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:2},singleSelect:{type:Boolean,default:!0},navigational:{type:Boolean,default:void 0}},setup(){var i,f;const o=E((...e)=>new z(...e)),_=L(`control-${o.model.controlType.toLowerCase()}`),V=v(()=>o.state.selectedData.map(e=>e._id));let C=[];const p=l(),y=l(d()),Q=l(""),K=d(),j=l(!0),G=e=>{const t=x(I,e),n=S(t),r=document.createElement("span");return n.mount(r),C.push(n),r},q=e=>e.map(t=>{const n=t?._icon?G({icon:t?._icon}):"";return{_id:t._id,_uuid:t._uuid,_leaf:t._leaf,_text:t._text,icon:n,_disableSelect:t._disableSelect}}),w=v(()=>{if(!o.state.isLoaded)return[];const e=o.model.rootVisible?o.state.rootNodes:o.state.rootNodes.reduce((t,n)=>n._children?t.concat(n._children):t,[]);return q(e)});function F(e,t){const n=t.state.items.find(r=>r._id===e);return n||t.state.items.find(r=>r._uuid===e)}const J=async(e,t)=>{if(!o.state.isLoaded)return;let n;const r=F(e.data._uuid,o);if(r&&r._children&&!o.state.query?(ibiz.log.debug("\u8282\u70B9\u5C55\u5F00\u52A0\u8F7D-\u672C\u5730",r),n=r._children):(ibiz.log.debug("\u8282\u70B9\u5C55\u5F00\u52A0\u8F7D-\u8FDC\u7A0B",r),n=await o.loadNodes(r)),n&&o.state.rootNodes.includes(n[0])){t(w.value),o.state.mobExpandedKey="",y.value=d();return}t(q(n))},O=(e,t)=>{if(o.state.singleSelect)return;const{originData:n}=t,{selectedData:r}=o.state,c=F(n._uuid,o),h=r.filter(b=>b._id!==c._id);h.length===r.length?o.setSelection(r.concat([c])):o.setSelection(h)},U=(e,t)=>{e.stopPropagation();const{originData:n}=t;n._leaf&&(O(e,t),o.onTreeNodeClick(n,e))},R=e=>{o.state.mobExpandedKey=e._uuid||""},W=T(async()=>{var e,t,n,r,c,h,b,P,H;if(p.value){const g=(c=(r=(n=(t=(e=p.value)==null?void 0:e.tree)==null?void 0:t.tree)==null?void 0:n.store)==null?void 0:r.breadcrumb)==null?void 0:c.list,m=g?g[g.length-1]:null;m&&(m.childNodes=[],(H=(P=(b=(h=p.value)==null?void 0:h.tree)==null?void 0:b.tree)==null?void 0:P.store)==null||H.nodesChange([]),m.loaded=!1,m.setExpand(!0))}},500),X=async e=>{o.state.query=e,await o.load()};o.evt.on("onAfterRefreshParent",()=>{W()}),o.evt.on("onLoadSuccess",()=>{o.state.mobExpandedKey="",y.value=d()});const Y=e=>({id:e._id,name:e._text,children:e._children,isLeaf:e._leaf}),Z=e=>{const{originData:t,loadingEl:n}=e;V.value.includes(t._id)&&n&&(n.parentNode.parentNode.classList.add("selected"),e.store.selectedCurrent=e)},ee=(e,t)=>{o.state.singleSelect&&Z(t);const{originData:n}=t;if(!n._leaf)return e("div",{text:ibiz.i18n.t("control.tree.subordinate"),className:"tree-button",click:(r,c)=>{c.store.breadcrumb.list.push(c),c.setExpand(!0),R(n)}})},te=(e,t)=>{const{checked:n}=t;t.setChecked(!n),U(e,t)},$={maxHeight:"100%",checkInherit:!1,nocheckParent:!0,rootName:(f=(i=o.model.detreeNodes)==null?void 0:i.find(e=>e.rootNode))==null?void 0:f.name,renderContent:ee,customNodeClick:te};return j.value&&Object.assign($,{breadcrumb:{el:`#breadcrumb${K}`,link:(e,t)=>{const n=document.createElement("span"),r=document.createElement("span");return r.innerText=t.name,t.icon instanceof HTMLElement&&n.appendChild(t.icon.cloneNode(!0)),n.appendChild(r),n.className=`${_.be("header","crumb")} ${_.is("root",t._vsroot)}`,n.onclick=()=>R.bind(this)(t),n}}}),D(()=>{C.forEach(e=>{e.unmount()}),C=[]}),{c:o,ns:_,treeRefreshKey:y,treeData:w,options:$,breadcrumb:j,checkedKeys:V,uuid:K,treeRef:p,onNodeCheck:O,onNodeClick:U,loadData:J,treeDataFormat:Y,currentVal:Q,onInput:X}},render(){const i={searchbar:()=>this.c.enableQuickSearch?a(u("van-search"),{modelValue:this.c.state.query,class:this.ns.b("quick-search"),clearable:!0,placeholder:this.c.state.placeHolder,"onUpdate:model-value":this.onInput},null):null},f=this.c.controlPanel?"tree":"default";return i[f]=()=>{const o=[this.breadcrumb&&a("div",{class:this.ns.be("header","container")},[a(u("van-sticky"),null,{default:()=>[a("div",{id:`breadcrumb${this.uuid}`,class:[this.ns.b("header"),this.ns.is("no-root",!this.c.model.rootVisible)]},null)]})]),this.c.state.isCreated&&this.c.state.isLoaded&&a(u("vs-tree"),{"show-line":!0,ref:"treeRef",key:this.treeRefreshKey,class:[this.ns.b("content")],lazy:!0,strictLeaf:!0,options:this.options,"show-checkbox":!this.c.state.singleSelect,showIcon:!0,data:this.treeData,highlightCurrent:!0,checkedKeys:this.checkedKeys,format:this.treeDataFormat,load:this.loadData,onCheck:this.onNodeCheck},null)];return a("div",{class:this.ns.b("container")},[o])},a(u("iBizControlBase"),{controller:this.c},s(i)?i:{default:()=>[i]})}});M({TreeControl:B,default:B})}}});
2
+ //# sourceMappingURL=tree-4CqtwsXL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-4CqtwsXL.js","sources":["../src/control/tree/tree.tsx"],"sourcesContent":["import {\n useControlController,\n useNamespace,\n IBizIcon,\n} from '@ibiz-template/vue3-util';\nimport {\n computed,\n defineComponent,\n PropType,\n ref,\n VNode,\n h as vueH,\n createApp,\n App,\n onUnmounted,\n} from 'vue';\nimport { IDETree } from '@ibiz/model-core';\nimport {\n IControlProvider,\n ITreeController,\n ITreeNodeData,\n TreeController,\n} from '@ibiz-template/runtime';\nimport { debounce } from 'lodash-es';\nimport { createUUID } from 'qx-util';\nimport { VsTreeComponent } from '@ibiz-template-package/vs-tree-ex';\nimport './tree.scss';\n\nexport const TreeControl = defineComponent({\n name: 'IBizTreeControl',\n components: {\n 'vs-tree': VsTreeComponent,\n },\n props: {\n /**\n * @description 树控件模型数据\n */\n modelData: { type: Object as PropType<IDETree>, required: true },\n /**\n * @description 应用上下文对象\n */\n context: { type: Object as PropType<IContext>, required: true },\n /**\n * @description 视图参数对象\n * @default {}\n */\n params: { type: Object as PropType<IParams>, default: () => ({}) },\n /**\n * @description 部件适配器\n */\n provider: { type: Object as PropType<IControlProvider> },\n /**\n * @description 部件激活模式,值为0:无激活,值为1:单击激活,值为2:双击激活\n * @default 2\n */\n mdctrlActiveMode: { type: Number, default: 2 },\n /**\n * @description 是否单选\n * @default true\n */\n singleSelect: { type: Boolean, default: true },\n /**\n * @description 是否是导航内的(即树导航里的树)\n */\n navigational: { type: Boolean, default: undefined },\n },\n setup() {\n const c = useControlController<TreeController>(\n (...args) => new TreeController(...args),\n );\n const ns = useNamespace(`control-${c.model.controlType!.toLowerCase()}`);\n // 默认选中项\n const checkedKeys = computed(() => {\n return c.state.selectedData.map(item => item._id);\n });\n\n // 节点创建的app实例,用于组件销毁时销毁所有实例\n let vueApps: App[] = [];\n // 引用的树组件实例\n const treeRef = ref();\n // 用于树强制刷新\n const treeRefreshKey = ref(createUUID());\n\n // 快捷搜索值\n const currentVal = ref('');\n\n const uuid = createUUID();\n\n // 启用面包屑功能\n const breadcrumb = ref(true);\n\n // 创建图标节点\n const createIconNode = (customProps: IData) => {\n const iop = vueH(IBizIcon, customProps);\n const vueApp = createApp(iop);\n const dom = document.createElement('span');\n vueApp.mount(dom);\n vueApps.push(vueApp);\n return dom;\n };\n\n /**\n * 创建新的节点对象,隔离组件数据和controller数据\n * @param {ITreeNodeData[]} nodes\n * @return {*} {IData[]}\n */\n const toElNodes = (nodes: ITreeNodeData[]): IData[] => {\n return nodes.map(node => {\n const iconDom = node?._icon\n ? createIconNode({ icon: node?._icon })\n : '';\n return {\n _id: node._id,\n _uuid: node._uuid,\n _leaf: node._leaf,\n _text: node._text,\n icon: iconDom,\n _disableSelect: node._disableSelect,\n };\n });\n };\n\n /** 树展示数据 */\n const treeData = computed(() => {\n if (!c.state.isLoaded) {\n return [];\n }\n const nodes = c.model.rootVisible\n ? c.state.rootNodes\n : c.state.rootNodes.reduce<ITreeNodeData[]>((result, nodeData) => {\n if (nodeData._children) {\n return result.concat(nodeData._children as ITreeNodeData[]);\n }\n return result;\n }, []);\n return toElNodes(nodes as ITreeNodeData[]);\n });\n\n /**\n * 根据id查找树节点数据对象\n * @export\n * @param {string} key (数据的_uuid 或者 _id)\n * @param {ITreeController} c\n * @return {*} {(ITreeNodeData | undefined)}\n */\n function findNodeData(\n key: string,\n controller: ITreeController,\n ): ITreeNodeData | undefined {\n const find = controller.state.items.find(item => item._id === key);\n if (find) {\n return find;\n }\n return controller.state.items.find(item => item._uuid === key);\n }\n\n /**\n * 触发节点加载数据\n * @author zk\n * @date 2023-05-29 09:16:07\n * @param {IData} item\n * @param {(nodes: IData[]) => void} callback\n */\n const loadData = async (\n item: IData,\n callback: (nodes: IData[]) => void,\n ) => {\n // 没加载前拦截\n if (!c.state.isLoaded) {\n return;\n }\n\n // 加载时拦截点击事件\n let nodes: ITreeNodeData[];\n const nodeData = findNodeData(item.data._uuid, c)!;\n // 有搜索值为搜索框搜索,必须请求后台数据过滤\n if (nodeData && nodeData._children && !c.state.query) {\n ibiz.log.debug('节点展开加载-本地', nodeData);\n nodes = nodeData._children;\n } else {\n ibiz.log.debug('节点展开加载-远程', nodeData);\n nodes = await c.loadNodes(nodeData);\n }\n // 根节点搜索时,返回树展示数据,并强制刷新\n if (nodes && c.state.rootNodes.includes(nodes[0])) {\n callback(treeData.value);\n c.state.mobExpandedKey = '';\n treeRefreshKey.value = createUUID();\n return;\n }\n callback(toElNodes(nodes));\n };\n\n /**\n * 多选时选中节点变更\n *\n * @param {ITreeNodeData} nodeData\n */\n const onNodeCheck = (event: MouseEvent, opts: IData) => {\n if (c.state.singleSelect) {\n return;\n }\n const { originData } = opts;\n // 选中相关处理\n const { selectedData } = c.state;\n const nodeData = findNodeData(originData._uuid, c)!;\n // 选中里没有则添加,有则删除\n const filterArr = selectedData.filter(\n (item: IData) => item._id !== nodeData._id,\n );\n if (filterArr.length === selectedData.length) {\n c.setSelection(selectedData.concat([nodeData]));\n } else {\n c.setSelection(filterArr);\n }\n };\n\n const onNodeClick = (event: MouseEvent, opts: IData) => {\n event.stopPropagation();\n const { originData } = opts;\n if (!originData._leaf) {\n return;\n }\n onNodeCheck(event, opts);\n c.onTreeNodeClick(originData, event);\n };\n\n // 处理展开节点切换\n const handleExpandedLastKey = (data: IData) => {\n c.state.mobExpandedKey = data._uuid || '';\n };\n\n // 搜索\n const debounceSearch = debounce(async () => {\n if (treeRef.value) {\n // 获取最后展开的节点\n const breadcrumbList =\n treeRef.value?.tree?.tree?.store?.breadcrumb?.list;\n const breadcrumbListLast = breadcrumbList\n ? breadcrumbList[breadcrumbList.length - 1]\n : null;\n if (breadcrumbListLast) {\n breadcrumbListLast.childNodes = [];\n treeRef.value?.tree?.tree?.store?.nodesChange([]);\n breadcrumbListLast.loaded = false;\n breadcrumbListLast.setExpand(true);\n }\n }\n }, 500);\n\n const onInput = async (value: string): Promise<void> => {\n c.state.query = value;\n await c.load();\n };\n\n c.evt.on('onAfterRefreshParent', () => {\n debounceSearch();\n });\n\n c.evt.on('onLoadSuccess', () => {\n c.state.mobExpandedKey = '';\n treeRefreshKey.value = createUUID();\n });\n\n /**\n * 树数据格式化\n *\n * @author zk\n * @date 2023-07-03 11:07:59\n * @param {ITreeNodeData} data\n * @return {*}\n */\n const treeDataFormat = (data: ITreeNodeData) => {\n return {\n id: data._id,\n name: data._text,\n children: data._children,\n isLeaf: data._leaf,\n };\n };\n\n /**\n * 处理单选默认选中样式\n *\n * @author ljx\n * @date 2024-12-12 15:07:59\n * @param {IData} opts\n * @return {*}\n */\n const handleSingleSelect = (opts: IData) => {\n const { originData, loadingEl } = opts;\n if (checkedKeys.value.includes(originData._id) && loadingEl) {\n loadingEl.parentNode.parentNode.classList.add('selected');\n opts.store.selectedCurrent = opts;\n }\n };\n\n const renderContent = (\n h: (tag: string, opt: IData) => VNode,\n opts: IData,\n ) => {\n if (c.state.singleSelect) handleSingleSelect(opts);\n const { originData } = opts;\n if (!originData._leaf) {\n return h('div', {\n text: ibiz.i18n.t('control.tree.subordinate'),\n className: 'tree-button',\n click: (e: Event, _opts: IData) => {\n _opts.store.breadcrumb.list.push(_opts);\n _opts.setExpand(true);\n handleExpandedLastKey(originData);\n },\n });\n }\n };\n\n const customNodeClick = (event: MouseEvent, opts: IData) => {\n const { checked } = opts;\n opts.setChecked(!checked);\n onNodeClick(event, opts);\n };\n\n // vs树配置项\n const options = {\n maxHeight: '100%',\n // 继承父状态\n checkInherit: false,\n // 不能选择父节点\n nocheckParent: true,\n rootName: c.model.detreeNodes?.find(item => item.rootNode)?.name,\n renderContent,\n customNodeClick,\n };\n\n if (breadcrumb.value) {\n Object.assign(options, {\n breadcrumb: {\n el: `#breadcrumb${uuid}`,\n link: (node: IData, data: IData) => {\n const content = document.createElement('span');\n const textDom = document.createElement('span');\n textDom.innerText = data.name;\n if (data.icon instanceof HTMLElement) {\n content.appendChild(data.icon.cloneNode(true));\n }\n content.appendChild(textDom);\n content.className = `${ns.be('header', 'crumb')} ${ns.is(\n 'root',\n data._vsroot,\n )}`;\n content.onclick = () => handleExpandedLastKey.bind(this)(data);\n return content;\n },\n },\n });\n }\n\n onUnmounted(() => {\n // 卸载绘制的图标节点\n vueApps.forEach((vueApp: App) => {\n vueApp.unmount();\n });\n vueApps = [];\n });\n\n return {\n c,\n ns,\n treeRefreshKey,\n treeData,\n options,\n breadcrumb,\n checkedKeys,\n uuid,\n treeRef,\n onNodeCheck,\n onNodeClick,\n loadData,\n treeDataFormat,\n currentVal,\n onInput,\n };\n },\n render() {\n const slots: IData = {\n searchbar: () => {\n if (!this.c.enableQuickSearch) {\n return null;\n }\n return (\n <van-search\n modelValue={this.c.state.query}\n class={this.ns.b('quick-search')}\n clearable={true}\n placeholder={this.c.state.placeHolder}\n onUpdate:model-value={this.onInput}\n ></van-search>\n );\n },\n };\n const key = this.c.controlPanel ? 'tree' : 'default';\n slots[key] = () => {\n const content = [\n this.breadcrumb && (\n <div class={this.ns.be('header', 'container')}>\n <van-sticky>\n <div\n id={`breadcrumb${this.uuid}`}\n class={[\n this.ns.b('header'),\n this.ns.is('no-root', !this.c.model.rootVisible),\n ]}\n ></div>\n </van-sticky>\n </div>\n ),\n this.c.state.isCreated && this.c.state.isLoaded && (\n <vs-tree\n show-line\n ref='treeRef'\n key={this.treeRefreshKey}\n class={[this.ns.b('content')]}\n lazy={true}\n strictLeaf={true}\n options={this.options}\n show-checkbox={!this.c.state.singleSelect}\n showIcon={true}\n data={this.treeData}\n highlightCurrent={true}\n checkedKeys={this.checkedKeys}\n format={this.treeDataFormat}\n load={this.loadData}\n onCheck={this.onNodeCheck}\n ></vs-tree>\n ),\n ];\n return <div class={this.ns.b('container')}>{content}</div>;\n };\n return <iBizControlBase controller={this.c}>{slots}</iBizControlBase>;\n },\n});\n\nexport default TreeControl;\n"],"names":["_isSlot","s","_isVNode","TreeControl","defineComponent","components","VsTreeComponent","props","type","required","Object","default","setup","c","_a","_b","useControlController","args","TreeController","checkedKeys","useNamespace","computed","item","vueApps","ref","treeRefreshKey","createUUID","treeRef","uuid","iop","vueH","IBizIcon","customProps","vueApp","createApp","dom","toElNodes","nodes","createIconNode","node","mount","push","iconDom","map","result","nodeData","icon","findNodeData","key","controller","find","loadData","callback","treeData","state","onNodeCheck","event","opts","originData","selectedData","filterArr","onNodeClick","debug","loadNodes","handleExpandedLastKey","data","rootNodes","mobExpandedKey","value","_e","_i","breadcrumbList","_d","_c","_b2","_a2","breadcrumbListLast","_h","_g","_f","debounceSearch","treeDataFormat","setSelection","stopPropagation","_leaf","loadingEl","renderContent","h","handleSingleSelect","e","_opts","tree","customNodeClick","onInput","checked","on","evt","breadcrumb","options","content","textDom","ns","onUnmounted","className","click","setExpand","_createVNode","_resolveComponent","slots","maxHeight","checkInherit","nocheckParent","rootName","assign","link","document","innerText","appendChild","onclick","forEach","unmount","exports"],"mappings":"6iBA0BqB,SAAAA,EAAAC,EAAA,CAAA,OAAA,OAAAA,GAAA,YAAA,OAAA,UAAA,SAAA,KAAAA,CAAA,IAAA,mBAAA,CAAAC,EAAAD,CAAA,CAErB,CACyB,MAAAE,EAAAC,EAAA,CACvBC,KAAAA,kBACE,WAAWC,CACZ,UAAAA,CACDC,EACE,MAAA,CAGaC,UAAiC,CAAEC,KAAAA,OAAgB,SAAA,EAChE,EAGWD,QAAkC,CAAEC,KAAAA,OAAgB,SAAA,EAC/D,EAIUD,OAAME,CAA6BC,KAAAA,OAAqB,QAAA,KAAA,CAAA,EAClE,EAGYH,SAAME,CAAsC,KAAA,MACxD,EAIoBF,iBAAY,CAAEG,KAAAA,OAAY,QAAA,CAC9C,EAIgBH,aAAa,CAAEG,KAAAA,QAAe,QAAA,EAC9C,EAGgBH,aAAa,CAAEG,KAAAA,QAAmB,QAAA,MACnD,CACDC,EACE,OAAMC,CAGN,IAAAC,EAAQC,EACR,MAAAF,EAAAG,EAAA,IAAAC,IAAA,IAAAC,EAAA,GAAAD,CAAA,CAAA,EACME,EAAWC,EAAW,WAAOP,EAAA,MAAA,YAAA,aAAA,EAAA,EACjCM,EAA2BE,EAAA,IAC3BR,EAAA,MAAA,aAAA,IAAAS,GAAAA,EAAA,GAAA,GAEF,IAAAC,EAAA,CAAA,EACA,MAAIA,EAAmBC,IACvBC,EAAAD,EAAAE,EAAA,CAAA,EACMC,EAAaH,EAAE,EAAA,EACrBI,EAAAF,IACMD,IAAiBD,EAAIE,QAE3B,MAAAG,EAAAC,EAAAC,EAAAC,CAAA,EACgBC,EAAAC,EAAUL,CAAA,EAEhBM,EAAa,SAAA,cAAE,MAAA,oBAEzBZ,EAAA,KAAAU,CAAA,EACgBE,GAEhBC,EAAAC,GACMC,EAAAA,IAAcC,GAAIP,CACtB,QAAuCO,GAAA,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A,UAAAA,EAAAA,EAAAA,SAAAA,EAAAA,CACD,YAAA,GAEGK,IAAAA,UACFvF,IAAOuG,KAAOf,eACZD,MAAAA,CAAU,KAAE,GAAA,EAAA,SAAA,CAAA,OACQrE,GAClBsF,WAAkB,GAChB,qBACA,gBAAa,CAAGC,KAAAA,EAAAA,MAAsB,aACtCf,SAAQgB,GACR,KAAInD,KAAKnB,0BACY,GACrB,YAAA,KAAA,YACAqD,OAAAA,KAAQkB,oBACD,cAIPlB,QAAO,KAACmB,WACR,EAAA,IAAA,CAAA,EACF,OAAAZ,EAAA,MAAA,CACF,MAAA,KAAA,GAAA,EAAA,WAAA,CACF,EAAE,CAAAP,CAAA,CAAA,CACJ,EAEAG,EAAkBK,EAAA,iBAAA,EAAA,CAChB,WAAA,KAAA,CACApF,EAAAA,EAAQgG,CAAAA,EAAStF,EAAgB,SACxBuF,IAAO,CAAAZ,CAAE,CAClB,CAAA,CACArF,CACF,CAAA,EAAAkG,EAAA,CAAA,YAAAtH,EAAA,QAAAA,CAAA,CAAA"}
@@ -0,0 +1 @@
1
+ .ibiz-action-group__separator{width:100%;height:.0625rem;display:inline-block;vertical-align:middle;background-color:var(--ibiz-color-border)}.ibiz-action-group__button .van-button__text{display:flex;align-items:center;gap:var(--ibiz-spacing-extra-tight)}.ibiz-action-group .van-popover__content{display:flex;flex-direction:column}.ibiz-action-group .van-popover__content .van-button{padding:0;font-size:var(--van-popover-action-font-size);line-height:var(--van-line-height-md);width:var(--van-popover-action-width);height:var(--van-popover-action-height);border-color:var(--ibiz-color-white)}.ibiz-action-group .van-popover__content .van-button:before{border-color:var(--ibiz-color-white)}.ibiz-action-group .van-popover__content .van-button .van-button__text{display:flex;align-items:center;gap:var(--ibiz-spacing-extra-tight)}
@@ -0,0 +1,55 @@
1
+ import { PropType } from 'vue';
2
+ import { IButtonContainerState } from '@ibiz-template/runtime';
3
+ import { IAppDEUIActionGroupDetail } from '@ibiz/model-core';
4
+ import './action-group.scss';
5
+ export declare const IBizActionGroup: import("vue").DefineComponent<{
6
+ actionDetail: {
7
+ type: PropType<IAppDEUIActionGroupDetail>;
8
+ required: true;
9
+ };
10
+ actionsState: {
11
+ type: PropType<IButtonContainerState>;
12
+ required: true;
13
+ };
14
+ popoverClassName: {
15
+ type: StringConstructor;
16
+ };
17
+ direction: {
18
+ type: PropType<"vertical" | "horizontal">;
19
+ default: string;
20
+ };
21
+ }, {
22
+ ns: import("@ibiz-template/core").Namespace;
23
+ visible: import("vue").ComputedRef<boolean>;
24
+ caption: import("vue").ComputedRef<string | undefined>;
25
+ buttonRef: import("vue").Ref<any>;
26
+ placement: import("vue").ComputedRef<"bottom" | "right" | "top-end" | "top-start" | "bottom-end" | "bottom-start" | "left-end" | "right-end" | "left-start" | "right-start">;
27
+ showPopover: import("vue").Ref<boolean>;
28
+ childPopover: import("vue").Ref<boolean>;
29
+ renderActions: () => ((import("vue/jsx-runtime").JSX.Element | undefined)[] | null)[];
30
+ onPopoverVisibleChange: (visible: boolean) => void;
31
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ actionClick: (detail: IAppDEUIActionGroupDetail, event: MouseEvent) => true;
33
+ popoverVisibleChange: (visible: boolean) => true;
34
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
35
+ actionDetail: {
36
+ type: PropType<IAppDEUIActionGroupDetail>;
37
+ required: true;
38
+ };
39
+ actionsState: {
40
+ type: PropType<IButtonContainerState>;
41
+ required: true;
42
+ };
43
+ popoverClassName: {
44
+ type: StringConstructor;
45
+ };
46
+ direction: {
47
+ type: PropType<"vertical" | "horizontal">;
48
+ default: string;
49
+ };
50
+ }>> & {
51
+ onActionClick?: ((detail: IAppDEUIActionGroupDetail, event: MouseEvent) => any) | undefined;
52
+ onPopoverVisibleChange?: ((visible: boolean) => any) | undefined;
53
+ }, {
54
+ direction: "vertical" | "horizontal";
55
+ }, {}>;
@@ -0,0 +1,174 @@
1
+ import { ref, computed, createVNode, resolveComponent, defineComponent } from 'vue';
2
+ import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import '../../util/index.mjs';
4
+ import './action-group.css';
5
+ import { convertBtnType } from '../../util/button-util/button-util.mjs';
6
+
7
+ "use strict";
8
+ const IBizActionGroup = /* @__PURE__ */ defineComponent({
9
+ name: "IBizActionGroup",
10
+ props: {
11
+ actionDetail: {
12
+ type: Object,
13
+ required: true
14
+ },
15
+ actionsState: {
16
+ type: Object,
17
+ required: true
18
+ },
19
+ popoverClassName: {
20
+ type: String
21
+ },
22
+ direction: {
23
+ type: String,
24
+ default: "horizontal"
25
+ }
26
+ },
27
+ emits: {
28
+ actionClick: (detail, event) => true,
29
+ popoverVisibleChange: (visible) => true
30
+ },
31
+ setup(props, {
32
+ emit
33
+ }) {
34
+ const ns = useNamespace("action-group");
35
+ const showPopover = ref(false);
36
+ const buttonRef = ref();
37
+ const childPopover = ref(false);
38
+ const details = computed(() => {
39
+ if (props.actionDetail.detailType === "DEUIACTIONGROUP" && props.actionDetail.refUIActionGroup)
40
+ return props.actionDetail.refUIActionGroup.uiactionGroupDetails || [];
41
+ return [];
42
+ });
43
+ const visible = computed(() => {
44
+ const visible2 = details.value.some((item) => {
45
+ var _a, _b;
46
+ return (_b = (_a = props.actionsState) == null ? void 0 : _a[item.id]) == null ? void 0 : _b.visible;
47
+ });
48
+ return visible2;
49
+ });
50
+ const caption = computed(() => {
51
+ var _a, _b;
52
+ return ((_a = props.actionDetail.refUIActionGroup) == null ? void 0 : _a.name) || ((_b = props.actionDetail.refUIActionGroup) == null ? void 0 : _b.id);
53
+ });
54
+ const placement = computed(() => {
55
+ if (!buttonRef.value)
56
+ return props.direction === "horizontal" ? "right" : "bottom";
57
+ const {
58
+ innerWidth,
59
+ innerHeight
60
+ } = window;
61
+ const {
62
+ offsetLeft: x,
63
+ offsetTop: y,
64
+ offsetWidth: width
65
+ } = buttonRef.value.$el;
66
+ const centerX = innerWidth - width - 128;
67
+ const centerY = details.value.length ? innerHeight - details.value.length * 44 : innerHeight / 2;
68
+ if (y > centerY) {
69
+ if (props.direction === "horizontal")
70
+ return x > centerX ? "left-end" : "right-end";
71
+ return x > centerX ? "top-end" : "top-start";
72
+ }
73
+ if (props.direction === "horizontal")
74
+ return x > centerX ? "left-start" : "right-start";
75
+ return x > centerX ? "bottom-end" : "bottom-start";
76
+ });
77
+ const handleClick = async (detail, event, closePopover = false) => {
78
+ if (closePopover)
79
+ showPopover.value = false;
80
+ emit("actionClick", detail, event);
81
+ };
82
+ const onPopoverVisibleChange = (visible2) => {
83
+ emit("popoverVisibleChange", visible2);
84
+ };
85
+ const renderSeparator = (visible2) => {
86
+ if (visible2)
87
+ return createVNode("div", {
88
+ "class": ns.e("separator")
89
+ }, null);
90
+ };
91
+ const renderActions = () => {
92
+ var _a;
93
+ return (_a = details.value) == null ? void 0 : _a.map((detail) => {
94
+ var _a2, _b, _c;
95
+ if (detail.detailType === "DEUIACTIONGROUP")
96
+ return [renderSeparator(detail.addSeparator), createVNode(resolveComponent("iBizActionGroup"), {
97
+ "actionDetail": detail,
98
+ "onActionClick": handleClick,
99
+ "actionsState": props.actionsState,
100
+ "popoverClassName": props.popoverClassName,
101
+ "onPopoverVisibleChange": (visible2) => childPopover.value = visible2
102
+ }, null)];
103
+ if ((_b = (_a2 = props.actionsState) == null ? void 0 : _a2[detail.id]) == null ? void 0 : _b.visible)
104
+ return [renderSeparator(detail.addSeparator), createVNode(resolveComponent("van-button"), {
105
+ "size": "small",
106
+ "type": convertBtnType(detail.buttonStyle),
107
+ "text": detail.showCaption ? detail.caption : "",
108
+ "onClick": (e) => handleClick(detail, e, true),
109
+ "disabled": props.actionsState[detail.id].disabled,
110
+ "class": [ns.e("item"), (_c = detail.sysCss) == null ? void 0 : _c.codeName]
111
+ }, {
112
+ icon: () => {
113
+ return detail.showIcon && detail.sysImage && createVNode(resolveComponent("iBizIcon"), {
114
+ "icon": detail.sysImage
115
+ }, null);
116
+ }
117
+ })];
118
+ return null;
119
+ });
120
+ };
121
+ return {
122
+ ns,
123
+ visible,
124
+ caption,
125
+ buttonRef,
126
+ placement,
127
+ showPopover,
128
+ childPopover,
129
+ renderActions,
130
+ onPopoverVisibleChange
131
+ };
132
+ },
133
+ render() {
134
+ if (this.visible)
135
+ return createVNode(resolveComponent("van-popover"), {
136
+ "placement": this.placement,
137
+ "show": this.showPopover,
138
+ "onUpdate:show": ($event) => this.showPopover = $event,
139
+ "close-on-click-outside": !this.childPopover,
140
+ "class": [this.ns.b(), this.popoverClassName],
141
+ "onOpen": () => this.onPopoverVisibleChange(true),
142
+ "onClose": () => this.onPopoverVisibleChange(false)
143
+ }, {
144
+ reference: () => {
145
+ return createVNode(resolveComponent("van-button"), {
146
+ "size": "small",
147
+ "ref": "buttonRef",
148
+ "class": this.ns.e("button"),
149
+ "type": convertBtnType(this.actionDetail.buttonStyle)
150
+ }, {
151
+ icon: () => {
152
+ return this.actionDetail.showIcon && this.actionDetail.sysImage && createVNode(resolveComponent("iBizIcon"), {
153
+ "icon": this.actionDetail.sysImage
154
+ }, null);
155
+ },
156
+ default: () => {
157
+ return [createVNode("div", {
158
+ "class": this.ns.em("button", "text")
159
+ }, [this.actionDetail.showCaption ? this.caption : ""]), createVNode("ion-icon", {
160
+ "class": this.ns.em("button", "icon"),
161
+ "name": this.direction === "horizontal" ? "chevron-forward-outline" : "chevron-down-outline"
162
+ }, null)];
163
+ }
164
+ });
165
+ },
166
+ default: () => {
167
+ return this.renderActions();
168
+ }
169
+ });
170
+ return void 0;
171
+ }
172
+ });
173
+
174
+ export { IBizActionGroup };
@@ -32,6 +32,7 @@ export declare const IBizActionToolbar: import("vue").DefineComponent<{
32
32
  }, {
33
33
  ns: import("@ibiz-template/core").Namespace;
34
34
  handleClick: (detail: IAppDEUIActionGroupDetail, event: MouseEvent) => Promise<void>;
35
+ renderSeparator: () => import("vue/jsx-runtime").JSX.Element;
35
36
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
37
  actionDetails: {
37
38
  type: {
@@ -30,27 +30,40 @@ const IBizActionToolbar = /* @__PURE__ */ defineComponent({
30
30
  event.stopPropagation();
31
31
  emit("action-click", detail, event);
32
32
  };
33
+ const renderSeparator = () => {
34
+ return createVNode("div", {
35
+ "class": ns.e("separator")
36
+ }, null);
37
+ };
33
38
  return {
34
39
  ns,
35
- handleClick
40
+ handleClick,
41
+ renderSeparator
36
42
  };
37
43
  },
38
44
  render() {
39
45
  const details = this.actionDetails || [];
40
- if (this.mode === "buttons") {
46
+ if (this.mode === "buttons")
41
47
  return createVNode("div", {
42
48
  "class": [this.ns.b(), this.ns.m("buttons")]
43
49
  }, [details.length > 0 && details.map((detail) => {
44
- if (this.actionsState[detail.id].visible) {
45
- return [detail.addSeparator && createVNode("div", {
46
- "class": this.ns.e("separator")
47
- }, null), createVNode(resolveComponent("van-button"), {
50
+ var _a, _b, _c;
51
+ if (detail.detailType === "DEUIACTIONGROUP")
52
+ return [detail.addSeparator && this.renderSeparator(), createVNode(resolveComponent("iBizActionGroup"), {
53
+ "direction": "vertical",
54
+ "actionDetail": detail,
55
+ "actionsState": this.actionsState,
56
+ "onActionClick": this.handleClick,
57
+ "popoverClassName": this.ns.b("action-group")
58
+ }, null)];
59
+ if ((_b = (_a = this.actionsState) == null ? void 0 : _a[detail.id]) == null ? void 0 : _b.visible) {
60
+ return [detail.addSeparator && this.renderSeparator(), createVNode(resolveComponent("van-button"), {
48
61
  "size": "small",
49
62
  "text": detail.showCaption ? detail.caption : "",
50
63
  "type": convertBtnType(detail.buttonStyle),
51
64
  "onClick": (e) => this.handleClick(detail, e),
52
65
  "disabled": this.actionsState[detail.id].disabled,
53
- "class": [this.ns.e("item"), this.ns.is("disabled", false)]
66
+ "class": [this.ns.e("item"), this.ns.is("disabled", false), (_c = detail.sysCss) == null ? void 0 : _c.codeName]
54
67
  }, {
55
68
  icon: () => {
56
69
  return detail.showIcon && detail.sysImage && createVNode(resolveComponent("iBizIcon"), {
@@ -61,7 +74,6 @@ const IBizActionToolbar = /* @__PURE__ */ defineComponent({
61
74
  }
62
75
  return null;
63
76
  })]);
64
- }
65
77
  return createVNode("div", null, [ibiz.i18n.t("component.actionToolbar.noSupportDropDown")]);
66
78
  }
67
79
  });
@@ -1 +1 @@
1
- .ibiz-button-list{width:100%;height:100%}.ibiz-button-list .van-button{border:none}.ibiz-button-list .van-button .van-button__text{display:flex;align-items:center;gap:var(--ibiz-spacing-extra-tight)}.ibiz-button-list .van-button .van-button__text .ibiz-icon{display:flex;align-items:center;justify-content:center;width:var(--ibiz-width-icon-medium);height:var(--ibiz-width-icon-medium);font-size:var(--ibiz-width-icon-medium)}.ibiz-button-list__content{display:flex;flex-wrap:wrap;gap:var(--ibiz-spacing-extra-tight)}.ibiz-button-list__popover{--ibiz-color-bg-0:var(--van-popover-light-text-color)}.ibiz-button-list__popover .van-popover__action--disabled,.ibiz-button-list__popover .van-popover__action--disabled:active{color:var(--ibiz-color-disabled-text)!important;background-color:var(--ibiz-color-disabled-bg)}.ibiz-button-list__popover--item{display:flex;align-items:center;gap:var(--ibiz-spacing-extra-tight)}.ibiz-button-list__popover--item .ibiz-icon{display:flex;align-items:center;justify-content:center;width:var(--ibiz-width-icon-medium);height:var(--ibiz-width-icon-medium);font-size:var(--ibiz-width-icon-medium)}.ibiz-button-list__popover--caption{display:flex;line-height:100%;align-items:center;gap:var(--ibiz-spacing-extra-tight)}
1
+ .ibiz-button-list{width:100%;height:100%}.ibiz-button-list .van-button{border:none}.ibiz-button-list .van-button .van-button__text{display:flex;align-items:center;gap:var(--ibiz-spacing-extra-tight)}.ibiz-button-list .van-button .van-button__text .ibiz-icon{display:flex;align-items:center;justify-content:center;width:var(--ibiz-width-icon-medium);height:var(--ibiz-width-icon-medium);font-size:var(--ibiz-width-icon-medium)}.ibiz-button-list__content{display:flex;flex-wrap:wrap;gap:var(--ibiz-spacing-extra-tight)}.ibiz-button-list__button--caption{display:flex;line-height:100%;align-items:center;gap:var(--ibiz-spacing-extra-tight)}.ibiz-button-list__popover{--ibiz-color-bg-0:var(--van-popover-light-text-color)}.ibiz-button-list__popover .van-popover__action--disabled,.ibiz-button-list__popover .van-popover__action--disabled:active{color:var(--ibiz-color-disabled-text)!important;background-color:var(--ibiz-color-disabled-bg)}.ibiz-button-list__popover .van-popover__content{display:flex;flex-direction:column}.ibiz-button-list__popover .van-popover__content .van-button{padding:0;font-size:var(--van-popover-action-font-size);line-height:var(--van-line-height-md);width:var(--van-popover-action-width);height:var(--van-popover-action-height);border-color:var(--ibiz-color-white)}.ibiz-button-list__popover .van-popover__content .van-button:before{border-color:var(--ibiz-color-white)}.ibiz-button-list__popover .van-popover__content .van-button .van-button__text{display:flex;align-items:center;gap:var(--ibiz-spacing-extra-tight)}
@@ -1,4 +1,4 @@
1
- import { PropType } from 'vue';
1
+ import { PropType, Ref } from 'vue';
2
2
  import { JSX } from 'vue/jsx-runtime';
3
3
  import { IPanelButtonList, IDEFormButtonList } from '@ibiz/model-core';
4
4
  import { IButtonContainerState } from '@ibiz-template/runtime';
@@ -21,8 +21,9 @@ export declare const IBizButtonList: import("vue").DefineComponent<{
21
21
  };
22
22
  }, {
23
23
  ns: import("@ibiz-template/core").Namespace;
24
+ buttonRef: Ref<any>;
24
25
  renderDropdown: () => JSX.Element;
25
- renderActions: () => JSX.Element;
26
+ renderActions: (direction: 'horizontal' | 'vertical') => ((JSX.Element | undefined)[] | null)[];
26
27
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
28
  click: (_id: string, _e?: MouseEvent) => true;
28
29
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1,4 +1,4 @@
1
- import { ref, computed, resolveComponent, createVNode, defineComponent } from 'vue';
1
+ import { ref, computed, createVNode, resolveComponent, defineComponent } from 'vue';
2
2
  import { useNamespace } from '@ibiz-template/vue3-util';
3
3
  import '../../util/index.mjs';
4
4
  import './button-list.css';
@@ -29,6 +29,36 @@ const IBizButtonList = /* @__PURE__ */ defineComponent({
29
29
  }) {
30
30
  const ns = useNamespace("button-list");
31
31
  const showPopover = ref(false);
32
+ const buttonRef = ref();
33
+ const childPopover = ref(false);
34
+ const details = computed(() => {
35
+ const {
36
+ buttonListType,
37
+ uiactionGroup
38
+ } = props.model;
39
+ if (buttonListType === "UIACTIONGROUP")
40
+ return (uiactionGroup == null ? void 0 : uiactionGroup.uiactionGroupDetails) || [];
41
+ return props.model.panelButtons || props.model.deformButtons || [];
42
+ });
43
+ const placement = computed(() => {
44
+ if (!buttonRef.value)
45
+ return "bottom";
46
+ const {
47
+ innerWidth,
48
+ innerHeight
49
+ } = window;
50
+ const {
51
+ offsetLeft: x,
52
+ offsetTop: y,
53
+ offsetWidth: width
54
+ } = buttonRef.value.$el;
55
+ const centerX = innerWidth - width - 128;
56
+ const centerY = details.value.length ? innerHeight - details.value.length * 44 : innerHeight / 2;
57
+ if (y > centerY) {
58
+ return x > centerX ? "top-end" : "top-start";
59
+ }
60
+ return x > centerX ? "bottom-end" : "bottom-start";
61
+ });
32
62
  const buttonListStyle = computed(() => {
33
63
  const {
34
64
  itemStyle,
@@ -37,102 +67,90 @@ const IBizButtonList = /* @__PURE__ */ defineComponent({
37
67
  return itemStyle || detailStyle || "DEFAULT";
38
68
  });
39
69
  const handleClick = (item, e) => {
70
+ e == null ? void 0 : e.stopPropagation();
40
71
  emit("click", item.id, e);
41
72
  };
42
73
  const onChangePopover = (e) => {
43
74
  e.stopPropagation();
44
75
  showPopover.value = !showPopover.value;
45
76
  };
46
- const details = computed(() => {
47
- const {
48
- buttonListType,
49
- uiactionGroup
50
- } = props.model;
51
- if (buttonListType === "UIACTIONGROUP")
52
- return (uiactionGroup == null ? void 0 : uiactionGroup.uiactionGroupDetails) || [];
53
- return props.model.panelButtons || props.model.deformButtons || [];
54
- });
55
- const actions = computed(() => {
56
- return details.value.filter((detail) => {
57
- var _a;
58
- return ((_a = props.buttonsState[detail.id]) == null ? void 0 : _a.visible) !== false;
59
- }).map((detail) => {
60
- var _a, _b;
61
- return {
62
- ...detail,
63
- disabled: (_a = props.buttonsState[detail.id]) == null ? void 0 : _a.disabled,
64
- className: (_b = detail.sysCss) == null ? void 0 : _b.cssName
65
- };
66
- });
67
- });
68
- const renderActions = () => {
69
- return createVNode("div", {
70
- "class": ns.e("content")
71
- }, [details.value.map((item) => {
77
+ const renderSeparator = (visible) => {
78
+ if (visible)
79
+ return createVNode("div", {
80
+ "class": ns.e("separator")
81
+ }, null);
82
+ };
83
+ const renderActions = (direction) => {
84
+ const showSeparator = direction === "vertical";
85
+ return details.value.map((item) => {
72
86
  var _a, _b, _c, _d;
73
- if (((_a = props.buttonsState[item.id]) == null ? void 0 : _a.visible) === false)
74
- return;
75
- return createVNode(resolveComponent("van-button"), {
76
- "class": [ns.e("item"), ns.em("item", `${(_b = item.id) == null ? void 0 : _b.toLowerCase()}`), (_c = item.sysCss) == null ? void 0 : _c.cssName],
77
- "size": "small",
78
- "type": convertBtnType(item.buttonStyle),
79
- "disabled": ((_d = props.buttonsState[item.id]) == null ? void 0 : _d.disabled) || props.disabled,
80
- "onClick": (event) => handleClick(item, event)
81
- }, {
82
- default: () => [item.showIcon !== false && createVNode(resolveComponent("iBizIcon"), {
83
- "icon": item.sysImage,
84
- "class": ns.em("item", "icon")
85
- }, null), item.showCaption && createVNode("span", {
86
- "class": ns.em("item", "caption")
87
- }, [item.caption])]
88
- });
89
- })]);
87
+ if (item.detailType === "DEUIACTIONGROUP")
88
+ return [renderSeparator(item.addSeparator && showSeparator), createVNode(resolveComponent("iBizActionGroup"), {
89
+ "actionDetail": item,
90
+ "onActionClick": handleClick,
91
+ "actionsState": props.buttonsState,
92
+ "popoverClassName": ns.b("action-group"),
93
+ "onPopoverVisibleChange": (visible) => childPopover.value = visible,
94
+ "direction": direction === "horizontal" ? "vertical" : "horizontal"
95
+ }, null)];
96
+ if ((_a = props.buttonsState[item.id]) == null ? void 0 : _a.visible)
97
+ return [renderSeparator(item.addSeparator && showSeparator), createVNode(resolveComponent("van-button"), {
98
+ "size": "small",
99
+ "class": [ns.e("item"), ns.em("item", `${(_b = item.id) == null ? void 0 : _b.toLowerCase()}`), (_c = item.sysCss) == null ? void 0 : _c.cssName],
100
+ "type": convertBtnType(item.buttonStyle),
101
+ "disabled": ((_d = props.buttonsState[item.id]) == null ? void 0 : _d.disabled) || props.disabled,
102
+ "onClick": (event) => handleClick(item, event)
103
+ }, {
104
+ default: () => [item.showIcon !== false && createVNode(resolveComponent("iBizIcon"), {
105
+ "icon": item.sysImage,
106
+ "class": ns.em("item", "icon")
107
+ }, null), item.showCaption && createVNode("span", {
108
+ "class": ns.em("item", "caption")
109
+ }, [item.caption])]
110
+ })];
111
+ return null;
112
+ });
90
113
  };
91
114
  const renderDropdown = () => {
92
115
  return createVNode(resolveComponent("van-popover"), {
93
116
  "class": ns.e("popover"),
94
- "placement": "bottom-end",
95
- "actions": actions.value,
117
+ "placement": placement.value,
96
118
  "show": showPopover.value,
97
119
  "onUpdate:show": ($event) => showPopover.value = $event,
98
- "onSelect": (data) => handleClick(data)
120
+ "close-on-click-outside": !childPopover.value
99
121
  }, {
100
- action: ({
101
- action
102
- }) => {
103
- return createVNode("span", {
104
- "class": ns.em("popover", "item")
105
- }, [action.showIcon !== false && action.sysImage && createVNode(resolveComponent("iBizIcon"), {
106
- "icon": action.sysImage
107
- }, null), action.showCaption && action.caption]);
108
- },
109
122
  reference: () => {
110
123
  const {
111
124
  caption,
112
- sysImage,
113
- showCaption
125
+ sysImage
114
126
  } = props.model;
115
127
  return createVNode(resolveComponent("van-button"), {
116
128
  "size": "small",
129
+ "ref": "buttonRef",
130
+ "class": ns.e("button"),
117
131
  "disabled": props.disabled,
118
132
  "onClick": onChangePopover,
119
133
  "type": convertBtnType(buttonListStyle.value)
120
134
  }, {
121
135
  default: () => [sysImage && createVNode(resolveComponent("iBizIcon"), {
122
- "class": ns.em("popover", "icon"),
136
+ "class": ns.em("button", "icon"),
123
137
  "icon": sysImage
124
- }, null), showCaption && createVNode("span", {
125
- "class": ns.em("popover", "caption")
138
+ }, null), caption && createVNode("span", {
139
+ "class": ns.em("button", "caption")
126
140
  }, [caption, createVNode("ion-icon", {
127
141
  "name": "chevron-down-outline",
128
- "class": ns.em("popover", "more")
142
+ "class": ns.em("button", "more")
129
143
  }, null)])]
130
144
  });
145
+ },
146
+ default: () => {
147
+ return renderActions("vertical");
131
148
  }
132
149
  });
133
150
  };
134
151
  return {
135
152
  ns,
153
+ buttonRef,
136
154
  renderDropdown,
137
155
  renderActions
138
156
  };
@@ -142,7 +160,9 @@ const IBizButtonList = /* @__PURE__ */ defineComponent({
142
160
  return createVNode("div", {
143
161
  "class": [this.ns.b(), this.ns.m(this.model.id), this.ns.m((_a = this.model.actionGroupExtractMode) == null ? void 0 : _a.toLowerCase())],
144
162
  "style": this.model.cssStyle
145
- }, [this.model.actionGroupExtractMode === "ITEM" || this.model.buttonListType === "BUTTONS" ? this.renderActions() : this.renderDropdown()]);
163
+ }, [this.model.actionGroupExtractMode === "ITEM" || this.model.buttonListType === "BUTTONS" ? createVNode("div", {
164
+ "class": this.ns.e("content")
165
+ }, [this.renderActions("horizontal")]) : this.renderDropdown()]);
146
166
  }
147
167
  });
148
168
 
@@ -16,10 +16,12 @@ import { IBizMdCtrlSetting } from './md-ctrl-setting/md-ctrl-setting.mjs';
16
16
  import { IBizPreviewImage } from './preview-image/preview-image.mjs';
17
17
  import { IBizDateRangeCalendar } from './date-range-picker/date-range-picker.mjs';
18
18
  import { IBizCropping } from './cropping/cropping.mjs';
19
+ import { IBizActionGroup } from './action-group/action-group.mjs';
19
20
 
20
21
  "use strict";
21
22
  const IBizCommonComponents = {
22
23
  install: (v) => {
24
+ v.component(IBizActionGroup.name, IBizActionGroup);
23
25
  v.component(IBizDateRangeCalendar.name, IBizDateRangeCalendar);
24
26
  v.component(IBizViewShell.name, IBizViewShell);
25
27
  v.component(IBizRow.name, IBizRow);
@@ -85,7 +85,7 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
85
85
  }
86
86
  }
87
87
  }
88
- if (["TEXT", "HEADING1", "HEADING2", "HEADING3", "HEADING4", "HEADING5", "HEADING6", "PARAGRAPH", "HTML"].includes(rawItemType.value)) {
88
+ if (["TEXT", "HEADING1", "HEADING2", "HEADING3", "HEADING4", "HEADING5", "HEADING6", "PARAGRAPH", "HTML", "RAW"].includes(rawItemType.value)) {
89
89
  rawItemText.value = rawItemContent.value;
90
90
  if (typeof rawItemText.value === "string") {
91
91
  rawItemText.value = rawItemText.value.replaceAll("&lt;", "<");
@@ -161,7 +161,7 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
161
161
  "icon": this.rawItemContent
162
162
  }, null);
163
163
  }
164
- if (this.rawItemType === "TEXT") {
164
+ if (this.rawItemType === "TEXT" || this.rawItemType === "RAW") {
165
165
  return createVNode("span", {
166
166
  "class": this.ns.e("text")
167
167
  }, [this.rawItemText]);