fast-element-plus 1.0.7 → 1.0.10

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 (182) hide show
  1. package/dist/index.full.js +894 -757
  2. package/dist/index.full.js.map +1 -1
  3. package/dist/index.full.min.js +1 -1
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +1 -1
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +894 -757
  8. package/dist/index.full.mjs.map +1 -1
  9. package/dist/styles/index.css +41 -23
  10. package/dist/styles/index.css.map +1 -1
  11. package/es/components/avatar/src/avatar.d.ts +4 -4
  12. package/es/components/avatar/src/avatar.mjs +1 -1
  13. package/es/components/avatar/src/avatar.mjs.map +1 -1
  14. package/es/components/button/src/button.mjs.map +1 -1
  15. package/es/components/carNumber/src/carNumber.d.ts +13 -5
  16. package/es/components/carNumber/src/carNumber.mjs +1 -1
  17. package/es/components/carNumber/src/carNumber.mjs.map +1 -1
  18. package/es/components/contextMenu/src/contextMenu.mjs +1 -1
  19. package/es/components/contextMenu/src/contextMenu.mjs.map +1 -1
  20. package/es/components/dialog/src/dialog.d.ts +4 -4
  21. package/es/components/dialog/src/dialog.mjs +1 -1
  22. package/es/components/dialog/src/dialog.mjs.map +1 -1
  23. package/es/components/drawer/src/drawer.d.ts +12 -4
  24. package/es/components/drawer/src/drawer.mjs +1 -1
  25. package/es/components/drawer/src/drawer.mjs.map +1 -1
  26. package/es/components/form/src/form.mjs +1 -1
  27. package/es/components/form/src/form.mjs.map +1 -1
  28. package/es/components/form/src/formItem.mjs +1 -1
  29. package/es/components/form/src/formItem.mjs.map +1 -1
  30. package/es/components/formItemTip/src/formItemTip.mjs +1 -1
  31. package/es/components/formItemTip/src/formItemTip.mjs.map +1 -1
  32. package/es/components/icon/src/icon.mjs +1 -1
  33. package/es/components/icon/src/icon.mjs.map +1 -1
  34. package/es/components/iconSelector/src/iconSelector.mjs +1 -1
  35. package/es/components/iconSelector/src/iconSelector.mjs.map +1 -1
  36. package/es/components/image/src/image.mjs +1 -1
  37. package/es/components/image/src/image.mjs.map +1 -1
  38. package/es/components/index.d.ts +1 -0
  39. package/es/components/index.mjs +1 -1
  40. package/es/components/inputDialogPage/index.d.ts +14 -0
  41. package/es/components/inputDialogPage/index.mjs +2 -0
  42. package/es/components/inputDialogPage/index.mjs.map +1 -0
  43. package/es/components/inputDialogPage/src/inputDialogPage.d.ts +131 -0
  44. package/es/components/inputDialogPage/src/inputDialogPage.mjs +2 -0
  45. package/es/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -0
  46. package/es/components/layoutGrid/src/layoutGrid.mjs +1 -1
  47. package/es/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
  48. package/es/components/layoutGrid/src/layoutGridItem.d.ts +6 -6
  49. package/es/components/layoutGrid/src/layoutGridItem.mjs +1 -1
  50. package/es/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
  51. package/es/components/select/src/select.d.ts +39 -34
  52. package/es/components/select/src/select.mjs +1 -1
  53. package/es/components/select/src/select.mjs.map +1 -1
  54. package/es/components/select/src/selectOption.mjs +1 -1
  55. package/es/components/select/src/selectOption.mjs.map +1 -1
  56. package/es/components/selectPage/src/selectPage.d.ts +39 -25
  57. package/es/components/selectPage/src/selectPage.mjs +1 -1
  58. package/es/components/selectPage/src/selectPage.mjs.map +1 -1
  59. package/es/components/selectV2/src/selectV2.d.ts +36 -44
  60. package/es/components/selectV2/src/selectV2.mjs +1 -1
  61. package/es/components/selectV2/src/selectV2.mjs.map +1 -1
  62. package/es/components/table/src/table.d.ts +6 -6
  63. package/es/components/table/src/table.mjs +1 -1
  64. package/es/components/table/src/table.mjs.map +1 -1
  65. package/es/components/table/src/table.type.d.ts +1 -1
  66. package/es/components/table/src/table.type.mjs.map +1 -1
  67. package/es/components/table/src/tableColumn.mjs +1 -1
  68. package/es/components/table/src/tableColumn.mjs.map +1 -1
  69. package/es/components/table/src/tableColumnSettingDialog.mjs +1 -1
  70. package/es/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
  71. package/es/components/table/src/useTable.mjs +1 -1
  72. package/es/components/table/src/useTable.mjs.map +1 -1
  73. package/es/components/table/utils/table.mjs +1 -1
  74. package/es/components/table/utils/table.mjs.map +1 -1
  75. package/es/components/tree/src/tree.d.ts +68 -174
  76. package/es/components/tree/src/tree.mjs +1 -1
  77. package/es/components/tree/src/tree.mjs.map +1 -1
  78. package/es/components/treeSelect/src/treeSelect.d.ts +123 -221
  79. package/es/components/treeSelect/src/treeSelect.mjs +1 -1
  80. package/es/components/treeSelect/src/treeSelect.mjs.map +1 -1
  81. package/es/directives/click-copy/index.mjs.map +1 -1
  82. package/es/directives/click-debounce/index.mjs.map +1 -1
  83. package/es/directives/click-draggable/index.mjs.map +1 -1
  84. package/es/directives/click-icon-copy/index.mjs.map +1 -1
  85. package/es/directives/click-longpress/index.mjs.map +1 -1
  86. package/es/directives/click-throttle/index.mjs.map +1 -1
  87. package/es/index.mjs +1 -1
  88. package/es/index.mjs.map +1 -1
  89. package/es/make-installer.mjs +1 -1
  90. package/es/make-installer.mjs.map +1 -1
  91. package/es/version.d.ts +1 -1
  92. package/es/version.mjs +1 -1
  93. package/es/version.mjs.map +1 -1
  94. package/lib/components/avatar/src/avatar.d.ts +4 -4
  95. package/lib/components/avatar/src/avatar.js +1 -1
  96. package/lib/components/avatar/src/avatar.js.map +1 -1
  97. package/lib/components/button/src/button.js.map +1 -1
  98. package/lib/components/carNumber/src/carNumber.d.ts +13 -5
  99. package/lib/components/carNumber/src/carNumber.js +1 -1
  100. package/lib/components/carNumber/src/carNumber.js.map +1 -1
  101. package/lib/components/contextMenu/src/contextMenu.js +1 -1
  102. package/lib/components/contextMenu/src/contextMenu.js.map +1 -1
  103. package/lib/components/dialog/src/dialog.d.ts +4 -4
  104. package/lib/components/dialog/src/dialog.js +1 -1
  105. package/lib/components/dialog/src/dialog.js.map +1 -1
  106. package/lib/components/drawer/src/drawer.d.ts +12 -4
  107. package/lib/components/drawer/src/drawer.js +1 -1
  108. package/lib/components/drawer/src/drawer.js.map +1 -1
  109. package/lib/components/form/src/form.js +1 -1
  110. package/lib/components/form/src/form.js.map +1 -1
  111. package/lib/components/form/src/formItem.js +1 -1
  112. package/lib/components/form/src/formItem.js.map +1 -1
  113. package/lib/components/formItemTip/src/formItemTip.js +1 -1
  114. package/lib/components/formItemTip/src/formItemTip.js.map +1 -1
  115. package/lib/components/icon/src/icon.js +1 -1
  116. package/lib/components/icon/src/icon.js.map +1 -1
  117. package/lib/components/iconSelector/src/iconSelector.js +1 -1
  118. package/lib/components/iconSelector/src/iconSelector.js.map +1 -1
  119. package/lib/components/image/src/image.js +1 -1
  120. package/lib/components/image/src/image.js.map +1 -1
  121. package/lib/components/index.d.ts +1 -0
  122. package/lib/components/index.js +1 -1
  123. package/lib/components/inputDialogPage/index.d.ts +14 -0
  124. package/lib/components/inputDialogPage/index.js +2 -0
  125. package/lib/components/inputDialogPage/index.js.map +1 -0
  126. package/lib/components/inputDialogPage/src/inputDialogPage.d.ts +131 -0
  127. package/lib/components/inputDialogPage/src/inputDialogPage.js +2 -0
  128. package/lib/components/inputDialogPage/src/inputDialogPage.js.map +1 -0
  129. package/lib/components/layoutGrid/src/layoutGrid.js +1 -1
  130. package/lib/components/layoutGrid/src/layoutGrid.js.map +1 -1
  131. package/lib/components/layoutGrid/src/layoutGridItem.d.ts +6 -6
  132. package/lib/components/layoutGrid/src/layoutGridItem.js +1 -1
  133. package/lib/components/layoutGrid/src/layoutGridItem.js.map +1 -1
  134. package/lib/components/select/src/select.d.ts +39 -34
  135. package/lib/components/select/src/select.js +1 -1
  136. package/lib/components/select/src/select.js.map +1 -1
  137. package/lib/components/select/src/selectOption.js +1 -1
  138. package/lib/components/select/src/selectOption.js.map +1 -1
  139. package/lib/components/selectPage/src/selectPage.d.ts +39 -25
  140. package/lib/components/selectPage/src/selectPage.js +1 -1
  141. package/lib/components/selectPage/src/selectPage.js.map +1 -1
  142. package/lib/components/selectV2/src/selectV2.d.ts +36 -44
  143. package/lib/components/selectV2/src/selectV2.js +1 -1
  144. package/lib/components/selectV2/src/selectV2.js.map +1 -1
  145. package/lib/components/table/src/table.d.ts +6 -6
  146. package/lib/components/table/src/table.js +1 -1
  147. package/lib/components/table/src/table.js.map +1 -1
  148. package/lib/components/table/src/table.type.d.ts +1 -1
  149. package/lib/components/table/src/table.type.js.map +1 -1
  150. package/lib/components/table/src/tableColumn.js +1 -1
  151. package/lib/components/table/src/tableColumn.js.map +1 -1
  152. package/lib/components/table/src/tableColumnSettingDialog.js +1 -1
  153. package/lib/components/table/src/tableColumnSettingDialog.js.map +1 -1
  154. package/lib/components/table/src/useTable.js.map +1 -1
  155. package/lib/components/table/utils/table.js +1 -1
  156. package/lib/components/table/utils/table.js.map +1 -1
  157. package/lib/components/tree/src/tree.d.ts +68 -174
  158. package/lib/components/tree/src/tree.js +1 -1
  159. package/lib/components/tree/src/tree.js.map +1 -1
  160. package/lib/components/treeSelect/src/treeSelect.d.ts +123 -221
  161. package/lib/components/treeSelect/src/treeSelect.js +1 -1
  162. package/lib/components/treeSelect/src/treeSelect.js.map +1 -1
  163. package/lib/directives/click-copy/index.js.map +1 -1
  164. package/lib/directives/click-debounce/index.js.map +1 -1
  165. package/lib/directives/click-draggable/index.js.map +1 -1
  166. package/lib/directives/click-icon-copy/index.js.map +1 -1
  167. package/lib/directives/click-longpress/index.js.map +1 -1
  168. package/lib/directives/click-throttle/index.js.map +1 -1
  169. package/lib/index.js +1 -1
  170. package/lib/index.js.map +1 -1
  171. package/lib/make-installer.js.map +1 -1
  172. package/lib/version.d.ts +1 -1
  173. package/lib/version.js +1 -1
  174. package/lib/version.js.map +1 -1
  175. package/package.json +3 -3
  176. package/styles/components/dialog.scss +1 -1
  177. package/styles/components/select.scss +35 -0
  178. package/styles/components/selectPage.scss +0 -30
  179. package/styles/components/table.scss +1 -1
  180. package/styles/components/tree.scss +17 -2
  181. package/styles/index.scss +1 -0
  182. package/types/components.d.ts +110 -1
@@ -1 +1 @@
1
- {"version":3,"file":"formItemTip.js","sources":["../../../../../packages/components/formItemTip/src/formItemTip.tsx"],"sourcesContent":["import { defineComponent } from \"vue\";\nimport { ElIcon, ElTooltip } from \"element-plus\";\nimport { QuestionFilled } from \"@element-plus/icons-vue\";\nimport { makeSlots, useRender } from \"@fast-china/utils\";\n\nexport const faFormItemTipProps = {\n\t/** @description 提示 */\n\ttips: String,\n\t/** @description 显示 */\n\tlabel: String,\n};\n\ntype FaFormItemTipSlots = {\n\t/** @description 显示插槽 */\n\tlabel: never;\n};\n\nexport default defineComponent({\n\tname: \"FaFormItemTip\",\n\tprops: faFormItemTipProps,\n\tslots: makeSlots<FaFormItemTipSlots>(),\n\tsetup(props, { slots }) {\n\t\tuseRender(() => (\n\t\t\t<div class=\"fa-form-item-tip\">\n\t\t\t\t<ElTooltip effect=\"dark\" rawContent content={props.tips} placement=\"top\">\n\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t<QuestionFilled />\n\t\t\t\t\t</ElIcon>\n\t\t\t\t</ElTooltip>\n\t\t\t\t<span class=\"fa-form-item-tip__label\">{slots.label ? slots.label() : props.label}</span>\n\t\t\t</div>\n\t\t));\n\t},\n});\n"],"names":["faFormItemTipProps","tips","String","label","FormItemTip","name","props","slots","makeSlots","setup","useRender","_createVNode","class","ElTooltip","effect","rawContent","content","placement","default","ElIcon","QuestionFilled"],"mappings":"iOAKaA,EAAqB,CAEjCC,KAAMC,OAENC,MAAOD,QAQRE,oBAA+B,CAC9BC,KAAM,gBACNC,MAAON,EACPO,MAAOC,EAAAA,YACPC,KAAAA,CAAMH,GAAOC,MAAEA,IACdG,YAAU,IAAAC,EAAAA,YAAA,MAAA,CAAAC,MAAA,oBAAA,CAAAD,EAAAA,YAAAE,YAAA,CAAAC,OAAA,OAAAC,YAAA,EAAAC,QAEqCV,EAAML,KAAIgB,UAAA,OAAA,CAAAC,QAAAA,IAAA,CAAAP,cAAAQ,EAAAA,OAAA,KAAA,CAAAD,QAAAA,IAAA,CAAAP,EAAAA,YAAAS,EAAAA,eAAA,KAAA,YAAAT,EAAAA,YAAA,OAAA,CAAAC,MAAA,2BAAA,CAKhBL,EAAMJ,MAAQI,EAAMJ,QAAUG,EAAMH,UAG9E"}
1
+ {"version":3,"file":"formItemTip.js","sources":["../../../../../packages/components/formItemTip/src/formItemTip.tsx"],"sourcesContent":["import { defineComponent } from \"vue\";\nimport { ElIcon, ElTooltip } from \"element-plus\";\nimport { QuestionFilled } from \"@element-plus/icons-vue\";\nimport { makeSlots, useRender } from \"@fast-china/utils\";\n\nexport const faFormItemTipProps = {\n\t/** @description 提示 */\n\ttips: String,\n\t/** @description 显示 */\n\tlabel: String,\n};\n\ntype FaFormItemTipSlots = {\n\t/** @description 显示插槽 */\n\tlabel: never;\n};\n\nexport default defineComponent({\n\tname: \"FaFormItemTip\",\n\tprops: faFormItemTipProps,\n\tslots: makeSlots<FaFormItemTipSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tuseRender(() => (\n\t\t\t<div class=\"fa-form-item-tip\">\n\t\t\t\t<ElTooltip effect=\"dark\" rawContent content={props.tips} placement=\"top\">\n\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t<QuestionFilled />\n\t\t\t\t\t</ElIcon>\n\t\t\t\t</ElTooltip>\n\t\t\t\t<span class=\"fa-form-item-tip__label\">{slots.label ? slots.label() : props.label}</span>\n\t\t\t</div>\n\t\t));\n\t},\n});\n"],"names":["faFormItemTipProps","tips","String","label","FormItemTip","name","props","slots","makeSlots","setup","attrs","emit","expose","useRender","_createVNode","class","ElTooltip","effect","rawContent","content","placement","default","ElIcon","QuestionFilled"],"mappings":"iOAKaA,EAAqB,CAEjCC,KAAMC,OAENC,MAAOD,QAQRE,oBAA+B,CAC9BC,KAAM,gBACNC,MAAON,EACPO,MAAOC,EAAAA,YACPC,KAAAA,CAAMH,GAAOI,MAAEA,EAAAA,MAAOH,EAAAA,KAAOI,EAAAA,OAAMC,IAClCC,YAAU,IAAAC,EAAAA,YAAA,MAAA,CAAAC,MAAA,oBAAA,CAAAD,EAAAA,YAAAE,YAAA,CAAAC,OAAA,OAAAC,YAAA,EAAAC,QAEqCb,EAAML,KAAImB,UAAA,OAAA,CAAAC,QAAAA,IAAA,CAAAP,cAAAQ,EAAAA,OAAA,KAAA,CAAAD,QAAAA,IAAA,CAAAP,EAAAA,YAAAS,EAAAA,eAAA,KAAA,YAAAT,EAAAA,YAAA,OAAA,CAAAC,MAAA,2BAAA,CAKhBR,EAAMJ,MAAQI,EAAMJ,QAAUG,EAAMH,UAG9E"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus");require("../../../constants/index.js");const n=require("@fast-china/utils"),o=require("../../../constants/regex.js");function r(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!e.isVNode(t)}const s={name:{type:String,required:!0},size:{type:[String,Number]},color:String},a=e.defineComponent({name:"FaIcon",props:s,setup(s,{attrs:a}){const l=e.reactive({isUrl:e.computed(()=>o.RegExps.External.test(s.name)),style:e.computed(()=>{const e={};return s.size&&(e.size=n.addUnit(s.size)),s.color&&(e.color=s.color),l.isUrl&&(e.mask=`url(${s.name}) no-repeat 50% 50%`,e["-webkit-mask"]=`url(${s.name}) no-repeat 50% 50%`),e})});n.useRender(()=>{let n,o;return 0===s.name.indexOf("el-icon-")?e.createVNode(t.ElIcon,e.mergeProps(a,s,{class:["fa-icon",s.name]}),r(n=e.h(e.resolveComponent(s.name)))?n:{default:()=>[n]}):0===s.name.indexOf("fa-icon")?e.createVNode(t.ElIcon,e.mergeProps(a,s,{class:["fa-icon",s.name]}),r(o=e.h(e.resolveComponent(s.name)))?o:{default:()=>[o]}):l.isUrl?e.createVNode("div",e.mergeProps(a,{class:"el-icon fa-icon url-icon",style:l.style}),null):e.createVNode("i",e.mergeProps(a,{class:["el-icon fa-icon",s.name],style:l.style}),null)})}});exports.default=a,exports.faIconProps=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus");require("../../../constants/index.js");const o=require("@fast-china/utils"),n=require("../../../constants/regex.js");function r(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!e.isVNode(t)}const s={name:{type:String,required:!0},size:{type:[String,Number]},color:String},a=e.defineComponent({name:"FaIcon",props:s,setup(s,{attrs:a,slots:l,emit:i,expose:c}){const u=e.reactive({isUrl:e.computed(()=>n.RegExps.External.test(s.name)),style:e.computed(()=>{const e={};return s.size&&(e.size=o.addUnit(s.size)),s.color&&(e.color=s.color),u.isUrl&&(e.mask=`url(${s.name}) no-repeat 50% 50%`,e["-webkit-mask"]=`url(${s.name}) no-repeat 50% 50%`),e})});o.useRender(()=>{let o,n;return 0===s.name.indexOf("el-icon-")?e.createVNode(t.ElIcon,e.mergeProps(a,s,{class:["fa-icon",s.name]}),r(o=e.h(e.resolveComponent(s.name)))?o:{default:()=>[o]}):0===s.name.indexOf("fa-icon")?e.createVNode(t.ElIcon,e.mergeProps(a,s,{class:["fa-icon",s.name]}),r(n=e.h(e.resolveComponent(s.name)))?n:{default:()=>[n]}):u.isUrl?e.createVNode("div",e.mergeProps(a,{class:"el-icon fa-icon url-icon",style:u.style}),null):e.createVNode("i",e.mergeProps(a,{class:["el-icon fa-icon",s.name],style:u.style}),null)})}});exports.default=a,exports.faIconProps=s;
2
2
  //# sourceMappingURL=icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sources":["../../../../../packages/components/icon/src/icon.tsx"],"sourcesContent":["import { computed, defineComponent, h, reactive, resolveComponent } from \"vue\";\nimport { ElIcon } from \"element-plus\";\nimport { RegExps } from \"@fast-element-plus/constants\";\nimport { addUnit, useRender } from \"@fast-china/utils\";\nimport type { CSSProperties } from \"vue\";\n\nexport const faIconProps = {\n\t/** @description el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */\n\tname: {\n\t\ttype: String,\n\t\trequired: true,\n\t},\n\t/** @description 大小 */\n\tsize: {\n\t\ttype: [String, Number],\n\t},\n\t/** @description 颜色*/\n\tcolor: String,\n};\n\nexport default defineComponent({\n\tname: \"FaIcon\",\n\tprops: faIconProps,\n\tsetup(props, { attrs }) {\n\t\tconst state = reactive({\n\t\t\tisUrl: computed(() => RegExps.External.test(props.name)),\n\t\t\tstyle: computed((): CSSProperties => {\n\t\t\t\tconst result: any = {};\n\t\t\t\tif (props.size) {\n\t\t\t\t\tresult.size = addUnit(props.size);\n\t\t\t\t}\n\t\t\t\tif (props.color) {\n\t\t\t\t\tresult.color = props.color;\n\t\t\t\t}\n\t\t\t\tif (state.isUrl) {\n\t\t\t\t\tresult.mask = `url(${props.name}) no-repeat 50% 50%`;\n\t\t\t\t\tresult[\"-webkit-mask\"] = `url(${props.name}) no-repeat 50% 50%`;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}),\n\t\t});\n\n\t\tuseRender(() =>\n\t\t\tprops.name.indexOf(\"el-icon-\") === 0 ? (\n\t\t\t\t<ElIcon {...attrs} {...props} class={[\"fa-icon\", props.name]}>\n\t\t\t\t\t{h(resolveComponent(props.name))}\n\t\t\t\t</ElIcon>\n\t\t\t) : props.name.indexOf(\"fa-icon\") === 0 ? (\n\t\t\t\t<ElIcon {...attrs} {...props} class={[\"fa-icon\", props.name]}>\n\t\t\t\t\t{h(resolveComponent(props.name))}\n\t\t\t\t</ElIcon>\n\t\t\t) : state.isUrl ? (\n\t\t\t\t<div {...attrs} class=\"el-icon fa-icon url-icon\" style={state.style} />\n\t\t\t) : (\n\t\t\t\t<i {...attrs} class={[\"el-icon fa-icon\", props.name]} style={state.style} />\n\t\t\t)\n\t\t);\n\t},\n});\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","faIconProps","name","type","String","required","size","Number","color","Icon","props","setup","attrs","state","reactive","isUrl","computed","RegExps","External","test","style","result","addUnit","mask","useRender","_slot","_slot2","indexOf","_createVNode","ElIcon","_mergeProps","class","h","resolveComponent","default"],"mappings":"kRAGuD,SAAAA,EAAAC,GAAA,MAAA,mBAAAA,GAAA,oBAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,KAAAK,EAAAA,QAAAL,EAAA,CAGhD,MAAMM,EAAc,CAE1BC,KAAM,CACLC,KAAMC,OACNC,UAAU,GAGXC,KAAM,CACLH,KAAM,CAACC,OAAQG,SAGhBC,MAAOJ,QAGRK,oBAA+B,CAC9BP,KAAM,SACNQ,MAAOT,EACPU,KAAAA,CAAMD,GAAOE,MAAEA,IACd,MAAMC,EAAQC,EAAAA,SAAS,CACtBC,MAAOC,EAAAA,SAAS,IAAMC,EAAAA,QAAQC,SAASC,KAAKT,EAAMR,OAClDkB,MAAOJ,EAAAA,SAAS,KACf,MAAMK,EAAc,CAAA,EAWpB,OAVIX,EAAMJ,OACTe,EAAOf,KAAOgB,UAAQZ,EAAMJ,OAEzBI,EAAMF,QACTa,EAAOb,MAAQE,EAAMF,OAElBK,EAAME,QACTM,EAAOE,KAAO,OAAOb,EAAMR,0BAC3BmB,EAAO,gBAAkB,OAAOX,EAAMR,2BAEhCmB,MAITG,EAAAA,UAAU,KAAA,IAAAC,EAAAC,EAAA,OAC0B,IAAnChB,EAAMR,KAAKyB,QAAQ,YAAiBC,EAAAA,YAAAC,EAAAA,OAAAC,aACvBlB,EAAWF,EAAK,CAAAqB,MAAS,CAAC,UAAWrB,EAAMR,QAAKR,EAAA+B,EAC1DO,IAAEC,EAAAA,iBAAiBvB,EAAMR,QAAMuB,EAAA,CAAAS,QAAAA,IAAA,CAAAT,KAEI,IAAlCf,EAAMR,KAAKyB,QAAQ,WAAgBC,EAAAA,YAAAC,EAAAA,OAAAC,aAC1BlB,EAAWF,EAAK,CAAAqB,MAAS,CAAC,UAAWrB,EAAMR,QAAKR,EAAAgC,EAC1DM,IAAEC,EAAAA,iBAAiBvB,EAAMR,QAAMwB,EAAA,CAAAQ,QAAAA,IAAA,CAAAR,KAE9Bb,EAAME,MAAKa,EAAAA,YAAA,MAAAE,EAAAA,WACLlB,EAAK,CAAAmB,MAAA,2BAAAX,MAA0CP,EAAMO,QAAK,MAAAQ,EAAAA,YAAA,IAAAE,EAAAA,WAE5DlB,EAAK,CAAAmB,MAAS,CAAC,kBAAmBrB,EAAMR,MAAKkB,MAASP,EAAMO,QAAK,OAG3E"}
1
+ {"version":3,"file":"icon.js","sources":["../../../../../packages/components/icon/src/icon.tsx"],"sourcesContent":["import { computed, defineComponent, h, reactive, resolveComponent } from \"vue\";\nimport { ElIcon } from \"element-plus\";\nimport { RegExps } from \"@fast-element-plus/constants\";\nimport { addUnit, useRender } from \"@fast-china/utils\";\nimport type { CSSProperties } from \"vue\";\n\nexport const faIconProps = {\n\t/** @description el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */\n\tname: {\n\t\ttype: String,\n\t\trequired: true,\n\t},\n\t/** @description 大小 */\n\tsize: {\n\t\ttype: [String, Number],\n\t},\n\t/** @description 颜色*/\n\tcolor: String,\n};\n\nexport default defineComponent({\n\tname: \"FaIcon\",\n\tprops: faIconProps,\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tisUrl: computed(() => RegExps.External.test(props.name)),\n\t\t\tstyle: computed((): CSSProperties => {\n\t\t\t\tconst result: any = {};\n\t\t\t\tif (props.size) {\n\t\t\t\t\tresult.size = addUnit(props.size);\n\t\t\t\t}\n\t\t\t\tif (props.color) {\n\t\t\t\t\tresult.color = props.color;\n\t\t\t\t}\n\t\t\t\tif (state.isUrl) {\n\t\t\t\t\tresult.mask = `url(${props.name}) no-repeat 50% 50%`;\n\t\t\t\t\tresult[\"-webkit-mask\"] = `url(${props.name}) no-repeat 50% 50%`;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}),\n\t\t});\n\n\t\tuseRender(() =>\n\t\t\tprops.name.indexOf(\"el-icon-\") === 0 ? (\n\t\t\t\t<ElIcon {...attrs} {...props} class={[\"fa-icon\", props.name]}>\n\t\t\t\t\t{h(resolveComponent(props.name))}\n\t\t\t\t</ElIcon>\n\t\t\t) : props.name.indexOf(\"fa-icon\") === 0 ? (\n\t\t\t\t<ElIcon {...attrs} {...props} class={[\"fa-icon\", props.name]}>\n\t\t\t\t\t{h(resolveComponent(props.name))}\n\t\t\t\t</ElIcon>\n\t\t\t) : state.isUrl ? (\n\t\t\t\t<div {...attrs} class=\"el-icon fa-icon url-icon\" style={state.style} />\n\t\t\t) : (\n\t\t\t\t<i {...attrs} class={[\"el-icon fa-icon\", props.name]} style={state.style} />\n\t\t\t)\n\t\t);\n\t},\n});\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","faIconProps","name","type","String","required","size","Number","color","Icon","props","setup","attrs","slots","emit","expose","state","reactive","isUrl","computed","RegExps","External","test","style","result","addUnit","mask","useRender","_slot","_slot2","indexOf","_createVNode","ElIcon","_mergeProps","class","h","resolveComponent","default"],"mappings":"kRAGuD,SAAAA,EAAAC,GAAA,MAAA,mBAAAA,GAAA,oBAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,KAAAK,EAAAA,QAAAL,EAAA,CAGhD,MAAMM,EAAc,CAE1BC,KAAM,CACLC,KAAMC,OACNC,UAAU,GAGXC,KAAM,CACLH,KAAM,CAACC,OAAQG,SAGhBC,MAAOJ,QAGRK,oBAA+B,CAC9BP,KAAM,SACNQ,MAAOT,EACPU,KAAAA,CAAMD,GAAOE,MAAEA,EAAAA,MAAOC,EAAAA,KAAOC,EAAAA,OAAMC,IAClC,MAAMC,EAAQC,EAAAA,SAAS,CACtBC,MAAOC,EAAAA,SAAS,IAAMC,EAAAA,QAAQC,SAASC,KAAKZ,EAAMR,OAClDqB,MAAOJ,EAAAA,SAAS,KACf,MAAMK,EAAc,CAAA,EAWpB,OAVId,EAAMJ,OACTkB,EAAOlB,KAAOmB,UAAQf,EAAMJ,OAEzBI,EAAMF,QACTgB,EAAOhB,MAAQE,EAAMF,OAElBQ,EAAME,QACTM,EAAOE,KAAO,OAAOhB,EAAMR,0BAC3BsB,EAAO,gBAAkB,OAAOd,EAAMR,2BAEhCsB,MAITG,EAAAA,UAAU,KAAA,IAAAC,EAAAC,EAAA,OAC0B,IAAnCnB,EAAMR,KAAK4B,QAAQ,YAAiBC,EAAAA,YAAAC,EAAAA,OAAAC,aACvBrB,EAAWF,EAAK,CAAAwB,MAAS,CAAC,UAAWxB,EAAMR,QAAKR,EAAAkC,EAC1DO,IAAEC,EAAAA,iBAAiB1B,EAAMR,QAAM0B,EAAA,CAAAS,QAAAA,IAAA,CAAAT,KAEI,IAAlClB,EAAMR,KAAK4B,QAAQ,WAAgBC,EAAAA,YAAAC,EAAAA,OAAAC,aAC1BrB,EAAWF,EAAK,CAAAwB,MAAS,CAAC,UAAWxB,EAAMR,QAAKR,EAAAmC,EAC1DM,IAAEC,EAAAA,iBAAiB1B,EAAMR,QAAM2B,EAAA,CAAAQ,QAAAA,IAAA,CAAAR,KAE9Bb,EAAME,MAAKa,EAAAA,YAAA,MAAAE,EAAAA,WACLrB,EAAK,CAAAsB,MAAA,2BAAAX,MAA0CP,EAAMO,QAAK,MAAAQ,EAAAA,YAAA,IAAAE,EAAAA,WAE5DrB,EAAK,CAAAsB,MAAS,CAAC,kBAAmBxB,EAAMR,MAAKqB,MAASP,EAAMO,QAAK,OAG3E"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("element-plus"),t=require("@element-plus/icons-vue"),l=require("../../icon/index.js"),a=require("@fast-element-plus/icons-vue"),c=require("@fast-china/utils"),r=require("lodash-unified");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}return o.default=e,Object.freeze(o)}const i=s(t);const n=e.defineComponent({name:"FaIconSelector",props:{modelValue:String,customIcons:c.definePropType(Array)},emits:{"update:modelValue":e=>r.isString(e)||r.isNull(e),change:e=>r.isString(e)||r.isNull(e)},setup(r,{attrs:s,slots:n,emit:u,expose:d}){const p=e.reactive({value:c.withDefineType(),searchValue:c.withDefineType(),iconType:c.withDefineType("ele"),popoverVisible:!1,iconNames:c.withDefineType(Object.keys(i)),renderIconNames:e.computed(()=>p.searchValue?p.iconNames.filter(e=>-1!==e.toLowerCase().indexOf(p.searchValue.toLowerCase())):p.iconNames)}),f=e=>{switch(p.iconType=e,p.iconNames=[],e){case"ele":p.iconNames=Object.keys(i).map(e=>`el-icon-${e}`);break;case"fastEle":p.iconNames=Object.keys(a).map(e=>`fa-icon-${e}`);break;case"local":p.iconNames=r.customIcons}},V=()=>{p.value=null,p.searchValue=null,u("update:modelValue",null),u("change",null)};return c.useRender(()=>e.createVNode(o.ElPopover,{popperClass:"fa-icon-selector-popover",visible:p.popoverVisible,width:"auto",trigger:"click",showArrow:!1,showAfter:0,hideAfter:0},{reference:()=>e.createVNode(o.ElInput,{modelValue:p.searchValue,"onUpdate:modelValue":e=>p.searchValue=e,placeholder:"搜索图标"},{prepend:()=>e.createVNode(o.ElIcon,null,{default:()=>[e.createVNode(t.ChromeFilled,null,null)]}),append:()=>e.createVNode(o.ElIcon,{onClick:V},{default:()=>[e.createVNode(t.RefreshRight,null,null)]})}),default:()=>{let t;return e.createVNode("div",{class:"fa-icon-selector-popover__box"},[e.createVNode("div",{class:"fa-icon-selector-popover__box-header"},[e.createVNode("div",{class:"fa-icon-selector-popover__box-header__title"},[e.createTextVNode("请选择图标")]),e.createVNode("div",{class:"fa-icon-selector-popover__box-header__tab"},[e.createVNode("span",{class:{"is-active":"ele"===p.iconType},title:"Element Plus 图标",onClick:()=>f("ele")},[e.createTextVNode("ele")]),e.createVNode("span",{class:{"is-active":"fastEle"===p.iconType},title:"Fast Element Plus 图标",onClick:()=>f("fastEle")},[e.createTextVNode("fastEle")]),e.createVNode("span",{class:{"is-active":"local"===p.iconType},title:"本地图标",onClick:()=>f("local")},[e.createTextVNode("local")])])]),e.createVNode("div",{class:"fa-icon-selector-popover__box-body"},[e.createVNode(o.ElScrollbar,null,(a=t=p.renderIconNames.map(o=>e.createVNode("div",{class:"fa-icon-selector-popover__box-body__item",title:o,onClick:()=>{return e=o,p.popoverVisible=!1,p.value=e,p.searchValue="",u("update:modelValue",e),void u("change",e);var e}},[e.createVNode(l.FaIcon,{name:o},null)])),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!e.isVNode(a)?t:{default:()=>[t]}))])]);var a}})),c.useExpose(d,{iconType:p.iconType})}});exports.default=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("element-plus"),t=require("@element-plus/icons-vue"),l=require("../../icon/index.js"),a=require("@fast-element-plus/icons-vue"),c=require("@fast-china/utils"),r=require("lodash-unified");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}return o.default=e,Object.freeze(o)}const i=s(t),n=s(a);const u=e.defineComponent({name:"FaIconSelector",props:{modelValue:String,customIcons:c.definePropType(Array)},emits:{"update:modelValue":e=>r.isString(e)||r.isNull(e),change:e=>r.isString(e)||r.isNull(e)},setup(a,{attrs:r,slots:s,emit:u,expose:d}){const p=e.reactive({value:c.withDefineType(),searchValue:c.withDefineType(),iconType:c.withDefineType("ele"),popoverVisible:!1,iconNames:c.withDefineType(Object.keys(i)),renderIconNames:e.computed(()=>p.searchValue?p.iconNames.filter(e=>-1!==e.toLowerCase().indexOf(p.searchValue.toLowerCase())):p.iconNames)}),f=e=>{switch(p.iconType=e,p.iconNames=[],e){case"ele":p.iconNames=Object.keys(i).map(e=>`el-icon-${e}`);break;case"fastEle":p.iconNames=Object.keys(n).map(e=>`fa-icon-${e}`);break;case"local":p.iconNames=a.customIcons}},V=()=>{p.value=null,p.searchValue=null,u("update:modelValue",null),u("change",null)};return c.useRender(()=>e.createVNode(o.ElPopover,{popperClass:"fa-icon-selector-popover",visible:p.popoverVisible,width:"auto",trigger:"click",showArrow:!1,showAfter:0,hideAfter:0},{reference:()=>e.createVNode(o.ElInput,{modelValue:p.searchValue,"onUpdate:modelValue":e=>p.searchValue=e,placeholder:"搜索图标"},{prepend:()=>e.createVNode(o.ElIcon,null,{default:()=>[e.createVNode(t.ChromeFilled,null,null)]}),append:()=>e.createVNode(o.ElIcon,{onClick:V},{default:()=>[e.createVNode(t.RefreshRight,null,null)]})}),default:()=>{let t;return e.createVNode("div",{class:"fa-icon-selector-popover__box"},[e.createVNode("div",{class:"fa-icon-selector-popover__box-header"},[e.createVNode("div",{class:"fa-icon-selector-popover__box-header__title"},[e.createTextVNode("请选择图标")]),e.createVNode("div",{class:"fa-icon-selector-popover__box-header__tab"},[e.createVNode("span",{class:{"is-active":"ele"===p.iconType},title:"Element Plus 图标",onClick:()=>f("ele")},[e.createTextVNode("ele")]),e.createVNode("span",{class:{"is-active":"fastEle"===p.iconType},title:"Fast Element Plus 图标",onClick:()=>f("fastEle")},[e.createTextVNode("fastEle")]),e.createVNode("span",{class:{"is-active":"local"===p.iconType},title:"本地图标",onClick:()=>f("local")},[e.createTextVNode("local")])])]),e.createVNode("div",{class:"fa-icon-selector-popover__box-body"},[e.createVNode(o.ElScrollbar,null,(a=t=p.renderIconNames.map(o=>e.createVNode("div",{class:"fa-icon-selector-popover__box-body__item",title:o,onClick:()=>{return e=o,p.popoverVisible=!1,p.value=e,p.searchValue="",u("update:modelValue",e),void u("change",e);var e}},[e.createVNode(l.FaIcon,{name:o},null)])),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!e.isVNode(a)?t:{default:()=>[t]}))])]);var a}})),c.useExpose(d,{iconType:p.iconType})}});exports.default=u;
2
2
  //# sourceMappingURL=iconSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"iconSelector.js","sources":["../../../../../packages/components/iconSelector/src/iconSelector.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElIcon, ElInput, ElPopover, ElScrollbar } from \"element-plus\";\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport { ChromeFilled, RefreshRight } from \"@element-plus/icons-vue\";\nimport { FaIcon } from \"@fast-element-plus/components/icon\";\nimport FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport { definePropType, useExpose, useRender, withDefineType } from \"@fast-china/utils\";\nimport { isNull, isString } from \"lodash-unified\";\n\ntype IconType = \"ele\" | \"fastEle\" | \"local\";\n\nexport default defineComponent({\n\tname: \"FaIconSelector\",\n\tprops: {\n\t\t/** @description v-model绑定值 */\n\t\tmodelValue: String,\n\t\t/** @description 自定义图标 */\n\t\tcustomIcons: definePropType<string[]>(Array),\n\t},\n\temits: {\n\t\t/** @description v-model 回调 */\n\t\t\"update:modelValue\": (value: string) => isString(value) || isNull(value),\n\t\t/** @description 改变 */\n\t\tchange: (value: string) => isString(value) || isNull(value),\n\t},\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string>(),\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\ticonType: withDefineType<IconType>(\"ele\"),\n\t\t\tpopoverVisible: false,\n\t\t\ticonNames: withDefineType<string[]>(Object.keys(ElementPlusIconsVue)),\n\t\t\trenderIconNames: computed((): string[] => {\n\t\t\t\tif (!state.searchValue) return state.iconNames;\n\t\t\t\treturn state.iconNames.filter((f) => f.toLowerCase().indexOf(state.searchValue.toLowerCase()) !== -1);\n\t\t\t}),\n\t\t});\n\n\t\tconst handleTabClick = (iconType: IconType): void => {\n\t\t\tstate.iconType = iconType;\n\t\t\tstate.iconNames = [];\n\t\t\tswitch (iconType) {\n\t\t\t\tcase \"ele\":\n\t\t\t\t\tstate.iconNames = Object.keys(ElementPlusIconsVue).map((m) => `el-icon-${m}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fastEle\":\n\t\t\t\t\tstate.iconNames = Object.keys(FastElementPlusIconsVue).map((m) => `fa-icon-${m}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"local\":\n\t\t\t\t\tstate.iconNames = props.customIcons;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tconst handleIconClick = (value: string): void => {\n\t\t\tstate.popoverVisible = false;\n\t\t\tstate.value = value;\n\t\t\tstate.searchValue = \"\";\n\t\t\temit(\"update:modelValue\", value);\n\t\t\temit(\"change\", value);\n\t\t};\n\n\t\tconst handleRefresh = (): void => {\n\t\t\tstate.value = null;\n\t\t\tstate.searchValue = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<ElPopover\n\t\t\t\tpopperClass=\"fa-icon-selector-popover\"\n\t\t\t\tvisible={state.popoverVisible}\n\t\t\t\twidth=\"auto\"\n\t\t\t\ttrigger=\"click\"\n\t\t\t\tshowArrow={false}\n\t\t\t\tshowAfter={0}\n\t\t\t\thideAfter={0}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\treference: () => (\n\t\t\t\t\t\t<ElInput vModel={state.searchValue} placeholder=\"搜索图标\">\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\tprepend: () => (\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<ChromeFilled />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t\t\t<ElIcon onClick={handleRefresh}>\n\t\t\t\t\t\t\t\t\t\t<RefreshRight />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElInput>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box\">\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header\">\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__title\">请选择图标</div>\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__tab\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"ele\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"ele\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tele\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"fastEle\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Fast Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"fastEle\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tfastEle\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"local\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"本地图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"local\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tlocal\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-body\">\n\t\t\t\t\t\t\t\t<ElScrollbar>\n\t\t\t\t\t\t\t\t\t{state.renderIconNames.map((m) => (\n\t\t\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-body__item\" title={m} onClick={() => handleIconClick(m)}>\n\t\t\t\t\t\t\t\t\t\t\t<FaIcon name={m} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElPopover>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\ticonType: state.iconType,\n\t\t});\n\t},\n});\n"],"names":["IconSelector","name","props","modelValue","String","customIcons","definePropType","Array","emits","isString","value","isNull","change","setup","attrs","slots","emit","expose","state","reactive","withDefineType","searchValue","iconType","popoverVisible","iconNames","Object","keys","ElementPlusIconsVue","renderIconNames","computed","filter","f","toLowerCase","indexOf","handleTabClick","map","m","FastElementPlusIconsVue","handleRefresh","useRender","_createVNode","ElPopover","popperClass","visible","width","trigger","showArrow","showAfter","hideAfter","reference","ElInput","$event","placeholder","prepend","ElIcon","default","ChromeFilled","append","onClick","RefreshRight","_slot","class","_createTextVNode","title","ElScrollbar","s","handleIconClick","FaIcon","prototype","toString","call","_isVNode","useExpose"],"mappings":"gmBAWA,MAAAA,oBAA+B,CAC9BC,KAAM,iBACNC,MAAO,CAENC,WAAYC,OAEZC,YAAaC,EAAAA,eAAyBC,QAEvCC,MAAO,CAEN,uBAAwCC,EAAAA,SAASC,IAAUC,EAAAA,OAAOD,GAElEE,UAA2BH,EAAAA,SAASC,IAAUC,EAAAA,OAAOD,IAEtDG,KAAAA,CAAMX,GAAOY,MAAEA,EAAAA,MAAOC,EAAAA,KAAOC,EAAAA,OAAMC,IAClC,MAAMC,EAAQC,EAAAA,SAAS,CACtBT,MAAOU,EAAAA,iBACPC,YAAaD,EAAAA,iBACbE,SAAUF,EAAAA,eAAyB,OACnCG,gBAAgB,EAChBC,UAAWJ,EAAAA,eAAyBK,OAAOC,KAAKC,IAChDC,gB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AAAA,2BAAAtB,EAAAA,YAAA,MAAA,CAAAqB,MAAA,6CAAA,CAAArB,EAAAA,YAAA,OAAA,CAAAqB,MAMG,CAAE,YAAgC,QAAnB3C,EAAMI,UAAoByC,MAAA,kBAAAL,QAEvCA,IAAMxB,EAAe,QAAM,CAAA4B,EAAAA,yBAAAtB,EAAAA,YAAA,OAAA,CAAAqB,MAK7B,CAAE,YAAgC,YAAnB3C,EAAMI,UAAwByC,MAAA,uBAAAL,QAE3CA,IAAMxB,EAAe,YAAU,CAAA4B,EAAAA,6BAAAtB,EAAAA,YAAA,OAAA,CAAAqB,MAKjC,CAAE,YAAgC,UAAnB3C,EAAMI,UAAsByC,MAAA,OAAAL,QAEzCA,IAAMxB,EAAe,UAAQ,CAAA4B,EAAAA,+BAAAtB,EAAAA,YAAA,MAAA,CAAAqB,MAAA,sCAAA,CAAArB,EAAAA,YAAAwB,cAAA,MA/GEC,EA+GFL,EAQtC1C,EAAMU,gBAAgBO,IAAKC,GAACI,EAAAA,YAAA,MAAA,CAAAqB,MAAA,2CAAAE,MACiC3B,EAACsB,QAAWA,KAAMQ,OAzE9DxD,EAyE8E0B,EAxEtGlB,EAAMK,gBAAiB,EACvBL,EAAMR,MAAQA,EACdQ,EAAMG,YAAc,GACpBL,EAAK,oBAAqBN,QAC1BM,EAAK,SAAUN,GALSA,IAAAA,IAyEgF,CAAA8B,EAAAA,YAAA2B,SAAA,CAAAlE,KAClFmC,GAAC,SAzHwB,mBAAA6B,GAAA,oBAAAxC,OAAA2C,UAAAC,SAAAC,KAAAL,KAAAM,EAAAA,QAAAN,GA2HvCL,EAAA,CAAAL,QAAAA,IAAA,CAAAK,UA3HuC,IAAAK,MAoIzCO,EAAAA,UAAUvD,EAAQ,CACxBK,SAAUJ,EAAMI,UAElB"}
1
+ {"version":3,"file":"iconSelector.js","sources":["../../../../../packages/components/iconSelector/src/iconSelector.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElIcon, ElInput, ElPopover, ElScrollbar } from \"element-plus\";\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport { ChromeFilled, RefreshRight } from \"@element-plus/icons-vue\";\nimport { FaIcon } from \"@fast-element-plus/components/icon\";\nimport * as FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport { definePropType, useExpose, useRender, withDefineType } from \"@fast-china/utils\";\nimport { isNull, isString } from \"lodash-unified\";\n\ntype IconType = \"ele\" | \"fastEle\" | \"local\";\n\nexport default defineComponent({\n\tname: \"FaIconSelector\",\n\tprops: {\n\t\t/** @description v-model绑定值 */\n\t\tmodelValue: String,\n\t\t/** @description 自定义图标 */\n\t\tcustomIcons: definePropType<string[]>(Array),\n\t},\n\temits: {\n\t\t/** @description v-model 回调 */\n\t\t\"update:modelValue\": (value: string) => isString(value) || isNull(value),\n\t\t/** @description 改变 */\n\t\tchange: (value: string) => isString(value) || isNull(value),\n\t},\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string>(),\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\ticonType: withDefineType<IconType>(\"ele\"),\n\t\t\tpopoverVisible: false,\n\t\t\ticonNames: withDefineType<string[]>(Object.keys(ElementPlusIconsVue)),\n\t\t\trenderIconNames: computed((): string[] => {\n\t\t\t\tif (!state.searchValue) return state.iconNames;\n\t\t\t\treturn state.iconNames.filter((f) => f.toLowerCase().indexOf(state.searchValue.toLowerCase()) !== -1);\n\t\t\t}),\n\t\t});\n\n\t\tconst handleTabClick = (iconType: IconType): void => {\n\t\t\tstate.iconType = iconType;\n\t\t\tstate.iconNames = [];\n\t\t\tswitch (iconType) {\n\t\t\t\tcase \"ele\":\n\t\t\t\t\tstate.iconNames = Object.keys(ElementPlusIconsVue).map((m) => `el-icon-${m}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fastEle\":\n\t\t\t\t\tstate.iconNames = Object.keys(FastElementPlusIconsVue).map((m) => `fa-icon-${m}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"local\":\n\t\t\t\t\tstate.iconNames = props.customIcons;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tconst handleIconClick = (value: string): void => {\n\t\t\tstate.popoverVisible = false;\n\t\t\tstate.value = value;\n\t\t\tstate.searchValue = \"\";\n\t\t\temit(\"update:modelValue\", value);\n\t\t\temit(\"change\", value);\n\t\t};\n\n\t\tconst handleRefresh = (): void => {\n\t\t\tstate.value = null;\n\t\t\tstate.searchValue = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<ElPopover\n\t\t\t\tpopperClass=\"fa-icon-selector-popover\"\n\t\t\t\tvisible={state.popoverVisible}\n\t\t\t\twidth=\"auto\"\n\t\t\t\ttrigger=\"click\"\n\t\t\t\tshowArrow={false}\n\t\t\t\tshowAfter={0}\n\t\t\t\thideAfter={0}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\treference: () => (\n\t\t\t\t\t\t<ElInput vModel={state.searchValue} placeholder=\"搜索图标\">\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\tprepend: () => (\n\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t<ChromeFilled />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t\t\t<ElIcon onClick={handleRefresh}>\n\t\t\t\t\t\t\t\t\t\t<RefreshRight />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElInput>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box\">\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header\">\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__title\">请选择图标</div>\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__tab\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"ele\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"ele\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tele\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"fastEle\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Fast Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"fastEle\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tfastEle\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"local\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"本地图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"local\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tlocal\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-body\">\n\t\t\t\t\t\t\t\t<ElScrollbar>\n\t\t\t\t\t\t\t\t\t{state.renderIconNames.map((m) => (\n\t\t\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-body__item\" title={m} onClick={() => handleIconClick(m)}>\n\t\t\t\t\t\t\t\t\t\t\t<FaIcon name={m} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElPopover>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\ticonType: state.iconType,\n\t\t});\n\t},\n});\n"],"names":["IconSelector","name","props","modelValue","String","customIcons","definePropType","Array","emits","isString","value","isNull","change","setup","attrs","slots","emit","expose","state","reactive","withDefineType","searchValue","iconType","popoverVisible","iconNames","Object","keys","ElementPlusIconsVue","renderIconNames","computed","filter","f","toLowerCase","indexOf","handleTabClick","map","m","FastElementPlusIconsVue","handleRefresh","useRender","_createVNode","ElPopover","popperClass","visible","width","trigger","showArrow","showAfter","hideAfter","reference","ElInput","$event","placeholder","prepend","ElIcon","default","ChromeFilled","append","onClick","RefreshRight","_slot","class","_createTextVNode","title","ElScrollbar","s","handleIconClick","FaIcon","prototype","toString","call","_isVNode","useExpose"],"mappings":"umBAWA,MAAAA,oBAA+B,CAC9BC,KAAM,iBACNC,MAAO,CAENC,WAAYC,OAEZC,YAAaC,EAAAA,eAAyBC,QAEvCC,MAAO,CAEN,uBAAwCC,EAAAA,SAASC,IAAUC,EAAAA,OAAOD,GAElEE,UAA2BH,EAAAA,SAASC,IAAUC,EAAAA,OAAOD,IAEtDG,KAAAA,CAAMX,GAAOY,MAAEA,EAAAA,MAAOC,EAAAA,KAAOC,EAAAA,OAAMC,IAClC,MAAMC,EAAQC,EAAAA,SAAS,CACtBT,MAAOU,EAAAA,iBACPC,YAAaD,EAAAA,iBACbE,SAAUF,EAAAA,eAAyB,OACnCG,gBAAgB,EAChBC,UAAWJ,EAAAA,eAAyBK,OAAOC,KAAKC,IAChDC,gBAAiBC,EAAAA,SAAS,IACpBX,EAAMG,YACJH,EAAMM,UAAUM,OAAQC,IAAmE,IAA7DA,EAAEC,cAAcC,QAAQf,EAAMG,YAAYW,gBADhDd,EAAMM,aAKjCU,EAAkBZ,IAGvB,OAFA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AAMxB,EAAe,QAAM,CAAA4B,EAAAA,yBAAAtB,EAAAA,YAAA,OAAA,CAAAqB,MAK7B,CAAE,YAAgC,YAAnB3C,EAAMI,UAAwByC,MAAA,uBAAAL,QAE3CA,IAAMxB,EAAe,YAAU,CAAA4B,EAAAA,6BAAAtB,EAAAA,YAAA,OAAA,CAAAqB,MAKjC,CAAE,YAAgC,UAAnB3C,EAAMI,UAAsByC,MAAA,OAAAL,QAEzCA,IAAMxB,EAAe,UAAQ,CAAA4B,EAAAA,+BAAAtB,EAAAA,YAAA,MAAA,CAAAqB,MAAA,sCAAA,CAAArB,EAAAA,YAAAwB,cAAA,MA/GEC,EA+GFL,EAQtC1C,EAAMU,gBAAgBO,IAAKC,GAACI,EAAAA,YAAA,MAAA,CAAAqB,MAAA,2CAAAE,MACiC3B,EAACsB,QAAWA,KAAMQ,OAzE9DxD,EAyE8E0B,EAxEtGlB,EAAMK,gBAAiB,EACvBL,EAAMR,MAAQA,EACdQ,EAAMG,YAAc,GACpBL,EAAK,oBAAqBN,QAC1BM,EAAK,SAAUN,GALSA,IAAAA,IAyEgF,CAAA8B,EAAAA,YAAA2B,SAAA,CAAAlE,KAClFmC,GAAC,SAzHwB,mBAAA6B,GAAA,oBAAAxC,OAAA2C,UAAAC,SAAAC,KAAAL,KAAAM,EAAAA,QAAAN,GA2HvCL,EAAA,CAAAL,QAAAA,IAAA,CAAAK,UA3HuC,IAAAK,MAoIzCO,EAAAA,UAAUvD,EAAQ,CACxBK,SAAUJ,EAAMI,UAElB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("element-plus"),a=require("@element-plus/icons-vue"),o=require("@fast-china/utils"),s={...r.imageProps,hideOnClickModal:{type:Boolean,default:!0},previewTeleported:{type:Boolean,default:!0},lazy:{type:Boolean,default:!0},base64:Boolean,original:Boolean,normal:Boolean,small:Boolean,thumb:Boolean,preview:{type:Boolean,default:!0}},l=e.defineComponent({name:"FaImage",props:s,slots:o.makeSlots(),setup(s,{attrs:l,slots:t,expose:i}){const c=e.reactive({src:e.computed(()=>{if(s.src)return s.base64?`data:image/png;base64,${s.src}`:s.original?s.src:s.normal?`${s.src}@!normal`:s.small?`${s.src}@!small`:(s.thumb,`${s.src}@!thumb`)}),previewList:e.computed(()=>s.preview?[s.base64?`data:image/png;base64,${s.src}`:s.src]:[])}),n=o.useProps(s,r.imageProps,["src","previewSrcList"]);o.useRender(()=>e.createVNode(r.ElImage,e.mergeProps(n.value,{class:"fa-image",src:c.src,previewSrcList:c.previewList}),{error:()=>t.error?t.error():e.createVNode("div",{class:"fa-image__error-image"},[e.createVNode(r.ElIcon,{class:"icon"},{default:()=>[e.createVNode(a.Picture,null,null)]})]),...t.placeholder&&{placeholder:()=>t.placeholder()},...t.viewer&&{viewer:()=>t.viewer({src:c.src})}}))}});exports.default=l,exports.faImageProps=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("element-plus"),a=require("@element-plus/icons-vue"),o=require("@fast-china/utils"),s={...r.imageProps,hideOnClickModal:{type:Boolean,default:!0},previewTeleported:{type:Boolean,default:!0},lazy:{type:Boolean,default:!0},base64:Boolean,original:Boolean,normal:Boolean,small:Boolean,thumb:Boolean,preview:{type:Boolean,default:!0}},l=e.defineComponent({name:"FaImage",props:s,slots:o.makeSlots(),setup(s,{attrs:l,slots:t,emit:i,expose:c}){const n=e.reactive({src:e.computed(()=>{if(s.src)return s.base64?`data:image/png;base64,${s.src}`:s.original?s.src:s.normal?`${s.src}@!normal`:s.small?`${s.src}@!small`:(s.thumb,`${s.src}@!thumb`)}),previewList:e.computed(()=>s.preview?[s.base64?`data:image/png;base64,${s.src}`:s.src]:[])}),p=o.useProps(s,r.imageProps,["src","previewSrcList"]);o.useRender(()=>e.createVNode(r.ElImage,e.mergeProps(p.value,{class:"fa-image",src:n.src,previewSrcList:n.previewList}),{error:()=>t.error?t.error():e.createVNode("div",{class:"fa-image__error-image"},[e.createVNode(r.ElIcon,{class:"icon"},{default:()=>[e.createVNode(a.Picture,null,null)]})]),...t.placeholder&&{placeholder:()=>t.placeholder()},...t.viewer&&{viewer:()=>t.viewer({src:n.src})}}))}});exports.default=l,exports.faImageProps=s;
2
2
  //# sourceMappingURL=image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sources":["../../../../../packages/components/image/src/image.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElIcon, ElImage, imageProps } from \"element-plus\";\nimport { Picture as ElIconPicture } from \"@element-plus/icons-vue\";\nimport { makeSlots, useProps, useRender } from \"@fast-china/utils\";\nimport type { VNode } from \"vue\";\n\nexport const faImageProps = {\n\t...imageProps,\n\t/** @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode. */\n\thideOnClickModal: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`. */\n\tpreviewTeleported: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to use lazy load. */\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description Base64图片 */\n\tbase64: Boolean,\n\t/** @description 原图 */\n\toriginal: Boolean,\n\t/** @description 标准 */\n\tnormal: Boolean,\n\t/** @description 小图 */\n\tsmall: Boolean,\n\t/** @description 缩略图 */\n\tthumb: Boolean,\n\t/** @description 是否可以预览图片 */\n\tpreview: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n};\n\ntype FaImageSlots = {\n\t/** @description 当图像尚未加载时,自定义的占位符内容 */\n\tplaceholder: never;\n\t/** @description 自定义图像加载失败的内容 */\n\terror: never;\n\t/** @description 当图像预览时自定义内容 */\n\tviewer: { src: string };\n};\n\nexport default defineComponent({\n\tname: \"FaImage\",\n\tprops: faImageProps,\n\tslots: makeSlots<FaImageSlots>(),\n\tsetup(props, { attrs, slots, expose }) {\n\t\tconst state = reactive({\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (!props.src) return undefined;\n\t\t\t\tif (props.base64) {\n\t\t\t\t\treturn `data:image/png;base64,${props.src}`;\n\t\t\t\t} else if (props.original) {\n\t\t\t\t\treturn props.src;\n\t\t\t\t} else if (props.normal) {\n\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t} else if (props.small) {\n\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t} else {\n\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpreviewList: computed(() => (props.preview ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [])),\n\t\t});\n\n\t\tconst bindProps = useProps(props, imageProps, [\"src\", \"previewSrcList\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElImage {...bindProps.value} class=\"fa-image\" src={state.src} previewSrcList={state.previewList}>\n\t\t\t\t{{\n\t\t\t\t\terror: () =>\n\t\t\t\t\t\tslots.error ? (\n\t\t\t\t\t\t\tslots.error()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div class=\"fa-image__error-image\">\n\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t<ElIconPicture />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.placeholder && { placeholder: (): VNode[] => slots.placeholder() }),\n\t\t\t\t\t...(slots.viewer && { viewer: (): VNode[] => slots.viewer({ src: state.src }) }),\n\t\t\t\t}}\n\t\t\t</ElImage>\n\t\t));\n\t},\n});\n"],"names":["faImageProps","imageProps","hideOnClickModal","type","Boolean","default","previewTeleported","lazy","base64","original","normal","small","thumb","preview","Image","name","props","slots","makeSlots","setup","attrs","expose","state","reactive","src","computed","previewList","bindProps","useProps","useRender","_createVNode","ElImage","_mergeProps","value","class","previewSrcList","error","ElIcon","ElIconPicture","placeholder","viewer"],"mappings":"iOAMaA,EAAe,IACxBC,EAAAA,WAEHC,iBAAkB,CACjBC,KAAMC,QACNC,SAAS,GAGVC,kBAAmB,CAClBH,KAAMC,QACNC,SAAS,GAGVE,KAAM,CACLJ,KAAMC,QACNC,SAAS,GAGVG,OAAQJ,QAERK,SAAUL,QAEVM,OAAQN,QAERO,MAAOP,QAEPQ,MAAOR,QAEPS,QAAS,CACRV,KAAMC,QACNC,SAAS,IAaXS,oBAA+B,CAC9BC,KAAM,UACNC,MAAOhB,EACPiB,MAAOC,EAAAA,YACPC,KAAAA,CAAMH,GAAOI,MAAEA,EAAAA,MAAOH,EAAAA,OAAOI,IAC5B,MAAMC,EAAQC,EAAAA,SAAS,CACtBC,IAAKC,EAAAA,SAAS,KACb,GAAKT,EAAMQ,IACX,OAAIR,EAAMR,OACF,yBAAyBQ,EAAMQ,MAC5BR,EAAMP,SACTO,EAAMQ,IACHR,EAAMN,OACT,GAAGM,EAAMQ,cACNR,EAAML,MACT,GAAGK,EAAMQ,cACNR,EAAMJ,MACT,GAAGI,EAAMQ,gBAMlBE,YAAaD,EAAAA,SAAS,IAAOT,EAAMH,QAAU,CAACG,EAAMR,OAAS,yBAAyBQ,EAAMQ,MAAQR,EAAMQ,KAAO,MAG5GG,EAAYC,EAAAA,SAASZ,EAAOf,EAAAA,WAAY,CAAC,MAAO,mBAEtD4B,EAAAA,UAAU,IAAAC,EAAAA,YAAAC,EAAAA,QAAAC,EAAAA,WACIL,EAAUM,MAAK,CAAAC,MAAA,WAAAV,IAAwBF,EAAME,IAAGW,eAAkBb,EAAMI,cAAW,CAE9FU,MAAOA,IACNnB,EAAMmB,MACLnB,EAAMmB,QAAON,EAAAA,YAAA,MAAA,CAAAI,MAAA,yBAAA,CAAAJ,EAAAA,YAAAO,SAAA,CAAAH,MAAA,QAAA,CAAA7B,QAAAA,IAAA,CAAAyB,EAAAA,YAAAQ,EAAAA,QAAA,KAAA,cAQXrB,EAAMsB,aAAe,CAAEA,YAAaA,IAAetB,EAAMsB,kBACzDtB,EAAMuB,QAAU,CAAEA,OAAQA,IAAevB,EAAMuB,OAAO,CAAEhB,IAAKF,EAAME,SAI3E"}
1
+ {"version":3,"file":"image.js","sources":["../../../../../packages/components/image/src/image.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElIcon, ElImage, imageProps } from \"element-plus\";\nimport { Picture as ElIconPicture } from \"@element-plus/icons-vue\";\nimport { makeSlots, useProps, useRender } from \"@fast-china/utils\";\nimport type { VNode } from \"vue\";\n\nexport const faImageProps = {\n\t...imageProps,\n\t/** @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode. */\n\thideOnClickModal: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`. */\n\tpreviewTeleported: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether to use lazy load. */\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description Base64图片 */\n\tbase64: Boolean,\n\t/** @description 原图 */\n\toriginal: Boolean,\n\t/** @description 标准 */\n\tnormal: Boolean,\n\t/** @description 小图 */\n\tsmall: Boolean,\n\t/** @description 缩略图 */\n\tthumb: Boolean,\n\t/** @description 是否可以预览图片 */\n\tpreview: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n};\n\ntype FaImageSlots = {\n\t/** @description 当图像尚未加载时,自定义的占位符内容 */\n\tplaceholder: never;\n\t/** @description 自定义图像加载失败的内容 */\n\terror: never;\n\t/** @description 当图像预览时自定义内容 */\n\tviewer: { src: string };\n};\n\nexport default defineComponent({\n\tname: \"FaImage\",\n\tprops: faImageProps,\n\tslots: makeSlots<FaImageSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (!props.src) return undefined;\n\t\t\t\tif (props.base64) {\n\t\t\t\t\treturn `data:image/png;base64,${props.src}`;\n\t\t\t\t} else if (props.original) {\n\t\t\t\t\treturn props.src;\n\t\t\t\t} else if (props.normal) {\n\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t} else if (props.small) {\n\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t} else {\n\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpreviewList: computed(() => (props.preview ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [])),\n\t\t});\n\n\t\tconst bindProps = useProps(props, imageProps, [\"src\", \"previewSrcList\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElImage {...bindProps.value} class=\"fa-image\" src={state.src} previewSrcList={state.previewList}>\n\t\t\t\t{{\n\t\t\t\t\terror: () =>\n\t\t\t\t\t\tslots.error ? (\n\t\t\t\t\t\t\tslots.error()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div class=\"fa-image__error-image\">\n\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t<ElIconPicture />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.placeholder && { placeholder: (): VNode[] => slots.placeholder() }),\n\t\t\t\t\t...(slots.viewer && { viewer: (): VNode[] => slots.viewer({ src: state.src }) }),\n\t\t\t\t}}\n\t\t\t</ElImage>\n\t\t));\n\t},\n});\n"],"names":["faImageProps","imageProps","hideOnClickModal","type","Boolean","default","previewTeleported","lazy","base64","original","normal","small","thumb","preview","Image","name","props","slots","makeSlots","setup","attrs","emit","expose","state","reactive","src","computed","previewList","bindProps","useProps","useRender","_createVNode","ElImage","_mergeProps","value","class","previewSrcList","error","ElIcon","ElIconPicture","placeholder","viewer"],"mappings":"iOAMaA,EAAe,IACxBC,EAAAA,WAEHC,iBAAkB,CACjBC,KAAMC,QACNC,SAAS,GAGVC,kBAAmB,CAClBH,KAAMC,QACNC,SAAS,GAGVE,KAAM,CACLJ,KAAMC,QACNC,SAAS,GAGVG,OAAQJ,QAERK,SAAUL,QAEVM,OAAQN,QAERO,MAAOP,QAEPQ,MAAOR,QAEPS,QAAS,CACRV,KAAMC,QACNC,SAAS,IAaXS,oBAA+B,CAC9BC,KAAM,UACNC,MAAOhB,EACPiB,MAAOC,EAAAA,YACPC,KAAAA,CAAMH,GAAOI,MAAEA,EAAAA,MAAOH,EAAAA,KAAOI,EAAAA,OAAMC,IAClC,MAAMC,EAAQC,EAAAA,SAAS,CACtBC,IAAKC,EAAAA,SAAS,KACb,GAAKV,EAAMS,IACX,OAAIT,EAAMR,OACF,yBAAyBQ,EAAMS,MAC5BT,EAAMP,SACTO,EAAMS,IACHT,EAAMN,OACT,GAAGM,EAAMS,cACNT,EAAML,MACT,GAAGK,EAAMS,cACNT,EAAMJ,MACT,GAAGI,EAAMS,gBAMlBE,YAAaD,EAAAA,SAAS,IAAOV,EAAMH,QAAU,CAACG,EAAMR,OAAS,yBAAyBQ,EAAMS,MAAQT,EAAMS,KAAO,MAG5GG,EAAYC,EAAAA,SAASb,EAAOf,EAAAA,WAAY,CAAC,MAAO,mBAEtD6B,EAAAA,UAAU,IAAAC,EAAAA,YAAAC,EAAAA,QAAAC,EAAAA,WACIL,EAAUM,MAAK,CAAAC,MAAA,WAAAV,IAAwBF,EAAME,IAAGW,eAAkBb,EAAMI,cAAW,CAE9FU,MAAOA,IACNpB,EAAMoB,MACLpB,EAAMoB,QAAON,EAAAA,YAAA,MAAA,CAAAI,MAAA,yBAAA,CAAAJ,EAAAA,YAAAO,SAAA,CAAAH,MAAA,QAAA,CAAA9B,QAAAA,IAAA,CAAA0B,EAAAA,YAAAQ,EAAAA,QAAA,KAAA,cAQXtB,EAAMuB,aAAe,CAAEA,YAAaA,IAAevB,EAAMuB,kBACzDvB,EAAMwB,QAAU,CAAEA,OAAQA,IAAexB,EAAMwB,OAAO,CAAEhB,IAAKF,EAAME,SAI3E"}
@@ -9,6 +9,7 @@ export * from './formItemTip';
9
9
  export * from './icon';
10
10
  export * from './iconSelector';
11
11
  export * from './image';
12
+ export * from './inputDialogPage';
12
13
  export * from './layoutGrid';
13
14
  export * from './select';
14
15
  export * from './selectPage';
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar/index.js"),r=require("./button/index.js"),a=require("./carNumber/index.js"),t=require("./contextMenu/index.js"),o=require("./dialog/index.js"),s=require("./drawer/index.js"),p=require("./form/index.js"),i=require("./formItemTip/index.js"),l=require("./icon/index.js"),m=require("./iconSelector/index.js"),u=require("./image/index.js"),x=require("./layoutGrid/index.js"),c=require("./select/index.js"),F=require("./selectPage/index.js"),f=require("./selectV2/index.js"),d=require("./table/index.js"),n=require("./tree/index.js"),P=require("./treeSelect/index.js"),g=require("./upload/index.js"),j=require("./uploadImage/index.js"),b=require("./uploadImages/index.js"),q=require("./button/src/button.js"),S=require("./carNumber/src/common.js"),I=require("./dialog/src/dialog.js"),T=require("./form/utils/form.js"),E=require("./form/src/form.js"),U=require("./form/src/formItem.js"),C=require("./formItemTip/src/formItemTip.js"),D=require("./image/src/image.js"),y=require("./select/src/select.js"),N=require("./selectPage/src/selectPage.js"),V=require("./selectV2/src/selectV2.js"),B=require("./table/src/page.type.js"),L=require("./table/src/table.type.js"),G=require("./table/utils/table.js"),v=require("./table/src/table.js"),A=require("./table/src/tableColumn.js"),M=require("./tree/src/tree.js"),w=require("./treeSelect/src/treeSelect.js"),O=require("./upload/src/upload.js"),h=require("./uploadImage/src/uploadImage.js");exports.FaAvatar=e.FaAvatar,exports.FaButton=r.FaButton,exports.FaCarNumber=a.FaCarNumber,exports.FaContextMenu=t.FaContextMenu,exports.FaDialog=o.FaDialog,exports.FaDrawer=s.FaDrawer,exports.FaForm=p.FaForm,exports.FaFormItem=p.FaFormItem,exports.FaFormItemTip=i.FaFormItemTip,exports.FaIcon=l.FaIcon,exports.FaIconSelector=m.FaIconSelector,exports.FaImage=u.FaImage,exports.FaLayoutGrid=x.FaLayoutGrid,exports.FaLayoutGridItem=x.FaLayoutGridItem,exports.FaSelect=c.FaSelect,exports.FaSelectOption=c.FaSelectOption,exports.FaSelectPage=F.FaSelectPage,exports.FaSelectV2=f.FaSelectV2,exports.FaTable=d.FaTable,exports.FaTableColumn=d.FaTableColumn,exports.FaTree=n.FaTree,exports.FaTreeSelect=P.FaTreeSelect,exports.FaUpload=g.FaUpload,exports.FaUploadImage=j.FaUploadImage,exports.FaUploadImages=b.FaUploadImages,exports.faButtonEmits=q.faButtonEmits,exports.faButtonProps=q.faButtonProps,exports.CarNumberArea=S.CarNumberArea,exports.CarNumberDigit=S.CarNumberDigit,exports.CarNumberLetter=S.CarNumberLetter,exports.faDialogEmits=I.faDialogEmits,exports.faDialogProps=I.faDialogProps,exports.formUtil=T.formUtil,exports.faFormProps=E.faFormProps,exports.faFormItemProps=U.faFormItemProps,exports.faFormItemTipProps=C.faFormItemTipProps,exports.faImageProps=D.faImageProps,exports.SelectProps=y.SelectProps,exports.faSelectProps=y.faSelectProps,exports.faSelectPageEmits=N.faSelectPageEmits,exports.faSelectPageProps=N.faSelectPageProps,exports.SelectV2Props=V.SelectV2Props,exports.faSelectV2Props=V.faSelectV2Props,exports.PagedSearchTypeEnum=B.PagedSearchTypeEnum,exports.getTableDefaultSlots=L.getTableDefaultSlots,exports.tableUtil=G.tableUtil,exports.faTableEmits=v.faTableEmits,exports.faTableProps=v.faTableProps,exports.tableProps=v.tableProps,exports.tableColumnProps=A.tableColumnProps,exports.faTreeEmits=M.faTreeEmits,exports.faTreeProps=M.faTreeProps,exports.faTreeSelectEmits=w.faTreeSelectEmits,exports.faTreeSelectProps=w.faTreeSelectProps,exports.faUploadEmits=O.faUploadEmits,exports.faUploadProps=O.faUploadProps,exports.faUploadImageEmits=h.faUploadImageEmits,exports.faUploadImageProps=h.faUploadImageProps;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar/index.js"),r=require("./button/index.js"),a=require("./carNumber/index.js"),t=require("./contextMenu/index.js"),o=require("./dialog/index.js"),s=require("./drawer/index.js"),p=require("./form/index.js"),i=require("./formItemTip/index.js"),l=require("./icon/index.js"),u=require("./iconSelector/index.js"),m=require("./image/index.js"),x=require("./inputDialogPage/index.js"),c=require("./layoutGrid/index.js"),n=require("./select/index.js"),g=require("./selectPage/index.js"),F=require("./selectV2/index.js"),f=require("./table/index.js"),P=require("./tree/index.js"),d=require("./treeSelect/index.js"),j=require("./upload/index.js"),q=require("./uploadImage/index.js"),b=require("./uploadImages/index.js"),I=require("./button/src/button.js"),S=require("./carNumber/src/common.js"),T=require("./dialog/src/dialog.js"),D=require("./form/utils/form.js"),E=require("./form/src/form.js"),U=require("./form/src/formItem.js"),C=require("./formItemTip/src/formItemTip.js"),y=require("./image/src/image.js"),N=require("./inputDialogPage/src/inputDialogPage.js"),V=require("./select/src/select.js"),B=require("./selectPage/src/selectPage.js"),L=require("./selectV2/src/selectV2.js"),G=require("./table/src/page.type.js"),v=require("./table/src/table.type.js"),A=require("./table/utils/table.js"),M=require("./table/src/table.js"),w=require("./table/src/tableColumn.js"),O=require("./tree/src/tree.js"),h=require("./treeSelect/src/treeSelect.js"),k=require("./upload/src/upload.js"),z=require("./uploadImage/src/uploadImage.js");exports.FaAvatar=e.FaAvatar,exports.FaButton=r.FaButton,exports.FaCarNumber=a.FaCarNumber,exports.FaContextMenu=t.FaContextMenu,exports.FaDialog=o.FaDialog,exports.FaDrawer=s.FaDrawer,exports.FaForm=p.FaForm,exports.FaFormItem=p.FaFormItem,exports.FaFormItemTip=i.FaFormItemTip,exports.FaIcon=l.FaIcon,exports.FaIconSelector=u.FaIconSelector,exports.FaImage=m.FaImage,exports.FaInputDialogPage=x.FaInputDialogPage,exports.FaLayoutGrid=c.FaLayoutGrid,exports.FaLayoutGridItem=c.FaLayoutGridItem,exports.FaSelect=n.FaSelect,exports.FaSelectOption=n.FaSelectOption,exports.FaSelectPage=g.FaSelectPage,exports.FaSelectV2=F.FaSelectV2,exports.FaTable=f.FaTable,exports.FaTableColumn=f.FaTableColumn,exports.FaTree=P.FaTree,exports.FaTreeSelect=d.FaTreeSelect,exports.FaUpload=j.FaUpload,exports.FaUploadImage=q.FaUploadImage,exports.FaUploadImages=b.FaUploadImages,exports.faButtonEmits=I.faButtonEmits,exports.faButtonProps=I.faButtonProps,exports.CarNumberArea=S.CarNumberArea,exports.CarNumberDigit=S.CarNumberDigit,exports.CarNumberLetter=S.CarNumberLetter,exports.faDialogEmits=T.faDialogEmits,exports.faDialogProps=T.faDialogProps,exports.formUtil=D.formUtil,exports.faFormProps=E.faFormProps,exports.faFormItemProps=U.faFormItemProps,exports.faFormItemTipProps=C.faFormItemTipProps,exports.faImageProps=y.faImageProps,exports.faInputDialogPageEmits=N.faInputDialogPageEmits,exports.faInputDialogPageProps=N.faInputDialogPageProps,exports.SelectProps=V.SelectProps,exports.faSelectProps=V.faSelectProps,exports.faSelectPageEmits=B.faSelectPageEmits,exports.faSelectPageProps=B.faSelectPageProps,exports.SelectV2Props=L.SelectV2Props,exports.faSelectV2Props=L.faSelectV2Props,exports.PagedSearchTypeEnum=G.PagedSearchTypeEnum,exports.getTableDefaultSlots=v.getTableDefaultSlots,exports.tableUtil=A.tableUtil,exports.faTableEmits=M.faTableEmits,exports.faTableProps=M.faTableProps,exports.tableProps=M.tableProps,exports.tableColumnProps=w.tableColumnProps,exports.faTreeEmits=O.faTreeEmits,exports.faTreeProps=O.faTreeProps,exports.faTreeSelectEmits=h.faTreeSelectEmits,exports.faTreeSelectProps=h.faTreeSelectProps,exports.faUploadEmits=k.faUploadEmits,exports.faUploadProps=k.faUploadProps,exports.faUploadImageEmits=z.faUploadImageEmits,exports.faUploadImageProps=z.faUploadImageProps;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ import { TSXWithInstall } from "@fast-china/utils";
2
+ import type { default as InputDialogPage, faInputDialogPageEmits, faInputDialogPageProps } from "./src/inputDialogPage";
3
+ import type { ExtractPropTypes } from "vue";
4
+
5
+ export declare const FaInputDialogPage: TSXWithInstall<typeof InputDialogPage>;
6
+ export default FaInputDialogPage;
7
+
8
+ export { faInputDialogPageProps, faInputDialogPageEmits };
9
+
10
+ export type FaInputDialogPageInstance = InstanceType<typeof InputDialogPage>;
11
+
12
+ export type FaInputDialogPageProps = ExtractPropTypes<typeof faInputDialogPageProps>;
13
+
14
+ export type FaInputDialogPageEmits = typeof faInputDialogPageEmits;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@fast-china/utils"),t=require("./src/inputDialogPage.js"),a=e.withInstall(t.default);exports.faInputDialogPageEmits=t.faInputDialogPageEmits,exports.faInputDialogPageProps=t.faInputDialogPageProps,exports.FaInputDialogPage=a,exports.default=a;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../packages/components/inputDialogPage/index.ts"],"sourcesContent":["import { withInstall } from \"@fast-china/utils\";\nimport InputDialogPage, { faInputDialogPageEmits, faInputDialogPageProps } from \"./src/inputDialogPage\";\nimport type { ExtractPropTypes } from \"vue\";\n\nexport const FaInputDialogPage = withInstall(InputDialogPage);\nexport default FaInputDialogPage;\n\nexport { faInputDialogPageProps, faInputDialogPageEmits };\n\nexport type FaInputDialogPageInstance = InstanceType<typeof InputDialogPage>;\n\nexport type FaInputDialogPageProps = ExtractPropTypes<typeof faInputDialogPageProps>;\n\nexport type FaInputDialogPageEmits = typeof faInputDialogPageEmits;\n"],"names":["FaInputDialogPage","withInstall","InputDialogPage"],"mappings":"uLAIaA,EAAoBC,EAAAA,YAAYC,EAAAA"}
@@ -0,0 +1,131 @@
1
+ import { TableProps } from 'element-plus';
2
+ import { PropType } from 'vue';
3
+ import { PagedInput, PagedResult } from '../../table';
4
+ export declare const faInputDialogPageProps: {
5
+ /** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */
6
+ rowKey: {
7
+ type: PropType<TableProps<any>["rowKey"]>;
8
+ default: string;
9
+ };
10
+ /** @description v-model绑定值 */
11
+ modelValue: (NumberConstructor | StringConstructor)[];
12
+ /** @description v-model:label绑定值 */
13
+ label: StringConstructor;
14
+ /** @description 输入框占位文本 */
15
+ placeholder: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ /** @description 禁用 */
20
+ disabled: BooleanConstructor;
21
+ /** @description 标题 */
22
+ title: StringConstructor;
23
+ /** @description 请求api */
24
+ requestApi: {
25
+ type: PropType<(params?: PagedInput) => Promise<PagedResult | any[]>>;
26
+ };
27
+ /** 初始化参数 */
28
+ initParam: PropType<any>;
29
+ /** @description 显示文本 Key */
30
+ labelKey: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ };
35
+ export declare const faInputDialogPageEmits: {
36
+ /** @description v-model 回调 */
37
+ "update:modelValue": (value: string | number) => boolean;
38
+ /** @description v-model:label 回调 */
39
+ "update:label": (value: string) => boolean;
40
+ /** @description 改变 */
41
+ change: (value: string | number) => boolean;
42
+ };
43
+ type FaInputDialogPageSlots = {
44
+ /** @description 默认内容插槽 */
45
+ default: never;
46
+ };
47
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
48
+ /** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */
49
+ rowKey: {
50
+ type: PropType<TableProps<any>["rowKey"]>;
51
+ default: string;
52
+ };
53
+ /** @description v-model绑定值 */
54
+ modelValue: (NumberConstructor | StringConstructor)[];
55
+ /** @description v-model:label绑定值 */
56
+ label: StringConstructor;
57
+ /** @description 输入框占位文本 */
58
+ placeholder: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
62
+ /** @description 禁用 */
63
+ disabled: BooleanConstructor;
64
+ /** @description 标题 */
65
+ title: StringConstructor;
66
+ /** @description 请求api */
67
+ requestApi: {
68
+ type: PropType<(params?: PagedInput) => Promise<PagedResult | any[]>>;
69
+ };
70
+ /** 初始化参数 */
71
+ initParam: PropType<any>;
72
+ /** @description 显示文本 Key */
73
+ labelKey: {
74
+ type: StringConstructor;
75
+ default: string;
76
+ };
77
+ }>, {
78
+ /** @description 选择行数据 */
79
+ selectionRow: import('vue').ComputedRef<unknown>;
80
+ /** @description 打开选择器弹窗 */
81
+ open: () => void;
82
+ /** @description 清除选择 */
83
+ clear: () => void;
84
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
85
+ /** @description v-model 回调 */
86
+ "update:modelValue": (value: string | number) => boolean;
87
+ /** @description v-model:label 回调 */
88
+ "update:label": (value: string) => boolean;
89
+ /** @description 改变 */
90
+ change: (value: string | number) => boolean;
91
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
92
+ /** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */
93
+ rowKey: {
94
+ type: PropType<TableProps<any>["rowKey"]>;
95
+ default: string;
96
+ };
97
+ /** @description v-model绑定值 */
98
+ modelValue: (NumberConstructor | StringConstructor)[];
99
+ /** @description v-model:label绑定值 */
100
+ label: StringConstructor;
101
+ /** @description 输入框占位文本 */
102
+ placeholder: {
103
+ type: StringConstructor;
104
+ default: string;
105
+ };
106
+ /** @description 禁用 */
107
+ disabled: BooleanConstructor;
108
+ /** @description 标题 */
109
+ title: StringConstructor;
110
+ /** @description 请求api */
111
+ requestApi: {
112
+ type: PropType<(params?: PagedInput) => Promise<PagedResult | any[]>>;
113
+ };
114
+ /** 初始化参数 */
115
+ initParam: PropType<any>;
116
+ /** @description 显示文本 Key */
117
+ labelKey: {
118
+ type: StringConstructor;
119
+ default: string;
120
+ };
121
+ }>> & Readonly<{
122
+ "onUpdate:modelValue"?: (value: string | number) => any;
123
+ onChange?: (value: string | number) => any;
124
+ "onUpdate:label"?: (value: string) => any;
125
+ }>, {
126
+ disabled: boolean;
127
+ placeholder: string;
128
+ rowKey: string | ((row: any) => string);
129
+ labelKey: string;
130
+ }, import('vue').SlotsType<Partial<import('@fast-china/utils').MakeSlots<FaInputDialogPageSlots>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
131
+ export default _default;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("element-plus"),t=require("@element-plus/icons-vue"),i=require("@fast-china/utils"),o=require("lodash-unified"),a=require("../../table/index.js"),u=require("@vueuse/core"),n=require("../../dialog/index.js"),r={rowKey:{type:[String,Function],default:"id"},modelValue:[String,Number],label:String,placeholder:{type:String,default:"请选择"},disabled:Boolean,title:String,requestApi:{type:i.definePropType(Function)},initParam:i.definePropType([String,Number,Object]),labelKey:{type:String,default:"name"}},s={"update:modelValue":e=>o.isString(e)||o.isNumber(e)||o.isNull(e),"update:label":e=>o.isString(e)||o.isNull(e),change:e=>o.isString(e)||o.isNumber(e)||o.isNull(e)},d=e.defineComponent({name:"FaInputDialogPage",props:r,emits:s,slots:i.makeSlots(),setup(r,{attrs:s,slots:d,emit:c,expose:p}){const g=u.useVModel(r,"modelValue",c),f=u.useVModel(r,"label",c),m=e.reactive({selectionRow:i.withDefineType()}),v=e.ref(),b=e.ref(),w=()=>{g.value=null,f.value=null,c("change",null)},y=()=>{v.value.open(()=>{if(m.selectionRow){b.value.selectedListIds.includes(o.isFunction(r.rowKey)?r.rowKey(m.selectionRow):m.selectionRow[r.rowKey])||b.value.toggleRowSelection(m.selectionRow)}})},S=()=>{v.value.close(()=>{if(b.value.selected){const e=b.value.selectedList[0];g.value=e[o.isFunction(r.rowKey)?r.rowKey(e):e[r.rowKey]],f.value=e[r.labelKey],c("change",e)}else g.value=null,f.value=null,c("change",null)})},h=e=>{b.value.clearSelection(),b.value.toggleRowSelection(e),m.selectionRow=e,S()};return i.useRender(()=>e.createVNode("div",{class:"fa-input-dialog-page"},[e.createVNode(l.ElInput,{modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,placeholder:r.placeholder,disabled:r.disabled,readonly:!0},{append:()=>e.createVNode(l.ElButtonGroup,null,{default:()=>[e.createVNode(l.ElButton,{disabled:r.disabled,icon:t.Delete,onClick:w},null),e.createVNode(l.ElButton,{disabled:r.disabled,icon:t.Search,onClick:y},null)]})}),e.createVNode(n.FaDialog,{ref:v,style:"--height: 70%;",width:"50%",title:r.title,fillHeight:!0,disabledConfirmButton:!b.value?.selected,onConfirmClick:S},{default:()=>[e.createVNode(a.FaTable,{ref:b,rowKey:r.rowKey,requestApi:r.requestApi,initParam:r.initParam,single:!0,rowClickSelection:!0,hideSearchTime:!0,exportBtn:!1,onRowDblclick:h},{default:()=>d.default&&d.default()})]})])),i.useExpose(p,{selectionRow:e.computed(()=>m.selectionRow),open:y,clear:w})}});exports.default=d,exports.faInputDialogPageEmits=s,exports.faInputDialogPageProps=r;
2
+ //# sourceMappingURL=inputDialogPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputDialogPage.js","sources":["../../../../../packages/components/inputDialogPage/src/inputDialogPage.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, ref } from \"vue\";\nimport { ElButton, ElButtonGroup, ElInput } from \"element-plus\";\nimport { Delete, Search } from \"@element-plus/icons-vue\";\nimport { definePropType, makeSlots, useExpose, useRender, withDefineType } from \"@fast-china/utils\";\nimport { isFunction, isNull, isNumber, isString } from \"lodash-unified\";\nimport type { TableProps } from \"element-plus\";\nimport type { PropType } from \"vue\";\nimport { FaTable, type FaTableInstance, type PagedInput, type PagedResult } from \"@fast-element-plus/components/table\";\nimport { useVModel } from \"@vueuse/core\";\nimport FaDialog, { FaDialogInstance } from \"@fast-element-plus/components/dialog\";\n\nexport const faInputDialogPageProps = {\n\t/** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */\n\trowKey: {\n\t\ttype: [String, Function] as PropType<TableProps<any>[\"rowKey\"]>,\n\t\tdefault: \"id\",\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: [String, Number],\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 输入框占位文本 */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: \"请选择\",\n\t},\n\t/** @description 禁用 */\n\tdisabled: Boolean,\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: PagedInput) => Promise<PagedResult | any[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n\t/** @description 显示文本 Key */\n\tlabelKey: {\n\t\ttype: String,\n\t\tdefault: \"name\",\n\t},\n};\n\nexport const faInputDialogPageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number) => isString(value) || isNumber(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string) => isString(value) || isNull(value),\n\t/** @description 改变 */\n\tchange: (value: string | number) => isString(value) || isNumber(value) || isNull(value),\n};\n\ntype FaInputDialogPageSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n};\n\nexport default defineComponent({\n\tname: \"FaInputDialogPage\",\n\tprops: faInputDialogPageProps,\n\temits: faInputDialogPageEmits,\n\tslots: makeSlots<FaInputDialogPageSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst modelValue = useVModel(props, \"modelValue\", emit);\n\t\tconst selectedLabel = useVModel(props, \"label\", emit);\n\n\t\tconst state = reactive({\n\t\t\tselectionRow: withDefineType<unknown>(),\n\t\t});\n\n\t\tconst faDialogRef = ref<FaDialogInstance>();\n\t\tconst faTableRef = ref<FaTableInstance>();\n\n\t\tconst handleDeleteClick = (): void => {\n\t\t\tmodelValue.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\tconst handleSearchClick = (): void => {\n\t\t\tfaDialogRef.value.open(() => {\n\t\t\t\tif (state.selectionRow) {\n\t\t\t\t\t// 判断当前行是否选中\n\t\t\t\t\tconst rowSelected = faTableRef.value.selectedListIds.includes(\n\t\t\t\t\t\tisFunction(props.rowKey) ? props.rowKey(state.selectionRow) : state.selectionRow[props.rowKey]\n\t\t\t\t\t);\n\t\t\t\t\tif (!rowSelected) {\n\t\t\t\t\t\tfaTableRef.value.toggleRowSelection(state.selectionRow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst handleConfirmClick = (): void => {\n\t\t\tfaDialogRef.value.close(() => {\n\t\t\t\tif (faTableRef.value.selected) {\n\t\t\t\t\tconst selectedData = faTableRef.value.selectedList[0];\n\t\t\t\t\tmodelValue.value = selectedData[isFunction(props.rowKey) ? props.rowKey(selectedData) : selectedData[props.rowKey]];\n\t\t\t\t\tselectedLabel.value = selectedData[props.labelKey];\n\t\t\t\t\temit(\"change\", selectedData);\n\t\t\t\t} else {\n\t\t\t\t\tmodelValue.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"change\", null);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst handleTableRowDblclick = (row: any): void => {\n\t\t\tfaTableRef.value.clearSelection();\n\t\t\tfaTableRef.value.toggleRowSelection(row);\n\t\t\tstate.selectionRow = row;\n\t\t\thandleConfirmClick();\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<div class=\"fa-input-dialog-page\">\n\t\t\t\t<ElInput vModel={selectedLabel.value} placeholder={props.placeholder} disabled={props.disabled} readonly>\n\t\t\t\t\t{{\n\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t<ElButtonGroup>\n\t\t\t\t\t\t\t\t<ElButton disabled={props.disabled} icon={Delete} onClick={handleDeleteClick} />\n\t\t\t\t\t\t\t\t<ElButton disabled={props.disabled} icon={Search} onClick={handleSearchClick} />\n\t\t\t\t\t\t\t</ElButtonGroup>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElInput>\n\t\t\t\t<FaDialog\n\t\t\t\t\tref={faDialogRef}\n\t\t\t\t\tstyle=\"--height: 70%;\"\n\t\t\t\t\twidth=\"50%\"\n\t\t\t\t\ttitle={props.title}\n\t\t\t\t\tfillHeight\n\t\t\t\t\tdisabledConfirmButton={!faTableRef.value?.selected}\n\t\t\t\t\tonConfirmClick={handleConfirmClick}\n\t\t\t\t>\n\t\t\t\t\t<FaTable\n\t\t\t\t\t\tref={faTableRef}\n\t\t\t\t\t\trowKey={props.rowKey}\n\t\t\t\t\t\trequestApi={props.requestApi}\n\t\t\t\t\t\tinitParam={props.initParam}\n\t\t\t\t\t\tsingle\n\t\t\t\t\t\trowClickSelection\n\t\t\t\t\t\thideSearchTime\n\t\t\t\t\t\texportBtn={false}\n\t\t\t\t\t\tonRowDblclick={handleTableRowDblclick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: () => slots.default && slots.default(),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</FaTable>\n\t\t\t\t</FaDialog>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 选择行数据 */\n\t\t\tselectionRow: computed(() => state.selectionRow),\n\t\t\t/** @description 打开选择器弹窗 */\n\t\t\topen: handleSearchClick,\n\t\t\t/** @description 清除选择 */\n\t\t\tclear: handleDeleteClick,\n\t\t});\n\t},\n});\n"],"names":["faInputDialogPageProps","rowKey","type","String","Function","default","modelValue","Number","label","placeholder","disabled","Boolean","title","requestApi","definePropType","initParam","Object","labelKey","faInputDialogPageEmits","value","isString","isNumber","isNull","change","InputDialogPage","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","useVModel","selectedLabel","state","reactive","selectionRow","withDefineType","faDialogRef","ref","faTableRef","handleDeleteClick","handleSearchClick","open","selectedListIds","includes","isFunction","toggleRowSelection","handleConfirmClick","close","selected","selectedData","selectedList","handleTableRowDblclick","row","clearSelection","useRender","_createVNode","class","ElInput","$event","readonly","append","ElButtonGroup","ElButton","icon","Delete","onClick","Search","FaDialog","style","width","fillHeight","disabledConfirmButton","onConfirmClick","FaTable","single","rowClickSelection","hideSearchTime","exportBtn","onRowDblclick","useExpose","computed","clear"],"mappings":"4VAWaA,EAAyB,CAErCC,OAAQ,CACPC,KAAM,CAACC,OAAQC,UACfC,QAAS,MAGVC,WAAY,CAACH,OAAQI,QAErBC,MAAOL,OAEPM,YAAa,CACZP,KAAMC,OACNE,QAAS,OAGVK,SAAUC,QAEVC,MAAOT,OAEPU,WAAY,CACXX,KAAMY,EAAAA,eAAsEV,WAG7EW,UAAWD,EAAAA,eAAsC,CAACX,OAAQI,OAAQS,SAElEC,SAAU,CACTf,KAAMC,OACNE,QAAS,SAIEa,EAAyB,CAErC,oBAAsBC,GAA2BC,EAAAA,SAASD,IAAUE,EAAAA,SAASF,IAAUG,EAAAA,OAAOH,GAE9F,kBAAmCC,EAAAA,SAASD,IAAUG,EAAAA,OAAOH,GAE7DI,OAASJ,GAA2BC,EAAAA,SAASD,IAAUE,EAAAA,SAASF,IAAUG,EAAAA,OAAOH,IAQlFK,oBAA+B,CAC9BC,KAAM,oBACNC,MAAO1B,EACP2B,MAAOT,EACPU,MAAOC,EAAAA,YACPC,KAAAA,CAAMJ,GAAOK,MAAEA,EAAAA,MAAOH,EAAAA,KAA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GAAA,CAE5FC,OAAQA,IAAAL,EAAAA,YAAAM,EAAAA,cAAA,KAAA,CAAA5D,QAAAA,IAAA,CAAAsD,EAAAA,YAAAO,WAAA,CAAAxD,SAEcgB,EAAMhB,SAAQyD,KAAQC,EAAAA,OAAMC,QAAW1B,GAAiB,MAAAgB,EAAAA,YAAAO,WAAA,CAAAxD,SACxDgB,EAAMhB,SAAQyD,KAAQG,EAAAA,OAAMD,QAAWzB,GAAiB,WAE7Ee,EAAAA,YAAAY,WAAA,CAAA9B,IAIGD,EAAWgC,MAAA,iBAAAC,MAAA,MAAA7D,MAGTc,EAAMd,MAAK8D,YAAA,EAAAC,uBAEMjC,EAAWvB,OAAOiC,SAAQwB,eAClC1B,GAAkB,CAAA7C,QAAAA,IAAA,CAAAsD,EAAAA,YAAAkB,UAAA,CAAApC,IAG5BC,EAAUzC,OACPyB,EAAMzB,OAAMY,WACRa,EAAMb,WAAUE,UACjBW,EAAMX,UAAS+D,QAAA,EAAAC,mBAAA,EAAAC,gBAAA,EAAAC,WAIf,EAAKC,cACD3B,GAAsB,CAGpClD,QAASA,IAAMuB,EAAMvB,SAAWuB,EAAMvB,kBAOpC8E,EAAAA,UAAUlD,EAAQ,CAExBK,aAAc8C,EAAAA,SAAS,IAAMhD,EAAME,cAEnCO,KAAMD,EAENyC,MAAO1C,GAET"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@fast-china/utils"),t=require("lodash-unified"),r=e.defineComponent({name:"FaLayoutGrid",props:{cols:{type:o.definePropType([String,Number,Object]),default:()=>({xs:1,sm:2,md:3,lg:4,xl:5})},collapsed:Boolean,collapsedRows:{type:[String,Number],default:1},gap:{type:o.definePropType([Number,Array]),default:0}},emits:{breakPointChange:({breakPoint:e})=>!0},slots:o.makeSlots(),setup(r,{slots:s,emit:a,expose:l}){const n=e.ref();e.provide("gap",t.isArray(r.gap)?r.gap[0]:r.gap);const p=e.ref("xl");e.provide("breakPoint",p);const i=e.ref(-1);e.provide("shouldHiddenIndex",i);const u=e.computed(()=>t.isObject(r.cols)?r.cols[p.value]??r.cols:r.cols);e.provide("cols",u);const d=t.isNumber(r.collapsedRows)?r.collapsedRows:Number(r.collapsedRows),c={xs:{min:0,max:479},sm:{min:480,max:768},md:{min:768,max:1024},lg:{min:1024,max:1440},xl:{min:1440,max:1/0}},m=e=>{if(1!==e.length)throw new Error("未知的多个El");const o=e[0].target.scrollWidth;for(const[t,{min:r,max:s}]of Object.entries(c))if(o>=r&&o<=s){p.value=t;break}};let f=null;e.onMounted(()=>{e.nextTick(()=>{f=new ResizeObserver(m),f.observe(n.value)}),e.watch(()=>p.value,e=>{a("breakPointChange",{breakPoint:e})},{immediate:!0})}),e.onActivated(()=>{e.nextTick(()=>{f=new ResizeObserver(m),f.observe(n.value)})}),e.onUnmounted(()=>{f?.disconnect()}),e.onDeactivated(()=>{f?.disconnect()});const v=e.computed(()=>t.isNumber(r.gap)?`${r.gap}px`:t.isArray(r.gap)?`${r.gap[1]}px ${r.gap[0]}px`:"unset"),b=e.computed(()=>({display:"grid",gridGap:v.value,gridTemplateColumns:`repeat(${u.value}, minmax(0, 1fr))`}));return o.useRender(()=>{const o=s?.default()??[];if(r.collapsed){const e=[];let t=null;o.forEach(o=>{"object"==typeof o.type&&"FaLayoutGridItem"===o.type.name&&void 0!==o.props?.suffix&&(t=o),"symbol"==typeof o.type&&Array.isArray(o?.children)&&e.push(...o.children)});let r=0;t&&(r=(t.props[p.value]?.span??t.props?.span??1)+(t.props[p.value]?.offset??t.props?.offset??0));try{let o=!1;e.reduce((e=0,t,s)=>{if(e+=(t.props[p.value]?.span??t.props?.span??1)+(t.props[p.value]?.offset??t.props?.offset??0),Number(e)>d*Number(u.value)-r)throw i.value=s,o=!0,"find it";return e},0),o||(i.value=-1)}catch{}}else i.value=-1;return e.createVNode("div",{ref:n,style:b.value},[o])}),o.useExpose(l,{breakPoint:p})}});exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@fast-china/utils"),t=require("lodash-unified"),r=e.defineComponent({name:"FaLayoutGrid",props:{cols:{type:o.definePropType([String,Number,Object]),default:()=>({xs:1,sm:2,md:3,lg:4,xl:5})},collapsed:Boolean,collapsedRows:{type:[String,Number],default:1},gap:{type:o.definePropType([Number,Array]),default:0}},emits:{breakPointChange:({breakPoint:e})=>!0},slots:o.makeSlots(),setup(r,{attrs:s,slots:a,emit:l,expose:n}){const p=e.ref();e.provide("gap",t.isArray(r.gap)?r.gap[0]:r.gap);const i=e.ref("xl");e.provide("breakPoint",i);const u=e.ref(-1);e.provide("shouldHiddenIndex",u);const d=e.computed(()=>t.isObject(r.cols)?r.cols[i.value]??r.cols:r.cols);e.provide("cols",d);const c=t.isNumber(r.collapsedRows)?r.collapsedRows:Number(r.collapsedRows),m={xs:{min:0,max:479},sm:{min:480,max:768},md:{min:768,max:1024},lg:{min:1024,max:1440},xl:{min:1440,max:1/0}},f=e=>{if(1!==e.length)throw new Error("未知的多个El");const o=e[0].target.scrollWidth;for(const[t,{min:r,max:s}]of Object.entries(m))if(o>=r&&o<=s){i.value=t;break}};let v=null;e.onMounted(()=>{e.nextTick(()=>{v=new ResizeObserver(f),v.observe(p.value)}),e.watch(()=>i.value,e=>{l("breakPointChange",{breakPoint:e})},{immediate:!0})}),e.onActivated(()=>{e.nextTick(()=>{v=new ResizeObserver(f),v.observe(p.value)})}),e.onUnmounted(()=>{v?.disconnect()}),e.onDeactivated(()=>{v?.disconnect()});const b=e.computed(()=>t.isNumber(r.gap)?`${r.gap}px`:t.isArray(r.gap)?`${r.gap[1]}px ${r.gap[0]}px`:"unset"),g=e.computed(()=>({display:"grid",gridGap:b.value,gridTemplateColumns:`repeat(${d.value}, minmax(0, 1fr))`}));return o.useRender(()=>{const o=a?.default()??[];if(r.collapsed){const e=[];let t=null;o.forEach(o=>{"object"==typeof o.type&&"FaLayoutGridItem"===o.type.name&&void 0!==o.props?.suffix&&(t=o),"symbol"==typeof o.type&&Array.isArray(o?.children)&&e.push(...o.children)});let r=0;t&&(r=(t.props[i.value]?.span??t.props?.span??1)+(t.props[i.value]?.offset??t.props?.offset??0));try{let o=!1;e.reduce((e=0,t,s)=>{if(e+=(t.props[i.value]?.span??t.props?.span??1)+(t.props[i.value]?.offset??t.props?.offset??0),Number(e)>c*Number(d.value)-r)throw u.value=s,o=!0,"find it";return e},0),o||(u.value=-1)}catch{}}else u.value=-1;return e.createVNode("div",{ref:p,style:g.value},[o])}),o.useExpose(n,{breakPoint:i})}});exports.default=r;
2
2
  //# sourceMappingURL=layoutGrid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGrid.js","sources":["../../../../../packages/components/layoutGrid/src/layoutGrid.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onActivated, onDeactivated, onMounted, onUnmounted, provide, ref, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"@fast-china/utils\";\nimport { isArray, isNumber, isObject } from \"lodash-unified\";\nimport type { FaLayoutGridBreakPoint } from \"./layoutGrid.type\";\nimport type { VNode, VNodeArrayChildren } from \"vue\";\n\ntype FaLayoutGridSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n};\n\nexport default defineComponent({\n\tname: \"FaLayoutGrid\",\n\tprops: {\n\t\t/** @description Grid布局列配置 */\n\t\tcols: {\n\t\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakPoint, number>>([String, Number, Object]),\n\t\t\tdefault: (): Record<FaLayoutGridBreakPoint, number> => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t\t},\n\t\t/** @description 折叠 */\n\t\tcollapsed: Boolean,\n\t\t/** @description 折叠行数 */\n\t\tcollapsedRows: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 间距,偏移 */\n\t\tgap: {\n\t\t\ttype: definePropType<number | [number, number]>([Number, Array]),\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 断点变化事件 */\n\t\tbreakPointChange: ({ breakPoint }: { breakPoint: FaLayoutGridBreakPoint }) => true,\n\t},\n\tslots: makeSlots<FaLayoutGridSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst divElRef = ref<HTMLElement>();\n\n\t\t// 注入 gap 间距\n\t\tprovide(\"gap\", isArray(props.gap) ? props.gap[0] : props.gap);\n\n\t\t// 注入响应式断点\n\t\tconst breakPoint = ref<FaLayoutGridBreakPoint>(\"xl\");\n\t\tprovide(\"breakPoint\", breakPoint);\n\n\t\t// 注入要开始折叠的 index\n\t\tconst hiddenIndex = ref(-1);\n\t\tprovide(\"shouldHiddenIndex\", hiddenIndex);\n\n\t\t// 注入 cols\n\t\tconst cols = computed(() => {\n\t\t\tif (isObject(props.cols)) return props.cols[breakPoint.value] ?? props.cols;\n\t\t\treturn props.cols;\n\t\t});\n\t\tprovide(\"cols\", cols);\n\n\t\tconst collapsedRows = isNumber(props.collapsedRows) ? props.collapsedRows : Number(props.collapsedRows);\n\n\t\t// 断点映射\n\t\tconst breakpoints = {\n\t\t\t// 小于480屏幕(如手机)\n\t\t\txs: { min: 0, max: 479 },\n\t\t\t// 平板竖屏\n\t\t\tsm: { min: 480, max: 768 },\n\t\t\t// 平板横屏\n\t\t\tmd: { min: 768, max: 1024 },\n\t\t\t// 小型桌面\n\t\t\tlg: { min: 1024, max: 1440 },\n\t\t\t// 大型桌面\n\t\t\txl: { min: 1440, max: Infinity },\n\t\t};\n\n\t\t// 监听屏幕变化\n\t\tconst resize = (e: ResizeObserverEntry[]): void => {\n\t\t\t// 这里肯定只有一个\n\t\t\tif (e.length !== 1) throw new Error(\"未知的多个El\");\n\t\t\tconst curEl = e[0];\n\t\t\tconst width = curEl.target.scrollWidth;\n\n\t\t\tfor (const [key, { min, max }] of Object.entries(breakpoints)) {\n\t\t\t\tif (width >= min && width <= max) {\n\t\t\t\t\tbreakPoint.value = key as FaLayoutGridBreakPoint;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet resizeObserver: ResizeObserver = null;\n\n\t\tonMounted(() => {\n\t\t\tnextTick(() => {\n\t\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\t\tresizeObserver.observe(divElRef.value);\n\t\t\t});\n\n\t\t\t// 断点变化时 执行 findIndex\n\t\t\twatch(\n\t\t\t\t() => breakPoint.value,\n\t\t\t\t(newValue) => {\n\t\t\t\t\temit(\"breakPointChange\", { breakPoint: newValue });\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timmediate: true,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tonActivated(() => {\n\t\t\tnextTick(() => {\n\t\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\t\tresizeObserver.observe(divElRef.value);\n\t\t\t});\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tonDeactivated(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\t// 设置间距\n\t\tconst gap = computed(() => {\n\t\t\tif (isNumber(props.gap)) return `${props.gap}px`;\n\t\t\tif (isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;\n\t\t\treturn \"unset\";\n\t\t});\n\n\t\t// 设置 style\n\t\tconst style = computed(() => {\n\t\t\treturn {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridGap: gap.value,\n\t\t\t\tgridTemplateColumns: `repeat(${cols.value}, minmax(0, 1fr))`,\n\t\t\t};\n\t\t});\n\n\t\tuseRender(() => {\n\t\t\tconst defaultSlot = slots?.default() ?? [];\n\n\t\t\tif (props.collapsed) {\n\t\t\t\tconst fields: VNodeArrayChildren = [];\n\t\t\t\tlet suffix: VNode = null;\n\n\t\t\t\tdefaultSlot.forEach((slot: any) => {\n\t\t\t\t\t// suffix\n\t\t\t\t\tif (typeof slot.type === \"object\" && slot.type.name === \"FaLayoutGridItem\" && slot.props?.suffix !== undefined) suffix = slot;\n\t\t\t\t\t// slot children\n\t\t\t\t\tif (typeof slot.type === \"symbol\" && Array.isArray(slot?.children)) fields.push(...slot.children);\n\t\t\t\t});\n\n\t\t\t\t// 计算 suffix 所占用的列\n\t\t\t\tlet suffixCols = 0;\n\t\t\t\tif (suffix) {\n\t\t\t\t\tsuffixCols =\n\t\t\t\t\t\t(suffix.props[breakPoint.value]?.span ?? suffix.props?.span ?? 1) +\n\t\t\t\t\t\t(suffix.props[breakPoint.value]?.offset ?? suffix.props?.offset ?? 0);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tlet find = false;\n\t\t\t\t\tfields.reduce((prev = 0, current, index) => {\n\t\t\t\t\t\tprev +=\n\t\t\t\t\t\t\t((current as VNode).props[breakPoint.value]?.span ?? (current as VNode).props?.span ?? 1) +\n\t\t\t\t\t\t\t((current as VNode).props[breakPoint.value]?.offset ?? (current as VNode).props?.offset ?? 0);\n\t\t\t\t\t\tif (Number(prev) > collapsedRows * Number(cols.value) - suffixCols) {\n\t\t\t\t\t\t\thiddenIndex.value = index;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t\tthrow \"find it\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn prev;\n\t\t\t\t\t}, 0);\n\t\t\t\t\tif (!find) hiddenIndex.value = -1;\n\t\t\t\t} catch {}\n\t\t\t} else {\n\t\t\t\thiddenIndex.value = -1;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div ref={divElRef} style={style.value}>\n\t\t\t\t\t{defaultSlot}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 响应式断点 */\n\t\t\tbreakPoint,\n\t\t});\n\t},\n});\n"],"names":["LayoutGrid","name","props","cols","type","definePropType","String","Number","Object","default","xs","sm","md","lg","xl","collapsed","Boolean","collapsedRows","gap","Array","emits","breakPointChange","breakPoint","slots","makeSlots","setup","emit","expose","divElRef","ref","provide","isArray","hiddenIndex","computed","isObject","value","isNumber","breakpoints","min","max","Infinity","resize","e","length","Error","width","target","scrollWidth","key","entries","resizeObserver","onMounted","nextTick","ResizeObserver","observe","watch","newValue","immediate","onActivated","onUnmounted","disconnect","onDeactivated","style","display","gridGap","gridTemplateColumns","useRender","defaultSlot","fields","suffix","forEach","slot","undefined","children","push","suffixCols","span","offset","find","reduce","prev","current","index","_createVNode","useExpose"],"mappings":"8LAWAA,oBAA+B,CAC9BC,KAAM,eACNC,MAAO,CAENC,KAAM,CACLC,KAAMC,EAAAA,eAAyE,CAACC,OAAQC,OAAQC,SAChGC,QAASA,KAAAA,CAAiDC,GAAI,EAAGC,GAAI,EAAGC,GAAI,EAAGC,GAAI,EAAGC,GAAI,KAG3FC,UAAWC,QAEXC,cAAe,CACdb,KAAM,CAACE,OAAQC,QACfE,QAAS,GAGVS,IAAK,CACJd,KAAMC,EAAAA,eAA0C,CAACE,OAAQY,QACzDV,QAAS,IAGXW,MAAO,CAENC,iBAAkBA,EAAGC,iBAAyD,GAE/EC,MAAOC,EAAAA,YACPC,KAAAA,CAAMvB,GAAOqB,MAAEA,EAAAA,KAAOG,EAAAA,OAAMC,IAC3B,MAAMC,EAAWC,EAAAA,MAGjBC,EAAAA,QAAQ,MAAOC,UAAQ7B,EAAMgB,KAAOhB,EAAMgB,IAAI,GAAKhB,EAAMgB,KAGzD,MAAMI,EAAaO,EAAAA,IAA4B,MAC/CC,EAAAA,QAAQ,aAAcR,GAGtB,MAAMU,EAAcH,OAAI,GACxBC,EAAAA,QAAQ,oBAAqBE,GAG7B,MAAM7B,EAAO8B,EAAAA,SAAS,IACjBC,WAAShC,EAAMC,MAAcD,EAAMC,KAAKmB,EAAWa,QAAUjC,EAAMC,KAChED,EAAMC,MAEd2B,EAAAA,QAAQ,OAAQ3B,GAEhB,MAAMc,EAAgBmB,WAASlC,EAAMe,eAAiBf,EAAMe,cAAg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GAAOd,WAAa,GAExC,GAAIP,EAAMa,UAAW,CACpB,MAAMqD,EAA6B,GACnC,IAAIC,EAAgB,KAEpBF,EAAYG,QAASC,IAEK,iBAAdA,EAAKnE,MAAwC,qBAAnBmE,EAAKnE,KAAKH,WAAsDuE,IAAvBD,EAAKrE,OAAOmE,SAAsBA,EAASE,GAEhG,iBAAdA,EAAKnE,MAAqBe,MAAMY,QAAQwC,GAAME,WAAWL,EAAOM,QAAQH,EAAKE,YAIzF,IAAIE,EAAa,EACbN,IACHM,GACEN,EAAOnE,MAAMoB,EAAWa,QAAQyC,MAAQP,EAAOnE,OAAO0E,MAAQ,IAC9DP,EAAOnE,MAAMoB,EAAWa,QAAQ0C,QAAUR,EAAOnE,OAAO2E,QAAU,IAGrE,IACC,IAAIC,GAAO,EACXV,EAAOW,OAAO,CAACC,EAAO,EAAGC,EAASC,KAIjC,GAHAF,IACGC,EAAkB/E,MAAMoB,EAAWa,QAAQyC,MAASK,EAAkB/E,OAAO0E,MAAQ,IACrFK,EAAkB/E,MAAMoB,EAAWa,QAAQ0C,QAAWI,EAAkB/E,OAAO2E,QAAU,GACxFtE,OAAOyE,GAAQ/D,EAAgBV,OAAOJ,EAAKgC,OAASwC,EAGvD,MAFA3C,EAAYG,MAAQ+C,EACpBJ,GAAO,EACD,UAEP,OAAOE,GACL,GACEF,IAAM9C,EAAYG,OAAQ,EAChC,CAAA,MAAS,CACV,MACCH,EAAYG,OAAQ,EAGrB,OAAAgD,EAAAA,YAAA,MAAA,CAAAtD,IACWD,EAAQkC,MAASA,EAAM3B,OAAK,CACpCgC,MAKGiB,EAAAA,UAAUzD,EAAQ,CAExBL,cAEF"}
1
+ {"version":3,"file":"layoutGrid.js","sources":["../../../../../packages/components/layoutGrid/src/layoutGrid.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onActivated, onDeactivated, onMounted, onUnmounted, provide, ref, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"@fast-china/utils\";\nimport { isArray, isNumber, isObject } from \"lodash-unified\";\nimport type { FaLayoutGridBreakPoint } from \"./layoutGrid.type\";\nimport type { VNode, VNodeArrayChildren } from \"vue\";\n\ntype FaLayoutGridSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n};\n\nexport default defineComponent({\n\tname: \"FaLayoutGrid\",\n\tprops: {\n\t\t/** @description Grid布局列配置 */\n\t\tcols: {\n\t\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakPoint, number>>([String, Number, Object]),\n\t\t\tdefault: (): Record<FaLayoutGridBreakPoint, number> => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t\t},\n\t\t/** @description 折叠 */\n\t\tcollapsed: Boolean,\n\t\t/** @description 折叠行数 */\n\t\tcollapsedRows: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 间距,偏移 */\n\t\tgap: {\n\t\t\ttype: definePropType<number | [number, number]>([Number, Array]),\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 断点变化事件 */\n\t\tbreakPointChange: ({ breakPoint }: { breakPoint: FaLayoutGridBreakPoint }) => true,\n\t},\n\tslots: makeSlots<FaLayoutGridSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst divElRef = ref<HTMLElement>();\n\n\t\t// 注入 gap 间距\n\t\tprovide(\"gap\", isArray(props.gap) ? props.gap[0] : props.gap);\n\n\t\t// 注入响应式断点\n\t\tconst breakPoint = ref<FaLayoutGridBreakPoint>(\"xl\");\n\t\tprovide(\"breakPoint\", breakPoint);\n\n\t\t// 注入要开始折叠的 index\n\t\tconst hiddenIndex = ref(-1);\n\t\tprovide(\"shouldHiddenIndex\", hiddenIndex);\n\n\t\t// 注入 cols\n\t\tconst cols = computed(() => {\n\t\t\tif (isObject(props.cols)) return props.cols[breakPoint.value] ?? props.cols;\n\t\t\treturn props.cols;\n\t\t});\n\t\tprovide(\"cols\", cols);\n\n\t\tconst collapsedRows = isNumber(props.collapsedRows) ? props.collapsedRows : Number(props.collapsedRows);\n\n\t\t// 断点映射\n\t\tconst breakpoints = {\n\t\t\t// 小于480屏幕(如手机)\n\t\t\txs: { min: 0, max: 479 },\n\t\t\t// 平板竖屏\n\t\t\tsm: { min: 480, max: 768 },\n\t\t\t// 平板横屏\n\t\t\tmd: { min: 768, max: 1024 },\n\t\t\t// 小型桌面\n\t\t\tlg: { min: 1024, max: 1440 },\n\t\t\t// 大型桌面\n\t\t\txl: { min: 1440, max: Infinity },\n\t\t};\n\n\t\t// 监听屏幕变化\n\t\tconst resize = (e: ResizeObserverEntry[]): void => {\n\t\t\t// 这里肯定只有一个\n\t\t\tif (e.length !== 1) throw new Error(\"未知的多个El\");\n\t\t\tconst curEl = e[0];\n\t\t\tconst width = curEl.target.scrollWidth;\n\n\t\t\tfor (const [key, { min, max }] of Object.entries(breakpoints)) {\n\t\t\t\tif (width >= min && width <= max) {\n\t\t\t\t\tbreakPoint.value = key as FaLayoutGridBreakPoint;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet resizeObserver: ResizeObserver = null;\n\n\t\tonMounted(() => {\n\t\t\tnextTick(() => {\n\t\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\t\tresizeObserver.observe(divElRef.value);\n\t\t\t});\n\n\t\t\t// 断点变化时 执行 findIndex\n\t\t\twatch(\n\t\t\t\t() => breakPoint.value,\n\t\t\t\t(newValue) => {\n\t\t\t\t\temit(\"breakPointChange\", { breakPoint: newValue });\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timmediate: true,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tonActivated(() => {\n\t\t\tnextTick(() => {\n\t\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\t\tresizeObserver.observe(divElRef.value);\n\t\t\t});\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tonDeactivated(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\t// 设置间距\n\t\tconst gap = computed(() => {\n\t\t\tif (isNumber(props.gap)) return `${props.gap}px`;\n\t\t\tif (isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;\n\t\t\treturn \"unset\";\n\t\t});\n\n\t\t// 设置 style\n\t\tconst style = computed(() => {\n\t\t\treturn {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridGap: gap.value,\n\t\t\t\tgridTemplateColumns: `repeat(${cols.value}, minmax(0, 1fr))`,\n\t\t\t};\n\t\t});\n\n\t\tuseRender(() => {\n\t\t\tconst defaultSlot = slots?.default() ?? [];\n\n\t\t\tif (props.collapsed) {\n\t\t\t\tconst fields: VNodeArrayChildren = [];\n\t\t\t\tlet suffix: VNode = null;\n\n\t\t\t\tdefaultSlot.forEach((slot: any) => {\n\t\t\t\t\t// suffix\n\t\t\t\t\tif (typeof slot.type === \"object\" && slot.type.name === \"FaLayoutGridItem\" && slot.props?.suffix !== undefined) suffix = slot;\n\t\t\t\t\t// slot children\n\t\t\t\t\tif (typeof slot.type === \"symbol\" && Array.isArray(slot?.children)) fields.push(...slot.children);\n\t\t\t\t});\n\n\t\t\t\t// 计算 suffix 所占用的列\n\t\t\t\tlet suffixCols = 0;\n\t\t\t\tif (suffix) {\n\t\t\t\t\tsuffixCols =\n\t\t\t\t\t\t(suffix.props[breakPoint.value]?.span ?? suffix.props?.span ?? 1) +\n\t\t\t\t\t\t(suffix.props[breakPoint.value]?.offset ?? suffix.props?.offset ?? 0);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tlet find = false;\n\t\t\t\t\tfields.reduce((prev = 0, current, index) => {\n\t\t\t\t\t\tprev +=\n\t\t\t\t\t\t\t((current as VNode).props[breakPoint.value]?.span ?? (current as VNode).props?.span ?? 1) +\n\t\t\t\t\t\t\t((current as VNode).props[breakPoint.value]?.offset ?? (current as VNode).props?.offset ?? 0);\n\t\t\t\t\t\tif (Number(prev) > collapsedRows * Number(cols.value) - suffixCols) {\n\t\t\t\t\t\t\thiddenIndex.value = index;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t\tthrow \"find it\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn prev;\n\t\t\t\t\t}, 0);\n\t\t\t\t\tif (!find) hiddenIndex.value = -1;\n\t\t\t\t} catch {}\n\t\t\t} else {\n\t\t\t\thiddenIndex.value = -1;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div ref={divElRef} style={style.value}>\n\t\t\t\t\t{defaultSlot}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 响应式断点 */\n\t\t\tbreakPoint,\n\t\t});\n\t},\n});\n"],"names":["LayoutGrid","name","props","cols","type","definePropType","String","Number","Object","default","xs","sm","md","lg","xl","collapsed","Boolean","collapsedRows","gap","Array","emits","breakPointChange","breakPoint","slots","makeSlots","setup","attrs","emit","expose","divElRef","ref","provide","isArray","hiddenIndex","computed","isObject","value","isNumber","breakpoints","min","max","Infinity","resize","e","length","Error","width","target","scrollWidth","key","entries","resizeObserver","onMounted","nextTick","ResizeObserver","observe","watch","newValue","immediate","onActivated","onUnmounted","disconnect","onDeactivated","style","display","gridGap","gridTemplateColumns","useRender","defaultSlot","fields","suffix","forEach","slot","undefined","children","push","suffixCols","span","offset","find","reduce","prev","current","index","_createVNode","useExpose"],"mappings":"8LAWAA,oBAA+B,CAC9BC,KAAM,eACNC,MAAO,CAENC,KAAM,CACLC,KAAMC,EAAAA,eAAyE,CAACC,OAAQC,OAAQC,SAChGC,QAASA,KAAAA,CAAiDC,GAAI,EAAGC,GAAI,EAAGC,GAAI,EAAGC,GAAI,EAAGC,GAAI,KAG3FC,UAAWC,QAEXC,cAAe,CACdb,KAAM,CAACE,OAAQC,QACfE,QAAS,GAGVS,IAAK,CACJd,KAAMC,EAAAA,eAA0C,CAACE,OAAQY,QACzDV,Q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EAAkBhF,MAAMoB,EAAWc,QAAQ0C,QAAWI,EAAkBhF,OAAO4E,QAAU,GACxFvE,OAAO0E,GAAQhE,EAAgBV,OAAOJ,EAAKiC,OAASwC,EAGvD,MAFA3C,EAAYG,MAAQ+C,EACpBJ,GAAO,EACD,UAEP,OAAOE,GACL,GACEF,IAAM9C,EAAYG,OAAQ,EAChC,CAAA,MAAS,CACV,MACCH,EAAYG,OAAQ,EAGrB,OAAAgD,EAAAA,YAAA,MAAA,CAAAtD,IACWD,EAAQkC,MAASA,EAAM3B,OAAK,CACpCgC,MAKGiB,EAAAA,UAAUzD,EAAQ,CAExBN,cAEF"}
@@ -6,12 +6,12 @@ type FaLayoutGridItemSlots = {
6
6
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
7
7
  /** @description 偏移 */
8
8
  offset: {
9
- type: NumberConstructor;
9
+ type: (NumberConstructor | StringConstructor)[];
10
10
  default: number;
11
11
  };
12
12
  /** @description 占位 */
13
13
  span: {
14
- type: NumberConstructor;
14
+ type: (NumberConstructor | StringConstructor)[];
15
15
  default: number;
16
16
  };
17
17
  /** @description 后缀 */
@@ -49,12 +49,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
49
49
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
50
50
  /** @description 偏移 */
51
51
  offset: {
52
- type: NumberConstructor;
52
+ type: (NumberConstructor | StringConstructor)[];
53
53
  default: number;
54
54
  };
55
55
  /** @description 占位 */
56
56
  span: {
57
- type: NumberConstructor;
57
+ type: (NumberConstructor | StringConstructor)[];
58
58
  default: number;
59
59
  };
60
60
  /** @description 后缀 */
@@ -88,8 +88,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
88
88
  default: FaLayoutGridItemResponsive;
89
89
  };
90
90
  }>> & Readonly<{}>, {
91
- span: number;
92
- offset: number;
91
+ span: string | number;
92
+ offset: string | number;
93
93
  xs: FaLayoutGridItemResponsive;
94
94
  sm: FaLayoutGridItemResponsive;
95
95
  md: FaLayoutGridItemResponsive;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("@fast-china/utils"),a=e.defineComponent({name:"FaLayoutGridItem",props:{offset:{type:Number,default:0},span:{type:Number,default:1},suffix:{type:Boolean,default:!1},xs:{type:t.definePropType(Object),default:void 0},sm:{type:t.definePropType(Object),default:void 0},md:{type:t.definePropType(Object),default:void 0},lg:{type:t.definePropType(Object),default:void 0},xl:{type:t.definePropType(Object),default:void 0}},slots:t.makeSlots(),setup(a,{attrs:o,slots:s,emit:u,expose:n}){const i=e.reactive({show:!0}),d=o,l=e.inject("breakPoint",e.ref("xl")),r=e.inject("shouldHiddenIndex",e.ref(-1));e.watch(()=>[r.value,l.value],e=>{~~d.index&&(i.show=!(-1!==e[0]&&parseInt(d.index)>=Number(e[0])))},{immediate:!0});const p=e.inject("gap",0),f=e.inject("cols",e.ref(5)),c=e.computed(()=>{const e=a[l.value],t=e?.span??a.span,o=e?.offset??a.offset;return a.suffix?{gridColumnStart:f.value-t-o+1,gridColumnEnd:`span ${t+o}`,marginLeft:0!==o?`calc(((100% + ${p}px) / ${t+o}) * ${o})`:"unset"}:{gridColumn:`span ${t+o>f.value?f.value:t+o}/span ${t+o>f.value?f.value:t+o}`,marginLeft:0!==o?`calc(((100% + ${p}px) / ${t+o}) * ${o})`:"unset"}});return t.useRender(()=>e.withDirectives(e.createVNode("div",{style:c.value},[s.default&&s.default()]),[[e.vShow,i.show]])),t.useExpose(n,{show:i.show})}});exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("@fast-china/utils"),s=require("lodash-unified"),u=e.defineComponent({name:"FaLayoutGridItem",props:{offset:{type:[String,Number],default:0},span:{type:[String,Number],default:1},suffix:{type:Boolean,default:!1},xs:{type:t.definePropType(Object),default:void 0},sm:{type:t.definePropType(Object),default:void 0},md:{type:t.definePropType(Object),default:void 0},lg:{type:t.definePropType(Object),default:void 0},xl:{type:t.definePropType(Object),default:void 0}},slots:t.makeSlots(),setup(u,{attrs:a,slots:o,emit:i,expose:n}){const r=e.reactive({show:!0}),d=a,l=e.inject("breakPoint",e.ref("xl")),p=e.inject("shouldHiddenIndex",e.ref(-1));e.watch(()=>[p.value,l.value],e=>{~~d.index&&(r.show=!(-1!==e[0]&&parseInt(d.index)>=Number(e[0])))},{immediate:!0});const f=e.inject("gap",0),c=e.inject("cols",e.ref(5)),m=e.computed(()=>{const e=u[l.value],t=e?.span??(s.isNumber(u.span)?u.span:Number(u.span)),a=e?.offset??(s.isNumber(u.offset)?u.offset:Number(u.offset));return u.suffix?{gridColumnStart:c.value-t-a+1,gridColumnEnd:`span ${t+a}`,marginLeft:0!==a?`calc(((100% + ${f}px) / ${t+a}) * ${a})`:"unset"}:{gridColumn:`span ${t+a>c.value?c.value:t+a}/span ${t+a>c.value?c.value:t+a}`,marginLeft:0!==a?`calc(((100% + ${f}px) / ${t+a}) * ${a})`:"unset"}});return t.useRender(()=>e.withDirectives(e.createVNode("div",{style:m.value},[o.default&&o.default()]),[[e.vShow,r.show]])),t.useExpose(n,{show:r.show})}});exports.default=u;
2
2
  //# sourceMappingURL=layoutGridItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGridItem.js","sources":["../../../../../packages/components/layoutGrid/src/layoutGridItem.tsx"],"sourcesContent":["import { computed, defineComponent, inject, reactive, ref, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"@fast-china/utils\";\nimport type { FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\nimport type { FaLayoutGridBreakPoint } from \"@fast-element-plus/components/layoutGrid\";\nimport type { Ref } from \"vue\";\n\ntype FaLayoutGridItemSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n};\n\nexport default defineComponent({\n\tname: \"FaLayoutGridItem\",\n\tprops: {\n\t\t/** @description 偏移 */\n\t\toffset: { type: Number, default: 0 },\n\t\t/** @description 占位 */\n\t\tspan: { type: Number, default: 1 },\n\t\t/** @description 后缀 */\n\t\tsuffix: { type: Boolean, default: false },\n\t\t/** @description 响应式,小于480px屏幕配置 */\n\t\txs: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,平板竖屏配置 */\n\t\tsm: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,平板横屏配置 */\n\t\tmd: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,小型桌面配置 */\n\t\tlg: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,大型桌面配置 */\n\t\txl: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t},\n\tslots: makeSlots<FaLayoutGridItemSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tshow: true,\n\t\t});\n\n\t\tconst attrsObj = attrs as any;\n\n\t\t// 注入断点\n\t\tconst breakPoint = inject<Ref<FaLayoutGridBreakPoint>>(\"breakPoint\", ref(\"xl\"));\n\t\tconst shouldHiddenIndex = inject<Ref<number>>(\"shouldHiddenIndex\", ref(-1));\n\n\t\twatch(\n\t\t\t() => [shouldHiddenIndex.value, breakPoint.value],\n\t\t\t(n) => {\n\t\t\t\tif (~~attrsObj.index) {\n\t\t\t\t\tstate.show = !(n[0] !== -1 && parseInt(attrsObj.index) >= Number(n[0]));\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tconst gap = inject(\"gap\", 0);\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(5));\n\n\t\tconst style = computed(() => {\n\t\t\tconst breakPointObk = props[breakPoint.value] as FaLayoutGridItemResponsive;\n\t\t\tconst span = breakPointObk?.span ?? props.span;\n\t\t\tconst offset = breakPointObk?.offset ?? props.offset;\n\t\t\tif (props.suffix) {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumnStart: cols.value - span - offset + 1,\n\t\t\t\t\tgridColumnEnd: `span ${span + offset}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${\n\t\t\t\t\t\tspan + offset > cols.value ? cols.value : span + offset\n\t\t\t\t\t}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<div style={style.value} vShow={state.show}>\n\t\t\t\t{slots.default && slots.default()}\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\tshow: state.show,\n\t\t});\n\t},\n});\n"],"names":["LayoutGridItem","name","props","offset","type","Number","default","span","suffix","Boolean","xs","definePropType","Object","undefined","sm","md","lg","xl","slots","makeSlots","setup","attrs","emit","expose","state","reactive","show","attrsObj","breakPoint","inject","ref","shouldHiddenIndex","watch","value","n","index","parseInt","immediate","gap","cols","style","computed","breakPointObk","gridColumnStart","gridColumnEnd","marginLeft","gridColumn","useRender","_withDirectives","_createVNode","_vShow","useExpose"],"mappings":"kKAWAA,oBAA+B,CAC9BC,KAAM,m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AAY/B,EAAOJ,QAAaA,KAAY,SAGlF,CACN2C,WAAY,QAAQvC,EAAOJ,EAASoC,EAAKN,MAAQM,EAAKN,MAAQ1B,EAAOJ,UACpEI,EAAOJ,EAASoC,EAAKN,MAAQM,EAAKN,MAAQ1B,EAAOJ,IAElD0C,WAAuB,IAAX1C,EAAe,iBAAiBmC,UAAY/B,EAAOJ,QAAaA,KAAY,WAW3F,OANA4C,EAAAA,UAAU,IAAAC,EAAAA,eAAAC,EAAAA,YAAA,MAAA,CAAAT,MACGA,EAAMP,OAAK,CACrBf,EAAMZ,SAAWY,EAAMZ,YAAS,CAAA,CAAA4C,EAAAA,MADF1B,EAAME,SAKhCyB,EAAAA,UAAU5B,EAAQ,CACxBG,KAAMF,EAAME,MAEd"}
1
+ {"version":3,"file":"layoutGridItem.js","sources":["../../../../../packages/components/layoutGrid/src/layoutGridItem.tsx"],"sourcesContent":["import { computed, defineComponent, inject, reactive, ref, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"@fast-china/utils\";\nimport type { FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\nimport type { FaLayoutGridBreakPoint } from \"@fast-element-plus/components/layoutGrid\";\nimport type { Ref } from \"vue\";\nimport { isNumber } from \"lodash-unified\";\n\ntype FaLayoutGridItemSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n};\n\nexport default defineComponent({\n\tname: \"FaLayoutGridItem\",\n\tprops: {\n\t\t/** @description 偏移 */\n\t\toffset: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 0,\n\t\t},\n\t\t/** @description 占位 */\n\t\tspan: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 后缀 */\n\t\tsuffix: { type: Boolean, default: false },\n\t\t/** @description 响应式,小于480px屏幕配置 */\n\t\txs: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,平板竖屏配置 */\n\t\tsm: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,平板横屏配置 */\n\t\tmd: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,小型桌面配置 */\n\t\tlg: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t\t/** @description 响应式,大型桌面配置 */\n\t\txl: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined as FaLayoutGridItemResponsive,\n\t\t},\n\t},\n\tslots: makeSlots<FaLayoutGridItemSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tshow: true,\n\t\t});\n\n\t\tconst attrsObj = attrs as any;\n\n\t\t// 注入断点\n\t\tconst breakPoint = inject<Ref<FaLayoutGridBreakPoint>>(\"breakPoint\", ref(\"xl\"));\n\t\tconst shouldHiddenIndex = inject<Ref<number>>(\"shouldHiddenIndex\", ref(-1));\n\n\t\twatch(\n\t\t\t() => [shouldHiddenIndex.value, breakPoint.value],\n\t\t\t(n) => {\n\t\t\t\tif (~~attrsObj.index) {\n\t\t\t\t\tstate.show = !(n[0] !== -1 && parseInt(attrsObj.index) >= Number(n[0]));\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tconst gap = inject(\"gap\", 0);\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(5));\n\n\t\tconst style = computed(() => {\n\t\t\tconst breakPointObk = props[breakPoint.value] as FaLayoutGridItemResponsive;\n\t\t\tconst span = breakPointObk?.span ?? (isNumber(props.span) ? props.span : Number(props.span));\n\t\t\tconst offset = breakPointObk?.offset ?? (isNumber(props.offset) ? props.offset : Number(props.offset));\n\t\t\tif (props.suffix) {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumnStart: cols.value - span - offset + 1,\n\t\t\t\t\tgridColumnEnd: `span ${span + offset}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${\n\t\t\t\t\t\tspan + offset > cols.value ? cols.value : span + offset\n\t\t\t\t\t}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<div style={style.value} vShow={state.show}>\n\t\t\t\t{slots.default && slots.default()}\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\tshow: state.show,\n\t\t});\n\t},\n});\n"],"names":["LayoutGridItem","name","props","offset","type","String","Number","default","span","suffix","Boolean","xs","definePropType","Object","undefined","sm","md","lg","xl","slots","makeSlots","setup","attrs","emit","expose","state","reactive","show","attrsObj","breakPoint","inject","ref","shouldHiddenIndex","watch","value","n","index","parseInt","immediate","gap","cols","style","computed","breakPointObk","isNumber","gridColumnStart","gridColumnEnd","marginLeft","gridColumn","useRender","_withDirectives","_createVNode","_vShow","useExpose"],"mappings":"8LAYAA,oBAA+B,CAC9BC,KAAM,mBACNC,MAAO,CAENC,OAAQ,CACPC,KAAM,CAACC,OAAQC,QACfC,QAAS,GAGVC,KAAM,CACLJ,KAAM,CAACC,OAAQC,QACfC,QAAS,GAGVE,OAAQ,CAAEL,KAAMM,QAASH,SAAS,GAElCI,GAAI,CACHP,KAAMQ,EAAAA,eAA2CC,QACjDN,aAASO,GAGVC,GAAI,CACHX,KAAMQ,EAAAA,eAA2CC,QACjDN,aA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