@duxweb/dvha-pro 0.0.5
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/dist/cjs/app.cjs +1 -0
- package/dist/cjs/component.cjs +1 -0
- package/dist/cjs/components/card/card.cjs +1 -0
- package/dist/cjs/components/carousel/carousel.cjs +1 -0
- package/dist/cjs/components/dashboard/hello.cjs +1 -0
- package/dist/cjs/components/dashboard/helloBig.cjs +1 -0
- package/dist/cjs/components/dashboard/quick.cjs +1 -0
- package/dist/cjs/components/dialog/dialog.cjs +1 -0
- package/dist/cjs/components/draw/drawApps.cjs +1 -0
- package/dist/cjs/components/draw/drawAuth.cjs +1 -0
- package/dist/cjs/components/draw/drawEmpty.cjs +1 -0
- package/dist/cjs/components/draw/drawEmptyForm.cjs +1 -0
- package/dist/cjs/components/draw/drawError.cjs +1 -0
- package/dist/cjs/components/drawer/drawer.cjs +1 -0
- package/dist/cjs/components/drawer/drawerPage.cjs +1 -0
- package/dist/cjs/components/form/formItem.cjs +1 -0
- package/dist/cjs/components/form/formLayout.cjs +1 -0
- package/dist/cjs/components/form/modalForm.cjs +1 -0
- package/dist/cjs/components/form/pageForm.cjs +1 -0
- package/dist/cjs/components/form/settingForm.cjs +1 -0
- package/dist/cjs/components/layout/filter.cjs +1 -0
- package/dist/cjs/components/layout/list.cjs +1 -0
- package/dist/cjs/components/layout/table.cjs +1 -0
- package/dist/cjs/components/layout/tools.cjs +1 -0
- package/dist/cjs/components/list/card.cjs +1 -0
- package/dist/cjs/components/list/list.cjs +1 -0
- package/dist/cjs/components/media/media.cjs +1 -0
- package/dist/cjs/components/modal/modal.cjs +1 -0
- package/dist/cjs/components/modal/modalPage.cjs +1 -0
- package/dist/cjs/components/modal/modalTab.cjs +1 -0
- package/dist/cjs/components/panel/alert.cjs +1 -0
- package/dist/cjs/components/panel/setting.cjs +1 -0
- package/dist/cjs/components/status/blockEmpty.cjs +1 -0
- package/dist/cjs/components/table/tablePage.cjs +1 -0
- package/dist/cjs/components/widget/connect.cjs +1 -0
- package/dist/cjs/config/uno.cjs +1 -0
- package/dist/cjs/config/validate.cjs +1 -0
- package/dist/cjs/dvha-pro.css +1 -0
- package/dist/cjs/hooks/action.cjs +1 -0
- package/dist/cjs/hooks/dialog.cjs +1 -0
- package/dist/cjs/hooks/drawer.cjs +1 -0
- package/dist/cjs/hooks/modal.cjs +1 -0
- package/dist/cjs/hooks/table/column.cjs +1 -0
- package/dist/cjs/hooks/table/copy.cjs +1 -0
- package/dist/cjs/hooks/table/hidden.cjs +1 -0
- package/dist/cjs/hooks/table/image.cjs +1 -0
- package/dist/cjs/hooks/table/input.cjs +1 -0
- package/dist/cjs/hooks/table/map.cjs +1 -0
- package/dist/cjs/hooks/table/media.cjs +1 -0
- package/dist/cjs/hooks/table/status.cjs +1 -0
- package/dist/cjs/hooks/table/switch.cjs +1 -0
- package/dist/cjs/hooks/table.cjs +1 -0
- package/dist/cjs/hooks/ui.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/langs/en-US.json.cjs +1 -0
- package/dist/cjs/langs/zh-CN.json.cjs +1 -0
- package/dist/cjs/main.cjs +1 -0
- package/dist/cjs/node_modules/@iconify-json/tabler/icons.json.cjs +1 -0
- package/dist/cjs/node_modules/@overlastic/core/dist/index.cjs +1 -0
- package/dist/cjs/node_modules/@overlastic/vue/dist/index.cjs +1 -0
- package/dist/cjs/node_modules/@vee-validate/i18n/dist/locale/en.json.cjs +1 -0
- package/dist/cjs/node_modules/@vee-validate/i18n/dist/locale/zh_CN.json.cjs +1 -0
- package/dist/cjs/node_modules/@vueuse/integrations/useFocusTrap.cjs +1 -0
- package/dist/cjs/node_modules/@vueuse/shared/index.cjs +1 -0
- package/dist/cjs/node_modules/colorizr/dist/index.cjs +1 -0
- package/dist/cjs/node_modules/focus-trap/dist/focus-trap.esm.cjs +5 -0
- package/dist/cjs/node_modules/lower-case/dist.es2015/index.cjs +1 -0
- package/dist/cjs/node_modules/no-case/dist.es2015/index.cjs +1 -0
- package/dist/cjs/node_modules/pascal-case/dist.es2015/index.cjs +1 -0
- package/dist/cjs/node_modules/tabbable/dist/index.esm.cjs +4 -0
- package/dist/cjs/node_modules/tslib/tslib.es6.cjs +1 -0
- package/dist/cjs/pages/authLayout.cjs +1 -0
- package/dist/cjs/pages/layout/global.cjs +1 -0
- package/dist/cjs/pages/layout/page.cjs +1 -0
- package/dist/cjs/pages/layout/tab.cjs +1 -0
- package/dist/cjs/pages/layout.cjs +1 -0
- package/dist/cjs/pages/loading.cjs +1 -0
- package/dist/cjs/pages/login.cjs +1 -0
- package/dist/cjs/pages/menu/avatar.cjs +1 -0
- package/dist/cjs/pages/menu/button.cjs +1 -0
- package/dist/cjs/pages/menu/cmd.cjs +1 -0
- package/dist/cjs/pages/menu/main.cjs +1 -0
- package/dist/cjs/pages/menu/mobile.cjs +1 -0
- package/dist/cjs/pages/page.cjs +1 -0
- package/dist/cjs/pages/page403.cjs +1 -0
- package/dist/cjs/pages/page404.cjs +1 -0
- package/dist/cjs/pages/page500.cjs +1 -0
- package/dist/cjs/pages/pageEmpty.cjs +1 -0
- package/dist/cjs/pages/pageLoading.cjs +1 -0
- package/dist/cjs/pages/pageStatus.cjs +1 -0
- package/dist/cjs/static/images/placeholder.png.cjs +1 -0
- package/dist/cjs/stores/ui.cjs +1 -0
- package/dist/cjs/theme/naiveTheme.cjs +1 -0
- package/dist/cjs/theme/presetTheme.cjs +1 -0
- package/dist/cjs/theme/uno.css.cjs +1285 -0
- package/dist/esm/app.js +20 -0
- package/dist/esm/component.js +59 -0
- package/dist/esm/components/card/card.js +114 -0
- package/dist/esm/components/carousel/carousel.js +37 -0
- package/dist/esm/components/dashboard/hello.js +40 -0
- package/dist/esm/components/dashboard/helloBig.js +344 -0
- package/dist/esm/components/dashboard/quick.js +59 -0
- package/dist/esm/components/dialog/dialog.js +118 -0
- package/dist/esm/components/draw/drawApps.js +145 -0
- package/dist/esm/components/draw/drawAuth.js +50 -0
- package/dist/esm/components/draw/drawEmpty.js +92 -0
- package/dist/esm/components/draw/drawEmptyForm.js +128 -0
- package/dist/esm/components/draw/drawError.js +242 -0
- package/dist/esm/components/drawer/drawer.js +73 -0
- package/dist/esm/components/drawer/drawerPage.js +28 -0
- package/dist/esm/components/form/formItem.js +77 -0
- package/dist/esm/components/form/formLayout.js +38 -0
- package/dist/esm/components/form/modalForm.js +108 -0
- package/dist/esm/components/form/pageForm.js +94 -0
- package/dist/esm/components/form/settingForm.js +104 -0
- package/dist/esm/components/layout/filter.js +27 -0
- package/dist/esm/components/layout/list.js +333 -0
- package/dist/esm/components/layout/table.js +292 -0
- package/dist/esm/components/layout/tools.js +78 -0
- package/dist/esm/components/list/card.js +78 -0
- package/dist/esm/components/list/list.js +38 -0
- package/dist/esm/components/media/media.js +77 -0
- package/dist/esm/components/modal/modal.js +116 -0
- package/dist/esm/components/modal/modalPage.js +56 -0
- package/dist/esm/components/modal/modalTab.js +70 -0
- package/dist/esm/components/panel/alert.js +57 -0
- package/dist/esm/components/panel/setting.js +49 -0
- package/dist/esm/components/status/blockEmpty.js +78 -0
- package/dist/esm/components/table/tablePage.js +41 -0
- package/dist/esm/components/widget/connect.js +119 -0
- package/dist/esm/config/uno.js +32 -0
- package/dist/esm/config/validate.js +15 -0
- package/dist/esm/dvha-pro.css +1 -0
- package/dist/esm/hooks/action.js +213 -0
- package/dist/esm/hooks/dialog.js +32 -0
- package/dist/esm/hooks/drawer.js +25 -0
- package/dist/esm/hooks/modal.js +14 -0
- package/dist/esm/hooks/table/column.js +31 -0
- package/dist/esm/hooks/table/copy.js +27 -0
- package/dist/esm/hooks/table/hidden.js +48 -0
- package/dist/esm/hooks/table/image.js +24 -0
- package/dist/esm/hooks/table/input.js +81 -0
- package/dist/esm/hooks/table/map.js +21 -0
- package/dist/esm/hooks/table/media.js +34 -0
- package/dist/esm/hooks/table/status.js +32 -0
- package/dist/esm/hooks/table/switch.js +33 -0
- package/dist/esm/hooks/table.js +74 -0
- package/dist/esm/hooks/ui.js +16 -0
- package/dist/esm/index.js +139 -0
- package/dist/esm/langs/en-US.json.js +11 -0
- package/dist/esm/langs/zh-CN.json.js +11 -0
- package/dist/esm/main.js +18 -0
- package/dist/esm/node_modules/@iconify-json/tabler/icons.json.js +17 -0
- package/dist/esm/node_modules/@overlastic/core/dist/index.js +76 -0
- package/dist/esm/node_modules/@overlastic/vue/dist/index.js +122 -0
- package/dist/esm/node_modules/@vee-validate/i18n/dist/locale/en.json.js +9 -0
- package/dist/esm/node_modules/@vee-validate/i18n/dist/locale/zh_CN.json.js +9 -0
- package/dist/esm/node_modules/@vueuse/integrations/useFocusTrap.js +43 -0
- package/dist/esm/node_modules/@vueuse/shared/index.js +6 -0
- package/dist/esm/node_modules/colorizr/dist/index.js +318 -0
- package/dist/esm/node_modules/focus-trap/dist/focus-trap.esm.js +473 -0
- package/dist/esm/node_modules/lower-case/dist.es2015/index.js +6 -0
- package/dist/esm/node_modules/no-case/dist.es2015/index.js +18 -0
- package/dist/esm/node_modules/pascal-case/dist.es2015/index.js +13 -0
- package/dist/esm/node_modules/tabbable/dist/index.esm.js +202 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js +12 -0
- package/dist/esm/pages/authLayout.js +38 -0
- package/dist/esm/pages/layout/global.js +51 -0
- package/dist/esm/pages/layout/page.js +54 -0
- package/dist/esm/pages/layout/tab.js +110 -0
- package/dist/esm/pages/layout.js +14 -0
- package/dist/esm/pages/loading.js +14 -0
- package/dist/esm/pages/login.js +143 -0
- package/dist/esm/pages/menu/avatar.js +205 -0
- package/dist/esm/pages/menu/button.js +60 -0
- package/dist/esm/pages/menu/cmd.js +156 -0
- package/dist/esm/pages/menu/main.js +101 -0
- package/dist/esm/pages/menu/mobile.js +38 -0
- package/dist/esm/pages/page.js +47 -0
- package/dist/esm/pages/page403.js +46 -0
- package/dist/esm/pages/page404.js +57 -0
- package/dist/esm/pages/page500.js +45 -0
- package/dist/esm/pages/pageEmpty.js +25 -0
- package/dist/esm/pages/pageLoading.js +22 -0
- package/dist/esm/pages/pageStatus.js +50 -0
- package/dist/esm/static/images/placeholder.png.js +4 -0
- package/dist/esm/stores/ui.js +34 -0
- package/dist/esm/theme/naiveTheme.js +97 -0
- package/dist/esm/theme/presetTheme.js +12 -0
- package/dist/esm/theme/uno.css.js +1288 -0
- package/dist/types/app.d.ts +1 -0
- package/dist/types/component.d.ts +5 -0
- package/dist/types/components/card/card.d.ts +140 -0
- package/dist/types/components/card/index.d.ts +1 -0
- package/dist/types/components/carousel/carousel.d.ts +20 -0
- package/dist/types/components/carousel/index.d.ts +1 -0
- package/dist/types/components/dashboard/hello.d.ts +16 -0
- package/dist/types/components/dashboard/helloBig.d.ts +19 -0
- package/dist/types/components/dashboard/index.d.ts +3 -0
- package/dist/types/components/dashboard/quick.d.ts +33 -0
- package/dist/types/components/dialog/dialog.d.ts +35 -0
- package/dist/types/components/dialog/index.d.ts +1 -0
- package/dist/types/components/draw/drawApps.d.ts +1 -0
- package/dist/types/components/draw/drawAuth.d.ts +1 -0
- package/dist/types/components/draw/drawEmpty.d.ts +1 -0
- package/dist/types/components/draw/drawEmptyForm.d.ts +1 -0
- package/dist/types/components/draw/drawError.d.ts +1 -0
- package/dist/types/components/draw/index.d.ts +5 -0
- package/dist/types/components/drawer/drawer.d.ts +19 -0
- package/dist/types/components/drawer/drawerPage.d.ts +1 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/form/formItem.d.ts +27 -0
- package/dist/types/components/form/formLayout.d.ts +38 -0
- package/dist/types/components/form/index.d.ts +5 -0
- package/dist/types/components/form/modalForm.d.ts +89 -0
- package/dist/types/components/form/pageForm.d.ts +51 -0
- package/dist/types/components/form/settingForm.d.ts +69 -0
- package/dist/types/components/index.d.ts +14 -0
- package/dist/types/components/layout/filter.d.ts +13 -0
- package/dist/types/components/layout/index.d.ts +4 -0
- package/dist/types/components/layout/list.d.ts +85 -0
- package/dist/types/components/layout/table.d.ts +72 -0
- package/dist/types/components/layout/tools.d.ts +37 -0
- package/dist/types/components/list/card.d.ts +117 -0
- package/dist/types/components/list/index.d.ts +2 -0
- package/dist/types/components/list/list.d.ts +87 -0
- package/dist/types/components/media/index.d.ts +1 -0
- package/dist/types/components/media/media.d.ts +95 -0
- package/dist/types/components/modal/index.d.ts +3 -0
- package/dist/types/components/modal/modal.d.ts +66 -0
- package/dist/types/components/modal/modalPage.d.ts +42 -0
- package/dist/types/components/modal/modalTab.d.ts +42 -0
- package/dist/types/components/panel/alert.d.ts +32 -0
- package/dist/types/components/panel/index.d.ts +2 -0
- package/dist/types/components/panel/setting.d.ts +29 -0
- package/dist/types/components/status/blockEmpty.d.ts +25 -0
- package/dist/types/components/status/index.d.ts +1 -0
- package/dist/types/components/table/index.d.ts +1 -0
- package/dist/types/components/table/tablePage.d.ts +73 -0
- package/dist/types/components/widget/connect.d.ts +11 -0
- package/dist/types/components/widget/index.d.ts +1 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/uno.d.ts +2 -0
- package/dist/types/config/validate.d.ts +1 -0
- package/dist/types/hooks/action.d.ts +17 -0
- package/dist/types/hooks/dialog.d.ts +17 -0
- package/dist/types/hooks/drawer.d.ts +11 -0
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/hooks/modal.d.ts +9 -0
- package/dist/types/hooks/table/column.d.ts +14 -0
- package/dist/types/hooks/table/copy.d.ts +6 -0
- package/dist/types/hooks/table/hidden.d.ts +7 -0
- package/dist/types/hooks/table/image.d.ts +8 -0
- package/dist/types/hooks/table/index.d.ts +7 -0
- package/dist/types/hooks/table/input.d.ts +9 -0
- package/dist/types/hooks/table/map.d.ts +13 -0
- package/dist/types/hooks/table/media.d.ts +12 -0
- package/dist/types/hooks/table/status.d.ts +12 -0
- package/dist/types/hooks/table/switch.d.ts +7 -0
- package/dist/types/hooks/table/types.d.ts +74 -0
- package/dist/types/hooks/table.d.ts +2 -0
- package/dist/types/hooks/ui.d.ts +8 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/langs/index.d.ts +3 -0
- package/dist/types/main.d.ts +5 -0
- package/dist/types/pages/authLayout.d.ts +1 -0
- package/dist/types/pages/index.d.ts +12 -0
- package/dist/types/pages/layout/global.d.ts +1 -0
- package/dist/types/pages/layout/index.d.ts +3 -0
- package/dist/types/pages/layout/page.d.ts +1 -0
- package/dist/types/pages/layout/tab.d.ts +1 -0
- package/dist/types/pages/layout.d.ts +1 -0
- package/dist/types/pages/loading.d.ts +1 -0
- package/dist/types/pages/login.d.ts +1 -0
- package/dist/types/pages/menu/avatar.d.ts +14 -0
- package/dist/types/pages/menu/button.d.ts +41 -0
- package/dist/types/pages/menu/cmd.d.ts +7 -0
- package/dist/types/pages/menu/index.d.ts +4 -0
- package/dist/types/pages/menu/main.d.ts +13 -0
- package/dist/types/pages/menu/mobile.d.ts +1 -0
- package/dist/types/pages/page.d.ts +42 -0
- package/dist/types/pages/page403.d.ts +1 -0
- package/dist/types/pages/page404.d.ts +1 -0
- package/dist/types/pages/page500.d.ts +1 -0
- package/dist/types/pages/pageEmpty.d.ts +7 -0
- package/dist/types/pages/pageLoading.d.ts +1 -0
- package/dist/types/pages/pageStatus.d.ts +7 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/ui.d.ts +28 -0
- package/dist/types/theme/index.d.ts +2 -0
- package/dist/types/theme/naiveTheme.d.ts +5 -0
- package/dist/types/theme/presetTheme.d.ts +7 -0
- package/package.json +73 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { defineComponent as _, toRef as $, computed as s, reactive as ee, ref as te, watch as le, createVNode as e, h as A, mergeProps as ae } from "vue";
|
|
2
|
+
import { useI18n as ie, useJsonSchema as D } from "@duxweb/dvha-core";
|
|
3
|
+
import { useWindowSize as ne, useElementSize as re } from "@vueuse/core";
|
|
4
|
+
import { NInput as E, NTabs as oe, NTab as ue, NPopover as ce, NButton as c, NPopselect as se, NTooltip as p, NProgress as pe, NPagination as fe } from "naive-ui";
|
|
5
|
+
import { useAction as de } from "../../hooks/action.js";
|
|
6
|
+
import { useTable as me } from "../../hooks/table.js";
|
|
7
|
+
import "lodash-es";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "jinrishici";
|
|
10
|
+
import "../../node_modules/@overlastic/vue/dist/index.js";
|
|
11
|
+
import "vee-validate";
|
|
12
|
+
import "@vee-validate/i18n";
|
|
13
|
+
import "vue-router";
|
|
14
|
+
import "vue-command-palette";
|
|
15
|
+
import "@duxweb/dvha-naiveui";
|
|
16
|
+
import { DuxPage as ve } from "../../pages/page.js";
|
|
17
|
+
import "../../pages/page404.js";
|
|
18
|
+
import { DuxTableFilter as ge } from "./filter.js";
|
|
19
|
+
import { DuxTableTools as be } from "./tools.js";
|
|
20
|
+
import "pinia";
|
|
21
|
+
const Be = /* @__PURE__ */ _({
|
|
22
|
+
name: "DuxTableLayout",
|
|
23
|
+
props: {
|
|
24
|
+
path: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: !0
|
|
27
|
+
},
|
|
28
|
+
filter: {
|
|
29
|
+
type: Object
|
|
30
|
+
},
|
|
31
|
+
filterSchema: {
|
|
32
|
+
type: Array
|
|
33
|
+
},
|
|
34
|
+
columns: {
|
|
35
|
+
type: Array
|
|
36
|
+
},
|
|
37
|
+
pagination: {
|
|
38
|
+
type: [Boolean, Object]
|
|
39
|
+
},
|
|
40
|
+
tabs: {
|
|
41
|
+
type: Array
|
|
42
|
+
},
|
|
43
|
+
actions: {
|
|
44
|
+
type: Array,
|
|
45
|
+
default: () => []
|
|
46
|
+
},
|
|
47
|
+
tools: {
|
|
48
|
+
type: Object
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
setup(l, {
|
|
52
|
+
slots: t
|
|
53
|
+
}) {
|
|
54
|
+
var N, k;
|
|
55
|
+
const f = $(l.filter || {}), {
|
|
56
|
+
t: r
|
|
57
|
+
} = ie(), {
|
|
58
|
+
renderAction: I
|
|
59
|
+
} = de(), b = me({
|
|
60
|
+
path: l.path,
|
|
61
|
+
filters: f.value,
|
|
62
|
+
columns: l.columns || [],
|
|
63
|
+
pagination: l.pagination
|
|
64
|
+
}), {
|
|
65
|
+
meta: d,
|
|
66
|
+
columns: h,
|
|
67
|
+
tablePagination: O,
|
|
68
|
+
table: W,
|
|
69
|
+
onUpdateColumnSelected: V,
|
|
70
|
+
onUpdateChecked: m,
|
|
71
|
+
columnSelected: B,
|
|
72
|
+
autoRefetch: L,
|
|
73
|
+
autoCountdown: x,
|
|
74
|
+
onAutoRefetch: U,
|
|
75
|
+
isExporting: q,
|
|
76
|
+
isExportingRows: F,
|
|
77
|
+
isImporting: H,
|
|
78
|
+
onExport: J,
|
|
79
|
+
onExportRows: K,
|
|
80
|
+
onImport: G
|
|
81
|
+
} = b, M = s(() => h.value.filter((a) => "title" in a && "key" in a).map((a) => ({
|
|
82
|
+
label: a.title,
|
|
83
|
+
value: a.key
|
|
84
|
+
}))), {
|
|
85
|
+
width: y
|
|
86
|
+
} = ne(), Q = s(() => h.value.reduce((o, i) => o + (Number(i == null ? void 0 : i.width) || Number(i == null ? void 0 : i.minWidth) || 110), 0)), u = ee({
|
|
87
|
+
show: !1,
|
|
88
|
+
collapse: !1
|
|
89
|
+
}), w = te(), {
|
|
90
|
+
height: X
|
|
91
|
+
} = re(w);
|
|
92
|
+
le(X, (a) => {
|
|
93
|
+
a > 35 ? u.show = !0 : u.show = !1;
|
|
94
|
+
}, {
|
|
95
|
+
immediate: !0,
|
|
96
|
+
deep: !0
|
|
97
|
+
});
|
|
98
|
+
const v = s(() => (l.filterSchema || []).map((a) => {
|
|
99
|
+
const {
|
|
100
|
+
title: o,
|
|
101
|
+
...i
|
|
102
|
+
} = a;
|
|
103
|
+
return {
|
|
104
|
+
tag: ge,
|
|
105
|
+
attrs: {
|
|
106
|
+
label: o
|
|
107
|
+
},
|
|
108
|
+
children: i
|
|
109
|
+
};
|
|
110
|
+
})), {
|
|
111
|
+
render: Y
|
|
112
|
+
} = D({
|
|
113
|
+
data: (N = v.value) == null ? void 0 : N.slice(1),
|
|
114
|
+
components: {
|
|
115
|
+
NInput: E
|
|
116
|
+
}
|
|
117
|
+
}), {
|
|
118
|
+
render: Z
|
|
119
|
+
} = D({
|
|
120
|
+
data: (k = v.value) == null ? void 0 : k.slice(0, 1),
|
|
121
|
+
components: {
|
|
122
|
+
NInput: E
|
|
123
|
+
}
|
|
124
|
+
}), g = s(() => ({
|
|
125
|
+
import: !0,
|
|
126
|
+
export: !0,
|
|
127
|
+
refresh: !0,
|
|
128
|
+
...l.tools
|
|
129
|
+
}));
|
|
130
|
+
return () => e(ve, {
|
|
131
|
+
actions: l.actions,
|
|
132
|
+
scrollbar: !1
|
|
133
|
+
}, {
|
|
134
|
+
default: () => {
|
|
135
|
+
var a, o, i, j, C, S, z, R, T;
|
|
136
|
+
return e("div", {
|
|
137
|
+
class: "flex flex-col gap-3 h-full relative "
|
|
138
|
+
}, [e("div", {
|
|
139
|
+
class: "flex gap-3 justify-between flex-col lg:flex-row"
|
|
140
|
+
}, [l.tabs && e("div", {
|
|
141
|
+
class: "flex flex-none"
|
|
142
|
+
}, [e(oe, {
|
|
143
|
+
type: "segment",
|
|
144
|
+
size: "small",
|
|
145
|
+
style: {
|
|
146
|
+
"--n-tab-padding": "4px 10px"
|
|
147
|
+
},
|
|
148
|
+
"default-value": (o = (a = l.tabs) == null ? void 0 : a[0]) == null ? void 0 : o.value,
|
|
149
|
+
value: (i = f.value) == null ? void 0 : i.tab,
|
|
150
|
+
onUpdateValue: (n) => {
|
|
151
|
+
f.value.tab = n;
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
default: () => {
|
|
155
|
+
var n;
|
|
156
|
+
return [(n = l.tabs) == null ? void 0 : n.map((P) => e(ue, {
|
|
157
|
+
name: P.value,
|
|
158
|
+
tab: P.label
|
|
159
|
+
}, null))];
|
|
160
|
+
}
|
|
161
|
+
})]), e("div", {
|
|
162
|
+
class: ["overflow-hidden flex-1", u.collapse ? "h-auto" : "h-8.5"]
|
|
163
|
+
}, [e("div", {
|
|
164
|
+
ref: w,
|
|
165
|
+
class: ["lg:flex gap-2 flex-wrap", l.tabs ? "justify-end" : "justify-start"]
|
|
166
|
+
}, [A(Z)])]), e("div", {
|
|
167
|
+
class: "flex gap-2 justify-between lg:justify-end"
|
|
168
|
+
}, [v.value.length > 1 && e(ce, {
|
|
169
|
+
trigger: "click",
|
|
170
|
+
displayDirective: "show"
|
|
171
|
+
}, {
|
|
172
|
+
trigger: () => e(c, {
|
|
173
|
+
iconPlacement: "right",
|
|
174
|
+
onClick: () => {
|
|
175
|
+
u.collapse = !u.collapse;
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
default: () => r("components.button.filter"),
|
|
179
|
+
icon: () => e("div", {
|
|
180
|
+
class: ["i-tabler:chevrons-down size-4 transition-all"]
|
|
181
|
+
}, null)
|
|
182
|
+
}),
|
|
183
|
+
default: () => e("div", {
|
|
184
|
+
class: "flex flex-col gap-2 py-1"
|
|
185
|
+
}, [A(Y)])
|
|
186
|
+
}), e("div", {
|
|
187
|
+
class: "flex gap-2 items-center"
|
|
188
|
+
}, [(j = t == null ? void 0 : t.tools) == null ? void 0 : j.call(t), e(se, {
|
|
189
|
+
options: M.value,
|
|
190
|
+
value: B.value,
|
|
191
|
+
onUpdateValue: (n) => {
|
|
192
|
+
V(n);
|
|
193
|
+
},
|
|
194
|
+
multiple: !0,
|
|
195
|
+
placement: "bottom-start",
|
|
196
|
+
trigger: "click"
|
|
197
|
+
}, {
|
|
198
|
+
default: () => [e(p, null, {
|
|
199
|
+
trigger: () => e(c, {
|
|
200
|
+
"icon-placement": "right"
|
|
201
|
+
}, {
|
|
202
|
+
icon: () => e("div", {
|
|
203
|
+
class: "i-tabler:columns size-4"
|
|
204
|
+
}, null)
|
|
205
|
+
}),
|
|
206
|
+
default: () => r("components.list.columnSetting")
|
|
207
|
+
})]
|
|
208
|
+
}), g.value.export && e(p, null, {
|
|
209
|
+
trigger: () => e(c, {
|
|
210
|
+
loading: q.value,
|
|
211
|
+
onClick: J
|
|
212
|
+
}, {
|
|
213
|
+
icon: () => e("div", {
|
|
214
|
+
class: "i-tabler:database-export size-4"
|
|
215
|
+
}, null)
|
|
216
|
+
}),
|
|
217
|
+
default: () => r("components.button.export")
|
|
218
|
+
}), g.value.import && e(p, null, {
|
|
219
|
+
trigger: () => e(c, {
|
|
220
|
+
loading: H.value,
|
|
221
|
+
onClick: G
|
|
222
|
+
}, {
|
|
223
|
+
icon: () => e("div", {
|
|
224
|
+
class: "i-tabler:database-import size-4"
|
|
225
|
+
}, null)
|
|
226
|
+
}),
|
|
227
|
+
default: () => r("components.button.import")
|
|
228
|
+
}), g.value.refresh && e(p, null, {
|
|
229
|
+
trigger: () => e(c, {
|
|
230
|
+
onClick: U
|
|
231
|
+
}, {
|
|
232
|
+
icon: () => L.value ? e(pe, {
|
|
233
|
+
class: "size-4",
|
|
234
|
+
type: "circle",
|
|
235
|
+
percentage: x.value * 10,
|
|
236
|
+
strokeWidth: 20,
|
|
237
|
+
color: "rgba(var(--ui-color-primary))"
|
|
238
|
+
}, {
|
|
239
|
+
default: () => [e("span", {
|
|
240
|
+
class: "text-8px"
|
|
241
|
+
}, [x.value])]
|
|
242
|
+
}) : e("div", {
|
|
243
|
+
class: "i-tabler:refresh size-4"
|
|
244
|
+
}, null)
|
|
245
|
+
}),
|
|
246
|
+
default: () => r("components.button.autoRefresh")
|
|
247
|
+
})]), e("div", {
|
|
248
|
+
class: "flex gap-2 justify-end"
|
|
249
|
+
}, [(C = t.actions) == null ? void 0 : C.call(t), ((S = l.actions) == null ? void 0 : S.length) > 0 && I({
|
|
250
|
+
type: y.value < 1024 ? "dropdown" : "button",
|
|
251
|
+
items: l.actions
|
|
252
|
+
})])])]), e("div", {
|
|
253
|
+
class: "flex-1 min-h-0"
|
|
254
|
+
}, [(z = t == null ? void 0 : t.default) == null ? void 0 : z.call(t, {
|
|
255
|
+
...b,
|
|
256
|
+
width: Q.value
|
|
257
|
+
})]), e("div", {
|
|
258
|
+
class: "flex justify-between"
|
|
259
|
+
}, [e("div", null, [(R = t == null ? void 0 : t.bottom) == null ? void 0 : R.call(t)]), e("div", null, [l.pagination && e(fe, ae(O.value, {
|
|
260
|
+
simple: y.value < 768
|
|
261
|
+
}), {
|
|
262
|
+
prefix: () => {
|
|
263
|
+
var n;
|
|
264
|
+
return e("div", null, [r("components.list.total", {
|
|
265
|
+
total: ((n = d == null ? void 0 : d.value) == null ? void 0 : n.total) || 0
|
|
266
|
+
})]);
|
|
267
|
+
}
|
|
268
|
+
})])]), e(be, {
|
|
269
|
+
number: ((T = W.value.checkedRowKeys) == null ? void 0 : T.length) || 0 || 0,
|
|
270
|
+
group: [[{
|
|
271
|
+
icon: "i-tabler:x",
|
|
272
|
+
onClick: () => {
|
|
273
|
+
m == null || m([]);
|
|
274
|
+
}
|
|
275
|
+
}], [{
|
|
276
|
+
label: r("components.button.export"),
|
|
277
|
+
icon: "i-tabler:file-export",
|
|
278
|
+
loading: F.value,
|
|
279
|
+
onClick: K
|
|
280
|
+
}, {
|
|
281
|
+
label: r("components.button.delete"),
|
|
282
|
+
type: "error",
|
|
283
|
+
icon: "i-tabler:trash"
|
|
284
|
+
}]]
|
|
285
|
+
}, null)]);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
export {
|
|
291
|
+
Be as DuxTableLayout
|
|
292
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as c, computed as s, createVNode as e, Transition as p, Fragment as m } from "vue";
|
|
2
|
+
import { useI18n as y } from "@duxweb/dvha-core";
|
|
3
|
+
import { NButton as u, NDropdown as g } from "naive-ui";
|
|
4
|
+
const x = /* @__PURE__ */ c({
|
|
5
|
+
name: "DuxTableTools",
|
|
6
|
+
props: {
|
|
7
|
+
number: {
|
|
8
|
+
type: Number
|
|
9
|
+
},
|
|
10
|
+
options: {
|
|
11
|
+
type: Array
|
|
12
|
+
},
|
|
13
|
+
group: {
|
|
14
|
+
type: Array
|
|
15
|
+
},
|
|
16
|
+
dropdown: {
|
|
17
|
+
type: Array
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(t) {
|
|
21
|
+
const {
|
|
22
|
+
t: i
|
|
23
|
+
} = y(), l = s(() => t.group ? t.group : [t.options]), d = s(() => t.number && t.number > 0);
|
|
24
|
+
return () => e("div", {
|
|
25
|
+
class: "absolute bottom-0 left-0 right-0 pointer-events-none"
|
|
26
|
+
}, [e(p, {
|
|
27
|
+
name: "slide-up",
|
|
28
|
+
appear: !0,
|
|
29
|
+
enterActiveClass: "transition-all duration-200 ease-out",
|
|
30
|
+
enterFromClass: "transform translate-y-full opacity-0",
|
|
31
|
+
enterToClass: "transform translate-y-0 opacity-100",
|
|
32
|
+
leaveActiveClass: "transition-all duration-200 ease-in",
|
|
33
|
+
leaveFromClass: "transform translate-y-0 opacity-100",
|
|
34
|
+
leaveToClass: "transform translate-y-full opacity-0"
|
|
35
|
+
}, {
|
|
36
|
+
default: () => {
|
|
37
|
+
var r;
|
|
38
|
+
return [d.value ? e("div", {
|
|
39
|
+
class: "flex h-12 px-1 justify-between lg:justify-center gap-2 pointer-events-auto backdrop-blur"
|
|
40
|
+
}, [(r = l.value) == null ? void 0 : r.map((n, o) => e("div", {
|
|
41
|
+
class: "h-10 mt-1 bg-gray-800 rounded px-4 py-1 shadow-lg flex items-center gap-4"
|
|
42
|
+
}, [o === l.value.length - 1 && e(m, null, [e("span", {
|
|
43
|
+
class: "text-gray-300"
|
|
44
|
+
}, [i("components.list.selectedItems", {
|
|
45
|
+
num: t.number || 0
|
|
46
|
+
})]), e("div", {
|
|
47
|
+
class: "w-px h-4 bg-gray-600"
|
|
48
|
+
}, null)]), n == null ? void 0 : n.map((a) => e(u, {
|
|
49
|
+
text: !0,
|
|
50
|
+
onClick: a.onClick,
|
|
51
|
+
class: "text-gray-300",
|
|
52
|
+
loading: a.loading,
|
|
53
|
+
disabled: a.disabled,
|
|
54
|
+
type: a.type
|
|
55
|
+
}, {
|
|
56
|
+
default: () => a.label,
|
|
57
|
+
icon: () => e("div", {
|
|
58
|
+
class: a.icon
|
|
59
|
+
}, null)
|
|
60
|
+
})), o === l.value.length - 1 && t.dropdown && t.dropdown.length > 0 && e(g, {
|
|
61
|
+
options: t.dropdown
|
|
62
|
+
}, {
|
|
63
|
+
default: () => [e(u, {
|
|
64
|
+
text: !0,
|
|
65
|
+
class: "text-gray-300"
|
|
66
|
+
}, {
|
|
67
|
+
icon: () => e("div", {
|
|
68
|
+
class: "i-tabler:dots-vertical size-4"
|
|
69
|
+
}, null)
|
|
70
|
+
})]
|
|
71
|
+
})]))]) : null];
|
|
72
|
+
}
|
|
73
|
+
})]);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
x as DuxTableTools
|
|
78
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as W, ref as R, computed as l, toRef as S, createVNode as s } from "vue";
|
|
2
|
+
import { useElementSize as y, useWindowSize as z, watchDebounced as M } from "@vueuse/core";
|
|
3
|
+
import { DuxListLayout as g } from "../layout/list.js";
|
|
4
|
+
const L = /* @__PURE__ */ W({
|
|
5
|
+
name: "DuxCardPage",
|
|
6
|
+
props: {
|
|
7
|
+
colWidth: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 320
|
|
10
|
+
},
|
|
11
|
+
rows: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 4
|
|
14
|
+
},
|
|
15
|
+
maxRows: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 10
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
extends: g,
|
|
21
|
+
slots: Object,
|
|
22
|
+
setup(e, {
|
|
23
|
+
slots: a
|
|
24
|
+
}) {
|
|
25
|
+
const h = R(), {
|
|
26
|
+
width: u
|
|
27
|
+
} = y(h), {
|
|
28
|
+
width: f
|
|
29
|
+
} = z(), w = l(() => e.colWidth || 320), r = (t = 0) => {
|
|
30
|
+
const i = t || f.value || 1024, o = e.colWidth || 320, c = e.rows || 4, b = e.maxRows || 10, d = 0.25 * 16 * 3, m = Math.max(1, Math.floor((i + d) / (o + d))), x = Math.floor((1920 + d) / (o + d)) * c, C = Math.ceil(x / m), v = Math.min(Math.max(C, c), b);
|
|
31
|
+
return m * v;
|
|
32
|
+
}, n = S(e.pagination && typeof e.pagination == "object" ? e.pagination : {
|
|
33
|
+
page: 1,
|
|
34
|
+
pageSize: r()
|
|
35
|
+
});
|
|
36
|
+
M([u], () => {
|
|
37
|
+
if (e.pagination && typeof e.pagination == "object")
|
|
38
|
+
return;
|
|
39
|
+
const t = r(u.value);
|
|
40
|
+
t !== n.value.pageSize && (n.value.pageSize = t, n.value.page = 1);
|
|
41
|
+
}, {
|
|
42
|
+
debounce: 300
|
|
43
|
+
});
|
|
44
|
+
const p = l(() => {
|
|
45
|
+
const {
|
|
46
|
+
maxRows: t,
|
|
47
|
+
rows: i,
|
|
48
|
+
colWidth: o,
|
|
49
|
+
...c
|
|
50
|
+
} = e;
|
|
51
|
+
return {
|
|
52
|
+
...c,
|
|
53
|
+
pagination: n.value
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return () => s(g, p.value, {
|
|
57
|
+
default: (t) => s("div", {
|
|
58
|
+
class: "grid gap-3",
|
|
59
|
+
style: {
|
|
60
|
+
"grid-template-columns": `repeat(auto-fit, minmax(${w.value}px, 1fr))`
|
|
61
|
+
}
|
|
62
|
+
}, [t.list.value.map((i) => {
|
|
63
|
+
var o;
|
|
64
|
+
return (o = a == null ? void 0 : a.default) == null ? void 0 : o.call(a, {
|
|
65
|
+
item: i,
|
|
66
|
+
isChecked: t.isChecked,
|
|
67
|
+
toggleChecked: t.toggleChecked
|
|
68
|
+
});
|
|
69
|
+
})]),
|
|
70
|
+
actions: a.actions,
|
|
71
|
+
tools: a.tools,
|
|
72
|
+
bottom: a.bottom
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
L as DuxCardPage
|
|
78
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as p, computed as r, createVNode as a } from "vue";
|
|
2
|
+
import { DuxListLayout as c } from "../layout/list.js";
|
|
3
|
+
const f = /* @__PURE__ */ p({
|
|
4
|
+
name: "DuxListPage",
|
|
5
|
+
props: {},
|
|
6
|
+
extends: c,
|
|
7
|
+
slots: Object,
|
|
8
|
+
setup(i, {
|
|
9
|
+
slots: e
|
|
10
|
+
}) {
|
|
11
|
+
const n = r(() => {
|
|
12
|
+
const {
|
|
13
|
+
...t
|
|
14
|
+
} = i;
|
|
15
|
+
return {
|
|
16
|
+
...t
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
return () => a(c, n.value, {
|
|
20
|
+
default: (t) => a("div", {
|
|
21
|
+
class: "flex flex-col gap-3"
|
|
22
|
+
}, [t.list.value.map((d) => {
|
|
23
|
+
var o;
|
|
24
|
+
return (o = e == null ? void 0 : e.default) == null ? void 0 : o.call(e, {
|
|
25
|
+
item: d,
|
|
26
|
+
isChecked: t.isChecked,
|
|
27
|
+
toggleChecked: t.toggleChecked
|
|
28
|
+
});
|
|
29
|
+
})]),
|
|
30
|
+
actions: e.actions,
|
|
31
|
+
tools: e.tools,
|
|
32
|
+
bottom: e.bottom
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
f as DuxListPage
|
|
38
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineComponent as h, computed as y, createVNode as i, Fragment as k, isVNode as A } from "vue";
|
|
2
|
+
import N from "clsx";
|
|
3
|
+
import { NAvatar as b, NImageGroup as S, NImage as C } from "naive-ui";
|
|
4
|
+
function j(e) {
|
|
5
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !A(e);
|
|
6
|
+
}
|
|
7
|
+
const D = /* @__PURE__ */ h({
|
|
8
|
+
name: "DuxMedia",
|
|
9
|
+
props: {
|
|
10
|
+
title: String,
|
|
11
|
+
avatar: Boolean,
|
|
12
|
+
image: [String, Array],
|
|
13
|
+
desc: [String, Array],
|
|
14
|
+
extend: String,
|
|
15
|
+
onClick: Function,
|
|
16
|
+
imageWidth: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 48
|
|
19
|
+
},
|
|
20
|
+
imageHeight: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 48
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(e, {
|
|
26
|
+
slots: a
|
|
27
|
+
}) {
|
|
28
|
+
const c = y(() => Array.isArray(e.image) ? e.image : e.image ? [e.image] : []), t = y(() => Array.isArray(e.desc) ? e.desc : e.desc ? [e.desc] : []);
|
|
29
|
+
return () => {
|
|
30
|
+
var u, r, g, x, f, l, v;
|
|
31
|
+
let m;
|
|
32
|
+
return i("div", {
|
|
33
|
+
class: "flex gap-2 items-center"
|
|
34
|
+
}, [(a == null ? void 0 : a.image) && i("div", {
|
|
35
|
+
class: "flex-none flex items-center gap-2"
|
|
36
|
+
}, [(u = a == null ? void 0 : a.image) == null ? void 0 : u.call(a)]), (c == null ? void 0 : c.value.length) > 0 && i("div", {
|
|
37
|
+
class: "flex-none flex items-center gap-2"
|
|
38
|
+
}, [e.avatar ? i(k, null, [c.value.map((n, d) => i(b, {
|
|
39
|
+
key: d,
|
|
40
|
+
src: n,
|
|
41
|
+
round: !0,
|
|
42
|
+
size: e.imageWidth
|
|
43
|
+
}, null))]) : i(S, null, j(m = c.value.map((n, d) => i(C, {
|
|
44
|
+
key: d,
|
|
45
|
+
src: n,
|
|
46
|
+
class: "rounded",
|
|
47
|
+
objectFit: "cover",
|
|
48
|
+
width: e.imageWidth,
|
|
49
|
+
height: e.imageHeight
|
|
50
|
+
}, null))) ? m : {
|
|
51
|
+
default: () => [m]
|
|
52
|
+
})]), i("div", {
|
|
53
|
+
class: "flex-1 flex-col gap-2 min-w-0 truncate items-center"
|
|
54
|
+
}, [i("div", {
|
|
55
|
+
class: "flex gap-2 items-center"
|
|
56
|
+
}, [(r = a.prefix) == null ? void 0 : r.call(a), (e.title || a.default) && i("div", {
|
|
57
|
+
onClick: () => {
|
|
58
|
+
var n;
|
|
59
|
+
return (n = e.onClick) == null ? void 0 : n.call(e);
|
|
60
|
+
},
|
|
61
|
+
class: N(["transition-all truncate text-default", (e == null ? void 0 : e.onClick) && "hover:text-primary cursor-pointer"])
|
|
62
|
+
}, [e.title || ((g = a.default) == null ? void 0 : g.call(a))])]), ((t == null ? void 0 : t.value.length) > 0 || a.desc) && i("div", {
|
|
63
|
+
class: "text-sm text-muted flex flex-col gap-0"
|
|
64
|
+
}, [(f = t == null ? void 0 : (x = t.value).map) == null ? void 0 : f.call(x, (n, d) => i("div", {
|
|
65
|
+
key: d,
|
|
66
|
+
class: "truncate"
|
|
67
|
+
}, [n])), (l = a.desc) == null ? void 0 : l.call(a)])]), (e == null ? void 0 : e.extend) && i("div", {
|
|
68
|
+
class: "flex-none flex items-center gap-2 text-gray-7"
|
|
69
|
+
}, [e == null ? void 0 : e.extend]), (a == null ? void 0 : a.extend) && i("div", {
|
|
70
|
+
class: "flex-none flex items-center gap-2 text-gray-7"
|
|
71
|
+
}, [(v = a == null ? void 0 : a.extend) == null ? void 0 : v.call(a)])]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
D as DuxMedia
|
|
77
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineComponent as p, defineAsyncComponent as x, ref as l, watch as C, createVNode as t, Suspense as k, mergeProps as D } from "vue";
|
|
2
|
+
import { useWindowSize as M, useElementSize as F, useDraggable as S, useThrottleFn as N } from "@vueuse/core";
|
|
3
|
+
import { useFocusTrap as P } from "../../node_modules/@vueuse/integrations/useFocusTrap.js";
|
|
4
|
+
import { useMessage as j, NCard as z, NSpin as O } from "naive-ui";
|
|
5
|
+
const A = /* @__PURE__ */ p({
|
|
6
|
+
name: "DuxModal",
|
|
7
|
+
props: {
|
|
8
|
+
title: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
component: {
|
|
13
|
+
type: Function
|
|
14
|
+
},
|
|
15
|
+
componentProps: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => ({})
|
|
18
|
+
},
|
|
19
|
+
width: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 500
|
|
22
|
+
},
|
|
23
|
+
onClose: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: () => {
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
onConfirm: {
|
|
29
|
+
type: Function,
|
|
30
|
+
default: () => {
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
draggable: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(e) {
|
|
39
|
+
const u = x(e.component), c = j(), s = l(), r = l(), o = l(), {
|
|
40
|
+
width: f,
|
|
41
|
+
height: g
|
|
42
|
+
} = M(), {
|
|
43
|
+
width: m,
|
|
44
|
+
height: h
|
|
45
|
+
} = F(o), {
|
|
46
|
+
style: w,
|
|
47
|
+
x: y,
|
|
48
|
+
y: v
|
|
49
|
+
} = S(s, {
|
|
50
|
+
initialValue: {
|
|
51
|
+
x: -1e3,
|
|
52
|
+
y: -1e3
|
|
53
|
+
},
|
|
54
|
+
preventDefault: !0,
|
|
55
|
+
handle: r,
|
|
56
|
+
disabled: !e.draggable
|
|
57
|
+
}), i = l(!1);
|
|
58
|
+
C([m, h, i], ([n, a]) => {
|
|
59
|
+
!n || !a || i.value || (i.value = !0, y.value = Math.max(0, (f.value - n) / 2), v.value = Math.max(0, (g.value - a) / 2));
|
|
60
|
+
});
|
|
61
|
+
const d = l(), b = N(() => {
|
|
62
|
+
c.warning("请先关闭当前窗口再操作其他窗口");
|
|
63
|
+
}, 3e3);
|
|
64
|
+
return P(d, {
|
|
65
|
+
immediate: !0,
|
|
66
|
+
escapeDeactivates: !0,
|
|
67
|
+
clickOutsideDeactivates: !1,
|
|
68
|
+
allowOutsideClick: (n) => {
|
|
69
|
+
const a = n.target.closest('[role="dialog"]');
|
|
70
|
+
return a && a !== o.value ? (b(), !1) : !0;
|
|
71
|
+
},
|
|
72
|
+
onDeactivate: () => {
|
|
73
|
+
e.onClose();
|
|
74
|
+
}
|
|
75
|
+
}), () => t("div", {
|
|
76
|
+
class: `fixed inset-0 overflow-auto flex items-center justify-center p-4 ${e.draggable ? "pointer-events-none" : ""}`,
|
|
77
|
+
style: "align-items: safe center;"
|
|
78
|
+
}, [t("div", {
|
|
79
|
+
ref: s,
|
|
80
|
+
style: w.value,
|
|
81
|
+
class: e.draggable ? "fixed pointer-events-auto" : "w-full max-w-none flex justify-center"
|
|
82
|
+
}, [t(z, {
|
|
83
|
+
ref: o,
|
|
84
|
+
contentClass: "p-0!",
|
|
85
|
+
bordered: !!e.draggable,
|
|
86
|
+
size: "small",
|
|
87
|
+
role: "dialog",
|
|
88
|
+
"aria-modal": "true",
|
|
89
|
+
class: [" max-w-full shadow-lg shadow-gray-950/10 bg-white/80 dark:shadow-gray-950/80 dark:bg-gray-900/90 backdrop-blur"],
|
|
90
|
+
style: {
|
|
91
|
+
width: `${e.width}px`
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
default: () => [t(k, null, {
|
|
95
|
+
default: () => t(u, D(e.componentProps, {
|
|
96
|
+
ref: d,
|
|
97
|
+
handle: r,
|
|
98
|
+
draggable: e.draggable,
|
|
99
|
+
onClose: e.onClose,
|
|
100
|
+
onConfirm: e.onConfirm
|
|
101
|
+
}), null),
|
|
102
|
+
fallback: () => t(O, {
|
|
103
|
+
show: !0
|
|
104
|
+
}, {
|
|
105
|
+
default: () => [t("div", {
|
|
106
|
+
class: "h-100"
|
|
107
|
+
}, null)]
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
})])]);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export {
|
|
114
|
+
A as DuxModal,
|
|
115
|
+
A as default
|
|
116
|
+
};
|