ranui 0.1.1-alpha.9 → 0.1.2

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.
Files changed (54) hide show
  1. package/dist/_commonjs-dynamic-modules-2ceabb0b.js +12 -0
  2. package/dist/colz-746223ab.js +241 -0
  3. package/dist/component.d.ts +0 -0
  4. package/dist/components/form/index.d.ts +2 -0
  5. package/dist/components/modal/index.d.ts +2 -0
  6. package/dist/components/preview/{pptx/colz.d.ts → colz.d.ts} +2 -0
  7. package/dist/components/preview/excel/excel.d.ts +11 -0
  8. package/dist/components/preview/excel/index.d.ts +1 -0
  9. package/dist/components/preview/excel/media.d.ts +37 -0
  10. package/dist/components/preview/pptx/worker.d.ts +1 -0
  11. package/dist/components/video/index.d.ts +393 -0
  12. package/dist/{docx.f485e17e.js → docx-5262a8f1.js} +7 -5
  13. package/dist/index-714a1eb8.js +85622 -0
  14. package/dist/{index.6f308b40.js → index-c8a90f0d.js} +1796 -936
  15. package/dist/index-f6ee5c1a.js +1761 -0
  16. package/dist/index.js +1 -1
  17. package/dist/index.umd.cjs +43 -2
  18. package/dist/{jszip.min.50449320.js → jszip.min-97cf7c6a.js} +2 -5
  19. package/dist/{pdf.51be4380.js → pdf-d8fcfb67.js} +1 -1
  20. package/dist/playwright.config.d.ts +11 -0
  21. package/dist/plugins/auto-import-file.d.ts +10 -0
  22. package/dist/plugins/load-style.d.ts +6 -0
  23. package/dist/plugins/load-svg.d.ts +9 -0
  24. package/dist/style.css +1 -1
  25. package/dist/tests/button.spec.d.ts +1 -0
  26. package/dist/utils/index.d.ts +11 -0
  27. package/dist/vite.config.d.ts +2 -0
  28. package/package.json +22 -15
  29. package/readme.md +7 -8
  30. package/dist/index.9f799c47.js +0 -1478
  31. package/dist/typings.d.ts +0 -47
  32. /package/dist/{add-user.98b805f1.js → add-user-d07564bd.js} +0 -0
  33. /package/dist/{book.c3235430.js → book-2a5a596c.js} +0 -0
  34. /package/dist/{check-circle.711c4f31.js → check-circle-2c986969.js} +0 -0
  35. /package/dist/{check-circle-fill.0a9e8a28.js → check-circle-fill-62eaa796.js} +0 -0
  36. /package/dist/{close-circle.dda355df.js → close-circle-2afb6e94.js} +0 -0
  37. /package/dist/{close-circle-fill.726bf59c.js → close-circle-fill-b6906239.js} +0 -0
  38. /package/dist/{close.9954c08c.js → close-ee3ba1d1.js} +0 -0
  39. /package/dist/{eye.c904f80b.js → eye-bd60afe1.js} +0 -0
  40. /package/dist/{eye-close.a954b46e.js → eye-close-bde3c1fc.js} +0 -0
  41. /package/dist/{home.f5970edc.js → home-f824d8f4.js} +0 -0
  42. /package/dist/{info-circle.718e6ac4.js → info-circle-59333e1c.js} +0 -0
  43. /package/dist/{info-circle-fill.9dfc3b5e.js → info-circle-fill-3ab7660d.js} +0 -0
  44. /package/dist/{loading.876d0293.js → loading-407d8249.js} +0 -0
  45. /package/dist/{lock.26244026.js → lock-6d20715b.js} +0 -0
  46. /package/dist/{message.5379338a.js → message-ee4fe153.js} +0 -0
  47. /package/dist/{power-off.050e4c26.js → power-off-bbec6b5f.js} +0 -0
  48. /package/dist/{preview.de4d53cc.js → preview-164a4944.js} +0 -0
  49. /package/dist/{setting.7917f3b2.js → setting-735a1963.js} +0 -0
  50. /package/dist/{team.b3a3196b.js → team-42573142.js} +0 -0
  51. /package/dist/{unlock.1e7bed93.js → unlock-ae33c6f7.js} +0 -0
  52. /package/dist/{user.21cfbfa6.js → user-b7098183.js} +0 -0
  53. /package/dist/{warning-circle.b1792bd4.js → warning-circle-536d4749.js} +0 -0
  54. /package/dist/{warning-circle-fill.b87fec04.js → warning-circle-fill-e4be98bc.js} +0 -0
@@ -1,1478 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- const styles = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(data:image/svg+xml;base64,PHN2ZyB0PSIxNjg4Mzc4MDE2NjYzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2MDgiIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4Ij48cGF0aCBkPSJNNTY4IDUxNS4wMDhsMjU0LjAxNi0yNTUuMDA4cTEyLTExLjAwOCAxMi0yNy40ODh0LTExLjQ4OC0yOC0yOC0xMS40ODgtMjcuNDg4IDEybC0yNTUuMDA4IDI1NC4wMTYtMjU1LjAwOC0yNTQuMDE2cS0xMS4wMDgtMTItMjcuNDg4LTEydC0yOCAxMS40ODgtMTEuNDg4IDI4IDEyIDI3LjQ4OGwyNTQuMDE2IDI1NS4wMDgtMjU0LjAxNiAyNTUuMDA4cS0xMiAxMS4wMDgtMTIgMjcuNDg4dDExLjQ4OCAyOCAyOCAxMS40ODggMjcuNDg4LTEybDI1NS4wMDgtMjU1LjAwOCAyNTUuMDA4IDI1NS4wMDhxMTEuMDA4IDEyIDI3LjQ4OCAxMnQyOC0xMS40ODggMTEuNDg4LTI4LTEyLTI3LjQ4OHoiIHAtaWQ9IjI2MDkiID48L3BhdGg+PC9zdmc+) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}\n';
8
- const f7170ee498e0dd32cbdcb63fba8f75cc$8 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}:host{position:relative;display:inline-block;font-weight:400;white-space:nowrap;text-align:center;background-image:none;border:1px solid transparent;box-shadow:0 2px #00000004;cursor:pointer;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;line-height:22px;font-size:14px;border-radius:2px;color:#000000d9;border-color:#d9d9d9;background:#fff;overflow:hidden;pointer-events:auto}:host,:host(:active),:host(:focus){outline:0}:host(:not([disabled]):hover){border-color:#1890ff;color:#1890ff}:host([type="primary"]){border-color:#1890ff;background-color:#1890ff;color:#fff}:host([type="primary"]:not([disabled])):after{background-image:radial-gradient(circle,#fff 10%,transparent 10.01%)}:host([type="primary"]:not([disabled]):hover){background-color:#40a9ff;color:#fff}:host([type="warning"]){border-color:#ff4d4f;background-color:#ff4d4f;color:#fff}:host([type="warning"]:not([disabled])):after{background-image:radial-gradient(circle,#fff 10%,transparent 10.01%)}:host([type="warning"]:not([disabled]):hover){border-color:#ff4d4f;background-color:#ff4d4f;color:#fff}:host([type="text"]){border:none}:host([disabled]){cursor:not-allowed;pointer-events:all;opacity:.6}:host(:not([disabled]):active):after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}:host(:active) .btn:before{opacity:.2}:host(:not([disabled],[effect])):after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,#1890ff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}:host .slot{display:block}.btn{display:flex;justify-content:space-between;align-items:center;padding:4px 15px}.btn .icon{margin-right:2px}\n';
9
- const falseList = [false, "false", null, void 0];
10
- const isDisabled = (element) => {
11
- const status = element.hasAttribute("disabled");
12
- const value = element.getAttribute("disabled");
13
- if (status && !falseList.includes(value))
14
- return true;
15
- return false;
16
- };
17
- const setElementClass = (element, addClass) => {
18
- const classList = element.classList;
19
- if (!classList.contains(addClass)) {
20
- classList.add(addClass);
21
- }
22
- };
23
- const deleteElementChildClass = (parent, deleteClass) => {
24
- const pre = parent.querySelectorAll(`.${deleteClass}`);
25
- if (pre.length > 0) {
26
- pre.forEach((item) => item.classList.remove(deleteClass));
27
- }
28
- };
29
- const loadScript = (src) => {
30
- return new Promise((resolve, reject) => {
31
- const script = document.createElement("script");
32
- script.src = src;
33
- script.onload = function() {
34
- resolve({ success: true });
35
- };
36
- script.onerror = function(error) {
37
- reject({ success: false, error });
38
- };
39
- document.body.append(script);
40
- });
41
- };
42
- class CustomError$1 {
43
- constructor(message2 = "document is undefined or r-button is exist") {
44
- __publicField(this, "message");
45
- this.message = message2;
46
- }
47
- }
48
- function Custom$5() {
49
- if (typeof document !== "undefined" && !customElements.get("r-button")) {
50
- class Button extends HTMLElement {
51
- constructor() {
52
- super();
53
- __publicField(this, "_btn");
54
- __publicField(this, "_iconElement");
55
- __publicField(this, "_slot");
56
- __publicField(this, "_shadowDom");
57
- __publicField(this, "setIcon", () => {
58
- if (this.icon) {
59
- const { width, height } = this._slot.getBoundingClientRect();
60
- const size = Math.min(width, height);
61
- if (this._iconElement) {
62
- this._iconElement.setAttribute("name", this.icon);
63
- } else {
64
- this._iconElement = document.createElement("r-icon");
65
- this._iconElement.setAttribute("name", this.icon);
66
- this._iconElement.setAttribute("color", "currentColor");
67
- this._iconElement.setAttribute("class", "icon");
68
- this._slot.insertAdjacentElement("beforebegin", this._iconElement);
69
- }
70
- if (this.iconSize) {
71
- this._iconElement.setAttribute("size", this.iconSize);
72
- } else {
73
- this._iconElement.setAttribute("size", `${size - 5}`);
74
- }
75
- }
76
- });
77
- __publicField(this, "mousedown", (event) => {
78
- if (!this.disabled || this.disabled === "false") {
79
- const { left, top } = this.getBoundingClientRect();
80
- this.style.setProperty("--ran-x", event.clientX - left + "px");
81
- this.style.setProperty("--ran-y", event.clientY - top + "px");
82
- }
83
- });
84
- __publicField(this, "mouseLeave", () => {
85
- setTimeout(() => {
86
- this.style.removeProperty("--ran-x");
87
- this.style.removeProperty("--ran-y");
88
- }, 300);
89
- });
90
- this._slot = document.createElement("slot");
91
- this._btn = document.createElement("div");
92
- this._btn.setAttribute("class", "btn");
93
- this._btn.appendChild(this._slot);
94
- this._slot.setAttribute("class", "slot");
95
- const shadowRoot = this.attachShadow({ mode: "closed" });
96
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
97
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$8;
98
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
99
- this._shadowDom = shadowRoot;
100
- shadowRoot.appendChild(this._btn);
101
- }
102
- static get observedAttributes() {
103
- return ["disabled", "icon", "effect", "iconSize", "sheet"];
104
- }
105
- get sheet() {
106
- return this.getAttribute("sheet");
107
- }
108
- set sheet(value) {
109
- this.setAttribute("sheet", value || "");
110
- }
111
- get disabled() {
112
- return isDisabled(this);
113
- }
114
- set disabled(value) {
115
- if (!value || value === "false") {
116
- this.removeAttribute("disabled");
117
- } else {
118
- this.setAttribute("disabled", "");
119
- }
120
- }
121
- get iconSize() {
122
- return this.getAttribute("iconSize");
123
- }
124
- set iconSize(value) {
125
- if (!value || value === "false") {
126
- this.removeAttribute("iconSize");
127
- } else {
128
- this.setAttribute("iconSize", value);
129
- this.setIcon();
130
- }
131
- }
132
- get icon() {
133
- return this.getAttribute("icon");
134
- }
135
- set icon(value) {
136
- if (!value || value === "false") {
137
- this.removeAttribute("icon");
138
- } else {
139
- this.setAttribute("icon", value);
140
- this.setIcon();
141
- }
142
- }
143
- get effect() {
144
- return this.getAttribute("effect");
145
- }
146
- set effect(value) {
147
- if (falseList.includes(value) || !value) {
148
- this.removeAttribute("effect");
149
- } else {
150
- this.setAttribute("effect", value);
151
- }
152
- }
153
- handlerExternalCss() {
154
- if (this.sheet) {
155
- try {
156
- const sheet = new CSSStyleSheet();
157
- sheet.insertRule(this.sheet);
158
- this._shadowDom.adoptedStyleSheets = [sheet];
159
- } catch (error) {
160
- console.error(
161
- `Failed to parse the rule in CSSStyleSheet: ${this.sheet}`
162
- );
163
- }
164
- }
165
- }
166
- connectedCallback() {
167
- this._btn.addEventListener("mousedown", this.mousedown);
168
- this._btn.addEventListener("mouseleave", this.mouseLeave);
169
- this.handlerExternalCss();
170
- this.setIcon();
171
- }
172
- disconnectCallback() {
173
- this._btn.removeEventListener("mousedown", this.mousedown);
174
- this._btn.removeEventListener("mouseleave", this.mouseLeave);
175
- }
176
- attributeChangedCallback(name, oldValue, newValue) {
177
- if (name === "disabled" && this._btn) {
178
- if (!newValue || newValue === "false") {
179
- this._btn.setAttribute("disabled", "");
180
- } else {
181
- this._btn.removeAttribute("disabled");
182
- }
183
- }
184
- if (name === "icon" && this._btn && oldValue !== newValue)
185
- this.setIcon();
186
- if (name === "iconSize" && this._btn && oldValue !== newValue)
187
- this._btn.setAttribute("iconSize", newValue);
188
- if (name === "sheet" && this._shadowDom && oldValue !== newValue)
189
- this.handlerExternalCss();
190
- }
191
- }
192
- customElements.define("r-button", Button);
193
- return Button;
194
- } else {
195
- return CustomError$1;
196
- }
197
- }
198
- const index$f = Custom$5();
199
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
200
- __proto__: null,
201
- default: index$f
202
- }, Symbol.toStringTag, { value: "Module" }));
203
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
204
- const v = glob[path];
205
- if (v) {
206
- return typeof v === "function" ? v() : Promise.resolve(v);
207
- }
208
- return new Promise((_, reject) => {
209
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
210
- });
211
- };
212
- const f7170ee498e0dd32cbdcb63fba8f75cc$7 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}:host{display:inline-flex}:host .icon{display:block}:host([spin]){animation-name:rotate;animation-duration:1.4s;animation-timing-function:linear;animation-iteration-count:infinite}@keyframes rotate{to{transform:rotate(360deg)}}\n';
213
- const fs = {};
214
- let fileSystem = fs;
215
- if (typeof process !== "undefined" && typeof fileSystem.Stats === "function") {
216
- fileSystem._identification = true;
217
- } else {
218
- fileSystem = { _identification: false, message: "require is not defined" };
219
- }
220
- const str2Xml = (xmlStr, format = "text/xml") => {
221
- if (window.DOMParser)
222
- return new window.DOMParser().parseFromString(xmlStr, format).documentElement;
223
- if (typeof window.ActiveXObject !== "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
224
- const xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
225
- xmlDoc.async = "false";
226
- xmlDoc.loadXML(xmlStr);
227
- return xmlDoc;
228
- }
229
- return void 0;
230
- };
231
- function vnode$1(sel, data, children, text, elm) {
232
- const key = data === void 0 ? void 0 : data.key;
233
- return { sel, data, children, text, elm, key };
234
- }
235
- vnode$1("", {}, [], void 0, void 0);
236
- function Custom$4() {
237
- if (typeof window !== "undefined" && !customElements.get("r-icon")) {
238
- class CustomElement2 extends HTMLElement {
239
- constructor() {
240
- super();
241
- __publicField(this, "_icon");
242
- __publicField(this, "_div");
243
- __publicField(this, "loadLocal", () => {
244
- return new Promise((resolve, reject) => {
245
- __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../assets/icons/add-user.svg": () => import("./add-user.98b805f1.js"), "../../assets/icons/book.svg": () => import("./book.c3235430.js"), "../../assets/icons/check-circle-fill.svg": () => import("./check-circle-fill.0a9e8a28.js"), "../../assets/icons/check-circle.svg": () => import("./check-circle.711c4f31.js"), "../../assets/icons/close-circle-fill.svg": () => import("./close-circle-fill.726bf59c.js"), "../../assets/icons/close-circle.svg": () => import("./close-circle.dda355df.js"), "../../assets/icons/close.svg": () => import("./close.9954c08c.js"), "../../assets/icons/eye-close.svg": () => import("./eye-close.a954b46e.js"), "../../assets/icons/eye.svg": () => import("./eye.c904f80b.js"), "../../assets/icons/home.svg": () => import("./home.f5970edc.js"), "../../assets/icons/info-circle-fill.svg": () => import("./info-circle-fill.9dfc3b5e.js"), "../../assets/icons/info-circle.svg": () => import("./info-circle.718e6ac4.js"), "../../assets/icons/loading.svg": () => import("./loading.876d0293.js"), "../../assets/icons/lock.svg": () => import("./lock.26244026.js"), "../../assets/icons/message.svg": () => import("./message.5379338a.js"), "../../assets/icons/power-off.svg": () => import("./power-off.050e4c26.js"), "../../assets/icons/preview.svg": () => import("./preview.de4d53cc.js"), "../../assets/icons/setting.svg": () => import("./setting.7917f3b2.js"), "../../assets/icons/team.svg": () => import("./team.b3a3196b.js"), "../../assets/icons/unlock.svg": () => import("./unlock.1e7bed93.js"), "../../assets/icons/user.svg": () => import("./user.21cfbfa6.js"), "../../assets/icons/warning-circle-fill.svg": () => import("./warning-circle-fill.b87fec04.js"), "../../assets/icons/warning-circle.svg": () => import("./warning-circle.b1792bd4.js") }), `../../assets/icons/${this.name}.svg`).then((result) => {
246
- if (result && result.default && result.default._identification) {
247
- const { data } = result.default;
248
- this._icon && this._div.removeChild(this._icon);
249
- this._icon = str2Xml(data, "image/svg+xml");
250
- if (this._icon) {
251
- this._div.appendChild(this._icon);
252
- this.setSize();
253
- this.setColor();
254
- resolve();
255
- }
256
- } else {
257
- this.loadNs();
258
- reject(
259
- `
260
- couldn't be loaded by r-icon, message: ${this.name} icon is undefined`
261
- );
262
- }
263
- }).catch((error) => {
264
- this.loadNs();
265
- });
266
- });
267
- });
268
- __publicField(this, "loadNs", () => {
269
- if (this._icon && this._div) {
270
- this._div.removeChild(this._icon);
271
- }
272
- this._icon = document.createElement("svg");
273
- this._icon.setAttribute("class", "icon");
274
- this._icon.setAttribute("viewBox", "0 0 1024 1024");
275
- this._icon.setAttribute("width", "100");
276
- this._icon.setAttribute("height", "100");
277
- const xLinksNs = "http://www.w3.org/1999/xlink";
278
- const use = document.createElementNS(xLinksNs, "use");
279
- use.setAttributeNS(
280
- xLinksNs,
281
- "xlink:href",
282
- `../../assets/iconfont/icon.svg#icon-${this.name}`
283
- );
284
- this._icon.appendChild(use);
285
- this._div.appendChild(this._icon);
286
- });
287
- __publicField(this, "setIcon", async () => {
288
- if (this.name) {
289
- this.loadLocal();
290
- }
291
- });
292
- __publicField(this, "setSize", () => {
293
- if (this._icon && this.size) {
294
- this._icon.setAttribute("width", this.size);
295
- this._icon.setAttribute("height", this.size);
296
- }
297
- });
298
- __publicField(this, "setColor", () => {
299
- if (this._icon) {
300
- this.color ? this._icon.setAttribute("fill", this.color) : this._icon.setAttribute("fill", "currentColor");
301
- }
302
- });
303
- __publicField(this, "setSpin", () => {
304
- if (this.spin) {
305
- this.style.setProperty("animation-duration", `${this.spin}s`);
306
- }
307
- });
308
- this._div = document.createElement("div");
309
- this._div.setAttribute("class", "icon");
310
- const shadowRoot = this.attachShadow({ mode: "closed" });
311
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
312
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$7;
313
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
314
- shadowRoot.appendChild(this._div);
315
- }
316
- static get observedAttributes() {
317
- return ["name", "size", "color", "spin"];
318
- }
319
- get name() {
320
- return this.getAttribute("name");
321
- }
322
- set name(value) {
323
- if (value)
324
- this.setAttribute("name", value);
325
- }
326
- get size() {
327
- return this.getAttribute("size");
328
- }
329
- set size(value) {
330
- if (value)
331
- this.setAttribute("size", value);
332
- }
333
- get color() {
334
- return this.getAttribute("color");
335
- }
336
- set color(value) {
337
- if (value)
338
- this.setAttribute("color", value);
339
- }
340
- get spin() {
341
- return this.getAttribute("spin");
342
- }
343
- set spin(value) {
344
- if (value != null)
345
- this.setAttribute("spin", value);
346
- }
347
- connectedCallback() {
348
- this.setIcon();
349
- }
350
- attributeChangedCallback(name, oldValue, newValue) {
351
- if (newValue !== oldValue) {
352
- if (name === "name")
353
- this.setIcon();
354
- if (name === "size")
355
- this.setSize();
356
- if (name === "color")
357
- this.setColor();
358
- if (name === "spin")
359
- this.setSpin();
360
- }
361
- }
362
- }
363
- customElements.define("r-icon", CustomElement2);
364
- }
365
- }
366
- const index$d = Custom$4();
367
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
368
- __proto__: null,
369
- default: index$d
370
- }, Symbol.toStringTag, { value: "Module" }));
371
- const f7170ee498e0dd32cbdcb63fba8f75cc$6 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}\n';
372
- const failImage = `
373
- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==
374
- `;
375
- function Custom$3() {
376
- if (typeof window !== "undefined" && !customElements.get("r-img")) {
377
- class CustomElement2 extends HTMLElement {
378
- constructor() {
379
- super();
380
- __publicField(this, "_image");
381
- __publicField(this, "_container");
382
- this._container = document.createElement("div");
383
- this._container.setAttribute("class", "r-image");
384
- const shadowRoot = this.attachShadow({ mode: "closed" });
385
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
386
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$6;
387
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
388
- shadowRoot.appendChild(this._container);
389
- }
390
- static get observedAttributes() {
391
- return ["fallback"];
392
- }
393
- get fallback() {
394
- return this.getAttribute("fallback") || failImage;
395
- }
396
- set fallback(value) {
397
- if (value) {
398
- this.setAttribute("fallback", value);
399
- } else {
400
- this.removeAttribute("fallback");
401
- }
402
- }
403
- listenFallback(name, value) {
404
- if (name === "fallback" && this._image) {
405
- if (value) {
406
- this._image.setAttribute("fallback", value);
407
- } else {
408
- this._image.removeAttribute("fallback");
409
- }
410
- }
411
- }
412
- connectedCallback() {
413
- const src = this.getAttribute("src") || "";
414
- this._image = new Image();
415
- this._image.src = src;
416
- this._image.addEventListener("error", () => {
417
- if (this._image && this.fallback) {
418
- this._image.src = this.fallback;
419
- }
420
- });
421
- this._image.addEventListener("load", () => {
422
- if (this._image) {
423
- this._container.appendChild(this._image);
424
- }
425
- });
426
- }
427
- attributeChangedCallback(name, oldValue, newValue) {
428
- this.listenFallback(name, newValue);
429
- }
430
- }
431
- customElements.define("r-img", CustomElement2);
432
- }
433
- }
434
- const index$b = Custom$3();
435
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
436
- __proto__: null,
437
- default: index$b
438
- }, Symbol.toStringTag, { value: "Module" }));
439
- const f7170ee498e0dd32cbdcb63fba8f75cc$5 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}.input{position:relative;display:flex;width:100%;min-width:0;padding:2px 8px;color:#000000d9;font-size:12px;line-height:1.5715;background-color:#fff;background-image:none;border-width:1px;border-style:solid;border-color:#d9d9d9;border-radius:2px;transition:all .3s}.input:active{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff33;border-right-width:1px;outline:0}.input:hover{border-color:#40a9ff;border-right-width:1px}.input>.input-main:hover~.input-label{color:#40a9ff}.input[value]>.input-label{transform:translateY(calc(-50% - .43em)) scale(.8);color:#00000040}.input[status=error]{border-color:#ff4d4f}.input[status=error]>.input-main~.input-label{color:#ff4d4f}.input[status=warning]{border-color:#ff7875}.input[status=warning]>.input-main~.input-label{color:#ff7875}.input[disabled]{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.input[disabled]>.input-main{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.input[disabled]>.input-main~.input-label{color:#00000040;background-color:#f5f5f5}.input[disabled]>.input-label{color:#999;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed}.input-main{writing-mode:horizontal-tb;text-rendering:auto;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0px;text-shadow:none;text-align:start;-webkit-rtl-ordering:logical;cursor:text;touch-action:manipulation;-webkit-appearance:none;text-overflow:ellipsis;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";position:relative;border:none;width:100%;min-width:0;color:#000000d9;font-size:14px;line-height:1.5715;background-color:#fff;background-image:none;transition:all .3s}.input-main:focus,.input-main:hover{border:none;outline:0}.input-main::placeholder{color:#999}.input-main:placeholder-shown~.input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.input-main:focus~.input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.input-label{pointer-events:none;position:absolute;font-size:14px;left:8px;transition:transform .3s,color .3s,background-color .3s,backdrop-filter .3s;transform-origin:left;padding:0 .2em;color:#999;background:#fff;opacity:.9}\n';
440
- class CustomError {
441
- constructor(message2 = "document is undefined or r-input is exist") {
442
- __publicField(this, "message");
443
- this.message = message2;
444
- }
445
- }
446
- function Custom$2() {
447
- if (typeof window !== "undefined" && !customElements.get("r-input")) {
448
- class CustomElement2 extends HTMLElement {
449
- constructor() {
450
- super();
451
- __publicField(this, "_container");
452
- __publicField(this, "_label");
453
- __publicField(this, "_input");
454
- __publicField(this, "_icon");
455
- __publicField(this, "inputValue", (event) => {
456
- event.stopPropagation();
457
- const target = event.target;
458
- this.value = target ? target.value : "";
459
- this.change();
460
- this.dispatchEvent(
461
- new CustomEvent("input", {
462
- detail: {
463
- value: this.value
464
- }
465
- })
466
- );
467
- });
468
- __publicField(this, "change", () => {
469
- this.dispatchEvent(
470
- new CustomEvent("change", {
471
- detail: {
472
- value: this.value
473
- }
474
- })
475
- );
476
- });
477
- __publicField(this, "focus", () => {
478
- this.dispatchEvent(
479
- new CustomEvent("focus", {
480
- detail: {
481
- value: this.value
482
- }
483
- })
484
- );
485
- });
486
- __publicField(this, "dealIcon", () => {
487
- if (!this._icon) {
488
- this._icon = document.createElement("r-icon");
489
- const { width, height } = this._input.getBoundingClientRect();
490
- const size = Math.min(width, height);
491
- this._icon.setAttribute("size", `${size}`);
492
- this._input.insertAdjacentElement("beforebegin", this._icon);
493
- }
494
- this.icon && this._icon.setAttribute("name", this.icon);
495
- });
496
- const shadowRoot = this.attachShadow({ mode: "closed" });
497
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
498
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$5;
499
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
500
- this._container = document.createElement("div");
501
- this._container.setAttribute("class", "input");
502
- this._input = document.createElement("input");
503
- this._input.setAttribute("class", "input-main");
504
- this._container.appendChild(this._input);
505
- shadowRoot.appendChild(this._container);
506
- }
507
- static get observedAttributes() {
508
- return [
509
- "label",
510
- "disabled",
511
- "name",
512
- "placeholder",
513
- "type",
514
- "icon",
515
- "status"
516
- ];
517
- }
518
- get value() {
519
- return this.getAttribute("value");
520
- }
521
- set value(value) {
522
- if (!isDisabled(this) && value) {
523
- this.setAttribute("value", value);
524
- this._container.setAttribute("value", value);
525
- } else {
526
- this.removeAttribute("value");
527
- this._container.removeAttribute("value");
528
- }
529
- }
530
- get placeholder() {
531
- return this.getAttribute("placeholder");
532
- }
533
- set placeholder(value) {
534
- if (value) {
535
- this.setAttribute("placeholder", value);
536
- } else {
537
- this.removeAttribute("placeholder");
538
- }
539
- }
540
- get required() {
541
- return this.getAttribute("required");
542
- }
543
- set required(value) {
544
- if (!value || value === "false") {
545
- this.removeAttribute("required");
546
- } else {
547
- this.setAttribute("required", "");
548
- }
549
- }
550
- get disabled() {
551
- return isDisabled(this);
552
- }
553
- set disabled(value) {
554
- if (falseList.includes(value)) {
555
- this.removeAttribute("disabled");
556
- this._container.removeAttribute("disabled");
557
- this._input.removeAttribute("disabled");
558
- } else {
559
- this.setAttribute("disabled", "");
560
- this._container.setAttribute("disabled", "");
561
- this._input.setAttribute("disabled", "");
562
- }
563
- }
564
- get label() {
565
- return this.getAttribute("label") || "";
566
- }
567
- set label(value) {
568
- this.setAttribute("label", value);
569
- }
570
- get status() {
571
- return this.getAttribute("status") || "";
572
- }
573
- set status(value) {
574
- if (value) {
575
- this.setAttribute("status", value);
576
- this._container.setAttribute("status", value);
577
- } else {
578
- this.removeAttribute("status");
579
- this._container.removeAttribute("status");
580
- }
581
- }
582
- get name() {
583
- return this.getAttribute("name") || "";
584
- }
585
- set name(value) {
586
- this.setAttribute("name", value);
587
- }
588
- get min() {
589
- return this.getAttribute("min") || "";
590
- }
591
- set min(value) {
592
- if (this.type === "number")
593
- this.setAttribute("min", value);
594
- }
595
- get max() {
596
- return this.getAttribute("max") || "";
597
- }
598
- set max(value) {
599
- if (this.type === "number")
600
- this.setAttribute("max", value);
601
- }
602
- get step() {
603
- return this.getAttribute("step") || "";
604
- }
605
- set step(value) {
606
- if (this.type === "number")
607
- this.setAttribute("step", value);
608
- }
609
- get icon() {
610
- return this.getAttribute("icon");
611
- }
612
- set icon(value) {
613
- if (value) {
614
- this.setAttribute("icon", value);
615
- } else {
616
- this.removeAttribute("icon");
617
- }
618
- }
619
- get type() {
620
- return this.getAttribute("type");
621
- }
622
- set type(value) {
623
- if (value) {
624
- this.setAttribute("type", value);
625
- } else {
626
- this.removeAttribute("type");
627
- }
628
- }
629
- listenPlaceholder(name, value) {
630
- if (name === "placeholder" && this._input) {
631
- if (value != null) {
632
- this._input.setAttribute("placeholder", value);
633
- } else {
634
- this._input.removeAttribute("placeholder");
635
- }
636
- }
637
- }
638
- listenLabel(name, value) {
639
- if (name === "label" && this._input) {
640
- if (value != null) {
641
- if (this._label) {
642
- this._label.innerHTML = value;
643
- } else {
644
- this._label = document.createElement("label");
645
- this._label.innerHTML = value;
646
- this._label.setAttribute("class", "input-label");
647
- this._container.appendChild(this._label);
648
- }
649
- } else {
650
- this._container.removeAttribute("label");
651
- if (this._label) {
652
- this._container.removeChild(this._label);
653
- this._label = void 0;
654
- }
655
- }
656
- }
657
- }
658
- listenType(name, value) {
659
- if (name === "type" && this._input) {
660
- if (value) {
661
- this._input.setAttribute("type", value);
662
- } else {
663
- this._input.removeAttribute("type");
664
- this._input.removeAttribute("min");
665
- this._input.removeAttribute("max");
666
- this._input.removeAttribute("step");
667
- }
668
- }
669
- }
670
- listenStatus(name, value) {
671
- if (name === "status" && this._container) {
672
- if (value) {
673
- this._container.setAttribute("status", value);
674
- } else {
675
- this._container.removeAttribute("status");
676
- }
677
- }
678
- }
679
- listenDisabled(name, value) {
680
- if (name === "disabled" && this._container) {
681
- if (falseList.includes(value)) {
682
- this._container.removeAttribute("disabled");
683
- } else {
684
- this._container.setAttribute("disabled", "");
685
- this._input.setAttribute("disabled", "");
686
- }
687
- }
688
- }
689
- listenIcon(name, value, oldValue) {
690
- if (name === "icon" && value && value !== oldValue) {
691
- this.removeAttribute("label");
692
- this.setAttribute("icon", value);
693
- this.dealIcon();
694
- }
695
- }
696
- listenEvent(name, oldValue, newValue) {
697
- this.listenPlaceholder(name, newValue);
698
- this.listenLabel(name, newValue);
699
- this.listenStatus(name, newValue);
700
- this.listenDisabled(name, newValue);
701
- this.listenIcon(name, newValue, oldValue);
702
- }
703
- connectedCallback() {
704
- if (this.value) {
705
- this._input.value = this.value;
706
- this._container.setAttribute("value", this.value);
707
- }
708
- if (this.status) {
709
- this._container.setAttribute("status", this.status);
710
- }
711
- if (isDisabled(this)) {
712
- this._container.setAttribute("disabled", "");
713
- this._input.setAttribute("disabled", "");
714
- }
715
- if (this.type) {
716
- this._input.setAttribute("type", this.type);
717
- }
718
- this._input.addEventListener("input", this.inputValue);
719
- this._input.addEventListener("focus", this.focus);
720
- if (document.readyState === "complete") {
721
- this.dealIcon();
722
- }
723
- }
724
- disconnectCallback() {
725
- this._input.removeEventListener("input", this.inputValue);
726
- }
727
- attributeChangedCallback(name, oldValue, newValue) {
728
- this.listenEvent(name, oldValue, newValue);
729
- }
730
- }
731
- customElements.define("r-input", CustomElement2);
732
- return CustomElement2;
733
- } else {
734
- return CustomError;
735
- }
736
- }
737
- const index$9 = Custom$2();
738
- const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
739
- __proto__: null,
740
- default: index$9
741
- }, Symbol.toStringTag, { value: "Module" }));
742
- const f7170ee498e0dd32cbdcb63fba8f75cc$4 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}@keyframes MessageMoveUpIn{0%{transform:translateY(-100%);transform-origin:0 0;opacity:0}to{transform:translateY(0);transform-origin:0 0;opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}:host([type="toast"]){--ranui-message-background: rgba(0, 0, 0, .7);--ranui-message-color: #fff;--ranui-message-border-radius: 7px}.message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}.message-notice-content{display:inline-block;padding:10px 16px;background:var(--ranui-message-background, #fff);border-radius:var(--ranui-message-border-radius, 2px);box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;pointer-events:all}.message-notice-content-info{align-items:center;display:flex}.message-notice-content-info span{margin:0;padding:0;color:var(--ranui-message-color, #000000d9);font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none}.message-leave{animation-name:MessageMoveOut;animation-duration:.3s}.message-in{animation-name:MessageMoveUpIn;animation-duration:.2s;animation-fill-mode:both}\n';
743
- const AnimationTime = 300;
744
- const defaultDuration = 3e3;
745
- const typeMapIcon = /* @__PURE__ */ new Map([
746
- ["success", "check-circle-fill"],
747
- ["warning", "warning-circle-fill"],
748
- ["error", "close-circle-fill"],
749
- ["info", "info-circle-fill"],
750
- ["toast", null]
751
- ]);
752
- const typeMapColor = /* @__PURE__ */ new Map([
753
- ["success", "#52c41a"],
754
- ["warning", "#faad14"],
755
- ["error", "#ff4d4f"],
756
- ["info", "#1890ff"],
757
- ["toast", "rgba(0, 0, 0, 0.7)"]
758
- ]);
759
- function Custom$1() {
760
- if (typeof window !== "undefined" && !customElements.get("r-message")) {
761
- class CustomElement2 extends HTMLElement {
762
- constructor() {
763
- super();
764
- __publicField(this, "_info");
765
- __publicField(this, "_notice");
766
- __publicField(this, "_content");
767
- __publicField(this, "_icon");
768
- __publicField(this, "_span");
769
- __publicField(this, "timeId");
770
- __publicField(this, "close");
771
- __publicField(this, "setIcon", (value) => {
772
- var _a, _b, _c, _d;
773
- const icon = typeMapIcon.get(value);
774
- const color = typeMapColor.get(value);
775
- if (icon) {
776
- (_a = this._icon) == null ? void 0 : _a.setAttribute("name", icon);
777
- (_b = this._icon) == null ? void 0 : _b.style.setProperty("margin-right", "8px");
778
- (_c = this._icon) == null ? void 0 : _c.setAttribute("size", "18");
779
- color && ((_d = this._icon) == null ? void 0 : _d.setAttribute("color", color));
780
- }
781
- });
782
- this._notice = document.createElement("div");
783
- this._notice.setAttribute("class", "message-notice");
784
- this._content = document.createElement("div");
785
- this._content.setAttribute("class", "message-notice-content");
786
- this._info = document.createElement("div");
787
- this._info.setAttribute("class", "message-notice-content-info");
788
- this._icon = document.createElement("r-icon");
789
- this._span = document.createElement("span");
790
- this._info.appendChild(this._icon);
791
- this._info.appendChild(this._span);
792
- this._content.appendChild(this._info);
793
- this._notice.appendChild(this._content);
794
- const shadowRoot = this.attachShadow({ mode: "closed" });
795
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
796
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$4;
797
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
798
- shadowRoot.appendChild(this._notice);
799
- }
800
- static get observedAttributes() {
801
- return ["type", "content"];
802
- }
803
- get type() {
804
- return this.getAttribute("type");
805
- }
806
- set type(value) {
807
- if (value)
808
- this.setAttribute("type", value);
809
- }
810
- get content() {
811
- return this.getAttribute("content");
812
- }
813
- set content(value) {
814
- if (value)
815
- this.setAttribute("content", value);
816
- }
817
- attributeChangedCallback(name, oldValue, newValue) {
818
- if (name === "content" && oldValue !== newValue) {
819
- this._span.textContent = newValue;
820
- }
821
- if (name === "type" && oldValue !== newValue) {
822
- this.setIcon(newValue);
823
- }
824
- }
825
- }
826
- customElements.define("r-message", CustomElement2);
827
- const container = document.createElement("div");
828
- const div = document.createElement("div");
829
- div.setAttribute("class", "ranui-message");
830
- document.body.appendChild(container);
831
- container.appendChild(div);
832
- const commonPrompt = (type) => {
833
- return (options) => {
834
- const message2 = new CustomElement2();
835
- message2.setAttribute("class", "message");
836
- message2.timeId && clearTimeout(message2.timeId);
837
- message2.setAttribute("type", type);
838
- let duration = defaultDuration;
839
- let close;
840
- if (typeof options === "string") {
841
- message2.setAttribute("content", options);
842
- } else {
843
- message2.setAttribute("content", options.content);
844
- close = options.close;
845
- duration = options.duration || defaultDuration;
846
- }
847
- const time = setTimeout(() => {
848
- message2.classList.remove("message-in");
849
- message2.classList.add("message-leave");
850
- clearTimeout(time);
851
- }, duration - AnimationTime);
852
- message2.timeId = setTimeout(() => {
853
- div.removeChild(message2);
854
- if (close)
855
- close();
856
- }, duration);
857
- div.appendChild(message2);
858
- message2.classList.add("message-in");
859
- };
860
- };
861
- return {
862
- info: commonPrompt("info"),
863
- success: commonPrompt("success"),
864
- error: commonPrompt("error"),
865
- warning: commonPrompt("warning"),
866
- toast: commonPrompt("toast")
867
- };
868
- }
869
- }
870
- const message = Custom$1();
871
- if (typeof window !== "undefined" && message) {
872
- window.message = message;
873
- }
874
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
875
- __proto__: null,
876
- default: message
877
- }, Symbol.toStringTag, { value: "Module" }));
878
- const f7170ee498e0dd32cbdcb63fba8f75cc$3 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}.r-preview-slot{display:block}:host{cursor:pointer}\n';
879
- const PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
880
- const PDF = "application/pdf";
881
- const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
882
- async function Custom() {
883
- if (typeof window !== "undefined" && !customElements.get("r-preview")) {
884
- const { renderPptx } = await import("./index.6f308b40.js");
885
- const { renderDocx } = await import("./docx.f485e17e.js");
886
- const { renderPdf } = await import("./pdf.51be4380.js");
887
- const url2File = (url, onProgress) => {
888
- return new Promise((resolve, reject) => {
889
- const xhr = new XMLHttpRequest();
890
- xhr.open("GET", url);
891
- xhr.responseType = "blob";
892
- xhr.onload = () => {
893
- const blob = xhr.response;
894
- const file = new File([blob], blob.name, { type: blob.type });
895
- resolve(file);
896
- };
897
- xhr.onprogress = (event) => {
898
- onProgress && onProgress(event);
899
- };
900
- xhr.onerror = (e) => {
901
- reject(e);
902
- };
903
- xhr.send();
904
- });
905
- };
906
- const renderPpt = (file, dom) => {
907
- return new Promise((resolve, reject) => {
908
- const reader = new FileReader();
909
- reader.readAsArrayBuffer(file);
910
- reader.onload = () => {
911
- var _a;
912
- if (reader.result && dom) {
913
- const param = {
914
- pptx: reader.result,
915
- resultElement: dom
916
- };
917
- (_a = renderPptx(param)) == null ? void 0 : _a.then(() => {
918
- resolve();
919
- });
920
- }
921
- };
922
- reader.onerror = (error) => {
923
- reject(error);
924
- };
925
- reader.onabort = (abort) => {
926
- reject(abort);
927
- };
928
- });
929
- };
930
- const renderWord = (file, dom) => {
931
- return Promise.resolve().then(
932
- () => renderDocx({ buffer: file, bodyContainer: dom })
933
- );
934
- };
935
- const renderFileMap = /* @__PURE__ */ new Map([
936
- [PDF, renderPdf],
937
- [PPTX, renderPpt],
938
- [DOCX, renderWord]
939
- ]);
940
- class CustomElement2 extends HTMLElement {
941
- constructor() {
942
- super();
943
- __publicField(this, "preview");
944
- __publicField(this, "previewContext");
945
- __publicField(this, "_slot");
946
- __publicField(this, "_div");
947
- __publicField(this, "onProgress", (event) => {
948
- const num = event.loaded / event.total * 100;
949
- const progress = num.toFixed(2) + "%";
950
- console.log(progress);
951
- });
952
- __publicField(this, "handleFile", async (file) => {
953
- try {
954
- if (typeof file === "string") {
955
- file = await url2File(file, this.onProgress);
956
- }
957
- const { type } = file;
958
- const handler = renderFileMap.get(type);
959
- if (handler && this.previewContext) {
960
- handler(file, this.previewContext);
961
- }
962
- } catch (error) {
963
- console.log("handleFile", error);
964
- }
965
- });
966
- __publicField(this, "closePreview", () => {
967
- if (this.preview) {
968
- this.preview.style.display = "none";
969
- }
970
- });
971
- __publicField(this, "showPreview", () => {
972
- if (this.src) {
973
- if (this.preview) {
974
- this.preview.style.display = "block";
975
- } else {
976
- this.preview = document.createElement("div");
977
- this.preview.setAttribute("class", "r-preview-mask");
978
- this.preview.setAttribute("id", "r-preview-mask");
979
- const previewOption = document.createElement("div");
980
- previewOption.setAttribute("class", "r-preview-options");
981
- const previewCloseButton = document.createElement("button");
982
- previewCloseButton.setAttribute("class", "r-preview-options-close");
983
- previewCloseButton.addEventListener("click", this.closePreview);
984
- const previewContain = document.createElement("div");
985
- previewContain.setAttribute("class", "r-preview-contain");
986
- this.previewContext = document.createElement("div");
987
- this.previewContext.setAttribute("class", "r-preview-context");
988
- previewContain.appendChild(this.previewContext);
989
- previewOption.appendChild(previewCloseButton);
990
- this.preview.appendChild(previewOption);
991
- this.preview.appendChild(previewContain);
992
- document.body.appendChild(this.preview);
993
- }
994
- this.handleFile(this.src);
995
- }
996
- });
997
- this._div = document.createElement("div");
998
- this.preview = document.getElementById("r-preview-mask");
999
- this._slot = document.createElement("slot");
1000
- this._div.appendChild(this._slot);
1001
- this._slot.setAttribute("class", "r-preview-slot");
1002
- this._div.setAttribute("class", "r-preview");
1003
- const shadowRoot = this.attachShadow({ mode: "closed" });
1004
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
1005
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$3;
1006
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
1007
- shadowRoot.appendChild(this._div);
1008
- }
1009
- static get observedAttributes() {
1010
- return ["src"];
1011
- }
1012
- get label() {
1013
- return this.getAttribute("label");
1014
- }
1015
- set label(value) {
1016
- if (value)
1017
- this.setAttribute("label", value);
1018
- }
1019
- get src() {
1020
- return this.getAttribute("src");
1021
- }
1022
- set src(value) {
1023
- if (value)
1024
- this.setAttribute("src", value);
1025
- }
1026
- connectedCallback() {
1027
- this.preview = document.getElementById("r-preview-mask");
1028
- this.addEventListener("click", this.showPreview);
1029
- }
1030
- disconnectedCallback() {
1031
- this.removeEventListener("click", this.showPreview);
1032
- }
1033
- attributeChangedCallback(name, oldValue, newValue) {
1034
- if (newValue !== oldValue) {
1035
- if (name === "src" && newValue) {
1036
- this.setAttribute("src", newValue);
1037
- this.showPreview();
1038
- }
1039
- }
1040
- }
1041
- }
1042
- customElements.define("r-preview", CustomElement2);
1043
- }
1044
- }
1045
- const index$6 = Custom();
1046
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1047
- __proto__: null,
1048
- default: index$6
1049
- }, Symbol.toStringTag, { value: "Module" }));
1050
- const f7170ee498e0dd32cbdcb63fba8f75cc$2 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}@keyframes skeleton{0%{transform:translate(-37.5%)}to{transform:translate(37.5%)}}.skeleton{position:relative;z-index:0;overflow:hidden;background:0 0;width:100%;height:16px;background:rgba(0,0,0,.06);border-radius:4px}.skeleton:after{position:absolute;top:0;inset-inline-end:-150%;bottom:0;inset-inline-start:-150%;background:linear-gradient(90deg,rgba(0,0,0,.06) 25%,rgba(0,0,0,.15) 37%,rgba(0,0,0,.06) 63%);animation-name:skeleton;animation-duration:1.4s;animation-timing-function:ease;animation-iteration-count:infinite;content:""}\n';
1051
- function Skeleton() {
1052
- if (typeof window !== "undefined" && !customElements.get("r-skeleton")) {
1053
- class CustomElement2 extends HTMLElement {
1054
- constructor() {
1055
- super();
1056
- __publicField(this, "_div");
1057
- this._div = document.createElement("div");
1058
- this._div.setAttribute("class", "skeleton");
1059
- const shadowRoot = this.attachShadow({ mode: "closed" });
1060
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
1061
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$2;
1062
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
1063
- shadowRoot.appendChild(this._div);
1064
- }
1065
- static get observedAttributes() {
1066
- return ["disabled"];
1067
- }
1068
- connectedCallback() {
1069
- }
1070
- disconnectCallback() {
1071
- }
1072
- attributeChangedCallback(name, oldValue, newValue) {
1073
- }
1074
- }
1075
- window.customElements.define("r-skeleton", CustomElement2);
1076
- }
1077
- }
1078
- const index$4 = Skeleton();
1079
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1080
- __proto__: null,
1081
- default: index$4
1082
- }, Symbol.toStringTag, { value: "Module" }));
1083
- const f7170ee498e0dd32cbdcb63fba8f75cc$1 = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}\n';
1084
- function CustomElement$1() {
1085
- if (typeof window !== "undefined" && !customElements.get("r-tab")) {
1086
- class TabPane extends HTMLElement {
1087
- constructor() {
1088
- super();
1089
- __publicField(this, "_div");
1090
- __publicField(this, "parent");
1091
- __publicField(this, "initAttribute", () => {
1092
- var _a, _b, _c;
1093
- this.parent = this.parentNode;
1094
- this.key && ((_a = this.parent) == null ? void 0 : _a.updateAttribute(this.key, "icon", this.icon));
1095
- this.key && ((_b = this.parent) == null ? void 0 : _b.updateAttribute(this.key, "iconSize", this.iconSize));
1096
- this.key && ((_c = this.parent) == null ? void 0 : _c.updateAttribute(this.key, "effect", this.effect));
1097
- });
1098
- this._div = document.createElement("slot");
1099
- const shadowRoot = this.attachShadow({ mode: "closed" });
1100
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
1101
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc$1;
1102
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
1103
- shadowRoot.appendChild(this._div);
1104
- }
1105
- static get observedAttributes() {
1106
- return ["label", "key", "disabled", "icon", "effect", "iconSize"];
1107
- }
1108
- get label() {
1109
- return this.getAttribute("label") || "";
1110
- }
1111
- set label(value) {
1112
- this.setAttribute("label", value);
1113
- }
1114
- get icon() {
1115
- return this.getAttribute("icon");
1116
- }
1117
- set icon(value) {
1118
- if (!value || value === "false") {
1119
- this.removeAttribute("icon");
1120
- } else {
1121
- this.setAttribute("icon", value);
1122
- }
1123
- }
1124
- get iconSize() {
1125
- return this.getAttribute("iconSize");
1126
- }
1127
- set iconSize(value) {
1128
- if (!value || value === "false") {
1129
- this.removeAttribute("iconSize");
1130
- } else {
1131
- this.setAttribute("iconSize", value);
1132
- }
1133
- }
1134
- get key() {
1135
- return this.getAttribute("r-key");
1136
- }
1137
- set key(value) {
1138
- if (value) {
1139
- this.setAttribute("r-key", value);
1140
- } else {
1141
- this.removeAttribute("r-key");
1142
- }
1143
- }
1144
- get disabled() {
1145
- return this.getAttribute("disabled");
1146
- }
1147
- set disabled(value) {
1148
- if (!value || value === "false") {
1149
- this.removeAttribute("disabled");
1150
- } else {
1151
- this.setAttribute("disabled", value);
1152
- }
1153
- }
1154
- get effect() {
1155
- return this.getAttribute("effect");
1156
- }
1157
- set effect(value) {
1158
- if (!value || value === "false") {
1159
- this.removeAttribute("effect");
1160
- } else {
1161
- this.setAttribute("effect", value);
1162
- }
1163
- }
1164
- onClick(e) {
1165
- console.log("e", e);
1166
- }
1167
- connectedCallback() {
1168
- this._div.addEventListener("click", this.onClick);
1169
- document.addEventListener("DOMContentLoaded", this.initAttribute);
1170
- }
1171
- disconnectCallback() {
1172
- document.removeEventListener("DOMContentLoaded", this.initAttribute);
1173
- }
1174
- attributeChangedCallback(name, oldValue, newValue) {
1175
- var _a, _b, _c, _d, _e;
1176
- if (oldValue !== newValue && this.key && ((_a = this.parent) == null ? void 0 : _a.updateAttribute)) {
1177
- if (name === "icon")
1178
- (_b = this.parent) == null ? void 0 : _b.updateAttribute(this.key, "icon", newValue);
1179
- if (name === "iconSize")
1180
- (_c = this.parent) == null ? void 0 : _c.updateAttribute(this.key, "iconSize", newValue);
1181
- if (name === "effect")
1182
- (_d = this.parent) == null ? void 0 : _d.updateAttribute(this.key, "effect", newValue);
1183
- if (name === "disabled")
1184
- (_e = this.parent) == null ? void 0 : _e.updateAttribute(this.key, "disabled", newValue);
1185
- }
1186
- }
1187
- }
1188
- customElements.define("r-tab", TabPane);
1189
- return TabPane;
1190
- }
1191
- }
1192
- const index$2 = CustomElement$1();
1193
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1194
- __proto__: null,
1195
- default: index$2
1196
- }, Symbol.toStringTag, { value: "Module" }));
1197
- const f7170ee498e0dd32cbdcb63fba8f75cc = '.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.r-preview-mask{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#00000073;z-index:1081}.r-preview-mask .r-preview-options{width:100%;background:rgba(0,0,0,.1);pointer-events:auto;display:flex;flex-flow:row-reverse nowrap;align-items:center;justify-content:space-between}.r-preview-mask .r-preview-options-close{margin:14px;border:none;cursor:pointer;transition:all .3s;user-select:none;width:25px;height:25px;background:url(./assets/icons/close.svg) no-repeat center center;background-size:contain}.r-preview-mask .r-preview-contain{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context{height:calc(100vh - 44px);overflow:auto}.r-preview-mask .r-preview-contain .r-preview-context section{width:100%;height:690px;position:relative;border:1px solid #333;background-color:#efefef;text-align:center;border-radius:10px;box-shadow:1px 1px 3px #aaa;overflow:hidden}.r-preview-mask .r-preview-contain .r-preview-context section div.block{position:absolute;top:0;left:0;width:100%}.r-preview-mask .r-preview-contain .r-preview-context section div.content{display:flex;flex-direction:column}.r-preview-mask .r-preview-contain .r-preview-context section div.v-up{justify-content:flex-start}.r-preview-mask .r-preview-contain .r-preview-context section div.v-mid{justify-content:center}.r-preview-mask .r-preview-contain .r-preview-context section div.v-down{justify-content:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.h-left{align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.h-mid{align-items:center;text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section div.h-right{align-items:flex-end;text-align:right}.r-preview-mask .r-preview-contain .r-preview-context section div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.up-center{justify-content:flex-start;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.up-right{justify-content:flex-start;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.center-left{justify-content:center;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.center-center{justify-content:center;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.center-right{justify-content:center;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context section div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}.r-preview-mask .r-preview-contain .r-preview-context section div.down-center{justify-content:flex-end;align-items:center}.r-preview-mask .r-preview-contain .r-preview-context section div.down-right{justify-content:flex-end;align-items:flex-end}.r-preview-mask .r-preview-contain .r-preview-context li.slide{margin:10px 0;font-size:18px}.r-preview-mask .r-preview-contain .r-preview-context div.footer{text-align:center}.r-preview-mask .r-preview-contain .r-preview-context section table{position:absolute}.r-preview-mask .r-preview-contain .r-preview-context section table,.r-preview-mask .r-preview-contain .r-preview-context section th,.r-preview-mask .r-preview-contain .r-preview-context section td{border:1px solid black}.r-preview-mask .r-preview-contain .r-preview-context section svg.drawing{position:absolute;overflow:visible}.tab ::slotted(r-tab){box-sizing:border-box;width:100%;height:100%;padding:10px;flex-shrink:0;overflow:auto;text-align:start}.tab-header{position:relative;overflow:hidden;scroll-behavior:smooth}.tab-header_nav{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center}.tab-header_nav::-webkit-scrollbar{display:none}.tab-header_nav__item{flex-shrink:0}.tab-header_nav .active{color:var(--active-color, #1890ff)}.tab-header_line{position:absolute;width:0;margin-top:-2px;height:2px;border-radius:2px;background:var(--line-color, #1890ff);transition:.2s}.tab-content{overflow:hidden}.tab-content_wrap{display:flex;width:100%;height:100%;transition:.2s}:host([type="line"]) .tab-header_nav__item{border:solid 1px transparent}:host([type="line"]) .tab-header_nav .active{color:var(--line-color, #1890ff);border:solid 1px transparent;border-color:var(--border-color, rgba(0, 0, 0, .2)) var(--border-color, rgba(0, 0, 0, .2)) transparent;border-radius:var(--border-radius, .25em) var(--border-radius, .25em) 0 0}:host([type="line"]) .tab-header_line{transition:none;visibility:hidden}:host([type="line"]) .tab-header_line:after,:host([type="line"]) .tab-header_line:before{content:"";position:absolute;visibility:visible;width:9999px;height:1px;bottom:0;background:var(--border-color, rgba(0, 0, 0, .2))}:host([type="line"]) .tab-header_line:after{left:100%}:host([type="line"]) .tab-header_line:before{right:100%}:host([align="center"]) .tab-header_nav{justify-content:center}:host([align="center"]) .tab-header_line{left:50%}:host([align="end"]) .tab-header_nav{justify-content:flex-end}\n';
1198
- function CustomElement() {
1199
- if (typeof window !== "undefined" && !customElements.get("r-tabs")) {
1200
- class Tabs extends HTMLElement {
1201
- constructor() {
1202
- super();
1203
- __publicField(this, "_container");
1204
- __publicField(this, "_header");
1205
- __publicField(this, "_nav");
1206
- __publicField(this, "_line");
1207
- __publicField(this, "_content");
1208
- __publicField(this, "_wrap");
1209
- __publicField(this, "_slot");
1210
- __publicField(this, "tabHeaderKeyMapIndex");
1211
- __publicField(this, "initTabHeaderKeyMapIndex", (key, index2) => {
1212
- const value = this.tabHeaderKeyMapIndex[key];
1213
- if (value) {
1214
- throw new Error(
1215
- "tab \u7EC4\u4EF6\u7684 key \u503C\u5B58\u5728\u91CD\u590D, \u6216\u8005\u67D0\u4E2A tab \u7EC4\u4EF6\u7F3A\u5C11 key \u5C5E\u6027"
1216
- );
1217
- } else {
1218
- this.tabHeaderKeyMapIndex[key] = index2;
1219
- }
1220
- });
1221
- __publicField(this, "initTabLineAlignCenter", () => {
1222
- const { length } = this._nav.children;
1223
- let left = 0;
1224
- for (let i = 0; i < length; i++) {
1225
- const { width = 0 } = this._nav.children[i].getBoundingClientRect();
1226
- left += width;
1227
- }
1228
- this._line.style.setProperty("left", `calc(50% - ${left / 2}px)`);
1229
- });
1230
- __publicField(this, "initTabLineAlignEnd", () => {
1231
- const { length } = this._nav.children;
1232
- let left = 0;
1233
- for (let i = 0; i < length; i++) {
1234
- const { width = 0 } = this._nav.children[i].getBoundingClientRect();
1235
- left += width;
1236
- }
1237
- this._line.style.setProperty("left", `calc(100% - ${left}px)`);
1238
- });
1239
- __publicField(this, "setTabLine", (key) => {
1240
- if (key) {
1241
- const index2 = this.tabHeaderKeyMapIndex[key];
1242
- const TabHeader = this._nav.children[index2];
1243
- const { width = 0 } = TabHeader.getBoundingClientRect();
1244
- this._line.style.setProperty("width", `${width}px`);
1245
- let distance = 0;
1246
- for (let i = 0; i < index2; i++) {
1247
- const item = this._nav.children[i];
1248
- const { width: width2 = 0 } = item.getBoundingClientRect();
1249
- distance += width2;
1250
- }
1251
- this._line.style.setProperty("transform", `translateX(${distance}px)`);
1252
- }
1253
- });
1254
- __publicField(this, "setTabContent", (key) => {
1255
- if (key) {
1256
- const index2 = this.tabHeaderKeyMapIndex[key];
1257
- this._wrap.style.setProperty(
1258
- "transform",
1259
- `translateX(${index2 * -100}%)`
1260
- );
1261
- }
1262
- });
1263
- __publicField(this, "clickTabHead", (e) => {
1264
- const tabHeader = e.target;
1265
- const key = tabHeader.getAttribute("r-key");
1266
- const disabled = isDisabled(tabHeader);
1267
- if (!disabled && key) {
1268
- this.setAttribute("active", key);
1269
- this.setTabLine(key);
1270
- this.setTabContent(key);
1271
- deleteElementChildClass(this._nav, "active");
1272
- setElementClass(tabHeader, "active");
1273
- }
1274
- });
1275
- __publicField(this, "updateAttribute", (key, attribute, value = "") => {
1276
- var _a, _b;
1277
- const index2 = this.tabHeaderKeyMapIndex[key];
1278
- if (key && value && this._nav.children[index2]) {
1279
- (_a = this._nav.children[index2]) == null ? void 0 : _a.setAttribute(attribute, value);
1280
- } else {
1281
- (_b = this._nav.children[index2]) == null ? void 0 : _b.removeAttribute(attribute);
1282
- }
1283
- });
1284
- __publicField(this, "initActive", () => {
1285
- const tabHeaderList = [...this._nav.children];
1286
- const initTabList = tabHeaderList.filter((item) => !isDisabled(item));
1287
- let initTabHeader;
1288
- if (this.active != null) {
1289
- initTabHeader = initTabList.find(
1290
- (item) => item.getAttribute("r-key") === this.active
1291
- );
1292
- initTabHeader == null ? void 0 : initTabHeader.setAttribute("r-key", this.active);
1293
- }
1294
- if (!initTabHeader) {
1295
- initTabHeader = initTabList.shift();
1296
- }
1297
- if (!initTabHeader)
1298
- return;
1299
- const index2 = tabHeaderList.findIndex((item) => item === initTabHeader);
1300
- const key = (initTabHeader == null ? void 0 : initTabHeader.getAttribute("r-key")) || `${index2}`;
1301
- if (key != null) {
1302
- this.setAttribute("active", `${key}`);
1303
- setElementClass(initTabHeader, "active");
1304
- this.setTabContent(key);
1305
- setTimeout(() => {
1306
- this.setTabLine(key);
1307
- }, 200);
1308
- }
1309
- });
1310
- __publicField(this, "listenSlotChange", () => {
1311
- const slots = this._slot.assignedElements();
1312
- slots.forEach((item, index2) => {
1313
- const tabPane = this.createTabHeader(item, index2);
1314
- this._nav.appendChild(tabPane);
1315
- tabPane.addEventListener("click", this.clickTabHead);
1316
- });
1317
- this.initActive();
1318
- if (this.align) {
1319
- if (this.align === "center")
1320
- this.initTabLineAlignCenter();
1321
- if (this.align === "end")
1322
- this.initTabLineAlignEnd();
1323
- }
1324
- });
1325
- __publicField(this, "initTab", () => {
1326
- this._slot.addEventListener("slotchange", this.listenSlotChange);
1327
- });
1328
- __publicField(this, "unloadTab", () => {
1329
- this._slot.removeEventListener("slotchange", this.listenSlotChange);
1330
- });
1331
- this._container = document.createElement("div");
1332
- this._container.setAttribute("class", "tab");
1333
- this._header = document.createElement("div");
1334
- this._header.setAttribute("class", "tab-header");
1335
- this._nav = document.createElement("div");
1336
- this._nav.setAttribute("class", "tab-header_nav");
1337
- this._line = document.createElement("div");
1338
- this._line.setAttribute("class", "tab-header_line");
1339
- this._content = document.createElement("div");
1340
- this._content.setAttribute("class", "tab-content");
1341
- this._wrap = document.createElement("div");
1342
- this._wrap.setAttribute("class", "tab-content_wrap");
1343
- this._slot = document.createElement("slot");
1344
- this._wrap.appendChild(this._slot);
1345
- this._content.appendChild(this._wrap);
1346
- this._header.appendChild(this._nav);
1347
- this._header.appendChild(this._line);
1348
- this._container.appendChild(this._header);
1349
- this._container.appendChild(this._content);
1350
- this.tabHeaderKeyMapIndex = {};
1351
- const shadowRoot = this.attachShadow({ mode: "closed" });
1352
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
1353
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
1354
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
1355
- shadowRoot.appendChild(this._container);
1356
- }
1357
- static get observedAttributes() {
1358
- return ["active", "forceRender", "type", "align", "effect"];
1359
- }
1360
- get align() {
1361
- return this.getAttribute("align") || "start";
1362
- }
1363
- set align(value) {
1364
- this.setAttribute("align", value);
1365
- }
1366
- set type(value) {
1367
- this.setAttribute("type", value);
1368
- }
1369
- get type() {
1370
- return this.getAttribute("type") || "flat";
1371
- }
1372
- get active() {
1373
- return this.getAttribute("active");
1374
- }
1375
- set active(value) {
1376
- if (value) {
1377
- this.setAttribute("active", value);
1378
- this.setTabLine(value);
1379
- this.setTabContent(value);
1380
- } else {
1381
- this.removeAttribute("active");
1382
- }
1383
- }
1384
- get effect() {
1385
- return this.getAttribute("effect");
1386
- }
1387
- set effect(value) {
1388
- if (!value || value === "false") {
1389
- this.removeAttribute("effect");
1390
- } else {
1391
- this.setAttribute("effect", value);
1392
- }
1393
- }
1394
- createTabHeader(tabPane, index2) {
1395
- const label = tabPane.getAttribute("label") || "";
1396
- const icon = tabPane.getAttribute("icon") || "";
1397
- const iconSize = tabPane.getAttribute("iconSize") || "";
1398
- const key = tabPane.getAttribute("r-key") || `${index2}`;
1399
- const type = tabPane.getAttribute("type") || "text";
1400
- this.initTabHeaderKeyMapIndex(key, index2);
1401
- const tabHeader = document.createElement("r-button");
1402
- tabHeader.setAttribute("class", "tab-header_nav__item");
1403
- tabHeader.setAttribute("type", type);
1404
- icon && tabHeader.setAttribute("icon", icon);
1405
- iconSize && tabHeader.setAttribute("iconSize", iconSize);
1406
- isDisabled(tabPane) && tabHeader.setAttribute("disabled", "");
1407
- tabHeader.setAttribute("r-key", key);
1408
- if (this.effect) {
1409
- tabPane.setAttribute("effect", this.effect);
1410
- this._line.style.setProperty("display", "none");
1411
- }
1412
- tabPane.setAttribute("r-key", key);
1413
- tabHeader.innerHTML = label;
1414
- return tabHeader;
1415
- }
1416
- connectedCallback() {
1417
- this.initTab();
1418
- }
1419
- disconnectCallback() {
1420
- this.unloadTab();
1421
- }
1422
- attributeChangedCallback(name, oldValue, newValue) {
1423
- if (oldValue !== newValue) {
1424
- this.dispatchEvent(
1425
- new CustomEvent("change", {
1426
- detail: {
1427
- active: this.active
1428
- }
1429
- })
1430
- );
1431
- if (name === "align") {
1432
- if (newValue === "center")
1433
- this.initTabLineAlignCenter();
1434
- if (newValue === "end")
1435
- this.initTabLineAlignEnd();
1436
- }
1437
- if (name === "effect") {
1438
- const tabHeaderList = [...this._nav.children];
1439
- tabHeaderList.forEach((item) => {
1440
- if (!this.effect || this.effect === "false") {
1441
- item.removeAttribute("effect");
1442
- } else {
1443
- item.setAttribute("effect", newValue);
1444
- }
1445
- });
1446
- }
1447
- if (name === "active") {
1448
- this.setAttribute(name, newValue);
1449
- }
1450
- }
1451
- }
1452
- }
1453
- customElements.define("r-tabs", Tabs);
1454
- return Tabs;
1455
- }
1456
- }
1457
- const index = CustomElement();
1458
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1459
- __proto__: null,
1460
- default: index
1461
- }, Symbol.toStringTag, { value: "Module" }));
1462
- if (typeof document !== "undefined") {
1463
- const style = document.createElement("style");
1464
- style.textContent = styles;
1465
- document.body.appendChild(style);
1466
- }
1467
- export {
1468
- index$e as a,
1469
- index$c as b,
1470
- index$a as c,
1471
- index$8 as d,
1472
- index$7 as e,
1473
- index$5 as f,
1474
- index$3 as g,
1475
- index$1 as h,
1476
- index$g as i,
1477
- loadScript as l
1478
- };