@supersoniks/concorde 1.1.44 → 1.1.46
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/README.md +9 -7
- package/concorde-core.bundle.js +39 -24
- package/concorde-core.es.js +907 -320
- package/core/components/functional/fetch/fetch.d.ts +2 -1
- package/core/components/functional/list/list.d.ts +3 -1
- package/core/components/functional/list/list.js +12 -7
- package/core/components/functional/queue/queue.d.ts +9 -2
- package/core/components/functional/queue/queue.js +131 -67
- package/core/components/functional/router/router.js +13 -4
- package/core/components/functional/sdui/sdui.d.ts +3 -2
- package/core/components/functional/sdui/sdui.js +1 -1
- package/core/components/functional/states/states.js +1 -0
- package/core/components/functional/value/value.js +3 -2
- package/core/components/ui/alert/alert.d.ts +3 -0
- package/core/components/ui/alert/alert.js +33 -1
- package/core/components/ui/badge/badge.d.ts +1 -1
- package/core/components/ui/badge/badge.js +9 -3
- package/core/components/ui/button/button.d.ts +1 -0
- package/core/components/ui/button/button.js +32 -28
- package/core/components/ui/form/checkbox/checkbox.d.ts +3 -0
- package/core/components/ui/form/checkbox/checkbox.js +14 -3
- package/core/components/ui/form/css/form-control.d.ts +1 -0
- package/core/components/ui/form/css/form-control.js +17 -0
- package/core/components/ui/form/input/input.d.ts +5 -3
- package/core/components/ui/form/input/input.js +47 -3
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +93 -13
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +181 -52
- package/core/components/ui/form/select/select.js +16 -4
- package/core/components/ui/form/textarea/textarea.d.ts +1 -0
- package/core/components/ui/group/group.js +7 -1
- package/core/components/ui/icon/icon.js +1 -1
- package/core/components/ui/modal/modal-close.js +2 -3
- package/core/components/ui/modal/modal-content.js +1 -0
- package/core/components/ui/modal/modal.d.ts +8 -0
- package/core/components/ui/modal/modal.js +34 -6
- package/core/components/ui/pop/pop.d.ts +5 -4
- package/core/components/ui/pop/pop.js +85 -44
- package/core/components/ui/theme/theme-collection/core-variables.js +18 -9
- package/core/components/ui/theme/theme.js +8 -3
- package/core/components/ui/tooltip/tooltip.js +3 -3
- package/core/mixins/Fetcher.d.ts +2 -1
- package/core/mixins/Fetcher.js +42 -10
- package/core/mixins/FormCheckable.d.ts +1 -0
- package/core/mixins/FormElement.d.ts +1 -0
- package/core/mixins/FormElement.js +6 -2
- package/core/mixins/FormInput.d.ts +1 -0
- package/core/mixins/Subscriber.d.ts +1 -0
- package/core/mixins/Subscriber.js +17 -12
- package/core/utils/PublisherProxy.d.ts +30 -3
- package/core/utils/PublisherProxy.js +218 -6
- package/core/utils/api.d.ts +29 -3
- package/core/utils/api.js +117 -24
- package/mixins.d.ts +4 -1
- package/package.json +7 -2
package/concorde-core.es.js
CHANGED
|
@@ -134,27 +134,53 @@ class Objects$1 {
|
|
|
134
134
|
const _API = class {
|
|
135
135
|
constructor(config) {
|
|
136
136
|
this.addHTTPResponse = false;
|
|
137
|
+
this.cache = "default";
|
|
137
138
|
this.serviceURL = config.serviceURL;
|
|
138
139
|
if (!this.serviceURL)
|
|
139
140
|
this.serviceURL = document.location.origin;
|
|
140
141
|
this.userName = config.userName;
|
|
141
142
|
this.password = config.password;
|
|
142
|
-
|
|
143
|
+
if (config.token)
|
|
144
|
+
this.token = config.token;
|
|
143
145
|
this.tokenProvider = config.tokenProvider;
|
|
146
|
+
this.authToken = config.authToken;
|
|
144
147
|
this.addHTTPResponse = config.addHTTPResponse || false;
|
|
145
148
|
this.credentials = config.credentials;
|
|
149
|
+
this.cache = config.cache || "default";
|
|
146
150
|
}
|
|
147
|
-
|
|
151
|
+
set token(token) {
|
|
152
|
+
this._token = token;
|
|
153
|
+
if (!token) {
|
|
154
|
+
_API.tokens.delete(this.serviceURL);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (_API.invalidTokens.includes(token))
|
|
158
|
+
return;
|
|
159
|
+
_API.tokens.set(this.serviceURL, token);
|
|
160
|
+
}
|
|
161
|
+
get token() {
|
|
162
|
+
return _API.invalidTokens.includes(this._token) ? _API.tokens.get(this.serviceURL) : this._token;
|
|
163
|
+
}
|
|
164
|
+
handleInvalidToken(token) {
|
|
165
|
+
if (!token)
|
|
166
|
+
return;
|
|
167
|
+
if (_API.invalidTokens.includes(token))
|
|
168
|
+
return;
|
|
169
|
+
_API.invalidTokens.push(token);
|
|
170
|
+
this.token = null;
|
|
171
|
+
}
|
|
172
|
+
async handleResult(fetchResult, lastCall) {
|
|
148
173
|
var _a2;
|
|
149
174
|
this.lastResult = fetchResult;
|
|
150
|
-
const contentType = (_a2 = fetchResult
|
|
175
|
+
const contentType = (_a2 = fetchResult.headers.get("content-type")) == null ? void 0 : _a2.toLowerCase();
|
|
176
|
+
const httpCode = fetchResult.status;
|
|
151
177
|
let result = {};
|
|
152
|
-
if (contentType
|
|
153
|
-
const str = await
|
|
178
|
+
if (!contentType || contentType.indexOf("text/") == 0) {
|
|
179
|
+
const str = await fetchResult.text();
|
|
154
180
|
result = { text: str };
|
|
155
181
|
} else {
|
|
156
182
|
try {
|
|
157
|
-
result = await
|
|
183
|
+
result = await fetchResult.json();
|
|
158
184
|
} catch (e2) {
|
|
159
185
|
result = {};
|
|
160
186
|
}
|
|
@@ -162,6 +188,19 @@ const _API = class {
|
|
|
162
188
|
if (this.addHTTPResponse && Objects$1.isObject(result)) {
|
|
163
189
|
result._sonic_http_response_ = fetchResult;
|
|
164
190
|
}
|
|
191
|
+
if (httpCode === 498 && !_API.failledTokenUpdates.has(this.serviceURL)) {
|
|
192
|
+
this.handleInvalidToken(this.token);
|
|
193
|
+
if (lastCall.apiMethod === "get") {
|
|
194
|
+
result = await this[lastCall.apiMethod](lastCall.path, lastCall.additionalHeaders);
|
|
195
|
+
} else {
|
|
196
|
+
result = await this[lastCall.apiMethod](
|
|
197
|
+
lastCall.path,
|
|
198
|
+
lastCall.data,
|
|
199
|
+
lastCall.method,
|
|
200
|
+
lastCall.additionalHeaders
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
165
204
|
return result;
|
|
166
205
|
}
|
|
167
206
|
async auth() {
|
|
@@ -171,36 +210,58 @@ const _API = class {
|
|
|
171
210
|
this.token = _API.tokens.get(this.serviceURL);
|
|
172
211
|
return;
|
|
173
212
|
}
|
|
174
|
-
if (!this.
|
|
213
|
+
if (!this.tokenProvider)
|
|
175
214
|
return;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
215
|
+
let headers = {};
|
|
216
|
+
if (this.userName && this.password) {
|
|
217
|
+
headers = {
|
|
218
|
+
Authorization: "Basic " + window.btoa(unescape(encodeURIComponent(this.userName + ":" + this.password)))
|
|
219
|
+
};
|
|
220
|
+
} else if (this.authToken) {
|
|
221
|
+
headers = {
|
|
222
|
+
Authorization: "Bearer " + this.authToken
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const serviceURL = new URL(this.serviceURL);
|
|
226
|
+
const serviceHost = serviceURL.protocol + "//" + serviceURL.host;
|
|
227
|
+
const result = await fetch(this.computeURL(this.tokenProvider, { serviceHost }), {
|
|
180
228
|
headers,
|
|
181
229
|
credentials: this.credentials
|
|
182
230
|
});
|
|
183
231
|
try {
|
|
184
232
|
const json = await result.json();
|
|
185
|
-
|
|
186
|
-
|
|
233
|
+
const newToken = json.token;
|
|
234
|
+
if (newToken) {
|
|
235
|
+
this.token = json.token;
|
|
236
|
+
} else {
|
|
237
|
+
_API.failledTokenUpdates.set(this.serviceURL, true);
|
|
238
|
+
}
|
|
187
239
|
} catch (e2) {
|
|
188
|
-
|
|
240
|
+
_API.failledTokenUpdates.set(this.serviceURL, true);
|
|
189
241
|
}
|
|
190
242
|
}
|
|
191
243
|
async get(path, additionalHeaders) {
|
|
244
|
+
const lastCall = {
|
|
245
|
+
apiMethod: "get",
|
|
246
|
+
path,
|
|
247
|
+
additionalHeaders
|
|
248
|
+
};
|
|
192
249
|
const headers = await this.createHeaders(additionalHeaders);
|
|
193
250
|
const url = this.computeURL(path);
|
|
194
|
-
|
|
251
|
+
const mapKey = JSON.stringify({
|
|
252
|
+
url,
|
|
253
|
+
headers
|
|
254
|
+
});
|
|
255
|
+
if (!_API.loadingGetPromises.has(mapKey)) {
|
|
195
256
|
const promise = new Promise(async (resolve) => {
|
|
196
|
-
const result2 = await fetch(url, { headers, credentials: this.credentials });
|
|
197
|
-
const handledResult = await this.handleResult(result2);
|
|
257
|
+
const result2 = await fetch(url, { headers, credentials: this.credentials, cache: this.cache });
|
|
258
|
+
const handledResult = await this.handleResult(result2, lastCall);
|
|
198
259
|
resolve(handledResult);
|
|
199
260
|
});
|
|
200
|
-
_API.loadingGetPromises.set(
|
|
261
|
+
_API.loadingGetPromises.set(mapKey, promise);
|
|
201
262
|
}
|
|
202
|
-
const result = await _API.loadingGetPromises.get(
|
|
203
|
-
_API.loadingGetPromises.delete(
|
|
263
|
+
const result = await _API.loadingGetPromises.get(mapKey);
|
|
264
|
+
_API.loadingGetPromises.delete(mapKey);
|
|
204
265
|
return result;
|
|
205
266
|
}
|
|
206
267
|
async createHeaders(additionalHeaders) {
|
|
@@ -214,10 +275,28 @@ const _API = class {
|
|
|
214
275
|
}
|
|
215
276
|
return headers;
|
|
216
277
|
}
|
|
217
|
-
computeURL(path) {
|
|
218
|
-
|
|
278
|
+
computeURL(path, query = {}) {
|
|
279
|
+
let url = "";
|
|
280
|
+
if (path.startsWith("http"))
|
|
281
|
+
url = path;
|
|
282
|
+
else
|
|
283
|
+
url = this.serviceURL + "/" + path;
|
|
284
|
+
if (!url.startsWith("http"))
|
|
285
|
+
url = window.location.origin + url;
|
|
286
|
+
const computedUrl = new URL(url);
|
|
287
|
+
for (const key in query) {
|
|
288
|
+
computedUrl.searchParams.set(key, query[key]);
|
|
289
|
+
}
|
|
290
|
+
return computedUrl.toString().replace(/([^(https?:)])\/{2,}/g, "$1/");
|
|
219
291
|
}
|
|
220
292
|
async send(path, data, method = "POST", additionalHeaders) {
|
|
293
|
+
const lastCall = {
|
|
294
|
+
apiMethod: "send",
|
|
295
|
+
path,
|
|
296
|
+
additionalHeaders,
|
|
297
|
+
method,
|
|
298
|
+
data
|
|
299
|
+
};
|
|
221
300
|
const headers = await this.createHeaders(additionalHeaders);
|
|
222
301
|
headers["Accept"] = "application/json";
|
|
223
302
|
headers["Content-Type"] = "application/json";
|
|
@@ -227,9 +306,16 @@ const _API = class {
|
|
|
227
306
|
method,
|
|
228
307
|
body: JSON.stringify(data)
|
|
229
308
|
});
|
|
230
|
-
return await this.handleResult(result);
|
|
309
|
+
return await this.handleResult(result, lastCall);
|
|
231
310
|
}
|
|
232
311
|
async submitFormData(path, data, method = "POST", additionalHeaders) {
|
|
312
|
+
const lastCall = {
|
|
313
|
+
apiMethod: "submitFormData",
|
|
314
|
+
path,
|
|
315
|
+
additionalHeaders,
|
|
316
|
+
method,
|
|
317
|
+
data
|
|
318
|
+
};
|
|
233
319
|
const headers = await this.createHeaders(additionalHeaders);
|
|
234
320
|
headers["Accept"] = "application/json";
|
|
235
321
|
const formData = new FormData();
|
|
@@ -242,7 +328,7 @@ const _API = class {
|
|
|
242
328
|
method,
|
|
243
329
|
body: formData
|
|
244
330
|
});
|
|
245
|
-
return await this.handleResult(result);
|
|
331
|
+
return await this.handleResult(result, lastCall);
|
|
246
332
|
}
|
|
247
333
|
async put(path, data, additionalHeaders) {
|
|
248
334
|
return this.send(path, data, "PUT", additionalHeaders);
|
|
@@ -257,6 +343,8 @@ const _API = class {
|
|
|
257
343
|
let API = _API;
|
|
258
344
|
API.loadingGetPromises = /* @__PURE__ */ new Map();
|
|
259
345
|
API.tokens = /* @__PURE__ */ new Map();
|
|
346
|
+
API.invalidTokens = [];
|
|
347
|
+
API.failledTokenUpdates = /* @__PURE__ */ new Map();
|
|
260
348
|
class Format$1 {
|
|
261
349
|
static ucFirst(str) {
|
|
262
350
|
if (typeof str != "string")
|
|
@@ -274,19 +362,22 @@ class Format$1 {
|
|
|
274
362
|
function isComplex(value) {
|
|
275
363
|
return typeof value === "object" && value != null;
|
|
276
364
|
}
|
|
277
|
-
class
|
|
365
|
+
const _PublisherProxy = class {
|
|
278
366
|
constructor(target, parentProxPub) {
|
|
279
367
|
this._proxies_ = /* @__PURE__ */ new Map();
|
|
280
368
|
this._key_ = "";
|
|
369
|
+
this._is_savable_ = false;
|
|
281
370
|
this._invalidateListeners_ = /* @__PURE__ */ new Set();
|
|
282
371
|
this._assignListeners_ = /* @__PURE__ */ new Set();
|
|
283
372
|
this._mutationListeners_ = /* @__PURE__ */ new Set();
|
|
284
373
|
this._fillListeners_ = /* @__PURE__ */ new Set();
|
|
285
374
|
this._templateFillListeners_ = /* @__PURE__ */ new Set();
|
|
286
375
|
this._lockInternalMutationPublishing_ = false;
|
|
376
|
+
this._instanceCounter_ = 0;
|
|
287
377
|
this._value_ = target;
|
|
288
378
|
this.parent = parentProxPub || null;
|
|
289
379
|
this.root = this;
|
|
380
|
+
this._instanceCounter_ = 0;
|
|
290
381
|
while (this.root.parent) {
|
|
291
382
|
this.root = this.root.parent;
|
|
292
383
|
}
|
|
@@ -301,6 +392,7 @@ class PublisherProxy$1 {
|
|
|
301
392
|
this._fillListeners_.clear();
|
|
302
393
|
this._templateFillListeners_.clear();
|
|
303
394
|
this._proxies_.clear();
|
|
395
|
+
_PublisherProxy.instances.delete(this._instanceCounter_);
|
|
304
396
|
}
|
|
305
397
|
hasListener() {
|
|
306
398
|
return this._templateFillListeners_.size > 0 || this._assignListeners_.size > 0 || this._invalidateListeners_.size > 0 || this._mutationListeners_.size > 0 || this._fillListeners_.size > 0;
|
|
@@ -309,6 +401,12 @@ class PublisherProxy$1 {
|
|
|
309
401
|
this._mutationListeners_.forEach((handler) => handler());
|
|
310
402
|
if (lockInternalMutationsTransmission)
|
|
311
403
|
return;
|
|
404
|
+
if (!PublisherManager$1.changed && this._is_savable_) {
|
|
405
|
+
PublisherManager$1.changed = true;
|
|
406
|
+
PublisherManager$1.saveId++;
|
|
407
|
+
const saveId = PublisherManager$1.saveId;
|
|
408
|
+
setTimeout(() => PublisherManager$1.getInstance().saveToLocalStorage(saveId), 1e3);
|
|
409
|
+
}
|
|
312
410
|
if (this.parent) {
|
|
313
411
|
this.parent._publishInternalMutation_();
|
|
314
412
|
}
|
|
@@ -457,28 +555,97 @@ class PublisherProxy$1 {
|
|
|
457
555
|
}
|
|
458
556
|
return this._value_;
|
|
459
557
|
}
|
|
460
|
-
|
|
558
|
+
get $tag() {
|
|
559
|
+
if (!this._instanceCounter_) {
|
|
560
|
+
_PublisherProxy.instancesCounter++;
|
|
561
|
+
this._instanceCounter_ = _PublisherProxy.instancesCounter;
|
|
562
|
+
}
|
|
563
|
+
_PublisherProxy.instances.set(this._instanceCounter_, this);
|
|
564
|
+
const str = '<reactive-publisher-proxy publisher="' + this._instanceCounter_ + '"></reactive-publisher-proxy>';
|
|
565
|
+
return str;
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
let PublisherProxy$1 = _PublisherProxy;
|
|
569
|
+
PublisherProxy$1.instances = /* @__PURE__ */ new Map();
|
|
570
|
+
PublisherProxy$1.instancesCounter = 0;
|
|
461
571
|
const _PublisherManager = class {
|
|
462
572
|
constructor() {
|
|
573
|
+
this.enabledLocaStorageProxies = [];
|
|
463
574
|
this.publishers = /* @__PURE__ */ new Map();
|
|
575
|
+
this.localStorageData = {};
|
|
576
|
+
this.isLocalStrorageReady = null;
|
|
577
|
+
this.initialisedData = [];
|
|
464
578
|
if (_PublisherManager.instance != null)
|
|
465
579
|
throw "Singleton / use getInstance";
|
|
466
580
|
_PublisherManager.instance = this;
|
|
581
|
+
this.isLocalStrorageReady = this.cleanStorageData();
|
|
582
|
+
}
|
|
583
|
+
async cleanStorageData() {
|
|
584
|
+
return new Promise((resolve) => {
|
|
585
|
+
const doiIt = async () => {
|
|
586
|
+
try {
|
|
587
|
+
let compressedData = localStorage.getItem("publisher-proxies-data");
|
|
588
|
+
let localStorageJSON = null;
|
|
589
|
+
if (compressedData)
|
|
590
|
+
localStorageJSON = await this.decompress(compressedData, "gzip");
|
|
591
|
+
if (localStorageJSON) {
|
|
592
|
+
try {
|
|
593
|
+
this.localStorageData = JSON.parse(localStorageJSON);
|
|
594
|
+
} catch (e2) {
|
|
595
|
+
this.localStorageData = {};
|
|
596
|
+
}
|
|
597
|
+
} else {
|
|
598
|
+
compressedData = await this.compress("{}", "gzip");
|
|
599
|
+
localStorage.setItem("publisher-proxies-data", compressedData);
|
|
600
|
+
this.localStorageData = {};
|
|
601
|
+
}
|
|
602
|
+
const expires = new Date().getTime() - 1e3 * 60 * 60 * 12;
|
|
603
|
+
for (const key in this.localStorageData) {
|
|
604
|
+
const item = this.localStorageData[key];
|
|
605
|
+
if (item.lastModifiationMS < expires) {
|
|
606
|
+
delete this.localStorageData[key];
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
resolve(true);
|
|
610
|
+
} catch (e2) {
|
|
611
|
+
window.requestAnimationFrame(() => {
|
|
612
|
+
resolve(false);
|
|
613
|
+
});
|
|
614
|
+
console.log("no publisher cache in this browser");
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
doiIt();
|
|
618
|
+
});
|
|
467
619
|
}
|
|
468
620
|
static getInstance() {
|
|
469
621
|
if (_PublisherManager.instance == null)
|
|
470
622
|
return new _PublisherManager();
|
|
471
623
|
return _PublisherManager.instance;
|
|
472
624
|
}
|
|
473
|
-
static get(id) {
|
|
474
|
-
return _PublisherManager.getInstance().get(id);
|
|
625
|
+
static get(id, options) {
|
|
626
|
+
return _PublisherManager.getInstance().get(id, options);
|
|
475
627
|
}
|
|
476
628
|
static delete(id) {
|
|
477
629
|
return _PublisherManager.getInstance().delete(id);
|
|
478
630
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
631
|
+
async setLocalData(publisher, id) {
|
|
632
|
+
var _a2;
|
|
633
|
+
await this.isLocalStrorageReady;
|
|
634
|
+
publisher.set(((_a2 = this.localStorageData[id + "\xA4page:>" + document.location.pathname]) == null ? void 0 : _a2.data) || publisher.get());
|
|
635
|
+
}
|
|
636
|
+
get(id, options) {
|
|
637
|
+
const hasLocalStorage = (options == null ? void 0 : options.localStorageMode) === "enabled";
|
|
638
|
+
if (!this.publishers.has(id)) {
|
|
639
|
+
const data = {};
|
|
640
|
+
const publisher2 = new Publisher(data);
|
|
641
|
+
this.set(id, publisher2);
|
|
642
|
+
}
|
|
643
|
+
const publisher = this.publishers.get(id);
|
|
644
|
+
if (hasLocalStorage && this.initialisedData.indexOf(id) === -1) {
|
|
645
|
+
publisher._is_savable_ = true;
|
|
646
|
+
this.initialisedData.push(id);
|
|
647
|
+
this.setLocalData(publisher, id);
|
|
648
|
+
}
|
|
482
649
|
return this.publishers.get(id);
|
|
483
650
|
}
|
|
484
651
|
set(id, publisher) {
|
|
@@ -490,8 +657,75 @@ const _PublisherManager = class {
|
|
|
490
657
|
this.publishers.delete(id);
|
|
491
658
|
return true;
|
|
492
659
|
}
|
|
660
|
+
async saveToLocalStorage(saveId = 0) {
|
|
661
|
+
if (saveId !== _PublisherManager.saveId && saveId % 10 != 0)
|
|
662
|
+
return;
|
|
663
|
+
try {
|
|
664
|
+
if (!_PublisherManager.changed || _PublisherManager.saving)
|
|
665
|
+
return;
|
|
666
|
+
_PublisherManager.saving = true;
|
|
667
|
+
_PublisherManager.changed = false;
|
|
668
|
+
const keys = Array.from(this.publishers.keys());
|
|
669
|
+
let hasChanged = false;
|
|
670
|
+
for (const key of keys) {
|
|
671
|
+
const publisher = this.publishers.get(key);
|
|
672
|
+
if (!(publisher == null ? void 0 : publisher._is_savable_))
|
|
673
|
+
continue;
|
|
674
|
+
const data = publisher == null ? void 0 : publisher.get();
|
|
675
|
+
if (!data)
|
|
676
|
+
continue;
|
|
677
|
+
this.localStorageData[key + "\xA4page:>" + document.location.pathname] = {
|
|
678
|
+
lastModifiationMS: new Date().getTime(),
|
|
679
|
+
data
|
|
680
|
+
};
|
|
681
|
+
hasChanged = true;
|
|
682
|
+
}
|
|
683
|
+
if (hasChanged) {
|
|
684
|
+
const compressedData = await this.compress(JSON.stringify(this.localStorageData), "gzip");
|
|
685
|
+
localStorage.setItem("publisher-proxies-data", compressedData);
|
|
686
|
+
}
|
|
687
|
+
_PublisherManager.saving = false;
|
|
688
|
+
if (_PublisherManager.changed) {
|
|
689
|
+
_PublisherManager.saveId++;
|
|
690
|
+
const saveId2 = _PublisherManager.saveId;
|
|
691
|
+
setTimeout(() => this.saveToLocalStorage(saveId2), 1e3);
|
|
692
|
+
}
|
|
693
|
+
} catch (e2) {
|
|
694
|
+
_PublisherManager.saving = false;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
async compress(string, encoding) {
|
|
698
|
+
const byteArray = new TextEncoder().encode(string);
|
|
699
|
+
const win = window;
|
|
700
|
+
const cs = new win.CompressionStream(encoding);
|
|
701
|
+
const writer = cs.writable.getWriter();
|
|
702
|
+
writer.write(byteArray);
|
|
703
|
+
writer.close();
|
|
704
|
+
const result = await new Response(cs.readable).arrayBuffer();
|
|
705
|
+
const arrayBufferView = new Uint8Array(result);
|
|
706
|
+
let str = "";
|
|
707
|
+
for (let i2 = 0; i2 < arrayBufferView.length; i2++) {
|
|
708
|
+
str += String.fromCharCode(arrayBufferView[i2]);
|
|
709
|
+
}
|
|
710
|
+
return btoa(str);
|
|
711
|
+
}
|
|
712
|
+
async decompress(str, encoding) {
|
|
713
|
+
const decodedString = atob(str);
|
|
714
|
+
const arrayBufferViewFromLocalStorage = Uint8Array.from(decodedString, (c2) => c2.charCodeAt(0));
|
|
715
|
+
const byteArray = arrayBufferViewFromLocalStorage.buffer;
|
|
716
|
+
const win = window;
|
|
717
|
+
const cs = new win.DecompressionStream(encoding);
|
|
718
|
+
const writer = cs.writable.getWriter();
|
|
719
|
+
writer.write(byteArray);
|
|
720
|
+
writer.close();
|
|
721
|
+
const result = await new Response(cs.readable).arrayBuffer();
|
|
722
|
+
return new TextDecoder().decode(result);
|
|
723
|
+
}
|
|
493
724
|
};
|
|
494
725
|
let PublisherManager$1 = _PublisherManager;
|
|
726
|
+
PublisherManager$1.changed = false;
|
|
727
|
+
PublisherManager$1.saving = false;
|
|
728
|
+
PublisherManager$1.saveId = 0;
|
|
495
729
|
PublisherManager$1.instance = null;
|
|
496
730
|
class Publisher extends PublisherProxy$1 {
|
|
497
731
|
constructor(target, parentProxPub = null) {
|
|
@@ -512,6 +746,7 @@ class Publisher extends PublisherProxy$1 {
|
|
|
512
746
|
"offInternalMutation",
|
|
513
747
|
"set",
|
|
514
748
|
"get",
|
|
749
|
+
"$tag",
|
|
515
750
|
"_templateFillListeners_",
|
|
516
751
|
"_fillListeners_",
|
|
517
752
|
"_assignListeners_",
|
|
@@ -527,7 +762,9 @@ class Publisher extends PublisherProxy$1 {
|
|
|
527
762
|
"_proxies_",
|
|
528
763
|
"parent",
|
|
529
764
|
"_value_",
|
|
530
|
-
"
|
|
765
|
+
"_is_savable_",
|
|
766
|
+
"_lockInternalMutationPublishing_",
|
|
767
|
+
"_instanceCounter_"
|
|
531
768
|
].includes(sKey))
|
|
532
769
|
return publisherInstance[sKey];
|
|
533
770
|
if (!publisherInstance._proxies_.has(sKey)) {
|
|
@@ -544,6 +781,14 @@ class Publisher extends PublisherProxy$1 {
|
|
|
544
781
|
publisherInstance._value_ = vValue;
|
|
545
782
|
return true;
|
|
546
783
|
}
|
|
784
|
+
if (sKey == "_is_savable_") {
|
|
785
|
+
publisherInstance._is_savable_ = vValue;
|
|
786
|
+
return true;
|
|
787
|
+
}
|
|
788
|
+
if (sKey == "_instanceCounter_") {
|
|
789
|
+
publisherInstance._instanceCounter_ = vValue;
|
|
790
|
+
return true;
|
|
791
|
+
}
|
|
547
792
|
if (!publisherInstance._proxies_.has(sKey)) {
|
|
548
793
|
const newPublisher = new Publisher({}, publisherInstance);
|
|
549
794
|
newPublisher._proxies_.set("_parent_", thisProxy);
|
|
@@ -591,6 +836,26 @@ class Publisher extends PublisherProxy$1 {
|
|
|
591
836
|
}
|
|
592
837
|
if (typeof module != "undefined")
|
|
593
838
|
module.exports = { Publisher, PublisherManager: PublisherManager$1 };
|
|
839
|
+
class PublisherWebComponent extends HTMLElement {
|
|
840
|
+
constructor() {
|
|
841
|
+
super();
|
|
842
|
+
this.publisherId = "";
|
|
843
|
+
this.onAssign = (value) => {
|
|
844
|
+
this.innerHTML = value.toString();
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
connectedCallback() {
|
|
848
|
+
var _a2;
|
|
849
|
+
this.publisherId = this.getAttribute("publisher") || "";
|
|
850
|
+
this.publisher = PublisherProxy$1.instances.get(parseInt(this.publisherId));
|
|
851
|
+
(_a2 = this.publisher) == null ? void 0 : _a2.onAssign(this.onAssign);
|
|
852
|
+
}
|
|
853
|
+
disconnectedCallback() {
|
|
854
|
+
var _a2;
|
|
855
|
+
(_a2 = this.publisher) == null ? void 0 : _a2.offAssign(this.onAssign);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
customElements.define("reactive-publisher-proxy", PublisherWebComponent);
|
|
594
859
|
const _DataBindObserver = class {
|
|
595
860
|
static disable() {
|
|
596
861
|
if (!this.enabled)
|
|
@@ -820,7 +1085,7 @@ function t$3(t2) {
|
|
|
820
1085
|
* Copyright 2017 Google LLC
|
|
821
1086
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
822
1087
|
*/
|
|
823
|
-
const o$
|
|
1088
|
+
const o$a = ({ finisher: e2, descriptor: t2 }) => (o2, n2) => {
|
|
824
1089
|
var r2;
|
|
825
1090
|
if (void 0 === n2) {
|
|
826
1091
|
const n3 = null !== (r2 = o2.originalKey) && void 0 !== r2 ? r2 : o2.key, i2 = null != t2 ? { kind: "method", placement: "prototype", key: n3, descriptor: t2(o2.key) } : { ...o2, key: n3 };
|
|
@@ -839,7 +1104,7 @@ const o$9 = ({ finisher: e2, descriptor: t2 }) => (o2, n2) => {
|
|
|
839
1104
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
840
1105
|
*/
|
|
841
1106
|
function i$5(i2, n2) {
|
|
842
|
-
return o$
|
|
1107
|
+
return o$a({ descriptor: (o2) => {
|
|
843
1108
|
const t2 = { get() {
|
|
844
1109
|
var o3, n3;
|
|
845
1110
|
return null !== (n3 = null === (o3 = this.renderRoot) || void 0 === o3 ? void 0 : o3.querySelector(i2)) && void 0 !== n3 ? n3 : null;
|
|
@@ -859,11 +1124,11 @@ function i$5(i2, n2) {
|
|
|
859
1124
|
* Copyright 2021 Google LLC
|
|
860
1125
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
861
1126
|
*/
|
|
862
|
-
var n$
|
|
863
|
-
const e$6 = null != (null === (n$
|
|
1127
|
+
var n$7;
|
|
1128
|
+
const e$6 = null != (null === (n$7 = window.HTMLSlotElement) || void 0 === n$7 ? void 0 : n$7.prototype.assignedElements) ? (o2, n2) => o2.assignedElements(n2) : (o2, n2) => o2.assignedNodes(n2).filter((o3) => o3.nodeType === Node.ELEMENT_NODE);
|
|
864
1129
|
function l$6(n2) {
|
|
865
1130
|
const { slot: l2, selector: t2 } = null != n2 ? n2 : {};
|
|
866
|
-
return o$
|
|
1131
|
+
return o$a({ descriptor: (o2) => ({ get() {
|
|
867
1132
|
var o3;
|
|
868
1133
|
const r2 = "slot" + (l2 ? `[name=${l2}]` : ":not([name])"), i2 = null === (o3 = this.renderRoot) || void 0 === o3 ? void 0 : o3.querySelector(r2), s2 = null != i2 ? e$6(i2, n2) : [];
|
|
869
1134
|
return t2 ? s2.filter((o4) => o4.matches(t2)) : s2;
|
|
@@ -874,9 +1139,9 @@ function l$6(n2) {
|
|
|
874
1139
|
* Copyright 2017 Google LLC
|
|
875
1140
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
876
1141
|
*/
|
|
877
|
-
function o$
|
|
1142
|
+
function o$9(o2, n2, r2) {
|
|
878
1143
|
let l2, s2 = o2;
|
|
879
|
-
return "object" == typeof o2 ? (s2 = o2.slot, l2 = o2) : l2 = { flatten: n2 }, r2 ? l$6({ slot: s2, flatten: n2, selector: r2 }) : o$
|
|
1144
|
+
return "object" == typeof o2 ? (s2 = o2.slot, l2 = o2) : l2 = { flatten: n2 }, r2 ? l$6({ slot: s2, flatten: n2, selector: r2 }) : o$a({ descriptor: (e2) => ({ get() {
|
|
880
1145
|
var e3, t2;
|
|
881
1146
|
const o3 = "slot" + (s2 ? `[name=${s2}]` : ":not([name])"), n3 = null === (e3 = this.renderRoot) || void 0 === e3 ? void 0 : e3.querySelector(o3);
|
|
882
1147
|
return null !== (t2 = null == n3 ? void 0 : n3.assignedNodes(l2)) && void 0 !== t2 ? t2 : [];
|
|
@@ -940,27 +1205,31 @@ const Subscriber$1 = (superClass, type) => {
|
|
|
940
1205
|
}
|
|
941
1206
|
updated(_changedProperties) {
|
|
942
1207
|
super.updated(_changedProperties);
|
|
943
|
-
|
|
1208
|
+
const ref = this.shadowRoot || this;
|
|
944
1209
|
const children = [...ref.children].filter((child) => child.tagName != "STYLE");
|
|
945
|
-
|
|
1210
|
+
const display = this.displayContents ? "contents" : children.length == 0 ? "none" : null;
|
|
946
1211
|
if (display)
|
|
947
1212
|
this.style.display = display;
|
|
948
1213
|
else
|
|
949
1214
|
this.style.removeProperty("display");
|
|
950
1215
|
}
|
|
951
1216
|
connectedCallback() {
|
|
1217
|
+
_SubscriberElement.instanceCounter++;
|
|
952
1218
|
if (this.hasAttribute("lazyRendering")) {
|
|
953
1219
|
const options = {
|
|
954
1220
|
root: null,
|
|
955
|
-
rootMargin: Math.max(window.innerWidth
|
|
1221
|
+
rootMargin: Math.max(window.innerWidth, window.innerHeight) + "px"
|
|
956
1222
|
};
|
|
957
1223
|
let firstView = true;
|
|
958
1224
|
const iObserver = new IntersectionObserver((entries) => {
|
|
959
1225
|
for (const e2 of entries) {
|
|
960
1226
|
if (firstView && e2.isIntersecting) {
|
|
1227
|
+
this.addDebugger();
|
|
961
1228
|
firstView = false;
|
|
962
1229
|
this.initWording();
|
|
963
1230
|
this.initPublisher();
|
|
1231
|
+
iObserver.disconnect();
|
|
1232
|
+
break;
|
|
964
1233
|
}
|
|
965
1234
|
}
|
|
966
1235
|
}, options);
|
|
@@ -968,10 +1237,9 @@ const Subscriber$1 = (superClass, type) => {
|
|
|
968
1237
|
} else {
|
|
969
1238
|
this.initWording();
|
|
970
1239
|
this.initPublisher();
|
|
1240
|
+
this.addDebugger();
|
|
971
1241
|
}
|
|
972
|
-
this.addDebugger();
|
|
973
1242
|
super.connectedCallback();
|
|
974
|
-
_SubscriberElement.instanceCounter++;
|
|
975
1243
|
}
|
|
976
1244
|
disconnectedCallback() {
|
|
977
1245
|
var _a2;
|
|
@@ -1054,14 +1322,15 @@ const Subscriber$1 = (superClass, type) => {
|
|
|
1054
1322
|
const serviceURL = this.getAncestorAttributeValue("serviceURL");
|
|
1055
1323
|
let userName = null;
|
|
1056
1324
|
let password2 = null;
|
|
1057
|
-
|
|
1325
|
+
const tokenProvider = this.getAncestorAttributeValue("tokenProvider");
|
|
1326
|
+
const authToken = this.getAncestorAttributeValue("eventsApiToken");
|
|
1058
1327
|
if (!token) {
|
|
1059
1328
|
userName = this.getAncestorAttributeValue("userName");
|
|
1060
1329
|
password2 = this.getAncestorAttributeValue("password");
|
|
1061
|
-
tokenProvider = this.getAncestorAttributeValue("tokenProvider");
|
|
1062
1330
|
}
|
|
1063
1331
|
const credentials = this.getAncestorAttributeValue("credentials") || void 0;
|
|
1064
|
-
|
|
1332
|
+
const cache = this.getAttribute("cache") || void 0 || void 0;
|
|
1333
|
+
return { serviceURL, token, userName, password: password2, authToken, tokenProvider, addHTTPResponse, credentials, cache };
|
|
1065
1334
|
}
|
|
1066
1335
|
async initWording() {
|
|
1067
1336
|
let hasWording = false;
|
|
@@ -1074,15 +1343,16 @@ const Subscriber$1 = (superClass, type) => {
|
|
|
1074
1343
|
}
|
|
1075
1344
|
if (!hasWording)
|
|
1076
1345
|
return;
|
|
1077
|
-
const publisher = PublisherManager$1.
|
|
1346
|
+
const publisher = PublisherManager$1.get("sonic-wording");
|
|
1078
1347
|
const wordingProvider = this.getAncestorAttributeValue("wordingProvider");
|
|
1079
1348
|
const api2 = new API(this.getApiConfiguration());
|
|
1080
1349
|
if (wordingProvider) {
|
|
1081
1350
|
const wordings = [];
|
|
1351
|
+
const publisherValue = publisher.get();
|
|
1082
1352
|
for (const p2 of propNames) {
|
|
1083
1353
|
if (p2.indexOf("wording_") == 0) {
|
|
1084
1354
|
const p8 = p2.substring(8);
|
|
1085
|
-
if (!
|
|
1355
|
+
if (!publisherValue[p2]) {
|
|
1086
1356
|
publisher[p2] = "...";
|
|
1087
1357
|
wordings.push(p8);
|
|
1088
1358
|
}
|
|
@@ -1126,7 +1396,7 @@ const Subscriber$1 = (superClass, type) => {
|
|
|
1126
1396
|
if (this.bindPublisher) {
|
|
1127
1397
|
mng.set(publisherId, this.bindPublisher());
|
|
1128
1398
|
}
|
|
1129
|
-
let pub = mng.get(publisherId);
|
|
1399
|
+
let pub = mng.get(publisherId, { localStorageMode: this.getAttribute("localStorage") || "disabled" });
|
|
1130
1400
|
this.dataProvider = publisherId;
|
|
1131
1401
|
if (this.hasAttribute("subDataProvider")) {
|
|
1132
1402
|
const dataPath = this.getAttribute("subDataProvider");
|
|
@@ -1224,8 +1494,8 @@ const TemplatesContainer$1 = (superClass) => {
|
|
|
1224
1494
|
* Copyright 2019 Google LLC
|
|
1225
1495
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1226
1496
|
*/
|
|
1227
|
-
const t$2 = window, e$5 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$6 = Symbol(), n$
|
|
1228
|
-
class o$
|
|
1497
|
+
const t$2 = window, e$5 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$6 = Symbol(), n$6 = /* @__PURE__ */ new WeakMap();
|
|
1498
|
+
class o$8 {
|
|
1229
1499
|
constructor(t2, e2, n2) {
|
|
1230
1500
|
if (this._$cssResult$ = true, n2 !== s$6)
|
|
1231
1501
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -1236,7 +1506,7 @@ class o$7 {
|
|
|
1236
1506
|
const s2 = this.t;
|
|
1237
1507
|
if (e$5 && void 0 === t2) {
|
|
1238
1508
|
const e2 = void 0 !== s2 && 1 === s2.length;
|
|
1239
|
-
e2 && (t2 = n$
|
|
1509
|
+
e2 && (t2 = n$6.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && n$6.set(s2, t2));
|
|
1240
1510
|
}
|
|
1241
1511
|
return t2;
|
|
1242
1512
|
}
|
|
@@ -1244,7 +1514,7 @@ class o$7 {
|
|
|
1244
1514
|
return this.cssText;
|
|
1245
1515
|
}
|
|
1246
1516
|
}
|
|
1247
|
-
const r$5 = (t2) => new o$
|
|
1517
|
+
const r$5 = (t2) => new o$8("string" == typeof t2 ? t2 : t2 + "", void 0, s$6), i$4 = (t2, ...e2) => {
|
|
1248
1518
|
const n2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, n3) => e3 + ((t3) => {
|
|
1249
1519
|
if (true === t3._$cssResult$)
|
|
1250
1520
|
return t3.cssText;
|
|
@@ -1252,7 +1522,7 @@ const r$5 = (t2) => new o$7("string" == typeof t2 ? t2 : t2 + "", void 0, s$6),
|
|
|
1252
1522
|
return t3;
|
|
1253
1523
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
1254
1524
|
})(s2) + t2[n3 + 1], t2[0]);
|
|
1255
|
-
return new o$
|
|
1525
|
+
return new o$8(n2, t2, s$6);
|
|
1256
1526
|
}, S$2 = (s2, n2) => {
|
|
1257
1527
|
e$5 ? s2.adoptedStyleSheets = n2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet) : n2.forEach((e2) => {
|
|
1258
1528
|
const n3 = document.createElement("style"), o2 = t$2.litNonce;
|
|
@@ -1270,7 +1540,7 @@ const r$5 = (t2) => new o$7("string" == typeof t2 ? t2 : t2 + "", void 0, s$6),
|
|
|
1270
1540
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1271
1541
|
*/
|
|
1272
1542
|
var s$5;
|
|
1273
|
-
const e$4 = window, r$4 = e$4.trustedTypes, h$3 = r$4 ? r$4.emptyScript : "", o$
|
|
1543
|
+
const e$4 = window, r$4 = e$4.trustedTypes, h$3 = r$4 ? r$4.emptyScript : "", o$7 = e$4.reactiveElementPolyfillSupport, n$5 = { toAttribute(t2, i2) {
|
|
1274
1544
|
switch (i2) {
|
|
1275
1545
|
case Boolean:
|
|
1276
1546
|
t2 = t2 ? h$3 : null;
|
|
@@ -1298,8 +1568,8 @@ const e$4 = window, r$4 = e$4.trustedTypes, h$3 = r$4 ? r$4.emptyScript : "", o$
|
|
|
1298
1568
|
}
|
|
1299
1569
|
}
|
|
1300
1570
|
return s2;
|
|
1301
|
-
} }, a$
|
|
1302
|
-
class d$
|
|
1571
|
+
} }, a$3 = (t2, i2) => i2 !== t2 && (i2 == i2 || t2 == t2), l$5 = { attribute: true, type: String, converter: n$5, reflect: false, hasChanged: a$3 };
|
|
1572
|
+
class d$2 extends HTMLElement {
|
|
1303
1573
|
constructor() {
|
|
1304
1574
|
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this.u();
|
|
1305
1575
|
}
|
|
@@ -1403,7 +1673,7 @@ class d$1 extends HTMLElement {
|
|
|
1403
1673
|
var e2;
|
|
1404
1674
|
const r2 = this.constructor._$Ep(t2, s2);
|
|
1405
1675
|
if (void 0 !== r2 && true === s2.reflect) {
|
|
1406
|
-
const h2 = (void 0 !== (null === (e2 = s2.converter) || void 0 === e2 ? void 0 : e2.toAttribute) ? s2.converter : n$
|
|
1676
|
+
const h2 = (void 0 !== (null === (e2 = s2.converter) || void 0 === e2 ? void 0 : e2.toAttribute) ? s2.converter : n$5).toAttribute(i2, s2.type);
|
|
1407
1677
|
this._$El = t2, null == h2 ? this.removeAttribute(r2) : this.setAttribute(r2, h2), this._$El = null;
|
|
1408
1678
|
}
|
|
1409
1679
|
}
|
|
@@ -1411,13 +1681,13 @@ class d$1 extends HTMLElement {
|
|
|
1411
1681
|
var s2;
|
|
1412
1682
|
const e2 = this.constructor, r2 = e2._$Ev.get(t2);
|
|
1413
1683
|
if (void 0 !== r2 && this._$El !== r2) {
|
|
1414
|
-
const t3 = e2.getPropertyOptions(r2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== (null === (s2 = t3.converter) || void 0 === s2 ? void 0 : s2.fromAttribute) ? t3.converter : n$
|
|
1684
|
+
const t3 = e2.getPropertyOptions(r2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== (null === (s2 = t3.converter) || void 0 === s2 ? void 0 : s2.fromAttribute) ? t3.converter : n$5;
|
|
1415
1685
|
this._$El = r2, this[r2] = h2.fromAttribute(i2, t3.type), this._$El = null;
|
|
1416
1686
|
}
|
|
1417
1687
|
}
|
|
1418
1688
|
requestUpdate(t2, i2, s2) {
|
|
1419
1689
|
let e2 = true;
|
|
1420
|
-
void 0 !== t2 && (((s2 = s2 || this.constructor.getPropertyOptions(t2)).hasChanged || a$
|
|
1690
|
+
void 0 !== t2 && (((s2 = s2 || this.constructor.getPropertyOptions(t2)).hasChanged || a$3)(this[t2], i2) ? (this._$AL.has(t2) || this._$AL.set(t2, i2), true === s2.reflect && this._$El !== t2 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t2, s2))) : e2 = false), !this.isUpdatePending && e2 && (this._$E_ = this._$Ej());
|
|
1421
1691
|
}
|
|
1422
1692
|
async _$Ej() {
|
|
1423
1693
|
this.isUpdatePending = true;
|
|
@@ -1478,14 +1748,14 @@ class d$1 extends HTMLElement {
|
|
|
1478
1748
|
firstUpdated(t2) {
|
|
1479
1749
|
}
|
|
1480
1750
|
}
|
|
1481
|
-
d$
|
|
1751
|
+
d$2.finalized = true, d$2.elementProperties = /* @__PURE__ */ new Map(), d$2.elementStyles = [], d$2.shadowRootOptions = { mode: "open" }, null == o$7 || o$7({ ReactiveElement: d$2 }), (null !== (s$5 = e$4.reactiveElementVersions) && void 0 !== s$5 ? s$5 : e$4.reactiveElementVersions = []).push("1.6.1");
|
|
1482
1752
|
/**
|
|
1483
1753
|
* @license
|
|
1484
1754
|
* Copyright 2017 Google LLC
|
|
1485
1755
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1486
1756
|
*/
|
|
1487
1757
|
var t$1;
|
|
1488
|
-
const i$3 = window, s$4 = i$3.trustedTypes, e$3 = s$4 ? s$4.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, o$
|
|
1758
|
+
const i$3 = window, s$4 = i$3.trustedTypes, e$3 = s$4 ? s$4.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, o$6 = `lit$${(Math.random() + "").slice(9)}$`, n$4 = "?" + o$6, l$4 = `<${n$4}>`, h$2 = document, r$3 = (t2 = "") => h$2.createComment(t2), d$1 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, u$2 = Array.isArray, c$3 = (t2) => u$2(t2) || "function" == typeof (null == t2 ? void 0 : t2[Symbol.iterator]), v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, a$2 = /-->/g, f$2 = />/g, _ = RegExp(`>|[
|
|
1489
1759
|
\f\r](?:([^\\s"'>=/]+)([
|
|
1490
1760
|
\f\r]*=[
|
|
1491
1761
|
\f\r]*(?:[^
|
|
@@ -1496,9 +1766,9 @@ const i$3 = window, s$4 = i$3.trustedTypes, e$3 = s$4 ? s$4.createPolicy("lit-ht
|
|
|
1496
1766
|
const s3 = t2[i3];
|
|
1497
1767
|
let e2, u3, c2 = -1, g2 = 0;
|
|
1498
1768
|
for (; g2 < s3.length && (d2.lastIndex = g2, u3 = d2.exec(s3), null !== u3); )
|
|
1499
|
-
g2 = d2.lastIndex, d2 === v ? "!--" === u3[1] ? d2 = a$
|
|
1769
|
+
g2 = d2.lastIndex, d2 === v ? "!--" === u3[1] ? d2 = a$2 : void 0 !== u3[1] ? d2 = f$2 : void 0 !== u3[2] ? ($$1.test(u3[2]) && (h2 = RegExp("</" + u3[2], "g")), d2 = _) : void 0 !== u3[3] && (d2 = _) : d2 === _ ? ">" === u3[0] ? (d2 = null != h2 ? h2 : v, c2 = -1) : void 0 === u3[1] ? c2 = -2 : (c2 = d2.lastIndex - u3[2].length, e2 = u3[1], d2 = void 0 === u3[3] ? _ : '"' === u3[3] ? p$2 : m$1) : d2 === p$2 || d2 === m$1 ? d2 = _ : d2 === a$2 || d2 === f$2 ? d2 = v : (d2 = _, h2 = void 0);
|
|
1500
1770
|
const y2 = d2 === _ && t2[i3 + 1].startsWith("/>") ? " " : "";
|
|
1501
|
-
r2 += d2 === v ? s3 + l$4 : c2 >= 0 ? (n2.push(e2), s3.slice(0, c2) + "$lit$" + s3.slice(c2) + o$
|
|
1771
|
+
r2 += d2 === v ? s3 + l$4 : c2 >= 0 ? (n2.push(e2), s3.slice(0, c2) + "$lit$" + s3.slice(c2) + o$6 + y2) : s3 + o$6 + (-2 === c2 ? (n2.push(void 0), i3) : y2);
|
|
1502
1772
|
}
|
|
1503
1773
|
const u2 = r2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : "");
|
|
1504
1774
|
if (!Array.isArray(t2) || !t2.hasOwnProperty("raw"))
|
|
@@ -1520,10 +1790,10 @@ class C {
|
|
|
1520
1790
|
if (l2.hasAttributes()) {
|
|
1521
1791
|
const t3 = [];
|
|
1522
1792
|
for (const i3 of l2.getAttributeNames())
|
|
1523
|
-
if (i3.endsWith("$lit$") || i3.startsWith(o$
|
|
1793
|
+
if (i3.endsWith("$lit$") || i3.startsWith(o$6)) {
|
|
1524
1794
|
const s2 = a2[d2++];
|
|
1525
1795
|
if (t3.push(i3), void 0 !== s2) {
|
|
1526
|
-
const t4 = l2.getAttribute(s2.toLowerCase() + "$lit$").split(o$
|
|
1796
|
+
const t4 = l2.getAttribute(s2.toLowerCase() + "$lit$").split(o$6), i4 = /([.?@])?(.*)/.exec(s2);
|
|
1527
1797
|
c2.push({ type: 1, index: h2, name: i4[2], strings: t4, ctor: "." === i4[1] ? M : "?" === i4[1] ? k : "@" === i4[1] ? H : S$1 });
|
|
1528
1798
|
} else
|
|
1529
1799
|
c2.push({ type: 6, index: h2 });
|
|
@@ -1532,7 +1802,7 @@ class C {
|
|
|
1532
1802
|
l2.removeAttribute(i3);
|
|
1533
1803
|
}
|
|
1534
1804
|
if ($$1.test(l2.tagName)) {
|
|
1535
|
-
const t3 = l2.textContent.split(o$
|
|
1805
|
+
const t3 = l2.textContent.split(o$6), i3 = t3.length - 1;
|
|
1536
1806
|
if (i3 > 0) {
|
|
1537
1807
|
l2.textContent = s$4 ? s$4.emptyScript : "";
|
|
1538
1808
|
for (let s2 = 0; s2 < i3; s2++)
|
|
@@ -1541,12 +1811,12 @@ class C {
|
|
|
1541
1811
|
}
|
|
1542
1812
|
}
|
|
1543
1813
|
} else if (8 === l2.nodeType)
|
|
1544
|
-
if (l2.data === n$
|
|
1814
|
+
if (l2.data === n$4)
|
|
1545
1815
|
c2.push({ type: 2, index: h2 });
|
|
1546
1816
|
else {
|
|
1547
1817
|
let t3 = -1;
|
|
1548
|
-
for (; -1 !== (t3 = l2.data.indexOf(o$
|
|
1549
|
-
c2.push({ type: 7, index: h2 }), t3 += o$
|
|
1818
|
+
for (; -1 !== (t3 = l2.data.indexOf(o$6, t3 + 1)); )
|
|
1819
|
+
c2.push({ type: 7, index: h2 }), t3 += o$6.length - 1;
|
|
1550
1820
|
}
|
|
1551
1821
|
h2++;
|
|
1552
1822
|
}
|
|
@@ -1561,7 +1831,7 @@ function P(t2, i2, s2 = t2, e2) {
|
|
|
1561
1831
|
if (i2 === x$1)
|
|
1562
1832
|
return i2;
|
|
1563
1833
|
let r2 = void 0 !== e2 ? null === (o2 = s2._$Co) || void 0 === o2 ? void 0 : o2[e2] : s2._$Cl;
|
|
1564
|
-
const u2 = d(i2) ? void 0 : i2._$litDirective$;
|
|
1834
|
+
const u2 = d$1(i2) ? void 0 : i2._$litDirective$;
|
|
1565
1835
|
return (null == r2 ? void 0 : r2.constructor) !== u2 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u2 ? r2 = void 0 : (r2 = new u2(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Co) && void 0 !== l2 ? l2 : h2._$Co = [])[e2] = r2 : s2._$Cl = r2), void 0 !== r2 && (i2 = P(t2, r2._$AS(t2, i2.values), r2, e2)), i2;
|
|
1566
1836
|
}
|
|
1567
1837
|
class V {
|
|
@@ -1615,7 +1885,7 @@ class N {
|
|
|
1615
1885
|
return this._$AB;
|
|
1616
1886
|
}
|
|
1617
1887
|
_$AI(t2, i2 = this) {
|
|
1618
|
-
t2 = P(this, t2, i2), d(t2) ? t2 === b$1 || null == t2 || "" === t2 ? (this._$AH !== b$1 && this._$AR(), this._$AH = b$1) : t2 !== this._$AH && t2 !== x$1 && this.g(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : c$3(t2) ? this.k(t2) : this.g(t2);
|
|
1888
|
+
t2 = P(this, t2, i2), d$1(t2) ? t2 === b$1 || null == t2 || "" === t2 ? (this._$AH !== b$1 && this._$AR(), this._$AH = b$1) : t2 !== this._$AH && t2 !== x$1 && this.g(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : c$3(t2) ? this.k(t2) : this.g(t2);
|
|
1619
1889
|
}
|
|
1620
1890
|
O(t2, i2 = this._$AB) {
|
|
1621
1891
|
return this._$AA.parentNode.insertBefore(t2, i2);
|
|
@@ -1624,7 +1894,7 @@ class N {
|
|
|
1624
1894
|
this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2));
|
|
1625
1895
|
}
|
|
1626
1896
|
g(t2) {
|
|
1627
|
-
this._$AH !== b$1 && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(h$2.createTextNode(t2)), this._$AH = t2;
|
|
1897
|
+
this._$AH !== b$1 && d$1(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(h$2.createTextNode(t2)), this._$AH = t2;
|
|
1628
1898
|
}
|
|
1629
1899
|
$(t2) {
|
|
1630
1900
|
var i2;
|
|
@@ -1674,12 +1944,12 @@ class S$1 {
|
|
|
1674
1944
|
const o2 = this.strings;
|
|
1675
1945
|
let n2 = false;
|
|
1676
1946
|
if (void 0 === o2)
|
|
1677
|
-
t2 = P(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== x$1, n2 && (this._$AH = t2);
|
|
1947
|
+
t2 = P(this, t2, i2, 0), n2 = !d$1(t2) || t2 !== this._$AH && t2 !== x$1, n2 && (this._$AH = t2);
|
|
1678
1948
|
else {
|
|
1679
1949
|
const e3 = t2;
|
|
1680
1950
|
let l2, h2;
|
|
1681
1951
|
for (t2 = o2[0], l2 = 0; l2 < o2.length - 1; l2++)
|
|
1682
|
-
h2 = P(this, e3[s2 + l2], i2, l2), h2 === x$1 && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === b$1 ? t2 = b$1 : t2 !== b$1 && (t2 += (null != h2 ? h2 : "") + o2[l2 + 1]), this._$AH[l2] = h2;
|
|
1952
|
+
h2 = P(this, e3[s2 + l2], i2, l2), h2 === x$1 && (h2 = this._$AH[l2]), n2 || (n2 = !d$1(h2) || h2 !== this._$AH[l2]), h2 === b$1 ? t2 = b$1 : t2 !== b$1 && (t2 += (null != h2 ? h2 : "") + o2[l2 + 1]), this._$AH[l2] = h2;
|
|
1683
1953
|
}
|
|
1684
1954
|
n2 && !e2 && this.j(t2);
|
|
1685
1955
|
}
|
|
@@ -1731,7 +2001,7 @@ class I {
|
|
|
1731
2001
|
P(this, t2);
|
|
1732
2002
|
}
|
|
1733
2003
|
}
|
|
1734
|
-
const L = { P: "$lit$", A: o$
|
|
2004
|
+
const L = { P: "$lit$", A: o$6, M: n$4, C: 1, L: E, R: V, D: c$3, V: P, I: N, H: S$1, N: k, U: H, B: M, F: I }, z = i$3.litHtmlPolyfillSupport;
|
|
1735
2005
|
null == z || z(C, N), (null !== (t$1 = i$3.litHtmlVersions) && void 0 !== t$1 ? t$1 : i$3.litHtmlVersions = []).push("2.6.1");
|
|
1736
2006
|
const Z = (t2, i2, s2) => {
|
|
1737
2007
|
var e2, o2;
|
|
@@ -1748,8 +2018,8 @@ const Z = (t2, i2, s2) => {
|
|
|
1748
2018
|
* Copyright 2017 Google LLC
|
|
1749
2019
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1750
2020
|
*/
|
|
1751
|
-
var l$3, o$
|
|
1752
|
-
class s$3 extends d$
|
|
2021
|
+
var l$3, o$5;
|
|
2022
|
+
class s$3 extends d$2 {
|
|
1753
2023
|
constructor() {
|
|
1754
2024
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1755
2025
|
}
|
|
@@ -1775,9 +2045,9 @@ class s$3 extends d$1 {
|
|
|
1775
2045
|
}
|
|
1776
2046
|
}
|
|
1777
2047
|
s$3.finalized = true, s$3._$litElement$ = true, null === (l$3 = globalThis.litElementHydrateSupport) || void 0 === l$3 || l$3.call(globalThis, { LitElement: s$3 });
|
|
1778
|
-
const n$
|
|
1779
|
-
null == n$
|
|
1780
|
-
(null !== (o$
|
|
2048
|
+
const n$3 = globalThis.litElementPolyfillSupport;
|
|
2049
|
+
null == n$3 || n$3({ LitElement: s$3 });
|
|
2050
|
+
(null !== (o$5 = globalThis.litElementVersions) && void 0 !== o$5 ? o$5 : globalThis.litElementVersions = []).push("3.2.2");
|
|
1781
2051
|
var __defProp$16 = Object.defineProperty;
|
|
1782
2052
|
var __getOwnPropDesc$16 = Object.getOwnPropertyDescriptor;
|
|
1783
2053
|
var __decorateClass$16 = (decorators, target, key, kind) => {
|
|
@@ -2314,15 +2584,20 @@ const Form$2 = (superClass) => {
|
|
|
2314
2584
|
next = loop[index - 1];
|
|
2315
2585
|
}
|
|
2316
2586
|
}
|
|
2317
|
-
const elt = (_a2 = next == null ? void 0 : next.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
2587
|
+
const elt = (_a2 = next == null ? void 0 : next.shadowRoot) == null ? void 0 : _a2.querySelector(
|
|
2588
|
+
selector
|
|
2589
|
+
);
|
|
2318
2590
|
if (elt && elt.focus) {
|
|
2319
2591
|
elt.focus();
|
|
2320
2592
|
e2.preventDefault();
|
|
2593
|
+
e2.stopPropagation();
|
|
2321
2594
|
}
|
|
2322
2595
|
});
|
|
2323
2596
|
}
|
|
2324
2597
|
connectedCallback() {
|
|
2325
|
-
this.formDataProvider = this.getAncestorAttributeValue(
|
|
2598
|
+
this.formDataProvider = this.getAncestorAttributeValue(
|
|
2599
|
+
"formDataProvider"
|
|
2600
|
+
);
|
|
2326
2601
|
super.connectedCallback();
|
|
2327
2602
|
this.addKeyboardNavigation();
|
|
2328
2603
|
}
|
|
@@ -2412,7 +2687,9 @@ class Arrays$1 {
|
|
|
2412
2687
|
if (source.length < 1)
|
|
2413
2688
|
return true;
|
|
2414
2689
|
const first = (source[0] || {})[key];
|
|
2415
|
-
return source.every(
|
|
2690
|
+
return source.every(
|
|
2691
|
+
(item) => (item || {})[key] == first
|
|
2692
|
+
);
|
|
2416
2693
|
}
|
|
2417
2694
|
};
|
|
2418
2695
|
}
|
|
@@ -2474,7 +2751,9 @@ class Arrays$1 {
|
|
|
2474
2751
|
forKey: (key) => {
|
|
2475
2752
|
const set = [...new Set(source.map((item) => item[key]))];
|
|
2476
2753
|
return Arrays$1.from(
|
|
2477
|
-
set.map(
|
|
2754
|
+
set.map(
|
|
2755
|
+
(value) => source.find((item) => item[key] == value)
|
|
2756
|
+
)
|
|
2478
2757
|
);
|
|
2479
2758
|
}
|
|
2480
2759
|
};
|
|
@@ -2486,7 +2765,11 @@ class Arrays$1 {
|
|
|
2486
2765
|
forKey: (key) => {
|
|
2487
2766
|
const areValuesDifferentForKey = (compared1, key2) => (compared2) => compared1[key2] != compared2[key2];
|
|
2488
2767
|
return Arrays$1.from(
|
|
2489
|
-
source.filter(
|
|
2768
|
+
source.filter(
|
|
2769
|
+
(elt) => toRemoveFromSource.every(
|
|
2770
|
+
areValuesDifferentForKey(elt, key)
|
|
2771
|
+
)
|
|
2772
|
+
)
|
|
2490
2773
|
);
|
|
2491
2774
|
}
|
|
2492
2775
|
};
|
|
@@ -2904,7 +3187,7 @@ let Button = class extends Form$1(Form$2(Subscriber$1(s$3))) {
|
|
|
2904
3187
|
};
|
|
2905
3188
|
Button.styles = [
|
|
2906
3189
|
fontSize,
|
|
2907
|
-
i$4`*{box-sizing:border-box}:host{--sc-btn-gap:0.35em;--sc-btn-py:0.25em;--sc-btn-px:1.1em;--sc-btn-fs:var(--sc-fs, 1rem);--sc-btn-fw:var(--sc-btn-font-weight);--sc-btn-ff:var(--sc-btn-font-family);--sc-btn-height:var(--sc-form-height);--sc-btn-color
|
|
3190
|
+
i$4`*{box-sizing:border-box}:host{--sc-btn-gap:0.35em;--sc-btn-py:0.25em;--sc-btn-px:1.1em;--sc-btn-fs:var(--sc-fs, 1rem);--sc-btn-fw:var(--sc-btn-font-weight);--sc-btn-ff:var(--sc-btn-font-family);--sc-btn-height:var(--sc-form-height);--btn-color:var(--sc-btn-color, var(--sc-base-content));--btn-bg:var(--sc-btn-bg, var(--sc-base-100));--sc-btn-border-style:solid;--sc-btn-border-width:var(--sc-form-border-width);--sc-btn-border-color:transparent;--btn-outline-bg-hover:var(--sc-btn-outline-bg-hover, var(--sc-base-100));--sc-btn-ghost-bg-hover:var(--sc-base-100);--sc-btn-active-color:var(--sc-base);--sc-btn-hover-filter:brightness(0.98);--sc-btn-active-filter:brightness(0.97);--sc-btn-active-bg:var(--sc-base-content);--sc-item-rounded-tr:var(--sc-btn-rounded);--sc-item-rounded-tl:var(--sc-btn-rounded);--sc-item-rounded-bl:var(--sc-btn-rounded);--sc-item-rounded-br:var(--sc-btn-rounded);display:inline-flex;vertical-align:middle;box-sizing:border-box;-webkit-print-color-adjust:exact}:host a{display:contents;color:unset}:host button{display:flex;flex:1;box-sizing:border-box;align-items:center;justify-content:center;font-family:var(--sc-btn-ff);font-weight:var(--sc-btn-fw);font-size:var(--sc-btn-fs);cursor:pointer;text-align:center;line-height:1.1;border-radius:var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);background:var(--btn-bg);color:var(--btn-color);padding-top:var(--sc-btn-py);padding-bottom:var(--sc-btn-py);padding-left:var(--sc-btn-px);padding-right:var(--sc-btn-px);border:var(--sc-btn-border-width) var(--sc-btn-border-style) var(--sc-btn-border-color);min-height:var(--sc-btn-height)}:host button.has-prefix-or-suffix{gap:var(--sc-btn-gap)}:host button:focus,:host button:hover{filter:var(--sc-btn-hover-filter)}:host button:active{filter:var(--sc-btn-active-filter)}:host([type=default]) button{--btn-color:var(--sc-base-content);--btn-bg:var(--sc-base-100)}:host([type=primary]) button{--btn-color:var(--sc-primary-content);--btn-bg:var(--sc-primary)}:host([type=warning]) button{--btn-color:var(--sc-warning-content);--btn-bg:var(--sc-warning)}:host([type=danger]) button{--btn-color:var(--sc-danger-content);--btn-bg:var(--sc-danger)}:host([type=info]) button{--btn-color:var(--sc-info-content);--btn-bg:var(--sc-info)}:host([type=success]) button{--btn-color:var(--sc-success-content);--btn-bg:var(--sc-success)}:host([type=neutral]) button{--btn-color:var(--sc-base);--btn-bg:var(--sc-base-600)}:host([type=custom]) button{--btn-color:var(--sc-btn-custom-color);--btn-bg:var(--sc-btn-custom-bg)}:host([variant=unstyled]){display:inline-block}:host([variant=unstyled]) button{all:unset;display:contents;cursor:pointer;--sc-btn-height:auto;--sc-btn-width:auto}:host(:not([disabled])) button:focus{box-shadow:0 0 0 .18rem var(--sc-base-300);border-color:var(--sc-base-300)!important;outline:0}:host([variant=ghost][type]) button{color:var(--btn-bg);background:0 0}:host([variant=ghost][type=default]) button{color:var(--btn-color);background:0 0}:host([variant=ghost]) button:hover{background:var(--sc-btn-ghost-bg-hover);filter:none}:host([active][variant=ghost]) button{background:var(--sc-btn-ghost-bg-hover);filter:none}:host([active][variant=ghost]) button:hover{filter:var(--sc-btn-hover-filter)}:host([variant=outline][type]) button{border-color:var(--btn-bg);color:var(--btn-bg);background:0 0}:host([variant=outline][type=default]) button{border-color:var(--sc-base-400);color:var(--sc-base-500);background:0 0}:host([variant=outline]) button:hover{background:var(--btn-outline-bg-hover)}:host([variant=link]:not([size])){vertical-align:baseline;margin-left:.25em;margin-right:.25em}:host([variant=link]:not([size])){font-size:inherit}:host([variant=link]) button{text-decoration:underline;padding:0;background:0 0;border:none;font-size:inherit;min-height:0;color:inherit}:host([variant=link][type]) button{color:var(--btn-bg)}:host([variant=link][type=default]) button{color:inherit}:host([variant=link]) button:focus,:host([variant=link]) button:hover{text-decoration:none}:host([shape=circle]) button{border-radius:50%}:host([shape=circle]) button,:host([shape=square]) button{width:var(--sc-btn-height);height:var(--sc-btn-height);padding:0;align-items:center;justify-content:0;text-align:center!important}:host([shape=block]),:host([shape=block]) button{width:100%}:host([disabled]){opacity:.3;pointer-events:none;user-select:none}:host([active]:not([variant=ghost]):not([variant=unstyled])) button{background:var(--sc-btn-active-bg);color:var(--sc-btn-active-color);border-color:var(--sc-btn-active-bg)}:host([align=left]) button{text-align:left}:host([align=right]) button{text-align:right}.main-slot{flex-grow:1;display:block}:host([minWidth]) .main-slot{flex-grow:0}slot[name=prefix],slot[name=suffix]{flex-shrink:0}::slotted(sonic-icon){min-width:1em;text-align:center}:host([icon]) ::slotted(sonic-icon){font-size:1.2em}sonic-tooltip{display:contents}:host(:not([active])) ::slotted([swap=on]){display:none!important}:host([active]) ::slotted([swap=off]){display:none!important}:host([loading]){pointer-events:none;position:relative}:host([loading]) slot{opacity:0!important;pointer-events:none}:host([loading]) .loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;line-height:0;height:var(--sc-btn-ff);width:var(--sc-btn-ff);animation:rotation 2s infinite linear}@keyframes rotation{from{transform-origin:50% 50%;transform:translate(-50%,-50%) rotate(0)}to{transform-origin:50% 50%;transform:translate(-50%,-50%) rotate(359deg)}}`
|
|
2908
3191
|
];
|
|
2909
3192
|
__decorateClass$13([
|
|
2910
3193
|
e$7({ type: String, reflect: true })
|
|
@@ -3034,7 +3317,7 @@ Loader = __decorateClass$12([
|
|
|
3034
3317
|
* Copyright 2020 Google LLC
|
|
3035
3318
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3036
3319
|
*/
|
|
3037
|
-
const { I: l$1 } = L, e$1 = (o2) => void 0 === o2.strings, c$2 = () => document.createComment(""), r$2 = (o2, t2, i2) => {
|
|
3320
|
+
const { I: l$1 } = L, n$2 = (o2, l2) => void 0 === l2 ? void 0 !== (null == o2 ? void 0 : o2._$litType$) : (null == o2 ? void 0 : o2._$litType$) === l2, e$1 = (o2) => void 0 === o2.strings, c$2 = () => document.createComment(""), r$2 = (o2, t2, i2) => {
|
|
3038
3321
|
var n2;
|
|
3039
3322
|
const d2 = o2._$AA.parentNode, v2 = void 0 === t2 ? o2._$AB : t2._$AA;
|
|
3040
3323
|
if (void 0 === i2) {
|
|
@@ -3064,6 +3347,8 @@ const { I: l$1 } = L, e$1 = (o2) => void 0 === o2.strings, c$2 = () => document.
|
|
|
3064
3347
|
const o3 = t2.nextSibling;
|
|
3065
3348
|
t2.remove(), t2 = o3;
|
|
3066
3349
|
}
|
|
3350
|
+
}, a$1 = (o2) => {
|
|
3351
|
+
o2._$AR();
|
|
3067
3352
|
};
|
|
3068
3353
|
/**
|
|
3069
3354
|
* @license
|
|
@@ -3149,7 +3434,7 @@ const s$1 = (i2, t2) => {
|
|
|
3149
3434
|
for (const i3 of r2)
|
|
3150
3435
|
null === (o2 = (e2 = i3)._$AO) || void 0 === o2 || o2.call(e2, t2, false), s$1(i3, t2);
|
|
3151
3436
|
return true;
|
|
3152
|
-
}, o$
|
|
3437
|
+
}, o$4 = (i2) => {
|
|
3153
3438
|
let t2, e2;
|
|
3154
3439
|
do {
|
|
3155
3440
|
if (void 0 === (t2 = i2._$AM))
|
|
@@ -3167,7 +3452,7 @@ const s$1 = (i2, t2) => {
|
|
|
3167
3452
|
}
|
|
3168
3453
|
};
|
|
3169
3454
|
function n$1(i2) {
|
|
3170
|
-
void 0 !== this._$AN ? (o$
|
|
3455
|
+
void 0 !== this._$AN ? (o$4(this), this._$AM = i2, r$1(this)) : this._$AM = i2;
|
|
3171
3456
|
}
|
|
3172
3457
|
function h$1(i2, t2 = false, e2 = 0) {
|
|
3173
3458
|
const r2 = this._$AH, n2 = this._$AN;
|
|
@@ -3175,9 +3460,9 @@ function h$1(i2, t2 = false, e2 = 0) {
|
|
|
3175
3460
|
if (t2)
|
|
3176
3461
|
if (Array.isArray(r2))
|
|
3177
3462
|
for (let i3 = e2; i3 < r2.length; i3++)
|
|
3178
|
-
s$1(r2[i3], false), o$
|
|
3463
|
+
s$1(r2[i3], false), o$4(r2[i3]);
|
|
3179
3464
|
else
|
|
3180
|
-
null != r2 && (s$1(r2, false), o$
|
|
3465
|
+
null != r2 && (s$1(r2, false), o$4(r2));
|
|
3181
3466
|
else
|
|
3182
3467
|
s$1(this, i2);
|
|
3183
3468
|
}
|
|
@@ -3194,7 +3479,7 @@ class c extends i$2 {
|
|
|
3194
3479
|
}
|
|
3195
3480
|
_$AO(i2, t2 = true) {
|
|
3196
3481
|
var e2, r2;
|
|
3197
|
-
i2 !== this.isConnected && (this.isConnected = i2, i2 ? null === (e2 = this.reconnected) || void 0 === e2 || e2.call(this) : null === (r2 = this.disconnected) || void 0 === r2 || r2.call(this)), t2 && (s$1(this, i2), o$
|
|
3482
|
+
i2 !== this.isConnected && (this.isConnected = i2, i2 ? null === (e2 = this.reconnected) || void 0 === e2 || e2.call(this) : null === (r2 = this.disconnected) || void 0 === r2 || r2.call(this)), t2 && (s$1(this, i2), o$4(this));
|
|
3198
3483
|
}
|
|
3199
3484
|
setValue(t2) {
|
|
3200
3485
|
if (e$1(this._$Ct))
|
|
@@ -3458,7 +3743,7 @@ class e extends i$2 {
|
|
|
3458
3743
|
}
|
|
3459
3744
|
}
|
|
3460
3745
|
e.directiveName = "unsafeHTML", e.resultType = 1;
|
|
3461
|
-
const o$
|
|
3746
|
+
const o$3 = e$2(e);
|
|
3462
3747
|
const loadingGetPromises = /* @__PURE__ */ new Map();
|
|
3463
3748
|
const libraries = {
|
|
3464
3749
|
heroicons: {
|
|
@@ -3522,7 +3807,7 @@ Icons.fontAwesomeNext = {
|
|
|
3522
3807
|
iconsAsRecord[library] = libIcons;
|
|
3523
3808
|
const libIconsKey = prefix + "-" + name;
|
|
3524
3809
|
if (libIcons[libIconsKey])
|
|
3525
|
-
return o$
|
|
3810
|
+
return o$3(libIcons[libIconsKey]);
|
|
3526
3811
|
const url = libraryItem.url.replace("$prefix", prefix).replace("$name", name);
|
|
3527
3812
|
if (!loadingGetPromises.has(url)) {
|
|
3528
3813
|
const promise = new Promise(async (resolve) => {
|
|
@@ -3543,9 +3828,9 @@ Icons.fontAwesomeNext = {
|
|
|
3543
3828
|
const result = await loadingGetPromises.get(url);
|
|
3544
3829
|
loadingGetPromises.delete(url);
|
|
3545
3830
|
libIcons[libIconsKey] = result || "";
|
|
3546
|
-
return o$
|
|
3831
|
+
return o$3(result);
|
|
3547
3832
|
}
|
|
3548
|
-
return o$
|
|
3833
|
+
return o$3(iconsAsRecord["core"][params.name] || "");
|
|
3549
3834
|
}
|
|
3550
3835
|
};
|
|
3551
3836
|
Icons.default = _Icons.fontAwesomeNext;
|
|
@@ -3575,7 +3860,7 @@ let Icon = class extends s$3 {
|
|
|
3575
3860
|
return;
|
|
3576
3861
|
this.renderId++;
|
|
3577
3862
|
const frameRenderId = this.renderId;
|
|
3578
|
-
window.requestAnimationFrame(async () => {
|
|
3863
|
+
(window.queueMicrotask || window.requestAnimationFrame)(async () => {
|
|
3579
3864
|
if (frameRenderId != this.renderId) {
|
|
3580
3865
|
return;
|
|
3581
3866
|
}
|
|
@@ -3669,7 +3954,7 @@ let SonicToastItem = class extends s$3 {
|
|
|
3669
3954
|
if (!this.visible) {
|
|
3670
3955
|
return b$1;
|
|
3671
3956
|
}
|
|
3672
|
-
return y`<div class="sonic-toast ${this.status} ${this.ghost ? "ghost" : ""}"><button aria-label="Close" class="sonic-toast-close" @click="${() => this.hide()}"><sonic-icon name="cancel" size="lg"></sonic-icon></button><div class="sonic-toast-content custom-scroll" style="max-height:${this.maxHeight}">${this.status && y`<sonic-icon name="${icon$1[this.status]}" class="sonic-toast-icon" size="2xl"></sonic-icon>`}<div class="sonic-toast-text">${this.title ? y`<div class="sonic-toast-title">${this.title}</div>` : ""} ${this.text ? o$
|
|
3957
|
+
return y`<div class="sonic-toast ${this.status} ${this.ghost ? "ghost" : ""}"><button aria-label="Close" class="sonic-toast-close" @click="${() => this.hide()}"><sonic-icon name="cancel" size="lg"></sonic-icon></button><div class="sonic-toast-content custom-scroll" style="max-height:${this.maxHeight}">${this.status && y`<sonic-icon name="${icon$1[this.status]}" class="sonic-toast-icon" size="2xl"></sonic-icon>`}<div class="sonic-toast-text">${this.title ? y`<div class="sonic-toast-title">${this.title}</div>` : ""} ${this.text ? o$3(this.text) : ""}<slot></slot></div>${!this.preserve ? this.autoHide() : ""}</div></div>`;
|
|
3673
3958
|
}
|
|
3674
3959
|
hide() {
|
|
3675
3960
|
if (!this.closest("sonic-toast")) {
|
|
@@ -3787,7 +4072,7 @@ let SonicToast$1 = class extends s$3 {
|
|
|
3787
4072
|
}
|
|
3788
4073
|
],
|
|
3789
4074
|
stabilizeOut: true
|
|
3790
|
-
})}>${item.text ? o$
|
|
4075
|
+
})}>${item.text ? o$3(item.text) : ""}</sonic-toast-item>`
|
|
3791
4076
|
)}</div>`;
|
|
3792
4077
|
}
|
|
3793
4078
|
static removeAll() {
|
|
@@ -3909,24 +4194,41 @@ const Fetcher$1 = (superClass, propsType) => {
|
|
|
3909
4194
|
if (!this.api)
|
|
3910
4195
|
return;
|
|
3911
4196
|
this.dispatchEvent(new CustomEvent("loading", { detail: this }));
|
|
3912
|
-
this.
|
|
3913
|
-
|
|
4197
|
+
if (this.getAttribute("localStorage") === "enabled") {
|
|
4198
|
+
await PublisherManager.getInstance().isLocalStrorageReady;
|
|
4199
|
+
}
|
|
4200
|
+
if (!this.isConnected)
|
|
4201
|
+
return;
|
|
3914
4202
|
const hasLoader = this.isDefaultLoaderEnabled && !this.hasAttribute("noLoader");
|
|
3915
|
-
if (hasLoader)
|
|
4203
|
+
if (hasLoader) {
|
|
3916
4204
|
Loader.show();
|
|
4205
|
+
}
|
|
3917
4206
|
const headerData = PublisherManager.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();
|
|
4207
|
+
this.isLoading = true;
|
|
4208
|
+
if (Objects$1.isObject(this.props) && Object.keys(this.props || {}).length > 0 && this.isFirstLoad) {
|
|
4209
|
+
this.dispatchEvent(new CustomEvent("load", { detail: this }));
|
|
4210
|
+
this.isFirstLoad = false;
|
|
4211
|
+
this.isLoading = false;
|
|
4212
|
+
}
|
|
3918
4213
|
let data = await this.api.get(this.endPoint || this.dataProvider || "", headerData);
|
|
4214
|
+
if (!this.isConnected) {
|
|
4215
|
+
if (hasLoader)
|
|
4216
|
+
Loader.hide();
|
|
4217
|
+
return;
|
|
4218
|
+
}
|
|
3919
4219
|
if (!data) {
|
|
3920
4220
|
SonicToast$1.add({ text: "Network Error", status: "error" });
|
|
3921
4221
|
this.isLoading = false;
|
|
3922
|
-
if (hasLoader)
|
|
4222
|
+
if (hasLoader) {
|
|
3923
4223
|
Loader.hide();
|
|
4224
|
+
}
|
|
3924
4225
|
return;
|
|
3925
4226
|
} else if (data._sonic_http_response_ && !data._sonic_http_response_.ok && Object.keys(data).length === 1) {
|
|
3926
4227
|
SonicToast$1.add({ text: "Network Error", status: "error" });
|
|
3927
4228
|
}
|
|
3928
|
-
if (hasLoader)
|
|
4229
|
+
if (hasLoader) {
|
|
3929
4230
|
Loader.hide();
|
|
4231
|
+
}
|
|
3930
4232
|
if (this.key) {
|
|
3931
4233
|
const response = data._sonic_http_response_;
|
|
3932
4234
|
data = Objects$1.traverse(data, this.key.split("."), this.hasAttribute("preserveOtherKeys"));
|
|
@@ -3950,11 +4252,10 @@ const Fetcher$1 = (superClass, propsType) => {
|
|
|
3950
4252
|
}
|
|
3951
4253
|
connectedCallback() {
|
|
3952
4254
|
var _a2;
|
|
4255
|
+
super.connectedCallback();
|
|
3953
4256
|
if (!this.isFetchEnabled) {
|
|
3954
|
-
super.connectedCallback();
|
|
3955
4257
|
return;
|
|
3956
4258
|
}
|
|
3957
|
-
super.connectedCallback();
|
|
3958
4259
|
this.key = this.getAttribute("key");
|
|
3959
4260
|
if (this.props) {
|
|
3960
4261
|
this.publisher.set(this.props);
|
|
@@ -3964,16 +4265,24 @@ const Fetcher$1 = (superClass, propsType) => {
|
|
|
3964
4265
|
const lazyLoad = this.getAttribute("lazyload");
|
|
3965
4266
|
if (lazyLoad === null) {
|
|
3966
4267
|
this._fetchData();
|
|
4268
|
+
} else {
|
|
4269
|
+
this.handleLazyLoad();
|
|
3967
4270
|
}
|
|
3968
4271
|
}
|
|
3969
|
-
|
|
4272
|
+
handleLazyLoad() {
|
|
3970
4273
|
const lazyLoad = this.getAttribute("lazyload");
|
|
3971
4274
|
if (lazyLoad === null) {
|
|
3972
4275
|
return;
|
|
3973
4276
|
}
|
|
4277
|
+
const rect = this.getBoundingClientRect();
|
|
4278
|
+
if (rect.x < window.innerWidth && rect.right > 0 && rect.y < window.innerHeight && rect.right > 0) {
|
|
4279
|
+
this._fetchData();
|
|
4280
|
+
return;
|
|
4281
|
+
}
|
|
4282
|
+
const boundsRatio = parseFloat(this.getAttribute("lazyBoundsRatio") || "1");
|
|
3974
4283
|
const options = {
|
|
3975
4284
|
root: null,
|
|
3976
|
-
rootMargin: Math.max(window.innerWidth, window.innerHeight) + "px"
|
|
4285
|
+
rootMargin: Math.max(window.innerWidth * boundsRatio, window.innerHeight * boundsRatio) + "px"
|
|
3977
4286
|
};
|
|
3978
4287
|
this.iObserver = new IntersectionObserver((entries) => this.onIntersection(entries), options);
|
|
3979
4288
|
let elt = this.shadowRoot ? this.shadowRoot.children[0] : this.children[0];
|
|
@@ -3990,9 +4299,12 @@ const Fetcher$1 = (superClass, propsType) => {
|
|
|
3990
4299
|
}
|
|
3991
4300
|
}
|
|
3992
4301
|
onIntersection(entries) {
|
|
4302
|
+
var _a2;
|
|
3993
4303
|
for (const e2 of entries) {
|
|
3994
4304
|
if (e2.isIntersecting && this.isFirstLoad) {
|
|
3995
4305
|
this._fetchData();
|
|
4306
|
+
(_a2 = this.iObserver) == null ? void 0 : _a2.disconnect();
|
|
4307
|
+
break;
|
|
3996
4308
|
}
|
|
3997
4309
|
}
|
|
3998
4310
|
}
|
|
@@ -4069,7 +4381,7 @@ SonicIF = __decorateClass$Y([
|
|
|
4069
4381
|
* Copyright 2020 Google LLC
|
|
4070
4382
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4071
4383
|
*/
|
|
4072
|
-
const o$
|
|
4384
|
+
const o$2 = e$2(class extends i$2 {
|
|
4073
4385
|
constructor(t$12) {
|
|
4074
4386
|
if (super(t$12), t$12.type !== t.CHILD)
|
|
4075
4387
|
throw Error("templateContent can only be used in child bindings");
|
|
@@ -4140,8 +4452,11 @@ let List = class extends Fetcher$1(Subscriber$1(TemplatesContainer$1(s$3))) {
|
|
|
4140
4452
|
this.isLoading = true;
|
|
4141
4453
|
super.connectedCallback();
|
|
4142
4454
|
}
|
|
4455
|
+
disconnectedCallback() {
|
|
4456
|
+
super.disconnectedCallback();
|
|
4457
|
+
}
|
|
4143
4458
|
renderLoadingState() {
|
|
4144
|
-
return this.templateParts["skeleton"] ? o$
|
|
4459
|
+
return this.templateParts["skeleton"] ? o$2(this.templateParts["skeleton"]) : y`<sonic-loader mode="inline"></sonic-loader>`;
|
|
4145
4460
|
}
|
|
4146
4461
|
renderNoResultState() {
|
|
4147
4462
|
return y`<div style="color:var(--sc-base-400);font-size:1.5em;margin:4rem 0;display:flex;gap:.5rem"><sonic-icon name="emoji-puzzled" size="lg"></sonic-icon><span class="sonic-no-result-text">${typeof this.props === "string" && this.props == "" ? "Aucun r\xE9sultat" : this.props}</span></div>`;
|
|
@@ -4157,7 +4472,7 @@ let List = class extends Fetcher$1(Subscriber$1(TemplatesContainer$1(s$3))) {
|
|
|
4157
4472
|
if (extractValues) {
|
|
4158
4473
|
props = Object.entries(props).map(([k2, v2]) => ({ key: k2, value: v2 }));
|
|
4159
4474
|
} else {
|
|
4160
|
-
if (!response || response.ok)
|
|
4475
|
+
if (Objects$1.isObject(props) && Object.keys(props).length > 0 && (!response || response.ok))
|
|
4161
4476
|
props = [props];
|
|
4162
4477
|
else {
|
|
4163
4478
|
props = [];
|
|
@@ -4181,7 +4496,7 @@ let List = class extends Fetcher$1(Subscriber$1(TemplatesContainer$1(s$3))) {
|
|
|
4181
4496
|
return y`<div></div>`;
|
|
4182
4497
|
const props = this.formatProps();
|
|
4183
4498
|
if (((props == null ? void 0 : props.length) || 0) == 0 && this.templateParts["no-item"]) {
|
|
4184
|
-
return o$
|
|
4499
|
+
return o$2(this.templateParts["no-item"]);
|
|
4185
4500
|
}
|
|
4186
4501
|
const templateCount = this.templateList.length;
|
|
4187
4502
|
let counter = -1;
|
|
@@ -4191,14 +4506,16 @@ let List = class extends Fetcher$1(Subscriber$1(TemplatesContainer$1(s$3))) {
|
|
|
4191
4506
|
return y`${props == null ? void 0 : props.map((item, index) => {
|
|
4192
4507
|
if (item == null)
|
|
4193
4508
|
return b$1;
|
|
4194
|
-
if (typeof item != "object" || Array.isArray(item))
|
|
4195
|
-
return b$1;
|
|
4196
|
-
const templatePartName = item[this.templateKey];
|
|
4197
4509
|
let templatePart = null;
|
|
4198
|
-
|
|
4199
|
-
|
|
4510
|
+
let key = index;
|
|
4511
|
+
if (typeof item == "object" && !Array.isArray(item)) {
|
|
4512
|
+
const templatePartName = item[this.templateKey];
|
|
4513
|
+
if (templatePartName && typeof templatePartName == "string") {
|
|
4514
|
+
templatePart = this.templateParts[templatePartName];
|
|
4515
|
+
}
|
|
4516
|
+
if (extractValues)
|
|
4517
|
+
key = item == null ? void 0 : item["key"];
|
|
4200
4518
|
}
|
|
4201
|
-
const key = extractValues ? item == null ? void 0 : item[this.idKey] : index;
|
|
4202
4519
|
if (key == "_sonic_http_response_")
|
|
4203
4520
|
return b$1;
|
|
4204
4521
|
if (typeof key != "string" && typeof key != "number")
|
|
@@ -4211,7 +4528,7 @@ let List = class extends Fetcher$1(Subscriber$1(TemplatesContainer$1(s$3))) {
|
|
|
4211
4528
|
counter = -1;
|
|
4212
4529
|
return item && y`<sonic-subscriber ?debug="${this.defferedDebug === true}" .bindPublisher="${function() {
|
|
4213
4530
|
return pub;
|
|
4214
|
-
}}" .propertyMap?="${this.itemPropertyMap}" dataProvider="${this.dataProvider}/list-item/${key}">${templatePart ? o$
|
|
4531
|
+
}}" .propertyMap?="${this.itemPropertyMap}" dataProvider="${this.dataProvider}/list-item/${key}">${templatePart ? o$2(templatePart) : o$2(this.templateList[counter % templateCount])}</sonic-subscriber>${separator && isNotLast ? o$2(separator) : b$1}`;
|
|
4215
4532
|
})}`;
|
|
4216
4533
|
}
|
|
4217
4534
|
};
|
|
@@ -4227,6 +4544,18 @@ __decorateClass$W([
|
|
|
4227
4544
|
List = __decorateClass$W([
|
|
4228
4545
|
e$8(tagName$S)
|
|
4229
4546
|
], List);
|
|
4547
|
+
/**
|
|
4548
|
+
* @license
|
|
4549
|
+
* Copyright 2021 Google LLC
|
|
4550
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4551
|
+
*/
|
|
4552
|
+
function* o$1(o2, f2) {
|
|
4553
|
+
if (void 0 !== o2) {
|
|
4554
|
+
let i2 = 0;
|
|
4555
|
+
for (const t2 of o2)
|
|
4556
|
+
yield f2(t2, i2++);
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4230
4559
|
var __defProp$V = Object.defineProperty;
|
|
4231
4560
|
var __getOwnPropDesc$V = Object.getOwnPropertyDescriptor;
|
|
4232
4561
|
var __decorateClass$V = (decorators, target, key, kind) => {
|
|
@@ -4246,14 +4575,20 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4246
4575
|
this.lastRequestTime = 0;
|
|
4247
4576
|
this.key = "";
|
|
4248
4577
|
this.itemPropertyMap = null;
|
|
4578
|
+
this.cache = "default";
|
|
4249
4579
|
this.targetRequestDuration = 500;
|
|
4250
4580
|
this.limit = 5;
|
|
4581
|
+
this.lazyBoundsRatio = 1;
|
|
4251
4582
|
this.offset = 0;
|
|
4252
4583
|
this.resultCount = 0;
|
|
4584
|
+
this.noLazyload = false;
|
|
4253
4585
|
this.filteredFields = "";
|
|
4586
|
+
this.instanceId = 0;
|
|
4587
|
+
this.localStorage = "disabled";
|
|
4254
4588
|
this.filterPublisher = null;
|
|
4255
4589
|
this.searchHash = "";
|
|
4256
4590
|
this.requestId = 0;
|
|
4591
|
+
this.isFirstRequest = true;
|
|
4257
4592
|
this.dataProviderExpression = "";
|
|
4258
4593
|
this.idKey = "id";
|
|
4259
4594
|
this.currentScrollPosition = void 0;
|
|
@@ -4267,33 +4602,36 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4267
4602
|
super.disconnectedCallback();
|
|
4268
4603
|
return;
|
|
4269
4604
|
}
|
|
4270
|
-
connectedCallback() {
|
|
4605
|
+
async connectedCallback() {
|
|
4606
|
+
this.instanceId = Queue.instanceCounter++;
|
|
4607
|
+
this.localStorage = this.getAttribute("localStorage") || this.localStorage;
|
|
4608
|
+
this.removeAttribute("localStorage");
|
|
4271
4609
|
this.noShadowDom = "";
|
|
4272
4610
|
this.defferedDebug = this.hasAttribute("debug") || null;
|
|
4611
|
+
if (!this.dataProvider)
|
|
4612
|
+
this.dataProvider = this.dataProviderExpression || "sonic-queue-" + this.instanceId + "-" + Math.random().toString(36).substring(7);
|
|
4273
4613
|
if (!this.dataProviderExpression) {
|
|
4274
4614
|
this.dataProviderExpression = HTML.getAncestorAttributeValue(this.parentElement, "dataProvider") || "";
|
|
4275
4615
|
}
|
|
4276
|
-
if (!this.dataProvider)
|
|
4277
|
-
this.dataProvider = "sonic-queue-" + Queue.instanceCounter++;
|
|
4278
|
-
this.configFilter();
|
|
4279
4616
|
super.connectedCallback();
|
|
4280
4617
|
this.key = this.getAttribute("key");
|
|
4281
4618
|
if (!this.templates)
|
|
4282
|
-
this.templates = Array.from(
|
|
4619
|
+
this.templates = Array.from(
|
|
4620
|
+
this.querySelectorAll("template")
|
|
4621
|
+
);
|
|
4283
4622
|
this.lastRequestTime = new Date().getTime();
|
|
4284
|
-
|
|
4285
|
-
|
|
4623
|
+
await PublisherManager$1.getInstance().isLocalStrorageReady;
|
|
4624
|
+
this.configFilter();
|
|
4286
4625
|
}
|
|
4287
4626
|
configFilter() {
|
|
4288
4627
|
var _a2;
|
|
4289
4628
|
const dataFilterProvider = this.getAncestorAttributeValue("dataFilterProvider");
|
|
4290
|
-
if (!dataFilterProvider)
|
|
4629
|
+
if (!dataFilterProvider) {
|
|
4630
|
+
this.next();
|
|
4291
4631
|
return;
|
|
4632
|
+
}
|
|
4292
4633
|
this.filterPublisher = PublisherManager$1.getInstance().get(dataFilterProvider);
|
|
4293
4634
|
(_a2 = this.filterPublisher) == null ? void 0 : _a2.onInternalMutation(() => {
|
|
4294
|
-
var _a3;
|
|
4295
|
-
if (Object.keys((_a3 = this.filterPublisher) == null ? void 0 : _a3.get()).length == 0)
|
|
4296
|
-
return;
|
|
4297
4635
|
this.updateFilteredContent();
|
|
4298
4636
|
});
|
|
4299
4637
|
}
|
|
@@ -4302,10 +4640,10 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4302
4640
|
const dataProvider = this.dataProviderExpression;
|
|
4303
4641
|
const split = dataProvider.split("?");
|
|
4304
4642
|
split.shift();
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
for (
|
|
4643
|
+
const searchParams = new URLSearchParams(split.join("?"));
|
|
4644
|
+
const filterData = (_a2 = this.filterPublisher) == null ? void 0 : _a2.get();
|
|
4645
|
+
const filteredFieldsArray = this.filteredFields.split(" ");
|
|
4646
|
+
for (const f2 in filterData) {
|
|
4309
4647
|
let value = filterData[f2];
|
|
4310
4648
|
if (Array.isArray(value))
|
|
4311
4649
|
value = value.filter((v2) => v2 !== null);
|
|
@@ -4314,7 +4652,7 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4314
4652
|
searchParams.set(f2, filterData[f2].toString());
|
|
4315
4653
|
}
|
|
4316
4654
|
const searchHash = searchParams.toString();
|
|
4317
|
-
if (searchHash == this.searchHash)
|
|
4655
|
+
if (searchHash == this.searchHash && !this.isFirstRequest)
|
|
4318
4656
|
return;
|
|
4319
4657
|
this.searchHash = searchHash;
|
|
4320
4658
|
for (const dataProvider2 of this.listDataProviders) {
|
|
@@ -4322,28 +4660,34 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4322
4660
|
}
|
|
4323
4661
|
this.listDataProviders = [];
|
|
4324
4662
|
clearTimeout(this.filterTimeoutId);
|
|
4325
|
-
this.filterTimeoutId = setTimeout(
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4663
|
+
this.filterTimeoutId = setTimeout(
|
|
4664
|
+
async () => {
|
|
4665
|
+
const count = this.resultCount;
|
|
4666
|
+
this.props = null;
|
|
4667
|
+
this.requestId++;
|
|
4668
|
+
this.resultCount = count;
|
|
4669
|
+
await PublisherManager$1.getInstance().isLocalStrorageReady;
|
|
4670
|
+
window.requestAnimationFrame(() => this.next());
|
|
4671
|
+
},
|
|
4672
|
+
this.isFirstRequest ? 0 : 400
|
|
4673
|
+
);
|
|
4674
|
+
this.isFirstRequest = false;
|
|
4332
4675
|
}
|
|
4333
4676
|
resetDuration() {
|
|
4334
4677
|
this.lastRequestTime = new Date().getTime();
|
|
4335
4678
|
}
|
|
4336
4679
|
next(e2) {
|
|
4337
|
-
var _a2
|
|
4680
|
+
var _a2;
|
|
4338
4681
|
let offset = this.offset;
|
|
4339
4682
|
const newTime = new Date().getTime();
|
|
4340
4683
|
const requestDuration = newTime - this.lastRequestTime;
|
|
4341
4684
|
if (!this.nextHadEvent && e2) {
|
|
4685
|
+
this.publisher.resultCount = 0;
|
|
4342
4686
|
this.resultCount = 0;
|
|
4343
4687
|
}
|
|
4344
4688
|
this.nextHadEvent = !!e2;
|
|
4345
4689
|
if (e2) {
|
|
4346
|
-
if (e2.detail.requestId
|
|
4690
|
+
if (e2.detail.requestId < this.requestId)
|
|
4347
4691
|
return;
|
|
4348
4692
|
this.resultCount += e2.detail.props.length;
|
|
4349
4693
|
if (!e2.detail.isFirstLoad || !e2.detail.props.length || this.dataProviderExpression.indexOf("$offset") == -1) {
|
|
@@ -4360,8 +4704,10 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4360
4704
|
const item = props[props.length - 1];
|
|
4361
4705
|
offset = parseInt(item.offset.toString()) + parseInt(item.limit.toString());
|
|
4362
4706
|
}
|
|
4363
|
-
if (requestDuration > 0 && e2)
|
|
4364
|
-
this.limit = Math.round(
|
|
4707
|
+
if (requestDuration > 0 && e2 && !this.localStorage)
|
|
4708
|
+
this.limit = Math.round(
|
|
4709
|
+
this.limit / requestDuration * this.targetRequestDuration
|
|
4710
|
+
);
|
|
4365
4711
|
if (this.limit < 1)
|
|
4366
4712
|
this.limit = 1;
|
|
4367
4713
|
if (this.limit > 15)
|
|
@@ -4373,7 +4719,7 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4373
4719
|
const filterData = (_a2 = this.filterPublisher) == null ? void 0 : _a2.get();
|
|
4374
4720
|
const filteredFieldsArray = this.filteredFields.split(" ");
|
|
4375
4721
|
for (const f2 in filterData) {
|
|
4376
|
-
if (this.filteredFields &&
|
|
4722
|
+
if (this.filteredFields && filteredFieldsArray.includes(f2) || filterData[f2] == null || filterData[f2] == "")
|
|
4377
4723
|
continue;
|
|
4378
4724
|
searchParams.set(f2, filterData[f2]);
|
|
4379
4725
|
}
|
|
@@ -4381,12 +4727,12 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4381
4727
|
this.searchHash = searchParams.toString();
|
|
4382
4728
|
dataProvider = endpoint + "?" + searchParams.toString();
|
|
4383
4729
|
this.listDataProviders.push(dataProvider);
|
|
4384
|
-
this.currentScrollPosition = (_b = document.scrollingElement) == null ? void 0 : _b.scrollTop;
|
|
4385
4730
|
const newProps = [
|
|
4386
4731
|
...this.props,
|
|
4387
4732
|
{
|
|
4388
4733
|
id: searchParams.toString() + "/" + this.props.length,
|
|
4389
|
-
dataProvider,
|
|
4734
|
+
dataProvider: dataProvider + "_item_from_queue_" + this.instanceId,
|
|
4735
|
+
endPoint: dataProvider,
|
|
4390
4736
|
offset,
|
|
4391
4737
|
limit: this.limit
|
|
4392
4738
|
}
|
|
@@ -4396,24 +4742,19 @@ let Queue = class extends Subscriber$1(s$3) {
|
|
|
4396
4742
|
this.lastRequestTime = new Date().getTime();
|
|
4397
4743
|
}
|
|
4398
4744
|
render() {
|
|
4399
|
-
if (this.currentScrollPosition) {
|
|
4400
|
-
window.requestAnimationFrame(() => {
|
|
4401
|
-
if (document.scrollingElement && this.currentScrollPosition != void 0)
|
|
4402
|
-
document.scrollingElement.scrollTop = this.currentScrollPosition;
|
|
4403
|
-
this.currentScrollPosition = void 0;
|
|
4404
|
-
});
|
|
4405
|
-
}
|
|
4406
4745
|
if (!Array.isArray(this.props))
|
|
4407
4746
|
return b$1;
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4747
|
+
let lazyload = !this.noLazyload;
|
|
4748
|
+
if (this.props.length == 1) {
|
|
4749
|
+
lazyload = false;
|
|
4750
|
+
}
|
|
4751
|
+
return y`${o$1(this.props, (item, index) => {
|
|
4752
|
+
var _a2;
|
|
4753
|
+
const templates = index == 0 ? this.templates : (_a2 = this.templates) == null ? void 0 : _a2.filter(
|
|
4754
|
+
(elt) => elt.getAttribute("data-value") != "no-item"
|
|
4755
|
+
);
|
|
4756
|
+
return y`<sonic-list fetch cache="${this.cache}" displayContents lazyBoundsRatio="${this.lazyBoundsRatio}" ?lazyload="${lazyload}" localStorage="${this.localStorage}" requestId="${this.requestId}" .itemPropertyMap="${this.itemPropertyMap}" ?debug="${this.defferedDebug === true}" @load="${this.next}" key="${this.key}" @loading="${this.resetDuration}" dataProvider="${item.dataProvider}" endPoint="${item.endPoint}" idKey="${this.idKey}" .templates="${templates}"></sonic-list>`;
|
|
4757
|
+
})}`;
|
|
4417
4758
|
}
|
|
4418
4759
|
};
|
|
4419
4760
|
Queue.instanceCounter = 0;
|
|
@@ -4423,18 +4764,27 @@ __decorateClass$V([
|
|
|
4423
4764
|
__decorateClass$V([
|
|
4424
4765
|
e$7({ type: Object })
|
|
4425
4766
|
], Queue.prototype, "itemPropertyMap", 2);
|
|
4767
|
+
__decorateClass$V([
|
|
4768
|
+
e$7()
|
|
4769
|
+
], Queue.prototype, "cache", 2);
|
|
4426
4770
|
__decorateClass$V([
|
|
4427
4771
|
e$7()
|
|
4428
4772
|
], Queue.prototype, "targetRequestDuration", 2);
|
|
4429
4773
|
__decorateClass$V([
|
|
4430
4774
|
e$7()
|
|
4431
4775
|
], Queue.prototype, "limit", 2);
|
|
4776
|
+
__decorateClass$V([
|
|
4777
|
+
e$7()
|
|
4778
|
+
], Queue.prototype, "lazyBoundsRatio", 2);
|
|
4432
4779
|
__decorateClass$V([
|
|
4433
4780
|
e$7()
|
|
4434
4781
|
], Queue.prototype, "offset", 2);
|
|
4435
4782
|
__decorateClass$V([
|
|
4436
4783
|
e$7()
|
|
4437
4784
|
], Queue.prototype, "resultCount", 2);
|
|
4785
|
+
__decorateClass$V([
|
|
4786
|
+
e$7({ type: Boolean })
|
|
4787
|
+
], Queue.prototype, "noLazyload", 2);
|
|
4438
4788
|
__decorateClass$V([
|
|
4439
4789
|
e$7()
|
|
4440
4790
|
], Queue.prototype, "filteredFields", 2);
|
|
@@ -5114,12 +5464,19 @@ let SonicRouter = class extends Subscriber$1(TemplatesContainer$1(s$3)) {
|
|
|
5114
5464
|
for (const t2 of this.templatePartsList) {
|
|
5115
5465
|
const path = t2.getAttribute(this.templateValueAttribute) || "";
|
|
5116
5466
|
const regexp = new RegExp(path);
|
|
5117
|
-
const urlPattern2 = new UrlPattern(path);
|
|
5118
5467
|
if (regexp.test(this.location)) {
|
|
5119
5468
|
templates.push(t2);
|
|
5120
|
-
} else
|
|
5121
|
-
|
|
5122
|
-
|
|
5469
|
+
} else {
|
|
5470
|
+
try {
|
|
5471
|
+
if (new UrlPattern(path).match(this.location)) {
|
|
5472
|
+
t2.setAttribute("mode", "patternMatching");
|
|
5473
|
+
templates.push(t2);
|
|
5474
|
+
}
|
|
5475
|
+
} catch (e2) {
|
|
5476
|
+
if (this.location.indexOf(path.replace(document.location.origin, "")) != -1) {
|
|
5477
|
+
templates.push(t2);
|
|
5478
|
+
}
|
|
5479
|
+
}
|
|
5123
5480
|
}
|
|
5124
5481
|
}
|
|
5125
5482
|
return y`${c$1(
|
|
@@ -5145,9 +5502,9 @@ let SonicRouter = class extends Subscriber$1(TemplatesContainer$1(s$3)) {
|
|
|
5145
5502
|
dataProvider = ((_a2 = match.shift()) == null ? void 0 : _a2.replace(regexp, dataProviderExpression)) || "";
|
|
5146
5503
|
}
|
|
5147
5504
|
}
|
|
5148
|
-
return y`<div style="display:contents" dataProvider="${dataProvider}">${o$
|
|
5505
|
+
return y`<div style="display:contents" dataProvider="${dataProvider}">${o$2(template)}</div>`;
|
|
5149
5506
|
}
|
|
5150
|
-
return o$
|
|
5507
|
+
return o$2(template);
|
|
5151
5508
|
}
|
|
5152
5509
|
)}`;
|
|
5153
5510
|
}
|
|
@@ -5225,6 +5582,7 @@ let SonicStates = class extends Subscriber$1(TemplatesContainer$1(s$3)) {
|
|
|
5225
5582
|
};
|
|
5226
5583
|
}
|
|
5227
5584
|
connectedCallback() {
|
|
5585
|
+
this.noShadowDom = "";
|
|
5228
5586
|
super.connectedCallback();
|
|
5229
5587
|
if (this.hasAttribute("data-path")) {
|
|
5230
5588
|
this.statePath = this.getAttribute("data-path");
|
|
@@ -5302,9 +5660,9 @@ let SonicStates = class extends Subscriber$1(TemplatesContainer$1(s$3)) {
|
|
|
5302
5660
|
dataProvider = (_a2 = match.shift()) == null ? void 0 : _a2.replace(regexp, dataProviderExpression);
|
|
5303
5661
|
}
|
|
5304
5662
|
}
|
|
5305
|
-
return y`<div style="display:contents" dataProvider="${dataProvider}">${o$
|
|
5663
|
+
return y`<div style="display:contents" dataProvider="${dataProvider}">${o$2(template)}</div>`;
|
|
5306
5664
|
}
|
|
5307
|
-
return o$
|
|
5665
|
+
return o$2(template);
|
|
5308
5666
|
}
|
|
5309
5667
|
)}`;
|
|
5310
5668
|
}
|
|
@@ -6072,16 +6430,20 @@ let SonicValue = class extends Subscriber(s$3) {
|
|
|
6072
6430
|
super.connectedCallback();
|
|
6073
6431
|
}
|
|
6074
6432
|
render() {
|
|
6075
|
-
if (typeof this.props
|
|
6433
|
+
if (typeof this.props === "object" || this.props === void 0)
|
|
6076
6434
|
return y`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`;
|
|
6077
|
-
return y`${o$
|
|
6435
|
+
return y`${o$3(this.props.toString())}<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`;
|
|
6078
6436
|
}
|
|
6079
6437
|
};
|
|
6080
6438
|
SonicValue = __decorateClass$L([
|
|
6081
6439
|
e$8(tagName$J)
|
|
6082
6440
|
], SonicValue);
|
|
6083
|
-
const coreVariables = i$4`:host{--sc-font-family-base:"Inter var","Inter",-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--sc-font-weight-base:400;--sc-font-style-base:normal;--sc-headings-font-family:var(--sc-font-family-base);--sc-headings-font-style:var(--sc-font-style-base);--sc-headings-line-height:1.1;--sc-headings-font-weight:700;--sc-headings-text-transform:none;--sc-btn-font-weight:var(--sc-font-weight-base);--sc-btn-font-family:var(--sc-font-family-base);--sc-btn-font-style:var(--sc-font-style-base);--sc-rounded-sm:calc(var(--sc-rounded) * 0.5);--sc-rounded:0.375rem;--sc-rounded-md:calc(var(--sc-rounded) * 1.8);--sc-rounded-lg:calc(var(--sc-rounded) * 3);--sc-rounded-xl:calc(var(--sc-rounded) * 7);--sc-rounded-size-intensity:calc((1em - 1rem) * 0.4);--sc-btn-rounded-intensity:1.4;--sc-btn-font-weight:500;--sc-btn-rounded:calc(
|
|
6084
|
-
(var(--sc-rounded) + var(--sc-rounded-size-intensity)) *
|
|
6441
|
+
const coreVariables = i$4`:host{--sc-font-family-base:"Inter var","Inter",-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;--sc-font-weight-base:400;--sc-font-style-base:normal;--sc-headings-font-family:var(--sc-font-family-base),sans-serif;--sc-headings-font-style:var(--sc-font-style-base);--sc-headings-line-height:1.1;--sc-headings-font-weight:700;--sc-headings-text-transform:none;--sc-btn-font-weight:var(--sc-font-weight-base);--sc-btn-font-family:var(--sc-font-family-base);--sc-btn-font-style:var(--sc-font-style-base);--sc-rounded-sm:calc(var(--sc-rounded) * 0.5);--sc-rounded:0.375rem;--sc-rounded-md:calc(var(--sc-rounded) * 1.8);--sc-rounded-lg:calc(var(--sc-rounded) * 3);--sc-rounded-xl:calc(var(--sc-rounded) * 7);--sc-rounded-size-intensity:calc((1em - 1rem) * 0.4);--sc-btn-rounded-intensity:1.4;--sc-btn-font-weight:500;--sc-btn-rounded:calc(
|
|
6442
|
+
(var(--sc-rounded) + var(--sc-rounded-size-intensity)) *
|
|
6443
|
+
var(--sc-btn-rounded-intensity)
|
|
6444
|
+
);--sc-placeholder-bg:rgba(17, 24, 39, 0.05);--sc-shadow-sm:0 1px 3px 0 rgb(0 0 0 / 0.1),0 1px 2px -1px rgb(0 0 0 / 0.1);--sc-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1),0 2px 4px -2px rgb(0 0 0 / 0.1);--sc-shadow-lg:0 10px 15px 0px rgb(0 0 0 / 0.1),0 4px 6px -4px rgb(0 0 0 / 0.1);--sc-shadow-xl:0 20px 25px -5px rgb(0 0 0 / 0.1),0 8px 10px -6px rgb(0 0 0 / 0.1);--sc-shadow-2xl:0 25px 50px -12px rgb(0 0 0 / 0.25);--sc-border-width:max(1px, 0.12rem);--sc-border-color:var(--sc-base-200);--sc-form-height:2.5em;--sc-form-border-width:var(--sc-border-width);--sc-input-bg:var(--sc-base-100);--sc-input-border-color:var(--sc-input-bg);--sc-input-rounded-intensity:1.4;--sc-input-rounded:calc(
|
|
6445
|
+
(var(--sc-rounded) + var(--sc-rounded-size-intensity)) *
|
|
6446
|
+
var(--sc-input-rounded-intensity)
|
|
6085
6447
|
);--sc-label-font-weight:500;--sc-contrast-content:#fff;--sc-contrast:#11151f;--sc-scrollbar-bg:var(--sc-base-400);--sc-body-bg:var(--sc-base)}`;
|
|
6086
6448
|
const light = i$4`:host{--sc-primary:var(--sc-base-800);--sc-info:#2563eb;--sc-danger:#f43f5e;--sc-warning:#f97316;--sc-success:#14b8a6;--sc-primary-content:var(--sc-base);--sc-info-content:var(--sc-base);--sc-danger-content:var(--sc-base);--sc-warning-content:var(--sc-base);--sc-success-content:var(--sc-base);--sc-base:#fff;--sc-base-50:#f8fafc;--sc-base-100:#f1f5f9;--sc-base-200:#e2e8f0;--sc-base-300:#cbd5e1;--sc-base-400:#94a3b8;--sc-base-500:#64748b;--sc-base-600:#475569;--sc-base-700:#334155;--sc-base-800:#1e293b;--sc-base-900:#0f172a;--sc-base-content:var(--sc-base-700);--sc-input-bg:var(--sc-base-100);--sc-input-color:var(--sc-base-content)}`;
|
|
6087
6449
|
const darkCss = i$4``;
|
|
@@ -6142,7 +6504,11 @@ let Theme = class extends s$3 {
|
|
|
6142
6504
|
}
|
|
6143
6505
|
getCssVariables() {
|
|
6144
6506
|
const names = [];
|
|
6145
|
-
const stylesheets = [
|
|
6507
|
+
const stylesheets = [
|
|
6508
|
+
...Theme.styles.map((s2) => s2.styleSheet),
|
|
6509
|
+
...Array.from(document.styleSheets)
|
|
6510
|
+
];
|
|
6511
|
+
console.log(stylesheets);
|
|
6146
6512
|
for (const stylesheet of stylesheets) {
|
|
6147
6513
|
try {
|
|
6148
6514
|
if (!stylesheet)
|
|
@@ -6175,7 +6541,7 @@ Theme.styles = [
|
|
|
6175
6541
|
light,
|
|
6176
6542
|
dark,
|
|
6177
6543
|
coreVariables,
|
|
6178
|
-
i$4`:host([background]){display:block!important;background:var(--sc-body-bg)!important;min-height:100vh}:host([color]){color:var(--sc-base-content)}:host([font]){font-family:var(--sc-font-family-base);font-weight:var(--sc-font-weight-base);font-style:var(--sc-font-style-base)}`
|
|
6544
|
+
i$4`:host([background]){display:block!important;background:var(--sc-body-bg)!important;min-height:100vh}:host([color]){color:var(--sc-base-content)}:host([font]){font-family:var(--sc-font-family-base),sans-serif;font-weight:var(--sc-font-weight-base);font-style:var(--sc-font-style-base)}`
|
|
6179
6545
|
];
|
|
6180
6546
|
__decorateClass$K([
|
|
6181
6547
|
e$7({ type: String, reflect: true })
|
|
@@ -6217,7 +6583,7 @@ let Badge = class extends s$3 {
|
|
|
6217
6583
|
};
|
|
6218
6584
|
Badge.styles = [
|
|
6219
6585
|
fontSize,
|
|
6220
|
-
i$4`:host{--sc-badge-gap:0.3em;--sc-badge-py:0.17em;--sc-badge-px:0.66em;--sc-fs:1rem;--sc-badge-color:var(--sc-base-content, #1f2937);--sc-badge-bg:var(--sc-base-200, #e5e7eb);--sc-badge-border-with:var(--sc-form-border-width, 0.1rem);--sc-badge-border-color:transparent;--sc-badge-border:var(--sc-badge-border-with) solid var(--sc-badge-border-color);--sc-badge-rounded:
|
|
6586
|
+
i$4`:host{--sc-badge-gap:0.3em;--sc-badge-py:0.17em;--sc-badge-px:0.66em;--sc-fs:1rem;--sc-badge-color:var(--sc-base-content, #1f2937);--sc-badge-bg:var(--sc-base-200, #e5e7eb);--sc-badge-border-with:var(--sc-form-border-width, 0.1rem);--sc-badge-border-color:transparent;--sc-badge-border:var(--sc-badge-border-with) solid var(--sc-badge-border-color);--sc-badge-rounded:0.85em;--sc-badge-fw:var(--sc-font-weight-base);display:inline-flex;align-items:center;box-sizing:border-box;line-height:var(--sc-lh);border-radius:var(--sc-badge-rounded);background:var(--sc-badge-bg);color:var(--sc-badge-color);font-family:var(--sc-badge-ff,var(--sc-font-family-base,inherit));font-weight:var(--sc-badge-fw);padding-top:var(--sc-badge-py);padding-bottom:var(--sc-badge-py);padding-left:var(--sc-badge-px);padding-right:var(--sc-badge-px);min-height:calc(var(--sc-badge-px) * 2);border:var(--sc-badge-border);-webkit-print-color-adjust:exact}:host([type=primary]){--sc-badge-color:var(--sc-primary-content);--sc-badge-bg:var(--sc-primary)}:host([type=warning]){--sc-badge-color:var(--sc-warning-content);--sc-badge-bg:var(--sc-warning)}:host([type=danger]){--sc-badge-color:var(--sc-danger-content);--sc-badge-bg:var(--sc-danger)}:host([type=info]){--sc-badge-color:var(--sc-info-content);--sc-badge-bg:var(--sc-info)}:host([type=success]){--sc-badge-color:var(--sc-success-content);--sc-badge-bg:var(--sc-success)}:host([type=neutral]){--sc-badge-color:var(--sc-base);--sc-badge-bg:var(--sc-base-content)}:host{font-size:var(--sc-fs);gap:var(--sc-badge-gap)}:host([size="2xs"]){--sc-badge-gap:0.35em}:host([size=xs]){--sc-badge-gap:0.35em}:host([size=sm]){--sc-badge-gap:0.35em}:host([size=lg]){--sc-lh:1.2;--sc-badge-gap:0.5em}:host([size=xl]){--sc-lh:1.2;--sc-badge-gap:0.5em}:host([contrast]){--sc-badge-color:var(--sc-contrast-content);--sc-badge-bg:var(--sc-contrast)}:host([variant=outline][type]){border-width:var(--sc-badge-border-with)!important;border-color:var(--sc-badge-bg);color:var(--sc-badge-bg);background:0 0}:host([variant=outline][type=default]){border-color:var(--sc-base-400);color:var(--sc-base-500);background:0 0}:host([variant=ghost][type]){color:var(--sc-badge-bg);background:0 0;padding:0}:host([variant=ghost][type=default]){color:var(--sc-badge-color);background:0 0}:host([ellipsis]){flex-wrap:nowrap;white-space:nowrap;max-width:100%}:host([ellipsis]) slot{overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;max-width:100%}slot[name=prefix],slot[name=suffix]{flex-shrink:0}`
|
|
6221
6587
|
];
|
|
6222
6588
|
__decorateClass$J([
|
|
6223
6589
|
e$7({ type: String, reflect: true })
|
|
@@ -6366,9 +6732,10 @@ __decorateClass$H([
|
|
|
6366
6732
|
Progress = __decorateClass$H([
|
|
6367
6733
|
e$8(tagName$F)
|
|
6368
6734
|
], Progress);
|
|
6735
|
+
const passwordToggle = i$4`.password-toggle{color:var(--sc-input-c);font-size:var(--sc-input-fs);cursor:pointer;margin-right:calc(-.5 * var(--sc-input-px))}:host([inlineContent]) .has-suffix .password-toggle{margin-right:0}`;
|
|
6369
6736
|
const label = i$4`:host{--sc-label-fs:var(--sc-fs, 1rem);--sc-label-fw:var(--sc-label-font-weight)}label{font-size:var(--sc-label-fs);font-weight:var(--sc-label-fw);line-height:1.2}.form-label{margin-bottom:.22em;display:block}`;
|
|
6370
6737
|
const description = i$4`.form-description{color:var(--sc-base-400);font-size:.85em;margin-top:.2em;display:block}`;
|
|
6371
|
-
const formControl = i$4`*{box-sizing:border-box}:host{--sc-input-height:var(--sc-form-height);--sc-input-c:var(--sc-input-color, var(--sc-base-content));--sc-input-b-width:var(--sc-form-border-width);--sc-input-b-color:var(--sc-input-border-color);--sc-item-rounded-tr:var(--sc-input-rounded);--sc-item-rounded-tl:var(--sc-input-rounded);--sc-item-rounded-bl:var(--sc-input-rounded);--sc-item-rounded-br:var(--sc-input-rounded);--sc-input-fs:var(--sc-fs, 1rem);--sc-input-ff:inherit;--sc-input-py:0.55em;--sc-input-px:clamp(0.3em, 8%, 1.1em);--sc-input-background:var(--sc-input-bg);--sc-input-addon-c:var(--sc-input-addon-color, var(--sc-base));--sc-input-addon-bg:var(--sc-input-c)}.form-element{display:block;flex-grow:1;width:100%;line-height:1.1;color:var(--sc-input-c);border-radius:var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);font-family:var(--sc-input-ff);background-color:var(--sc-input-background);border:var(--sc-input-b-width) solid var(--sc-input-b-color,var(--sc-base-300,#aaa));width:100%;font-size:var(--sc-input-fs);padding-top:var(--sc-input-py);padding-bottom:var(--sc-input-py);padding-left:var(--sc-input-px);padding-right:var(--sc-input-px);min-height:var(--sc-input-height)}.form-control{display:flex;width:100%}:host(:not([inlineContent])) .has-prefix slot[name=prefix],:host(:not([inlineContent])) .has-suffix slot[name=suffix]{min-width:var(--sc-input-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;line-height:1.1;flex-shrink:0;padding-left:clamp(.25em,3%,calc(.33 * var(--sc-input-px)));padding-right:clamp(.25em,3%,calc(.33 * var(--sc-input-px)))}:host(:not([inlineContent])) slot[name=prefix]{border-radius:var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl);background-color:var(--sc-input-addon-bg);color:var(--sc-input-addon-c)}:host(:not([inlineContent])) slot[name=suffix]{border-radius:0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0;background-color:var(--sc-input-addon-bg);color:var(--sc-input-addon-c)}:host(:not([inlineContent])) .has-prefix .form-element{border-top-left-radius:0;border-bottom-left-radius:0}:host(:not([inlineContent])) .has-suffix .form-element{border-top-right-radius:0;border-bottom-right-radius:0}slot[name=prefix]::slotted(sonic-icon),slot[name=suffix]::slotted(sonic-icon){font-size:1.2em}.form-element .form-element,.form-element>slot{all:unset}:host([inlineContent]) .form-element{display:flex;align-items:center;gap:.35em;min-height:var(--sc-form-height)}:host([inlineContent]) .form-element .form-element{appearance:none;background:0 0;border:none;padding:0;display:block;width:50%;min-width:0;flex:1 1 auto;height:auto;min-height:auto;border-radius:0}:host([inlineContent]) slot[name=prefix]::slotted(*),:host([inlineContent]) slot[name=suffix]::slotted(*){display:block;flex:0 0 auto;max-width:100%;max-width:100%}:host([inlineContent]) .has-suffix slot[name=suffix]{margin-right:calc(-.5 * var(--sc-input-px))}:host([inlineContent]) .has-prefix slot[name=prefix]{margin-left:calc(-.5 * var(--sc-input-px))}:host([inlineContent]) slot[name=suffix]::slotted(*){margin-left:auto}:host([disabled]) .form-control{cursor:not-allowed}:host([variant=ghost]) .form-element{--sc-input-bg:transparent}:host([disabled]) .form-element{pointer-events:none;opacity:.5}:host([disabled]) .select-chevron{display:none}::placeholder{color:inherit;opacity:.45}:host([placehoderAsLabel]) ::placeholder{opacity:1}:focus::placeholder{opacity:0!important}.form-element:focus,.form-element:focus-visible,:host(:not([disabled])) .form-element:hover{filter:brightness(.97);outline:0}.form-label{margin-bottom:.22em;display:block}.form-description{color:var(--sc-base-400);font-size:.85em;margin-top:.2em;display:block}.hidden{display:none}.contents{display:contents}:host([error]){--sc-input-b-color:var(--sc-danger)}:host input:visited{display:none}:host([touched][required]) :not(:focus):invalid{--sc-input-b-color:var(--sc-danger);--sc-input-c:var(--sc-danger)}:host([touched][required]) :not(:focus):invalid+.select-chevron{--sc-input-c:var(--sc-danger)}:host([touched][required]) :not([value=""]):not(:focus):valid{--sc-input-b-color:var(--sc-success);--sc-input-c:var(--sc-success)}:host([touched][required]) :not(:focus):valid+.select-chevron{--sc-input-c:var(--sc-success)}:host([type=color]) .form-element{padding:0;border:0;min-width:var(--sc-input-height)}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:none;border-radius:var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl)}:host([type=image]) .form-element{padding:0;border:none}input[type=reset],input[type=submit]{cursor:pointer}:host([type=search]){appearance:none!important}input[type=search]::-webkit-search-cancel-button{appearance:none;cursor:pointer;height:.65em;width:.65em;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjEyMy4wNXB4IiBoZWlnaHQ9IjEyMy4wNXB4IiB2aWV3Qm94PSIwIDAgMTIzLjA1IDEyMy4wNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTIzLjA1IDEyMy4wNTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTEyMS4zMjUsMTAuOTI1bC04LjUtOC4zOTljLTIuMy0yLjMtNi4xLTIuMy04LjUsMGwtNDIuNCw0Mi4zOTlMMTguNzI2LDEuNzI2Yy0yLjMwMS0yLjMwMS02LjEwMS0yLjMwMS04LjUsMGwtOC41LDguNQ0KCQljLTIuMzAxLDIuMy0yLjMwMSw2LjEsMCw4LjVsNDMuMSw0My4xbC00Mi4zLDQyLjVjLTIuMywyLjMtMi4zLDYuMSwwLDguNWw4LjUsOC41YzIuMywyLjMsNi4xLDIuMyw4LjUsMGw0Mi4zOTktNDIuNGw0Mi40LDQyLjQNCgkJYzIuMywyLjMsNi4xLDIuMyw4LjUsMGw4LjUtOC41YzIuMy0yLjMsMi4zLTYuMSwwLTguNWwtNDIuNS00Mi40bDQyLjQtNDIuMzk5QzEyMy42MjUsMTcuMTI1LDEyMy42MjUsMTMuMzI1LDEyMS4zMjUsMTAuOTI1eiIvPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=);background-size:contain;background-repeat:no-repeat}:host([align=center]) .form-element{text-align:center}:host([align=left]) .form-element{text-align:left}:host([align=right]) .form-element{text-align:right}:host([noAppearance]) input[type=number]::-webkit-inner-spin-button,:host([noAppearance]) input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host([noAppearance]) input[type=number]{-moz-appearance:textfield!important}`;
|
|
6738
|
+
const formControl = i$4`*{box-sizing:border-box}:host{--sc-input-height:var(--sc-form-height);--sc-input-c:var(--sc-input-color, var(--sc-base-content));--sc-input-b-width:var(--sc-form-border-width);--sc-input-b-color:var(--sc-input-border-color);--sc-item-rounded-tr:var(--sc-input-rounded);--sc-item-rounded-tl:var(--sc-input-rounded);--sc-item-rounded-bl:var(--sc-input-rounded);--sc-item-rounded-br:var(--sc-input-rounded);--sc-input-fs:var(--sc-fs, 1rem);--sc-input-ff:inherit;--sc-input-py:0.55em;--sc-input-px:clamp(0.3em, 8%, 1.1em);--sc-input-background:var(--sc-input-bg);--sc-input-addon-c:var(--sc-input-addon-color, var(--sc-base));--sc-input-addon-bg:var(--sc-input-c)}.form-element{display:block;flex-grow:1;width:100%;line-height:1.1;color:var(--sc-input-c);border-radius:var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);font-family:var(--sc-input-ff);background-color:var(--sc-input-background);border:var(--sc-input-b-width) solid var(--sc-input-b-color,var(--sc-base-300,#aaa));width:100%;font-size:var(--sc-input-fs);padding-top:var(--sc-input-py);padding-bottom:var(--sc-input-py);padding-left:var(--sc-input-px);padding-right:var(--sc-input-px);min-height:var(--sc-input-height)}.form-control{display:flex;width:100%}:host(:not([inlineContent])) .has-prefix slot[name=prefix],:host(:not([inlineContent])) .has-suffix slot[name=suffix]{min-width:var(--sc-input-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;line-height:1.1;flex-shrink:0;padding-left:clamp(.25em,3%,calc(.33 * var(--sc-input-px)));padding-right:clamp(.25em,3%,calc(.33 * var(--sc-input-px)))}:host(:not([inlineContent])) slot[name=prefix]{border-radius:var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl);background-color:var(--sc-input-addon-bg);color:var(--sc-input-addon-c)}:host(:not([inlineContent])) slot[name=suffix]{border-radius:0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0;background-color:var(--sc-input-addon-bg);color:var(--sc-input-addon-c)}:host(:not([inlineContent])) .has-prefix .form-element{border-top-left-radius:0;border-bottom-left-radius:0}:host(:not([inlineContent])) .has-suffix .form-element{border-top-right-radius:0;border-bottom-right-radius:0}slot[name=prefix]::slotted(sonic-icon),slot[name=suffix]::slotted(sonic-icon){font-size:1.2em}.form-element .form-element,.form-element>slot{all:unset}:host([inlineContent]) .form-element{display:flex;align-items:center;gap:.35em;min-height:var(--sc-form-height)}:host([inlineContent]) .form-element .form-element{appearance:none;background:0 0;border:none;padding:0;display:block;width:50%;min-width:0;flex:1 1 auto;height:auto;min-height:auto;border-radius:0}:host([inlineContent]) slot[name=prefix]::slotted(*),:host([inlineContent]) slot[name=suffix]::slotted(*){display:block;flex:0 0 auto;max-width:100%;max-width:100%}:host([inlineContent]) .has-suffix slot[name=suffix]{margin-right:calc(-.5 * var(--sc-input-px))}:host([inlineContent]) .has-prefix slot[name=prefix]{margin-left:calc(-.5 * var(--sc-input-px))}:host([inlineContent]) slot[name=suffix]::slotted(*){margin-left:auto}:host([inlineContent]) .no-prefix slot[name=prefix],:host([inlineContent]) .no-suffix slot[name=suffix]{display:none}:host([disabled]) .form-control{cursor:not-allowed}:host([variant=ghost]) .form-element{--sc-input-bg:transparent}:host([disabled]) .form-element{pointer-events:none;opacity:.5}:host([disabled]) .select-chevron{display:none}::placeholder{color:inherit;opacity:.45}:host([placehoderAsLabel]) ::placeholder{opacity:1}:focus::placeholder{opacity:0!important}.form-element:focus,.form-element:focus-visible,:host(:not([disabled])) .form-element:hover{filter:brightness(.97);outline:0}.form-label{margin-bottom:.22em;display:block}.form-description{color:var(--sc-base-400);font-size:.85em;margin-top:.2em;display:block}.hidden{display:none}.contents{display:contents}:host([error]){--sc-input-b-color:var(--sc-danger)}:host input:visited{display:none}:host([touched][required]) :not(:focus):invalid{--sc-input-b-color:var(--sc-danger);--sc-input-c:var(--sc-danger)}:host([touched][required]) :not(:focus):invalid+.select-chevron{--sc-input-c:var(--sc-danger)}:host([touched][required]) :not([value=""]):not(:focus):valid{--sc-input-b-color:var(--sc-success);--sc-input-c:var(--sc-success)}:host([touched][required]) :not(:focus):valid+.select-chevron{--sc-input-c:var(--sc-success)}:host([type=color]) .form-element{padding:0;border:0;min-width:var(--sc-input-height)}input[type=color]::-webkit-color-swatch-wrapper{padding:0}input[type=color]::-webkit-color-swatch{border:none;border-radius:var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl)}:host([type=image]) .form-element{padding:0;border:none}input[type=reset],input[type=submit]{cursor:pointer}:host([type=search]){appearance:none!important}input[type=search]::-webkit-search-cancel-button{appearance:none;cursor:pointer;height:.65em;width:.65em;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjEyMy4wNXB4IiBoZWlnaHQ9IjEyMy4wNXB4IiB2aWV3Qm94PSIwIDAgMTIzLjA1IDEyMy4wNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTIzLjA1IDEyMy4wNTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTEyMS4zMjUsMTAuOTI1bC04LjUtOC4zOTljLTIuMy0yLjMtNi4xLTIuMy04LjUsMGwtNDIuNCw0Mi4zOTlMMTguNzI2LDEuNzI2Yy0yLjMwMS0yLjMwMS02LjEwMS0yLjMwMS04LjUsMGwtOC41LDguNQ0KCQljLTIuMzAxLDIuMy0yLjMwMSw2LjEsMCw4LjVsNDMuMSw0My4xbC00Mi4zLDQyLjVjLTIuMywyLjMtMi4zLDYuMSwwLDguNWw4LjUsOC41YzIuMywyLjMsNi4xLDIuMyw4LjUsMGw0Mi4zOTktNDIuNGw0Mi40LDQyLjQNCgkJYzIuMywyLjMsNi4xLDIuMyw4LjUsMGw4LjUtOC41YzIuMy0yLjMsMi4zLTYuMSwwLTguNWwtNDIuNS00Mi40bDQyLjQtNDIuMzk5QzEyMy42MjUsMTcuMTI1LDEyMy42MjUsMTMuMzI1LDEyMS4zMjUsMTAuOTI1eiIvPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=);background-size:contain;background-repeat:no-repeat}:host([align=center]) .form-element{text-align:center}:host([align=left]) .form-element{text-align:left}:host([align=right]) .form-element{text-align:right}:host([noAppearance]) input[type=number]::-webkit-inner-spin-button,:host([noAppearance]) input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host([noAppearance]) input[type=number]{-moz-appearance:textfield!important}`;
|
|
6372
6739
|
/**
|
|
6373
6740
|
* @license
|
|
6374
6741
|
* Copyright 2018 Google LLC
|
|
@@ -6420,10 +6787,12 @@ let Input = class extends Form(Form$2(Subscriber$1(s$3))) {
|
|
|
6420
6787
|
this.readonly = false;
|
|
6421
6788
|
this.inlineContent = false;
|
|
6422
6789
|
this.disableInlineContentFocus = false;
|
|
6790
|
+
this.showPasswordToggle = false;
|
|
6423
6791
|
this.hasDescription = false;
|
|
6424
6792
|
this.hasLabel = false;
|
|
6425
6793
|
this.hasSuffix = false;
|
|
6426
6794
|
this.hasPrefix = false;
|
|
6795
|
+
this.isPassword = false;
|
|
6427
6796
|
}
|
|
6428
6797
|
connectedCallback() {
|
|
6429
6798
|
super.connectedCallback();
|
|
@@ -6436,6 +6805,11 @@ let Input = class extends Form(Form$2(Subscriber$1(s$3))) {
|
|
|
6436
6805
|
return;
|
|
6437
6806
|
formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle);
|
|
6438
6807
|
}
|
|
6808
|
+
if (this.type == "password") {
|
|
6809
|
+
this.isPassword = true;
|
|
6810
|
+
this.showPasswordToggle = true;
|
|
6811
|
+
this.inlineContent = true;
|
|
6812
|
+
}
|
|
6439
6813
|
}
|
|
6440
6814
|
disconnectedCallback() {
|
|
6441
6815
|
super.disconnectedCallback();
|
|
@@ -6450,6 +6824,9 @@ let Input = class extends Form(Form$2(Subscriber$1(s$3))) {
|
|
|
6450
6824
|
this.hasSlotOrProps();
|
|
6451
6825
|
super.willUpdate(changedProperties);
|
|
6452
6826
|
}
|
|
6827
|
+
setSelectionRange(start, end) {
|
|
6828
|
+
this.input.setSelectionRange(start, end);
|
|
6829
|
+
}
|
|
6453
6830
|
hasSlotOrProps() {
|
|
6454
6831
|
var _a2, _b, _c, _d;
|
|
6455
6832
|
this.hasLabel = this.label || ((_a2 = this.slotLabelNodes) == null ? void 0 : _a2.length) ? true : false;
|
|
@@ -6470,14 +6847,26 @@ let Input = class extends Form(Form$2(Subscriber$1(s$3))) {
|
|
|
6470
6847
|
}
|
|
6471
6848
|
if (this.changeTimeoutId)
|
|
6472
6849
|
clearTimeout(this.changeTimeoutId);
|
|
6473
|
-
this.changeTimeoutId = setTimeout(
|
|
6850
|
+
this.changeTimeoutId = setTimeout(
|
|
6851
|
+
() => super.handleChange(e2),
|
|
6852
|
+
parseInt(this.getAttribute("inputDelayMs"))
|
|
6853
|
+
);
|
|
6854
|
+
}
|
|
6855
|
+
togglePasswordVisibility() {
|
|
6856
|
+
this.isPassword = !this.isPassword;
|
|
6857
|
+
this._type = this.isPassword ? "password" : "text";
|
|
6858
|
+
console.log(this.isPassword);
|
|
6474
6859
|
}
|
|
6475
6860
|
render() {
|
|
6476
6861
|
const slotClasses = {
|
|
6477
6862
|
"has-prefix": this.hasPrefix,
|
|
6478
|
-
"has-suffix": this.hasSuffix
|
|
6863
|
+
"has-suffix": this.hasSuffix,
|
|
6864
|
+
"no-suffix": !this.hasSuffix,
|
|
6865
|
+
"no-prefix": !this.hasPrefix
|
|
6479
6866
|
};
|
|
6480
|
-
return y`<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$
|
|
6867
|
+
return y`<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$3(this.label) : ""}<slot name="label" @slotchange="${this.hasSlotOrProps}"></slot></label><div @click="${this.inlineContentFocus}" class="form-control ${o(
|
|
6868
|
+
slotClasses
|
|
6869
|
+
)}"><div class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}"><slot name="prefix" @slotchange="${this.hasSlotOrProps}"></slot><input id="form-element" part="input" class="form-element input" @input="${this.handleChange}" @blur="${this.handleBlur}" type="${this.type}" disabled="${l$2(this.disabled)}" ?readonly="${this.readonly}" ?autofocus="${this.autofocus}" list="${l$2(this.list)}" tabindex="${l$2(this.tabindex)}" pattern="${l$2(this.pattern)}" min="${l$2(this.min)}" max="${l$2(this.max)}" step="${l$2(this.step)}" src="${l$2(this.src)}" minlength="${l$2(this.minlength)}" maxlength="${l$2(this.maxlength)}" placeholder="${l$2(this.placeholder)}" required="${l$2(this.required)}" autocomplete="${l$2(this.autocomplete)}" aria-label="${l$2(this.ariaLabel)}" aria-labelledby="${l$2(this.ariaLabelledby)}" .name="${this.name}" .value="${this.value}"> ${this.showPasswordToggle ? y`<sonic-button shape="circle" class="password-toggle" @click="${this.togglePasswordVisibility}" aria-label="Toggle password visibility" variant="unstyled"><sonic-icon library="heroicons" name="${this.isPassword ? "eye" : "eye-slash"}"></sonic-icon></sonic-button>` : ""}<slot name="suffix" @slotchange="${this.hasSlotOrProps}"></slot></div></div><slot name="description" @slotchange="${this.hasSlotOrProps}" class="${this.hasDescription ? "form-description" : "hidden"}">${this.description ? y`${o$3(this.description)}` : ""}</slot><slot name="list"></slot>`;
|
|
6481
6870
|
}
|
|
6482
6871
|
};
|
|
6483
6872
|
Input.styles = [
|
|
@@ -6485,7 +6874,8 @@ Input.styles = [
|
|
|
6485
6874
|
formControl,
|
|
6486
6875
|
label,
|
|
6487
6876
|
description,
|
|
6488
|
-
|
|
6877
|
+
passwordToggle,
|
|
6878
|
+
i$4`:host([type=hidden]){appearance:none!important;display:none!important}:host>.form-control{position:relative}`
|
|
6489
6879
|
];
|
|
6490
6880
|
__decorateClass$G([
|
|
6491
6881
|
e$7({ type: String, reflect: true })
|
|
@@ -6527,16 +6917,19 @@ __decorateClass$G([
|
|
|
6527
6917
|
e$7({ type: Boolean })
|
|
6528
6918
|
], Input.prototype, "disableInlineContentFocus", 2);
|
|
6529
6919
|
__decorateClass$G([
|
|
6530
|
-
|
|
6920
|
+
e$7({ type: Boolean })
|
|
6921
|
+
], Input.prototype, "showPasswordToggle", 2);
|
|
6922
|
+
__decorateClass$G([
|
|
6923
|
+
o$9({ slot: "label" })
|
|
6531
6924
|
], Input.prototype, "slotLabelNodes", 2);
|
|
6532
6925
|
__decorateClass$G([
|
|
6533
|
-
o$
|
|
6926
|
+
o$9({ slot: "description" })
|
|
6534
6927
|
], Input.prototype, "slotDescriptionNodes", 2);
|
|
6535
6928
|
__decorateClass$G([
|
|
6536
|
-
o$
|
|
6929
|
+
o$9({ slot: "suffix" })
|
|
6537
6930
|
], Input.prototype, "slotSuffixNodes", 2);
|
|
6538
6931
|
__decorateClass$G([
|
|
6539
|
-
o$
|
|
6932
|
+
o$9({ slot: "prefix" })
|
|
6540
6933
|
], Input.prototype, "slotPrefixNodes", 2);
|
|
6541
6934
|
__decorateClass$G([
|
|
6542
6935
|
i$5("input")
|
|
@@ -6553,6 +6946,9 @@ __decorateClass$G([
|
|
|
6553
6946
|
__decorateClass$G([
|
|
6554
6947
|
t$3()
|
|
6555
6948
|
], Input.prototype, "hasPrefix", 2);
|
|
6949
|
+
__decorateClass$G([
|
|
6950
|
+
t$3()
|
|
6951
|
+
], Input.prototype, "isPassword", 2);
|
|
6556
6952
|
Input = __decorateClass$G([
|
|
6557
6953
|
e$8(tagName$E)
|
|
6558
6954
|
], Input);
|
|
@@ -6572,21 +6968,23 @@ let Pop = class extends s$3 {
|
|
|
6572
6968
|
constructor() {
|
|
6573
6969
|
super(...arguments);
|
|
6574
6970
|
this.open = false;
|
|
6575
|
-
this.toggle = "true";
|
|
6576
6971
|
this.noToggle = false;
|
|
6577
6972
|
this.inline = false;
|
|
6578
6973
|
this.shadow = "lg";
|
|
6579
6974
|
this.placement = "bottom";
|
|
6580
6975
|
this.positioningRuns = false;
|
|
6581
|
-
this.lastContentX =
|
|
6582
|
-
this.lastContentY =
|
|
6976
|
+
this.lastContentX = 0;
|
|
6977
|
+
this.lastContentY = 0;
|
|
6978
|
+
this.resizeObserver = new ResizeObserver(
|
|
6979
|
+
() => this.computePosition(this.placement)
|
|
6980
|
+
);
|
|
6583
6981
|
}
|
|
6584
|
-
|
|
6982
|
+
runPositioningLoop() {
|
|
6585
6983
|
if (!this.positioningRuns)
|
|
6586
6984
|
return;
|
|
6587
6985
|
this.positioningRuns = true;
|
|
6588
|
-
this.
|
|
6589
|
-
window.requestAnimationFrame(() => this.
|
|
6986
|
+
this.computePosition(this.placement);
|
|
6987
|
+
window.requestAnimationFrame(() => this.runPositioningLoop());
|
|
6590
6988
|
}
|
|
6591
6989
|
_toggle(e2) {
|
|
6592
6990
|
if (this.open && this.noToggle)
|
|
@@ -6598,26 +6996,31 @@ let Pop = class extends s$3 {
|
|
|
6598
6996
|
this.open ? this._show() : this._hide();
|
|
6599
6997
|
}
|
|
6600
6998
|
_show() {
|
|
6999
|
+
this.popContent.style.removeProperty("display");
|
|
6601
7000
|
this.open = true;
|
|
6602
7001
|
this.popContent.setAttribute("tabindex", "0");
|
|
6603
7002
|
if (this.popBtn && this.popContent && !this.positioningRuns) {
|
|
6604
7003
|
this.positioningRuns = true;
|
|
6605
|
-
this.lastContentX =
|
|
6606
|
-
this.lastContentY =
|
|
6607
|
-
this.
|
|
7004
|
+
this.lastContentX = 0;
|
|
7005
|
+
this.lastContentY = 0;
|
|
7006
|
+
this.runPositioningLoop();
|
|
6608
7007
|
}
|
|
7008
|
+
this.dispatchEvent(new CustomEvent("show"));
|
|
6609
7009
|
}
|
|
6610
7010
|
_hide() {
|
|
6611
7011
|
this.open = false;
|
|
6612
7012
|
this.popContent.setAttribute("tabindex", "-1");
|
|
6613
7013
|
this.positioningRuns = false;
|
|
7014
|
+
this.dispatchEvent(new CustomEvent("hide"));
|
|
6614
7015
|
}
|
|
6615
7016
|
_handleClosePop(e2) {
|
|
6616
7017
|
const path = e2.composedPath();
|
|
6617
7018
|
const target = path[0];
|
|
6618
7019
|
Pop.pops.forEach((pop) => {
|
|
6619
7020
|
const popContainsTarget = path.includes(pop);
|
|
6620
|
-
const popContentContainsTarget = path.includes(
|
|
7021
|
+
const popContentContainsTarget = path.includes(
|
|
7022
|
+
pop.querySelector('[slot="content"]')
|
|
7023
|
+
);
|
|
6621
7024
|
const isCloseManual = HTML$1.getAncestorAttributeValue(target, "data-on-select") === "keep";
|
|
6622
7025
|
if (e2.type == "pointerdown" && popContainsTarget)
|
|
6623
7026
|
return;
|
|
@@ -6634,6 +7037,10 @@ let Pop = class extends s$3 {
|
|
|
6634
7037
|
}
|
|
6635
7038
|
Pop.pops.add(this);
|
|
6636
7039
|
}
|
|
7040
|
+
firstUpdated(_changedProperties) {
|
|
7041
|
+
super.firstUpdated(_changedProperties);
|
|
7042
|
+
this.resizeObserver.observe(this.popContent);
|
|
7043
|
+
}
|
|
6637
7044
|
disconnectedCallback() {
|
|
6638
7045
|
super.disconnectedCallback();
|
|
6639
7046
|
Pop.pops.delete(this);
|
|
@@ -6641,22 +7048,20 @@ let Pop = class extends s$3 {
|
|
|
6641
7048
|
document.removeEventListener("pointerdown", this._handleClosePop);
|
|
6642
7049
|
document.removeEventListener("click", this._handleClosePop);
|
|
6643
7050
|
}
|
|
7051
|
+
this.resizeObserver.unobserve(this.popContent);
|
|
6644
7052
|
}
|
|
6645
|
-
|
|
6646
|
-
var _a2;
|
|
6647
|
-
|
|
7053
|
+
computePosition(placement) {
|
|
7054
|
+
var _a2, _b, _c;
|
|
7055
|
+
let contentRect = (_a2 = this.popContent) == null ? void 0 : _a2.getBoundingClientRect();
|
|
6648
7056
|
const padding = 8;
|
|
6649
|
-
const shiftPadding =
|
|
7057
|
+
const shiftPadding = 5;
|
|
6650
7058
|
const thisRect = this.getBoundingClientRect();
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
const bodyRect = this.offsetParent.getBoundingClientRect();
|
|
6654
|
-
const x0 = thisRect.left - bodyRect.left;
|
|
6655
|
-
const y0 = thisRect.top - bodyRect.top;
|
|
7059
|
+
const x0 = thisRect.left;
|
|
7060
|
+
const y0 = thisRect.top;
|
|
6656
7061
|
let x2 = x0, y2 = y0;
|
|
6657
7062
|
const yTop = y0 - contentRect.height - padding;
|
|
6658
|
-
const xLeft = x0 - contentRect.width -
|
|
6659
|
-
const xRight = x0 + thisRect.width +
|
|
7063
|
+
const xLeft = x0 - contentRect.width - padding;
|
|
7064
|
+
const xRight = x0 + thisRect.width + padding;
|
|
6660
7065
|
const yBottom = y0 + thisRect.height + padding;
|
|
6661
7066
|
switch (placement) {
|
|
6662
7067
|
case "bottom":
|
|
@@ -6672,36 +7077,52 @@ let Pop = class extends s$3 {
|
|
|
6672
7077
|
x2 = xRight;
|
|
6673
7078
|
break;
|
|
6674
7079
|
}
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
7080
|
+
this.lastContentX += x2 - contentRect.x;
|
|
7081
|
+
this.lastContentY += y2 - contentRect.y;
|
|
7082
|
+
Object.assign(this.popContent.style, {
|
|
7083
|
+
left: `${this.lastContentX}px`,
|
|
7084
|
+
top: `${this.lastContentY}px`
|
|
7085
|
+
});
|
|
7086
|
+
contentRect = (_b = this.popContent) == null ? void 0 : _b.getBoundingClientRect();
|
|
7087
|
+
if (contentRect.x < shiftPadding && placement == "left")
|
|
6682
7088
|
x2 = xRight;
|
|
6683
|
-
|
|
6684
|
-
if (dyBottom < 0 && placement === "bottom")
|
|
6685
|
-
y2 = yTop;
|
|
6686
|
-
if (dyBottom < 0 && ["left", "right"].includes(placement))
|
|
6687
|
-
y2 = Math.max(y2 + dyBottom, yTop + thisRect.height);
|
|
6688
|
-
const dyTop = -bodyRect.top - yTop;
|
|
6689
|
-
if (dyTop > -shiftPadding && placement === "top")
|
|
7089
|
+
if (contentRect.y < shiftPadding && placement == "top")
|
|
6690
7090
|
y2 = yBottom;
|
|
6691
|
-
|
|
6692
|
-
|
|
7091
|
+
if (contentRect.x + contentRect.width > window.innerWidth - shiftPadding && placement == "right")
|
|
7092
|
+
x2 = xLeft;
|
|
7093
|
+
if (contentRect.y + contentRect.height > window.innerHeight - shiftPadding && placement == "bottom")
|
|
7094
|
+
y2 = yTop;
|
|
7095
|
+
this.lastContentX += x2 - contentRect.x;
|
|
7096
|
+
this.lastContentY += y2 - contentRect.y;
|
|
7097
|
+
Object.assign(this.popContent.style, {
|
|
7098
|
+
left: `${this.lastContentX}px`,
|
|
7099
|
+
top: `${this.lastContentY}px`
|
|
7100
|
+
});
|
|
7101
|
+
contentRect = (_c = this.popContent) == null ? void 0 : _c.getBoundingClientRect();
|
|
7102
|
+
if (contentRect.x < 0) {
|
|
7103
|
+
this.lastContentX += -contentRect.x;
|
|
7104
|
+
}
|
|
7105
|
+
if (contentRect.y < 0) {
|
|
7106
|
+
this.lastContentY += -contentRect.y;
|
|
7107
|
+
}
|
|
7108
|
+
if (contentRect.x + contentRect.width > window.innerWidth) {
|
|
7109
|
+
this.lastContentX += window.innerWidth - (contentRect.x + contentRect.width);
|
|
7110
|
+
}
|
|
7111
|
+
if (contentRect.y + contentRect.height > window.innerHeight) {
|
|
7112
|
+
this.lastContentY += window.innerHeight - (contentRect.y + contentRect.height);
|
|
7113
|
+
}
|
|
6693
7114
|
Object.assign(this.popContent.style, {
|
|
6694
|
-
left: `${
|
|
6695
|
-
top: `${
|
|
7115
|
+
left: `${this.lastContentX}px`,
|
|
7116
|
+
top: `${this.lastContentY}px`
|
|
6696
7117
|
});
|
|
6697
7118
|
}
|
|
6698
7119
|
render() {
|
|
6699
|
-
return y`<slot @click="${this._toggle}" @keydown="${this._toggle}" class="contents"></slot><slot name="content" tabindex="-1" part="content" class="${this.open ? "is-open" : ""}"></slot>`;
|
|
7120
|
+
return y`<slot @click="${this._toggle}" @keydown="${this._toggle}" class="contents"></slot><slot name="content" tabindex="-1" part="content" style="display:none" class="${this.open ? "is-open" : ""}"></slot>`;
|
|
6700
7121
|
}
|
|
6701
7122
|
};
|
|
6702
7123
|
Pop.pops = /* @__PURE__ */ new Set();
|
|
6703
7124
|
Pop.styles = [
|
|
6704
|
-
i$4`:host{display:inline-block;vertical-align:middle}slot[name=content]{max-width:80vw;background-color:var(--sc-base);position:absolute;z-index:50;display:block;transform:translateY(1rem) scale(.95);opacity:0;pointer-events:none;transition-duration:.15s;transition-timing-function:ease;transition-property:all;border-radius:min(calc(var(--sc-btn-rounded) * 2),.4em)}slot[name=content].is-open{transform:translateY(0) scale(1);opacity:1;pointer-events:auto;transition-property:scale,opacity;transition-timing-function:cubic-bezier(.25,.25,.42,1.225)}:host([shadow=md]) slot[name=content],:host([shadow=true]) slot[name=content],:host([shadow]) slot[name=content]{box-shadow:var(--sc-shadow)}:host([shadow=sm]) slot[name=content]{box-shadow:var(--sc-shadow-sm)}:host([shadow=none]) slot[name=content]{box-shadow:none}:host([shadow=lg]) slot[name=content]{box-shadow:var(--sc-shadow-lg)}:host([inline]){vertical-align:baseline}`
|
|
7125
|
+
i$4`:host{display:inline-block;vertical-align:middle}slot[name=content]{max-width:80vw;background-color:var(--sc-base);position:absolute;z-index:50;display:block;transform:translateY(1rem) scale(.95);opacity:0;pointer-events:none;transition-duration:.15s;transition-timing-function:ease;transition-property:all;border-radius:min(calc(var(--sc-btn-rounded) * 2),.4em)}slot[name=content].is-open:not(.is-empty){transform:translateY(0) scale(1);opacity:1;pointer-events:auto;transition-property:scale,opacity;transition-timing-function:cubic-bezier(.25,.25,.42,1.225)}:host([shadow=md]) slot[name=content],:host([shadow=true]) slot[name=content],:host([shadow]) slot[name=content]{box-shadow:var(--sc-shadow)}:host([shadow=sm]) slot[name=content]{box-shadow:var(--sc-shadow-sm)}:host([shadow=none]) slot[name=content]{box-shadow:none}:host([shadow=lg]) slot[name=content]{box-shadow:var(--sc-shadow-lg)}:host([inline]){vertical-align:baseline}`
|
|
6705
7126
|
];
|
|
6706
7127
|
__decorateClass$F([
|
|
6707
7128
|
t$3()
|
|
@@ -6712,9 +7133,6 @@ __decorateClass$F([
|
|
|
6712
7133
|
__decorateClass$F([
|
|
6713
7134
|
i$5("slot[name=content]")
|
|
6714
7135
|
], Pop.prototype, "popContent", 2);
|
|
6715
|
-
__decorateClass$F([
|
|
6716
|
-
e$7({ type: String })
|
|
6717
|
-
], Pop.prototype, "toggle", 2);
|
|
6718
7136
|
__decorateClass$F([
|
|
6719
7137
|
e$7({ type: Boolean })
|
|
6720
7138
|
], Pop.prototype, "noToggle", 2);
|
|
@@ -6776,69 +7194,150 @@ var __decorateClass$D = (decorators, target, key, kind) => {
|
|
|
6776
7194
|
__defProp$D(target, key, result);
|
|
6777
7195
|
return result;
|
|
6778
7196
|
};
|
|
6779
|
-
let InputAutocomplete = class extends TemplatesContainer(
|
|
7197
|
+
let InputAutocomplete = class extends TemplatesContainer(
|
|
7198
|
+
FormInput(FormElement(Subscriber(s$3)))
|
|
7199
|
+
) {
|
|
6780
7200
|
constructor() {
|
|
6781
7201
|
super(...arguments);
|
|
6782
|
-
this.
|
|
6783
|
-
this.forceAutoFill = false;
|
|
7202
|
+
this.size = "md";
|
|
6784
7203
|
this.placeholder = "";
|
|
6785
7204
|
this.filteredFields = "";
|
|
6786
7205
|
this.readonly = null;
|
|
6787
7206
|
this.dataProviderExpression = "";
|
|
6788
7207
|
this.key = "";
|
|
6789
|
-
this.
|
|
6790
|
-
this.
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
7208
|
+
this.searchParameter = "";
|
|
7209
|
+
this.searchDataProvider = "";
|
|
7210
|
+
this.initSearchDataProvider = "";
|
|
7211
|
+
this.queueDataProvider = "";
|
|
7212
|
+
this.initQueueDataProvider = "";
|
|
7213
|
+
this.lastValidSearch = "";
|
|
7214
|
+
this.updateSearchParameter = (value) => {
|
|
7215
|
+
if (value == "") {
|
|
7216
|
+
this.lastValidSearch = "";
|
|
7217
|
+
return;
|
|
7218
|
+
}
|
|
7219
|
+
this.queryQueueListItem(
|
|
7220
|
+
this.queueDataProvider,
|
|
7221
|
+
this.findSelection,
|
|
7222
|
+
this.setSearchFromSelection
|
|
7223
|
+
);
|
|
7224
|
+
};
|
|
7225
|
+
this.initSearchParameter = () => {
|
|
7226
|
+
this.queryQueueListItem(
|
|
7227
|
+
this.initQueueDataProvider,
|
|
7228
|
+
this.findSelection,
|
|
7229
|
+
this.setSearchFromSelection
|
|
7230
|
+
);
|
|
7231
|
+
};
|
|
7232
|
+
this.selectListItem = (listItem) => {
|
|
7233
|
+
var _a2;
|
|
7234
|
+
(_a2 = this.formValuePublisher) == null ? void 0 : _a2.set(listItem[this.name]);
|
|
7235
|
+
};
|
|
7236
|
+
this.findSearchedItem = (listItem) => {
|
|
7237
|
+
var _a2;
|
|
7238
|
+
return listItem[this.searchParameter || this.name] == ((_a2 = this.searchPublisher) == null ? void 0 : _a2.get());
|
|
7239
|
+
};
|
|
7240
|
+
this.findSelection = (listItem) => {
|
|
7241
|
+
return listItem[this.name] == this.value;
|
|
7242
|
+
};
|
|
7243
|
+
this.setSearchFromSelection = (listItem) => {
|
|
7244
|
+
var _a2;
|
|
7245
|
+
this.lastValidSearch = listItem[this.searchParameter || this.name];
|
|
7246
|
+
(_a2 = this.searchPublisher) == null ? void 0 : _a2.set(this.lastValidSearch);
|
|
7247
|
+
};
|
|
7248
|
+
this.updateActiveSelection = () => {
|
|
7249
|
+
var _a2, _b, _c;
|
|
7250
|
+
this.queryQueueListItem(
|
|
7251
|
+
this.queueDataProvider,
|
|
7252
|
+
this.findSearchedItem,
|
|
7253
|
+
this.selectListItem
|
|
7254
|
+
);
|
|
7255
|
+
if (!this.select && this.lastValidSearch && this.lastValidSearch != ((_a2 = this.searchPublisher) == null ? void 0 : _a2.get()) && ((_b = this.formValuePublisher) == null ? void 0 : _b.get())) {
|
|
7256
|
+
(_c = this.formValuePublisher) == null ? void 0 : _c.set("");
|
|
7257
|
+
}
|
|
7258
|
+
};
|
|
6803
7259
|
}
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
this.
|
|
6808
|
-
this.
|
|
7260
|
+
connectedCallback() {
|
|
7261
|
+
var _a2, _b, _c;
|
|
7262
|
+
super.connectedCallback();
|
|
7263
|
+
const searchParameter = this.searchParameter || this.name;
|
|
7264
|
+
const formDataProvider = this.getAncestorAttributeValue("formDataProvider");
|
|
7265
|
+
const dpPrefix = formDataProvider + "__autocomplete";
|
|
7266
|
+
this.initSearchDataProvider = `${dpPrefix}_init_search__`;
|
|
7267
|
+
this.initQueueDataProvider = `${dpPrefix}_init_queue__`;
|
|
7268
|
+
this.searchDataProvider = `${dpPrefix}_search__`;
|
|
7269
|
+
this.queueDataProvider = `${dpPrefix}_queue__`;
|
|
7270
|
+
const getPublisher = PublisherManager.get;
|
|
7271
|
+
this.searchPublisher = getPublisher(this.searchDataProvider)[searchParameter];
|
|
7272
|
+
this.formValuePublisher = getPublisher(formDataProvider)[this.name];
|
|
7273
|
+
this.countPublisher = getPublisher(this.queueDataProvider).resultCount;
|
|
7274
|
+
this.initCountPublisher = getPublisher(
|
|
7275
|
+
this.initQueueDataProvider
|
|
7276
|
+
).resultCount;
|
|
7277
|
+
if (this.value) {
|
|
7278
|
+
PublisherManager.get(this.initSearchDataProvider)[this.name] = this.value;
|
|
7279
|
+
}
|
|
7280
|
+
(_a2 = this.initCountPublisher) == null ? void 0 : _a2.onAssign(this.initSearchParameter);
|
|
7281
|
+
(_b = this.formValuePublisher) == null ? void 0 : _b.onAssign(this.updateSearchParameter);
|
|
7282
|
+
(_c = this.countPublisher) == null ? void 0 : _c.onAssign(this.updateActiveSelection);
|
|
6809
7283
|
}
|
|
6810
|
-
|
|
6811
|
-
|
|
7284
|
+
disconnectedCallback() {
|
|
7285
|
+
var _a2, _b, _c;
|
|
7286
|
+
super.disconnectedCallback();
|
|
7287
|
+
(_a2 = this.initCountPublisher) == null ? void 0 : _a2.offAssign(this.initSearchParameter);
|
|
7288
|
+
(_b = this.formValuePublisher) == null ? void 0 : _b.offAssign(this.updateSearchParameter);
|
|
7289
|
+
(_c = this.countPublisher) == null ? void 0 : _c.offAssign(this.updateActiveSelection);
|
|
7290
|
+
const getPublisher = PublisherManager.get;
|
|
7291
|
+
getPublisher(this.initSearchDataProvider).delete();
|
|
7292
|
+
getPublisher(this.initQueueDataProvider).delete();
|
|
7293
|
+
getPublisher(this.searchDataProvider).delete();
|
|
7294
|
+
getPublisher(this.queueDataProvider).delete();
|
|
7295
|
+
}
|
|
7296
|
+
queryQueueListItem(queueDataProvider, itemFinder, itemMutator) {
|
|
7297
|
+
const queuePublisher = PublisherManager.get(queueDataProvider);
|
|
7298
|
+
let listItem;
|
|
7299
|
+
const listsDescriptors = queuePublisher.get();
|
|
7300
|
+
if (!Array.isArray(listsDescriptors))
|
|
7301
|
+
return;
|
|
7302
|
+
for (const listDescriptor of listsDescriptors) {
|
|
7303
|
+
const list = PublisherManager.get(listDescriptor.dataProvider).get();
|
|
7304
|
+
if (!Array.isArray(list))
|
|
7305
|
+
continue;
|
|
7306
|
+
listItem = list.find(itemFinder);
|
|
7307
|
+
console.log(listItem);
|
|
7308
|
+
if (listItem) {
|
|
7309
|
+
break;
|
|
7310
|
+
}
|
|
7311
|
+
}
|
|
7312
|
+
if (listItem) {
|
|
7313
|
+
itemMutator(listItem);
|
|
7314
|
+
}
|
|
6812
7315
|
}
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
this._label = value;
|
|
6817
|
-
this.requestUpdate();
|
|
7316
|
+
setSelectionRange(start, end) {
|
|
7317
|
+
var _a2;
|
|
7318
|
+
(_a2 = this.querySelector("sonic-input")) == null ? void 0 : _a2.setSelectionRange(start, end);
|
|
6818
7319
|
}
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
7320
|
+
handleHide() {
|
|
7321
|
+
var _a2, _b, _c;
|
|
7322
|
+
if (!this.select)
|
|
7323
|
+
return;
|
|
7324
|
+
if (((_a2 = this.searchPublisher) == null ? void 0 : _a2.get()) == "") {
|
|
7325
|
+
this.lastValidSearch = "";
|
|
7326
|
+
(_b = this.formValuePublisher) == null ? void 0 : _b.set("");
|
|
7327
|
+
return;
|
|
7328
|
+
}
|
|
7329
|
+
(_c = this.searchPublisher) == null ? void 0 : _c.set(this.lastValidSearch);
|
|
6822
7330
|
}
|
|
6823
7331
|
render() {
|
|
6824
|
-
return y`<sonic-pop
|
|
7332
|
+
return y`<sonic-pop noToggle style="display:block" @hide="${this.handleHide}"><sonic-input debug dataProvider="${this.initSearchDataProvider + Math.random()}" formDataProvider="${this.searchDataProvider}" type="search" data-keyboard-nav="${this.getAttribute("data-keyboard-nav") || ""}" label="${l$2(this.label)}" description="${l$2(this.description)}" name="${l$2(this.searchParameter || this.name)}" placeholder="${l$2(this.placeholder)}" ?readonly="${this.readonly}" autocomplete="off" clearable inlineContent size="${this.size}">${this.select ? y`<sonic-icon slot="suffix" class="select-chevron" name="nav-arrow-down" .size="${this.size}"></sonic-icon>` : b$1}</sonic-input><sonic-menu slot="content"><sonic-queue dataProvider="${this.queueDataProvider}" filteredFields="${this.filteredFields}" dataProviderExpression="${this.dataProviderExpression}" dataFilterProvider="${this.searchDataProvider}" key="${this.key}" .templates="${this.templateList}" displayContents></sonic-queue><sonic-queue noLazyload dataProvider="${this.initQueueDataProvider}" filteredFields="${this.filteredFields}" dataProviderExpression="${this.dataProviderExpression}" dataFilterProvider="${this.initSearchDataProvider}" key="${this.key}" displayContents></sonic-queue></sonic-menu></sonic-pop>`;
|
|
6825
7333
|
}
|
|
6826
7334
|
};
|
|
6827
7335
|
InputAutocomplete.styles = [
|
|
6828
7336
|
i$4`:host{display:block}`
|
|
6829
7337
|
];
|
|
6830
7338
|
__decorateClass$D([
|
|
6831
|
-
e$7()
|
|
6832
|
-
], InputAutocomplete.prototype, "
|
|
6833
|
-
__decorateClass$D([
|
|
6834
|
-
e$7()
|
|
6835
|
-
], InputAutocomplete.prototype, "forceAutoFill", 2);
|
|
6836
|
-
__decorateClass$D([
|
|
6837
|
-
e$7()
|
|
6838
|
-
], InputAutocomplete.prototype, "description", 1);
|
|
6839
|
-
__decorateClass$D([
|
|
6840
|
-
e$7()
|
|
6841
|
-
], InputAutocomplete.prototype, "label", 1);
|
|
7339
|
+
e$7({ type: String })
|
|
7340
|
+
], InputAutocomplete.prototype, "size", 2);
|
|
6842
7341
|
__decorateClass$D([
|
|
6843
7342
|
e$7({ type: String })
|
|
6844
7343
|
], InputAutocomplete.prototype, "placeholder", 2);
|
|
@@ -6851,12 +7350,15 @@ __decorateClass$D([
|
|
|
6851
7350
|
__decorateClass$D([
|
|
6852
7351
|
e$7({ type: String })
|
|
6853
7352
|
], InputAutocomplete.prototype, "dataProviderExpression", 2);
|
|
7353
|
+
__decorateClass$D([
|
|
7354
|
+
e$7({ type: Boolean })
|
|
7355
|
+
], InputAutocomplete.prototype, "select", 2);
|
|
6854
7356
|
__decorateClass$D([
|
|
6855
7357
|
e$7({ type: String })
|
|
6856
7358
|
], InputAutocomplete.prototype, "key", 2);
|
|
6857
7359
|
__decorateClass$D([
|
|
6858
7360
|
e$7({ type: String })
|
|
6859
|
-
], InputAutocomplete.prototype, "
|
|
7361
|
+
], InputAutocomplete.prototype, "searchParameter", 2);
|
|
6860
7362
|
InputAutocomplete = __decorateClass$D([
|
|
6861
7363
|
e$8("sonic-input-autocomplete")
|
|
6862
7364
|
], InputAutocomplete);
|
|
@@ -7016,7 +7518,7 @@ let SonicComponent = class extends Subscriber(s$3) {
|
|
|
7016
7518
|
render() {
|
|
7017
7519
|
if (this.hasNoChar)
|
|
7018
7520
|
return b$1;
|
|
7019
|
-
return y`<span>${this.areEqual ? o$
|
|
7521
|
+
return y`<span>${this.areEqual ? o$3(this.descriptionWhenEqual) : o$3(this.descriptionWhenNotEqual)}</span>`;
|
|
7020
7522
|
}
|
|
7021
7523
|
};
|
|
7022
7524
|
__decorateClass$B([
|
|
@@ -7052,12 +7554,15 @@ var __decorateClass$A = (decorators, target, key, kind) => {
|
|
|
7052
7554
|
return result;
|
|
7053
7555
|
};
|
|
7054
7556
|
const tagName$z = "sonic-checkbox";
|
|
7055
|
-
let Checkbox = class extends Form$1(
|
|
7557
|
+
let Checkbox = class extends Form$1(
|
|
7558
|
+
Form(Form$2(Subscriber$1(s$3)))
|
|
7559
|
+
) {
|
|
7056
7560
|
constructor() {
|
|
7057
7561
|
super(...arguments);
|
|
7058
7562
|
this.touched = false;
|
|
7059
7563
|
this.iconName = "check";
|
|
7060
7564
|
this.indeterminateIconName = "minus-small";
|
|
7565
|
+
this.showAsIndeterminate = false;
|
|
7061
7566
|
this.hasDescription = false;
|
|
7062
7567
|
this.hasLabel = false;
|
|
7063
7568
|
}
|
|
@@ -7076,12 +7581,12 @@ let Checkbox = class extends Form$1(Form(Form$2(Subscriber$1(s$3)))) {
|
|
|
7076
7581
|
this.hasDescription = this.description || ((_b = this.slotDescriptionNodes) == null ? void 0 : _b.length) ? true : false;
|
|
7077
7582
|
}
|
|
7078
7583
|
render() {
|
|
7079
|
-
return y`<label class="checkbox-container ${this.disabled ? "disabled" : ""}"><span class="icon-container"><input type="${this.type}" @click="${this.handleChange}" @blur="${this.handleBlur}" ?required="${this.required}" .disabled="${l$2(this.disabled)}" .checked="${l$2(this.checked)}" .name="${this.name}" .value="${this.value}" ?autofocus="${this.autofocus}" aria-label="${l$2(this.ariaLabel)}" aria-labelledby="${l$2(this.ariaLabelledby)}"><sonic-icon name="${this.checked == "indeterminate" ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon></span><div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">${this.label ? o$
|
|
7584
|
+
return y`<label class="checkbox-container ${this.disabled ? "disabled" : ""}"><span class="icon-container"><input type="${this.type}" @click="${this.handleChange}" @blur="${this.handleBlur}" ?required="${this.required}" ?data-indeterminate="${this.showAsIndeterminate}" .disabled="${l$2(this.disabled)}" .checked="${l$2(this.checked)}" .name="${this.name}" .value="${this.value}" ?autofocus="${this.autofocus}" aria-label="${l$2(this.ariaLabel)}" aria-labelledby="${l$2(this.ariaLabelledby)}"><sonic-icon name="${this.checked == "indeterminate" || this.showAsIndeterminate ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon></span><div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}">${this.label ? o$3(this.label) : ""}<slot @slotchange="${this.hasSlotOrProps}"></slot><slot @slotchange="${this.hasSlotOrProps}" name="description" class="${this.hasDescription ? "description" : "hidden"}">${this.description ? y`${o$3(this.description)}` : ""}</slot></div></label>`;
|
|
7080
7585
|
}
|
|
7081
7586
|
};
|
|
7082
7587
|
Checkbox.styles = [
|
|
7083
7588
|
fontSize,
|
|
7084
|
-
i$4`:host{--sc-checkbox-border-width:var(--sc-form-border-width);--sc-checkbox-border-color:var(--sc-input-border-color);--sc-checkbox-bg:var(--sc-input-bg);--sc-checkbox-color:transparent}*{box-sizing:border-box}.checkbox-container{min-height:1.4em;display:flex;gap:.5em;line-height:1.2;align-items:flex-start;font-size:var(--sc-fs)}.icon-container{position:relative;display:flex;flex-shrink:0}input{box-sizing:border-box;appearance:none;flex-shrink:0;height:calc(var(--sc-fs) * 1.25);width:calc(var(--sc-fs) * 1.25);display:block;cursor:pointer;border-radius:.25em;transition:.2s;outline:0;margin:0;background-color:var(--sc-checkbox-bg);border:var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color)}:host(:not([disabled])) input:active,input:focus{box-shadow:0 0 0 2px var(--sc-primary)}:host(:not([disabled])) label{cursor:pointer}sonic-icon{line-height:0;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%) scale(0);transition:transform .2s ease-in-out;color:var(--sc-checkbox-color)}.description{color:var(--sc-base-400);font-size:.85em;margin-top:.2em;display:block}input:checked,input[checked]{--sc-checkbox-border-color:var(--sc-primary);--sc-checkbox-bg:var(--sc-primary)}input:checked+sonic-icon,input[checked]+sonic-icon{--sc-checkbox-color:var(--sc-primary-content);transform:translateX(-50%) translateY(-50%) scale(1)}.disabled{cursor:not-allowed}.disabled input{opacity:.4}.disabled .checkbox-text{opacity:.6}:host(:not([disabled])) label:hover input{filter:brightness(.97)}::slotted(a){color:inherit;text-decoration:underline!important}::slotted(a:hover){text-decoration:none!important}.hidden{display:none}`
|
|
7589
|
+
i$4`:host{--sc-checkbox-border-width:var(--sc-form-border-width);--sc-checkbox-border-color:var(--sc-input-border-color);--sc-checkbox-bg:var(--sc-input-bg);--sc-checkbox-color:transparent}*{box-sizing:border-box}.checkbox-container{min-height:1.4em;display:flex;gap:.5em;line-height:1.2;align-items:flex-start;font-size:var(--sc-fs)}.icon-container{position:relative;display:flex;flex-shrink:0}input{box-sizing:border-box;appearance:none;flex-shrink:0;height:calc(var(--sc-fs) * 1.25);width:calc(var(--sc-fs) * 1.25);display:block;cursor:pointer;border-radius:.25em;transition:.2s;outline:0;margin:0;background-color:var(--sc-checkbox-bg);border:var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color)}:host(:not([disabled])) input:active,input:focus{box-shadow:0 0 0 2px var(--sc-primary)}:host(:not([disabled])) label{cursor:pointer}sonic-icon{line-height:0;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%) scale(0);transition:transform .2s ease-in-out;color:var(--sc-checkbox-color)}.description{color:var(--sc-base-400);font-size:.85em;margin-top:.2em;display:block}input:checked,input[checked],input[data-indeterminate]{--sc-checkbox-border-color:var(--sc-primary);--sc-checkbox-bg:var(--sc-primary)}input:checked+sonic-icon,input[checked]+sonic-icon,input[data-indeterminate]+sonic-icon{--sc-checkbox-color:var(--sc-primary-content);transform:translateX(-50%) translateY(-50%) scale(1)}.disabled{cursor:not-allowed}.disabled input{opacity:.4}.disabled .checkbox-text{opacity:.6}:host(:not([disabled])) label:hover input{filter:brightness(.97)}::slotted(a){color:inherit;text-decoration:underline!important}::slotted(a:hover){text-decoration:none!important}.hidden{display:none}`
|
|
7085
7590
|
];
|
|
7086
7591
|
__decorateClass$A([
|
|
7087
7592
|
e$7({ type: Boolean, reflect: true })
|
|
@@ -7092,6 +7597,9 @@ __decorateClass$A([
|
|
|
7092
7597
|
__decorateClass$A([
|
|
7093
7598
|
e$7({ type: String })
|
|
7094
7599
|
], Checkbox.prototype, "indeterminateIconName", 2);
|
|
7600
|
+
__decorateClass$A([
|
|
7601
|
+
e$7({ type: Boolean })
|
|
7602
|
+
], Checkbox.prototype, "showAsIndeterminate", 2);
|
|
7095
7603
|
__decorateClass$A([
|
|
7096
7604
|
e$7({ type: Boolean })
|
|
7097
7605
|
], Checkbox.prototype, "hasDescription", 2);
|
|
@@ -7099,10 +7607,10 @@ __decorateClass$A([
|
|
|
7099
7607
|
e$7({ type: Boolean })
|
|
7100
7608
|
], Checkbox.prototype, "hasLabel", 2);
|
|
7101
7609
|
__decorateClass$A([
|
|
7102
|
-
o$
|
|
7610
|
+
o$9()
|
|
7103
7611
|
], Checkbox.prototype, "slotLabelNodes", 2);
|
|
7104
7612
|
__decorateClass$A([
|
|
7105
|
-
o$
|
|
7613
|
+
o$9({ slot: "description" })
|
|
7106
7614
|
], Checkbox.prototype, "slotDescriptionNodes", 2);
|
|
7107
7615
|
Checkbox = __decorateClass$A([
|
|
7108
7616
|
e$8(tagName$z)
|
|
@@ -7261,14 +7769,14 @@ let Select = class extends Form$2(Subscriber$1(s$3)) {
|
|
|
7261
7769
|
"has-prefix": this.hasPrefix,
|
|
7262
7770
|
"has-suffix": this.hasSuffix
|
|
7263
7771
|
};
|
|
7264
|
-
return y`<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$
|
|
7772
|
+
return y`<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$3(this.label) : ""}<slot name="label" @slotchange="${this.hasSlotOrProps}"></slot></label><div class="form-control ${o(slotClasses)}"><slot name="prefix" @slotchange="${this.hasSlotOrProps}"></slot><div class="form-select-wrapper"><select id="form-element" @change="${this.handleChange}" @blur="${this.handleBlur}" ?disabled="${this.disabled}" ?required="${this.required}" ?multiple="${this.multiple}" size="${l$2(this.selectSize)}" ?autofocus="${this.autofocus}" .value="${this.value}" class="form-element" aria-label="${l$2(this.ariaLabel)}" aria-labelledby="${l$2(this.ariaLabelledby)}">${c$1(
|
|
7265
7773
|
this.options,
|
|
7266
7774
|
(option) => option[this.valueKey],
|
|
7267
7775
|
(option) => {
|
|
7268
7776
|
const isSelected = this.value == option[this.valueKey] ? true : false;
|
|
7269
7777
|
return y`<option ?selected="${isSelected}" value="${option[this.valueKey]}">${option[this.wordingKey]}</option>`;
|
|
7270
7778
|
}
|
|
7271
|
-
)}<slot></slot></select><sonic-icon class="select-chevron" name="nav-arrow-down" .size="${this.size}"></sonic-icon></div><slot name="suffix" @slotchange="${this.hasSlotOrProps}"></slot></div><slot name="description" @slotchange="${this.hasSlotOrProps}" class="${this.hasDescription ? "form-description" : "hidden"}">${this.description ? y`${o$
|
|
7779
|
+
)}<slot></slot></select><sonic-icon class="select-chevron" name="nav-arrow-down" .size="${this.size}"></sonic-icon></div><slot name="suffix" @slotchange="${this.hasSlotOrProps}"></slot></div><slot name="description" @slotchange="${this.hasSlotOrProps}" class="${this.hasDescription ? "form-description" : "hidden"}">${this.description ? y`${o$3(this.description)}` : ""}</slot>`;
|
|
7272
7780
|
}
|
|
7273
7781
|
};
|
|
7274
7782
|
Select.styles = [
|
|
@@ -7276,7 +7784,7 @@ Select.styles = [
|
|
|
7276
7784
|
formControl,
|
|
7277
7785
|
label,
|
|
7278
7786
|
description,
|
|
7279
|
-
i$4`.form-element{appearance:none}:host([disabled]) sonic-icon{opacity:0}:host(:not([disabled])) .form-element:not(:has(option:only-child)){padding-right:max(
|
|
7787
|
+
i$4`.form-element{appearance:none}:host([disabled]) sonic-icon{opacity:0}@supports selector(:has(*)){:host(:not([disabled])) .form-element:not(:has(option:only-child)){padding-right:max(1.275em,calc(1.5 * var(--sc-input-px)))}}@supports not selector(:has(*)){:host(:not([disabled])) .form-element{padding-right:max(1.275em,calc(1.5 * var(--sc-input-px)))}}.form-select-wrapper{position:relative;width:100%}sonic-icon{position:absolute;right:calc(.8 * var(--sc-input-px));top:50%;pointer-events:none;transform:translateY(-50%);color:var(--sc-input-c)}option{padding:.1rem var(--sc-input-px);color:var(--sc-base-content);background:var(--sc-base)}select[multiple] option{background:0 0;padding:0}`
|
|
7280
7788
|
];
|
|
7281
7789
|
__decorateClass$y([
|
|
7282
7790
|
e$7({ type: String })
|
|
@@ -7309,16 +7817,16 @@ __decorateClass$y([
|
|
|
7309
7817
|
e$7()
|
|
7310
7818
|
], Select.prototype, "label", 1);
|
|
7311
7819
|
__decorateClass$y([
|
|
7312
|
-
o$
|
|
7820
|
+
o$9({ slot: "label" })
|
|
7313
7821
|
], Select.prototype, "slotLabelNodes", 2);
|
|
7314
7822
|
__decorateClass$y([
|
|
7315
|
-
o$
|
|
7823
|
+
o$9({ slot: "description" })
|
|
7316
7824
|
], Select.prototype, "slotDescriptionNodes", 2);
|
|
7317
7825
|
__decorateClass$y([
|
|
7318
|
-
o$
|
|
7826
|
+
o$9({ slot: "suffix" })
|
|
7319
7827
|
], Select.prototype, "slotSuffixNodes", 2);
|
|
7320
7828
|
__decorateClass$y([
|
|
7321
|
-
o$
|
|
7829
|
+
o$9({ slot: "prefix" })
|
|
7322
7830
|
], Select.prototype, "slotPrefixNodes", 2);
|
|
7323
7831
|
__decorateClass$y([
|
|
7324
7832
|
t$3()
|
|
@@ -7380,8 +7888,8 @@ let Textarea = class extends Form(Form$2(Subscriber$1(s$3))) {
|
|
|
7380
7888
|
textarea2.reportValidity();
|
|
7381
7889
|
}
|
|
7382
7890
|
render() {
|
|
7383
|
-
return y`<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$
|
|
7384
|
-
${this.value}</textarea></div><slot name="description" @slotchange="${this.hasSlotOrProps}" class="${this.hasDescription ? "form-description" : "hidden"}">${this.description ? y`${o$
|
|
7891
|
+
return y`<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$3(this.label) : ""}<slot name="label" @slotchange="${this.hasSlotOrProps}"></slot></label><div class="form-control"><textarea id="form-element" @input="${this.handleChange}" @blur="${this.handleBlur}" disabled="${l$2(this.disabled)}" ?required="${this.required}" ?autofocus="${this.autofocus}" rows="${l$2(this.rows)}" cols="${l$2(this.cols)}" maxlength="${l$2(this.maxlength)}" minlength="${l$2(this.minlength)}" ?readonly="${this.readonly}" spellcheck="${l$2(this.spellcheck)}" autocomplete="${l$2(this.autocomplete)}" tabindex="${l$2(this.tabindex)}" wrap="${l$2(this.wrap)}" placeholder="${this.placeholder}" class="form-element textarea custom-scroll" aria-label="${l$2(this.ariaLabel)}" aria-labelledby="${l$2(this.ariaLabelledby)}">
|
|
7892
|
+
${this.value}</textarea></div><slot name="description" @slotchange="${this.hasSlotOrProps}" class="${this.hasDescription ? "form-description" : "hidden"}">${this.description ? y`${o$3(this.description)}` : ""}</slot>`;
|
|
7385
7893
|
}
|
|
7386
7894
|
};
|
|
7387
7895
|
Textarea.styles = [
|
|
@@ -7417,10 +7925,10 @@ __decorateClass$x([
|
|
|
7417
7925
|
e$7({ type: String })
|
|
7418
7926
|
], Textarea.prototype, "placeholder", 2);
|
|
7419
7927
|
__decorateClass$x([
|
|
7420
|
-
o$
|
|
7928
|
+
o$9({ slot: "label" })
|
|
7421
7929
|
], Textarea.prototype, "slotLabelNodes", 2);
|
|
7422
7930
|
__decorateClass$x([
|
|
7423
|
-
o$
|
|
7931
|
+
o$9({ slot: "description" })
|
|
7424
7932
|
], Textarea.prototype, "slotDescriptionNodes", 2);
|
|
7425
7933
|
__decorateClass$x([
|
|
7426
7934
|
t$3()
|
|
@@ -7489,7 +7997,7 @@ let Legend = class extends s$3 {
|
|
|
7489
7997
|
this.requestUpdate();
|
|
7490
7998
|
}
|
|
7491
7999
|
render() {
|
|
7492
|
-
return y`<legend part="legend">${this.iconName ? y`<div class="icon"><sonic-icon name="${this.iconName}" prefix="${l$2(this.iconPrefix)}" library="${l$2(this.iconLibrary)}"></sonic-icon></div>` : ""}<div class="legend-content">${o$
|
|
8000
|
+
return y`<legend part="legend">${this.iconName ? y`<div class="icon"><sonic-icon name="${this.iconName}" prefix="${l$2(this.iconPrefix)}" library="${l$2(this.iconLibrary)}"></sonic-icon></div>` : ""}<div class="legend-content">${o$3(this.label ? this.label : "")} ${this.description ? y`<sonic-legend-description>${o$3(this.description)}</sonic-legend-description>` : ""}<slot></slot></div><slot name="suffix"></slot></legend>`;
|
|
7493
8001
|
}
|
|
7494
8002
|
};
|
|
7495
8003
|
Legend.styles = [
|
|
@@ -7700,7 +8208,7 @@ let Group = class extends s$3 {
|
|
|
7700
8208
|
this.hasLabel = false;
|
|
7701
8209
|
}
|
|
7702
8210
|
updated() {
|
|
7703
|
-
const children = this.querySelectorAll("sonic-input, sonic-button");
|
|
8211
|
+
const children = this.querySelectorAll("sonic-input, sonic-button, sonic-select");
|
|
7704
8212
|
const nbChildren = children.length;
|
|
7705
8213
|
if (nbChildren > 1) {
|
|
7706
8214
|
children.forEach((item, index) => {
|
|
@@ -7737,14 +8245,14 @@ let Group = class extends s$3 {
|
|
|
7737
8245
|
const slotStyle = {
|
|
7738
8246
|
alignItems: this.alignItems
|
|
7739
8247
|
};
|
|
7740
|
-
return y`<span class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$
|
|
8248
|
+
return y`<span class="${this.hasLabel ? "form-label" : "hidden"}">${this.label ? o$3(this.label) : ""}<slot name="label" @slotchange="${this.hasSlotOrProps}"></slot></span><slot class="main-slot" style="${i$1(slotStyle)}"></slot><slot name="description" @slotchange="${this.hasSlotOrProps}" class="${this.hasDescription ? "form-description" : "hidden"}">${this.description ? y`${o$3(this.description)}` : ""}</slot>`;
|
|
7741
8249
|
}
|
|
7742
8250
|
};
|
|
7743
8251
|
Group.styles = [
|
|
7744
8252
|
fontSize,
|
|
7745
8253
|
label,
|
|
7746
8254
|
description,
|
|
7747
|
-
i$4`:host{display:inline-block;vertical-align:middle}.main-slot{width:100%;display:flex}.hidden{display:none}`
|
|
8255
|
+
i$4`:host{display:inline-block;vertical-align:middle}.main-slot{width:100%;display:flex}.hidden{display:none}::slotted(sonic-button),::slotted(sonic-input),::slotted(sonic-select){flex-grow:1}`
|
|
7748
8256
|
];
|
|
7749
8257
|
__decorateClass$r([
|
|
7750
8258
|
e$7({ type: String })
|
|
@@ -7756,10 +8264,10 @@ __decorateClass$r([
|
|
|
7756
8264
|
e$7({ type: String })
|
|
7757
8265
|
], Group.prototype, "description", 2);
|
|
7758
8266
|
__decorateClass$r([
|
|
7759
|
-
o$
|
|
8267
|
+
o$9({ slot: "label" })
|
|
7760
8268
|
], Group.prototype, "slotLabelNodes", 2);
|
|
7761
8269
|
__decorateClass$r([
|
|
7762
|
-
o$
|
|
8270
|
+
o$9({ slot: "description" })
|
|
7763
8271
|
], Group.prototype, "slotDescriptionNodes", 2);
|
|
7764
8272
|
__decorateClass$r([
|
|
7765
8273
|
t$3()
|
|
@@ -7833,6 +8341,42 @@ __decorateClass$q([
|
|
|
7833
8341
|
Image = __decorateClass$q([
|
|
7834
8342
|
e$8(tagName$q)
|
|
7835
8343
|
], Image);
|
|
8344
|
+
/**
|
|
8345
|
+
* @license
|
|
8346
|
+
* Copyright 2017 Google LLC
|
|
8347
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8348
|
+
*/
|
|
8349
|
+
const d = e$2(class extends i$2 {
|
|
8350
|
+
constructor(t2) {
|
|
8351
|
+
super(t2), this.et = /* @__PURE__ */ new WeakMap();
|
|
8352
|
+
}
|
|
8353
|
+
render(t2) {
|
|
8354
|
+
return [t2];
|
|
8355
|
+
}
|
|
8356
|
+
update(s2, [e2]) {
|
|
8357
|
+
if (n$2(this.it) && (!n$2(e2) || this.it.strings !== e2.strings)) {
|
|
8358
|
+
const e3 = m(s2).pop();
|
|
8359
|
+
let o2 = this.et.get(this.it.strings);
|
|
8360
|
+
if (void 0 === o2) {
|
|
8361
|
+
const s3 = document.createDocumentFragment();
|
|
8362
|
+
o2 = Z(b$1, s3), o2.setConnected(false), this.et.set(this.it.strings, o2);
|
|
8363
|
+
}
|
|
8364
|
+
s$2(o2, [e3]), r$2(o2, void 0, e3);
|
|
8365
|
+
}
|
|
8366
|
+
if (n$2(e2)) {
|
|
8367
|
+
if (!n$2(this.it) || this.it.strings !== e2.strings) {
|
|
8368
|
+
const t2 = this.et.get(e2.strings);
|
|
8369
|
+
if (void 0 !== t2) {
|
|
8370
|
+
const i2 = m(t2).pop();
|
|
8371
|
+
a$1(s2), r$2(s2, void 0, i2), s$2(s2, [i2]);
|
|
8372
|
+
}
|
|
8373
|
+
}
|
|
8374
|
+
this.it = e2;
|
|
8375
|
+
} else
|
|
8376
|
+
this.it = void 0;
|
|
8377
|
+
return this.render(e2);
|
|
8378
|
+
}
|
|
8379
|
+
});
|
|
7836
8380
|
var __defProp$p = Object.defineProperty;
|
|
7837
8381
|
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
7838
8382
|
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
@@ -7852,6 +8396,8 @@ let Taxonomy = class extends s$3 {
|
|
|
7852
8396
|
this.taxonomy = [];
|
|
7853
8397
|
this.separator = ", ";
|
|
7854
8398
|
this.key = "";
|
|
8399
|
+
this.displayAll = false;
|
|
8400
|
+
this.contrast = false;
|
|
7855
8401
|
this.type = "default";
|
|
7856
8402
|
this.variant = "default";
|
|
7857
8403
|
this.size = "md";
|
|
@@ -7860,7 +8406,7 @@ let Taxonomy = class extends s$3 {
|
|
|
7860
8406
|
if (!Array.isArray(this.taxonomy))
|
|
7861
8407
|
return b$1;
|
|
7862
8408
|
const key = this.key + "_display";
|
|
7863
|
-
const taxo = this.taxonomy.filter(
|
|
8409
|
+
const taxo = this.displayAll ? this.taxonomy : this.taxonomy.filter(
|
|
7864
8410
|
(elt) => elt != null && (elt[key] === true || elt[key] == "1" || !Object.hasOwnProperty.call(elt, key))
|
|
7865
8411
|
);
|
|
7866
8412
|
if (taxo.length === 0) {
|
|
@@ -7868,13 +8414,13 @@ let Taxonomy = class extends s$3 {
|
|
|
7868
8414
|
return b$1;
|
|
7869
8415
|
}
|
|
7870
8416
|
this.style.removeProperty("display");
|
|
7871
|
-
return y`<sonic-badge type="${this.type}" variant="${this.variant}" size="${this.size}"><sonic-icon slot="prefix" library="${l$2(this.icon.library)}" prefix="${l$2(this.icon.prefix)}" name="${l$2(this.icon.name)}"></sonic-icon><span class="taxonomy-list">${c$1(
|
|
8417
|
+
return d(y`<sonic-badge type="${this.type}" variant="${this.variant}" size="${this.size}" ?contrast="${this.contrast}"><sonic-icon slot="prefix" library="${l$2(this.icon.library)}" prefix="${l$2(this.icon.prefix)}" name="${l$2(this.icon.name)}"></sonic-icon><span class="taxonomy-list">${c$1(
|
|
7872
8418
|
taxo,
|
|
7873
8419
|
(item) => item[this.key + "_id"],
|
|
7874
8420
|
(item) => {
|
|
7875
|
-
return y`<span>${item[this.key + "_name"] || item["name"]}</span><span class="sonic-taxonomy-separator">${o$
|
|
8421
|
+
return y`<span>${item[this.key + "_name"] || item["name"]}</span><span class="sonic-taxonomy-separator">${o$3(this.separator)}</span>`;
|
|
7876
8422
|
}
|
|
7877
|
-
)}</span></sonic-badge
|
|
8423
|
+
)}</span></sonic-badge>`);
|
|
7878
8424
|
}
|
|
7879
8425
|
};
|
|
7880
8426
|
Taxonomy.styles = i$4`:host .sonic-taxonomy-separator:last-child{display:none}.taxonomy-list{display:flex;flex-wrap:wrap}`;
|
|
@@ -7890,6 +8436,12 @@ __decorateClass$p([
|
|
|
7890
8436
|
__decorateClass$p([
|
|
7891
8437
|
e$7({ type: String })
|
|
7892
8438
|
], Taxonomy.prototype, "key", 2);
|
|
8439
|
+
__decorateClass$p([
|
|
8440
|
+
e$7({ type: Boolean })
|
|
8441
|
+
], Taxonomy.prototype, "displayAll", 2);
|
|
8442
|
+
__decorateClass$p([
|
|
8443
|
+
e$7({ type: Boolean })
|
|
8444
|
+
], Taxonomy.prototype, "contrast", 2);
|
|
7893
8445
|
__decorateClass$p([
|
|
7894
8446
|
e$7({ type: String, reflect: true })
|
|
7895
8447
|
], Taxonomy.prototype, "type", 2);
|
|
@@ -8159,7 +8711,7 @@ let ModalClose = class extends s$3 {
|
|
|
8159
8711
|
}
|
|
8160
8712
|
};
|
|
8161
8713
|
ModalClose.styles = [
|
|
8162
|
-
i$4`:host{position:sticky;display:block;align-self:flex-end;height:0;top
|
|
8714
|
+
i$4`:host{position:sticky;display:block;align-self:flex-end;height:0;top:.5rem;right:.5rem;transform:translate3d(calc(var(--sc-modal-px)),calc(-1 * var(--sc-modal-py)),0);z-index:20}`
|
|
8163
8715
|
];
|
|
8164
8716
|
__decorateClass$m([
|
|
8165
8717
|
e$7()
|
|
@@ -8185,7 +8737,7 @@ let ModalContent = class extends s$3 {
|
|
|
8185
8737
|
}
|
|
8186
8738
|
};
|
|
8187
8739
|
ModalContent.styles = [
|
|
8188
|
-
i$4`:host{display:block}`
|
|
8740
|
+
i$4`:host{display:block;width:100%}`
|
|
8189
8741
|
];
|
|
8190
8742
|
ModalContent = __decorateClass$l([
|
|
8191
8743
|
e$8(tagName$l)
|
|
@@ -8252,17 +8804,31 @@ let Modal = class extends Subscriber$1(s$3) {
|
|
|
8252
8804
|
constructor() {
|
|
8253
8805
|
super(...arguments);
|
|
8254
8806
|
this.forceAction = false;
|
|
8807
|
+
this.removeOnHide = false;
|
|
8255
8808
|
this.align = "left";
|
|
8256
8809
|
this.padding = "var(--sc-modal-py) var(--sc-modal-px)";
|
|
8257
8810
|
this.maxWidth = "var(--sc-modal-max-w) ";
|
|
8258
8811
|
this.maxHeight = "var(--sc-modal-max-h) ";
|
|
8259
8812
|
this.width = "100%";
|
|
8260
8813
|
this.height = "auto";
|
|
8814
|
+
this.zIndex = "var(--sc-modal-z-index)";
|
|
8261
8815
|
this.fullScreen = false;
|
|
8262
8816
|
this.visible = false;
|
|
8263
8817
|
}
|
|
8264
8818
|
static create(options) {
|
|
8265
8819
|
const modal = document.createElement(tagName$i);
|
|
8820
|
+
if (options.removeOnHide === true)
|
|
8821
|
+
modal.setAttribute("removeOnHide", "true");
|
|
8822
|
+
if (options.maxWidth)
|
|
8823
|
+
modal.maxWidth = options == null ? void 0 : options.maxWidth;
|
|
8824
|
+
if (options.width)
|
|
8825
|
+
modal.width = options == null ? void 0 : options.width;
|
|
8826
|
+
if (options.paddingX)
|
|
8827
|
+
modal.style.setProperty("--sc-modal-px", options == null ? void 0 : options.paddingX);
|
|
8828
|
+
if (options.paddingY)
|
|
8829
|
+
modal.style.setProperty("--sc-modal-py", options == null ? void 0 : options.paddingY);
|
|
8830
|
+
if (options.zIndex)
|
|
8831
|
+
modal.style.setProperty("--sc-modal-z-index", options == null ? void 0 : options.zIndex);
|
|
8266
8832
|
modal.innerHTML = `<sonic-modal-close></sonic-modal-close><sonic-modal-content>${options.content}</sonic-modal-content>` || "";
|
|
8267
8833
|
const container = document.querySelector("sonic-theme") || document.body;
|
|
8268
8834
|
container.appendChild(modal);
|
|
@@ -8301,6 +8867,7 @@ let Modal = class extends Subscriber$1(s$3) {
|
|
|
8301
8867
|
maxHeight: this.maxHeight,
|
|
8302
8868
|
width: this.width,
|
|
8303
8869
|
height: this.height,
|
|
8870
|
+
zIndex: this.zIndex,
|
|
8304
8871
|
borderRadius: this.fullScreen ? "0" : "var(--sc-modal-rounded)"
|
|
8305
8872
|
};
|
|
8306
8873
|
const modalWrapperStyles = {
|
|
@@ -8319,7 +8886,7 @@ let Modal = class extends Subscriber$1(s$3) {
|
|
|
8319
8886
|
},
|
|
8320
8887
|
in: [{ transform: "translateY(25%) scale(1)", boxShadow: "0 0 0 rgba(0,0,0,0)", opacity: 0 }],
|
|
8321
8888
|
out: [{ transform: "translateY(20%) scale(1)", boxShadow: "0 0 0 rgba(0,0,0,0)", opacity: 0 }]
|
|
8322
|
-
})}><div class="modal-content"><slot></slot></div></div></div><div class="overlay" @click="${!this.forceAction ? this.hide :
|
|
8889
|
+
})}><div class="modal-content"><slot></slot></div></div></div><div class="overlay" @click="${!this.forceAction ? this.hide : null}" ${$({
|
|
8323
8890
|
keyframeOptions: {
|
|
8324
8891
|
duration: 500
|
|
8325
8892
|
},
|
|
@@ -8342,6 +8909,9 @@ let Modal = class extends Subscriber$1(s$3) {
|
|
|
8342
8909
|
if (this.hasAttribute("resetDataProviderOnHide")) {
|
|
8343
8910
|
PublisherManager.get(this.getAttribute("resetDataProviderOnHide")).set({});
|
|
8344
8911
|
}
|
|
8912
|
+
if (this.removeOnHide) {
|
|
8913
|
+
this.remove();
|
|
8914
|
+
}
|
|
8345
8915
|
}
|
|
8346
8916
|
dispose() {
|
|
8347
8917
|
this.hide();
|
|
@@ -8350,9 +8920,9 @@ let Modal = class extends Subscriber$1(s$3) {
|
|
|
8350
8920
|
handleEscape(e2) {
|
|
8351
8921
|
if (e2.key === "Escape") {
|
|
8352
8922
|
const modals = [...document.querySelectorAll(tagName$i)];
|
|
8353
|
-
modals.forEach((
|
|
8354
|
-
if (!
|
|
8355
|
-
|
|
8923
|
+
modals.forEach((modal) => {
|
|
8924
|
+
if (!modal.forceAction) {
|
|
8925
|
+
modal.hide();
|
|
8356
8926
|
}
|
|
8357
8927
|
});
|
|
8358
8928
|
}
|
|
@@ -8368,11 +8938,14 @@ let Modal = class extends Subscriber$1(s$3) {
|
|
|
8368
8938
|
};
|
|
8369
8939
|
Modal.styles = [
|
|
8370
8940
|
customScroll,
|
|
8371
|
-
i$4`:host{--sc-modal-py:2.5rem;--sc-modal-px:1.5rem;--sc-modal-max-w:min(100vw, 64ch);--sc-modal-max-h:80vh;--sc-modal-rounded:var(--sc-rounded-lg)}*{box-sizing:border-box}.modal-wrapper{position:fixed;bottom:0;left:0;width:100%;z-index:
|
|
8941
|
+
i$4`:host{--sc-modal-py:2.5rem;--sc-modal-px:1.5rem;--sc-modal-max-w:min(100vw, 64ch);--sc-modal-max-h:80vh;--sc-modal-rounded:var(--sc-rounded-lg);--sc-modal-z-index:990}*{box-sizing:border-box}.modal-wrapper{position:fixed;bottom:0;left:0;width:100%;z-index:calc(var(--sc-modal-z-index) + 1);align-items:center;justify-content:center;flex-direction:column;display:flex;pointer-events:none}.modal-content{display:flex;flex-direction:column;min-height:10rem;line-height:1.25}.modal{background:var(--sc-base);color:var(--sc-base-content);width:100%;box-shadow:var(--sc-shadow-lg);border-radius:var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0;pointer-events:auto;transform:translateZ(0)}.overlay{background:var(--sc-modal-overlay-bg,var(--sc-base-200));left:0;top:0;right:0;bottom:0;z-index:var(--sc-modal-z-index);opacity:.8;position:fixed}::slotted(sonic-modal-title){margin-bottom:1.25rem}::slotted(sonic-modal-subtitle){margin-top:-.9rem;margin-bottom:1.25rem}@media (max-width:767.5px){.modal,.modal-wrapper{max-width:none!important;width:100%!important;border-radius:var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0!important}}@media (min-width:768px){.modal-wrapper{top:50%;left:50%;bottom:auto;right:auto;transform:translateX(-50%) translateY(-50%)}.modal{top:50%;bottom:auto;right:auto;border-radius:var(--sc-modal-rounded)}}:host([align=left]) .modal-content{text-align:left;align-items:flex-start}:host([align=center]) .modal-content{text-align:center;align-items:center}:host([align=right]) .modal-content{text-align:right;align-items:flex-end}:host([rounded=none]) modal{--sc-img-radius:0!important}`
|
|
8372
8942
|
];
|
|
8373
8943
|
__decorateClass$i([
|
|
8374
8944
|
e$7({ type: Boolean })
|
|
8375
8945
|
], Modal.prototype, "forceAction", 2);
|
|
8946
|
+
__decorateClass$i([
|
|
8947
|
+
e$7({ type: Boolean })
|
|
8948
|
+
], Modal.prototype, "removeOnHide", 2);
|
|
8376
8949
|
__decorateClass$i([
|
|
8377
8950
|
e$7({ type: String, reflect: true })
|
|
8378
8951
|
], Modal.prototype, "align", 2);
|
|
@@ -8391,6 +8964,9 @@ __decorateClass$i([
|
|
|
8391
8964
|
__decorateClass$i([
|
|
8392
8965
|
e$7({ type: String })
|
|
8393
8966
|
], Modal.prototype, "height", 2);
|
|
8967
|
+
__decorateClass$i([
|
|
8968
|
+
e$7({ type: String })
|
|
8969
|
+
], Modal.prototype, "zIndex", 2);
|
|
8394
8970
|
__decorateClass$i([
|
|
8395
8971
|
e$7({ type: Boolean, reflect: true })
|
|
8396
8972
|
], Modal.prototype, "fullScreen", 2);
|
|
@@ -8435,27 +9011,38 @@ let Alert = class extends s$3 {
|
|
|
8435
9011
|
constructor() {
|
|
8436
9012
|
super(...arguments);
|
|
8437
9013
|
this.label = "";
|
|
9014
|
+
this.noIcon = false;
|
|
8438
9015
|
this.text = "";
|
|
9016
|
+
this.dismissible = false;
|
|
8439
9017
|
this.background = false;
|
|
8440
9018
|
this.status = "default";
|
|
8441
9019
|
}
|
|
8442
9020
|
render() {
|
|
8443
|
-
return y`<div part="alert" class="alert"
|
|
9021
|
+
return y`<div part="alert" class="alert">${!this.noIcon ? y`<div>${this.status && y`<sonic-icon name="${icon[this.status]}"></sonic-icon>`}</div>` : b$1}<div>${this.label ? y`<span class="label">${o$3(this.label)}</span>` : b$1}<slot>${this.text}</slot></div>${this.dismissible ? y`<sonic-button @click="${this.close}" class="close-btn" variant="unstyled" shape="circle"><sonic-icon name="cancel" size="lg"></sonic-icon></sonic-button>` : b$1}</div>`;
|
|
9022
|
+
}
|
|
9023
|
+
close() {
|
|
9024
|
+
this.remove();
|
|
8444
9025
|
}
|
|
8445
9026
|
};
|
|
8446
9027
|
Alert.styles = [
|
|
8447
9028
|
fontSize,
|
|
8448
|
-
i$4`:host{--sc-alert-color:var(--sc-base-content);--sc-alert-rounded:var(--sc-rounded);--sc-alert-fw:var(--sc-font-weight-base);--sc-alert-fst:var(--sc-font-style-base);--sc-alert-label-fw:bold;display:block;font-weight:var(--sc-alert-fw);font-style:var(--sc-alert-fst)}.alert{color:var(--sc-alert-color);position:relative;display:flex;gap:.4em;border-radius:var(--sc-alert-rounded)}.label{font-weight:var(--sc-alert-label-fw)}:host([status=warning]){--sc-alert-color:var(--sc-warning)}:host([status=error]){--sc-alert-color:var(--sc-danger)}:host([status=info]){--sc-alert-color:var(--sc-info)}:host([status=success]){--sc-alert-color:var(--sc-success)}:host([background]) .alert{background:var(--sc-base);padding:.8em 1.15em}:host([background]) .alert:before{background-color:currentColor;content:"";display:block;position:absolute;left:0;top:0;right:0;bottom:0;opacity:.08;border-radius:var(--sc-alert-rounded);pointer-events:none}:host([background])>div{z-index:2;position:relative}slot{display:block}:host([size=xs]) .alert{--sc-alert-rounded:var(--sc-rounded-sm)}:host([size=sm]) .alert{--sc-alert-rounded:var(--sc-rounded-sm)}`
|
|
9029
|
+
i$4`:host{--sc-alert-color:var(--sc-base-content);--sc-alert-rounded:var(--sc-rounded);--sc-alert-fw:var(--sc-font-weight-base);--sc-alert-fst:var(--sc-font-style-base);--sc-alert-label-fw:bold;display:block;font-weight:var(--sc-alert-fw);font-style:var(--sc-alert-fst)}.alert{color:var(--sc-alert-color);position:relative;display:flex;gap:.4em;border-radius:var(--sc-alert-rounded)}.label{font-weight:var(--sc-alert-label-fw)}:host([status=warning]){--sc-alert-color:var(--sc-warning)}:host([status=error]){--sc-alert-color:var(--sc-danger)}:host([status=info]){--sc-alert-color:var(--sc-info)}:host([status=success]){--sc-alert-color:var(--sc-success)}:host([background]) .alert,:host([dismissible]) .alert{background:var(--sc-base);padding:.8em 1.15em}:host([background]) .alert:before,:host([dismissible]) .alert:before{background-color:currentColor;content:"";display:block;position:absolute;left:0;top:0;right:0;bottom:0;opacity:.08;border-radius:var(--sc-alert-rounded);pointer-events:none}:host([background])>div,:host([dismissible])>div{z-index:2;position:relative}slot{display:block}:host([size=xs]) .alert{--sc-alert-rounded:var(--sc-rounded-sm)}:host([size=sm]) .alert{--sc-alert-rounded:var(--sc-rounded-sm)}:host([dismissible]) .alert{padding-right:3rem}:host([dismissible]) .close-btn{padding:.5em;position:absolute;top:.25rem;right:.25rem}`
|
|
8449
9030
|
];
|
|
8450
9031
|
__decorateClass$h([
|
|
8451
9032
|
e$7({ type: String })
|
|
8452
9033
|
], Alert.prototype, "label", 2);
|
|
9034
|
+
__decorateClass$h([
|
|
9035
|
+
e$7({ type: Boolean, reflect: true })
|
|
9036
|
+
], Alert.prototype, "noIcon", 2);
|
|
8453
9037
|
__decorateClass$h([
|
|
8454
9038
|
e$7({ type: String })
|
|
8455
9039
|
], Alert.prototype, "text", 2);
|
|
8456
9040
|
__decorateClass$h([
|
|
8457
9041
|
e$7({ type: String, reflect: true })
|
|
8458
9042
|
], Alert.prototype, "size", 2);
|
|
9043
|
+
__decorateClass$h([
|
|
9044
|
+
e$7({ type: Boolean, reflect: true })
|
|
9045
|
+
], Alert.prototype, "dismissible", 2);
|
|
8459
9046
|
__decorateClass$h([
|
|
8460
9047
|
e$7({ type: Boolean, reflect: true })
|
|
8461
9048
|
], Alert.prototype, "background", 2);
|
|
@@ -8575,7 +9162,7 @@ let Tooltip = class extends s$3 {
|
|
|
8575
9162
|
}
|
|
8576
9163
|
};
|
|
8577
9164
|
Tooltip.styles = [
|
|
8578
|
-
i$4`:host{position:relative;display:inline-flex;align-items:center;text-align:center;--sc-tooltip-fw:var(--sc-font-weight-base)}.tooltip:before{position:absolute;content:attr(data-tooltip-text);font-size:.85rem;display:block;opacity:0;pointer-events:none;background:var(--sc-base-content,#111827);padding:.25rem;border-radius
|
|
9165
|
+
i$4`:host{position:relative;display:inline-flex;align-items:center;text-align:center;--sc-tooltip-fw:var(--sc-font-weight-base)}.tooltip:before{position:absolute;content:attr(data-tooltip-text);font-size:.85rem;display:block;opacity:0;pointer-events:none;background:var(--sc-base-content,#111827);padding:.32rem .25rem;border-radius:var(--sc-rounded);color:var(--sc-base,#fff);z-index:999;display:none;line-height:1.1;width:max-content;max-width:18rem;white-space:pre-line;font-weight:var(--sc-tooltip-fw)}.tooltip:not(.disabled):hover:before{opacity:1;display:block}:host(:not([placement])) .tooltip:before,:host([placement=top]) .tooltip:before{bottom:calc(100% + .25rem);left:50%;transform:translateX(-50%)}:host([placement=bottom]) .tooltip:before{top:calc(100% + .25rem);left:50%;transform:translateX(-50%)}:host([placement=left]) .tooltip:before{top:50%;right:calc(100% + .25rem);transform:translateY(-50%)}:host([placement=right]) .tooltip:before{top:50%;transform:translateY(-50%);left:calc(100% + .25rem)}`
|
|
8579
9166
|
];
|
|
8580
9167
|
__decorateClass$f([
|
|
8581
9168
|
e$7({ type: String })
|
|
@@ -8616,14 +9203,14 @@ let Divider = class extends s$3 {
|
|
|
8616
9203
|
}
|
|
8617
9204
|
}
|
|
8618
9205
|
render() {
|
|
8619
|
-
return y`<div part="divider"><span class="text">${o$
|
|
9206
|
+
return y`<div part="divider"><span class="text">${o$3(this.label ? this.label : "")}<slot></slot></span></div>`;
|
|
8620
9207
|
}
|
|
8621
9208
|
};
|
|
8622
9209
|
Divider.styles = [
|
|
8623
9210
|
i$4`:host{--sc-divider-my:0.5rem;--sc-divider-mx:0;--sc-divider-border-width:max(1px, var(--sc-border-width));--sc-divider-border-color:var(--sc-border-color);--sc-divider-border-style:solid;--sc-divider-color:currentColor;--sc-divider-ff:var(--sc-font-family-base);--sc-divider-fs:1rem;--sc-divider-fw:var(--sc-font-weight-base);--sc-divider-fst:var(--sc-font-style-base);margin:var(--sc-divider-my) var(--sc-divider-mx);font-size:var(--sc-divider-fs);font-style:var(--sc-divider-fst);font-family:var(--sc-divider-ff);font-weight:var(--sc-divider-fw);color:var(--sc-divider-color);display:block}:host([size="2xs"]){--sc-divider-my:0.35rem;--sc-divider-fs:0.68rem}:host([size=xs]){--sc-divider-my:0.5rem;--sc-divider-fs:0.75rem}:host([size=sm]){--sc-divider-my:0.75rem;--sc-divider-fs:0.875rem}:host([size=md]){--sc-divider-my:1.25rem}:host([size=lg]){--sc-divider-my:1.85rem}:host([size=xl]){--sc-divider-my:2.25rem}:host([size="2xl"]){--sc-divider-my:3.35rem}div{display:flex;align-items:center;width:100%}div::after,div::before{content:"";flex-grow:1;border-top:var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);width:100%;opacity:var(--sc-divider-opacity,1)}:host([align=left]) div:before{display:none}:host([align=right]) div:after{display:none}:host([vertical]){margin:var(--sc-divider-mx) var(--sc-divider-my)}:host([vertical]) div{flex-direction:column;height:100%;min-height:var(--sc-form-height)}:host([vertical]) .has-text{gap:.25rem}:host([vertical]) div::after,:host([vertical]) div::before{border-top:none;border-left:var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color);width:auto;height:100%;opacity:var(--sc-divider-opacity,1)}:host([noMargin]){margin:0}.text{flex-shrink:0;line-height:1.1;max-width:80%}.no-text .text{display:none}.has-text{gap:.5rem}`
|
|
8624
9211
|
];
|
|
8625
9212
|
__decorateClass$e([
|
|
8626
|
-
o$
|
|
9213
|
+
o$9()
|
|
8627
9214
|
], Divider.prototype, "slotNodes", 2);
|
|
8628
9215
|
__decorateClass$e([
|
|
8629
9216
|
i$5("div")
|
|
@@ -8683,7 +9270,7 @@ var __decorateClass$c = (decorators, target, key, kind) => {
|
|
|
8683
9270
|
const tagName$c = "sonic-card-header";
|
|
8684
9271
|
let CardHeader = class extends s$3 {
|
|
8685
9272
|
render() {
|
|
8686
|
-
return y`<div class="header"><div class="header-content">${o$
|
|
9273
|
+
return y`<div class="header"><div class="header-content">${o$3(this.label)} ${this.description ? y`<sonic-card-header-description>${o$3(this.description)}</sonic-card-header-description>` : ""}<slot></slot></div><slot name="suffix"></slot></div>`;
|
|
8687
9274
|
}
|
|
8688
9275
|
};
|
|
8689
9276
|
CardHeader.styles = [
|