@ibiz-template/vue3-components 0.7.38-alpha.12 → 0.7.38-alpha.21
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/index-3cxXHoLs.js +4 -0
- package/dist/{index-B_Fo_3Rt.js → index-CiEIUSX9.js} +1 -1
- package/dist/{index-BvI3oZGL.js → index-HW5stxcy.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-XDKOLzzW.js → xlsx-util-BlkeQIMu.js} +1 -1
- package/es/common/action-toolbar/action-toolbar.mjs +6 -3
- package/es/common/control-navigation/control-navigation.css +1 -0
- package/es/common/control-navigation/control-navigation.d.ts +32 -0
- package/es/common/control-navigation/control-navigation.mjs +116 -0
- package/es/common/control-navigation/provider/calendar-navigation.provider.d.ts +17 -0
- package/es/common/control-navigation/provider/calendar-navigation.provider.mjs +55 -0
- package/es/common/control-navigation/provider/index.d.ts +10 -0
- package/es/common/control-navigation/provider/index.mjs +17 -0
- package/es/common/control-navigation/provider/navigation-base.provider.d.ts +84 -0
- package/es/common/control-navigation/provider/navigation-base.provider.mjs +142 -0
- package/es/common/control-navigation/provider/tree-navigation.provider.d.ts +30 -0
- package/es/common/control-navigation/provider/tree-navigation.provider.mjs +81 -0
- package/es/common/custom-theme/custom-theme-model.mjs +5 -13
- package/es/common/gantt-setting/gantt-setting.css +1 -0
- package/es/common/gantt-setting/gantt-setting.d.ts +53 -0
- package/es/common/gantt-setting/gantt-setting.mjs +217 -0
- package/es/common/grid-setting/grid-setting.css +1 -1
- package/es/common/grid-setting/grid-setting.d.ts +2 -1
- package/es/common/grid-setting/grid-setting.mjs +20 -4
- package/es/common/index.mjs +6 -0
- package/es/common/nav-split/nav-split.css +1 -0
- package/es/common/nav-split/nav-split.d.ts +57 -0
- package/es/common/nav-split/nav-split.mjs +209 -0
- package/es/common/pql-editor/utils/index.mjs +30 -40
- package/es/common/split/split.css +1 -1
- package/es/control/app-menu/app-menu.css +1 -1
- package/es/control/app-menu/app-menu.d.ts +3 -0
- package/es/control/app-menu/app-menu.mjs +54 -16
- package/es/control/app-menu/custom-menu-design/custom-menu-design.mjs +11 -3
- package/es/control/app-menu/index.d.ts +3 -0
- package/es/control/calendar/calendar.css +1 -1
- package/es/control/calendar/calendar.d.ts +12 -1
- package/es/control/calendar/calendar.mjs +42 -10
- package/es/control/calendar/index.d.ts +12 -1
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +3 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.mjs +2 -1
- package/es/control/data-view/data-view.css +1 -1
- package/es/control/data-view/data-view.d.ts +1 -0
- package/es/control/data-view/data-view.mjs +21 -3
- package/es/control/data-view/index.d.ts +1 -0
- package/es/control/drbar/drbar.controller.mjs +1 -1
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/drtab/drtab.controller.d.ts +9 -1
- package/es/control/drtab/drtab.controller.mjs +26 -2
- package/es/control/drtab/drtab.css +1 -1
- package/es/control/drtab/drtab.d.ts +3 -1
- package/es/control/drtab/drtab.mjs +68 -9
- package/es/control/drtab/index.d.ts +3 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +4 -0
- package/es/control/form/form-detail/form-tab-panel/form-tab-panel.css +1 -1
- package/es/control/form/form-detail/form-tab-panel/form-tab-panel.mjs +1 -1
- package/es/control/gantt/gantt.css +1 -1
- package/es/control/gantt/gantt.d.ts +2 -4
- package/es/control/gantt/gantt.mjs +82 -25
- package/es/control/gantt/index.d.ts +2 -4
- package/es/control/grid/grid/grid-control.util.mjs +2 -2
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/grid/grid/grid.mjs +75 -71
- package/es/control/list/index.d.ts +1 -0
- package/es/control/list/list.css +1 -1
- package/es/control/list/list.d.ts +1 -0
- package/es/control/list/list.mjs +23 -5
- package/es/control/map/map.d.ts +9 -0
- package/es/control/map/map.mjs +4 -0
- package/es/control/search-bar/search-groups/search-groups.mjs +2 -2
- package/es/control/toolbar/toolbar.mjs +3 -0
- package/es/control/tree/el-tree-util.d.ts +39 -1
- package/es/control/tree/el-tree-util.mjs +70 -2
- package/es/control/tree/index.d.ts +16 -14
- package/es/control/tree/tree.css +1 -1
- package/es/control/tree/tree.d.ts +16 -14
- package/es/control/tree/tree.mjs +60 -31
- package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.css +1 -1
- package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.d.ts +3 -8
- package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.mjs +22 -23
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +1 -0
- package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.mjs +3 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.css +1 -1
- package/es/locale/en/index.d.ts +17 -0
- package/es/locale/en/index.mjs +18 -1
- package/es/locale/zh-CN/index.d.ts +17 -0
- package/es/locale/zh-CN/index.mjs +18 -1
- package/es/panel-component/auth-userinfo/auth-userinfo.css +1 -1
- package/es/panel-component/index-actions/index-actions.css +1 -1
- package/es/panel-component/index.mjs +2 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.controller.mjs +8 -31
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.service.d.ts +1 -1
- package/es/panel-component/nav-breadcrumb/nav-breadcrumb.service.mjs +1 -1
- package/es/panel-component/nav-pos-index/nav-pos-index.controller.mjs +7 -2
- package/es/panel-component/panel-app-title/index.mjs +4 -0
- package/es/panel-component/panel-app-title/panel-app-title.controller.mjs +8 -0
- package/es/panel-component/panel-app-title/panel-app-title.css +1 -1
- package/es/panel-component/panel-app-title/panel-app-title.mjs +112 -108
- package/es/panel-component/panel-index-view-search/panel-index-view-search.css +1 -1
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/es/util/notification-util/notification-util.d.ts +10 -1
- package/es/util/notification-util/notification-util.mjs +36 -0
- package/es/util/notification-util/upload-manager/file-type.d.ts +8 -0
- package/es/util/notification-util/upload-manager/file-type.mjs +207 -0
- package/es/util/notification-util/upload-manager/upload-manager.css +1 -0
- package/es/util/notification-util/upload-manager/upload-manager.d.ts +64 -0
- package/es/util/notification-util/upload-manager/upload-manager.mjs +159 -0
- package/es/util/pagination/use-pagination.mjs +5 -4
- package/es/view-engine/tab-exp-view.engine.d.ts +9 -0
- package/es/view-engine/tab-exp-view.engine.mjs +20 -1
- package/lib/common/action-toolbar/action-toolbar.cjs +6 -3
- package/lib/common/control-navigation/control-navigation.cjs +118 -0
- package/lib/common/control-navigation/control-navigation.css +1 -0
- package/lib/common/control-navigation/provider/calendar-navigation.provider.cjs +57 -0
- package/lib/common/control-navigation/provider/index.cjs +19 -0
- package/lib/common/control-navigation/provider/navigation-base.provider.cjs +144 -0
- package/lib/common/control-navigation/provider/tree-navigation.provider.cjs +83 -0
- package/lib/common/custom-theme/custom-theme-model.cjs +5 -13
- package/lib/common/gantt-setting/gantt-setting.cjs +219 -0
- package/lib/common/gantt-setting/gantt-setting.css +1 -0
- package/lib/common/grid-setting/grid-setting.cjs +20 -4
- package/lib/common/grid-setting/grid-setting.css +1 -1
- package/lib/common/index.cjs +6 -0
- package/lib/common/nav-split/nav-split.cjs +211 -0
- package/lib/common/nav-split/nav-split.css +1 -0
- package/lib/common/pql-editor/utils/index.cjs +30 -40
- package/lib/common/split/split.css +1 -1
- package/lib/control/app-menu/app-menu.cjs +52 -14
- package/lib/control/app-menu/app-menu.css +1 -1
- package/lib/control/app-menu/custom-menu-design/custom-menu-design.cjs +10 -2
- package/lib/control/calendar/calendar.cjs +42 -10
- package/lib/control/calendar/calendar.css +1 -1
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.cjs +2 -1
- package/lib/control/data-view/data-view.cjs +21 -3
- package/lib/control/data-view/data-view.css +1 -1
- package/lib/control/drbar/drbar.controller.cjs +1 -1
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/drtab/drtab.cjs +67 -8
- package/lib/control/drtab/drtab.controller.cjs +26 -2
- package/lib/control/drtab/drtab.css +1 -1
- package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.cjs +1 -1
- package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.css +1 -1
- package/lib/control/gantt/gantt.cjs +80 -23
- package/lib/control/gantt/gantt.css +1 -1
- package/lib/control/grid/grid/grid-control.util.cjs +2 -2
- package/lib/control/grid/grid/grid.cjs +75 -71
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/list/list.cjs +23 -5
- package/lib/control/list/list.css +1 -1
- package/lib/control/map/map.cjs +4 -0
- package/lib/control/search-bar/search-groups/search-groups.cjs +2 -2
- package/lib/control/toolbar/toolbar.cjs +3 -0
- package/lib/control/tree/el-tree-util.cjs +70 -0
- package/lib/control/tree/tree.cjs +58 -29
- package/lib/control/tree/tree.css +1 -1
- package/lib/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.cjs +21 -22
- package/lib/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.css +1 -1
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +1 -0
- package/lib/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.cjs +3 -1
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.css +1 -1
- package/lib/locale/en/index.cjs +18 -1
- package/lib/locale/zh-CN/index.cjs +18 -1
- package/lib/panel-component/auth-userinfo/auth-userinfo.css +1 -1
- package/lib/panel-component/index-actions/index-actions.css +1 -1
- package/lib/panel-component/index.cjs +1 -0
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.controller.cjs +7 -30
- package/lib/panel-component/nav-breadcrumb/nav-breadcrumb.service.cjs +1 -1
- package/lib/panel-component/nav-pos-index/nav-pos-index.controller.cjs +7 -2
- package/lib/panel-component/panel-app-title/index.cjs +4 -0
- package/lib/panel-component/panel-app-title/panel-app-title.cjs +112 -108
- package/lib/panel-component/panel-app-title/panel-app-title.controller.cjs +8 -0
- package/lib/panel-component/panel-app-title/panel-app-title.css +1 -1
- package/lib/panel-component/panel-index-view-search/panel-index-view-search.css +1 -1
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/lib/util/notification-util/notification-util.cjs +36 -0
- package/lib/util/notification-util/upload-manager/file-type.cjs +209 -0
- package/lib/util/notification-util/upload-manager/upload-manager.cjs +161 -0
- package/lib/util/notification-util/upload-manager/upload-manager.css +1 -0
- package/lib/util/pagination/use-pagination.cjs +5 -4
- package/lib/view-engine/tab-exp-view.engine.cjs +19 -0
- package/package.json +10 -10
- package/dist/index-VQ3FT6ih.js +0 -4
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.35-alpha.1_axios@1.7.7_lodash-es@4.17.21_qs@6.13.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.38-alpha.16_axios@1.7.7_lodash-es@4.17.21_qs@6.13.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.35-alpha.1_axios@1.7.7_lodash-es@4.17.21_qs@6.13.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.38-alpha.16_axios@1.7.7_lodash-es@4.17.21_qs@6.13.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IModal, IColumnState } from '@ibiz-template/runtime';
|
|
3
|
+
import './gantt-setting.scss';
|
|
4
|
+
type ListType = 'optional' | 'selected';
|
|
5
|
+
export declare const IBizGanttSetting: import("vue").DefineComponent<{
|
|
6
|
+
modal: {
|
|
7
|
+
type: PropType<IModal>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
columnStates: {
|
|
11
|
+
type: PropType<IColumnState[]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
mustShowColumns: {
|
|
15
|
+
type: PropType<string[]>;
|
|
16
|
+
required: true;
|
|
17
|
+
default: () => string[];
|
|
18
|
+
};
|
|
19
|
+
}, {
|
|
20
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
21
|
+
optionalInput: import("vue").Ref<string>;
|
|
22
|
+
selectedInput: import("vue").Ref<string>;
|
|
23
|
+
states: import("vue").Ref<{
|
|
24
|
+
key: string;
|
|
25
|
+
caption: string;
|
|
26
|
+
hidden: boolean;
|
|
27
|
+
hideMode: number;
|
|
28
|
+
uaColumn: boolean;
|
|
29
|
+
fixed?: "left" | "right" | undefined;
|
|
30
|
+
adaptive?: boolean | undefined;
|
|
31
|
+
}[]>;
|
|
32
|
+
renderSearchList: (listData?: IColumnState[], type?: ListType) => JSX.Element;
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
onConfirm: () => void;
|
|
35
|
+
onResultDefault: () => void;
|
|
36
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
modal: {
|
|
38
|
+
type: PropType<IModal>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
columnStates: {
|
|
42
|
+
type: PropType<IColumnState[]>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
mustShowColumns: {
|
|
46
|
+
type: PropType<string[]>;
|
|
47
|
+
required: true;
|
|
48
|
+
default: () => string[];
|
|
49
|
+
};
|
|
50
|
+
}>> & {}, {
|
|
51
|
+
mustShowColumns: string[];
|
|
52
|
+
}, {}>;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { isVNode, createVNode, defineComponent, ref, watch, resolveComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { clone } from 'ramda';
|
|
4
|
+
import './gantt-setting.css';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function _isSlot(s) {
|
|
8
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
9
|
+
}
|
|
10
|
+
const selectedIcon = () => createVNode("svg", {
|
|
11
|
+
"viewBox": "0 0 16 16",
|
|
12
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
13
|
+
"height": "1em",
|
|
14
|
+
"width": "1em",
|
|
15
|
+
"focusable": "false"
|
|
16
|
+
}, [createVNode("g", {
|
|
17
|
+
"stroke-width": "1",
|
|
18
|
+
"fill-rule": "evenodd"
|
|
19
|
+
}, [createVNode("path", {
|
|
20
|
+
"d": "M6.012 11.201L1.313 6.832l-.817.879 5.54 5.15 9.304-9.163-.842-.855z"
|
|
21
|
+
}, null)])]);
|
|
22
|
+
const closeIcon = () => createVNode("svg", {
|
|
23
|
+
"viewBox": "0 0 16 16",
|
|
24
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
25
|
+
"height": "1em",
|
|
26
|
+
"width": "1em",
|
|
27
|
+
"focusable": "false"
|
|
28
|
+
}, [createVNode("g", {
|
|
29
|
+
"stroke-width": "1",
|
|
30
|
+
"fill-rule": "evenodd"
|
|
31
|
+
}, [createVNode("path", {
|
|
32
|
+
"d": "M7.456 7.456V-.115h1.2v7.571h7.572v1.2H8.656v7.572h-1.2V8.656H-.115v-1.2h7.571z",
|
|
33
|
+
"transform": "rotate(45 8.056 8.056)"
|
|
34
|
+
}, null)])]);
|
|
35
|
+
const searchIcon = () => createVNode("svg", {
|
|
36
|
+
"viewBox": "0 0 16 16",
|
|
37
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
38
|
+
"height": "1em",
|
|
39
|
+
"width": "1em",
|
|
40
|
+
"focusable": "false"
|
|
41
|
+
}, [createVNode("g", {
|
|
42
|
+
"stroke-width": "1",
|
|
43
|
+
"fill-rule": "evenodd"
|
|
44
|
+
}, [createVNode("path", {
|
|
45
|
+
"d": "M6.751 12.303A5.557 5.557 0 0 1 1.2 6.751C1.2 3.691 3.69 1.2 6.751 1.2a5.558 5.558 0 0 1 5.551 5.551 5.557 5.557 0 0 1-5.551 5.552M6.751 0a6.751 6.751 0 1 0 4.309 11.949l3.855 3.855a.6.6 0 1 0 .849-.849l-3.854-3.853A6.751 6.751 0 0 0 6.751 0"
|
|
46
|
+
}, null)])]);
|
|
47
|
+
const IBizGanttSetting = /* @__PURE__ */ defineComponent({
|
|
48
|
+
name: "IBizGanttSetting",
|
|
49
|
+
props: {
|
|
50
|
+
modal: {
|
|
51
|
+
type: Object,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
// 表格列状态数组
|
|
55
|
+
columnStates: {
|
|
56
|
+
type: Object,
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
// 必须显示的列
|
|
60
|
+
mustShowColumns: {
|
|
61
|
+
type: Array,
|
|
62
|
+
required: true,
|
|
63
|
+
default: () => ["sn", "name"]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
emits: [],
|
|
67
|
+
setup(props) {
|
|
68
|
+
const ns = useNamespace("gantt-setting");
|
|
69
|
+
const optionalInput = ref("");
|
|
70
|
+
const selectedInput = ref("");
|
|
71
|
+
const states = ref([]);
|
|
72
|
+
const calcMustShowColumn = (item) => {
|
|
73
|
+
return props.mustShowColumns.some((item2) => item.key === item2);
|
|
74
|
+
};
|
|
75
|
+
const initData = () => {
|
|
76
|
+
states.value = clone(props.columnStates);
|
|
77
|
+
};
|
|
78
|
+
watch(() => props.columnStates, () => {
|
|
79
|
+
initData();
|
|
80
|
+
}, {
|
|
81
|
+
immediate: true,
|
|
82
|
+
deep: true
|
|
83
|
+
});
|
|
84
|
+
const onListItemClose = (e, item) => {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
Object.assign(item, {
|
|
87
|
+
hidden: !item.hidden
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const onListItemClick = (item) => {
|
|
91
|
+
Object.assign(item, {
|
|
92
|
+
hidden: !item.hidden
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const onClose = () => {
|
|
96
|
+
props.modal.dismiss();
|
|
97
|
+
};
|
|
98
|
+
const onConfirm = () => {
|
|
99
|
+
const modalData = {
|
|
100
|
+
ok: true,
|
|
101
|
+
data: states.value
|
|
102
|
+
};
|
|
103
|
+
props.modal.dismiss(modalData);
|
|
104
|
+
};
|
|
105
|
+
const onResultDefault = () => {
|
|
106
|
+
initData();
|
|
107
|
+
};
|
|
108
|
+
const renderLeftSearch = () => {
|
|
109
|
+
return createVNode(resolveComponent("el-input"), {
|
|
110
|
+
"placeholder": ibiz.i18n.t("app.search"),
|
|
111
|
+
"modelValue": optionalInput.value,
|
|
112
|
+
"onUpdate:modelValue": ($event) => optionalInput.value = $event,
|
|
113
|
+
"clearable": true
|
|
114
|
+
}, {
|
|
115
|
+
prefix: () => searchIcon()
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
const renderRightSearch = () => {
|
|
119
|
+
return createVNode(resolveComponent("el-input"), {
|
|
120
|
+
"placeholder": ibiz.i18n.t("app.search"),
|
|
121
|
+
"modelValue": selectedInput.value,
|
|
122
|
+
"onUpdate:modelValue": ($event) => selectedInput.value = $event,
|
|
123
|
+
"clearable": true
|
|
124
|
+
}, {
|
|
125
|
+
prefix: () => searchIcon()
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const renderListItem = (item, type = "optional") => {
|
|
129
|
+
const caption = item.caption || "";
|
|
130
|
+
const isOptional = type === "optional";
|
|
131
|
+
const isMust = calcMustShowColumn(item);
|
|
132
|
+
if (!isOptional && item.hidden && !isMust) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
const isSelectedShow = isOptional && states.value.some((item2) => item.key === item2.key && !item.hidden);
|
|
136
|
+
return createVNode("div", {
|
|
137
|
+
"class": [ns.b("list-item"), ns.is("disabled", isMust && isOptional)],
|
|
138
|
+
"onClick": () => isOptional && !isMust && onListItemClick(item)
|
|
139
|
+
}, [createVNode("div", {
|
|
140
|
+
"class": ns.be("list-item", "caption")
|
|
141
|
+
}, [caption]), createVNode("div", {
|
|
142
|
+
"class": [ns.be("list-item", "end-icon")]
|
|
143
|
+
}, [(isSelectedShow || isOptional && isMust) && selectedIcon(), !isOptional && !isMust && createVNode("div", {
|
|
144
|
+
"class": ns.bem("list-item", "end-icon", "close"),
|
|
145
|
+
"onClick": (e) => onListItemClose(e, item)
|
|
146
|
+
}, [closeIcon()])])]);
|
|
147
|
+
};
|
|
148
|
+
const renderSearchList = (listData = [], type = "optional") => {
|
|
149
|
+
const isOptional = type === "optional";
|
|
150
|
+
const searchVal = isOptional ? optionalInput.value : selectedInput.value;
|
|
151
|
+
const values = [];
|
|
152
|
+
listData.forEach((item) => {
|
|
153
|
+
var _a;
|
|
154
|
+
return ((_a = item.caption) == null ? void 0 : _a.includes(searchVal)) && values.push(item);
|
|
155
|
+
});
|
|
156
|
+
const lengthNum = isOptional ? values.length : listData.filter((item) => !item.hidden).length;
|
|
157
|
+
const caption = isOptional ? ibiz.i18n.t("component.ganttSetting.optionalAttribute") : ibiz.i18n.t("component.ganttSetting.selectedAttribute");
|
|
158
|
+
return createVNode("div", {
|
|
159
|
+
"class": ns.b("search-list")
|
|
160
|
+
}, [createVNode("div", {
|
|
161
|
+
"class": ns.be("search-list", "caption")
|
|
162
|
+
}, ["".concat(caption, " \xB7 ").concat(lengthNum)]), createVNode("div", {
|
|
163
|
+
"class": ns.be("search-list", "content")
|
|
164
|
+
}, [createVNode("div", {
|
|
165
|
+
"class": ns.be("search-list", "search")
|
|
166
|
+
}, [isOptional ? renderLeftSearch() : renderRightSearch()]), createVNode("div", {
|
|
167
|
+
"class": ns.be("search-list", "list")
|
|
168
|
+
}, [values.map((item) => {
|
|
169
|
+
return renderListItem(item, type);
|
|
170
|
+
})])])]);
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
ns,
|
|
174
|
+
optionalInput,
|
|
175
|
+
selectedInput,
|
|
176
|
+
states,
|
|
177
|
+
renderSearchList,
|
|
178
|
+
onClose,
|
|
179
|
+
onConfirm,
|
|
180
|
+
onResultDefault
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
render() {
|
|
184
|
+
let _slot, _slot2, _slot3;
|
|
185
|
+
return createVNode("div", {
|
|
186
|
+
"class": [this.ns.b()]
|
|
187
|
+
}, [createVNode("div", {
|
|
188
|
+
"class": [this.ns.e("header")]
|
|
189
|
+
}, [ibiz.i18n.t("component.ganttSetting.headerCaption")]), createVNode("div", {
|
|
190
|
+
"class": [this.ns.e("content")]
|
|
191
|
+
}, [createVNode("div", {
|
|
192
|
+
"class": [this.ns.em("content", "optional")]
|
|
193
|
+
}, [this.renderSearchList(this.states, "optional")]), createVNode("div", {
|
|
194
|
+
"class": [this.ns.em("content", "selected")]
|
|
195
|
+
}, [this.renderSearchList(this.states, "selected")])]), createVNode("div", {
|
|
196
|
+
"class": [this.ns.e("bottom")]
|
|
197
|
+
}, [createVNode(resolveComponent("el-button"), {
|
|
198
|
+
"type": "text",
|
|
199
|
+
"onClick": this.onResultDefault
|
|
200
|
+
}, _isSlot(_slot = ibiz.i18n.t("component.ganttSetting.resultDefault")) ? _slot : {
|
|
201
|
+
default: () => [_slot]
|
|
202
|
+
}), createVNode("div", {
|
|
203
|
+
"class": [this.ns.em("bottom", "btn-right")]
|
|
204
|
+
}, [createVNode(resolveComponent("el-button"), {
|
|
205
|
+
"type": "text",
|
|
206
|
+
"onClick": this.onClose
|
|
207
|
+
}, _isSlot(_slot2 = ibiz.i18n.t("app.cancel")) ? _slot2 : {
|
|
208
|
+
default: () => [_slot2]
|
|
209
|
+
}), createVNode(resolveComponent("el-button"), {
|
|
210
|
+
"onClick": this.onConfirm
|
|
211
|
+
}, _isSlot(_slot3 = ibiz.i18n.t("app.confirm")) ? _slot3 : {
|
|
212
|
+
default: () => [_slot3]
|
|
213
|
+
})])])]);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
export { IBizGanttSetting };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-grid-setting-column-states{width:100%;max-height:500px;overflow-y:auto}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state{display:flex;align-items:center;justify-content:flex-start;width:100%;padding:var(--ibiz-spacing-extra-tight) 0;font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state ion-icon{display:inline-block;width:var(--ibiz-font-size-small);margin-right:var(--ibiz-spacing-extra-tight);font-size:var(--ibiz-font-size-regular)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-drag-icon{color:var(--ibiz-color-text)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-enable-icon{color:var(--ibiz-color-success)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-disable-icon{display:none;color:var(--ibiz-color-danger)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-state-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled .ibiz-grid-setting-enable-icon{display:none}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled .ibiz-grid-setting-disable-icon{display:block}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled .ibiz-grid-setting-state-caption{color:var(--ibiz-color-disabled-text)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state-ghost{background-color:var(--ibiz-color-primary-light-default);opacity:.5}.ibiz-grid-setting-set-icon{color:var(--ibiz-color-primary);cursor:pointer}
|
|
1
|
+
.ibiz-grid-setting-column-states{width:100%;max-height:500px;overflow-y:auto}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state{display:flex;align-items:center;justify-content:flex-start;width:100%;padding:var(--ibiz-spacing-extra-tight) 0;font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state ion-icon{display:inline-block;width:var(--ibiz-font-size-small);margin-right:var(--ibiz-spacing-extra-tight);font-size:var(--ibiz-font-size-regular)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-drag-icon{color:var(--ibiz-color-text)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-enable-icon{color:var(--ibiz-color-success)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-disable-icon{display:none;color:var(--ibiz-color-danger)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state .ibiz-grid-setting-state-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled .ibiz-grid-setting-enable-icon{display:none}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled .ibiz-grid-setting-disable-icon{display:block}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled .ibiz-grid-setting-state-caption{color:var(--ibiz-color-disabled-text)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state-ghost{background-color:var(--ibiz-color-primary-light-default);opacity:.5}.ibiz-grid-setting-set-icon{color:var(--ibiz-color-primary);cursor:pointer}.ibiz-grid-setting__nav-icon{cursor:pointer;color:var(--ibiz-color-primary);padding-left:var(--ibiz-spacing-tight)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import './grid-setting.scss';
|
|
3
2
|
import { GridController, IColumnState } from '@ibiz-template/runtime';
|
|
3
|
+
import './grid-setting.scss';
|
|
4
4
|
export declare const IBizGridSetting: import("vue").DefineComponent<{
|
|
5
5
|
columnStates: {
|
|
6
6
|
type: PropType<IColumnState[]>;
|
|
@@ -25,6 +25,7 @@ export declare const IBizGridSetting: import("vue").DefineComponent<{
|
|
|
25
25
|
isDraggable: import("vue").ComputedRef<boolean>;
|
|
26
26
|
handleClick: (dragColumnState: IColumnState) => void;
|
|
27
27
|
onDragChange: (evt: IData) => Promise<void>;
|
|
28
|
+
onShowNavView: () => void;
|
|
28
29
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
30
|
columnStates: {
|
|
30
31
|
type: PropType<IColumnState[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode, resolveComponent } from 'vue';
|
|
2
2
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
-
import './grid-setting.css';
|
|
4
3
|
import draggable from 'vuedraggable';
|
|
5
4
|
import { showTitle } from '@ibiz-template/core';
|
|
5
|
+
import './grid-setting.css';
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
8
8
|
const IBizGridSetting = /* @__PURE__ */ defineComponent({
|
|
@@ -49,17 +49,23 @@ const IBizGridSetting = /* @__PURE__ */ defineComponent({
|
|
|
49
49
|
c.changeColumnStateSort(movedDragColumnState.key, newIndex, oldIndex);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
+
const onShowNavView = () => {
|
|
53
|
+
c.state.showNavView = !c.state.showNavView;
|
|
54
|
+
};
|
|
52
55
|
return {
|
|
53
56
|
ns,
|
|
54
57
|
c,
|
|
55
58
|
dragColumnStates,
|
|
56
59
|
isDraggable,
|
|
57
60
|
handleClick,
|
|
58
|
-
onDragChange
|
|
61
|
+
onDragChange,
|
|
62
|
+
onShowNavView
|
|
59
63
|
};
|
|
60
64
|
},
|
|
61
65
|
render() {
|
|
62
|
-
return createVNode(
|
|
66
|
+
return createVNode("div", {
|
|
67
|
+
"class": this.ns.b()
|
|
68
|
+
}, [createVNode(resolveComponent("el-popover"), {
|
|
63
69
|
"placement": "right-start",
|
|
64
70
|
"trigger": "click",
|
|
65
71
|
"width": "auto"
|
|
@@ -115,7 +121,17 @@ const IBizGridSetting = /* @__PURE__ */ defineComponent({
|
|
|
115
121
|
}
|
|
116
122
|
});
|
|
117
123
|
}
|
|
118
|
-
})
|
|
124
|
+
}), this.c.state.enableNavView ? !this.c.state.showNavView ? createVNode("ion-icon", {
|
|
125
|
+
"class": this.ns.e("nav-icon"),
|
|
126
|
+
"title": ibiz.i18n.t("component.controlNavigation.showNav"),
|
|
127
|
+
"name": "eye-outline",
|
|
128
|
+
"onClick": this.onShowNavView
|
|
129
|
+
}, null) : createVNode("ion-icon", {
|
|
130
|
+
"class": this.ns.e("nav-icon"),
|
|
131
|
+
"title": ibiz.i18n.t("component.controlNavigation.hiddenNav"),
|
|
132
|
+
"name": "eye-off-outline",
|
|
133
|
+
"onClick": this.onShowNavView
|
|
134
|
+
}, null) : null]);
|
|
119
135
|
}
|
|
120
136
|
});
|
|
121
137
|
|
package/es/common/index.mjs
CHANGED
|
@@ -28,6 +28,9 @@ import { IBizPqlEditor } from './pql-editor/pql-editor.mjs';
|
|
|
28
28
|
import { IBizCustomFilterCondition } from './custom-filter-condition/custom-filter-condition.mjs';
|
|
29
29
|
import { IBizAnchorContainer } from './anchor-container/anchor-container.mjs';
|
|
30
30
|
import { IBizButtonList } from './button-list/button-list.mjs';
|
|
31
|
+
import { IBizControlNavigation } from './control-navigation/control-navigation.mjs';
|
|
32
|
+
import { IBizGanttSetting } from './gantt-setting/gantt-setting.mjs';
|
|
33
|
+
import { IBizNavSplit } from './nav-split/nav-split.mjs';
|
|
31
34
|
|
|
32
35
|
"use strict";
|
|
33
36
|
const IBizCommonComponents = {
|
|
@@ -73,6 +76,9 @@ const IBizCommonComponents = {
|
|
|
73
76
|
v.component(IBizCustomFilterCondition.name, IBizCustomFilterCondition);
|
|
74
77
|
v.component(IBizAnchorContainer.name, IBizAnchorContainer);
|
|
75
78
|
v.component(IBizButtonList.name, IBizButtonList);
|
|
79
|
+
v.component(IBizControlNavigation.name, IBizControlNavigation);
|
|
80
|
+
v.component(IBizGanttSetting.name, IBizGanttSetting);
|
|
81
|
+
v.component(IBizNavSplit.name, IBizNavSplit);
|
|
76
82
|
}
|
|
77
83
|
};
|
|
78
84
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-nav-split-wrapper{position:relative;width:100%;height:100%}.ibiz-nav-split-wrapper.is-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ibiz-nav-split--horizontal{display:flex;height:100%}.ibiz-nav-split--horizontal .ibiz-nav-split-trigger-con{top:50%;width:0;height:100%}.ibiz-nav-split--horizontal .ibiz-nav-split-pane{position:unset}.ibiz-nav-split--horizontal .ibiz-nav-split-pane--right{padding-left:6px}.ibiz-nav-split--vertical .ibiz-nav-split-trigger-con{left:50%;width:100%;height:0}.ibiz-nav-split--vertical .ibiz-nav-split-pane{position:absolute}.ibiz-nav-split--vertical .ibiz-nav-split-pane--bottom{padding-top:6px}.ibiz-nav-split-pane{position:absolute}.ibiz-nav-split-pane--left{top:0;bottom:0;left:0;overflow:hidden}.ibiz-nav-split-pane--right{top:0;right:0;bottom:0;overflow:hidden}.ibiz-nav-split-pane--top{top:0;right:0;left:0;overflow:hidden}.ibiz-nav-split-pane--bottom{right:0;bottom:0;left:0;overflow:hidden}.ibiz-nav-split-pane--moving{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ibiz-nav-split-trigger-con{position:absolute;z-index:10;transform:translate(-50%,-50%)}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import './nav-split.scss';
|
|
3
|
+
export declare const IBizNavSplit: import("vue").DefineComponent<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
mode: {
|
|
9
|
+
validator: (value: string) => boolean;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
min: {
|
|
13
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
14
|
+
default: number;
|
|
15
|
+
};
|
|
16
|
+
max: {
|
|
17
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
22
|
+
outerWrapper: Ref<HTMLDivElement | null>;
|
|
23
|
+
offset: Ref<number>;
|
|
24
|
+
wrapperClasses: import("vue").ComputedRef<string[]>;
|
|
25
|
+
paneClasses: import("vue").ComputedRef<string[]>;
|
|
26
|
+
isHorizontal: import("vue").ComputedRef<boolean>;
|
|
27
|
+
anotherOffset: import("vue").ComputedRef<number>;
|
|
28
|
+
handleMousedown: (e: MouseEvent) => void;
|
|
29
|
+
handleMove: (e: MouseEvent) => void;
|
|
30
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-move-start" | "on-moving" | "on-move-end")[], "update:modelValue" | "on-move-start" | "on-moving" | "on-move-end", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
modelValue: {
|
|
32
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
mode: {
|
|
36
|
+
validator: (value: string) => boolean;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
min: {
|
|
40
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
max: {
|
|
44
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
}>> & {
|
|
48
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
49
|
+
"onOn-move-start"?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
"onOn-moving"?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
"onOn-move-end"?: ((...args: any[]) => any) | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
mode: string;
|
|
54
|
+
modelValue: string | number;
|
|
55
|
+
max: string | number;
|
|
56
|
+
min: string | number;
|
|
57
|
+
}, {}>;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, nextTick, watch, onMounted, onBeforeUnmount, createVNode, resolveComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import './nav-split.css';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const IBizNavSplit = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "IBizNavSplit",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: [Number, String],
|
|
11
|
+
default: 0.5
|
|
12
|
+
},
|
|
13
|
+
mode: {
|
|
14
|
+
validator: (value) => {
|
|
15
|
+
return ["horizontal", "vertical"].includes(value);
|
|
16
|
+
},
|
|
17
|
+
default: "horizontal"
|
|
18
|
+
},
|
|
19
|
+
min: {
|
|
20
|
+
type: [Number, String],
|
|
21
|
+
default: 0.2
|
|
22
|
+
},
|
|
23
|
+
max: {
|
|
24
|
+
type: [Number, String],
|
|
25
|
+
default: 0.8
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue", "on-move-start", "on-moving", "on-move-end"],
|
|
29
|
+
setup(props, {
|
|
30
|
+
emit
|
|
31
|
+
}) {
|
|
32
|
+
const ns = useNamespace("nav-split");
|
|
33
|
+
const outerWrapper = ref(null);
|
|
34
|
+
const offset = ref(0);
|
|
35
|
+
const oldOffset = ref(0);
|
|
36
|
+
const isMoving = ref(false);
|
|
37
|
+
const computedMin = ref(0);
|
|
38
|
+
const computedMax = ref(0);
|
|
39
|
+
const currentValue = ref(0.5);
|
|
40
|
+
const initOffset = ref(0);
|
|
41
|
+
const wrapperClasses = computed(() => [ns.b("wrapper"), ns.is("no-select", isMoving.value)]);
|
|
42
|
+
const paneClasses = computed(() => [ns.b("pane"), isMoving.value ? ns.bm("pane", "moving") : ""]);
|
|
43
|
+
const isHorizontal = computed(() => props.mode === "horizontal");
|
|
44
|
+
const anotherOffset = computed(() => 100 - offset.value);
|
|
45
|
+
const valueIsPx = computed(() => typeof props.modelValue === "string");
|
|
46
|
+
const offsetSize = computed(() => isHorizontal.value ? "offsetWidth" : "offsetHeight");
|
|
47
|
+
const px2percent = (numerator, denominator) => {
|
|
48
|
+
return parseFloat(numerator) / parseFloat(denominator);
|
|
49
|
+
};
|
|
50
|
+
const getComputedThresholdValue = (type) => {
|
|
51
|
+
const size = outerWrapper.value[offsetSize.value];
|
|
52
|
+
if (valueIsPx.value) {
|
|
53
|
+
return typeof props[type] === "string" ? props[type] : size * props[type];
|
|
54
|
+
}
|
|
55
|
+
return typeof props[type] === "string" ? px2percent(props[type], size) : props[type];
|
|
56
|
+
};
|
|
57
|
+
const getMax = (value1, value2) => {
|
|
58
|
+
if (valueIsPx.value)
|
|
59
|
+
return "".concat(Math.max(parseFloat(value1), parseFloat(value2)), "px");
|
|
60
|
+
return Math.max(value1, value2);
|
|
61
|
+
};
|
|
62
|
+
const getMin = (value1, value2) => {
|
|
63
|
+
if (valueIsPx.value)
|
|
64
|
+
return "".concat(Math.min(parseFloat(value1), parseFloat(value2)), "px");
|
|
65
|
+
return Math.min(value1, value2);
|
|
66
|
+
};
|
|
67
|
+
const getAnotherOffset = (value) => {
|
|
68
|
+
let res = 0;
|
|
69
|
+
if (valueIsPx.value)
|
|
70
|
+
res = "".concat(outerWrapper.value[offsetSize.value] - parseFloat(value), "px");
|
|
71
|
+
else
|
|
72
|
+
res = 1 - value;
|
|
73
|
+
return res;
|
|
74
|
+
};
|
|
75
|
+
const handleMove = (e) => {
|
|
76
|
+
const pageOffset = isHorizontal.value ? e.pageX : e.pageY;
|
|
77
|
+
const moveOffset = pageOffset - initOffset.value;
|
|
78
|
+
const outerWidth = outerWrapper.value[offsetSize.value];
|
|
79
|
+
let value = valueIsPx.value ? "".concat(parseFloat(oldOffset.value) + moveOffset, "px") : px2percent(outerWidth * oldOffset.value + moveOffset, outerWidth);
|
|
80
|
+
const anotherValue = getAnotherOffset(value);
|
|
81
|
+
if (parseFloat(anotherValue) > parseFloat(computedMax.value)) {
|
|
82
|
+
value = getAnotherOffset(getMin(anotherValue, computedMax.value));
|
|
83
|
+
}
|
|
84
|
+
if (parseFloat(anotherValue) <= parseFloat(computedMin.value)) {
|
|
85
|
+
value = getAnotherOffset(getMax(anotherValue, computedMin.value));
|
|
86
|
+
}
|
|
87
|
+
Object.assign(e, {
|
|
88
|
+
atMin: props.modelValue === computedMin.value,
|
|
89
|
+
atMax: valueIsPx.value ? getAnotherOffset(props.modelValue) === computedMax.value : getAnotherOffset(props.modelValue).toFixed(5) === computedMax.value.toFixed(5)
|
|
90
|
+
});
|
|
91
|
+
emit("update:modelValue", value);
|
|
92
|
+
emit("on-moving", e);
|
|
93
|
+
};
|
|
94
|
+
const handleUp = () => {
|
|
95
|
+
isMoving.value = false;
|
|
96
|
+
document.removeEventListener("mousemove", handleMove);
|
|
97
|
+
document.removeEventListener("mouseup", handleUp);
|
|
98
|
+
emit("on-move-end");
|
|
99
|
+
};
|
|
100
|
+
const handleMousedown = (e) => {
|
|
101
|
+
initOffset.value = isHorizontal.value ? e.pageX : e.pageY;
|
|
102
|
+
oldOffset.value = props.modelValue;
|
|
103
|
+
isMoving.value = true;
|
|
104
|
+
document.addEventListener("mousemove", handleMove);
|
|
105
|
+
document.addEventListener("mouseup", handleUp);
|
|
106
|
+
emit("on-move-start");
|
|
107
|
+
};
|
|
108
|
+
const computeOffset = () => {
|
|
109
|
+
nextTick(() => {
|
|
110
|
+
computedMin.value = getComputedThresholdValue("min");
|
|
111
|
+
computedMax.value = getComputedThresholdValue("max");
|
|
112
|
+
const denominator = outerWrapper.value[offsetSize.value];
|
|
113
|
+
const outerWrapperValue = parseFloat(denominator);
|
|
114
|
+
const defaultValue = (valueIsPx.value ? px2percent(props.modelValue, outerWrapperValue) : props.modelValue) * 1e4 / 100;
|
|
115
|
+
const reverseValue = defaultValue * 100 / 1e4 * outerWrapperValue;
|
|
116
|
+
const diffValue = outerWrapperValue - reverseValue;
|
|
117
|
+
const maxValue = parseFloat(computedMax.value);
|
|
118
|
+
const minValue = parseFloat(computedMin.value);
|
|
119
|
+
if (Math.round(diffValue) >= minValue && Math.round(diffValue) <= maxValue) {
|
|
120
|
+
offset.value = defaultValue;
|
|
121
|
+
} else if (Math.round(diffValue) < minValue) {
|
|
122
|
+
const leftWidth = outerWrapperValue - minValue;
|
|
123
|
+
offset.value = leftWidth / outerWrapperValue * 1e4 / 100;
|
|
124
|
+
emit("update:modelValue", "".concat(leftWidth, "px"));
|
|
125
|
+
} else {
|
|
126
|
+
const leftWidth = outerWrapperValue - maxValue;
|
|
127
|
+
offset.value = leftWidth / outerWrapperValue * 1e4 / 100;
|
|
128
|
+
emit("update:modelValue", "".concat(leftWidth, "px"));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
watch(() => props.modelValue, (val) => {
|
|
133
|
+
console.log("props.modelValue", val);
|
|
134
|
+
if (val !== currentValue.value) {
|
|
135
|
+
currentValue.value = val;
|
|
136
|
+
computeOffset();
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
onMounted(() => {
|
|
140
|
+
nextTick(() => {
|
|
141
|
+
computeOffset();
|
|
142
|
+
});
|
|
143
|
+
window.addEventListener("resize", computeOffset);
|
|
144
|
+
});
|
|
145
|
+
onBeforeUnmount(() => {
|
|
146
|
+
window.removeEventListener("resize", computeOffset);
|
|
147
|
+
});
|
|
148
|
+
return {
|
|
149
|
+
ns,
|
|
150
|
+
outerWrapper,
|
|
151
|
+
offset,
|
|
152
|
+
wrapperClasses,
|
|
153
|
+
paneClasses,
|
|
154
|
+
isHorizontal,
|
|
155
|
+
anotherOffset,
|
|
156
|
+
handleMousedown,
|
|
157
|
+
handleMove
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
render() {
|
|
161
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
162
|
+
return createVNode("div", {
|
|
163
|
+
"class": this.wrapperClasses,
|
|
164
|
+
"ref": "outerWrapper"
|
|
165
|
+
}, [this.isHorizontal ? createVNode("div", {
|
|
166
|
+
"class": this.ns.m("horizontal")
|
|
167
|
+
}, [createVNode("div", {
|
|
168
|
+
"style": {
|
|
169
|
+
width: "".concat(this.offset, "%")
|
|
170
|
+
},
|
|
171
|
+
"class": [this.paneClasses, this.ns.bm("pane", "left")]
|
|
172
|
+
}, [(_b = (_a = this.$slots).left) == null ? void 0 : _b.call(_a)]), createVNode("div", {
|
|
173
|
+
"style": {
|
|
174
|
+
left: "".concat(this.offset, "%")
|
|
175
|
+
},
|
|
176
|
+
"class": this.ns.b("trigger-con"),
|
|
177
|
+
"onMousedown": (e) => this.handleMousedown(e)
|
|
178
|
+
}, [((_d = (_c = this.$slots).trigger) == null ? void 0 : _d.call(_c)) || createVNode(resolveComponent("iBizSplitTrigger"), {
|
|
179
|
+
"mode": "vertical"
|
|
180
|
+
}, null)]), createVNode("div", {
|
|
181
|
+
"style": {
|
|
182
|
+
width: "".concat(this.anotherOffset, "%")
|
|
183
|
+
},
|
|
184
|
+
"class": [this.paneClasses, this.ns.bm("pane", "right")]
|
|
185
|
+
}, [(_f = (_e = this.$slots).right) == null ? void 0 : _f.call(_e)])]) : createVNode("div", {
|
|
186
|
+
"class": this.ns.m("vertical")
|
|
187
|
+
}, [createVNode("div", {
|
|
188
|
+
"style": {
|
|
189
|
+
bottom: "".concat(this.anotherOffset, "%")
|
|
190
|
+
},
|
|
191
|
+
"class": [this.paneClasses, this.ns.bm("pane", "top")]
|
|
192
|
+
}, [(_h = (_g = this.$slots).top) == null ? void 0 : _h.call(_g)]), createVNode("div", {
|
|
193
|
+
"style": {
|
|
194
|
+
top: "".concat(this.offset, "%")
|
|
195
|
+
},
|
|
196
|
+
"class": this.ns.b("trigger-con"),
|
|
197
|
+
"onMousedown": (e) => this.handleMousedown(e)
|
|
198
|
+
}, [((_j = (_i = this.$slots).trigger) == null ? void 0 : _j.call(_i)) || createVNode(resolveComponent("iBizSplitTrigger"), {
|
|
199
|
+
"mode": "horizontal"
|
|
200
|
+
}, null)]), createVNode("div", {
|
|
201
|
+
"style": {
|
|
202
|
+
top: "".concat(this.offset, "%")
|
|
203
|
+
},
|
|
204
|
+
"class": [this.paneClasses, this.ns.bm("pane", "bottom")]
|
|
205
|
+
}, [(_l = (_k = this.$slots).bottom) == null ? void 0 : _l.call(_k)])])]);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export { IBizNavSplit };
|