@aplus-frontend/ui 6.18.0 → 6.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-action/group/index.vue.mjs +3 -3
- package/es/src/ap-action/item/index.vue2.mjs +5 -5
- package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
- package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
- package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +4 -4
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
- package/es/src/ap-download/ap-download.vue.mjs +1 -1
- package/es/src/ap-drawer/components/ApDrawerClose.vue2.mjs +2 -2
- package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +13 -13
- package/es/src/ap-field/date-range/index.vue.mjs +16 -16
- package/es/src/ap-field/index.mjs +36 -36
- package/es/src/ap-field/number/index.vue.mjs +8 -8
- package/es/src/ap-field/radio/index.vue.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +1 -1
- package/es/src/ap-field/select/index.vue.mjs +2 -2
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/slider/index.vue.mjs +4 -4
- package/es/src/ap-field/switch/index.vue.mjs +3 -3
- package/es/src/ap-field/text/index.vue2.mjs +2 -2
- package/es/src/ap-field/text/password.vue.mjs +2 -2
- package/es/src/ap-field/text-area/index.vue.mjs +3 -3
- package/es/src/ap-field/tree-select/index.vue.mjs +3 -3
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +2 -1
- package/es/src/ap-form/ap-form.vue2.mjs +2 -2
- package/es/src/ap-form/drawer-form/index.vue.d.ts +7 -6
- package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
- package/es/src/ap-form/item/index.vue.mjs +7 -7
- package/es/src/ap-form/item-group/index.vue.mjs +1 -1
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
- package/es/src/ap-form/items/number/index.vue.d.ts +3 -3
- package/es/src/ap-form/items/number/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +11 -11
- package/es/src/ap-form/items/select/index.vue.mjs +2 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
- package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/password.vue.mjs +2 -2
- package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +3 -3
- package/es/src/ap-form/items/tree-select/index.vue.mjs +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +7 -6
- package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
- package/es/src/ap-form/render/item.vue.mjs +2 -2
- package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +10 -10
- package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +23 -23
- package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +7 -6
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-form/set/index.vue.mjs +1 -1
- package/es/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/form-item.vue.mjs +9 -9
- package/es/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/index.vue.mjs +3 -3
- package/es/src/ap-grid/index.vue.d.ts +4 -2
- package/es/src/ap-grid/index.vue.mjs +40 -40
- package/es/src/ap-list/index.vue.d.ts +4 -2
- package/es/src/ap-list/index.vue.mjs +1 -1
- package/es/src/ap-modal/utils/confirm.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue.d.ts +4 -2
- package/es/src/ap-table/ap-table.vue2.mjs +14 -13
- package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
- package/es/src/ap-table/constants.d.ts +10 -10
- package/es/src/ap-table/constants.mjs +45 -45
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
- package/es/src/ap-tag/ap-tag-group.vue.mjs +73 -78
- package/es/src/ap-tag/ap-tag.vue.d.ts +1 -0
- package/es/src/ap-tag/ap-tag.vue.mjs +17 -18
- package/es/src/ap-tag/interface.d.ts +6 -0
- package/es/src/ap-tag/utils.d.ts +1 -0
- package/es/src/ap-tag/utils.mjs +12 -0
- package/es/src/ap-upload/apUpload.vue.mjs +5 -5
- package/es/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
- package/es/src/ap-upload/components/Picture.vue.d.ts +7 -2
- package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
- package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +6 -6
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +9 -9
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +3 -4
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
- package/es/src/business/ap-card/ApCard.vue2.mjs +9 -9
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +3 -2
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +212 -398
- package/es/src/business/ap-draggable-grid/constans.mjs +1 -1
- package/es/src/business/ap-draggable-grid/index.d.ts +5 -2
- package/es/src/business/ap-draggable-grid/interface.d.ts +3 -2
- package/es/src/business/ap-draggable-grid/utils/sortItemsByRowAndCol.d.ts +2 -0
- package/es/src/business/ap-draggable-grid/utils/sortItemsByRowAndCol.mjs +14 -0
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +33 -33
- package/es/src/business/ap-expand-alert/index.d.ts +6 -4
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +7 -7
- package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
- package/es/src/business/ap-keep-alive/keep-alive.mjs +3 -3
- package/es/src/business/ap-ladder/components/RenderValue.mjs +2 -2
- package/es/src/business/ap-radio-group/ap-radio-group.vue2.mjs +1 -1
- package/es/src/business/ap-select-layout/index.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
- package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
- package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
- package/es/src/business/ap-table-modal/index.d.ts +5 -17
- package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
- package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
- package/es/src/business/ap-view/ap-view.vue2.mjs +2 -2
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +5 -4
- package/es/src/business/ap-view/components/main-button-content.vue2.mjs +5 -5
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +5 -4
- package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +6 -6
- package/es/src/business/ap-view/icons/line-delete.vue.mjs +2 -2
- package/es/src/business/ap-view/icons/line-down.vue.mjs +2 -2
- package/es/src/business/ap-view/icons/line-eye.vue.mjs +2 -2
- package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
- package/es/src/check-card/index.vue2.mjs +3 -3
- package/es/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/es/src/editable-table/form-item.vue.d.ts +4 -2
- package/es/src/editable-table/form-item.vue.mjs +38 -37
- package/es/src/editable-table/index.vue.d.ts +4 -2
- package/es/src/editable-table/index.vue.mjs +16 -15
- package/es/src/full-screen/index.vue.mjs +3 -3
- package/es/src/hooks/useFullScreen.mjs +5 -5
- package/es/src/mask/index.vue.mjs +10 -10
- package/es/src/portal/index.vue.mjs +2 -2
- package/es/src/scroll-bar/index.vue.mjs +3 -3
- package/es/src/scroll-bar/internal.vue.mjs +2 -2
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/scroll-view/index.vue.mjs +9 -9
- package/es/src/splitter/Panel.vue2.mjs +4 -4
- package/es/src/splitter/SplitBar.vue2.mjs +7 -7
- package/es/src/splitter/Splitter.vue2.mjs +5 -5
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/text/group.vue.mjs +2 -2
- package/es/src/text/index.vue.mjs +5 -5
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +5 -4
- package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +7 -6
- package/lib/src/ap-form/items/number/index.vue.d.ts +3 -3
- package/lib/src/ap-form/items/select/index.vue.d.ts +11 -11
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +3 -3
- package/lib/src/ap-form/modal-form/index.vue.d.ts +7 -6
- package/lib/src/ap-form/search-form/index.vue.d.ts +7 -6
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +4 -2
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +4 -2
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +10 -10
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-tag/ap-tag.vue.d.ts +1 -0
- package/lib/src/ap-tag/ap-tag.vue.js +1 -1
- package/lib/src/ap-tag/interface.d.ts +6 -0
- package/lib/src/ap-tag/utils.d.ts +1 -0
- package/lib/src/ap-tag/utils.js +1 -0
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/ap-upload/components/Picture.vue.d.ts +7 -2
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +3 -2
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-draggable-grid/constans.js +1 -1
- package/lib/src/business/ap-draggable-grid/index.d.ts +5 -2
- package/lib/src/business/ap-draggable-grid/interface.d.ts +3 -2
- package/lib/src/business/ap-draggable-grid/utils/sortItemsByRowAndCol.d.ts +2 -0
- package/lib/src/business/ap-draggable-grid/utils/sortItemsByRowAndCol.js +1 -0
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/ap-expand-alert/index.d.ts +6 -4
- package/lib/src/business/ap-select-layout/index.d.ts +4 -2
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/lib/src/business/ap-table-modal/index.d.ts +5 -17
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +5 -4
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +5 -4
- package/lib/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/lib/src/editable-table/form-item.vue.d.ts +4 -2
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +4 -2
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +5 -4
- package/package.json +3 -3
- package/theme/antd-global-overwrite/admin/alert.css +37 -0
- package/theme/antd-global-overwrite/admin/alert.less +51 -0
- package/theme/antd-global-overwrite/admin/button.css +27 -0
- package/theme/antd-global-overwrite/admin/button.less +31 -0
- package/theme/antd-global-overwrite/admin/field.css +42 -0
- package/theme/antd-global-overwrite/admin/field.less +43 -0
- package/theme/antd-global-overwrite/admin/form.css +57 -0
- package/theme/antd-global-overwrite/admin/form.less +97 -0
- package/theme/antd-global-overwrite/admin/message.css +10 -0
- package/theme/antd-global-overwrite/admin/message.less +13 -0
- package/theme/antd-global-overwrite/admin/modal.css +94 -0
- package/theme/antd-global-overwrite/admin/modal.less +128 -0
- package/theme/antd-global-overwrite/admin/pagination.css +122 -0
- package/theme/antd-global-overwrite/admin/pagination.less +91 -0
- package/theme/antd-global-overwrite/admin/steps.css +127 -0
- package/theme/antd-global-overwrite/admin/steps.less +197 -0
- package/theme/antd-global-overwrite/admin/table.css +78 -0
- package/theme/antd-global-overwrite/admin/table.less +62 -0
- package/theme/antd-global-overwrite/admin/tooltip.css +3 -0
- package/theme/antd-global-overwrite/admin/tooltip.less +3 -0
- package/theme/antd-global-overwrite/aplus/alert.css +40 -0
- package/theme/antd-global-overwrite/aplus/alert.less +55 -0
- package/theme/antd-global-overwrite/aplus/button.css +27 -0
- package/theme/antd-global-overwrite/aplus/button.less +31 -0
- package/theme/antd-global-overwrite/aplus/field.css +42 -0
- package/theme/antd-global-overwrite/aplus/field.less +43 -0
- package/theme/antd-global-overwrite/aplus/form.css +87 -0
- package/theme/antd-global-overwrite/aplus/form.less +133 -0
- package/theme/antd-global-overwrite/aplus/message.css +10 -0
- package/theme/antd-global-overwrite/aplus/message.less +13 -0
- package/theme/antd-global-overwrite/aplus/modal.css +87 -0
- package/theme/antd-global-overwrite/aplus/modal.less +120 -0
- package/theme/antd-global-overwrite/aplus/pagination.css +147 -0
- package/theme/antd-global-overwrite/aplus/pagination.less +108 -0
- package/theme/antd-global-overwrite/aplus/steps.css +125 -0
- package/theme/antd-global-overwrite/aplus/steps.less +198 -0
- package/theme/antd-global-overwrite/aplus/table.css +78 -0
- package/theme/antd-global-overwrite/aplus/table.less +61 -0
- package/theme/antd-global-overwrite/aplus/tooltip.css +3 -0
- package/theme/antd-global-overwrite/aplus/tooltip.less +3 -0
- package/theme/antdv-override.css +2 -6
- package/theme/antdv-override.less +2 -6
- package/theme/ap-draggable-grid/ap-draggable-grid.css +3 -3
- package/theme/ap-draggable-grid/ap-draggable-grid.less +3 -4
- package/theme/ap-label/ap-label.css +1 -0
- package/theme/ap-label/ap-label.less +1 -0
- package/theme/ap-table/ap-table-pagination.css +12 -0
- package/theme/ap-table/ap-table-pagination.less +14 -0
- package/theme/ap-tag/ap-tag.css +5 -2
- package/theme/ap-tag/ap-tag.less +5 -2
- package/theme/index.css +11 -11
- package/theme/ui-mode.css +60 -0
- package/theme/ui-mode.less +109 -0
|
@@ -1,440 +1,254 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApDraggableGridProps as
|
|
3
|
-
import { Spin as
|
|
1
|
+
import { defineComponent as te, ref as T, computed as H, useTemplateRef as ne, watch as ae, toRaw as le, onMounted as se, onUnmounted as ie, openBlock as M, createBlock as ue, unref as G, withCtx as de, createElementVNode as ce, normalizeClass as q, normalizeStyle as z, createElementBlock as U, Fragment as ge, renderList as fe, renderSlot as pe } from "vue";
|
|
2
|
+
import { ApDraggableGridProps as me } from "./constans.mjs";
|
|
3
|
+
import { Spin as we } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { sortItemsByRowAndCol as D } from "./utils/sortItemsByRowAndCol.mjs";
|
|
6
|
+
import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const ve = ["data-span", "data-index", "data-row", "data-col", "data-height", "data-module", "draggable"], Ee = /* @__PURE__ */ te({
|
|
7
8
|
__name: "ApDraggableGrid",
|
|
8
|
-
props:
|
|
9
|
+
props: me(),
|
|
9
10
|
emits: ["onGridListChange"],
|
|
10
|
-
setup(V, { expose:
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
() =>
|
|
14
|
-
(
|
|
15
|
-
Array.isArray(
|
|
11
|
+
setup(V, { expose: j, emit: K }) {
|
|
12
|
+
const g = V, { b: F, e: L, m: Q } = he("ap-draggable-grid"), C = T(!1), R = T(!1), O = H(() => L("item")), P = H(() => L("dragging")), X = H(() => g.customWrapper ? `.${g.customWrapper} .${O.value}:not(.${P.value})` : `.${O.value}:not(.${P.value})`), Y = K, f = ne("gridContainer"), I = T([]);
|
|
13
|
+
ae(
|
|
14
|
+
() => g.gridList,
|
|
15
|
+
(e) => {
|
|
16
|
+
Array.isArray(e) && s(e);
|
|
16
17
|
},
|
|
17
18
|
{ deep: !0, immediate: !0 }
|
|
18
19
|
);
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
}
|
|
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);
|
|
40
|
-
};
|
|
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
|
|
50
|
-
})
|
|
20
|
+
function s(e) {
|
|
21
|
+
const t = [...e].sort((o, i) => o.row - i.row);
|
|
22
|
+
I.value = t.map((o) => ({
|
|
23
|
+
...o
|
|
24
|
+
})), Y(
|
|
25
|
+
"onGridListChange",
|
|
26
|
+
JSON.parse(JSON.stringify(I.value))
|
|
51
27
|
);
|
|
52
|
-
K("onGridListChange", r);
|
|
53
28
|
}
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
const Z = (e) => ({
|
|
30
|
+
gridColumn: `${e.col} / span ${e.span}`,
|
|
31
|
+
gridRow: e.row,
|
|
32
|
+
minHeight: e.showHeight ? e.showHeight + "px" : `${g.gridItemHeight}px`,
|
|
33
|
+
height: e.showHeight ? e.showHeight + "px" : `${g.gridItemHeight}px`,
|
|
34
|
+
boxShadow: g.gridItemShadow ? g.gridItemShadow : "none"
|
|
35
|
+
});
|
|
36
|
+
async function k() {
|
|
37
|
+
if (s([]), typeof g.request == "function")
|
|
56
38
|
try {
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
Array.isArray(
|
|
39
|
+
C.value = !0;
|
|
40
|
+
const e = await g.request();
|
|
41
|
+
Array.isArray(e) ? (console.log("ApDraggableGrid: 请求到的布局数据:", e), s(e)) : console.warn(
|
|
60
42
|
"ApDraggableGrid: 请求函数必须返回一个符合 ApDraggableGridItemBase 数组的格式"
|
|
61
43
|
);
|
|
62
|
-
} catch (
|
|
63
|
-
console.error("ApDraggableGrid: 请求错误:",
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.error("ApDraggableGrid: 请求错误:", e);
|
|
64
46
|
} finally {
|
|
65
|
-
|
|
47
|
+
C.value = !1;
|
|
66
48
|
}
|
|
67
49
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const t = e.closest(
|
|
81
|
-
q.value
|
|
82
|
-
);
|
|
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
|
|
94
|
-
);
|
|
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;
|
|
102
|
-
};
|
|
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));
|
|
105
|
-
});
|
|
106
|
-
});
|
|
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;
|
|
129
|
-
}
|
|
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);
|
|
194
|
-
}
|
|
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
|
-
}
|
|
50
|
+
let N = T(null), S = T(null), w = null, A = !1, v = null;
|
|
51
|
+
const W = (e) => {
|
|
52
|
+
if (!A && (A = !0, e.dataTransfer && e.target instanceof HTMLElement)) {
|
|
53
|
+
const t = e.target.dataset;
|
|
54
|
+
e.dataTransfer.setData("text/plain", t.module), e.dataTransfer.effectAllowed = "move", N.value = {
|
|
55
|
+
span: Number(t.span),
|
|
56
|
+
col: Number(t.col),
|
|
57
|
+
row: Number(t.row),
|
|
58
|
+
module: t.module,
|
|
59
|
+
height: Number(t.height),
|
|
60
|
+
index: Number(t.index)
|
|
61
|
+
}, w = e.target, w.style.opacity = "0";
|
|
211
62
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
o,
|
|
219
|
-
e,
|
|
220
|
-
i,
|
|
221
|
-
a,
|
|
222
|
-
t
|
|
63
|
+
}, J = (e) => {
|
|
64
|
+
if (e.preventDefault(), v && clearTimeout(v), v = window.setTimeout(() => {
|
|
65
|
+
A = !1, v = null;
|
|
66
|
+
}, 300), e.dataTransfer && e.target instanceof HTMLElement) {
|
|
67
|
+
const t = e.target.closest(
|
|
68
|
+
X.value
|
|
223
69
|
);
|
|
224
|
-
return;
|
|
70
|
+
if (!t) return;
|
|
71
|
+
const o = t.dataset;
|
|
72
|
+
S.value = {
|
|
73
|
+
span: Number(o.span),
|
|
74
|
+
col: Number(o.col),
|
|
75
|
+
row: Number(o.row),
|
|
76
|
+
module: o.module,
|
|
77
|
+
height: Number(o.height),
|
|
78
|
+
index: Number(o.index)
|
|
79
|
+
};
|
|
225
80
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
81
|
+
}, B = (e) => {
|
|
82
|
+
e.preventDefault(), w && (w.style.opacity = "1", w = null), ee(N, S) && oe(N, S), N.value = null, S.value = null, R.value = !1;
|
|
83
|
+
}, _ = () => {
|
|
84
|
+
w && (w.style.opacity = "1", w = null), N.value = null, S.value = null, R.value = !1;
|
|
85
|
+
}, ee = (e, t) => {
|
|
86
|
+
const { span: o, module: i } = e.value, { span: u, module: d } = t.value;
|
|
87
|
+
return i === d && o === u ? (console.log("如果自己放在自己之上不能交换数据"), !1) : !0;
|
|
88
|
+
}, oe = (e, t) => {
|
|
89
|
+
if (!e.value || !t.value) return;
|
|
90
|
+
const {
|
|
91
|
+
span: o,
|
|
92
|
+
col: i,
|
|
93
|
+
row: u,
|
|
94
|
+
module: d,
|
|
95
|
+
height: $,
|
|
96
|
+
index: a
|
|
97
|
+
} = e.value, {
|
|
98
|
+
span: b,
|
|
99
|
+
col: h,
|
|
100
|
+
row: p,
|
|
101
|
+
module: re,
|
|
102
|
+
height: x,
|
|
103
|
+
index: c
|
|
104
|
+
} = t.value;
|
|
105
|
+
if (u === p && i === h && o === b && $ === x && d === re) {
|
|
106
|
+
console.log("从同一位置拖拽到同一位置,不做任何操作");
|
|
229
107
|
return;
|
|
230
108
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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);
|
|
109
|
+
let r = [...le(I.value)];
|
|
110
|
+
const E = JSON.parse(JSON.stringify(r));
|
|
111
|
+
if (u === p)
|
|
112
|
+
if (a > c) {
|
|
113
|
+
console.log("", "从右向左拖拽"), console.log(a, c), console.log(a - c), a - c === 1 ? (r[c].col = o + h, r[a].col = h) : (r.forEach((m, n) => {
|
|
114
|
+
n < a && n >= c && (m.col += b);
|
|
115
|
+
}), r[a].col = h);
|
|
116
|
+
const l = D(r);
|
|
117
|
+
if (!y(l)) {
|
|
118
|
+
console.warn("交换后的布局无效,恢复原始布局");
|
|
119
|
+
return;
|
|
248
120
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
});
|
|
121
|
+
s(l);
|
|
122
|
+
return;
|
|
123
|
+
} else {
|
|
124
|
+
console.log(a, c), console.log("", "从左向右拖拽"), c - a === 1 ? (r[a].col = b + 1, r[c].col = i) : (r.forEach((m, n) => {
|
|
125
|
+
n > a && n <= c && (m.col -= b);
|
|
126
|
+
}), r[a].col = h);
|
|
127
|
+
const l = D(r);
|
|
128
|
+
if (console.log("交换后的布局:", l), !y(l)) {
|
|
129
|
+
console.warn("交换后的布局无效,恢复原始布局"), s(E);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
s(l);
|
|
133
|
+
return;
|
|
255
134
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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);
|
|
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);
|
|
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;
|
|
135
|
+
else if (p < u) {
|
|
136
|
+
if (console.log("从下向上拖拽"), o === 24) {
|
|
137
|
+
const l = [];
|
|
138
|
+
for (let n = p; n < u; n++)
|
|
139
|
+
l.push(n);
|
|
140
|
+
r.forEach((n) => {
|
|
141
|
+
l.includes(n.row) && (n.row += 1);
|
|
142
|
+
}), r[a].row = p;
|
|
143
|
+
const m = D(r);
|
|
144
|
+
if (!y(m)) {
|
|
145
|
+
console.warn("交换后的布局无效,恢复原始布局"), s(E);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
s(m);
|
|
149
|
+
return;
|
|
296
150
|
}
|
|
297
|
-
if (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
g.row = p, g.col = g === d[0] ? 1 : d[0].col + d[0].span;
|
|
307
|
-
}), n[p] = d, p++);
|
|
151
|
+
if (o === b && $ === x) {
|
|
152
|
+
r[a].row = p, r[a].col = h, r[c].row = u, r[c].col = i;
|
|
153
|
+
const l = D(r);
|
|
154
|
+
if (!y(l)) {
|
|
155
|
+
console.warn("交换后的布局无效,恢复原始布局"), s(E);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
s(l);
|
|
159
|
+
return;
|
|
308
160
|
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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;
|
|
161
|
+
} else {
|
|
162
|
+
if (console.log("从上向下拖拽"), o === 24) {
|
|
163
|
+
console.log("如果拖拽元素跨度为24", "从上向下拖拽");
|
|
164
|
+
const l = [];
|
|
165
|
+
for (let n = u + 1; n <= p; n++)
|
|
166
|
+
l.push(n);
|
|
167
|
+
r.forEach((n) => {
|
|
168
|
+
l.includes(n.row) && (n.row -= 1);
|
|
169
|
+
}), r[a].row = p;
|
|
170
|
+
const m = D(r);
|
|
171
|
+
if (!y(m)) {
|
|
172
|
+
console.warn("交换后的布局无效,恢复原始布局"), s(E);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
s(m);
|
|
338
176
|
return;
|
|
339
177
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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)]);
|
|
178
|
+
if (o === b && $ === x) {
|
|
179
|
+
r[a].row = p, r[a].col = h, r[c].row = u, r[c].col = i;
|
|
180
|
+
const l = D(r);
|
|
181
|
+
if (!y(l)) {
|
|
182
|
+
console.warn("交换后的布局无效,恢复原始布局"), s(E);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
s(l);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}, y = (e) => {
|
|
190
|
+
const t = {};
|
|
191
|
+
e.forEach((o) => {
|
|
192
|
+
t[o.row] || (t[o.row] = []), t[o.row].push(o);
|
|
380
193
|
});
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
194
|
+
for (const o in t) {
|
|
195
|
+
const i = t[o].sort((d, $) => d.col - $.col);
|
|
196
|
+
let u = 1;
|
|
197
|
+
for (const d of i) {
|
|
198
|
+
if (d.col < u)
|
|
199
|
+
return console.warn(
|
|
200
|
+
`行 ${o} 中的元素重叠: 元素 ${d.module} 在列 ${d.col}, 但当前列已经是 ${u}`
|
|
201
|
+
), !1;
|
|
202
|
+
if (u = d.col + d.span, u > 25)
|
|
203
|
+
return console.warn(
|
|
204
|
+
`行 ${o} 中的元素超出界限: 元素 ${d.module} 在列 ${d.col} 跨度 ${d.span}`
|
|
205
|
+
), !1;
|
|
389
206
|
}
|
|
390
|
-
(e !== o.col || t !== o.span) && console.warn(
|
|
391
|
-
`Item layout corrected: col ${e} -> ${o.col}, span ${t} -> ${o.span}`
|
|
392
|
-
);
|
|
393
207
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
208
|
+
return !0;
|
|
209
|
+
};
|
|
210
|
+
return se(async () => {
|
|
211
|
+
await k(), !g.disableDrag && f.value && (f.value.addEventListener("dragstart", W), f.value.addEventListener("dragover", J), f.value.addEventListener("drop", B), f.value.addEventListener("dragend", _));
|
|
212
|
+
}), ie(() => {
|
|
213
|
+
f.value && (f.value.removeEventListener("dragstart", W), f.value.removeEventListener("dragover", J), f.value.removeEventListener("drop", B), f.value.removeEventListener("dragend", _), v && clearTimeout(v));
|
|
214
|
+
}), j({
|
|
215
|
+
setGridItems: (e) => {
|
|
216
|
+
s(e);
|
|
398
217
|
},
|
|
218
|
+
getGridItems: () => JSON.parse(JSON.stringify(I.value)),
|
|
399
219
|
refreshGrid: () => {
|
|
400
220
|
(async () => {
|
|
401
|
-
await
|
|
221
|
+
await k();
|
|
402
222
|
})();
|
|
403
223
|
}
|
|
404
|
-
}), (
|
|
405
|
-
default:
|
|
406
|
-
|
|
224
|
+
}), (e, t) => (M(), ue(G(we), { spinning: C.value }, {
|
|
225
|
+
default: de(() => [
|
|
226
|
+
ce("div", {
|
|
407
227
|
ref_key: "gridContainer",
|
|
408
|
-
ref:
|
|
409
|
-
class:
|
|
410
|
-
style:
|
|
411
|
-
width: typeof
|
|
412
|
-
gap: `${
|
|
228
|
+
ref: f,
|
|
229
|
+
class: q([C.value ? G(F)("loading") : G(F)(), g.customWrapper]),
|
|
230
|
+
style: z({
|
|
231
|
+
width: typeof e.gridWidth == "number" ? `${e.gridWidth}px` : e.gridWidth,
|
|
232
|
+
gap: `${e.gapWidth}px`
|
|
413
233
|
})
|
|
414
234
|
}, [
|
|
415
|
-
(
|
|
416
|
-
key:
|
|
417
|
-
class:
|
|
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")
|
|
423
|
-
]),
|
|
235
|
+
(M(!0), U(ge, null, fe(I.value, (o, i) => (M(), U("div", {
|
|
236
|
+
key: i,
|
|
237
|
+
class: q([G(L)("item"), g.disableDrag ? "" : G(Q)("canDrag")]),
|
|
424
238
|
"data-span": o.span,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
239
|
+
"data-index": i,
|
|
240
|
+
"data-row": o.row,
|
|
241
|
+
"data-col": o.col,
|
|
242
|
+
"data-height": o.height,
|
|
243
|
+
"data-module": o.module,
|
|
244
|
+
style: z([Z(o)]),
|
|
245
|
+
draggable: !g.disableDrag
|
|
432
246
|
}, [
|
|
433
|
-
|
|
247
|
+
pe(e.$slots, "item", {
|
|
434
248
|
item: o,
|
|
435
|
-
index:
|
|
249
|
+
index: i
|
|
436
250
|
})
|
|
437
|
-
],
|
|
251
|
+
], 14, ve))), 128))
|
|
438
252
|
], 6)
|
|
439
253
|
]),
|
|
440
254
|
_: 3
|
|
@@ -442,5 +256,5 @@ const Do = ["data-span", "draggable", "onDragstart"], Co = /* @__PURE__ */ lo({
|
|
|
442
256
|
}
|
|
443
257
|
});
|
|
444
258
|
export {
|
|
445
|
-
|
|
259
|
+
Ee as default
|
|
446
260
|
};
|