@aplus-frontend/ui 6.17.2 → 6.19.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.
- 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.d.ts +31 -2
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
- package/es/src/ap-button/ap-action-button.vue.mjs +11 -7
- package/es/src/ap-button/ap-button.vue.mjs +24 -20
- package/es/src/ap-button/ap-confirm-button.vue.mjs +15 -11
- 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 +21 -18
- 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 +4 -4
- package/es/src/ap-field/date-range/index.vue.mjs +8 -8
- package/es/src/ap-field/index.mjs +36 -36
- package/es/src/ap-field/number/index.vue.d.ts +29 -29
- 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.d.ts +4 -4
- package/es/src/ap-field/rate/index.vue.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +17 -12
- package/es/src/ap-field/select/index.vue.d.ts +97 -97
- package/es/src/ap-field/select/index.vue.mjs +10 -10
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/slider/index.vue.d.ts +8 -8
- 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.d.ts +54 -54
- package/es/src/ap-field/text-area/index.vue.mjs +12 -12
- package/es/src/ap-field/tree-select/index.vue.d.ts +93 -93
- package/es/src/ap-field/tree-select/index.vue.mjs +19 -19
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +14 -15
- package/es/src/ap-form/ap-form.vue2.mjs +2 -2
- package/es/src/ap-form/drawer-form/index.vue.d.ts +18 -19
- 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 +31 -31
- 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 +105 -105
- 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.vue.d.ts +3 -3
- package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +3 -3
- package/es/src/ap-form/items/text/password.vue.mjs +2 -2
- package/es/src/ap-form/items/text-area/index.vue.d.ts +106 -106
- 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 +95 -95
- package/es/src/ap-form/items/tree-select/index.vue.mjs +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +48 -20
- 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.vue.d.ts +29 -10
- 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 +18 -19
- 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 +2 -4
- package/es/src/ap-grid/editable/form-item.vue.mjs +2 -2
- package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ap-grid/editable/index.vue.mjs +2 -2
- package/es/src/ap-grid/index.vue.d.ts +2 -4
- package/es/src/ap-grid/index.vue.mjs +26 -19
- package/es/src/ap-grid/utils/table.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +31 -31
- package/es/src/ap-list/index.vue.d.ts +2 -4
- 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 +2 -4
- package/es/src/ap-table/ap-table.vue2.mjs +13 -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 +331 -331
- 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 +45 -30
- 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 +3 -3
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
- package/es/src/ap-upload/components/Picture.vue.d.ts +2 -7
- 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 +1 -1
- package/es/src/business/ap-batch-action-group/index.d.ts +33 -11
- 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 -19
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +395 -144
- package/es/src/business/ap-draggable-grid/constans.d.ts +0 -8
- package/es/src/business/ap-draggable-grid/constans.mjs +0 -8
- package/es/src/business/ap-draggable-grid/index.d.ts +3 -31
- package/es/src/business/ap-draggable-grid/interface.d.ts +2 -0
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
- package/es/src/business/ap-expand-alert/index.d.ts +4 -6
- 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 +2 -4
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- 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 +17 -5
- 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 +10 -11
- 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 +10 -11
- 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.d.ts +2 -2
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/business/batch-input-group/popover-input/index.vue.d.ts +54 -54
- 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/config-provider-props.d.ts +4 -5
- package/es/src/config-provider/config-provider.d.ts +8 -9
- package/es/src/config-provider/hooks/use-global-config.d.ts +4 -5
- package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +13 -14
- package/es/src/editable-table/form-item.vue.d.ts +2 -4
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.d.ts +2 -4
- package/es/src/editable-table/index.vue.mjs +2 -2
- 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/utils/config-provider-preset.d.ts +5 -6
- 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 +10 -11
- 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-action/item-popconfirm/index.vue.d.ts +31 -2
- package/lib/src/ap-button/ap-action-button.vue.js +1 -1
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-button/ap-confirm-button.vue.js +1 -1
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/number/index.vue.d.ts +29 -29
- package/lib/src/ap-field/rate/index.vue.d.ts +4 -4
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +97 -97
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/slider/index.vue.d.ts +8 -8
- package/lib/src/ap-field/text-area/index.vue.d.ts +54 -54
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.d.ts +93 -93
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +14 -15
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +18 -19
- package/lib/src/ap-form/items/number/index.vue.d.ts +31 -31
- package/lib/src/ap-form/items/select/index.vue.d.ts +105 -105
- package/lib/src/ap-form/items/text/index.vue.d.ts +3 -3
- package/lib/src/ap-form/items/text/password.vue.d.ts +3 -3
- package/lib/src/ap-form/items/text-area/index.vue.d.ts +106 -106
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +95 -95
- package/lib/src/ap-form/modal-form/index.vue.d.ts +48 -20
- package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +29 -10
- package/lib/src/ap-form/search-form/index.vue.d.ts +18 -19
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/table.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +2 -4
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
- package/lib/src/ap-table/constants.d.ts +331 -331
- 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 +3 -3
- package/lib/src/ap-upload/components/Picture.vue.d.ts +2 -7
- package/lib/src/business/ap-batch-action-group/index.d.ts +33 -11
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +3 -19
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-draggable-grid/constans.d.ts +0 -8
- package/lib/src/business/ap-draggable-grid/constans.js +1 -1
- package/lib/src/business/ap-draggable-grid/index.d.ts +3 -31
- package/lib/src/business/ap-draggable-grid/interface.d.ts +2 -0
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/lib/src/business/ap-expand-alert/index.d.ts +4 -6
- package/lib/src/business/ap-select-layout/index.d.ts +2 -4
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/lib/src/business/ap-table-modal/index.d.ts +17 -5
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +10 -11
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +10 -11
- package/lib/src/business/batch-input-group/index.vue.d.ts +2 -2
- package/lib/src/business/batch-input-group/popover-input/index.vue.d.ts +54 -54
- package/lib/src/config-provider/config-provider-props.d.ts +4 -5
- package/lib/src/config-provider/config-provider.d.ts +8 -9
- package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -5
- package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +13 -14
- package/lib/src/editable-table/form-item.vue.d.ts +2 -4
- package/lib/src/editable-table/index.vue.d.ts +2 -4
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/utils/config-provider-preset.d.ts +5 -6
- 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 +10 -11
- package/package.json +3 -3
- package/theme/antdv-override.css +2 -6
- package/theme/antdv-override.less +2 -6
- package/theme/ap-descriptions/ap-descriptions.css +1 -1
- package/theme/ap-descriptions/ap-descriptions.less +1 -1
- package/theme/ap-draggable-grid/ap-draggable-grid.css +4 -3
- package/theme/ap-draggable-grid/ap-draggable-grid.less +4 -2
- package/theme/ap-label/ap-label.css +1 -0
- package/theme/ap-label/ap-label.less +1 -0
- package/theme/ap-tag/ap-tag.css +3 -1
- package/theme/ap-tag/ap-tag.less +3 -1
- package/theme/index.css +11 -11
- package/theme/antd-global-overwrite/admin/alert.css +0 -37
- package/theme/antd-global-overwrite/admin/alert.less +0 -51
- package/theme/antd-global-overwrite/admin/button.css +0 -27
- package/theme/antd-global-overwrite/admin/button.less +0 -31
- package/theme/antd-global-overwrite/admin/field.css +0 -42
- package/theme/antd-global-overwrite/admin/field.less +0 -43
- package/theme/antd-global-overwrite/admin/form.css +0 -57
- package/theme/antd-global-overwrite/admin/form.less +0 -97
- package/theme/antd-global-overwrite/admin/message.css +0 -10
- package/theme/antd-global-overwrite/admin/message.less +0 -13
- package/theme/antd-global-overwrite/admin/modal.css +0 -94
- package/theme/antd-global-overwrite/admin/modal.less +0 -128
- package/theme/antd-global-overwrite/admin/pagination.css +0 -122
- package/theme/antd-global-overwrite/admin/pagination.less +0 -91
- package/theme/antd-global-overwrite/admin/steps.css +0 -127
- package/theme/antd-global-overwrite/admin/steps.less +0 -197
- package/theme/antd-global-overwrite/admin/table.css +0 -78
- package/theme/antd-global-overwrite/admin/table.less +0 -62
- package/theme/antd-global-overwrite/admin/tooltip.css +0 -3
- package/theme/antd-global-overwrite/admin/tooltip.less +0 -3
- package/theme/antd-global-overwrite/aplus/alert.css +0 -40
- package/theme/antd-global-overwrite/aplus/alert.less +0 -55
- package/theme/antd-global-overwrite/aplus/button.css +0 -27
- package/theme/antd-global-overwrite/aplus/button.less +0 -31
- package/theme/antd-global-overwrite/aplus/field.css +0 -42
- package/theme/antd-global-overwrite/aplus/field.less +0 -43
- package/theme/antd-global-overwrite/aplus/form.css +0 -87
- package/theme/antd-global-overwrite/aplus/form.less +0 -133
- package/theme/antd-global-overwrite/aplus/message.css +0 -10
- package/theme/antd-global-overwrite/aplus/message.less +0 -13
- package/theme/antd-global-overwrite/aplus/modal.css +0 -87
- package/theme/antd-global-overwrite/aplus/modal.less +0 -120
- package/theme/antd-global-overwrite/aplus/pagination.css +0 -147
- package/theme/antd-global-overwrite/aplus/pagination.less +0 -108
- package/theme/antd-global-overwrite/aplus/steps.css +0 -125
- package/theme/antd-global-overwrite/aplus/steps.less +0 -198
- package/theme/antd-global-overwrite/aplus/table.css +0 -78
- package/theme/antd-global-overwrite/aplus/table.less +0 -61
- package/theme/antd-global-overwrite/aplus/tooltip.css +0 -3
- package/theme/antd-global-overwrite/aplus/tooltip.less +0 -3
- package/theme/ap-table/ap-table-pagination.css +0 -12
- package/theme/ap-table/ap-table-pagination.less +0 -14
- package/theme/ui-mode.css +0 -60
- package/theme/ui-mode.less +0 -109
|
@@ -1,189 +1,440 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApDraggableGridProps as
|
|
3
|
-
import { Spin as
|
|
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
|
|
6
|
-
const
|
|
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:
|
|
8
|
+
props: yo(),
|
|
9
9
|
emits: ["onGridListChange"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
() =>
|
|
14
|
-
(
|
|
15
|
-
Array.isArray(
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...
|
|
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
|
|
29
|
-
gridColumn: `${
|
|
30
|
-
gridRow:
|
|
31
|
-
minHeight: `${
|
|
32
|
-
boxShadow:
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
45
|
-
const
|
|
46
|
-
(
|
|
47
|
-
span:
|
|
48
|
-
row:
|
|
49
|
-
col:
|
|
50
|
-
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
|
-
|
|
52
|
+
K("onGridListChange", r);
|
|
54
53
|
}
|
|
55
|
-
async function
|
|
56
|
-
if (
|
|
54
|
+
async function _() {
|
|
55
|
+
if (G([]), typeof h.request == "function")
|
|
57
56
|
try {
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
Array.isArray(
|
|
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 (
|
|
64
|
-
console.error("ApDraggableGrid: 请求错误:",
|
|
62
|
+
} catch (r) {
|
|
63
|
+
console.error("ApDraggableGrid: 请求错误:", r);
|
|
65
64
|
} finally {
|
|
66
|
-
|
|
65
|
+
$.value = !1;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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 (!
|
|
79
|
-
const
|
|
80
|
-
document.querySelectorAll(
|
|
81
|
-
).indexOf(
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
const
|
|
88
|
-
|
|
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 (!
|
|
91
|
-
const
|
|
92
|
-
document.querySelectorAll(
|
|
93
|
-
).indexOf(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}),
|
|
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
|
-
|
|
99
|
-
|
|
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
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
e
|
|
115
|
-
)
|
|
116
|
-
|
|
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
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|
125
|
-
const
|
|
126
|
-
|
|
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
|
|
129
|
-
const e =
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
|
142
|
-
setGridItems: (
|
|
143
|
-
|
|
395
|
+
return X({
|
|
396
|
+
setGridItems: (r) => {
|
|
397
|
+
G(r), O(), C();
|
|
144
398
|
},
|
|
145
399
|
refreshGrid: () => {
|
|
146
400
|
(async () => {
|
|
147
|
-
await
|
|
401
|
+
await _(), O(), C();
|
|
148
402
|
})();
|
|
149
403
|
}
|
|
150
|
-
}), (
|
|
151
|
-
default:
|
|
152
|
-
|
|
404
|
+
}), (r, s) => (k(), wo(R(So), { spinning: $.value }, {
|
|
405
|
+
default: go(() => [
|
|
406
|
+
ho("div", {
|
|
153
407
|
ref_key: "gridContainer",
|
|
154
|
-
ref:
|
|
155
|
-
class:
|
|
156
|
-
style:
|
|
157
|
-
width: typeof
|
|
158
|
-
gap: `${
|
|
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
|
-
(
|
|
162
|
-
key:
|
|
163
|
-
class:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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":
|
|
171
|
-
style:
|
|
172
|
-
|
|
173
|
-
|
|
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: !
|
|
177
|
-
onDragstart: (
|
|
178
|
-
onDragend:
|
|
429
|
+
draggable: !h.disableDrag,
|
|
430
|
+
onDragstart: (t) => Z(t, e),
|
|
431
|
+
onDragend: x
|
|
179
432
|
}, [
|
|
180
|
-
|
|
181
|
-
item:
|
|
182
|
-
index:
|
|
183
|
-
}
|
|
184
|
-
|
|
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
|
-
|
|
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
|