v-nuxt-ui 0.1.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/README.md +153 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.json +15 -0
- package/dist/module.mjs +45 -0
- package/dist/runtime/assets/css/main.css +1 -0
- package/dist/runtime/assets/css/transition.css +1 -0
- package/dist/runtime/components/CircleProgress.d.vue.ts +17 -0
- package/dist/runtime/components/CircleProgress.vue +75 -0
- package/dist/runtime/components/CircleProgress.vue.d.ts +17 -0
- package/dist/runtime/components/DeleteModal.d.vue.ts +14 -0
- package/dist/runtime/components/DeleteModal.vue +57 -0
- package/dist/runtime/components/DeleteModal.vue.d.ts +14 -0
- package/dist/runtime/components/Dnd.client.d.vue.ts +25 -0
- package/dist/runtime/components/Dnd.client.vue +47 -0
- package/dist/runtime/components/Dnd.client.vue.d.ts +25 -0
- package/dist/runtime/components/EChart.client.d.vue.ts +19 -0
- package/dist/runtime/components/EChart.client.vue +72 -0
- package/dist/runtime/components/EChart.client.vue.d.ts +19 -0
- package/dist/runtime/components/Empty.d.vue.ts +12 -0
- package/dist/runtime/components/Empty.vue +26 -0
- package/dist/runtime/components/Empty.vue.d.ts +12 -0
- package/dist/runtime/components/PermissionWrapper.d.vue.ts +23 -0
- package/dist/runtime/components/PermissionWrapper.vue +51 -0
- package/dist/runtime/components/PermissionWrapper.vue.d.ts +23 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +26 -0
- package/dist/runtime/components/ScrollArea.vue +201 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +26 -0
- package/dist/runtime/components/Spin.d.vue.ts +16 -0
- package/dist/runtime/components/Spin.vue +22 -0
- package/dist/runtime/components/Spin.vue.d.ts +16 -0
- package/dist/runtime/components/SqlEditor.d.vue.ts +23 -0
- package/dist/runtime/components/SqlEditor.vue +255 -0
- package/dist/runtime/components/SqlEditor.vue.d.ts +23 -0
- package/dist/runtime/components/Watermark.d.vue.ts +44 -0
- package/dist/runtime/components/Watermark.vue +162 -0
- package/dist/runtime/components/Watermark.vue.d.ts +44 -0
- package/dist/runtime/components/badge/CodeModal.client.d.vue.ts +11 -0
- package/dist/runtime/components/badge/CodeModal.client.vue +77 -0
- package/dist/runtime/components/badge/CodeModal.client.vue.d.ts +11 -0
- package/dist/runtime/components/badge/CodeTooltip.client.d.vue.ts +9 -0
- package/dist/runtime/components/badge/CodeTooltip.client.vue +57 -0
- package/dist/runtime/components/badge/CodeTooltip.client.vue.d.ts +9 -0
- package/dist/runtime/components/button/Dropdown.d.vue.ts +31 -0
- package/dist/runtime/components/button/Dropdown.vue +123 -0
- package/dist/runtime/components/button/Dropdown.vue.d.ts +31 -0
- package/dist/runtime/components/button/Theme.d.vue.ts +19 -0
- package/dist/runtime/components/button/Theme.vue +45 -0
- package/dist/runtime/components/button/Theme.vue.d.ts +19 -0
- package/dist/runtime/components/date-picker/Input.d.vue.ts +18 -0
- package/dist/runtime/components/date-picker/Input.vue +39 -0
- package/dist/runtime/components/date-picker/Input.vue.d.ts +18 -0
- package/dist/runtime/components/date-picker/index.d.vue.ts +26 -0
- package/dist/runtime/components/date-picker/index.vue +223 -0
- package/dist/runtime/components/date-picker/index.vue.d.ts +26 -0
- package/dist/runtime/components/flow/FlowEdge.client.d.vue.ts +5 -0
- package/dist/runtime/components/flow/FlowEdge.client.vue +110 -0
- package/dist/runtime/components/flow/FlowEdge.client.vue.d.ts +5 -0
- package/dist/runtime/components/flow/FlowNode.client.d.vue.ts +8 -0
- package/dist/runtime/components/flow/FlowNode.client.vue +79 -0
- package/dist/runtime/components/flow/FlowNode.client.vue.d.ts +8 -0
- package/dist/runtime/components/flow/FlowStats.d.vue.ts +7 -0
- package/dist/runtime/components/flow/FlowStats.vue +17 -0
- package/dist/runtime/components/flow/FlowStats.vue.d.ts +7 -0
- package/dist/runtime/components/flow/FlowToolbar.d.vue.ts +14 -0
- package/dist/runtime/components/flow/FlowToolbar.vue +113 -0
- package/dist/runtime/components/flow/FlowToolbar.vue.d.ts +14 -0
- package/dist/runtime/components/form/create-modal-template/WithApi.d.vue.ts +19 -0
- package/dist/runtime/components/form/create-modal-template/WithApi.vue +36 -0
- package/dist/runtime/components/form/create-modal-template/WithApi.vue.d.ts +19 -0
- package/dist/runtime/components/form/create-modal-template/index.d.vue.ts +19 -0
- package/dist/runtime/components/form/create-modal-template/index.vue +75 -0
- package/dist/runtime/components/form/create-modal-template/index.vue.d.ts +19 -0
- package/dist/runtime/components/form/field/AsyncObjectSelect.d.vue.ts +23 -0
- package/dist/runtime/components/form/field/AsyncObjectSelect.vue +46 -0
- package/dist/runtime/components/form/field/AsyncObjectSelect.vue.d.ts +23 -0
- package/dist/runtime/components/form/field/AsyncSelect.d.vue.ts +26 -0
- package/dist/runtime/components/form/field/AsyncSelect.vue +140 -0
- package/dist/runtime/components/form/field/AsyncSelect.vue.d.ts +26 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.d.vue.ts +27 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.vue +130 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.vue.d.ts +27 -0
- package/dist/runtime/components/form/field/ButtonSwitch.d.vue.ts +19 -0
- package/dist/runtime/components/form/field/ButtonSwitch.vue +29 -0
- package/dist/runtime/components/form/field/ButtonSwitch.vue.d.ts +19 -0
- package/dist/runtime/components/form/field/DatePicker.d.vue.ts +26 -0
- package/dist/runtime/components/form/field/DatePicker.vue +89 -0
- package/dist/runtime/components/form/field/DatePicker.vue.d.ts +26 -0
- package/dist/runtime/components/form/field/DynamicInput.d.vue.ts +14 -0
- package/dist/runtime/components/form/field/DynamicInput.vue +52 -0
- package/dist/runtime/components/form/field/DynamicInput.vue.d.ts +14 -0
- package/dist/runtime/components/form/field/DynamicObjectInput.d.vue.ts +20 -0
- package/dist/runtime/components/form/field/DynamicObjectInput.vue +82 -0
- package/dist/runtime/components/form/field/DynamicObjectInput.vue.d.ts +20 -0
- package/dist/runtime/components/form/field/Input.d.vue.ts +17 -0
- package/dist/runtime/components/form/field/Input.vue +41 -0
- package/dist/runtime/components/form/field/Input.vue.d.ts +17 -0
- package/dist/runtime/components/form/field/InputPassword.d.vue.ts +17 -0
- package/dist/runtime/components/form/field/InputPassword.vue +40 -0
- package/dist/runtime/components/form/field/InputPassword.vue.d.ts +17 -0
- package/dist/runtime/components/form/field/InputStringNumber.d.vue.ts +16 -0
- package/dist/runtime/components/form/field/InputStringNumber.vue +56 -0
- package/dist/runtime/components/form/field/InputStringNumber.vue.d.ts +16 -0
- package/dist/runtime/components/form/field/Select.d.vue.ts +16 -0
- package/dist/runtime/components/form/field/Select.vue +29 -0
- package/dist/runtime/components/form/field/Select.vue.d.ts +16 -0
- package/dist/runtime/components/form/field/SqlEditor.d.vue.ts +10 -0
- package/dist/runtime/components/form/field/SqlEditor.vue +28 -0
- package/dist/runtime/components/form/field/SqlEditor.vue.d.ts +10 -0
- package/dist/runtime/components/form/field/TreeSelectTransfer.d.vue.ts +4 -0
- package/dist/runtime/components/form/field/TreeSelectTransfer.vue +89 -0
- package/dist/runtime/components/form/field/TreeSelectTransfer.vue.d.ts +4 -0
- package/dist/runtime/components/form/field/index.d.vue.ts +26 -0
- package/dist/runtime/components/form/field/index.vue +212 -0
- package/dist/runtime/components/form/field/index.vue.d.ts +26 -0
- package/dist/runtime/components/form/index.d.vue.ts +21 -0
- package/dist/runtime/components/form/index.vue +77 -0
- package/dist/runtime/components/form/index.vue.d.ts +21 -0
- package/dist/runtime/components/layout/ModuleMenu.d.vue.ts +6 -0
- package/dist/runtime/components/layout/ModuleMenu.vue +48 -0
- package/dist/runtime/components/layout/ModuleMenu.vue.d.ts +6 -0
- package/dist/runtime/components/layout/ThemePicker.d.vue.ts +3 -0
- package/dist/runtime/components/layout/ThemePicker.vue +100 -0
- package/dist/runtime/components/layout/ThemePicker.vue.d.ts +3 -0
- package/dist/runtime/components/layout/UserMenu.d.vue.ts +7 -0
- package/dist/runtime/components/layout/UserMenu.vue +77 -0
- package/dist/runtime/components/layout/UserMenu.vue.d.ts +7 -0
- package/dist/runtime/components/layout/default.d.vue.ts +13 -0
- package/dist/runtime/components/layout/default.vue +82 -0
- package/dist/runtime/components/layout/default.vue.d.ts +13 -0
- package/dist/runtime/components/placeholder/Svg.d.vue.ts +3 -0
- package/dist/runtime/components/placeholder/Svg.vue +22 -0
- package/dist/runtime/components/placeholder/Svg.vue.d.ts +3 -0
- package/dist/runtime/components/simple-table/index.d.vue.ts +21 -0
- package/dist/runtime/components/simple-table/index.vue +159 -0
- package/dist/runtime/components/simple-table/index.vue.d.ts +21 -0
- package/dist/runtime/components/table/ExcelExportModal.d.vue.ts +28 -0
- package/dist/runtime/components/table/ExcelExportModal.vue +82 -0
- package/dist/runtime/components/table/ExcelExportModal.vue.d.ts +28 -0
- package/dist/runtime/components/table/Page.d.vue.ts +26 -0
- package/dist/runtime/components/table/Page.vue +130 -0
- package/dist/runtime/components/table/Page.vue.d.ts +26 -0
- package/dist/runtime/components/table/Pagination.d.vue.ts +19 -0
- package/dist/runtime/components/table/Pagination.vue +51 -0
- package/dist/runtime/components/table/Pagination.vue.d.ts +19 -0
- package/dist/runtime/components/table/TooltipCell.d.vue.ts +7 -0
- package/dist/runtime/components/table/TooltipCell.vue +23 -0
- package/dist/runtime/components/table/TooltipCell.vue.d.ts +7 -0
- package/dist/runtime/components/table/column/ActionHeader.d.vue.ts +21 -0
- package/dist/runtime/components/table/column/ActionHeader.vue +155 -0
- package/dist/runtime/components/table/column/ActionHeader.vue.d.ts +21 -0
- package/dist/runtime/components/table/expansion/Field.d.vue.ts +18 -0
- package/dist/runtime/components/table/expansion/Field.vue +33 -0
- package/dist/runtime/components/table/expansion/Field.vue.d.ts +18 -0
- package/dist/runtime/components/table/expansion/Layout.d.vue.ts +13 -0
- package/dist/runtime/components/table/expansion/Layout.vue +8 -0
- package/dist/runtime/components/table/expansion/Layout.vue.d.ts +13 -0
- package/dist/runtime/components/table/header/index.d.vue.ts +19 -0
- package/dist/runtime/components/table/header/index.vue +221 -0
- package/dist/runtime/components/table/header/index.vue.d.ts +19 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.d.vue.ts +32 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.vue +46 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.vue.d.ts +32 -0
- package/dist/runtime/components/table/header/settings/columns/Item.d.vue.ts +18 -0
- package/dist/runtime/components/table/header/settings/columns/Item.vue +59 -0
- package/dist/runtime/components/table/header/settings/columns/Item.vue.d.ts +18 -0
- package/dist/runtime/components/table/header/settings/columns/index.d.vue.ts +24 -0
- package/dist/runtime/components/table/header/settings/columns/index.vue +143 -0
- package/dist/runtime/components/table/header/settings/columns/index.vue.d.ts +24 -0
- package/dist/runtime/components/table/header/settings/index.d.vue.ts +25 -0
- package/dist/runtime/components/table/header/settings/index.vue +35 -0
- package/dist/runtime/components/table/header/settings/index.vue.d.ts +25 -0
- package/dist/runtime/components/table/index.d.vue.ts +26 -0
- package/dist/runtime/components/table/index.vue +121 -0
- package/dist/runtime/components/table/index.vue.d.ts +26 -0
- package/dist/runtime/components/table/query/order/Item.d.vue.ts +28 -0
- package/dist/runtime/components/table/query/order/Item.vue +85 -0
- package/dist/runtime/components/table/query/order/Item.vue.d.ts +28 -0
- package/dist/runtime/components/table/query/order/Newer.d.vue.ts +25 -0
- package/dist/runtime/components/table/query/order/Newer.vue +50 -0
- package/dist/runtime/components/table/query/order/Newer.vue.d.ts +25 -0
- package/dist/runtime/components/table/query/order/index.d.vue.ts +19 -0
- package/dist/runtime/components/table/query/order/index.vue +108 -0
- package/dist/runtime/components/table/query/order/index.vue.d.ts +19 -0
- package/dist/runtime/components/table/query/where/Newer.d.vue.ts +14 -0
- package/dist/runtime/components/table/query/where/Newer.vue +44 -0
- package/dist/runtime/components/table/query/where/Newer.vue.d.ts +14 -0
- package/dist/runtime/components/table/query/where/index.d.vue.ts +21 -0
- package/dist/runtime/components/table/query/where/index.vue +108 -0
- package/dist/runtime/components/table/query/where/index.vue.d.ts +21 -0
- package/dist/runtime/components/table/query/where/simple/index.d.vue.ts +7 -0
- package/dist/runtime/components/table/query/where/simple/index.vue +47 -0
- package/dist/runtime/components/table/query/where/simple/index.vue.d.ts +7 -0
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.d.vue.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue +65 -0
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue.d.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.d.vue.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue +68 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue.d.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/index.d.vue.ts +20 -0
- package/dist/runtime/components/table/query/where/simple/item/index.vue +56 -0
- package/dist/runtime/components/table/query/where/simple/item/index.vue.d.ts +20 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.d.vue.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +152 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue.d.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.d.vue.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue +232 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue.d.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.d.vue.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.vue +57 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.vue.d.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.d.vue.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.vue +45 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.vue.d.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.d.vue.ts +28 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue +62 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue.d.ts +28 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/index.d.vue.ts +19 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +72 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue.d.ts +19 -0
- package/dist/runtime/composables/api/flow/index.d.ts +3 -0
- package/dist/runtime/composables/api/flow/index.js +3 -0
- package/dist/runtime/composables/api/flow/useFlowApi.d.ts +1 -0
- package/dist/runtime/composables/api/flow/useFlowApi.js +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeApi.d.ts +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeApi.js +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeLinkApi.d.ts +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeLinkApi.js +1 -0
- package/dist/runtime/composables/api/index.d.ts +4 -0
- package/dist/runtime/composables/api/index.js +4 -0
- package/dist/runtime/composables/api/sys/index.d.ts +9 -0
- package/dist/runtime/composables/api/sys/index.js +9 -0
- package/dist/runtime/composables/api/sys/useAuthApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useAuthApi.js +13 -0
- package/dist/runtime/composables/api/sys/useCompanyApi.d.ts +1 -0
- package/dist/runtime/composables/api/sys/useCompanyApi.js +3 -0
- package/dist/runtime/composables/api/sys/useDepartmentApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useDepartmentApi.js +30 -0
- package/dist/runtime/composables/api/sys/useJobTitleApi.d.ts +1 -0
- package/dist/runtime/composables/api/sys/useJobTitleApi.js +3 -0
- package/dist/runtime/composables/api/sys/useLoginApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useLoginApi.js +13 -0
- package/dist/runtime/composables/api/sys/useMenuApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useMenuApi.js +32 -0
- package/dist/runtime/composables/api/sys/useRoleApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useRoleApi.js +20 -0
- package/dist/runtime/composables/api/sys/useRowRecord.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useRowRecord.js +8 -0
- package/dist/runtime/composables/api/sys/useUserApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useUserApi.js +39 -0
- package/dist/runtime/composables/api/useApi.d.ts +0 -0
- package/dist/runtime/composables/api/useApi.js +103 -0
- package/dist/runtime/composables/api/useModel.d.ts +3 -0
- package/dist/runtime/composables/api/useModel.js +4 -0
- package/dist/runtime/composables/flow/index.d.ts +3 -0
- package/dist/runtime/composables/flow/index.js +3 -0
- package/dist/runtime/composables/flow/useFlow.d.ts +0 -0
- package/dist/runtime/composables/flow/useFlow.js +162 -0
- package/dist/runtime/composables/flow/useFlowResize.d.ts +56 -0
- package/dist/runtime/composables/flow/useFlowResize.js +148 -0
- package/dist/runtime/composables/flow/useFlowStyles.d.ts +14 -0
- package/dist/runtime/composables/flow/useFlowStyles.js +32 -0
- package/dist/runtime/composables/index.d.ts +13 -0
- package/dist/runtime/composables/index.js +13 -0
- package/dist/runtime/composables/table/index.d.ts +9 -0
- package/dist/runtime/composables/table/index.js +9 -0
- package/dist/runtime/composables/table/useTable.d.ts +0 -0
- package/dist/runtime/composables/table/useTable.js +340 -0
- package/dist/runtime/composables/table/useTableColumns.d.ts +30 -0
- package/dist/runtime/composables/table/useTableColumns.js +214 -0
- package/dist/runtime/composables/table/useTableData.d.ts +29 -0
- package/dist/runtime/composables/table/useTableData.js +92 -0
- package/dist/runtime/composables/table/useTableOpr.d.ts +8 -0
- package/dist/runtime/composables/table/useTableOpr.js +91 -0
- package/dist/runtime/composables/table/useTablePagination.d.ts +7 -0
- package/dist/runtime/composables/table/useTablePagination.js +29 -0
- package/dist/runtime/composables/table/useTableQuery.d.ts +23 -0
- package/dist/runtime/composables/table/useTableQuery.js +131 -0
- package/dist/runtime/composables/table/useTableRowActions.d.ts +18 -0
- package/dist/runtime/composables/table/useTableRowActions.js +154 -0
- package/dist/runtime/composables/table/useTableRowSelection.d.ts +6 -0
- package/dist/runtime/composables/table/useTableRowSelection.js +26 -0
- package/dist/runtime/composables/table/useTableView.d.ts +0 -0
- package/dist/runtime/composables/table/useTableView.js +150 -0
- package/dist/runtime/composables/useApp.d.ts +22 -0
- package/dist/runtime/composables/useApp.js +83 -0
- package/dist/runtime/composables/useAuth.d.ts +14 -0
- package/dist/runtime/composables/useAuth.js +92 -0
- package/dist/runtime/composables/useBoolean.d.ts +58 -0
- package/dist/runtime/composables/useBoolean.js +71 -0
- package/dist/runtime/composables/useDate.d.ts +25 -0
- package/dist/runtime/composables/useDate.js +157 -0
- package/dist/runtime/composables/useEChart.d.ts +103 -0
- package/dist/runtime/composables/useEChart.js +120 -0
- package/dist/runtime/composables/useForm.d.ts +0 -0
- package/dist/runtime/composables/useForm.js +60 -0
- package/dist/runtime/composables/usePermission.d.ts +10 -0
- package/dist/runtime/composables/usePermission.js +53 -0
- package/dist/runtime/composables/useRouterPush.d.ts +8 -0
- package/dist/runtime/composables/useRouterPush.js +37 -0
- package/dist/runtime/composables/useSidebarMenu.d.ts +36 -0
- package/dist/runtime/composables/useSidebarMenu.js +131 -0
- package/dist/runtime/composables/useTheme.d.ts +20 -0
- package/dist/runtime/composables/useTheme.js +94 -0
- package/dist/runtime/constants/columns.d.ts +3 -0
- package/dist/runtime/constants/columns.js +52 -0
- package/dist/runtime/constants/flow.d.ts +12 -0
- package/dist/runtime/constants/flow.js +24 -0
- package/dist/runtime/constants/index.d.ts +6 -0
- package/dist/runtime/constants/index.js +6 -0
- package/dist/runtime/constants/menu.d.ts +9 -0
- package/dist/runtime/constants/menu.js +11 -0
- package/dist/runtime/constants/options.d.ts +8 -0
- package/dist/runtime/constants/options.js +15 -0
- package/dist/runtime/constants/time.d.ts +7 -0
- package/dist/runtime/constants/time.js +12 -0
- package/dist/runtime/constants/user.d.ts +7 -0
- package/dist/runtime/constants/user.js +7 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/01.nuxtUIEnhancement.d.ts +18 -0
- package/dist/runtime/plugins/01.nuxtUIEnhancement.js +52 -0
- package/dist/runtime/plugins/02.dayjs.d.ts +13 -0
- package/dist/runtime/plugins/02.dayjs.js +9 -0
- package/dist/runtime/plugins/03.theme.d.ts +2 -0
- package/dist/runtime/plugins/03.theme.js +33 -0
- package/dist/runtime/plugins/04.head.d.ts +2 -0
- package/dist/runtime/plugins/04.head.js +29 -0
- package/dist/runtime/types/app.d.ts +42 -0
- package/dist/runtime/types/app.js +0 -0
- package/dist/runtime/types/cmds/login.d.ts +23 -0
- package/dist/runtime/types/cmds/sys.d.ts +10 -0
- package/dist/runtime/types/cmds/user.d.ts +8 -0
- package/dist/runtime/types/components/date.d.ts +5 -0
- package/dist/runtime/types/components/date.js +0 -0
- package/dist/runtime/types/components/dnd.d.ts +14 -0
- package/dist/runtime/types/components/dnd.js +0 -0
- package/dist/runtime/types/components/form/field.d.ts +102 -0
- package/dist/runtime/types/components/form/field.js +0 -0
- package/dist/runtime/types/components/form/index.d.ts +27 -0
- package/dist/runtime/types/components/form/index.js +1 -0
- package/dist/runtime/types/components/index.d.ts +4 -0
- package/dist/runtime/types/components/index.js +4 -0
- package/dist/runtime/types/components/table/column.d.ts +35 -0
- package/dist/runtime/types/components/table/column.js +0 -0
- package/dist/runtime/types/components/table/header.d.ts +33 -0
- package/dist/runtime/types/components/table/header.js +0 -0
- package/dist/runtime/types/components/table/index.d.ts +103 -0
- package/dist/runtime/types/components/table/index.js +4 -0
- package/dist/runtime/types/components/table/pagination.d.ts +14 -0
- package/dist/runtime/types/components/table/pagination.js +0 -0
- package/dist/runtime/types/components/table/query/index.d.ts +2 -0
- package/dist/runtime/types/components/table/query/index.js +2 -0
- package/dist/runtime/types/components/table/query/order.d.ts +16 -0
- package/dist/runtime/types/components/table/query/order.js +0 -0
- package/dist/runtime/types/components/table/query/where.d.ts +26 -0
- package/dist/runtime/types/components/table/query/where.js +0 -0
- package/dist/runtime/types/constants/time.d.ts +5 -0
- package/dist/runtime/types/index.d.ts +14 -0
- package/dist/runtime/types/index.js +6 -0
- package/dist/runtime/types/localStorage.d.ts +15 -0
- package/dist/runtime/types/locale.d.ts +81 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/models/base.d.ts +16 -0
- package/dist/runtime/types/models/flow.d.ts +31 -0
- package/dist/runtime/types/models/sys.d.ts +107 -0
- package/dist/runtime/types/query.d.ts +45 -0
- package/dist/runtime/types/query.js +1 -0
- package/dist/runtime/types/request.d.ts +55 -0
- package/dist/runtime/types/request.js +22 -0
- package/dist/runtime/types/storage.d.ts +10 -0
- package/dist/runtime/types/storage.js +11 -0
- package/dist/runtime/utils/array.d.ts +1 -0
- package/dist/runtime/utils/array.js +3 -0
- package/dist/runtime/utils/diff.d.ts +2 -0
- package/dist/runtime/utils/diff.js +81 -0
- package/dist/runtime/utils/download/index.d.ts +1 -0
- package/dist/runtime/utils/download/index.js +1 -0
- package/dist/runtime/utils/download/tagA.d.ts +2 -0
- package/dist/runtime/utils/download/tagA.js +14 -0
- package/dist/runtime/utils/emoji.d.ts +1 -0
- package/dist/runtime/utils/emoji.js +57 -0
- package/dist/runtime/utils/excel.d.ts +3 -0
- package/dist/runtime/utils/excel.js +63 -0
- package/dist/runtime/utils/form.d.ts +2 -0
- package/dist/runtime/utils/form.js +142 -0
- package/dist/runtime/utils/index.d.ts +11 -0
- package/dist/runtime/utils/index.js +11 -0
- package/dist/runtime/utils/request.d.ts +3 -0
- package/dist/runtime/utils/request.js +3 -0
- package/dist/runtime/utils/string.d.ts +6 -0
- package/dist/runtime/utils/string.js +18 -0
- package/dist/runtime/utils/tree.d.ts +8 -0
- package/dist/runtime/utils/tree.js +54 -0
- package/dist/runtime/utils/type.d.ts +1 -0
- package/dist/runtime/utils/type.js +3 -0
- package/dist/runtime/utils/vueuse.d.ts +1 -0
- package/dist/runtime/utils/vueuse.js +20 -0
- package/dist/types.d.mts +3 -0
- package/package.json +108 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SelectOption, WhereQueryOpr, WhereQueryType } from '#v/types';
|
|
2
|
+
export declare const useTableOpr: () => {
|
|
3
|
+
getOprListByType: (type: WhereQueryType) => WhereQueryOpr[];
|
|
4
|
+
getDefaultOprByType: (type: WhereQueryType | undefined) => WhereQueryOpr;
|
|
5
|
+
getOprNameMapByType: (type: WhereQueryType) => Map<WhereQueryOpr, string>;
|
|
6
|
+
getOprNameOptionsByType: (type: WhereQueryType) => SelectOption[];
|
|
7
|
+
getOprNameByTypeAndOpr: (type: WhereQueryType, opr: WhereQueryOpr) => string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
2
|
+
const _useTableOpr = () => {
|
|
3
|
+
const oprMap = /* @__PURE__ */ new Map([
|
|
4
|
+
["input", ["eq", "ne", "like", "not_like", "start_like", "end_like", "is_empty", "is_not_empty"]],
|
|
5
|
+
["input-number", ["eq", "ne", "gt", "gte", "lt", "lte"]],
|
|
6
|
+
["select", ["in", "not_in"]],
|
|
7
|
+
["async-select", ["in", "not_in"]],
|
|
8
|
+
["date-picker", ["range_gte_lte", "lt", "lte", "gt", "gte", "is_null", "is_not_null"]]
|
|
9
|
+
]);
|
|
10
|
+
const getOprListByType = (type) => {
|
|
11
|
+
return oprMap.get(type) || [];
|
|
12
|
+
};
|
|
13
|
+
const defaultOprMap = /* @__PURE__ */ new Map([
|
|
14
|
+
["input", "like"],
|
|
15
|
+
["input-number", "eq"],
|
|
16
|
+
["select", "in"],
|
|
17
|
+
["async-select", "in"],
|
|
18
|
+
["date-picker", "range_gte_lte"]
|
|
19
|
+
]);
|
|
20
|
+
const getDefaultOprByType = (type) => {
|
|
21
|
+
return type ? defaultOprMap.get(type) || "eq" : "eq";
|
|
22
|
+
};
|
|
23
|
+
const inputNameMap = /* @__PURE__ */ new Map([
|
|
24
|
+
["eq", "\u7B49\u4E8E"],
|
|
25
|
+
["ne", "\u4E0D\u7B49\u4E8E"],
|
|
26
|
+
["like", "\u5305\u542B"],
|
|
27
|
+
["not_like", "\u4E0D\u5305\u542B"],
|
|
28
|
+
["start_like", "\u4EE5...\u5F00\u59CB"],
|
|
29
|
+
["end_like", "\u4EE5...\u7ED3\u675F"],
|
|
30
|
+
["is_empty", "\u4E3A\u7A7A"],
|
|
31
|
+
["is_not_empty", "\u4E0D\u4E3A\u7A7A"],
|
|
32
|
+
["text_arr_str_like", "\u5305\u542B"]
|
|
33
|
+
// 这个操作符是为了支持text-arr-input类型的输入,表示输入的多个值中包含任意一个即可
|
|
34
|
+
]);
|
|
35
|
+
const inputNumberNameMap = /* @__PURE__ */ new Map([
|
|
36
|
+
["eq", "="],
|
|
37
|
+
["ne", "\u2260"],
|
|
38
|
+
["gt", ">"],
|
|
39
|
+
["gte", "\u2265"],
|
|
40
|
+
["lt", "<"],
|
|
41
|
+
["lte", "\u2264"]
|
|
42
|
+
]);
|
|
43
|
+
const selectNameMap = /* @__PURE__ */ new Map([
|
|
44
|
+
["in", "\u5305\u542B"],
|
|
45
|
+
["not_in", "\u4E0D\u5305\u542B"]
|
|
46
|
+
]);
|
|
47
|
+
const datePickerNameMap = /* @__PURE__ */ new Map([
|
|
48
|
+
["range_gte_lte", "\u8303\u56F4"],
|
|
49
|
+
["lt", "\u65E9\u4E8E"],
|
|
50
|
+
["lte", "\u65E9\u4E8E\u7B49\u4E8E"],
|
|
51
|
+
["gt", "\u665A\u4E8E"],
|
|
52
|
+
["gte", "\u665A\u4E8E\u7B49\u4E8E"],
|
|
53
|
+
["is_null", "\u4E3A\u7A7A"],
|
|
54
|
+
["is_not_null", "\u4E0D\u4E3A\u7A7A"]
|
|
55
|
+
]);
|
|
56
|
+
const getOprNameMapByType = (type) => {
|
|
57
|
+
switch (type) {
|
|
58
|
+
case "input":
|
|
59
|
+
return inputNameMap;
|
|
60
|
+
case "input-number":
|
|
61
|
+
return inputNumberNameMap;
|
|
62
|
+
case "select":
|
|
63
|
+
case "async-select":
|
|
64
|
+
return selectNameMap;
|
|
65
|
+
case "date-picker":
|
|
66
|
+
return datePickerNameMap;
|
|
67
|
+
default:
|
|
68
|
+
return /* @__PURE__ */ new Map();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const getOprNameOptionsByType = (type) => {
|
|
72
|
+
const nameMap = getOprNameMapByType(type);
|
|
73
|
+
const oprList = getOprListByType(type);
|
|
74
|
+
return oprList.map((opr) => ({
|
|
75
|
+
label: nameMap.get(opr) ?? opr ?? "\u672A\u77E5\u64CD\u4F5C\u7B26",
|
|
76
|
+
value: opr
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
const getOprNameByTypeAndOpr = (type, opr) => {
|
|
80
|
+
const nameMap = getOprNameMapByType(type);
|
|
81
|
+
return nameMap.get(opr) || "\u672A\u77E5\u64CD\u4F5C\u7B26";
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
getOprListByType,
|
|
85
|
+
getDefaultOprByType,
|
|
86
|
+
getOprNameMapByType,
|
|
87
|
+
getOprNameOptionsByType,
|
|
88
|
+
getOprNameByTypeAndOpr
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export const useTableOpr = createSharedComposable(_useTableOpr);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { DropdownMenuItem } from '@nuxt/ui';
|
|
3
|
+
import type { Pagination } from '#v/types';
|
|
4
|
+
export declare function useTablePagination(localStgSettings: Ref<LocalStorage.TableSettings<any>>): {
|
|
5
|
+
pagination: Ref<Pagination, Pagination>;
|
|
6
|
+
pageSizeDropdownMenuItems: import("vue").ComputedRef<DropdownMenuItem[]>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
const defaultPageSize = 10;
|
|
3
|
+
const pageSizeOptions = [5, 10, 20, 50, 100];
|
|
4
|
+
export function useTablePagination(localStgSettings) {
|
|
5
|
+
const pageSize = computed({
|
|
6
|
+
get: () => localStgSettings.value.pageSize ?? defaultPageSize,
|
|
7
|
+
set: (pageSize2) => localStgSettings.value = { ...localStgSettings.value, pageSize: pageSize2 }
|
|
8
|
+
});
|
|
9
|
+
const pagination = ref({
|
|
10
|
+
pageNum: 1,
|
|
11
|
+
pageSize: pageSize.value
|
|
12
|
+
});
|
|
13
|
+
const pageSizeDropdownMenuItems = computed(
|
|
14
|
+
() => pageSizeOptions.map((size) => ({
|
|
15
|
+
label: `${size} / \u9875`,
|
|
16
|
+
value: size,
|
|
17
|
+
type: "checkbox",
|
|
18
|
+
checked: pagination.value.pageSize === size,
|
|
19
|
+
onSelect: () => {
|
|
20
|
+
pagination.value.pageSize = size;
|
|
21
|
+
pageSize.value = size;
|
|
22
|
+
}
|
|
23
|
+
}))
|
|
24
|
+
);
|
|
25
|
+
return {
|
|
26
|
+
pagination,
|
|
27
|
+
pageSizeDropdownMenuItems
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OrderQueryOption, WhereQueryOption, VColumn, OrderQuery, WhereQuery, WhereQueryItem, WhereQueryItemGroup } from '#v/types';
|
|
2
|
+
export declare function useTableQuery<T>(props: {
|
|
3
|
+
name: string;
|
|
4
|
+
bizColumns: VColumn<T>[];
|
|
5
|
+
extraWhereQueryOptions?: WhereQueryOption<T>[];
|
|
6
|
+
extraWhereQueryInitValues?: Partial<WhereQuery<T>>;
|
|
7
|
+
extraOrderQueryOptions?: OrderQueryOption<T>[];
|
|
8
|
+
}): {
|
|
9
|
+
whereQueryOptions: import("vue").ComputedRef<WhereQueryOption<T>[]>;
|
|
10
|
+
whereQueryInitValues: import("vue").ComputedRef<WhereQuery<T>>;
|
|
11
|
+
orderQueryOptions: import("vue").ComputedRef<OrderQueryOption<T>[]>;
|
|
12
|
+
orderQueryInitValues: import("vue").ComputedRef<OrderQuery<T>>;
|
|
13
|
+
initStorageColumns: import("vue").ComputedRef<LocalStorage.Column[]>;
|
|
14
|
+
localStgSettings: import("@vueuse/core").RemovableRef<LocalStorage.TableSettings<T>>;
|
|
15
|
+
whereQuery: import("vue").WritableComputedRef<WhereQuery<T> | undefined, WhereQuery<T> | undefined>;
|
|
16
|
+
whereQueryOpen: import("vue").WritableComputedRef<boolean, boolean>;
|
|
17
|
+
orderQuery: import("vue").WritableComputedRef<OrderQuery<T>, OrderQuery<T>>;
|
|
18
|
+
isWhereQueryValueEmpty: import("vue").ComputedRef<boolean>;
|
|
19
|
+
pruneWhereQuery: (query: WhereQuery<T> | undefined) => {
|
|
20
|
+
items: WhereQueryItem<T>[];
|
|
21
|
+
groups: WhereQueryItemGroup<T>[];
|
|
22
|
+
} | undefined;
|
|
23
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useLocalStorage } from "@vueuse/core";
|
|
3
|
+
import { noValueOprList } from "#v/types";
|
|
4
|
+
import { defu } from "defu";
|
|
5
|
+
import { useTableOpr } from "./useTableOpr.js";
|
|
6
|
+
import { cloneJson } from "#v/utils";
|
|
7
|
+
export function useTableQuery(props) {
|
|
8
|
+
const { name, bizColumns, extraWhereQueryOptions, extraWhereQueryInitValues, extraOrderQueryOptions } = props;
|
|
9
|
+
const whereQueryOptions = computed(() => {
|
|
10
|
+
const options = bizColumns.filter((col) => col.filterOption).map((col) => ({
|
|
11
|
+
field: col.accessorKey,
|
|
12
|
+
label: col.header,
|
|
13
|
+
...col.filterOption
|
|
14
|
+
}));
|
|
15
|
+
extraWhereQueryOptions?.forEach((option) => {
|
|
16
|
+
options.unshift(option);
|
|
17
|
+
});
|
|
18
|
+
return options;
|
|
19
|
+
});
|
|
20
|
+
const whereQueryInitValues = computed(() => {
|
|
21
|
+
const initValues = {
|
|
22
|
+
items: whereQueryOptions.value.filter((option) => option.initValues !== void 0 && option.initValues !== null || option.initHide === false).map((option) => ({
|
|
23
|
+
field: option.field,
|
|
24
|
+
opr: option.defaultOpr ?? useTableOpr().getDefaultOprByType(option.type),
|
|
25
|
+
value: option.initValues ?? null,
|
|
26
|
+
custom: option.custom
|
|
27
|
+
}))
|
|
28
|
+
};
|
|
29
|
+
return defu(initValues, extraWhereQueryInitValues ?? {});
|
|
30
|
+
});
|
|
31
|
+
const orderQueryOptions = computed(() => {
|
|
32
|
+
const options = bizColumns.filter((col) => col.sortOption).map((col) => ({
|
|
33
|
+
field: col["accessorKey"],
|
|
34
|
+
label: col.header,
|
|
35
|
+
defaultOpr: col.sortOption === true ? null : col.sortOption?.defaultOpr
|
|
36
|
+
}));
|
|
37
|
+
extraOrderQueryOptions?.forEach((option) => {
|
|
38
|
+
options.push(option);
|
|
39
|
+
});
|
|
40
|
+
return options;
|
|
41
|
+
});
|
|
42
|
+
const orderQueryInitValues = computed(() => {
|
|
43
|
+
return orderQueryOptions.value.filter((option) => option.defaultOpr).map((option) => ({ field: option.field, order: option.defaultOpr ?? "desc" }));
|
|
44
|
+
});
|
|
45
|
+
const initStorageColumns = computed(
|
|
46
|
+
() => bizColumns.map((col) => ({
|
|
47
|
+
accessorKey: col["accessorKey"],
|
|
48
|
+
fixed: "unfixed",
|
|
49
|
+
checked: !col.initHide
|
|
50
|
+
}))
|
|
51
|
+
);
|
|
52
|
+
const localStgSettings = useLocalStorage(`${name}-table-settings`, {
|
|
53
|
+
columns: initStorageColumns.value,
|
|
54
|
+
pageSize: 10,
|
|
55
|
+
whereQuery: whereQueryInitValues.value,
|
|
56
|
+
orderQuery: orderQueryInitValues.value
|
|
57
|
+
});
|
|
58
|
+
const whereQuery = computed({
|
|
59
|
+
get: () => localStgSettings.value.whereQuery ?? whereQueryInitValues.value,
|
|
60
|
+
set: (query) => localStgSettings.value = { ...localStgSettings.value, whereQuery: query }
|
|
61
|
+
});
|
|
62
|
+
const whereQueryOpen = computed({
|
|
63
|
+
get: () => localStgSettings.value.whereQueryOpen ?? false,
|
|
64
|
+
set: (open) => localStgSettings.value = { ...localStgSettings.value, whereQueryOpen: open }
|
|
65
|
+
});
|
|
66
|
+
const orderQuery = computed({
|
|
67
|
+
get: () => localStgSettings.value.orderQuery ?? [],
|
|
68
|
+
set: (query) => localStgSettings.value = { ...localStgSettings.value, orderQuery: query }
|
|
69
|
+
});
|
|
70
|
+
const checkIfWhereQueryItemsValueEmpty = (items) => {
|
|
71
|
+
const itemsWithOprNoValues = items.filter((item) => noValueOprList.includes(item.opr));
|
|
72
|
+
if (itemsWithOprNoValues.length > 0) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return !items.filter((item) => !noValueOprList.includes(item.opr)).some((item) => item.value !== null && item.value !== void 0 && item.value !== "");
|
|
76
|
+
};
|
|
77
|
+
const checkIfWhereQueryGroupsValueEmpty = (groups) => {
|
|
78
|
+
for (const group of groups) {
|
|
79
|
+
if (!checkIfWhereQueryItemsValueEmpty(group.items ?? [])) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (!checkIfWhereQueryGroupsValueEmpty(group.groups ?? [])) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
};
|
|
88
|
+
const isWhereQueryValueEmpty = computed(() => {
|
|
89
|
+
return checkIfWhereQueryItemsValueEmpty(
|
|
90
|
+
whereQuery.value?.items?.filter(
|
|
91
|
+
(query) => whereQueryOptions.value.find((option) => option.field === query.field)
|
|
92
|
+
) ?? []
|
|
93
|
+
) && checkIfWhereQueryGroupsValueEmpty(whereQuery.value?.groups ?? []);
|
|
94
|
+
});
|
|
95
|
+
const pruneWhereQuery = (query) => {
|
|
96
|
+
if (!query) return void 0;
|
|
97
|
+
const clonedQuery = cloneJson(query);
|
|
98
|
+
const prunedItems = clonedQuery.items?.filter((item) => {
|
|
99
|
+
if (noValueOprList.includes(item.opr)) {
|
|
100
|
+
return true;
|
|
101
|
+
} else {
|
|
102
|
+
return item.value !== null && item.value !== void 0 && item.value !== "";
|
|
103
|
+
}
|
|
104
|
+
}).map((item) => {
|
|
105
|
+
const newItem = { ...item };
|
|
106
|
+
delete newItem.extraData;
|
|
107
|
+
return newItem;
|
|
108
|
+
});
|
|
109
|
+
const prunedGroups = clonedQuery.groups?.map(
|
|
110
|
+
(group) => pruneWhereQuery({ items: group.items, groups: group.groups })
|
|
111
|
+
).filter(Boolean);
|
|
112
|
+
return {
|
|
113
|
+
...clonedQuery,
|
|
114
|
+
items: prunedItems,
|
|
115
|
+
groups: prunedGroups
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
whereQueryOptions,
|
|
120
|
+
whereQueryInitValues,
|
|
121
|
+
orderQueryOptions,
|
|
122
|
+
orderQueryInitValues,
|
|
123
|
+
initStorageColumns,
|
|
124
|
+
localStgSettings,
|
|
125
|
+
whereQuery,
|
|
126
|
+
whereQueryOpen,
|
|
127
|
+
orderQuery,
|
|
128
|
+
isWhereQueryValueEmpty,
|
|
129
|
+
pruneWhereQuery
|
|
130
|
+
};
|
|
131
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { VColumn } from '#v/types';
|
|
2
|
+
import type { DropdownMenuItem, TableRow } from '@nuxt/ui';
|
|
3
|
+
export declare function useTableRowActions<T>(props: {
|
|
4
|
+
rowKey: keyof T;
|
|
5
|
+
disableRowActions?: boolean;
|
|
6
|
+
disableRowUpdate?: boolean;
|
|
7
|
+
disableRowCopy?: boolean;
|
|
8
|
+
disableRowDeletion?: boolean;
|
|
9
|
+
onEditRowFromModal?: (...args: any[]) => any;
|
|
10
|
+
extraRowActions?: any[];
|
|
11
|
+
useApiGroup?: (...args: any[]) => any;
|
|
12
|
+
customRowCopyFn?: (...args: any[]) => any;
|
|
13
|
+
fetchList: () => Promise<void>;
|
|
14
|
+
}): {
|
|
15
|
+
getRowActions: (row: TableRow<T>) => DropdownMenuItem[];
|
|
16
|
+
generateActionColumn: () => VColumn<T>;
|
|
17
|
+
actionLoadingRowIdxSet: import("vue").Ref<Set<number> & Omit<Set<number>, keyof Set<any>>, Set<number> | (Set<number> & Omit<Set<number>, keyof Set<any>>)>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { ref, h } from "vue";
|
|
2
|
+
import { useOverlay } from "@nuxt/ui/composables";
|
|
3
|
+
import DeleteModal from "#v/components/DeleteModal.vue";
|
|
4
|
+
import UDropdownMenu from "@nuxt/ui/components/DropdownMenu.vue";
|
|
5
|
+
import UButton from "@nuxt/ui/components/Button.vue";
|
|
6
|
+
export function useTableRowActions(props) {
|
|
7
|
+
const {
|
|
8
|
+
rowKey,
|
|
9
|
+
disableRowActions: _disableRowActions,
|
|
10
|
+
disableRowUpdate,
|
|
11
|
+
disableRowCopy,
|
|
12
|
+
disableRowDeletion,
|
|
13
|
+
onEditRowFromModal,
|
|
14
|
+
extraRowActions,
|
|
15
|
+
useApiGroup,
|
|
16
|
+
customRowCopyFn,
|
|
17
|
+
fetchList
|
|
18
|
+
} = props;
|
|
19
|
+
const overlay = useOverlay();
|
|
20
|
+
const deleteModal = overlay.create(DeleteModal);
|
|
21
|
+
const apiGroup = useApiGroup?.();
|
|
22
|
+
const actionLoadingRowIdxSet = ref(/* @__PURE__ */ new Set());
|
|
23
|
+
function getRowActions(row) {
|
|
24
|
+
const actionItems = [];
|
|
25
|
+
if (!disableRowUpdate && onEditRowFromModal) {
|
|
26
|
+
actionItems.push({
|
|
27
|
+
label: "\u7F16\u8F91",
|
|
28
|
+
icon: "i-lucide-clipboard-pen-line",
|
|
29
|
+
onClick: async () => {
|
|
30
|
+
const result = await onEditRowFromModal(row.original);
|
|
31
|
+
if (result) {
|
|
32
|
+
await fetchList();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (!disableRowCopy && onEditRowFromModal) {
|
|
38
|
+
const copyFn = customRowCopyFn ?? apiGroup?.copy;
|
|
39
|
+
actionItems.push({
|
|
40
|
+
label: "\u590D\u5236",
|
|
41
|
+
icon: "i-lucide-clipboard-plus",
|
|
42
|
+
onClick: async () => {
|
|
43
|
+
const result = await onEditRowFromModal(copyFn(row.original));
|
|
44
|
+
if (result) {
|
|
45
|
+
await fetchList();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
extraRowActions?.forEach((action) => {
|
|
51
|
+
actionItems.push({
|
|
52
|
+
label: action.label,
|
|
53
|
+
icon: action.icon,
|
|
54
|
+
type: action.type,
|
|
55
|
+
color: action.color,
|
|
56
|
+
onClick: async () => {
|
|
57
|
+
if (action.fn) {
|
|
58
|
+
action.fn(row.original);
|
|
59
|
+
if (action.refetchAfterFn) {
|
|
60
|
+
await fetchList();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (action.asyncFn) {
|
|
64
|
+
actionLoadingRowIdxSet.value.add(row.index);
|
|
65
|
+
try {
|
|
66
|
+
await action.asyncFn(row.original);
|
|
67
|
+
} finally {
|
|
68
|
+
actionLoadingRowIdxSet.value.delete(row.index);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (action.fnWithModal) {
|
|
72
|
+
const result = await action.fnWithModal(row.original);
|
|
73
|
+
if (result) {
|
|
74
|
+
await fetchList();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
if (!disableRowDeletion) {
|
|
81
|
+
if (actionItems.length > 0) {
|
|
82
|
+
actionItems.push({ type: "separator" });
|
|
83
|
+
}
|
|
84
|
+
actionItems.push({
|
|
85
|
+
label: "\u5220\u9664",
|
|
86
|
+
icon: "i-lucide-trash-2",
|
|
87
|
+
color: "error",
|
|
88
|
+
onSelect: async () => {
|
|
89
|
+
const result = await deleteModal.open({
|
|
90
|
+
ids: [row.original[rowKey]],
|
|
91
|
+
onDelete: (ids) => apiGroup?.batchDelete({ ids })
|
|
92
|
+
}).result;
|
|
93
|
+
if (result) {
|
|
94
|
+
await fetchList();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
actionItems.unshift({
|
|
100
|
+
type: "label",
|
|
101
|
+
label: "\u64CD\u4F5C"
|
|
102
|
+
});
|
|
103
|
+
return actionItems;
|
|
104
|
+
}
|
|
105
|
+
function generateActionColumn() {
|
|
106
|
+
return {
|
|
107
|
+
id: "actions",
|
|
108
|
+
accessorKey: "actions",
|
|
109
|
+
header: "\u64CD\u4F5C",
|
|
110
|
+
meta: {
|
|
111
|
+
class: {
|
|
112
|
+
th: "w-15 min-w-15 px-4"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
cell: ({ row }) => {
|
|
116
|
+
return h(
|
|
117
|
+
"div",
|
|
118
|
+
{ class: "text-center" },
|
|
119
|
+
h(
|
|
120
|
+
UDropdownMenu,
|
|
121
|
+
{
|
|
122
|
+
content: {
|
|
123
|
+
align: "end"
|
|
124
|
+
},
|
|
125
|
+
items: getRowActions(row)
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"default": () => h(UButton, {
|
|
129
|
+
icon: "i-lucide-ellipsis",
|
|
130
|
+
color: "neutral",
|
|
131
|
+
variant: "ghost",
|
|
132
|
+
size: "sm",
|
|
133
|
+
loading: actionLoadingRowIdxSet.value.has(row.index),
|
|
134
|
+
class: "ml-auto"
|
|
135
|
+
}),
|
|
136
|
+
"item": () => null,
|
|
137
|
+
"item-leading": () => null,
|
|
138
|
+
"item-label": () => null,
|
|
139
|
+
"item-description": () => null,
|
|
140
|
+
"item-trailing": () => null,
|
|
141
|
+
"content-top": () => null,
|
|
142
|
+
"content-bottom": () => null
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
getRowActions,
|
|
151
|
+
generateActionColumn,
|
|
152
|
+
actionLoadingRowIdxSet
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export declare function useTableRowSelection<T>(data: Ref<T[]>, rowKey: keyof T): {
|
|
3
|
+
rowSelection: Ref<Record<number, boolean> | undefined, Record<number, boolean> | undefined>;
|
|
4
|
+
selectedIds: Ref<number[], number[]>;
|
|
5
|
+
clearRowSelection: () => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
export function useTableRowSelection(data, rowKey) {
|
|
3
|
+
const rowSelection = ref();
|
|
4
|
+
const selectedIds = ref([]);
|
|
5
|
+
watch(
|
|
6
|
+
rowSelection,
|
|
7
|
+
(newRowSelection) => {
|
|
8
|
+
if (!newRowSelection) {
|
|
9
|
+
selectedIds.value = [];
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const filteredRowSelection = Object.entries(newRowSelection).filter(([_, selected]) => selected);
|
|
13
|
+
selectedIds.value = filteredRowSelection.map(([idx]) => data.value[Number(idx)]?.[rowKey]);
|
|
14
|
+
},
|
|
15
|
+
{ deep: true }
|
|
16
|
+
);
|
|
17
|
+
const clearRowSelection = () => {
|
|
18
|
+
rowSelection.value = {};
|
|
19
|
+
selectedIds.value = [];
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
rowSelection,
|
|
23
|
+
selectedIds,
|
|
24
|
+
clearRowSelection
|
|
25
|
+
};
|
|
26
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ref, computed, watch, onMounted, onUnmounted, nextTick, useTemplateRef } from "vue";
|
|
2
|
+
import { useTable } from "./useTable.js";
|
|
3
|
+
const PINNED_SHADOW_CLASSES = {
|
|
4
|
+
left: {
|
|
5
|
+
base: "[&_th[data-pinned=left]]:after:absolute [&_th[data-pinned=left]]:after:top-0 [&_th[data-pinned=left]]:after:right-0 [&_th[data-pinned=left]]:after:bottom-0 [&_th[data-pinned=left]]:after:w-[30px] [&_th[data-pinned=left]]:after:translate-x-full [&_th[data-pinned=left]]:after:transition-opacity [&_th[data-pinned=left]]:after:duration-300 [&_th[data-pinned=left]]:after:pointer-events-none [&_th[data-pinned=left]]:after:shadow-[inset_10px_0_8px_-8px_rgba(0,0,0,0.15)] [&_td[data-pinned=left]]:after:absolute [&_td[data-pinned=left]]:after:top-0 [&_td[data-pinned=left]]:after:right-0 [&_td[data-pinned=left]]:after:bottom-0 [&_td[data-pinned=left]]:after:w-[30px] [&_td[data-pinned=left]]:after:translate-x-full [&_td[data-pinned=left]]:after:transition-opacity [&_td[data-pinned=left]]:after:duration-200 [&_td[data-pinned=left]]:after:pointer-events-none [&_td[data-pinned=left]]:after:shadow-[inset_10px_0_8px_-8px_rgba(0,0,0,0.15)]",
|
|
6
|
+
show: "[&_th[data-pinned=left]]:after:opacity-100 [&_td[data-pinned=left]]:after:opacity-100",
|
|
7
|
+
hide: "[&_th[data-pinned=left]]:after:opacity-0 [&_td[data-pinned=left]]:after:opacity-0"
|
|
8
|
+
},
|
|
9
|
+
right: {
|
|
10
|
+
base: "[&_th[data-pinned=right]]:before:absolute [&_th[data-pinned=right]]:before:top-0 [&_th[data-pinned=right]]:before:left-0 [&_th[data-pinned=right]]:before:bottom-0 [&_th[data-pinned=right]]:before:w-[30px] [&_th[data-pinned=right]]:before:-translate-x-full [&_th[data-pinned=right]]:before:transition-opacity [&_th[data-pinned=right]]:before:duration-300 [&_th[data-pinned=right]]:before:pointer-events-none [&_th[data-pinned=right]]:before:shadow-[inset_-10px_0_8px_-8px_rgba(0,0,0,0.15)] [&_td[data-pinned=right]]:before:absolute [&_td[data-pinned=right]]:before:top-0 [&_td[data-pinned=right]]:before:left-0 [&_td[data-pinned=right]]:before:bottom-0 [&_td[data-pinned=right]]:before:w-[30px] [&_td[data-pinned=right]]:before:-translate-x-full [&_td[data-pinned=right]]:before:transition-opacity [&_td[data-pinned=right]]:before:duration-200 [&_td[data-pinned=right]]:before:pointer-events-none [&_td[data-pinned=right]]:before:shadow-[inset_-10px_0_8px_-8px_rgba(0,0,0,0.15)]",
|
|
11
|
+
show: "[&_th[data-pinned=right]]:before:opacity-100 [&_td[data-pinned=right]]:before:opacity-100",
|
|
12
|
+
hide: "[&_th[data-pinned=right]]:before:opacity-0 [&_td[data-pinned=right]]:before:opacity-0"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const EXPANDED_STICKY_CLASS = "[&_tr[data-expanded=true]]:sticky [&_tr[data-expanded=true]]:top-[calc(var(--ui-table-header-height)+1px)] [&_tr[data-expanded=true]]:z-1 [&_tr[data-expanded=true]]:bg-default";
|
|
16
|
+
export function useProTableView(props) {
|
|
17
|
+
const {
|
|
18
|
+
data,
|
|
19
|
+
createRow,
|
|
20
|
+
updateRow,
|
|
21
|
+
deleteRow,
|
|
22
|
+
stats,
|
|
23
|
+
fetchList,
|
|
24
|
+
rowSelection,
|
|
25
|
+
onUpdateRowSelection,
|
|
26
|
+
tblProps,
|
|
27
|
+
tblWhereQueryProps,
|
|
28
|
+
tblHeaderProps,
|
|
29
|
+
tblPaginationProps,
|
|
30
|
+
tblContextMenuItems
|
|
31
|
+
} = useTable(props);
|
|
32
|
+
const thClass = computed(() => {
|
|
33
|
+
const classList = [];
|
|
34
|
+
if (!props.singleRow) {
|
|
35
|
+
classList.push("[&:has([role=checkbox])]:pe-2");
|
|
36
|
+
}
|
|
37
|
+
if (!props.singleColumn) {
|
|
38
|
+
classList.push("border-b");
|
|
39
|
+
}
|
|
40
|
+
return classList.join(" ");
|
|
41
|
+
});
|
|
42
|
+
const tdClass = computed(() => {
|
|
43
|
+
const classList = [];
|
|
44
|
+
if (!props.singleRow) {
|
|
45
|
+
classList.push("border-l first:border-l-0 [&:has([role=checkbox])]:pe-2");
|
|
46
|
+
}
|
|
47
|
+
if (!props.singleColumn) {
|
|
48
|
+
classList.push("group-has-[td:not(:empty)]:border-b");
|
|
49
|
+
if (props.hideLastRowBorder) {
|
|
50
|
+
classList.push("[tr:last-child_td]:border-b-0");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return classList.join(" ");
|
|
54
|
+
});
|
|
55
|
+
const tableWidth = ref(0);
|
|
56
|
+
const tableDiv = useTemplateRef("table");
|
|
57
|
+
let resizeObserver = null;
|
|
58
|
+
let scrollContainer = null;
|
|
59
|
+
const showLeftPinnedShadow = ref(false);
|
|
60
|
+
const showRightPinnedShadow = ref(false);
|
|
61
|
+
const hasVerticalOverflow = ref(false);
|
|
62
|
+
const pinnedShadowClasses = computed(() => [
|
|
63
|
+
PINNED_SHADOW_CLASSES.left.base,
|
|
64
|
+
PINNED_SHADOW_CLASSES.right.base,
|
|
65
|
+
showLeftPinnedShadow.value ? PINNED_SHADOW_CLASSES.left.show : PINNED_SHADOW_CLASSES.left.hide,
|
|
66
|
+
showRightPinnedShadow.value ? PINNED_SHADOW_CLASSES.right.show : PINNED_SHADOW_CLASSES.right.hide
|
|
67
|
+
]);
|
|
68
|
+
const HIDE_LAST_ROW_BORDER_CLASS = "[&_tbody_tr:last-child_td]:border-b-0";
|
|
69
|
+
const tblClasses = computed(() => [pinnedShadowClasses.value, EXPANDED_STICKY_CLASS, hasVerticalOverflow.value && HIDE_LAST_ROW_BORDER_CLASS]);
|
|
70
|
+
const tblUi = computed(() => ({ root: "relative overflow-clip", th: thClass.value, td: tdClass.value }));
|
|
71
|
+
function updateTableWidth() {
|
|
72
|
+
if (tableDiv.value) {
|
|
73
|
+
tableWidth.value = tableDiv.value.offsetWidth;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function checkShadowVisibility() {
|
|
77
|
+
if (!scrollContainer) return;
|
|
78
|
+
const { scrollLeft, scrollWidth, clientWidth, scrollHeight, clientHeight } = scrollContainer;
|
|
79
|
+
showLeftPinnedShadow.value = scrollLeft > 0;
|
|
80
|
+
showRightPinnedShadow.value = scrollLeft + clientWidth < scrollWidth - 1;
|
|
81
|
+
hasVerticalOverflow.value = scrollHeight > clientHeight + 1;
|
|
82
|
+
}
|
|
83
|
+
function handleScroll(e) {
|
|
84
|
+
const target = e.target;
|
|
85
|
+
const { scrollLeft, scrollWidth, clientWidth } = target;
|
|
86
|
+
showLeftPinnedShadow.value = scrollLeft > 0;
|
|
87
|
+
showRightPinnedShadow.value = scrollLeft + clientWidth < scrollWidth - 1;
|
|
88
|
+
}
|
|
89
|
+
onMounted(() => {
|
|
90
|
+
nextTick(() => {
|
|
91
|
+
if (!tableDiv.value) return;
|
|
92
|
+
const selectors = ["[data-reka-scroll-area-viewport]", ".overflow-x-auto", "[data-scroll-container]", ".overflow-auto", 'div[style*="overflow"]'];
|
|
93
|
+
for (const selector of selectors) {
|
|
94
|
+
scrollContainer = tableDiv.value.querySelector(selector);
|
|
95
|
+
if (scrollContainer) break;
|
|
96
|
+
}
|
|
97
|
+
if (scrollContainer) {
|
|
98
|
+
scrollContainer.addEventListener("scroll", handleScroll, { passive: true });
|
|
99
|
+
}
|
|
100
|
+
if (tableDiv.value) {
|
|
101
|
+
resizeObserver = new ResizeObserver(() => {
|
|
102
|
+
updateTableWidth();
|
|
103
|
+
nextTick(() => checkShadowVisibility());
|
|
104
|
+
});
|
|
105
|
+
resizeObserver.observe(tableDiv.value);
|
|
106
|
+
updateTableWidth();
|
|
107
|
+
checkShadowVisibility();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
watch(data, () => {
|
|
112
|
+
nextTick(() => checkShadowVisibility());
|
|
113
|
+
}, { flush: "post" });
|
|
114
|
+
onUnmounted(() => {
|
|
115
|
+
if (resizeObserver && tableDiv.value) {
|
|
116
|
+
resizeObserver.unobserve(tableDiv.value);
|
|
117
|
+
resizeObserver.disconnect();
|
|
118
|
+
resizeObserver = null;
|
|
119
|
+
}
|
|
120
|
+
if (scrollContainer) {
|
|
121
|
+
scrollContainer.removeEventListener("scroll", handleScroll);
|
|
122
|
+
scrollContainer = null;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
// data
|
|
127
|
+
data,
|
|
128
|
+
createRow,
|
|
129
|
+
updateRow,
|
|
130
|
+
deleteRow,
|
|
131
|
+
stats,
|
|
132
|
+
// crud
|
|
133
|
+
fetchList,
|
|
134
|
+
// row selection
|
|
135
|
+
rowSelection,
|
|
136
|
+
onUpdateRowSelection,
|
|
137
|
+
// props for sub-components
|
|
138
|
+
tblProps,
|
|
139
|
+
tblWhereQueryProps,
|
|
140
|
+
tblHeaderProps,
|
|
141
|
+
tblPaginationProps,
|
|
142
|
+
// context menu
|
|
143
|
+
tblContextMenuItems,
|
|
144
|
+
// view
|
|
145
|
+
tableWidth,
|
|
146
|
+
updateTableWidth,
|
|
147
|
+
tblClasses,
|
|
148
|
+
tblUi
|
|
149
|
+
};
|
|
150
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CustomAppConfig, type I18nLocale } from '#v/types';
|
|
2
|
+
export declare const defaultAppSettings: CustomAppConfig;
|
|
3
|
+
export declare const useApp: () => {
|
|
4
|
+
themeSettingsVisible: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
changelogVisible: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
appConfig: import("@vueuse/core").RemovableRef<CustomAppConfig>;
|
|
7
|
+
resetAppConfig: () => CustomAppConfig;
|
|
8
|
+
updatePrimaryColor: (color: string) => void;
|
|
9
|
+
updateBlackAsPrimary: (value: boolean) => void;
|
|
10
|
+
updateNeutralColor: (color: string) => void;
|
|
11
|
+
updateRadius: (radius: number) => void;
|
|
12
|
+
updateLocale: (locale: I18nLocale) => void;
|
|
13
|
+
keepalive: import("vue").WritableComputedRef<boolean, boolean>;
|
|
14
|
+
setKeepalive: (value: boolean) => boolean;
|
|
15
|
+
isMobile: import("vue").ComputedRef<boolean>;
|
|
16
|
+
isSmallerThanMd: import("vue").ComputedRef<boolean>;
|
|
17
|
+
redirectConfirm: import("vue").Ref<boolean, boolean>;
|
|
18
|
+
redirectConfirmTitle: import("vue").Ref<string, string>;
|
|
19
|
+
redirectConfirmMsg: import("vue").Ref<string, string>;
|
|
20
|
+
askRedirectConfirmBeforeLeave: (title: string, msg: string) => void;
|
|
21
|
+
clearRedirectConfirm: () => void;
|
|
22
|
+
};
|