@baohu/canvas-editor-ui 1.1.0 → 1.3.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 X, { EDITOR_COMPONENT as T, EditorComponent as k, EditorMode as w, PageMode as S, PaperDirection as V, RowFlex as L, ElementType as E, TitleLevel as z, ListType as _, ListStyle as y, CheckboxMarkType as D, splitText as Y, ControlType as m } from "@baohu/canvas-editor";
3
- const j = {
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 j = {
38
600
  hyperlinkUrl: "链接",
39
601
  separator: "分割线",
40
602
  pageBreak: "分页符",
41
- control: "控件",
42
603
  controlType: "类型",
43
604
  controlText: "文本",
44
605
  controlSelect: "下拉框",
@@ -48,10 +609,85 @@ const j = {
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: "复选框",
56
692
  checkboxCross: "叉选",
57
693
  checkboxCheck: "勾选",
@@ -84,167 +720,122 @@ const j = {
84
720
  modeForm: "表单模式",
85
721
  modePrint: "打印模式",
86
722
  modeDesign: "设计模式",
723
+ modeGraffiti: "涂鸦模式",
724
+ modeTrace: "留痕模式",
87
725
  fullscreen: "全屏"
88
- }, K = "ceu";
89
- function c(a, n = {}, ...s) {
90
- const e = document.createElement(a);
91
- return Object.keys(n).forEach((t) => {
92
- const o = n[t];
93
- o === void 0 || o === !1 || (t === "class" ? e.className = String(o) : e.setAttribute(t, o === !0 ? "" : String(o)));
94
- }), s.forEach((t) => {
95
- t == null || t === !1 || e.append(t);
96
- }), e;
97
- }
98
- function l(a) {
99
- return `${K}-${a}`;
100
- }
101
- function G(a, n) {
102
- let s = null;
103
- const e = (...t) => {
104
- s && clearTimeout(s), s = setTimeout(() => {
105
- s = null, a(...t);
106
- }, n);
107
- };
108
- return e.cancel = () => {
109
- s && clearTimeout(s), s = null;
110
- }, e;
111
- }
112
- function W(a) {
113
- return new Promise((n, s) => {
114
- const e = new FileReader();
115
- e.onload = () => n(e.result), e.onerror = s, e.readAsDataURL(a);
116
- });
117
- }
118
- function Z(a) {
119
- return new Promise((n, s) => {
120
- const e = new Image();
121
- e.onload = () => n(e), e.onerror = s, e.src = a;
122
- });
123
- }
124
- function J(a, n) {
125
- const s = URL.createObjectURL(a);
126
- c("a", { href: s, download: n }).click(), URL.revokeObjectURL(s);
127
- }
128
- function R(a, n) {
129
- const s = (t) => String(t).padStart(2, "0"), e = `${a.getFullYear()}-${s(a.getMonth() + 1)}-${s(
130
- a.getDate()
131
- )}`;
132
- return n ? `${e} ${s(a.getHours())}:${s(a.getMinutes())}:${s(
133
- a.getSeconds()
134
- )}` : e;
135
- }
136
- class I {
137
- constructor(n) {
138
- var s;
139
- this.inputList = [], this.options = n, this.mask = c("div", { class: l("dialog-mask") }), this.container = this.render(), this.mask.setAttribute(T, k.COMPONENT), this.container.setAttribute(T, k.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) => {
140
731
  e.key === "Escape" && this.close();
141
- }, 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();
142
733
  }
143
734
  render() {
144
- const { title: n, fields: s, confirmText: e = "确定", cancelText: t = "取消" } = this.options, o = c("i", { class: l("dialog__close") });
145
- o.onclick = () => this.close();
146
- const i = c("div", { class: l("dialog__body") });
147
- s.forEach((g) => {
148
- const u = this.createInput(g);
149
- this.inputList.push(u);
150
- const M = g.label ? c(
735
+ const { title: t, fields: o, confirmText: e = "确定", cancelText: n = "取消" } = this.options, i = l("i", { class: c("dialog__close") });
736
+ i.onclick = () => this.close();
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(
151
742
  "span",
152
743
  {
153
- class: `${l("dialog__label")}${g.required ? ` ${l("dialog__label--required")}` : ""}`
744
+ class: `${c("dialog__label")}${p.required ? ` ${c("dialog__label--required")}` : ""}`
154
745
  },
155
- g.label
746
+ p.label
156
747
  ) : null;
157
- i.append(c("label", { class: l("dialog__field") }, M, u));
748
+ a.append(l("label", { class: c("dialog__field") }, f, g));
158
749
  });
159
- const r = c("button", { type: "button" }, t);
750
+ const r = l("button", { type: "button" }, n);
160
751
  r.onclick = () => this.close();
161
- const d = c(
752
+ const h = l(
162
753
  "button",
163
- { type: "button", class: l("dialog__confirm") },
754
+ { type: "button", class: c("dialog__confirm") },
164
755
  e
165
756
  );
166
- d.onclick = () => this.confirm();
167
- const h = c(
757
+ h.onclick = () => this.confirm();
758
+ const d = l(
168
759
  "div",
169
- { class: l("dialog") },
170
- c("div", { class: l("dialog__title") }, c("span", {}, n), o),
171
- i,
172
- 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)
173
764
  );
174
- return h.addEventListener("keydown", (g) => {
175
- const u = g.target;
176
- g.key === "Enter" && u.tagName === "INPUT" && (g.preventDefault(), this.confirm());
177
- }), 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);
178
769
  }
179
- createInput(n) {
770
+ createInput(t) {
180
771
  var e;
181
- let s;
182
- return n.type === "select" ? (s = c("select", { name: n.name }), (e = n.options) == null || e.forEach((t) => {
183
- s.append(c("option", { value: t.value }, t.label));
184
- })) : 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;
185
776
  }
186
777
  confirm() {
187
- const { fields: n, onConfirm: s } = this.options, e = {};
188
- let t = !0;
189
- this.inputList.forEach((o, i) => {
190
- e[o.name] = o.value;
191
- const r = n[i].required && !o.value.trim();
192
- o.classList.toggle(l("dialog__input--error"), !!r), r && (t = !1);
193
- }), t && (s && s(e) === !1 || this.dispose());
778
+ const { fields: t, onConfirm: o } = this.options, e = {};
779
+ let n = !0;
780
+ this.inputList.forEach((i, a) => {
781
+ e[i.name] = i.value;
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());
194
785
  }
195
786
  close() {
196
- var n, s;
197
- (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();
198
789
  }
199
790
  dispose() {
200
791
  document.removeEventListener("keydown", this.keydownHandler), this.mask.remove(), this.container.remove();
201
792
  }
202
793
  }
203
- const x = /* @__PURE__ */ new Set();
204
- function A(a) {
205
- x.forEach((n) => {
206
- 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();
207
798
  });
208
799
  }
209
800
  class C {
210
- constructor(n, s, e = "bottom") {
211
- this.panel = c(
801
+ constructor(t, o, e = "bottom") {
802
+ this.panel = l(
212
803
  "div",
213
- { class: `${l("dropdown__panel")} ${l(`dropdown__panel--${e}`)}` },
214
- s
215
- ), 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());
216
807
  }
217
808
  toggle() {
218
- x.has(this) ? this.close() : this.open();
809
+ M.has(this) ? this.close() : this.open();
219
810
  }
220
811
  open() {
221
- x.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"), x.size || document.addEventListener("mousedown", A), x.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);
222
813
  }
223
814
  close() {
224
- this.panel.classList.remove(l("dropdown__panel--visible")), x.delete(this), x.size || document.removeEventListener("mousedown", A);
815
+ this.panel.classList.remove(c("dropdown__panel--visible")), M.delete(this), M.size || document.removeEventListener("mousedown", U);
225
816
  }
226
817
  }
227
- function p(a, n) {
228
- const s = c("ul", { class: l("option-list") });
229
- return a.forEach((e) => {
230
- 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(
231
822
  "li",
232
823
  { "data-value": e.value, style: e.style },
233
- e.icon ? c("i", {
234
- class: l("icon"),
824
+ e.icon ? l("i", {
825
+ class: c("icon"),
235
826
  style: `background-image:url("${e.icon}")`
236
827
  }) : null,
237
828
  e.label
238
829
  );
239
- t.addEventListener("mousedown", (o) => o.preventDefault()), t.addEventListener("click", () => n(e.value)), s.append(t);
240
- }), s;
830
+ n.addEventListener("mousedown", (i) => i.preventDefault()), n.addEventListener("click", () => t(e.value)), o.append(n);
831
+ }), o;
241
832
  }
242
- function b(a, n) {
243
- a.querySelectorAll("li").forEach((s) => {
244
- 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);
245
836
  });
246
837
  }
247
- const Q = "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", ee = "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", 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='M7%207V3h2v4h4v2H9v4H7V9H3V7h4z'%20fill='%23636363'%20fill-rule='evenodd'/%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%3cpath%20d='M3%207h10v2H3z'%20fill='%23636363'%20fill-rule='evenodd'/%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_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", ae = "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", 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='%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", U = [
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 = [
248
839
  "pageNo",
249
840
  "wordCount",
250
841
  "rowCol",
@@ -253,173 +844,175 @@ const Q = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://
253
844
  "paperDirection",
254
845
  "paperMargin",
255
846
  "fullscreen"
256
- ], oe = ["pageNo", "wordCount", "rowCol"];
257
- function H(a, n, s) {
258
- const e = c(
847
+ ], ge = ["pageNo", "wordCount", "rowCol"];
848
+ function T(s, t, o) {
849
+ const e = l(
259
850
  "div",
260
- { class: l("statusbar__button"), title: n },
261
- 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}")` })
262
853
  );
263
- return e.addEventListener("click", s), e;
854
+ return e.addEventListener("click", o), e;
264
855
  }
265
- class ie {
266
- constructor(n, s = U) {
267
- this.disposeList = [], this.updaterList = [], this.on = (o, i) => {
856
+ class me {
857
+ constructor(t, o = j) {
858
+ this.disposeList = [], this.updaterList = [], this.on = (i, a) => {
268
859
  const { eventBus: r } = this.ui.editor;
269
- r.on(o, i), this.disposeList.push(() => r.off(o, i));
270
- }, this.ui = n;
271
- const e = c("div", { class: l("statusbar__left") }), t = c("div", { class: l("statusbar__right") });
272
- this.el = c("div", { class: l("statusbar") }, e, t), this.el.setAttribute(T, k.FOOTER), this.el.addEventListener("mousedown", (o) => o.preventDefault()), s.forEach((o) => {
273
- const i = this.createItem(o);
274
- i && (i.classList.add(l("statusbar__item")), (oe.includes(o) ? e : t).append(i));
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));
275
866
  });
276
867
  }
277
- createItem(n) {
278
- const { editor: s, locale: e } = this.ui;
279
- switch (n) {
868
+ createItem(t) {
869
+ const { editor: o, locale: e } = this.ui;
870
+ switch (t) {
280
871
  case "pageNo": {
281
- const t = c("span", {}, "1"), o = c("span", {}, String(this.ui.getPageSize()));
282
- return this.on("intersectionPageNoChange", (i) => {
283
- t.innerText = String(i + 1);
284
- }), this.on("pageSizeChange", (i) => {
285
- o.innerText = String(i);
286
- }), c("span", {}, `${e.pageNo}:`, t, "/", o);
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);
287
878
  }
288
879
  case "wordCount": {
289
- const t = c("span", {}, "0"), o = G(async () => {
290
- t.innerText = String(await s.command.getWordCount());
880
+ const n = l("span", {}, "0"), i = te(async () => {
881
+ n.innerText = String(await o.command.getWordCount());
291
882
  }, 300);
292
- return this.on("contentChange", o), this.disposeList.push(o.cancel), o(), c("span", {}, `${e.wordCount}:`, t);
883
+ return this.on("contentChange", i), this.disposeList.push(i.cancel), i(), l("span", {}, `${e.wordCount}:`, n);
293
884
  }
294
885
  case "rowCol": {
295
- const t = c("span", {}, "1:1");
886
+ const n = l("span", {}, "1:1");
296
887
  return this.on("rangeStyleChange", () => {
297
- const o = s.command.getRangeContext();
298
- o && (t.innerText = `${o.startRowNo + 1}:${o.startColNo + 1}`);
299
- }), 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);
300
891
  }
301
892
  case "pageMode": {
302
- const t = H(ee, "", () => {
303
- }), o = p(
893
+ const n = T(de, "", () => {
894
+ }), i = w(
304
895
  [
305
- { label: e.pageModePaging, value: S.PAGING },
306
- { label: e.pageModeContinuity, value: S.CONTINUITY }
896
+ { label: e.pageModePaging, value: V.PAGING },
897
+ { label: e.pageModeContinuity, value: V.CONTINUITY }
307
898
  ],
308
- (d) => {
309
- i.close(), s.command.executePageMode(d);
899
+ (h) => {
900
+ a.close(), o.command.executePageMode(h);
310
901
  }
311
- ), i = new C(t, o, "top"), r = (d) => {
312
- b(o, 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;
313
904
  };
314
- return r(s.command.getOptions().pageMode), this.on("pageModeChange", r), i.el;
905
+ return r(o.command.getOptions().pageMode), this.on("pageModeChange", r), a.el;
315
906
  }
316
907
  case "scale": {
317
- const t = c("span", {
318
- class: l("statusbar__scale"),
908
+ const n = l("span", {
909
+ class: c("statusbar__scale"),
319
910
  title: e.scaleRecovery
320
- }), o = (i) => {
321
- t.innerText = `${Math.round(i * 100)}%`;
911
+ }), i = (a) => {
912
+ n.innerText = `${Math.round(a * 100)}%`;
322
913
  };
323
- return o(s.command.getOptions().scale), this.on("pageScaleChange", o), t.addEventListener(
914
+ return i(o.command.getOptions().scale), this.on("pageScaleChange", i), n.addEventListener(
324
915
  "click",
325
- () => s.command.executePageScaleRecovery()
326
- ), c(
916
+ () => o.command.executePageScaleRecovery()
917
+ ), l(
327
918
  "div",
328
- { class: l("statusbar__group") },
329
- H(
330
- ne,
919
+ { class: c("statusbar__group") },
920
+ T(
921
+ pe,
331
922
  e.scaleMinus,
332
- () => s.command.executePageScaleMinus()
923
+ () => o.command.executePageScaleMinus()
333
924
  ),
334
- t,
335
- H(
336
- te,
925
+ n,
926
+ T(
927
+ he,
337
928
  e.scaleAdd,
338
- () => s.command.executePageScaleAdd()
929
+ () => o.command.executePageScaleAdd()
339
930
  )
340
931
  );
341
932
  }
342
933
  case "paperDirection":
343
- return H(se, e.paperDirection, () => {
344
- const { paperDirection: t } = s.command.getOptions();
345
- s.command.executePaperDirection(
346
- t === V.HORIZONTAL ? V.VERTICAL : V.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
347
938
  );
348
939
  });
349
940
  case "paperMargin":
350
- return H(
351
- ae,
941
+ return T(
942
+ ve,
352
943
  e.paperMargin,
353
944
  () => this.openPaperMarginDialog()
354
945
  );
355
946
  case "mode": {
356
- const t = [
357
- { label: e.modeEdit, value: w.EDIT },
358
- { label: e.modeClean, value: w.CLEAN },
359
- { label: e.modeReadonly, value: w.READONLY },
360
- { label: e.modeForm, value: w.FORM },
361
- { label: e.modePrint, value: w.PRINT },
362
- { label: e.modeDesign, value: w.DESIGN }
363
- ], o = c("span", { class: l("statusbar__mode") }), i = p(t, (h) => {
364
- r.close(), this.ui.setMode(h);
365
- }), r = new C(o, i, "top"), d = () => {
366
- var g;
367
- const h = s.command.getOptions().mode;
368
- o.innerText = ((g = t.find((u) => u.value === h)) == null ? void 0 : g.label) || h, b(i, 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);
369
962
  };
370
- return d(), this.updaterList.push(d), r.el;
963
+ return h(), this.updaterList.push(h), r.el;
371
964
  }
372
965
  case "fullscreen": {
373
- const t = H(B, e.fullscreen, () => {
966
+ const n = T(G, e.fullscreen, () => {
374
967
  document.fullscreenElement ? document.exitFullscreen() : this.ui.root.requestFullscreen();
375
- }), o = () => {
376
- const i = document.fullscreenElement ? Q : B;
377
- t.querySelector("i").style.backgroundImage = `url("${i}")`;
968
+ }), i = () => {
969
+ const a = document.fullscreenElement ? re : G;
970
+ n.querySelector("i").style.backgroundImage = `url("${a}")`;
378
971
  };
379
- return document.addEventListener("fullscreenchange", o), this.disposeList.push(
380
- () => document.removeEventListener("fullscreenchange", o)
381
- ), t;
972
+ return document.addEventListener("fullscreenchange", i), this.disposeList.push(
973
+ () => document.removeEventListener("fullscreenchange", i)
974
+ ), n;
382
975
  }
383
976
  default:
384
- return console.warn(`[canvas-editor-ui] unknown statusbar item: ${n}`), null;
977
+ return console.warn(`[canvas-editor-ui] unknown statusbar item: ${t}`), null;
385
978
  }
386
979
  }
387
980
  openPaperMarginDialog() {
388
- const { editor: n, locale: s } = this.ui, e = ["top", "right", "bottom", "left"], t = [
389
- s.marginTop,
390
- s.marginRight,
391
- s.marginBottom,
392
- s.marginLeft
393
- ], o = n.command.getPaperMargin();
394
- new I({
395
- title: s.paperMargin,
396
- confirmText: s.confirm,
397
- cancelText: s.cancel,
398
- fields: e.map((i, 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) => ({
399
992
  type: "number",
400
- name: i,
401
- label: t[r],
993
+ name: a,
994
+ label: n[r],
402
995
  required: !0,
403
- value: String(o[r])
996
+ value: String(i[r])
404
997
  })),
405
- onConfirm: (i) => {
406
- const [r, d, h, g] = e.map(
407
- (M) => Number(i[M])
408
- ), u = [r, d, h, g];
409
- if (u.some((M) => isNaN(M) || M < 0)) return !1;
410
- 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);
411
1004
  }
412
1005
  });
413
1006
  }
414
1007
  // 外部状态(如编辑模式)变化后刷新
415
1008
  update() {
416
- this.updaterList.forEach((n) => n());
1009
+ this.updaterList.forEach((t) => t());
417
1010
  }
418
1011
  destroy() {
419
- this.disposeList.forEach((n) => n()), this.el.remove();
1012
+ this.disposeList.forEach((t) => t()), this.el.remove();
420
1013
  }
421
1014
  }
422
- const 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='M2%2013h12v1H2v-1zm0-3h12v1H2v-1zm0-3h12v1H2V7zm0-6h12v1H2V1zm0%203h12v1H2V4z'%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='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", 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-1zm2-3h8v1H4v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm2%203h8v1H4V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%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_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", 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.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", 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%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", ve = "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", 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='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", me = "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", pe = "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", we = "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", 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='M10.017%203L8.08%2013H9v1H6v-1h1.182L9%203H8V2h3v1h-.983z'%20fill='%233D4757'/%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%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", be = "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", Me = "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", $ = "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", 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='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", Le = "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", _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='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", 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%2013h12v1H2v-1zm4-3h8v1H6v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm4%203h8v1H6V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%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='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", Te = "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", 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='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", 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%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", 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='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", Ve = "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", Re = "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", 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='M5%202v6a3%203%200%20106%200V2h1v6a4%204%200%2011-8%200V2h1zM4%2013h8v1H4z'%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='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", Ne = [
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 = [
423
1016
  "Microsoft YaHei",
424
1017
  "宋体",
425
1018
  "黑体",
@@ -434,11 +1027,11 @@ const ce = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%20
434
1027
  "Arial",
435
1028
  "Segoe UI",
436
1029
  "Times New Roman"
437
- ].map((a) => ({
438
- label: a === "Microsoft YaHei" ? "微软雅黑" : a,
439
- value: a,
440
- style: `font-family:'${a}'`
441
- })), Oe = [
1030
+ ].map((s) => ({
1031
+ label: s === "Microsoft YaHei" ? "微软雅黑" : s,
1032
+ value: s,
1033
+ style: `font-family:'${s}'`
1034
+ })), je = [
442
1035
  ["初号", 56],
443
1036
  ["小初", 48],
444
1037
  ["一号", 34],
@@ -455,7 +1048,7 @@ const ce = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%20
455
1048
  ["小六", 8],
456
1049
  ["七号", 7],
457
1050
  ["八号", 6]
458
- ].map(([a, n]) => ({ label: String(a), value: String(n) })), Fe = ["1", "1.25", "1.5", "1.75", "2", "2.5", "3"], N = [
1051
+ ].map(([s, t]) => ({ label: String(s), value: String(t) })), Je = ["0.5", "0.75", "1", "1.25", "1.5", "1.75", "2", "2.5", "3"], q = [
459
1052
  { label: "———— 实线", dashArray: [] },
460
1053
  { label: "··········· 点线", dashArray: [1, 1] },
461
1054
  { label: "- - - - - 短虚线", dashArray: [3, 1] },
@@ -463,482 +1056,417 @@ const ce = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%20
463
1056
  { label: "—·—·— 点划线", dashArray: [7, 3, 3, 3] },
464
1057
  { label: "—··—·· 双点划线", dashArray: [6, 2, 2, 2, 2, 2] }
465
1058
  ];
466
- function v(a, n, s, e, t = {}) {
467
- 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 };
468
1061
  }
469
- function O(a, n, s, e, t, o) {
1062
+ function Y(s, t, o, e, n, i) {
470
1063
  return {
471
- key: a,
472
- title: n,
473
- render: (i) => {
474
- 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(
475
1068
  "div",
476
- { class: l("select"), title: n, style: `width:${e}px` },
1069
+ { class: c("select"), title: t, style: `width:${e}px` },
477
1070
  r
478
- ), h = p(s, (u) => {
479
- g.close(), t(i, u);
480
- }), g = new C(d, h);
481
- return g.el;
1071
+ ), d = w(o, (g) => {
1072
+ p.close(), n(a, g);
1073
+ }), p = new C(h, d);
1074
+ return p.el;
482
1075
  },
483
- update: (i, r) => {
484
- const d = o(i), h = s.find((g) => g.value === d);
485
- r.querySelector(`.${l("select__label")}`).innerText = h ? h.label : d || "", b(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);
486
1079
  }
487
1080
  };
488
1081
  }
489
- function f(a, n, s, e, t = {}) {
1082
+ function b(s, t, o, e, n = {}) {
490
1083
  return {
491
- key: a,
492
- title: n,
493
- render: (o) => {
494
- const i = c(
1084
+ key: s,
1085
+ title: t,
1086
+ render: (i) => {
1087
+ const a = l(
495
1088
  "div",
496
- { class: `${l("toolbar__button")} ${l("toolbar__button--arrow")}`, title: n },
497
- c("i", { class: l("icon"), style: `background-image:url("${s}")` })
498
- ), r = c("div"), d = new C(i, r);
499
- return i.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(
500
1093
  "click",
501
1094
  () => {
502
- r.innerHTML = "", r.append(e(o, () => d.close()));
1095
+ r.innerHTML = "", r.append(e(i, () => h.close()));
503
1096
  },
504
1097
  !0
505
- ), d.el;
1098
+ ), h.el;
506
1099
  },
507
- ...t
1100
+ ...n
508
1101
  };
509
1102
  }
510
- function F(a, n, s, e, t) {
1103
+ function K(s, t, o, e, n) {
511
1104
  return {
512
- key: a,
513
- title: n,
514
- render: (o) => {
515
- const i = c("input", { type: "color", class: l("color__input") });
516
- i.addEventListener("input", () => e(o, i.value));
517
- const r = c("span", { class: l("color__bar") }), d = c(
1105
+ key: s,
1106
+ title: t,
1107
+ render: (i) => {
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(
518
1111
  "div",
519
- { class: `${l("toolbar__button")} ${l("color")}`, title: n },
520
- 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}")` }),
521
1114
  r,
522
- i
1115
+ a
523
1116
  );
524
- return d.addEventListener("click", () => i.click()), d;
1117
+ return h.addEventListener("click", () => a.click()), h;
525
1118
  },
526
- update: (o, i) => {
527
- const r = t(o);
528
- i.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";
529
1122
  }
530
1123
  };
531
1124
  }
532
- function Pe(a) {
533
- const n = c("input", { type: "file", accept: "image/*" });
534
- n.addEventListener("change", async () => {
535
- var o;
536
- const s = (o = n.files) == null ? void 0 : o[0];
537
- if (!s) return;
538
- const e = await W(s), t = await Z(e);
539
- a.editor.command.executeImage({
1125
+ function We(s) {
1126
+ const t = l("input", { type: "file", accept: "image/*" });
1127
+ t.addEventListener("change", async () => {
1128
+ var i;
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({
540
1133
  value: e,
541
- width: t.width,
542
- height: t.height
1134
+ width: n.width,
1135
+ height: n.height
543
1136
  });
544
- }), n.click();
1137
+ }), t.click();
545
1138
  }
546
- function Ue({ editor: a, locale: n }) {
547
- new I({
548
- title: n.hyperlink,
549
- confirmText: n.confirm,
550
- 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,
551
1144
  fields: [
552
1145
  {
553
1146
  type: "text",
554
1147
  name: "text",
555
- label: n.hyperlinkText,
1148
+ label: t.hyperlinkText,
556
1149
  required: !0,
557
- value: a.command.getRangeText()
1150
+ value: s.command.getRangeText()
558
1151
  },
559
1152
  {
560
1153
  type: "text",
561
1154
  name: "url",
562
- label: n.hyperlinkUrl,
1155
+ label: t.hyperlinkUrl,
563
1156
  required: !0,
564
1157
  placeholder: "https://"
565
1158
  }
566
1159
  ],
567
- onConfirm: ({ text: s, url: e }) => {
568
- a.command.executeHyperlink({
1160
+ onConfirm: ({ text: o, url: e }) => {
1161
+ s.command.executeHyperlink({
569
1162
  url: e,
570
- valueList: Y(s).map((t) => ({ value: t }))
1163
+ valueList: Z(o).map((n) => ({ value: n }))
571
1164
  });
572
1165
  }
573
1166
  });
574
1167
  }
575
- const P = [
576
- m.SELECT,
577
- m.CHECKBOX,
578
- m.RADIO
579
- ];
580
- function qe({ editor: a, locale: n }) {
581
- new I({
582
- title: n.control,
583
- confirmText: n.confirm,
584
- cancelText: n.cancel,
585
- fields: [
586
- {
587
- type: "select",
588
- name: "type",
589
- label: n.controlType,
590
- options: [
591
- { label: n.controlText, value: m.TEXT },
592
- { label: n.controlSelect, value: m.SELECT },
593
- { label: n.controlCheckbox, value: m.CHECKBOX },
594
- { label: n.controlRadio, value: m.RADIO },
595
- { label: n.controlDate, value: m.DATE },
596
- { label: n.controlNumber, value: m.NUMBER }
597
- ]
598
- },
599
- {
600
- type: "text",
601
- name: "placeholder",
602
- label: n.controlPlaceholder
603
- },
604
- {
605
- type: "textarea",
606
- name: "valueSets",
607
- label: n.controlValueSets,
608
- placeholder: n.controlValueSetsPlaceholder,
609
- height: 80
610
- },
611
- {
612
- type: "select",
613
- name: "dateFormat",
614
- label: n.controlDateFormat,
615
- options: [
616
- { label: "yyyy-MM-dd", value: "yyyy-MM-dd" },
617
- { label: "yyyy-MM-dd HH:mm:ss", value: "yyyy-MM-dd HH:mm:ss" }
618
- ]
619
- }
620
- ],
621
- onConfirm: (s) => {
622
- const e = s.type, t = s.valueSets.split(`
623
- `).map((i) => i.trim()).filter(Boolean).map((i) => ({ value: i, code: i }));
624
- if (P.includes(e) && !t.length)
625
- return !1;
626
- const o = {
627
- type: e,
628
- value: null,
629
- placeholder: s.placeholder || void 0
630
- };
631
- P.includes(e) && (o.code = null, o.valueSets = t), e === m.CHECKBOX && (o.markType = D.CROSS), e === m.DATE && (o.dateFormat = s.dateFormat), a.command.executeInsertControl({
632
- type: E.CONTROL,
633
- value: "",
634
- control: o
635
- });
636
- }
637
- });
638
- }
639
- function Xe({ editor: a, locale: n }) {
640
- new I({
641
- title: n.search,
642
- confirmText: n.confirm,
643
- 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,
644
1173
  fields: [
645
1174
  {
646
1175
  type: "text",
647
1176
  name: "keyword",
648
- label: n.searchKeyword,
1177
+ label: t.searchKeyword,
649
1178
  required: !0,
650
- value: a.command.getRangeText()
1179
+ value: s.command.getRangeText()
651
1180
  },
652
1181
  {
653
1182
  type: "text",
654
1183
  name: "replace",
655
- label: n.searchReplace,
656
- placeholder: n.searchReplacePlaceholder
1184
+ label: t.searchReplace,
1185
+ placeholder: t.searchReplacePlaceholder
657
1186
  }
658
1187
  ],
659
- onConfirm: ({ keyword: s, replace: e }) => {
660
- 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);
661
1190
  },
662
- onClose: () => a.command.executeSearch(null)
1191
+ onClose: () => s.command.executeSearch(null)
663
1192
  });
664
1193
  }
665
- function Ye(a, n) {
666
- const e = c("div", { class: l("table-picker__title") }, a.locale.table), t = c("div", { class: l("table-picker__grid") }), o = [];
667
- for (let i = 1; i <= 10; i++)
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++)
668
1197
  for (let r = 1; r <= 10; r++) {
669
- const d = c("span", { "data-row": i, "data-col": r });
670
- o.push(d), t.append(d);
1198
+ const h = l("span", { "data-row": a, "data-col": r });
1199
+ i.push(h), n.append(h);
671
1200
  }
672
- return t.addEventListener("mouseover", (i) => {
673
- const r = i.target, d = Number(r.dataset.row), h = Number(r.dataset.col);
674
- !d || !h || (e.innerText = `${d} × ${h}`, o.forEach((g) => {
675
- g.classList.toggle(
676
- l("active"),
677
- 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
678
1207
  );
679
1208
  }));
680
- }), t.addEventListener("mousedown", (i) => i.preventDefault()), t.addEventListener("click", (i) => {
681
- const r = i.target, d = Number(r.dataset.row), h = Number(r.dataset.col);
682
- !d || !h || (n(), a.editor.command.executeInsertTable(d, h));
683
- }), 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);
684
1213
  }
685
- const je = [
686
- ["left", L.LEFT, be],
687
- ["center", L.CENTER, re],
688
- ["right", L.RIGHT, ye],
689
- ["alignment", L.ALIGNMENT, ce],
690
- ["justify", L.JUSTIFY, xe]
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]
691
1220
  ];
692
- function Ke(a) {
693
- const n = [
694
- v("undo", a.undo, $e, ({ editor: e }) => e.command.executeUndo(), {
1221
+ function ot(s) {
1222
+ const t = [
1223
+ v("undo", s.undo, Ye, ({ editor: e }) => e.command.executeUndo(), {
695
1224
  isDisabled: ({ style: e }) => !!e && !e.undo
696
1225
  }),
697
- v("redo", a.redo, _e, ({ editor: e }) => e.command.executeRedo(), {
1226
+ v("redo", s.redo, Ve, ({ editor: e }) => e.command.executeRedo(), {
698
1227
  isDisabled: ({ style: e }) => !!e && !e.redo
699
1228
  }),
700
1229
  {
701
1230
  key: "painter",
702
- title: a.painter,
703
- icon: $,
1231
+ title: s.painter,
1232
+ icon: X,
704
1233
  isActive: ({ style: e }) => !!(e != null && e.painter),
705
1234
  render: ({ editor: e }) => {
706
- const t = c(
1235
+ const n = l(
707
1236
  "div",
708
- { class: l("toolbar__button"), title: a.painter },
709
- c("i", {
710
- class: l("icon"),
711
- style: `background-image:url("${$}")`
1237
+ { class: c("toolbar__button"), title: s.painter },
1238
+ l("i", {
1239
+ class: c("icon"),
1240
+ style: `background-image:url("${X}")`
712
1241
  })
713
1242
  );
714
- let o = null;
715
- return t.addEventListener("click", () => {
716
- o && clearTimeout(o), o = setTimeout(() => {
717
- o = null, e.command.executePainter({ isDblclick: !1 });
1243
+ let i = null;
1244
+ return n.addEventListener("click", () => {
1245
+ i && clearTimeout(i), i = setTimeout(() => {
1246
+ i = null, e.command.executePainter({ isDblclick: !1 });
718
1247
  }, 200);
719
- }), t.addEventListener("dblclick", () => {
720
- o && clearTimeout(o), o = null, e.command.executePainter({ isDblclick: !0 });
721
- }), t;
1248
+ }), n.addEventListener("dblclick", () => {
1249
+ i && clearTimeout(i), i = null, e.command.executePainter({ isDblclick: !0 });
1250
+ }), n;
722
1251
  }
723
1252
  },
724
1253
  v(
725
1254
  "format",
726
- a.format,
727
- ue,
1255
+ s.format,
1256
+ ke,
728
1257
  ({ editor: e }) => e.command.executeFormat()
729
1258
  ),
730
- O(
1259
+ Y(
731
1260
  "font",
732
- a.font,
733
- Ne,
1261
+ s.font,
1262
+ Ke,
734
1263
  90,
735
- ({ editor: e }, t) => e.command.executeFont(t),
736
- ({ 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
737
1266
  ),
738
- O(
1267
+ Y(
739
1268
  "size",
740
- a.size,
741
- Oe,
1269
+ s.size,
1270
+ je,
742
1271
  54,
743
- ({ editor: e }, t) => e.command.executeSize(Number(t)),
744
- ({ 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)
745
1274
  ),
746
1275
  v(
747
1276
  "sizeAdd",
748
- a.sizeAdd,
749
- ke,
1277
+ s.sizeAdd,
1278
+ Be,
750
1279
  ({ editor: e }) => e.command.executeSizeAdd()
751
1280
  ),
752
1281
  v(
753
1282
  "sizeMinus",
754
- a.sizeMinus,
755
- Ce,
1283
+ s.sizeMinus,
1284
+ Ne,
756
1285
  ({ editor: e }) => e.command.executeSizeMinus()
757
1286
  ),
758
- v("bold", a.bold, le, ({ editor: e }) => e.command.executeBold(), {
1287
+ v("bold", s.bold, xe, ({ editor: e }) => e.command.executeBold(), {
759
1288
  isActive: ({ style: e }) => !!(e != null && e.bold)
760
1289
  }),
761
- v("italic", a.italic, fe, ({ editor: e }) => e.command.executeItalic(), {
1290
+ v("italic", s.italic, _e, ({ editor: e }) => e.command.executeItalic(), {
762
1291
  isActive: ({ style: e }) => !!(e != null && e.italic)
763
1292
  }),
764
- v("underline", a.underline, Be, ({ editor: e }) => e.command.executeUnderline(), {
1293
+ v("underline", s.underline, qe, ({ editor: e }) => e.command.executeUnderline(), {
765
1294
  isActive: ({ style: e }) => !!(e != null && e.underline)
766
1295
  }),
767
- v("strikeout", a.strikeout, Ie, ({ editor: e }) => e.command.executeStrikeout(), {
1296
+ v("strikeout", s.strikeout, $e, ({ editor: e }) => e.command.executeStrikeout(), {
768
1297
  isActive: ({ style: e }) => !!(e != null && e.strikeout)
769
1298
  }),
770
- v("superscript", a.superscript, Ve, ({ editor: e }) => e.command.executeSuperscript(), {
771
- isActive: ({ style: e }) => (e == null ? void 0 : e.type) === E.SUPERSCRIPT
1299
+ v("superscript", s.superscript, Ue, ({ editor: e }) => e.command.executeSuperscript(), {
1300
+ isActive: ({ style: e }) => (e == null ? void 0 : e.type) === H.SUPERSCRIPT
772
1301
  }),
773
- v("subscript", a.subscript, Se, ({ editor: e }) => e.command.executeSubscript(), {
774
- isActive: ({ style: e }) => (e == null ? void 0 : e.type) === E.SUBSCRIPT
1302
+ v("subscript", s.subscript, Pe, ({ editor: e }) => e.command.executeSubscript(), {
1303
+ isActive: ({ style: e }) => (e == null ? void 0 : e.type) === H.SUBSCRIPT
775
1304
  }),
776
- F(
1305
+ K(
777
1306
  "color",
778
- a.color,
779
- he,
780
- ({ editor: e }, t) => e.command.executeColor(t),
1307
+ s.color,
1308
+ Me,
1309
+ ({ editor: e }, n) => e.command.executeColor(n),
781
1310
  ({ style: e }) => (e == null ? void 0 : e.color) || "#000000"
782
1311
  ),
783
- F(
1312
+ K(
784
1313
  "highlight",
785
- a.highlight,
786
- me,
787
- ({ editor: e }, t) => e.command.executeHighlight(t),
1314
+ s.highlight,
1315
+ Te,
1316
+ ({ editor: e }, n) => e.command.executeHighlight(n),
788
1317
  ({ style: e }) => (e == null ? void 0 : e.highlight) || null
789
1318
  ),
790
- f("title", a.title, Ae, ({ editor: e, style: t }, o) => {
791
- const i = [
792
- z.FIRST,
793
- z.SECOND,
794
- z.THIRD,
795
- z.FOURTH,
796
- z.FIFTH,
797
- z.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
798
1327
  ], r = [
799
- { label: a.text, value: "" },
800
- ...i.map((h, g) => ({
801
- label: `${a.title}${g + 1}`,
802
- value: h,
803
- 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`
804
1333
  }))
805
- ], d = p(r, (h) => {
806
- o(), e.command.executeTitle(h || null);
1334
+ ], h = w(r, (d) => {
1335
+ i(), e.command.executeTitle(d || null);
807
1336
  });
808
- return b(d, (t == null ? void 0 : t.level) || ""), d;
1337
+ return y(h, (n == null ? void 0 : n.level) || ""), h;
809
1338
  }),
810
- ...je.map(
811
- ([e, t, o]) => v(e, a[e], o, ({ editor: i }) => i.command.executeRowFlex(t), {
812
- isActive: ({ style: i }) => ((i == null ? void 0 : i.rowFlex) || L.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
813
1342
  })
814
1343
  ),
815
- f(
1344
+ b(
816
1345
  "rowMargin",
817
- a.rowMargin,
818
- Ee,
819
- ({ editor: e, style: t }, o) => {
820
- const i = p(
821
- Fe.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 })),
822
1351
  (r) => {
823
- o(), e.command.executeRowMargin(Number(r));
1352
+ i(), e.command.executeRowMargin(Number(r));
824
1353
  }
825
1354
  );
826
- return b(i, t ? String(t.rowMargin) : null), i;
1355
+ return y(a, n ? String(n.rowMargin) : null), a;
827
1356
  }
828
1357
  ),
829
- f(
1358
+ b(
830
1359
  "list",
831
- a.list,
832
- Me,
833
- ({ editor: e, style: t }, o) => {
834
- const i = [
835
- { label: a.listDecimal, value: `${_.OL}|${y.DECIMAL}` },
836
- { label: a.listCheckbox, value: `${_.UL}|${y.CHECKBOX}` },
837
- { label: a.listDisc, value: `${_.UL}|${y.DISC}` },
838
- { label: a.listCircle, value: `${_.UL}|${y.CIRCLE}` },
839
- { label: a.listSquare, value: `${_.UL}|${y.SQUARE}` }
840
- ], r = p(i, (d) => {
841
- o();
842
- const [h, g] = d.split("|");
843
- e.command.executeList(h, g);
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) => {
1370
+ i();
1371
+ const [d, p] = h.split("|");
1372
+ e.command.executeList(d, p);
844
1373
  });
845
- return b(
1374
+ return y(
846
1375
  r,
847
- t != null && t.listType ? `${t.listType}|${t.listStyle}` : null
1376
+ n != null && n.listType ? `${n.listType}|${n.listStyle}` : null
848
1377
  ), r;
849
1378
  },
850
1379
  { isActive: ({ style: e }) => !!(e != null && e.listType) }
851
1380
  ),
852
- f("table", a.table, Re, Ye),
853
- v("image", a.image, we, Pe),
854
- v("hyperlink", a.hyperlink, pe, Ue),
855
- f(
1381
+ b("table", s.table, Ge, et),
1382
+ v("image", s.image, De, We),
1383
+ v("hyperlink", s.hyperlink, Ee, Ze),
1384
+ b(
856
1385
  "separator",
857
- a.separator,
858
- Te,
859
- ({ editor: e }, t) => p(
860
- N.map((o, i) => ({
861
- label: o.label,
862
- value: String(i)
1386
+ s.separator,
1387
+ Ae,
1388
+ ({ editor: e }, n) => w(
1389
+ q.map((i, a) => ({
1390
+ label: i.label,
1391
+ value: String(a)
863
1392
  })),
864
- (o) => {
865
- t(), e.command.executeSeparator(
866
- N[Number(o)].dashArray
1393
+ (i) => {
1394
+ n(), e.command.executeSeparator(
1395
+ q[Number(i)].dashArray
867
1396
  );
868
1397
  }
869
1398
  )
870
1399
  ),
871
1400
  v(
872
1401
  "pageBreak",
873
- a.pageBreak,
1402
+ s.pageBreak,
874
1403
  ze,
875
1404
  ({ editor: e }) => e.command.executePageBreak()
876
1405
  ),
877
- v("control", a.control, ge, qe),
878
- f("checkbox", a.checkbox, de, ({ editor: e }, t) => {
879
- const o = p(
1406
+ b("checkbox", s.checkbox, be, ({ editor: e }, n) => {
1407
+ const i = w(
880
1408
  [
881
- { label: `☒ ${a.checkboxCross}`, value: D.CROSS },
882
- { label: `☑ ${a.checkboxCheck}`, value: D.CHECK }
1409
+ { label: `☒ ${s.checkboxCross}`, value: E.CROSS },
1410
+ { label: `☑ ${s.checkboxCheck}`, value: E.CHECK }
883
1411
  ],
884
- (i) => {
885
- t(), e.command.executeInsertElementList([
1412
+ (a) => {
1413
+ n(), e.command.executeInsertElementList([
886
1414
  {
887
- type: E.CHECKBOX,
1415
+ type: H.CHECKBOX,
888
1416
  value: "",
889
- checkbox: { value: !1, markType: i }
1417
+ checkbox: { value: !1, markType: a }
890
1418
  }
891
1419
  ]);
892
1420
  }
893
1421
  );
894
- return b(o, D.CROSS), o;
1422
+ return y(i, E.CROSS), i;
895
1423
  }),
896
- f("date", a.date, ve, ({ editor: e }, t) => {
897
- const o = /* @__PURE__ */ new Date(), i = [
898
- { format: "yyyy-MM-dd", text: R(o, !1) },
899
- { format: "yyyy-MM-dd HH:mm:ss", text: R(o, !0) }
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) }
900
1428
  ];
901
- return p(
902
- i.map((r, d) => ({
1429
+ return w(
1430
+ a.map((r, h) => ({
903
1431
  label: r.text,
904
- value: String(d)
1432
+ value: String(h)
905
1433
  })),
906
1434
  (r) => {
907
- t();
908
- const { format: d, text: h } = i[Number(r)];
1435
+ n();
1436
+ const { format: h, text: d } = a[Number(r)];
909
1437
  e.command.executeInsertElementList([
910
1438
  {
911
- type: E.DATE,
1439
+ type: H.DATE,
912
1440
  value: "",
913
- dateFormat: d,
914
- valueList: [{ value: h }]
1441
+ dateFormat: h,
1442
+ valueList: [{ value: d }]
915
1443
  }
916
1444
  ]);
917
1445
  }
918
1446
  );
919
1447
  }),
920
- v("search", a.search, De, Xe, {
1448
+ v("search", s.search, Oe, Qe, {
921
1449
  keepEnabledInReadonly: !0
922
1450
  }),
923
- v("print", a.print, Le, ({ editor: e }) => e.command.executePrint(), {
1451
+ v("print", s.print, Ie, ({ editor: e }) => e.command.executePrint(), {
924
1452
  keepEnabledInReadonly: !0
925
1453
  }),
926
1454
  v(
927
1455
  "pdf",
928
- a.pdf,
929
- He,
1456
+ s.pdf,
1457
+ Ce,
930
1458
  async ({ editor: e }) => {
931
- const t = await e.command.getPdf();
932
- J(t, `document-${Date.now()}.pdf`);
1459
+ const n = await e.command.getPdf();
1460
+ ie(n, `document-${Date.now()}.pdf`);
933
1461
  },
934
1462
  { keepEnabledInReadonly: !0 }
935
1463
  )
936
- ], s = {};
937
- return n.forEach((e) => {
938
- s[e.key] = e;
939
- }), s;
1464
+ ], o = {};
1465
+ return t.forEach((e) => {
1466
+ o[e.key] = e;
1467
+ }), o;
940
1468
  }
941
- const q = [
1469
+ const J = [
942
1470
  "undo",
943
1471
  "redo",
944
1472
  "painter",
@@ -975,15 +1503,15 @@ const q = [
975
1503
  "date",
976
1504
  "|",
977
1505
  "search"
978
- ], Ge = [w.READONLY, w.PRINT];
979
- class We {
980
- constructor(n, s = q) {
981
- this.style = null, this.renderedList = [], this.ui = n, this.el = c("div", { class: l("toolbar") }), this.el.setAttribute(T, k.MENU), this.el.addEventListener("mousedown", (e) => {
982
- const t = e.target.tagName;
983
- t !== "INPUT" && t !== "SELECT" && t !== "TEXTAREA" && e.preventDefault();
984
- }), 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) => {
985
1513
  this.style = e, this.update();
986
- }, n.editor.eventBus.on("rangeStyleChange", this.rangeStyleChange), this.update();
1514
+ }, t.editor.eventBus.on("rangeStyleChange", this.rangeStyleChange), this.update();
987
1515
  }
988
1516
  getContext() {
989
1517
  return {
@@ -993,93 +1521,118 @@ class We {
993
1521
  style: this.style
994
1522
  };
995
1523
  }
996
- render(n) {
997
- const s = Ke(this.ui.locale), e = this.getContext();
998
- n.forEach((t) => {
999
- if (t === "|") {
1000
- 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") }));
1001
1529
  return;
1002
1530
  }
1003
- const o = typeof t == "string" ? s[t] : t;
1004
- if (!o) {
1005
- console.warn(`[canvas-editor-ui] unknown toolbar item: ${t}`);
1531
+ const i = typeof n == "string" ? o[n] : n;
1532
+ if (!i) {
1533
+ console.warn(`[canvas-editor-ui] unknown toolbar item: ${n}`);
1006
1534
  return;
1007
1535
  }
1008
- const i = o.render ? o.render(e) : this.renderButton(o);
1009
- i.classList.add(l("toolbar__item")), i.dataset.key = o.key, this.el.append(i), this.renderedList.push({ item: o, el: i });
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 });
1010
1538
  });
1011
1539
  }
1012
- renderButton(n) {
1013
- const s = c(
1540
+ renderButton(t) {
1541
+ const o = l(
1014
1542
  "div",
1015
- { class: l("toolbar__button"), title: n.title },
1016
- n.icon ? c("i", {
1017
- class: l("icon"),
1018
- 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}")`
1019
1547
  }) : null,
1020
- n.text ? c("span", { class: l("toolbar__text") }, n.text) : null
1548
+ t.text ? l("span", { class: c("toolbar__text") }, t.text) : null
1021
1549
  );
1022
- return s.addEventListener("click", () => {
1550
+ return o.addEventListener("click", () => {
1023
1551
  var e;
1024
- s.classList.contains(l("disabled")) || (e = n.onClick) == null || e.call(n, this.getContext(), s);
1025
- }), s;
1552
+ o.classList.contains(c("disabled")) || (e = t.onClick) == null || e.call(t, this.getContext(), o);
1553
+ }), o;
1026
1554
  }
1027
1555
  // 根据光标样式与编辑模式刷新按钮状态
1028
1556
  update() {
1029
- const n = this.getContext(), s = this.ui.editor.command.getOptions().mode, e = Ge.includes(s);
1030
- this.renderedList.forEach(({ item: t, el: o }) => {
1031
- var r, d, h;
1032
- const i = e && !t.keepEnabledInReadonly || !!((r = t.isDisabled) != null && r.call(t, n));
1033
- o.classList.toggle(l("disabled"), i), o.classList.toggle(l("active"), !!((d = t.isActive) != null && d.call(t, n))), (h = t.update) == null || h.call(t, n, o);
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);
1034
1562
  });
1035
1563
  }
1036
1564
  destroy() {
1037
1565
  this.ui.editor.eventBus.off("rangeStyleChange", this.rangeStyleChange), this.el.remove();
1038
1566
  }
1039
1567
  }
1040
- let Ze = 0;
1041
- class Je {
1042
- constructor(n, s = {}) {
1043
- this.toolbar = null, this.statusbar = null, this.locale = { ...j, ...s.locale };
1044
- const e = `${l("root")}-${++Ze}`, t = c("div", { class: l("editor") });
1045
- 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 X(t, s.data || { main: [] }, {
1046
- scrollContainerSelector: `#${e} .${l("main")}`,
1047
- ...s.options
1048
- }), s.toolbar !== !1 && (this.toolbar = new We(this, s.toolbar || q), this.root.prepend(this.toolbar.el)), s.statusbar !== !1 && (this.statusbar = new ie(this, s.statusbar || U), 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 = () => {
1049
1577
  this.editor.command.getOptions().mode !== this.mode && this.syncMode();
1050
1578
  }, this.editor.eventBus.on("renderChange", this.renderChange);
1051
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
+ }
1052
1604
  syncMode() {
1053
- var n, s;
1054
- 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();
1055
1607
  }
1056
1608
  // 当前总页数(编辑器仅在页数变化时通知,初始值从页面画布读取)
1057
1609
  getPageSize() {
1058
1610
  return this.main.querySelectorAll("canvas[data-index]").length || 1;
1059
1611
  }
1060
1612
  // 切换编辑模式并刷新工具栏可用状态
1061
- setMode(n) {
1062
- this.editor.command.executeMode(n), this.syncMode();
1613
+ setMode(t) {
1614
+ this.editor.command.executeMode(t), this.syncMode();
1063
1615
  }
1064
1616
  destroy() {
1065
- var n, s;
1066
- 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();
1067
1619
  }
1068
1620
  }
1069
- function e0(a, n) {
1070
- const s = typeof a == "string" ? document.querySelector(a) : a;
1071
- if (!s)
1072
- throw new Error(`[canvas-editor-ui] container not found: ${a}`);
1073
- return new Je(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);
1074
1626
  }
1075
1627
  export {
1076
- U as DEFAULT_STATUSBAR,
1077
- q as DEFAULT_TOOLBAR,
1078
- I as Dialog,
1079
- Je as EditorUI,
1080
- Ne as FONT_LIST,
1081
- Oe as SIZE_LIST,
1082
- e0 as createEditorUI,
1083
- j 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
1084
1637
  };
1085
1638
  //# sourceMappingURL=canvas-editor-ui.esm.js.map