@lukso/web-components 1.172.13 → 1.172.14
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/chunks/cn-LM_JlZIN.js +36 -0
- package/dist/chunks/cn-zamUNFMe.js +39 -0
- package/dist/chunks/directive-CY66atYi.js +22 -0
- package/dist/chunks/directive-DUHAbymA.js +15 -0
- package/dist/chunks/index-BNt_JinF.js +212 -0
- package/dist/chunks/{index-DG4rMUh3.js → index-BOEPqh0N.js} +1 -1
- package/dist/chunks/{index-F8ll4iy2.js → index-C5S-_QDF.js} +1 -1
- package/dist/chunks/{index-B_H2eYG_.js → index-CA6SrfZ-.js} +9 -8
- package/dist/chunks/{index-CZGvLdJ0.js → index-CqZm8OfY.js} +1 -2
- package/dist/chunks/index-Cy2_2lFt.js +214 -0
- package/dist/chunks/{index-Dn2DJhID.js → index-Ds-r8fCt.js} +77 -74
- package/dist/chunks/{index-C5YyB6ug.js → index-DvLZWpq9.js} +2 -3
- package/dist/chunks/{index-D_5wz2k1.js → index-UVrFZqIM.js} +79 -76
- package/dist/chunks/{index-BHAtoIlu.js → index-cakeic-M.js} +9 -8
- package/dist/chunks/{style-map-B7XFhSOK.js → style-map-AEeBQfPb.js} +2 -3
- package/dist/chunks/{style-map-BPljJihp.js → style-map-auscxO0L.js} +1 -2
- package/dist/components/index.cjs +4 -5
- package/dist/components/index.js +4 -5
- package/dist/components/lukso-alert/index.cjs +16 -15
- package/dist/components/lukso-alert/index.js +16 -15
- package/dist/components/lukso-button/index.cjs +42 -40
- package/dist/components/lukso-button/index.js +39 -37
- package/dist/components/lukso-card/index.cjs +66 -71
- package/dist/components/lukso-card/index.js +48 -53
- package/dist/components/lukso-checkbox/index.cjs +27 -26
- package/dist/components/lukso-checkbox/index.js +27 -26
- package/dist/components/lukso-collapse/index.cjs +27 -26
- package/dist/components/lukso-collapse/index.js +26 -25
- package/dist/components/lukso-color-picker/index.cjs +33 -31
- package/dist/components/lukso-color-picker/index.js +32 -30
- package/dist/components/lukso-dropdown/index.cjs +20 -19
- package/dist/components/lukso-dropdown/index.js +20 -19
- package/dist/components/lukso-dropdown-option/index.cjs +12 -11
- package/dist/components/lukso-dropdown-option/index.js +12 -11
- package/dist/components/lukso-footer/index.cjs +5 -4
- package/dist/components/lukso-footer/index.js +5 -4
- package/dist/components/lukso-form-description/index.cjs +7 -6
- package/dist/components/lukso-form-description/index.js +7 -6
- package/dist/components/lukso-form-error/index.cjs +7 -6
- package/dist/components/lukso-form-error/index.js +7 -6
- package/dist/components/lukso-form-label/index.cjs +8 -7
- package/dist/components/lukso-form-label/index.js +8 -7
- package/dist/components/lukso-icon/index.cjs +268 -267
- package/dist/components/lukso-icon/index.js +268 -267
- package/dist/components/lukso-image/index.cjs +12 -12
- package/dist/components/lukso-image/index.js +12 -12
- package/dist/components/lukso-input/index.cjs +49 -47
- package/dist/components/lukso-input/index.js +48 -46
- package/dist/components/lukso-markdown/index.cjs +13 -83
- package/dist/components/lukso-markdown/index.js +13 -83
- package/dist/components/lukso-markdown-editor/index.cjs +68 -67
- package/dist/components/lukso-markdown-editor/index.js +67 -66
- package/dist/components/lukso-modal/index.cjs +12 -11
- package/dist/components/lukso-modal/index.js +11 -10
- package/dist/components/lukso-navbar/index.cjs +30 -30
- package/dist/components/lukso-navbar/index.js +30 -30
- package/dist/components/lukso-pagination/index.cjs +16 -16
- package/dist/components/lukso-pagination/index.js +16 -16
- package/dist/components/lukso-profile/index.cjs +162 -11
- package/dist/components/lukso-profile/index.js +165 -5
- package/dist/components/lukso-progress/index.cjs +16 -13
- package/dist/components/lukso-progress/index.js +13 -10
- package/dist/components/lukso-qr-code/index.cjs +17 -34
- package/dist/components/lukso-qr-code/index.js +16 -33
- package/dist/components/lukso-radio/index.cjs +27 -25
- package/dist/components/lukso-radio/index.js +25 -23
- package/dist/components/lukso-radio-group/index.cjs +9 -9
- package/dist/components/lukso-radio-group/index.js +9 -9
- package/dist/components/lukso-sanitize/index.cjs +5 -4
- package/dist/components/lukso-sanitize/index.js +5 -4
- package/dist/components/lukso-search/index.cjs +11 -8
- package/dist/components/lukso-search/index.js +11 -8
- package/dist/components/lukso-select/index.cjs +47 -46
- package/dist/components/lukso-select/index.js +46 -45
- package/dist/components/lukso-share/index.cjs +7 -6
- package/dist/components/lukso-share/index.js +7 -6
- package/dist/components/lukso-switch/index.cjs +16 -15
- package/dist/components/lukso-switch/index.js +16 -15
- package/dist/components/lukso-tag/index.cjs +13 -12
- package/dist/components/lukso-tag/index.js +12 -11
- package/dist/components/lukso-terms/index.cjs +9 -8
- package/dist/components/lukso-terms/index.js +9 -8
- package/dist/components/lukso-textarea/index.cjs +36 -34
- package/dist/components/lukso-textarea/index.js +35 -33
- package/dist/components/lukso-tooltip/index.cjs +27 -3461
- package/dist/components/lukso-tooltip/index.js +27 -3461
- package/dist/components/lukso-username/index.cjs +11 -7
- package/dist/components/lukso-username/index.js +11 -7
- package/dist/components/lukso-wizard/index.cjs +13 -12
- package/dist/components/lukso-wizard/index.js +11 -10
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/shared/tailwind-element/index.cjs +15 -3
- package/dist/shared/tailwind-element/index.js +17 -1
- package/dist/vite.full.config.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/chunks/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/chunks/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/chunks/axe-DJKac19y.js +0 -35093
- package/dist/chunks/axe-MHuN9KU0.js +0 -35097
- package/dist/chunks/base-Bn-zDNuZ.js +0 -93
- package/dist/chunks/base-Cl6v8-BZ.js +0 -8
- package/dist/chunks/base-KJhhKWYy.js +0 -91
- package/dist/chunks/base-NFGX42U4.js +0 -10
- package/dist/chunks/chunk-LQIOVPBE-CGhQ79Di.js +0 -370
- package/dist/chunks/chunk-LQIOVPBE-kQFZF_OS.js +0 -372
- package/dist/chunks/directive-BKuZRRPO.js +0 -8
- package/dist/chunks/directive-DT5Y-Nw0.js +0 -12
- package/dist/chunks/index-5X9ujrWL.js +0 -41
- package/dist/chunks/index-B9iart53.js +0 -2545
- package/dist/chunks/index-BAf8Hzhe.js +0 -611
- package/dist/chunks/index-BBFSnMaE.js +0 -1345
- package/dist/chunks/index-BDyLu6M0.js +0 -609
- package/dist/chunks/index-BxQ_0s_1.js +0 -50
- package/dist/chunks/index-CaJky2qL.js +0 -2547
- package/dist/chunks/index-glHBylgQ.js +0 -1347
- package/dist/chunks/isAddress-B1R_6-uN.js +0 -745
- package/dist/chunks/isAddress-BUdSrCaY.js +0 -743
- package/dist/chunks/property-D6IL6zax.js +0 -11
- package/dist/chunks/property-DfumgIL6.js +0 -9
- package/dist/chunks/query-CHb9Ft_d.js +0 -9
- package/dist/chunks/query-D3HF7Pde.js +0 -11
- package/dist/chunks/state-CFjY89m3.js +0 -11
- package/dist/chunks/state-CaelFSbE.js +0 -9
- package/dist/chunks/unsafe-html-BHBLEMoa.js +0 -10
- package/dist/chunks/unsafe-html-DiwkOQlV.js +0 -12
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const base = require('./base-Bn-zDNuZ.js');
|
|
4
|
-
const property = require('./property-D6IL6zax.js');
|
|
5
|
-
const state = require('./state-CFjY89m3.js');
|
|
6
|
-
|
|
7
|
-
function defineChain(chain) {
|
|
8
|
-
return {
|
|
9
|
-
formatters: undefined,
|
|
10
|
-
fees: undefined,
|
|
11
|
-
serializers: undefined,
|
|
12
|
-
...chain,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
class InvalidDecimalNumberError extends base.BaseError {
|
|
17
|
-
constructor({ value }) {
|
|
18
|
-
super(`Number \`${value}\` is not a valid decimal number.`, {
|
|
19
|
-
name: 'InvalidDecimalNumberError',
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Multiplies a string representation of a number by a given exponent of base 10 (10exponent).
|
|
26
|
-
*
|
|
27
|
-
* - Docs: https://viem.sh/docs/utilities/parseUnits
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* import { parseUnits } from 'viem'
|
|
31
|
-
*
|
|
32
|
-
* parseUnits('420', 9)
|
|
33
|
-
* // 420000000000n
|
|
34
|
-
*/
|
|
35
|
-
function parseUnits(value, decimals) {
|
|
36
|
-
if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
|
|
37
|
-
throw new InvalidDecimalNumberError({ value });
|
|
38
|
-
let [integer, fraction = '0'] = value.split('.');
|
|
39
|
-
const negative = integer.startsWith('-');
|
|
40
|
-
if (negative)
|
|
41
|
-
integer = integer.slice(1);
|
|
42
|
-
// trim trailing zeros.
|
|
43
|
-
fraction = fraction.replace(/(0+)$/, '');
|
|
44
|
-
// round off if the fraction is larger than the number of decimals.
|
|
45
|
-
if (fraction.length > decimals) {
|
|
46
|
-
const [left, unit, right] = [
|
|
47
|
-
fraction.slice(0, decimals - 1),
|
|
48
|
-
fraction.slice(decimals - 1, decimals),
|
|
49
|
-
fraction.slice(decimals),
|
|
50
|
-
];
|
|
51
|
-
const rounded = Math.round(Number(`${unit}.${right}`));
|
|
52
|
-
if (rounded > 9)
|
|
53
|
-
fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, '0');
|
|
54
|
-
else
|
|
55
|
-
fraction = `${left}${rounded}`;
|
|
56
|
-
if (fraction.length > decimals) {
|
|
57
|
-
fraction = fraction.slice(1);
|
|
58
|
-
integer = `${BigInt(integer) + 1n}`;
|
|
59
|
-
}
|
|
60
|
-
fraction = fraction.slice(0, decimals);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
fraction = fraction.padEnd(decimals, '0');
|
|
64
|
-
}
|
|
65
|
-
return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const lukso = /*#__PURE__*/ defineChain({
|
|
69
|
-
id: 42,
|
|
70
|
-
network: 'lukso',
|
|
71
|
-
name: 'LUKSO',
|
|
72
|
-
nativeCurrency: {
|
|
73
|
-
name: 'LUKSO',
|
|
74
|
-
symbol: 'LYX',
|
|
75
|
-
decimals: 18,
|
|
76
|
-
},
|
|
77
|
-
rpcUrls: {
|
|
78
|
-
default: {
|
|
79
|
-
http: ['https://rpc.mainnet.lukso.network'],
|
|
80
|
-
webSocket: ['wss://ws-rpc.mainnet.lukso.network'],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
blockExplorers: {
|
|
84
|
-
default: {
|
|
85
|
-
name: 'LUKSO Mainnet Explorer',
|
|
86
|
-
url: 'https://explorer.execution.mainnet.lukso.network',
|
|
87
|
-
apiUrl: 'https://api.explorer.execution.mainnet.lukso.network/api',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
contracts: {
|
|
91
|
-
multicall3: {
|
|
92
|
-
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
93
|
-
blockCreated: 468183,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const luksoTestnet = /*#__PURE__*/ defineChain({
|
|
99
|
-
id: 4201,
|
|
100
|
-
name: 'LUKSO Testnet',
|
|
101
|
-
nativeCurrency: {
|
|
102
|
-
decimals: 18,
|
|
103
|
-
name: 'LUKSO Testnet',
|
|
104
|
-
symbol: 'LYXt',
|
|
105
|
-
},
|
|
106
|
-
rpcUrls: {
|
|
107
|
-
default: {
|
|
108
|
-
http: ['https://rpc.testnet.lukso.network'],
|
|
109
|
-
webSocket: ['wss://ws-rpc.testnet.lukso.network'],
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
blockExplorers: {
|
|
113
|
-
default: {
|
|
114
|
-
name: 'LUKSO Testnet Explorer',
|
|
115
|
-
url: 'https://explorer.execution.testnet.lukso.network',
|
|
116
|
-
apiUrl: 'https://api.explorer.execution.testnet.lukso.network/api',
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
contracts: {
|
|
120
|
-
multicall3: {
|
|
121
|
-
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
122
|
-
blockCreated: 605348,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
testnet: true,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
({
|
|
129
|
-
nativeCurrency: {
|
|
130
|
-
...lukso.nativeCurrency,
|
|
131
|
-
supply: parseUnits("42000000", 18).toString()
|
|
132
|
-
},
|
|
133
|
-
contracts: {
|
|
134
|
-
...lukso.contracts}});
|
|
135
|
-
({
|
|
136
|
-
nativeCurrency: {
|
|
137
|
-
...luksoTestnet.nativeCurrency,
|
|
138
|
-
supply: parseUnits("42000000", 18).toString()},
|
|
139
|
-
contracts: {
|
|
140
|
-
...luksoTestnet.contracts}});
|
|
141
|
-
|
|
142
|
-
// Generated ESM version of ua-parser-js
|
|
143
|
-
// DO NOT EDIT THIS FILE!
|
|
144
|
-
// Source: /src/main/ua-parser.js
|
|
145
|
-
|
|
146
|
-
/////////////////////////////////////////////////////////////////////////////////
|
|
147
|
-
/* UAParser.js v2.0.7
|
|
148
|
-
Copyright © 2012-2025 Faisal Salman <f@faisalman.com>
|
|
149
|
-
AGPLv3 License *//*
|
|
150
|
-
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
|
|
151
|
-
Supports browser & node.js environment.
|
|
152
|
-
Demo : https://uaparser.dev
|
|
153
|
-
Source : https://github.com/faisalman/ua-parser-js */
|
|
154
|
-
/////////////////////////////////////////////////////////////////////////////////
|
|
155
|
-
|
|
156
|
-
/* jshint esversion: 6 */
|
|
157
|
-
/* globals window */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
//////////////
|
|
162
|
-
// Constants
|
|
163
|
-
/////////////
|
|
164
|
-
|
|
165
|
-
var TYPEOF = {
|
|
166
|
-
OBJECT : 'object',
|
|
167
|
-
UNDEFINED : 'undefined'
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
// properties
|
|
171
|
-
BROWSER = 'browser',
|
|
172
|
-
CPU = 'cpu',
|
|
173
|
-
DEVICE = 'device',
|
|
174
|
-
ENGINE = 'engine',
|
|
175
|
-
OS = 'os',
|
|
176
|
-
NAME = 'name',
|
|
177
|
-
TYPE = 'type',
|
|
178
|
-
VENDOR = 'vendor',
|
|
179
|
-
VERSION = 'version',
|
|
180
|
-
ARCHITECTURE= 'architecture',
|
|
181
|
-
MAJOR = 'major',
|
|
182
|
-
MODEL = 'model',
|
|
183
|
-
|
|
184
|
-
// device types
|
|
185
|
-
CONSOLE = 'console',
|
|
186
|
-
MOBILE = 'mobile',
|
|
187
|
-
TABLET = 'tablet',
|
|
188
|
-
SMARTTV = 'smarttv',
|
|
189
|
-
WEARABLE = 'wearable',
|
|
190
|
-
EMBEDDED = 'embedded';
|
|
191
|
-
|
|
192
|
-
var isWindow = typeof window !== TYPEOF.UNDEFINED,
|
|
193
|
-
NAVIGATOR = (isWindow && window.navigator) ?
|
|
194
|
-
window.navigator :
|
|
195
|
-
undefined;
|
|
196
|
-
(NAVIGATOR && NAVIGATOR.userAgentData) ?
|
|
197
|
-
NAVIGATOR.userAgentData :
|
|
198
|
-
undefined;
|
|
199
|
-
|
|
200
|
-
///////////
|
|
201
|
-
// Helper
|
|
202
|
-
//////////
|
|
203
|
-
|
|
204
|
-
var enumerize = function (arr) {
|
|
205
|
-
var enums = {};
|
|
206
|
-
for (var i=0; i<arr.length; i++) {
|
|
207
|
-
enums[arr[i].toUpperCase()] = arr[i];
|
|
208
|
-
}
|
|
209
|
-
return enums;
|
|
210
|
-
},
|
|
211
|
-
setProps = function (arr) {
|
|
212
|
-
for (var i in arr) {
|
|
213
|
-
if (!arr.hasOwnProperty(i)) continue;
|
|
214
|
-
|
|
215
|
-
var propName = arr[i];
|
|
216
|
-
if (typeof propName == TYPEOF.OBJECT && propName.length == 2) {
|
|
217
|
-
this[propName[0]] = propName[1];
|
|
218
|
-
} else {
|
|
219
|
-
this[propName] = undefined;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return this;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
/////////////////
|
|
226
|
-
// Factories
|
|
227
|
-
////////////////
|
|
228
|
-
|
|
229
|
-
((function () {
|
|
230
|
-
var props = { init : {}, isIgnore : {}, isIgnoreRgx : {}, toString : {}};
|
|
231
|
-
setProps.call(props.init, [
|
|
232
|
-
[BROWSER, [NAME, VERSION, MAJOR, TYPE]],
|
|
233
|
-
[CPU, [ARCHITECTURE]],
|
|
234
|
-
[DEVICE, [TYPE, MODEL, VENDOR]],
|
|
235
|
-
[ENGINE, [NAME, VERSION]],
|
|
236
|
-
[OS, [NAME, VERSION]]
|
|
237
|
-
]);
|
|
238
|
-
setProps.call(props.isIgnore, [
|
|
239
|
-
[BROWSER, [VERSION, MAJOR]],
|
|
240
|
-
[ENGINE, [VERSION]],
|
|
241
|
-
[OS, [VERSION]]
|
|
242
|
-
]);
|
|
243
|
-
setProps.call(props.isIgnoreRgx, [
|
|
244
|
-
[BROWSER, / ?browser$/i],
|
|
245
|
-
[OS, / ?os$/i]
|
|
246
|
-
]);
|
|
247
|
-
setProps.call(props.toString, [
|
|
248
|
-
[BROWSER, [NAME, VERSION]],
|
|
249
|
-
[CPU, [ARCHITECTURE]],
|
|
250
|
-
[DEVICE, [VENDOR, MODEL]],
|
|
251
|
-
[ENGINE, [NAME, VERSION]],
|
|
252
|
-
[OS, [NAME, VERSION]]
|
|
253
|
-
]);
|
|
254
|
-
return props;
|
|
255
|
-
}))();
|
|
256
|
-
enumerize([NAME, VERSION, MAJOR, TYPE]);
|
|
257
|
-
enumerize([ARCHITECTURE]);
|
|
258
|
-
enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
|
|
259
|
-
enumerize([NAME, VERSION]);
|
|
260
|
-
|
|
261
|
-
var __defProp = Object.defineProperty;
|
|
262
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
263
|
-
var result = void 0 ;
|
|
264
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
265
|
-
if (decorator = decorators[i])
|
|
266
|
-
result = (decorator(target, key, result) ) || result;
|
|
267
|
-
if (result) __defProp(target, key, result);
|
|
268
|
-
return result;
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
function withTheme(Base) {
|
|
272
|
-
class Mixin extends Base {
|
|
273
|
-
constructor() {
|
|
274
|
-
super(...arguments);
|
|
275
|
-
this.theme = "light";
|
|
276
|
-
this.isDark = false;
|
|
277
|
-
this.mediaQueryList = null;
|
|
278
|
-
/**
|
|
279
|
-
* Handle system theme changes
|
|
280
|
-
*
|
|
281
|
-
* @param event - Media query list event
|
|
282
|
-
*/
|
|
283
|
-
this.handleMediaQueryChange = (event) => {
|
|
284
|
-
this.isDark = event.matches;
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
connectedCallback() {
|
|
288
|
-
super.connectedCallback();
|
|
289
|
-
this.updateTheme();
|
|
290
|
-
this.updateHostClass();
|
|
291
|
-
if (this.theme === "auto") {
|
|
292
|
-
this.mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
|
|
293
|
-
this.mediaQueryList.addEventListener(
|
|
294
|
-
"change",
|
|
295
|
-
this.handleMediaQueryChange
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
disconnectedCallback() {
|
|
300
|
-
super.disconnectedCallback();
|
|
301
|
-
if (this.mediaQueryList) {
|
|
302
|
-
this.mediaQueryList.removeEventListener(
|
|
303
|
-
"change",
|
|
304
|
-
this.handleMediaQueryChange
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
updated(changedProperties) {
|
|
309
|
-
super.updated(changedProperties);
|
|
310
|
-
if (changedProperties.has("theme")) {
|
|
311
|
-
this.updateTheme();
|
|
312
|
-
if (this.theme === "auto" && !this.mediaQueryList) {
|
|
313
|
-
this.mediaQueryList = window.matchMedia(
|
|
314
|
-
"(prefers-color-scheme: dark)"
|
|
315
|
-
);
|
|
316
|
-
this.mediaQueryList.addEventListener(
|
|
317
|
-
"change",
|
|
318
|
-
this.handleMediaQueryChange
|
|
319
|
-
);
|
|
320
|
-
} else if (this.theme !== "auto" && this.mediaQueryList) {
|
|
321
|
-
this.mediaQueryList.removeEventListener(
|
|
322
|
-
"change",
|
|
323
|
-
this.handleMediaQueryChange
|
|
324
|
-
);
|
|
325
|
-
this.mediaQueryList = null;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
if (changedProperties.has("isDark")) {
|
|
329
|
-
this.updateHostClass();
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Update isDark state based on theme property
|
|
334
|
-
*/
|
|
335
|
-
updateTheme() {
|
|
336
|
-
if (this.theme === "auto") {
|
|
337
|
-
this.isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
338
|
-
} else {
|
|
339
|
-
this.isDark = this.theme === "dark";
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Create the render root with a themed wrapper div
|
|
344
|
-
*/
|
|
345
|
-
createRenderRoot() {
|
|
346
|
-
const root = super.createRenderRoot();
|
|
347
|
-
this.themeRoot = document.createElement("div");
|
|
348
|
-
this.themeRoot.setAttribute("data-theme-root", "");
|
|
349
|
-
root.appendChild(this.themeRoot);
|
|
350
|
-
return this.themeRoot;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Update the host element's class based on isDark state
|
|
354
|
-
*/
|
|
355
|
-
updateHostClass() {
|
|
356
|
-
if (this.isDark) {
|
|
357
|
-
this.themeRoot.classList.add("dark");
|
|
358
|
-
} else {
|
|
359
|
-
this.themeRoot.classList.remove("dark");
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
__decorateClass([
|
|
364
|
-
property.n({ type: String, reflect: true })
|
|
365
|
-
], Mixin.prototype, "theme");
|
|
366
|
-
__decorateClass([
|
|
367
|
-
state.r()
|
|
368
|
-
], Mixin.prototype, "isDark");
|
|
369
|
-
return Mixin;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
exports.withTheme = withTheme;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t={ATTRIBUTE:1,CHILD:2},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
7
|
-
|
|
8
|
-
export { e, i, t };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2017 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
const t={ATTRIBUTE:1,CHILD:2},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
9
|
-
|
|
10
|
-
exports.e = e;
|
|
11
|
-
exports.i = i;
|
|
12
|
-
exports.t = t;
|