@ayu-sh-kr/dota-ui 0.0.4 → 0.0.6
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/dota-ui.cjs +3350 -0
- package/dist/{style.css → dota-ui.css} +606 -499
- package/dist/{index.mjs → dota-ui.mjs} +1232 -1138
- package/dist/index.d.ts +974 -3
- package/package.json +23 -8
- package/dist/components/accordian/accordion.component.d.ts +0 -16
- package/dist/components/accordian/accordion.config.d.ts +0 -21
- package/dist/components/avatar/avatar.component.d.ts +0 -25
- package/dist/components/badge/badge.component.d.ts +0 -14
- package/dist/components/badge/badge.config.d.ts +0 -75
- package/dist/components/button/button.component.d.ts +0 -23
- package/dist/components/button/button.config.d.ts +0 -9
- package/dist/components/card/card.component.d.ts +0 -33
- package/dist/components/chip/chip.component.d.ts +0 -11
- package/dist/components/chip/chip.config.d.ts +0 -30
- package/dist/components/icon/icons.component.d.ts +0 -15
- package/dist/components/icon/icons.config.d.ts +0 -19
- package/dist/components/index.d.ts +0 -11
- package/dist/components/modal/modal.component.d.ts +0 -16
- package/dist/components/modal/modal.config.d.ts +0 -56
- package/dist/components/placeholder/placeholder.component.d.ts +0 -6
- package/dist/components/popover/popover.component.d.ts +0 -25
- package/dist/components/utils/scaffold.component.d.ts +0 -7
- package/dist/configs/app.config.d.ts +0 -2
- package/dist/configs/index.d.ts +0 -2
- package/dist/dota-ui.d.ts +0 -2
- package/dist/main.d.ts +0 -1
- package/dist/utils/debounce.d.ts +0 -25
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/position-calculator.utils.d.ts +0 -69
- package/dist/utils/position.utils.d.ts +0 -106
- package/tailwind.config.ts +0 -13
- package/tsconfig.json +0 -41
package/dist/dota-ui.cjs
ADDED
|
@@ -0,0 +1,3350 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
var _a, _b, _c, _d, _e;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
const dotaCore = require("@ayu-sh-kr/dota-core");
|
|
8
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
9
|
+
var _Reflect = {};
|
|
10
|
+
/*! *****************************************************************************
|
|
11
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
12
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
13
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
14
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
17
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
18
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
19
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
20
|
+
|
|
21
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
22
|
+
and limitations under the License.
|
|
23
|
+
***************************************************************************** */
|
|
24
|
+
var hasRequired_Reflect;
|
|
25
|
+
function require_Reflect() {
|
|
26
|
+
if (hasRequired_Reflect) return _Reflect;
|
|
27
|
+
hasRequired_Reflect = 1;
|
|
28
|
+
var Reflect2;
|
|
29
|
+
(function(Reflect3) {
|
|
30
|
+
(function(factory) {
|
|
31
|
+
var root = typeof globalThis === "object" ? globalThis : typeof commonjsGlobal === "object" ? commonjsGlobal : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
|
|
32
|
+
var exporter = makeExporter(Reflect3);
|
|
33
|
+
if (typeof root.Reflect !== "undefined") {
|
|
34
|
+
exporter = makeExporter(root.Reflect, exporter);
|
|
35
|
+
}
|
|
36
|
+
factory(exporter, root);
|
|
37
|
+
if (typeof root.Reflect === "undefined") {
|
|
38
|
+
root.Reflect = Reflect3;
|
|
39
|
+
}
|
|
40
|
+
function makeExporter(target, previous) {
|
|
41
|
+
return function(key, value) {
|
|
42
|
+
Object.defineProperty(target, key, { configurable: true, writable: true, value });
|
|
43
|
+
if (previous)
|
|
44
|
+
previous(key, value);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function functionThis() {
|
|
48
|
+
try {
|
|
49
|
+
return Function("return this;")();
|
|
50
|
+
} catch (_) {
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function indirectEvalThis() {
|
|
54
|
+
try {
|
|
55
|
+
return (void 0, eval)("(function() { return this; })()");
|
|
56
|
+
} catch (_) {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function sloppyModeThis() {
|
|
60
|
+
return functionThis() || indirectEvalThis();
|
|
61
|
+
}
|
|
62
|
+
})(function(exporter, root) {
|
|
63
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
64
|
+
var supportsSymbol = typeof Symbol === "function";
|
|
65
|
+
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
66
|
+
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
67
|
+
var supportsCreate = typeof Object.create === "function";
|
|
68
|
+
var supportsProto = { __proto__: [] } instanceof Array;
|
|
69
|
+
var downLevel = !supportsCreate && !supportsProto;
|
|
70
|
+
var HashMap = {
|
|
71
|
+
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
72
|
+
create: supportsCreate ? function() {
|
|
73
|
+
return MakeDictionary(/* @__PURE__ */ Object.create(null));
|
|
74
|
+
} : supportsProto ? function() {
|
|
75
|
+
return MakeDictionary({ __proto__: null });
|
|
76
|
+
} : function() {
|
|
77
|
+
return MakeDictionary({});
|
|
78
|
+
},
|
|
79
|
+
has: downLevel ? function(map, key) {
|
|
80
|
+
return hasOwn.call(map, key);
|
|
81
|
+
} : function(map, key) {
|
|
82
|
+
return key in map;
|
|
83
|
+
},
|
|
84
|
+
get: downLevel ? function(map, key) {
|
|
85
|
+
return hasOwn.call(map, key) ? map[key] : void 0;
|
|
86
|
+
} : function(map, key) {
|
|
87
|
+
return map[key];
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var functionPrototype = Object.getPrototypeOf(Function);
|
|
91
|
+
var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
92
|
+
var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
93
|
+
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
94
|
+
var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : void 0;
|
|
95
|
+
var metadataRegistry = GetOrCreateMetadataRegistry();
|
|
96
|
+
var metadataProvider = CreateMetadataProvider(metadataRegistry);
|
|
97
|
+
function decorate(decorators, target, propertyKey, attributes) {
|
|
98
|
+
if (!IsUndefined(propertyKey)) {
|
|
99
|
+
if (!IsArray(decorators))
|
|
100
|
+
throw new TypeError();
|
|
101
|
+
if (!IsObject(target))
|
|
102
|
+
throw new TypeError();
|
|
103
|
+
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
104
|
+
throw new TypeError();
|
|
105
|
+
if (IsNull(attributes))
|
|
106
|
+
attributes = void 0;
|
|
107
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
108
|
+
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
109
|
+
} else {
|
|
110
|
+
if (!IsArray(decorators))
|
|
111
|
+
throw new TypeError();
|
|
112
|
+
if (!IsConstructor(target))
|
|
113
|
+
throw new TypeError();
|
|
114
|
+
return DecorateConstructor(decorators, target);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exporter("decorate", decorate);
|
|
118
|
+
function metadata(metadataKey, metadataValue) {
|
|
119
|
+
function decorator(target, propertyKey) {
|
|
120
|
+
if (!IsObject(target))
|
|
121
|
+
throw new TypeError();
|
|
122
|
+
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
123
|
+
throw new TypeError();
|
|
124
|
+
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
125
|
+
}
|
|
126
|
+
return decorator;
|
|
127
|
+
}
|
|
128
|
+
exporter("metadata", metadata);
|
|
129
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
130
|
+
if (!IsObject(target))
|
|
131
|
+
throw new TypeError();
|
|
132
|
+
if (!IsUndefined(propertyKey))
|
|
133
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
134
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
135
|
+
}
|
|
136
|
+
exporter("defineMetadata", defineMetadata);
|
|
137
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
138
|
+
if (!IsObject(target))
|
|
139
|
+
throw new TypeError();
|
|
140
|
+
if (!IsUndefined(propertyKey))
|
|
141
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
142
|
+
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
143
|
+
}
|
|
144
|
+
exporter("hasMetadata", hasMetadata);
|
|
145
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
146
|
+
if (!IsObject(target))
|
|
147
|
+
throw new TypeError();
|
|
148
|
+
if (!IsUndefined(propertyKey))
|
|
149
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
150
|
+
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
151
|
+
}
|
|
152
|
+
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
153
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
154
|
+
if (!IsObject(target))
|
|
155
|
+
throw new TypeError();
|
|
156
|
+
if (!IsUndefined(propertyKey))
|
|
157
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
158
|
+
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
159
|
+
}
|
|
160
|
+
exporter("getMetadata", getMetadata);
|
|
161
|
+
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
162
|
+
if (!IsObject(target))
|
|
163
|
+
throw new TypeError();
|
|
164
|
+
if (!IsUndefined(propertyKey))
|
|
165
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
166
|
+
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
167
|
+
}
|
|
168
|
+
exporter("getOwnMetadata", getOwnMetadata);
|
|
169
|
+
function getMetadataKeys(target, propertyKey) {
|
|
170
|
+
if (!IsObject(target))
|
|
171
|
+
throw new TypeError();
|
|
172
|
+
if (!IsUndefined(propertyKey))
|
|
173
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
174
|
+
return OrdinaryMetadataKeys(target, propertyKey);
|
|
175
|
+
}
|
|
176
|
+
exporter("getMetadataKeys", getMetadataKeys);
|
|
177
|
+
function getOwnMetadataKeys(target, propertyKey) {
|
|
178
|
+
if (!IsObject(target))
|
|
179
|
+
throw new TypeError();
|
|
180
|
+
if (!IsUndefined(propertyKey))
|
|
181
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
182
|
+
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
183
|
+
}
|
|
184
|
+
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
185
|
+
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
186
|
+
if (!IsObject(target))
|
|
187
|
+
throw new TypeError();
|
|
188
|
+
if (!IsUndefined(propertyKey))
|
|
189
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
190
|
+
if (!IsObject(target))
|
|
191
|
+
throw new TypeError();
|
|
192
|
+
if (!IsUndefined(propertyKey))
|
|
193
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
194
|
+
var provider = GetMetadataProvider(
|
|
195
|
+
target,
|
|
196
|
+
propertyKey,
|
|
197
|
+
/*Create*/
|
|
198
|
+
false
|
|
199
|
+
);
|
|
200
|
+
if (IsUndefined(provider))
|
|
201
|
+
return false;
|
|
202
|
+
return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);
|
|
203
|
+
}
|
|
204
|
+
exporter("deleteMetadata", deleteMetadata);
|
|
205
|
+
function DecorateConstructor(decorators, target) {
|
|
206
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
207
|
+
var decorator = decorators[i];
|
|
208
|
+
var decorated = decorator(target);
|
|
209
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
210
|
+
if (!IsConstructor(decorated))
|
|
211
|
+
throw new TypeError();
|
|
212
|
+
target = decorated;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return target;
|
|
216
|
+
}
|
|
217
|
+
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
218
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
219
|
+
var decorator = decorators[i];
|
|
220
|
+
var decorated = decorator(target, propertyKey, descriptor);
|
|
221
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
222
|
+
if (!IsObject(decorated))
|
|
223
|
+
throw new TypeError();
|
|
224
|
+
descriptor = decorated;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return descriptor;
|
|
228
|
+
}
|
|
229
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
230
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
231
|
+
if (hasOwn2)
|
|
232
|
+
return true;
|
|
233
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
234
|
+
if (!IsNull(parent))
|
|
235
|
+
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
239
|
+
var provider = GetMetadataProvider(
|
|
240
|
+
O,
|
|
241
|
+
P,
|
|
242
|
+
/*Create*/
|
|
243
|
+
false
|
|
244
|
+
);
|
|
245
|
+
if (IsUndefined(provider))
|
|
246
|
+
return false;
|
|
247
|
+
return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
|
|
248
|
+
}
|
|
249
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
250
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
251
|
+
if (hasOwn2)
|
|
252
|
+
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
253
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
254
|
+
if (!IsNull(parent))
|
|
255
|
+
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
259
|
+
var provider = GetMetadataProvider(
|
|
260
|
+
O,
|
|
261
|
+
P,
|
|
262
|
+
/*Create*/
|
|
263
|
+
false
|
|
264
|
+
);
|
|
265
|
+
if (IsUndefined(provider))
|
|
266
|
+
return;
|
|
267
|
+
return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
268
|
+
}
|
|
269
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
270
|
+
var provider = GetMetadataProvider(
|
|
271
|
+
O,
|
|
272
|
+
P,
|
|
273
|
+
/*Create*/
|
|
274
|
+
true
|
|
275
|
+
);
|
|
276
|
+
provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);
|
|
277
|
+
}
|
|
278
|
+
function OrdinaryMetadataKeys(O, P) {
|
|
279
|
+
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
280
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
281
|
+
if (parent === null)
|
|
282
|
+
return ownKeys;
|
|
283
|
+
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
284
|
+
if (parentKeys.length <= 0)
|
|
285
|
+
return ownKeys;
|
|
286
|
+
if (ownKeys.length <= 0)
|
|
287
|
+
return parentKeys;
|
|
288
|
+
var set = new _Set();
|
|
289
|
+
var keys = [];
|
|
290
|
+
for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
|
|
291
|
+
var key = ownKeys_1[_i];
|
|
292
|
+
var hasKey = set.has(key);
|
|
293
|
+
if (!hasKey) {
|
|
294
|
+
set.add(key);
|
|
295
|
+
keys.push(key);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
for (var _a2 = 0, parentKeys_1 = parentKeys; _a2 < parentKeys_1.length; _a2++) {
|
|
299
|
+
var key = parentKeys_1[_a2];
|
|
300
|
+
var hasKey = set.has(key);
|
|
301
|
+
if (!hasKey) {
|
|
302
|
+
set.add(key);
|
|
303
|
+
keys.push(key);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return keys;
|
|
307
|
+
}
|
|
308
|
+
function OrdinaryOwnMetadataKeys(O, P) {
|
|
309
|
+
var provider = GetMetadataProvider(
|
|
310
|
+
O,
|
|
311
|
+
P,
|
|
312
|
+
/*create*/
|
|
313
|
+
false
|
|
314
|
+
);
|
|
315
|
+
if (!provider) {
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
return provider.OrdinaryOwnMetadataKeys(O, P);
|
|
319
|
+
}
|
|
320
|
+
function Type(x) {
|
|
321
|
+
if (x === null)
|
|
322
|
+
return 1;
|
|
323
|
+
switch (typeof x) {
|
|
324
|
+
case "undefined":
|
|
325
|
+
return 0;
|
|
326
|
+
case "boolean":
|
|
327
|
+
return 2;
|
|
328
|
+
case "string":
|
|
329
|
+
return 3;
|
|
330
|
+
case "symbol":
|
|
331
|
+
return 4;
|
|
332
|
+
case "number":
|
|
333
|
+
return 5;
|
|
334
|
+
case "object":
|
|
335
|
+
return x === null ? 1 : 6;
|
|
336
|
+
default:
|
|
337
|
+
return 6;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function IsUndefined(x) {
|
|
341
|
+
return x === void 0;
|
|
342
|
+
}
|
|
343
|
+
function IsNull(x) {
|
|
344
|
+
return x === null;
|
|
345
|
+
}
|
|
346
|
+
function IsSymbol(x) {
|
|
347
|
+
return typeof x === "symbol";
|
|
348
|
+
}
|
|
349
|
+
function IsObject(x) {
|
|
350
|
+
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
351
|
+
}
|
|
352
|
+
function ToPrimitive(input, PreferredType) {
|
|
353
|
+
switch (Type(input)) {
|
|
354
|
+
case 0:
|
|
355
|
+
return input;
|
|
356
|
+
case 1:
|
|
357
|
+
return input;
|
|
358
|
+
case 2:
|
|
359
|
+
return input;
|
|
360
|
+
case 3:
|
|
361
|
+
return input;
|
|
362
|
+
case 4:
|
|
363
|
+
return input;
|
|
364
|
+
case 5:
|
|
365
|
+
return input;
|
|
366
|
+
}
|
|
367
|
+
var hint = "string";
|
|
368
|
+
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
369
|
+
if (exoticToPrim !== void 0) {
|
|
370
|
+
var result = exoticToPrim.call(input, hint);
|
|
371
|
+
if (IsObject(result))
|
|
372
|
+
throw new TypeError();
|
|
373
|
+
return result;
|
|
374
|
+
}
|
|
375
|
+
return OrdinaryToPrimitive(input);
|
|
376
|
+
}
|
|
377
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
378
|
+
var valueOf, result, toString_2;
|
|
379
|
+
{
|
|
380
|
+
var toString_1 = O.toString;
|
|
381
|
+
if (IsCallable(toString_1)) {
|
|
382
|
+
var result = toString_1.call(O);
|
|
383
|
+
if (!IsObject(result))
|
|
384
|
+
return result;
|
|
385
|
+
}
|
|
386
|
+
var valueOf = O.valueOf;
|
|
387
|
+
if (IsCallable(valueOf)) {
|
|
388
|
+
var result = valueOf.call(O);
|
|
389
|
+
if (!IsObject(result))
|
|
390
|
+
return result;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
throw new TypeError();
|
|
394
|
+
}
|
|
395
|
+
function ToBoolean(argument) {
|
|
396
|
+
return !!argument;
|
|
397
|
+
}
|
|
398
|
+
function ToString(argument) {
|
|
399
|
+
return "" + argument;
|
|
400
|
+
}
|
|
401
|
+
function ToPropertyKey(argument) {
|
|
402
|
+
var key = ToPrimitive(argument);
|
|
403
|
+
if (IsSymbol(key))
|
|
404
|
+
return key;
|
|
405
|
+
return ToString(key);
|
|
406
|
+
}
|
|
407
|
+
function IsArray(argument) {
|
|
408
|
+
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
409
|
+
}
|
|
410
|
+
function IsCallable(argument) {
|
|
411
|
+
return typeof argument === "function";
|
|
412
|
+
}
|
|
413
|
+
function IsConstructor(argument) {
|
|
414
|
+
return typeof argument === "function";
|
|
415
|
+
}
|
|
416
|
+
function IsPropertyKey(argument) {
|
|
417
|
+
switch (Type(argument)) {
|
|
418
|
+
case 3:
|
|
419
|
+
return true;
|
|
420
|
+
case 4:
|
|
421
|
+
return true;
|
|
422
|
+
default:
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
function SameValueZero(x, y) {
|
|
427
|
+
return x === y || x !== x && y !== y;
|
|
428
|
+
}
|
|
429
|
+
function GetMethod(V, P) {
|
|
430
|
+
var func = V[P];
|
|
431
|
+
if (func === void 0 || func === null)
|
|
432
|
+
return void 0;
|
|
433
|
+
if (!IsCallable(func))
|
|
434
|
+
throw new TypeError();
|
|
435
|
+
return func;
|
|
436
|
+
}
|
|
437
|
+
function GetIterator(obj) {
|
|
438
|
+
var method = GetMethod(obj, iteratorSymbol);
|
|
439
|
+
if (!IsCallable(method))
|
|
440
|
+
throw new TypeError();
|
|
441
|
+
var iterator = method.call(obj);
|
|
442
|
+
if (!IsObject(iterator))
|
|
443
|
+
throw new TypeError();
|
|
444
|
+
return iterator;
|
|
445
|
+
}
|
|
446
|
+
function IteratorValue(iterResult) {
|
|
447
|
+
return iterResult.value;
|
|
448
|
+
}
|
|
449
|
+
function IteratorStep(iterator) {
|
|
450
|
+
var result = iterator.next();
|
|
451
|
+
return result.done ? false : result;
|
|
452
|
+
}
|
|
453
|
+
function IteratorClose(iterator) {
|
|
454
|
+
var f = iterator["return"];
|
|
455
|
+
if (f)
|
|
456
|
+
f.call(iterator);
|
|
457
|
+
}
|
|
458
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
459
|
+
var proto = Object.getPrototypeOf(O);
|
|
460
|
+
if (typeof O !== "function" || O === functionPrototype)
|
|
461
|
+
return proto;
|
|
462
|
+
if (proto !== functionPrototype)
|
|
463
|
+
return proto;
|
|
464
|
+
var prototype = O.prototype;
|
|
465
|
+
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
466
|
+
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
467
|
+
return proto;
|
|
468
|
+
var constructor = prototypeProto.constructor;
|
|
469
|
+
if (typeof constructor !== "function")
|
|
470
|
+
return proto;
|
|
471
|
+
if (constructor === O)
|
|
472
|
+
return proto;
|
|
473
|
+
return constructor;
|
|
474
|
+
}
|
|
475
|
+
function CreateMetadataRegistry() {
|
|
476
|
+
var fallback;
|
|
477
|
+
if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") {
|
|
478
|
+
fallback = CreateFallbackProvider(root.Reflect);
|
|
479
|
+
}
|
|
480
|
+
var first;
|
|
481
|
+
var second;
|
|
482
|
+
var rest;
|
|
483
|
+
var targetProviderMap = new _WeakMap();
|
|
484
|
+
var registry = {
|
|
485
|
+
registerProvider,
|
|
486
|
+
getProvider,
|
|
487
|
+
setProvider
|
|
488
|
+
};
|
|
489
|
+
return registry;
|
|
490
|
+
function registerProvider(provider) {
|
|
491
|
+
if (!Object.isExtensible(registry)) {
|
|
492
|
+
throw new Error("Cannot add provider to a frozen registry.");
|
|
493
|
+
}
|
|
494
|
+
switch (true) {
|
|
495
|
+
case fallback === provider:
|
|
496
|
+
break;
|
|
497
|
+
case IsUndefined(first):
|
|
498
|
+
first = provider;
|
|
499
|
+
break;
|
|
500
|
+
case first === provider:
|
|
501
|
+
break;
|
|
502
|
+
case IsUndefined(second):
|
|
503
|
+
second = provider;
|
|
504
|
+
break;
|
|
505
|
+
case second === provider:
|
|
506
|
+
break;
|
|
507
|
+
default:
|
|
508
|
+
if (rest === void 0)
|
|
509
|
+
rest = new _Set();
|
|
510
|
+
rest.add(provider);
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function getProviderNoCache(O, P) {
|
|
515
|
+
if (!IsUndefined(first)) {
|
|
516
|
+
if (first.isProviderFor(O, P))
|
|
517
|
+
return first;
|
|
518
|
+
if (!IsUndefined(second)) {
|
|
519
|
+
if (second.isProviderFor(O, P))
|
|
520
|
+
return first;
|
|
521
|
+
if (!IsUndefined(rest)) {
|
|
522
|
+
var iterator = GetIterator(rest);
|
|
523
|
+
while (true) {
|
|
524
|
+
var next = IteratorStep(iterator);
|
|
525
|
+
if (!next) {
|
|
526
|
+
return void 0;
|
|
527
|
+
}
|
|
528
|
+
var provider = IteratorValue(next);
|
|
529
|
+
if (provider.isProviderFor(O, P)) {
|
|
530
|
+
IteratorClose(iterator);
|
|
531
|
+
return provider;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {
|
|
538
|
+
return fallback;
|
|
539
|
+
}
|
|
540
|
+
return void 0;
|
|
541
|
+
}
|
|
542
|
+
function getProvider(O, P) {
|
|
543
|
+
var providerMap = targetProviderMap.get(O);
|
|
544
|
+
var provider;
|
|
545
|
+
if (!IsUndefined(providerMap)) {
|
|
546
|
+
provider = providerMap.get(P);
|
|
547
|
+
}
|
|
548
|
+
if (!IsUndefined(provider)) {
|
|
549
|
+
return provider;
|
|
550
|
+
}
|
|
551
|
+
provider = getProviderNoCache(O, P);
|
|
552
|
+
if (!IsUndefined(provider)) {
|
|
553
|
+
if (IsUndefined(providerMap)) {
|
|
554
|
+
providerMap = new _Map();
|
|
555
|
+
targetProviderMap.set(O, providerMap);
|
|
556
|
+
}
|
|
557
|
+
providerMap.set(P, provider);
|
|
558
|
+
}
|
|
559
|
+
return provider;
|
|
560
|
+
}
|
|
561
|
+
function hasProvider(provider) {
|
|
562
|
+
if (IsUndefined(provider))
|
|
563
|
+
throw new TypeError();
|
|
564
|
+
return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);
|
|
565
|
+
}
|
|
566
|
+
function setProvider(O, P, provider) {
|
|
567
|
+
if (!hasProvider(provider)) {
|
|
568
|
+
throw new Error("Metadata provider not registered.");
|
|
569
|
+
}
|
|
570
|
+
var existingProvider = getProvider(O, P);
|
|
571
|
+
if (existingProvider !== provider) {
|
|
572
|
+
if (!IsUndefined(existingProvider)) {
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
var providerMap = targetProviderMap.get(O);
|
|
576
|
+
if (IsUndefined(providerMap)) {
|
|
577
|
+
providerMap = new _Map();
|
|
578
|
+
targetProviderMap.set(O, providerMap);
|
|
579
|
+
}
|
|
580
|
+
providerMap.set(P, provider);
|
|
581
|
+
}
|
|
582
|
+
return true;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
function GetOrCreateMetadataRegistry() {
|
|
586
|
+
var metadataRegistry2;
|
|
587
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
588
|
+
metadataRegistry2 = root.Reflect[registrySymbol];
|
|
589
|
+
}
|
|
590
|
+
if (IsUndefined(metadataRegistry2)) {
|
|
591
|
+
metadataRegistry2 = CreateMetadataRegistry();
|
|
592
|
+
}
|
|
593
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
594
|
+
Object.defineProperty(root.Reflect, registrySymbol, {
|
|
595
|
+
enumerable: false,
|
|
596
|
+
configurable: false,
|
|
597
|
+
writable: false,
|
|
598
|
+
value: metadataRegistry2
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
return metadataRegistry2;
|
|
602
|
+
}
|
|
603
|
+
function CreateMetadataProvider(registry) {
|
|
604
|
+
var metadata2 = new _WeakMap();
|
|
605
|
+
var provider = {
|
|
606
|
+
isProviderFor: function(O, P) {
|
|
607
|
+
var targetMetadata = metadata2.get(O);
|
|
608
|
+
if (IsUndefined(targetMetadata))
|
|
609
|
+
return false;
|
|
610
|
+
return targetMetadata.has(P);
|
|
611
|
+
},
|
|
612
|
+
OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata2,
|
|
613
|
+
OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata2,
|
|
614
|
+
OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata2,
|
|
615
|
+
OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys2,
|
|
616
|
+
OrdinaryDeleteMetadata
|
|
617
|
+
};
|
|
618
|
+
metadataRegistry.registerProvider(provider);
|
|
619
|
+
return provider;
|
|
620
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
621
|
+
var targetMetadata = metadata2.get(O);
|
|
622
|
+
var createdTargetMetadata = false;
|
|
623
|
+
if (IsUndefined(targetMetadata)) {
|
|
624
|
+
if (!Create)
|
|
625
|
+
return void 0;
|
|
626
|
+
targetMetadata = new _Map();
|
|
627
|
+
metadata2.set(O, targetMetadata);
|
|
628
|
+
createdTargetMetadata = true;
|
|
629
|
+
}
|
|
630
|
+
var metadataMap = targetMetadata.get(P);
|
|
631
|
+
if (IsUndefined(metadataMap)) {
|
|
632
|
+
if (!Create)
|
|
633
|
+
return void 0;
|
|
634
|
+
metadataMap = new _Map();
|
|
635
|
+
targetMetadata.set(P, metadataMap);
|
|
636
|
+
if (!registry.setProvider(O, P, provider)) {
|
|
637
|
+
targetMetadata.delete(P);
|
|
638
|
+
if (createdTargetMetadata) {
|
|
639
|
+
metadata2.delete(O);
|
|
640
|
+
}
|
|
641
|
+
throw new Error("Wrong provider for target.");
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
return metadataMap;
|
|
645
|
+
}
|
|
646
|
+
function OrdinaryHasOwnMetadata2(MetadataKey, O, P) {
|
|
647
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
648
|
+
O,
|
|
649
|
+
P,
|
|
650
|
+
/*Create*/
|
|
651
|
+
false
|
|
652
|
+
);
|
|
653
|
+
if (IsUndefined(metadataMap))
|
|
654
|
+
return false;
|
|
655
|
+
return ToBoolean(metadataMap.has(MetadataKey));
|
|
656
|
+
}
|
|
657
|
+
function OrdinaryGetOwnMetadata2(MetadataKey, O, P) {
|
|
658
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
659
|
+
O,
|
|
660
|
+
P,
|
|
661
|
+
/*Create*/
|
|
662
|
+
false
|
|
663
|
+
);
|
|
664
|
+
if (IsUndefined(metadataMap))
|
|
665
|
+
return void 0;
|
|
666
|
+
return metadataMap.get(MetadataKey);
|
|
667
|
+
}
|
|
668
|
+
function OrdinaryDefineOwnMetadata2(MetadataKey, MetadataValue, O, P) {
|
|
669
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
670
|
+
O,
|
|
671
|
+
P,
|
|
672
|
+
/*Create*/
|
|
673
|
+
true
|
|
674
|
+
);
|
|
675
|
+
metadataMap.set(MetadataKey, MetadataValue);
|
|
676
|
+
}
|
|
677
|
+
function OrdinaryOwnMetadataKeys2(O, P) {
|
|
678
|
+
var keys = [];
|
|
679
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
680
|
+
O,
|
|
681
|
+
P,
|
|
682
|
+
/*Create*/
|
|
683
|
+
false
|
|
684
|
+
);
|
|
685
|
+
if (IsUndefined(metadataMap))
|
|
686
|
+
return keys;
|
|
687
|
+
var keysObj = metadataMap.keys();
|
|
688
|
+
var iterator = GetIterator(keysObj);
|
|
689
|
+
var k = 0;
|
|
690
|
+
while (true) {
|
|
691
|
+
var next = IteratorStep(iterator);
|
|
692
|
+
if (!next) {
|
|
693
|
+
keys.length = k;
|
|
694
|
+
return keys;
|
|
695
|
+
}
|
|
696
|
+
var nextValue = IteratorValue(next);
|
|
697
|
+
try {
|
|
698
|
+
keys[k] = nextValue;
|
|
699
|
+
} catch (e) {
|
|
700
|
+
try {
|
|
701
|
+
IteratorClose(iterator);
|
|
702
|
+
} finally {
|
|
703
|
+
throw e;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
k++;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
function OrdinaryDeleteMetadata(MetadataKey, O, P) {
|
|
710
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
711
|
+
O,
|
|
712
|
+
P,
|
|
713
|
+
/*Create*/
|
|
714
|
+
false
|
|
715
|
+
);
|
|
716
|
+
if (IsUndefined(metadataMap))
|
|
717
|
+
return false;
|
|
718
|
+
if (!metadataMap.delete(MetadataKey))
|
|
719
|
+
return false;
|
|
720
|
+
if (metadataMap.size === 0) {
|
|
721
|
+
var targetMetadata = metadata2.get(O);
|
|
722
|
+
if (!IsUndefined(targetMetadata)) {
|
|
723
|
+
targetMetadata.delete(P);
|
|
724
|
+
if (targetMetadata.size === 0) {
|
|
725
|
+
metadata2.delete(targetMetadata);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return true;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
function CreateFallbackProvider(reflect) {
|
|
733
|
+
var defineMetadata2 = reflect.defineMetadata, hasOwnMetadata2 = reflect.hasOwnMetadata, getOwnMetadata2 = reflect.getOwnMetadata, getOwnMetadataKeys2 = reflect.getOwnMetadataKeys, deleteMetadata2 = reflect.deleteMetadata;
|
|
734
|
+
var metadataOwner = new _WeakMap();
|
|
735
|
+
var provider = {
|
|
736
|
+
isProviderFor: function(O, P) {
|
|
737
|
+
var metadataPropertySet = metadataOwner.get(O);
|
|
738
|
+
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
|
|
739
|
+
return true;
|
|
740
|
+
}
|
|
741
|
+
if (getOwnMetadataKeys2(O, P).length) {
|
|
742
|
+
if (IsUndefined(metadataPropertySet)) {
|
|
743
|
+
metadataPropertySet = new _Set();
|
|
744
|
+
metadataOwner.set(O, metadataPropertySet);
|
|
745
|
+
}
|
|
746
|
+
metadataPropertySet.add(P);
|
|
747
|
+
return true;
|
|
748
|
+
}
|
|
749
|
+
return false;
|
|
750
|
+
},
|
|
751
|
+
OrdinaryDefineOwnMetadata: defineMetadata2,
|
|
752
|
+
OrdinaryHasOwnMetadata: hasOwnMetadata2,
|
|
753
|
+
OrdinaryGetOwnMetadata: getOwnMetadata2,
|
|
754
|
+
OrdinaryOwnMetadataKeys: getOwnMetadataKeys2,
|
|
755
|
+
OrdinaryDeleteMetadata: deleteMetadata2
|
|
756
|
+
};
|
|
757
|
+
return provider;
|
|
758
|
+
}
|
|
759
|
+
function GetMetadataProvider(O, P, Create) {
|
|
760
|
+
var registeredProvider = metadataRegistry.getProvider(O, P);
|
|
761
|
+
if (!IsUndefined(registeredProvider)) {
|
|
762
|
+
return registeredProvider;
|
|
763
|
+
}
|
|
764
|
+
if (Create) {
|
|
765
|
+
if (metadataRegistry.setProvider(O, P, metadataProvider)) {
|
|
766
|
+
return metadataProvider;
|
|
767
|
+
}
|
|
768
|
+
throw new Error("Illegal state.");
|
|
769
|
+
}
|
|
770
|
+
return void 0;
|
|
771
|
+
}
|
|
772
|
+
function CreateMapPolyfill() {
|
|
773
|
+
var cacheSentinel = {};
|
|
774
|
+
var arraySentinel = [];
|
|
775
|
+
var MapIterator = (
|
|
776
|
+
/** @class */
|
|
777
|
+
function() {
|
|
778
|
+
function MapIterator2(keys, values, selector) {
|
|
779
|
+
this._index = 0;
|
|
780
|
+
this._keys = keys;
|
|
781
|
+
this._values = values;
|
|
782
|
+
this._selector = selector;
|
|
783
|
+
}
|
|
784
|
+
MapIterator2.prototype["@@iterator"] = function() {
|
|
785
|
+
return this;
|
|
786
|
+
};
|
|
787
|
+
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
788
|
+
return this;
|
|
789
|
+
};
|
|
790
|
+
MapIterator2.prototype.next = function() {
|
|
791
|
+
var index = this._index;
|
|
792
|
+
if (index >= 0 && index < this._keys.length) {
|
|
793
|
+
var result = this._selector(this._keys[index], this._values[index]);
|
|
794
|
+
if (index + 1 >= this._keys.length) {
|
|
795
|
+
this._index = -1;
|
|
796
|
+
this._keys = arraySentinel;
|
|
797
|
+
this._values = arraySentinel;
|
|
798
|
+
} else {
|
|
799
|
+
this._index++;
|
|
800
|
+
}
|
|
801
|
+
return { value: result, done: false };
|
|
802
|
+
}
|
|
803
|
+
return { value: void 0, done: true };
|
|
804
|
+
};
|
|
805
|
+
MapIterator2.prototype.throw = function(error) {
|
|
806
|
+
if (this._index >= 0) {
|
|
807
|
+
this._index = -1;
|
|
808
|
+
this._keys = arraySentinel;
|
|
809
|
+
this._values = arraySentinel;
|
|
810
|
+
}
|
|
811
|
+
throw error;
|
|
812
|
+
};
|
|
813
|
+
MapIterator2.prototype.return = function(value) {
|
|
814
|
+
if (this._index >= 0) {
|
|
815
|
+
this._index = -1;
|
|
816
|
+
this._keys = arraySentinel;
|
|
817
|
+
this._values = arraySentinel;
|
|
818
|
+
}
|
|
819
|
+
return { value, done: true };
|
|
820
|
+
};
|
|
821
|
+
return MapIterator2;
|
|
822
|
+
}()
|
|
823
|
+
);
|
|
824
|
+
var Map2 = (
|
|
825
|
+
/** @class */
|
|
826
|
+
function() {
|
|
827
|
+
function Map3() {
|
|
828
|
+
this._keys = [];
|
|
829
|
+
this._values = [];
|
|
830
|
+
this._cacheKey = cacheSentinel;
|
|
831
|
+
this._cacheIndex = -2;
|
|
832
|
+
}
|
|
833
|
+
Object.defineProperty(Map3.prototype, "size", {
|
|
834
|
+
get: function() {
|
|
835
|
+
return this._keys.length;
|
|
836
|
+
},
|
|
837
|
+
enumerable: true,
|
|
838
|
+
configurable: true
|
|
839
|
+
});
|
|
840
|
+
Map3.prototype.has = function(key) {
|
|
841
|
+
return this._find(
|
|
842
|
+
key,
|
|
843
|
+
/*insert*/
|
|
844
|
+
false
|
|
845
|
+
) >= 0;
|
|
846
|
+
};
|
|
847
|
+
Map3.prototype.get = function(key) {
|
|
848
|
+
var index = this._find(
|
|
849
|
+
key,
|
|
850
|
+
/*insert*/
|
|
851
|
+
false
|
|
852
|
+
);
|
|
853
|
+
return index >= 0 ? this._values[index] : void 0;
|
|
854
|
+
};
|
|
855
|
+
Map3.prototype.set = function(key, value) {
|
|
856
|
+
var index = this._find(
|
|
857
|
+
key,
|
|
858
|
+
/*insert*/
|
|
859
|
+
true
|
|
860
|
+
);
|
|
861
|
+
this._values[index] = value;
|
|
862
|
+
return this;
|
|
863
|
+
};
|
|
864
|
+
Map3.prototype.delete = function(key) {
|
|
865
|
+
var index = this._find(
|
|
866
|
+
key,
|
|
867
|
+
/*insert*/
|
|
868
|
+
false
|
|
869
|
+
);
|
|
870
|
+
if (index >= 0) {
|
|
871
|
+
var size = this._keys.length;
|
|
872
|
+
for (var i = index + 1; i < size; i++) {
|
|
873
|
+
this._keys[i - 1] = this._keys[i];
|
|
874
|
+
this._values[i - 1] = this._values[i];
|
|
875
|
+
}
|
|
876
|
+
this._keys.length--;
|
|
877
|
+
this._values.length--;
|
|
878
|
+
if (SameValueZero(key, this._cacheKey)) {
|
|
879
|
+
this._cacheKey = cacheSentinel;
|
|
880
|
+
this._cacheIndex = -2;
|
|
881
|
+
}
|
|
882
|
+
return true;
|
|
883
|
+
}
|
|
884
|
+
return false;
|
|
885
|
+
};
|
|
886
|
+
Map3.prototype.clear = function() {
|
|
887
|
+
this._keys.length = 0;
|
|
888
|
+
this._values.length = 0;
|
|
889
|
+
this._cacheKey = cacheSentinel;
|
|
890
|
+
this._cacheIndex = -2;
|
|
891
|
+
};
|
|
892
|
+
Map3.prototype.keys = function() {
|
|
893
|
+
return new MapIterator(this._keys, this._values, getKey);
|
|
894
|
+
};
|
|
895
|
+
Map3.prototype.values = function() {
|
|
896
|
+
return new MapIterator(this._keys, this._values, getValue);
|
|
897
|
+
};
|
|
898
|
+
Map3.prototype.entries = function() {
|
|
899
|
+
return new MapIterator(this._keys, this._values, getEntry);
|
|
900
|
+
};
|
|
901
|
+
Map3.prototype["@@iterator"] = function() {
|
|
902
|
+
return this.entries();
|
|
903
|
+
};
|
|
904
|
+
Map3.prototype[iteratorSymbol] = function() {
|
|
905
|
+
return this.entries();
|
|
906
|
+
};
|
|
907
|
+
Map3.prototype._find = function(key, insert) {
|
|
908
|
+
if (!SameValueZero(this._cacheKey, key)) {
|
|
909
|
+
this._cacheIndex = -1;
|
|
910
|
+
for (var i = 0; i < this._keys.length; i++) {
|
|
911
|
+
if (SameValueZero(this._keys[i], key)) {
|
|
912
|
+
this._cacheIndex = i;
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (this._cacheIndex < 0 && insert) {
|
|
918
|
+
this._cacheIndex = this._keys.length;
|
|
919
|
+
this._keys.push(key);
|
|
920
|
+
this._values.push(void 0);
|
|
921
|
+
}
|
|
922
|
+
return this._cacheIndex;
|
|
923
|
+
};
|
|
924
|
+
return Map3;
|
|
925
|
+
}()
|
|
926
|
+
);
|
|
927
|
+
return Map2;
|
|
928
|
+
function getKey(key, _) {
|
|
929
|
+
return key;
|
|
930
|
+
}
|
|
931
|
+
function getValue(_, value) {
|
|
932
|
+
return value;
|
|
933
|
+
}
|
|
934
|
+
function getEntry(key, value) {
|
|
935
|
+
return [key, value];
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
function CreateSetPolyfill() {
|
|
939
|
+
var Set2 = (
|
|
940
|
+
/** @class */
|
|
941
|
+
function() {
|
|
942
|
+
function Set3() {
|
|
943
|
+
this._map = new _Map();
|
|
944
|
+
}
|
|
945
|
+
Object.defineProperty(Set3.prototype, "size", {
|
|
946
|
+
get: function() {
|
|
947
|
+
return this._map.size;
|
|
948
|
+
},
|
|
949
|
+
enumerable: true,
|
|
950
|
+
configurable: true
|
|
951
|
+
});
|
|
952
|
+
Set3.prototype.has = function(value) {
|
|
953
|
+
return this._map.has(value);
|
|
954
|
+
};
|
|
955
|
+
Set3.prototype.add = function(value) {
|
|
956
|
+
return this._map.set(value, value), this;
|
|
957
|
+
};
|
|
958
|
+
Set3.prototype.delete = function(value) {
|
|
959
|
+
return this._map.delete(value);
|
|
960
|
+
};
|
|
961
|
+
Set3.prototype.clear = function() {
|
|
962
|
+
this._map.clear();
|
|
963
|
+
};
|
|
964
|
+
Set3.prototype.keys = function() {
|
|
965
|
+
return this._map.keys();
|
|
966
|
+
};
|
|
967
|
+
Set3.prototype.values = function() {
|
|
968
|
+
return this._map.keys();
|
|
969
|
+
};
|
|
970
|
+
Set3.prototype.entries = function() {
|
|
971
|
+
return this._map.entries();
|
|
972
|
+
};
|
|
973
|
+
Set3.prototype["@@iterator"] = function() {
|
|
974
|
+
return this.keys();
|
|
975
|
+
};
|
|
976
|
+
Set3.prototype[iteratorSymbol] = function() {
|
|
977
|
+
return this.keys();
|
|
978
|
+
};
|
|
979
|
+
return Set3;
|
|
980
|
+
}()
|
|
981
|
+
);
|
|
982
|
+
return Set2;
|
|
983
|
+
}
|
|
984
|
+
function CreateWeakMapPolyfill() {
|
|
985
|
+
var UUID_SIZE = 16;
|
|
986
|
+
var keys = HashMap.create();
|
|
987
|
+
var rootKey = CreateUniqueKey();
|
|
988
|
+
return (
|
|
989
|
+
/** @class */
|
|
990
|
+
function() {
|
|
991
|
+
function WeakMap2() {
|
|
992
|
+
this._key = CreateUniqueKey();
|
|
993
|
+
}
|
|
994
|
+
WeakMap2.prototype.has = function(target) {
|
|
995
|
+
var table = GetOrCreateWeakMapTable(
|
|
996
|
+
target,
|
|
997
|
+
/*create*/
|
|
998
|
+
false
|
|
999
|
+
);
|
|
1000
|
+
return table !== void 0 ? HashMap.has(table, this._key) : false;
|
|
1001
|
+
};
|
|
1002
|
+
WeakMap2.prototype.get = function(target) {
|
|
1003
|
+
var table = GetOrCreateWeakMapTable(
|
|
1004
|
+
target,
|
|
1005
|
+
/*create*/
|
|
1006
|
+
false
|
|
1007
|
+
);
|
|
1008
|
+
return table !== void 0 ? HashMap.get(table, this._key) : void 0;
|
|
1009
|
+
};
|
|
1010
|
+
WeakMap2.prototype.set = function(target, value) {
|
|
1011
|
+
var table = GetOrCreateWeakMapTable(
|
|
1012
|
+
target,
|
|
1013
|
+
/*create*/
|
|
1014
|
+
true
|
|
1015
|
+
);
|
|
1016
|
+
table[this._key] = value;
|
|
1017
|
+
return this;
|
|
1018
|
+
};
|
|
1019
|
+
WeakMap2.prototype.delete = function(target) {
|
|
1020
|
+
var table = GetOrCreateWeakMapTable(
|
|
1021
|
+
target,
|
|
1022
|
+
/*create*/
|
|
1023
|
+
false
|
|
1024
|
+
);
|
|
1025
|
+
return table !== void 0 ? delete table[this._key] : false;
|
|
1026
|
+
};
|
|
1027
|
+
WeakMap2.prototype.clear = function() {
|
|
1028
|
+
this._key = CreateUniqueKey();
|
|
1029
|
+
};
|
|
1030
|
+
return WeakMap2;
|
|
1031
|
+
}()
|
|
1032
|
+
);
|
|
1033
|
+
function CreateUniqueKey() {
|
|
1034
|
+
var key;
|
|
1035
|
+
do
|
|
1036
|
+
key = "@@WeakMap@@" + CreateUUID();
|
|
1037
|
+
while (HashMap.has(keys, key));
|
|
1038
|
+
keys[key] = true;
|
|
1039
|
+
return key;
|
|
1040
|
+
}
|
|
1041
|
+
function GetOrCreateWeakMapTable(target, create) {
|
|
1042
|
+
if (!hasOwn.call(target, rootKey)) {
|
|
1043
|
+
if (!create)
|
|
1044
|
+
return void 0;
|
|
1045
|
+
Object.defineProperty(target, rootKey, { value: HashMap.create() });
|
|
1046
|
+
}
|
|
1047
|
+
return target[rootKey];
|
|
1048
|
+
}
|
|
1049
|
+
function FillRandomBytes(buffer, size) {
|
|
1050
|
+
for (var i = 0; i < size; ++i)
|
|
1051
|
+
buffer[i] = Math.random() * 255 | 0;
|
|
1052
|
+
return buffer;
|
|
1053
|
+
}
|
|
1054
|
+
function GenRandomBytes(size) {
|
|
1055
|
+
if (typeof Uint8Array === "function") {
|
|
1056
|
+
var array = new Uint8Array(size);
|
|
1057
|
+
if (typeof crypto !== "undefined") {
|
|
1058
|
+
crypto.getRandomValues(array);
|
|
1059
|
+
} else if (typeof msCrypto !== "undefined") {
|
|
1060
|
+
msCrypto.getRandomValues(array);
|
|
1061
|
+
} else {
|
|
1062
|
+
FillRandomBytes(array, size);
|
|
1063
|
+
}
|
|
1064
|
+
return array;
|
|
1065
|
+
}
|
|
1066
|
+
return FillRandomBytes(new Array(size), size);
|
|
1067
|
+
}
|
|
1068
|
+
function CreateUUID() {
|
|
1069
|
+
var data = GenRandomBytes(UUID_SIZE);
|
|
1070
|
+
data[6] = data[6] & 79 | 64;
|
|
1071
|
+
data[8] = data[8] & 191 | 128;
|
|
1072
|
+
var result = "";
|
|
1073
|
+
for (var offset = 0; offset < UUID_SIZE; ++offset) {
|
|
1074
|
+
var byte = data[offset];
|
|
1075
|
+
if (offset === 4 || offset === 6 || offset === 8)
|
|
1076
|
+
result += "-";
|
|
1077
|
+
if (byte < 16)
|
|
1078
|
+
result += "0";
|
|
1079
|
+
result += byte.toString(16).toLowerCase();
|
|
1080
|
+
}
|
|
1081
|
+
return result;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
function MakeDictionary(obj) {
|
|
1085
|
+
obj.__ = void 0;
|
|
1086
|
+
delete obj.__;
|
|
1087
|
+
return obj;
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
})(Reflect2 || (Reflect2 = {}));
|
|
1091
|
+
return _Reflect;
|
|
1092
|
+
}
|
|
1093
|
+
require_Reflect();
|
|
1094
|
+
var __defProp$b = Object.defineProperty;
|
|
1095
|
+
var __name = (target, value) => __defProp$b(target, "name", { value, configurable: true });
|
|
1096
|
+
var HelperUtils = (_a = class {
|
|
1097
|
+
/**
|
|
1098
|
+
* Fetches existing metadata or creates new metadata for a given target and appender.
|
|
1099
|
+
*
|
|
1100
|
+
* This method retrieves metadata associated with the target's constructor using the specified appender.
|
|
1101
|
+
* If the metadata does not exist, it creates a new Map, defines it as metadata, and returns it.
|
|
1102
|
+
* If the metadata already exists, it simply returns the existing Map.
|
|
1103
|
+
*
|
|
1104
|
+
* @template T - The type of the metadata value.
|
|
1105
|
+
* @param {any} target - The target object to fetch or create metadata for.
|
|
1106
|
+
* @param {string} appender - The appender string used to construct the metadata key.
|
|
1107
|
+
* @returns {Map<string, T>} - The metadata Map associated with the target and appender.
|
|
1108
|
+
*/
|
|
1109
|
+
static fetchOrCreate(target, appender) {
|
|
1110
|
+
const key = `${target.constructor.name}:${appender}`;
|
|
1111
|
+
let data;
|
|
1112
|
+
if (!Reflect.hasMetadata(key, target)) {
|
|
1113
|
+
data = /* @__PURE__ */ new Map();
|
|
1114
|
+
Reflect.defineMetadata(key, data, target);
|
|
1115
|
+
}
|
|
1116
|
+
data = Reflect.getMetadata(key, target);
|
|
1117
|
+
return data;
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Binds reactive properties to an element based on metadata.
|
|
1121
|
+
*
|
|
1122
|
+
* This function retrieves metadata associated with the element to find property details.
|
|
1123
|
+
* It then defines getter and setter methods for each property to enable reactivity.
|
|
1124
|
+
* When a property is set, the element's `updateHTML` method is called to re-render the component.
|
|
1125
|
+
*
|
|
1126
|
+
* The function also checks for any watchers associated with the property and calls them if they exist.
|
|
1127
|
+
*
|
|
1128
|
+
* @function bindReactive
|
|
1129
|
+
* @param {any} element - The element to bind reactive properties to.
|
|
1130
|
+
*
|
|
1131
|
+
* @example
|
|
1132
|
+
* // Assuming `element` is an instance of a class that extends `BaseElement`
|
|
1133
|
+
* bindReactive(element);
|
|
1134
|
+
*
|
|
1135
|
+
* // Now, when a property defined in the metadata is set, the element's `updateHTML` method will be called.
|
|
1136
|
+
* element.someProperty = 'newValue'; // This will trigger element.updateHTML()
|
|
1137
|
+
*/
|
|
1138
|
+
static bindReactive(element) {
|
|
1139
|
+
let data = _a.fetchOrCreate(element, "Property");
|
|
1140
|
+
data.forEach((value) => {
|
|
1141
|
+
const propertyKey = `_${value.prototype}`;
|
|
1142
|
+
Object.defineProperty(element, value.prototype, {
|
|
1143
|
+
get() {
|
|
1144
|
+
return element[propertyKey];
|
|
1145
|
+
},
|
|
1146
|
+
set(v) {
|
|
1147
|
+
if (element[propertyKey] !== v) {
|
|
1148
|
+
element[propertyKey] = v;
|
|
1149
|
+
element.setAttribute(value.name, v);
|
|
1150
|
+
const watchers = _a.fetchOrCreate(element, `Watcher:${value.prototype}`);
|
|
1151
|
+
if (watchers && watchers.size > 0) {
|
|
1152
|
+
watchers.forEach((item) => {
|
|
1153
|
+
if (element[item.name] && typeof element[item.name] === "function") {
|
|
1154
|
+
item.method.call(element);
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
enumerable: true,
|
|
1161
|
+
configurable: true
|
|
1162
|
+
});
|
|
1163
|
+
});
|
|
1164
|
+
element.reactive = true;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Extracts metadata for a given decorator from a class.
|
|
1168
|
+
*
|
|
1169
|
+
* @param {Function} targetClass - The class from which to extract metadata.
|
|
1170
|
+
* @param {string} decoratorName - The name of the decorator.
|
|
1171
|
+
* @returns {any} - The metadata associated with the specified decorator.
|
|
1172
|
+
*/
|
|
1173
|
+
static getComponentMetadata(targetClass, decoratorName) {
|
|
1174
|
+
if (Reflect.hasOwnMetadata(decoratorName, targetClass)) {
|
|
1175
|
+
return Reflect.getOwnMetadata(decoratorName, targetClass);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}, __name(_a, "HelperUtils"), _a);
|
|
1179
|
+
function AfterInitDecorator() {
|
|
1180
|
+
return function(target, propertyKey, descriptor) {
|
|
1181
|
+
let data = HelperUtils.fetchOrCreate(target, "After");
|
|
1182
|
+
data.set(propertyKey.toString(), descriptor.value);
|
|
1183
|
+
return descriptor;
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
__name(AfterInitDecorator, "AfterInitDecorator");
|
|
1187
|
+
function BeforeInitDecorator() {
|
|
1188
|
+
return function(target, propertyKey, descriptor) {
|
|
1189
|
+
let data = HelperUtils.fetchOrCreate(target, "Before");
|
|
1190
|
+
data.set(propertyKey.toString(), descriptor.value);
|
|
1191
|
+
return descriptor;
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
__name(BeforeInitDecorator, "BeforeInitDecorator");
|
|
1195
|
+
function BindEventDecorator(config) {
|
|
1196
|
+
return function(target, propertyKey, descriptor) {
|
|
1197
|
+
let data = HelperUtils.fetchOrCreate(target, "Bind");
|
|
1198
|
+
data.set(propertyKey.toString(), config);
|
|
1199
|
+
return descriptor;
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
__name(BindEventDecorator, "BindEventDecorator");
|
|
1203
|
+
function ComponentDecorator(config) {
|
|
1204
|
+
return function(target) {
|
|
1205
|
+
const methodNames = Object.getOwnPropertyNames(target.prototype).filter((prop) => typeof target.prototype[prop] === "function" && prop !== "constructor");
|
|
1206
|
+
const methods = methodNames.map((name) => ({
|
|
1207
|
+
name,
|
|
1208
|
+
method: target.prototype[name]
|
|
1209
|
+
}));
|
|
1210
|
+
Reflect.defineMetadata(target.name, methods, target);
|
|
1211
|
+
if (!customElements.get(config.selector)) {
|
|
1212
|
+
customElements.define(config.selector, target);
|
|
1213
|
+
}
|
|
1214
|
+
Reflect.defineMetadata(target.name + ":shadow", config.shadow, target);
|
|
1215
|
+
Reflect.defineMetadata("Component", config, target);
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
__name(ComponentDecorator, "ComponentDecorator");
|
|
1219
|
+
function PropertyDecorator(config) {
|
|
1220
|
+
return function(target, propertyKey) {
|
|
1221
|
+
if (!target.constructor.observedAttributes) {
|
|
1222
|
+
target.constructor.observedAttributes = [];
|
|
1223
|
+
}
|
|
1224
|
+
target.constructor.observedAttributes.push(config.name);
|
|
1225
|
+
let data = HelperUtils.fetchOrCreate(target, "Property");
|
|
1226
|
+
data.set(config.name, {
|
|
1227
|
+
name: config.name,
|
|
1228
|
+
prototype: propertyKey.toString(),
|
|
1229
|
+
default: config.default,
|
|
1230
|
+
type: config.type
|
|
1231
|
+
});
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
__name(PropertyDecorator, "PropertyDecorator");
|
|
1235
|
+
var StringType = {
|
|
1236
|
+
process: /* @__PURE__ */ __name((value) => {
|
|
1237
|
+
if (value === null || value === void 0) {
|
|
1238
|
+
throw new Error(`Value is not of given type: ${value}`);
|
|
1239
|
+
}
|
|
1240
|
+
return String(value);
|
|
1241
|
+
}, "process")
|
|
1242
|
+
};
|
|
1243
|
+
var BooleanType = {
|
|
1244
|
+
process: /* @__PURE__ */ __name((value) => {
|
|
1245
|
+
if (value === "false") {
|
|
1246
|
+
return false;
|
|
1247
|
+
} else if (value === "true") {
|
|
1248
|
+
return true;
|
|
1249
|
+
}
|
|
1250
|
+
throw new Error(`Value is not of type boolean: ${value}`);
|
|
1251
|
+
}, "process")
|
|
1252
|
+
};
|
|
1253
|
+
var EventType = /* @__PURE__ */ function(EventType2) {
|
|
1254
|
+
EventType2[EventType2["WINDOW"] = 0] = "WINDOW";
|
|
1255
|
+
EventType2[EventType2["ROOT"] = 1] = "ROOT";
|
|
1256
|
+
return EventType2;
|
|
1257
|
+
}(EventType || {});
|
|
1258
|
+
function EventListenerDecorator(config) {
|
|
1259
|
+
return function(target, propertyKey, descriptor) {
|
|
1260
|
+
const originalConnectedCallback = target.connectedCallback;
|
|
1261
|
+
target.connectedCallback = function() {
|
|
1262
|
+
if (originalConnectedCallback) {
|
|
1263
|
+
originalConnectedCallback.apply(this);
|
|
1264
|
+
}
|
|
1265
|
+
if (config.type === EventType.WINDOW) {
|
|
1266
|
+
window.addEventListener(config.name, descriptor.value.bind(this));
|
|
1267
|
+
} else if (config.type === EventType.ROOT) {
|
|
1268
|
+
this.addEventListener(config.name, descriptor.value.bind(this));
|
|
1269
|
+
}
|
|
1270
|
+
};
|
|
1271
|
+
const originalDisconnectedCallback = target.disconnectedCallback;
|
|
1272
|
+
target.disconnectedCallback = function() {
|
|
1273
|
+
if (config.type === EventType.WINDOW) {
|
|
1274
|
+
window.removeEventListener(config.name, descriptor.value.bind(this));
|
|
1275
|
+
} else if (config.type === EventType.ROOT) {
|
|
1276
|
+
this.removeEventListener(config.name, descriptor.value.bind(this));
|
|
1277
|
+
}
|
|
1278
|
+
if (originalDisconnectedCallback) {
|
|
1279
|
+
originalDisconnectedCallback.apply(this);
|
|
1280
|
+
}
|
|
1281
|
+
};
|
|
1282
|
+
return descriptor;
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
__name(EventListenerDecorator, "EventListenerDecorator");
|
|
1286
|
+
function ExposeDecorator() {
|
|
1287
|
+
return function(target, propertyKey, descriptor) {
|
|
1288
|
+
let data = HelperUtils.fetchOrCreate(target, "Exposed");
|
|
1289
|
+
data.set(propertyKey.toString(), {
|
|
1290
|
+
name: propertyKey.toString(),
|
|
1291
|
+
method: descriptor.value
|
|
1292
|
+
});
|
|
1293
|
+
return descriptor;
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
__name(ExposeDecorator, "ExposeDecorator");
|
|
1297
|
+
function EventDecorator() {
|
|
1298
|
+
return function(target, propertyKey) {
|
|
1299
|
+
let data = HelperUtils.fetchOrCreate(target, "Output");
|
|
1300
|
+
const event = `on${capitalize(propertyKey.toString())}`;
|
|
1301
|
+
const details = {
|
|
1302
|
+
eventName: event,
|
|
1303
|
+
propertyName: propertyKey.toString()
|
|
1304
|
+
};
|
|
1305
|
+
data.set(propertyKey.toString(), details);
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
__name(EventDecorator, "EventDecorator");
|
|
1309
|
+
function capitalize(str) {
|
|
1310
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1311
|
+
}
|
|
1312
|
+
__name(capitalize, "capitalize");
|
|
1313
|
+
function HostListenerDecorator(options) {
|
|
1314
|
+
return function(target, propertyKey, descriptor) {
|
|
1315
|
+
const data = HelperUtils.fetchOrCreate(target, "Host");
|
|
1316
|
+
data.set(propertyKey.toString(), {
|
|
1317
|
+
event: options.event,
|
|
1318
|
+
name: propertyKey.toString(),
|
|
1319
|
+
method: descriptor.value
|
|
1320
|
+
});
|
|
1321
|
+
return descriptor;
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
__name(HostListenerDecorator, "HostListenerDecorator");
|
|
1325
|
+
function WindowListenerDecorator(config) {
|
|
1326
|
+
return function(target, propertyKey, descriptor) {
|
|
1327
|
+
const data = HelperUtils.fetchOrCreate(target, "Window");
|
|
1328
|
+
data.set(propertyKey.toString(), {
|
|
1329
|
+
name: propertyKey.toString(),
|
|
1330
|
+
method: descriptor.value,
|
|
1331
|
+
event: config.event
|
|
1332
|
+
});
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
__name(WindowListenerDecorator, "WindowListenerDecorator");
|
|
1336
|
+
var GeneralUtils = (_b = class {
|
|
1337
|
+
static convertToArray(value) {
|
|
1338
|
+
return Array.isArray(value) ? value : [
|
|
1339
|
+
value
|
|
1340
|
+
];
|
|
1341
|
+
}
|
|
1342
|
+
}, __name(_b, "GeneralUtils"), _b);
|
|
1343
|
+
function WatcherDecorator(value) {
|
|
1344
|
+
return function(target, propertyKey, descriptor) {
|
|
1345
|
+
if (value) {
|
|
1346
|
+
const properties = GeneralUtils.convertToArray(value);
|
|
1347
|
+
properties.forEach((property) => {
|
|
1348
|
+
const data = HelperUtils.fetchOrCreate(target, `Watcher:${property}`);
|
|
1349
|
+
data.set(propertyKey.toString(), {
|
|
1350
|
+
name: propertyKey.toString(),
|
|
1351
|
+
method: descriptor.value,
|
|
1352
|
+
value: property
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
return descriptor;
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
__name(WatcherDecorator, "WatcherDecorator");
|
|
1360
|
+
function HTML(strings, ...values) {
|
|
1361
|
+
let str = "";
|
|
1362
|
+
strings.forEach((string, i) => {
|
|
1363
|
+
str += string + (values[i] || "");
|
|
1364
|
+
});
|
|
1365
|
+
return str;
|
|
1366
|
+
}
|
|
1367
|
+
__name(HTML, "HTML");
|
|
1368
|
+
var Sanitizer = (_c = class {
|
|
1369
|
+
/**
|
|
1370
|
+
* Sanitizes a given value based on the specified property type.
|
|
1371
|
+
*
|
|
1372
|
+
* This method processes the incoming value using the provided `PropertyType` to ensure
|
|
1373
|
+
* it conforms to the expected type. The `PropertyType` defines a `process` method that
|
|
1374
|
+
* handles the conversion or validation of the value.
|
|
1375
|
+
*
|
|
1376
|
+
* @param {any} newValue - The new value to be sanitized.
|
|
1377
|
+
* @param {PropertyType<any>} type - The property type used to process the value.
|
|
1378
|
+
* @returns {any} - The sanitized value, converted to the expected type.
|
|
1379
|
+
*
|
|
1380
|
+
* @example
|
|
1381
|
+
* // Assuming `NumberType` is a PropertyType that converts values to numbers
|
|
1382
|
+
* const sanitizedValue = Sanitizer.sanitize('123', NumberType);
|
|
1383
|
+
* console.log(sanitizedValue); // Output: 123
|
|
1384
|
+
*
|
|
1385
|
+
* @example
|
|
1386
|
+
* // Assuming `ObjectType` is a PropertyType that converts JSON strings to objects
|
|
1387
|
+
* interface ExampleObject {
|
|
1388
|
+
* key: string;
|
|
1389
|
+
* value: number;
|
|
1390
|
+
* }
|
|
1391
|
+
* const exampleObjectType = ObjectType<ExampleObject>();
|
|
1392
|
+
* const sanitizedObject = Sanitizer.sanitize('{"key": "example", "value": 42}', exampleObjectType);
|
|
1393
|
+
* console.log(sanitizedObject); // Output: { key: "example", value: 42 }
|
|
1394
|
+
*/
|
|
1395
|
+
static sanitize(newValue, type) {
|
|
1396
|
+
return type.process(newValue);
|
|
1397
|
+
}
|
|
1398
|
+
}, __name(_c, "Sanitizer"), _c);
|
|
1399
|
+
var EventEmitter = (_d = class {
|
|
1400
|
+
/**
|
|
1401
|
+
* Creates an instance of `EventEmitter`.
|
|
1402
|
+
*
|
|
1403
|
+
* @param {string} name - The name of the event to be emitted.
|
|
1404
|
+
*/
|
|
1405
|
+
constructor(name) {
|
|
1406
|
+
__publicField(this, "name");
|
|
1407
|
+
this.name = name;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Emits an event with the specified data.
|
|
1411
|
+
*
|
|
1412
|
+
* This method creates a `CustomEvent` with the provided data and dispatches it.
|
|
1413
|
+
* If a root element is specified, the event is dispatched from that element.
|
|
1414
|
+
* Otherwise, the event is dispatched from the global window object.
|
|
1415
|
+
*
|
|
1416
|
+
* @param {T} data - The data to be included in the event's detail.
|
|
1417
|
+
* @param {HTMLElement} [root] - The root element from which to dispatch the event. If not provided, the event is dispatched from the window.
|
|
1418
|
+
*/
|
|
1419
|
+
emit(data, root) {
|
|
1420
|
+
const event = new CustomEvent(this.name, {
|
|
1421
|
+
bubbles: true,
|
|
1422
|
+
detail: data
|
|
1423
|
+
});
|
|
1424
|
+
if (root) {
|
|
1425
|
+
root.dispatchEvent(event);
|
|
1426
|
+
} else window.dispatchEvent(event);
|
|
1427
|
+
}
|
|
1428
|
+
}, __name(_d, "EventEmitter"), _d);
|
|
1429
|
+
var BaseElement = (_e = class extends HTMLElement {
|
|
1430
|
+
constructor() {
|
|
1431
|
+
super();
|
|
1432
|
+
__publicField(this, "isShadow");
|
|
1433
|
+
__publicField(this, "shadowRoot");
|
|
1434
|
+
__publicField(this, "reactive", false);
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Lifecycle method called when the component is added to the DOM.
|
|
1438
|
+
*
|
|
1439
|
+
* This method performs the following tasks:
|
|
1440
|
+
* 1. Executes methods annotated with `@BeforeInit` decorator.
|
|
1441
|
+
* 2. Exposes methods annotated with `@Expose` decorator to the global scope.
|
|
1442
|
+
* 3. Binds the component's HTML content and events.
|
|
1443
|
+
* 4. Binds the component's internal methods to their corresponding events.
|
|
1444
|
+
* 5. Binds event emitters to the component's properties.
|
|
1445
|
+
* 6. Binds the event related to host to its internal methods.
|
|
1446
|
+
* 7. Bind the event on window to its internal methods.
|
|
1447
|
+
* 8. Executed methods annotated with `@AfterInit`
|
|
1448
|
+
* @method connectedCallback
|
|
1449
|
+
*/
|
|
1450
|
+
connectedCallback() {
|
|
1451
|
+
this.handleBeforeInit();
|
|
1452
|
+
this.bindHTML();
|
|
1453
|
+
this.exposeMethods();
|
|
1454
|
+
this.bindMethods();
|
|
1455
|
+
this.bindEmitter();
|
|
1456
|
+
this.bindHostEvents();
|
|
1457
|
+
this.bindWindowEvents();
|
|
1458
|
+
this.handleAfterInit();
|
|
1459
|
+
}
|
|
1460
|
+
disconnectedCallback() {
|
|
1461
|
+
this.unbindMethods();
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Updates the component's rendered HTML.
|
|
1465
|
+
*
|
|
1466
|
+
* This method re-renders the component's HTML content based on the current state.
|
|
1467
|
+
* If the component uses a shadow DOM, it updates the shadow root's inner HTML.
|
|
1468
|
+
* Otherwise, it updates the component's inner HTML. After updating the HTML,
|
|
1469
|
+
* it re-binds the component's methods to their corresponding events.
|
|
1470
|
+
*
|
|
1471
|
+
* @method updateHTML
|
|
1472
|
+
*/
|
|
1473
|
+
updateHTML() {
|
|
1474
|
+
if (this.isShadow && this.shadowRoot) {
|
|
1475
|
+
this.shadowRoot.innerHTML = this.render();
|
|
1476
|
+
} else {
|
|
1477
|
+
this.innerHTML = this.render();
|
|
1478
|
+
}
|
|
1479
|
+
this.bindMethods();
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Called when an observed attribute changes.
|
|
1483
|
+
*
|
|
1484
|
+
* This method is invoked when one of the component's attributes, specified in the `observedAttributes` array, changes.
|
|
1485
|
+
* It updates the component's properties and re-renders the component if the new value is different from the old value.
|
|
1486
|
+
*
|
|
1487
|
+
* @method attributeChangedCallback
|
|
1488
|
+
* @param {string} name - The name of the attribute that changed.
|
|
1489
|
+
* @param {string} oldValue - The old value of the attribute.
|
|
1490
|
+
* @param {string} newValue - The new value of the attribute.
|
|
1491
|
+
*/
|
|
1492
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1493
|
+
if (!this.reactive) {
|
|
1494
|
+
HelperUtils.bindReactive(this);
|
|
1495
|
+
}
|
|
1496
|
+
if (!newValue) {
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
if (newValue !== oldValue) {
|
|
1500
|
+
this.bindProperty(name, newValue);
|
|
1501
|
+
this.updateHTML();
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Sets the value of an attribute on the component and updates the corresponding property.
|
|
1506
|
+
*
|
|
1507
|
+
* This method overrides the default `setAttribute` method to ensure that the component's
|
|
1508
|
+
* property is updated whenever an attribute is set. It assigns the provided value to the
|
|
1509
|
+
* property with the same name as the attribute and then calls the superclasses `setAttribute`
|
|
1510
|
+
* method to update the attribute on the DOM element.
|
|
1511
|
+
*
|
|
1512
|
+
* @param {number} qualifiedName - The name of the attribute to set.
|
|
1513
|
+
* @param {number} value - The value to assign to the attribute.
|
|
1514
|
+
*/
|
|
1515
|
+
setAttribute(qualifiedName, value) {
|
|
1516
|
+
super.setAttribute(qualifiedName, value);
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Executes methods annotated with `@BeforeInit` decorator before the component initializes.
|
|
1520
|
+
*
|
|
1521
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1522
|
+
* to find methods marked with the `@BeforeInit` decorator. It then invokes the
|
|
1523
|
+
* `beforeInit` method if it exists in the metadata, allowing for any setup
|
|
1524
|
+
* or initialization tasks to be performed before the component is fully initialized.
|
|
1525
|
+
*
|
|
1526
|
+
* @method handleBeforeInit
|
|
1527
|
+
*/
|
|
1528
|
+
handleBeforeInit() {
|
|
1529
|
+
let data = HelperUtils.fetchOrCreate(this, "Before");
|
|
1530
|
+
const fun = data.get("beforeViewInit");
|
|
1531
|
+
if (fun) {
|
|
1532
|
+
fun.apply(this);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Executes methods annotated with `@AfterInit` decorator after the component initializes.
|
|
1537
|
+
*
|
|
1538
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1539
|
+
* to find methods marked with the `@AfterInit` decorator. It then invokes the
|
|
1540
|
+
* `afterInit` method if it exists in the metadata, allowing for any setup
|
|
1541
|
+
* or initialization tasks to be performed after the component is fully initialized.
|
|
1542
|
+
*
|
|
1543
|
+
* @method handleAfterInit
|
|
1544
|
+
*/
|
|
1545
|
+
handleAfterInit() {
|
|
1546
|
+
let data = HelperUtils.fetchOrCreate(this, "After");
|
|
1547
|
+
let fun = data.get("afterViewInit");
|
|
1548
|
+
if (fun) {
|
|
1549
|
+
fun.apply(this);
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Binds the component's `HTML` content and events based on metadata.
|
|
1554
|
+
*
|
|
1555
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1556
|
+
* to determine if the component should use a shadow DOM. It then sets the inner
|
|
1557
|
+
* HTML of the component or its shadow root to the result of the `render` method.
|
|
1558
|
+
* After setting the HTML, it binds events specified in the component's inner HTML
|
|
1559
|
+
* to their corresponding methods.
|
|
1560
|
+
*
|
|
1561
|
+
* @method bindHTML
|
|
1562
|
+
*/
|
|
1563
|
+
bindHTML() {
|
|
1564
|
+
let methods = Reflect.getMetadata(this.constructor.name, this.constructor);
|
|
1565
|
+
this.isShadow = Reflect.getMetadata(this.constructor.name + ":shadow", this.constructor);
|
|
1566
|
+
if (this.isShadow) {
|
|
1567
|
+
this.shadowRoot = this.attachShadow({
|
|
1568
|
+
mode: "open"
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
if (this.isShadow) {
|
|
1572
|
+
if (this.shadowRoot) {
|
|
1573
|
+
this.shadowRoot.innerHTML = this.render();
|
|
1574
|
+
this.bindEvents(this, methods);
|
|
1575
|
+
}
|
|
1576
|
+
} else {
|
|
1577
|
+
this.innerHTML = this.render();
|
|
1578
|
+
this.bindEvents(this, methods);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Binds events specified in the component's inner HTML to their corresponding methods.
|
|
1583
|
+
*
|
|
1584
|
+
* This method searches the component's inner HTML for event bindings in the format
|
|
1585
|
+
* `@event="{method}"`. It then attaches event listeners to the elements matching
|
|
1586
|
+
* these bindings, ensuring that the specified methods are called when the events
|
|
1587
|
+
* are triggered.
|
|
1588
|
+
*
|
|
1589
|
+
* @method bindEvents
|
|
1590
|
+
* @param {HTMLElement | ShadowRoot} root - The root element to search for event bindings.
|
|
1591
|
+
* @param {MethodDetails[]} methods - An array of method details to bind to the events.
|
|
1592
|
+
*/
|
|
1593
|
+
bindEvents(root, methods) {
|
|
1594
|
+
const eventPattern = /@(\w+)="{(\w+)}"/g;
|
|
1595
|
+
for (const match of root.innerHTML.matchAll(eventPattern)) {
|
|
1596
|
+
const eventName = match[1];
|
|
1597
|
+
const methodName = match[2];
|
|
1598
|
+
const methodDetail = methods.find((m) => m.name === methodName);
|
|
1599
|
+
if (methodDetail) {
|
|
1600
|
+
const elements = root.querySelectorAll(`[\\@${eventName}="{${methodName}}"]`);
|
|
1601
|
+
elements.forEach((element) => {
|
|
1602
|
+
element.addEventListener(eventName, methodDetail.method.bind(this));
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* Binds the component's internal events to its methods based on metadata.
|
|
1609
|
+
*
|
|
1610
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1611
|
+
* to find event binding configurations. It then binds the specified methods
|
|
1612
|
+
* to the corresponding events on the elements identified by the metadata.
|
|
1613
|
+
*
|
|
1614
|
+
* @method bindMethods
|
|
1615
|
+
*/
|
|
1616
|
+
bindMethods() {
|
|
1617
|
+
let data = HelperUtils.fetchOrCreate(this, "Bind");
|
|
1618
|
+
if (data) {
|
|
1619
|
+
data.forEach((config, methodName) => {
|
|
1620
|
+
const element = this.isShadow ? this.shadowRoot.querySelector(config.id) : this.querySelector(config.id);
|
|
1621
|
+
if (element) {
|
|
1622
|
+
const method = this[methodName];
|
|
1623
|
+
if (config.params) {
|
|
1624
|
+
const boundMethodWithParams = /* @__PURE__ */ __name((event, ...args) => method.apply(this, event, [
|
|
1625
|
+
...config.params,
|
|
1626
|
+
...args
|
|
1627
|
+
]), "boundMethodWithParams");
|
|
1628
|
+
element.addEventListener(config.event, boundMethodWithParams);
|
|
1629
|
+
} else {
|
|
1630
|
+
element.addEventListener(config.event, method.bind(this));
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Unbinds component's methods from their associated events.
|
|
1638
|
+
*
|
|
1639
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1640
|
+
* to find methods that were previously bound to events. It then removes the
|
|
1641
|
+
* event listeners for these methods, effectively unbinding them.
|
|
1642
|
+
*
|
|
1643
|
+
* @method unbindMethods
|
|
1644
|
+
*/
|
|
1645
|
+
unbindMethods() {
|
|
1646
|
+
const data = HelperUtils.fetchOrCreate(this, "Bind");
|
|
1647
|
+
if (!data) return;
|
|
1648
|
+
data.forEach((config) => {
|
|
1649
|
+
const element = this.querySelector(config.id);
|
|
1650
|
+
if (!element) return;
|
|
1651
|
+
element.removeEventListener(config.event, () => {
|
|
1652
|
+
});
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Exposes component methods to the global scope.
|
|
1657
|
+
*
|
|
1658
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1659
|
+
* to find methods marked for exposure. It then binds these methods to the global
|
|
1660
|
+
* `window` object, making them accessible globally.
|
|
1661
|
+
*
|
|
1662
|
+
* @method exposeMethods
|
|
1663
|
+
*/
|
|
1664
|
+
exposeMethods() {
|
|
1665
|
+
let data = HelperUtils.fetchOrCreate(this, "Exposed");
|
|
1666
|
+
if (data) {
|
|
1667
|
+
data.forEach((value, key) => {
|
|
1668
|
+
if (typeof window !== "undefined") {
|
|
1669
|
+
if (!window[key]) {
|
|
1670
|
+
window[key] = value.method.bind(this);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* Binds a component's property to a new value based on metadata.
|
|
1678
|
+
*
|
|
1679
|
+
* This method is called by `attributeChangedCallback` to update the component's
|
|
1680
|
+
* properties when an attribute changes. It retrieves metadata associated with
|
|
1681
|
+
* the component's constructor to find property details and assigns the new value
|
|
1682
|
+
* to the corresponding property.
|
|
1683
|
+
*
|
|
1684
|
+
* @method bindProperty
|
|
1685
|
+
* @param {string} name - The name of the attribute that changed.
|
|
1686
|
+
* @param {string} value - The new value of the attribute.
|
|
1687
|
+
*/
|
|
1688
|
+
bindProperty(name, value) {
|
|
1689
|
+
let data = HelperUtils.fetchOrCreate(this, "Property");
|
|
1690
|
+
if (data) {
|
|
1691
|
+
let property = data.get(name);
|
|
1692
|
+
if (property) {
|
|
1693
|
+
this[property.prototype] = Sanitizer.sanitize(value, property.type);
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Binds event emitters to the component's properties based on metadata.
|
|
1700
|
+
*
|
|
1701
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1702
|
+
* to find event details and binds an `EventEmitter` instance to each property
|
|
1703
|
+
* specified in the metadata. The event name is derived from the metadata.
|
|
1704
|
+
*
|
|
1705
|
+
* @method bindEmitter
|
|
1706
|
+
*/
|
|
1707
|
+
bindEmitter() {
|
|
1708
|
+
let data = HelperUtils.fetchOrCreate(this, "Output");
|
|
1709
|
+
if (!data) return;
|
|
1710
|
+
data.forEach((value, key) => {
|
|
1711
|
+
this[key] = new EventEmitter(value.eventName);
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Binds host events to the component's methods based on metadata.
|
|
1716
|
+
*
|
|
1717
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1718
|
+
* to find host event configurations. It then binds the specified methods
|
|
1719
|
+
* to the corresponding events on the host element or its shadow root. If the event is
|
|
1720
|
+
* a string, it adds a single event listener. If the event is an array of strings,
|
|
1721
|
+
* it traverses the array and adds event listeners for each event.
|
|
1722
|
+
*
|
|
1723
|
+
* @method bindHostEvents
|
|
1724
|
+
*
|
|
1725
|
+
* @example
|
|
1726
|
+
* // Example of using bindHostEvents to bind host events
|
|
1727
|
+
* class MyComponent extends BaseElement {
|
|
1728
|
+
* \@HostListener({ event: 'click' })
|
|
1729
|
+
* public handleClick(event: Event) {
|
|
1730
|
+
* console.log('Host element clicked', event);
|
|
1731
|
+
* }
|
|
1732
|
+
* }
|
|
1733
|
+
*
|
|
1734
|
+
* const myComponent = new MyComponent();
|
|
1735
|
+
* myComponent.bindHostEvents();
|
|
1736
|
+
* // The click event on the host element will now trigger the handleClick method
|
|
1737
|
+
*/
|
|
1738
|
+
bindHostEvents() {
|
|
1739
|
+
const data = HelperUtils.fetchOrCreate(this, "Host");
|
|
1740
|
+
if (!data) return;
|
|
1741
|
+
data.forEach((value) => {
|
|
1742
|
+
const element = this.isShadow ? this.shadowRoot : this;
|
|
1743
|
+
if (element) {
|
|
1744
|
+
if (typeof value.event === "string") {
|
|
1745
|
+
element.addEventListener(value.event, (event) => value.method.call(this, event));
|
|
1746
|
+
} else if (Array.isArray(value.event)) {
|
|
1747
|
+
value.event.forEach((eventName) => {
|
|
1748
|
+
element.addEventListener(eventName, (event) => value.method.call(this, event));
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Binds window events to the component's methods based on metadata.
|
|
1756
|
+
*
|
|
1757
|
+
* This method retrieves metadata associated with the component's constructor
|
|
1758
|
+
* to find window event configurations. It then binds the specified methods
|
|
1759
|
+
* to the corresponding events on the global `window` object. If the event is
|
|
1760
|
+
* a string, it adds a single event listener. If the event is an array of strings,
|
|
1761
|
+
* it traverses the array and adds event listeners for each event.
|
|
1762
|
+
*
|
|
1763
|
+
* @method bindWindowEvents
|
|
1764
|
+
*
|
|
1765
|
+
* @example
|
|
1766
|
+
* // Example of using bindWindowEvents to bind window events
|
|
1767
|
+
* class MyComponent extends BaseElement {
|
|
1768
|
+
* \@WindowListener({ event: 'resize' })
|
|
1769
|
+
* public handleResize(event: Event) {
|
|
1770
|
+
* console.log('Window resized', event);
|
|
1771
|
+
* }
|
|
1772
|
+
* }
|
|
1773
|
+
*
|
|
1774
|
+
* const myComponent = new MyComponent();
|
|
1775
|
+
* myComponent.bindWindowEvents();
|
|
1776
|
+
* // The resize event on the window will now trigger the handleResize method
|
|
1777
|
+
*/
|
|
1778
|
+
bindWindowEvents() {
|
|
1779
|
+
const data = HelperUtils.fetchOrCreate(this, "Window");
|
|
1780
|
+
if (!data) return;
|
|
1781
|
+
data.forEach((value) => {
|
|
1782
|
+
if (typeof value.event === "string") {
|
|
1783
|
+
window.addEventListener(value.event, (event) => value.method.call(this, event));
|
|
1784
|
+
} else if (Array.isArray(value.event)) {
|
|
1785
|
+
value.event.forEach((eventName) => {
|
|
1786
|
+
window.addEventListener(eventName, (event) => value.method.call(this, event));
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
}, __name(_e, "BaseElement"), _e);
|
|
1792
|
+
const ModalStyle = {
|
|
1793
|
+
base: "bg-white border border-gray-200 fixed left-1/2 top-1/2 space-y-4 shadow-md p-6 min-w-[320px] z-[999]",
|
|
1794
|
+
duration: {
|
|
1795
|
+
"0": "0s",
|
|
1796
|
+
"100": "100ms",
|
|
1797
|
+
"150": "150ms",
|
|
1798
|
+
"200": "200ms",
|
|
1799
|
+
"300": "300ms",
|
|
1800
|
+
"500": "500ms",
|
|
1801
|
+
"700": "700ms",
|
|
1802
|
+
"1000": "1000ms",
|
|
1803
|
+
"1200": "1200ms",
|
|
1804
|
+
"1300": "1300ms",
|
|
1805
|
+
"2000": "2000ms"
|
|
1806
|
+
},
|
|
1807
|
+
rounded: {
|
|
1808
|
+
"none": "",
|
|
1809
|
+
"sm": "rounded-sm",
|
|
1810
|
+
"md": "rounded-md",
|
|
1811
|
+
"lg": "rounded-lg",
|
|
1812
|
+
"xl": "rounded-xl",
|
|
1813
|
+
"2xl": "rounded-2xl",
|
|
1814
|
+
"3xl": "rounded-3xl",
|
|
1815
|
+
"full": "rounded-full"
|
|
1816
|
+
},
|
|
1817
|
+
direction: {
|
|
1818
|
+
up: {
|
|
1819
|
+
startX: "-50%",
|
|
1820
|
+
endX: "-50%",
|
|
1821
|
+
startY: "-200%",
|
|
1822
|
+
endY: "-50%"
|
|
1823
|
+
},
|
|
1824
|
+
down: {
|
|
1825
|
+
startX: "-50%",
|
|
1826
|
+
endX: "-50%",
|
|
1827
|
+
startY: "200%",
|
|
1828
|
+
endY: "-50%"
|
|
1829
|
+
},
|
|
1830
|
+
left: {
|
|
1831
|
+
startX: "-180%",
|
|
1832
|
+
endX: "-50%",
|
|
1833
|
+
startY: "-50%",
|
|
1834
|
+
endY: "-50%"
|
|
1835
|
+
},
|
|
1836
|
+
right: {
|
|
1837
|
+
startX: "140%",
|
|
1838
|
+
endX: "-50%",
|
|
1839
|
+
startY: "-50%",
|
|
1840
|
+
endY: "-50%"
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
};
|
|
1844
|
+
var __defProp$a = Object.defineProperty;
|
|
1845
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
1846
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
1847
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
1848
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1849
|
+
if (decorator = decorators[i])
|
|
1850
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1851
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
1852
|
+
return result;
|
|
1853
|
+
};
|
|
1854
|
+
exports.ModalComponent = class ModalComponent extends BaseElement {
|
|
1855
|
+
constructor() {
|
|
1856
|
+
super();
|
|
1857
|
+
__publicField(this, "isOpen");
|
|
1858
|
+
__publicField(this, "content");
|
|
1859
|
+
__publicField(this, "className");
|
|
1860
|
+
__publicField(this, "rounded");
|
|
1861
|
+
__publicField(this, "duration");
|
|
1862
|
+
__publicField(this, "direction");
|
|
1863
|
+
__publicField(this, "modalChange");
|
|
1864
|
+
__publicField(this, "template", (open) => {
|
|
1865
|
+
return `
|
|
1866
|
+
<div style="
|
|
1867
|
+
--start-x: ${ModalStyle.direction[`${this.direction ?? "up"}`].startX};
|
|
1868
|
+
--end-x: ${ModalStyle.direction[`${this.direction ?? "up"}`].endX};
|
|
1869
|
+
--start-y: ${ModalStyle.direction[`${this.direction ?? "up"}`].startY};
|
|
1870
|
+
--end-y: ${ModalStyle.direction[`${this.direction ?? "up"}`].endY};
|
|
1871
|
+
--animation-duration: ${ModalStyle.duration[`${this.duration ?? "1300"}`]};
|
|
1872
|
+
" id="model" class="${open ? "modelOpen" : "modelClose"} ${ModalStyle.base} ${ModalStyle.rounded[`${this.rounded ?? "none"}`]}">
|
|
1873
|
+
<button type="button" id="close" class="absolute right-4 top-3">X</button>
|
|
1874
|
+
${this.content}
|
|
1875
|
+
</div>
|
|
1876
|
+
`;
|
|
1877
|
+
});
|
|
1878
|
+
this.content = this.innerHTML;
|
|
1879
|
+
}
|
|
1880
|
+
handleClose() {
|
|
1881
|
+
this.isOpen = false;
|
|
1882
|
+
this.modalChange.emit(false, this);
|
|
1883
|
+
}
|
|
1884
|
+
render() {
|
|
1885
|
+
return this.template(this.isOpen);
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
__decorateClass$b([
|
|
1889
|
+
PropertyDecorator({ name: "open", type: StringType })
|
|
1890
|
+
], exports.ModalComponent.prototype, "isOpen", 2);
|
|
1891
|
+
__decorateClass$b([
|
|
1892
|
+
PropertyDecorator({ name: "className", type: StringType })
|
|
1893
|
+
], exports.ModalComponent.prototype, "className", 2);
|
|
1894
|
+
__decorateClass$b([
|
|
1895
|
+
PropertyDecorator({ name: "rounded", type: StringType })
|
|
1896
|
+
], exports.ModalComponent.prototype, "rounded", 2);
|
|
1897
|
+
__decorateClass$b([
|
|
1898
|
+
PropertyDecorator({ name: "duration", type: StringType })
|
|
1899
|
+
], exports.ModalComponent.prototype, "duration", 2);
|
|
1900
|
+
__decorateClass$b([
|
|
1901
|
+
PropertyDecorator({ name: "direction", type: StringType })
|
|
1902
|
+
], exports.ModalComponent.prototype, "direction", 2);
|
|
1903
|
+
__decorateClass$b([
|
|
1904
|
+
EventDecorator()
|
|
1905
|
+
], exports.ModalComponent.prototype, "modalChange", 2);
|
|
1906
|
+
__decorateClass$b([
|
|
1907
|
+
BindEventDecorator({ event: "click", id: "#close" })
|
|
1908
|
+
], exports.ModalComponent.prototype, "handleClose", 1);
|
|
1909
|
+
exports.ModalComponent = __decorateClass$b([
|
|
1910
|
+
ComponentDecorator({
|
|
1911
|
+
selector: "dota-modal",
|
|
1912
|
+
shadow: false
|
|
1913
|
+
})
|
|
1914
|
+
], exports.ModalComponent);
|
|
1915
|
+
var __defProp$9 = Object.defineProperty;
|
|
1916
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
1917
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
1918
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
1919
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1920
|
+
if (decorator = decorators[i])
|
|
1921
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1922
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
1923
|
+
return result;
|
|
1924
|
+
};
|
|
1925
|
+
exports.CardComponent = class CardComponent extends BaseElement {
|
|
1926
|
+
constructor() {
|
|
1927
|
+
super();
|
|
1928
|
+
__publicField(this, "content");
|
|
1929
|
+
__publicField(this, "className");
|
|
1930
|
+
this.content = this.innerHTML;
|
|
1931
|
+
}
|
|
1932
|
+
render() {
|
|
1933
|
+
return `
|
|
1934
|
+
<div class="${this.className}">
|
|
1935
|
+
${this.content}
|
|
1936
|
+
</div>
|
|
1937
|
+
`;
|
|
1938
|
+
}
|
|
1939
|
+
};
|
|
1940
|
+
__decorateClass$a([
|
|
1941
|
+
PropertyDecorator({ name: "className", type: StringType })
|
|
1942
|
+
], exports.CardComponent.prototype, "className", 2);
|
|
1943
|
+
exports.CardComponent = __decorateClass$a([
|
|
1944
|
+
ComponentDecorator({
|
|
1945
|
+
selector: "dota-card",
|
|
1946
|
+
shadow: false
|
|
1947
|
+
})
|
|
1948
|
+
], exports.CardComponent);
|
|
1949
|
+
exports.CardTitleComponent = class CardTitleComponent extends BaseElement {
|
|
1950
|
+
constructor() {
|
|
1951
|
+
super();
|
|
1952
|
+
__publicField(this, "title");
|
|
1953
|
+
__publicField(this, "className");
|
|
1954
|
+
__publicField(this, "template", (title) => {
|
|
1955
|
+
let content;
|
|
1956
|
+
content = title || this.innerHTML;
|
|
1957
|
+
return `
|
|
1958
|
+
<h1 class="text-3xl font-bold ${this.className ?? ""}">
|
|
1959
|
+
${content}
|
|
1960
|
+
</h1>
|
|
1961
|
+
`;
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1964
|
+
render() {
|
|
1965
|
+
return this.template(this.title);
|
|
1966
|
+
}
|
|
1967
|
+
};
|
|
1968
|
+
__decorateClass$a([
|
|
1969
|
+
PropertyDecorator({ name: "title", type: StringType })
|
|
1970
|
+
], exports.CardTitleComponent.prototype, "title", 2);
|
|
1971
|
+
__decorateClass$a([
|
|
1972
|
+
PropertyDecorator({ name: "className", type: StringType })
|
|
1973
|
+
], exports.CardTitleComponent.prototype, "className", 2);
|
|
1974
|
+
exports.CardTitleComponent = __decorateClass$a([
|
|
1975
|
+
ComponentDecorator({
|
|
1976
|
+
selector: "card-title",
|
|
1977
|
+
shadow: true
|
|
1978
|
+
})
|
|
1979
|
+
], exports.CardTitleComponent);
|
|
1980
|
+
exports.CardHeaderComponent = class CardHeaderComponent extends BaseElement {
|
|
1981
|
+
constructor() {
|
|
1982
|
+
super();
|
|
1983
|
+
__publicField(this, "header");
|
|
1984
|
+
__publicField(this, "template", (header) => {
|
|
1985
|
+
let content = header || this.innerHTML;
|
|
1986
|
+
return `
|
|
1987
|
+
<header class="py-4 text-4xl font-bold">${content}</header>
|
|
1988
|
+
`;
|
|
1989
|
+
});
|
|
1990
|
+
}
|
|
1991
|
+
render() {
|
|
1992
|
+
return this.template(this.header);
|
|
1993
|
+
}
|
|
1994
|
+
};
|
|
1995
|
+
__decorateClass$a([
|
|
1996
|
+
PropertyDecorator({ name: "", type: StringType })
|
|
1997
|
+
], exports.CardHeaderComponent.prototype, "header", 2);
|
|
1998
|
+
exports.CardHeaderComponent = __decorateClass$a([
|
|
1999
|
+
ComponentDecorator({
|
|
2000
|
+
selector: "card-header",
|
|
2001
|
+
shadow: false
|
|
2002
|
+
})
|
|
2003
|
+
], exports.CardHeaderComponent);
|
|
2004
|
+
exports.CardDescriptionComponent = class CardDescriptionComponent extends BaseElement {
|
|
2005
|
+
constructor() {
|
|
2006
|
+
super();
|
|
2007
|
+
__publicField(this, "description");
|
|
2008
|
+
__publicField(this, "className");
|
|
2009
|
+
__publicField(this, "template", (description) => {
|
|
2010
|
+
let content = description || this.innerHTML;
|
|
2011
|
+
return `
|
|
2012
|
+
<p class="text-lg font-medium ${this.className}">${content}</p>
|
|
2013
|
+
`;
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
render() {
|
|
2017
|
+
return this.template(this.description);
|
|
2018
|
+
}
|
|
2019
|
+
};
|
|
2020
|
+
__decorateClass$a([
|
|
2021
|
+
PropertyDecorator({ name: "description", type: StringType })
|
|
2022
|
+
], exports.CardDescriptionComponent.prototype, "description", 2);
|
|
2023
|
+
__decorateClass$a([
|
|
2024
|
+
PropertyDecorator({ name: "className", type: StringType })
|
|
2025
|
+
], exports.CardDescriptionComponent.prototype, "className", 2);
|
|
2026
|
+
exports.CardDescriptionComponent = __decorateClass$a([
|
|
2027
|
+
ComponentDecorator({
|
|
2028
|
+
selector: "card-description",
|
|
2029
|
+
shadow: false
|
|
2030
|
+
})
|
|
2031
|
+
], exports.CardDescriptionComponent);
|
|
2032
|
+
exports.CardFooterComponent = class CardFooterComponent extends BaseElement {
|
|
2033
|
+
constructor() {
|
|
2034
|
+
super();
|
|
2035
|
+
__publicField(this, "content");
|
|
2036
|
+
__publicField(this, "className");
|
|
2037
|
+
this.content = this.innerHTML;
|
|
2038
|
+
}
|
|
2039
|
+
render() {
|
|
2040
|
+
return `
|
|
2041
|
+
<footer class="flex items-center gap-4 justify-center ${this.className}">
|
|
2042
|
+
${this.content}
|
|
2043
|
+
</footer>
|
|
2044
|
+
`;
|
|
2045
|
+
}
|
|
2046
|
+
};
|
|
2047
|
+
__decorateClass$a([
|
|
2048
|
+
PropertyDecorator({ name: "className", type: StringType })
|
|
2049
|
+
], exports.CardFooterComponent.prototype, "className", 2);
|
|
2050
|
+
exports.CardFooterComponent = __decorateClass$a([
|
|
2051
|
+
ComponentDecorator({
|
|
2052
|
+
selector: "card-footer",
|
|
2053
|
+
shadow: false
|
|
2054
|
+
})
|
|
2055
|
+
], exports.CardFooterComponent);
|
|
2056
|
+
const BadgeStyle = {
|
|
2057
|
+
base: "inline-flex item-center text-center w-fit px-3 py-1",
|
|
2058
|
+
rounded: {
|
|
2059
|
+
"none": "",
|
|
2060
|
+
"sm": "rounded-sm",
|
|
2061
|
+
"md": "rounded-md",
|
|
2062
|
+
"lg": "rounded-lg",
|
|
2063
|
+
"xl": "rounded-xl"
|
|
2064
|
+
},
|
|
2065
|
+
size: {
|
|
2066
|
+
xs: "text-xs",
|
|
2067
|
+
sm: "text-sm",
|
|
2068
|
+
lg: "text-lg",
|
|
2069
|
+
xl: "text-xl",
|
|
2070
|
+
"2xl": "text-2xl",
|
|
2071
|
+
"3xl": "text-3xl",
|
|
2072
|
+
"4xl": "text-4xl"
|
|
2073
|
+
},
|
|
2074
|
+
color: {
|
|
2075
|
+
red: {
|
|
2076
|
+
solid: "bg-red-500 dark:bg-red-400 text-white dark:text-gray-900",
|
|
2077
|
+
outline: "text-red-500 dark:text-red-400 ring-1 ring-inset ring-red-500 dark:ring-red-400",
|
|
2078
|
+
soft: "bg-red-50 dark:bg-red-400 dark:bg-opacity-10 text-red-500 dark:text-red-400",
|
|
2079
|
+
subtle: "bg-red-50 dark:bg-red-400 dark:bg-opacity-10 text-red-500 dark:text-red-400 ring-1 ring-inset ring-red-500 dark:ring-red-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2080
|
+
},
|
|
2081
|
+
yellow: {
|
|
2082
|
+
solid: "bg-yellow-500 dark:bg-yellow-400 text-white dark:text-gray-900",
|
|
2083
|
+
outline: "text-yellow-500 dark:text-yellow-400 ring-1 ring-inset ring-yellow-500 dark:ring-yellow-400",
|
|
2084
|
+
soft: "bg-yellow-50 dark:bg-yellow-400 dark:bg-opacity-10 text-yellow-500 dark:text-yellow-400",
|
|
2085
|
+
subtle: "bg-yellow-50 dark:bg-yellow-400 dark:bg-opacity-10 text-yellow-500 dark:text-yellow-400 ring-1 ring-inset ring-yellow-500 dark:ring-yellow-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2086
|
+
},
|
|
2087
|
+
pink: {
|
|
2088
|
+
solid: "bg-pink-500 dark:bg-pink-400 text-white dark:text-gray-900",
|
|
2089
|
+
outline: "text-pink-500 dark:text-pink-400 ring-1 ring-inset ring-pink-500 dark:ring-pink-400",
|
|
2090
|
+
soft: "bg-pink-50 dark:bg-pink-400 dark:bg-opacity-10 text-pink-500 dark:text-pink-400",
|
|
2091
|
+
subtle: "bg-pink-50 dark:bg-pink-400 dark:bg-opacity-10 text-pink-500 dark:text-pink-400 ring-1 ring-inset ring-pink-500 dark:ring-pink-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2092
|
+
},
|
|
2093
|
+
purple: {
|
|
2094
|
+
solid: "bg-purple-500 dark:bg-purple-400 text-white dark:text-gray-900",
|
|
2095
|
+
outline: "text-purple-500 dark:text-purple-400 ring-1 ring-inset ring-purple-500 dark:ring-purple-400",
|
|
2096
|
+
soft: "bg-purple-50 dark:bg-purple-400 dark:bg-opacity-10 text-purple-500 dark:text-purple-400",
|
|
2097
|
+
subtle: "bg-purple-50 dark:bg-purple-400 dark:bg-opacity-10 text-purple-500 dark:text-purple-400 ring-1 ring-inset ring-purple-500 dark:ring-purple-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2098
|
+
},
|
|
2099
|
+
blue: {
|
|
2100
|
+
solid: "bg-blue-500 dark:bg-blue-400 text-white dark:text-gray-900",
|
|
2101
|
+
outline: "text-blue-500 dark:text-blue-400 ring-1 ring-inset ring-blue-500 dark:ring-blue-400",
|
|
2102
|
+
soft: "bg-blue-50 dark:bg-blue-400 dark:bg-opacity-10 text-blue-500 dark:text-blue-400",
|
|
2103
|
+
subtle: "bg-blue-50 dark:bg-blue-400 dark:bg-opacity-10 text-blue-500 dark:text-blue-400 ring-1 ring-inset ring-blue-500 dark:ring-blue-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2104
|
+
},
|
|
2105
|
+
cyan: {
|
|
2106
|
+
solid: "bg-cyan-500 dark:bg-cyan-400 text-white dark:text-gray-900",
|
|
2107
|
+
outline: "text-cyan-500 dark:text-cyan-400 ring-1 ring-inset ring-cyan-500 dark:ring-cyan-400",
|
|
2108
|
+
soft: "bg-cyan-50 dark:bg-cyan-400 dark:bg-opacity-10 text-cyan-500 dark:text-cyan-400",
|
|
2109
|
+
subtle: "bg-cyan-50 dark:bg-cyan-400 dark:bg-opacity-10 text-cyan-500 dark:text-cyan-400 ring-1 ring-inset ring-cyan-500 dark:ring-cyan-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2110
|
+
},
|
|
2111
|
+
green: {
|
|
2112
|
+
solid: "bg-green-500 dark:bg-green-400 text-white dark:text-gray-900",
|
|
2113
|
+
outline: "text-green-500 dark:text-green-400 ring-1 ring-inset ring-green-500 dark:ring-green-400",
|
|
2114
|
+
soft: "bg-green-50 dark:bg-green-400 dark:bg-opacity-10 text-green-500 dark:text-green-400",
|
|
2115
|
+
subtle: "bg-green-50 dark:bg-green-400 dark:bg-opacity-10 text-green-500 dark:text-green-400 ring-1 ring-inset ring-green-500 dark:ring-green-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2116
|
+
},
|
|
2117
|
+
emerald: {
|
|
2118
|
+
solid: "bg-emerald-500 dark:bg-emerald-400 text-white dark:text-gray-900",
|
|
2119
|
+
outline: "text-emerald-500 dark:text-emerald-400 ring-1 ring-inset ring-emerald-500 dark:ring-emerald-400",
|
|
2120
|
+
soft: "bg-emerald-50 dark:bg-emerald-400 dark:bg-opacity-10 text-emerald-500 dark:text-emerald-400",
|
|
2121
|
+
subtle: "bg-emerald-50 dark:bg-emerald-400 dark:bg-opacity-10 text-emerald-500 dark:text-emerald-400 ring-1 ring-inset ring-emerald-500 dark:ring-emerald-400 ring-opacity-25 dark:ring-opacity-25"
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
};
|
|
2125
|
+
var __defProp$8 = Object.defineProperty;
|
|
2126
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
2127
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
2128
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
2129
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2130
|
+
if (decorator = decorators[i])
|
|
2131
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2132
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
2133
|
+
return result;
|
|
2134
|
+
};
|
|
2135
|
+
exports.BadgeComponent = class BadgeComponent extends BaseElement {
|
|
2136
|
+
constructor() {
|
|
2137
|
+
super();
|
|
2138
|
+
__publicField(this, "className");
|
|
2139
|
+
__publicField(this, "color");
|
|
2140
|
+
__publicField(this, "variant");
|
|
2141
|
+
__publicField(this, "size");
|
|
2142
|
+
__publicField(this, "rounded");
|
|
2143
|
+
__publicField(this, "label");
|
|
2144
|
+
__publicField(this, "content");
|
|
2145
|
+
this.content = this.innerHTML;
|
|
2146
|
+
this.counter = 0;
|
|
2147
|
+
}
|
|
2148
|
+
render() {
|
|
2149
|
+
return `
|
|
2150
|
+
<span id="click" class="${BadgeStyle.base} ${BadgeStyle["color"][`${this.color ?? "red"}`][`${this.variant ?? "solid"}`]} ${BadgeStyle.size[`${this.size ?? ""}`]} ${BadgeStyle.rounded[`${this.rounded ?? "none"}`]} ${this.className ?? ""}">
|
|
2151
|
+
${this.label ? this.label : this.content}
|
|
2152
|
+
</span>
|
|
2153
|
+
`;
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
__decorateClass$9([
|
|
2157
|
+
PropertyDecorator({ name: "classname", type: StringType })
|
|
2158
|
+
], exports.BadgeComponent.prototype, "className", 2);
|
|
2159
|
+
__decorateClass$9([
|
|
2160
|
+
PropertyDecorator({ name: "color", type: StringType })
|
|
2161
|
+
], exports.BadgeComponent.prototype, "color", 2);
|
|
2162
|
+
__decorateClass$9([
|
|
2163
|
+
PropertyDecorator({ name: "variant", type: StringType })
|
|
2164
|
+
], exports.BadgeComponent.prototype, "variant", 2);
|
|
2165
|
+
__decorateClass$9([
|
|
2166
|
+
PropertyDecorator({ name: "size", type: StringType })
|
|
2167
|
+
], exports.BadgeComponent.prototype, "size", 2);
|
|
2168
|
+
__decorateClass$9([
|
|
2169
|
+
PropertyDecorator({ name: "rounded", type: StringType })
|
|
2170
|
+
], exports.BadgeComponent.prototype, "rounded", 2);
|
|
2171
|
+
__decorateClass$9([
|
|
2172
|
+
PropertyDecorator({ name: "label", type: StringType })
|
|
2173
|
+
], exports.BadgeComponent.prototype, "label", 2);
|
|
2174
|
+
exports.BadgeComponent = __decorateClass$9([
|
|
2175
|
+
ComponentDecorator({
|
|
2176
|
+
selector: "dota-badge",
|
|
2177
|
+
shadow: false
|
|
2178
|
+
})
|
|
2179
|
+
], exports.BadgeComponent);
|
|
2180
|
+
var __defProp$7 = Object.defineProperty;
|
|
2181
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
2182
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
2183
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
2184
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2185
|
+
if (decorator = decorators[i])
|
|
2186
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2187
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
2188
|
+
return result;
|
|
2189
|
+
};
|
|
2190
|
+
exports.ScaffoldComponent = class ScaffoldComponent extends BaseElement {
|
|
2191
|
+
/**
|
|
2192
|
+
* Initializes the component and captures inner content
|
|
2193
|
+
*/
|
|
2194
|
+
constructor() {
|
|
2195
|
+
super();
|
|
2196
|
+
__publicField(this, "className");
|
|
2197
|
+
/**
|
|
2198
|
+
* Inner HTML content of the component
|
|
2199
|
+
*/
|
|
2200
|
+
__publicField(this, "content");
|
|
2201
|
+
this.content = this.innerHTML;
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Renders the component with the stored content and applied classes
|
|
2205
|
+
* @returns Rendered HTML string
|
|
2206
|
+
*/
|
|
2207
|
+
render() {
|
|
2208
|
+
return `
|
|
2209
|
+
<section class="p-2 ${this.className ?? ""}">
|
|
2210
|
+
${this.content}
|
|
2211
|
+
</section>
|
|
2212
|
+
`;
|
|
2213
|
+
}
|
|
2214
|
+
};
|
|
2215
|
+
__decorateClass$8([
|
|
2216
|
+
PropertyDecorator({ name: "classname", type: StringType })
|
|
2217
|
+
], exports.ScaffoldComponent.prototype, "className", 2);
|
|
2218
|
+
exports.ScaffoldComponent = __decorateClass$8([
|
|
2219
|
+
ComponentDecorator({
|
|
2220
|
+
selector: "app-scaffold",
|
|
2221
|
+
shadow: false
|
|
2222
|
+
})
|
|
2223
|
+
], exports.ScaffoldComponent);
|
|
2224
|
+
const UIConfig = {
|
|
2225
|
+
color: {
|
|
2226
|
+
none: {
|
|
2227
|
+
solid: "",
|
|
2228
|
+
soft: "",
|
|
2229
|
+
outline: "",
|
|
2230
|
+
ghost: "",
|
|
2231
|
+
link: ""
|
|
2232
|
+
},
|
|
2233
|
+
red: {
|
|
2234
|
+
solid: "dark:text-gray-800 text-gray-200 bg-red-500 hover:bg-red-600 disabled:bg-red-500 dark:bg-red-400 dark:hover:bg-red-500 dark:disabled:bg-red-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-500 dark:focus-visible:outline-red-400",
|
|
2235
|
+
soft: "text-red-500 dark:text-red-400 bg-red-50 hover:bg-red-100 disabled:bg-red-50 dark:bg-red-950 dark:hover:bg-red-900 dark:disabled:bg-red-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-red-500 dark:focus-visible:ring-red-400",
|
|
2236
|
+
outline: "ring-1 ring-inset ring-current text-red-500 dark:text-red-400 hover:bg-red-50 disabled:bg-transparent dark:hover:bg-red-950 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-red-500 dark:focus-visible:ring-red-400",
|
|
2237
|
+
ghost: "text-red-500 dark:text-red-400 hover:bg-red-50 disabled:bg-transparent dark:hover:bg-red-950 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-red-500 dark:focus-visible:ring-red-400",
|
|
2238
|
+
link: "text-red-500 hover:text-red-600 disabled:text-red-500 dark:text-red-400 dark:hover:text-red-500 dark:disabled:text-red-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-red-500 dark:focus-visible:ring-red-400"
|
|
2239
|
+
},
|
|
2240
|
+
yellow: {
|
|
2241
|
+
solid: "text-white bg-yellow-500 hover:bg-yellow-600 disabled:bg-yellow-500 dark:bg-yellow-400 dark:hover:bg-yellow-500 dark:disabled:bg-yellow-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-yellow-500 dark:focus-visible:ring-yellow-400",
|
|
2242
|
+
soft: "text-yellow-500 dark:text-yellow-400 bg-yellow-50 hover:bg-yellow-100 disabled:bg-yellow-50 dark:bg-yellow-950 dark:hover:bg-yellow-900 dark:disabled:bg-yellow-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-yellow-500 dark:focus-visible:ring-yellow-400",
|
|
2243
|
+
outline: "text-yellow-500 dark:text-yellow-400 border border-yellow-500 hover:bg-yellow-50 disabled:bg-yellow-50 dark:border-yellow-400 dark:hover:bg-yellow-900 dark:disabled:bg-yellow-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-yellow-500 dark:focus-visible:ring-yellow-400",
|
|
2244
|
+
ghost: "text-yellow-500 dark:text-yellow-400 bg-transparent hover:bg-yellow-50 disabled:bg-transparent dark:hover:bg-yellow-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-yellow-500 dark:focus-visible:ring-yellow-400",
|
|
2245
|
+
link: "text-yellow-500 hover:text-yellow-600 disabled:text-yellow-500 dark:text-yellow-400 dark:hover:text-yellow-500 dark:disabled:text-yellow-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-yellow-500 dark:focus-visible:ring-yellow-400"
|
|
2246
|
+
},
|
|
2247
|
+
rose: {
|
|
2248
|
+
solid: "text-white bg-rose-500 hover:bg-rose-600 disabled:bg-rose-500 dark:bg-rose-400 dark:hover:bg-rose-500 dark:disabled:bg-rose-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rose-500 dark:focus-visible:ring-rose-400",
|
|
2249
|
+
soft: "text-rose-500 dark:text-rose-400 bg-rose-50 hover:bg-rose-100 disabled:bg-rose-50 dark:bg-rose-950 dark:hover:bg-rose-900 dark:disabled:bg-rose-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rose-500 dark:focus-visible:ring-rose-400",
|
|
2250
|
+
outline: "text-rose-500 dark:text-rose-400 border border-rose-500 hover:bg-rose-50 disabled:bg-rose-50 dark:border-rose-400 dark:hover:bg-rose-900 dark:disabled:bg-rose-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rose-500 dark:focus-visible:ring-rose-400",
|
|
2251
|
+
ghost: "text-rose-500 dark:text-rose-400 bg-transparent hover:bg-rose-50 disabled:bg-transparent dark:hover:bg-rose-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rose-500 dark:focus-visible:ring-rose-400",
|
|
2252
|
+
link: "text-rose-500 hover:text-rose-600 disabled:text-rose-500 dark:text-rose-400 dark:hover:text-rose-500 dark:disabled:text-rose-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rose-500 dark:focus-visible:ring-rose-400"
|
|
2253
|
+
},
|
|
2254
|
+
emerald: {
|
|
2255
|
+
solid: "text-white bg-emerald-500 hover:bg-emerald-600 disabled:bg-emerald-500 dark:bg-emerald-400 dark:hover:bg-emerald-500 dark:disabled:bg-emerald-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 dark:focus-visible:ring-emerald-400",
|
|
2256
|
+
soft: "text-emerald-500 dark:text-emerald-400 bg-emerald-50 hover:bg-emerald-100 disabled:bg-emerald-50 dark:bg-emerald-950 dark:hover:bg-emerald-900 dark:disabled:bg-emerald-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 dark:focus-visible:ring-emerald-400",
|
|
2257
|
+
outline: "text-emerald-500 dark:text-emerald-400 border border-emerald-500 hover:bg-emerald-50 disabled:bg-emerald-50 dark:border-emerald-400 dark:hover:bg-emerald-900 dark:disabled:bg-emerald-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 dark:focus-visible:ring-emerald-400",
|
|
2258
|
+
ghost: "text-emerald-500 dark:text-emerald-400 bg-transparent hover:bg-emerald-50 disabled:bg-transparent dark:hover:bg-emerald-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 dark:focus-visible:ring-emerald-400",
|
|
2259
|
+
link: "text-emerald-500 hover:text-emerald-600 disabled:text-emerald-500 dark:text-emerald-400 dark:hover:text-emerald-500 dark:disabled:text-emerald-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 dark:focus-visible:ring-emerald-400"
|
|
2260
|
+
},
|
|
2261
|
+
green: {
|
|
2262
|
+
solid: "text-white bg-green-500 hover:bg-green-600 disabled:bg-green-500 dark:bg-green-400 dark:hover:bg-green-500 dark:disabled:bg-green-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-green-500 dark:focus-visible:ring-green-400",
|
|
2263
|
+
soft: "text-green-500 dark:text-green-400 bg-green-50 hover:bg-green-100 disabled:bg-green-50 dark:bg-green-950 dark:hover:bg-green-900 dark:disabled:bg-green-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-green-500 dark:focus-visible:ring-green-400",
|
|
2264
|
+
outline: "text-green-500 dark:text-green-400 border border-green-500 hover:bg-green-50 disabled:bg-green-50 dark:border-green-400 dark:hover:bg-green-900 dark:disabled:bg-green-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-green-500 dark:focus-visible:ring-green-400",
|
|
2265
|
+
ghost: "text-green-500 dark:text-green-400 bg-transparent hover:bg-green-50 disabled:bg-transparent dark:hover:bg-green-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-green-500 dark:focus-visible:ring-green-400",
|
|
2266
|
+
link: "text-green-500 hover:text-green-600 disabled:text-green-500 dark:text-green-400 dark:hover:text-green-500 dark:disabled:text-green-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-green-500 dark:focus-visible:ring-green-400"
|
|
2267
|
+
},
|
|
2268
|
+
blue: {
|
|
2269
|
+
solid: "text-white bg-blue-500 hover:bg-blue-600 disabled:bg-blue-500 dark:bg-blue-400 dark:hover:bg-blue-500 dark:disabled:bg-blue-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400",
|
|
2270
|
+
soft: "text-blue-500 dark:text-blue-400 bg-blue-50 hover:bg-blue-100 disabled:bg-blue-50 dark:bg-blue-950 dark:hover:bg-blue-900 dark:disabled:bg-blue-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400",
|
|
2271
|
+
outline: "text-blue-500 dark:text-blue-400 border border-blue-500 hover:bg-blue-50 disabled:bg-blue-50 dark:border-blue-400 dark:hover:bg-blue-900 dark:disabled:bg-blue-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400",
|
|
2272
|
+
ghost: "text-blue-500 dark:text-blue-400 bg-transparent hover:bg-blue-50 disabled:bg-transparent dark:hover:bg-blue-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400",
|
|
2273
|
+
link: "text-blue-500 hover:text-blue-600 disabled:text-blue-500 dark:text-blue-400 dark:hover:text-blue-500 dark:disabled:text-blue-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400"
|
|
2274
|
+
},
|
|
2275
|
+
cyan: {
|
|
2276
|
+
solid: "text-white bg-cyan-500 hover:bg-cyan-600 disabled:bg-cyan-500 dark:bg-cyan-400 dark:hover:bg-cyan-500 dark:disabled:bg-cyan-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-cyan-500 dark:focus-visible:ring-cyan-400",
|
|
2277
|
+
soft: "text-cyan-500 dark:text-cyan-400 bg-cyan-50 hover:bg-cyan-100 disabled:bg-cyan-50 dark:bg-cyan-950 dark:hover:bg-cyan-900 dark:disabled:bg-cyan-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-cyan-500 dark:focus-visible:ring-cyan-400",
|
|
2278
|
+
outline: "text-cyan-500 dark:text-cyan-400 border border-cyan-500 hover:bg-cyan-50 disabled:bg-cyan-50 dark:border-cyan-400 dark:hover:bg-cyan-900 dark:disabled:bg-cyan-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-cyan-500 dark:focus-visible:ring-cyan-400",
|
|
2279
|
+
ghost: "text-cyan-500 dark:text-cyan-400 bg-transparent hover:bg-cyan-50 disabled:bg-transparent dark:hover:bg-cyan-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-cyan-500 dark:focus-visible:ring-cyan-400",
|
|
2280
|
+
link: "text-cyan-500 hover:text-cyan-600 disabled:text-cyan-500 dark:text-cyan-400 dark:hover:text-cyan-500 dark:disabled:text-cyan-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-cyan-500 dark:focus-visible:ring-cyan-400"
|
|
2281
|
+
},
|
|
2282
|
+
teal: {
|
|
2283
|
+
solid: "text-white bg-teal-500 hover:bg-teal-600 disabled:bg-teal-500 dark:bg-teal-400 dark:hover:bg-teal-500 dark:disabled:bg-teal-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-teal-500 dark:focus-visible:ring-teal-400",
|
|
2284
|
+
soft: "text-teal-500 dark:text-teal-400 bg-teal-50 hover:bg-teal-100 disabled:bg-teal-50 dark:bg-teal-950 dark:hover:bg-teal-900 dark:disabled:bg-teal-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-teal-500 dark:focus-visible:ring-teal-400",
|
|
2285
|
+
outline: "text-teal-500 dark:text-teal-400 border border-teal-500 hover:bg-teal-50 disabled:bg-teal-50 dark:border-teal-400 dark:hover:bg-teal-900 dark:disabled:bg-teal-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-teal-500 dark:focus-visible:ring-teal-400",
|
|
2286
|
+
ghost: "text-teal-500 dark:text-teal-400 bg-transparent hover:bg-teal-50 disabled:bg-transparent dark:hover:bg-teal-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-teal-500 dark:focus-visible:ring-teal-400",
|
|
2287
|
+
link: "text-teal-500 hover:text-teal-600 disabled:text-teal-500 dark:text-teal-400 dark:hover:text-teal-500 dark:disabled:text-teal-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-teal-500 dark:focus-visible:ring-teal-400"
|
|
2288
|
+
},
|
|
2289
|
+
gray: {
|
|
2290
|
+
solid: "text-white bg-gray-500 hover:bg-gray-600 disabled:bg-gray-500 dark:bg-gray-400 dark:hover:bg-gray-500 dark:disabled:bg-gray-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-500 dark:focus-visible:ring-gray-400",
|
|
2291
|
+
soft: "text-gray-500 dark:text-gray-400 bg-gray-50 hover:bg-gray-100 disabled:bg-gray-50 dark:bg-gray-950 dark:hover:bg-gray-900 dark:disabled:bg-gray-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-500 dark:focus-visible:ring-gray-400",
|
|
2292
|
+
outline: "text-gray-500 dark:text-gray-400 border border-gray-500 hover:bg-gray-50 disabled:bg-gray-50 dark:border-gray-400 dark:hover:bg-gray-900 dark:disabled:bg-gray-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-500 dark:focus-visible:ring-gray-400",
|
|
2293
|
+
ghost: "text-gray-500 dark:text-gray-400 bg-transparent hover:bg-gray-50 disabled:bg-transparent dark:hover:bg-gray-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-500 dark:focus-visible:ring-gray-400",
|
|
2294
|
+
link: "text-gray-500 hover:text-gray-600 disabled:text-gray-500 dark:text-gray-400 dark:hover:text-gray-500 dark:disabled:text-gray-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-500 dark:focus-visible:ring-gray-400"
|
|
2295
|
+
},
|
|
2296
|
+
purple: {
|
|
2297
|
+
solid: "text-white bg-purple-500 hover:bg-purple-600 disabled:bg-purple-500 dark:bg-purple-400 dark:hover:bg-purple-500 dark:disabled:bg-purple-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-purple-500 dark:focus-visible:ring-purple-400",
|
|
2298
|
+
soft: "text-purple-500 dark:text-purple-400 bg-purple-50 hover:bg-purple-100 disabled:bg-purple-50 dark:bg-purple-950 dark:hover:bg-purple-900 dark:disabled:bg-purple-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-purple-500 dark:focus-visible:ring-purple-400",
|
|
2299
|
+
outline: "text-purple-500 dark:text-purple-400 border border-purple-500 hover:bg-purple-50 disabled:bg-purple-50 dark:border-purple-400 dark:hover:bg-purple-900 dark:disabled:bg-purple-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-purple-500 dark:focus-visible:ring-purple-400",
|
|
2300
|
+
ghost: "text-purple-500 dark:text-purple-400 bg-transparent hover:bg-purple-50 disabled:bg-transparent dark:hover:bg-purple-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-purple-500 dark:focus-visible:ring-purple-400",
|
|
2301
|
+
link: "text-purple-500 hover:text-purple-600 disabled:text-purple-500 dark:text-purple-400 dark:hover:text-purple-500 dark:disabled:text-purple-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-purple-500 dark:focus-visible:ring-purple-400"
|
|
2302
|
+
},
|
|
2303
|
+
violet: {
|
|
2304
|
+
solid: "text-white bg-violet-500 hover:bg-violet-600 disabled:bg-violet-500 dark:bg-violet-400 dark:hover:bg-violet-500 dark:disabled:bg-violet-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-violet-500 dark:focus-visible:ring-violet-400",
|
|
2305
|
+
soft: "text-violet-500 dark:text-violet-400 bg-violet-50 hover:bg-violet-100 disabled:bg-violet-50 dark:bg-violet-950 dark:hover:bg-violet-900 dark:disabled:bg-violet-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-violet-500 dark:focus-visible:ring-violet-400",
|
|
2306
|
+
outline: "text-violet-500 dark:text-violet-400 border border-violet-500 hover:bg-violet-50 disabled:bg-violet-50 dark:border-violet-400 dark:hover:bg-violet-900 dark:disabled:bg-violet-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-violet-500 dark:focus-visible:ring-violet-400",
|
|
2307
|
+
ghost: "text-violet-500 dark:text-violet-400 bg-transparent hover:bg-violet-50 disabled:bg-transparent dark:hover:bg-violet-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-violet-500 dark:focus-visible:ring-violet-400",
|
|
2308
|
+
link: "text-violet-500 hover:text-violet-600 disabled:text-violet-500 dark:text-violet-400 dark:hover:text-violet-500 dark:disabled:text-violet-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-violet-500 dark:focus-visible:ring-violet-400"
|
|
2309
|
+
},
|
|
2310
|
+
pink: {
|
|
2311
|
+
solid: "text-white bg-pink-500 hover:bg-pink-600 disabled:bg-pink-500 dark:bg-pink-400 dark:hover:bg-pink-500 dark:disabled:bg-pink-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-pink-500 dark:focus-visible:ring-pink-400",
|
|
2312
|
+
soft: "text-pink-500 dark:text-pink-400 bg-pink-50 hover:bg-pink-100 disabled:bg-pink-50 dark:bg-pink-950 dark:hover:bg-pink-900 dark:disabled:bg-pink-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-pink-500 dark:focus-visible:ring-pink-400",
|
|
2313
|
+
outline: "text-pink-500 dark:text-pink-400 border border-pink-500 hover:bg-pink-50 disabled:bg-pink-50 dark:border-pink-400 dark:hover:bg-pink-900 dark:disabled:bg-pink-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-pink-500 dark:focus-visible:ring-pink-400",
|
|
2314
|
+
ghost: "text-pink-500 dark:text-pink-400 bg-transparent hover:bg-pink-50 disabled:bg-transparent dark:hover:bg-pink-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-pink-500 dark:focus-visible:ring-pink-400",
|
|
2315
|
+
link: "text-pink-500 hover:text-pink-600 disabled:text-pink-500 dark:text-pink-400 dark:hover:text-pink-500 dark:disabled:text-pink-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-pink-500 dark:focus-visible:ring-pink-400"
|
|
2316
|
+
},
|
|
2317
|
+
sky: {
|
|
2318
|
+
solid: "text-white bg-sky-500 hover:bg-sky-600 disabled:bg-sky-500 dark:bg-sky-400 dark:hover:bg-sky-500 dark:disabled:bg-sky-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-500 dark:focus-visible:ring-sky-400",
|
|
2319
|
+
soft: "text-sky-500 dark:text-sky-400 bg-sky-50 hover:bg-sky-100 disabled:bg-sky-50 dark:bg-sky-950 dark:hover:bg-sky-900 dark:disabled:bg-sky-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-500 dark:focus-visible:ring-sky-400",
|
|
2320
|
+
outline: "text-sky-500 dark:text-sky-400 border border-sky-500 hover:bg-sky-50 disabled:bg-sky-50 dark:border-sky-400 dark:hover:bg-sky-900 dark:disabled:bg-sky-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-500 dark:focus-visible:ring-sky-400",
|
|
2321
|
+
ghost: "text-sky-500 dark:text-sky-400 bg-transparent hover:bg-sky-50 disabled:bg-transparent dark:hover:bg-sky-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-500 dark:focus-visible:ring-sky-400",
|
|
2322
|
+
link: "text-sky-500 hover:text-sky-600 disabled:text-sky-500 dark:text-sky-400 dark:hover:text-sky-500 dark:disabled:text-sky-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-500 dark:focus-visible:ring-sky-400"
|
|
2323
|
+
},
|
|
2324
|
+
orange: {
|
|
2325
|
+
solid: "text-white bg-orange-500 hover:bg-orange-600 disabled:bg-orange-500 dark:bg-orange-400 dark:hover:bg-orange-500 dark:disabled:bg-orange-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-orange-500 dark:focus-visible:ring-orange-400",
|
|
2326
|
+
soft: "text-orange-500 dark:text-orange-400 bg-orange-50 hover:bg-orange-100 disabled:bg-orange-50 dark:bg-orange-950 dark:hover:bg-orange-900 dark:disabled:bg-orange-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-orange-500 dark:focus-visible:ring-orange-400",
|
|
2327
|
+
outline: "text-orange-500 dark:text-orange-400 border border-orange-500 hover:bg-orange-50 disabled:bg-orange-50 dark:border-orange-400 dark:hover:bg-orange-900 dark:disabled:bg-orange-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-orange-500 dark:focus-visible:ring-orange-400",
|
|
2328
|
+
ghost: "text-orange-500 dark:text-orange-400 bg-transparent hover:bg-orange-50 disabled:bg-transparent dark:hover:bg-orange-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-orange-500 dark:focus-visible:ring-orange-400",
|
|
2329
|
+
link: "text-orange-500 hover:text-orange-600 disabled:text-orange-500 dark:text-orange-400 dark:hover:text-orange-500 dark:disabled:text-orange-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-orange-500 dark:focus-visible:ring-orange-400"
|
|
2330
|
+
},
|
|
2331
|
+
slate: {
|
|
2332
|
+
solid: "text-white bg-slate-500 hover:bg-slate-600 disabled:bg-slate-500 dark:bg-slate-400 dark:hover:bg-slate-500 dark:disabled:bg-slate-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-500 dark:focus-visible:ring-slate-400",
|
|
2333
|
+
soft: "text-slate-500 dark:text-slate-400 bg-slate-50 hover:bg-slate-100 disabled:bg-slate-50 dark:bg-slate-950 dark:hover:bg-slate-900 dark:disabled:bg-slate-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-500 dark:focus-visible:ring-slate-400",
|
|
2334
|
+
outline: "text-slate-500 dark:text-slate-400 border border-slate-500 hover:bg-slate-50 disabled:bg-slate-50 dark:border-slate-400 dark:hover:bg-slate-900 dark:disabled:bg-slate-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-500 dark:focus-visible:ring-slate-400",
|
|
2335
|
+
ghost: "text-slate-500 dark:text-slate-400 bg-transparent hover:bg-slate-50 disabled:bg-transparent dark:hover:bg-slate-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-500 dark:focus-visible:ring-slate-400",
|
|
2336
|
+
link: "text-slate-500 hover:text-slate-600 disabled:text-slate-500 dark:text-slate-400 dark:hover:text-slate-500 dark:disabled:text-slate-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-500 dark:focus-visible:ring-slate-400"
|
|
2337
|
+
},
|
|
2338
|
+
indigo: {
|
|
2339
|
+
solid: "text-white bg-indigo-500 hover:bg-indigo-600 disabled:bg-indigo-500 dark:bg-indigo-400 dark:hover:bg-indigo-500 dark:disabled:bg-indigo-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-500 dark:focus-visible:ring-indigo-400",
|
|
2340
|
+
soft: "text-indigo-500 dark:text-indigo-400 bg-indigo-50 hover:bg-indigo-100 disabled:bg-indigo-50 dark:bg-indigo-950 dark:hover:bg-indigo-900 dark:disabled:bg-indigo-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-500 dark:focus-visible:ring-indigo-400",
|
|
2341
|
+
outline: "text-indigo-500 dark:text-indigo-400 border border-indigo-500 hover:bg-indigo-50 disabled:bg-indigo-50 dark:border-indigo-400 dark:hover:bg-indigo-900 dark:disabled:bg-indigo-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-500 dark:focus-visible:ring-indigo-400",
|
|
2342
|
+
ghost: "text-indigo-500 dark:text-indigo-400 bg-transparent hover:bg-indigo-50 disabled:bg-transparent dark:hover:bg-indigo-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-500 dark:focus-visible:ring-indigo-400",
|
|
2343
|
+
link: "text-indigo-500 hover:text-indigo-600 disabled:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500 dark:disabled:text-indigo-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-500 dark:focus-visible:ring-indigo-400"
|
|
2344
|
+
},
|
|
2345
|
+
fuchsia: {
|
|
2346
|
+
solid: "text-white bg-fuchsia-500 hover:bg-fuchsia-600 disabled:bg-fuchsia-500 dark:bg-fuchsia-400 dark:hover:bg-fuchsia-500 dark:disabled:bg-fuchsia-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fuchsia-500 dark:focus-visible:ring-fuchsia-400",
|
|
2347
|
+
soft: "text-fuchsia-500 dark:text-fuchsia-400 bg-fuchsia-50 hover:bg-fuchsia-100 disabled:bg-fuchsia-50 dark:bg-fuchsia-950 dark:hover:bg-fuchsia-900 dark:disabled:bg-fuchsia-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fuchsia-500 dark:focus-visible:ring-fuchsia-400",
|
|
2348
|
+
outline: "text-fuchsia-500 dark:text-fuchsia-400 border border-fuchsia-500 hover:bg-fuchsia-50 disabled:bg-fuchsia-50 dark:border-fuchsia-400 dark:hover:bg-fuchsia-900 dark:disabled:bg-fuchsia-950 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fuchsia-500 dark:focus-visible:ring-fuchsia-400",
|
|
2349
|
+
ghost: "text-fuchsia-500 dark:text-fuchsia-400 bg-transparent hover:bg-fuchsia-50 disabled:bg-transparent dark:hover:bg-fuchsia-900 dark:disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fuchsia-500 dark:focus-visible:ring-fuchsia-400",
|
|
2350
|
+
link: "text-fuchsia-500 hover:text-fuchsia-600 disabled:text-fuchsia-500 dark:text-fuchsia-400 dark:hover:text-fuchsia-500 dark:disabled:text-fuchsia-400 underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fuchsia-500 dark:focus-visible:ring-fuchsia-400"
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
};
|
|
2354
|
+
const IconStyle = {
|
|
2355
|
+
shadow: "shadow-sm",
|
|
2356
|
+
base: "overflow-hidden rounded-md focus:outline-none focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 flex-shrink-0 relative font-medium",
|
|
2357
|
+
color: {
|
|
2358
|
+
...UIConfig.color
|
|
2359
|
+
},
|
|
2360
|
+
size: {
|
|
2361
|
+
sm: "p-0.5 size-4",
|
|
2362
|
+
md: "p-0.5 size-6",
|
|
2363
|
+
lg: "p-1 size-8",
|
|
2364
|
+
xl: "p-1 size-10",
|
|
2365
|
+
"2xl": "p-1.5 size-12",
|
|
2366
|
+
"3xl": "p-1.5 size-14"
|
|
2367
|
+
}
|
|
2368
|
+
};
|
|
2369
|
+
var __defProp$6 = Object.defineProperty;
|
|
2370
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
2371
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
2372
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
2373
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2374
|
+
if (decorator = decorators[i])
|
|
2375
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2376
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
2377
|
+
return result;
|
|
2378
|
+
};
|
|
2379
|
+
exports.IconsComponent = class IconsComponent extends BaseElement {
|
|
2380
|
+
constructor() {
|
|
2381
|
+
super();
|
|
2382
|
+
__publicField(this, "name");
|
|
2383
|
+
__publicField(this, "className");
|
|
2384
|
+
__publicField(this, "size");
|
|
2385
|
+
__publicField(this, "color");
|
|
2386
|
+
__publicField(this, "variant");
|
|
2387
|
+
}
|
|
2388
|
+
afterViewInit() {
|
|
2389
|
+
this.getSvg().then();
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Fetches and renders the SVG icon from the Iconify API
|
|
2393
|
+
* Applies the configured size, color, and variant styles
|
|
2394
|
+
*/
|
|
2395
|
+
async getSvg() {
|
|
2396
|
+
let url = `https://api.iconify.design/${this.name}.svg?color=%23888888`;
|
|
2397
|
+
const response = await fetch(url);
|
|
2398
|
+
if (response.status === 200) {
|
|
2399
|
+
let text = await response.text();
|
|
2400
|
+
if (text !== "404") {
|
|
2401
|
+
this.innerHTML = text;
|
|
2402
|
+
const svg = this.querySelector("svg");
|
|
2403
|
+
if (svg) {
|
|
2404
|
+
svg.setAttribute("class", IconStyle.size[this.size] || IconStyle.size.sm);
|
|
2405
|
+
IconStyle.base.split(" ").forEach((value) => svg.classList.add(value));
|
|
2406
|
+
if (this.color) {
|
|
2407
|
+
const iconColor = this.variant ? IconStyle.color[this.color][this.variant] : IconStyle.color[this.color].solid;
|
|
2408
|
+
iconColor.split(" ").forEach((value) => svg.classList.add(value));
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
const svgPath = this.querySelector("svg path");
|
|
2412
|
+
if (svgPath) {
|
|
2413
|
+
svgPath.setAttribute("fill", "currentColor");
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
} else {
|
|
2417
|
+
console.warn("Invalid Icon Name");
|
|
2418
|
+
this.innerHTML = "";
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
render() {
|
|
2422
|
+
return HTML`
|
|
2423
|
+
<div id="svg" class="flex items-center justify-center">
|
|
2424
|
+
|
|
2425
|
+
</div>
|
|
2426
|
+
`;
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2429
|
+
__decorateClass$7([
|
|
2430
|
+
PropertyDecorator({ name: "name", type: StringType })
|
|
2431
|
+
], exports.IconsComponent.prototype, "name", 2);
|
|
2432
|
+
__decorateClass$7([
|
|
2433
|
+
PropertyDecorator({ name: "classname", type: StringType })
|
|
2434
|
+
], exports.IconsComponent.prototype, "className", 2);
|
|
2435
|
+
__decorateClass$7([
|
|
2436
|
+
PropertyDecorator({ name: "size", type: StringType })
|
|
2437
|
+
], exports.IconsComponent.prototype, "size", 2);
|
|
2438
|
+
__decorateClass$7([
|
|
2439
|
+
PropertyDecorator({ name: "color", type: StringType })
|
|
2440
|
+
], exports.IconsComponent.prototype, "color", 2);
|
|
2441
|
+
__decorateClass$7([
|
|
2442
|
+
PropertyDecorator({ name: "variant", type: StringType })
|
|
2443
|
+
], exports.IconsComponent.prototype, "variant", 2);
|
|
2444
|
+
__decorateClass$7([
|
|
2445
|
+
AfterInitDecorator()
|
|
2446
|
+
], exports.IconsComponent.prototype, "afterViewInit", 1);
|
|
2447
|
+
exports.IconsComponent = __decorateClass$7([
|
|
2448
|
+
ComponentDecorator({
|
|
2449
|
+
selector: "dota-icon",
|
|
2450
|
+
shadow: false
|
|
2451
|
+
})
|
|
2452
|
+
], exports.IconsComponent);
|
|
2453
|
+
const AccordionStyle = {
|
|
2454
|
+
button: {
|
|
2455
|
+
base: "focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75 flex-shrink-0 font-medium rounded-md inline-flex justify-between items-center mb-1.5 w-full",
|
|
2456
|
+
size: {
|
|
2457
|
+
"2xs": "text-xs gap-x-1 px-2 py-1",
|
|
2458
|
+
xs: "text-xs gap-x-1.5 px-2.5 py-1.5",
|
|
2459
|
+
sm: "text-sm gap-x-1.5 px-2.5 py-1.5",
|
|
2460
|
+
md: "text-sm gap-x-2 px-3 py-2",
|
|
2461
|
+
lg: "text-sm gap-x-2.5 px-3.5 py-2.5",
|
|
2462
|
+
xl: "text-base gap-x-2.5 px-3.5 py-2.5"
|
|
2463
|
+
},
|
|
2464
|
+
color: {
|
|
2465
|
+
...UIConfig.color
|
|
2466
|
+
}
|
|
2467
|
+
},
|
|
2468
|
+
paragraph: "text-sm text-gray-500 dark:text-gray-400 pt-1.5 pb-3"
|
|
2469
|
+
};
|
|
2470
|
+
var __defProp$5 = Object.defineProperty;
|
|
2471
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
2472
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
2473
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
2474
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2475
|
+
if (decorator = decorators[i])
|
|
2476
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2477
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
2478
|
+
return result;
|
|
2479
|
+
};
|
|
2480
|
+
exports.AccordionComponent = class AccordionComponent extends BaseElement {
|
|
2481
|
+
constructor() {
|
|
2482
|
+
super();
|
|
2483
|
+
__publicField(this, "className");
|
|
2484
|
+
__publicField(this, "header");
|
|
2485
|
+
__publicField(this, "description");
|
|
2486
|
+
__publicField(this, "icon");
|
|
2487
|
+
__publicField(this, "color");
|
|
2488
|
+
__publicField(this, "variant");
|
|
2489
|
+
__publicField(this, "size");
|
|
2490
|
+
/**
|
|
2491
|
+
* Processes the icon name and returns the HTML string for the icon component.
|
|
2492
|
+
* @param icon - The name of the icon to be displayed
|
|
2493
|
+
* @returns HTML string containing the icon component or empty string if no icon provided
|
|
2494
|
+
*/
|
|
2495
|
+
__publicField(this, "processIcon", (icon) => {
|
|
2496
|
+
return icon ? `<dota-icon className="text-blue-400 text-xl" name="${icon}"></dota-icon>` : "";
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
handleAccordion() {
|
|
2500
|
+
const element = this.querySelector("#description");
|
|
2501
|
+
if (element) {
|
|
2502
|
+
element.classList.toggle("description-active");
|
|
2503
|
+
}
|
|
2504
|
+
const icon = this.querySelector("#icon");
|
|
2505
|
+
if (icon) {
|
|
2506
|
+
icon.classList.toggle("active");
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
render() {
|
|
2510
|
+
return `
|
|
2511
|
+
<div class="${this.className ?? ""} w-full flex flex-col">
|
|
2512
|
+
<button type="button" id="header" class="${AccordionStyle.button.base} ${AccordionStyle.button.size[this.size] ?? AccordionStyle.button.size.md} ${AccordionStyle.button.color[this.color][`${this.variant ?? "solid"}`] ?? AccordionStyle.button.color.gray.soft}">
|
|
2513
|
+
<div class="flex">
|
|
2514
|
+
${this.processIcon(this.icon)}
|
|
2515
|
+
<span class="text-left break-all line-clamp-1">${this.header}</span>
|
|
2516
|
+
</div>
|
|
2517
|
+
<div id="icon" class="icon">
|
|
2518
|
+
<dota-icon name="material-symbols:arrow-forward-ios-rounded"></dota-icon>
|
|
2519
|
+
</div>
|
|
2520
|
+
</button>
|
|
2521
|
+
<div id="description" class="description">
|
|
2522
|
+
<p class="overflow-hidden p-2 ${AccordionStyle.paragraph}">${this.description}</p>
|
|
2523
|
+
</div>
|
|
2524
|
+
</div>
|
|
2525
|
+
`;
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2528
|
+
__decorateClass$6([
|
|
2529
|
+
PropertyDecorator({ name: "classname", type: StringType })
|
|
2530
|
+
], exports.AccordionComponent.prototype, "className", 2);
|
|
2531
|
+
__decorateClass$6([
|
|
2532
|
+
PropertyDecorator({ name: "header", type: StringType })
|
|
2533
|
+
], exports.AccordionComponent.prototype, "header", 2);
|
|
2534
|
+
__decorateClass$6([
|
|
2535
|
+
PropertyDecorator({ name: "description", type: StringType })
|
|
2536
|
+
], exports.AccordionComponent.prototype, "description", 2);
|
|
2537
|
+
__decorateClass$6([
|
|
2538
|
+
PropertyDecorator({ name: "icon", type: StringType })
|
|
2539
|
+
], exports.AccordionComponent.prototype, "icon", 2);
|
|
2540
|
+
__decorateClass$6([
|
|
2541
|
+
PropertyDecorator({ name: "color", type: StringType })
|
|
2542
|
+
], exports.AccordionComponent.prototype, "color", 2);
|
|
2543
|
+
__decorateClass$6([
|
|
2544
|
+
PropertyDecorator({ name: "variant", type: StringType })
|
|
2545
|
+
], exports.AccordionComponent.prototype, "variant", 2);
|
|
2546
|
+
__decorateClass$6([
|
|
2547
|
+
PropertyDecorator({ name: "size", type: StringType })
|
|
2548
|
+
], exports.AccordionComponent.prototype, "size", 2);
|
|
2549
|
+
__decorateClass$6([
|
|
2550
|
+
BindEventDecorator({ event: "click", id: "#header" })
|
|
2551
|
+
], exports.AccordionComponent.prototype, "handleAccordion", 1);
|
|
2552
|
+
exports.AccordionComponent = __decorateClass$6([
|
|
2553
|
+
ComponentDecorator({
|
|
2554
|
+
selector: "dota-accordion",
|
|
2555
|
+
shadow: false
|
|
2556
|
+
})
|
|
2557
|
+
], exports.AccordionComponent);
|
|
2558
|
+
const ChipStyle = {
|
|
2559
|
+
base: {
|
|
2560
|
+
parent: "relative inline-flex items-center justify-center flex-shrink-0",
|
|
2561
|
+
chip: "absolute rounded-full text-center text-white flex item-center justify-center"
|
|
2562
|
+
},
|
|
2563
|
+
position: {
|
|
2564
|
+
"top-left": "top-0 left-0 -translate-y-1/2 -translate-x-1/2",
|
|
2565
|
+
"top-right": "top-0 right-0 -translate-y-1/2 translate-x-1/2",
|
|
2566
|
+
"bottom-right": "bottom-0 right-0 translate-y-1/2 translate-x-1/2",
|
|
2567
|
+
"bottom-left": "bottom-0 left-0 translate-y-1/2 -translate-x-1/2"
|
|
2568
|
+
},
|
|
2569
|
+
color: {
|
|
2570
|
+
red: "bg-red-500 dark:bg-red-400",
|
|
2571
|
+
yellow: "bg-yellow-500 dark:bg-yellow-400",
|
|
2572
|
+
rose: "bg-rose-500 dark:bg-rose-400",
|
|
2573
|
+
emerald: "bg-emerald-500 dark:bg-emerald-400",
|
|
2574
|
+
green: "bg-green-500 dark:bg-green-400",
|
|
2575
|
+
blue: "bg-blue-500 dark:bg-blue-400",
|
|
2576
|
+
cyan: "bg-cyan-500 dark:bg-cyan-400",
|
|
2577
|
+
teal: "bg-teal-500 dark:bg-teal-400",
|
|
2578
|
+
gray: "bg-gray-500 dark:bg-gray-400",
|
|
2579
|
+
orange: "bg-orange-500 dark:bg-orange-400",
|
|
2580
|
+
sky: "bg-sky-500 dark:bg-sky-400",
|
|
2581
|
+
purple: "bg-purple-500 dark:bg-purple-400",
|
|
2582
|
+
violet: "bg-violet-500 dark:bg-violet-400",
|
|
2583
|
+
pink: "bg-pink-500 dark:bg-pink-400"
|
|
2584
|
+
}
|
|
2585
|
+
};
|
|
2586
|
+
var __defProp$4 = Object.defineProperty;
|
|
2587
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
2588
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
2589
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
2590
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2591
|
+
if (decorator = decorators[i])
|
|
2592
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2593
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
2594
|
+
return result;
|
|
2595
|
+
};
|
|
2596
|
+
exports.ChipComponent = class ChipComponent extends BaseElement {
|
|
2597
|
+
constructor() {
|
|
2598
|
+
super();
|
|
2599
|
+
__publicField(this, "text");
|
|
2600
|
+
__publicField(this, "position");
|
|
2601
|
+
__publicField(this, "color");
|
|
2602
|
+
__publicField(this, "content");
|
|
2603
|
+
this.content = this.innerHTML;
|
|
2604
|
+
}
|
|
2605
|
+
render() {
|
|
2606
|
+
return `
|
|
2607
|
+
<div class="${ChipStyle.base.parent}">
|
|
2608
|
+
<span class="
|
|
2609
|
+
${ChipStyle.base.chip} ${ChipStyle.position[this.position] ?? ChipStyle.position["top-right"]}
|
|
2610
|
+
${ChipStyle.color[this.color] ?? ChipStyle.color.yellow} text-[10px]
|
|
2611
|
+
${this.text ? "size-4" : "size-2"}">
|
|
2612
|
+
${this.text ?? ""}
|
|
2613
|
+
</span>
|
|
2614
|
+
${this.content}
|
|
2615
|
+
</div>
|
|
2616
|
+
`;
|
|
2617
|
+
}
|
|
2618
|
+
};
|
|
2619
|
+
__decorateClass$5([
|
|
2620
|
+
PropertyDecorator({ name: "text", type: StringType })
|
|
2621
|
+
], exports.ChipComponent.prototype, "text", 2);
|
|
2622
|
+
__decorateClass$5([
|
|
2623
|
+
PropertyDecorator({ name: "position", type: StringType })
|
|
2624
|
+
], exports.ChipComponent.prototype, "position", 2);
|
|
2625
|
+
__decorateClass$5([
|
|
2626
|
+
PropertyDecorator({ name: "color", type: StringType })
|
|
2627
|
+
], exports.ChipComponent.prototype, "color", 2);
|
|
2628
|
+
exports.ChipComponent = __decorateClass$5([
|
|
2629
|
+
ComponentDecorator({
|
|
2630
|
+
selector: "dota-chip",
|
|
2631
|
+
shadow: false
|
|
2632
|
+
})
|
|
2633
|
+
], exports.ChipComponent);
|
|
2634
|
+
var __defProp$3 = Object.defineProperty;
|
|
2635
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
2636
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
2637
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
2638
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2639
|
+
if (decorator = decorators[i])
|
|
2640
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2641
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
2642
|
+
return result;
|
|
2643
|
+
};
|
|
2644
|
+
exports.AvatarComponent = class AvatarComponent extends BaseElement {
|
|
2645
|
+
constructor() {
|
|
2646
|
+
super();
|
|
2647
|
+
__publicField(this, "img");
|
|
2648
|
+
__publicField(this, "imgAlt");
|
|
2649
|
+
__publicField(this, "label");
|
|
2650
|
+
__publicField(this, "icon");
|
|
2651
|
+
__publicField(this, "isChip");
|
|
2652
|
+
__publicField(this, "chipText");
|
|
2653
|
+
__publicField(this, "chipColor");
|
|
2654
|
+
__publicField(this, "chipPosition");
|
|
2655
|
+
__publicField(this, "variant");
|
|
2656
|
+
__publicField(this, "size");
|
|
2657
|
+
__publicField(this, "template", () => {
|
|
2658
|
+
const size = this.size || "md";
|
|
2659
|
+
if (this.img) {
|
|
2660
|
+
return this.isChip ? `
|
|
2661
|
+
<dota-chip color="${this.chipColor}" size="sm" position="${this.chipPosition}">
|
|
2662
|
+
<avatar-wrapper color="${this.chipColor}" variant="${this.variant}" size="${size}">
|
|
2663
|
+
<img src="${this.img}" alt="${this.imgAlt}" class="w-full h-full">
|
|
2664
|
+
</avatar-wrapper>
|
|
2665
|
+
</dota-chip>
|
|
2666
|
+
|
|
2667
|
+
` : `
|
|
2668
|
+
<avatar-wrapper color="${this.chipColor}" variant="${this.variant}" size="${size}">
|
|
2669
|
+
<img src="${this.img}" alt="${this.imgAlt}" class="w-full h-full">
|
|
2670
|
+
</avatar-wrapper>
|
|
2671
|
+
`;
|
|
2672
|
+
} else if (this.label) {
|
|
2673
|
+
return this.isChip ? `
|
|
2674
|
+
<dota-chip color="${this.chipColor}" size="sm" position="${this.chipPosition}">
|
|
2675
|
+
<avatar-wrapper color="${this.chipColor}" variant="${this.variant}" size="${size}">
|
|
2676
|
+
${this.label.split(" ").map((value, index) => {
|
|
2677
|
+
if (index < 2) {
|
|
2678
|
+
return value.toUpperCase().at(0);
|
|
2679
|
+
}
|
|
2680
|
+
}).join("")}
|
|
2681
|
+
</avatar-wrapper>
|
|
2682
|
+
</dota-chip>
|
|
2683
|
+
` : `
|
|
2684
|
+
<avatar-wrapper color="${this.chipColor}" variant="${this.variant}" size="${size}">
|
|
2685
|
+
<span>
|
|
2686
|
+
${this.label.split(" ").map((value, index) => {
|
|
2687
|
+
if (index < 2) {
|
|
2688
|
+
return value.toUpperCase().at(0);
|
|
2689
|
+
}
|
|
2690
|
+
}).join("")}
|
|
2691
|
+
</span>
|
|
2692
|
+
</avatar-wrapper>
|
|
2693
|
+
`;
|
|
2694
|
+
} else {
|
|
2695
|
+
return this.isChip ? `
|
|
2696
|
+
<dota-chip color="${this.chipColor}" size="sm" position="${this.chipPosition}">
|
|
2697
|
+
<avatar-wrapper color="${this.chipColor}" variant="${this.variant}" size="${size}">
|
|
2698
|
+
<dota-icon name="${this.icon}" color="${this.chipColor}" size="${size}" variant="${this.variant}"></dota-icon>
|
|
2699
|
+
</avatar-wrapper>
|
|
2700
|
+
</dota-chip>
|
|
2701
|
+
` : `
|
|
2702
|
+
<avatar-wrapper color="${this.chipColor}" variant="${this.variant}" size="${size}">
|
|
2703
|
+
<dota-icon name="${this.icon}" color="${this.chipColor}" size="${size}" variant="${this.variant}"></dota-icon>
|
|
2704
|
+
</avatar-wrapper>
|
|
2705
|
+
`;
|
|
2706
|
+
}
|
|
2707
|
+
});
|
|
2708
|
+
}
|
|
2709
|
+
render() {
|
|
2710
|
+
return this.template();
|
|
2711
|
+
}
|
|
2712
|
+
};
|
|
2713
|
+
__decorateClass$4([
|
|
2714
|
+
PropertyDecorator({
|
|
2715
|
+
name: "img",
|
|
2716
|
+
type: StringType
|
|
2717
|
+
})
|
|
2718
|
+
], exports.AvatarComponent.prototype, "img", 2);
|
|
2719
|
+
__decorateClass$4([
|
|
2720
|
+
PropertyDecorator({
|
|
2721
|
+
name: "img-alt",
|
|
2722
|
+
type: StringType
|
|
2723
|
+
})
|
|
2724
|
+
], exports.AvatarComponent.prototype, "imgAlt", 2);
|
|
2725
|
+
__decorateClass$4([
|
|
2726
|
+
PropertyDecorator({
|
|
2727
|
+
name: "label",
|
|
2728
|
+
type: StringType
|
|
2729
|
+
})
|
|
2730
|
+
], exports.AvatarComponent.prototype, "label", 2);
|
|
2731
|
+
__decorateClass$4([
|
|
2732
|
+
PropertyDecorator({
|
|
2733
|
+
name: "icon",
|
|
2734
|
+
type: StringType
|
|
2735
|
+
})
|
|
2736
|
+
], exports.AvatarComponent.prototype, "icon", 2);
|
|
2737
|
+
__decorateClass$4([
|
|
2738
|
+
PropertyDecorator({
|
|
2739
|
+
name: "is-chip",
|
|
2740
|
+
type: BooleanType
|
|
2741
|
+
})
|
|
2742
|
+
], exports.AvatarComponent.prototype, "isChip", 2);
|
|
2743
|
+
__decorateClass$4([
|
|
2744
|
+
PropertyDecorator({
|
|
2745
|
+
name: "chip-text",
|
|
2746
|
+
type: StringType
|
|
2747
|
+
})
|
|
2748
|
+
], exports.AvatarComponent.prototype, "chipText", 2);
|
|
2749
|
+
__decorateClass$4([
|
|
2750
|
+
PropertyDecorator({
|
|
2751
|
+
name: "chip-color",
|
|
2752
|
+
type: StringType
|
|
2753
|
+
})
|
|
2754
|
+
], exports.AvatarComponent.prototype, "chipColor", 2);
|
|
2755
|
+
__decorateClass$4([
|
|
2756
|
+
PropertyDecorator({
|
|
2757
|
+
name: "chip-position",
|
|
2758
|
+
type: StringType
|
|
2759
|
+
})
|
|
2760
|
+
], exports.AvatarComponent.prototype, "chipPosition", 2);
|
|
2761
|
+
__decorateClass$4([
|
|
2762
|
+
PropertyDecorator({
|
|
2763
|
+
name: "variant",
|
|
2764
|
+
type: StringType
|
|
2765
|
+
})
|
|
2766
|
+
], exports.AvatarComponent.prototype, "variant", 2);
|
|
2767
|
+
__decorateClass$4([
|
|
2768
|
+
PropertyDecorator({
|
|
2769
|
+
name: "size",
|
|
2770
|
+
type: StringType
|
|
2771
|
+
})
|
|
2772
|
+
], exports.AvatarComponent.prototype, "size", 2);
|
|
2773
|
+
exports.AvatarComponent = __decorateClass$4([
|
|
2774
|
+
ComponentDecorator({
|
|
2775
|
+
selector: "d-avatar",
|
|
2776
|
+
shadow: false
|
|
2777
|
+
})
|
|
2778
|
+
], exports.AvatarComponent);
|
|
2779
|
+
exports.AvatarWrapper = class AvatarWrapper extends BaseElement {
|
|
2780
|
+
constructor() {
|
|
2781
|
+
super();
|
|
2782
|
+
/** Content to be rendered inside the avatar wrapper */
|
|
2783
|
+
__publicField(this, "content");
|
|
2784
|
+
__publicField(this, "color");
|
|
2785
|
+
__publicField(this, "variant");
|
|
2786
|
+
__publicField(this, "size");
|
|
2787
|
+
this.content = this.innerHTML;
|
|
2788
|
+
}
|
|
2789
|
+
render() {
|
|
2790
|
+
const color = AvatarConfig.color[this.color] || AvatarConfig.color.gray;
|
|
2791
|
+
const variant = color[this.variant] || color.solid;
|
|
2792
|
+
const size = AvatarConfig.size[this.size] || AvatarConfig.size.lg;
|
|
2793
|
+
return `
|
|
2794
|
+
<div class="rounded-full content-center ${variant} ${size} flex items-center justify-center font-semibold overflow-hidden">
|
|
2795
|
+
${this.content}
|
|
2796
|
+
</div>
|
|
2797
|
+
`;
|
|
2798
|
+
}
|
|
2799
|
+
};
|
|
2800
|
+
__decorateClass$4([
|
|
2801
|
+
PropertyDecorator({
|
|
2802
|
+
name: "color",
|
|
2803
|
+
type: StringType
|
|
2804
|
+
})
|
|
2805
|
+
], exports.AvatarWrapper.prototype, "color", 2);
|
|
2806
|
+
__decorateClass$4([
|
|
2807
|
+
PropertyDecorator({
|
|
2808
|
+
name: "variant",
|
|
2809
|
+
type: StringType
|
|
2810
|
+
})
|
|
2811
|
+
], exports.AvatarWrapper.prototype, "variant", 2);
|
|
2812
|
+
__decorateClass$4([
|
|
2813
|
+
PropertyDecorator({
|
|
2814
|
+
name: "size",
|
|
2815
|
+
type: StringType
|
|
2816
|
+
})
|
|
2817
|
+
], exports.AvatarWrapper.prototype, "size", 2);
|
|
2818
|
+
exports.AvatarWrapper = __decorateClass$4([
|
|
2819
|
+
ComponentDecorator({
|
|
2820
|
+
selector: "avatar-wrapper",
|
|
2821
|
+
shadow: false
|
|
2822
|
+
})
|
|
2823
|
+
], exports.AvatarWrapper);
|
|
2824
|
+
const AvatarConfig = {
|
|
2825
|
+
color: IconStyle.color,
|
|
2826
|
+
size: IconStyle.size
|
|
2827
|
+
};
|
|
2828
|
+
const ButtonStyle = {
|
|
2829
|
+
base: "inline-flex relative justify-center items-center w-fit transition-all duration-300 active:scale-95 ease-in-out w-full",
|
|
2830
|
+
size: {
|
|
2831
|
+
xs: "px-1 py-0.5 text-xs",
|
|
2832
|
+
sm: "px-1.5 py-1 text-sm",
|
|
2833
|
+
md: "px-2 py-1 text-base",
|
|
2834
|
+
lg: "px-3 py-1.5 text-lg",
|
|
2835
|
+
xl: "px-4 py-0.5 text-lg",
|
|
2836
|
+
"2xl": "px-5 py-0.5 text-xl",
|
|
2837
|
+
"3xl": "px-5 py-0.5 text-2xl"
|
|
2838
|
+
},
|
|
2839
|
+
rounded: {
|
|
2840
|
+
xs: "rounded-xs",
|
|
2841
|
+
sm: "rounded-sm",
|
|
2842
|
+
md: "rounded-md",
|
|
2843
|
+
lg: "rounded-lg",
|
|
2844
|
+
xl: "rounded-xl",
|
|
2845
|
+
"2xl": "rounded-2xl",
|
|
2846
|
+
"3xl": "rounded-3xl"
|
|
2847
|
+
},
|
|
2848
|
+
color: {
|
|
2849
|
+
...UIConfig.color
|
|
2850
|
+
},
|
|
2851
|
+
animation: {
|
|
2852
|
+
fill: {
|
|
2853
|
+
base: "buttonFill",
|
|
2854
|
+
color: {
|
|
2855
|
+
emerald: "after:bg-emerald-400 before:bg-emerald-500 dark:before:bg-emerald-500 hover:text-white",
|
|
2856
|
+
blue: "after:bg-blue-400 before:bg-blue-500 dark:before:bg-blue-500 hover:text-white",
|
|
2857
|
+
sky: "after:bg-sky-400 before:bg-sky-500 dark:before:bg-sky-500 hover:text-white",
|
|
2858
|
+
indigo: "after:bg-indigo-400 before:bg-indigo-500 dark:before:bg-indigo-500 hover:text-white",
|
|
2859
|
+
purple: "after:bg-purple-400 before:bg-purple-500 dark:before:bg-purple-500 hover:text-white",
|
|
2860
|
+
cyan: "after:bg-cyan-400 before:bg-cyan-500 dark:before:bg-cyan-500 hover:text-white",
|
|
2861
|
+
green: "after:bg-green-400 before:bg-green-500 dark:before:bg-green-500 hover:text-white",
|
|
2862
|
+
teal: "after:bg-teal-400 before:bg-teal-500 dark:before:bg-teal-500 hover:text-white",
|
|
2863
|
+
orange: "after:bg-orange-400 before:bg-orange-500 dark:before:bg-orange-500 hover:text-white",
|
|
2864
|
+
yellow: "after:bg-yellow-400 before:bg-yellow-500 dark:before:bg-yellow-500 hover:text-white",
|
|
2865
|
+
rose: "after:bg-rose-400 before:bg-rose-500 dark:before:bg-rose-500 hover:text-white",
|
|
2866
|
+
violet: "after:bg-violet-400 before:bg-violet-500 dark:before:bg-violet-500 hover:text-white",
|
|
2867
|
+
slate: "after:bg-slate-400 before:bg-slate-500 dark:before:bg-slate-500 hover:text-white",
|
|
2868
|
+
gray: "after:bg-gray-400 before:bg-gray-500 dark:before:bg-gray-500 hover:text-white",
|
|
2869
|
+
pink: "after:bg-pink-400 before:bg-pink-500 dark:before:bg-pink-500 hover:text-white",
|
|
2870
|
+
fuchsia: "after:bg-fuchsia-400 before:bg-fuchsia-500 dark:before:bg-fuchsia-500 hover:text-white"
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
};
|
|
2875
|
+
var __defProp$2 = Object.defineProperty;
|
|
2876
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
2877
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
2878
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
2879
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2880
|
+
if (decorator = decorators[i])
|
|
2881
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2882
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
2883
|
+
return result;
|
|
2884
|
+
};
|
|
2885
|
+
exports.ButtonComponent = class ButtonComponent extends BaseElement {
|
|
2886
|
+
constructor() {
|
|
2887
|
+
super();
|
|
2888
|
+
/** Inner content of the button */
|
|
2889
|
+
__publicField(this, "content");
|
|
2890
|
+
__publicField(this, "animation");
|
|
2891
|
+
__publicField(this, "className");
|
|
2892
|
+
__publicField(this, "label");
|
|
2893
|
+
__publicField(this, "color");
|
|
2894
|
+
__publicField(this, "variant");
|
|
2895
|
+
__publicField(this, "icon");
|
|
2896
|
+
__publicField(this, "loading");
|
|
2897
|
+
__publicField(this, "iconPosition");
|
|
2898
|
+
__publicField(this, "animationColor");
|
|
2899
|
+
__publicField(this, "type");
|
|
2900
|
+
__publicField(this, "size");
|
|
2901
|
+
__publicField(this, "rounded");
|
|
2902
|
+
__publicField(this, "template", () => {
|
|
2903
|
+
var _a2, _b2, _c2, _d2;
|
|
2904
|
+
const iconComponent = this.icon ? `<dota-icon class="relative block" name="${this.icon}" size="${this.size || "md"}"></dota-icon>` : "";
|
|
2905
|
+
const size = ((_a2 = ButtonStyle.size) == null ? void 0 : _a2[this.size ?? "md"]) ?? "";
|
|
2906
|
+
const round = ((_b2 = ButtonStyle.rounded) == null ? void 0 : _b2[this.rounded]) ?? "";
|
|
2907
|
+
let content;
|
|
2908
|
+
switch (this.iconPosition) {
|
|
2909
|
+
case "forward": {
|
|
2910
|
+
content = `
|
|
2911
|
+
<p>${this.label || this.content}</p>
|
|
2912
|
+
${iconComponent}
|
|
2913
|
+
`;
|
|
2914
|
+
break;
|
|
2915
|
+
}
|
|
2916
|
+
case "leading": {
|
|
2917
|
+
content = `
|
|
2918
|
+
${iconComponent}
|
|
2919
|
+
<p>${this.label || this.content}</p>
|
|
2920
|
+
`;
|
|
2921
|
+
break;
|
|
2922
|
+
}
|
|
2923
|
+
default: {
|
|
2924
|
+
content = `
|
|
2925
|
+
${iconComponent}
|
|
2926
|
+
<p>${this.label || this.content}</p>
|
|
2927
|
+
`;
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
if (this.animation) {
|
|
2931
|
+
return `
|
|
2932
|
+
<button class="${ButtonStyle.base} ${ButtonStyle.animation[this.animation || "fill"].base} ${size} ${round}
|
|
2933
|
+
${ButtonStyle.animation[this.animation ?? "fill"].color[this.animationColor ?? "indigo"]}
|
|
2934
|
+
|
|
2935
|
+
">
|
|
2936
|
+
${this.label || this.content}
|
|
2937
|
+
</button>
|
|
2938
|
+
`;
|
|
2939
|
+
}
|
|
2940
|
+
const color = ((_d2 = (_c2 = ButtonStyle.color) == null ? void 0 : _c2[this.color ?? "none"]) == null ? void 0 : _d2[this.variant ?? "solid"]) ?? "";
|
|
2941
|
+
return `
|
|
2942
|
+
<button class="${ButtonStyle.base} ${color} ${size} ${round}">
|
|
2943
|
+
${content}
|
|
2944
|
+
</button>
|
|
2945
|
+
`;
|
|
2946
|
+
});
|
|
2947
|
+
this.content = this.innerHTML;
|
|
2948
|
+
}
|
|
2949
|
+
render() {
|
|
2950
|
+
return this.template();
|
|
2951
|
+
}
|
|
2952
|
+
};
|
|
2953
|
+
__decorateClass$3([
|
|
2954
|
+
PropertyDecorator({ name: "animation", type: StringType })
|
|
2955
|
+
], exports.ButtonComponent.prototype, "animation", 2);
|
|
2956
|
+
__decorateClass$3([
|
|
2957
|
+
PropertyDecorator({ name: "className", type: StringType })
|
|
2958
|
+
], exports.ButtonComponent.prototype, "className", 2);
|
|
2959
|
+
__decorateClass$3([
|
|
2960
|
+
PropertyDecorator({ name: "label", type: StringType })
|
|
2961
|
+
], exports.ButtonComponent.prototype, "label", 2);
|
|
2962
|
+
__decorateClass$3([
|
|
2963
|
+
PropertyDecorator({ name: "color", type: StringType })
|
|
2964
|
+
], exports.ButtonComponent.prototype, "color", 2);
|
|
2965
|
+
__decorateClass$3([
|
|
2966
|
+
PropertyDecorator({ name: "variant", type: StringType })
|
|
2967
|
+
], exports.ButtonComponent.prototype, "variant", 2);
|
|
2968
|
+
__decorateClass$3([
|
|
2969
|
+
PropertyDecorator({ name: "icon", type: StringType })
|
|
2970
|
+
], exports.ButtonComponent.prototype, "icon", 2);
|
|
2971
|
+
__decorateClass$3([
|
|
2972
|
+
PropertyDecorator({ name: "loading", type: BooleanType })
|
|
2973
|
+
], exports.ButtonComponent.prototype, "loading", 2);
|
|
2974
|
+
__decorateClass$3([
|
|
2975
|
+
PropertyDecorator({ name: "icon-position", type: StringType })
|
|
2976
|
+
], exports.ButtonComponent.prototype, "iconPosition", 2);
|
|
2977
|
+
__decorateClass$3([
|
|
2978
|
+
PropertyDecorator({ name: "animation-color", type: StringType })
|
|
2979
|
+
], exports.ButtonComponent.prototype, "animationColor", 2);
|
|
2980
|
+
__decorateClass$3([
|
|
2981
|
+
PropertyDecorator({ name: "type", type: StringType })
|
|
2982
|
+
], exports.ButtonComponent.prototype, "type", 2);
|
|
2983
|
+
__decorateClass$3([
|
|
2984
|
+
PropertyDecorator({ name: "size", type: StringType })
|
|
2985
|
+
], exports.ButtonComponent.prototype, "size", 2);
|
|
2986
|
+
__decorateClass$3([
|
|
2987
|
+
PropertyDecorator({ name: "round", type: StringType })
|
|
2988
|
+
], exports.ButtonComponent.prototype, "rounded", 2);
|
|
2989
|
+
exports.ButtonComponent = __decorateClass$3([
|
|
2990
|
+
ComponentDecorator({
|
|
2991
|
+
selector: "dota-button",
|
|
2992
|
+
shadow: false
|
|
2993
|
+
})
|
|
2994
|
+
], exports.ButtonComponent);
|
|
2995
|
+
function debounce(func, wait) {
|
|
2996
|
+
let timeout;
|
|
2997
|
+
return function(...args) {
|
|
2998
|
+
return new Promise((resolve) => {
|
|
2999
|
+
clearTimeout(timeout);
|
|
3000
|
+
timeout = window.setTimeout(() => {
|
|
3001
|
+
const result = func.apply(this, args);
|
|
3002
|
+
resolve(result);
|
|
3003
|
+
}, wait);
|
|
3004
|
+
});
|
|
3005
|
+
};
|
|
3006
|
+
}
|
|
3007
|
+
const isElementInViewport = debounce((element) => {
|
|
3008
|
+
const rect = element.getBoundingClientRect();
|
|
3009
|
+
const viewportHeight = getViewportHeight();
|
|
3010
|
+
const viewportWidth = getViewportWidth();
|
|
3011
|
+
return rect.x <= viewportWidth && rect.y <= viewportHeight;
|
|
3012
|
+
}, 2e3);
|
|
3013
|
+
const elementPositionInViewport = (element) => {
|
|
3014
|
+
const rect = element.getBoundingClientRect();
|
|
3015
|
+
const position = {
|
|
3016
|
+
top: rect.top,
|
|
3017
|
+
right: rect.right,
|
|
3018
|
+
bottom: rect.bottom,
|
|
3019
|
+
left: rect.left
|
|
3020
|
+
};
|
|
3021
|
+
return position;
|
|
3022
|
+
};
|
|
3023
|
+
const calculateElementSize = (element) => {
|
|
3024
|
+
const rect = element.getBoundingClientRect();
|
|
3025
|
+
const width = rect.width;
|
|
3026
|
+
const height = rect.height;
|
|
3027
|
+
return { width, height };
|
|
3028
|
+
};
|
|
3029
|
+
const calculatePosition = (element) => {
|
|
3030
|
+
const rect = element.getBoundingClientRect();
|
|
3031
|
+
return {
|
|
3032
|
+
left: rect.x + window.scrollX,
|
|
3033
|
+
top: rect.y + window.scrollY
|
|
3034
|
+
};
|
|
3035
|
+
};
|
|
3036
|
+
const getViewportHeight = () => {
|
|
3037
|
+
return window.innerHeight || document.documentElement.clientHeight;
|
|
3038
|
+
};
|
|
3039
|
+
const getViewportWidth = () => {
|
|
3040
|
+
return window.innerWidth || document.documentElement.clientWidth;
|
|
3041
|
+
};
|
|
3042
|
+
function extractSizeAndPositions(reference, target) {
|
|
3043
|
+
const referencePosition = calculatePosition(reference);
|
|
3044
|
+
const referenceSize = calculateElementSize(reference);
|
|
3045
|
+
const targetSize = calculateElementSize(target);
|
|
3046
|
+
const targetPosition = calculatePosition(target);
|
|
3047
|
+
return { referencePosition, referenceSize, targetSize, targetPosition };
|
|
3048
|
+
}
|
|
3049
|
+
const getBottomCenterCoords = (reference, target, offset) => {
|
|
3050
|
+
const { referencePosition, referenceSize, targetSize } = extractSizeAndPositions(reference, target);
|
|
3051
|
+
const totalOffset = offset + referenceSize.height;
|
|
3052
|
+
const top = totalOffset + referencePosition.top;
|
|
3053
|
+
const widthDiff = targetSize.width - referenceSize.width;
|
|
3054
|
+
const left = referencePosition.left - widthDiff / 2;
|
|
3055
|
+
return { left, top };
|
|
3056
|
+
};
|
|
3057
|
+
const getTopCenterCoords = (reference, target, offset) => {
|
|
3058
|
+
const { referencePosition, referenceSize, targetSize } = extractSizeAndPositions(reference, target);
|
|
3059
|
+
const top = referencePosition.top - offset - targetSize.height;
|
|
3060
|
+
const widthDiff = targetSize.width - referenceSize.width;
|
|
3061
|
+
const left = referencePosition.left - widthDiff / 2;
|
|
3062
|
+
return { left, top };
|
|
3063
|
+
};
|
|
3064
|
+
const getRightCenterCoords = (reference, target, offset) => {
|
|
3065
|
+
const { referencePosition, referenceSize, targetSize } = extractSizeAndPositions(reference, target);
|
|
3066
|
+
const top = referencePosition.top - targetSize.height / 2 + referenceSize.height / 2;
|
|
3067
|
+
const left = referencePosition.left + referenceSize.width + offset;
|
|
3068
|
+
return { left, top };
|
|
3069
|
+
};
|
|
3070
|
+
const getLeftCenterCoords = (reference, target, offset) => {
|
|
3071
|
+
const { referencePosition, referenceSize, targetSize } = extractSizeAndPositions(reference, target);
|
|
3072
|
+
const top = referencePosition.top - targetSize.height / 2 + referenceSize.height / 2;
|
|
3073
|
+
const left = referencePosition.left - offset - targetSize.width;
|
|
3074
|
+
return { left, top };
|
|
3075
|
+
};
|
|
3076
|
+
class PositionCalculator {
|
|
3077
|
+
constructor() {
|
|
3078
|
+
__publicField(this, "_reference");
|
|
3079
|
+
__publicField(this, "_target");
|
|
3080
|
+
__publicField(this, "_placement", "bottom");
|
|
3081
|
+
__publicField(this, "_offset", 0);
|
|
3082
|
+
}
|
|
3083
|
+
/**
|
|
3084
|
+
* Sets the reference element.
|
|
3085
|
+
*
|
|
3086
|
+
* @param element - The reference HTML element.
|
|
3087
|
+
* @returns The current instance of PositionCalculator for method chaining.
|
|
3088
|
+
*/
|
|
3089
|
+
reference(element) {
|
|
3090
|
+
this._reference = element;
|
|
3091
|
+
return this;
|
|
3092
|
+
}
|
|
3093
|
+
/**
|
|
3094
|
+
* Sets the target element.
|
|
3095
|
+
*
|
|
3096
|
+
* @param element - The target HTML element.
|
|
3097
|
+
* @returns The current instance of PositionCalculator for method chaining.
|
|
3098
|
+
*/
|
|
3099
|
+
target(element) {
|
|
3100
|
+
this._target = element;
|
|
3101
|
+
return this;
|
|
3102
|
+
}
|
|
3103
|
+
/**
|
|
3104
|
+
* Sets the placement direction for the target element.
|
|
3105
|
+
*
|
|
3106
|
+
* @param value - The placement direction ('bottom', 'left', 'top', or 'right').
|
|
3107
|
+
* @returns The current instance of PositionCalculator for method chaining.
|
|
3108
|
+
*/
|
|
3109
|
+
placement(value) {
|
|
3110
|
+
this._placement = value;
|
|
3111
|
+
return this;
|
|
3112
|
+
}
|
|
3113
|
+
/**
|
|
3114
|
+
* Sets the offset in pixels to apply to the target element.
|
|
3115
|
+
*
|
|
3116
|
+
* @param value - The offset in pixels.
|
|
3117
|
+
* @returns The current instance of PositionCalculator for method chaining.
|
|
3118
|
+
*/
|
|
3119
|
+
offset(value) {
|
|
3120
|
+
this._offset = value;
|
|
3121
|
+
return this;
|
|
3122
|
+
}
|
|
3123
|
+
/**
|
|
3124
|
+
* Calculates the coordinates for positioning the target element based on the specified placement and offset.
|
|
3125
|
+
*
|
|
3126
|
+
* @returns An object representing the coordinates with `left` and `top` properties.
|
|
3127
|
+
*/
|
|
3128
|
+
calculate() {
|
|
3129
|
+
switch (this._placement) {
|
|
3130
|
+
case "bottom": {
|
|
3131
|
+
return getBottomCenterCoords(this._reference, this._target, this._offset);
|
|
3132
|
+
}
|
|
3133
|
+
case "left": {
|
|
3134
|
+
return getLeftCenterCoords(this._reference, this._target, this._offset);
|
|
3135
|
+
}
|
|
3136
|
+
case "top": {
|
|
3137
|
+
return getTopCenterCoords(this._reference, this._target, this._offset);
|
|
3138
|
+
}
|
|
3139
|
+
case "right": {
|
|
3140
|
+
return getRightCenterCoords(this._reference, this._target, this._offset);
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
var __defProp$1 = Object.defineProperty;
|
|
3146
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
3147
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
3148
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
3149
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
3150
|
+
if (decorator = decorators[i])
|
|
3151
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3152
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
3153
|
+
return result;
|
|
3154
|
+
};
|
|
3155
|
+
exports.PopoverComponent = class PopoverComponent extends dotaCore.BaseElement {
|
|
3156
|
+
constructor() {
|
|
3157
|
+
super();
|
|
3158
|
+
__publicField(this, "isOpen");
|
|
3159
|
+
__publicField(this, "placement");
|
|
3160
|
+
__publicField(this, "offset");
|
|
3161
|
+
/**
|
|
3162
|
+
* Content of the trigger element
|
|
3163
|
+
*/
|
|
3164
|
+
__publicField(this, "label");
|
|
3165
|
+
/**
|
|
3166
|
+
* Content to be displayed in the popover
|
|
3167
|
+
*/
|
|
3168
|
+
__publicField(this, "content");
|
|
3169
|
+
__publicField(this, "posX");
|
|
3170
|
+
__publicField(this, "posY");
|
|
3171
|
+
this.extractResource();
|
|
3172
|
+
this.posX = 0;
|
|
3173
|
+
this.posY = 0;
|
|
3174
|
+
}
|
|
3175
|
+
extractResource() {
|
|
3176
|
+
const template = this.querySelector("#panel");
|
|
3177
|
+
if (template) {
|
|
3178
|
+
this.content = template.innerHTML;
|
|
3179
|
+
}
|
|
3180
|
+
const firstChild = this.firstElementChild;
|
|
3181
|
+
if (firstChild) {
|
|
3182
|
+
this.label = firstChild.outerHTML;
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
async afterViewInit() {
|
|
3186
|
+
console.log("Initiated Popover");
|
|
3187
|
+
this.updatePosition();
|
|
3188
|
+
}
|
|
3189
|
+
handlePopover() {
|
|
3190
|
+
this.isOpen = !this.isOpen;
|
|
3191
|
+
this.updatePosition();
|
|
3192
|
+
}
|
|
3193
|
+
updatePosition() {
|
|
3194
|
+
if (!this.isOpen) return;
|
|
3195
|
+
const button = this.querySelector("#button");
|
|
3196
|
+
const popper = this.querySelector("#tooltip");
|
|
3197
|
+
const position = new PositionCalculator().reference(button).target(popper).offset(5).placement(this.placement).calculate();
|
|
3198
|
+
this.posY = position.top;
|
|
3199
|
+
this.posX = position.left;
|
|
3200
|
+
}
|
|
3201
|
+
handleWindowClick(event) {
|
|
3202
|
+
const path = event.composedPath();
|
|
3203
|
+
if (!path.includes(this)) {
|
|
3204
|
+
this.isOpen = false;
|
|
3205
|
+
this.status = false;
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
render() {
|
|
3209
|
+
return `
|
|
3210
|
+
<button id="button" aria-describedby="tooltip">
|
|
3211
|
+
${this.label}
|
|
3212
|
+
</button>
|
|
3213
|
+
<div id="tooltip" role="tooltip" class="${this.isOpen ? "" : "hidden"}" style="top: ${this.posY}px; left: ${this.posX}px">
|
|
3214
|
+
${this.content}
|
|
3215
|
+
</div>
|
|
3216
|
+
`;
|
|
3217
|
+
}
|
|
3218
|
+
};
|
|
3219
|
+
__decorateClass$2([
|
|
3220
|
+
dotaCore.Property({
|
|
3221
|
+
name: "is-open",
|
|
3222
|
+
type: dotaCore.Boolean
|
|
3223
|
+
})
|
|
3224
|
+
], exports.PopoverComponent.prototype, "isOpen", 2);
|
|
3225
|
+
__decorateClass$2([
|
|
3226
|
+
dotaCore.Property({
|
|
3227
|
+
name: "placement",
|
|
3228
|
+
type: dotaCore.String
|
|
3229
|
+
})
|
|
3230
|
+
], exports.PopoverComponent.prototype, "placement", 2);
|
|
3231
|
+
__decorateClass$2([
|
|
3232
|
+
dotaCore.Property({
|
|
3233
|
+
name: "offset",
|
|
3234
|
+
type: dotaCore.String
|
|
3235
|
+
})
|
|
3236
|
+
], exports.PopoverComponent.prototype, "offset", 2);
|
|
3237
|
+
__decorateClass$2([
|
|
3238
|
+
dotaCore.Property({
|
|
3239
|
+
name: "pos-x",
|
|
3240
|
+
type: dotaCore.Number
|
|
3241
|
+
})
|
|
3242
|
+
], exports.PopoverComponent.prototype, "posX", 2);
|
|
3243
|
+
__decorateClass$2([
|
|
3244
|
+
dotaCore.Property({
|
|
3245
|
+
name: "pos-y",
|
|
3246
|
+
type: dotaCore.Number
|
|
3247
|
+
})
|
|
3248
|
+
], exports.PopoverComponent.prototype, "posY", 2);
|
|
3249
|
+
__decorateClass$2([
|
|
3250
|
+
dotaCore.AfterInit()
|
|
3251
|
+
], exports.PopoverComponent.prototype, "afterViewInit", 1);
|
|
3252
|
+
__decorateClass$2([
|
|
3253
|
+
dotaCore.BindEvent({ event: "click", id: "#button" })
|
|
3254
|
+
], exports.PopoverComponent.prototype, "handlePopover", 1);
|
|
3255
|
+
__decorateClass$2([
|
|
3256
|
+
dotaCore.WindowListener({ event: ["resize", "scroll"] })
|
|
3257
|
+
], exports.PopoverComponent.prototype, "updatePosition", 1);
|
|
3258
|
+
__decorateClass$2([
|
|
3259
|
+
dotaCore.WindowListener({ event: "click" })
|
|
3260
|
+
], exports.PopoverComponent.prototype, "handleWindowClick", 1);
|
|
3261
|
+
exports.PopoverComponent = __decorateClass$2([
|
|
3262
|
+
dotaCore.Component({
|
|
3263
|
+
selector: "dota-popover",
|
|
3264
|
+
shadow: false
|
|
3265
|
+
})
|
|
3266
|
+
], exports.PopoverComponent);
|
|
3267
|
+
var __defProp2 = Object.defineProperty;
|
|
3268
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
3269
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
3270
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
3271
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
3272
|
+
if (decorator = decorators[i])
|
|
3273
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3274
|
+
if (kind && result) __defProp2(target, key, result);
|
|
3275
|
+
return result;
|
|
3276
|
+
};
|
|
3277
|
+
exports.PlaceholderComponent = class PlaceholderComponent extends BaseElement {
|
|
3278
|
+
constructor() {
|
|
3279
|
+
super();
|
|
3280
|
+
__publicField(this, "className");
|
|
3281
|
+
}
|
|
3282
|
+
render() {
|
|
3283
|
+
return `
|
|
3284
|
+
<div class="bg-slate-400 flex justify-center items-center p-1 rounded-lg overflow-hidden ${this.className}">
|
|
3285
|
+
<div class="placeholder w-full h-full bg-slate-300 rounded-lg"></div>
|
|
3286
|
+
</div>
|
|
3287
|
+
`;
|
|
3288
|
+
}
|
|
3289
|
+
};
|
|
3290
|
+
__decorateClass$1([
|
|
3291
|
+
PropertyDecorator({ name: "classname", type: StringType })
|
|
3292
|
+
], exports.PlaceholderComponent.prototype, "className", 2);
|
|
3293
|
+
exports.PlaceholderComponent = __decorateClass$1([
|
|
3294
|
+
ComponentDecorator({
|
|
3295
|
+
selector: "dota-placeholder",
|
|
3296
|
+
shadow: false
|
|
3297
|
+
})
|
|
3298
|
+
], exports.PlaceholderComponent);
|
|
3299
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3300
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
3301
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
3302
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
3303
|
+
if (decorator = decorators[i])
|
|
3304
|
+
result = decorator(result) || result;
|
|
3305
|
+
return result;
|
|
3306
|
+
};
|
|
3307
|
+
exports.BlobsComponent = class BlobsComponent extends BaseElement {
|
|
3308
|
+
constructor() {
|
|
3309
|
+
super();
|
|
3310
|
+
__publicField(this, "content");
|
|
3311
|
+
this.content = this.innerHTML;
|
|
3312
|
+
}
|
|
3313
|
+
render() {
|
|
3314
|
+
return `
|
|
3315
|
+
<div class="bg-gray-50 min-h-screen flex items-center justify-center px-16">
|
|
3316
|
+
<div class="relative w-full max-w-lg">
|
|
3317
|
+
<div class="absolute top-0 -left-4 w-72 h-72 bg-purple-300 rounded-full mix-blend-multiply filter blur-xl opacity-70 animate-blob"></div>
|
|
3318
|
+
<div class="absolute top-0 -right-4 w-72 h-72 bg-yellow-300 rounded-full mix-blend-multiply filter blur-xl opacity-70 animate-blob animation-delay-2000"></div>
|
|
3319
|
+
<div class="absolute -bottom-8 left-20 w-72 h-72 bg-pink-300 rounded-full mix-blend-multiply filter blur-xl opacity-70 animate-blob animation-delay-4000"></div>
|
|
3320
|
+
<div class="relative">
|
|
3321
|
+
${this.content}
|
|
3322
|
+
</div>
|
|
3323
|
+
</div>
|
|
3324
|
+
</div>
|
|
3325
|
+
`;
|
|
3326
|
+
}
|
|
3327
|
+
};
|
|
3328
|
+
exports.BlobsComponent = __decorateClass([
|
|
3329
|
+
ComponentDecorator({
|
|
3330
|
+
selector: "blob-animation",
|
|
3331
|
+
shadow: false
|
|
3332
|
+
})
|
|
3333
|
+
], exports.BlobsComponent);
|
|
3334
|
+
exports.AccordionConfig = AccordionStyle;
|
|
3335
|
+
exports.BadgeConfig = BadgeStyle;
|
|
3336
|
+
exports.ButtonConfig = ButtonStyle;
|
|
3337
|
+
exports.ChipStyle = ChipStyle;
|
|
3338
|
+
exports.IconStyle = IconStyle;
|
|
3339
|
+
exports.ModalConfig = ModalStyle;
|
|
3340
|
+
exports.PositionCalculator = PositionCalculator;
|
|
3341
|
+
exports.UIConfig = UIConfig;
|
|
3342
|
+
exports.calculateElementSize = calculateElementSize;
|
|
3343
|
+
exports.calculatePosition = calculatePosition;
|
|
3344
|
+
exports.debounce = debounce;
|
|
3345
|
+
exports.elementPositionInViewport = elementPositionInViewport;
|
|
3346
|
+
exports.getBottomCenterCoords = getBottomCenterCoords;
|
|
3347
|
+
exports.getLeftCenterCoords = getLeftCenterCoords;
|
|
3348
|
+
exports.getRightCenterCoords = getRightCenterCoords;
|
|
3349
|
+
exports.getTopCenterCoords = getTopCenterCoords;
|
|
3350
|
+
exports.isElementInViewport = isElementInViewport;
|