@ibiz-template/vue3-components 0.7.41-alpha.96 → 0.7.41-alpha.98
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-CTxNNWbw.js +1 -0
- package/dist/index-DAM-lgrU.js +1 -0
- package/dist/index-DSNJCnK2.js +339 -0
- package/dist/{index.es-COHR8lWq.js → index.es-STEFwkv3.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-Dchfm22O.js +1 -0
- package/dist/{xlsx-util-CzrO72Os.js → xlsx-util-D-uPcLFr.js} +2 -2
- package/es/common/control-navigation/provider/navigation-base.provider.mjs +3 -1
- package/es/common/high-light-code/high-light-code-util.mjs +183 -0
- package/es/common/high-light-code/high-light-code.css +1 -0
- package/es/common/high-light-code/high-light-code.mjs +31 -0
- package/es/common/index.mjs +2 -0
- package/es/common/pagination/pagination.mjs +5 -1
- package/es/common/rawitem/rawitem.mjs +2 -0
- package/es/control/calendar/calendar-util.mjs +1 -1
- package/es/control/calendar/calendar.mjs +54 -40
- package/es/control/calendar/components/calendar-flatten/calendar-flatten.css +1 -0
- package/es/control/calendar/components/calendar-flatten/calendar-flatten.mjs +200 -0
- package/es/control/calendar/components/calendar-flatten/index.mjs +9 -0
- package/es/control/calendar/components/custom-calendar/custom-calendar.mjs +1 -1
- package/es/control/calendar/components/custom-calendar/use-custom-calendar.mjs +2 -2
- package/es/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.css +1 -1
- package/es/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.mjs +20 -3
- package/es/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.mjs +32 -7
- package/es/control/data-view/data-view.mjs +2 -2
- package/es/control/form/form-detail/form-page/form-page.mjs +1 -1
- package/es/control/form/form-detail/form-rawitem/form-rawitem.mjs +3 -1
- package/es/control/grid/grid/grid-control.util.mjs +1 -1
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/grid/grid/grid.mjs +31 -9
- package/es/control/grid/grid-column/grid-column-header/grid-column-header.css +1 -1
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
- package/es/control/grid/grid-column/grid-field-edit-column/grid-edit-item/grid-edit-item.css +1 -1
- package/es/control/grid/grid-column/grid-ua-column/grid-ua-column.css +1 -1
- package/es/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/es/control/list/list.css +1 -1
- package/es/control/list/list.mjs +6 -3
- package/es/control/search-bar/filter-mode-select/filter-mode-select.mjs +2 -2
- package/es/control/search-bar/filter-tree/filter-tree.mjs +2 -2
- package/es/editor/code/code-editor.controller.mjs +11 -1
- package/es/editor/code/monaco-editor/monaco-editor.css +1 -1
- package/es/editor/code/monaco-editor/monaco-editor.mjs +54 -7
- package/es/editor/raw/ibiz-raw/ibiz-raw.mjs +3 -1
- package/es/locale/en/index.mjs +4 -3
- package/es/locale/index.mjs +29 -1
- package/es/locale/zh-CN/index.mjs +4 -3
- package/es/util/inline-ai-util/inline-ai-util.mjs +17 -1
- package/lib/common/control-navigation/provider/navigation-base.provider.cjs +3 -1
- package/lib/common/high-light-code/high-light-code-util.cjs +185 -0
- package/lib/common/high-light-code/high-light-code.cjs +33 -0
- package/lib/common/high-light-code/high-light-code.css +1 -0
- package/lib/common/index.cjs +2 -0
- package/lib/common/pagination/pagination.cjs +5 -1
- package/lib/common/rawitem/rawitem.cjs +2 -0
- package/lib/control/calendar/calendar-util.cjs +1 -1
- package/lib/control/calendar/calendar.cjs +54 -40
- package/lib/control/calendar/components/calendar-flatten/calendar-flatten.cjs +202 -0
- package/lib/control/calendar/components/calendar-flatten/calendar-flatten.css +1 -0
- package/lib/control/calendar/components/calendar-flatten/index.cjs +14 -0
- package/lib/control/calendar/components/custom-calendar/custom-calendar.cjs +1 -1
- package/lib/control/calendar/components/custom-calendar/use-custom-calendar.cjs +2 -2
- package/lib/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.cjs +20 -3
- package/lib/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.css +1 -1
- package/lib/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.cjs +31 -6
- package/lib/control/data-view/data-view.cjs +2 -2
- package/lib/control/form/form-detail/form-page/form-page.cjs +1 -1
- package/lib/control/form/form-detail/form-rawitem/form-rawitem.cjs +3 -1
- package/lib/control/grid/grid/grid-control.util.cjs +1 -1
- package/lib/control/grid/grid/grid.cjs +30 -8
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/grid/grid-column/grid-column-header/grid-column-header.css +1 -1
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-edit-item/grid-edit-item.css +1 -1
- package/lib/control/grid/grid-column/grid-ua-column/grid-ua-column.css +1 -1
- package/lib/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/lib/control/list/list.cjs +6 -3
- package/lib/control/list/list.css +1 -1
- package/lib/control/search-bar/filter-mode-select/filter-mode-select.cjs +2 -2
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +2 -2
- package/lib/editor/code/code-editor.controller.cjs +11 -1
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +54 -7
- package/lib/editor/code/monaco-editor/monaco-editor.css +1 -1
- package/lib/editor/raw/ibiz-raw/ibiz-raw.cjs +3 -1
- package/lib/locale/en/index.cjs +4 -3
- package/lib/locale/index.cjs +29 -1
- package/lib/locale/zh-CN/index.cjs +4 -3
- package/lib/util/inline-ai-util/inline-ai-util.cjs +17 -1
- package/package.json +6 -6
- package/dist/index-CSWh3Soj.js +0 -339
- package/dist/index-ChKlnzfZ.js +0 -1
- package/dist/index-DiSn0c6_.js +0 -1
- package/dist/wang-editor-DGTnSGqn.js +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const KEYWORDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"async",
|
|
4
|
+
"function",
|
|
5
|
+
"Function",
|
|
6
|
+
"return",
|
|
7
|
+
"const",
|
|
8
|
+
"let",
|
|
9
|
+
"var",
|
|
10
|
+
"await",
|
|
11
|
+
"new",
|
|
12
|
+
"this",
|
|
13
|
+
"null",
|
|
14
|
+
"undefined",
|
|
15
|
+
"true",
|
|
16
|
+
"false"
|
|
17
|
+
]);
|
|
18
|
+
function escapeHtml(s) {
|
|
19
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
20
|
+
}
|
|
21
|
+
function normalizeFunctionBody(src) {
|
|
22
|
+
const open = src.lastIndexOf("{");
|
|
23
|
+
if (open === -1)
|
|
24
|
+
return src;
|
|
25
|
+
let depth = 0;
|
|
26
|
+
let close = -1;
|
|
27
|
+
let i = open;
|
|
28
|
+
while (i < src.length) {
|
|
29
|
+
const ch = src[i];
|
|
30
|
+
if (ch === '"' || ch === "'" || ch === "`") {
|
|
31
|
+
const q = ch;
|
|
32
|
+
i++;
|
|
33
|
+
while (i < src.length && src[i] !== q) {
|
|
34
|
+
if (src[i] === "\\")
|
|
35
|
+
i++;
|
|
36
|
+
i++;
|
|
37
|
+
}
|
|
38
|
+
i++;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (ch === "/" && src[i + 1] === "/") {
|
|
42
|
+
while (i < src.length && src[i] !== "\n")
|
|
43
|
+
i++;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (ch === "/" && src[i + 1] === "*") {
|
|
47
|
+
i += 2;
|
|
48
|
+
while (i < src.length - 1 && !(src[i] === "*" && src[i + 1] === "/"))
|
|
49
|
+
i++;
|
|
50
|
+
i += 2;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (ch === "{")
|
|
54
|
+
depth++;
|
|
55
|
+
else if (ch === "}") {
|
|
56
|
+
depth--;
|
|
57
|
+
if (depth === 0) {
|
|
58
|
+
close = i;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
i++;
|
|
63
|
+
}
|
|
64
|
+
if (close === -1)
|
|
65
|
+
return src;
|
|
66
|
+
const inner = src.slice(open + 1, close);
|
|
67
|
+
if (/\n/.test(inner))
|
|
68
|
+
return src;
|
|
69
|
+
const trimmed = inner.trim();
|
|
70
|
+
const indented = trimmed ? "\n ".concat(trimmed, "\n") : "\n";
|
|
71
|
+
return src.slice(0, open + 1) + indented + src.slice(close);
|
|
72
|
+
}
|
|
73
|
+
const highlight = (src) => {
|
|
74
|
+
src = normalizeFunctionBody(src);
|
|
75
|
+
let result = "";
|
|
76
|
+
let i = 0;
|
|
77
|
+
console.log(src);
|
|
78
|
+
while (i < src.length) {
|
|
79
|
+
if (src[i] === "/" && src[i + 1] === "/") {
|
|
80
|
+
let j = i;
|
|
81
|
+
while (j < src.length && src[j] !== "\n")
|
|
82
|
+
j++;
|
|
83
|
+
result += '<span class="comment">'.concat(escapeHtml(src.slice(i, j)), "</span>");
|
|
84
|
+
i = j;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (src[i] === "/" && src[i + 1] === "*") {
|
|
88
|
+
let j = i + 2;
|
|
89
|
+
while (j < src.length - 1 && !(src[j] === "*" && src[j + 1] === "/"))
|
|
90
|
+
j++;
|
|
91
|
+
j += 2;
|
|
92
|
+
result += '<span class="comment">'.concat(escapeHtml(src.slice(i, j)), "</span>");
|
|
93
|
+
i = j;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (src[i] === '"' || src[i] === "'" || src[i] === "`") {
|
|
97
|
+
const quote = src[i];
|
|
98
|
+
let j = i + 1;
|
|
99
|
+
while (j < src.length && src[j] !== quote) {
|
|
100
|
+
if (src[j] === "\\")
|
|
101
|
+
j++;
|
|
102
|
+
j++;
|
|
103
|
+
}
|
|
104
|
+
j++;
|
|
105
|
+
result += '<span class="string">'.concat(escapeHtml(src.slice(i, j)), "</span>");
|
|
106
|
+
i = j;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (/[0-9]/.test(src[i])) {
|
|
110
|
+
let j = i;
|
|
111
|
+
while (j < src.length && /[0-9._]/.test(src[j]))
|
|
112
|
+
j++;
|
|
113
|
+
result += '<span class="number">'.concat(escapeHtml(src.slice(i, j)), "</span>");
|
|
114
|
+
i = j;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (/[a-zA-Z_$]/.test(src[i])) {
|
|
118
|
+
let j = i;
|
|
119
|
+
while (j < src.length && /[a-zA-Z0-9_$]/.test(src[j]))
|
|
120
|
+
j++;
|
|
121
|
+
const word = src.slice(i, j);
|
|
122
|
+
let k = j;
|
|
123
|
+
while (k < src.length && src[k] === " ")
|
|
124
|
+
k++;
|
|
125
|
+
const isCall = src[k] === "(";
|
|
126
|
+
let m = j;
|
|
127
|
+
while (m < src.length && src[m] === " ")
|
|
128
|
+
m++;
|
|
129
|
+
const isTyped = src[m] === ":";
|
|
130
|
+
if (KEYWORDS.has(word)) {
|
|
131
|
+
result += '<span class="keyword">'.concat(escapeHtml(word), "</span>");
|
|
132
|
+
} else if (isTyped) {
|
|
133
|
+
result += '<span class="param">'.concat(escapeHtml(word), "</span>");
|
|
134
|
+
} else if (isCall) {
|
|
135
|
+
result += '<span class="fn-call">'.concat(escapeHtml(word), "</span>");
|
|
136
|
+
} else {
|
|
137
|
+
result += '<span class="ident">'.concat(escapeHtml(word), "</span>");
|
|
138
|
+
}
|
|
139
|
+
i = j;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (src[i] === ":") {
|
|
143
|
+
result += '<span class="punct">:</span>';
|
|
144
|
+
i++;
|
|
145
|
+
let ws = "";
|
|
146
|
+
while (i < src.length && src[i] === " ") {
|
|
147
|
+
ws += src[i];
|
|
148
|
+
i++;
|
|
149
|
+
}
|
|
150
|
+
if (ws)
|
|
151
|
+
result += ws;
|
|
152
|
+
if (i < src.length && /[a-zA-Z_$]/.test(src[i])) {
|
|
153
|
+
let j = i;
|
|
154
|
+
while (j < src.length && /[a-zA-Z0-9_$<>[\]|&]/.test(src[j]))
|
|
155
|
+
j++;
|
|
156
|
+
result += '<span class="type">'.concat(escapeHtml(src.slice(i, j)), "</span>");
|
|
157
|
+
i = j;
|
|
158
|
+
}
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if ("(){}[]".includes(src[i])) {
|
|
162
|
+
const cls = "([{".includes(src[i]) ? "bracket-open" : "bracket-close";
|
|
163
|
+
result += '<span class="bracket '.concat(cls, '">').concat(escapeHtml(src[i]), "</span>");
|
|
164
|
+
i++;
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (",;.".includes(src[i])) {
|
|
168
|
+
result += '<span class="punct">'.concat(escapeHtml(src[i]), "</span>");
|
|
169
|
+
i++;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if ("=><+-*/%!&|^~".includes(src[i])) {
|
|
173
|
+
result += '<span class="operator">'.concat(escapeHtml(src[i]), "</span>");
|
|
174
|
+
i++;
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
result += escapeHtml(src[i]);
|
|
178
|
+
i++;
|
|
179
|
+
}
|
|
180
|
+
return result;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export { highlight };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-high-light-code{color:var(--ibiz-color-text-3);white-space:break-spaces}.ibiz-high-light-code .keyword{color:#7f77dd}.ibiz-high-light-code .type{color:#378add}.ibiz-high-light-code .param{color:#1d9e75}.ibiz-high-light-code .ident{color:#1d9e75}.ibiz-high-light-code .fn-call{color:#d2a8ff}.ibiz-high-light-code .string{color:#639922}.ibiz-high-light-code .number{color:#79c0ff}.ibiz-high-light-code .comment{font-style:italic;color:#8b949e}.ibiz-high-light-code .operator{color:#ff7b72}.ibiz-high-light-code .punct{color:#8b949e}.ibiz-high-light-code .bracket-open{color:#e3b341}.ibiz-high-light-code .bracket-close{color:#e3b341}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent, createVNode, computed } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { highlight } from './high-light-code-util.mjs';
|
|
4
|
+
import './high-light-code.css';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const IBizHighLightCode = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "IBizHighLightCode",
|
|
9
|
+
props: {
|
|
10
|
+
code: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(props) {
|
|
16
|
+
const ns = useNamespace("high-light-code");
|
|
17
|
+
const highlighted = computed(() => highlight(props.code));
|
|
18
|
+
return {
|
|
19
|
+
ns,
|
|
20
|
+
highlighted
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
render() {
|
|
24
|
+
return createVNode("div", {
|
|
25
|
+
"class": this.ns.b(),
|
|
26
|
+
"innerHTML": this.highlighted
|
|
27
|
+
}, null);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export { IBizHighLightCode };
|
package/es/common/index.mjs
CHANGED
|
@@ -34,6 +34,7 @@ import { IBizNavSplit } from './nav-split/nav-split.mjs';
|
|
|
34
34
|
import { IBizCropping } from './cropping/cropping.mjs';
|
|
35
35
|
import { IBizEditorEmptyText } from './editor-empty-text/editor-empty-text.mjs';
|
|
36
36
|
import { IBizKanbanSetting } from './kanben-setting/kanben-setting.mjs';
|
|
37
|
+
import { IBizHighLightCode } from './high-light-code/high-light-code.mjs';
|
|
37
38
|
|
|
38
39
|
"use strict";
|
|
39
40
|
const IBizCommonComponents = {
|
|
@@ -92,6 +93,7 @@ const IBizCommonComponents = {
|
|
|
92
93
|
v.component(IBizGanttSetting.name, IBizGanttSetting);
|
|
93
94
|
v.component(IBizNavSplit.name, IBizNavSplit);
|
|
94
95
|
v.component(IBizSignaturePad.name, IBizSignaturePad);
|
|
96
|
+
v.component(IBizHighLightCode.name, IBizHighLightCode);
|
|
95
97
|
}
|
|
96
98
|
};
|
|
97
99
|
|
|
@@ -116,7 +116,11 @@ const IBizPagination = /* @__PURE__ */ defineComponent({
|
|
|
116
116
|
default: () => [createVNode("ion-icon", {
|
|
117
117
|
"name": "refresh-outline"
|
|
118
118
|
}, null)]
|
|
119
|
-
})]), isNil(this.totalPages) || this.calcTotalPages === this.totalPages ? createVNode("span",
|
|
119
|
+
})]), isNil(this.totalPages) || this.calcTotalPages === this.totalPages ? createVNode("span", {
|
|
120
|
+
"class": this.ns.b("desc")
|
|
121
|
+
}, [ibiz.i18n.t("component.pagination.display"), createTextVNode("\xA0"), this.start, createTextVNode("\xA0-\xA0"), this.end, createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.piece"), createTextVNode("\uFF0C")]) : null, createVNode("span", {
|
|
122
|
+
"class": this.ns.b("desc")
|
|
123
|
+
}, [ibiz.i18n.t("component.pagination.total"), createTextVNode("\xA0"), this.total, createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.pieceData")])]
|
|
120
124
|
})]);
|
|
121
125
|
}
|
|
122
126
|
});
|
|
@@ -269,6 +269,7 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
|
|
|
269
269
|
}
|
|
270
270
|
if (this.rawItemType === "DIVIDER") {
|
|
271
271
|
return createVNode(resolveComponent("el-divider"), {
|
|
272
|
+
"class": this.ns.e("divider"),
|
|
272
273
|
"content-position": this.dividerParams.contentPosition
|
|
273
274
|
}, {
|
|
274
275
|
default: () => [createVNode("span", {
|
|
@@ -278,6 +279,7 @@ const IBizRawItem = /* @__PURE__ */ defineComponent({
|
|
|
278
279
|
}
|
|
279
280
|
if (this.rawItemType === "INFO" || this.rawItemType === "WARNING" || this.rawItemType === "ERROR") {
|
|
280
281
|
return createVNode(resolveComponent("el-alert"), {
|
|
282
|
+
"class": this.ns.e("alert"),
|
|
281
283
|
"title": this.alertParams.title,
|
|
282
284
|
"type": this.alertParams.type,
|
|
283
285
|
"show-icon": this.alertParams.showIcon,
|
|
@@ -36,7 +36,7 @@ function useCalendarLegend(ns) {
|
|
|
36
36
|
() => getVarValue("".concat(ns.cssVarName("color-black")))
|
|
37
37
|
);
|
|
38
38
|
const getBkColor = (_index) => {
|
|
39
|
-
return bgColors[_index] || bgColors[0];
|
|
39
|
+
return bgColors[_index % bgColors.length] || bgColors[0];
|
|
40
40
|
};
|
|
41
41
|
const getActBdrColors = (_index) => {
|
|
42
42
|
return actBdrColors[_index] || getVarValue("".concat(ns.cssVarName("color-primary")));
|
|
@@ -5,6 +5,7 @@ import dayjs from 'dayjs';
|
|
|
5
5
|
import { debounce } from 'lodash-es';
|
|
6
6
|
import { showTitle } from '@ibiz-template/core';
|
|
7
7
|
import { IBizCustomCalendar } from './components/custom-calendar/index.mjs';
|
|
8
|
+
import { IBizCalendarFlatten } from './components/calendar-flatten/index.mjs';
|
|
8
9
|
import { isTimeBetween, useCalendarLegend, getWeekRange } from './calendar-util.mjs';
|
|
9
10
|
import '../../util/index.mjs';
|
|
10
11
|
import './calendar.css';
|
|
@@ -90,15 +91,13 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
90
91
|
const result = !Object.values(c.loadMoreItems).some((item) => item.curPage < item.totalPage);
|
|
91
92
|
return result;
|
|
92
93
|
});
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const legendType = ["DAY", "WEEK", "MONTH", "USER2"];
|
|
95
|
+
const legends = ref([]);
|
|
96
|
+
const onLegendClick = (item) => {
|
|
97
|
+
item.isShow = !item.isShow;
|
|
97
98
|
};
|
|
98
|
-
const legendItems = ref([]);
|
|
99
|
-
const legendType = ["DAY", "WEEK", "MONTH"];
|
|
100
99
|
const calcLegend = () => {
|
|
101
|
-
|
|
100
|
+
legends.value = c.state.legends.map((_item, index) => {
|
|
102
101
|
const tempItem = {
|
|
103
102
|
..._item,
|
|
104
103
|
isShow: true
|
|
@@ -190,13 +189,20 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
190
189
|
return false;
|
|
191
190
|
};
|
|
192
191
|
watch(() => c.state.selectedDate, (newVal, oldVal) => {
|
|
193
|
-
if (timeRangeComparison(newVal, oldVal))
|
|
192
|
+
if (timeRangeComparison(newVal, oldVal))
|
|
193
|
+
return;
|
|
194
|
+
c.load();
|
|
195
|
+
});
|
|
196
|
+
watch(() => c.state.timeRange, () => {
|
|
197
|
+
if (!c.state.isLoaded)
|
|
194
198
|
return;
|
|
195
|
-
}
|
|
196
199
|
c.load();
|
|
197
200
|
});
|
|
201
|
+
const onTimeRangeChange = (date) => {
|
|
202
|
+
c.state.timeRange = date;
|
|
203
|
+
};
|
|
198
204
|
const calcItemStyle = (data) => {
|
|
199
|
-
const _legend =
|
|
205
|
+
const _legend = legends.value.find((_item) => _item.id === data.itemType);
|
|
200
206
|
return {
|
|
201
207
|
color: data.color,
|
|
202
208
|
backgroundColor: data.bkColor,
|
|
@@ -207,7 +213,7 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
207
213
|
const calcCalendarItems = (date) => {
|
|
208
214
|
const weekRange = getWeekRange(date);
|
|
209
215
|
const calendarItems = c.state.items.filter((item) => {
|
|
210
|
-
const _legend =
|
|
216
|
+
const _legend = legends.value.find((legend) => legend.id === item.itemType);
|
|
211
217
|
if (_legend && !_legend.isShow)
|
|
212
218
|
return false;
|
|
213
219
|
if (!showDateRange.value) {
|
|
@@ -231,7 +237,7 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
231
237
|
});
|
|
232
238
|
}
|
|
233
239
|
return calendarItems.map((_item) => {
|
|
234
|
-
const targetLegend =
|
|
240
|
+
const targetLegend = legends.value.find((legendItem) => Object.is(legendItem.id, _item.itemType));
|
|
235
241
|
if (!targetLegend)
|
|
236
242
|
return _item;
|
|
237
243
|
if (!_item.bkColor)
|
|
@@ -377,9 +383,9 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
377
383
|
return {
|
|
378
384
|
c,
|
|
379
385
|
ns,
|
|
386
|
+
legends,
|
|
380
387
|
curPopover,
|
|
381
388
|
calendarRef,
|
|
382
|
-
legendItems,
|
|
383
389
|
popoverValue,
|
|
384
390
|
showDateList,
|
|
385
391
|
showDateRange,
|
|
@@ -387,8 +393,9 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
387
393
|
disabledLodeMore,
|
|
388
394
|
selectDate,
|
|
389
395
|
calcItemStyle,
|
|
396
|
+
onLegendClick,
|
|
390
397
|
handleScrollLoad,
|
|
391
|
-
|
|
398
|
+
onTimeRangeChange,
|
|
392
399
|
calcCalendarItems,
|
|
393
400
|
onNodeContextmenu
|
|
394
401
|
};
|
|
@@ -503,25 +510,19 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
503
510
|
"class": this.ns.b("content-title")
|
|
504
511
|
}, [date]), createVNode("div", {
|
|
505
512
|
"class": this.ns.b("legend")
|
|
506
|
-
}, [this.
|
|
507
|
-
var _a;
|
|
508
|
-
let label = _legend.name;
|
|
509
|
-
const _model = (_a = this.c.model.sysCalendarItems) == null ? void 0 : _a.find((_calendarItem) => _calendarItem.id === _legend.id);
|
|
510
|
-
if (_model == null ? void 0 : _model.nameLanguageRes) {
|
|
511
|
-
label = ibiz.i18n.t(_model.nameLanguageRes.lanResTag, _model.name);
|
|
512
|
-
}
|
|
513
|
+
}, [this.legends && this.legends.length > 1 && this.legends.map((legend) => {
|
|
513
514
|
return createVNode("div", {
|
|
514
515
|
"class": [this.ns.be("legend", "item")],
|
|
515
|
-
"onClick": () => this.
|
|
516
|
+
"onClick": () => this.onLegendClick(legend)
|
|
516
517
|
}, [createVNode("div", {
|
|
517
518
|
"class": this.ns.bem("legend", "item", "tip"),
|
|
518
519
|
"style": {
|
|
519
|
-
background:
|
|
520
|
-
color:
|
|
520
|
+
background: legend.isShow ? legend == null ? void 0 : legend.bkcolor : "var(".concat(this.ns.cssVarName("color-disabled-bg"), ")"),
|
|
521
|
+
color: legend == null ? void 0 : legend.color
|
|
521
522
|
}
|
|
522
523
|
}, null), createVNode("div", {
|
|
523
524
|
"class": this.ns.bem("legend", "item", "text")
|
|
524
|
-
}, [
|
|
525
|
+
}, [legend.name])]);
|
|
525
526
|
})]), createVNode("div", {
|
|
526
527
|
"class": this.ns.b("content-header")
|
|
527
528
|
}, [createVNode(resolveComponent("el-date-picker"), {
|
|
@@ -598,22 +599,23 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
598
599
|
default: () => [noDataSlots]
|
|
599
600
|
});
|
|
600
601
|
};
|
|
601
|
-
const
|
|
602
|
-
const slots = {};
|
|
602
|
+
const renderSlots = () => {
|
|
603
603
|
const {
|
|
604
|
-
sysCalendarItems
|
|
604
|
+
sysCalendarItems = []
|
|
605
605
|
} = this.c.model;
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
return
|
|
606
|
+
return {
|
|
607
|
+
event: ({
|
|
608
|
+
data
|
|
609
|
+
}) => {
|
|
610
|
+
const model = sysCalendarItems.find((item) => data.itemType === item.itemType);
|
|
611
|
+
if (model == null ? void 0 : model.layoutPanel)
|
|
612
|
+
return renderPanelItem(data, model.layoutPanel);
|
|
613
|
+
return renderDefaultItem(data);
|
|
614
614
|
}
|
|
615
|
-
return renderDefaultItem(data);
|
|
616
615
|
};
|
|
616
|
+
};
|
|
617
|
+
const renderWeekDay = () => {
|
|
618
|
+
let _slot6;
|
|
617
619
|
return createVNode("div", {
|
|
618
620
|
"class": this.ns.b("content")
|
|
619
621
|
}, [createVNode(IBizCustomCalendar, {
|
|
@@ -624,7 +626,7 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
624
626
|
"ref": "calendarRef",
|
|
625
627
|
"viewType": this.c.model.calendarStyle,
|
|
626
628
|
"events": this.c.state.items,
|
|
627
|
-
"legends": this.
|
|
629
|
+
"legends": this.legends,
|
|
628
630
|
"multiple": !this.c.state.singleSelect,
|
|
629
631
|
"selectedData": this.c.state.selectedData,
|
|
630
632
|
"onEventClick": (value) => {
|
|
@@ -652,8 +654,8 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
652
654
|
if (item && evt)
|
|
653
655
|
this.onNodeContextmenu(item, evt);
|
|
654
656
|
}
|
|
655
|
-
}, _isSlot(
|
|
656
|
-
default: () => [
|
|
657
|
+
}, _isSlot(_slot6 = renderSlots()) ? _slot6 : {
|
|
658
|
+
default: () => [_slot6]
|
|
657
659
|
})]);
|
|
658
660
|
};
|
|
659
661
|
const renderTimeLine = () => {
|
|
@@ -681,6 +683,7 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
681
683
|
})]);
|
|
682
684
|
};
|
|
683
685
|
const renderCalendar = () => {
|
|
686
|
+
let _slot7;
|
|
684
687
|
switch (this.c.model.calendarStyle) {
|
|
685
688
|
case "TIMELINE":
|
|
686
689
|
return renderTimeLine();
|
|
@@ -688,6 +691,17 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
|
|
|
688
691
|
case "DAY":
|
|
689
692
|
case "USER":
|
|
690
693
|
return renderWeekDay();
|
|
694
|
+
case "USER2":
|
|
695
|
+
return createVNode(IBizCalendarFlatten, {
|
|
696
|
+
"legends": this.legends,
|
|
697
|
+
"items": this.c.state.items,
|
|
698
|
+
"timeRange": this.c.state.timeRange,
|
|
699
|
+
"title": this.c.state.calendarTitle,
|
|
700
|
+
"onLegendClick": this.onLegendClick,
|
|
701
|
+
"onTimeRangeChange": this.onTimeRangeChange
|
|
702
|
+
}, _isSlot(_slot7 = renderSlots()) ? _slot7 : {
|
|
703
|
+
default: () => [_slot7]
|
|
704
|
+
});
|
|
691
705
|
case "MONTH":
|
|
692
706
|
default:
|
|
693
707
|
return renderElCalender();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-calendar-flatten{display:flex;flex-direction:column;gap:var(--ibiz-spacing-tight);width:100%;height:100%}.ibiz-calendar-flatten__header{display:flex;flex-shrink:0;align-items:center;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base-loose);border-bottom:1px solid var(--ibiz-color-border)}.ibiz-calendar-flatten__header--left{flex-shrink:0;min-width:300px}.ibiz-calendar-flatten__header--centre{display:flex;flex-grow:1;gap:var(--ibiz-spacing-tight);align-items:center;justify-content:center}.ibiz-calendar-flatten__header--right{flex-shrink:0}.ibiz-calendar-flatten__body{display:flex;flex-grow:1;flex-wrap:wrap;gap:var(--ibiz-spacing-tight);overflow:auto}.ibiz-calendar-flatten__month-calendar{width:366px;border:1px solid var(--ibiz-color-border)}.ibiz-calendar-flatten__month-calendar .el-calendar__header{display:flex;justify-content:center}.ibiz-calendar-flatten__month-calendar .el-calendar__body{padding:var(--ibiz-spacing-tight)}.ibiz-calendar-flatten__month-calendar .el-calendar-table .el-calendar-day{width:50px;height:50px;padding:0}.ibiz-calendar-flatten__month-calendar .el-calendar-table td.is-selected{background-color:transparent}.ibiz-calendar-flatten__date{display:flex;flex-direction:column;gap:var(--ibiz-spacing-extra-tight);align-items:center;justify-content:center;width:100%;height:100%;padding:4px}.ibiz-calendar-flatten__date--day{flex-shrink:0}.ibiz-calendar-flatten__date--mark{display:flex;flex-grow:1;flex-wrap:wrap;gap:var(--ibiz-spacing-extra-tight);justify-content:center;overflow:hidden}.ibiz-calendar-flatten__dot{width:4px;height:4px;border-radius:50%}.ibiz-calendar-flatten__legend{display:flex;gap:var(--ibiz-spacing-extra-tight);align-items:center;cursor:pointer}.ibiz-calendar-flatten__legend--dot{width:16px;height:16px;border-radius:50%}.ibiz-calendar-flatten__popover{max-height:300px;overflow:auto}.ibiz-calendar-flatten__event .ibiz-control-calendar-item{width:126px;height:auto}.ibiz-calendar-flatten__event .ibiz-control-calendar-item.is-active{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}
|