@silver-formily/element-plus 1.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +35 -35
  3. package/esm/__builtins__/configs/index.mjs.map +1 -1
  4. package/esm/__builtins__/shared/hooks.mjs.map +1 -1
  5. package/esm/__builtins__/shared/loading.mjs.map +1 -1
  6. package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
  7. package/esm/__builtins__/shared/transform-component.d.ts +1 -2
  8. package/esm/__builtins__/shared/transform-component.mjs +1 -1
  9. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  10. package/esm/__builtins__/shared/utils.mjs +1 -1
  11. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  12. package/esm/array-base/index.mjs +39 -42
  13. package/esm/array-base/index.mjs.map +1 -1
  14. package/esm/array-base/symbols.mjs.map +1 -1
  15. package/esm/array-base/utils.mjs +29 -33
  16. package/esm/array-base/utils.mjs.map +1 -1
  17. package/esm/array-cards/array-cards.d.ts +1 -1
  18. package/esm/array-cards/index.d.ts +3 -3
  19. package/esm/array-cards/index.mjs +23 -25
  20. package/esm/array-cards/index.mjs.map +1 -1
  21. package/esm/array-collapse/array-collapse.d.ts +2 -2
  22. package/esm/array-collapse/index.d.ts +3 -3
  23. package/esm/array-collapse/index.mjs +87 -88
  24. package/esm/array-collapse/index.mjs.map +1 -1
  25. package/esm/array-collapse/utils.mjs +2 -8
  26. package/esm/array-collapse/utils.mjs.map +1 -1
  27. package/esm/array-items/index.mjs +29 -32
  28. package/esm/array-items/index.mjs.map +1 -1
  29. package/esm/array-list-tabs/array-list-tabs.d.ts +3 -3
  30. package/esm/array-list-tabs/index.d.ts +6 -6
  31. package/esm/array-list-tabs/index.mjs +88 -86
  32. package/esm/array-list-tabs/index.mjs.map +1 -1
  33. package/esm/array-list-tabs/utils.mjs +5 -11
  34. package/esm/array-list-tabs/utils.mjs.map +1 -1
  35. package/esm/array-table/array-table.d.ts +1 -1
  36. package/esm/array-table/index.d.ts +3 -3
  37. package/esm/array-table/index.mjs +48 -50
  38. package/esm/array-table/index.mjs.map +1 -1
  39. package/esm/array-table/types.d.ts +1 -1
  40. package/esm/array-table/utils.mjs +12 -18
  41. package/esm/array-table/utils.mjs.map +1 -1
  42. package/esm/array-tabs/index.mjs +26 -28
  43. package/esm/array-tabs/index.mjs.map +1 -1
  44. package/esm/cascader/cascader.d.ts +1 -6
  45. package/esm/cascader/index.d.ts +3 -16
  46. package/esm/cascader/index.mjs +26 -32
  47. package/esm/cascader/index.mjs.map +1 -1
  48. package/esm/checkbox/checkbox-group.d.ts +2 -15
  49. package/esm/checkbox/index.d.ts +3 -28
  50. package/esm/checkbox/index.mjs +33 -45
  51. package/esm/checkbox/index.mjs.map +1 -1
  52. package/esm/date-picker/index.d.ts +442 -1
  53. package/esm/date-picker/index.mjs +9 -18
  54. package/esm/date-picker/index.mjs.map +1 -1
  55. package/esm/editable/index.mjs +34 -36
  56. package/esm/editable/index.mjs.map +1 -1
  57. package/esm/form/form.mjs +7 -7
  58. package/esm/form/form.mjs.map +1 -1
  59. package/esm/form-button-group/index.mjs +20 -23
  60. package/esm/form-button-group/index.mjs.map +1 -1
  61. package/esm/form-button-group/utils.mjs +2 -8
  62. package/esm/form-button-group/utils.mjs.map +1 -1
  63. package/esm/form-collapse/index.mjs +31 -32
  64. package/esm/form-collapse/index.mjs.map +1 -1
  65. package/esm/form-collapse/utils.mjs.map +1 -1
  66. package/esm/form-dialog/index.mjs +18 -18
  67. package/esm/form-dialog/index.mjs.map +1 -1
  68. package/esm/form-drawer/index.mjs +17 -17
  69. package/esm/form-drawer/index.mjs.map +1 -1
  70. package/esm/form-grid/hooks.mjs.map +1 -1
  71. package/esm/form-grid/index.mjs +20 -23
  72. package/esm/form-grid/index.mjs.map +1 -1
  73. package/esm/form-item/index.mjs +30 -32
  74. package/esm/form-item/index.mjs.map +1 -1
  75. package/esm/form-item/utils.mjs.map +1 -1
  76. package/esm/form-layout/form-layout.mjs +11 -14
  77. package/esm/form-layout/form-layout.mjs.map +1 -1
  78. package/esm/form-layout/utils.mjs +19 -24
  79. package/esm/form-layout/utils.mjs.map +1 -1
  80. package/esm/form-step/index.mjs +22 -24
  81. package/esm/form-step/index.mjs.map +1 -1
  82. package/esm/form-step/utils.mjs.map +1 -1
  83. package/esm/form-tab/form-tab.d.ts +2 -2
  84. package/esm/form-tab/hooks.mjs +1 -1
  85. package/esm/form-tab/hooks.mjs.map +1 -1
  86. package/esm/form-tab/index.d.ts +5 -5
  87. package/esm/form-tab/index.mjs +28 -29
  88. package/esm/form-tab/index.mjs.map +1 -1
  89. package/esm/form-tab/types.d.ts +1 -1
  90. package/esm/form-tab/utils.mjs.map +1 -1
  91. package/esm/index.mjs +58 -58
  92. package/esm/input/index.d.ts +6 -38
  93. package/esm/input/index.mjs +36 -48
  94. package/esm/input/index.mjs.map +1 -1
  95. package/esm/input/input.d.ts +1 -8
  96. package/esm/input-number/index.d.ts +215 -1
  97. package/esm/input-number/index.mjs +8 -17
  98. package/esm/input-number/index.mjs.map +1 -1
  99. package/esm/pagination/components/jumper.mjs.map +1 -1
  100. package/esm/pagination/components/next.mjs.map +1 -1
  101. package/esm/pagination/components/pager.mjs.map +1 -1
  102. package/esm/pagination/components/prev.mjs.map +1 -1
  103. package/esm/pagination/components/total.mjs.map +1 -1
  104. package/esm/pagination/pagination.mjs +1 -1
  105. package/esm/pagination/pagination.mjs.map +1 -1
  106. package/esm/password/index.d.ts +6 -38
  107. package/esm/password/index.mjs +1 -1
  108. package/esm/password/index.mjs.map +1 -1
  109. package/esm/preview-text/cascader.d.ts +1 -1
  110. package/esm/preview-text/date-picker.d.ts +1 -1
  111. package/esm/preview-text/index.d.ts +13 -13
  112. package/esm/preview-text/index.mjs +115 -118
  113. package/esm/preview-text/index.mjs.map +1 -1
  114. package/esm/preview-text/input.d.ts +1 -1
  115. package/esm/preview-text/select.d.ts +1 -1
  116. package/esm/preview-text/time-picker.d.ts +1 -1
  117. package/esm/preview-text/tree.d.ts +1 -1
  118. package/esm/preview-text/utils.mjs.map +1 -1
  119. package/esm/radio/index.d.ts +3 -25
  120. package/esm/radio/index.mjs +34 -44
  121. package/esm/radio/index.mjs.map +1 -1
  122. package/esm/radio/radio-group.d.ts +2 -13
  123. package/esm/reset/index.mjs +1 -1
  124. package/esm/reset/index.mjs.map +1 -1
  125. package/esm/select/index.d.ts +3 -16
  126. package/esm/select/index.mjs +62 -70
  127. package/esm/select/index.mjs.map +1 -1
  128. package/esm/select/select.d.ts +1 -6
  129. package/esm/select-table/index.d.ts +5 -5
  130. package/esm/select-table/index.mjs +78 -81
  131. package/esm/select-table/index.mjs.map +1 -1
  132. package/esm/select-table/select-table.d.ts +2 -2
  133. package/esm/select-table/types.d.ts +1 -1
  134. package/esm/submit/index.mjs +1 -1
  135. package/esm/submit/index.mjs.map +1 -1
  136. package/esm/switch/index.d.ts +260 -1
  137. package/esm/switch/index.mjs +5 -11
  138. package/esm/switch/index.mjs.map +1 -1
  139. package/esm/time-picker/index.d.ts +442 -1
  140. package/esm/time-picker/index.mjs +8 -15
  141. package/esm/time-picker/index.mjs.map +1 -1
  142. package/esm/time-select/index.d.ts +124 -1
  143. package/esm/time-select/index.mjs +10 -17
  144. package/esm/time-select/index.mjs.map +1 -1
  145. package/esm/transfer/index.mjs +5 -5
  146. package/esm/transfer/index.mjs.map +1 -1
  147. package/esm/tree/index.d.ts +5 -5
  148. package/esm/tree/index.mjs +42 -45
  149. package/esm/tree/index.mjs.map +1 -1
  150. package/esm/tree/tree.d.ts +2 -2
  151. package/esm/tree/types.d.ts +1 -1
  152. package/esm/tree/utils.mjs.map +1 -1
  153. package/esm/tree-select/index.d.ts +3 -19
  154. package/esm/tree-select/index.mjs +22 -32
  155. package/esm/tree-select/index.mjs.map +1 -1
  156. package/esm/tree-select/tree-select.d.ts +1 -8
  157. package/esm/upload/index.d.ts +5 -5
  158. package/esm/upload/index.mjs +14 -16
  159. package/esm/upload/index.mjs.map +1 -1
  160. package/esm/upload/upload.d.ts +2 -2
  161. package/esm/vendor/sizes.mjs.map +1 -1
  162. package/package.json +114 -116
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { TabPaneName } from 'element-plus'\nimport { reaction } from '@formily/reactive'\nimport { isEqual, isFn } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@formily/vue'\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\nimport { onUnmounted, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { getArrayItemSchema } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayTabs',\n inheritAttrs: false,\n})\n\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\n\nconst prefixCls = `${stylePrefix}-array-tabs`\nconst activeKey = ref<TabPaneName>('tab-0')\n\nconst field = fieldRef.value\n/* istanbul ignore else -- @preserve */\nif (field.value.length === 0) {\n field.value.push(null)\n}\nconst schema = schemaRef.value\nfunction getTabTitle(index: number) {\n return `${field.title || 'Untitled'} ${index + 1}`\n}\n\nconst errorCountList = ref([])\nconst dispose = reaction(() => {\n return field.value.map((item, index) => {\n const panelErrors = field.form.queryFeedbacks({\n type: 'error',\n address: `${field.address.concat(index)}.**`,\n })\n return panelErrors.length\n })\n}, (newVal) => {\n errorCountList.value = newVal\n}, {\n equals: isEqual,\n})\nonUnmounted(() => {\n dispose()\n})\nconst { props: elTabProps } = useCleanAttrs(['value'])\n</script>\n\n<template>\n <ElTabs\n v-bind=\"elTabProps\"\n :model-value=\"activeKey\"\n :class=\"prefixCls\"\n type=\"card\"\n :addable=\"true\"\n @tab-remove=\"(target) => {\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\n field.remove(Number(index))\n if (activeKey === target) {\n activeKey = `tab-${Number(index) - 1}`\n }\n\n if (isFn($attrs['tab-remove'])) {\n $attrs['tab-remove'](target)\n }\n }\"\n @tab-add=\"() => {\n const id = field.value.length\n field.value.push(null)\n activeKey = `tab-${id}`\n if (isFn($attrs['tab-add'])) {\n $attrs['tab-add']()\n }\n }\"\n @change=\"() => {}\"\n >\n <ElTabPane\n v-for=\"(item, index) of field.value\"\n :key=\"`tab-${index}`\"\n :closable=\"index !== 0\"\n :name=\"`tab-${index}`\"\n >\n <template #default>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n />\n </template>\n <template #label>\n <span v-if=\"errorCountList[index] > 0\">\n <ElBadge\n :class=\"[`${prefixCls}-errors-badge`]\"\n :value=\"errorCountList[index]\"\n >\n {{ getTabTitle(index) }}\n </ElBadge>\n </span>\n <span v-else>\n {{ getTabTitle(index) }}\n </span>\n </template>\n </ElTabPane>\n </ElTabs>\n</template>\n","import FArrayTabs from './array-tabs.vue'\nimport './style.scss'\n\nexport const ArrayTabs = FArrayTabs\n\nexport default ArrayTabs\n"],"names":["fieldRef","useField","schemaRef","useFieldSchema","prefixCls","stylePrefix","activeKey","ref","field","schema","getTabTitle","index","errorCountList","dispose","reaction","item","newVal","isEqual","onUnmounted","elTabProps","useCleanAttrs","_createBlock","_unref","ElTabs","_mergeProps","target","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":";;;;;;;;;;;;;;;AAiBA,UAAMA,IAAWC,EAAA,GACXC,IAAYC,EAAA,GAEZC,IAAY,GAAGC,CAAW,eAC1BC,IAAYC,EAAiB,OAAO,GAEpCC,IAAQR,EAAS;AAAA,IAAA;AAEvB,IAAIQ,EAAM,MAAM,WAAW,KACzBA,EAAM,MAAM,KAAK,IAAI;AAEvB,UA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OAAM,SAAA,CAAA,KAAwBA,EAAAA,OAAM,SAAA,EAAA;AAAA;MAQnK,UAAQ,MAAA;AAAA,MAAA;AAAA,IAAA;iBAGP,MAAoC;AAAA,SADtCG,EAAA,EAAA,GAAAC,EAyBYC,WAxBcV,EAAAd,CAAA,EAAM,OAAK,CAA3BO,GAAMJ,YADhBU,EAyBYC,EAAAW,CAAA,GAAA;AAAA,UAvBT,YAAYtB,CAAK;AAAA,UACjB,UAAUA,MAAK;AAAA,UACf,aAAaA,CAAK;AAAA,QAAA;UAER,WACT,MAGE;AAAA,YAHFuB,EAGEZ,EAAAa,CAAA,GAAA;AAAA,cAFC,QAAQb,EAAAc,CAAA,EAAmBd,EAAAb,CAAA,GAAQE,CAAK;AAAA,cACxC,MAAMA;AAAA,YAAA;;UAGA,SACT,MAOO;AAAA,YAPKC,EAAA,MAAeD,CAAK,IAAA,UAAhCoB,EAOO,QAAAM,GAAA;AAAA,cANLH,EAKUZ,EAAAgB,CAAA,GAAA;AAAA,gBAJP,aAAWlC,CAAS,eAAA,CAAA;AAAA,gBACpB,OAAOQ,EAAA,MAAeD,CAAK;AAAA,cAAA;2BAE5B,MAAwB;AAAA,kBAArB4B,EAAAC,EAAA9B,EAAYC,CAAK,CAAA,GAAA,CAAA;AAAA,gBAAA;;;wBAGxBoB,EAEO,QAAAU,GAAAD,EADF9B,EAAYC,CAAK,CAAA,GAAA,CAAA;AAAA,UAAA;;;;;;;ICpGjB+B,KAAYC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\r\nimport type { ArrayField } from '@formily/core'\r\nimport type { TabPaneName } from 'element-plus'\r\nimport { reaction } from '@formily/reactive'\r\nimport { isEqual, isFn } from '@formily/shared'\r\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\r\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\r\nimport { onUnmounted, ref } from 'vue'\r\nimport { useCleanAttrs } from '../__builtins__'\r\nimport { stylePrefix } from '../__builtins__/configs'\r\nimport { getArrayItemSchema } from '../array-base/utils'\r\n\r\ndefineOptions({\r\n name: 'FArrayTabs',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst fieldRef = useField<ArrayField>()\r\nconst schemaRef = useFieldSchema()\r\n\r\nconst prefixCls = `${stylePrefix}-array-tabs`\r\nconst activeKey = ref<TabPaneName>('tab-0')\r\n\r\nconst field = fieldRef.value\r\n/* istanbul ignore else -- @preserve */\r\nif (field.value.length === 0) {\r\n field.value.push(null)\r\n}\r\nconst schema = schemaRef.value\r\nfunction getTabTitle(index: number) {\r\n return `${field.title || 'Untitled'} ${index + 1}`\r\n}\r\n\r\nconst errorCountList = ref([])\r\nconst dispose = reaction(() => {\r\n return field.value.map((item, index) => {\r\n const panelErrors = field.form.queryFeedbacks({\r\n type: 'error',\r\n address: `${field.address.concat(index)}.**`,\r\n })\r\n return panelErrors.length\r\n })\r\n}, (newVal) => {\r\n errorCountList.value = newVal\r\n}, {\r\n equals: isEqual,\r\n})\r\nonUnmounted(() => {\r\n dispose()\r\n})\r\nconst { props: elTabProps } = useCleanAttrs(['value', 'modelValue', 'onUpdate:modelValue'])\r\n</script>\r\n\r\n<template>\r\n <ElTabs\r\n v-bind=\"elTabProps\"\r\n :model-value=\"activeKey\"\r\n :class=\"prefixCls\"\r\n type=\"card\"\r\n :addable=\"true\"\r\n @tab-remove=\"(target) => {\r\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\r\n field.remove(Number(index))\r\n if (activeKey === target) {\r\n activeKey = `tab-${Number(index) - 1}`\r\n }\r\n\r\n if (isFn($attrs['tab-remove'])) {\r\n $attrs['tab-remove'](target)\r\n }\r\n }\"\r\n @tab-add=\"() => {\r\n const id = field.value.length\r\n field.value.push(null)\r\n activeKey = `tab-${id}`\r\n if (isFn($attrs['tab-add'])) {\r\n $attrs['tab-add']()\r\n }\r\n }\"\r\n @change=\"() => {}\"\r\n >\r\n <ElTabPane\r\n v-for=\"(item, index) of field.value\"\r\n :key=\"`tab-${index}`\"\r\n :closable=\"index !== 0\"\r\n :name=\"`tab-${index}`\"\r\n >\r\n <template #default>\r\n <RecursionField\r\n :schema=\"getArrayItemSchema(schema, index)\"\r\n :name=\"index\"\r\n />\r\n </template>\r\n <template #label>\r\n <span v-if=\"errorCountList[index] > 0\">\r\n <ElBadge\r\n :class=\"[`${prefixCls}-errors-badge`]\"\r\n :value=\"errorCountList[index]\"\r\n >\r\n {{ getTabTitle(index) }}\r\n </ElBadge>\r\n </span>\r\n <span v-else>\r\n {{ getTabTitle(index) }}\r\n </span>\r\n </template>\r\n </ElTabPane>\r\n </ElTabs>\r\n</template>\r\n","import FArrayTabs from './array-tabs.vue'\r\nimport './style.scss'\r\n\r\nexport const ArrayTabs = FArrayTabs\r\n\r\nexport default ArrayTabs\r\n"],"names":["fieldRef","useField","schemaRef","useFieldSchema","prefixCls","stylePrefix","activeKey","ref","field","schema","getTabTitle","index","errorCountList","dispose","reaction","item","newVal","isEqual","onUnmounted","elTabProps","useCleanAttrs","_createBlock","_unref","ElTabs","_mergeProps","target","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":";;;;;;;;;;;;;AAiBA,UAAMA,IAAWC,EAAA,GACXC,IAAYC,EAAA,GAEZC,IAAY,GAAGC,CAAW,eAC1BC,IAAYC,EAAiB,OAAO,GAEpCC,IAAQR,EAAS;AAAA,IAAA;AAEvB,IAAIQ,EAAM,MAAM,WAAW,KACzBA,EAAM,MAAM,KAAK,IAAI;AAEvB,UAAMC,IAASP,EAAU;AACzB,aAASQ,EAAYC,GAAe;AAClC,aAAO,GAAGH,EAAM,SAAS,UAAU,IAAIG,IAAQ,CAAC;AAAA,IAClD;AAEA,UAAMC,IAAiBL,EAAI,EAAE,GACvB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,GAAAC,EAyBYC,WAxBcV,EAAAd,CAAA,EAAM,OAAK,CAA3BO,GAAMJ,YADhBU,EAyBYC,EAAAW,CAAA,GAAA;AAAA,UAvBT,YAAYtB,CAAK;AAAA,UACjB,UAAUA,MAAK;AAAA,UACf,aAAaA,CAAK;AAAA,QAAA;UAER,WACT,MAGE;AAAA,YAHFuB,EAGEZ,EAAAa,CAAA,GAAA;AAAA,cAFC,QAAQb,EAAAc,CAAA,EAAmBd,EAAAb,CAAA,GAAQE,CAAK;AAAA,cACxC,MAAMA;AAAA,YAAA;;UAGA,SACT,MAOO;AAAA,YAPKC,EAAA,MAAeD,CAAK,IAAA,UAAhCoB,EAOO,QAAAM,GAAA;AAAA,cANLH,EAKUZ,EAAAgB,CAAA,GAAA;AAAA,gBAJP,aAAWlC,CAAS,eAAA,CAAA;AAAA,gBACpB,OAAOQ,EAAA,MAAeD,CAAK;AAAA,cAAA;2BAE5B,MAAwB;AAAA,kBAArB4B,EAAAC,EAAA9B,EAAYC,CAAK,CAAA,GAAA,CAAA;AAAA,gBAAA;;;wBAGxBoB,EAEO,QAAAU,GAAAD,EADF9B,EAAYC,CAAK,CAAA,GAAA,CAAA;AAAA,UAAA;;;;;;;ICpGjB+B,IAAYC;"}
@@ -1,6 +1,5 @@
1
1
  import { CascaderOption } from 'element-plus';
2
2
  type __VLS_Props = {
3
- value?: any;
4
3
  options?: CascaderOption[];
5
4
  };
6
5
  declare function __VLS_template(): {
@@ -16,11 +15,7 @@ declare function __VLS_template(): {
16
15
  rootEl: any;
17
16
  };
18
17
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
- change: (value: any) => any;
21
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
- onChange?: (value: any) => any;
23
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
24
19
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
25
20
  export default _default;
26
21
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,12 +1,7 @@
1
1
  export declare const Cascader: {
2
2
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
3
- value?: any;
4
3
  options?: import('element-plus').CascaderOption[];
5
- }> & Readonly<{
6
- onChange?: (value: any) => any;
7
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
- change: (value: any) => any;
9
- }, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
4
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
10
5
  P: {};
11
6
  B: {};
12
7
  D: {};
@@ -14,22 +9,14 @@ export declare const Cascader: {
14
9
  M: {};
15
10
  Defaults: {};
16
11
  }, Readonly<{
17
- value?: any;
18
12
  options?: import('element-plus').CascaderOption[];
19
- }> & Readonly<{
20
- onChange?: (value: any) => any;
21
- }>, {}, {}, {}, {}, {}>;
13
+ }> & Readonly<{}>, {}, {}, {}, {}, {}>;
22
14
  __isFragment?: never;
23
15
  __isTeleport?: never;
24
16
  __isSuspense?: never;
25
17
  } & import('vue').ComponentOptionsBase<Readonly<{
26
- value?: any;
27
18
  options?: import('element-plus').CascaderOption[];
28
- }> & Readonly<{
29
- onChange?: (value: any) => any;
30
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
31
- change: (value: any) => any;
32
- }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
19
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
33
20
  $slots: {
34
21
  default?(_: {
35
22
  node: any;
@@ -1,54 +1,48 @@
1
- import { observer as u } from "@formily/reactive-vue";
2
- import { connect as c, mapProps as f } from "@formily/vue";
3
- import { defineComponent as v, createBlock as C, openBlock as y, unref as a, mergeProps as P, createSlots as k, withCtx as s, renderSlot as m } from "vue";
4
- import { ElCascader as $ } from "element-plus";
5
- import "@formily/reactive";
6
- import { mapReadPretty as g } from "../__builtins__/shared/transform-component.mjs";
7
- import { PreviewText as h } from "../preview-text/index.mjs";
8
- import "@formily/core";
9
- import { useCleanAttrs as S } from "../__builtins__/shared/utils.mjs";
10
- const b = /* @__PURE__ */ v({
1
+ import { observer as i } from "@formily/reactive-vue";
2
+ import { connect as c, mapProps as d } from "@silver-formily/vue";
3
+ import { PreviewText as l } from "../preview-text/index.mjs";
4
+ import { defineComponent as f, createBlock as u, openBlock as C, unref as o, mergeProps as y, createSlots as P, withCtx as r, renderSlot as t } from "vue";
5
+ import { ElCascader as k } from "element-plus";
6
+ import { useCleanAttrs as v } from "../__builtins__/shared/utils.mjs";
7
+ import { mapReadPretty as $ } from "../__builtins__/shared/transform-component.mjs";
8
+ const h = /* @__PURE__ */ f({
11
9
  name: "FCascader",
12
10
  inheritAttrs: !1,
13
11
  __name: "cascader",
14
12
  props: {
15
- value: null,
16
13
  options: null
17
14
  },
18
- emits: ["change"],
19
- setup(n, { emit: p }) {
20
- const t = n, l = p, { props: i } = S();
21
- return (e, r) => (y(), C(a($), P(a(i), {
22
- options: t.options,
23
- "model-value": t.value,
24
- "onUpdate:modelValue": r[0] || (r[0] = (o) => l("change", o))
25
- }), k({ _: 2 }, [
15
+ setup(s) {
16
+ const a = s, { props: p } = v();
17
+ return (e, S) => (C(), u(o(k), y(o(p), {
18
+ options: a.options
19
+ }), P({ _: 2 }, [
26
20
  e.$slots.default ? {
27
21
  name: "default",
28
- fn: s(({ node: o, data: d }) => [
29
- m(e.$slots, "default", {
30
- node: o,
31
- data: d
22
+ fn: r(({ node: n, data: m }) => [
23
+ t(e.$slots, "default", {
24
+ node: n,
25
+ data: m
32
26
  })
33
27
  ]),
34
28
  key: "0"
35
29
  } : void 0,
36
30
  e.$slots.empty ? {
37
31
  name: "empty",
38
- fn: s(() => [
39
- m(e.$slots, "empty")
32
+ fn: r(() => [
33
+ t(e.$slots, "empty")
40
34
  ]),
41
35
  key: "1"
42
36
  } : void 0
43
- ]), 1040, ["options", "model-value"]));
37
+ ]), 1040, ["options"]));
44
38
  }
45
- }), _ = c(
46
- u(b),
47
- f({ dataSource: "options", value: "modelValue", disabled: !0 }),
48
- g(h.Cascader)
39
+ }), F = c(
40
+ i(h),
41
+ d({ dataSource: "options", disabled: !0 }),
42
+ $(l.Cascader)
49
43
  );
50
44
  export {
51
- _ as Cascader,
52
- _ as default
45
+ F as Cascader,
46
+ F as default
53
47
  };
54
48
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CascaderOption } from 'element-plus'\nimport { ElCascader } from 'element-plus'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCascader',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: null,\n options: null\n})\n\nconst emit = defineEmits([\"change\"])\n\nconst { props: cascaderProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCascader\n v-bind=\"cascaderProps\"\n :options=\"props.options\"\n :model-value=\"props.value\"\n @update:model-value=\"value => emit('change', value)\"\n >\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\n <slot :node=\"node\" :data=\"data\" />\n </template>\n <template v-if=\"$slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n </ElCascader>\n</template>\n","import { observer } from '@formily/reactive-vue'\nimport { connect, mapProps } from '@formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCascader from './cascader.vue'\n\nexport const Cascader = connect(\n observer(FCascader),\n mapProps({ dataSource: 'options', value: 'modelValue', disabled: true }),\n mapReadPretty(PreviewText.Cascader),\n)\n\nexport default Cascader\n"],"names":["props","__props","emit","__emit","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","_cache","value","$slots","node","data","_renderSlot","_ctx","Cascader","connect","observer","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAKRC,IAAOC,GAEP,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAYaC,EAAAC,CAAA,GAZbC,EAYaF,EAAAH,CAAA,GAXU;AAAA,MACpB,SAASJ,EAAM;AAAA,MACf,eAAaA,EAAM;AAAA,MACnB,uBAAkBU,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAE,CAAAC,MAAST,YAAeS,CAAK;AAAA,IAAA;MAElCC,EAAAA,OAAO;cAAU;AAAA,cAC/B,CAAkC,EADQ,MAAAC,GAAM,MAAAC,QAAI;AAAA,UACpDC,EAAkCC,EAAA,QAAA,WAAA;AAAA,YAA3B,MAAAH;AAAA,YAAa,MAAAC;AAAA,UAAA;;;;MAENF,EAAAA,OAAO;cAAQ;AAAA,cAC7B,MAAqB;AAAA,UAArBG,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;;;ICzBdC,IAAWC;AAAA,EACtBC,EAASC,CAAS;AAAA,EAClBC,EAAS,EAAE,YAAY,WAAW,OAAO,cAAc,UAAU,IAAM;AAAA,EACvEC,EAAcC,EAAY,QAAQ;AACpC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { CascaderOption } from 'element-plus'\r\nimport { ElCascader } from 'element-plus'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FCascader',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n options: null\n})\r\n\r\nconst { props: cascaderProps } = useCleanAttrs()\r\n</script>\r\n\r\n<template>\r\n <ElCascader\r\n v-bind=\"cascaderProps\"\r\n :options=\"props.options\"\r\n >\r\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\r\n <slot :node=\"node\" :data=\"data\" />\r\n </template>\r\n <template v-if=\"$slots.empty\" #empty>\r\n <slot name=\"empty\" />\r\n </template>\r\n </ElCascader>\r\n</template>\r\n","import { observer } from '@formily/reactive-vue'\r\nimport { connect, mapProps } from '@silver-formily/vue'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FCascader from './cascader.vue'\r\n\r\nexport const Cascader = connect(\r\n observer(FCascader),\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Cascader),\r\n)\r\n\r\nexport default Cascader\r\n"],"names":["props","__props","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","$slots","node","data","_renderSlot","_ctx","Cascader","connect","observer","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAIR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAUaC,EAAAC,CAAA,GAVbC,EAUaF,EAAAH,CAAA,GATU;AAAA,MACpB,SAASF,EAAM;AAAA,IAAA;MAEAQ,EAAAA,OAAO;cAAU;AAAA,cAC/B,CAAkC,EADQ,MAAAC,GAAM,MAAAC,QAAI;AAAA,UACpDC,EAAkCC,EAAA,QAAA,WAAA;AAAA,YAA3B,MAAAH;AAAA,YAAa,MAAAC;AAAA,UAAA;;;;MAENF,EAAAA,OAAO;cAAQ;AAAA,cAC7B,MAAqB;AAAA,UAArBG,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;;;ICpBdC,IAAWC;AAAA,EACtBC,EAASC,CAAS;AAAA,EAClBC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AACpC;"}
@@ -15,10 +15,6 @@ declare function __VLS_template(): {
15
15
  };
16
16
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
17
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
18
- value: {
19
- type: PropType<Array<any>>;
20
- default: () => any[];
21
- };
22
18
  options: {
23
19
  type: PropType<Array<CheckboxProps>>;
24
20
  default: () => any[];
@@ -27,13 +23,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
27
23
  type: PropType<"default" | "button">;
28
24
  default: string;
29
25
  };
30
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
31
- change: (...args: any[]) => void;
32
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
33
- value: {
34
- type: PropType<Array<any>>;
35
- default: () => any[];
36
- };
26
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
37
27
  options: {
38
28
  type: PropType<Array<CheckboxProps>>;
39
29
  default: () => any[];
@@ -42,10 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
42
32
  type: PropType<"default" | "button">;
43
33
  default: string;
44
34
  };
45
- }>> & Readonly<{
46
- onChange?: (...args: any[]) => any;
47
- }>, {
48
- value: any[];
35
+ }>> & Readonly<{}>, {
49
36
  options: CheckboxProps[];
50
37
  optionType: "button" | "default";
51
38
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -694,10 +694,6 @@ export declare const Checkbox: {
694
694
  } & {
695
695
  Group: {
696
696
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
697
- value: {
698
- type: import('vue').PropType<Array<any>>;
699
- default: () => any[];
700
- };
701
697
  options: {
702
698
  type: import('vue').PropType<Array<import('element-plus').CheckboxProps>>;
703
699
  default: () => any[];
@@ -706,12 +702,7 @@ export declare const Checkbox: {
706
702
  type: import('vue').PropType<"default" | "button">;
707
703
  default: string;
708
704
  };
709
- }>> & Readonly<{
710
- onChange?: (...args: any[]) => any;
711
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
712
- change: (...args: any[]) => void;
713
- }, import('vue').PublicProps, {
714
- value: any[];
705
+ }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
715
706
  options: import('element-plus').CheckboxProps[];
716
707
  optionType: "button" | "default";
717
708
  }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
@@ -722,10 +713,6 @@ export declare const Checkbox: {
722
713
  M: {};
723
714
  Defaults: {};
724
715
  }, Readonly<import('vue').ExtractPropTypes<{
725
- value: {
726
- type: import('vue').PropType<Array<any>>;
727
- default: () => any[];
728
- };
729
716
  options: {
730
717
  type: import('vue').PropType<Array<import('element-plus').CheckboxProps>>;
731
718
  default: () => any[];
@@ -734,10 +721,7 @@ export declare const Checkbox: {
734
721
  type: import('vue').PropType<"default" | "button">;
735
722
  default: string;
736
723
  };
737
- }>> & Readonly<{
738
- onChange?: (...args: any[]) => any;
739
- }>, {}, {}, {}, {}, {
740
- value: any[];
724
+ }>> & Readonly<{}>, {}, {}, {}, {}, {
741
725
  options: import('element-plus').CheckboxProps[];
742
726
  optionType: "button" | "default";
743
727
  }>;
@@ -745,10 +729,6 @@ export declare const Checkbox: {
745
729
  __isTeleport?: never;
746
730
  __isSuspense?: never;
747
731
  } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
748
- value: {
749
- type: import('vue').PropType<Array<any>>;
750
- default: () => any[];
751
- };
752
732
  options: {
753
733
  type: import('vue').PropType<Array<import('element-plus').CheckboxProps>>;
754
734
  default: () => any[];
@@ -757,12 +737,7 @@ export declare const Checkbox: {
757
737
  type: import('vue').PropType<"default" | "button">;
758
738
  default: string;
759
739
  };
760
- }>> & Readonly<{
761
- onChange?: (...args: any[]) => any;
762
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
763
- change: (...args: any[]) => void;
764
- }, string, {
765
- value: any[];
740
+ }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
766
741
  options: import('element-plus').CheckboxProps[];
767
742
  optionType: "button" | "default";
768
743
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
@@ -1,23 +1,16 @@
1
- import { connect as v, mapProps as _ } from "@formily/vue";
2
- import { ElCheckboxButton as T, ElCheckbox as h, ElCheckboxGroup as A, version as B } from "element-plus";
3
- import { defineComponent as G, computed as i, useSlots as V, createBlock as n, openBlock as l, unref as a, mergeProps as u, withCtx as p, createElementBlock as f, Fragment as d, renderList as b, resolveDynamicComponent as k, createTextVNode as w, toDisplayString as D, renderSlot as F } from "vue";
4
- import "@formily/reactive";
5
- import { mapReadPretty as I } from "../__builtins__/shared/transform-component.mjs";
6
- import { useCleanAttrs as L, composeExport as N } from "../__builtins__/shared/utils.mjs";
7
- import { PreviewText as O } from "../preview-text/index.mjs";
8
- import { isPlainObj as y } from "@formily/shared";
9
- import { lt as j } from "../__builtins__/shared/simple-version-compare.mjs";
10
- import "@formily/core";
11
- import "@formily/reactive-vue";
12
- const H = /* @__PURE__ */ G({
1
+ import { connect as _, mapProps as y } from "@silver-formily/vue";
2
+ import { ElCheckboxButton as S, ElCheckbox as h, ElCheckboxGroup as g, version as E } from "element-plus";
3
+ import { PreviewText as T } from "../preview-text/index.mjs";
4
+ import { defineComponent as A, computed as c, useSlots as B, createBlock as a, openBlock as o, unref as p, normalizeProps as G, guardReactiveProps as w, withCtx as l, createElementBlock as m, Fragment as i, renderList as f, resolveDynamicComponent as b, mergeProps as d, createTextVNode as D, toDisplayString as F, renderSlot as I } from "vue";
5
+ import { isPlainObj as k } from "@formily/shared";
6
+ import { lt as L } from "../__builtins__/shared/simple-version-compare.mjs";
7
+ import { useCleanAttrs as N, composeExport as O } from "../__builtins__/shared/utils.mjs";
8
+ import { mapReadPretty as R } from "../__builtins__/shared/transform-component.mjs";
9
+ const j = /* @__PURE__ */ A({
13
10
  name: "FCheckboxGroup",
14
11
  inheritAttrs: !1,
15
12
  __name: "checkbox-group",
16
13
  props: {
17
- value: {
18
- type: Array,
19
- default: () => []
20
- },
21
14
  options: {
22
15
  type: Array,
23
16
  default: () => []
@@ -27,57 +20,52 @@ const H = /* @__PURE__ */ G({
27
20
  default: "default"
28
21
  }
29
22
  },
30
- emits: ["change"],
31
- setup(x, { emit: C }) {
32
- const o = x, S = C, s = i(() => o.optionType === "button" ? T : h), g = j(B, "2.6.0"), m = i(() => o.options.map((e) => {
33
- if (!y(e))
23
+ setup(x) {
24
+ const n = x, s = c(() => n.optionType === "button" ? S : h), C = L(E, "2.6.0"), u = c(() => n.options.map((e) => {
25
+ if (!k(e))
34
26
  return {
35
27
  label: e,
36
28
  value: e
37
29
  };
38
30
  /* istanbul ignore if -- @preserve */
39
- return g ? {
31
+ return C ? {
40
32
  ...e,
41
33
  label: e.value
42
34
  } : e;
43
- })), P = V(), { props: E } = L();
44
- return (e, c) => (l(), n(a(A), u(a(E), {
45
- "model-value": o.value,
46
- "onUpdate:modelValue": c[0] || (c[0] = (t) => S("change", t))
47
- }), {
48
- default: p(() => [
49
- a(P).option ? (l(!0), f(d, { key: 1 }, b(m.value, (t, r) => (l(), n(k(s.value), u({ key: r }, { ref_for: !0 }, t), {
50
- default: p(() => [
51
- F(e.$slots, "option", { option: t })
35
+ })), v = B(), { props: P } = N();
36
+ return (e, V) => (o(), a(p(g), G(w(p(P))), {
37
+ default: l(() => [
38
+ p(v).option ? (o(!0), m(i, { key: 1 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
39
+ default: l(() => [
40
+ I(e.$slots, "option", { option: t })
52
41
  ]),
53
42
  _: 2
54
- }, 1040))), 128)) : (l(!0), f(d, { key: 0 }, b(m.value, (t, r) => (l(), n(k(s.value), u({ key: r }, { ref_for: !0 }, t), {
55
- default: p(() => [
56
- w(D(a(y)(o.options[r]) ? o.options[r]?.label : t.label), 1)
43
+ }, 1040))), 128)) : (o(!0), m(i, { key: 0 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
44
+ default: l(() => [
45
+ D(F(p(k)(n.options[r]) ? n.options[r]?.label : t.label), 1)
57
46
  ]),
58
47
  _: 2
59
48
  }, 1040))), 128))
60
49
  ]),
61
50
  _: 3
62
- }, 16, ["model-value"]));
51
+ }, 16));
63
52
  }
64
- }), R = v(
65
- H,
66
- _({ dataSource: "options", disabled: !0 }),
67
- I(O.Select, {
53
+ }), z = _(
54
+ j,
55
+ y({ dataSource: "options", disabled: !0 }),
56
+ R(T.Select, {
68
57
  multiple: !0
69
58
  })
70
- ), U = v(
59
+ ), H = _(
71
60
  h,
72
- _({
73
- value: "modelValue",
61
+ y({
74
62
  disabled: !0
75
63
  })
76
- ), ee = N(U, {
77
- Group: R
64
+ ), X = O(H, {
65
+ Group: z
78
66
  });
79
67
  export {
80
- ee as Checkbox,
81
- ee as default
68
+ X as Checkbox,
69
+ X as default
82
70
  };
83
71
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CheckboxProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCheckboxGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: {\n type: Array as PropType<Array<any>>,\n default: () => [],\n },\n options: {\n type: Array as PropType<Array<CheckboxProps>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst emits = defineEmits(['change'])\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElCheckboxButton : ElCheckbox\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\nconst compatiableProps = computed(() => {\n return props.options.map((option) => {\n if (!isPlainObj(option)) {\n return {\n label: option,\n value: option,\n }\n }\n /* istanbul ignore if -- @preserve */\n if (IS_LESS_THAN_2_6_0) {\n return {\n ...option,\n label: option.value,\n }\n }\n return option\n })\n})\n\nconst slots = useSlots()\nconst { props: checkboxProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCheckboxGroup v-bind=\"checkboxProps\" :model-value=\"props.value\" @update:model-value=\"(value) => emits('change', value)\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ isPlainObj(props.options[index]) ? props.options[index]?.label : option.label }}\n </component>\n </template>\n <template v-else>\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n <slot name=\"option\" :option=\"option\" />\n </component>\n </template>\n </ElCheckboxGroup>\n</template>\n","import { connect, mapProps } from '@formily/vue'\nimport { ElCheckbox } from 'element-plus'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCheckboxGroup from './checkbox-group.vue'\n\nconst CheckboxGroup = connect(\n FCheckboxGroup,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select, {\n multiple: true,\n }),\n)\n\nconst InnerCheckbox = connect(\n ElCheckbox,\n mapProps({\n value: 'modelValue',\n disabled: true,\n }),\n)\n\nexport const Checkbox = composeExport(InnerCheckbox, {\n Group: CheckboxGroup,\n})\n\nexport default Checkbox\n"],"names":["props","__props","emits","__emit","OptionType","computed","ElCheckboxButton","ElCheckbox","IS_LESS_THAN_2_6_0","lt","version","compatiableProps","option","isPlainObj","slots","useSlots","checkboxProps","useCleanAttrs","_createBlock","_unref","ElCheckboxGroup","_mergeProps","_cache","value","_openBlock","_createElementBlock","_Fragment","_renderList","index","_resolveDynamicComponent","_renderSlot","_ctx","_createTextVNode","_toDisplayString","CheckboxGroup","connect","FCheckboxGroup","mapProps","mapReadPretty","PreviewText","InnerCheckbox","Checkbox","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,UAAMA,IAAQC,GAeRC,IAAQC,GACRC,IAAaC,EAAS,MACnBL,EAAM,eAAe,WAAWM,IAAmBC,CAC3D,GACKC,IAAqBC,EAAGC,GAAS,OAAO,GACxCC,IAAmBN,EAAS,MACzBL,EAAM,QAAQ,IAAI,CAACY,MAAW;AACnC,UAAI,CAACC,EAAWD,CAAM;AACpB,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IACK;AAAA,QAC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C,IAAgBL;AAAA,EACpB5B;AAAA,EACA8B,EAAS;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH,GAEaI,KAAWC,EAAcF,GAAe;AAAA,EACnD,OAAON;AACT,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { CheckboxProps } from 'element-plus'\r\nimport type { PropType } from 'vue'\r\nimport { isPlainObj } from '@formily/shared'\r\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\r\nimport { computed, useSlots } from 'vue'\r\nimport { lt, useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FCheckboxGroup',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\r\n options: {\r\n type: Array as PropType<Array<CheckboxProps>>,\r\n default: () => [],\r\n },\r\n optionType: {\r\n type: String as PropType<'default' | 'button'>,\r\n default: 'default',\r\n },\r\n})\r\n\r\nconst OptionType = computed(() => {\r\n return props.optionType === 'button' ? ElCheckboxButton : ElCheckbox\r\n})\r\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\r\nconst compatiableProps = computed(() => {\r\n return props.options.map((option) => {\r\n if (!isPlainObj(option)) {\r\n return {\r\n label: option,\r\n value: option,\r\n }\r\n }\r\n /* istanbul ignore if -- @preserve */\r\n if (IS_LESS_THAN_2_6_0) {\r\n return {\r\n ...option,\r\n label: option.value,\r\n }\r\n }\r\n return option\r\n })\r\n})\r\n\r\nconst slots = useSlots()\r\nconst { props: checkboxProps } = useCleanAttrs()\r\n</script>\r\n\r\n<template>\r\n <ElCheckboxGroup v-bind=\"checkboxProps\">\r\n <template v-if=\"!slots.option\">\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n {{ isPlainObj(props.options[index]) ? props.options[index]?.label : option.label }}\r\n </component>\r\n </template>\r\n <template v-else>\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n <slot name=\"option\" :option=\"option\" />\r\n </component>\r\n </template>\r\n </ElCheckboxGroup>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElCheckbox } from 'element-plus'\r\nimport { composeExport, mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FCheckboxGroup from './checkbox-group.vue'\r\n\r\nconst CheckboxGroup = connect(\r\n FCheckboxGroup,\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Select, {\r\n multiple: true,\r\n }),\r\n)\r\n\r\nconst InnerCheckbox = connect(\r\n ElCheckbox,\r\n mapProps({\r\n disabled: true,\r\n }),\r\n)\r\n\r\nexport const Checkbox = composeExport(InnerCheckbox, {\r\n Group: CheckboxGroup,\r\n})\r\n\r\nexport default Checkbox\r\n"],"names":["props","__props","OptionType","computed","ElCheckboxButton","ElCheckbox","IS_LESS_THAN_2_6_0","lt","version","compatiableProps","option","isPlainObj","slots","useSlots","checkboxProps","useCleanAttrs","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","index","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","_createTextVNode","_toDisplayString","CheckboxGroup","connect","FCheckboxGroup","mapProps","mapReadPretty","PreviewText","InnerCheckbox","Checkbox","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,UAAMA,IAAQC,GAWRC,IAAaC,EAAS,MACnBH,EAAM,eAAe,WAAWI,IAAmBC,CAC3D,GACKC,IAAqBC,EAAGC,GAAS,OAAO,GACxCC,IAAmBN,EAAS,MACzBH,EAAM,QAAQ,IAAI,CAACU,MAAW;AACnC,UAAI,CAACC,EAAWD,CAAM;AACpB,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IAC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