@baohu/canvas-editor-ui 1.0.0 → 1.2.0

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.
@@ -1,6 +1,568 @@
1
- (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-ui-style",e.appendChild(document.createTextNode(`.ceu-root{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:0;background:#f2f4f7;color:#3d4757;font-size:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;box-sizing:border-box}.ceu-root *,.ceu-dialog-container *{box-sizing:border-box}.ceu-main{position:relative;flex:1;min-height:0;overflow:auto}.ceu-editor>div{margin:20px auto}.ceu-icon{display:inline-block;width:16px;height:16px;background-repeat:no-repeat;background-size:100% 100%}.ceu-active{background:#19375814}.ceu-disabled{opacity:.4;pointer-events:none}.ceu-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 2px;padding:8px 12px;background:#f2f4f7;border-bottom:1px solid #e2e6ed;user-select:none}.ceu-toolbar__divider{width:1px;height:16px;margin:0 6px;background:#cfd2d8}.ceu-toolbar__button,.ceu-statusbar__button{position:relative;display:flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;cursor:pointer}.ceu-toolbar__button:hover,.ceu-statusbar__button:hover,.ceu-select:hover{background:#1937580a}.ceu-toolbar__item.ceu-active>.ceu-toolbar__button,.ceu-toolbar__button.ceu-active{background:#19375814}.ceu-toolbar__text{margin-left:2px;white-space:nowrap}.ceu-toolbar__button--arrow:after,.ceu-select:after{content:"";width:0;height:0;margin-left:3px;border:3px solid transparent;border-top:4px solid #767c85;transform:translateY(2px)}.ceu-select{display:flex;align-items:center;justify-content:space-between;height:24px;padding:0 4px;cursor:pointer}.ceu-select__label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ceu-color{flex-direction:column}.ceu-color .ceu-icon{width:14px;height:12px}.ceu-color__bar{width:14px;height:3px;margin-top:1px;border:1px solid #e2e6ed}.ceu-color__input{position:absolute;left:0;bottom:0;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.ceu-dropdown{position:relative}.ceu-dropdown__panel{position:absolute;left:0;z-index:10;display:none;min-width:100%;padding:6px;background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px #38383833}.ceu-dropdown__panel--bottom{top:calc(100% + 4px)}.ceu-dropdown__panel--top{bottom:calc(100% + 4px)}.ceu-dropdown__panel--visible{display:block}.ceu-option-list{margin:0;padding:0;list-style:none;max-height:300px;overflow-y:auto}.ceu-option-list li{display:flex;align-items:center;gap:6px;padding:5px 10px;white-space:nowrap;cursor:pointer}.ceu-option-list li:hover{background:#ebecef}.ceu-option-list li.ceu-active{background:#e2e6ed}.ceu-table-picker__title{padding:2px 2px 6px;color:#3d4757}.ceu-table-picker__grid{display:grid;grid-template-columns:repeat(10,16px);gap:3px}.ceu-table-picker__grid span{width:16px;height:16px;border:1px solid #e2e6ed;cursor:pointer}.ceu-table-picker__grid span.ceu-active{background:#4991f226;border-color:#4991f280}.ceu-statusbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;min-height:30px;padding:2px 8px 2px 16px;background:#f2f4f7;border-top:1px solid #e2e6ed;user-select:none}.ceu-statusbar__left,.ceu-statusbar__right,.ceu-statusbar__group{display:flex;align-items:center;gap:4px}.ceu-statusbar__left{gap:12px}.ceu-statusbar__left>span{white-space:nowrap;letter-spacing:1px}.ceu-statusbar__scale,.ceu-statusbar__mode{display:inline-block;padding:0 6px;line-height:24px;white-space:nowrap;cursor:pointer}.ceu-statusbar__scale:hover,.ceu-statusbar__mode:hover{background:#1937580a}.ceu-statusbar .ceu-dropdown__panel{left:auto;right:0}.ceu-dialog-mask{position:fixed;inset:0;z-index:2000;background:#00000080}.ceu-dialog-container{position:fixed;inset:0;z-index:2001;display:flex;align-items:center;justify-content:center;overflow:auto;font-size:14px;color:#3d4757}.ceu-dialog{width:420px;max-width:calc(100vw - 32px);padding:0 24px 24px;background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px #38383833}.ceu-dialog__title{display:flex;align-items:center;justify-content:space-between;height:56px;margin-bottom:20px;border-bottom:1px solid #e2e6ed}.ceu-dialog__close{width:16px;height:16px;cursor:pointer;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.9%208.192l4.242%204.243-.707.707L8.192%208.9%203.95%2013.142l-.707-.707%204.242-4.243L3.243%203.95l.707-.707%204.242%204.242%204.243-4.242.707.707L8.9%208.192z'%20fill='%236A6A6A'%20fill-rule='evenodd'/%3e%3c/svg%3e") no-repeat}.ceu-dialog__field{display:flex;align-items:center;gap:12px;margin-bottom:16px}.ceu-dialog__label{position:relative;flex-shrink:0;width:64px;text-align:right}.ceu-dialog__label--required:before{content:"*";position:absolute;left:-8px;color:#f56c6c}.ceu-dialog__field input,.ceu-dialog__field textarea,.ceu-dialog__field select{flex:1;min-width:0;height:30px;padding:5px;font:inherit;border:1px solid #d3d3d3;border-radius:2px;outline:none}.ceu-dialog__field textarea{resize:vertical}.ceu-dialog__field input:focus,.ceu-dialog__field textarea:focus,.ceu-dialog__field select:focus{border-color:#4991f2}.ceu-dialog__field .ceu-dialog__input--error{border-color:#f56c6c}.ceu-dialog__footer{display:flex;justify-content:flex-end;gap:12px;margin-top:8px}.ceu-dialog__footer button{padding:0 16px;line-height:26px;font:inherit;background:#fff;border:1px solid #e2e6ed;border-radius:2px;cursor:pointer}.ceu-dialog__footer button:hover{background:#1937580a}.ceu-dialog__footer .ceu-dialog__confirm{color:#fff;background:#4991f2;border-color:#4991f2}.ceu-dialog__footer .ceu-dialog__confirm:hover{background:#5b9cf3}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import q, { EDITOR_COMPONENT as E, EditorComponent as T, EditorMode as p, PageMode as S, PaperDirection as C, RowFlex as H, ElementType as D, TitleLevel as b, ListType as _, ListStyle as y, splitText as X, ControlType as m } from "@baohu/canvas-editor";
3
- const Y = {
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-ui-style",e.appendChild(document.createTextNode(`.ceu-root{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:0;background:#f2f4f7;color:#3d4757;font-size:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;box-sizing:border-box}.ceu-root *,.ceu-dialog-container *{box-sizing:border-box}.ceu-main{position:relative;flex:1;min-height:0;overflow:auto}.ceu-editor>div{margin:20px auto}.ceu-icon{display:inline-block;width:16px;height:16px;background-repeat:no-repeat;background-size:100% 100%}.ceu-active{background:#19375814}.ceu-disabled{opacity:.4;pointer-events:none}.ceu-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 2px;padding:8px 12px;background:#f2f4f7;border-bottom:1px solid #e2e6ed;user-select:none}.ceu-toolbar__divider{width:1px;height:16px;margin:0 6px;background:#cfd2d8}.ceu-toolbar__button,.ceu-statusbar__button{position:relative;display:flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;cursor:pointer}.ceu-toolbar__button:hover,.ceu-statusbar__button:hover,.ceu-select:hover{background:#1937580a}.ceu-toolbar__item.ceu-active>.ceu-toolbar__button,.ceu-toolbar__button.ceu-active{background:#19375814}.ceu-toolbar__text{margin-left:2px;white-space:nowrap}.ceu-toolbar__button--arrow:after,.ceu-select:after{content:"";width:0;height:0;margin-left:3px;border:3px solid transparent;border-top:4px solid #767c85;transform:translateY(2px)}.ceu-select{display:flex;align-items:center;justify-content:space-between;height:24px;padding:0 4px;cursor:pointer}.ceu-select__label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ceu-color{flex-direction:column}.ceu-color .ceu-icon{width:14px;height:12px}.ceu-color__bar{width:14px;height:3px;margin-top:1px;border:1px solid #e2e6ed}.ceu-color__input{position:absolute;left:0;bottom:0;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.ceu-dropdown{position:relative}.ceu-dropdown__panel{position:absolute;left:0;z-index:10;display:none;min-width:100%;padding:6px;background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px #38383833}.ceu-dropdown__panel--bottom{top:calc(100% + 4px)}.ceu-dropdown__panel--top{bottom:calc(100% + 4px)}.ceu-dropdown__panel--visible{display:block}.ceu-option-list{margin:0;padding:0;list-style:none;max-height:300px;overflow-y:auto}.ceu-option-list li{display:flex;align-items:center;gap:6px;padding:5px 10px;white-space:nowrap;cursor:pointer}.ceu-option-list li:hover{background:#ebecef}.ceu-option-list li.ceu-active{background:#e2e6ed}.ceu-table-picker__title{padding:2px 2px 6px;color:#3d4757}.ceu-table-picker__grid{display:grid;grid-template-columns:repeat(10,16px);gap:3px}.ceu-table-picker__grid span{width:16px;height:16px;border:1px solid #e2e6ed;cursor:pointer}.ceu-table-picker__grid span.ceu-active{background:#4991f226;border-color:#4991f280}.ceu-statusbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;min-height:30px;padding:2px 8px 2px 16px;background:#f2f4f7;border-top:1px solid #e2e6ed;user-select:none}.ceu-statusbar__left,.ceu-statusbar__right,.ceu-statusbar__group{display:flex;align-items:center;gap:4px}.ceu-statusbar__left{gap:12px}.ceu-statusbar__left>span{white-space:nowrap;letter-spacing:1px}.ceu-statusbar__scale,.ceu-statusbar__mode{display:inline-block;padding:0 6px;line-height:24px;white-space:nowrap;cursor:pointer}.ceu-statusbar__scale:hover,.ceu-statusbar__mode:hover{background:#1937580a}.ceu-statusbar .ceu-dropdown__panel{left:auto;right:0}.ceu-dialog-mask{position:fixed;inset:0;z-index:2000;background:#00000080}.ceu-dialog-container{position:fixed;inset:0;z-index:2001;display:flex;align-items:center;justify-content:center;overflow:auto;font-size:14px;color:#3d4757}.ceu-dialog{width:420px;max-width:calc(100vw - 32px);padding:0 24px 24px;background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px #38383833}.ceu-dialog__title{display:flex;align-items:center;justify-content:space-between;height:56px;margin-bottom:20px;border-bottom:1px solid #e2e6ed}.ceu-dialog__close{width:16px;height:16px;cursor:pointer;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.9%208.192l4.242%204.243-.707.707L8.192%208.9%203.95%2013.142l-.707-.707%204.242-4.243L3.243%203.95l.707-.707%204.242%204.242%204.243-4.242.707.707L8.9%208.192z'%20fill='%236A6A6A'%20fill-rule='evenodd'/%3e%3c/svg%3e") no-repeat}.ceu-dialog__field{display:flex;align-items:center;gap:12px;margin-bottom:16px}.ceu-dialog__label{position:relative;flex-shrink:0;width:64px;text-align:right}.ceu-dialog__label--required:before{content:"*";position:absolute;left:-8px;color:#f56c6c}.ceu-dialog__field input,.ceu-dialog__field textarea,.ceu-dialog__field select{flex:1;min-width:0;height:30px;padding:5px;font:inherit;border:1px solid #d3d3d3;border-radius:2px;outline:none}.ceu-dialog__field textarea{resize:vertical}.ceu-dialog__field input:focus,.ceu-dialog__field textarea:focus,.ceu-dialog__field select:focus{border-color:#4991f2}.ceu-dialog__field .ceu-dialog__input--error{border-color:#f56c6c}.ceu-dialog__footer{display:flex;justify-content:flex-end;gap:12px;margin-top:8px}.ceu-dialog__footer button{padding:0 16px;line-height:26px;font:inherit;background:#fff;border:1px solid #e2e6ed;border-radius:2px;cursor:pointer}.ceu-dialog__footer button:hover{background:#1937580a}.ceu-dialog__footer .ceu-dialog__confirm{color:#fff;background:#4991f2;border-color:#4991f2}.ceu-dialog__footer .ceu-dialog__confirm:hover{background:#5b9cf3}.ceu-control-panel{width:560px}.ceu-control-panel .ceu-dialog__title{margin-bottom:0}.ceu-control-panel__tabs{display:flex;margin-bottom:16px;border-bottom:1px solid #e2e6ed}.ceu-control-panel__tab{margin-bottom:-1px;padding:10px 14px;border-bottom:2px solid transparent;cursor:pointer}.ceu-control-panel__tab:hover,.ceu-control-panel__tab.ceu-active{color:#4991f2}.ceu-control-panel__tab.ceu-active{border-bottom-color:#4991f2}.ceu-control-panel__body{height:400px;max-height:calc(100vh - 240px);padding-right:4px;overflow-y:auto}.ceu-control-panel__group{margin:20px 0 12px;padding-left:8px;line-height:14px;font-weight:600;border-left:3px solid #4991f2}.ceu-control-panel__group:first-child{margin-top:0}.ceu-control-panel__field{display:flex;align-items:center;gap:12px;margin-bottom:12px}.ceu-control-panel__label{flex-shrink:0;width:84px}.ceu-control-panel__field input[type=text],.ceu-control-panel__field input[type=number],.ceu-control-panel__field select,.ceu-control-panel__field textarea{flex:1;min-width:0;height:30px;padding:5px;font:inherit;border:1px solid #d3d3d3;border-radius:2px;outline:none}.ceu-control-panel__field input:focus,.ceu-control-panel__field select:focus,.ceu-control-panel__field textarea:focus{border-color:#4991f2}.ceu-control-panel__field select:disabled{color:#999;background:#f5f7fa;cursor:not-allowed}.ceu-control-panel__field input[type=checkbox],.ceu-control-panel__field input[type=radio]{width:14px;height:14px;margin:0;cursor:pointer}.ceu-control-panel__field textarea{height:100px;font-family:Menlo,Consolas,monospace;font-size:12px;resize:vertical}.ceu-control-panel__field .ceu-dialog__input--error{border-color:#f56c6c}.ceu-control-panel__field--block{flex-direction:column;align-items:stretch;gap:8px}.ceu-control-panel__field--block .ceu-control-panel__label{width:auto}.ceu-control-panel__tip{margin:-4px 0 12px 96px;font-size:12px;color:#999}.ceu-control-panel__field--block .ceu-control-panel__tip{margin:0}.ceu-control-panel__link{color:#4991f2;white-space:nowrap;cursor:pointer}.ceu-control-panel__color{display:flex;flex:1;align-items:center;gap:8px}.ceu-control-panel__field .ceu-control-panel__color input[type=color]{width:30px;height:30px;padding:2px;background:#fff;border:1px solid #d3d3d3;border-radius:2px;cursor:pointer}.ceu-control-panel__color--empty input[type=color]{opacity:.4}.ceu-control-panel__value-sets{width:100%;border-collapse:collapse}.ceu-control-panel__value-sets th{padding:6px;font-weight:400;text-align:left;color:#666;background:#f5f7fa}.ceu-control-panel__value-sets td{padding:4px 6px;border-bottom:1px solid #f0f0f0}.ceu-control-panel__value-sets th:first-child,.ceu-control-panel__value-sets td:first-child{width:48px;text-align:center}.ceu-control-panel__value-sets th:last-child,.ceu-control-panel__value-sets td:last-child{width:40px}.ceu-control-panel__field .ceu-control-panel__value-sets input[type=text]{width:100%}.ceu-control-panel__field--block>.ceu-control-panel__link{align-self:flex-start}.ceu-control-panel__error{min-height:20px;margin:8px 0 0;font-size:13px;color:#f56c6c}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ import W, { ControlType as u, EDITOR_COMPONENT as D, EditorComponent as _, RowFlex as x, ControlIndentation as B, CheckboxMarkType as E, FlexDirection as I, ElementType as H, EditorMode as m, PageMode as V, PaperDirection as R, TitleLevel as k, ListType as S, ListStyle as L, splitText as Z, INTERNAL_CONTEXT_MENU_KEY as Q } from "@baohu/canvas-editor";
3
+ const ee = "ceu";
4
+ function l(s, t = {}, ...o) {
5
+ const e = document.createElement(s);
6
+ return Object.keys(t).forEach((n) => {
7
+ const i = t[n];
8
+ i === void 0 || i === !1 || (n === "class" ? e.className = String(i) : e.setAttribute(n, i === !0 ? "" : String(i)));
9
+ }), o.forEach((n) => {
10
+ n == null || n === !1 || e.append(n);
11
+ }), e;
12
+ }
13
+ function c(s) {
14
+ return `${ee}-${s}`;
15
+ }
16
+ function te(s, t) {
17
+ let o = null;
18
+ const e = (...n) => {
19
+ o && clearTimeout(o), o = setTimeout(() => {
20
+ o = null, s(...n);
21
+ }, t);
22
+ };
23
+ return e.cancel = () => {
24
+ o && clearTimeout(o), o = null;
25
+ }, e;
26
+ }
27
+ function oe(s) {
28
+ return new Promise((t, o) => {
29
+ const e = new FileReader();
30
+ e.onload = () => t(e.result), e.onerror = o, e.readAsDataURL(s);
31
+ });
32
+ }
33
+ function ne(s) {
34
+ return new Promise((t, o) => {
35
+ const e = new Image();
36
+ e.onload = () => t(e), e.onerror = o, e.src = s;
37
+ });
38
+ }
39
+ function ie(s, t) {
40
+ const o = URL.createObjectURL(s);
41
+ l("a", { href: o, download: t }).click(), URL.revokeObjectURL(o);
42
+ }
43
+ function N(s, t) {
44
+ const o = (n) => String(n).padStart(2, "0"), e = `${s.getFullYear()}-${o(s.getMonth() + 1)}-${o(
45
+ s.getDate()
46
+ )}`;
47
+ return t ? `${e} ${o(s.getHours())}:${o(s.getMinutes())}:${o(
48
+ s.getSeconds()
49
+ )}` : e;
50
+ }
51
+ const $ = [
52
+ u.SELECT,
53
+ u.CHECKBOX,
54
+ u.RADIO
55
+ ], ae = [
56
+ "yyyy-MM-dd",
57
+ "yyyy-MM-dd HH:mm",
58
+ "yyyy-MM-dd HH:mm:ss",
59
+ "HH:mm:ss",
60
+ "yyyy年MM月dd日",
61
+ "yyyy年MM月dd日 HH时mm分ss秒"
62
+ ], P = /^#[0-9a-f]{6}$/i;
63
+ let le = 0;
64
+ class se {
65
+ constructor(t) {
66
+ this.activeTab = "basic", this.id = `${c("control-panel")}-${++le}`, this.options = t, this.locale = t.locale, this.isEdit = !!(t.controlId && t.control), this.draft = this.createDraft(), this.originValue = this.getValue(), this.originValueSets = JSON.stringify(this.getValueSets()), this.mask = l("div", { class: c("dialog-mask") }), this.tabs = l("div", { class: c("control-panel__tabs") }), this.body = l("div", { class: c("control-panel__body") }), this.error = l("div", { class: c("control-panel__error") }), this.container = this.render(), this.mask.setAttribute(D, _.COMPONENT), this.container.setAttribute(D, _.COMPONENT), document.body.append(this.mask, this.container), this.keydownHandler = (o) => {
67
+ o.key === "Escape" && this.close();
68
+ }, document.addEventListener("keydown", this.keydownHandler), this.renderContent();
69
+ }
70
+ createDraft() {
71
+ var r;
72
+ const { editor: t, control: o, controlId: e, type: n } = this.options;
73
+ if (!this.isEdit || !o || !e)
74
+ return {
75
+ type: n || u.TEXT,
76
+ valueText: "",
77
+ valueSetRows: []
78
+ };
79
+ const i = {
80
+ ...o,
81
+ validation: o.validation ? { ...o.validation } : void 0,
82
+ valueText: "",
83
+ valueSetRows: []
84
+ };
85
+ Reflect.deleteProperty(i, "value");
86
+ const a = (r = t.command.getControlValue({ id: e })) == null ? void 0 : r[0];
87
+ if ($.includes(o.type)) {
88
+ const h = a ? a.code : o.code, d = h ? h.split(",") : [];
89
+ i.valueSetRows = (o.valueSets || []).map((p) => ({
90
+ ...p,
91
+ checked: d.includes(p.code)
92
+ }));
93
+ } else
94
+ i.valueText = (a == null ? void 0 : a.value) || "";
95
+ return i;
96
+ }
97
+ isOptionType() {
98
+ return $.includes(this.draft.type);
99
+ }
100
+ isMultiple() {
101
+ const { type: t, isMultiSelect: o } = this.draft;
102
+ return t === u.CHECKBOX || t === u.SELECT && !!o;
103
+ }
104
+ // 选项编码为空时与显示值相同
105
+ getValueSets() {
106
+ return this.draft.valueSetRows.map((t) => ({
107
+ value: t.value.trim(),
108
+ code: t.code.trim() || t.value.trim()
109
+ }));
110
+ }
111
+ getValue() {
112
+ if (!this.isOptionType()) return this.draft.valueText;
113
+ const t = this.getValueSets();
114
+ return this.draft.valueSetRows.map((o, e) => o.checked ? t[e].code : "").filter(Boolean).join(",");
115
+ }
116
+ // ---------- 渲染 ----------
117
+ render() {
118
+ const { locale: t } = this, o = l("i", { class: c("dialog__close") });
119
+ o.onclick = () => this.close();
120
+ const e = l("button", { type: "button" }, t.cancel);
121
+ e.onclick = () => this.close();
122
+ const n = l(
123
+ "button",
124
+ { type: "button", class: c("dialog__confirm") },
125
+ t.confirm
126
+ );
127
+ n.onclick = () => this.confirm();
128
+ const i = l(
129
+ "div",
130
+ { class: `${c("dialog")} ${c("control-panel")}` },
131
+ l(
132
+ "div",
133
+ { class: c("dialog__title") },
134
+ l("span", {}, this.isEdit ? t.controlProperty : t.controlAdd),
135
+ o
136
+ ),
137
+ this.tabs,
138
+ this.body,
139
+ this.error,
140
+ l("div", { class: c("dialog__footer") }, e, n)
141
+ );
142
+ return l("div", { class: c("dialog-container") }, i);
143
+ }
144
+ getTabList() {
145
+ const { locale: t } = this;
146
+ return [
147
+ { key: "basic", label: t.controlTabBasic },
148
+ { key: "option", label: t.controlTabOption },
149
+ { key: "rule", label: t.controlTabRule },
150
+ { key: "style", label: t.controlTabStyle },
151
+ { key: "advanced", label: t.controlTabAdvanced }
152
+ ].filter(
153
+ (e) => e.key !== "option" || this.draft.type !== u.TEXT
154
+ );
155
+ }
156
+ renderContent() {
157
+ const t = this.getTabList();
158
+ t.some((e) => e.key === this.activeTab) || (this.activeTab = "basic"), this.tabs.innerHTML = "", t.forEach((e) => {
159
+ const n = l(
160
+ "div",
161
+ {
162
+ class: `${c("control-panel__tab")}${e.key === this.activeTab ? ` ${c("active")}` : ""}`
163
+ },
164
+ e.label
165
+ );
166
+ n.onclick = () => {
167
+ this.activeTab = e.key, this.renderContent();
168
+ }, this.tabs.append(n);
169
+ });
170
+ const o = this.body.scrollTop;
171
+ switch (this.body.innerHTML = "", this.activeTab) {
172
+ case "basic":
173
+ this.renderBasic();
174
+ break;
175
+ case "option":
176
+ this.renderOption();
177
+ break;
178
+ case "rule":
179
+ this.renderRule();
180
+ break;
181
+ case "style":
182
+ this.renderStyle();
183
+ break;
184
+ case "advanced":
185
+ this.renderAdvanced();
186
+ break;
187
+ }
188
+ this.body.scrollTop = o;
189
+ }
190
+ renderBasic() {
191
+ const { locale: t, draft: o } = this, e = this.appendSelect(
192
+ t.controlType,
193
+ [
194
+ { label: t.controlText, value: u.TEXT },
195
+ { label: t.controlSelect, value: u.SELECT },
196
+ { label: t.controlCheckbox, value: u.CHECKBOX },
197
+ { label: t.controlRadio, value: u.RADIO },
198
+ { label: t.controlDate, value: u.DATE },
199
+ { label: t.controlNumber, value: u.NUMBER }
200
+ ],
201
+ o.type,
202
+ (n) => {
203
+ o.type = n, o.valueText = "", o.valueSetRows.forEach((i) => i.checked = !1), this.renderContent();
204
+ }
205
+ );
206
+ if (this.isEdit && (e.disabled = !0, e.title = t.controlTypeDisabled), !this.isOptionType()) {
207
+ const n = o.type === u.DATE ? o.dateFormat || "yyyy-MM-dd HH:mm:ss" : "";
208
+ this.appendInput(
209
+ this.isEdit ? t.controlValue : t.controlDefaultValue,
210
+ o.type === u.NUMBER ? "number" : "text",
211
+ o.valueText,
212
+ (i) => o.valueText = i,
213
+ n
214
+ );
215
+ }
216
+ o.type !== u.CHECKBOX && o.type !== u.RADIO && this.appendDraftField("placeholder", t.controlPlaceholder, "text"), this.appendDraftField("conceptId", t.controlConceptId, "text"), this.appendDraftField("groupId", t.controlGroupId, "text"), this.appendGroup(t.controlGroupText), this.appendDraftField("preText", t.controlPreText, "text"), this.appendDraftField("postText", t.controlPostText, "text"), this.appendDraftField("prefix", t.controlPrefix, "text", "{"), this.appendDraftField("postfix", t.controlPostfix, "text", "}"), this.appendGroup(t.controlGroupLayout), this.appendDraftField("minWidth", t.controlMinWidth, "number"), this.appendSelect(
217
+ t.controlRowFlex,
218
+ [
219
+ { label: t.controlDefault, value: "" },
220
+ { label: t.left, value: x.LEFT },
221
+ { label: t.center, value: x.CENTER },
222
+ { label: t.right, value: x.RIGHT },
223
+ { label: t.alignment, value: x.ALIGNMENT },
224
+ { label: t.justify, value: x.JUSTIFY }
225
+ ],
226
+ o.rowFlex || "",
227
+ (n) => o.rowFlex = n || void 0
228
+ ), this.appendSelect(
229
+ t.controlIndentation,
230
+ [
231
+ { label: t.controlDefault, value: "" },
232
+ {
233
+ label: t.controlIndentationRowStart,
234
+ value: B.ROW_START
235
+ },
236
+ {
237
+ label: t.controlIndentationValueStart,
238
+ value: B.VALUE_START
239
+ }
240
+ ],
241
+ o.indentation || "",
242
+ (n) => o.indentation = n || void 0
243
+ ), this.appendDraftField("underline", t.underline, "switch"), this.appendDraftField("border", t.controlBorder, "switch");
244
+ }
245
+ renderOption() {
246
+ var e, n;
247
+ const { locale: t, draft: o } = this;
248
+ switch (o.type) {
249
+ case u.SELECT:
250
+ this.appendDraftField(
251
+ "isMultiSelect",
252
+ t.controlMultiSelect,
253
+ "switch",
254
+ "",
255
+ () => {
256
+ if (!o.isMultiSelect) {
257
+ let i = !1;
258
+ o.valueSetRows.forEach((a) => {
259
+ a.checked && i && (a.checked = !1), a.checked && (i = !0);
260
+ });
261
+ }
262
+ this.renderContent();
263
+ }
264
+ ), o.isMultiSelect && this.appendDraftField(
265
+ "multiSelectDelimiter",
266
+ t.controlMultiSelectDelimiter,
267
+ "text",
268
+ ","
269
+ ), this.appendSwitch(
270
+ t.controlInputAble,
271
+ !!((e = o.selectExclusiveOptions) != null && e.inputAble),
272
+ (i) => {
273
+ o.selectExclusiveOptions = i ? { inputAble: !0 } : void 0;
274
+ }
275
+ ), this.appendValueSets();
276
+ break;
277
+ case u.CHECKBOX:
278
+ this.appendFlexDirection(), this.appendSelect(
279
+ t.controlMarkType,
280
+ [
281
+ { label: t.checkboxCross, value: E.CROSS },
282
+ { label: t.checkboxCheck, value: E.CHECK }
283
+ ],
284
+ o.markType || E.CHECK,
285
+ (i) => o.markType = i
286
+ ), this.appendDraftField("min", t.controlCheckboxMin, "number"), this.appendDraftField("max", t.controlCheckboxMax, "number"), this.appendValueSets();
287
+ break;
288
+ case u.RADIO:
289
+ this.appendFlexDirection(), this.appendValueSets();
290
+ break;
291
+ case u.DATE: {
292
+ const i = this.appendInput(
293
+ t.controlDateFormat,
294
+ "text",
295
+ o.dateFormat || "",
296
+ (r) => o.dateFormat = r || void 0,
297
+ "yyyy-MM-dd HH:mm:ss"
298
+ ), a = l("datalist", { id: `${this.id}-date-format` });
299
+ ae.forEach((r) => {
300
+ a.append(l("option", { value: r }));
301
+ }), i.setAttribute("list", a.id), i.after(a), this.appendTip(t.controlDateFormatTip);
302
+ break;
303
+ }
304
+ case u.NUMBER:
305
+ this.appendSwitch(
306
+ t.controlCalculatorDisabled,
307
+ !!((n = o.numberExclusiveOptions) != null && n.calculatorDisabled),
308
+ (i) => {
309
+ o.numberExclusiveOptions = i ? { calculatorDisabled: !0 } : void 0;
310
+ }
311
+ );
312
+ break;
313
+ }
314
+ }
315
+ renderRule() {
316
+ const { locale: t, draft: o } = this;
317
+ switch (this.appendGroup(t.controlGroupRule), this.appendSwitch(
318
+ t.controlDeletable,
319
+ o.deletable !== !1,
320
+ (e) => o.deletable = e
321
+ ), this.appendDraftField("disabled", t.controlDisabled, "switch"), this.appendDraftField("pasteDisabled", t.controlPasteDisabled, "switch"), this.appendDraftField("hide", t.controlHide, "switch"), this.appendDraftField("required", t.controlRequired, "switch"), this.appendGroup(t.controlGroupValidation), o.type) {
322
+ case u.TEXT:
323
+ this.appendValidationField("minLength", t.controlMinLength, "number"), this.appendValidationField("maxLength", t.controlMaxLength, "number"), this.appendValidationField("pattern", t.controlPattern, "text", "^\\d{11}$");
324
+ break;
325
+ case u.NUMBER:
326
+ this.appendValidationField("min", t.controlMin, "number"), this.appendValidationField("max", t.controlMax, "number"), this.appendValidationField("integer", t.controlInteger, "switch"), this.appendValidationField("precision", t.controlPrecision, "number");
327
+ break;
328
+ case u.DATE:
329
+ this.appendValidationField("minDate", t.controlMinDate, "text", "YYYY-MM-DD / today"), this.appendValidationField("maxDate", t.controlMaxDate, "text", "YYYY-MM-DD / today");
330
+ break;
331
+ case u.CHECKBOX:
332
+ this.appendValidationField("minChecked", t.controlMinChecked, "number"), this.appendValidationField("maxChecked", t.controlMaxChecked, "number");
333
+ break;
334
+ }
335
+ this.appendValidationField("message", t.controlValidationMessage, "text");
336
+ }
337
+ renderStyle() {
338
+ const { locale: t } = this;
339
+ this.appendGroup(t.controlGroupValueStyle), this.appendDraftField("font", t.font, "text"), this.appendDraftField("size", t.size, "number"), this.appendDraftField("bold", t.bold, "switch"), this.appendDraftField("italic", t.italic, "switch"), this.appendDraftField("strikeout", t.strikeout, "switch"), this.appendDraftField("highlight", t.highlight, "color"), this.appendGroup(t.controlGroupBackground), this.appendDraftField("activeBackgroundColor", t.controlActiveBackground, "color"), this.appendDraftField("disabledBackgroundColor", t.controlDisabledBackground, "color"), this.appendDraftField("existValueBackgroundColor", t.controlExistValueBackground, "color"), this.appendDraftField("noValueBackgroundColor", t.controlNoValueBackground, "color");
340
+ }
341
+ renderAdvanced() {
342
+ const { locale: t } = this, o = l("textarea", {
343
+ placeholder: "round(getValue('weight') / getValue('height'), 1)"
344
+ });
345
+ o.value = this.draft.compute || "", o.oninput = () => {
346
+ this.draft.compute = o.value.trim() || void 0;
347
+ }, this.appendItem(
348
+ t.controlCompute,
349
+ o,
350
+ l("div", { class: c("control-panel__tip") }, t.controlComputeTip)
351
+ ).classList.add(c("control-panel__field--block")), this.appendJsonField("cascade", t.controlCascade, '[{ "expression": "", "actions": [] }]'), this.appendJsonField("extension", t.controlExtension, '{ "key": "value" }');
352
+ }
353
+ // ---------- 表单项 ----------
354
+ appendItem(t, ...o) {
355
+ const e = l(
356
+ "div",
357
+ { class: c("control-panel__field") },
358
+ l("span", { class: c("control-panel__label") }, t),
359
+ ...o
360
+ );
361
+ return this.body.append(e), e;
362
+ }
363
+ appendGroup(t) {
364
+ this.body.append(l("div", { class: c("control-panel__group") }, t));
365
+ }
366
+ appendTip(t) {
367
+ this.body.append(l("div", { class: c("control-panel__tip") }, t));
368
+ }
369
+ appendInput(t, o, e, n, i = "") {
370
+ const a = l("input", { type: o, placeholder: i });
371
+ return a.value = e, a.oninput = () => n(a.value), this.appendItem(t, a), a;
372
+ }
373
+ appendSelect(t, o, e, n) {
374
+ const i = l("select");
375
+ return o.forEach((a) => {
376
+ i.append(l("option", { value: a.value }, a.label));
377
+ }), i.value = e, i.onchange = () => n(i.value), this.appendItem(t, i), i;
378
+ }
379
+ appendSwitch(t, o, e) {
380
+ const n = l("input", { type: "checkbox" });
381
+ n.checked = o, n.onchange = () => e(n.checked), this.appendItem(t, n);
382
+ }
383
+ // 颜色可为空(未设置时使用全局配置),因此额外提供文本框与清除按钮
384
+ appendColor(t, o, e) {
385
+ const n = l("input", { type: "color" }), i = l("input", { type: "text", placeholder: this.locale.controlUnset }), a = l("span", { class: c("control-panel__link") }, this.locale.controlClear), r = l("div", { class: c("control-panel__color") }, n, i, a), h = (d) => {
386
+ i.value = d || "", n.value = d && P.test(d) ? d : "#ffffff", r.classList.toggle(c("control-panel__color--empty"), !d);
387
+ };
388
+ h(o), n.oninput = () => {
389
+ h(n.value), e(n.value);
390
+ }, i.oninput = () => {
391
+ const d = i.value.trim() || void 0;
392
+ d && P.test(d) && (n.value = d), r.classList.toggle(c("control-panel__color--empty"), !d), e(d);
393
+ }, a.onclick = () => {
394
+ h(void 0), e(void 0);
395
+ }, this.appendItem(t, r);
396
+ }
397
+ appendField(t, o, e, n, i = "") {
398
+ o === "switch" ? this.appendSwitch(t, !!e, (a) => n(a || void 0)) : o === "color" ? this.appendColor(t, e, n) : this.appendInput(
399
+ t,
400
+ o,
401
+ e == null ? "" : String(e),
402
+ (a) => {
403
+ n(o === "number" ? a === "" ? void 0 : Number(a) : a || void 0);
404
+ },
405
+ i
406
+ );
407
+ }
408
+ appendDraftField(t, o, e, n = "", i) {
409
+ this.appendField(
410
+ o,
411
+ e,
412
+ this.draft[t],
413
+ (a) => {
414
+ Reflect.set(this.draft, t, a), i == null || i();
415
+ },
416
+ n
417
+ );
418
+ }
419
+ appendValidationField(t, o, e, n = "") {
420
+ var i;
421
+ this.appendField(
422
+ o,
423
+ e,
424
+ (i = this.draft.validation) == null ? void 0 : i[t],
425
+ (a) => {
426
+ this.draft.validation = { ...this.draft.validation, [t]: a };
427
+ },
428
+ n
429
+ );
430
+ }
431
+ appendJsonField(t, o, e) {
432
+ const n = this.draft[t], i = l("textarea", { placeholder: e });
433
+ i.value = n == null ? "" : JSON.stringify(n, null, 2), i.onchange = () => {
434
+ const r = i.value.trim();
435
+ try {
436
+ Reflect.set(this.draft, t, r ? JSON.parse(r) : void 0), i.classList.remove(c("dialog__input--error"));
437
+ } catch {
438
+ i.classList.add(c("dialog__input--error"));
439
+ }
440
+ }, this.appendItem(o, i).classList.add(c("control-panel__field--block"));
441
+ }
442
+ appendFlexDirection() {
443
+ const { locale: t, draft: o } = this;
444
+ this.appendSelect(
445
+ t.controlFlexDirection,
446
+ [
447
+ { label: t.controlFlexRow, value: I.ROW },
448
+ { label: t.controlFlexColumn, value: I.COLUMN }
449
+ ],
450
+ o.flexDirection || I.ROW,
451
+ (e) => o.flexDirection = e
452
+ );
453
+ }
454
+ appendValueSets() {
455
+ const { locale: t, draft: o } = this, e = o.valueSetRows, n = this.isMultiple(), i = l("tbody");
456
+ e.forEach((d, p) => {
457
+ const g = l("input", { type: n ? "checkbox" : "radio" });
458
+ g.checked = d.checked, g.onclick = () => {
459
+ n || e.forEach((A) => {
460
+ A !== d && (A.checked = !1);
461
+ }), d.checked = !d.checked, this.renderContent();
462
+ };
463
+ const f = l("input", { type: "text" });
464
+ f.value = d.value, f.oninput = () => d.value = f.value;
465
+ const z = l("input", {
466
+ type: "text",
467
+ placeholder: t.controlValueSetCodePlaceholder
468
+ });
469
+ z.value = d.code, z.oninput = () => d.code = z.value;
470
+ const O = l("span", { class: c("control-panel__link") }, t.controlRemove);
471
+ O.onclick = () => {
472
+ e.splice(p, 1), this.renderContent();
473
+ }, i.append(
474
+ l(
475
+ "tr",
476
+ {},
477
+ l("td", {}, g),
478
+ l("td", {}, f),
479
+ l("td", {}, z),
480
+ l("td", {}, O)
481
+ )
482
+ );
483
+ });
484
+ const a = l(
485
+ "table",
486
+ { class: c("control-panel__value-sets") },
487
+ l(
488
+ "thead",
489
+ {},
490
+ l(
491
+ "tr",
492
+ {},
493
+ l("th", {}, this.isEdit ? t.controlChecked : t.controlDefaultValue),
494
+ l("th", {}, t.controlValueSetValue),
495
+ l("th", {}, t.controlValueSetCode),
496
+ l("th")
497
+ )
498
+ ),
499
+ i
500
+ ), r = l("span", { class: c("control-panel__link") }, `+ ${t.controlAddValueSet}`);
501
+ r.onclick = () => {
502
+ var p;
503
+ e.push({ value: "", code: "", checked: !1 }), this.renderContent(), (p = this.body.querySelectorAll(
504
+ `.${c("control-panel__value-sets")} tbody tr:last-child input[type='text']`
505
+ )[0]) == null || p.focus();
506
+ }, this.appendItem(t.controlValueSets, a, r).classList.add(c("control-panel__field--block"));
507
+ }
508
+ // ---------- 提交 ----------
509
+ validate() {
510
+ const { locale: t, draft: o } = this;
511
+ if (this.body.querySelector(`.${c("dialog__input--error")}`))
512
+ return t.controlErrorJson;
513
+ if (this.isOptionType()) {
514
+ const e = this.getValueSets();
515
+ if (!e.length) return t.controlErrorValueSetsEmpty;
516
+ if (e.some((i) => !i.value))
517
+ return t.controlErrorValueSetValue;
518
+ if (new Set(e.map((i) => i.code)).size !== e.length)
519
+ return t.controlErrorValueSetCode;
520
+ }
521
+ return o.type === u.NUMBER && o.valueText && isNaN(Number(o.valueText)) ? t.controlErrorNumber : null;
522
+ }
523
+ getProperties() {
524
+ const { draft: t } = this, { type: o } = t, e = { ...t };
525
+ Reflect.deleteProperty(e, "valueText"), Reflect.deleteProperty(e, "valueSetRows"), this.isOptionType() ? (e.valueSets = this.getValueSets(), e.code = this.getValue() || null) : (e.valueSets = void 0, e.code = void 0), o !== u.SELECT && (e.isMultiSelect = void 0, e.multiSelectDelimiter = void 0, e.selectExclusiveOptions = void 0), o !== u.CHECKBOX && (e.min = void 0, e.max = void 0, e.markType = void 0), o !== u.CHECKBOX && o !== u.RADIO && (e.flexDirection = void 0), o !== u.DATE && (e.dateFormat = void 0), o !== u.NUMBER && (e.numberExclusiveOptions = void 0);
526
+ const n = {};
527
+ return Object.entries(t.validation || {}).forEach(([i, a]) => {
528
+ a !== void 0 && a !== "" && Reflect.set(n, i, a);
529
+ }), e.validation = Object.keys(n).length ? n : void 0, e;
530
+ }
531
+ confirm() {
532
+ const t = this.validate();
533
+ if (this.error.innerText = t || "", t) return;
534
+ const { editor: o, controlId: e } = this.options, n = this.getProperties(), i = this.getValue();
535
+ if (this.isEdit && e) {
536
+ if (this.isOptionType()) {
537
+ const a = JSON.stringify(this.getValueSets()) !== this.originValueSets;
538
+ (i !== this.originValue || a) && o.command.executeSetControlValue({ id: e, value: null });
539
+ } else i !== this.originValue && o.command.executeSetControlValue({
540
+ id: e,
541
+ value: i || null
542
+ });
543
+ Reflect.deleteProperty(n, "type"), o.command.executeSetControlProperties({
544
+ id: e,
545
+ properties: n
546
+ });
547
+ } else
548
+ o.command.executeInsertControl({
549
+ type: H.CONTROL,
550
+ value: "",
551
+ control: {
552
+ ...n,
553
+ value: !this.isOptionType() && i ? [{ value: i }] : null
554
+ }
555
+ });
556
+ this.dispose();
557
+ }
558
+ close() {
559
+ this.dispose();
560
+ }
561
+ dispose() {
562
+ document.removeEventListener("keydown", this.keydownHandler), this.mask.remove(), this.container.remove();
563
+ }
564
+ }
565
+ const ce = {
4
566
  undo: "撤销",
5
567
  redo: "重做",
6
568
  painter: "格式刷(双击可连续使用)",
@@ -38,7 +600,6 @@ const Y = {
38
600
  hyperlinkUrl: "链接",
39
601
  separator: "分割线",
40
602
  pageBreak: "分页符",
41
- control: "控件",
42
603
  controlType: "类型",
43
604
  controlText: "文本",
44
605
  controlSelect: "下拉框",
@@ -48,11 +609,88 @@ const Y = {
48
609
  controlNumber: "数值",
49
610
  controlPlaceholder: "占位符",
50
611
  controlValueSets: "选项",
51
- controlValueSetsPlaceholder: `每行一个选项,如:
52
- 有
53
- 无`,
54
612
  controlDateFormat: "日期格式",
613
+ controlAdd: "新增控件",
614
+ controlProperty: "控件属性",
615
+ controlTabBasic: "基础",
616
+ controlTabOption: "选项",
617
+ controlTabRule: "规则校验",
618
+ controlTabStyle: "样式",
619
+ controlTabAdvanced: "高级",
620
+ controlTypeDisabled: "修改控件属性时不可修改控件类型",
621
+ controlValue: "当前值",
622
+ controlDefaultValue: "默认值",
623
+ controlChecked: "选中",
624
+ controlConceptId: "概念 ID",
625
+ controlGroupId: "成组 ID",
626
+ controlGroupText: "文本",
627
+ controlPreText: "前文本",
628
+ controlPostText: "后文本",
629
+ controlPrefix: "前缀",
630
+ controlPostfix: "后缀",
631
+ controlGroupLayout: "布局",
632
+ controlMinWidth: "最小宽度",
633
+ controlRowFlex: "对齐方式",
634
+ controlIndentation: "换行缩进",
635
+ controlIndentationRowStart: "从行起始位置",
636
+ controlIndentationValueStart: "从值起始位置",
637
+ controlDefault: "默认",
638
+ controlBorder: "边框",
639
+ controlMultiSelect: "多选",
640
+ controlMultiSelectDelimiter: "多选分隔符",
641
+ controlInputAble: "允许输入",
642
+ controlMarkType: "选中样式",
643
+ controlCheckboxMin: "最少选择",
644
+ controlCheckboxMax: "最多选择",
645
+ controlFlexDirection: "排列方向",
646
+ controlFlexRow: "横向",
647
+ controlFlexColumn: "纵向",
648
+ controlValueSetValue: "显示值",
649
+ controlValueSetCode: "编码",
650
+ controlValueSetCodePlaceholder: "默认同显示值",
651
+ controlAddValueSet: "添加选项",
652
+ controlRemove: "删除",
653
+ controlDateFormatTip: "yyyy 年、MM 月、dd 日、HH 时(24 小时制)、hh 时(12 小时制)、mm 分、ss 秒",
654
+ controlCalculatorDisabled: "禁用计算器",
655
+ controlGroupRule: "规则",
656
+ controlDeletable: "可删除",
657
+ controlDisabled: "禁止编辑",
658
+ controlPasteDisabled: "禁止粘贴",
659
+ controlHide: "隐藏",
660
+ controlRequired: "必填",
661
+ controlGroupValidation: "校验",
662
+ controlMinLength: "最小长度",
663
+ controlMaxLength: "最大长度",
664
+ controlPattern: "正则",
665
+ controlMin: "最小值",
666
+ controlMax: "最大值",
667
+ controlInteger: "必须为整数",
668
+ controlPrecision: "小数位数",
669
+ controlMinDate: "最早日期",
670
+ controlMaxDate: "最晚日期",
671
+ controlMinChecked: "最少勾选",
672
+ controlMaxChecked: "最多勾选",
673
+ controlValidationMessage: "错误提示",
674
+ controlGroupValueStyle: "值样式",
675
+ controlGroupBackground: "背景色(优先于全局配置)",
676
+ controlActiveBackground: "激活时",
677
+ controlDisabledBackground: "禁用时",
678
+ controlExistValueBackground: "有值时",
679
+ controlNoValueBackground: "无值时",
680
+ controlUnset: "未设置",
681
+ controlClear: "清除",
682
+ controlCompute: "计算表达式",
683
+ controlComputeTip: "控件值变化时自动重算并回写本控件,用 getValue('概念 ID') 引用其他控件的值",
684
+ controlCascade: "级联规则",
685
+ controlExtension: "扩展数据",
686
+ controlErrorJson: "JSON 格式错误,请检查「高级」中的配置",
687
+ controlErrorValueSetsEmpty: "请至少添加一个选项",
688
+ controlErrorValueSetValue: "选项的显示值不能为空",
689
+ controlErrorValueSetCode: "选项编码不能重复",
690
+ controlErrorNumber: "数值控件的值必须为数字",
55
691
  checkbox: "复选框",
692
+ checkboxCross: "叉选",
693
+ checkboxCheck: "勾选",
56
694
  date: "日期",
57
695
  search: "查找替换",
58
696
  searchKeyword: "查找",
@@ -82,167 +720,122 @@ const Y = {
82
720
  modeForm: "表单模式",
83
721
  modePrint: "打印模式",
84
722
  modeDesign: "设计模式",
723
+ modeGraffiti: "涂鸦模式",
724
+ modeTrace: "留痕模式",
85
725
  fullscreen: "全屏"
86
- }, j = "ceu";
87
- function c(a, n = {}, ...s) {
88
- const e = document.createElement(a);
89
- return Object.keys(n).forEach((t) => {
90
- const i = n[t];
91
- i === void 0 || i === !1 || (t === "class" ? e.className = String(i) : e.setAttribute(t, i === !0 ? "" : String(i)));
92
- }), s.forEach((t) => {
93
- t == null || t === !1 || e.append(t);
94
- }), e;
95
- }
96
- function l(a) {
97
- return `${j}-${a}`;
98
- }
99
- function G(a, n) {
100
- let s = null;
101
- const e = (...t) => {
102
- s && clearTimeout(s), s = setTimeout(() => {
103
- s = null, a(...t);
104
- }, n);
105
- };
106
- return e.cancel = () => {
107
- s && clearTimeout(s), s = null;
108
- }, e;
109
- }
110
- function K(a) {
111
- return new Promise((n, s) => {
112
- const e = new FileReader();
113
- e.onload = () => n(e.result), e.onerror = s, e.readAsDataURL(a);
114
- });
115
- }
116
- function W(a) {
117
- return new Promise((n, s) => {
118
- const e = new Image();
119
- e.onload = () => n(e), e.onerror = s, e.src = a;
120
- });
121
- }
122
- function Z(a, n) {
123
- const s = URL.createObjectURL(a);
124
- c("a", { href: s, download: n }).click(), URL.revokeObjectURL(s);
125
- }
126
- function V(a, n) {
127
- const s = (t) => String(t).padStart(2, "0"), e = `${a.getFullYear()}-${s(a.getMonth() + 1)}-${s(
128
- a.getDate()
129
- )}`;
130
- return n ? `${e} ${s(a.getHours())}:${s(a.getMinutes())}:${s(
131
- a.getSeconds()
132
- )}` : e;
133
- }
134
- class k {
135
- constructor(n) {
136
- var s;
137
- this.inputList = [], this.options = n, this.mask = c("div", { class: l("dialog-mask") }), this.container = this.render(), this.mask.setAttribute(E, T.COMPONENT), this.container.setAttribute(E, T.COMPONENT), document.body.append(this.mask, this.container), this.keydownHandler = (e) => {
726
+ };
727
+ class F {
728
+ constructor(t) {
729
+ var o;
730
+ this.inputList = [], this.options = t, this.mask = l("div", { class: c("dialog-mask") }), this.container = this.render(), this.mask.setAttribute(D, _.COMPONENT), this.container.setAttribute(D, _.COMPONENT), document.body.append(this.mask, this.container), this.keydownHandler = (e) => {
138
731
  e.key === "Escape" && this.close();
139
- }, document.addEventListener("keydown", this.keydownHandler), (s = this.inputList[0]) == null || s.focus();
732
+ }, document.addEventListener("keydown", this.keydownHandler), (o = this.inputList[0]) == null || o.focus();
140
733
  }
141
734
  render() {
142
- const { title: n, fields: s, confirmText: e = "确定", cancelText: t = "取消" } = this.options, i = c("i", { class: l("dialog__close") });
735
+ const { title: t, fields: o, confirmText: e = "确定", cancelText: n = "取消" } = this.options, i = l("i", { class: c("dialog__close") });
143
736
  i.onclick = () => this.close();
144
- const o = c("div", { class: l("dialog__body") });
145
- s.forEach((g) => {
146
- const u = this.createInput(g);
147
- this.inputList.push(u);
148
- const x = g.label ? c(
737
+ const a = l("div", { class: c("dialog__body") });
738
+ o.forEach((p) => {
739
+ const g = this.createInput(p);
740
+ this.inputList.push(g);
741
+ const f = p.label ? l(
149
742
  "span",
150
743
  {
151
- class: `${l("dialog__label")}${g.required ? ` ${l("dialog__label--required")}` : ""}`
744
+ class: `${c("dialog__label")}${p.required ? ` ${c("dialog__label--required")}` : ""}`
152
745
  },
153
- g.label
746
+ p.label
154
747
  ) : null;
155
- o.append(c("label", { class: l("dialog__field") }, x, u));
748
+ a.append(l("label", { class: c("dialog__field") }, f, g));
156
749
  });
157
- const r = c("button", { type: "button" }, t);
750
+ const r = l("button", { type: "button" }, n);
158
751
  r.onclick = () => this.close();
159
- const d = c(
752
+ const h = l(
160
753
  "button",
161
- { type: "button", class: l("dialog__confirm") },
754
+ { type: "button", class: c("dialog__confirm") },
162
755
  e
163
756
  );
164
- d.onclick = () => this.confirm();
165
- const h = c(
757
+ h.onclick = () => this.confirm();
758
+ const d = l(
166
759
  "div",
167
- { class: l("dialog") },
168
- c("div", { class: l("dialog__title") }, c("span", {}, n), i),
169
- o,
170
- c("div", { class: l("dialog__footer") }, r, d)
760
+ { class: c("dialog") },
761
+ l("div", { class: c("dialog__title") }, l("span", {}, t), i),
762
+ a,
763
+ l("div", { class: c("dialog__footer") }, r, h)
171
764
  );
172
- return h.addEventListener("keydown", (g) => {
173
- const u = g.target;
174
- g.key === "Enter" && u.tagName === "INPUT" && (g.preventDefault(), this.confirm());
175
- }), c("div", { class: l("dialog-container") }, h);
765
+ return d.addEventListener("keydown", (p) => {
766
+ const g = p.target;
767
+ p.key === "Enter" && g.tagName === "INPUT" && (p.preventDefault(), this.confirm());
768
+ }), l("div", { class: c("dialog-container") }, d);
176
769
  }
177
- createInput(n) {
770
+ createInput(t) {
178
771
  var e;
179
- let s;
180
- return n.type === "select" ? (s = c("select", { name: n.name }), (e = n.options) == null || e.forEach((t) => {
181
- s.append(c("option", { value: t.value }, t.label));
182
- })) : n.type === "textarea" ? (s = c("textarea", { name: n.name }), n.height && (s.style.height = `${n.height}px`)) : s = c("input", { name: n.name, type: n.type }), n.value !== void 0 && (s.value = n.value), n.placeholder && !(s instanceof HTMLSelectElement) && (s.placeholder = n.placeholder), s;
772
+ let o;
773
+ return t.type === "select" ? (o = l("select", { name: t.name }), (e = t.options) == null || e.forEach((n) => {
774
+ o.append(l("option", { value: n.value }, n.label));
775
+ })) : t.type === "textarea" ? (o = l("textarea", { name: t.name }), t.height && (o.style.height = `${t.height}px`)) : o = l("input", { name: t.name, type: t.type }), t.value !== void 0 && (o.value = t.value), t.placeholder && !(o instanceof HTMLSelectElement) && (o.placeholder = t.placeholder), o;
183
776
  }
184
777
  confirm() {
185
- const { fields: n, onConfirm: s } = this.options, e = {};
186
- let t = !0;
187
- this.inputList.forEach((i, o) => {
778
+ const { fields: t, onConfirm: o } = this.options, e = {};
779
+ let n = !0;
780
+ this.inputList.forEach((i, a) => {
188
781
  e[i.name] = i.value;
189
- const r = n[o].required && !i.value.trim();
190
- i.classList.toggle(l("dialog__input--error"), !!r), r && (t = !1);
191
- }), t && (s && s(e) === !1 || this.dispose());
782
+ const r = t[a].required && !i.value.trim();
783
+ i.classList.toggle(c("dialog__input--error"), !!r), r && (n = !1);
784
+ }), n && (o && o(e) === !1 || this.dispose());
192
785
  }
193
786
  close() {
194
- var n, s;
195
- (s = (n = this.options).onClose) == null || s.call(n), this.dispose();
787
+ var t, o;
788
+ (o = (t = this.options).onClose) == null || o.call(t), this.dispose();
196
789
  }
197
790
  dispose() {
198
791
  document.removeEventListener("keydown", this.keydownHandler), this.mask.remove(), this.container.remove();
199
792
  }
200
793
  }
201
- const f = /* @__PURE__ */ new Set();
202
- function A(a) {
203
- f.forEach((n) => {
204
- n.el.contains(a.target) || n.close();
794
+ const M = /* @__PURE__ */ new Set();
795
+ function U(s) {
796
+ M.forEach((t) => {
797
+ t.el.contains(s.target) || t.close();
205
798
  });
206
799
  }
207
- class I {
208
- constructor(n, s, e = "bottom") {
209
- this.panel = c(
800
+ class C {
801
+ constructor(t, o, e = "bottom") {
802
+ this.panel = l(
210
803
  "div",
211
- { class: `${l("dropdown__panel")} ${l(`dropdown__panel--${e}`)}` },
212
- s
213
- ), this.el = c("div", { class: l("dropdown") }, n, this.panel), n.addEventListener("click", () => this.toggle());
804
+ { class: `${c("dropdown__panel")} ${c(`dropdown__panel--${e}`)}` },
805
+ o
806
+ ), this.el = l("div", { class: c("dropdown") }, t, this.panel), t.addEventListener("click", () => this.toggle());
214
807
  }
215
808
  toggle() {
216
- f.has(this) ? this.close() : this.open();
809
+ M.has(this) ? this.close() : this.open();
217
810
  }
218
811
  open() {
219
- f.forEach((s) => s.close()), this.panel.classList.add(l("dropdown__panel--visible")), this.panel.style.left = "", this.panel.style.right = "", this.panel.getBoundingClientRect().right > window.innerWidth && (this.panel.style.left = "auto", this.panel.style.right = "0"), f.size || document.addEventListener("mousedown", A), f.add(this);
812
+ M.forEach((o) => o.close()), this.panel.classList.add(c("dropdown__panel--visible")), this.panel.style.left = "", this.panel.style.right = "", this.panel.getBoundingClientRect().right > window.innerWidth && (this.panel.style.left = "auto", this.panel.style.right = "0"), M.size || document.addEventListener("mousedown", U), M.add(this);
220
813
  }
221
814
  close() {
222
- this.panel.classList.remove(l("dropdown__panel--visible")), f.delete(this), f.size || document.removeEventListener("mousedown", A);
815
+ this.panel.classList.remove(c("dropdown__panel--visible")), M.delete(this), M.size || document.removeEventListener("mousedown", U);
223
816
  }
224
817
  }
225
- function w(a, n) {
226
- const s = c("ul", { class: l("option-list") });
227
- return a.forEach((e) => {
228
- const t = c(
818
+ function w(s, t) {
819
+ const o = l("ul", { class: c("option-list") });
820
+ return s.forEach((e) => {
821
+ const n = l(
229
822
  "li",
230
823
  { "data-value": e.value, style: e.style },
231
- e.icon ? c("i", {
232
- class: l("icon"),
824
+ e.icon ? l("i", {
825
+ class: c("icon"),
233
826
  style: `background-image:url("${e.icon}")`
234
827
  }) : null,
235
828
  e.label
236
829
  );
237
- t.addEventListener("mousedown", (i) => i.preventDefault()), t.addEventListener("click", () => n(e.value)), s.append(t);
238
- }), s;
830
+ n.addEventListener("mousedown", (i) => i.preventDefault()), n.addEventListener("click", () => t(e.value)), o.append(n);
831
+ }), o;
239
832
  }
240
- function L(a, n) {
241
- a.querySelectorAll("li").forEach((s) => {
242
- s.classList.toggle(l("active"), s.dataset.value === n);
833
+ function y(s, t) {
834
+ s.querySelectorAll("li").forEach((o) => {
835
+ o.classList.toggle(c("active"), o.dataset.value === t);
243
836
  });
244
837
  }
245
- const J = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M9%209h1v4H9z'/%3e%3cpath%20d='M9%209h4v1H9zM7%207H6V3h1z'/%3e%3cpath%20d='M7%207H3V6h4z'/%3e%3c/g%3e%3c/svg%3e", Q = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(2%201)'%3e%3crect%20stroke='%233D4757'%20x='.5'%20y='.5'%20width='11'%20height='8'%20rx='1'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M2%203h4v1H2zm0%202h8v1H2z'/%3e%3c/g%3e%3cg%20fill='%233D4757'%20fill-rule='nonzero'%3e%3cpath%20d='M14%2015h-1v-5H3v5H2V9h12v6z'/%3e%3cpath%20d='M4%2012h4v1H4zm0%202h8v1H4z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ee = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%207V3h2v4h4v2H9v4H7V9H3V7h4z'%20fill='%23636363'%20fill-rule='evenodd'/%3e%3c/svg%3e", te = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%207h10v2H3z'%20fill='%23636363'%20fill-rule='evenodd'/%3e%3c/svg%3e", ne = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_04页面_x2F_纸张方向-16px'%3e%3cg%20id='编组'%20transform='translate(1%201)'%3e%3cpath%20id='合并形状'%20class='st0'%20d='M14%206v7c0%20.6-.4%201-1%201H4c-.6%200-1-.4-1-1V6c0-.6.4-1%201-1h9c.6%200%201%20.4%201%201zm-1%200H4v7h9V6z'/%3e%3cpath%20id='路径'%20class='st0'%20d='M9%204H8V1H1v9h1v1H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1h7c.6%200%201%20.4%201%201v3z'/%3e%3cpath%20id='矩形'%20class='st0'%20d='M11%207h1v5h-1z'/%3e%3cpath%20id='矩形-copy-2'%20class='st0'%20d='M2%202h5v1H2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", se = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3crect%20stroke='%233D4757'%20x='2.5'%20y='1.5'%20width='11'%20height='13'%20rx='1'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M3%204h10v1H3zm0%207h10v1H3z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M5%2014V2h1v12zm5%200V2h1v12z'/%3e%3c/g%3e%3c/svg%3e", R = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M3%203h1v4H3z'/%3e%3cpath%20d='M3%203h4v1H3zm10%2010h-1V9h1z'/%3e%3cpath%20d='M13%2013H9v-1h4z'/%3e%3c/g%3e%3c/svg%3e", P = [
838
+ const re = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M9%209h1v4H9z'/%3e%3cpath%20d='M9%209h4v1H9zM7%207H6V3h1z'/%3e%3cpath%20d='M7%207H3V6h4z'/%3e%3c/g%3e%3c/svg%3e", de = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(2%201)'%3e%3crect%20stroke='%233D4757'%20x='.5'%20y='.5'%20width='11'%20height='8'%20rx='1'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M2%203h4v1H2zm0%202h8v1H2z'/%3e%3c/g%3e%3cg%20fill='%233D4757'%20fill-rule='nonzero'%3e%3cpath%20d='M14%2015h-1v-5H3v5H2V9h12v6z'/%3e%3cpath%20d='M4%2012h4v1H4zm0%202h8v1H4z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", he = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%207V3h2v4h4v2H9v4H7V9H3V7h4z'%20fill='%23636363'%20fill-rule='evenodd'/%3e%3c/svg%3e", pe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%207h10v2H3z'%20fill='%23636363'%20fill-rule='evenodd'/%3e%3c/svg%3e", ue = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_04页面_x2F_纸张方向-16px'%3e%3cg%20id='编组'%20transform='translate(1%201)'%3e%3cpath%20id='合并形状'%20class='st0'%20d='M14%206v7c0%20.6-.4%201-1%201H4c-.6%200-1-.4-1-1V6c0-.6.4-1%201-1h9c.6%200%201%20.4%201%201zm-1%200H4v7h9V6z'/%3e%3cpath%20id='路径'%20class='st0'%20d='M9%204H8V1H1v9h1v1H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1h7c.6%200%201%20.4%201%201v3z'/%3e%3cpath%20id='矩形'%20class='st0'%20d='M11%207h1v5h-1z'/%3e%3cpath%20id='矩形-copy-2'%20class='st0'%20d='M2%202h5v1H2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ve = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3crect%20stroke='%233D4757'%20x='2.5'%20y='1.5'%20width='11'%20height='13'%20rx='1'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M3%204h10v1H3zm0%207h10v1H3z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M5%2014V2h1v12zm5%200V2h1v12z'/%3e%3c/g%3e%3c/svg%3e", G = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M3%203h1v4H3z'/%3e%3cpath%20d='M3%203h4v1H3zm10%2010h-1V9h1z'/%3e%3cpath%20d='M13%2013H9v-1h4z'/%3e%3c/g%3e%3c/svg%3e", j = [
246
839
  "pageNo",
247
840
  "wordCount",
248
841
  "rowCol",
@@ -251,173 +844,175 @@ const J = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://
251
844
  "paperDirection",
252
845
  "paperMargin",
253
846
  "fullscreen"
254
- ], ae = ["pageNo", "wordCount", "rowCol"];
255
- function M(a, n, s) {
256
- const e = c(
847
+ ], ge = ["pageNo", "wordCount", "rowCol"];
848
+ function T(s, t, o) {
849
+ const e = l(
257
850
  "div",
258
- { class: l("statusbar__button"), title: n },
259
- c("i", { class: l("icon"), style: `background-image:url("${a}")` })
851
+ { class: c("statusbar__button"), title: t },
852
+ l("i", { class: c("icon"), style: `background-image:url("${s}")` })
260
853
  );
261
- return e.addEventListener("click", s), e;
854
+ return e.addEventListener("click", o), e;
262
855
  }
263
- class ie {
264
- constructor(n, s = P) {
265
- this.disposeList = [], this.updaterList = [], this.on = (i, o) => {
856
+ class me {
857
+ constructor(t, o = j) {
858
+ this.disposeList = [], this.updaterList = [], this.on = (i, a) => {
266
859
  const { eventBus: r } = this.ui.editor;
267
- r.on(i, o), this.disposeList.push(() => r.off(i, o));
268
- }, this.ui = n;
269
- const e = c("div", { class: l("statusbar__left") }), t = c("div", { class: l("statusbar__right") });
270
- this.el = c("div", { class: l("statusbar") }, e, t), this.el.setAttribute(E, T.FOOTER), this.el.addEventListener("mousedown", (i) => i.preventDefault()), s.forEach((i) => {
271
- const o = this.createItem(i);
272
- o && (o.classList.add(l("statusbar__item")), (ae.includes(i) ? e : t).append(o));
860
+ r.on(i, a), this.disposeList.push(() => r.off(i, a));
861
+ }, this.ui = t;
862
+ const e = l("div", { class: c("statusbar__left") }), n = l("div", { class: c("statusbar__right") });
863
+ this.el = l("div", { class: c("statusbar") }, e, n), this.el.setAttribute(D, _.FOOTER), this.el.addEventListener("mousedown", (i) => i.preventDefault()), o.forEach((i) => {
864
+ const a = this.createItem(i);
865
+ a && (a.classList.add(c("statusbar__item")), (ge.includes(i) ? e : n).append(a));
273
866
  });
274
867
  }
275
- createItem(n) {
276
- const { editor: s, locale: e } = this.ui;
277
- switch (n) {
868
+ createItem(t) {
869
+ const { editor: o, locale: e } = this.ui;
870
+ switch (t) {
278
871
  case "pageNo": {
279
- const t = c("span", {}, "1"), i = c("span", {}, String(this.ui.getPageSize()));
280
- return this.on("intersectionPageNoChange", (o) => {
281
- t.innerText = String(o + 1);
282
- }), this.on("pageSizeChange", (o) => {
283
- i.innerText = String(o);
284
- }), c("span", {}, `${e.pageNo}:`, t, "/", i);
872
+ const n = l("span", {}, "1"), i = l("span", {}, String(this.ui.getPageSize()));
873
+ return this.on("intersectionPageNoChange", (a) => {
874
+ n.innerText = String(a + 1);
875
+ }), this.on("pageSizeChange", (a) => {
876
+ i.innerText = String(a);
877
+ }), l("span", {}, `${e.pageNo}:`, n, "/", i);
285
878
  }
286
879
  case "wordCount": {
287
- const t = c("span", {}, "0"), i = G(async () => {
288
- t.innerText = String(await s.command.getWordCount());
880
+ const n = l("span", {}, "0"), i = te(async () => {
881
+ n.innerText = String(await o.command.getWordCount());
289
882
  }, 300);
290
- return this.on("contentChange", i), this.disposeList.push(i.cancel), i(), c("span", {}, `${e.wordCount}:`, t);
883
+ return this.on("contentChange", i), this.disposeList.push(i.cancel), i(), l("span", {}, `${e.wordCount}:`, n);
291
884
  }
292
885
  case "rowCol": {
293
- const t = c("span", {}, "1:1");
886
+ const n = l("span", {}, "1:1");
294
887
  return this.on("rangeStyleChange", () => {
295
- const i = s.command.getRangeContext();
296
- i && (t.innerText = `${i.startRowNo + 1}:${i.startColNo + 1}`);
297
- }), c("span", {}, `${e.rowCol}:`, t);
888
+ const i = o.command.getRangeContext();
889
+ i && (n.innerText = `${i.startRowNo + 1}:${i.startColNo + 1}`);
890
+ }), l("span", {}, `${e.rowCol}:`, n);
298
891
  }
299
892
  case "pageMode": {
300
- const t = M(Q, "", () => {
893
+ const n = T(de, "", () => {
301
894
  }), i = w(
302
895
  [
303
- { label: e.pageModePaging, value: S.PAGING },
304
- { label: e.pageModeContinuity, value: S.CONTINUITY }
896
+ { label: e.pageModePaging, value: V.PAGING },
897
+ { label: e.pageModeContinuity, value: V.CONTINUITY }
305
898
  ],
306
- (d) => {
307
- o.close(), s.command.executePageMode(d);
899
+ (h) => {
900
+ a.close(), o.command.executePageMode(h);
308
901
  }
309
- ), o = new I(t, i, "top"), r = (d) => {
310
- L(i, d), t.title = d === S.CONTINUITY ? e.pageModeContinuity : e.pageModePaging;
902
+ ), a = new C(n, i, "top"), r = (h) => {
903
+ y(i, h), n.title = h === V.CONTINUITY ? e.pageModeContinuity : e.pageModePaging;
311
904
  };
312
- return r(s.command.getOptions().pageMode), this.on("pageModeChange", r), o.el;
905
+ return r(o.command.getOptions().pageMode), this.on("pageModeChange", r), a.el;
313
906
  }
314
907
  case "scale": {
315
- const t = c("span", {
316
- class: l("statusbar__scale"),
908
+ const n = l("span", {
909
+ class: c("statusbar__scale"),
317
910
  title: e.scaleRecovery
318
- }), i = (o) => {
319
- t.innerText = `${Math.round(o * 100)}%`;
911
+ }), i = (a) => {
912
+ n.innerText = `${Math.round(a * 100)}%`;
320
913
  };
321
- return i(s.command.getOptions().scale), this.on("pageScaleChange", i), t.addEventListener(
914
+ return i(o.command.getOptions().scale), this.on("pageScaleChange", i), n.addEventListener(
322
915
  "click",
323
- () => s.command.executePageScaleRecovery()
324
- ), c(
916
+ () => o.command.executePageScaleRecovery()
917
+ ), l(
325
918
  "div",
326
- { class: l("statusbar__group") },
327
- M(
328
- te,
919
+ { class: c("statusbar__group") },
920
+ T(
921
+ pe,
329
922
  e.scaleMinus,
330
- () => s.command.executePageScaleMinus()
923
+ () => o.command.executePageScaleMinus()
331
924
  ),
332
- t,
333
- M(
334
- ee,
925
+ n,
926
+ T(
927
+ he,
335
928
  e.scaleAdd,
336
- () => s.command.executePageScaleAdd()
929
+ () => o.command.executePageScaleAdd()
337
930
  )
338
931
  );
339
932
  }
340
933
  case "paperDirection":
341
- return M(ne, e.paperDirection, () => {
342
- const { paperDirection: t } = s.command.getOptions();
343
- s.command.executePaperDirection(
344
- t === C.HORIZONTAL ? C.VERTICAL : C.HORIZONTAL
934
+ return T(ue, e.paperDirection, () => {
935
+ const { paperDirection: n } = o.command.getOptions();
936
+ o.command.executePaperDirection(
937
+ n === R.HORIZONTAL ? R.VERTICAL : R.HORIZONTAL
345
938
  );
346
939
  });
347
940
  case "paperMargin":
348
- return M(
349
- se,
941
+ return T(
942
+ ve,
350
943
  e.paperMargin,
351
944
  () => this.openPaperMarginDialog()
352
945
  );
353
946
  case "mode": {
354
- const t = [
355
- { label: e.modeEdit, value: p.EDIT },
356
- { label: e.modeClean, value: p.CLEAN },
357
- { label: e.modeReadonly, value: p.READONLY },
358
- { label: e.modeForm, value: p.FORM },
359
- { label: e.modePrint, value: p.PRINT },
360
- { label: e.modeDesign, value: p.DESIGN }
361
- ], i = c("span", { class: l("statusbar__mode") }), o = w(t, (h) => {
362
- r.close(), this.ui.setMode(h);
363
- }), r = new I(i, o, "top"), d = () => {
364
- var g;
365
- const h = s.command.getOptions().mode;
366
- i.innerText = ((g = t.find((u) => u.value === h)) == null ? void 0 : g.label) || h, L(o, h);
947
+ const n = [
948
+ { label: e.modeEdit, value: m.EDIT },
949
+ { label: e.modeClean, value: m.CLEAN },
950
+ { label: e.modeReadonly, value: m.READONLY },
951
+ { label: e.modeForm, value: m.FORM },
952
+ { label: e.modePrint, value: m.PRINT },
953
+ { label: e.modeDesign, value: m.DESIGN },
954
+ { label: e.modeGraffiti, value: m.GRAFFITI },
955
+ { label: e.modeTrace, value: m.TRACE }
956
+ ], i = l("span", { class: c("statusbar__mode") }), a = w(n, (d) => {
957
+ r.close(), this.ui.setMode(d);
958
+ }), r = new C(i, a, "top"), h = () => {
959
+ var p;
960
+ const d = o.command.getOptions().mode;
961
+ i.innerText = ((p = n.find((g) => g.value === d)) == null ? void 0 : p.label) || d, y(a, d);
367
962
  };
368
- return d(), this.updaterList.push(d), r.el;
963
+ return h(), this.updaterList.push(h), r.el;
369
964
  }
370
965
  case "fullscreen": {
371
- const t = M(R, e.fullscreen, () => {
966
+ const n = T(G, e.fullscreen, () => {
372
967
  document.fullscreenElement ? document.exitFullscreen() : this.ui.root.requestFullscreen();
373
968
  }), i = () => {
374
- const o = document.fullscreenElement ? J : R;
375
- t.querySelector("i").style.backgroundImage = `url("${o}")`;
969
+ const a = document.fullscreenElement ? re : G;
970
+ n.querySelector("i").style.backgroundImage = `url("${a}")`;
376
971
  };
377
972
  return document.addEventListener("fullscreenchange", i), this.disposeList.push(
378
973
  () => document.removeEventListener("fullscreenchange", i)
379
- ), t;
974
+ ), n;
380
975
  }
381
976
  default:
382
- return console.warn(`[canvas-editor-ui] unknown statusbar item: ${n}`), null;
977
+ return console.warn(`[canvas-editor-ui] unknown statusbar item: ${t}`), null;
383
978
  }
384
979
  }
385
980
  openPaperMarginDialog() {
386
- const { editor: n, locale: s } = this.ui, e = ["top", "right", "bottom", "left"], t = [
387
- s.marginTop,
388
- s.marginRight,
389
- s.marginBottom,
390
- s.marginLeft
391
- ], i = n.command.getPaperMargin();
392
- new k({
393
- title: s.paperMargin,
394
- confirmText: s.confirm,
395
- cancelText: s.cancel,
396
- fields: e.map((o, r) => ({
981
+ const { editor: t, locale: o } = this.ui, e = ["top", "right", "bottom", "left"], n = [
982
+ o.marginTop,
983
+ o.marginRight,
984
+ o.marginBottom,
985
+ o.marginLeft
986
+ ], i = t.command.getPaperMargin();
987
+ new F({
988
+ title: o.paperMargin,
989
+ confirmText: o.confirm,
990
+ cancelText: o.cancel,
991
+ fields: e.map((a, r) => ({
397
992
  type: "number",
398
- name: o,
399
- label: t[r],
993
+ name: a,
994
+ label: n[r],
400
995
  required: !0,
401
996
  value: String(i[r])
402
997
  })),
403
- onConfirm: (o) => {
404
- const [r, d, h, g] = e.map(
405
- (x) => Number(o[x])
406
- ), u = [r, d, h, g];
407
- if (u.some((x) => isNaN(x) || x < 0)) return !1;
408
- n.command.executeSetPaperMargin(u);
998
+ onConfirm: (a) => {
999
+ const [r, h, d, p] = e.map(
1000
+ (f) => Number(a[f])
1001
+ ), g = [r, h, d, p];
1002
+ if (g.some((f) => isNaN(f) || f < 0)) return !1;
1003
+ t.command.executeSetPaperMargin(g);
409
1004
  }
410
1005
  });
411
1006
  }
412
1007
  // 外部状态(如编辑模式)变化后刷新
413
1008
  update() {
414
- this.updaterList.forEach((n) => n());
1009
+ this.updaterList.forEach((t) => t());
415
1010
  }
416
1011
  destroy() {
417
- this.disposeList.forEach((n) => n()), this.el.remove();
1012
+ this.disposeList.forEach((t) => t()), this.el.remove();
418
1013
  }
419
1014
  }
420
- const oe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm0-3h12v1H2v-1zm0-3h12v1H2V7zm0-6h12v1H2V1zm0%203h12v1H2V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", ce = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.131%206.9c2.035%200%202.569-.9%202.569-1.869%200-.968-.64-1.831-2.623-1.831H5.2v3.7h2.931zm.524%205.9c2.045%200%202.545-1.305%202.545-2.3%200-.985-.506-2.4-2.81-2.4H5.2v4.7h3.455zM4%202h4.71c2.367%200%203.19%201.583%203.19%203s-.325%201.852-1.1%202.5c1.2.5%201.569%201.379%201.6%203%20.03%201.606-.586%203.5-3.769%203.5H4V2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", le = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm2-3h8v1H4v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm2%203h8v1H4V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", re = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_01开始_x2F_任务列表-16px'%3e%3cpath%20id='合并形状'%20class='st0'%20d='M10.1%202H2v11h11V8.7l1-1V13c0%20.6-.4%201-1%201H2c-.6%200-1-.4-1-1V2c0-.6.4-1%201-1h9.1l-1%201z'/%3e%3cpath%20id='路径'%20class='st0'%20d='M7.7%208.5l5.7-5.8.9.8-6.1%205.9-.5.5-3.9-3.4.8-.7z'/%3e%3c/g%3e%3c/svg%3e", de = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.997%203.429L6.398%208h3.2L7.997%203.429zM8.497%202L12%2012h-1L9.949%209h-3.9L5%2012H4L7.496%202h1z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", he = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M9.793%201.5H3a.5.5%200%2000-.5.5v12a.5.5%200%2000.5.5h9a.5.5%200%2000.5-.5V4.207L9.793%201.5z'%20stroke='%233D4757'/%3e%3cg%20fill='%233D4757'%3e%3cpath%20d='M7%207h1v5H7z'/%3e%3cpath%20d='M5%207h5v1H5z'/%3e%3c/g%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M9%202h1v3H9z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M9%204h3v1H9z'/%3e%3c/g%3e%3c/svg%3e", ge = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M7.5%2014.154a5.654%205.654%200%20100-11.308%205.654%205.654%200%20000%2011.308zm0%20.846a6.5%206.5%200%20110-13%206.5%206.5%200%20010%2013z'%20fill-rule='nonzero'/%3e%3cpath%20d='M8%208h4v1H7V4h1v4z'/%3e%3c/g%3e%3c/svg%3e", ve = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M8.213%2013H6.8l6.636-6.636-4.243-4.243-7.07%207.071L5.928%2013H4.515L1.06%209.546a.5.5%200%20010-.707L8.839%201.06a.5.5%200%2001.707%200l4.95%204.95a.5.5%200%20010%20.707L8.213%2013z'%20fill-rule='nonzero'/%3e%3cpath%20d='M4.536%206.364l4.95%204.95-.707.707-4.95-4.95zM4.521%2013h10.03v1H5.496z'/%3e%3c/g%3e%3c/svg%3e", ue = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M13.31%205h-1.92a2.203%202.203%200%2000-.39-.034c-.135%200-.27.012-.402.034H10v.18c-.578.256-1%20.714-1%201.214v1.928c0%20.196.117.43.3.658v1.23a3.543%203.543%200%2001-.3-.4V11H8V1h1v4.265C9%204.763%2010%204%2010.942%204c1.19%200%201.92.422%202.367%201zM2%206c-.03-.498-.175-2%202.5-2C7.11%204%207%205%207%206.902V11H5.984v-.993c.38.662-.115.993-1.484.993C2.708%2011%202%209.931%202%209c0-1.428.447-2%202.5-2h1.484c0-1%20.031-2-1.484-2-1.533%200-1.577.485-1.577%201H2zm2.5%202C3.601%208%203%207.768%203%209c0%201.31.438%201%201.5%201%20.617%200%201.484-.665%201.484-1.847V8H4.5z'/%3e%3cpath%20d='M13.085%206.316l-2.814%203a1%201%200%20101.458%201.368l2.815-3a1%201%200%2000-1.459-1.368z'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e", me = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='rotate(45%205.5%2013.328)'%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M7%206H6V3.515a2.5%202.5%200%2010-5%200V6H0V3.515a3.5%203.5%200%20117%200V6zm0%204v2.5a3.5%203.5%200%2001-7%200V10h1v2.5a2.5%202.5%200%20105%200V10h1z'%20fill-rule='nonzero'/%3e%3crect%20x='3.062'%20y='5.209'%20width='1'%20height='5.5'%20rx='.5'/%3e%3c/g%3e%3c/svg%3e", pe = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_插入图片-16px-'%3e%3cg%20id='Group-19'%20transform='translate(1%201)'%3e%3cpath%20id='Combined-Shape'%20class='st0'%20d='M1%200h12c.6%200%201%20.4%201%201v11c0%20.6-.4%201-1%201H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1zm0%201v11h12V1H1z'/%3e%3ccircle%20id='椭圆形'%20class='st0'%20cx='10'%20cy='4'%20r='1'/%3e%3cpath%20id='Path'%20class='st0'%20d='M8.5%2011.2l-4-4.1L1%2010.7V9.2c1.7-1.6%202.7-2.5%203-2.8.4-.5.7-.4%201%200L8.5%2010%2011%207.3c.4-.5.6-.5%201-.1l2%202.8v1.5l-2.5-3.4-3%203.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", we = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.017%203L8.08%2013H9v1H6v-1h1.182L9%203H8V2h3v1h-.983z'%20fill='%233D4757'/%3e%3c/svg%3e", fe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20stroke='%233D4757'%20fill='%233D4757'%20d='M2%2010.5H14M2%2013.5H14'%20stroke-linecap='round'%20stroke-linejoin='miter'%3e%3c/path%3e%3cpath%20stroke='%233D4757'%20fill='%233D4757'%20d='M14%203.5L12%201.5M14%203.5L12%205.5M14%203.5L2%203.5M4%201.5L2%203.5M2%203.5L4%205.5'%20stroke-linecap='round'%20stroke-linejoin='miter'%3e%3c/path%3e%3c/svg%3e", xe = "data:image/svg+xml,%3csvg%20height='16'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2zm0-3h8v1H2zm0-3h12v1H2zm0-6h12v1H2zm0%203h8v1H2z'%20fill='%233d4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", be = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M7%2012h7v1H7zm0-5h7v1H7zm0-5h7v1H7zM3%204V2H2V1h2v3h1v1H2V4h1z'/%3e%3cpath%20d='M2%206h3v1H2V6zm0%203h3v1H2V9z'%20fill='%234F4F4F'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M4.5%206L5%207l-2.5%203L2%209z'/%3e%3cpath%20d='M4%2014l-1-2H2v-1h3v1H4l1%202v1H2v-1h2z'%20fill='%233D4757'/%3e%3c/g%3e%3c/svg%3e", Me = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:none;stroke:%233d4757}.st1{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_02插入_x2F_分页-16px'%3e%3cpath%20id='矩形'%20class='st0'%20d='M5.5%202.5h7c.6%200%201%20.4%201%201v3c0%20.6-.4%201-1%201h-7c-.6%200-1-.4-1-1v-3c0-.6.4-1%201-1z'/%3e%3cpath%20id='三角形'%20class='st1'%20d='M4%208.5L1%206v5z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M10.8%209.5H5c-.3%200-.5.2-.5.5v4c0%20.3.2.5.5.5h8c.3%200%20.5-.2.5-.5v-1.8l-2.7-2.7z'/%3e%3cpath%20id='矩形_1_'%20class='st1'%20d='M10%2010h1v3h-1z'/%3e%3cpath%20id='矩形-copy-2'%20class='st1'%20d='M10%2012h3v1h-3z'/%3e%3c/g%3e%3c/svg%3e", B = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.5%202v2.5H4a.5.5%200%2000-.5.5v2a.5.5%200%2000.5.5h9a.5.5%200%2000.5-.5V5a.5.5%200%2000-.5-.5H9.5V2a.5.5%200%2000-.5-.5H8a.5.5%200%2000-.5.5z'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M13%207h1v4h-1z'/%3e%3cpath%20d='M11%2013a2%202%200%20002-2V8.764A3%203%200%20118.764%2013H11z'%20fill='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M1%2013h10v1H1z'/%3e%3cpath%20d='M1%2013a2%202%200%20002-2V8.764A3%203%200%20011%2014v-1z'%20fill='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M3%207h1v4H3z'/%3e%3c/g%3e%3c/svg%3e", ze = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M10%201l4%204v9a1%201%200%2001-1%201H3a1%201%200%2001-1-1V2a1%201%200%20011-1h7zm-.414%201H3v12h10V5.414L9.586%202z'/%3e%3cpath%20d='M9%201h1v4h4v1H9z'/%3e%3cpath%20d='M8%207h1v4.293l1.646-1.647.708.708L8.5%2013.207l-2.854-2.853.708-.708L8%2011.293z'%20transform='translate(-.5)'/%3e%3c/g%3e%3c/svg%3e", He = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M12%204h-1V2H5v2H4V2a1%201%200%20011-1h6a1%201%200%20011%201v2zm0%205v4a1%201%200%2001-1%201H5a1%201%200%2001-1-1V9h1v4h6V9h1z'/%3e%3cpath%20d='M12%2012v-1h2V5H2v6h2v1H2a1%201%200%2001-1-1V5a1%201%200%20011-1h12a1%201%200%20011%201v6a1%201%200%2001-1%201h-2z'/%3e%3cpath%20d='M3%208h10v1H3zm8-2h2v1h-2z'/%3e%3c/g%3e%3c/svg%3e", Le = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%2014v-3a4%204%200%20014-4h3V6H7a5%205%200%2000-5%205v3h1zm7.016-11.282v7.543l4.29-3.73z'%20fill='%233D4757'/%3e%3c/svg%3e", _e = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm4-3h8v1H6v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm4%203h8v1H6V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", ye = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2014h12v1H2v-1zm7-5h5v1H9V9zm0-3h5v1H9V6zM2%201h12v1H2V1zm2.5%203L7%207H2zm0%208L7%209H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", De = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20stroke='%233D4757'%20cx='6'%20cy='6'%20r='4.5'/%3e%3cpath%20d='M10.061%2010.968L8.707%209.414l.707-.707%201.514%201.457.435-.404%202.632%202.462a1.154%201.154%200%2001.05%201.635%201.184%201.184%200%2001-1.655.064l-2.788-2.527.46-.426z'%20fill='%233D4757'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e", Ee = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9%202.8l2.01%202.506c.2.25.58.25.78%200L8.7%202.799l2.01%202.507c.2.25.58.25.78%200l2.4-2.993-.78-.626-2.01%202.507-2.01-2.507a.5.5%200%2000-.78%200L6.3%204.194%204.29%201.687a.5.5%200%2000-.78%200l-2.4%203%20.78.625L3.9%202.8zM1%208h13v1H1zm0%204h3v1H1zm5%200h3v1H6zm5%200h3v1h-3z'%20fill='%233D4757'/%3e%3c/svg%3e", Te = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6.215%203.29H7.64L11.855%2014H10.52l-1.14-3H4.46l-1.14%203H2L6.215%203.29zM4.85%209.965h4.14L6.965%204.61h-.06L4.85%209.965z'/%3e%3cpath%20d='M12%204V2h1v2h2v1h-2v2h-1V5h-2V4h2z'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e", Ie = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20fill-rule='nonzero'%20d='M11%204h4v1h-4z'/%3e%3cpath%20d='M6.215%203.29H7.64L11.855%2014H10.52l-1.14-3H4.46l-1.14%203H2L6.215%203.29zM4.85%209.965h4.14L6.965%204.61h-.06L4.85%209.965z'/%3e%3c/g%3e%3c/svg%3e", ke = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M10.42%207.903H6.692a9.182%209.182%200%2001-.41-.172%205.54%205.54%200%2001-.814-.447%202.955%202.955%200%2001-.655-.595%202.728%202.728%200%2001-.44-.777%202.877%202.877%200%2001-.162-1.006c0-.472.094-.888.282-1.25.188-.36.453-.663.793-.907s.747-.43%201.22-.558A5.97%205.97%200%20018.063%202c.504%200%20.95.049%201.337.147.387.097.725.23%201.013.398.287.169.53.365.73.59a3.337%203.337%200%2001.772%201.486c.03.13.054.255.073.379h-1.276a2.393%202.393%200%2000-.22-.615%202.315%202.315%200%2000-.59-.724%202.467%202.467%200%2000-.834-.44%203.376%203.376%200%2000-1.005-.146%204.69%204.69%200%2000-.958.097%202.77%202.77%200%2000-.839.314%201.765%201.765%200%2000-.597.566c-.152.233-.229.518-.229.854%200%20.348.086.642.258.884.171.241.401.449.689.622.287.174.615.323.983.448s.749.247%201.142.367c.31.097.62.196.934.297a8.439%208.439%200%2001.973.38zm1.376%201c.175.217.315.466.418.746.105.285.158.612.158.98%200%20.554-.104%201.041-.312%201.462-.207.42-.496.772-.867%201.054-.37.282-.81.495-1.32.64A6.12%206.12%200%20018.205%2014c-.543%200-1.071-.09-1.586-.273a4.44%204.44%200%2001-1.374-.773%203.873%203.873%200%2001-.97-1.217%203.695%203.695%200%2001-.395-1.612h1.27c.028.407.122.78.282%201.12a2.835%202.835%200%20001.581%201.465c.363.138.76.207%201.192.207.387%200%20.758-.042%201.112-.126a2.85%202.85%200%2000.938-.399%202.01%202.01%200%2000.647-.708c.16-.29.241-.642.241-1.054%200-.337-.087-.623-.261-.86a2.333%202.333%200%2000-.69-.61%204.651%204.651%200%2000-.495-.257h2.099z'/%3e%3cpath%20d='M3%207h10v1H3z'/%3e%3c/g%3e%3c/svg%3e", Se = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_subscript'%3e%3cpath%20id='_x32_'%20class='st0'%20d='M15%2013.3v.7h-3c0-.3.1-.5.3-.8.2-.2.5-.6%201-1%20.4-.3.6-.5.7-.7.1-.2.2-.3.2-.5s-.1-.3-.2-.4c-.1-.1-.2-.1-.4-.1s-.3%200-.4.1-.2.4-.2.7l-.9-.1c.1-.4.2-.7.5-.9.3-.2.6-.3%201-.3s.8.1%201%20.3c.3.2.4.5.4.8%200%20.2%200%20.4-.1.5-.1.2-.2.3-.3.5-.1.1-.3.3-.6.5s-.4.4-.5.4c-.1.1-.1.2-.2.3H15z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M7.2%208.5l4%205.5H9.8L6.5%209.4%203.2%2014H1.8l4-5.5-4-5.5h1.4l3.3%204.6L9.8%203h1.3L7.2%208.5z'/%3e%3c/g%3e%3c/svg%3e", Ce = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_superscript'%3e%3cpath%20id='_x32_'%20class='st0'%20d='M15%206.3V7h-3c0-.3.1-.5.3-.8.2-.2.5-.6%201-1%20.3-.2.6-.5.7-.6.1-.2.2-.3.2-.5s-.1-.3-.2-.4c-.1-.1-.2-.1-.4-.1s-.3%200-.4.1-.2.3-.2.6l-.9-.1c.1-.4.2-.7.5-.9s.6-.3%201-.3.8.1%201%20.3c.3.2.4.5.4.8%200%20.2%200%20.4-.1.5s-.2.4-.4.5c-.1.1-.3.3-.6.5s-.4.4-.4.5c-.1.1-.1.2-.2.3l1.7-.1z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M7.4%208.5l4%205.5H10L6.7%209.4%203.4%2014H2l4-5.5L2%203h1.4l3.3%204.6L10%203h1.3L7.4%208.5z'/%3e%3c/g%3e%3c/svg%3e", Ve = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3crect%20x='.5'%20y='.5'%20width='12'%20height='12'%20rx='1'%20transform='translate(1%201)'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M2%209h12v1H2zm0-4h12v1H2z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M5%201h1v13H5zm4%200h1v13H9z'/%3e%3c/g%3e%3c/svg%3e", Ae = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M14%201a1%201%200%20011%201v12a1%201%200%2001-1%201H2a1%201%200%2001-1-1V2a1%201%200%20011-1h12zm0%201H2v12h12V2z'%20fill-rule='nonzero'/%3e%3cpath%20fill-rule='nonzero'%20d='M4%2011h8v1H4zm0-3h4v1H4zm0-3h2v1H4z'/%3e%3cpath%20d='M9%205h1v4H9z'/%3e%3cpath%20d='M7%205h5v1H7z'/%3e%3c/g%3e%3c/svg%3e", Re = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%202v6a3%203%200%20106%200V2h1v6a4%204%200%2011-8%200V2h1zM4%2013h8v1H4z'%20fill='%233D4757'/%3e%3c/svg%3e", Be = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%202.763v7.544l-4.29-3.73zM13%2014v-3a4%204%200%2000-4-4H6V6h3a5%205%200%20015%205v3h-1z'%20fill='%233D4757'/%3e%3c/svg%3e", $e = [
1015
+ const fe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm0-3h12v1H2v-1zm0-3h12v1H2V7zm0-6h12v1H2V1zm0%203h12v1H2V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", xe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.131%206.9c2.035%200%202.569-.9%202.569-1.869%200-.968-.64-1.831-2.623-1.831H5.2v3.7h2.931zm.524%205.9c2.045%200%202.545-1.305%202.545-2.3%200-.985-.506-2.4-2.81-2.4H5.2v4.7h3.455zM4%202h4.71c2.367%200%203.19%201.583%203.19%203s-.325%201.852-1.1%202.5c1.2.5%201.569%201.379%201.6%203%20.03%201.606-.586%203.5-3.769%203.5H4V2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", we = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm2-3h8v1H4v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm2%203h8v1H4V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", be = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_01开始_x2F_任务列表-16px'%3e%3cpath%20id='合并形状'%20class='st0'%20d='M10.1%202H2v11h11V8.7l1-1V13c0%20.6-.4%201-1%201H2c-.6%200-1-.4-1-1V2c0-.6.4-1%201-1h9.1l-1%201z'/%3e%3cpath%20id='路径'%20class='st0'%20d='M7.7%208.5l5.7-5.8.9.8-6.1%205.9-.5.5-3.9-3.4.8-.7z'/%3e%3c/g%3e%3c/svg%3e", Me = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.997%203.429L6.398%208h3.2L7.997%203.429zM8.497%202L12%2012h-1L9.949%209h-3.9L5%2012H4L7.496%202h1z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", ye = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M7.5%2014.154a5.654%205.654%200%20100-11.308%205.654%205.654%200%20000%2011.308zm0%20.846a6.5%206.5%200%20110-13%206.5%206.5%200%20010%2013z'%20fill-rule='nonzero'/%3e%3cpath%20d='M8%208h4v1H7V4h1v4z'/%3e%3c/g%3e%3c/svg%3e", ke = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M8.213%2013H6.8l6.636-6.636-4.243-4.243-7.07%207.071L5.928%2013H4.515L1.06%209.546a.5.5%200%20010-.707L8.839%201.06a.5.5%200%2001.707%200l4.95%204.95a.5.5%200%20010%20.707L8.213%2013z'%20fill-rule='nonzero'/%3e%3cpath%20d='M4.536%206.364l4.95%204.95-.707.707-4.95-4.95zM4.521%2013h10.03v1H5.496z'/%3e%3c/g%3e%3c/svg%3e", Te = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M13.31%205h-1.92a2.203%202.203%200%2000-.39-.034c-.135%200-.27.012-.402.034H10v.18c-.578.256-1%20.714-1%201.214v1.928c0%20.196.117.43.3.658v1.23a3.543%203.543%200%2001-.3-.4V11H8V1h1v4.265C9%204.763%2010%204%2010.942%204c1.19%200%201.92.422%202.367%201zM2%206c-.03-.498-.175-2%202.5-2C7.11%204%207%205%207%206.902V11H5.984v-.993c.38.662-.115.993-1.484.993C2.708%2011%202%209.931%202%209c0-1.428.447-2%202.5-2h1.484c0-1%20.031-2-1.484-2-1.533%200-1.577.485-1.577%201H2zm2.5%202C3.601%208%203%207.768%203%209c0%201.31.438%201%201.5%201%20.617%200%201.484-.665%201.484-1.847V8H4.5z'/%3e%3cpath%20d='M13.085%206.316l-2.814%203a1%201%200%20101.458%201.368l2.815-3a1%201%200%2000-1.459-1.368z'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e", Ee = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='rotate(45%205.5%2013.328)'%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M7%206H6V3.515a2.5%202.5%200%2010-5%200V6H0V3.515a3.5%203.5%200%20117%200V6zm0%204v2.5a3.5%203.5%200%2001-7%200V10h1v2.5a2.5%202.5%200%20105%200V10h1z'%20fill-rule='nonzero'/%3e%3crect%20x='3.062'%20y='5.209'%20width='1'%20height='5.5'%20rx='.5'/%3e%3c/g%3e%3c/svg%3e", De = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_插入图片-16px-'%3e%3cg%20id='Group-19'%20transform='translate(1%201)'%3e%3cpath%20id='Combined-Shape'%20class='st0'%20d='M1%200h12c.6%200%201%20.4%201%201v11c0%20.6-.4%201-1%201H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1zm0%201v11h12V1H1z'/%3e%3ccircle%20id='椭圆形'%20class='st0'%20cx='10'%20cy='4'%20r='1'/%3e%3cpath%20id='Path'%20class='st0'%20d='M8.5%2011.2l-4-4.1L1%2010.7V9.2c1.7-1.6%202.7-2.5%203-2.8.4-.5.7-.4%201%200L8.5%2010%2011%207.3c.4-.5.6-.5%201-.1l2%202.8v1.5l-2.5-3.4-3%203.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", _e = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.017%203L8.08%2013H9v1H6v-1h1.182L9%203H8V2h3v1h-.983z'%20fill='%233D4757'/%3e%3c/svg%3e", Se = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20stroke='%233D4757'%20fill='%233D4757'%20d='M2%2010.5H14M2%2013.5H14'%20stroke-linecap='round'%20stroke-linejoin='miter'%3e%3c/path%3e%3cpath%20stroke='%233D4757'%20fill='%233D4757'%20d='M14%203.5L12%201.5M14%203.5L12%205.5M14%203.5L2%203.5M4%201.5L2%203.5M2%203.5L4%205.5'%20stroke-linecap='round'%20stroke-linejoin='miter'%3e%3c/path%3e%3c/svg%3e", Le = "data:image/svg+xml,%3csvg%20height='16'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2zm0-3h8v1H2zm0-3h12v1H2zm0-6h12v1H2zm0%203h8v1H2z'%20fill='%233d4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", He = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M7%2012h7v1H7zm0-5h7v1H7zm0-5h7v1H7zM3%204V2H2V1h2v3h1v1H2V4h1z'/%3e%3cpath%20d='M2%206h3v1H2V6zm0%203h3v1H2V9z'%20fill='%234F4F4F'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M4.5%206L5%207l-2.5%203L2%209z'/%3e%3cpath%20d='M4%2014l-1-2H2v-1h3v1H4l1%202v1H2v-1h2z'%20fill='%233D4757'/%3e%3c/g%3e%3c/svg%3e", ze = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:none;stroke:%233d4757}.st1{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_02插入_x2F_分页-16px'%3e%3cpath%20id='矩形'%20class='st0'%20d='M5.5%202.5h7c.6%200%201%20.4%201%201v3c0%20.6-.4%201-1%201h-7c-.6%200-1-.4-1-1v-3c0-.6.4-1%201-1z'/%3e%3cpath%20id='三角形'%20class='st1'%20d='M4%208.5L1%206v5z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M10.8%209.5H5c-.3%200-.5.2-.5.5v4c0%20.3.2.5.5.5h8c.3%200%20.5-.2.5-.5v-1.8l-2.7-2.7z'/%3e%3cpath%20id='矩形_1_'%20class='st1'%20d='M10%2010h1v3h-1z'/%3e%3cpath%20id='矩形-copy-2'%20class='st1'%20d='M10%2012h3v1h-3z'/%3e%3c/g%3e%3c/svg%3e", X = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.5%202v2.5H4a.5.5%200%2000-.5.5v2a.5.5%200%2000.5.5h9a.5.5%200%2000.5-.5V5a.5.5%200%2000-.5-.5H9.5V2a.5.5%200%2000-.5-.5H8a.5.5%200%2000-.5.5z'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M13%207h1v4h-1z'/%3e%3cpath%20d='M11%2013a2%202%200%20002-2V8.764A3%203%200%20118.764%2013H11z'%20fill='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M1%2013h10v1H1z'/%3e%3cpath%20d='M1%2013a2%202%200%20002-2V8.764A3%203%200%20011%2014v-1z'%20fill='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M3%207h1v4H3z'/%3e%3c/g%3e%3c/svg%3e", Ce = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M10%201l4%204v9a1%201%200%2001-1%201H3a1%201%200%2001-1-1V2a1%201%200%20011-1h7zm-.414%201H3v12h10V5.414L9.586%202z'/%3e%3cpath%20d='M9%201h1v4h4v1H9z'/%3e%3cpath%20d='M8%207h1v4.293l1.646-1.647.708.708L8.5%2013.207l-2.854-2.853.708-.708L8%2011.293z'%20transform='translate(-.5)'/%3e%3c/g%3e%3c/svg%3e", Ie = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M12%204h-1V2H5v2H4V2a1%201%200%20011-1h6a1%201%200%20011%201v2zm0%205v4a1%201%200%2001-1%201H5a1%201%200%2001-1-1V9h1v4h6V9h1z'/%3e%3cpath%20d='M12%2012v-1h2V5H2v6h2v1H2a1%201%200%2001-1-1V5a1%201%200%20011-1h12a1%201%200%20011%201v6a1%201%200%2001-1%201h-2z'/%3e%3cpath%20d='M3%208h10v1H3zm8-2h2v1h-2z'/%3e%3c/g%3e%3c/svg%3e", Ve = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%2014v-3a4%204%200%20014-4h3V6H7a5%205%200%2000-5%205v3h1zm7.016-11.282v7.543l4.29-3.73z'%20fill='%233D4757'/%3e%3c/svg%3e", Re = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm4-3h8v1H6v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm4%203h8v1H6V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", Fe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2014h12v1H2v-1zm7-5h5v1H9V9zm0-3h5v1H9V6zM2%201h12v1H2V1zm2.5%203L7%207H2zm0%208L7%209H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e", Oe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20stroke='%233D4757'%20cx='6'%20cy='6'%20r='4.5'/%3e%3cpath%20d='M10.061%2010.968L8.707%209.414l.707-.707%201.514%201.457.435-.404%202.632%202.462a1.154%201.154%200%2001.05%201.635%201.184%201.184%200%2001-1.655.064l-2.788-2.527.46-.426z'%20fill='%233D4757'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e", Ae = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9%202.8l2.01%202.506c.2.25.58.25.78%200L8.7%202.799l2.01%202.507c.2.25.58.25.78%200l2.4-2.993-.78-.626-2.01%202.507-2.01-2.507a.5.5%200%2000-.78%200L6.3%204.194%204.29%201.687a.5.5%200%2000-.78%200l-2.4%203%20.78.625L3.9%202.8zM1%208h13v1H1zm0%204h3v1H1zm5%200h3v1H6zm5%200h3v1h-3z'%20fill='%233D4757'/%3e%3c/svg%3e", Be = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6.215%203.29H7.64L11.855%2014H10.52l-1.14-3H4.46l-1.14%203H2L6.215%203.29zM4.85%209.965h4.14L6.965%204.61h-.06L4.85%209.965z'/%3e%3cpath%20d='M12%204V2h1v2h2v1h-2v2h-1V5h-2V4h2z'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e", Ne = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20fill-rule='nonzero'%20d='M11%204h4v1h-4z'/%3e%3cpath%20d='M6.215%203.29H7.64L11.855%2014H10.52l-1.14-3H4.46l-1.14%203H2L6.215%203.29zM4.85%209.965h4.14L6.965%204.61h-.06L4.85%209.965z'/%3e%3c/g%3e%3c/svg%3e", $e = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M10.42%207.903H6.692a9.182%209.182%200%2001-.41-.172%205.54%205.54%200%2001-.814-.447%202.955%202.955%200%2001-.655-.595%202.728%202.728%200%2001-.44-.777%202.877%202.877%200%2001-.162-1.006c0-.472.094-.888.282-1.25.188-.36.453-.663.793-.907s.747-.43%201.22-.558A5.97%205.97%200%20018.063%202c.504%200%20.95.049%201.337.147.387.097.725.23%201.013.398.287.169.53.365.73.59a3.337%203.337%200%2001.772%201.486c.03.13.054.255.073.379h-1.276a2.393%202.393%200%2000-.22-.615%202.315%202.315%200%2000-.59-.724%202.467%202.467%200%2000-.834-.44%203.376%203.376%200%2000-1.005-.146%204.69%204.69%200%2000-.958.097%202.77%202.77%200%2000-.839.314%201.765%201.765%200%2000-.597.566c-.152.233-.229.518-.229.854%200%20.348.086.642.258.884.171.241.401.449.689.622.287.174.615.323.983.448s.749.247%201.142.367c.31.097.62.196.934.297a8.439%208.439%200%2001.973.38zm1.376%201c.175.217.315.466.418.746.105.285.158.612.158.98%200%20.554-.104%201.041-.312%201.462-.207.42-.496.772-.867%201.054-.37.282-.81.495-1.32.64A6.12%206.12%200%20018.205%2014c-.543%200-1.071-.09-1.586-.273a4.44%204.44%200%2001-1.374-.773%203.873%203.873%200%2001-.97-1.217%203.695%203.695%200%2001-.395-1.612h1.27c.028.407.122.78.282%201.12a2.835%202.835%200%20001.581%201.465c.363.138.76.207%201.192.207.387%200%20.758-.042%201.112-.126a2.85%202.85%200%2000.938-.399%202.01%202.01%200%2000.647-.708c.16-.29.241-.642.241-1.054%200-.337-.087-.623-.261-.86a2.333%202.333%200%2000-.69-.61%204.651%204.651%200%2000-.495-.257h2.099z'/%3e%3cpath%20d='M3%207h10v1H3z'/%3e%3c/g%3e%3c/svg%3e", Pe = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_subscript'%3e%3cpath%20id='_x32_'%20class='st0'%20d='M15%2013.3v.7h-3c0-.3.1-.5.3-.8.2-.2.5-.6%201-1%20.4-.3.6-.5.7-.7.1-.2.2-.3.2-.5s-.1-.3-.2-.4c-.1-.1-.2-.1-.4-.1s-.3%200-.4.1-.2.4-.2.7l-.9-.1c.1-.4.2-.7.5-.9.3-.2.6-.3%201-.3s.8.1%201%20.3c.3.2.4.5.4.8%200%20.2%200%20.4-.1.5-.1.2-.2.3-.3.5-.1.1-.3.3-.6.5s-.4.4-.5.4c-.1.1-.1.2-.2.3H15z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M7.2%208.5l4%205.5H9.8L6.5%209.4%203.2%2014H1.8l4-5.5-4-5.5h1.4l3.3%204.6L9.8%203h1.3L7.2%208.5z'/%3e%3c/g%3e%3c/svg%3e", Ue = "data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_superscript'%3e%3cpath%20id='_x32_'%20class='st0'%20d='M15%206.3V7h-3c0-.3.1-.5.3-.8.2-.2.5-.6%201-1%20.3-.2.6-.5.7-.6.1-.2.2-.3.2-.5s-.1-.3-.2-.4c-.1-.1-.2-.1-.4-.1s-.3%200-.4.1-.2.3-.2.6l-.9-.1c.1-.4.2-.7.5-.9s.6-.3%201-.3.8.1%201%20.3c.3.2.4.5.4.8%200%20.2%200%20.4-.1.5s-.2.4-.4.5c-.1.1-.3.3-.6.5s-.4.4-.4.5c-.1.1-.1.2-.2.3l1.7-.1z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M7.4%208.5l4%205.5H10L6.7%209.4%203.4%2014H2l4-5.5L2%203h1.4l3.3%204.6L10%203h1.3L7.4%208.5z'/%3e%3c/g%3e%3c/svg%3e", Ge = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3crect%20x='.5'%20y='.5'%20width='12'%20height='12'%20rx='1'%20transform='translate(1%201)'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M2%209h12v1H2zm0-4h12v1H2z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M5%201h1v13H5zm4%200h1v13H9z'/%3e%3c/g%3e%3c/svg%3e", Xe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M14%201a1%201%200%20011%201v12a1%201%200%2001-1%201H2a1%201%200%2001-1-1V2a1%201%200%20011-1h12zm0%201H2v12h12V2z'%20fill-rule='nonzero'/%3e%3cpath%20fill-rule='nonzero'%20d='M4%2011h8v1H4zm0-3h4v1H4zm0-3h2v1H4z'/%3e%3cpath%20d='M9%205h1v4H9z'/%3e%3cpath%20d='M7%205h5v1H7z'/%3e%3c/g%3e%3c/svg%3e", qe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%202v6a3%203%200%20106%200V2h1v6a4%204%200%2011-8%200V2h1zM4%2013h8v1H4z'%20fill='%233D4757'/%3e%3c/svg%3e", Ye = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%202.763v7.544l-4.29-3.73zM13%2014v-3a4%204%200%2000-4-4H6V6h3a5%205%200%20015%205v3h-1z'%20fill='%233D4757'/%3e%3c/svg%3e", Ke = [
421
1016
  "Microsoft YaHei",
422
1017
  "宋体",
423
1018
  "黑体",
@@ -432,11 +1027,11 @@ const oe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%20
432
1027
  "Arial",
433
1028
  "Segoe UI",
434
1029
  "Times New Roman"
435
- ].map((a) => ({
436
- label: a === "Microsoft YaHei" ? "微软雅黑" : a,
437
- value: a,
438
- style: `font-family:'${a}'`
439
- })), Ne = [
1030
+ ].map((s) => ({
1031
+ label: s === "Microsoft YaHei" ? "微软雅黑" : s,
1032
+ value: s,
1033
+ style: `font-family:'${s}'`
1034
+ })), je = [
440
1035
  ["初号", 56],
441
1036
  ["小初", 48],
442
1037
  ["一号", 34],
@@ -453,7 +1048,7 @@ const oe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%20
453
1048
  ["小六", 8],
454
1049
  ["七号", 7],
455
1050
  ["八号", 6]
456
- ].map(([a, n]) => ({ label: String(a), value: String(n) })), Oe = ["1", "1.25", "1.5", "1.75", "2", "2.5", "3"], $ = [
1051
+ ].map(([s, t]) => ({ label: String(s), value: String(t) })), Je = ["1", "1.25", "1.5", "1.75", "2", "2.5", "3"], q = [
457
1052
  { label: "———— 实线", dashArray: [] },
458
1053
  { label: "··········· 点线", dashArray: [1, 1] },
459
1054
  { label: "- - - - - 短虚线", dashArray: [3, 1] },
@@ -461,472 +1056,417 @@ const oe = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%20
461
1056
  { label: "—·—·— 点划线", dashArray: [7, 3, 3, 3] },
462
1057
  { label: "—··—·· 双点划线", dashArray: [6, 2, 2, 2, 2, 2] }
463
1058
  ];
464
- function v(a, n, s, e, t = {}) {
465
- return { key: a, title: n, icon: s, onClick: e, ...t };
1059
+ function v(s, t, o, e, n = {}) {
1060
+ return { key: s, title: t, icon: o, onClick: e, ...n };
466
1061
  }
467
- function N(a, n, s, e, t, i) {
1062
+ function Y(s, t, o, e, n, i) {
468
1063
  return {
469
- key: a,
470
- title: n,
471
- render: (o) => {
472
- const r = c("span", { class: l("select__label") }), d = c(
1064
+ key: s,
1065
+ title: t,
1066
+ render: (a) => {
1067
+ const r = l("span", { class: c("select__label") }), h = l(
473
1068
  "div",
474
- { class: l("select"), title: n, style: `width:${e}px` },
1069
+ { class: c("select"), title: t, style: `width:${e}px` },
475
1070
  r
476
- ), h = w(s, (u) => {
477
- g.close(), t(o, u);
478
- }), g = new I(d, h);
479
- return g.el;
1071
+ ), d = w(o, (g) => {
1072
+ p.close(), n(a, g);
1073
+ }), p = new C(h, d);
1074
+ return p.el;
480
1075
  },
481
- update: (o, r) => {
482
- const d = i(o), h = s.find((g) => g.value === d);
483
- r.querySelector(`.${l("select__label")}`).innerText = h ? h.label : d || "", L(r, d);
1076
+ update: (a, r) => {
1077
+ const h = i(a), d = o.find((p) => p.value === h);
1078
+ r.querySelector(`.${c("select__label")}`).innerText = d ? d.label : h || "", y(r, h);
484
1079
  }
485
1080
  };
486
1081
  }
487
- function z(a, n, s, e, t = {}) {
1082
+ function b(s, t, o, e, n = {}) {
488
1083
  return {
489
- key: a,
490
- title: n,
1084
+ key: s,
1085
+ title: t,
491
1086
  render: (i) => {
492
- const o = c(
1087
+ const a = l(
493
1088
  "div",
494
- { class: `${l("toolbar__button")} ${l("toolbar__button--arrow")}`, title: n },
495
- c("i", { class: l("icon"), style: `background-image:url("${s}")` })
496
- ), r = c("div"), d = new I(o, r);
497
- return o.addEventListener(
1089
+ { class: `${c("toolbar__button")} ${c("toolbar__button--arrow")}`, title: t },
1090
+ l("i", { class: c("icon"), style: `background-image:url("${o}")` })
1091
+ ), r = l("div"), h = new C(a, r);
1092
+ return a.addEventListener(
498
1093
  "click",
499
1094
  () => {
500
- r.innerHTML = "", r.append(e(i, () => d.close()));
1095
+ r.innerHTML = "", r.append(e(i, () => h.close()));
501
1096
  },
502
1097
  !0
503
- ), d.el;
1098
+ ), h.el;
504
1099
  },
505
- ...t
1100
+ ...n
506
1101
  };
507
1102
  }
508
- function O(a, n, s, e, t) {
1103
+ function K(s, t, o, e, n) {
509
1104
  return {
510
- key: a,
511
- title: n,
1105
+ key: s,
1106
+ title: t,
512
1107
  render: (i) => {
513
- const o = c("input", { type: "color", class: l("color__input") });
514
- o.addEventListener("input", () => e(i, o.value));
515
- const r = c("span", { class: l("color__bar") }), d = c(
1108
+ const a = l("input", { type: "color", class: c("color__input") });
1109
+ a.addEventListener("input", () => e(i, a.value));
1110
+ const r = l("span", { class: c("color__bar") }), h = l(
516
1111
  "div",
517
- { class: `${l("toolbar__button")} ${l("color")}`, title: n },
518
- c("i", { class: l("icon"), style: `background-image:url("${s}")` }),
1112
+ { class: `${c("toolbar__button")} ${c("color")}`, title: t },
1113
+ l("i", { class: c("icon"), style: `background-image:url("${o}")` }),
519
1114
  r,
520
- o
1115
+ a
521
1116
  );
522
- return d.addEventListener("click", () => o.click()), d;
1117
+ return h.addEventListener("click", () => a.click()), h;
523
1118
  },
524
- update: (i, o) => {
525
- const r = t(i);
526
- o.querySelector(`.${l("color__bar")}`).style.background = r || "transparent";
1119
+ update: (i, a) => {
1120
+ const r = n(i);
1121
+ a.querySelector(`.${c("color__bar")}`).style.background = r || "transparent";
527
1122
  }
528
1123
  };
529
1124
  }
530
- function Fe(a) {
531
- const n = c("input", { type: "file", accept: "image/*" });
532
- n.addEventListener("change", async () => {
1125
+ function We(s) {
1126
+ const t = l("input", { type: "file", accept: "image/*" });
1127
+ t.addEventListener("change", async () => {
533
1128
  var i;
534
- const s = (i = n.files) == null ? void 0 : i[0];
535
- if (!s) return;
536
- const e = await K(s), t = await W(e);
537
- a.editor.command.executeImage({
1129
+ const o = (i = t.files) == null ? void 0 : i[0];
1130
+ if (!o) return;
1131
+ const e = await oe(o), n = await ne(e);
1132
+ s.editor.command.executeImage({
538
1133
  value: e,
539
- width: t.width,
540
- height: t.height
1134
+ width: n.width,
1135
+ height: n.height
541
1136
  });
542
- }), n.click();
1137
+ }), t.click();
543
1138
  }
544
- function Pe({ editor: a, locale: n }) {
545
- new k({
546
- title: n.hyperlink,
547
- confirmText: n.confirm,
548
- cancelText: n.cancel,
1139
+ function Ze({ editor: s, locale: t }) {
1140
+ new F({
1141
+ title: t.hyperlink,
1142
+ confirmText: t.confirm,
1143
+ cancelText: t.cancel,
549
1144
  fields: [
550
1145
  {
551
1146
  type: "text",
552
1147
  name: "text",
553
- label: n.hyperlinkText,
1148
+ label: t.hyperlinkText,
554
1149
  required: !0,
555
- value: a.command.getRangeText()
1150
+ value: s.command.getRangeText()
556
1151
  },
557
1152
  {
558
1153
  type: "text",
559
1154
  name: "url",
560
- label: n.hyperlinkUrl,
1155
+ label: t.hyperlinkUrl,
561
1156
  required: !0,
562
1157
  placeholder: "https://"
563
1158
  }
564
1159
  ],
565
- onConfirm: ({ text: s, url: e }) => {
566
- a.command.executeHyperlink({
1160
+ onConfirm: ({ text: o, url: e }) => {
1161
+ s.command.executeHyperlink({
567
1162
  url: e,
568
- valueList: X(s).map((t) => ({ value: t }))
569
- });
570
- }
571
- });
572
- }
573
- const F = [
574
- m.SELECT,
575
- m.CHECKBOX,
576
- m.RADIO
577
- ];
578
- function Ue({ editor: a, locale: n }) {
579
- new k({
580
- title: n.control,
581
- confirmText: n.confirm,
582
- cancelText: n.cancel,
583
- fields: [
584
- {
585
- type: "select",
586
- name: "type",
587
- label: n.controlType,
588
- options: [
589
- { label: n.controlText, value: m.TEXT },
590
- { label: n.controlSelect, value: m.SELECT },
591
- { label: n.controlCheckbox, value: m.CHECKBOX },
592
- { label: n.controlRadio, value: m.RADIO },
593
- { label: n.controlDate, value: m.DATE },
594
- { label: n.controlNumber, value: m.NUMBER }
595
- ]
596
- },
597
- {
598
- type: "text",
599
- name: "placeholder",
600
- label: n.controlPlaceholder
601
- },
602
- {
603
- type: "textarea",
604
- name: "valueSets",
605
- label: n.controlValueSets,
606
- placeholder: n.controlValueSetsPlaceholder,
607
- height: 80
608
- },
609
- {
610
- type: "select",
611
- name: "dateFormat",
612
- label: n.controlDateFormat,
613
- options: [
614
- { label: "yyyy-MM-dd", value: "yyyy-MM-dd" },
615
- { label: "yyyy-MM-dd HH:mm:ss", value: "yyyy-MM-dd HH:mm:ss" }
616
- ]
617
- }
618
- ],
619
- onConfirm: (s) => {
620
- const e = s.type, t = s.valueSets.split(`
621
- `).map((o) => o.trim()).filter(Boolean).map((o) => ({ value: o, code: o }));
622
- if (F.includes(e) && !t.length)
623
- return !1;
624
- const i = {
625
- type: e,
626
- value: null,
627
- placeholder: s.placeholder || void 0
628
- };
629
- F.includes(e) && (i.code = null, i.valueSets = t), e === m.DATE && (i.dateFormat = s.dateFormat), a.command.executeInsertControl({
630
- type: D.CONTROL,
631
- value: "",
632
- control: i
1163
+ valueList: Z(o).map((n) => ({ value: n }))
633
1164
  });
634
1165
  }
635
1166
  });
636
1167
  }
637
- function qe({ editor: a, locale: n }) {
638
- new k({
639
- title: n.search,
640
- confirmText: n.confirm,
641
- cancelText: n.cancel,
1168
+ function Qe({ editor: s, locale: t }) {
1169
+ new F({
1170
+ title: t.search,
1171
+ confirmText: t.confirm,
1172
+ cancelText: t.cancel,
642
1173
  fields: [
643
1174
  {
644
1175
  type: "text",
645
1176
  name: "keyword",
646
- label: n.searchKeyword,
1177
+ label: t.searchKeyword,
647
1178
  required: !0,
648
- value: a.command.getRangeText()
1179
+ value: s.command.getRangeText()
649
1180
  },
650
1181
  {
651
1182
  type: "text",
652
1183
  name: "replace",
653
- label: n.searchReplace,
654
- placeholder: n.searchReplacePlaceholder
1184
+ label: t.searchReplace,
1185
+ placeholder: t.searchReplacePlaceholder
655
1186
  }
656
1187
  ],
657
- onConfirm: ({ keyword: s, replace: e }) => {
658
- a.command.executeSearch(s), e && a.command.executeReplace(e);
1188
+ onConfirm: ({ keyword: o, replace: e }) => {
1189
+ s.command.executeSearch(o), e && s.command.executeReplace(e);
659
1190
  },
660
- onClose: () => a.command.executeSearch(null)
1191
+ onClose: () => s.command.executeSearch(null)
661
1192
  });
662
1193
  }
663
- function Xe(a, n) {
664
- const e = c("div", { class: l("table-picker__title") }, a.locale.table), t = c("div", { class: l("table-picker__grid") }), i = [];
665
- for (let o = 1; o <= 10; o++)
1194
+ function et(s, t) {
1195
+ const e = l("div", { class: c("table-picker__title") }, s.locale.table), n = l("div", { class: c("table-picker__grid") }), i = [];
1196
+ for (let a = 1; a <= 10; a++)
666
1197
  for (let r = 1; r <= 10; r++) {
667
- const d = c("span", { "data-row": o, "data-col": r });
668
- i.push(d), t.append(d);
1198
+ const h = l("span", { "data-row": a, "data-col": r });
1199
+ i.push(h), n.append(h);
669
1200
  }
670
- return t.addEventListener("mouseover", (o) => {
671
- const r = o.target, d = Number(r.dataset.row), h = Number(r.dataset.col);
672
- !d || !h || (e.innerText = `${d} × ${h}`, i.forEach((g) => {
673
- g.classList.toggle(
674
- l("active"),
675
- Number(g.dataset.row) <= d && Number(g.dataset.col) <= h
1201
+ return n.addEventListener("mouseover", (a) => {
1202
+ const r = a.target, h = Number(r.dataset.row), d = Number(r.dataset.col);
1203
+ !h || !d || (e.innerText = `${h} × ${d}`, i.forEach((p) => {
1204
+ p.classList.toggle(
1205
+ c("active"),
1206
+ Number(p.dataset.row) <= h && Number(p.dataset.col) <= d
676
1207
  );
677
1208
  }));
678
- }), t.addEventListener("mousedown", (o) => o.preventDefault()), t.addEventListener("click", (o) => {
679
- const r = o.target, d = Number(r.dataset.row), h = Number(r.dataset.col);
680
- !d || !h || (n(), a.editor.command.executeInsertTable(d, h));
681
- }), c("div", { class: l("table-picker") }, e, t);
1209
+ }), n.addEventListener("mousedown", (a) => a.preventDefault()), n.addEventListener("click", (a) => {
1210
+ const r = a.target, h = Number(r.dataset.row), d = Number(r.dataset.col);
1211
+ !h || !d || (t(), s.editor.command.executeInsertTable(h, d));
1212
+ }), l("div", { class: c("table-picker") }, e, n);
682
1213
  }
683
- const Ye = [
684
- ["left", H.LEFT, xe],
685
- ["center", H.CENTER, le],
686
- ["right", H.RIGHT, _e],
687
- ["alignment", H.ALIGNMENT, oe],
688
- ["justify", H.JUSTIFY, fe]
1214
+ const tt = [
1215
+ ["left", x.LEFT, Le],
1216
+ ["center", x.CENTER, we],
1217
+ ["right", x.RIGHT, Re],
1218
+ ["alignment", x.ALIGNMENT, fe],
1219
+ ["justify", x.JUSTIFY, Se]
689
1220
  ];
690
- function je(a) {
691
- const n = [
692
- v("undo", a.undo, Be, ({ editor: e }) => e.command.executeUndo(), {
1221
+ function ot(s) {
1222
+ const t = [
1223
+ v("undo", s.undo, Ye, ({ editor: e }) => e.command.executeUndo(), {
693
1224
  isDisabled: ({ style: e }) => !!e && !e.undo
694
1225
  }),
695
- v("redo", a.redo, Le, ({ editor: e }) => e.command.executeRedo(), {
1226
+ v("redo", s.redo, Ve, ({ editor: e }) => e.command.executeRedo(), {
696
1227
  isDisabled: ({ style: e }) => !!e && !e.redo
697
1228
  }),
698
1229
  {
699
1230
  key: "painter",
700
- title: a.painter,
701
- icon: B,
1231
+ title: s.painter,
1232
+ icon: X,
702
1233
  isActive: ({ style: e }) => !!(e != null && e.painter),
703
1234
  render: ({ editor: e }) => {
704
- const t = c(
1235
+ const n = l(
705
1236
  "div",
706
- { class: l("toolbar__button"), title: a.painter },
707
- c("i", {
708
- class: l("icon"),
709
- style: `background-image:url("${B}")`
1237
+ { class: c("toolbar__button"), title: s.painter },
1238
+ l("i", {
1239
+ class: c("icon"),
1240
+ style: `background-image:url("${X}")`
710
1241
  })
711
1242
  );
712
1243
  let i = null;
713
- return t.addEventListener("click", () => {
1244
+ return n.addEventListener("click", () => {
714
1245
  i && clearTimeout(i), i = setTimeout(() => {
715
1246
  i = null, e.command.executePainter({ isDblclick: !1 });
716
1247
  }, 200);
717
- }), t.addEventListener("dblclick", () => {
1248
+ }), n.addEventListener("dblclick", () => {
718
1249
  i && clearTimeout(i), i = null, e.command.executePainter({ isDblclick: !0 });
719
- }), t;
1250
+ }), n;
720
1251
  }
721
1252
  },
722
1253
  v(
723
1254
  "format",
724
- a.format,
725
- ve,
1255
+ s.format,
1256
+ ke,
726
1257
  ({ editor: e }) => e.command.executeFormat()
727
1258
  ),
728
- N(
1259
+ Y(
729
1260
  "font",
730
- a.font,
731
- $e,
1261
+ s.font,
1262
+ Ke,
732
1263
  90,
733
- ({ editor: e }, t) => e.command.executeFont(t),
734
- ({ editor: e, style: t }) => (t == null ? void 0 : t.font) || e.command.getOptions().defaultFont
1264
+ ({ editor: e }, n) => e.command.executeFont(n),
1265
+ ({ editor: e, style: n }) => (n == null ? void 0 : n.font) || e.command.getOptions().defaultFont
735
1266
  ),
736
- N(
1267
+ Y(
737
1268
  "size",
738
- a.size,
739
- Ne,
1269
+ s.size,
1270
+ je,
740
1271
  54,
741
- ({ editor: e }, t) => e.command.executeSize(Number(t)),
742
- ({ editor: e, style: t }) => String(t ? t.size : e.command.getOptions().defaultSize)
1272
+ ({ editor: e }, n) => e.command.executeSize(Number(n)),
1273
+ ({ editor: e, style: n }) => String(n ? n.size : e.command.getOptions().defaultSize)
743
1274
  ),
744
1275
  v(
745
1276
  "sizeAdd",
746
- a.sizeAdd,
747
- Te,
1277
+ s.sizeAdd,
1278
+ Be,
748
1279
  ({ editor: e }) => e.command.executeSizeAdd()
749
1280
  ),
750
1281
  v(
751
1282
  "sizeMinus",
752
- a.sizeMinus,
753
- Ie,
1283
+ s.sizeMinus,
1284
+ Ne,
754
1285
  ({ editor: e }) => e.command.executeSizeMinus()
755
1286
  ),
756
- v("bold", a.bold, ce, ({ editor: e }) => e.command.executeBold(), {
1287
+ v("bold", s.bold, xe, ({ editor: e }) => e.command.executeBold(), {
757
1288
  isActive: ({ style: e }) => !!(e != null && e.bold)
758
1289
  }),
759
- v("italic", a.italic, we, ({ editor: e }) => e.command.executeItalic(), {
1290
+ v("italic", s.italic, _e, ({ editor: e }) => e.command.executeItalic(), {
760
1291
  isActive: ({ style: e }) => !!(e != null && e.italic)
761
1292
  }),
762
- v("underline", a.underline, Re, ({ editor: e }) => e.command.executeUnderline(), {
1293
+ v("underline", s.underline, qe, ({ editor: e }) => e.command.executeUnderline(), {
763
1294
  isActive: ({ style: e }) => !!(e != null && e.underline)
764
1295
  }),
765
- v("strikeout", a.strikeout, ke, ({ editor: e }) => e.command.executeStrikeout(), {
1296
+ v("strikeout", s.strikeout, $e, ({ editor: e }) => e.command.executeStrikeout(), {
766
1297
  isActive: ({ style: e }) => !!(e != null && e.strikeout)
767
1298
  }),
768
- v("superscript", a.superscript, Ce, ({ editor: e }) => e.command.executeSuperscript(), {
769
- isActive: ({ style: e }) => (e == null ? void 0 : e.type) === D.SUPERSCRIPT
1299
+ v("superscript", s.superscript, Ue, ({ editor: e }) => e.command.executeSuperscript(), {
1300
+ isActive: ({ style: e }) => (e == null ? void 0 : e.type) === H.SUPERSCRIPT
770
1301
  }),
771
- v("subscript", a.subscript, Se, ({ editor: e }) => e.command.executeSubscript(), {
772
- isActive: ({ style: e }) => (e == null ? void 0 : e.type) === D.SUBSCRIPT
1302
+ v("subscript", s.subscript, Pe, ({ editor: e }) => e.command.executeSubscript(), {
1303
+ isActive: ({ style: e }) => (e == null ? void 0 : e.type) === H.SUBSCRIPT
773
1304
  }),
774
- O(
1305
+ K(
775
1306
  "color",
776
- a.color,
777
- de,
778
- ({ editor: e }, t) => e.command.executeColor(t),
1307
+ s.color,
1308
+ Me,
1309
+ ({ editor: e }, n) => e.command.executeColor(n),
779
1310
  ({ style: e }) => (e == null ? void 0 : e.color) || "#000000"
780
1311
  ),
781
- O(
1312
+ K(
782
1313
  "highlight",
783
- a.highlight,
784
- ue,
785
- ({ editor: e }, t) => e.command.executeHighlight(t),
1314
+ s.highlight,
1315
+ Te,
1316
+ ({ editor: e }, n) => e.command.executeHighlight(n),
786
1317
  ({ style: e }) => (e == null ? void 0 : e.highlight) || null
787
1318
  ),
788
- z("title", a.title, Ae, ({ editor: e, style: t }, i) => {
789
- const o = [
790
- b.FIRST,
791
- b.SECOND,
792
- b.THIRD,
793
- b.FOURTH,
794
- b.FIFTH,
795
- b.SIXTH
1319
+ b("title", s.title, Xe, ({ editor: e, style: n }, i) => {
1320
+ const a = [
1321
+ k.FIRST,
1322
+ k.SECOND,
1323
+ k.THIRD,
1324
+ k.FOURTH,
1325
+ k.FIFTH,
1326
+ k.SIXTH
796
1327
  ], r = [
797
- { label: a.text, value: "" },
798
- ...o.map((h, g) => ({
799
- label: `${a.title}${g + 1}`,
800
- value: h,
801
- style: `font-size:${26 - g * 2}px;font-weight:bold`
1328
+ { label: s.text, value: "" },
1329
+ ...a.map((d, p) => ({
1330
+ label: `${s.title}${p + 1}`,
1331
+ value: d,
1332
+ style: `font-size:${26 - p * 2}px;font-weight:bold`
802
1333
  }))
803
- ], d = w(r, (h) => {
804
- i(), e.command.executeTitle(h || null);
1334
+ ], h = w(r, (d) => {
1335
+ i(), e.command.executeTitle(d || null);
805
1336
  });
806
- return L(d, (t == null ? void 0 : t.level) || ""), d;
1337
+ return y(h, (n == null ? void 0 : n.level) || ""), h;
807
1338
  }),
808
- ...Ye.map(
809
- ([e, t, i]) => v(e, a[e], i, ({ editor: o }) => o.command.executeRowFlex(t), {
810
- isActive: ({ style: o }) => ((o == null ? void 0 : o.rowFlex) || H.LEFT) === t
1339
+ ...tt.map(
1340
+ ([e, n, i]) => v(e, s[e], i, ({ editor: a }) => a.command.executeRowFlex(n), {
1341
+ isActive: ({ style: a }) => ((a == null ? void 0 : a.rowFlex) || x.LEFT) === n
811
1342
  })
812
1343
  ),
813
- z(
1344
+ b(
814
1345
  "rowMargin",
815
- a.rowMargin,
816
- ye,
817
- ({ editor: e, style: t }, i) => {
818
- const o = w(
819
- Oe.map((r) => ({ label: r, value: r })),
1346
+ s.rowMargin,
1347
+ Fe,
1348
+ ({ editor: e, style: n }, i) => {
1349
+ const a = w(
1350
+ Je.map((r) => ({ label: r, value: r })),
820
1351
  (r) => {
821
1352
  i(), e.command.executeRowMargin(Number(r));
822
1353
  }
823
1354
  );
824
- return L(o, t ? String(t.rowMargin) : null), o;
1355
+ return y(a, n ? String(n.rowMargin) : null), a;
825
1356
  }
826
1357
  ),
827
- z(
1358
+ b(
828
1359
  "list",
829
- a.list,
830
- be,
831
- ({ editor: e, style: t }, i) => {
832
- const o = [
833
- { label: a.listDecimal, value: `${_.OL}|${y.DECIMAL}` },
834
- { label: a.listCheckbox, value: `${_.UL}|${y.CHECKBOX}` },
835
- { label: a.listDisc, value: `${_.UL}|${y.DISC}` },
836
- { label: a.listCircle, value: `${_.UL}|${y.CIRCLE}` },
837
- { label: a.listSquare, value: `${_.UL}|${y.SQUARE}` }
838
- ], r = w(o, (d) => {
1360
+ s.list,
1361
+ He,
1362
+ ({ editor: e, style: n }, i) => {
1363
+ const a = [
1364
+ { label: s.listDecimal, value: `${S.OL}|${L.DECIMAL}` },
1365
+ { label: s.listCheckbox, value: `${S.UL}|${L.CHECKBOX}` },
1366
+ { label: s.listDisc, value: `${S.UL}|${L.DISC}` },
1367
+ { label: s.listCircle, value: `${S.UL}|${L.CIRCLE}` },
1368
+ { label: s.listSquare, value: `${S.UL}|${L.SQUARE}` }
1369
+ ], r = w(a, (h) => {
839
1370
  i();
840
- const [h, g] = d.split("|");
841
- e.command.executeList(h, g);
1371
+ const [d, p] = h.split("|");
1372
+ e.command.executeList(d, p);
842
1373
  });
843
- return L(
1374
+ return y(
844
1375
  r,
845
- t != null && t.listType ? `${t.listType}|${t.listStyle}` : null
1376
+ n != null && n.listType ? `${n.listType}|${n.listStyle}` : null
846
1377
  ), r;
847
1378
  },
848
1379
  { isActive: ({ style: e }) => !!(e != null && e.listType) }
849
1380
  ),
850
- z("table", a.table, Ve, Xe),
851
- v("image", a.image, pe, Fe),
852
- v("hyperlink", a.hyperlink, me, Pe),
853
- z(
1381
+ b("table", s.table, Ge, et),
1382
+ v("image", s.image, De, We),
1383
+ v("hyperlink", s.hyperlink, Ee, Ze),
1384
+ b(
854
1385
  "separator",
855
- a.separator,
856
- Ee,
857
- ({ editor: e }, t) => w(
858
- $.map((i, o) => ({
1386
+ s.separator,
1387
+ Ae,
1388
+ ({ editor: e }, n) => w(
1389
+ q.map((i, a) => ({
859
1390
  label: i.label,
860
- value: String(o)
1391
+ value: String(a)
861
1392
  })),
862
1393
  (i) => {
863
- t(), e.command.executeSeparator(
864
- $[Number(i)].dashArray
1394
+ n(), e.command.executeSeparator(
1395
+ q[Number(i)].dashArray
865
1396
  );
866
1397
  }
867
1398
  )
868
1399
  ),
869
1400
  v(
870
1401
  "pageBreak",
871
- a.pageBreak,
872
- Me,
1402
+ s.pageBreak,
1403
+ ze,
873
1404
  ({ editor: e }) => e.command.executePageBreak()
874
1405
  ),
875
- v("control", a.control, he, Ue),
876
- v(
877
- "checkbox",
878
- a.checkbox,
879
- re,
880
- ({ editor: e }) => e.command.executeInsertElementList([
881
- { type: D.CHECKBOX, value: "", checkbox: { value: !1 } }
882
- ])
883
- ),
884
- z("date", a.date, ge, ({ editor: e }, t) => {
885
- const i = /* @__PURE__ */ new Date(), o = [
886
- { format: "yyyy-MM-dd", text: V(i, !1) },
887
- { format: "yyyy-MM-dd HH:mm:ss", text: V(i, !0) }
1406
+ b("checkbox", s.checkbox, be, ({ editor: e }, n) => {
1407
+ const i = w(
1408
+ [
1409
+ { label: `☒ ${s.checkboxCross}`, value: E.CROSS },
1410
+ { label: `☑ ${s.checkboxCheck}`, value: E.CHECK }
1411
+ ],
1412
+ (a) => {
1413
+ n(), e.command.executeInsertElementList([
1414
+ {
1415
+ type: H.CHECKBOX,
1416
+ value: "",
1417
+ checkbox: { value: !1, markType: a }
1418
+ }
1419
+ ]);
1420
+ }
1421
+ );
1422
+ return y(i, E.CROSS), i;
1423
+ }),
1424
+ b("date", s.date, ye, ({ editor: e }, n) => {
1425
+ const i = /* @__PURE__ */ new Date(), a = [
1426
+ { format: "yyyy-MM-dd", text: N(i, !1) },
1427
+ { format: "yyyy-MM-dd HH:mm:ss", text: N(i, !0) }
888
1428
  ];
889
1429
  return w(
890
- o.map((r, d) => ({
1430
+ a.map((r, h) => ({
891
1431
  label: r.text,
892
- value: String(d)
1432
+ value: String(h)
893
1433
  })),
894
1434
  (r) => {
895
- t();
896
- const { format: d, text: h } = o[Number(r)];
1435
+ n();
1436
+ const { format: h, text: d } = a[Number(r)];
897
1437
  e.command.executeInsertElementList([
898
1438
  {
899
- type: D.DATE,
1439
+ type: H.DATE,
900
1440
  value: "",
901
- dateFormat: d,
902
- valueList: [{ value: h }]
1441
+ dateFormat: h,
1442
+ valueList: [{ value: d }]
903
1443
  }
904
1444
  ]);
905
1445
  }
906
1446
  );
907
1447
  }),
908
- v("search", a.search, De, qe, {
1448
+ v("search", s.search, Oe, Qe, {
909
1449
  keepEnabledInReadonly: !0
910
1450
  }),
911
- v("print", a.print, He, ({ editor: e }) => e.command.executePrint(), {
1451
+ v("print", s.print, Ie, ({ editor: e }) => e.command.executePrint(), {
912
1452
  keepEnabledInReadonly: !0
913
1453
  }),
914
1454
  v(
915
1455
  "pdf",
916
- a.pdf,
917
- ze,
1456
+ s.pdf,
1457
+ Ce,
918
1458
  async ({ editor: e }) => {
919
- const t = await e.command.getPdf();
920
- Z(t, `document-${Date.now()}.pdf`);
1459
+ const n = await e.command.getPdf();
1460
+ ie(n, `document-${Date.now()}.pdf`);
921
1461
  },
922
1462
  { keepEnabledInReadonly: !0 }
923
1463
  )
924
- ], s = {};
925
- return n.forEach((e) => {
926
- s[e.key] = e;
927
- }), s;
1464
+ ], o = {};
1465
+ return t.forEach((e) => {
1466
+ o[e.key] = e;
1467
+ }), o;
928
1468
  }
929
- const U = [
1469
+ const J = [
930
1470
  "undo",
931
1471
  "redo",
932
1472
  "painter",
@@ -963,15 +1503,15 @@ const U = [
963
1503
  "date",
964
1504
  "|",
965
1505
  "search"
966
- ], Ge = [p.READONLY, p.PRINT];
967
- class Ke {
968
- constructor(n, s = U) {
969
- this.style = null, this.renderedList = [], this.ui = n, this.el = c("div", { class: l("toolbar") }), this.el.setAttribute(E, T.MENU), this.el.addEventListener("mousedown", (e) => {
970
- const t = e.target.tagName;
971
- t !== "INPUT" && t !== "SELECT" && t !== "TEXTAREA" && e.preventDefault();
972
- }), this.render(s), this.rangeStyleChange = (e) => {
1506
+ ], nt = [m.READONLY, m.PRINT];
1507
+ class it {
1508
+ constructor(t, o = J) {
1509
+ this.style = null, this.renderedList = [], this.ui = t, this.el = l("div", { class: c("toolbar") }), this.el.setAttribute(D, _.MENU), this.el.addEventListener("mousedown", (e) => {
1510
+ const n = e.target.tagName;
1511
+ n !== "INPUT" && n !== "SELECT" && n !== "TEXTAREA" && e.preventDefault();
1512
+ }), this.render(o), this.rangeStyleChange = (e) => {
973
1513
  this.style = e, this.update();
974
- }, n.editor.eventBus.on("rangeStyleChange", this.rangeStyleChange), this.update();
1514
+ }, t.editor.eventBus.on("rangeStyleChange", this.rangeStyleChange), this.update();
975
1515
  }
976
1516
  getContext() {
977
1517
  return {
@@ -981,93 +1521,118 @@ class Ke {
981
1521
  style: this.style
982
1522
  };
983
1523
  }
984
- render(n) {
985
- const s = je(this.ui.locale), e = this.getContext();
986
- n.forEach((t) => {
987
- if (t === "|") {
988
- this.el.append(c("span", { class: l("toolbar__divider") }));
1524
+ render(t) {
1525
+ const o = ot(this.ui.locale), e = this.getContext();
1526
+ t.forEach((n) => {
1527
+ if (n === "|") {
1528
+ this.el.append(l("span", { class: c("toolbar__divider") }));
989
1529
  return;
990
1530
  }
991
- const i = typeof t == "string" ? s[t] : t;
1531
+ const i = typeof n == "string" ? o[n] : n;
992
1532
  if (!i) {
993
- console.warn(`[canvas-editor-ui] unknown toolbar item: ${t}`);
1533
+ console.warn(`[canvas-editor-ui] unknown toolbar item: ${n}`);
994
1534
  return;
995
1535
  }
996
- const o = i.render ? i.render(e) : this.renderButton(i);
997
- o.classList.add(l("toolbar__item")), o.dataset.key = i.key, this.el.append(o), this.renderedList.push({ item: i, el: o });
1536
+ const a = i.render ? i.render(e) : this.renderButton(i);
1537
+ a.classList.add(c("toolbar__item")), a.dataset.key = i.key, this.el.append(a), this.renderedList.push({ item: i, el: a });
998
1538
  });
999
1539
  }
1000
- renderButton(n) {
1001
- const s = c(
1540
+ renderButton(t) {
1541
+ const o = l(
1002
1542
  "div",
1003
- { class: l("toolbar__button"), title: n.title },
1004
- n.icon ? c("i", {
1005
- class: l("icon"),
1006
- style: `background-image:url("${n.icon}")`
1543
+ { class: c("toolbar__button"), title: t.title },
1544
+ t.icon ? l("i", {
1545
+ class: c("icon"),
1546
+ style: `background-image:url("${t.icon}")`
1007
1547
  }) : null,
1008
- n.text ? c("span", { class: l("toolbar__text") }, n.text) : null
1548
+ t.text ? l("span", { class: c("toolbar__text") }, t.text) : null
1009
1549
  );
1010
- return s.addEventListener("click", () => {
1550
+ return o.addEventListener("click", () => {
1011
1551
  var e;
1012
- s.classList.contains(l("disabled")) || (e = n.onClick) == null || e.call(n, this.getContext(), s);
1013
- }), s;
1552
+ o.classList.contains(c("disabled")) || (e = t.onClick) == null || e.call(t, this.getContext(), o);
1553
+ }), o;
1014
1554
  }
1015
1555
  // 根据光标样式与编辑模式刷新按钮状态
1016
1556
  update() {
1017
- const n = this.getContext(), s = this.ui.editor.command.getOptions().mode, e = Ge.includes(s);
1018
- this.renderedList.forEach(({ item: t, el: i }) => {
1019
- var r, d, h;
1020
- const o = e && !t.keepEnabledInReadonly || !!((r = t.isDisabled) != null && r.call(t, n));
1021
- i.classList.toggle(l("disabled"), o), i.classList.toggle(l("active"), !!((d = t.isActive) != null && d.call(t, n))), (h = t.update) == null || h.call(t, n, i);
1557
+ const t = this.getContext(), o = this.ui.editor.command.getOptions().mode, e = nt.includes(o);
1558
+ this.renderedList.forEach(({ item: n, el: i }) => {
1559
+ var r, h, d;
1560
+ const a = e && !n.keepEnabledInReadonly || !!((r = n.isDisabled) != null && r.call(n, t));
1561
+ i.classList.toggle(c("disabled"), a), i.classList.toggle(c("active"), !!((h = n.isActive) != null && h.call(n, t))), (d = n.update) == null || d.call(n, t, i);
1022
1562
  });
1023
1563
  }
1024
1564
  destroy() {
1025
1565
  this.ui.editor.eventBus.off("rangeStyleChange", this.rangeStyleChange), this.el.remove();
1026
1566
  }
1027
1567
  }
1028
- let We = 0;
1029
- class Ze {
1030
- constructor(n, s = {}) {
1031
- this.toolbar = null, this.statusbar = null, this.locale = { ...Y, ...s.locale };
1032
- const e = `${l("root")}-${++We}`, t = c("div", { class: l("editor") });
1033
- this.main = c("div", { class: l("main") }, t), this.root = c("div", { class: l("root"), id: e }, this.main), n.append(this.root), this.editor = new q(t, s.data || { main: [] }, {
1034
- scrollContainerSelector: `#${e} .${l("main")}`,
1035
- ...s.options
1036
- }), s.toolbar !== !1 && (this.toolbar = new Ke(this, s.toolbar || U), this.root.prepend(this.toolbar.el)), s.statusbar !== !1 && (this.statusbar = new ie(this, s.statusbar || P), this.root.append(this.statusbar.el)), this.mode = this.editor.command.getOptions().mode, this.renderChange = () => {
1568
+ let at = 0;
1569
+ class lt {
1570
+ constructor(t, o = {}) {
1571
+ this.toolbar = null, this.statusbar = null, this.locale = { ...ce, ...o.locale };
1572
+ const e = `${c("root")}-${++at}`, n = l("div", { class: c("editor") });
1573
+ this.main = l("div", { class: c("main") }, n), this.root = l("div", { class: c("root"), id: e }, this.main), t.append(this.root), this.editor = new W(n, o.data || { main: [] }, {
1574
+ scrollContainerSelector: `#${e} .${c("main")}`,
1575
+ ...o.options
1576
+ }), o.toolbar !== !1 && (this.toolbar = new it(this, o.toolbar || J), this.root.prepend(this.toolbar.el)), o.statusbar !== !1 && (this.statusbar = new me(this, o.statusbar || j), this.root.append(this.statusbar.el)), this.registerControlContextMenu(), this.mode = this.editor.command.getOptions().mode, this.renderChange = () => {
1037
1577
  this.editor.command.getOptions().mode !== this.mode && this.syncMode();
1038
1578
  }, this.editor.eventBus.on("renderChange", this.renderChange);
1039
1579
  }
1580
+ registerControlContextMenu() {
1581
+ const { register: t } = this.editor, o = t.getContextMenuList().find((n) => n.key === Q.CONTROL.DELETE), e = o == null ? void 0 : o.when;
1582
+ o && e && (o.when = (n) => {
1583
+ var i, a;
1584
+ return e(n) && (n.options.mode === m.DESIGN || ((a = (i = n.startElement) == null ? void 0 : i.control) == null ? void 0 : a.deletable) !== !1);
1585
+ }), t.contextMenuList([
1586
+ {
1587
+ name: this.locale.controlProperty,
1588
+ when: (n) => {
1589
+ var i;
1590
+ return n.options.mode === m.DESIGN && !n.editorHasSelection && !!((i = n.startElement) != null && i.controlId);
1591
+ },
1592
+ callback: (n, i) => {
1593
+ const { controlId: a, control: r } = i.startElement;
1594
+ new se({
1595
+ editor: this.editor,
1596
+ locale: this.locale,
1597
+ controlId: a,
1598
+ control: r
1599
+ });
1600
+ }
1601
+ }
1602
+ ]);
1603
+ }
1040
1604
  syncMode() {
1041
- var n, s;
1042
- this.mode = this.editor.command.getOptions().mode, (n = this.toolbar) == null || n.update(), (s = this.statusbar) == null || s.update();
1605
+ var t, o;
1606
+ this.mode = this.editor.command.getOptions().mode, (t = this.toolbar) == null || t.update(), (o = this.statusbar) == null || o.update();
1043
1607
  }
1044
1608
  // 当前总页数(编辑器仅在页数变化时通知,初始值从页面画布读取)
1045
1609
  getPageSize() {
1046
1610
  return this.main.querySelectorAll("canvas[data-index]").length || 1;
1047
1611
  }
1048
1612
  // 切换编辑模式并刷新工具栏可用状态
1049
- setMode(n) {
1050
- this.editor.command.executeMode(n), this.syncMode();
1613
+ setMode(t) {
1614
+ this.editor.command.executeMode(t), this.syncMode();
1051
1615
  }
1052
1616
  destroy() {
1053
- var n, s;
1054
- this.editor.eventBus.off("renderChange", this.renderChange), (n = this.toolbar) == null || n.destroy(), (s = this.statusbar) == null || s.destroy(), this.editor.destroy(), this.root.remove();
1617
+ var t, o;
1618
+ this.editor.eventBus.off("renderChange", this.renderChange), (t = this.toolbar) == null || t.destroy(), (o = this.statusbar) == null || o.destroy(), this.editor.destroy(), this.root.remove();
1055
1619
  }
1056
1620
  }
1057
- function Qe(a, n) {
1058
- const s = typeof a == "string" ? document.querySelector(a) : a;
1059
- if (!s)
1060
- throw new Error(`[canvas-editor-ui] container not found: ${a}`);
1061
- return new Ze(s, n);
1621
+ function ct(s, t) {
1622
+ const o = typeof s == "string" ? document.querySelector(s) : s;
1623
+ if (!o)
1624
+ throw new Error(`[canvas-editor-ui] container not found: ${s}`);
1625
+ return new lt(o, t);
1062
1626
  }
1063
1627
  export {
1064
- P as DEFAULT_STATUSBAR,
1065
- U as DEFAULT_TOOLBAR,
1066
- k as Dialog,
1067
- Ze as EditorUI,
1068
- $e as FONT_LIST,
1069
- Ne as SIZE_LIST,
1070
- Qe as createEditorUI,
1071
- Y as defaultLocale
1628
+ se as ControlPanel,
1629
+ j as DEFAULT_STATUSBAR,
1630
+ J as DEFAULT_TOOLBAR,
1631
+ F as Dialog,
1632
+ lt as EditorUI,
1633
+ Ke as FONT_LIST,
1634
+ je as SIZE_LIST,
1635
+ ct as createEditorUI,
1636
+ ce as defaultLocale
1072
1637
  };
1073
1638
  //# sourceMappingURL=canvas-editor-ui.esm.js.map