@farris/ui-vue 1.6.5-beta.8 → 1.6.6

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 (137) hide show
  1. package/components/avatar/index.esm.js +335 -335
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/button-edit/index.esm.js +6 -6
  4. package/components/button-edit/index.umd.cjs +1 -1
  5. package/components/combo-list/index.esm.js +139 -134
  6. package/components/combo-list/index.umd.cjs +1 -1
  7. package/components/common/index.esm.js +1 -1
  8. package/components/common/index.umd.cjs +1 -1
  9. package/components/component/index.esm.js +300 -300
  10. package/components/component/index.umd.cjs +1 -1
  11. package/components/condition/index.esm.js +7 -6
  12. package/components/condition/index.umd.cjs +1 -1
  13. package/components/content-container/index.esm.js +295 -295
  14. package/components/content-container/index.umd.cjs +1 -1
  15. package/components/data-grid/index.esm.js +99 -99
  16. package/components/data-grid/index.umd.cjs +1 -1
  17. package/components/data-view/index.esm.js +3407 -3338
  18. package/components/data-view/index.umd.cjs +1 -1
  19. package/components/date-picker/index.esm.js +833 -832
  20. package/components/date-picker/index.umd.cjs +1 -1
  21. package/components/designer-canvas/index.esm.js +5 -5
  22. package/components/designer-canvas/index.umd.cjs +1 -1
  23. package/components/dynamic-form/index.esm.js +173 -172
  24. package/components/dynamic-form/index.umd.cjs +1 -1
  25. package/components/events-editor/index.esm.js +637 -637
  26. package/components/events-editor/index.umd.cjs +3 -3
  27. package/components/expression-editor/index.esm.js +737 -732
  28. package/components/expression-editor/index.umd.cjs +4 -4
  29. package/components/filter-bar/index.esm.js +728 -706
  30. package/components/filter-bar/index.umd.cjs +1 -1
  31. package/components/filter-condition-editor/index.esm.js +670 -665
  32. package/components/filter-condition-editor/index.umd.cjs +2 -2
  33. package/components/flow-canvas/index.esm.js +205 -205
  34. package/components/flow-canvas/index.umd.cjs +1 -1
  35. package/components/language-textbox/index.esm.js +77 -76
  36. package/components/language-textbox/index.umd.cjs +1 -1
  37. package/components/list-nav/index.esm.js +4 -2
  38. package/components/list-nav/index.umd.cjs +1 -1
  39. package/components/list-view/index.esm.js +42 -40
  40. package/components/list-view/index.umd.cjs +2 -2
  41. package/components/lookup/index.esm.js +118 -118
  42. package/components/lookup/index.umd.cjs +1 -1
  43. package/components/mapping-editor/index.esm.js +482 -483
  44. package/components/mapping-editor/index.umd.cjs +1 -1
  45. package/components/message-box/index.esm.js +424 -424
  46. package/components/message-box/index.umd.cjs +1 -1
  47. package/components/modal/index.esm.js +276 -276
  48. package/components/modal/index.umd.cjs +1 -1
  49. package/components/number-range/index.esm.js +161 -161
  50. package/components/number-range/index.umd.cjs +1 -1
  51. package/components/number-spinner/index.esm.js +322 -316
  52. package/components/number-spinner/index.umd.cjs +1 -1
  53. package/components/order/index.esm.js +541 -534
  54. package/components/order/index.umd.cjs +2 -2
  55. package/components/page-header/index.esm.js +1 -1
  56. package/components/page-header/index.umd.cjs +1 -1
  57. package/components/popover/index.esm.js +58 -56
  58. package/components/popover/index.umd.cjs +1 -1
  59. package/components/property-panel/index.esm.js +216 -216
  60. package/components/property-panel/index.umd.cjs +2 -2
  61. package/components/query-solution/index.esm.js +489 -467
  62. package/components/query-solution/index.umd.cjs +3 -3
  63. package/components/radio-group/index.esm.js +30 -30
  64. package/components/radio-group/index.umd.cjs +1 -1
  65. package/components/response-layout/index.esm.js +282 -282
  66. package/components/response-layout/index.umd.cjs +1 -1
  67. package/components/response-layout-editor/index.esm.js +875 -873
  68. package/components/response-layout-editor/index.umd.cjs +1 -1
  69. package/components/response-toolbar/index.esm.js +1 -1
  70. package/components/response-toolbar/index.umd.cjs +1 -1
  71. package/components/schema-selector/index.esm.js +504 -496
  72. package/components/schema-selector/index.umd.cjs +6 -6
  73. package/components/search-box/index.esm.js +76 -72
  74. package/components/search-box/index.umd.cjs +1 -1
  75. package/components/section/index.esm.js +212 -212
  76. package/components/section/index.umd.cjs +1 -1
  77. package/components/sort-condition-editor/index.esm.js +382 -377
  78. package/components/sort-condition-editor/index.umd.cjs +2 -2
  79. package/components/tabs/index.esm.js +584 -582
  80. package/components/tabs/index.umd.cjs +2 -2
  81. package/components/textarea/index.esm.js +362 -362
  82. package/components/textarea/index.umd.cjs +2 -2
  83. package/components/time-picker/index.css +1 -0
  84. package/components/time-picker/index.esm.js +9799 -0
  85. package/components/time-picker/index.umd.cjs +1 -0
  86. package/components/time-picker/package.json +8 -0
  87. package/components/time-picker/style.js +6 -0
  88. package/components/transfer/index.esm.js +81 -79
  89. package/components/transfer/index.umd.cjs +2 -2
  90. package/components/tree-grid/index.esm.js +100 -100
  91. package/components/tree-grid/index.umd.cjs +1 -1
  92. package/components/tree-view/index.esm.js +2361 -2279
  93. package/components/tree-view/index.umd.cjs +1 -1
  94. package/components/video/index.esm.js +220 -220
  95. package/components/video/index.umd.cjs +1 -1
  96. package/designer/button-edit/index.css +1 -0
  97. package/designer/button-edit/index.esm.js +4856 -0
  98. package/designer/button-edit/index.umd.cjs +1 -0
  99. package/designer/checkbox/index.esm.js +254 -0
  100. package/designer/checkbox/index.umd.cjs +1 -0
  101. package/designer/checkbox-group/index.esm.js +381 -0
  102. package/designer/checkbox-group/index.umd.cjs +1 -0
  103. package/designer/data-grid/index.css +1 -0
  104. package/designer/data-grid/index.esm.js +15445 -0
  105. package/designer/data-grid/index.umd.cjs +23 -0
  106. package/designer/data-view/index.esm.js +854 -0
  107. package/designer/data-view/index.umd.cjs +38 -0
  108. package/designer/drawer/index.css +1 -0
  109. package/designer/drawer/index.esm.js +525 -0
  110. package/designer/drawer/index.umd.cjs +1 -0
  111. package/designer/farris-designer.all.esm.js +22331 -0
  112. package/designer/farris-designer.all.umd.cjs +34 -0
  113. package/designer/index.css +1 -0
  114. package/designer/input-group/index.esm.js +1099 -0
  115. package/designer/input-group/index.umd.cjs +1 -0
  116. package/designer/list-view/index.css +1 -0
  117. package/designer/list-view/index.esm.js +4685 -0
  118. package/designer/list-view/index.umd.cjs +40 -0
  119. package/designer/radio-group/index.css +1 -0
  120. package/designer/radio-group/index.esm.js +6989 -0
  121. package/designer/radio-group/index.umd.cjs +1 -0
  122. package/designer/tree-grid/index.esm.js +1099 -0
  123. package/designer/tree-grid/index.umd.cjs +1 -0
  124. package/farris.all.esm.js +13299 -13177
  125. package/farris.all.umd.cjs +25 -25
  126. package/locales/data-grid/ui/en.json +4 -3
  127. package/locales/data-grid/ui/zh-CHS.json +2 -1
  128. package/locales/data-grid/ui/zh-CHT.json +2 -1
  129. package/locales/designer/en.json +9 -7
  130. package/locales/designer/zh-CHS.json +4 -2
  131. package/locales/designer/zh-CHT.json +4 -2
  132. package/locales/ui/en.json +9 -7
  133. package/locales/ui/zh-CHS.json +4 -2
  134. package/locales/ui/zh-CHT.json +4 -2
  135. package/package.json +1 -1
  136. package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
  137. package/types/data-view/composition/types.d.ts +10 -4
@@ -0,0 +1,38 @@
1
+ (function(m,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(m=typeof globalThis<"u"?globalThis:m||self,s(m["data-view"]={},m.Vue))})(this,function(m,s){"use strict";function H(l,a,u,r,c){const{getGridHeaderCells:p}=c,C=120,R=50,_=s.computed(()=>{var e;return((e=l.rowNumber)==null?void 0:e.enable)||!1}),k=s.computed(()=>{var e,t;return((e=l.selection)==null?void 0:e.multiSelect)||((t=l.selection)==null?void 0:t.showCheckbox)||!1}),M=s.computed(()=>{var e;return 0+(_.value?((e=l.rowNumber)==null?void 0:e.width)||32:0)+(k.value?R:0)}),E=s.computed(()=>{var e;return(e=l.columnOption)==null?void 0:e.fitColumns}),I=s.computed(()=>{var e;return E.value&&((e=l.columnOption)==null?void 0:e.fitMode)||"none"});function N(e,t,o){const h=parseInt(e.width,10)/100;return o*h}function b(e,t,o){return typeof e.width=="string"?N(e,t,o):e.width||C}function A(e,t){const o=[],h=[];let f=0;e.value.primaryColumns.forEach(g=>{typeof g.width=="string"?h.push(g):(g.width=g.width||C,f+=g.width,o.push(g))});const w=t*(o.length/e.value.primaryColumns.length);o.forEach(g=>{const d=w*(g.width/f);g.actualWidth=d,e.value.primaryColumnsWidth+=g.actualWidth});const S=t-w;h.forEach(g=>{const d=N(g,e.value,S);g.actualWidth=d,e.value.primaryColumnsWidth+=g.actualWidth})}function W(e,t){const o=[],h=[],f=new WeakMap;let w=0,S=0;if(e.value.primaryColumns.forEach(d=>{if(typeof d.width=="string"){const y=N(d,e.value,t);f.set(d,y),w+=y,h.push(d)}else d.width=d.width||C,S+=d.width,o.push(d)}),t-w>S){const d=t-w;h.forEach(y=>{y.actualWidth=f.get(y)||C,e.value.primaryColumnsWidth+=y.actualWidth}),o.forEach(y=>{y.actualWidth=d*(y.width/S),e.value.primaryColumnsWidth+=y.actualWidth})}else A(e,t)}function v(e,t){e.value.primaryColumns.forEach(o=>{o.actualWidth=b(o,e.value,t),e.value.primaryColumnsWidth+=o.actualWidth})}const D={expand:W,none:v,percentage:A};function O(e){e.value.leftHeaderColumns=Array.from(p(e.value.leftColumns).values()),e.value.primaryHeaderColumns=Array.from(p(e.value.primaryColumns).values()),e.value.rightHeaderColumns=Array.from(p(e.value.rightColumns).values())}function P(e){e.value.leftColumnsWidth=0,e.value.primaryColumnsWidth=0,e.value.rightColumnsWidth=0,e.value.leftColumns.forEach(t=>{e.value.leftColumnsWidth+=t.actualWidth||0}),e.value.primaryColumns.forEach(t=>{e.value.primaryColumnsWidth+=t.actualWidth||0}),e.value.rightColumns.forEach(t=>{e.value.rightColumnsWidth+=t.actualWidth||0}),e.value=Object.assign({},e.value)}function n(e,t,o){var y;let h=0;const f=e.value.primaryColumns,w=e.value.rightColumns;e.value.rightColumns.forEach(V=>{V.actualWidth=b(V,e.value,t),h+=V.actualWidth});const S=o-h,g=D[I.value];if(g&&g(e,S),e.value.primaryColumnsWidth+h<=o)return e.value.primaryColumns=[...f,...w],e.value.primaryColumnsWidth+=h,e.value.rightColumns=[],e.value.rightColumnsWidth=0,!0;const d=new Map;return d.set("primary",[]),d.set("right",[]),e.value.primaryColumns.reduce((V,F)=>{var T,$;return F.fixed==="right"?(T=V.get("right"))==null||T.push(F):($=V.get("primary"))==null||$.push(F),V},d),(y=d.get("right"))!=null&&y.length&&(e.value.primaryColumns=[...d.get("primary")||[]],e.value.rightColumns=[...d.get("right")||[]]),e.value.primaryColumnsWidth=0,e.value.rightColumnsWidth=0,!1}function i(){if(u.value){a.value.leftColumnsWidth=0,a.value.primaryColumnsWidth=0,a.value.rightColumnsWidth=0;const e=u.value.clientWidth-M.value;a.value.leftColumns.forEach(o=>{o.actualWidth=b(o,a.value,e),a.value.leftColumnsWidth+=o.actualWidth});const t=e-a.value.leftColumnsWidth;if(n(a,e,t))r.value=t;else{a.value.rightColumns.forEach(f=>{f.actualWidth=b(f,a.value,e),a.value.rightColumnsWidth+=f.actualWidth});const o=e-a.value.leftColumnsWidth-a.value.rightColumnsWidth,h=D[I.value];h&&h(a,o),r.value=o}O(a),a.value=Object.assign({},a.value)}}return s.watch(()=>{var e;return(e=l.columnOption)==null?void 0:e.fitColumns},(e,t)=>{e!==t&&e&&i()}),s.watch(I,(e,t)=>{e!==t&&E.value&&i()}),{calculateColumnHeaders:O,calculateColumnsSize:i,calculateColumnsWidth:P}}const B="";function G(l){const u={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]},r=s.ref(u);function c(){r.value={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]}}const p=s.ref(l.summary),C=s.computed(()=>{const n=p.value;return(n==null?void 0:n.groupFields)||[]});function R(){r.value.rightColumns.forEach(e=>{e.showSetting=!1}),r.value.primaryColumns.forEach(e=>{e.showSetting=!1});const n=r.value.rightColumns,i=r.value.primaryColumns;n.length>0?n[n.length-1].showSetting=!0:i.length>0&&(i[i.length-1].showSetting=!0)}function _(n){c();const i=new Map;return C.value&&C.value.reduce((e,t)=>(e.set(t,!0),e),i),n.reduce((e,t)=>(t.filter=t.filter||B,t.fixed==="left"?(r.value.leftColumns.push(t),r.value.leftColumnsMap.set(t.field,t),r.value.leftColumnsWidth+=t.actualWidth):t.fixed==="right"?(r.value.rightColumns.push(t),r.value.rightColumnsMap.set(t.field,t),r.value.rightColumnsWidth+=t.actualWidth):(r.value.primaryColumns.push(t),r.value.primaryColumnsMap.set(t.field,t),r.value.primaryColumnsWidth+=t.actualWidth),i.has(t.field)&&r.value.summaryColumns.push(t),e),r),R(),r}_(l.columns);const k=s.computed(()=>r.value.leftColumns.length>0),M=s.computed(()=>r.value.rightColumns.length>0);function E(n,i){return i.sortable&&i.sort&&i.sort!=="none"&&n.push(i),n}function I(n,i){return n.sortOrder=n.sortOrder||0,i.sortOrder=i.sortOrder||0,n.sortOrder===i.sortOrder?0:n.sortOrder<i.sortOrder?-1:1}function N(n,i){return n.sortOrder=n.sortOrder||0,i.sortOrder=i.sortOrder||0,n.sortOrder===i.sortOrder?0:n.sortOrder<i.sortOrder?1:-1}function b(n,i){return i.filterable&&n.push(i),n}function A(){const n=[];return r.value.leftColumns.reduce(b,n),r.value.primaryColumns.reduce(b,n),r.value.rightColumns.reduce(b,n),n}function W(){const n=[];r.value.leftColumns.reduce(E,n),r.value.primaryColumns.reduce(E,n),r.value.rightColumns.reduce(E,n);const i=Math.max(...n.map(e=>e.sortOrder||0));return n.sort(N).map(e=>{const t=e.sortOrder||i+1;return e.sortOrder=t,e}).sort(I).map((e,t)=>{const o=t+1;return e.sortOrder=o,e})}function v(n,i,e){const t=n.map(o=>{const h=e.getSorterByColumn(o),f=o.sort==="asc",w=o.sort==="desc",S=f?h.ascend:w?h.decend:void 0;return{field:o.field,compare:S}});i.setSorters(t)}function D(n,i){const e=W();v(e,n,i)}function O(n){}function P(n){}return{applyColumnSorter:D,collectionFilterableColumns:A,applySortableColumns:v,collectionSortableColumns:W,columnContext:r,hasLeftFixedColumn:k,hasRightFixedColumn:M,updateColumnRenderContext:_,updateColumnSettingIcon:R,sortFromServer:O,createSortConditions:P}}function z(l,a,u,r,c,p,C,R){const _=s.ref(r.value-1+c),k=s.ref(0),{renderDataRow:M}=p,E=C?C.renderGroupRow:M,I=R?R.renderSummaryRow:M;function N(W){let v=M;return W.__fv_data_grid_group_row__&&(v=E),W.__fv_data_grid_group_summary__&&(v=I),v}function b(W,v,D,O){const{dataView:P}=u,n=[];if(P.value.length>0){const i=O?Date.now().toString():"";let e=W,t=0;const o=v-W+1;for(;n.length<o&&e<P.value.length;){const h=P.value[e],f=P.value[e-1]||D,w=n[t-1],S=f?(f.__fv_data_position__||0)+(f.__fv_data_height__||0):0,d=N(h)(h,f,w,e,S,a.value,n);d.refreshKey=i,n.push(d),t++,e++}}return k.value=n.length>0?n[0].index:0,_.value=n.length>0?n[n.length-1].index:0,n}function A(W,v,D){const O=v.groupField||"",{groupValue:P,raw:n}=v;u[W](O,P,n.groupParents||[]);const{dataView:i}=u,e=D[0].index,t=Math.min(e+r.value+c+1,i.value.length-1);return b(e,t)}return{getVisualData:b,maxVisibleRowIndex:_,minVisibleRowIndex:k,toggleGroupRow:A}}function L(){function l(a){return{title:"行配置",description:"",properties:{customRowStyle:{title:"行样式",type:"string",description:"自定义行样式",$converter:"/converter/row-option.converter",editor:{type:"code-editor",language:"javascript",leftTemplate:()=>s.createVNode(s.Fragment,null,[s.createVNode("h5",null,[s.createTextVNode("示例代码")]),s.createVNode("pre",null,[`
2
+ (dataItem) => {
3
+ if(dataItem.code === '0001') {
4
+ return {
5
+ class: {
6
+ 'text-align': true,
7
+ 'text-red': true
8
+ },
9
+ style: {
10
+ 'background-color': '#000',
11
+ 'font-size': '1rem'
12
+ }
13
+ };
14
+ }
15
+ return {};
16
+ }
17
+
18
+ 注: dataItem 行数据
19
+ `])])}},customCellStyle:{title:"单元格样式",type:"string",description:"自定义单元格样式",$converter:"/converter/row-option.converter",editor:{type:"code-editor",language:"javascript",leftTemplate:()=>s.createVNode(s.Fragment,null,[s.createVNode("h5",null,[s.createTextVNode("示例代码")]),s.createVNode("pre",null,[`
20
+ (cell, row) => {
21
+ if(cell.data === '0002') {
22
+ return {
23
+ class: {
24
+ 'text-align': true,
25
+ 'text-red': true
26
+ },
27
+ style: {
28
+ 'background-color': '#000',
29
+ 'font-size': '1rem'
30
+ }
31
+ };
32
+ }
33
+ return {};
34
+ }
35
+ 注: cell.data 单元格数据
36
+ cell.column 列数据
37
+ row.raw 行数据
38
+ `])])}}}}}return{getRowOptionProperties:l}}function U(){function l(a){return{title:"填充列宽",description:"",properties:{fitColumns:{title:"启用",type:"boolean",description:"启用填充列宽",$converter:"/converter/column-option.converter",refreshPanelAfterChanged:!0}},setPropertyRelates(u,r){switch(u&&u.propertyID){case"fitColumns":{r.fit=u.propertyValue,r.columns&&(u.propertyValue?r.columns.forEach(c=>{c.resizable=!1}):r.columns.forEach(c=>{c.resizable=!0}));break}}}}}return{getColumnOptionProperties:l}}function K(){function l(a){return{title:"操作列",description:"",properties:{enable:{title:"启用",type:"boolean",$converter:"/converter/column-command.converter",description:"启用操作列",refreshPanelAfterChanged:!0}}}}return{getCommandColumnProperties:l}}function q(){function l(a){return{title:"合计行",description:"",properties:{enable:{title:"启用",type:"boolean",description:"启用合计行",$converter:"/converter/summary.converter",refreshPanelAfterChanged:!0}}}}return{getSummaryProperties:l}}function Y(){function l(a){var u;return{title:"分组",description:"",properties:{enable:{title:"启用",type:"boolean",description:"启用分组",$converter:"/converter/group.converter",refreshPanelAfterChanged:!0},showSummary:{title:"显示分组合计行",type:"boolean",visible:!!((u=a.group)!=null&&u.enable),$converter:"/converter/group.converter",description:"显示分组合计行"}}}}return{getGroupProperties:l}}function J(){function l(a){var r,c;const u=[{label:"onClickRow",name:"行点击事件"},{label:"onSelectionChange",name:"行切换事件"},{label:"onDoubleClickRow",name:"行双击事件"},{label:"onFilterChanged",name:"过滤事件"}];return a.type!=="tree-grid"&&u.push({label:"onSortChanged",name:"排序事件"},{label:"onSelectItem",name:"选中行事件"},{label:"onUnSelectItem",name:"取消选中行事件"},{label:"onSelectAll",name:"全选事件"},{label:"onUnSelectAll",name:"取消全选事件"}),((r=a.pagination)==null?void 0:r.enable)!==!1&&a.type!=="tree-grid"&&u.push({label:"onPageIndexChanged",name:"切换页码事件"},{label:"onPageSizeChanged",name:"分页条数变化事件"}),(c=a.command)!=null&&c.enable&&u.push({label:"onClickEditCommand",name:"操作列编辑事件"},{label:"onClickDeleteCommand",name:"操作列删除事件"}),u}return{initEvent:l}}function Q(){function l(a){var u,r,c;return{title:"多选配置",$converter:"/converter/grid-selection.converter",parentPropertyID:"editor",properties:{multiSelect:{title:"启用多选",type:"boolean",refreshPanelAfterChanged:!0},showCheckbox:{visible:!!((u=a.selection)!=null&&u.multiSelect),$converter:"/converter/grid-selection.converter",title:"显示复选框",type:"boolean",readonly:!0,refreshPanelAfterChanged:!0},showSelectAll:{visible:!!((r=a.selection)!=null&&r.multiSelect)&&!!((c=a.selection)!=null&&c.showCheckbox),title:"显示全选",type:"boolean"}},setPropertyRelates(p,C){switch(p&&p.propertyID){case"multiSelect":a.selection.showCheckbox=p.propertyValue;break}}}}return{getSelection:l}}function X(){function l(a){var u,r;return{title:"行号配置",$converter:"/converter/row-number.converter",parentPropertyID:"rowNumber",properties:{enable:{title:"显示行号",type:"boolean",refreshPanelAfterChanged:!0},width:{visible:!!((u=a.rowNumber)!=null&&u.enable),title:"宽度",type:"number"},heading:{visible:!!((r=a.rowNumber)!=null&&r.enable),title:"标题",type:"string"}}}}return{getRowNumber:l}}function Z(){function l(a,u){var r,c;return{title:"分页",$converter:"/converter/pagination.converter",parentPropertyID:"pagination",properties:{enable:{title:"启用分页",type:"boolean",refreshPanelAfterChanged:!0,editor:{readonly:u}},showIndex:{visible:((r=a.pagination)==null?void 0:r.enable)||!1,title:"显示页码",type:"boolean"},showLimits:{visible:((c=a.pagination)==null?void 0:c.enable)||!1,title:"显示分页条数",type:"boolean"}}}}return{getPagination:l}}function j(){function l(){return{showStripe:{title:"显示条纹",type:"boolean",description:"是否显示条纹"},showBorder:{title:"显示边框",type:"boolean",description:"是否显示边框"},showSetting:{title:"显示设置按钮",type:"boolean",description:"是否显示设置按钮"},emptyTemplate:{title:"空模板",type:"string",description:"空模板",editor:{type:"code-editor",language:"html"}}}}function a(r,c){return{title:"外观",properties:{class:{title:"class样式",type:"string",description:"组件的class样式"},columns:{title:"列设置",description:"列设置",type:"array",editor:{type:"grid-field-editor",viewModelId:c,gridData:r,getLatestGridData:p=>r},refreshPanelAfterChanged:!0},...l()},setPropertyRelates(p,C){switch(p&&p.propertyID){case"useBlankWhenDataIsEmpty":r.emptyDataHeight=r.useBlankWhenDataIsEmpty?36:240;break;case"columns":r.columns=p.propertyValue||[];break}}}}function u(r,c){return{title:"外观",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式"},columns:{title:"列设置",description:"列设置",$converter:"/converter/items-count.converter",editor:{type:"grid-field-editor",viewModelId:c,gridData:r,gridType:"tree-grid-column"},refreshPanelAfterChanged:!0},...l()},setPropertyRelates(p,C){switch(p&&p.propertyID){case"useBlankWhenDataIsEmpty":r.emptyDataHeight=r.useBlankWhenDataIsEmpty?36:240;break;case"fields":r.fields=p.propertyValue||[];break}}}}return{getDataGrid:a,getTreeGrid:u}}function x(){function l(a){return{title:"排序",description:"",properties:{mode:{title:"类型",type:"enum",description:"排序类型",$converter:"/converter/grid-sort.converter",editor:{data:[{id:"client",name:"客户端"},{id:"server",name:"服务端"}]}}}}}return{getSort:l}}function ee(){function l(a){return{title:"过滤",description:"",properties:{mode:{title:"类型",type:"enum",description:"过滤类型",$converter:"/converter/grid-filter.converter",editor:{data:[{id:"client",name:"客户端"},{id:"server",name:"服务端"}]}}}}}return{getFilter:l}}m.useAppearance=j,m.useColumnOption=U,m.useCommandOption=K,m.useDataGridEvent=J,m.useDesignerColumn=G,m.useDesignerFitColumn=H,m.useDesignerVisualData=z,m.useFilter=ee,m.useGroup=Y,m.usePagination=Z,m.useRowNumber=X,m.useRowOption=L,m.useSelection=Q,m.useSort=x,m.useSummary=q,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1 @@
1
+ .f-drawer{position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;pointer-events:none}.f-drawer.f-drawer-inline{position:absolute}.f-drawer-container{display:flex;flex-direction:column;width:100%;height:100%}.f-drawer-header{display:flex;padding:16px 24px;justify-content:space-between}.f-drawer-close:hover{cursor:pointer}.f-drawer-body{flex:1;padding:24px}.f-drawer-mask{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1000;background:#00000073;pointer-events:auto}.f-drawer-wrapper{position:absolute;z-index:1000;transition:all .3s;pointer-events:auto;background-color:#fff}.f-drawer-wrapper-right{top:0;right:0;bottom:0;height:100%!important}.f-drawer-wrapper-left{top:0;left:0;bottom:0;height:100%!important}.f-drawer-wrapper-top{top:0;left:0;width:100%!important}.f-drawer-wrapper-bottom{bottom:0;left:0;width:100%!important}.f-drawer-entry{position:absolute;z-index:850;transition:transform 1s}.f-drawer-entry-left{top:30px;left:0}.f-drawer-entry-right{top:30px;right:0}.f-drawer-entry-top{left:30px;top:0}.f-drawer-entry-bottom{left:30px;bottom:0}.f-drawer-entry-icon{width:24px;height:30px;background:#2a87ff;color:#fff;box-shadow:0 2px 3px #6081ba33;text-align:center;cursor:pointer}.f-drawer-entry-icon .f-icon{font-size:24px;line-height:30px}.f-drawer-right-enter-active,.f-drawer-right-leave-active,.f-drawer-left-enter-active,.f-drawer-left-leave-active,.f-drawer-top-enter-active,.f-drawer-top-leave-active,.f-drawer-bottom-enter-active,.f-drawer-bottom-leave-active,.f-drawer-mask-enter-active,.f-drawer-mask-leave-active{transition:all .3s}.f-drawer-right-enter-from,.f-drawer-right-leave-to{transform:translate(100%)}.f-drawer-right-enter-to,.f-drawer-right-leave-from,.f-drawer-left-enter-to,.f-drawer-left-leave-from{transform:translate(0)}.f-drawer-left-enter-from,.f-drawer-left-leave-to{transform:translate(-100%)}.f-drawer-top-enter-from,.f-drawer-top-leave-to{transform:translateY(-100%)}.f-drawer-top-enter-to,.f-drawer-top-leave-from,.f-drawer-bottom-enter-to,.f-drawer-bottom-leave-from{transform:translateY(0)}.f-drawer-bottom-enter-from,.f-drawer-bottom-leave-to{transform:translateY(100%)}.f-drawer-mask-enter-from,.f-drawer-mask-leave-to{opacity:0}.f-drawer-mask-enter-to,.f-drawer-mask-leave-from{opacity:1}.f-drawer-footer{height:60px;display:flex;justify-content:end;align-items:center}
@@ -0,0 +1,525 @@
1
+ import { resolveAppearance as W, createPropsResolver as z } from "../../components/dynamic-resolver/index.esm.js";
2
+ import { withInstall as G } from "../../components/common/index.esm.js";
3
+ import { defineComponent as A, ref as m, computed as i, watch as $, createVNode as t, Teleport as j, Transition as b, withModifiers as k, withDirectives as J, vShow as Q, Fragment as X, inject as V, onMounted as Y } from "vue";
4
+ import { useI18n as Z } from "vue-i18n";
5
+ import { UseTemplateDragAndDropRules as _, useDesignerComponent as O, FDesignerInnerItem as ee } from "../../components/designer-canvas/index.esm.js";
6
+ import te, { responseToolbarResolver as N } from "../../components/response-toolbar/index.esm.js";
7
+ import { BaseControlProperty as re } from "../../components/property-panel/index.esm.js";
8
+ const x = {
9
+ /** 背景色 */
10
+ backgroundColor: { type: String, default: "#fff" },
11
+ /**
12
+ * 关闭对话框前事件, 是个函数,返回true或者false
13
+ */
14
+ beforeClose: { type: Function, default: () => !0 },
15
+ /**
16
+ * 自定义抽屉样式
17
+ */
18
+ class: { type: String, default: "" },
19
+ /**
20
+ * 自定义抽屉蒙层样式
21
+ */
22
+ modalClass: { type: String, default: "" },
23
+ /** 高度 */
24
+ height: { type: String, default: 300 },
25
+ /** 打开关闭抽屉 */
26
+ modelValue: { type: Boolean, default: !1 },
27
+ /** 从哪个位置呼出 */
28
+ position: { type: String, default: "right" },
29
+ /** 抽屉插入位置 */
30
+ appendTo: { type: String, default: "body" },
31
+ /** 是否展示打开抽屉入口 */
32
+ showEntry: { type: Boolean, default: !1 },
33
+ /** 是否展示关闭按钮 */
34
+ showClose: { type: Boolean, default: !0 },
35
+ /** 是否展示遮罩层 */
36
+ // mask: { type: Boolean, default: true },
37
+ /** 点击遮罩是否关闭抽屉 */
38
+ allowClickMaskToClose: { type: Boolean, default: !0 },
39
+ /** 标题 */
40
+ title: { type: String, default: "" },
41
+ /** 宽度 */
42
+ width: { type: String, default: 300 },
43
+ /**
44
+ * 渲染的DOM容器
45
+ */
46
+ host: { type: Object, default: "body" },
47
+ showHeader: { type: Boolean, default: !0 },
48
+ showFooter: { type: Boolean, default: !0 },
49
+ buttons: { type: Array, default: [] }
50
+ };
51
+ function oe() {
52
+ const { t: e } = Z();
53
+ return { drawerLocale: {
54
+ cancel: e("drawer.cancel") || "取消",
55
+ confirm: e("drawer.confirm") || "确定"
56
+ } };
57
+ }
58
+ const ne = /* @__PURE__ */ A({
59
+ name: "FDrawer",
60
+ props: x,
61
+ emits: ["afterClose", "update:modelValue"],
62
+ setup(e, r) {
63
+ const {
64
+ drawerLocale: s
65
+ } = oe(), c = m(e.modelValue), a = m(e.buttons), y = i(() => ({
66
+ "f-drawer": !0,
67
+ // 在某个DOM内部打开抽屉
68
+ "f-drawer-inline": typeof e.host == "string" ? e.host !== "body" : document.querySelector(e.host) !== document.body
69
+ }));
70
+ i(() => ({}));
71
+ const h = i(() => {
72
+ const o = {};
73
+ return e.maskClass && e.maskClass.split(" ").forEach((n) => {
74
+ o[n] = !0;
75
+ }), {
76
+ "f-drawer-mask": !0,
77
+ ...o
78
+ };
79
+ }), d = i(() => {
80
+ const o = {};
81
+ return e.maskClass && e.class.split(" ").forEach((n) => {
82
+ o[n] = !0;
83
+ }), {
84
+ "f-drawer-wrapper": !0,
85
+ [`f-drawer-wrapper-${e.position}`]: !0,
86
+ ...o
87
+ };
88
+ }), w = i(() => {
89
+ const o = e.width;
90
+ return typeof o == "string" ? o : typeof o == "number" ? `${o}px` : "20%";
91
+ }), p = i(() => {
92
+ const o = e.height;
93
+ return typeof o == "string" ? o : typeof o == "number" ? `${o}px` : "20%";
94
+ }), f = i(() => `f-drawer-${e.position}`), g = (o) => {
95
+ Promise.resolve().then(() => {
96
+ var n;
97
+ return (n = e.beforeClose) == null ? void 0 : n.call(e);
98
+ }).then((n) => {
99
+ n && (c.value = !1, r.emit("update:modelValue", c.value), r.emit("afterClose"));
100
+ });
101
+ }, T = (o) => {
102
+ g();
103
+ };
104
+ $(() => e.modelValue, (o, n) => {
105
+ o !== n && (c.value = o);
106
+ });
107
+ const P = {
108
+ close: () => {
109
+ c.value = !1;
110
+ }
111
+ };
112
+ async function B(o, n) {
113
+ o.handle && await o.handle(n, P) && r.emit("closed", n);
114
+ }
115
+ const S = () => !a.value || !a.value.length ? [{
116
+ id: "drawer-footer-cancel",
117
+ text: s.cancel,
118
+ class: "btn btn-secondary mr-2",
119
+ handle: g
120
+ }, {
121
+ id: "drawer-footer-confirm",
122
+ text: s.confirm,
123
+ class: "btn btn-primary",
124
+ handle: T
125
+ }] : a.value;
126
+ function C() {
127
+ const o = S();
128
+ return t(X, null, [o && o.map((n) => {
129
+ const v = m(n.disabled);
130
+ return t("button", {
131
+ id: n.id,
132
+ type: "button",
133
+ disabled: v.value,
134
+ class: n.class + (n.iconClass ? " btn-icontext" : ""),
135
+ onClick: (I) => {
136
+ B(n, I);
137
+ }
138
+ }, [!!n.iconClass && t("i", {
139
+ class: n.iconClass
140
+ }, null), n.text]);
141
+ })]);
142
+ }
143
+ function F() {
144
+ return r.slots.footerTemplate ? r.slots.footerTemplate() : C();
145
+ }
146
+ return () => t(j, {
147
+ to: e.host
148
+ }, {
149
+ default: () => [t("div", {
150
+ class: y.value,
151
+ id: e.id
152
+ }, [t(b, {
153
+ name: "f-drawer-mask",
154
+ appear: !0
155
+ }, {
156
+ default: () => [c.value && t("div", {
157
+ class: h.value,
158
+ onClick: k((o) => {
159
+ e.allowClickMaskToClose && g();
160
+ }, ["stop"])
161
+ }, null)]
162
+ }), t(b, {
163
+ name: f.value
164
+ }, {
165
+ default: () => {
166
+ var o, n;
167
+ return [J(t("div", {
168
+ class: d.value,
169
+ style: {
170
+ width: w.value,
171
+ height: p.value,
172
+ backgroundColor: e.backgroundColor
173
+ }
174
+ }, [t("div", {
175
+ class: "f-drawer-container"
176
+ }, [e.showHeader && t("div", {
177
+ class: "f-drawer-header"
178
+ }, [t("div", {
179
+ class: "f-drawer-title"
180
+ }, [r.slots.headerTemplate ? r.slots.headerTemplate() : e.title]), e.showClose && t("div", {
181
+ class: "f-drawer-close"
182
+ }, [t("span", {
183
+ class: "f-icon f-icon-close",
184
+ onClick: k((v) => {
185
+ g();
186
+ }, ["stop"])
187
+ }, null)])]), t("div", {
188
+ class: "f-drawer-body"
189
+ }, [(n = (o = r.slots).content) == null ? void 0 : n.call(o)]), e.showFooter && t("div", {
190
+ class: "f-drawer-footer px-2"
191
+ }, [F()])])]), [[Q, c.value]])];
192
+ }
193
+ })])]
194
+ });
195
+ }
196
+ });
197
+ class se extends re {
198
+ constructor(r, s) {
199
+ super(r, s);
200
+ }
201
+ getPropertyConfig(r) {
202
+ return this.propertyConfig.categories.basic = this.getBasicPropConfig(r), this.propertyConfig.categories.appearance = this.getAppearanceConfig(r), this.getBehaviorConfig(), this.propertyConfig;
203
+ }
204
+ getBehaviorConfig() {
205
+ this.propertyConfig.categories.behavior = {
206
+ title: "行为",
207
+ description: "Behavior",
208
+ properties: {
209
+ title: {
210
+ title: "标题",
211
+ description: "标题",
212
+ type: "string"
213
+ },
214
+ position: {
215
+ title: "显示位置",
216
+ description: "抽屉显示位置",
217
+ type: "select",
218
+ default: "right",
219
+ editor: {
220
+ type: "combo-list",
221
+ textField: "name",
222
+ valueField: "value",
223
+ editable: !1,
224
+ data: [
225
+ { value: "left", name: "左侧" },
226
+ { value: "right", name: "右侧" }
227
+ ]
228
+ }
229
+ },
230
+ width: {
231
+ title: "宽度",
232
+ description: "抽屉宽度",
233
+ type: "number"
234
+ },
235
+ showMask: {
236
+ title: "显示遮罩",
237
+ description: "是否显示遮罩",
238
+ type: "boolean",
239
+ default: !0,
240
+ visible: !1
241
+ },
242
+ showFooter: {
243
+ title: "显示底部",
244
+ description: "是否显示底部",
245
+ type: "boolean",
246
+ default: !0
247
+ }
248
+ },
249
+ setPropertyRelates(r, s) {
250
+ if (r)
251
+ switch (r && r.propertyID) {
252
+ case "title": {
253
+ r.needRefreshControlTree = !0;
254
+ break;
255
+ }
256
+ }
257
+ }
258
+ };
259
+ }
260
+ }
261
+ function ae(e, r) {
262
+ new _();
263
+ function s() {
264
+ return !1;
265
+ }
266
+ function c() {
267
+ return !1;
268
+ }
269
+ function a() {
270
+ return !1;
271
+ }
272
+ function y() {
273
+ return !0;
274
+ }
275
+ function h() {
276
+ return "position: absolute !important;border: none !important;left: 0;right: 0;padding: 0;";
277
+ }
278
+ function d(w) {
279
+ const p = new se(w, r), { schema: f } = e;
280
+ return p.getPropertyConfig(f);
281
+ }
282
+ return { canAccepts: s, checkCanDeleteComponent: c, checkCanMoveComponent: a, hideNestedPaddingInDesginerView: y, getStyles: h, getPropsConfig: d };
283
+ }
284
+ const H = Object.assign({}, x, {
285
+ componentId: { type: String, default: "" }
286
+ }), D = /* @__PURE__ */ A({
287
+ name: "FDrawerDesign",
288
+ props: H,
289
+ setup(e, r) {
290
+ const s = m(), c = V("designer-host-service"), a = V("design-item-context"), y = ae(a, c), h = O(s, a, y), d = m(a.schema.toolbar || {
291
+ type: "response-toolbar",
292
+ buttons: []
293
+ }), w = m(N(d.value));
294
+ $(() => a.schema.toolbar, () => {
295
+ d.value = a.schema.toolbar || {
296
+ type: "response-toolbar",
297
+ buttons: []
298
+ }, w.value = N(d.value);
299
+ }, {
300
+ deep: !0
301
+ });
302
+ const p = i(() => [...w.value.items]);
303
+ Y(() => {
304
+ s.value.componentInstance = h;
305
+ }), r.expose(h.value);
306
+ const f = m(e.modelValue);
307
+ $(() => e.modelValue, () => {
308
+ f.value = e.modelValue;
309
+ });
310
+ const g = i(() => ["f-drawer-wrapper", `f-drawer-wrapper-${e.position}`, e.wrapperClass]), T = i(() => {
311
+ const l = e.width, u = e.height, R = typeof l == "string" ? l : typeof l == "number" ? `${l}px` : "20%", M = typeof u == "string" ? u : typeof u == "number" ? `${u}px` : "20%";
312
+ return {
313
+ width: R,
314
+ height: M,
315
+ backgroundColor: e.backgroundColor
316
+ };
317
+ }), P = i(() => ["f-drawer-entry", `f-drawer-entry-${e.position}`, e.entryClass]), B = i(() => `f-icon-arrow-chevron-${{
318
+ left: "right",
319
+ right: "left",
320
+ top: "down",
321
+ bottom: "up"
322
+ }[e.position] ?? "right"}`), S = i(() => `f-drawer-${e.position}`), C = () => {
323
+ f.value = !1;
324
+ }, F = () => {
325
+ f.value = !0;
326
+ }, o = () => t("div", {
327
+ class: P.value,
328
+ onClick: F
329
+ }, [r.slots.button ? r.slots.button() : t("div", {
330
+ class: "f-drawer-entry-icon"
331
+ }, [t("span", {
332
+ class: `f-icon ${B.value}`
333
+ }, null)])]), n = () => t(b, {
334
+ name: "f-drawer-mask",
335
+ appear: !0
336
+ }, {
337
+ default: () => [f.value && e.showMask && t("div", {
338
+ class: "f-drawer-mask",
339
+ onClick: e.closeByMask && k(C, ["stop"])
340
+ }, null)]
341
+ });
342
+ function v(l, u, R, M) {
343
+ a && a.setupContext && a.setupContext.emit("selectionChange", l, u, R, M);
344
+ }
345
+ const I = () => {
346
+ if (p.value && p.value.length > 0)
347
+ return t(ee, {
348
+ modelValue: d.value,
349
+ "onUpdate:modelValue": (l) => d.value = l,
350
+ canAdd: !0,
351
+ childType: "response-toolbar-item",
352
+ childLabel: "按钮",
353
+ contentKey: "buttons",
354
+ id: d.value.id,
355
+ componentId: e.componentId,
356
+ onSelectionChange: v
357
+ }, {
358
+ default: () => [t(te, {
359
+ customClass: "w-100",
360
+ items: p.value,
361
+ componentId: e.componentId
362
+ }, null)]
363
+ });
364
+ }, L = () => t("div", {
365
+ class: "f-drawer-close"
366
+ }, [t("span", {
367
+ class: "f-icon f-icon-close",
368
+ onClick: k(C, ["stop"])
369
+ }, null)]), q = () => t("div", {
370
+ class: "f-drawer-header"
371
+ }, [t("div", {
372
+ class: "f-drawer-header-left"
373
+ }, [t("div", {
374
+ class: "f-drawer-title"
375
+ }, [r.slots.title ? r.slots.title() : e.title])]), t("div", {
376
+ class: "f-drawer-header-right"
377
+ }, [I(), e.showClose && L()])]), U = () => t(b, {
378
+ name: S.value,
379
+ appear: !0
380
+ }, {
381
+ default: () => {
382
+ var l, u;
383
+ return [f.value && t("div", {
384
+ class: g.value,
385
+ style: T.value
386
+ }, [t("div", {
387
+ class: "f-drawer-container"
388
+ }, [q(), t("div", {
389
+ class: "f-drawer-body"
390
+ }, [(u = (l = r.slots).default) == null ? void 0 : u.call(l)])])])];
391
+ }
392
+ }), K = () => t(j, {
393
+ to: ".editorPanel "
394
+ }, {
395
+ default: () => [t("div", {
396
+ class: "f-drawer"
397
+ }, [n(), U()])]
398
+ });
399
+ return () => t("div", {
400
+ ref: s
401
+ }, [K(), o()]);
402
+ }
403
+ });
404
+ function ie(e, r, s) {
405
+ return r;
406
+ }
407
+ const le = /* @__PURE__ */ new Map([
408
+ ["appearance", W]
409
+ ]), ce = "https://json-schema.org/draft/2020-12/schema", de = "https://farris-design.gitee.io/drawer.schema.json", ue = "drawer", fe = "A Farris Component", pe = "object", me = {
410
+ id: {
411
+ description: "The unique identifier for drawer",
412
+ type: "string"
413
+ },
414
+ type: {
415
+ description: "The type string of drawer",
416
+ type: "string",
417
+ default: "drawer"
418
+ },
419
+ appearance: {
420
+ description: "",
421
+ type: "object",
422
+ properties: {
423
+ class: {
424
+ type: "string"
425
+ },
426
+ style: {
427
+ type: "string"
428
+ }
429
+ },
430
+ default: {}
431
+ },
432
+ visible: {
433
+ description: "",
434
+ type: "boolean",
435
+ default: !0
436
+ },
437
+ title: {
438
+ description: "",
439
+ type: "string",
440
+ default: "标题"
441
+ },
442
+ position: {
443
+ description: "",
444
+ type: "string",
445
+ default: "right"
446
+ },
447
+ width: {
448
+ description: "",
449
+ type: "number"
450
+ },
451
+ showMask: {
452
+ description: "",
453
+ type: "boolean",
454
+ default: !0
455
+ },
456
+ showHeader: {
457
+ description: "",
458
+ type: "boolean",
459
+ default: !0
460
+ },
461
+ showFooter: {
462
+ description: "",
463
+ type: "boolean",
464
+ default: !0
465
+ },
466
+ toolbar: {
467
+ description: "",
468
+ type: "object",
469
+ properties: {
470
+ appearance: {
471
+ description: "",
472
+ type: "object",
473
+ properties: {
474
+ class: {
475
+ type: "string",
476
+ default: "col-3"
477
+ }
478
+ }
479
+ },
480
+ id: {
481
+ description: "",
482
+ type: "string"
483
+ },
484
+ type: {
485
+ description: "",
486
+ type: "string",
487
+ default: "response-toolbar"
488
+ },
489
+ alignment: {
490
+ description: "The alignment of Response Toolbar Button.",
491
+ type: "string",
492
+ default: "right"
493
+ },
494
+ buttons: {
495
+ description: "The items of Response Toolbar.",
496
+ type: "array",
497
+ default: []
498
+ }
499
+ }
500
+ }
501
+ }, he = [
502
+ "id",
503
+ "type",
504
+ "contents"
505
+ ], we = {
506
+ $schema: ce,
507
+ $id: de,
508
+ title: ue,
509
+ description: fe,
510
+ type: pe,
511
+ properties: me,
512
+ required: he
513
+ }, E = z(H, we, le, ie);
514
+ D.register = (e, r, s) => {
515
+ e.drawer = ne, r.drawer = E;
516
+ };
517
+ D.registerDesigner = (e, r, s) => {
518
+ e.drawer = D, r.drawer = E;
519
+ };
520
+ const Te = G(D);
521
+ export {
522
+ Te as default,
523
+ x as drawerProps,
524
+ E as propsResolver
525
+ };
@@ -0,0 +1 @@
1
+ (function(s,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("../../components/dynamic-resolver/index.umd.js"),require("../../components/common/index.umd.js"),require("vue"),require("vue-i18n"),require("../../components/designer-canvas/index.umd.js"),require("../../components/response-toolbar/index.umd.js"),require("../../components/property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../../components/dynamic-resolver/index.umd.js","../../components/common/index.umd.js","vue","vue-i18n","../../components/designer-canvas/index.umd.js","../../components/response-toolbar/index.umd.js","../../components/property-panel/index.umd.js"],m):(s=typeof globalThis<"u"?globalThis:s||self,m(s.drawer={},s.dynamicResolver,s.common,s.Vue,s.vueI18n,s.designerCanvas,s.FResponseToolbarDesignComponent,s.propertyPanel))})(this,function(s,m,$,e,x,N,k,q){"use strict";const T={backgroundColor:{type:String,default:"#fff"},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},modalClass:{type:String,default:""},height:{type:String,default:300},modelValue:{type:Boolean,default:!1},position:{type:String,default:"right"},appendTo:{type:String,default:"body"},showEntry:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},allowClickMaskToClose:{type:Boolean,default:!0},title:{type:String,default:""},width:{type:String,default:300},host:{type:Object,default:"body"},showHeader:{type:Boolean,default:!0},showFooter:{type:Boolean,default:!0},buttons:{type:Array,default:[]}};function A(){const{t}=x.useI18n();return{drawerLocale:{cancel:t("drawer.cancel")||"取消",confirm:t("drawer.confirm")||"确定"}}}const H=e.defineComponent({name:"FDrawer",props:T,emits:["afterClose","update:modelValue"],setup(t,r){const{drawerLocale:a}=A(),l=e.ref(t.modelValue),i=e.ref(t.buttons),g=e.computed(()=>({"f-drawer":!0,"f-drawer-inline":typeof t.host=="string"?t.host!=="body":document.querySelector(t.host)!==document.body}));e.computed(()=>({}));const h=e.computed(()=>{const o={};return t.maskClass&&t.maskClass.split(" ").forEach(n=>{o[n]=!0}),{"f-drawer-mask":!0,...o}}),c=e.computed(()=>{const o={};return t.maskClass&&t.class.split(" ").forEach(n=>{o[n]=!0}),{"f-drawer-wrapper":!0,[`f-drawer-wrapper-${t.position}`]:!0,...o}}),w=e.computed(()=>{const o=t.width;return typeof o=="string"?o:typeof o=="number"?`${o}px`:"20%"}),f=e.computed(()=>{const o=t.height;return typeof o=="string"?o:typeof o=="number"?`${o}px`:"20%"}),p=e.computed(()=>`f-drawer-${t.position}`),y=o=>{Promise.resolve().then(()=>{var n;return(n=t.beforeClose)==null?void 0:n.call(t)}).then(n=>{n&&(l.value=!1,r.emit("update:modelValue",l.value),r.emit("afterClose"))})},D=o=>{y()};e.watch(()=>t.modelValue,(o,n)=>{o!==n&&(l.value=o)});const v={close:()=>{l.value=!1}};async function M(o,n){o.handle&&await o.handle(n,v)&&r.emit("closed",n)}const S=()=>!i.value||!i.value.length?[{id:"drawer-footer-cancel",text:a.cancel,class:"btn btn-secondary mr-2",handle:y},{id:"drawer-footer-confirm",text:a.confirm,class:"btn btn-primary",handle:D}]:i.value;function V(){const o=S();return e.createVNode(e.Fragment,null,[o&&o.map(n=>{const C=e.ref(n.disabled);return e.createVNode("button",{id:n.id,type:"button",disabled:C.value,class:n.class+(n.iconClass?" btn-icontext":""),onClick:B=>{M(n,B)}},[!!n.iconClass&&e.createVNode("i",{class:n.iconClass},null),n.text])})])}function j(){return r.slots.footerTemplate?r.slots.footerTemplate():V()}return()=>e.createVNode(e.Teleport,{to:t.host},{default:()=>[e.createVNode("div",{class:g.value,id:t.id},[e.createVNode(e.Transition,{name:"f-drawer-mask",appear:!0},{default:()=>[l.value&&e.createVNode("div",{class:h.value,onClick:e.withModifiers(o=>{t.allowClickMaskToClose&&y()},["stop"])},null)]}),e.createVNode(e.Transition,{name:p.value},{default:()=>{var o,n;return[e.withDirectives(e.createVNode("div",{class:c.value,style:{width:w.value,height:f.value,backgroundColor:t.backgroundColor}},[e.createVNode("div",{class:"f-drawer-container"},[t.showHeader&&e.createVNode("div",{class:"f-drawer-header"},[e.createVNode("div",{class:"f-drawer-title"},[r.slots.headerTemplate?r.slots.headerTemplate():t.title]),t.showClose&&e.createVNode("div",{class:"f-drawer-close"},[e.createVNode("span",{class:"f-icon f-icon-close",onClick:e.withModifiers(C=>{y()},["stop"])},null)])]),e.createVNode("div",{class:"f-drawer-body"},[(n=(o=r.slots).content)==null?void 0:n.call(o)]),t.showFooter&&e.createVNode("div",{class:"f-drawer-footer px-2"},[j()])])]),[[e.vShow,l.value]])]}})])]})}});class E extends q.BaseControlProperty{constructor(r,a){super(r,a)}getPropertyConfig(r){return this.propertyConfig.categories.basic=this.getBasicPropConfig(r),this.propertyConfig.categories.appearance=this.getAppearanceConfig(r),this.getBehaviorConfig(),this.propertyConfig}getBehaviorConfig(){this.propertyConfig.categories.behavior={title:"行为",description:"Behavior",properties:{title:{title:"标题",description:"标题",type:"string"},position:{title:"显示位置",description:"抽屉显示位置",type:"select",default:"right",editor:{type:"combo-list",textField:"name",valueField:"value",editable:!1,data:[{value:"left",name:"左侧"},{value:"right",name:"右侧"}]}},width:{title:"宽度",description:"抽屉宽度",type:"number"},showMask:{title:"显示遮罩",description:"是否显示遮罩",type:"boolean",default:!0,visible:!1},showFooter:{title:"显示底部",description:"是否显示底部",type:"boolean",default:!0}},setPropertyRelates(r,a){if(r)switch(r&&r.propertyID){case"title":{r.needRefreshControlTree=!0;break}}}}}}function L(t,r){new N.UseTemplateDragAndDropRules;function a(){return!1}function l(){return!1}function i(){return!1}function g(){return!0}function h(){return"position: absolute !important;border: none !important;left: 0;right: 0;padding: 0;"}function c(w){const f=new E(w,r),{schema:p}=t;return f.getPropertyConfig(p)}return{canAccepts:a,checkCanDeleteComponent:l,checkCanMoveComponent:i,hideNestedPaddingInDesginerView:g,getStyles:h,getPropsConfig:c}}const F=Object.assign({},T,{componentId:{type:String,default:""}}),b=e.defineComponent({name:"FDrawerDesign",props:F,setup(t,r){const a=e.ref(),l=e.inject("designer-host-service"),i=e.inject("design-item-context"),g=L(i,l),h=N.useDesignerComponent(a,i,g),c=e.ref(i.schema.toolbar||{type:"response-toolbar",buttons:[]}),w=e.ref(k.responseToolbarResolver(c.value));e.watch(()=>i.schema.toolbar,()=>{c.value=i.schema.toolbar||{type:"response-toolbar",buttons:[]},w.value=k.responseToolbarResolver(c.value)},{deep:!0});const f=e.computed(()=>[...w.value.items]);e.onMounted(()=>{a.value.componentInstance=h}),r.expose(h.value);const p=e.ref(t.modelValue);e.watch(()=>t.modelValue,()=>{p.value=t.modelValue});const y=e.computed(()=>["f-drawer-wrapper",`f-drawer-wrapper-${t.position}`,t.wrapperClass]),D=e.computed(()=>{const d=t.width,u=t.height,I=typeof d=="string"?d:typeof d=="number"?`${d}px`:"20%",R=typeof u=="string"?u:typeof u=="number"?`${u}px`:"20%";return{width:I,height:R,backgroundColor:t.backgroundColor}}),v=e.computed(()=>["f-drawer-entry",`f-drawer-entry-${t.position}`,t.entryClass]),M=e.computed(()=>`f-icon-arrow-chevron-${{left:"right",right:"left",top:"down",bottom:"up"}[t.position]??"right"}`),S=e.computed(()=>`f-drawer-${t.position}`),V=()=>{p.value=!1},j=()=>{p.value=!0},o=()=>e.createVNode("div",{class:v.value,onClick:j},[r.slots.button?r.slots.button():e.createVNode("div",{class:"f-drawer-entry-icon"},[e.createVNode("span",{class:`f-icon ${M.value}`},null)])]),n=()=>e.createVNode(e.Transition,{name:"f-drawer-mask",appear:!0},{default:()=>[p.value&&t.showMask&&e.createVNode("div",{class:"f-drawer-mask",onClick:t.closeByMask&&e.withModifiers(V,["stop"])},null)]});function C(d,u,I,R){i&&i.setupContext&&i.setupContext.emit("selectionChange",d,u,I,R)}const B=()=>{if(f.value&&f.value.length>0)return e.createVNode(N.FDesignerInnerItem,{modelValue:c.value,"onUpdate:modelValue":d=>c.value=d,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:c.value.id,componentId:t.componentId,onSelectionChange:C},{default:()=>[e.createVNode(k,{customClass:"w-100",items:f.value,componentId:t.componentId},null)]})},z=()=>e.createVNode("div",{class:"f-drawer-close"},[e.createVNode("span",{class:"f-icon f-icon-close",onClick:e.withModifiers(V,["stop"])},null)]),G=()=>e.createVNode("div",{class:"f-drawer-header"},[e.createVNode("div",{class:"f-drawer-header-left"},[e.createVNode("div",{class:"f-drawer-title"},[r.slots.title?r.slots.title():t.title])]),e.createVNode("div",{class:"f-drawer-header-right"},[B(),t.showClose&&z()])]),J=()=>e.createVNode(e.Transition,{name:S.value,appear:!0},{default:()=>{var d,u;return[p.value&&e.createVNode("div",{class:y.value,style:D.value},[e.createVNode("div",{class:"f-drawer-container"},[G(),e.createVNode("div",{class:"f-drawer-body"},[(u=(d=r.slots).default)==null?void 0:u.call(d)])])])]}}),O=()=>e.createVNode(e.Teleport,{to:".editorPanel "},{default:()=>[e.createVNode("div",{class:"f-drawer"},[n(),J()])]});return()=>e.createVNode("div",{ref:a},[O(),o()])}});function U(t,r,a){return r}const _=new Map([["appearance",m.resolveAppearance]]),K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/drawer.schema.json",title:"drawer",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for drawer",type:"string"},type:{description:"The type string of drawer",type:"string",default:"drawer"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0},title:{description:"",type:"string",default:"标题"},position:{description:"",type:"string",default:"right"},width:{description:"",type:"number"},showMask:{description:"",type:"boolean",default:!0},showHeader:{description:"",type:"boolean",default:!0},showFooter:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{appearance:{description:"",type:"object",properties:{class:{type:"string",default:"col-3"}}},id:{description:"",type:"string"},type:{description:"",type:"string",default:"response-toolbar"},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}}}},required:["id","type","contents"]},P=m.createPropsResolver(F,K,_,U);b.register=(t,r,a)=>{t.drawer=H,r.drawer=P},b.registerDesigner=(t,r,a)=>{t.drawer=b,r.drawer=P};const W=$.withInstall(b);s.default=W,s.drawerProps=T,s.propsResolver=P,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});