ranui 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-user-b2bed3e7.js +4 -0
- package/dist/book-b11a68eb.js +4 -0
- package/dist/build/config.d.ts +3 -0
- package/dist/check-circle-74bd09c3.js +4 -0
- package/dist/check-circle-fill-dc284144.js +4 -0
- package/dist/close-20925345.js +4 -0
- package/dist/close-circle-720c18be.js +4 -0
- package/dist/close-circle-fill-238a66b1.js +4 -0
- package/dist/components/button/index.js +4 -2
- package/dist/components/icon/index.js +3 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/message/index.d.ts +12 -6
- package/dist/components/message/index.js +1 -2
- package/dist/components/modal/index.js +4 -0
- package/dist/components/option/index.d.ts +2 -0
- package/dist/components/option/index.js +95 -0
- package/dist/components/{video → player}/index.d.ts +198 -87
- package/dist/components/player/index.js +11 -0
- package/dist/components/preview/excel/excel.d.ts +0 -9
- package/dist/components/preview/index.d.ts +4 -0
- package/dist/components/preview/index.js +5 -4
- package/dist/components/progress/index.d.ts +36 -0
- package/dist/components/progress/index.js +8 -0
- package/dist/components/radar/index.js +4 -2
- package/dist/components/select/index.d.ts +101 -0
- package/dist/components/select/index.js +11 -0
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/tab/index.js +4 -2
- package/dist/components/tabpane/index.js +1 -1
- package/dist/docx-c5d02d8c.js +21 -0
- package/dist/eye-5e742329.js +4 -0
- package/dist/eye-close-3874f1ae.js +4 -0
- package/dist/home-c4a05e8b.js +4 -0
- package/dist/index-0e7229ea.js +328 -0
- package/dist/index-183517e7.js +265 -0
- package/dist/index-48653b79.js +162 -0
- package/dist/index-4d873a42.js +195 -0
- package/dist/index-57492b9b.js +48 -0
- package/dist/index-5975bbc0.js +126 -0
- package/dist/{index-64d03ac1.js → index-7b8840f9.js} +1 -4
- package/dist/index-7f513a14.js +175 -0
- package/dist/index-8e1e2573.js +19 -0
- package/dist/index-a1a53af6.js +354 -0
- package/dist/index-a216f328.js +662 -0
- package/dist/index-a43b144f.js +232 -0
- package/dist/index-aea75a9f.js +78 -0
- package/dist/index-b2be6bef.js +10423 -0
- package/dist/index-b90299ca.js +43 -0
- package/dist/index-d2d69b06.js +225 -0
- package/dist/index-ecaed5cc.js +439 -0
- package/dist/index-f6d6982d.js +516 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +23 -13
- package/dist/info-circle-5826decc.js +4 -0
- package/dist/info-circle-fill-90ec9aa9.js +14 -0
- package/dist/loading-09ca52df.js +4 -0
- package/dist/lock-1d2487c9.js +4 -0
- package/dist/message-b2bfdea7.js +4 -0
- package/dist/{pdf-6e38f826.js → pdf-bdb7818a.js} +1 -2
- package/dist/playwright.config.d.ts +0 -2
- package/dist/power-off-6ade5a91.js +4 -0
- package/dist/preview-b291aea8.js +4 -0
- package/dist/setting-1e5ccb6d.js +4 -0
- package/dist/style.css +1 -1
- package/dist/team-ca6a12e1.js +4 -0
- package/dist/umd/build/config.d.ts +3 -0
- package/dist/umd/components/message/index.d.ts +12 -6
- package/dist/umd/components/option/index.d.ts +2 -0
- package/dist/umd/components/{video → player}/index.d.ts +198 -87
- package/dist/umd/components/preview/excel/excel.d.ts +0 -9
- package/dist/umd/components/preview/index.d.ts +4 -0
- package/dist/umd/components/progress/index.d.ts +36 -0
- package/dist/umd/components/select/index.d.ts +101 -0
- package/dist/umd/index.d.ts +4 -0
- package/dist/umd/index.umd.cjs +26 -8
- package/dist/umd/playwright.config.d.ts +0 -2
- package/dist/umd/style.css +1 -1
- package/dist/umd/utils/image.d.ts +32 -0
- package/dist/umd/utils/index.d.ts +41 -32
- package/dist/umd/utils/math.d.ts +26 -0
- package/dist/umd/utils/tween.d.ts +21 -0
- package/dist/unlock-f56086fd.js +4 -0
- package/dist/user-5c01e665.js +4 -0
- package/dist/utils/image.d.ts +32 -0
- package/dist/utils/index.d.ts +41 -32
- package/dist/utils/math.d.ts +26 -0
- package/dist/utils/tween.d.ts +21 -0
- package/dist/{index-a55c2dff.js → vendor-f71e6f68.js} +7771 -1268
- package/dist/warning-circle-035e025c.js +4 -0
- package/dist/warning-circle-fill-d17c37c9.js +4 -0
- package/package.json +38 -6
- package/readme.md +2 -3
- package/dist/_commonjs-dynamic-modules-2ceabb0b.js +0 -12
- package/dist/add-user-d07564bd.js +0 -4
- package/dist/assets/image/failImage.d.ts +0 -2
- package/dist/base-bcc748a2.js +0 -1
- package/dist/book-2a5a596c.js +0 -4
- package/dist/check-circle-2c986969.js +0 -4
- package/dist/check-circle-fill-62eaa796.js +0 -4
- package/dist/close-circle-2afb6e94.js +0 -4
- package/dist/close-circle-fill-b6906239.js +0 -4
- package/dist/close-ee3ba1d1.js +0 -4
- package/dist/docx-5262a8f1.js +0 -2635
- package/dist/eye-bd60afe1.js +0 -4
- package/dist/eye-close-bde3c1fc.js +0 -4
- package/dist/home-f824d8f4.js +0 -4
- package/dist/index-00913cab.js +0 -43
- package/dist/index-07c8e518.js +0 -327
- package/dist/index-105ed089.js +0 -127
- package/dist/index-2243317e.js +0 -155
- package/dist/index-441da303.js +0 -196
- package/dist/index-4459fbd0.js +0 -108
- package/dist/index-57d3be68.js +0 -450
- package/dist/index-a7db1b7b.js +0 -175
- package/dist/index-b580f377.js +0 -78
- package/dist/index-b99ac79f.js +0 -353
- package/dist/index-c558bde2.js +0 -218
- package/dist/info-circle-59333e1c.js +0 -4
- package/dist/info-circle-fill-3ab7660d.js +0 -4
- package/dist/jszip.min-97cf7c6a.js +0 -2655
- package/dist/loading-407d8249.js +0 -4
- package/dist/lock-6d20715b.js +0 -4
- package/dist/message-ee4fe153.js +0 -4
- package/dist/power-off-bbec6b5f.js +0 -4
- package/dist/preview-164a4944.js +0 -4
- package/dist/setting-735a1963.js +0 -4
- package/dist/team-42573142.js +0 -4
- package/dist/umd/assets/image/failImage.d.ts +0 -2
- package/dist/unlock-ae33c6f7.js +0 -4
- package/dist/user-b7098183.js +0 -4
- package/dist/warning-circle-536d4749.js +0 -4
- package/dist/warning-circle-fill-e4be98bc.js +0 -4
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
import { p as perToNum } from "./index-d2d69b06.js";
|
|
8
|
+
import { c as createCustomError } from "./index-57492b9b.js";
|
|
9
|
+
const index$2 = "";
|
|
10
|
+
const attributes = ["percent", "type", "total", "dot"];
|
|
11
|
+
class Progress extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
__publicField(this, "_progress");
|
|
15
|
+
__publicField(this, "_progressWrap");
|
|
16
|
+
__publicField(this, "_progressWrapValue");
|
|
17
|
+
__publicField(this, "_progressDot");
|
|
18
|
+
__publicField(this, "moveProgress");
|
|
19
|
+
__publicField(this, "progressClick", (e) => {
|
|
20
|
+
const rect = this._progress.getBoundingClientRect();
|
|
21
|
+
const offsetX = e.clientX - rect.left;
|
|
22
|
+
const percentage = Math.min(
|
|
23
|
+
1,
|
|
24
|
+
Math.max(0, offsetX / this._progress.offsetWidth)
|
|
25
|
+
);
|
|
26
|
+
this.percent = percentage * this.total;
|
|
27
|
+
this._progressWrapValue.style.setProperty(
|
|
28
|
+
"transform",
|
|
29
|
+
`scaleX(${percentage})`
|
|
30
|
+
);
|
|
31
|
+
this._progressDot.style.setProperty(
|
|
32
|
+
"transform",
|
|
33
|
+
`translateX(${percentage * this._progress.offsetWidth}px)`
|
|
34
|
+
);
|
|
35
|
+
this.change();
|
|
36
|
+
});
|
|
37
|
+
__publicField(this, "progressDotMouseDown", () => {
|
|
38
|
+
this.moveProgress.mouseDown = true;
|
|
39
|
+
});
|
|
40
|
+
__publicField(this, "progressDotMouseMove", (e) => {
|
|
41
|
+
if (!this.moveProgress.mouseDown)
|
|
42
|
+
return;
|
|
43
|
+
const rect = this._progress.getBoundingClientRect();
|
|
44
|
+
const offsetX = e.clientX - rect.left;
|
|
45
|
+
const percentage = Math.min(
|
|
46
|
+
1,
|
|
47
|
+
Math.max(0, offsetX / this._progress.offsetWidth)
|
|
48
|
+
);
|
|
49
|
+
this.percent = percentage * this.total;
|
|
50
|
+
this._progressWrapValue.style.setProperty(
|
|
51
|
+
"transform",
|
|
52
|
+
`scaleX(${percentage})`
|
|
53
|
+
);
|
|
54
|
+
this._progressDot.style.setProperty(
|
|
55
|
+
"transform",
|
|
56
|
+
`translateX(${percentage * this._progress.offsetWidth}px)`
|
|
57
|
+
);
|
|
58
|
+
this.change();
|
|
59
|
+
});
|
|
60
|
+
__publicField(this, "progressDotMouseUp", (e) => {
|
|
61
|
+
if (!this.moveProgress.mouseDown)
|
|
62
|
+
return;
|
|
63
|
+
this.moveProgress.mouseDown = false;
|
|
64
|
+
});
|
|
65
|
+
__publicField(this, "change", () => {
|
|
66
|
+
this.dispatchEvent(
|
|
67
|
+
new CustomEvent("change", {
|
|
68
|
+
detail: {
|
|
69
|
+
value: this.percent,
|
|
70
|
+
percent: this.percent,
|
|
71
|
+
total: this.total
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
__publicField(this, "appendProgressDot", () => {
|
|
77
|
+
if (this.dot === "true" && !this._progress.contains(this._progressDot)) {
|
|
78
|
+
this._progress.appendChild(this._progressDot);
|
|
79
|
+
}
|
|
80
|
+
if (this.dot === "false" && this._progress.contains(this._progressDot)) {
|
|
81
|
+
this._progress.removeChild(this._progressDot);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
__publicField(this, "updateCurrentProgress", () => {
|
|
85
|
+
const percent = this.percent / this.total;
|
|
86
|
+
this._progressWrapValue.style.setProperty(
|
|
87
|
+
"transform",
|
|
88
|
+
`scaleX(${percent})`
|
|
89
|
+
);
|
|
90
|
+
this._progressDot.style.setProperty(
|
|
91
|
+
"transform",
|
|
92
|
+
`translateX(${percent * this._progress.offsetWidth}px)`
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
__publicField(this, "dragEvent", () => {
|
|
96
|
+
if (this.type !== "drag")
|
|
97
|
+
return;
|
|
98
|
+
this._progress.addEventListener("click", this.progressClick);
|
|
99
|
+
this._progressDot.addEventListener("mousedown", this.progressDotMouseDown);
|
|
100
|
+
document.addEventListener("mousemove", this.progressDotMouseMove);
|
|
101
|
+
document.addEventListener("mouseup", this.progressDotMouseUp);
|
|
102
|
+
});
|
|
103
|
+
__publicField(this, "createProgress", () => {
|
|
104
|
+
if (!this.contains(this._progress)) {
|
|
105
|
+
this.appendChild(this._progress);
|
|
106
|
+
this._progress.appendChild(this._progressDot);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
__publicField(this, "resize", () => {
|
|
110
|
+
this.updateCurrentProgress();
|
|
111
|
+
});
|
|
112
|
+
this._progress = document.createElement("div");
|
|
113
|
+
this._progress.setAttribute("class", "ran-progress");
|
|
114
|
+
this._progressWrap = document.createElement("div");
|
|
115
|
+
this._progressWrap.setAttribute("class", "ran-progress-wrap");
|
|
116
|
+
this._progress.appendChild(this._progressWrap);
|
|
117
|
+
this._progressWrapValue = document.createElement("div");
|
|
118
|
+
this._progressWrapValue.setAttribute("class", "ran-progress-wrap-value");
|
|
119
|
+
this._progressWrap.appendChild(this._progressWrapValue);
|
|
120
|
+
this._progressDot = document.createElement("div");
|
|
121
|
+
this._progressDot.setAttribute("class", "ran-progress-dot");
|
|
122
|
+
this.moveProgress = {
|
|
123
|
+
mouseDown: false
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get observedAttributes() {
|
|
127
|
+
return attributes;
|
|
128
|
+
}
|
|
129
|
+
get percent() {
|
|
130
|
+
const percent = this.getAttribute("percent") || "";
|
|
131
|
+
const num = perToNum(percent);
|
|
132
|
+
if (num > this.total) {
|
|
133
|
+
console.error("percent must be < total");
|
|
134
|
+
return this.total;
|
|
135
|
+
}
|
|
136
|
+
return perToNum(percent);
|
|
137
|
+
}
|
|
138
|
+
set percent(value) {
|
|
139
|
+
this.setAttribute("percent", `${value || 0}`);
|
|
140
|
+
}
|
|
141
|
+
get total() {
|
|
142
|
+
const total = this.getAttribute("total");
|
|
143
|
+
if (!total)
|
|
144
|
+
return 1;
|
|
145
|
+
return perToNum(total);
|
|
146
|
+
}
|
|
147
|
+
set total(value) {
|
|
148
|
+
this.setAttribute("total", value || "");
|
|
149
|
+
}
|
|
150
|
+
get type() {
|
|
151
|
+
const result = ["primary", "drag"];
|
|
152
|
+
const type = this.getAttribute("type") || "";
|
|
153
|
+
if (result.includes(type)) {
|
|
154
|
+
return type;
|
|
155
|
+
} else {
|
|
156
|
+
return "primary";
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
set type(value) {
|
|
160
|
+
this.setAttribute("type", value || "primary");
|
|
161
|
+
}
|
|
162
|
+
get animation() {
|
|
163
|
+
const result = ["play", "pause"];
|
|
164
|
+
const animation = this.getAttribute("animation") || "";
|
|
165
|
+
if (result.includes(animation)) {
|
|
166
|
+
return animation;
|
|
167
|
+
} else {
|
|
168
|
+
return "pause";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
set animation(value) {
|
|
172
|
+
this.setAttribute("animation", value || "pause");
|
|
173
|
+
}
|
|
174
|
+
get dot() {
|
|
175
|
+
const result = ["true", "false"];
|
|
176
|
+
const dot = this.getAttribute("dot") || "";
|
|
177
|
+
if (result.includes(dot)) {
|
|
178
|
+
return dot;
|
|
179
|
+
} else {
|
|
180
|
+
return "true";
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
set dot(value) {
|
|
184
|
+
this.setAttribute("dot", value || "true");
|
|
185
|
+
}
|
|
186
|
+
connectedCallback() {
|
|
187
|
+
this.dragEvent();
|
|
188
|
+
this.updateCurrentProgress();
|
|
189
|
+
window.addEventListener("resize", this.resize);
|
|
190
|
+
}
|
|
191
|
+
disconnectCallback() {
|
|
192
|
+
this._progress.removeEventListener("click", this.progressClick);
|
|
193
|
+
this._progressDot.removeEventListener(
|
|
194
|
+
"mousedown",
|
|
195
|
+
this.progressDotMouseDown
|
|
196
|
+
);
|
|
197
|
+
document.removeEventListener("mousemove", this.progressDotMouseMove);
|
|
198
|
+
document.removeEventListener("mouseup", this.progressDotMouseUp);
|
|
199
|
+
window.removeEventListener("resize", this.resize);
|
|
200
|
+
}
|
|
201
|
+
attributeChangedCallback(k, o, n) {
|
|
202
|
+
if (o !== n) {
|
|
203
|
+
if (k === "type") {
|
|
204
|
+
this.createProgress();
|
|
205
|
+
}
|
|
206
|
+
if (k === "dot") {
|
|
207
|
+
this.appendProgressDot();
|
|
208
|
+
}
|
|
209
|
+
if (k === "percent") {
|
|
210
|
+
this.updateCurrentProgress();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function Custom() {
|
|
216
|
+
if (typeof document !== "undefined" && !customElements.get("r-progress")) {
|
|
217
|
+
customElements.define("r-progress", Progress);
|
|
218
|
+
} else {
|
|
219
|
+
return createCustomError("document is undefined or r-progress is exist");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const index = Custom();
|
|
223
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
224
|
+
__proto__: null,
|
|
225
|
+
Progress,
|
|
226
|
+
default: index
|
|
227
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
228
|
+
export {
|
|
229
|
+
Progress as P,
|
|
230
|
+
index as a,
|
|
231
|
+
index$1 as i
|
|
232
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
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 f7170ee498e0dd32cbdcb63fba8f75cc = "";
|
|
8
|
+
const failImage = `
|
|
9
|
+
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoB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JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==
|
|
10
|
+
`;
|
|
11
|
+
function Custom() {
|
|
12
|
+
if (typeof window !== "undefined" && !customElements.get("r-img")) {
|
|
13
|
+
class CustomElement extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
__publicField(this, "_image");
|
|
17
|
+
__publicField(this, "_container");
|
|
18
|
+
this._container = document.createElement("div");
|
|
19
|
+
this._container.setAttribute("class", "ran-image");
|
|
20
|
+
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
21
|
+
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
22
|
+
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
23
|
+
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
24
|
+
shadowRoot.appendChild(this._container);
|
|
25
|
+
}
|
|
26
|
+
static get observedAttributes() {
|
|
27
|
+
return ["fallback"];
|
|
28
|
+
}
|
|
29
|
+
get fallback() {
|
|
30
|
+
return this.getAttribute("fallback") || failImage;
|
|
31
|
+
}
|
|
32
|
+
set fallback(value) {
|
|
33
|
+
if (value) {
|
|
34
|
+
this.setAttribute("fallback", value);
|
|
35
|
+
} else {
|
|
36
|
+
this.removeAttribute("fallback");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
listenFallback(name, value) {
|
|
40
|
+
if (name === "fallback" && this._image) {
|
|
41
|
+
if (value) {
|
|
42
|
+
this._image.setAttribute("fallback", value);
|
|
43
|
+
} else {
|
|
44
|
+
this._image.removeAttribute("fallback");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
connectedCallback() {
|
|
49
|
+
const src = this.getAttribute("src") || "";
|
|
50
|
+
this._image = new Image();
|
|
51
|
+
this._image.src = src;
|
|
52
|
+
this._image.addEventListener("error", () => {
|
|
53
|
+
if (this._image && this.fallback) {
|
|
54
|
+
this._image.src = this.fallback;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
this._image.addEventListener("load", () => {
|
|
58
|
+
if (this._image) {
|
|
59
|
+
this._container.appendChild(this._image);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
64
|
+
this.listenFallback(name, newValue);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
customElements.define("r-img", CustomElement);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const index = Custom();
|
|
71
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
72
|
+
__proto__: null,
|
|
73
|
+
default: index
|
|
74
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
75
|
+
export {
|
|
76
|
+
index as a,
|
|
77
|
+
index$1 as i
|
|
78
|
+
};
|