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,57 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { useColorMode } from "@vueuse/core";
|
|
4
|
+
import { codeToHtml } from "shiki";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
data: { type: null, required: true },
|
|
7
|
+
lang: { type: String, required: false, default: "text" }
|
|
8
|
+
});
|
|
9
|
+
const colorMode = useColorMode();
|
|
10
|
+
const codeText = computed(() => {
|
|
11
|
+
if (props.data == null) return "";
|
|
12
|
+
if (typeof props.data === "string") return props.data;
|
|
13
|
+
return JSON.stringify(props.data, null, 2);
|
|
14
|
+
});
|
|
15
|
+
const highlightedHtml = ref("");
|
|
16
|
+
const updateHighlight = async () => {
|
|
17
|
+
const text = codeText.value;
|
|
18
|
+
if (!text) {
|
|
19
|
+
highlightedHtml.value = "";
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (props.lang === "text") {
|
|
23
|
+
highlightedHtml.value = "";
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
highlightedHtml.value = await codeToHtml(text, {
|
|
28
|
+
lang: props.lang,
|
|
29
|
+
theme: colorMode.value === "dark" ? "github-dark" : "github-light"
|
|
30
|
+
});
|
|
31
|
+
} catch {
|
|
32
|
+
highlightedHtml.value = "";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
watch([codeText, () => colorMode.value], updateHighlight, { immediate: true });
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<UPopover :content="{ side: 'top' }" mode="hover" :open-delay="100">
|
|
40
|
+
<UBadge
|
|
41
|
+
icon="i-lucide-eye"
|
|
42
|
+
color="neutral"
|
|
43
|
+
variant="subtle"
|
|
44
|
+
label="查看"
|
|
45
|
+
class="cursor-pointer"
|
|
46
|
+
/>
|
|
47
|
+
<template #content>
|
|
48
|
+
<div class="max-w-2xl max-h-96 overflow-auto p-3 text-xs">
|
|
49
|
+
<template v-if="highlightedHtml">
|
|
50
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
51
|
+
<div class="overflow-auto" v-html="highlightedHtml" />
|
|
52
|
+
</template>
|
|
53
|
+
<pre v-else class="whitespace-pre-wrap">{{ codeText }}</pre>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
</UPopover>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
data: string | Record<string, any> | undefined | null;
|
|
3
|
+
lang?: 'json' | 'sql' | 'text';
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
lang: "json" | "sql" | "text";
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CommandPaletteGroup, CommandPaletteProps } from '@nuxt/ui';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
groups: CommandPaletteGroup[];
|
|
4
|
+
multiple?: CommandPaletteProps['multiple'];
|
|
5
|
+
enableFooterToolbar?: boolean;
|
|
6
|
+
onOpen?: () => Promise<void>;
|
|
7
|
+
onSearch?: (searchTerm: string) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
'modelValue'?: string | number | undefined | null | (string | number)[];
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare var __VLS_8: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_8) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
18
|
+
focus: () => Promise<void>;
|
|
19
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:modelValue": (value: string | number | (string | number)[] | null | undefined) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: ((value: string | number | (string | number)[] | null | undefined) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
groups: { type: Array, required: true },
|
|
5
|
+
multiple: { type: Boolean, required: false },
|
|
6
|
+
enableFooterToolbar: { type: Boolean, required: false },
|
|
7
|
+
onOpen: { type: Function, required: false },
|
|
8
|
+
onSearch: { type: Function, required: false }
|
|
9
|
+
});
|
|
10
|
+
const modelValue = defineModel("modelValue", { type: null, ...{ required: false } });
|
|
11
|
+
const commandPaletteModelValue = computed({
|
|
12
|
+
get() {
|
|
13
|
+
if (props.multiple) {
|
|
14
|
+
const values = [];
|
|
15
|
+
for (const group of props.groups) {
|
|
16
|
+
for (const item of group.items) {
|
|
17
|
+
if (Array.isArray(modelValue.value) && modelValue.value.includes(item.value)) {
|
|
18
|
+
values.push(item);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return values;
|
|
23
|
+
}
|
|
24
|
+
for (const group of props.groups) {
|
|
25
|
+
for (const item of group.items) {
|
|
26
|
+
if (item.value === modelValue.value) {
|
|
27
|
+
const newItem = { ...item };
|
|
28
|
+
delete newItem.onSelect;
|
|
29
|
+
return newItem;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return {};
|
|
34
|
+
},
|
|
35
|
+
set(newValue) {
|
|
36
|
+
if (props.multiple) {
|
|
37
|
+
modelValue.value = newValue.map((item) => item.value);
|
|
38
|
+
} else {
|
|
39
|
+
modelValue.value = newValue.value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const footerActions = [
|
|
44
|
+
{
|
|
45
|
+
label: "\u5168\u9009",
|
|
46
|
+
fn: () => modelValue.value = props.groups.flatMap((group) => group.items.map((item) => item.value))
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: "\u53CD\u9009",
|
|
50
|
+
fn: () => modelValue.value = props.groups.flatMap((group) => group.items.map((item) => item.value)).filter((value) => !(Array.isArray(modelValue.value) ? modelValue.value.includes(value) : modelValue.value === value))
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "\u6E05\u7A7A",
|
|
54
|
+
fn: () => modelValue.value = []
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
const searchTerm = ref("");
|
|
58
|
+
const popoverOpen = ref(false);
|
|
59
|
+
watch(popoverOpen, async (newOpen) => {
|
|
60
|
+
if (newOpen) {
|
|
61
|
+
await props.onOpen?.();
|
|
62
|
+
} else {
|
|
63
|
+
searchTerm.value = "";
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
defineExpose({
|
|
67
|
+
focus: async () => {
|
|
68
|
+
popoverOpen.value = true;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<!-- NOTE: 自己实现DropdownMenu, 原生DropdownMenu的Focus有问题,会让查询字段打开的Popover关闭 -->
|
|
75
|
+
<UPopover
|
|
76
|
+
v-model:open="popoverOpen"
|
|
77
|
+
:content="{
|
|
78
|
+
align: 'start',
|
|
79
|
+
onCloseAutoFocus: (e) => e.preventDefault()
|
|
80
|
+
}"
|
|
81
|
+
>
|
|
82
|
+
<slot />
|
|
83
|
+
|
|
84
|
+
<template #content>
|
|
85
|
+
<UCommandPalette
|
|
86
|
+
:model-value="commandPaletteModelValue"
|
|
87
|
+
:selection-behavior="multiple ? 'toggle' : 'replace'"
|
|
88
|
+
:groups="groups"
|
|
89
|
+
:multiple="multiple"
|
|
90
|
+
:ui="{ input: '[&>input]:h-8 [&>input]:text-sm' }"
|
|
91
|
+
placeholder="搜索"
|
|
92
|
+
:search-term="searchTerm"
|
|
93
|
+
@update:model-value="(newValue) => {
|
|
94
|
+
commandPaletteModelValue = newValue;
|
|
95
|
+
if (!multiple) {
|
|
96
|
+
popoverOpen = false;
|
|
97
|
+
}
|
|
98
|
+
}"
|
|
99
|
+
@update:search-term="async (newSearchTerm) => {
|
|
100
|
+
searchTerm = newSearchTerm;
|
|
101
|
+
await onSearch?.(newSearchTerm);
|
|
102
|
+
}"
|
|
103
|
+
>
|
|
104
|
+
<template v-if="enableFooterToolbar && multiple" #footer>
|
|
105
|
+
<div class="flex">
|
|
106
|
+
<UFieldGroup class="flex items-center ml-auto">
|
|
107
|
+
<UButton
|
|
108
|
+
v-for="action in footerActions"
|
|
109
|
+
:key="action.label"
|
|
110
|
+
:label="action.label"
|
|
111
|
+
size="xs"
|
|
112
|
+
color="neutral"
|
|
113
|
+
variant="ghost"
|
|
114
|
+
class="text-muted font-normal"
|
|
115
|
+
@click="action.fn"
|
|
116
|
+
/>
|
|
117
|
+
</UFieldGroup>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
</UCommandPalette>
|
|
121
|
+
</template>
|
|
122
|
+
</UPopover>
|
|
123
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CommandPaletteGroup, CommandPaletteProps } from '@nuxt/ui';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
groups: CommandPaletteGroup[];
|
|
4
|
+
multiple?: CommandPaletteProps['multiple'];
|
|
5
|
+
enableFooterToolbar?: boolean;
|
|
6
|
+
onOpen?: () => Promise<void>;
|
|
7
|
+
onSearch?: (searchTerm: string) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
'modelValue'?: string | number | undefined | null | (string | number)[];
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare var __VLS_8: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_8) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
18
|
+
focus: () => Promise<void>;
|
|
19
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:modelValue": (value: string | number | (string | number)[] | null | undefined) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: ((value: string | number | (string | number)[] | null | undefined) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
icon?: string;
|
|
4
|
+
chip?: string;
|
|
5
|
+
locale?: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {
|
|
9
|
+
leading: () => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { getEmojiFlag } from "#v/utils";
|
|
4
|
+
import { useColorMode } from "@vueuse/core";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
label: { type: String, required: true },
|
|
7
|
+
icon: { type: String, required: false },
|
|
8
|
+
chip: { type: String, required: false },
|
|
9
|
+
locale: { type: String, required: false },
|
|
10
|
+
selected: { type: Boolean, required: false }
|
|
11
|
+
});
|
|
12
|
+
const slots = defineSlots();
|
|
13
|
+
const colorMode = useColorMode();
|
|
14
|
+
const chipColor = computed(() => {
|
|
15
|
+
if (!props.chip) return void 0;
|
|
16
|
+
if (props.chip === "black") return "black";
|
|
17
|
+
const shade = colorMode.value === "dark" ? "400" : "500";
|
|
18
|
+
return `var(--color-${props.chip}-${shade})`;
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<UButton
|
|
24
|
+
size="sm"
|
|
25
|
+
color="neutral"
|
|
26
|
+
variant="outline"
|
|
27
|
+
:icon="icon"
|
|
28
|
+
:label="label"
|
|
29
|
+
class="capitalize ring-default text-[11px]"
|
|
30
|
+
:class="[selected ? 'bg-elevated' : 'hover:bg-elevated/50']"
|
|
31
|
+
>
|
|
32
|
+
<template v-if="chip || locale || !!slots.leading" #leading>
|
|
33
|
+
<slot v-if="chip" name="leading">
|
|
34
|
+
<span
|
|
35
|
+
class="inline-block size-2 rounded-full"
|
|
36
|
+
:style="{ backgroundColor: chipColor }"
|
|
37
|
+
/>
|
|
38
|
+
</slot>
|
|
39
|
+
<slot v-else-if="locale" name="leading">
|
|
40
|
+
{{ getEmojiFlag(locale) }}
|
|
41
|
+
</slot>
|
|
42
|
+
<slot v-else name="leading" />
|
|
43
|
+
</template>
|
|
44
|
+
</UButton>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
icon?: string;
|
|
4
|
+
chip?: string;
|
|
5
|
+
locale?: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {
|
|
9
|
+
leading: () => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InputProps } from '@nuxt/ui';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
placeholder?: InputProps['placeholder'];
|
|
4
|
+
size?: InputProps['size'];
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
'value': undefined | string;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
11
|
+
focus: () => any;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:value": (value: string | undefined) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:value"?: ((value: string | undefined) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useTemplateRef } from "vue";
|
|
3
|
+
import { vMaska } from "maska/vue";
|
|
4
|
+
defineProps({
|
|
5
|
+
placeholder: { type: String, required: false },
|
|
6
|
+
size: { type: null, required: false }
|
|
7
|
+
});
|
|
8
|
+
const value = defineModel("value", { type: null, ...{ required: true } });
|
|
9
|
+
const input = useTemplateRef("input");
|
|
10
|
+
defineExpose({
|
|
11
|
+
focus: () => input.value?.inputRef?.focus()
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<UInput
|
|
17
|
+
ref="input"
|
|
18
|
+
v-model="value"
|
|
19
|
+
v-maska="'####/##/##'"
|
|
20
|
+
size="sm"
|
|
21
|
+
class="w-full"
|
|
22
|
+
icon="i-lucide-calendar"
|
|
23
|
+
:placeholder="placeholder"
|
|
24
|
+
>
|
|
25
|
+
<template v-if="value?.length" #trailing>
|
|
26
|
+
<UButton
|
|
27
|
+
color="neutral"
|
|
28
|
+
variant="link"
|
|
29
|
+
size="sm"
|
|
30
|
+
icon="i-lucide-circle-x"
|
|
31
|
+
aria-label="Clear input"
|
|
32
|
+
@click="() => {
|
|
33
|
+
value = void 0;
|
|
34
|
+
input?.inputRef?.focus();
|
|
35
|
+
}"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
</UInput>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InputProps } from '@nuxt/ui';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
placeholder?: InputProps['placeholder'];
|
|
4
|
+
size?: InputProps['size'];
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
'value': undefined | string;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
11
|
+
focus: () => any;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:value": (value: string | undefined) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:value"?: ((value: string | undefined) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ButtonProps } from '@nuxt/ui';
|
|
2
|
+
import type { DateRange, DateValue } from 'reka-ui';
|
|
3
|
+
import type { DateShortcut } from '#v/types';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
size?: ButtonProps['size'];
|
|
6
|
+
loading?: ButtonProps['loading'];
|
|
7
|
+
range?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
timeUnit?: Const.Time.TimeUnit;
|
|
10
|
+
leadingIcon?: ButtonProps['leadingIcon'];
|
|
11
|
+
shortcuts?: DateShortcut[];
|
|
12
|
+
peerButtons?: ButtonProps[];
|
|
13
|
+
};
|
|
14
|
+
type __VLS_ModelProps = {
|
|
15
|
+
'modelValue'?: DateValue | DateValue[] | DateRange | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
18
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
19
|
+
open: () => void;
|
|
20
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:modelValue": (value: DateValue | DateRange | DateValue[] | null | undefined) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: ((value: DateValue | DateRange | DateValue[] | null | undefined) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useTemplateRef, nextTick, ref } from "vue";
|
|
3
|
+
import { now } from "@internationalized/date";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
import { useApp } from "#v/composables/useApp";
|
|
6
|
+
import { useDate } from "#v/composables/useDate";
|
|
7
|
+
import { dateFormat, TIME_ZONE } from "#v/constants";
|
|
8
|
+
import { stringsJoin } from "#v/utils";
|
|
9
|
+
import DatePickerInput from "./Input.vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
size: { type: null, required: false },
|
|
12
|
+
loading: { type: Boolean, required: false },
|
|
13
|
+
range: { type: Boolean, required: false },
|
|
14
|
+
placeholder: { type: String, required: false },
|
|
15
|
+
timeUnit: { type: null, required: false },
|
|
16
|
+
leadingIcon: { type: null, required: false },
|
|
17
|
+
shortcuts: { type: Array, required: false },
|
|
18
|
+
peerButtons: { type: Array, required: false }
|
|
19
|
+
});
|
|
20
|
+
const modelValue = defineModel("modelValue", { type: null });
|
|
21
|
+
const app = useApp();
|
|
22
|
+
const startDateStrValueInput = useTemplateRef("startDateStrValueInput");
|
|
23
|
+
const startDateStrValue = computed({
|
|
24
|
+
get() {
|
|
25
|
+
return useDate().dateValueToDayjs(modelValue.value?.start)?.format(dateFormat) ?? void 0;
|
|
26
|
+
},
|
|
27
|
+
set(newValue) {
|
|
28
|
+
if (!newValue) {
|
|
29
|
+
modelValue.value = {
|
|
30
|
+
...modelValue.value,
|
|
31
|
+
start: void 0
|
|
32
|
+
};
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const formattedDayjs = dayjs(newValue, dateFormat, true);
|
|
36
|
+
if (formattedDayjs.isValid()) {
|
|
37
|
+
modelValue.value = {
|
|
38
|
+
...modelValue.value,
|
|
39
|
+
start: useDate().dayjsToDateValue(formattedDayjs) ?? void 0
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const endDateStrValue = computed({
|
|
45
|
+
get() {
|
|
46
|
+
return useDate().dateValueToDayjs(modelValue.value?.end)?.format(dateFormat) ?? void 0;
|
|
47
|
+
},
|
|
48
|
+
set(newValue) {
|
|
49
|
+
if (!newValue) {
|
|
50
|
+
modelValue.value = {
|
|
51
|
+
...modelValue.value,
|
|
52
|
+
end: void 0
|
|
53
|
+
};
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const formattedDayjs = dayjs(newValue, dateFormat, true);
|
|
57
|
+
if (formattedDayjs.isValid()) {
|
|
58
|
+
modelValue.value = {
|
|
59
|
+
...modelValue.value,
|
|
60
|
+
end: useDate().dayjsToDateValue(formattedDayjs) ?? void 0
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const singleDateStrValueInput = useTemplateRef("singleDateStrValueInput");
|
|
66
|
+
const singleDateStrValue = computed({
|
|
67
|
+
get() {
|
|
68
|
+
return useDate().dateValueToDayjs(modelValue.value)?.format(dateFormat) ?? void 0;
|
|
69
|
+
},
|
|
70
|
+
set(newValue) {
|
|
71
|
+
if (!newValue) {
|
|
72
|
+
modelValue.value = void 0;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const formattedDayjs = dayjs(newValue, dateFormat, true);
|
|
76
|
+
if (formattedDayjs.isValid()) {
|
|
77
|
+
modelValue.value = useDate().dayjsToDateValue(formattedDayjs);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const isValueEmpty = computed(() => {
|
|
82
|
+
if (props.range) {
|
|
83
|
+
const range = modelValue.value;
|
|
84
|
+
return !range?.start && !range?.end;
|
|
85
|
+
} else {
|
|
86
|
+
return !modelValue.value;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const displayValue = computed(() => {
|
|
90
|
+
if (isValueEmpty.value) {
|
|
91
|
+
return props.placeholder ?? "\u8BF7\u9009\u62E9\u65E5\u671F";
|
|
92
|
+
}
|
|
93
|
+
if (props.range) {
|
|
94
|
+
const dateStrList = [];
|
|
95
|
+
if (props.timeUnit) {
|
|
96
|
+
dateStrList.push(useDate().formatTimeUnit(modelValue.value?.start, props.timeUnit));
|
|
97
|
+
dateStrList.push(useDate().formatTimeUnit(modelValue.value?.end, props.timeUnit));
|
|
98
|
+
} else {
|
|
99
|
+
dateStrList.push(useDate().dateValueToDayjs(modelValue.value?.start)?.format(dateFormat) ?? null);
|
|
100
|
+
dateStrList.push(useDate().dateValueToDayjs(modelValue.value?.end)?.format(dateFormat) ?? null);
|
|
101
|
+
}
|
|
102
|
+
return stringsJoin(dateStrList, " - ");
|
|
103
|
+
} else {
|
|
104
|
+
return useDate().dateValueToDayjs(modelValue.value)?.format(dateFormat) ?? "";
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const dateStrInputFocus = () => {
|
|
108
|
+
nextTick(() => {
|
|
109
|
+
if (props.range) {
|
|
110
|
+
startDateStrValueInput.value?.focus();
|
|
111
|
+
} else {
|
|
112
|
+
singleDateStrValueInput.value?.focus();
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const popoverOpen = ref(false);
|
|
117
|
+
defineExpose({
|
|
118
|
+
open: () => {
|
|
119
|
+
popoverOpen.value = true;
|
|
120
|
+
dateStrInputFocus();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<template>
|
|
126
|
+
<UPopover
|
|
127
|
+
:open="popoverOpen"
|
|
128
|
+
:content="{ align: 'start' }"
|
|
129
|
+
@update:open="(newOpen) => {
|
|
130
|
+
popoverOpen = newOpen;
|
|
131
|
+
if (newOpen) {
|
|
132
|
+
dateStrInputFocus();
|
|
133
|
+
}
|
|
134
|
+
}"
|
|
135
|
+
>
|
|
136
|
+
<UFieldGroup>
|
|
137
|
+
<UButton
|
|
138
|
+
color="neutral"
|
|
139
|
+
variant="outline"
|
|
140
|
+
:leading-icon="leadingIcon ?? 'i-lucide-calendar'"
|
|
141
|
+
trailing-icon="i-lucide-chevron-down"
|
|
142
|
+
:loading="loading"
|
|
143
|
+
:size="size"
|
|
144
|
+
>
|
|
145
|
+
<div class="flex items-center gap-1">
|
|
146
|
+
<span>{{ displayValue }}</span>
|
|
147
|
+
</div>
|
|
148
|
+
</UButton>
|
|
149
|
+
<UButton v-for="(btnProps, idx) in peerButtons" :key="idx" v-bind="btnProps" />
|
|
150
|
+
</UFieldGroup>
|
|
151
|
+
|
|
152
|
+
<template #content>
|
|
153
|
+
<div class="p-3 flex flex-col gap-2">
|
|
154
|
+
<div v-if="range" class="flex flex-col sm:flex-row items-center gap-2">
|
|
155
|
+
<DatePickerInput
|
|
156
|
+
ref="startDateStrValueInput"
|
|
157
|
+
v-model:value="startDateStrValue"
|
|
158
|
+
placeholder="YYYY/MM/DD 开始日期"
|
|
159
|
+
/>
|
|
160
|
+
<DatePickerInput
|
|
161
|
+
ref="endDateStrValueInput"
|
|
162
|
+
v-model:value="endDateStrValue"
|
|
163
|
+
placeholder="YYYY/MM/DD 结束日期"
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
<DatePickerInput
|
|
167
|
+
v-else
|
|
168
|
+
ref="singleDateStrValueInput"
|
|
169
|
+
v-model:value="singleDateStrValue"
|
|
170
|
+
placeholder="YYYY/MM/DD 日期"
|
|
171
|
+
/>
|
|
172
|
+
<UCalendar
|
|
173
|
+
:model-value="modelValue"
|
|
174
|
+
:size="size"
|
|
175
|
+
:number-of-months="app.isMobile.value || !range ? 1 : 2"
|
|
176
|
+
:range="range"
|
|
177
|
+
@update:model-value="(newValue) => {
|
|
178
|
+
modelValue = newValue;
|
|
179
|
+
if (!range) {
|
|
180
|
+
popoverOpen = false;
|
|
181
|
+
}
|
|
182
|
+
}"
|
|
183
|
+
/>
|
|
184
|
+
<div class="flex flex-wrap items-center gap-1">
|
|
185
|
+
<UButton
|
|
186
|
+
label="清空"
|
|
187
|
+
size="xs"
|
|
188
|
+
color="neutral"
|
|
189
|
+
variant="outline"
|
|
190
|
+
class="mr-auto"
|
|
191
|
+
@click="() => {
|
|
192
|
+
modelValue = range ? { start: void 0, end: void 0 } : null;
|
|
193
|
+
}"
|
|
194
|
+
/>
|
|
195
|
+
<UButton
|
|
196
|
+
v-for="shortcut in shortcuts"
|
|
197
|
+
:key="shortcut.label"
|
|
198
|
+
:label="shortcut.label"
|
|
199
|
+
size="xs"
|
|
200
|
+
color="neutral"
|
|
201
|
+
variant="outline"
|
|
202
|
+
@click="() => {
|
|
203
|
+
modelValue = shortcut.dateFn?.();
|
|
204
|
+
popoverOpen = false;
|
|
205
|
+
}"
|
|
206
|
+
/>
|
|
207
|
+
<UButton
|
|
208
|
+
v-if="!range"
|
|
209
|
+
label="今天"
|
|
210
|
+
size="xs"
|
|
211
|
+
color="neutral"
|
|
212
|
+
variant="outline"
|
|
213
|
+
class="ml-auto"
|
|
214
|
+
@click="() => {
|
|
215
|
+
modelValue = now(TIME_ZONE);
|
|
216
|
+
popoverOpen = false;
|
|
217
|
+
}"
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</template>
|
|
222
|
+
</UPopover>
|
|
223
|
+
</template>
|