@opendesign-plus-test/components 0.0.1-rc.85 → 0.0.1-rc.87
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/components/header/OHeader.vue.d.ts +6 -2
- package/dist/components/header/index.d.ts +3 -1
- package/dist/components.cjs.js +40 -40
- package/dist/components.css +1 -1
- package/dist/components.es.js +7276 -7233
- package/dist/treeshaking/components/common/MoreText.css +12 -12
- package/dist/treeshaking/components/common/MoreText.vue.mjs +86 -5
- package/dist/treeshaking/components/common/MoreText.vue3.mjs +5 -0
- package/dist/treeshaking/components/common/ThFilter.css +10 -10
- package/dist/treeshaking/components/common/TooltipText.css +13 -6
- package/dist/treeshaking/components/common/TooltipText.vue.mjs +83 -6
- package/dist/treeshaking/components/common/TooltipText.vue3.mjs +5 -0
- package/dist/treeshaking/components/header/OHeader.css +13 -18
- package/dist/treeshaking/components/header/OHeader.vue.d.ts +6 -2
- package/dist/treeshaking/components/header/OHeader.vue.mjs +1 -1
- package/dist/treeshaking/components/header/OHeader.vue2.mjs +80 -9
- package/dist/treeshaking/components/header/OHeaderMobile.css +20 -20
- package/dist/treeshaking/components/header/OHeaderMobile.vue.mjs +1 -1
- package/dist/treeshaking/components/header/components/HeaderContent.css +253 -263
- package/dist/treeshaking/components/header/components/HeaderContent.vue.mjs +1 -1
- package/dist/treeshaking/components/header/components/HeaderContent.vue2.mjs +15 -12
- package/dist/treeshaking/components/header/components/HeaderNav.css +26 -26
- package/dist/treeshaking/components/header/components/HeaderNav.vue.mjs +1 -1
- package/dist/treeshaking/components/header/components/HeaderNav.vue2.mjs +1 -3
- package/dist/treeshaking/components/header/index.d.ts +3 -1
- package/dist/treeshaking/components/header-language-switcher/OHeaderLanguageSwitcher.css +43 -29
- package/dist/treeshaking/components/header-language-switcher/OHeaderLanguageSwitcher.vue.mjs +1 -1
- package/dist/treeshaking/components/header-language-switcher/OHeaderLanguageSwitcher.vue2.mjs +1 -1
- package/dist/treeshaking/components/header-source-code/OHeaderSourceCode.css +25 -26
- package/dist/treeshaking/components/header-source-code/OHeaderSourceCode.vue.mjs +1 -1
- package/dist/treeshaking/components/header-source-code/OHeaderSourceCode.vue2.mjs +1 -0
- package/dist/treeshaking/components/header-user/OHeaderUser.css +26 -26
- package/dist/treeshaking/components/header-user/OHeaderUser.vue.mjs +1 -1
- package/dist/treeshaking/components/header-user/OHeaderUser2.css +5 -0
- package/dist/treeshaking/components/meeting/OMeetingCalendar.vue.mjs +13 -5
- package/dist/treeshaking/components/meeting/OMeetingMyCalendar.vue.mjs +3 -2
- package/dist/treeshaking/components/meeting/components/OMeetingCalendarList.vue.mjs +3 -2
- package/dist/treeshaking/components/meeting/components/OMeetingDetail.vue.mjs +3 -2
- package/package.json +3 -3
- package/dist/treeshaking/components/common/MoreText.vue2.mjs +0 -88
- package/dist/treeshaking/components/common/TooltipText.vue2.mjs +0 -85
- package/dist/treeshaking/components/common/TooltipText2.css +0 -15
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
.hover-icon-rotate .o-icon
|
|
1
|
+
.hover-icon-rotate .o-icon {
|
|
2
2
|
transition: all var(--o-duration-m1) var(--o-easing-standard-in);
|
|
3
3
|
}
|
|
4
4
|
@media (hover: hover) {
|
|
5
|
-
.hover-icon-rotate:hover .o-icon
|
|
5
|
+
.hover-icon-rotate:hover .o-icon {
|
|
6
6
|
transform: rotate(-180deg);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
.more-text-wrapper .more-text-content
|
|
9
|
+
.more-text-wrapper .more-text-content {
|
|
10
10
|
line-height: 1.5em;
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
text-overflow: ellipsis;
|
|
@@ -16,24 +16,24 @@
|
|
|
16
16
|
word-break: break-all;
|
|
17
17
|
transition: height 0.1s;
|
|
18
18
|
}
|
|
19
|
-
.more-text-wrapper .more-text-content.is-link
|
|
19
|
+
.more-text-wrapper .more-text-content.is-link {
|
|
20
20
|
color: var(--o-color-primary1);
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
}
|
|
23
23
|
@media (hover: hover) {
|
|
24
|
-
.more-text-wrapper .more-text-content.is-link
|
|
24
|
+
.more-text-wrapper .more-text-content.is-link:hover {
|
|
25
25
|
color: var(--o-color-primary2);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
.more-text-wrapper .more-text-btn
|
|
28
|
+
.more-text-wrapper .more-text-btn {
|
|
29
29
|
color: var(--o-color-primary1);
|
|
30
30
|
}
|
|
31
31
|
@media (hover: hover) {
|
|
32
|
-
.more-text-wrapper .more-text-btn
|
|
32
|
+
.more-text-wrapper .more-text-btn:hover {
|
|
33
33
|
color: var(--o-color-primary2);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
.more-text-wrapper .more-text-btn > div
|
|
36
|
+
.more-text-wrapper .more-text-btn > div {
|
|
37
37
|
height: 1.5em;
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
display: flex;
|
|
@@ -44,25 +44,25 @@
|
|
|
44
44
|
line-height: 22px;
|
|
45
45
|
}
|
|
46
46
|
@media (min-width: 1201px) and (max-width: 1680px) {
|
|
47
|
-
.more-text-wrapper .more-text-btn > div
|
|
47
|
+
.more-text-wrapper .more-text-btn > div {
|
|
48
48
|
font-size: 12px;
|
|
49
49
|
line-height: 18px;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
@media (min-width: 841px) and (max-width: 1200px) {
|
|
53
|
-
.more-text-wrapper .more-text-btn > div
|
|
53
|
+
.more-text-wrapper .more-text-btn > div {
|
|
54
54
|
font-size: 12px;
|
|
55
55
|
line-height: 18px;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
@media (min-width: 601px) and (max-width: 840px) {
|
|
59
|
-
.more-text-wrapper .more-text-btn > div
|
|
59
|
+
.more-text-wrapper .more-text-btn > div {
|
|
60
60
|
font-size: 12px;
|
|
61
61
|
line-height: 18px;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
@media (max-width: 600px) {
|
|
65
|
-
.more-text-wrapper .more-text-btn > div
|
|
65
|
+
.more-text-wrapper .more-text-btn > div {
|
|
66
66
|
font-size: 12px;
|
|
67
67
|
line-height: 18px;
|
|
68
68
|
}
|
|
@@ -1,7 +1,88 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent, ref, onMounted, watch, nextTick, openBlock, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, toDisplayString, unref, createVNode, withCtx, createCommentVNode } from "vue";
|
|
2
|
+
import { OIcon, OIconChevronDown, OIconChevronUp } from "@opensig/opendesign";
|
|
3
|
+
import { useI18n } from "../../i18n/index.mjs";
|
|
4
|
+
const _hoisted_1 = { class: "more-text-wrapper" };
|
|
5
|
+
const _hoisted_2 = { key: 0 };
|
|
6
|
+
const _hoisted_3 = { key: 1 };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "MoreText",
|
|
9
|
+
props: {
|
|
10
|
+
text: { default: "" },
|
|
11
|
+
link: { type: Boolean, default: false },
|
|
12
|
+
lines: { default: 3 },
|
|
13
|
+
show: { type: Boolean, default: false }
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const { t } = useI18n();
|
|
18
|
+
const expanded = ref(false);
|
|
19
|
+
const showBtn = ref(false);
|
|
20
|
+
const offsetHeight = ref(0);
|
|
21
|
+
const contentRef = ref(null);
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
determineHeight();
|
|
24
|
+
});
|
|
25
|
+
watch([() => props.text, () => props.show], () => {
|
|
26
|
+
determineHeight();
|
|
27
|
+
});
|
|
28
|
+
const determineHeight = () => {
|
|
29
|
+
nextTick(() => {
|
|
30
|
+
const ele = contentRef.value;
|
|
31
|
+
if (ele) {
|
|
32
|
+
const range = document.createRange();
|
|
33
|
+
range.setStart(ele, 0);
|
|
34
|
+
range.setEnd(ele, ele.childNodes.length);
|
|
35
|
+
showBtn.value = range.getBoundingClientRect().height > ele.offsetHeight + 10 || ele.scrollHeight > ele.offsetHeight + 10;
|
|
36
|
+
offsetHeight.value = range.getBoundingClientRect().height || ele.scrollHeight;
|
|
37
|
+
} else {
|
|
38
|
+
showBtn.value = false;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const clickText = () => {
|
|
43
|
+
if (props.link) {
|
|
44
|
+
window.open(props.text);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (_ctx, _cache) => {
|
|
48
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
49
|
+
createElementVNode("div", {
|
|
50
|
+
class: normalizeClass(["more-text-content", __props.link && "is-link"]),
|
|
51
|
+
ref_key: "contentRef",
|
|
52
|
+
ref: contentRef,
|
|
53
|
+
style: normalizeStyle({
|
|
54
|
+
"max-height": expanded.value ? offsetHeight.value + "px" : "4.5em",
|
|
55
|
+
"-webkit-line-clamp": expanded.value ? "initial" : __props.lines
|
|
56
|
+
}),
|
|
57
|
+
onClick: clickText
|
|
58
|
+
}, toDisplayString(__props.text), 7),
|
|
59
|
+
showBtn.value ? (openBlock(), createElementBlock("div", {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "more-text-btn",
|
|
62
|
+
onClick: _cache[0] || (_cache[0] = ($event) => expanded.value = !expanded.value)
|
|
63
|
+
}, [
|
|
64
|
+
!expanded.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
65
|
+
createElementVNode("span", null, toDisplayString(unref(t)("common.expand")), 1),
|
|
66
|
+
createVNode(unref(OIcon), null, {
|
|
67
|
+
default: withCtx(() => [
|
|
68
|
+
createVNode(unref(OIconChevronDown))
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
})
|
|
72
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
73
|
+
createElementVNode("span", null, toDisplayString(unref(t)("common.collapse")), 1),
|
|
74
|
+
createVNode(unref(OIcon), null, {
|
|
75
|
+
default: withCtx(() => [
|
|
76
|
+
createVNode(unref(OIconChevronUp))
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
})
|
|
80
|
+
]))
|
|
81
|
+
])) : createCommentVNode("", true)
|
|
82
|
+
]);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
5
86
|
export {
|
|
6
|
-
|
|
87
|
+
_sfc_main as default
|
|
7
88
|
};
|
|
@@ -15,50 +15,50 @@
|
|
|
15
15
|
.th-filter-wrapper > span:first-child {
|
|
16
16
|
word-break: keep-all;
|
|
17
17
|
}
|
|
18
|
-
.filter-wrapper {
|
|
18
|
+
.th-filter-wrapper .filter-wrapper {
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: center;
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
}
|
|
24
|
-
.filter-wrapper > * {
|
|
24
|
+
.th-filter-wrapper .filter-wrapper > * {
|
|
25
25
|
flex-shrink: 0;
|
|
26
26
|
}
|
|
27
|
-
.filter-wrapper .filter-hover-icon {
|
|
27
|
+
.th-filter-wrapper .filter-wrapper .filter-hover-icon {
|
|
28
28
|
display: none;
|
|
29
29
|
}
|
|
30
|
-
.filter-wrapper .filter-icon {
|
|
30
|
+
.th-filter-wrapper .filter-wrapper .filter-icon {
|
|
31
31
|
font-size: 24px;
|
|
32
32
|
line-height: 32px;
|
|
33
33
|
}
|
|
34
34
|
@media (min-width: 1201px) and (max-width: 1680px) {
|
|
35
|
-
.filter-wrapper .filter-icon {
|
|
35
|
+
.th-filter-wrapper .filter-wrapper .filter-icon {
|
|
36
36
|
font-size: 20px;
|
|
37
37
|
line-height: 28px;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
@media (min-width: 841px) and (max-width: 1200px) {
|
|
41
|
-
.filter-wrapper .filter-icon {
|
|
41
|
+
.th-filter-wrapper .filter-wrapper .filter-icon {
|
|
42
42
|
font-size: 18px;
|
|
43
43
|
line-height: 26px;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
@media (min-width: 601px) and (max-width: 840px) {
|
|
47
|
-
.filter-wrapper .filter-icon {
|
|
47
|
+
.th-filter-wrapper .filter-wrapper .filter-icon {
|
|
48
48
|
font-size: 18px;
|
|
49
49
|
line-height: 26px;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
@media (max-width: 600px) {
|
|
53
|
-
.filter-wrapper .filter-icon {
|
|
53
|
+
.th-filter-wrapper .filter-wrapper .filter-icon {
|
|
54
54
|
font-size: 16px;
|
|
55
55
|
line-height: 24px;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
.filter-wrapper:hover .filter-icon, .filter-wrapper.has-checked .filter-icon {
|
|
58
|
+
.th-filter-wrapper .filter-wrapper:hover .filter-icon, .th-filter-wrapper .filter-wrapper.has-checked .filter-icon {
|
|
59
59
|
color: var(--o-color-primary1);
|
|
60
60
|
}
|
|
61
|
-
.filter-wrapper:hover .o-icon path, .filter-wrapper.has-checked .o-icon path {
|
|
61
|
+
.th-filter-wrapper .filter-wrapper:hover .o-icon path, .th-filter-wrapper .filter-wrapper.has-checked .o-icon path {
|
|
62
62
|
fill: currentColor;
|
|
63
63
|
}
|
|
64
64
|
.th-filter-dropdown .o-dropdown-item {
|
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
.hover-icon-rotate .o-icon
|
|
1
|
+
.hover-icon-rotate .o-icon {
|
|
2
2
|
transition: all var(--o-duration-m1) var(--o-easing-standard-in);
|
|
3
3
|
}
|
|
4
4
|
@media (hover: hover) {
|
|
5
|
-
.hover-icon-rotate:hover .o-icon
|
|
5
|
+
.hover-icon-rotate:hover .o-icon {
|
|
6
6
|
transform: rotate(-180deg);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
.tooltip-text-wrapper .tooltip-text
|
|
9
|
+
.tooltip-text-wrapper .tooltip-text {
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
word-break: keep-all;
|
|
12
12
|
}
|
|
13
|
-
.tooltip-text-wrapper .tooltip-text.ellipsis
|
|
13
|
+
.tooltip-text-wrapper .tooltip-text.ellipsis {
|
|
14
14
|
white-space: nowrap;
|
|
15
15
|
text-overflow: ellipsis;
|
|
16
16
|
}
|
|
17
|
-
.tooltip-text-wrapper .tooltip-text.multi-lines
|
|
17
|
+
.tooltip-text-wrapper .tooltip-text.multi-lines {
|
|
18
18
|
white-space: normal;
|
|
19
19
|
text-overflow: ellipsis;
|
|
20
20
|
display: -webkit-box;
|
|
21
21
|
-webkit-box-orient: vertical;
|
|
22
22
|
-webkit-line-clamp: var(--lines);
|
|
23
23
|
}
|
|
24
|
-
.tooltip-text-wrapper .button
|
|
24
|
+
.tooltip-text-wrapper .button {
|
|
25
25
|
color: var(--o-color-primary1);
|
|
26
26
|
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
.tooltip-text-wrapper .popup-box2 {
|
|
29
|
+
color: var(--o-color-info2);
|
|
30
|
+
}
|
|
31
|
+
.tooltip-text-wrapper .popup-box2.fz-14 {
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
line-height: 22px;
|
|
27
34
|
}
|
|
@@ -1,8 +1,85 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent, ref, useSlots, onMounted, onUnmounted, watch, computed, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, createElementVNode, normalizeClass, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { isClient, OPopover } from "@opensig/opendesign";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "TooltipText",
|
|
5
|
+
props: {
|
|
6
|
+
lines: {},
|
|
7
|
+
width: {},
|
|
8
|
+
type: { default: "" },
|
|
9
|
+
size: { default: 14 }
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const contentRef = ref(null);
|
|
13
|
+
const ellipsis = ref(true);
|
|
14
|
+
const props = __props;
|
|
15
|
+
const slots = useSlots();
|
|
16
|
+
let resizeObserver = null;
|
|
17
|
+
const checkOverflow = () => {
|
|
18
|
+
if (!isClient) return;
|
|
19
|
+
const ele = contentRef.value;
|
|
20
|
+
if (!ele) return;
|
|
21
|
+
ellipsis.value = ele.scrollWidth > ele.offsetWidth + 1 || ele.scrollHeight > ele.offsetHeight + 1;
|
|
22
|
+
};
|
|
23
|
+
onMounted(() => {
|
|
24
|
+
checkOverflow();
|
|
25
|
+
if (!isClient || !contentRef.value) return;
|
|
26
|
+
resizeObserver = new ResizeObserver(() => checkOverflow());
|
|
27
|
+
resizeObserver.observe(contentRef.value);
|
|
28
|
+
});
|
|
29
|
+
onUnmounted(() => {
|
|
30
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
31
|
+
});
|
|
32
|
+
watch(() => [props.lines, props.width], () => {
|
|
33
|
+
if (isClient) requestAnimationFrame(checkOverflow);
|
|
34
|
+
});
|
|
35
|
+
const getTextFromNode = (node) => {
|
|
36
|
+
const children = node.children ?? "";
|
|
37
|
+
if (Array.isArray(children)) {
|
|
38
|
+
return children.map((v) => getTextFromNode(v)).join("");
|
|
39
|
+
}
|
|
40
|
+
return String(children);
|
|
41
|
+
};
|
|
42
|
+
const contentText = computed(() => {
|
|
43
|
+
var _a;
|
|
44
|
+
const nodes = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || [];
|
|
45
|
+
return nodes.map((node) => getTextFromNode(node)).join("\n");
|
|
46
|
+
});
|
|
47
|
+
const wrapperStyle = computed(() => {
|
|
48
|
+
const calcWidth = Number.isNaN(Number(props.width)) ? props.width : `${props.width}px`;
|
|
49
|
+
return { width: calcWidth };
|
|
50
|
+
});
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return openBlock(), createElementBlock("div", {
|
|
53
|
+
class: "tooltip-text-wrapper",
|
|
54
|
+
style: normalizeStyle(wrapperStyle.value)
|
|
55
|
+
}, [
|
|
56
|
+
createVNode(unref(OPopover), {
|
|
57
|
+
anchor: "",
|
|
58
|
+
disabled: !ellipsis.value,
|
|
59
|
+
adjustMinWidth: false,
|
|
60
|
+
adjustWidth: true
|
|
61
|
+
}, {
|
|
62
|
+
target: withCtx(() => [
|
|
63
|
+
createElementVNode("div", {
|
|
64
|
+
class: normalizeClass(["tooltip-text", __props.type, ellipsis.value && "ellipsis", __props.lines > 1 && "multi-lines"]),
|
|
65
|
+
ref_key: "contentRef",
|
|
66
|
+
ref: contentRef,
|
|
67
|
+
style: normalizeStyle(`--lines: ${__props.lines};`)
|
|
68
|
+
}, [
|
|
69
|
+
renderSlot(_ctx.$slots, "default")
|
|
70
|
+
], 6)
|
|
71
|
+
]),
|
|
72
|
+
default: withCtx(() => [
|
|
73
|
+
createElementVNode("div", {
|
|
74
|
+
class: normalizeClass(["popup-box2", `fz-${__props.size}`])
|
|
75
|
+
}, toDisplayString(contentText.value), 3)
|
|
76
|
+
]),
|
|
77
|
+
_: 3
|
|
78
|
+
}, 8, ["disabled"])
|
|
79
|
+
], 4);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
6
83
|
export {
|
|
7
|
-
|
|
84
|
+
_sfc_main as default
|
|
8
85
|
};
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
.hover-icon-rotate .o-icon[data-v-
|
|
1
|
+
.hover-icon-rotate .o-icon[data-v-bfc2a089] {
|
|
2
2
|
transition: all var(--o-duration-m1) var(--o-easing-standard-in);
|
|
3
3
|
}
|
|
4
4
|
@media (hover: hover) {
|
|
5
|
-
.hover-icon-rotate:hover .o-icon[data-v-
|
|
5
|
+
.hover-icon-rotate:hover .o-icon[data-v-bfc2a089] {
|
|
6
6
|
transform: rotate(-180deg);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
.header[data-v-
|
|
9
|
+
.header[data-v-bfc2a089] {
|
|
10
10
|
--o-header-height: 72px;
|
|
11
11
|
}
|
|
12
|
-
.header-wrap[data-v-
|
|
12
|
+
.header-wrap[data-v-bfc2a089] {
|
|
13
13
|
background-color: var(--o-color-fill2);
|
|
14
14
|
position: fixed;
|
|
15
15
|
left: 0;
|
|
16
16
|
right: 0;
|
|
17
17
|
top: 0;
|
|
18
18
|
z-index: 999;
|
|
19
|
-
box-shadow:
|
|
19
|
+
box-shadow: var(--o-shadow-1);
|
|
20
20
|
backdrop-filter: blur(5px);
|
|
21
21
|
height: var(--o-header-height);
|
|
22
22
|
}
|
|
23
|
-
.header-content[data-v-
|
|
23
|
+
.header-content[data-v-bfc2a089] {
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
height: 100%;
|
|
27
|
+
--layout-content-padding: 28px;
|
|
27
28
|
}
|
|
28
|
-
.header-logo[data-v-
|
|
29
|
+
.header-logo[data-v-bfc2a089] {
|
|
29
30
|
height: 100%;
|
|
30
31
|
display: flex;
|
|
31
32
|
align-items: center;
|
|
@@ -33,33 +34,27 @@
|
|
|
33
34
|
margin-right: 24px;
|
|
34
35
|
flex-shrink: 0;
|
|
35
36
|
}
|
|
36
|
-
.logo[data-v-
|
|
37
|
+
.logo[data-v-bfc2a089] {
|
|
37
38
|
height: 32px;
|
|
38
39
|
}
|
|
39
|
-
.header-nav[data-v-
|
|
40
|
+
.header-nav[data-v-bfc2a089] {
|
|
40
41
|
flex: 1;
|
|
41
42
|
height: 100%;
|
|
42
43
|
min-width: 0;
|
|
43
44
|
overflow: hidden;
|
|
44
45
|
position: relative;
|
|
45
46
|
}
|
|
46
|
-
.header-toolbar[data-v-
|
|
47
|
+
.header-toolbar[data-v-bfc2a089] {
|
|
47
48
|
height: 100%;
|
|
48
49
|
position: relative;
|
|
49
50
|
}
|
|
50
|
-
.header-nav-content[data-v-
|
|
51
|
+
.header-nav-content[data-v-bfc2a089] {
|
|
51
52
|
position: fixed;
|
|
52
53
|
top: var(--o-header-height);
|
|
53
54
|
left: 0;
|
|
54
55
|
right: 0;
|
|
55
56
|
background: var(--o-color-fill2);
|
|
56
57
|
z-index: 998;
|
|
57
|
-
box-shadow:
|
|
58
|
+
box-shadow: var(--o-shadow-1);
|
|
58
59
|
overflow: hidden;
|
|
59
|
-
}
|
|
60
|
-
.header-wrap-dark[data-v-b3349981] {
|
|
61
|
-
box-shadow: 0 3px 9px 0 rgba(var(--o-grey-4), 0.08);
|
|
62
|
-
}
|
|
63
|
-
.header-wrap-dark .header-nav-content[data-v-b3349981] {
|
|
64
|
-
box-shadow: 0 3px 9px 0 rgba(var(--o-grey-4), 0.08);
|
|
65
60
|
}
|
|
@@ -10,7 +10,9 @@ declare function __VLS_template(): {
|
|
|
10
10
|
nav?(_: {}): any;
|
|
11
11
|
toolbar?(_: {}): any;
|
|
12
12
|
};
|
|
13
|
-
refs: {
|
|
13
|
+
refs: {
|
|
14
|
+
contentRef: HTMLDivElement;
|
|
15
|
+
};
|
|
14
16
|
rootEl: HTMLDivElement;
|
|
15
17
|
};
|
|
16
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -20,7 +22,9 @@ declare const __VLS_component: import('vue').DefineComponent<NavT, {}, {}, {}, {
|
|
|
20
22
|
}, string, import('vue').PublicProps, Readonly<NavT> & Readonly<{
|
|
21
23
|
"onHandle-click"?: ((val: any) => any) | undefined;
|
|
22
24
|
"onGo-home"?: (() => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
26
|
+
contentRef: HTMLDivElement;
|
|
27
|
+
}, HTMLDivElement>;
|
|
24
28
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
29
|
export default _default;
|
|
26
30
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./OHeader.vue2.mjs";
|
|
2
2
|
import './OHeader.css';
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const _OHeader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const _OHeader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bfc2a089"]]);
|
|
5
5
|
export {
|
|
6
6
|
_OHeader as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode,
|
|
1
|
+
import { defineComponent, ref, onUnmounted, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, renderSlot, createCommentVNode, createBlock } from "vue";
|
|
2
2
|
import ContentWrapper from "../common/ContentWrapper.vue.mjs";
|
|
3
3
|
import HeaderNav from "./components/HeaderNav.vue.mjs";
|
|
4
4
|
import HeaderContent from "./components/HeaderContent.vue.mjs";
|
|
5
|
-
import { useTheme } from "../../shared/theme.mjs";
|
|
6
5
|
const _hoisted_1 = { class: "header" };
|
|
7
6
|
const _hoisted_2 = ["src"];
|
|
8
7
|
const _hoisted_3 = { class: "header-nav" };
|
|
@@ -10,7 +9,6 @@ const _hoisted_4 = {
|
|
|
10
9
|
key: 0,
|
|
11
10
|
class: "header-toolbar"
|
|
12
11
|
};
|
|
13
|
-
const _hoisted_5 = { class: "header-nav-content" };
|
|
14
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
13
|
__name: "OHeader",
|
|
16
14
|
props: {
|
|
@@ -27,18 +25,80 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
25
|
},
|
|
28
26
|
emits: ["go-home", "handle-click"],
|
|
29
27
|
setup(__props, { emit: __emit }) {
|
|
30
|
-
const { isDark } = useTheme();
|
|
31
28
|
const emit = __emit;
|
|
32
29
|
const props = __props;
|
|
33
30
|
const hoverIndex = ref();
|
|
34
31
|
const hoverId = ref();
|
|
35
32
|
const itemData = ref();
|
|
36
33
|
const itemVisible = ref(false);
|
|
34
|
+
const closeTimer = ref(null);
|
|
35
|
+
const contentRef = ref();
|
|
36
|
+
const lastMousePos = ref({ x: 0, y: 0 });
|
|
37
|
+
let safetyTracker = null;
|
|
38
|
+
const cancelClose = () => {
|
|
39
|
+
if (closeTimer.value !== null) {
|
|
40
|
+
clearTimeout(closeTimer.value);
|
|
41
|
+
closeTimer.value = null;
|
|
42
|
+
}
|
|
43
|
+
removeSafetyTracker();
|
|
44
|
+
};
|
|
45
|
+
const removeSafetyTracker = () => {
|
|
46
|
+
if (safetyTracker) {
|
|
47
|
+
document.removeEventListener("mousemove", safetyTracker);
|
|
48
|
+
safetyTracker = null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const isInTriangle = (px, py, ax, ay, bx, by, cx, cy) => {
|
|
52
|
+
const d1 = (px - bx) * (ay - by) - (ax - bx) * (py - by);
|
|
53
|
+
const d2 = (px - cx) * (by - cy) - (bx - cx) * (py - cy);
|
|
54
|
+
const d3 = (px - ax) * (cy - ay) - (cx - ax) * (py - ay);
|
|
55
|
+
const hasNeg = d1 < 0 || d2 < 0 || d3 < 0;
|
|
56
|
+
const hasPos = d1 > 0 || d2 > 0 || d3 > 0;
|
|
57
|
+
return !(hasNeg && hasPos);
|
|
58
|
+
};
|
|
59
|
+
const scheduleClose = (useTriangle = true) => {
|
|
60
|
+
cancelClose();
|
|
61
|
+
const exitPos = { ...lastMousePos.value };
|
|
62
|
+
const startTimer = () => {
|
|
63
|
+
closeTimer.value = window.setTimeout(() => {
|
|
64
|
+
removeSafetyTracker();
|
|
65
|
+
itemVisible.value = false;
|
|
66
|
+
closeTimer.value = null;
|
|
67
|
+
}, 100);
|
|
68
|
+
};
|
|
69
|
+
if (useTriangle && contentRef.value && itemVisible.value) {
|
|
70
|
+
const rect = contentRef.value.getBoundingClientRect();
|
|
71
|
+
safetyTracker = (e) => {
|
|
72
|
+
const mx = e.clientX;
|
|
73
|
+
const my = e.clientY;
|
|
74
|
+
if (mx >= rect.left && mx <= rect.right && my >= rect.top && my <= rect.bottom) {
|
|
75
|
+
cancelClose();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const inTriangle = isInTriangle(mx, my, exitPos.x, exitPos.y, rect.left, rect.top, rect.right, rect.top);
|
|
79
|
+
if (!inTriangle) {
|
|
80
|
+
cancelClose();
|
|
81
|
+
itemVisible.value = false;
|
|
82
|
+
} else {
|
|
83
|
+
if (closeTimer.value !== null) {
|
|
84
|
+
clearTimeout(closeTimer.value);
|
|
85
|
+
}
|
|
86
|
+
startTimer();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
document.addEventListener("mousemove", safetyTracker);
|
|
90
|
+
}
|
|
91
|
+
startTimer();
|
|
92
|
+
};
|
|
93
|
+
const onMousemoveHeader = (e) => {
|
|
94
|
+
lastMousePos.value = { x: e.clientX, y: e.clientY };
|
|
95
|
+
};
|
|
37
96
|
const goHome = () => {
|
|
38
97
|
emit("go-home");
|
|
39
98
|
};
|
|
40
99
|
const handleMouseenter = (val) => {
|
|
41
100
|
var _a;
|
|
101
|
+
cancelClose();
|
|
42
102
|
itemData.value = val;
|
|
43
103
|
hoverIndex.value = val.id;
|
|
44
104
|
if ((_a = val == null ? void 0 : val.children) == null ? void 0 : _a.length) {
|
|
@@ -46,21 +106,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
106
|
}
|
|
47
107
|
};
|
|
48
108
|
const handleMouseleave = () => {
|
|
49
|
-
|
|
109
|
+
scheduleClose(true);
|
|
50
110
|
};
|
|
51
111
|
const handleClick = (val) => {
|
|
52
112
|
emit("handle-click", val);
|
|
53
113
|
};
|
|
54
114
|
const handleMouseenterSub = (val) => {
|
|
115
|
+
cancelClose();
|
|
55
116
|
hoverId.value = val;
|
|
56
117
|
};
|
|
57
118
|
const handleMouseleaveSub = (val) => {
|
|
58
119
|
hoverId.value = val;
|
|
120
|
+
scheduleClose(false);
|
|
59
121
|
};
|
|
122
|
+
onUnmounted(() => {
|
|
123
|
+
cancelClose();
|
|
124
|
+
});
|
|
60
125
|
return (_ctx, _cache) => {
|
|
61
126
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
62
127
|
createElementVNode("div", {
|
|
63
|
-
class:
|
|
128
|
+
class: "header-wrap",
|
|
129
|
+
onMousemove: onMousemoveHeader
|
|
64
130
|
}, [
|
|
65
131
|
createVNode(ContentWrapper, { class: "header-content" }, {
|
|
66
132
|
default: withCtx(() => [
|
|
@@ -96,8 +162,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
162
|
]),
|
|
97
163
|
_: 3
|
|
98
164
|
})
|
|
99
|
-
],
|
|
100
|
-
createElementVNode("div",
|
|
165
|
+
], 32),
|
|
166
|
+
createElementVNode("div", {
|
|
167
|
+
ref_key: "contentRef",
|
|
168
|
+
ref: contentRef,
|
|
169
|
+
class: "header-nav-content",
|
|
170
|
+
onMousemove: onMousemoveHeader
|
|
171
|
+
}, [
|
|
101
172
|
createVNode(HeaderContent, {
|
|
102
173
|
itemData: itemData.value,
|
|
103
174
|
"item-visible": itemVisible.value,
|
|
@@ -108,7 +179,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
108
179
|
onHandleMouseenterSub: handleMouseenterSub,
|
|
109
180
|
onHandleMouseleaveSub: handleMouseleaveSub
|
|
110
181
|
}, null, 8, ["itemData", "item-visible", "bg-left", "bg-right", "community", "hover-index"])
|
|
111
|
-
])
|
|
182
|
+
], 544)
|
|
112
183
|
]);
|
|
113
184
|
};
|
|
114
185
|
}
|