@vipl520/dk-ui 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. package/dist/index.js +13 -26
  2. package/dist/index.min.js +34 -0
  3. package/dist/index.min.js.map +1 -0
  4. package/dist/index.min.mjs +34 -0
  5. package/dist/index.min.mjs.map +1 -0
  6. package/dist/index.mjs +13 -26
  7. package/dist/web-types.json +1 -1
  8. package/es/api/attachment.d.ts +10 -0
  9. package/es/api/common.d.ts +1 -0
  10. package/es/api/index.d.ts +1 -0
  11. package/es/attachment/index.d.ts +29 -0
  12. package/es/attachment/src/attachment.vue.d.ts +28 -0
  13. package/es/attachment/src/file-icon.vue.d.ts +41 -0
  14. package/es/attachment/src/props.d.ts +12 -0
  15. package/es/attachment-dialog/index.d.ts +40 -0
  16. package/es/attachment-dialog/src/attachment-dialog.vue.d.ts +39 -0
  17. package/es/attachment-dialog/src/props.d.ts +16 -0
  18. package/es/audio-input/index.d.ts +55 -0
  19. package/es/audio-input/src/audio-input.vue.d.ts +54 -0
  20. package/es/audio-input/src/props.d.ts +24 -0
  21. package/es/audio-list-input/index.d.ts +55 -0
  22. package/es/audio-list-input/src/audio-list-input.vue.d.ts +54 -0
  23. package/es/audio-list-input/src/props.d.ts +24 -0
  24. package/es/box-size-input/index.d.ts +71 -0
  25. package/es/box-size-input/src/box-size-input.vue.d.ts +70 -0
  26. package/es/box-size-input/src/props.d.ts +32 -0
  27. package/es/color-input/index.d.ts +46 -0
  28. package/es/color-input/src/color-input.vue.d.ts +45 -0
  29. package/es/color-input/src/props.d.ts +23 -0
  30. package/es/dialog/index.d.ts +176 -0
  31. package/es/dialog/src/dialog.vue.d.ts +59 -0
  32. package/es/dialog/src/props.d.ts +24 -0
  33. package/es/file-input/index.d.ts +64 -0
  34. package/es/file-input/src/file-input.vue.d.ts +63 -0
  35. package/es/file-input/src/props.d.ts +28 -0
  36. package/es/file-list-input/index.d.ts +64 -0
  37. package/es/file-list-input/src/file-list-input.vue.d.ts +63 -0
  38. package/es/file-list-input/src/props.d.ts +28 -0
  39. package/es/form/index.d.ts +294 -0
  40. package/es/form/src/config.d.ts +45 -0
  41. package/es/form/src/form.vue.d.ts +116 -0
  42. package/es/form/src/props.d.ts +44 -0
  43. package/es/group/index.d.ts +174 -0
  44. package/es/group/src/group.vue.d.ts +173 -0
  45. package/es/group/src/props.d.ts +76 -0
  46. package/es/group/utils/extend.d.ts +3 -0
  47. package/es/group/utils/utils.d.ts +4 -0
  48. package/es/icon/index.d.ts +189 -0
  49. package/es/icon/src/icon.vue.d.ts +66 -0
  50. package/es/icon/src/props.d.ts +31 -0
  51. package/es/icon-input/index.d.ts +143 -0
  52. package/es/icon-input/src/icon-content.vue.d.ts +44 -0
  53. package/es/icon-input/src/icon-dialog.vue.d.ts +38 -0
  54. package/es/icon-input/src/icon-input.vue.d.ts +62 -0
  55. package/es/icon-input/src/props.d.ts +62 -0
  56. package/es/image-input/index.d.ts +55 -0
  57. package/es/image-input/src/image-input.vue.d.ts +54 -0
  58. package/es/image-input/src/props.d.ts +24 -0
  59. package/es/image-list-input/index.d.ts +55 -0
  60. package/es/image-list-input/src/image-list-input.vue.d.ts +54 -0
  61. package/es/image-list-input/src/props.d.ts +24 -0
  62. package/es/index.d.ts +35 -0
  63. package/es/packages/dk-ui/src/box-size-input/src/box-size-input.vue2.mjs +3 -3
  64. package/es/packages/dk-ui/src/box-size-input/src/box-size-input.vue2.mjs.map +1 -1
  65. package/es/packages/dk-ui/src/form/src/form.vue2.mjs +2 -2
  66. package/es/packages/dk-ui/src/form/src/form.vue2.mjs.map +1 -1
  67. package/es/packages/dk-ui/src/select/index.mjs.map +1 -1
  68. package/es/packages/dk-ui/src/select/src/props.mjs.map +1 -1
  69. package/es/packages/dk-ui/src/style-border-input/src/style-border-input.vue2.mjs +3 -7
  70. package/es/packages/dk-ui/src/style-border-input/src/style-border-input.vue2.mjs.map +1 -1
  71. package/es/packages/dk-ui/src/style-position-input/src/style-position-input.vue2.mjs +1 -4
  72. package/es/packages/dk-ui/src/style-position-input/src/style-position-input.vue2.mjs.map +1 -1
  73. package/es/packages/dk-ui/src/style-shadow-input/src/style-shadow-content.vue2.mjs +2 -6
  74. package/es/packages/dk-ui/src/style-shadow-input/src/style-shadow-content.vue2.mjs.map +1 -1
  75. package/es/packages/dk-ui/src/table/src/components/RecycleDialog.vue2.mjs.map +1 -1
  76. package/es/packages/dk-ui/src/tiny-editor/src/tiny-editor.vue2.mjs +2 -4
  77. package/es/packages/dk-ui/src/tiny-editor/src/tiny-editor.vue2.mjs.map +1 -1
  78. package/es/page-diy/index.d.ts +246 -0
  79. package/es/page-diy/src/components/DragBox.vue.d.ts +14 -0
  80. package/es/page-diy/src/components/DragTool.vue.d.ts +59 -0
  81. package/es/page-diy/src/components/PreviewPhone.vue.d.ts +30 -0
  82. package/es/page-diy/src/config/base/dkPage.d.ts +7 -0
  83. package/es/page-diy/src/config/base/dkSetting.d.ts +35 -0
  84. package/es/page-diy/src/config/base/index.d.ts +3 -0
  85. package/es/page-diy/src/config/rule/common/DkPosterBtn.d.ts +86 -0
  86. package/es/page-diy/src/config/rule/common/DkViewBulletChat.d.ts +108 -0
  87. package/es/page-diy/src/config/rule/common/DkViewCell.d.ts +37 -0
  88. package/es/page-diy/src/config/rule/common/DkViewCommonBtn.d.ts +264 -0
  89. package/es/page-diy/src/config/rule/common/DkViewDialog.d.ts +106 -0
  90. package/es/page-diy/src/config/rule/common/DkViewGridCellList.d.ts +130 -0
  91. package/es/page-diy/src/config/rule/common/DkViewImage.d.ts +120 -0
  92. package/es/page-diy/src/config/rule/common/DkViewMusic.d.ts +85 -0
  93. package/es/page-diy/src/config/rule/common/DkViewNavBar.d.ts +33 -0
  94. package/es/page-diy/src/config/rule/common/DkViewNoticeBar.d.ts +57 -0
  95. package/es/page-diy/src/config/rule/common/DkViewSwipe.d.ts +140 -0
  96. package/es/page-diy/src/config/rule/common/DkViewTabbar.d.ts +101 -0
  97. package/es/page-diy/src/config/rule/common/DkViewTextarea.d.ts +33 -0
  98. package/es/page-diy/src/config/rule/common/DkViewVideo.d.ts +73 -0
  99. package/es/page-diy/src/config/rule/common/index.d.ts +2638 -0
  100. package/es/page-diy/src/config/rule/index.d.ts +3665 -0
  101. package/es/page-diy/src/config/rule/layout/DkViewTitle.d.ts +125 -0
  102. package/es/page-diy/src/config/rule/layout/col.d.ts +36 -0
  103. package/es/page-diy/src/config/rule/layout/divider.d.ts +39 -0
  104. package/es/page-diy/src/config/rule/layout/index.d.ts +1023 -0
  105. package/es/page-diy/src/config/rule/layout/row.d.ts +47 -0
  106. package/es/page-diy/src/config/rule/layout/space.d.ts +32 -0
  107. package/es/page-diy/src/config/rule/layout/swip-item.d.ts +27 -0
  108. package/es/page-diy/src/config/rule/layout/swipe.d.ts +62 -0
  109. package/es/page-diy/src/config/rule/layout/tab.d.ts +30 -0
  110. package/es/page-diy/src/config/rule/layout/tabs.d.ts +119 -0
  111. package/es/page-diy/src/config/rule/layout/vanEmpty.d.ts +66 -0
  112. package/es/page-diy/src/page-diy.vue.d.ts +245 -0
  113. package/es/page-diy/src/props.d.ts +11 -0
  114. package/es/page-diy/src/utils/form.d.ts +4 -0
  115. package/es/page-diy/src/utils/help.d.ts +2 -0
  116. package/es/page-diy/src/utils/index.d.ts +3 -0
  117. package/es/page-diy/src/utils/unique.d.ts +1 -0
  118. package/es/page-diy/src/views/DkViewBulletChat.vue.d.ts +59 -0
  119. package/es/page-diy/src/views/DkViewCell.vue.d.ts +14 -0
  120. package/es/page-diy/src/views/DkViewCommonBtn.vue.d.ts +220 -0
  121. package/es/page-diy/src/views/DkViewDialog.vue.d.ts +81 -0
  122. package/es/page-diy/src/views/DkViewGridCellList.vue.d.ts +133 -0
  123. package/es/page-diy/src/views/DkViewImage.vue.d.ts +120 -0
  124. package/es/page-diy/src/views/DkViewMusic.vue.d.ts +68 -0
  125. package/es/page-diy/src/views/DkViewNavBar.vue.d.ts +68 -0
  126. package/es/page-diy/src/views/DkViewNoticeBar.vue.d.ts +59 -0
  127. package/es/page-diy/src/views/DkViewSwipe.vue.d.ts +59 -0
  128. package/es/page-diy/src/views/DkViewTabbar.vue.d.ts +52 -0
  129. package/es/page-diy/src/views/DkViewTextarea.vue.d.ts +14 -0
  130. package/es/page-diy/src/views/DkViewTitle.vue.d.ts +167 -0
  131. package/es/page-diy/src/views/DkViewVideo.vue.d.ts +54 -0
  132. package/es/page-diy/src/views/index.d.ts +2 -0
  133. package/es/poster-input/index.d.ts +142 -0
  134. package/es/poster-input/src/component/config.d.ts +97 -0
  135. package/es/poster-input/src/component/poster-content.vue.d.ts +46 -0
  136. package/es/poster-input/src/component/poster.vue.d.ts +31 -0
  137. package/es/poster-input/src/component/views/DkPosterViewAvatar.vue.d.ts +23 -0
  138. package/es/poster-input/src/component/views/DkPosterViewImage.vue.d.ts +23 -0
  139. package/es/poster-input/src/component/views/DkPosterViewName.vue.d.ts +23 -0
  140. package/es/poster-input/src/component/views/DkPosterViewQrcode.vue.d.ts +23 -0
  141. package/es/poster-input/src/component/views/DkPosterViewText.vue.d.ts +23 -0
  142. package/es/poster-input/src/component/views/quick-action.vue.d.ts +14 -0
  143. package/es/poster-input/src/poster-input.vue.d.ts +112 -0
  144. package/es/poster-input/src/props.d.ts +54 -0
  145. package/es/resolver.d.ts +15 -0
  146. package/es/select/index.d.ts +3 -0
  147. package/es/select/src/props.d.ts +3 -0
  148. package/es/select/src/select.vue.d.ts +17 -0
  149. package/es/style-background-input/index.d.ts +23 -0
  150. package/es/style-background-input/src/props.d.ts +11 -0
  151. package/es/style-background-input/src/style-background-input.vue.d.ts +22 -0
  152. package/es/style-border-input/index.d.ts +17 -0
  153. package/es/style-border-input/src/props.d.ts +8 -0
  154. package/es/style-border-input/src/style-border-input.vue.d.ts +16 -0
  155. package/es/style-box-input/index.d.ts +35 -0
  156. package/es/style-box-input/src/html.d.ts +33 -0
  157. package/es/style-box-input/src/props.d.ts +16 -0
  158. package/es/style-box-input/src/style-box-input.vue.d.ts +34 -0
  159. package/es/style-font-input/index.d.ts +17 -0
  160. package/es/style-font-input/src/props.d.ts +8 -0
  161. package/es/style-font-input/src/style-font-input.vue.d.ts +16 -0
  162. package/es/style-input/index.d.ts +26 -0
  163. package/es/style-input/src/default.d.ts +9 -0
  164. package/es/style-input/src/props.d.ts +16 -0
  165. package/es/style-input/src/style-input.vue.d.ts +25 -0
  166. package/es/style-number-input/index.d.ts +62 -0
  167. package/es/style-number-input/src/props.d.ts +28 -0
  168. package/es/style-number-input/src/style-number-input.vue.d.ts +61 -0
  169. package/es/style-position-input/index.d.ts +17 -0
  170. package/es/style-position-input/src/props.d.ts +8 -0
  171. package/es/style-position-input/src/style-position-input.vue.d.ts +16 -0
  172. package/es/style-shadow-input/index.d.ts +83 -0
  173. package/es/style-shadow-input/src/props.d.ts +12 -0
  174. package/es/style-shadow-input/src/style-shadow-content.vue.d.ts +58 -0
  175. package/es/style-shadow-input/src/style-shadow-input.vue.d.ts +25 -0
  176. package/es/table/index.d.ts +127 -0
  177. package/es/table/src/components/ComSearch.vue.d.ts +7 -0
  178. package/es/table/src/components/FieldRender.vue.d.ts +37 -0
  179. package/es/table/src/components/RecycleDialog.vue.d.ts +2 -0
  180. package/es/table/src/components/header.vue.d.ts +40 -0
  181. package/es/table/src/props.d.ts +8 -0
  182. package/es/table/src/table.vue.d.ts +27 -0
  183. package/es/table/utils/dkTable.d.ts +85 -0
  184. package/es/table/utils/dkTableApi.d.ts +59 -0
  185. package/es/test/index.d.ts +24 -0
  186. package/es/test/src/props.d.ts +15 -0
  187. package/es/test/src/test.vue.d.ts +23 -0
  188. package/es/tiny-editor/index.d.ts +64 -0
  189. package/es/tiny-editor/src/config.d.ts +19 -0
  190. package/es/tiny-editor/src/props.d.ts +31 -0
  191. package/es/tiny-editor/src/tiny-editor.vue.d.ts +63 -0
  192. package/es/video-input/index.d.ts +55 -0
  193. package/es/video-input/src/props.d.ts +24 -0
  194. package/es/video-input/src/video-input.vue.d.ts +54 -0
  195. package/es/video-list-input/index.d.ts +55 -0
  196. package/es/video-list-input/src/props.d.ts +24 -0
  197. package/es/video-list-input/src/video-list-input.vue.d.ts +54 -0
  198. package/lib/api/attachment.d.ts +10 -0
  199. package/lib/api/common.d.ts +1 -0
  200. package/lib/api/index.d.ts +1 -0
  201. package/lib/attachment/index.d.ts +29 -0
  202. package/lib/attachment/src/attachment.vue.d.ts +28 -0
  203. package/lib/attachment/src/file-icon.vue.d.ts +41 -0
  204. package/lib/attachment/src/props.d.ts +12 -0
  205. package/lib/attachment-dialog/index.d.ts +40 -0
  206. package/lib/attachment-dialog/src/attachment-dialog.vue.d.ts +39 -0
  207. package/lib/attachment-dialog/src/props.d.ts +16 -0
  208. package/lib/audio-input/index.d.ts +55 -0
  209. package/lib/audio-input/src/audio-input.vue.d.ts +54 -0
  210. package/lib/audio-input/src/props.d.ts +24 -0
  211. package/lib/audio-list-input/index.d.ts +55 -0
  212. package/lib/audio-list-input/src/audio-list-input.vue.d.ts +54 -0
  213. package/lib/audio-list-input/src/props.d.ts +24 -0
  214. package/lib/box-size-input/index.d.ts +71 -0
  215. package/lib/box-size-input/src/box-size-input.vue.d.ts +70 -0
  216. package/lib/box-size-input/src/props.d.ts +32 -0
  217. package/lib/color-input/index.d.ts +46 -0
  218. package/lib/color-input/src/color-input.vue.d.ts +45 -0
  219. package/lib/color-input/src/props.d.ts +23 -0
  220. package/lib/dialog/index.d.ts +176 -0
  221. package/lib/dialog/src/dialog.vue.d.ts +59 -0
  222. package/lib/dialog/src/props.d.ts +24 -0
  223. package/lib/file-input/index.d.ts +64 -0
  224. package/lib/file-input/src/file-input.vue.d.ts +63 -0
  225. package/lib/file-input/src/props.d.ts +28 -0
  226. package/lib/file-list-input/index.d.ts +64 -0
  227. package/lib/file-list-input/src/file-list-input.vue.d.ts +63 -0
  228. package/lib/file-list-input/src/props.d.ts +28 -0
  229. package/lib/form/index.d.ts +294 -0
  230. package/lib/form/src/config.d.ts +45 -0
  231. package/lib/form/src/form.vue.d.ts +116 -0
  232. package/lib/form/src/props.d.ts +44 -0
  233. package/lib/group/index.d.ts +174 -0
  234. package/lib/group/src/group.vue.d.ts +173 -0
  235. package/lib/group/src/props.d.ts +76 -0
  236. package/lib/group/utils/extend.d.ts +3 -0
  237. package/lib/group/utils/utils.d.ts +4 -0
  238. package/lib/icon/index.d.ts +189 -0
  239. package/lib/icon/src/icon.vue.d.ts +66 -0
  240. package/lib/icon/src/props.d.ts +31 -0
  241. package/lib/icon-input/index.d.ts +143 -0
  242. package/lib/icon-input/src/icon-content.vue.d.ts +44 -0
  243. package/lib/icon-input/src/icon-dialog.vue.d.ts +38 -0
  244. package/lib/icon-input/src/icon-input.vue.d.ts +62 -0
  245. package/lib/icon-input/src/props.d.ts +62 -0
  246. package/lib/image-input/index.d.ts +55 -0
  247. package/lib/image-input/src/image-input.vue.d.ts +54 -0
  248. package/lib/image-input/src/props.d.ts +24 -0
  249. package/lib/image-list-input/index.d.ts +55 -0
  250. package/lib/image-list-input/src/image-list-input.vue.d.ts +54 -0
  251. package/lib/image-list-input/src/props.d.ts +24 -0
  252. package/lib/index.d.ts +35 -0
  253. package/lib/packages/dk-ui/src/box-size-input/src/box-size-input.vue2.js +3 -3
  254. package/lib/packages/dk-ui/src/box-size-input/src/box-size-input.vue2.js.map +1 -1
  255. package/lib/packages/dk-ui/src/form/src/form.vue2.js +2 -2
  256. package/lib/packages/dk-ui/src/form/src/form.vue2.js.map +1 -1
  257. package/lib/packages/dk-ui/src/select/index.js.map +1 -1
  258. package/lib/packages/dk-ui/src/select/src/props.js.map +1 -1
  259. package/lib/packages/dk-ui/src/style-border-input/src/style-border-input.vue2.js +3 -7
  260. package/lib/packages/dk-ui/src/style-border-input/src/style-border-input.vue2.js.map +1 -1
  261. package/lib/packages/dk-ui/src/style-position-input/src/style-position-input.vue2.js +1 -4
  262. package/lib/packages/dk-ui/src/style-position-input/src/style-position-input.vue2.js.map +1 -1
  263. package/lib/packages/dk-ui/src/style-shadow-input/src/style-shadow-content.vue2.js +2 -6
  264. package/lib/packages/dk-ui/src/style-shadow-input/src/style-shadow-content.vue2.js.map +1 -1
  265. package/lib/packages/dk-ui/src/table/src/components/RecycleDialog.vue2.js.map +1 -1
  266. package/lib/packages/dk-ui/src/tiny-editor/src/tiny-editor.vue2.js +2 -4
  267. package/lib/packages/dk-ui/src/tiny-editor/src/tiny-editor.vue2.js.map +1 -1
  268. package/lib/page-diy/index.d.ts +246 -0
  269. package/lib/page-diy/src/components/DragBox.vue.d.ts +14 -0
  270. package/lib/page-diy/src/components/DragTool.vue.d.ts +59 -0
  271. package/lib/page-diy/src/components/PreviewPhone.vue.d.ts +30 -0
  272. package/lib/page-diy/src/config/base/dkPage.d.ts +7 -0
  273. package/lib/page-diy/src/config/base/dkSetting.d.ts +35 -0
  274. package/lib/page-diy/src/config/base/index.d.ts +3 -0
  275. package/lib/page-diy/src/config/rule/common/DkPosterBtn.d.ts +86 -0
  276. package/lib/page-diy/src/config/rule/common/DkViewBulletChat.d.ts +108 -0
  277. package/lib/page-diy/src/config/rule/common/DkViewCell.d.ts +37 -0
  278. package/lib/page-diy/src/config/rule/common/DkViewCommonBtn.d.ts +264 -0
  279. package/lib/page-diy/src/config/rule/common/DkViewDialog.d.ts +106 -0
  280. package/lib/page-diy/src/config/rule/common/DkViewGridCellList.d.ts +130 -0
  281. package/lib/page-diy/src/config/rule/common/DkViewImage.d.ts +120 -0
  282. package/lib/page-diy/src/config/rule/common/DkViewMusic.d.ts +85 -0
  283. package/lib/page-diy/src/config/rule/common/DkViewNavBar.d.ts +33 -0
  284. package/lib/page-diy/src/config/rule/common/DkViewNoticeBar.d.ts +57 -0
  285. package/lib/page-diy/src/config/rule/common/DkViewSwipe.d.ts +140 -0
  286. package/lib/page-diy/src/config/rule/common/DkViewTabbar.d.ts +101 -0
  287. package/lib/page-diy/src/config/rule/common/DkViewTextarea.d.ts +33 -0
  288. package/lib/page-diy/src/config/rule/common/DkViewVideo.d.ts +73 -0
  289. package/lib/page-diy/src/config/rule/common/index.d.ts +2638 -0
  290. package/lib/page-diy/src/config/rule/index.d.ts +3665 -0
  291. package/lib/page-diy/src/config/rule/layout/DkViewTitle.d.ts +125 -0
  292. package/lib/page-diy/src/config/rule/layout/col.d.ts +36 -0
  293. package/lib/page-diy/src/config/rule/layout/divider.d.ts +39 -0
  294. package/lib/page-diy/src/config/rule/layout/index.d.ts +1023 -0
  295. package/lib/page-diy/src/config/rule/layout/row.d.ts +47 -0
  296. package/lib/page-diy/src/config/rule/layout/space.d.ts +32 -0
  297. package/lib/page-diy/src/config/rule/layout/swip-item.d.ts +27 -0
  298. package/lib/page-diy/src/config/rule/layout/swipe.d.ts +62 -0
  299. package/lib/page-diy/src/config/rule/layout/tab.d.ts +30 -0
  300. package/lib/page-diy/src/config/rule/layout/tabs.d.ts +119 -0
  301. package/lib/page-diy/src/config/rule/layout/vanEmpty.d.ts +66 -0
  302. package/lib/page-diy/src/page-diy.vue.d.ts +245 -0
  303. package/lib/page-diy/src/props.d.ts +11 -0
  304. package/lib/page-diy/src/utils/form.d.ts +4 -0
  305. package/lib/page-diy/src/utils/help.d.ts +2 -0
  306. package/lib/page-diy/src/utils/index.d.ts +3 -0
  307. package/lib/page-diy/src/utils/unique.d.ts +1 -0
  308. package/lib/page-diy/src/views/DkViewBulletChat.vue.d.ts +59 -0
  309. package/lib/page-diy/src/views/DkViewCell.vue.d.ts +14 -0
  310. package/lib/page-diy/src/views/DkViewCommonBtn.vue.d.ts +220 -0
  311. package/lib/page-diy/src/views/DkViewDialog.vue.d.ts +81 -0
  312. package/lib/page-diy/src/views/DkViewGridCellList.vue.d.ts +133 -0
  313. package/lib/page-diy/src/views/DkViewImage.vue.d.ts +120 -0
  314. package/lib/page-diy/src/views/DkViewMusic.vue.d.ts +68 -0
  315. package/lib/page-diy/src/views/DkViewNavBar.vue.d.ts +68 -0
  316. package/lib/page-diy/src/views/DkViewNoticeBar.vue.d.ts +59 -0
  317. package/lib/page-diy/src/views/DkViewSwipe.vue.d.ts +59 -0
  318. package/lib/page-diy/src/views/DkViewTabbar.vue.d.ts +52 -0
  319. package/lib/page-diy/src/views/DkViewTextarea.vue.d.ts +14 -0
  320. package/lib/page-diy/src/views/DkViewTitle.vue.d.ts +167 -0
  321. package/lib/page-diy/src/views/DkViewVideo.vue.d.ts +54 -0
  322. package/lib/page-diy/src/views/index.d.ts +2 -0
  323. package/lib/poster-input/index.d.ts +142 -0
  324. package/lib/poster-input/src/component/config.d.ts +97 -0
  325. package/lib/poster-input/src/component/poster-content.vue.d.ts +46 -0
  326. package/lib/poster-input/src/component/poster.vue.d.ts +31 -0
  327. package/lib/poster-input/src/component/views/DkPosterViewAvatar.vue.d.ts +23 -0
  328. package/lib/poster-input/src/component/views/DkPosterViewImage.vue.d.ts +23 -0
  329. package/lib/poster-input/src/component/views/DkPosterViewName.vue.d.ts +23 -0
  330. package/lib/poster-input/src/component/views/DkPosterViewQrcode.vue.d.ts +23 -0
  331. package/lib/poster-input/src/component/views/DkPosterViewText.vue.d.ts +23 -0
  332. package/lib/poster-input/src/component/views/quick-action.vue.d.ts +14 -0
  333. package/lib/poster-input/src/poster-input.vue.d.ts +112 -0
  334. package/lib/poster-input/src/props.d.ts +54 -0
  335. package/lib/resolver.d.ts +15 -0
  336. package/lib/select/index.d.ts +3 -0
  337. package/lib/select/src/props.d.ts +3 -0
  338. package/lib/select/src/select.vue.d.ts +17 -0
  339. package/lib/style-background-input/index.d.ts +23 -0
  340. package/lib/style-background-input/src/props.d.ts +11 -0
  341. package/lib/style-background-input/src/style-background-input.vue.d.ts +22 -0
  342. package/lib/style-border-input/index.d.ts +17 -0
  343. package/lib/style-border-input/src/props.d.ts +8 -0
  344. package/lib/style-border-input/src/style-border-input.vue.d.ts +16 -0
  345. package/lib/style-box-input/index.d.ts +35 -0
  346. package/lib/style-box-input/src/html.d.ts +33 -0
  347. package/lib/style-box-input/src/props.d.ts +16 -0
  348. package/lib/style-box-input/src/style-box-input.vue.d.ts +34 -0
  349. package/lib/style-font-input/index.d.ts +17 -0
  350. package/lib/style-font-input/src/props.d.ts +8 -0
  351. package/lib/style-font-input/src/style-font-input.vue.d.ts +16 -0
  352. package/lib/style-input/index.d.ts +26 -0
  353. package/lib/style-input/src/default.d.ts +9 -0
  354. package/lib/style-input/src/props.d.ts +16 -0
  355. package/lib/style-input/src/style-input.vue.d.ts +25 -0
  356. package/lib/style-number-input/index.d.ts +62 -0
  357. package/lib/style-number-input/src/props.d.ts +28 -0
  358. package/lib/style-number-input/src/style-number-input.vue.d.ts +61 -0
  359. package/lib/style-position-input/index.d.ts +17 -0
  360. package/lib/style-position-input/src/props.d.ts +8 -0
  361. package/lib/style-position-input/src/style-position-input.vue.d.ts +16 -0
  362. package/lib/style-shadow-input/index.d.ts +83 -0
  363. package/lib/style-shadow-input/src/props.d.ts +12 -0
  364. package/lib/style-shadow-input/src/style-shadow-content.vue.d.ts +58 -0
  365. package/lib/style-shadow-input/src/style-shadow-input.vue.d.ts +25 -0
  366. package/lib/table/index.d.ts +127 -0
  367. package/lib/table/src/components/ComSearch.vue.d.ts +7 -0
  368. package/lib/table/src/components/FieldRender.vue.d.ts +37 -0
  369. package/lib/table/src/components/RecycleDialog.vue.d.ts +2 -0
  370. package/lib/table/src/components/header.vue.d.ts +40 -0
  371. package/lib/table/src/props.d.ts +8 -0
  372. package/lib/table/src/table.vue.d.ts +27 -0
  373. package/lib/table/utils/dkTable.d.ts +85 -0
  374. package/lib/table/utils/dkTableApi.d.ts +59 -0
  375. package/lib/test/index.d.ts +24 -0
  376. package/lib/test/src/props.d.ts +15 -0
  377. package/lib/test/src/test.vue.d.ts +23 -0
  378. package/lib/tiny-editor/index.d.ts +64 -0
  379. package/lib/tiny-editor/src/config.d.ts +19 -0
  380. package/lib/tiny-editor/src/props.d.ts +31 -0
  381. package/lib/tiny-editor/src/tiny-editor.vue.d.ts +63 -0
  382. package/lib/video-input/index.d.ts +55 -0
  383. package/lib/video-input/src/props.d.ts +24 -0
  384. package/lib/video-input/src/video-input.vue.d.ts +54 -0
  385. package/lib/video-list-input/index.d.ts +55 -0
  386. package/lib/video-list-input/src/props.d.ts +24 -0
  387. package/lib/video-list-input/src/video-list-input.vue.d.ts +54 -0
  388. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ modelValue: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ placeholder: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ showInput: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ imgSize: {
15
+ type: NumberConstructor;
16
+ default: number;
17
+ };
18
+ accept: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "input" | "update:modelValue")[], "change" | "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
+ modelValue: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ placeholder: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ showInput: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ imgSize: {
36
+ type: NumberConstructor;
37
+ default: number;
38
+ };
39
+ accept: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ }>> & {
44
+ onChange?: ((...args: any[]) => any) | undefined;
45
+ onInput?: ((...args: any[]) => any) | undefined;
46
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
47
+ }, {
48
+ accept: string;
49
+ placeholder: string;
50
+ modelValue: string;
51
+ showInput: boolean;
52
+ imgSize: number;
53
+ }, {}>;
54
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ export declare const imageInputProps: {
3
+ modelValue: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ placeholder: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ showInput: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ imgSize: {
16
+ type: NumberConstructor;
17
+ default: number;
18
+ };
19
+ accept: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ };
24
+ export type ImageInputProps = ExtractPropTypes<typeof imageInputProps>;
@@ -0,0 +1,55 @@
1
+ export declare const ImageListInput: import("@vipl520/utils").WithInstall<import("vue").DefineComponent<{
2
+ modelValue: {
3
+ default: () => never[];
4
+ type: ArrayConstructor;
5
+ };
6
+ disabled: {
7
+ default: boolean;
8
+ type: BooleanConstructor;
9
+ };
10
+ limit: {
11
+ default: number;
12
+ type: NumberConstructor;
13
+ };
14
+ imgSize: {
15
+ default: number;
16
+ type: NumberConstructor;
17
+ };
18
+ accept: {
19
+ default: string;
20
+ type: StringConstructor;
21
+ };
22
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "input" | "update:modelValue")[], "change" | "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
+ modelValue: {
24
+ default: () => never[];
25
+ type: ArrayConstructor;
26
+ };
27
+ disabled: {
28
+ default: boolean;
29
+ type: BooleanConstructor;
30
+ };
31
+ limit: {
32
+ default: number;
33
+ type: NumberConstructor;
34
+ };
35
+ imgSize: {
36
+ default: number;
37
+ type: NumberConstructor;
38
+ };
39
+ accept: {
40
+ default: string;
41
+ type: StringConstructor;
42
+ };
43
+ }>> & {
44
+ onChange?: ((...args: any[]) => any) | undefined;
45
+ onInput?: ((...args: any[]) => any) | undefined;
46
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
47
+ }, {
48
+ accept: string;
49
+ modelValue: unknown[];
50
+ disabled: boolean;
51
+ imgSize: number;
52
+ limit: number;
53
+ }, {}>>;
54
+ export default ImageListInput;
55
+ export * from './src/props';
@@ -0,0 +1,54 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ modelValue: {
3
+ default: () => never[];
4
+ type: ArrayConstructor;
5
+ };
6
+ disabled: {
7
+ default: boolean;
8
+ type: BooleanConstructor;
9
+ };
10
+ limit: {
11
+ default: number;
12
+ type: NumberConstructor;
13
+ };
14
+ imgSize: {
15
+ default: number;
16
+ type: NumberConstructor;
17
+ };
18
+ accept: {
19
+ default: string;
20
+ type: StringConstructor;
21
+ };
22
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "input" | "update:modelValue")[], "change" | "input" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
+ modelValue: {
24
+ default: () => never[];
25
+ type: ArrayConstructor;
26
+ };
27
+ disabled: {
28
+ default: boolean;
29
+ type: BooleanConstructor;
30
+ };
31
+ limit: {
32
+ default: number;
33
+ type: NumberConstructor;
34
+ };
35
+ imgSize: {
36
+ default: number;
37
+ type: NumberConstructor;
38
+ };
39
+ accept: {
40
+ default: string;
41
+ type: StringConstructor;
42
+ };
43
+ }>> & {
44
+ onChange?: ((...args: any[]) => any) | undefined;
45
+ onInput?: ((...args: any[]) => any) | undefined;
46
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
47
+ }, {
48
+ accept: string;
49
+ modelValue: unknown[];
50
+ disabled: boolean;
51
+ imgSize: number;
52
+ limit: number;
53
+ }, {}>;
54
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ export declare const imageListInputProps: {
3
+ modelValue: {
4
+ default: () => never[];
5
+ type: ArrayConstructor;
6
+ };
7
+ disabled: {
8
+ default: boolean;
9
+ type: BooleanConstructor;
10
+ };
11
+ limit: {
12
+ default: number;
13
+ type: NumberConstructor;
14
+ };
15
+ imgSize: {
16
+ default: number;
17
+ type: NumberConstructor;
18
+ };
19
+ accept: {
20
+ default: string;
21
+ type: StringConstructor;
22
+ };
23
+ };
24
+ export type ImageListInputProps = ExtractPropTypes<typeof imageListInputProps>;
package/lib/index.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ import type { App } from 'vue';
2
+ export * from './tiny-editor';
3
+ export * from './icon';
4
+ export * from './group';
5
+ export * from './color-input';
6
+ export * from './form';
7
+ export * from './attachment';
8
+ export * from './attachment-dialog';
9
+ export * from './file-input';
10
+ export * from './image-input';
11
+ export * from './audio-input';
12
+ export * from './video-input';
13
+ export * from './file-list-input';
14
+ export * from './image-list-input';
15
+ export * from './audio-list-input';
16
+ export * from './video-list-input';
17
+ export * from './icon-input';
18
+ export * from './page-diy';
19
+ export * from './box-size-input';
20
+ export * from './test';
21
+ export * from './style-input';
22
+ export * from './style-box-input';
23
+ export * from './style-font-input';
24
+ export * from './style-border-input';
25
+ export * from './style-shadow-input';
26
+ export * from './style-background-input';
27
+ export * from './style-position-input';
28
+ export * from './style-number-input';
29
+ export * from './table';
30
+ export * from './select';
31
+ export declare const install: (app: App, option?: any) => void;
32
+ declare const _default: {
33
+ install: (app: App<any>, option?: any) => void;
34
+ };
35
+ export default _default;
@@ -16,7 +16,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
16
16
  emits: ["update:modelValue"],
17
17
  setup(__props, { emit }) {
18
18
  const props = __props;
19
- const el = vue.ref(null);
19
+ const el = vue.ref();
20
20
  const { width } = core.useElementSize(el);
21
21
  const positions = vue.reactive({
22
22
  all: "",
@@ -198,7 +198,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
198
198
  vue.withDirectives(vue.createElementVNode(
199
199
  "div",
200
200
  {
201
- class: vue.normalizeClass(vue.unref(width) < 500 ? "" : "flex")
201
+ class: vue.normalizeClass(vue.unref(width).value < 500 ? "" : "flex")
202
202
  },
203
203
  [
204
204
  (vue.openBlock(true), vue.createElementBlock(
@@ -223,7 +223,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
223
223
  _: 2
224
224
  /* DYNAMIC */
225
225
  }, [
226
- vue.unref(width) > 600 || vue.unref(width) < 500 ? {
226
+ vue.unref(width).value > 600 || vue.unref(width).value < 500 ? {
227
227
  name: "prefix",
228
228
  fn: vue.withCtx(() => [
229
229
  vue.createElementVNode("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"box-size-input.vue2.js","sources":["../../../../../../src/box-size-input/src/box-size-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkBoxSizeInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-box-size-input\">\n <div v-show=\"!isMerge\" :class=\"width < 500 ? '' : 'flex'\">\n <el-input\n v-for=\"(item, key) in inputList\"\n :key=\"key\"\n v-model=\"positions[item.position]\"\n type=\"number\"\n :controls=\"false\"\n :disabled=\"unit[item.position] == 'auto'\"\n >\n <template v-if=\"width > 600 || width < 500\" #prefix>\n <span\n class=\"w-resize\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown(item.position, $event)\"\n @mouseup=\"handleMouseUp\"\n >\n <el-tooltip\n :hide-after=\"0\"\n class=\"item\"\n effect=\"dark\"\n :content=\"item.name\"\n placement=\"top-start\"\n :disabled=\"disabledTooltip\"\n >\n <dk-icon :icon=\"item.icon\" />\n </el-tooltip>\n </span>\n </template>\n <template #append>\n <el-select-v2 v-model=\"unit[item.position]\" :options=\"options\">\n </el-select-v2>\n </template>\n </el-input>\n </div>\n <div v-show=\"isMerge\">\n <el-input\n v-model=\"positions.all\"\n type=\"number\"\n :controls=\"false\"\n :disabled=\"unit.all === 'auto'\"\n :clearable=\"props.clearable\"\n >\n <template #prefix>\n <span\n class=\"w-resize\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown('all', $event)\"\n @mouseup=\"handleMouseUp\"\n >\n <dk-icon icon=\"Rank\"></dk-icon>\n </span>\n </template>\n <template #append>\n <el-select-v2 v-model=\"unit.all\" :options=\"options\"> </el-select-v2>\n </template>\n </el-input>\n </div>\n <div v-if=\"props.showMerge\" class=\"dk-full\" @click=\"isMerge = !isMerge\">\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :content=\"isMerge ? '独立配置' : '批量配置'\"\n placement=\"top\"\n :hide-after=\"0\"\n >\n <el-button v-if=\"isMerge\">\n <dk-icon\n icon=\"streamline:interface-layout-border-horizontal-border-cell-center-format-formatting\"\n ></dk-icon>\n </el-button>\n <el-button v-else>\n <dk-icon\n icon=\"streamline:interface-layout-border-full-grid-layout-layouts-module\"\n ></dk-icon>\n </el-button>\n </el-tooltip>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { boxSizeInputProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\n\nconst props = defineProps(boxSizeInputProps)\nconst el = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n// First, second, third, fourth\nconst positions: any = reactive({\n all: '',\n // 一般用于padding、margin、border\n first: '',\n second: '',\n third: '',\n fourth: '',\n // 一般用于radius\n})\n\nconst unit: any = reactive({\n all: 'px',\n first: 'rem',\n second: 'px',\n third: 'px',\n fourth: 'px',\n})\n\nconst units = ['px', '%', 'rem', 'rm', 'vh', 'auto']\nconst position = ref('')\nconst isMerge = ref(props.defaultIsMerge)\nconst isDragging = ref(false)\nconst startX = ref(0)\nconst disabledTooltip = ref(false)\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\n\nconst options = computed(() => {\n return units.map((item) => {\n return {\n label: item,\n value: item,\n }\n })\n})\n\nconst inputList = computed(() => {\n let list: any[]\n if (props.type === 'radius') {\n list = [\n {\n position: 'first',\n name: '左上',\n icon: 'ant-design:radius-upleft-outlined',\n },\n {\n position: 'second',\n name: '右上',\n icon: 'ant-design:radius-upright-outlined',\n },\n {\n position: 'fourth',\n name: '左下',\n icon: 'ant-design:radius-bottomleft-outlined',\n },\n {\n position: 'third',\n name: '左下',\n icon: 'ant-design:radius-bottomright-outlined',\n },\n ]\n } else {\n list = [\n { position: 'first', name: '上', icon: 'ArrowUp' },\n { position: 'second', name: '右', icon: 'ArrowRight' },\n { position: 'third', name: '下', icon: 'ArrowDown' },\n { position: 'fourth', name: '左', icon: 'ArrowLeft' },\n ]\n }\n return list\n})\nconst emit = defineEmits(['update:modelValue'])\n\nconst handleMouseDown = (_position: any, event: any) => {\n isDragging.value = true\n startX.value = event.clientX\n position.value = _position\n trackMouseBound.value = handleMouseMove.bind(event)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n document.addEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'ew-resize'\n}\n\nconst handleMouseMove = (event: any) => {\n if (isDragging.value) {\n positions[position.value] = event.clientX - startX.value\n }\n}\n\nconst handleMouseUp = () => {\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'default'\n isDragging.value = false\n position.value = ''\n}\n\nconst initValue = () => {\n const getUnit = (value: string) => {\n let unit = 'px'\n units.forEach((item) => {\n if (value.includes(item)) {\n unit = item\n }\n })\n return unit\n }\n\n const arr = props.modelValue.split(' ') || ['0px']\n let [first, second = first, third = first, fourth = second] = arr\n\n if (arr.length === 4) {\n isMerge.value = false\n } else if (arr.length === 3) {\n isMerge.value = false\n fourth = ''\n } else if (arr.length === 2) {\n isMerge.value = false\n third = first\n fourth = second\n } else {\n isMerge.value = true\n second = third = fourth = first\n }\n\n const positionValues: any = { first, second, third, fourth }\n for (const pos in positionValues) {\n positions[pos] = parseInt(positionValues[pos]) || 0\n unit[pos] = getUnit(positionValues[pos])\n }\n\n if (isMerge.value) {\n positions.all = positions.first\n unit.all = unit.first\n }\n}\n\n// 值的初始化\nwatch(\n () => props.modelValue,\n () => {\n initValue()\n }\n)\n\n// const sizeValue = computed(() => {\n// if (isMerge.value) {\n// if (unit.all === 'auto') {\n// return 'auto'\n// // emit('update:modelValue', 'auto')\n// } else {\n// // emit('update:modelValue', `${positions.all}${unit.all}`)\n// return `${positions.all}${unit.all}`\n// }\n// } else {\n// // 如果有一个值为auto,则为auto\n// let value = ''\n// for (const pos in unit) {\n// if (pos === 'all') continue\n// if (unit[pos] === 'auto') {\n// value += 'auto '\n// } else {\n// value += `${positions[pos]}${unit[pos]} `\n// }\n// }\n// // emit('update:modelValue', value.trim())\n// return value.trim()\n// }\n// })\n\nconst emitValue = () => {\n if (isMerge.value) {\n if (unit.all === 'auto') {\n emit('update:modelValue', 'auto')\n } else {\n emit('update:modelValue', `${positions.all}${unit.all}`)\n }\n } else {\n // 如果有一个值为auto,则为auto\n let value = ''\n for (const pos in unit) {\n if (pos === 'all') continue\n if (unit[pos] === 'auto') {\n value += 'auto '\n } else {\n value += `${positions[pos]}${unit[pos]} `\n }\n }\n emit('update:modelValue', value.trim())\n }\n}\n\nwatch(positions, () => {\n emitValue()\n})\nwatch(isMerge, () => {\n emitValue()\n})\nwatch(unit, () => {\n emitValue()\n})\n\n// watch(sizeValue, () => {\n// console.log('sizeValue', sizeValue)\n// emit('update:modelValue', sizeValue)\n// })\n\nonMounted(() => {\n initValue()\n})\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","reactive","computed","unit","watch","onMounted"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,gBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA2FD,IAAM,MAAA,EAAA,GAAKC,QAAI,IAAI,CAAA,CAAA;AACnB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AAEnC,IAAA,MAAM,YAAiBC,YAAS,CAAA;AAAA,MAC9B,GAAK,EAAA,EAAA;AAAA;AAAA,MAEL,KAAO,EAAA,EAAA;AAAA,MACP,MAAQ,EAAA,EAAA;AAAA,MACR,KAAO,EAAA,EAAA;AAAA,MACP,MAAQ,EAAA,EAAA;AAAA;AAAA,KA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AACd,MAAU,SAAA,EAAA,CAAA;AAAA,KACX,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"box-size-input.vue2.js","sources":["../../../../../../src/box-size-input/src/box-size-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkBoxSizeInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-box-size-input\">\n <div v-show=\"!isMerge\" :class=\"width.value < 500 ? '' : 'flex'\">\n <el-input\n v-for=\"(item, key) in inputList\"\n :key=\"key\"\n v-model=\"positions[item.position]\"\n type=\"number\"\n :controls=\"false\"\n :disabled=\"unit[item.position] == 'auto'\"\n >\n <template v-if=\"width.value > 600 || width.value < 500\" #prefix>\n <span\n class=\"w-resize\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown(item.position, $event)\"\n @mouseup=\"handleMouseUp\"\n >\n <el-tooltip\n :hide-after=\"0\"\n class=\"item\"\n effect=\"dark\"\n :content=\"item.name\"\n placement=\"top-start\"\n :disabled=\"disabledTooltip\"\n >\n <dk-icon :icon=\"item.icon\" />\n </el-tooltip>\n </span>\n </template>\n <template #append>\n <el-select-v2 v-model=\"unit[item.position]\" :options=\"options\"> </el-select-v2>\n </template>\n </el-input>\n </div>\n <div v-show=\"isMerge\">\n <el-input\n v-model=\"positions.all\"\n type=\"number\"\n :controls=\"false\"\n :disabled=\"unit.all === 'auto'\"\n :clearable=\"props.clearable\"\n >\n <template #prefix>\n <span\n class=\"w-resize\"\n @mousemove=\"handleMouseMove\"\n @mousedown=\"handleMouseDown('all', $event)\"\n @mouseup=\"handleMouseUp\"\n >\n <dk-icon icon=\"Rank\"></dk-icon>\n </span>\n </template>\n <template #append>\n <el-select-v2 v-model=\"unit.all\" :options=\"options\"> </el-select-v2>\n </template>\n </el-input>\n </div>\n <div v-if=\"props.showMerge\" class=\"dk-full\" @click=\"isMerge = !isMerge\">\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :content=\"isMerge ? '独立配置' : '批量配置'\"\n placement=\"top\"\n :hide-after=\"0\"\n >\n <el-button v-if=\"isMerge\">\n <dk-icon icon=\"streamline:interface-layout-border-horizontal-border-cell-center-format-formatting\"></dk-icon>\n </el-button>\n <el-button v-else>\n <dk-icon icon=\"streamline:interface-layout-border-full-grid-layout-layouts-module\"></dk-icon>\n </el-button>\n </el-tooltip>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { boxSizeInputProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\n\nconst props = defineProps(boxSizeInputProps)\nconst el: any = ref()\nconst { width } = useElementSize(el) // 当前组件宽度\n// First, second, third, fourth\nconst positions: any = reactive({\n all: '',\n // 一般用于padding、margin、border\n first: '',\n second: '',\n third: '',\n fourth: '',\n // 一般用于radius\n})\n\nconst unit: any = reactive({\n all: 'px',\n first: 'rem',\n second: 'px',\n third: 'px',\n fourth: 'px',\n})\n\nconst units = ['px', '%', 'rem', 'rm', 'vh', 'auto']\nconst position = ref('')\nconst isMerge = ref(props.defaultIsMerge)\nconst isDragging = ref(false)\nconst startX = ref(0)\nconst disabledTooltip = ref(false)\nconst trackMouseBound: any = ref(null)\nconst stopChangeBound: any = ref(null)\n\nconst options = computed(() => {\n return units.map((item) => {\n return {\n label: item,\n value: item,\n }\n })\n})\n\nconst inputList = computed(() => {\n let list: any[]\n if (props.type === 'radius') {\n list = [\n {\n position: 'first',\n name: '左上',\n icon: 'ant-design:radius-upleft-outlined',\n },\n {\n position: 'second',\n name: '右上',\n icon: 'ant-design:radius-upright-outlined',\n },\n {\n position: 'fourth',\n name: '左下',\n icon: 'ant-design:radius-bottomleft-outlined',\n },\n {\n position: 'third',\n name: '左下',\n icon: 'ant-design:radius-bottomright-outlined',\n },\n ]\n } else {\n list = [\n { position: 'first', name: '上', icon: 'ArrowUp' },\n { position: 'second', name: '右', icon: 'ArrowRight' },\n { position: 'third', name: '下', icon: 'ArrowDown' },\n { position: 'fourth', name: '左', icon: 'ArrowLeft' },\n ]\n }\n return list\n})\nconst emit = defineEmits(['update:modelValue'])\n\nconst handleMouseDown = (_position: any, event: any) => {\n isDragging.value = true\n startX.value = event.clientX\n position.value = _position\n trackMouseBound.value = handleMouseMove.bind(event)\n stopChangeBound.value = handleMouseUp.bind(event)\n document.addEventListener('mousemove', trackMouseBound.value)\n document.addEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'ew-resize'\n}\n\nconst handleMouseMove = (event: any) => {\n if (isDragging.value) {\n positions[position.value] = event.clientX - startX.value\n }\n}\n\nconst handleMouseUp = () => {\n document.removeEventListener('mousemove', trackMouseBound.value)\n document.removeEventListener('mouseup', stopChangeBound.value)\n document.body.style.cursor = 'default'\n isDragging.value = false\n position.value = ''\n}\n\nconst initValue = () => {\n const getUnit = (value: string) => {\n let unit = 'px'\n units.forEach((item) => {\n if (value.includes(item)) {\n unit = item\n }\n })\n return unit\n }\n\n const arr = props.modelValue.split(' ') || ['0px']\n let [first, second = first, third = first, fourth = second] = arr\n\n if (arr.length === 4) {\n isMerge.value = false\n } else if (arr.length === 3) {\n isMerge.value = false\n fourth = ''\n } else if (arr.length === 2) {\n isMerge.value = false\n third = first\n fourth = second\n } else {\n isMerge.value = true\n second = third = fourth = first\n }\n\n const positionValues: any = { first, second, third, fourth }\n for (const pos in positionValues) {\n positions[pos] = parseInt(positionValues[pos]) || 0\n unit[pos] = getUnit(positionValues[pos])\n }\n\n if (isMerge.value) {\n positions.all = positions.first\n unit.all = unit.first\n }\n}\n\n// 值的初始化\nwatch(\n () => props.modelValue,\n () => {\n initValue()\n }\n)\n\n// const sizeValue = computed(() => {\n// if (isMerge.value) {\n// if (unit.all === 'auto') {\n// return 'auto'\n// // emit('update:modelValue', 'auto')\n// } else {\n// // emit('update:modelValue', `${positions.all}${unit.all}`)\n// return `${positions.all}${unit.all}`\n// }\n// } else {\n// // 如果有一个值为auto,则为auto\n// let value = ''\n// for (const pos in unit) {\n// if (pos === 'all') continue\n// if (unit[pos] === 'auto') {\n// value += 'auto '\n// } else {\n// value += `${positions[pos]}${unit[pos]} `\n// }\n// }\n// // emit('update:modelValue', value.trim())\n// return value.trim()\n// }\n// })\n\nconst emitValue = () => {\n if (isMerge.value) {\n if (unit.all === 'auto') {\n emit('update:modelValue', 'auto')\n } else {\n emit('update:modelValue', `${positions.all}${unit.all}`)\n }\n } else {\n // 如果有一个值为auto,则为auto\n let value = ''\n for (const pos in unit) {\n if (pos === 'all') continue\n if (unit[pos] === 'auto') {\n value += 'auto '\n } else {\n value += `${positions[pos]}${unit[pos]} `\n }\n }\n emit('update:modelValue', value.trim())\n }\n}\n\nwatch(positions, () => {\n emitValue()\n})\nwatch(isMerge, () => {\n emitValue()\n})\nwatch(unit, () => {\n emitValue()\n})\n\n// watch(sizeValue, () => {\n// console.log('sizeValue', sizeValue)\n// emit('update:modelValue', sizeValue)\n// })\n\nonMounted(() => {\n initValue()\n})\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","reactive","computed","unit","watch","onMounted"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,gBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAsFD,IAAA,MAAM,KAAUC,OAAI,EAAA,CAAA;AACpB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AAEnC,IAAA,MAAM,YAAiBC,YAAS,CAAA;AAAA,MAC9B,GAAK,EAAA,EAAA;AAAA;AAAA,MAEL,KAAO,EAAA,EAAA;AA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AAM,MAAM,MAAM;AAChB,MAAU,SAAA,EAAA,CAAA;AAAA,KACX,CAAA,CAAA;AAOD,IAAAC,aAAA,CAAU,MAAM;AACd,MAAU,SAAA,EAAA,CAAA;AAAA,KACX,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -141,8 +141,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
141
141
  modelValue: showDialog.value,
142
142
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => showDialog.value = $event),
143
143
  title: _formData.value?.title ? _formData.value?.title : "\u8868\u5355",
144
- width: vue.unref(width) < 768 ? "100%" : "800px",
145
- "default-fullscreen": vue.unref(width) < 768,
144
+ width: vue.unref(width).value < 768 ? "100%" : "800px",
145
+ "default-fullscreen": vue.unref(width).value < 768,
146
146
  "min-height": "200px",
147
147
  "append-to-body": ""
148
148
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"form.vue2.js","sources":["../../../../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"width < 768 ? '100%' : '800px'\"\n :default-fullscreen=\"width < 768\"\n min-height=\"200px\"\n append-to-body\n >\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, request, isNumber, isObject, isArray } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { ref, reactive, onMounted, computed, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\nconst minHeight = computed(() => (isNumber(props.minHeight) ? `${props.minHeight}px` : props.minHeight))\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n console.error(res)\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","formCreate","value","isArray","config","reactive","_config","ref","computed","isNumber","useWindowSize","watch","isObject","request","ElMessage","onMounted"],"mappings":";;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAA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,IAAI,GAAG,CAAA,CAAA;AACzB,UAAK,IAAA,CAAA,QAAA,EAAU,MAAM,GAAG,CAAA,CAAA;AACxB,UAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,SACvB,CAAA,CACA,KAAM,CAAA,CAAC,GAAQ,KAAA;AACd,UAAUA,eAAA,CAAA,KAAA,CAAM,IAAI,GAAG,CAAA,CAAA;AACvB,UAAK,IAAA,CAAA,MAAA,EAAQ,MAAM,GAAG,CAAA,CAAA;AACtB,UAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,SACvB,CAAA,CAAA;AAAA,OACE,MAAA;AACL,QAAA,IAAA,CAAK,UAAU,IAAI,CAAA,CAAA;AACnB,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACxB;AACA,MAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB,CAAA;AACA,IAAAC,aAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"form.vue2.js","sources":["../../../../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"width.value < 768 ? '100%' : '800px'\"\n :default-fullscreen=\"width.value < 768\"\n min-height=\"200px\"\n append-to-body\n >\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, request, isNumber, isObject, isArray } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { ref, reactive, onMounted, computed, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\nconst minHeight = computed(() => (isNumber(props.minHeight) ? `${props.minHeight}px` : props.minHeight))\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n console.error(res)\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","formCreate","value","isArray","config","reactive","_config","ref","computed","isNumber","useWindowSize","watch","isObject","request","ElMessage","onMounted"],"mappings":";;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA2DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,MAAM,CAAA,CAAA;AAEvC,IAAAC,sBAAA,CAAW,QAAS,CAAA;AAAA,MAClB,IAAM,EAAA,MAAA;AAAA,MACN,IAAK,CAAA,EAAE,KAAAC,EAAAA,MAAAA,IAAS,IAAM,EAAA;AAEpB,QAAI,IAAA,CAACC,aAAQD,CAAAA,MAAK,CAAG,EAAA;AACnB,UAAAA,MAAAA,GAAQ,CAACA,MAAK,CAAA,CAAA;AAAA,SAChB;AACA,QAAA,IAAA,CAAK,MAAS,GAAA;AAAA,UACZ,IAAM,EAAA,GAAA;AAAA,UACN,QAAUA,EAAAA,MAAAA;AAAA,UACV,KAAO,EAAA,WAAA;AAAA,SACT,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,UAAA,GAAaD,uBAAW,KAAM,EAAA,CAAA;AAIpC,IAAM,MAAAG,QAAA,GAASC,aAASC,cAAO,CAAA,CAAA;AAC/B,IAAA,MAAM,OAAOC,OAAI,EAAA,CAAA;AACjB,IAAM,MAAA,OAAA,GAAUA,QAAI,IAAI,CAAA,CAAA;AACxB,IAAM,MAAA,aAAA,GAAgBA,QAAI,KAAK,CAAA,CAAA;AAC/B,IAAA,MAAM,SAAY,GAAAC,YAAA,CAAS,MAAOC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;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/select/index.ts"],"sourcesContent":["import { withInstall } from '@vipl520/utils'\nimport _Select from './src/select.vue'\n\nexport const Select = withInstall(_Select)\nexport default Select\n\nexport * from './src/props'\n"],"names":["withInstall","_Select"],"mappings":";;;;;;;;AAGa,MAAA,MAAA,GAASA,kBAAYC,cAAO;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/select/index.ts"],"sourcesContent":["import { withInstall } from '@vipl520/utils'\nimport _Select from './src/select.vue'\n\nexport const Select: any = withInstall(_Select)\nexport default Select\n\nexport * from './src/props'\n"],"names":["withInstall","_Select"],"mappings":";;;;;;;;AAGa,MAAA,MAAA,GAAcA,kBAAYC,cAAO;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../../../../src/select/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport { SelectProps } from 'element-plus/es/components/select-v2/src/defaults'\n\nexport const selectProps = {\n // 继承select-v2\n ...SelectProps,\n // 远程地址\n remoteUrl: {\n type: String,\n default: '',\n },\n options: {\n type: Array,\n default: () => {\n return []\n },\n },\n}\n\nexport type SelectProps = ExtractPropTypes<typeof selectProps>\n"],"names":["SelectProps"],"mappings":";;;;AAGO,MAAM,WAAc,GAAA;AAAA;AAAA,EAEzB,GAAGA,oBAAA;AAAA;AAAA,EAEH,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,KAAA;AAAA,IACN,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../../../../src/select/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport { SelectProps } from 'element-plus/es/components/select-v2/src/defaults'\n\nexport const selectProps: any = {\n // 继承select-v2\n ...SelectProps,\n // 远程地址\n remoteUrl: {\n type: String,\n default: '',\n },\n options: {\n type: Array,\n default: () => {\n return []\n },\n },\n}\n\nexport type SelectProps = ExtractPropTypes<typeof selectProps>\n"],"names":["SelectProps"],"mappings":";;;;AAGO,MAAM,WAAmB,GAAA;AAAA;AAAA,EAE9B,GAAGA,oBAAA;AAAA;AAAA,EAEH,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,KAAA;AAAA,IACN,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,GACF;AACF;;;;"}
@@ -189,7 +189,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
189
189
  {
190
190
  ref_key: "el",
191
191
  ref: el,
192
- class: vue.normalizeClass(["dk-style-border-input", vue.unref(width) < 400 ? "mini" : ""])
192
+ class: vue.normalizeClass(["dk-style-border-input", vue.unref(width).value < 400 ? "mini" : ""])
193
193
  },
194
194
  [
195
195
  vue.createElementVNode("div", _hoisted_1, [
@@ -200,13 +200,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
200
200
  return vue.createVNode(_component_dk_icon, {
201
201
  key: item,
202
202
  icon: "gg:border-" + item,
203
- class: vue.normalizeClass(
204
- "border-box-option border-" + item + " " + (position.value == item ? "selected" : "")
205
- ),
203
+ class: vue.normalizeClass("border-box-option border-" + item + " " + (position.value == item ? "selected" : "")),
206
204
  size: 24,
207
- style: vue.normalizeStyle(
208
- "grid-area: border-" + item + " / border-" + item + " / border-" + item + " / border-" + item + ";"
209
- ),
205
+ style: vue.normalizeStyle("grid-area: border-" + item + " / border-" + item + " / border-" + item + " / border-" + item + ";"),
210
206
  onClick: ($event) => position.value = item
211
207
  }, null, 8, ["icon", "class", "style", "onClick"]);
212
208
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"style-border-input.vue2.js","sources":["../../../../../../src/style-border-input/src/style-border-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleBorderInput',\n});\n</script>\n<template>\n <div\n ref=\"el\"\n class=\"dk-style-border-input\"\n :class=\"width < 400 ? 'mini' : ''\"\n >\n <div class=\"border-box\">\n <dk-icon\n v-for=\"item in positions\"\n :key=\"item\"\n :icon=\"'gg:border-' + item\"\n :class=\"\n 'border-box-option border-' +\n item +\n ' ' +\n (position == item ? 'selected' : '')\n \"\n :size=\"24\"\n :style=\"\n 'grid-area: border-' +\n item +\n ' / border-' +\n item +\n ' / border-' +\n item +\n ' / border-' +\n item +\n ';'\n \"\n @click=\"position = item\"\n ></dk-icon>\n </div>\n <div style=\"width: 100%\" class=\"m-l-20px\">\n <!-- 样式、宽度、颜色-->\n <el-form label-width=\"50px\" label-position=\"left\" size=\"small\">\n <el-form-item label=\"尺寸\">\n <template #label>\n <el-tooltip\n effect=\"dark\"\n content=\"点击清除\"\n placement=\"top-start\"\n :disabled=\"!form[position].borderWidth\"\n >\n <span\n class=\"cursor-pointer\"\n :class=\"form[position].borderWidth ? 'color-blue' : ''\"\n @click=\"del('borderWidth')\"\n >尺寸</span\n >\n </el-tooltip>\n </template>\n <el-slider\n v-model=\"form[position].borderWidth\"\n class=\"dk-border-slider\"\n :max=\"50\"\n @change=\"clearOtherBorder()\"\n />\n <el-input\n v-model=\"form[position].borderWidth\"\n class=\"dk-border-input\"\n type=\"number\"\n @change=\"clearOtherBorder()\"\n >\n <template #append>\n <el-select\n v-model=\"form[position].unit\"\n placeholder=\"请选择\"\n class=\"dk-border-select\"\n suffix-icon=\"\"\n @change=\"clearOtherBorder()\"\n >\n <el-option\n v-for=\"item in units\"\n :key=\"item\"\n :label=\"item\"\n :value=\"item\"\n />\n </el-select>\n </template>\n </el-input>\n </el-form-item>\n <el-form-item label=\"样式\">\n <template #label>\n <el-tooltip\n effect=\"dark\"\n content=\"点击清除\"\n placement=\"top-start\"\n :disabled=\"!form[position].borderStyle\"\n >\n <span\n class=\"cursor-pointer\"\n :class=\"form[position].borderStyle ? 'color-blue' : ''\"\n @click=\"del('borderStyle')\"\n >样式</span\n >\n </el-tooltip>\n </template>\n <el-radio-group\n v-model=\"form[position].borderStyle\"\n @change=\"clearOtherBorder()\"\n >\n <el-radio-button label=\"solid\" name=\"type\">\n <dk-icon icon=\"gg:border-style-solid\"></dk-icon>\n </el-radio-button>\n <el-radio-button label=\"dotted\" name=\"type\">\n <dk-icon icon=\"gg:border-style-dotted\"></dk-icon>\n </el-radio-button>\n <el-radio-button label=\"dashed\" name=\"type\">\n <dk-icon icon=\"gg:border-style-dashed\"></dk-icon>\n </el-radio-button>\n <el-radio-button label=\"double\" name=\"type\">\n <dk-icon icon=\"memory:box-light-double-horizontal\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </el-form-item>\n <el-form-item label=\"颜色\">\n <template #label>\n <el-tooltip\n effect=\"dark\"\n content=\"点击清除\"\n placement=\"top-start\"\n :disabled=\"!form[position].borderColor\"\n >\n <span\n class=\"cursor-pointer\"\n :class=\"form[position].borderColor ? 'color-blue' : ''\"\n @click=\"del('borderColor')\"\n >颜色</span\n >\n </el-tooltip>\n </template>\n <el-color-picker v-model=\"form[position].borderColor\" />\n </el-form-item>\n <el-form-item label=\"弧度\">\n <template #label>\n <el-tooltip\n effect=\"dark\"\n content=\"点击清除\"\n placement=\"top-start\"\n :disabled=\"form.radius == '0px'\"\n >\n <span\n class=\"cursor-pointer\"\n :class=\"form.radius !== '0px' ? 'color-blue' : ''\"\n @click=\"del('radius')\"\n >弧度</span\n >\n </el-tooltip>\n </template>\n <dk-box-size-input\n v-model=\"form.radius\"\n type=\"radius\"\n ></dk-box-size-input>\n </el-form-item>\n </el-form>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleBorderInputProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport { upper } from '@vipl520/utils'\nimport { useElementSize, useWindowSize } from '@vueuse/core'\n\n\n\nconst props = defineProps(styleBorderInputProps)\nconst emit = defineEmits(['update:modelValue'])\n\nconst positions = ['top', 'right', 'bottom', 'left', 'all']\nconst units = ['px', '%', 'rem', 'em', 'vw', 'vh']\nconst position = ref('all')\nconst el = ref()\nconst { width } = useElementSize(el) // 当前组件宽度\nconst defaultForm = () => ({\n unit: 'px',\n})\n\nconst form: any = reactive({\n top: defaultForm(),\n right: defaultForm(),\n bottom: defaultForm(),\n left: defaultForm(),\n all: defaultForm(),\n radius: props.modelValue.borderRadius || '0px',\n})\n\nconst styles = computed(() => {\n const style: any = {}\n positions.forEach((item) => {\n if (item === 'all') {\n if (form[item].borderWidth) {\n style.borderWidth = form[item].borderWidth + (form[item].unit || 'px')\n }\n if (form[item].borderStyle) {\n style.borderStyle = form[item].borderStyle\n }\n if (form[item].borderColor) {\n style.borderColor = form[item].borderColor\n }\n } else {\n if (form[item].borderWidth) {\n style['border' + upper(item) + 'Width'] =\n form[item].borderWidth + (form[item].unit || 'px')\n }\n\n if (form[item].borderStyle) {\n style['border' + upper(item) + 'Style'] = form[item].borderStyle\n }\n\n if (form[item].borderColor) {\n style['border' + upper(item) + 'Color'] = form[item].borderColor\n }\n }\n })\n // 把style中的borderWidth、borderStyle、borderColor放到最前面\n if (form.radius !== '0px') {\n style.borderRadius = form.radius\n }\n return style\n})\nwatch(styles, () => {\n emit('update:modelValue', styles.value)\n})\n\nconst init = () => {\n const keys = [\n 'borderWidth',\n 'borderStyle',\n 'borderColor',\n 'borderRightWidth',\n 'borderRightStyle',\n 'borderRightColor',\n 'borderLeftWidth',\n 'borderLeftStyle',\n 'borderLeftColor',\n 'borderTopWidth',\n 'borderTopStyle',\n 'borderTopColor',\n 'borderBottomWidth',\n 'borderBottomStyle',\n 'borderBottomColor',\n 'borderRadius',\n ]\n\n keys.forEach((key) => {\n if (props.modelValue[key]) {\n if (key === 'borderRadius') {\n form.radius = props.modelValue[key]\n } else {\n let [_, position, property] = key.split(/(?=[A-Z])/)\n let _position = position.toLowerCase() // 位置\n const value = props.modelValue[key] // 值\n if (positions.indexOf(_position) === -1) {\n _position = 'all'\n property = position\n }\n if (property === 'Width') {\n const width = parseInt(value) || 0\n const unit = value.replace(width + '', '') || 'px'\n if (units.indexOf(unit) > -1) {\n form[_position].unit = unit\n form[_position].borderWidth = width\n }\n } else {\n form[_position]['border' + property] = value\n }\n }\n } else {\n if (key === 'borderRadius') {\n form.radius = '0px'\n } else {\n // delete form[position.value][key]\n let [_, position, property] = key.split(/(?=[A-Z])/)\n\n let _position = position.toLowerCase() // 位置\n if (positions.indexOf(_position) === -1) {\n _position = 'all'\n property = position\n }\n const value = props.modelValue[key] // 值\n if (property === 'Width') {\n delete form[_position].borderWidth\n delete form[_position].unit\n } else {\n delete form[_position]['border' + property]\n }\n }\n }\n })\n}\n\nconst clearOtherBorder = () => {\n if (position.value === 'all') {\n positions.forEach((item) => {\n if (item !== 'all') {\n form[item] = {\n unit: 'px',\n }\n }\n })\n } else {\n positions.forEach((item) => {\n if (item === 'all') {\n form[item] = {\n unit: 'px',\n }\n }\n })\n }\n}\nconst del = (value: any) => {\n if (value === 'radius') {\n form.radius = '0px'\n } else {\n delete form[position.value][value]\n }\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n },\n {\n deep: true,\n }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","reactive","computed","upper","watch","position","width","onMounted"],"mappings":";;;;;;;;;;;;;;AAEA,MAA6B,cAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-border-input.vue2.js","sources":["../../../../../../src/style-border-input/src/style-border-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleBorderInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-border-input\" :class=\"width.value < 400 ? 'mini' : ''\">\n <div class=\"border-box\">\n <dk-icon\n v-for=\"item in positions\"\n :key=\"item\"\n :icon=\"'gg:border-' + item\"\n :class=\"'border-box-option border-' + item + ' ' + (position == item ? 'selected' : '')\"\n :size=\"24\"\n :style=\"'grid-area: border-' + item + ' / border-' + item + ' / border-' + item + ' / border-' + item + ';'\"\n @click=\"position = item\"\n ></dk-icon>\n </div>\n <div style=\"width: 100%\" class=\"m-l-20px\">\n <!-- 样式、宽度、颜色-->\n <el-form label-width=\"50px\" label-position=\"left\" size=\"small\">\n <el-form-item label=\"尺寸\">\n <template #label>\n <el-tooltip effect=\"dark\" content=\"点击清除\" placement=\"top-start\" :disabled=\"!form[position].borderWidth\">\n <span\n class=\"cursor-pointer\"\n :class=\"form[position].borderWidth ? 'color-blue' : ''\"\n @click=\"del('borderWidth')\"\n >尺寸</span\n >\n </el-tooltip>\n </template>\n <el-slider\n v-model=\"form[position].borderWidth\"\n class=\"dk-border-slider\"\n :max=\"50\"\n @change=\"clearOtherBorder()\"\n />\n <el-input\n v-model=\"form[position].borderWidth\"\n class=\"dk-border-input\"\n type=\"number\"\n @change=\"clearOtherBorder()\"\n >\n <template #append>\n <el-select\n v-model=\"form[position].unit\"\n placeholder=\"请选择\"\n class=\"dk-border-select\"\n suffix-icon=\"\"\n @change=\"clearOtherBorder()\"\n >\n <el-option v-for=\"item in units\" :key=\"item\" :label=\"item\" :value=\"item\" />\n </el-select>\n </template>\n </el-input>\n </el-form-item>\n <el-form-item label=\"样式\">\n <template #label>\n <el-tooltip effect=\"dark\" content=\"点击清除\" placement=\"top-start\" :disabled=\"!form[position].borderStyle\">\n <span\n class=\"cursor-pointer\"\n :class=\"form[position].borderStyle ? 'color-blue' : ''\"\n @click=\"del('borderStyle')\"\n >样式</span\n >\n </el-tooltip>\n </template>\n <el-radio-group v-model=\"form[position].borderStyle\" @change=\"clearOtherBorder()\">\n <el-radio-button label=\"solid\" name=\"type\">\n <dk-icon icon=\"gg:border-style-solid\"></dk-icon>\n </el-radio-button>\n <el-radio-button label=\"dotted\" name=\"type\">\n <dk-icon icon=\"gg:border-style-dotted\"></dk-icon>\n </el-radio-button>\n <el-radio-button label=\"dashed\" name=\"type\">\n <dk-icon icon=\"gg:border-style-dashed\"></dk-icon>\n </el-radio-button>\n <el-radio-button label=\"double\" name=\"type\">\n <dk-icon icon=\"memory:box-light-double-horizontal\"></dk-icon>\n </el-radio-button>\n </el-radio-group>\n </el-form-item>\n <el-form-item label=\"颜色\">\n <template #label>\n <el-tooltip effect=\"dark\" content=\"点击清除\" placement=\"top-start\" :disabled=\"!form[position].borderColor\">\n <span\n class=\"cursor-pointer\"\n :class=\"form[position].borderColor ? 'color-blue' : ''\"\n @click=\"del('borderColor')\"\n >颜色</span\n >\n </el-tooltip>\n </template>\n <el-color-picker v-model=\"form[position].borderColor\" />\n </el-form-item>\n <el-form-item label=\"弧度\">\n <template #label>\n <el-tooltip effect=\"dark\" content=\"点击清除\" placement=\"top-start\" :disabled=\"form.radius == '0px'\">\n <span class=\"cursor-pointer\" :class=\"form.radius !== '0px' ? 'color-blue' : ''\" @click=\"del('radius')\"\n >弧度</span\n >\n </el-tooltip>\n </template>\n <dk-box-size-input v-model=\"form.radius\" type=\"radius\"></dk-box-size-input>\n </el-form-item>\n </el-form>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleBorderInputProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport { upper } from '@vipl520/utils'\nimport { useElementSize, useWindowSize } from '@vueuse/core'\n\n\n\nconst props = defineProps(styleBorderInputProps)\nconst emit = defineEmits(['update:modelValue'])\n\nconst positions = ['top', 'right', 'bottom', 'left', 'all']\nconst units = ['px', '%', 'rem', 'em', 'vw', 'vh']\nconst position = ref('all')\nconst el: any = ref()\nconst { width } = useElementSize(el) // 当前组件宽度\nconst defaultForm = () => ({\n unit: 'px',\n})\n\nconst form: any = reactive({\n top: defaultForm(),\n right: defaultForm(),\n bottom: defaultForm(),\n left: defaultForm(),\n all: defaultForm(),\n radius: props.modelValue.borderRadius || '0px',\n})\n\nconst styles = computed(() => {\n const style: any = {}\n positions.forEach((item) => {\n if (item === 'all') {\n if (form[item].borderWidth) {\n style.borderWidth = form[item].borderWidth + (form[item].unit || 'px')\n }\n if (form[item].borderStyle) {\n style.borderStyle = form[item].borderStyle\n }\n if (form[item].borderColor) {\n style.borderColor = form[item].borderColor\n }\n } else {\n if (form[item].borderWidth) {\n style['border' + upper(item) + 'Width'] = form[item].borderWidth + (form[item].unit || 'px')\n }\n\n if (form[item].borderStyle) {\n style['border' + upper(item) + 'Style'] = form[item].borderStyle\n }\n\n if (form[item].borderColor) {\n style['border' + upper(item) + 'Color'] = form[item].borderColor\n }\n }\n })\n // 把style中的borderWidth、borderStyle、borderColor放到最前面\n if (form.radius !== '0px') {\n style.borderRadius = form.radius\n }\n return style\n})\nwatch(styles, () => {\n emit('update:modelValue', styles.value)\n})\n\nconst init = () => {\n const keys = [\n 'borderWidth',\n 'borderStyle',\n 'borderColor',\n 'borderRightWidth',\n 'borderRightStyle',\n 'borderRightColor',\n 'borderLeftWidth',\n 'borderLeftStyle',\n 'borderLeftColor',\n 'borderTopWidth',\n 'borderTopStyle',\n 'borderTopColor',\n 'borderBottomWidth',\n 'borderBottomStyle',\n 'borderBottomColor',\n 'borderRadius',\n ]\n\n keys.forEach((key) => {\n if (props.modelValue[key]) {\n if (key === 'borderRadius') {\n form.radius = props.modelValue[key]\n } else {\n let [_, position, property] = key.split(/(?=[A-Z])/)\n let _position = position.toLowerCase() // 位置\n const value = props.modelValue[key] // 值\n if (positions.indexOf(_position) === -1) {\n _position = 'all'\n property = position\n }\n if (property === 'Width') {\n const width = parseInt(value) || 0\n const unit = value.replace(width + '', '') || 'px'\n if (units.indexOf(unit) > -1) {\n form[_position].unit = unit\n form[_position].borderWidth = width\n }\n } else {\n form[_position]['border' + property] = value\n }\n }\n } else {\n if (key === 'borderRadius') {\n form.radius = '0px'\n } else {\n // delete form[position.value][key]\n let [_, position, property] = key.split(/(?=[A-Z])/)\n\n let _position = position.toLowerCase() // 位置\n if (positions.indexOf(_position) === -1) {\n _position = 'all'\n property = position\n }\n const value = props.modelValue[key] // 值\n if (property === 'Width') {\n delete form[_position].borderWidth\n delete form[_position].unit\n } else {\n delete form[_position]['border' + property]\n }\n }\n }\n })\n}\n\nconst clearOtherBorder = () => {\n if (position.value === 'all') {\n positions.forEach((item) => {\n if (item !== 'all') {\n form[item] = {\n unit: 'px',\n }\n }\n })\n } else {\n positions.forEach((item) => {\n if (item === 'all') {\n form[item] = {\n unit: 'px',\n }\n }\n })\n }\n}\nconst del = (value: any) => {\n if (value === 'radius') {\n form.radius = '0px'\n } else {\n delete form[position.value][value]\n }\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n },\n {\n deep: true,\n }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","reactive","computed","upper","watch","position","width","onMounted"],"mappings":";;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,oBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAuHD,IAAA,MAAM,YAAY,CAAC,KAAA,EAAO,OAAS,EAAA,QAAA,EAAU,QAAQ,KAAK,CAAA,CAAA;AAC1D,IAAA,MAAM,QA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.defineComponent({
202
202
  }, {
203
203
  default: vue.withCtx(() => [
204
204
  vue.createElementVNode("span", {
205
- style: vue.normalizeStyle([
206
- { "cursor": "pointer" },
207
- form.value[item.value] ? "color:var(--el-color-primary)" : ""
208
- ]),
205
+ style: vue.normalizeStyle([{ "cursor": "pointer" }, form.value[item.value] ? "color:var(--el-color-primary)" : ""]),
209
206
  onClick: ($event) => form.value[item.value] = ""
210
207
  }, vue.toDisplayString(item.label) + "\uFF1A", 13, _hoisted_2)
211
208
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"style-position-input.vue2.js","sources":["../../../../../../src/style-position-input/src/style-position-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStylePositionInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-position-input\">\n <el-form label-width=\"50px\" label-position=\"left\">\n <div>\n <el-form-item label=\"常用\">\n <el-radio-group @change=\"positionChange\">\n <el-radio-button\n v-for=\"(item, key) in positions\"\n :key=\"key\"\n :label=\"item.value\"\n >{{ item.label }}</el-radio-button\n >\n </el-radio-group>\n <!-- <el-select v-model=\"form.position\" placeholder=\"Select\">-->\n <!-- <el-option-->\n <!-- v-for=\"item in positions\"-->\n <!-- :key=\"item.value\"-->\n <!-- :label=\"item.label\"-->\n <!-- :value=\"item.value\"-->\n <!-- />-->\n <!-- </el-select>-->\n </el-form-item>\n </div>\n <div class=\"m-t-10px\">\n <el-row :gutter=\"20\">\n <el-col\n v-for=\"(item, key) in custom\"\n :key=\"key\"\n :span=\"span\"\n class=\"m-b-5px\"\n >\n <el-form-item :label=\"item.label\">\n <template #label>\n <el-tooltip\n class=\"item\"\n effect=\"dark\"\n :content=\"item.tip\"\n placement=\"top\"\n >\n <span\n style=\"cursor: pointer\"\n :style=\"\n form[item.value] ? 'color:var(--el-color-primary)' : ''\n \"\n @click=\"form[item.value] = ''\"\n >\n {{ item.label }}:</span\n >\n </el-tooltip>\n </template>\n <dk-style-number-input\n v-model=\"form[item.value]\"\n ></dk-style-number-input>\n </el-form-item>\n </el-col>\n </el-row>\n </div>\n </el-form>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { stylePositionInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\nconst el = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n\nconst span = computed(() => {\n if (width.value <= 300) {\n return 24\n } else if (width.value < 800) {\n return 12\n } else {\n return 6\n }\n})\n\n\n\nconst props = defineProps(stylePositionInputProps)\n\nconst form: any = ref({\n left: props.modelValue.left || '',\n top: props.modelValue.top || '',\n right: props.modelValue.right || '',\n bottom: props.modelValue.bottom || '',\n})\n\nconst custom = [\n { label: '上', value: 'top', tip: '当前距离顶部距离,点击清除' },\n { label: '右', value: 'right', tip: '当前距离右侧的距离,点击清除' },\n { label: '下', value: 'bottom', tip: '当前距离底部的距离,点击清除' },\n { label: '左', value: 'left', tip: '当前距离左侧的距离,点击清除' },\n]\n\nconst positions = [\n { label: '左上', value: 'left-top' },\n { label: '左下', value: 'left-down' },\n { label: '右上', value: 'right-top' },\n { label: '右下', value: 'right-down' },\n]\nconst emit = defineEmits(['update:modelValue'])\nconst positionChange = (value: string) => {\n switch (value) {\n case 'left-top':\n form.value = {\n left: '1px',\n top: '0px',\n right: '',\n bottom: '',\n }\n break\n case 'left-down':\n form.value = {\n left: '0px',\n top: '',\n right: '',\n bottom: '0px',\n }\n break\n case 'right-top':\n form.value = {\n left: '',\n top: '0px',\n right: '0px',\n bottom: '',\n }\n break\n case 'right-down':\n form.value = {\n left: '',\n top: '',\n right: '0px',\n bottom: '0px',\n }\n break\n }\n emitValue()\n}\nconst emitValue = () => {\n // 只保留form中有的值,并移除position\n const data = Object.keys(form.value).reduce((prev: any, cur) => {\n if (form.value[cur] && cur !== 'position') {\n prev[cur] = form.value[cur]\n }\n return prev\n }, {})\n emit('update:modelValue', data)\n}\nwatch(\n () => form.value,\n () => {\n emitValue()\n },\n { deep: true }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n Object.keys(props.modelValue).reduce((prev: any, cur) => {\n if (cur !== 'position') {\n prev[cur] = props.modelValue[cur]\n }\n return prev\n }, form.value)\n },\n { deep: true }\n)\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","computed","watch"],"mappings":";;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,sBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAoED,IAAM,MAAA,EAAA,GAAKC,QAAI,IAAI,CAAA,CAAA;AACnB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AAEnC,IAAM,MAAA,IAAA,GAAOC,aAAS,MAAM;AAC1B,MAAI,IAAA,KAAA,CAAM,SAAS,GAAK,EAAA;AACtB,QAAO,OAAA,EAAA,CAAA;AAAA,OACT,MAAA,IAAW,KAAM,CAAA,KAAA,GAAQ,GAAK,EAAA;AAC5B,QAAO,OAAA,EAAA,CAAA;AAAA,OACF,MAAA;AACL,QAAO,OAAA,CAAA,CAAA;AAAA,OACT;AAAA,KACD,CAAA,CAAA;AAMD,IAAA,MAAM,OAAYF,OAAI,CAAA;AAAA,MACpB,IAAA,EAAM,KAAM,CAAA,UAAA,CAAW,IAAQ,IAAA,EAAA;AAAA,MAC/B,GAAA,EAAK,KAAM,CAAA,UAAA,CAAW,GAAO,IAAA,EAAA;AAAA,MAC7B,KAAA,EAAO,KAAM,CAAA,UAAA,CAAW,KAAS,IAAA,EAAA;AAAA,MACjC,MAAA,EAAQ,KAAM,CAAA,UAAA,CAAW,MAAU,IAAA,EAAA;AAAA,KACpC,CAAA,CAAA;AAED,IAAA,MAAM,MAAS,GAAA;AAAA,MACb,EAAE,KAAO,EAAA,QAAA,EAAK,KAAO,EAAA,KAAA,EAAO,KAAK,gFAAgB,EAAA;AAA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CAAA;AAAA,WAClC;AACA,UAAO,OAAA,IAAA,CAAA;AAAA,SACT,EAAG,KAAK,KAAK,CAAA,CAAA;AAAA,OACf;AAAA,MACA,EAAE,MAAM,IAAK,EAAA;AAAA,KACf,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style-position-input.vue2.js","sources":["../../../../../../src/style-position-input/src/style-position-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStylePositionInput',\n});\n</script>\n<template>\n <div ref=\"el\" class=\"dk-style-position-input\">\n <el-form label-width=\"50px\" label-position=\"left\">\n <div>\n <el-form-item label=\"常用\">\n <el-radio-group @change=\"positionChange\">\n <el-radio-button v-for=\"(item, key) in positions\" :key=\"key\" :label=\"item.value\">\n {{ item.label }}\n </el-radio-button>\n </el-radio-group>\n <!-- <el-select v-model=\"form.position\" placeholder=\"Select\">-->\n <!-- <el-option-->\n <!-- v-for=\"item in positions\"-->\n <!-- :key=\"item.value\"-->\n <!-- :label=\"item.label\"-->\n <!-- :value=\"item.value\"-->\n <!-- />-->\n <!-- </el-select>-->\n </el-form-item>\n </div>\n <div class=\"m-t-10px\">\n <el-row :gutter=\"20\">\n <el-col v-for=\"(item, key) in custom\" :key=\"key\" :span=\"span\" class=\"m-b-5px\">\n <el-form-item :label=\"item.label\">\n <template #label>\n <el-tooltip class=\"item\" effect=\"dark\" :content=\"item.tip\" placement=\"top\">\n <span\n style=\"cursor: pointer\"\n :style=\"form[item.value] ? 'color:var(--el-color-primary)' : ''\"\n @click=\"form[item.value] = ''\"\n >\n {{ item.label }}:</span\n >\n </el-tooltip>\n </template>\n <dk-style-number-input v-model=\"form[item.value]\"></dk-style-number-input>\n </el-form-item>\n </el-col>\n </el-row>\n </div>\n </el-form>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { stylePositionInputProps } from './props'\nimport { computed, ref, watch } from 'vue'\nimport { useElementSize } from '@vueuse/core'\n\nconst el: any = ref(null)\nconst { width } = useElementSize(el) // 当前组件宽度\n\nconst span = computed(() => {\n if (width.value <= 300) {\n return 24\n } else if (width.value < 800) {\n return 12\n } else {\n return 6\n }\n})\n\n\n\nconst props = defineProps(stylePositionInputProps)\n\nconst form: any = ref({\n left: props.modelValue.left || '',\n top: props.modelValue.top || '',\n right: props.modelValue.right || '',\n bottom: props.modelValue.bottom || '',\n})\n\nconst custom = [\n { label: '上', value: 'top', tip: '当前距离顶部距离,点击清除' },\n { label: '右', value: 'right', tip: '当前距离右侧的距离,点击清除' },\n { label: '下', value: 'bottom', tip: '当前距离底部的距离,点击清除' },\n { label: '左', value: 'left', tip: '当前距离左侧的距离,点击清除' },\n]\n\nconst positions = [\n { label: '左上', value: 'left-top' },\n { label: '左下', value: 'left-down' },\n { label: '右上', value: 'right-top' },\n { label: '右下', value: 'right-down' },\n]\nconst emit = defineEmits(['update:modelValue'])\nconst positionChange = (value: string) => {\n switch (value) {\n case 'left-top':\n form.value = {\n left: '1px',\n top: '0px',\n right: '',\n bottom: '',\n }\n break\n case 'left-down':\n form.value = {\n left: '0px',\n top: '',\n right: '',\n bottom: '0px',\n }\n break\n case 'right-top':\n form.value = {\n left: '',\n top: '0px',\n right: '0px',\n bottom: '',\n }\n break\n case 'right-down':\n form.value = {\n left: '',\n top: '',\n right: '0px',\n bottom: '0px',\n }\n break\n }\n emitValue()\n}\nconst emitValue = () => {\n // 只保留form中有的值,并移除position\n const data = Object.keys(form.value).reduce((prev: any, cur) => {\n if (form.value[cur] && cur !== 'position') {\n prev[cur] = form.value[cur]\n }\n return prev\n }, {})\n emit('update:modelValue', data)\n}\nwatch(\n () => form.value,\n () => {\n emitValue()\n },\n { deep: true }\n)\n\nwatch(\n () => props.modelValue,\n () => {\n Object.keys(props.modelValue).reduce((prev: any, cur) => {\n if (cur !== 'position') {\n prev[cur] = props.modelValue[cur]\n }\n return prev\n }, form.value)\n },\n { deep: true }\n)\n</script>\n"],"names":["__MACROS_defineComponent","ref","useElementSize","computed","watch"],"mappings":";;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,sBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAmDD,IAAM,MAAA,EAAA,GAAUC,QAAI,IAAI,CAAA,CAAA;AACxB,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,mBAAA,CAAe,EAAE,CAAA,CAAA;AAEnC,IAAM,MAAA,IAAA,GAAOC,aAAS,MAAM;AAC1B,MAAI,IAAA,KAAA,CAAM,SAAS,GAAK,EAAA;AACtB,QAAO,OAAA,EAAA,CAAA;AAAA,OACT,MAAA,IAAW,KAAM,CAAA,KAAA,GAAQ,GAAK,EAAA;AAC5B,QAAO,OAAA,EAAA,CAAA;AAAA,OACF,MAAA;AACL,QAAO,OAAA,CAAA,CAAA;AAAA,OACT;AAAA,KACD,CAAA,CAAA;AAMD,IAAA,MAAM,OAAYF,OAAI,CAAA;AAAA,MACpB,IAAA,EAAM,KAAM,CAAA,UAAA,CAAW,IAAQ,IAAA,EAAA;AAAA,MAC/B,GAAA,EAAK,KAAM,CAAA,UAAA,CAAW,GAAO,IAAA,EAAA;AAAA,MAC7B,KAAA,EAAO,KAAM,CAAA,UAAA,CAAW,KAAS,IAAA,EAAA;AAAA,MACjC,MAAA,EAAQ,KAAM,CAAA,UAAA,CAAW,MAAU,IAAA,EAAA;AAAA,KACpC,CAAA,CAAA;AAED,IAAA,MAAM,MAAS,GAAA;AAAA,MACb,EAAE,KAAO,EAAA,QAAA,EAAK,KAAO,EAAA,KAAA,EAAO,KAAK,gFAAgB,EAAA;AAAA,MACjD,EAAE,KAAO,EAAA,QAAA,EAAK,KAAO,EAAA,OA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