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,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { createContent } from '../../utils/vue.mjs';
|
|
3
|
+
|
|
4
4
|
const TitleView = defineComponent({
|
|
5
|
-
name:
|
|
5
|
+
name: 'TitleView',
|
|
6
6
|
inheritAttrs: false,
|
|
7
7
|
props: {
|
|
8
8
|
icon: [String, Object, Function],
|
|
9
9
|
title: [String, Object, Function],
|
|
10
10
|
mode: {
|
|
11
11
|
type: String,
|
|
12
|
-
default:
|
|
12
|
+
default: 'icon-only'
|
|
13
13
|
},
|
|
14
14
|
/** 交互状态:idle / active / disabled / error。idle 时 hover 由 CSS :hover 处理 */
|
|
15
15
|
state: {
|
|
16
16
|
type: String,
|
|
17
|
-
default:
|
|
17
|
+
default: 'idle'
|
|
18
18
|
},
|
|
19
19
|
/** 聚焦/选中态,独立于 state,可与任何状态叠加 */
|
|
20
20
|
focused: {
|
|
@@ -23,34 +23,39 @@ const TitleView = defineComponent({
|
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
25
25
|
type: String,
|
|
26
|
-
default:
|
|
26
|
+
default: 'middle'
|
|
27
27
|
},
|
|
28
28
|
className: {
|
|
29
29
|
type: String,
|
|
30
|
-
default:
|
|
30
|
+
default: ''
|
|
31
31
|
},
|
|
32
32
|
onClick: Function
|
|
33
33
|
},
|
|
34
34
|
setup(props) {
|
|
35
35
|
return () => {
|
|
36
|
-
const {
|
|
36
|
+
const {
|
|
37
|
+
icon,
|
|
38
|
+
title,
|
|
39
|
+
mode,
|
|
40
|
+
state,
|
|
41
|
+
size,
|
|
42
|
+
focused,
|
|
43
|
+
className,
|
|
44
|
+
onClick
|
|
45
|
+
} = props;
|
|
37
46
|
const iconNode = icon ? createContent(icon) : null;
|
|
38
47
|
const titleNode = title ? createContent(title) : null;
|
|
39
|
-
const classes = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */ jsx("span", { class: "title-view__icon", children: iconNode }),
|
|
49
|
-
/* @__PURE__ */ jsx("span", { class: "title-view__label", children: titleNode })
|
|
50
|
-
] });
|
|
48
|
+
const classes = ['title-view', `title-view--${mode}`, `title-view--${state}`, `title-view--${size}`, focused && 'title-view--focused', className].filter(Boolean).join(' ');
|
|
49
|
+
return createVNode("span", {
|
|
50
|
+
"class": classes,
|
|
51
|
+
"onClick": onClick
|
|
52
|
+
}, [createVNode("span", {
|
|
53
|
+
"class": "title-view__icon"
|
|
54
|
+
}, [iconNode]), createVNode("span", {
|
|
55
|
+
"class": "title-view__label"
|
|
56
|
+
}, [titleNode])]);
|
|
51
57
|
};
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
60
|
+
|
|
61
|
+
export { TitleView };
|
|
@@ -1,48 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createContent } from
|
|
4
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { Popup } from '../popup/index.mjs';
|
|
3
|
+
import { createContent } from '../../utils/vue.mjs';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* @Author: shuwen 1243889238@qq.com
|
|
7
|
+
* @Date: 2026-06-08 16:12:13
|
|
8
|
+
* @LastEditors: shuwen 1243889238@qq.com
|
|
9
|
+
* @LastEditTime: 2026-06-09 16:58:03
|
|
10
|
+
* @FilePath: /Layplux/packages/layplux/src/components/tooltip/index.tsx
|
|
11
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
12
|
+
*/
|
|
5
13
|
const Tooltip = defineComponent({
|
|
6
|
-
name:
|
|
14
|
+
name: 'LaypluxTooltip',
|
|
7
15
|
props: {
|
|
8
16
|
title: [String, Object, Function],
|
|
9
|
-
trigger: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
trigger: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'hover'
|
|
20
|
+
},
|
|
21
|
+
placement: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'top'
|
|
24
|
+
},
|
|
25
|
+
mouseEnterDelay: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 100
|
|
28
|
+
},
|
|
29
|
+
mouseLeaveDelay: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 100
|
|
32
|
+
},
|
|
13
33
|
visible: Boolean,
|
|
14
|
-
disabled: {
|
|
15
|
-
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
getContainer: {
|
|
39
|
+
type: Function,
|
|
40
|
+
default: () => document.body
|
|
41
|
+
}
|
|
16
42
|
},
|
|
17
|
-
emits: [
|
|
18
|
-
setup(props, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
43
|
+
emits: ['update:visible'],
|
|
44
|
+
setup(props, {
|
|
45
|
+
emit,
|
|
46
|
+
slots
|
|
47
|
+
}) {
|
|
48
|
+
return () => createVNode(Popup, {
|
|
49
|
+
"visible": props.visible,
|
|
50
|
+
"trigger": props.trigger,
|
|
51
|
+
"placement": props.placement,
|
|
52
|
+
"disabled": props.disabled,
|
|
53
|
+
"mouseEnterDelay": props.mouseEnterDelay,
|
|
54
|
+
"mouseLeaveDelay": props.mouseLeaveDelay,
|
|
55
|
+
"destroyOnClose": true,
|
|
56
|
+
"getContainer": props.getContainer,
|
|
57
|
+
"onUpdate:visible": v => emit('update:visible', v)
|
|
58
|
+
}, {
|
|
59
|
+
default: () => slots.default?.(),
|
|
60
|
+
content: () => {
|
|
61
|
+
const hasContent = slots.content;
|
|
62
|
+
const titleNode = hasContent ? slots.content?.() : createContent(props.title);
|
|
63
|
+
return createVNode("div", {
|
|
64
|
+
"class": "layplux-tooltip"
|
|
65
|
+
}, [createVNode("div", {
|
|
66
|
+
"class": "layplux-tooltip__arrow"
|
|
67
|
+
}, null), createVNode("div", {
|
|
68
|
+
"class": "layplux-tooltip__inner"
|
|
69
|
+
}, [titleNode])]);
|
|
42
70
|
}
|
|
43
|
-
);
|
|
71
|
+
});
|
|
44
72
|
}
|
|
45
73
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
74
|
+
|
|
75
|
+
export { Tooltip };
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent, ref, onErrorCaptured, h, createVNode, createTextVNode, Fragment } from 'vue';
|
|
2
|
+
import { TitleView } from '../title/index.mjs';
|
|
3
|
+
import { Tooltip } from '../tooltip/index.mjs';
|
|
4
|
+
|
|
5
5
|
const WidgetView = defineComponent({
|
|
6
|
-
name:
|
|
6
|
+
name: 'WidgetView',
|
|
7
7
|
inheritAttrs: false,
|
|
8
8
|
props: {
|
|
9
9
|
widget: Object
|
|
10
10
|
},
|
|
11
11
|
setup(props) {
|
|
12
12
|
const hasError = ref(false);
|
|
13
|
-
const errorMessage = ref(
|
|
14
|
-
onErrorCaptured(
|
|
13
|
+
const errorMessage = ref('');
|
|
14
|
+
onErrorCaptured(err => {
|
|
15
15
|
hasError.value = true;
|
|
16
16
|
errorMessage.value = err.message;
|
|
17
17
|
console.error(`[Layplux] Widget "${props.widget?.name}" crashed:`, err);
|
|
18
18
|
return false;
|
|
19
19
|
});
|
|
20
20
|
return () => {
|
|
21
|
-
const {
|
|
21
|
+
const {
|
|
22
|
+
widget
|
|
23
|
+
} = props;
|
|
22
24
|
if (hasError.value) {
|
|
23
25
|
const fallback = widget?.config.props?.errorFallback;
|
|
24
26
|
if (fallback) {
|
|
25
|
-
return h(fallback, {
|
|
27
|
+
return h(fallback, {
|
|
28
|
+
error: errorMessage.value,
|
|
29
|
+
widget
|
|
30
|
+
});
|
|
26
31
|
}
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
widget?.name,
|
|
31
|
-
'" \u53D1\u751F\u9519\u8BEF'
|
|
32
|
-
] }),
|
|
33
|
-
/* @__PURE__ */ jsx("pre", { children: errorMessage.value })
|
|
34
|
-
] });
|
|
32
|
+
return createVNode("div", {
|
|
33
|
+
"class": "layplux-widget-error"
|
|
34
|
+
}, [createVNode("span", null, [createTextVNode("\u7EC4\u4EF6 \""), widget?.name, createTextVNode("\" \u53D1\u751F\u9519\u8BEF")]), createVNode("pre", null, [errorMessage.value])]);
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return createVNode(Fragment, null, [widget?.renderBody()]);
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const WidgetTitleView = defineComponent({
|
|
41
|
-
name:
|
|
41
|
+
name: 'WidgetTitleView',
|
|
42
42
|
inheritAttrs: false,
|
|
43
43
|
props: {
|
|
44
44
|
widget: Object
|
|
@@ -50,35 +50,32 @@ const WidgetTitleView = defineComponent({
|
|
|
50
50
|
props.widget?.container?.toggleActive(props.widget?.name);
|
|
51
51
|
};
|
|
52
52
|
return () => {
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
) });
|
|
53
|
+
const {
|
|
54
|
+
widget
|
|
55
|
+
} = props;
|
|
56
|
+
const tooltipTitle = widget?.config.props?.title ?? widget?.name ?? '';
|
|
57
|
+
return createVNode("div", {
|
|
58
|
+
"class": "widget-title-view"
|
|
59
|
+
}, [createVNode(Tooltip, {
|
|
60
|
+
"visible": tooltipVisible.value,
|
|
61
|
+
"onUpdate:visible": v => {
|
|
62
|
+
tooltipVisible.value = v;
|
|
63
|
+
},
|
|
64
|
+
"title": tooltipTitle,
|
|
65
|
+
"placement": "right",
|
|
66
|
+
"mouseEnterDelay": 500,
|
|
67
|
+
"getContainer": () => document.querySelector('.layplux-root') || document.body
|
|
68
|
+
}, {
|
|
69
|
+
default: () => [createVNode(TitleView, {
|
|
70
|
+
"onClick": handleClick,
|
|
71
|
+
"focused": widget?.focused.value,
|
|
72
|
+
"state": widget?.active.value ? 'active' : 'idle',
|
|
73
|
+
"icon": widget?.config.props?.icon,
|
|
74
|
+
"title": widget?.config.props?.title
|
|
75
|
+
}, null)]
|
|
76
|
+
})]);
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
79
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
WidgetView
|
|
84
|
-
};
|
|
80
|
+
|
|
81
|
+
export { WidgetTitleView, WidgetView };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
FocusTracker,
|
|
7
|
-
default2 as Layplux,
|
|
8
|
-
createPluginEventBus,
|
|
9
|
-
useSkeleton
|
|
10
|
-
};
|
|
1
|
+
export { default as Layplux } from './layout/layplux.mjs';
|
|
2
|
+
export { useSkeleton } from './managers/skeleton.mjs';
|
|
3
|
+
export { createPluginEventBus } from './utils/event-bus.mjs';
|
|
4
|
+
export { FocusTracker } from './utils/focus-tracker.mjs';
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 玻璃面板(GlassOverlay)是Layplux中的一个重要组件,它位于整个界面的最顶层,覆盖在所有其他内容之上。
|
|
5
|
+
* 这个组件的主要作用是提供一个透明的层,用于捕获用户的交互事件,例如鼠标点击、拖动等。
|
|
6
|
+
* 通过玻璃面板,Layplux能够实现一些特殊的交互效果,比如拖放操作、全局事件监听等。
|
|
7
|
+
* 玻璃面板就像一层透明的保护膜,既能保护底层内容,又能提供丰富的交互功能,使得用户界面更加灵活和响应式。
|
|
8
|
+
*/
|
|
3
9
|
const GlassOverlay = defineComponent({
|
|
4
|
-
name:
|
|
10
|
+
name: 'GlassOverlay',
|
|
5
11
|
setup() {
|
|
6
|
-
return () =>
|
|
12
|
+
return () => createVNode("div", null, null);
|
|
7
13
|
}
|
|
8
14
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
15
|
+
|
|
16
|
+
export { GlassOverlay };
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { Skeleton } from './skeleton/skeleton.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Z 轴分层容器,把子组件分配到不同"层号",层号大的显示在上方。
|
|
6
|
+
* 预设了五个层:DEFAULT(0)、PALETTE(100)、MODAL(200)、POPUP(300)、DRAG(400)。
|
|
7
|
+
* 在此基础上拓展了自定义层号,用于管理弹出窗口(completion popup、快速文档)和拖拽反馈,
|
|
8
|
+
* 从而避免每次弹窗都创建独立的 OS 窗口,大幅降低渲染开销
|
|
9
|
+
*/
|
|
4
10
|
const LayeredManager = defineComponent({
|
|
5
|
-
name:
|
|
11
|
+
name: 'LayeredManager',
|
|
6
12
|
props: {
|
|
7
13
|
skeleton: Object
|
|
8
14
|
},
|
|
9
15
|
setup(props) {
|
|
10
|
-
return () =>
|
|
16
|
+
return () => createVNode("div", {
|
|
17
|
+
"class": "layered-manager"
|
|
18
|
+
}, [createVNode(Skeleton, {
|
|
19
|
+
"skeleton": props.skeleton
|
|
20
|
+
}, null)]);
|
|
11
21
|
}
|
|
12
22
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
23
|
+
|
|
24
|
+
export { LayeredManager };
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent, createVNode, createTextVNode } from 'vue';
|
|
2
|
+
import { RootPane } from './root-pane.mjs';
|
|
3
|
+
|
|
4
4
|
const Layplux = defineComponent({
|
|
5
|
-
name:
|
|
5
|
+
name: 'Layplux',
|
|
6
6
|
props: {
|
|
7
7
|
skeleton: Object
|
|
8
8
|
},
|
|
9
9
|
setup(props) {
|
|
10
|
-
return () =>
|
|
10
|
+
return () => createVNode(RootPane, {
|
|
11
|
+
"skeleton": props.skeleton
|
|
12
|
+
}, {
|
|
13
|
+
default: () => [createTextVNode("Layplux")]
|
|
14
|
+
});
|
|
11
15
|
}
|
|
12
16
|
});
|
|
13
|
-
var
|
|
14
|
-
install:
|
|
15
|
-
app.component(
|
|
17
|
+
var layplux = Object.assign(Layplux, {
|
|
18
|
+
install: app => {
|
|
19
|
+
app.component('Layplux', Layplux);
|
|
16
20
|
return app;
|
|
17
21
|
}
|
|
18
22
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
23
|
+
|
|
24
|
+
export { layplux as default };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent, provide, computed, createVNode } from 'vue';
|
|
2
|
+
import { LayeredManager } from './layered-manager.mjs';
|
|
3
|
+
import { GlassOverlay } from './glass-overlay.mjs';
|
|
4
|
+
import { CornerGlow } from '../components/corner-glow/index.mjs';
|
|
5
|
+
|
|
6
6
|
const RootPane = defineComponent({
|
|
7
|
-
name:
|
|
7
|
+
name: 'RootPane',
|
|
8
8
|
props: {
|
|
9
9
|
skeleton: Object
|
|
10
10
|
},
|
|
11
11
|
setup(props) {
|
|
12
|
-
provide(
|
|
12
|
+
provide('layplux-locale', props.skeleton?.locale);
|
|
13
13
|
const rootClass = computed(() => {
|
|
14
14
|
const dark = props.skeleton?.isDark();
|
|
15
|
-
return [
|
|
15
|
+
return ['layplux-root', dark ? 'dark' : ''].filter(Boolean);
|
|
16
16
|
});
|
|
17
|
-
return () =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
return () => createVNode("div", {
|
|
18
|
+
"class": rootClass.value,
|
|
19
|
+
"data-theme": props.skeleton?.themeName?.value
|
|
20
|
+
}, [createVNode(CornerGlow, null, null), createVNode(LayeredManager, {
|
|
21
|
+
"skeleton": props.skeleton
|
|
22
|
+
}, null), createVNode(GlassOverlay, null, null)]);
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
25
|
+
|
|
26
|
+
export { RootPane };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const BottomArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'BottomArea',
|
|
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 BottomArea = 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": `bottom-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-bottom-area"
|
|
34
|
+
}, [createVNode("div", {
|
|
35
|
+
"class": "layplux-bottom-area__left"
|
|
36
|
+
}, [...left]), createVNode("div", {
|
|
37
|
+
"class": "layplux-bottom-area__center"
|
|
38
|
+
}, [...center]), createVNode("div", {
|
|
39
|
+
"class": "layplux-bottom-area__right"
|
|
40
|
+
}, [...right])]);
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
44
|
+
|
|
45
|
+
export { BottomArea };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const BottomLeftArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'BottomLeftArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
@@ -9,14 +9,15 @@ const BottomLeftArea = 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-bottom-left-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 { BottomLeftArea };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
|
|
3
3
|
const BottomRightArea = defineComponent({
|
|
4
|
-
name:
|
|
4
|
+
name: 'BottomRightArea',
|
|
5
5
|
props: {
|
|
6
6
|
area: Object
|
|
7
7
|
},
|
|
@@ -9,10 +9,11 @@ const BottomRightArea = 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-bottom-right-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 { BottomRightArea };
|