@aplus-frontend/ui 6.17.2 → 6.18.0

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 (260) hide show
  1. package/es/src/ap-action/group/index.vue.mjs +3 -3
  2. package/es/src/ap-action/item/index.vue2.mjs +5 -5
  3. package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
  4. package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
  5. package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
  6. package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
  7. package/es/src/ap-button/ap-button.vue.mjs +2 -2
  8. package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
  9. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +4 -4
  10. package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
  11. package/es/src/ap-download/ap-download.vue.mjs +1 -1
  12. package/es/src/ap-drawer/components/ApDrawerClose.vue2.mjs +2 -2
  13. package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
  14. package/es/src/ap-field/date/index.vue.mjs +4 -4
  15. package/es/src/ap-field/date-range/index.vue.mjs +8 -8
  16. package/es/src/ap-field/index.mjs +36 -36
  17. package/es/src/ap-field/number/index.vue.mjs +8 -8
  18. package/es/src/ap-field/radio/index.vue.mjs +1 -1
  19. package/es/src/ap-field/rate/index.vue.mjs +2 -2
  20. package/es/src/ap-field/segmented/index.vue.mjs +1 -1
  21. package/es/src/ap-field/select/index.vue.mjs +2 -2
  22. package/es/src/ap-field/select/use-select-options.d.ts +2 -2
  23. package/es/src/ap-field/slider/index.vue.mjs +4 -4
  24. package/es/src/ap-field/switch/index.vue.mjs +3 -3
  25. package/es/src/ap-field/text/index.vue2.mjs +2 -2
  26. package/es/src/ap-field/text/password.vue.mjs +2 -2
  27. package/es/src/ap-field/text-area/index.vue.mjs +3 -3
  28. package/es/src/ap-field/tree-select/index.vue.mjs +3 -3
  29. package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
  30. package/es/src/ap-form/ap-form.vue.d.ts +1 -2
  31. package/es/src/ap-form/ap-form.vue2.mjs +2 -2
  32. package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  33. package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
  34. package/es/src/ap-form/item/index.vue.mjs +7 -7
  35. package/es/src/ap-form/item-group/index.vue.mjs +1 -1
  36. package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
  37. package/es/src/ap-form/items/date/index.vue.mjs +2 -2
  38. package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
  39. package/es/src/ap-form/items/number/index.vue.mjs +2 -2
  40. package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
  41. package/es/src/ap-form/items/select/index.vue.d.ts +6 -6
  42. package/es/src/ap-form/items/select/index.vue.mjs +2 -2
  43. package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
  44. package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
  45. package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
  46. package/es/src/ap-form/items/text/password.vue.mjs +2 -2
  47. package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
  48. package/es/src/ap-form/items/tree-select/index.vue.mjs +2 -2
  49. package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
  50. package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
  51. package/es/src/ap-form/render/item.vue.mjs +2 -2
  52. package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +10 -10
  53. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +23 -23
  54. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +2 -2
  55. package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
  56. package/es/src/ap-form/search-form/index.vue.mjs +1 -1
  57. package/es/src/ap-form/set/index.vue.mjs +1 -1
  58. package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  59. package/es/src/ap-grid/editable/form-item.vue.mjs +2 -2
  60. package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
  61. package/es/src/ap-grid/editable/index.vue.mjs +2 -2
  62. package/es/src/ap-grid/index.vue.d.ts +2 -4
  63. package/es/src/ap-grid/index.vue.mjs +26 -19
  64. package/es/src/ap-grid/utils/table.d.ts +1 -1
  65. package/es/src/ap-grid/utils/table.mjs +31 -31
  66. package/es/src/ap-list/index.vue.d.ts +2 -4
  67. package/es/src/ap-list/index.vue.mjs +1 -1
  68. package/es/src/ap-modal/utils/confirm.d.ts +1 -1
  69. package/es/src/ap-table/ap-table.vue.d.ts +2 -4
  70. package/es/src/ap-table/ap-table.vue2.mjs +13 -13
  71. package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
  72. package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
  73. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
  74. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
  75. package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
  76. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
  77. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
  78. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
  79. package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
  80. package/es/src/ap-table/constants.d.ts +5 -5
  81. package/es/src/ap-table/constants.mjs +45 -45
  82. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
  83. package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
  84. package/es/src/ap-tag/ap-tag-group.vue.mjs +8 -8
  85. package/es/src/ap-tag/ap-tag.vue.mjs +2 -2
  86. package/es/src/ap-upload/apUpload.vue.mjs +5 -5
  87. package/es/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  88. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
  89. package/es/src/ap-upload/components/Picture.vue.d.ts +2 -7
  90. package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
  91. package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
  92. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
  93. package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
  94. package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +6 -6
  95. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +9 -9
  96. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +1 -1
  97. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  98. package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
  99. package/es/src/business/ap-card/ApCard.vue2.mjs +9 -9
  100. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +3 -19
  101. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +395 -144
  102. package/es/src/business/ap-draggable-grid/constans.d.ts +0 -8
  103. package/es/src/business/ap-draggable-grid/constans.mjs +0 -8
  104. package/es/src/business/ap-draggable-grid/index.d.ts +3 -31
  105. package/es/src/business/ap-draggable-grid/interface.d.ts +2 -0
  106. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  107. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
  108. package/es/src/business/ap-expand-alert/index.d.ts +4 -6
  109. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +7 -7
  110. package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
  111. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
  112. package/es/src/business/ap-keep-alive/keep-alive.mjs +3 -3
  113. package/es/src/business/ap-ladder/components/RenderValue.mjs +2 -2
  114. package/es/src/business/ap-radio-group/ap-radio-group.vue2.mjs +1 -1
  115. package/es/src/business/ap-select-layout/index.d.ts +2 -4
  116. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  117. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
  118. package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
  119. package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
  120. package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
  121. package/es/src/business/ap-table-modal/index.d.ts +17 -5
  122. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
  123. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
  124. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
  125. package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
  126. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
  127. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
  128. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
  129. package/es/src/business/ap-view/ap-view.vue2.mjs +2 -2
  130. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
  131. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +5 -5
  132. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  133. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +6 -6
  134. package/es/src/business/ap-view/icons/line-delete.vue.mjs +2 -2
  135. package/es/src/business/ap-view/icons/line-down.vue.mjs +2 -2
  136. package/es/src/business/ap-view/icons/line-eye.vue.mjs +2 -2
  137. package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
  138. package/es/src/business/batch-input-group/index.vue.mjs +1 -1
  139. package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
  140. package/es/src/check-card/index.vue2.mjs +3 -3
  141. package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
  142. package/es/src/editable-table/form-item.vue.d.ts +2 -4
  143. package/es/src/editable-table/form-item.vue.mjs +2 -2
  144. package/es/src/editable-table/index.vue.d.ts +2 -4
  145. package/es/src/editable-table/index.vue.mjs +2 -2
  146. package/es/src/full-screen/index.vue.mjs +3 -3
  147. package/es/src/hooks/useFullScreen.mjs +5 -5
  148. package/es/src/mask/index.vue.mjs +10 -10
  149. package/es/src/portal/index.vue.mjs +2 -2
  150. package/es/src/scroll-bar/index.vue.mjs +3 -3
  151. package/es/src/scroll-bar/internal.vue.mjs +2 -2
  152. package/es/src/scroll-view/index.vue.d.ts +5 -5
  153. package/es/src/scroll-view/index.vue.mjs +9 -9
  154. package/es/src/splitter/Panel.vue2.mjs +4 -4
  155. package/es/src/splitter/SplitBar.vue2.mjs +7 -7
  156. package/es/src/splitter/Splitter.vue2.mjs +5 -5
  157. package/es/src/tests/wrapper.d.ts +4 -4
  158. package/es/src/text/group.vue.mjs +2 -2
  159. package/es/src/text/index.vue.mjs +5 -5
  160. package/es/src/version.d.ts +1 -1
  161. package/es/src/version.mjs +1 -1
  162. package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
  163. package/es/src/work-order-modal/work-order-modal.vue.d.ts +2 -3
  164. package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
  165. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  166. package/lib/src/ap-field/index.js +1 -1
  167. package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
  168. package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
  169. package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
  170. package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  171. package/lib/src/ap-form/items/select/index.vue.d.ts +6 -6
  172. package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
  173. package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
  174. package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
  175. package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
  176. package/lib/src/ap-grid/index.vue.d.ts +2 -4
  177. package/lib/src/ap-grid/index.vue.js +1 -1
  178. package/lib/src/ap-grid/utils/table.d.ts +1 -1
  179. package/lib/src/ap-grid/utils/table.js +1 -1
  180. package/lib/src/ap-list/index.vue.d.ts +2 -4
  181. package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
  182. package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
  183. package/lib/src/ap-table/constants.d.ts +5 -5
  184. package/lib/src/ap-table/constants.js +1 -1
  185. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
  186. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  187. package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  188. package/lib/src/ap-upload/components/Picture.vue.d.ts +2 -7
  189. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  190. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +3 -19
  191. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  192. package/lib/src/business/ap-draggable-grid/constans.d.ts +0 -8
  193. package/lib/src/business/ap-draggable-grid/constans.js +1 -1
  194. package/lib/src/business/ap-draggable-grid/index.d.ts +3 -31
  195. package/lib/src/business/ap-draggable-grid/interface.d.ts +2 -0
  196. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  197. package/lib/src/business/ap-expand-alert/index.d.ts +4 -6
  198. package/lib/src/business/ap-select-layout/index.d.ts +2 -4
  199. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  200. package/lib/src/business/ap-table-modal/index.d.ts +17 -5
  201. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
  202. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
  203. package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
  204. package/lib/src/editable-table/form-item.vue.d.ts +2 -4
  205. package/lib/src/editable-table/index.vue.d.ts +2 -4
  206. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  207. package/lib/src/tests/wrapper.d.ts +4 -4
  208. package/lib/src/version.d.ts +1 -1
  209. package/lib/src/version.js +1 -1
  210. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +2 -3
  211. package/package.json +1 -1
  212. package/theme/ap-descriptions/ap-descriptions.css +1 -1
  213. package/theme/ap-descriptions/ap-descriptions.less +1 -1
  214. package/theme/ap-draggable-grid/ap-draggable-grid.css +4 -3
  215. package/theme/ap-draggable-grid/ap-draggable-grid.less +4 -2
  216. package/theme/index.css +5 -4
  217. package/theme/antd-global-overwrite/admin/alert.css +0 -37
  218. package/theme/antd-global-overwrite/admin/alert.less +0 -51
  219. package/theme/antd-global-overwrite/admin/button.css +0 -27
  220. package/theme/antd-global-overwrite/admin/button.less +0 -31
  221. package/theme/antd-global-overwrite/admin/field.css +0 -42
  222. package/theme/antd-global-overwrite/admin/field.less +0 -43
  223. package/theme/antd-global-overwrite/admin/form.css +0 -57
  224. package/theme/antd-global-overwrite/admin/form.less +0 -97
  225. package/theme/antd-global-overwrite/admin/message.css +0 -10
  226. package/theme/antd-global-overwrite/admin/message.less +0 -13
  227. package/theme/antd-global-overwrite/admin/modal.css +0 -94
  228. package/theme/antd-global-overwrite/admin/modal.less +0 -128
  229. package/theme/antd-global-overwrite/admin/pagination.css +0 -122
  230. package/theme/antd-global-overwrite/admin/pagination.less +0 -91
  231. package/theme/antd-global-overwrite/admin/steps.css +0 -127
  232. package/theme/antd-global-overwrite/admin/steps.less +0 -197
  233. package/theme/antd-global-overwrite/admin/table.css +0 -78
  234. package/theme/antd-global-overwrite/admin/table.less +0 -62
  235. package/theme/antd-global-overwrite/admin/tooltip.css +0 -3
  236. package/theme/antd-global-overwrite/admin/tooltip.less +0 -3
  237. package/theme/antd-global-overwrite/aplus/alert.css +0 -40
  238. package/theme/antd-global-overwrite/aplus/alert.less +0 -55
  239. package/theme/antd-global-overwrite/aplus/button.css +0 -27
  240. package/theme/antd-global-overwrite/aplus/button.less +0 -31
  241. package/theme/antd-global-overwrite/aplus/field.css +0 -42
  242. package/theme/antd-global-overwrite/aplus/field.less +0 -43
  243. package/theme/antd-global-overwrite/aplus/form.css +0 -87
  244. package/theme/antd-global-overwrite/aplus/form.less +0 -133
  245. package/theme/antd-global-overwrite/aplus/message.css +0 -10
  246. package/theme/antd-global-overwrite/aplus/message.less +0 -13
  247. package/theme/antd-global-overwrite/aplus/modal.css +0 -87
  248. package/theme/antd-global-overwrite/aplus/modal.less +0 -120
  249. package/theme/antd-global-overwrite/aplus/pagination.css +0 -147
  250. package/theme/antd-global-overwrite/aplus/pagination.less +0 -108
  251. package/theme/antd-global-overwrite/aplus/steps.css +0 -125
  252. package/theme/antd-global-overwrite/aplus/steps.less +0 -198
  253. package/theme/antd-global-overwrite/aplus/table.css +0 -78
  254. package/theme/antd-global-overwrite/aplus/table.less +0 -61
  255. package/theme/antd-global-overwrite/aplus/tooltip.css +0 -3
  256. package/theme/antd-global-overwrite/aplus/tooltip.less +0 -3
  257. package/theme/ap-table/ap-table-pagination.css +0 -12
  258. package/theme/ap-table/ap-table-pagination.less +0 -14
  259. package/theme/ui-mode.css +0 -60
  260. package/theme/ui-mode.less +0 -109
@@ -1,189 +1,440 @@
1
- import { defineComponent as H, ref as $, computed as w, useTemplateRef as M, reactive as U, watch as V, onMounted as J, onUnmounted as X, openBlock as D, createBlock as Y, unref as d, withCtx as j, createElementVNode as K, normalizeClass as L, normalizeStyle as W, createElementBlock as k, Fragment as Q, renderList as Z, renderSlot as ee, createTextVNode as re, toDisplayString as T } from "vue";
2
- import { ApDraggableGridProps as te } from "./constans.mjs";
3
- import { Spin as ae } from "@aplus-frontend/antdv";
1
+ import { defineComponent as lo, ref as N, computed as I, useTemplateRef as co, reactive as io, watch as fo, onMounted as po, onUnmounted as uo, createBlock as wo, openBlock as k, unref as R, withCtx as go, createElementVNode as ho, normalizeStyle as J, normalizeClass as U, createElementBlock as z, Fragment as mo, renderList as vo, renderSlot as Eo } from "vue";
2
+ import { ApDraggableGridProps as yo } from "./constans.mjs";
3
+ import { Spin as So } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
6
- const oe = ["data-span", "draggable", "onDragstart"], ue = /* @__PURE__ */ H({
5
+ import { useNamespace as Ro } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const Do = ["data-span", "draggable", "onDragstart"], Co = /* @__PURE__ */ lo({
7
7
  __name: "ApDraggableGrid",
8
- props: te(),
8
+ props: yo(),
9
9
  emits: ["onGridListChange"],
10
- setup(N, { expose: R, emit: B }) {
11
- const o = N, { b, e: p, m: E } = ne("ap-draggable-grid"), f = $(!1), m = w(() => p("item")), S = w(() => p("dragging")), I = w(() => o.customWrapper ? `.${o.customWrapper} .${m.value}` : `.${m.value}`), O = w(() => o.customWrapper ? `.${o.customWrapper} .${m.value}:not(.${S.value})` : `.${m.value}:not(.${S.value})`), F = B, u = M("gridContainer"), i = $(null), s = U([]);
12
- V(
13
- () => o.gridList,
14
- (e) => {
15
- Array.isArray(e) && v(e);
10
+ setup(V, { expose: X, emit: Y }) {
11
+ const h = V, { b: W, e: M, m: H } = Ro("ap-draggable-grid"), $ = N(!1), L = N([]), A = I(() => M("item")), B = I(() => M("dragging")), P = I(() => h.customWrapper ? `.${h.customWrapper} .${A.value}` : `.${A.value}`), q = I(() => h.customWrapper ? `.${h.customWrapper} .${A.value}:not(.${B.value})` : `.${A.value}:not(.${B.value})`), K = Y, D = co("gridContainer"), y = N(null), c = io([]);
12
+ fo(
13
+ () => h.gridList,
14
+ (r) => {
15
+ Array.isArray(r) && G(r);
16
16
  },
17
17
  { deep: !0, immediate: !0 }
18
18
  );
19
- function v(e) {
20
- s.splice(0, s.length), e.forEach((r) => {
21
- s.push({
22
- ...r,
19
+ function G(r) {
20
+ c.splice(0, c.length), r.forEach((s) => {
21
+ c.push({
22
+ ...s,
23
23
  isDragging: !1,
24
24
  isOverlay: !1
25
25
  });
26
26
  });
27
27
  }
28
- const q = (e) => ({
29
- gridColumn: `${e.col} / span ${e.span}`,
30
- gridRow: e.row,
31
- minHeight: `${o.gridItemHeight}px`,
32
- boxShadow: o.gridItemShadow ? o.gridItemShadow : "none"
33
- }), x = (e) => {
34
- if (e.isOverlay) {
35
- const r = {};
36
- return o.dragOverlayColor && (r.backgroundColor = o.dragOverlayColor), o.dragOverlayBorderColor && (r.border = `2px dashed ${o.dragOverlayBorderColor}`, r.boxSizing = "border-box"), r;
37
- }
38
- return {};
39
- }, _ = (e, r) => {
40
- i.value = r, s[r].isDragging = !0, e.dataTransfer && (e.dataTransfer.setData("text/plain", String(r)), e.dataTransfer.effectAllowed = "move");
41
- }, P = () => {
42
- i.value !== null && (s[i.value].isDragging = !1, h(), i.value = null), s.forEach((e) => e.isOverlay = !1);
28
+ const Q = (r) => ({
29
+ gridColumn: `${r.col} / span ${r.span}`,
30
+ gridRow: r.row,
31
+ minHeight: `${h.gridItemHeight}px`,
32
+ boxShadow: h.gridItemShadow ? h.gridItemShadow : "none"
33
+ }), Z = (r, s) => {
34
+ y.value = s, c[s].isDragging = !0, L.value = c.map((o) => ({
35
+ row: o.row,
36
+ col: o.col
37
+ })), r.dataTransfer && (r.dataTransfer.setData("text/plain", String(s)), r.dataTransfer.effectAllowed = "move");
38
+ }, x = () => {
39
+ y.value !== null && (c[y.value].isDragging = !1, C(), y.value = null), c.forEach((r) => r.isOverlay = !1);
43
40
  };
44
- function h() {
45
- const e = s.map(
46
- (r) => ({
47
- span: r.span,
48
- row: r.row,
49
- col: r.col,
50
- height: r.height ? r.height : ""
41
+ function C() {
42
+ const r = c.map(
43
+ (s) => ({
44
+ span: s.span,
45
+ row: s.row,
46
+ col: s.col,
47
+ height: s.height ? s.height : "",
48
+ showHeight: s.showHeight ? s.showHeight : "",
49
+ module: s.module
51
50
  })
52
51
  );
53
- F("onGridListChange", e);
52
+ K("onGridListChange", r);
54
53
  }
55
- async function C() {
56
- if (v([]), typeof o.request == "function")
54
+ async function _() {
55
+ if (G([]), typeof h.request == "function")
57
56
  try {
58
- f.value = !0;
59
- const e = await o.request();
60
- Array.isArray(e) ? v(e) : console.warn(
57
+ $.value = !0;
58
+ const r = await h.request();
59
+ Array.isArray(r) ? G(r) : console.warn(
61
60
  "ApDraggableGrid: 请求函数必须返回一个符合 ApDraggableGridItemBase 数组的格式"
62
61
  );
63
- } catch (e) {
64
- console.error("ApDraggableGrid: 请求错误:", e);
62
+ } catch (r) {
63
+ console.error("ApDraggableGrid: 请求错误:", r);
65
64
  } finally {
66
- f.value = !1;
65
+ $.value = !1;
67
66
  }
68
67
  }
69
- J(async () => {
70
- if (await C(), y(), o.disableDrag || !u.value) return;
71
- const e = (t) => {
72
- if (t.preventDefault(), i.value === null || !t.target) return;
73
- const a = document.elementFromPoint(t.clientX, t.clientY);
74
- if (!a) return;
75
- const n = a.closest(
76
- O.value
68
+ function oo() {
69
+ L.value.length === c.length && c.forEach((r, s) => {
70
+ const o = L.value[s];
71
+ r.row = o.row, r.col = o.col;
72
+ });
73
+ }
74
+ po(async () => {
75
+ if (await _(), O(), h.disableDrag || !D.value) return;
76
+ const r = (o) => {
77
+ if (o.preventDefault(), y.value === null || !o.target) return;
78
+ const e = document.elementFromPoint(o.clientX, o.clientY);
79
+ if (!e) return;
80
+ const t = e.closest(
81
+ q.value
77
82
  );
78
- if (!n) return;
79
- const l = Array.from(
80
- document.querySelectorAll(I.value)
81
- ).indexOf(n);
82
- l >= 0 && l !== i.value && (s.forEach((c) => c.isOverlay = !1), s[l].isOverlay = !0, A(i.value, l) ? t.dataTransfer.dropEffect = "move" : t.dataTransfer.dropEffect = "none");
83
- }, r = (t) => {
84
- if (t.preventDefault(), i.value === null) return;
85
- const a = document.elementFromPoint(t.clientX, t.clientY);
86
- if (!a) return;
87
- const n = a.closest(
88
- O.value
83
+ if (!t) return;
84
+ const a = Array.from(
85
+ document.querySelectorAll(P.value)
86
+ ).indexOf(t);
87
+ a >= 0 && a !== y.value && (c.forEach((f) => f.isOverlay = !1), c[a].isOverlay = !0, j(y.value, a) ? o.dataTransfer.dropEffect = "move" : o.dataTransfer.dropEffect = "none");
88
+ }, s = (o) => {
89
+ if (o.preventDefault(), y.value === null) return;
90
+ const e = document.elementFromPoint(o.clientX, o.clientY);
91
+ if (!e) return;
92
+ const t = e.closest(
93
+ q.value
89
94
  );
90
- if (!n) return;
91
- const l = Array.from(
92
- document.querySelectorAll(I.value)
93
- ).indexOf(n);
94
- l >= 0 && A(i.value, l) && (z(i.value, l), y(), h()), s.forEach((c) => {
95
- c.isDragging = !1, c.isOverlay = !1;
96
- }), i.value = null;
95
+ if (!t) return;
96
+ const a = Array.from(
97
+ document.querySelectorAll(P.value)
98
+ ).indexOf(t);
99
+ a >= 0 && ro(y.value, a) ? (no(y.value, a), O(), C()) : oo(), c.forEach((f) => {
100
+ f.isDragging = !1, f.isOverlay = !1;
101
+ }), y.value = null;
97
102
  };
98
- u.value.addEventListener("dragover", e), u.value.addEventListener("drop", r), X(() => {
99
- u.value && (u.value.removeEventListener("dragover", e), u.value.removeEventListener("drop", r));
103
+ D.value.addEventListener("dragover", r), D.value.addEventListener("drop", s), uo(() => {
104
+ D.value && (D.value.removeEventListener("dragover", r), D.value.removeEventListener("drop", s));
100
105
  });
101
106
  });
102
- function A(e, r) {
103
- const t = JSON.parse(
104
- JSON.stringify(s)
105
- ), a = t[e], n = t[r], g = a.height === n.height, l = G(
106
- a.span,
107
- n.row,
108
- e,
109
- r
110
- ), c = G(
111
- n.span,
112
- a.row,
113
- r,
114
- e
115
- );
116
- return l && c && g;
107
+ function j(r, s) {
108
+ const o = c[r], e = c[s];
109
+ if (o.row === e.row) {
110
+ const t = c.filter(
111
+ (a) => a.row === o.row
112
+ );
113
+ let i = 0;
114
+ return t.forEach((a) => {
115
+ c.indexOf(a) !== r && c.indexOf(a) !== s && (i += a.span);
116
+ }), i += o.span + e.span, i <= 24;
117
+ }
118
+ return o.span === e.span && o.height === e.height ? !0 : o.span === 24 ? c.filter(
119
+ (a) => a.row === e.row
120
+ ).reduce(
121
+ (a, f) => a + f.span,
122
+ 0
123
+ ) === 24 : e.span === 24 ? c.filter(
124
+ (a) => a.row === o.row
125
+ ).reduce(
126
+ (a, f) => a + f.span,
127
+ 0
128
+ ) === 24 : !1;
117
129
  }
118
- function G(e, r, t, a) {
119
- let n = 0, g = 1;
120
- return s.forEach((l, c) => {
121
- l.row === r && c !== a && c !== t && (n += l.span, l.col <= g && (g = l.col + l.span));
122
- }), n + e <= 24;
130
+ function ro(r, s) {
131
+ const o = c[r], e = c[s];
132
+ if (o.row === e.row)
133
+ return j(r, s);
134
+ const t = JSON.parse(JSON.stringify(c)), i = o.row, a = e.row, f = a < i, m = /* @__PURE__ */ new Map();
135
+ if (t.forEach((n, p) => {
136
+ m.has(n.row) || m.set(n.row, []), m.get(n.row).push(p);
137
+ }), o.span === 24 && e.span === 24) {
138
+ t[r].row = a, t[r].col = 1;
139
+ const n = f ? a + 1 : a - 1;
140
+ t[s].row = n, t[s].col = 1;
141
+ const p = t.map((u) => u.row);
142
+ t.forEach((u, l) => {
143
+ l !== r && l !== s && (f ? (p[l] > a && p[l] < i || p[l] === n) && (u.row += 1) : (p[l] > i && p[l] < a || p[l] === n) && (u.row -= 1));
144
+ });
145
+ } else if (o.span === 24) {
146
+ const n = t.filter(
147
+ (u) => u.row === a
148
+ );
149
+ if (n.reduce(
150
+ (u, l) => u + l.span,
151
+ 0
152
+ ) !== 24) return !1;
153
+ if (t[r].row = a, t[r].col = 1, f) {
154
+ const u = /* @__PURE__ */ new Set();
155
+ for (let l = a; l < i; l++)
156
+ u.add(l);
157
+ t.forEach((l, E) => {
158
+ E !== r && u.has(l.row) && (l.row += 1);
159
+ }), n.forEach((l) => {
160
+ t.indexOf(l) !== r && (l.row = a + 1);
161
+ });
162
+ } else
163
+ n.forEach((u) => {
164
+ t.indexOf(u) !== r && (u.row = i);
165
+ });
166
+ } else if (e.span === 24) {
167
+ const n = t.filter(
168
+ (u) => u.row === i
169
+ );
170
+ if (n.reduce(
171
+ (u, l) => u + l.span,
172
+ 0
173
+ ) !== 24) return !1;
174
+ t[s].row = i, t[s].col = 1, f ? n.forEach((u) => {
175
+ t.indexOf(u) !== s && (u.row = a + 1);
176
+ }) : n.forEach((u) => {
177
+ t.indexOf(u) !== s && (u.row = a);
178
+ });
179
+ } else if (o.span === e.span)
180
+ t[r].row = a, t[r].col = e.col, t[s].row = i, t[s].col = o.col;
181
+ else
182
+ return !1;
183
+ const v = /* @__PURE__ */ new Map();
184
+ t.forEach((n) => {
185
+ v.has(n.row) || v.set(n.row, []), v.get(n.row).push(n);
186
+ });
187
+ const S = Array.from(v.keys()).sort((n, p) => n - p);
188
+ let w = 1;
189
+ for (const n of S)
190
+ v.get(n).forEach((u) => {
191
+ u.row = w;
192
+ }), w++;
193
+ return eo(t);
123
194
  }
124
- function z(e, r) {
125
- const t = s[e], a = s[r], n = t.row, g = t.col;
126
- t.row = a.row, t.col = a.col, a.row = n, a.col = g;
195
+ function eo(r) {
196
+ const s = {};
197
+ r.forEach((o) => {
198
+ s[o.row] || (s[o.row] = []), s[o.row].push(o);
199
+ });
200
+ for (const o in s) {
201
+ const e = s[o];
202
+ if (e.reduce((a, f) => a + f.span, 0) > 24)
203
+ return !1;
204
+ e.sort((a, f) => a.col - f.col);
205
+ let i = 0;
206
+ for (const a of e) {
207
+ if (a.col <= i)
208
+ return !1;
209
+ i = a.col + a.span - 1;
210
+ }
211
+ }
212
+ return !0;
127
213
  }
128
- function y() {
129
- const e = {};
130
- s.forEach((r) => {
131
- e[r.row] || (e[r.row] = []), e[r.row].push(r);
132
- }), Object.keys(e).forEach((r) => {
133
- const t = parseInt(r);
134
- e[t].sort((n, g) => n.col - g.col);
135
- let a = 1;
136
- e[t].forEach((n) => {
137
- n.col = a, a += n.span;
214
+ function no(r, s) {
215
+ const o = c[r], e = c[s], t = JSON.parse(JSON.stringify(c)), i = o.row, a = e.row;
216
+ if (o.span === 24 && e.span === 24) {
217
+ ao(
218
+ o,
219
+ e,
220
+ i,
221
+ a,
222
+ t
223
+ );
224
+ return;
225
+ }
226
+ if (i === a) {
227
+ const w = o.col;
228
+ o.col = e.col, e.col = w;
229
+ return;
230
+ }
231
+ const f = a < i, m = c.map((w) => w.row), v = c.map((w) => w.col), S = c.map((w) => w.span);
232
+ if (o.span === 24 && e.span === 24) {
233
+ const w = i, n = a;
234
+ o.row = n, o.col = 1, o.span = 24, e.row = w, e.col = 1, e.span = 24;
235
+ const p = Math.abs(w - n), u = /* @__PURE__ */ new Set();
236
+ for (let l = Math.min(w, n); l <= Math.max(w, n); l++)
237
+ u.add(l);
238
+ if (p !== 1) {
239
+ const l = Math.min(w, n), E = Math.max(w, n), d = /* @__PURE__ */ new Map();
240
+ if (f) {
241
+ d.set(w, n), d.set(n, n + 1);
242
+ for (let g = n + 1; g < w; g++)
243
+ d.set(g, g + 1);
244
+ } else {
245
+ d.set(w, n), d.set(n, n - 1);
246
+ for (let g = w + 1; g < n; g++)
247
+ d.set(g, g - 1);
248
+ }
249
+ c.forEach((g, b) => {
250
+ if (b !== r && b !== s) {
251
+ const T = m[b];
252
+ T >= l && T <= E && d.has(T) && (g.row = d.get(T), g.col = v[b], g.span = S[b]);
253
+ }
254
+ });
255
+ }
256
+ } else if (o.span === 24) {
257
+ const w = c.filter(
258
+ (n) => n.row === a
259
+ );
260
+ o.row = a, o.col = 1, f ? c.forEach((n, p) => {
261
+ p !== r && (n.row === a ? n.row = a + 1 : n.row > a && n.row < i && (n.row += 1));
262
+ }) : w.forEach((n) => {
263
+ c.indexOf(n) !== r && (n.row = i);
264
+ });
265
+ } else if (e.span === 24) {
266
+ const w = c.filter(
267
+ (n) => n.row === i
268
+ );
269
+ e.row = i, e.col = 1, f ? (w.forEach((n) => {
270
+ c.indexOf(n) !== s && (n.row = a + 1);
271
+ }), c.forEach((n, p) => {
272
+ p !== s && !w.includes(n) && n.row > a && n.row < i && (n.row += 1);
273
+ })) : w.forEach((n) => {
274
+ c.indexOf(n) !== s && (n.row = a);
138
275
  });
276
+ } else o.span === e.span && (o.row = a, o.col = e.col, e.row = i, e.col = o.col);
277
+ O();
278
+ }
279
+ function ao(r, s, o, e, t) {
280
+ const i = r.module, a = s.module, f = t.map((l) => ({ ...l })), m = /* @__PURE__ */ new Map();
281
+ f.forEach((l) => {
282
+ m.has(l.row) || m.set(l.row, []), m.get(l.row).push(l);
139
283
  });
284
+ const v = f.find(
285
+ (l) => l.module === i
286
+ ), S = f.find(
287
+ (l) => l.module === a
288
+ ), w = Array.from(
289
+ /* @__PURE__ */ new Set([o, e, ...Array.from(m.keys())])
290
+ ).sort((l, E) => l - E), n = {};
291
+ let p = 1;
292
+ for (const l of w) {
293
+ if (n[p]) {
294
+ p++;
295
+ continue;
296
+ }
297
+ if (l === o)
298
+ p === e && p++, n[p] = [S], S.row = p, S.col = 1, S.span = 24, p++;
299
+ else if (l === e)
300
+ p === o && p++, n[p] = [v], v.row = p, v.col = 1, v.span = 24, p++;
301
+ else {
302
+ const d = (m.get(l) || []).filter(
303
+ (g) => g.module !== i && g.module !== a
304
+ );
305
+ d.length > 0 && (d.forEach((g) => {
306
+ g.row = p, g.col = g === d[0] ? 1 : d[0].col + d[0].span;
307
+ }), n[p] = d, p++);
308
+ }
309
+ }
310
+ c.splice(0, c.length);
311
+ const u = Object.keys(n).map(Number).sort((l, E) => l - E);
312
+ for (const l of u) {
313
+ const E = n[l];
314
+ E.sort((d, g) => d.col - g.col), E.forEach((d) => {
315
+ c.push(d);
316
+ });
317
+ }
318
+ O();
319
+ }
320
+ function O() {
321
+ c.forEach((e) => {
322
+ if (e.module) {
323
+ const t = so(e.module);
324
+ t && (e.span <= 0 || e.span > 24) ? (console.log(
325
+ `Restoring original span ${t} for module ${e.module}`
326
+ ), e.span = t) : (e.span <= 0 && (e.span = 1), e.span > 24 && (e.span = 24));
327
+ } else
328
+ e.span <= 0 && (e.span = 1), e.span > 24 && (e.span = 24);
329
+ e.span === 24 && (e.col = 1);
330
+ });
331
+ const r = {};
332
+ c.forEach((e) => {
333
+ r[e.row] || (r[e.row] = []), r[e.row].push(e);
334
+ }), Object.keys(r).forEach((e) => {
335
+ const t = parseInt(e), i = r[t];
336
+ if (i.sort((f, m) => f.col - m.col), i.length === 1 && i[0].span === 24) {
337
+ i[0].col = 1;
338
+ return;
339
+ }
340
+ let a = 1;
341
+ i.forEach((f, m) => {
342
+ f.col = a;
343
+ const v = 24 - a + 1;
344
+ f.span > v && (m === 0 ? f.span = Math.min(f.span, 24) : f.span = v), a += f.span;
345
+ }), F(i);
346
+ });
347
+ const s = Object.keys(r).map(Number).sort((e, t) => e - t);
348
+ let o = 1;
349
+ s.forEach((e) => {
350
+ e !== o && r[e].forEach((t) => {
351
+ t.row = o;
352
+ }), o++;
353
+ }), to();
354
+ }
355
+ function so(r) {
356
+ return {
357
+ 1: 8,
358
+ 2: 16,
359
+ 3: 24,
360
+ 4: 16,
361
+ 5: 8,
362
+ 6: 16,
363
+ 7: 8,
364
+ 8: 24,
365
+ 9: 12,
366
+ 10: 12
367
+ }[r] || null;
368
+ }
369
+ function to() {
370
+ const r = [...new Set(c.map((o) => o.row))].sort(
371
+ (o, e) => o - e
372
+ );
373
+ for (let o = 0; o < r.length - 1; o++)
374
+ r[o + 1] - r[o] !== 1 && console.warn(`Row gap detected: ${r[o]} to ${r[o + 1]}`);
375
+ const s = {};
376
+ c.forEach((o) => {
377
+ s[o.row] || (s[o.row] = []), s[o.row].push(o);
378
+ }), Object.keys(s).forEach((o) => {
379
+ F(s[parseInt(o)]);
380
+ });
381
+ }
382
+ function F(r) {
383
+ r.sort((s, o) => s.col - o.col);
384
+ for (let s = 0; s < r.length; s++) {
385
+ const o = r[s], e = o.col, t = o.span;
386
+ if (o.span <= 0 && (o.span = 1), o.span > 24 && (o.span = 24), o.col < 1 && (o.col = 1), o.col + o.span - 1 > 24 && (o.col > 1 ? o.col = Math.max(1, 25 - o.span) : o.span = 24 - o.col + 1), s > 0) {
387
+ const a = r[s - 1], f = a.col + a.span - 1;
388
+ o.col <= f && (o.col = f + 1, o.col + o.span - 1 > 24 && (o.span = Math.max(1, 24 - o.col + 1)));
389
+ }
390
+ (e !== o.col || t !== o.span) && console.warn(
391
+ `Item layout corrected: col ${e} -> ${o.col}, span ${t} -> ${o.span}`
392
+ );
393
+ }
140
394
  }
141
- return R({
142
- setGridItems: (e) => {
143
- v(e), y(), h();
395
+ return X({
396
+ setGridItems: (r) => {
397
+ G(r), O(), C();
144
398
  },
145
399
  refreshGrid: () => {
146
400
  (async () => {
147
- await C(), y(), h();
401
+ await _(), O(), C();
148
402
  })();
149
403
  }
150
- }), (e, r) => (D(), Y(d(ae), { spinning: f.value }, {
151
- default: j(() => [
152
- K("div", {
404
+ }), (r, s) => (k(), wo(R(So), { spinning: $.value }, {
405
+ default: go(() => [
406
+ ho("div", {
153
407
  ref_key: "gridContainer",
154
- ref: u,
155
- class: L([f.value ? d(b)("loading") : d(b)(), o.customWrapper]),
156
- style: W({
157
- width: typeof e.gridWidth == "number" ? `${e.gridWidth}px` : e.gridWidth,
158
- gap: `${e.gapWidth}px`
408
+ ref: D,
409
+ class: U([$.value ? R(W)("loading") : R(W)(), h.customWrapper]),
410
+ style: J({
411
+ width: typeof r.gridWidth == "number" ? `${r.gridWidth}px` : r.gridWidth,
412
+ gap: `${r.gapWidth}px`
159
413
  })
160
414
  }, [
161
- (D(!0), k(Q, null, Z(s, (t, a) => (D(), k("div", {
162
- key: a,
163
- class: L([
164
- d(p)("item"),
165
- o.disableDrag ? "" : d(E)("dragging"),
166
- t.isDragging ? d(p)("dragging") : "",
167
- t.isOverlay ? d(p)("overlay") : "",
168
- o.disableDrag ? "" : d(E)("canDrag")
415
+ (k(!0), z(mo, null, vo(c, (o, e) => (k(), z("div", {
416
+ key: e,
417
+ class: U([
418
+ R(M)("item"),
419
+ h.disableDrag ? "" : R(H)("dragging"),
420
+ o.isDragging ? R(M)("dragging") : "",
421
+ o.isOverlay ? R(M)("overlay") : "",
422
+ h.disableDrag ? "" : R(H)("canDrag")
169
423
  ]),
170
- "data-span": t.span,
171
- style: W([
172
- q(t),
173
- x(t),
174
- { height: t.height ? t.height + "px" : "" }
424
+ "data-span": o.span,
425
+ style: J([
426
+ Q(o),
427
+ { height: o.showHeight ? o.showHeight + "px" : "" }
175
428
  ]),
176
- draggable: !o.disableDrag,
177
- onDragstart: (n) => _(n, a),
178
- onDragend: P
429
+ draggable: !h.disableDrag,
430
+ onDragstart: (t) => Z(t, e),
431
+ onDragend: x
179
432
  }, [
180
- ee(e.$slots, "item", {
181
- item: t,
182
- index: a
183
- }, () => [
184
- re(T(Math.round(t.span / 24 * 100)) + "% (" + T(t.span) + "/24) ", 1)
185
- ])
186
- ], 46, oe))), 128))
433
+ Eo(r.$slots, "item", {
434
+ item: o,
435
+ index: e
436
+ })
437
+ ], 46, Do))), 128))
187
438
  ], 6)
188
439
  ]),
189
440
  _: 3
@@ -191,5 +442,5 @@ const oe = ["data-span", "draggable", "onDragstart"], ue = /* @__PURE__ */ H({
191
442
  }
192
443
  });
193
444
  export {
194
- ue as default
445
+ Co as default
195
446
  };
@@ -25,14 +25,6 @@ export declare const ApDraggableGridProps: () => {
25
25
  type: NumberConstructor;
26
26
  default: number;
27
27
  };
28
- dragOverlayColor: {
29
- type: StringConstructor;
30
- default: string;
31
- };
32
- dragOverlayBorderColor: {
33
- type: StringConstructor;
34
- default: string;
35
- };
36
28
  disableDrag: {
37
29
  type: BooleanConstructor;
38
30
  default: boolean;
@@ -23,14 +23,6 @@ const e = () => ({
23
23
  type: Number,
24
24
  default: 12
25
25
  },
26
- dragOverlayColor: {
27
- type: String,
28
- default: "#66a9ff"
29
- },
30
- dragOverlayBorderColor: {
31
- type: String,
32
- default: "#4d97f7"
33
- },
34
26
  disableDrag: {
35
27
  type: Boolean,
36
28
  default: !1