layplux 1.0.1 → 2.0.1
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/components/center-view/index.cjs +18 -28
- package/dist/cjs/components/corner-glow/index.cjs +11 -28
- package/dist/cjs/components/dropdown/index.cjs +136 -130
- package/dist/cjs/components/icon/index.cjs +29 -51
- package/dist/cjs/components/index.cjs +24 -25
- package/dist/cjs/components/panel-view/index.cjs +111 -114
- package/dist/cjs/components/popup/index.cjs +166 -151
- package/dist/cjs/components/title/index.cjs +34 -47
- package/dist/cjs/components/tooltip/index.cjs +70 -61
- package/dist/cjs/components/widget/index.cjs +52 -72
- package/dist/cjs/index.cjs +13 -40
- package/dist/cjs/layout/glass-overlay.cjs +15 -28
- package/dist/cjs/layout/layered-manager.cjs +20 -29
- package/dist/cjs/layout/layplux.cjs +19 -32
- package/dist/cjs/layout/root-pane.cjs +20 -38
- package/dist/cjs/layout/skeleton/bottom-area.cjs +26 -43
- package/dist/cjs/layout/skeleton/bottom-left-area.cjs +12 -29
- package/dist/cjs/layout/skeleton/bottom-right-area.cjs +11 -28
- package/dist/cjs/layout/skeleton/center-area.cjs +278 -371
- package/dist/cjs/layout/skeleton/index.cjs +7 -24
- package/dist/cjs/layout/skeleton/left-bottom-area.cjs +12 -29
- package/dist/cjs/layout/skeleton/left-top-area.cjs +12 -29
- package/dist/cjs/layout/skeleton/right-bottom-area.cjs +11 -28
- package/dist/cjs/layout/skeleton/right-top-area.cjs +11 -28
- package/dist/cjs/layout/skeleton/skeleton.cjs +55 -60
- package/dist/cjs/layout/skeleton/top-area.cjs +26 -43
- package/dist/cjs/locales/en-US.cjs +11 -30
- package/dist/cjs/locales/index.cjs +12 -30
- package/dist/cjs/locales/zh-CN.cjs +11 -30
- package/dist/cjs/managers/area.cjs +12 -25
- package/dist/cjs/managers/index.cjs +12 -20
- package/dist/cjs/managers/pane.cjs +12 -26
- package/dist/cjs/managers/skeleton.cjs +112 -124
- package/dist/cjs/managers/theme.cjs +8 -29
- package/dist/cjs/managers/widget-container.cjs +31 -31
- package/dist/cjs/managers/widget.cjs +63 -50
- package/dist/cjs/types/config.cjs +2 -16
- package/dist/cjs/types/index.cjs +2 -18
- package/dist/cjs/types/locale.cjs +2 -16
- package/dist/cjs/utils/event-bus.cjs +53 -49
- package/dist/cjs/utils/focus-tracker.cjs +66 -42
- package/dist/cjs/utils/index.cjs +23 -31
- package/dist/cjs/utils/unique-id.cjs +5 -24
- package/dist/cjs/utils/vue.cjs +20 -30
- package/dist/esm/components/center-view/index.mjs +15 -7
- package/dist/esm/components/corner-glow/index.mjs +8 -7
- package/dist/esm/components/dropdown/index.mjs +117 -101
- package/dist/esm/components/icon/index.mjs +24 -30
- package/dist/esm/components/index.mjs +7 -8
- package/dist/esm/components/panel-view/index.mjs +107 -98
- package/dist/esm/components/popup/index.mjs +155 -130
- package/dist/esm/components/title/index.mjs +29 -24
- package/dist/esm/components/tooltip/index.mjs +67 -40
- package/dist/esm/components/widget/index.mjs +45 -48
- package/dist/esm/index.mjs +4 -10
- package/dist/esm/layout/glass-overlay.mjs +12 -7
- package/dist/esm/layout/layered-manager.mjs +17 -8
- package/dist/esm/layout/layplux.mjs +14 -11
- package/dist/esm/layout/root-pane.mjs +16 -16
- package/dist/esm/layout/skeleton/bottom-area.mjs +23 -22
- package/dist/esm/layout/skeleton/bottom-left-area.mjs +9 -8
- package/dist/esm/layout/skeleton/bottom-right-area.mjs +8 -7
- package/dist/esm/layout/skeleton/center-area.mjs +251 -333
- package/dist/esm/layout/skeleton/index.mjs +1 -4
- package/dist/esm/layout/skeleton/left-bottom-area.mjs +9 -8
- package/dist/esm/layout/skeleton/left-top-area.mjs +9 -8
- package/dist/esm/layout/skeleton/right-bottom-area.mjs +8 -7
- package/dist/esm/layout/skeleton/right-top-area.mjs +8 -7
- package/dist/esm/layout/skeleton/skeleton.mjs +52 -39
- package/dist/esm/layout/skeleton/top-area.mjs +23 -22
- package/dist/esm/locales/en-US.mjs +9 -10
- package/dist/esm/locales/index.mjs +7 -9
- package/dist/esm/locales/zh-CN.mjs +9 -10
- package/dist/esm/managers/area.mjs +10 -5
- package/dist/esm/managers/index.mjs +3 -3
- package/dist/esm/managers/pane.mjs +9 -5
- package/dist/esm/managers/skeleton.mjs +97 -95
- package/dist/esm/managers/theme.mjs +6 -9
- package/dist/esm/managers/widget-container.mjs +28 -10
- package/dist/esm/managers/widget.mjs +55 -25
- package/dist/esm/types/config.mjs +1 -0
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/locale.mjs +1 -0
- package/dist/esm/utils/event-bus.mjs +46 -17
- package/dist/esm/utils/focus-tracker.mjs +63 -23
- package/dist/esm/utils/index.mjs +7 -10
- package/dist/esm/utils/unique-id.mjs +3 -4
- package/dist/esm/utils/vue.mjs +13 -5
- package/dist/types/managers/skeleton.d.ts.map +1 -1
- package/dist/umd/index.js +2 -30
- package/package.json +18 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const LeftBottomArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'LeftBottomArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
@@ -9,14 +9,15 @@ const LeftBottomArea = defineComponent({
|
|
|
9
9
|
return () => {
|
|
10
10
|
const items = props.area?.container.items.value;
|
|
11
11
|
if (!items || items.length === 0) return null;
|
|
12
|
-
return
|
|
12
|
+
return createVNode("div", {
|
|
13
|
+
"class": "layplux-left-bottom-area"
|
|
14
|
+
}, [items.slice().toSorted((a, b) => {
|
|
13
15
|
const i1 = a.config?.index ?? 0;
|
|
14
16
|
const i2 = b.config?.index ?? 0;
|
|
15
17
|
return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
|
|
16
|
-
}).map(
|
|
18
|
+
}).map(widget => widget.renderTitle())]);
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
22
|
+
|
|
23
|
+
export { LeftBottomArea };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const LeftTopArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'LeftTopArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
@@ -9,14 +9,15 @@ const LeftTopArea = defineComponent({
|
|
|
9
9
|
return () => {
|
|
10
10
|
const items = props.area?.container.items.value;
|
|
11
11
|
if (!items || items.length === 0) return null;
|
|
12
|
-
return
|
|
12
|
+
return createVNode("div", {
|
|
13
|
+
"class": "layplux-left-top-area"
|
|
14
|
+
}, [items.slice().toSorted((a, b) => {
|
|
13
15
|
const i1 = a.config?.index ?? 0;
|
|
14
16
|
const i2 = b.config?.index ?? 0;
|
|
15
17
|
return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
|
|
16
|
-
}).map(
|
|
18
|
+
}).map(widget => widget.renderTitle())]);
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
22
|
+
|
|
23
|
+
export { LeftTopArea };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const RightBottomArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'RightBottomArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
@@ -9,10 +9,11 @@ const RightBottomArea = defineComponent({
|
|
|
9
9
|
return () => {
|
|
10
10
|
const items = props.area?.container.items.value;
|
|
11
11
|
if (!items || items.length === 0) return null;
|
|
12
|
-
return
|
|
12
|
+
return createVNode("div", {
|
|
13
|
+
"class": "layplux-right-bottom-area"
|
|
14
|
+
}, [items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map(widget => widget.renderTitle())]);
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
18
|
+
|
|
19
|
+
export { RightBottomArea };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const RightTopArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'RightTopArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
@@ -9,10 +9,11 @@ const RightTopArea = defineComponent({
|
|
|
9
9
|
return () => {
|
|
10
10
|
const items = props.area?.container.items.value;
|
|
11
11
|
if (!items || items.length === 0) return null;
|
|
12
|
-
return
|
|
12
|
+
return createVNode("div", {
|
|
13
|
+
"class": "layplux-right-top-area"
|
|
14
|
+
}, [items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map(widget => widget.renderTitle())]);
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
18
|
+
|
|
19
|
+
export { RightTopArea };
|
|
@@ -1,46 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { CenterArea } from "./center-area.mjs";
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { TopArea } from './top-area.mjs';
|
|
3
|
+
import { BottomArea } from './bottom-area.mjs';
|
|
4
|
+
import { LeftTopArea } from './left-top-area.mjs';
|
|
5
|
+
import { LeftBottomArea } from './left-bottom-area.mjs';
|
|
6
|
+
import { BottomLeftArea } from './bottom-left-area.mjs';
|
|
7
|
+
import { RightTopArea } from './right-top-area.mjs';
|
|
8
|
+
import { RightBottomArea } from './right-bottom-area.mjs';
|
|
9
|
+
import { BottomRightArea } from './bottom-right-area.mjs';
|
|
10
|
+
import { CenterArea } from './center-area.mjs';
|
|
11
|
+
|
|
13
12
|
const Skeleton = defineComponent({
|
|
14
|
-
name:
|
|
13
|
+
name: 'Skeleton',
|
|
15
14
|
props: {
|
|
16
15
|
skeleton: Object
|
|
17
16
|
},
|
|
18
17
|
setup(props) {
|
|
19
|
-
return () =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
return () => createVNode("div", {
|
|
19
|
+
"class": "layplux-skeleton"
|
|
20
|
+
}, [createVNode(TopArea, {
|
|
21
|
+
"area": props.skeleton?.topArea
|
|
22
|
+
}, null), createVNode("div", {
|
|
23
|
+
"class": "layplux-skeleton__body"
|
|
24
|
+
}, [createVNode("div", {
|
|
25
|
+
"class": "layplux-skeleton__stripe"
|
|
26
|
+
}, [createVNode("div", {
|
|
27
|
+
"class": "layplux-skeleton__stripe-top"
|
|
28
|
+
}, [createVNode(LeftTopArea, {
|
|
29
|
+
"area": props.skeleton?.leftTopArea
|
|
30
|
+
}, null), createVNode("div", {
|
|
31
|
+
"class": "layplux-skeleton__stripe-separator"
|
|
32
|
+
}, null), createVNode(LeftBottomArea, {
|
|
33
|
+
"area": props.skeleton?.leftBottomArea
|
|
34
|
+
}, null)]), createVNode(BottomLeftArea, {
|
|
35
|
+
"area": props.skeleton?.bottomLeftArea
|
|
36
|
+
}, null)]), createVNode("div", {
|
|
37
|
+
"class": "layplux-skeleton__center"
|
|
38
|
+
}, [createVNode(CenterArea, {
|
|
39
|
+
"skeleton": props.skeleton,
|
|
40
|
+
"centerArea": props.skeleton?.centerArea
|
|
41
|
+
}, null)]), createVNode("div", {
|
|
42
|
+
"class": "layplux-skeleton__stripe"
|
|
43
|
+
}, [createVNode("div", {
|
|
44
|
+
"class": "layplux-skeleton__stripe-top"
|
|
45
|
+
}, [createVNode(RightTopArea, {
|
|
46
|
+
"area": props.skeleton?.rightTopArea
|
|
47
|
+
}, null), createVNode("div", {
|
|
48
|
+
"class": "layplux-skeleton__stripe-separator"
|
|
49
|
+
}, null), createVNode(RightBottomArea, {
|
|
50
|
+
"area": props.skeleton?.rightBottomArea
|
|
51
|
+
}, null)]), createVNode(BottomRightArea, {
|
|
52
|
+
"area": props.skeleton?.bottomRightArea
|
|
53
|
+
}, null)])]), createVNode(BottomArea, {
|
|
54
|
+
"area": props.skeleton?.bottomArea
|
|
55
|
+
}, null)]);
|
|
42
56
|
}
|
|
43
57
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
58
|
+
|
|
59
|
+
export { Skeleton };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const TopArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'TopArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
8
8
|
setup(props) {
|
|
9
9
|
return () => {
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
area
|
|
12
|
+
} = props;
|
|
11
13
|
const left = [];
|
|
12
14
|
const center = [];
|
|
13
15
|
const right = [];
|
|
@@ -15,30 +17,29 @@ const TopArea = defineComponent({
|
|
|
15
17
|
const index1 = a.config?.index || 0;
|
|
16
18
|
const index2 = b.config?.index || 0;
|
|
17
19
|
return index1 === index2 ? 0 : index1 > index2 ? 1 : -1;
|
|
18
|
-
}).forEach(
|
|
19
|
-
const content =
|
|
20
|
-
|
|
20
|
+
}).forEach(item => {
|
|
21
|
+
const content = createVNode("div", {
|
|
22
|
+
"key": `top-area-${item.name}`
|
|
23
|
+
}, [item.renderContent()]);
|
|
24
|
+
if (item.align === 'left') {
|
|
21
25
|
left.push(content);
|
|
22
|
-
} else if (item.align ===
|
|
26
|
+
} else if (item.align === 'center') {
|
|
23
27
|
center.push(content);
|
|
24
28
|
} else {
|
|
25
29
|
right.push(content);
|
|
26
30
|
}
|
|
27
31
|
});
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
] })
|
|
38
|
-
] });
|
|
32
|
+
return createVNode("div", {
|
|
33
|
+
"class": "layplux-top-area"
|
|
34
|
+
}, [createVNode("div", {
|
|
35
|
+
"class": "layplux-top-area__toolbar-left"
|
|
36
|
+
}, [...left]), createVNode("div", {
|
|
37
|
+
"class": "layplux-top-area__toolbar-center"
|
|
38
|
+
}, [...center]), createVNode("div", {
|
|
39
|
+
"class": "layplux-top-area__toolbar-right"
|
|
40
|
+
}, [...right])]);
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
44
|
+
|
|
45
|
+
export { TopArea };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
const enUS = {
|
|
2
2
|
panel: {
|
|
3
|
-
viewMode:
|
|
4
|
-
dockPinned:
|
|
5
|
-
dockUnpinned:
|
|
6
|
-
undock:
|
|
7
|
-
help:
|
|
8
|
-
more:
|
|
9
|
-
minimize:
|
|
3
|
+
viewMode: 'View Mode',
|
|
4
|
+
dockPinned: 'Dock Pinned',
|
|
5
|
+
dockUnpinned: 'Dock Unpinned',
|
|
6
|
+
undock: 'Undock',
|
|
7
|
+
help: 'Help',
|
|
8
|
+
more: 'More',
|
|
9
|
+
minimize: 'Minimize'
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
12
|
+
|
|
13
|
+
export { enUS };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { zhCN } from
|
|
2
|
-
import { enUS } from
|
|
1
|
+
import { zhCN } from './zh-CN.mjs';
|
|
2
|
+
import { enUS } from './en-US.mjs';
|
|
3
|
+
|
|
3
4
|
const builtInLocales = {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
'zh-CN': zhCN,
|
|
6
|
+
'en-US': enUS
|
|
6
7
|
};
|
|
7
8
|
function getBuiltInLocale(name) {
|
|
8
9
|
const locale = builtInLocales[name];
|
|
@@ -12,8 +13,5 @@ function getBuiltInLocale(name) {
|
|
|
12
13
|
}
|
|
13
14
|
return locale;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getBuiltInLocale,
|
|
18
|
-
zhCN
|
|
19
|
-
};
|
|
16
|
+
|
|
17
|
+
export { enUS, getBuiltInLocale, zhCN };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
const zhCN = {
|
|
2
2
|
panel: {
|
|
3
|
-
viewMode:
|
|
4
|
-
dockPinned:
|
|
5
|
-
dockUnpinned:
|
|
6
|
-
undock:
|
|
7
|
-
help:
|
|
8
|
-
more:
|
|
9
|
-
minimize:
|
|
3
|
+
viewMode: '视图模式',
|
|
4
|
+
dockPinned: '停靠固定',
|
|
5
|
+
dockUnpinned: '停靠不固定',
|
|
6
|
+
undock: '取消停靠',
|
|
7
|
+
help: '帮助',
|
|
8
|
+
more: '更多',
|
|
9
|
+
minimize: '最小化'
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
12
|
+
|
|
13
|
+
export { zhCN };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `useArea` 只需要 skeleton 的 `createContainer` 能力,
|
|
3
|
+
* 不依赖完整的 ISkeleton(避免创建时的循环依赖)。
|
|
4
|
+
*/
|
|
2
5
|
function useArea(skeleton, name, handle) {
|
|
3
6
|
const container = skeleton.createContainer(name, handle);
|
|
4
7
|
function add(config) {
|
|
5
8
|
const item = container.add(config);
|
|
6
9
|
return item;
|
|
7
10
|
}
|
|
8
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
add,
|
|
13
|
+
container
|
|
14
|
+
};
|
|
9
15
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
16
|
+
|
|
17
|
+
export { useArea };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { useSkeleton } from './skeleton.mjs';
|
|
2
|
+
export { useArea } from './area.mjs';
|
|
3
|
+
export { isWidget, useWidget } from './widget.mjs';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { ref } from
|
|
2
|
-
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 没个widget都会对应自己的pane的状态
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
function usePane(defaultViewMode = 'DockPinned') {
|
|
3
8
|
const viewMode = ref(defaultViewMode);
|
|
4
9
|
function setViewMode(mode) {
|
|
5
10
|
viewMode.value = mode;
|
|
@@ -9,6 +14,5 @@ function usePane(defaultViewMode = "DockPinned") {
|
|
|
9
14
|
setViewMode
|
|
10
15
|
};
|
|
11
16
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
17
|
+
|
|
18
|
+
export { usePane };
|