@warp-ds/elements 2.0.0-next.2 → 2.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +3 -6
- package/dist/api.js.map +1 -1
- package/dist/index.js +205 -255
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.d.ts +1 -1
- package/dist/packages/affix/index.js +35 -49
- package/dist/packages/affix/index.js.map +3 -3
- package/dist/packages/alert/index.js +39 -55
- package/dist/packages/alert/index.js.map +3 -3
- package/dist/packages/attention/index.js +118 -109
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +3 -7
- package/dist/packages/badge/index.js.map +2 -2
- package/dist/packages/box/index.d.ts +1 -1
- package/dist/packages/box/index.js +2 -5
- package/dist/packages/box/index.js.map +2 -2
- package/dist/packages/breadcrumbs/index.js +36 -53
- package/dist/packages/breadcrumbs/index.js.map +3 -3
- package/dist/packages/broadcast/index.js +2 -6
- package/dist/packages/broadcast/index.js.map +1 -1
- package/dist/packages/button/index.js +36 -54
- package/dist/packages/button/index.js.map +3 -3
- package/dist/packages/card/index.d.ts +2 -2
- package/dist/packages/card/index.js +3 -7
- package/dist/packages/card/index.js.map +2 -2
- package/dist/packages/expandable/index.d.ts +2 -2
- package/dist/packages/expandable/index.js +52 -68
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/modal/index.js +45 -69
- package/dist/packages/modal/index.js.map +3 -3
- package/dist/packages/modal/modal-header.d.ts +1 -1
- package/dist/packages/modal/modal-main.d.ts +3 -3
- package/dist/packages/pill/index.js +38 -56
- package/dist/packages/pill/index.js.map +3 -3
- package/dist/packages/select/index.js +54 -87
- package/dist/packages/select/index.js.map +3 -3
- package/dist/packages/textfield/index.js +7 -15
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/api.d.ts +1 -1
- package/dist/packages/toast/index.js +68 -110
- package/dist/packages/toast/index.js.map +3 -3
- package/dist/packages/toast/toast-container.d.ts +1 -1
- package/dist/packages/toast/toast.d.ts +2 -2
- package/dist/packages/utils/index.d.ts +1 -1
- package/package.json +27 -28
package/dist/index.js
CHANGED
|
@@ -8,6 +8,9 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __typeError = (msg) => {
|
|
12
|
+
throw TypeError(msg);
|
|
13
|
+
};
|
|
11
14
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
15
|
var __spreadValues = (a2, b2) => {
|
|
13
16
|
for (var prop in b2 || (b2 = {}))
|
|
@@ -52,23 +55,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
55
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
56
|
mod
|
|
54
57
|
));
|
|
55
|
-
var __publicField = (obj, key, value) =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var __accessCheck = (obj, member, msg) => {
|
|
60
|
-
if (!member.has(obj))
|
|
61
|
-
throw TypeError("Cannot " + msg);
|
|
62
|
-
};
|
|
63
|
-
var __privateGet = (obj, member, getter) => {
|
|
64
|
-
__accessCheck(obj, member, "read from private field");
|
|
65
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
66
|
-
};
|
|
67
|
-
var __privateAdd = (obj, member, value) => {
|
|
68
|
-
if (member.has(obj))
|
|
69
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
70
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
71
|
-
};
|
|
58
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
59
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
72
62
|
|
|
73
63
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
74
64
|
var require_errors = __commonJS({
|
|
@@ -241,8 +231,7 @@ var require_moo = __commonJS({
|
|
|
241
231
|
return "(" + s + ")";
|
|
242
232
|
}
|
|
243
233
|
function reUnion(regexps) {
|
|
244
|
-
if (!regexps.length)
|
|
245
|
-
return "(?!)";
|
|
234
|
+
if (!regexps.length) return "(?!)";
|
|
246
235
|
var source = regexps.map(function(s) {
|
|
247
236
|
return "(?:" + s + ")";
|
|
248
237
|
}).join("|");
|
|
@@ -252,14 +241,10 @@ var require_moo = __commonJS({
|
|
|
252
241
|
if (typeof obj === "string") {
|
|
253
242
|
return "(?:" + reEscape(obj) + ")";
|
|
254
243
|
} else if (isRegExp(obj)) {
|
|
255
|
-
if (obj.ignoreCase)
|
|
256
|
-
|
|
257
|
-
if (obj.
|
|
258
|
-
|
|
259
|
-
if (obj.sticky)
|
|
260
|
-
throw new Error("RegExp /y flag is implied");
|
|
261
|
-
if (obj.multiline)
|
|
262
|
-
throw new Error("RegExp /m flag is implied");
|
|
244
|
+
if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
|
|
245
|
+
if (obj.global) throw new Error("RegExp /g flag is implied");
|
|
246
|
+
if (obj.sticky) throw new Error("RegExp /y flag is implied");
|
|
247
|
+
if (obj.multiline) throw new Error("RegExp /m flag is implied");
|
|
263
248
|
return obj.source;
|
|
264
249
|
} else {
|
|
265
250
|
throw new Error("Not a pattern: " + obj);
|
|
@@ -308,16 +293,14 @@ var require_moo = __commonJS({
|
|
|
308
293
|
var match = [];
|
|
309
294
|
rules.forEach(function(rule) {
|
|
310
295
|
if (isObject(rule)) {
|
|
311
|
-
if (match.length)
|
|
312
|
-
result.push(ruleOptions(key, match));
|
|
296
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
313
297
|
result.push(ruleOptions(key, rule));
|
|
314
298
|
match = [];
|
|
315
299
|
} else {
|
|
316
300
|
match.push(rule);
|
|
317
301
|
}
|
|
318
302
|
});
|
|
319
|
-
if (match.length)
|
|
320
|
-
result.push(ruleOptions(key, match));
|
|
303
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
321
304
|
}
|
|
322
305
|
return result;
|
|
323
306
|
}
|
|
@@ -452,8 +435,7 @@ var require_moo = __commonJS({
|
|
|
452
435
|
var fallbackRule = errorRule && errorRule.fallback;
|
|
453
436
|
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
454
437
|
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
455
|
-
if (unicodeFlag === true)
|
|
456
|
-
flags += "u";
|
|
438
|
+
if (unicodeFlag === true) flags += "u";
|
|
457
439
|
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
458
440
|
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
459
441
|
}
|
|
@@ -474,8 +456,7 @@ var require_moo = __commonJS({
|
|
|
474
456
|
var all = states.$all ? toRules(states.$all) : [];
|
|
475
457
|
delete states.$all;
|
|
476
458
|
var keys2 = Object.getOwnPropertyNames(states);
|
|
477
|
-
if (!start)
|
|
478
|
-
start = keys2[0];
|
|
459
|
+
if (!start) start = keys2[0];
|
|
479
460
|
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
480
461
|
for (var i2 = 0; i2 < keys2.length; i2++) {
|
|
481
462
|
var key = keys2[i2];
|
|
@@ -487,8 +468,7 @@ var require_moo = __commonJS({
|
|
|
487
468
|
var included = /* @__PURE__ */ Object.create(null);
|
|
488
469
|
for (var j = 0; j < rules.length; j++) {
|
|
489
470
|
var rule = rules[j];
|
|
490
|
-
if (!rule.include)
|
|
491
|
-
continue;
|
|
471
|
+
if (!rule.include) continue;
|
|
492
472
|
var splice = [j, 1];
|
|
493
473
|
if (rule.include !== key && !included[rule.include]) {
|
|
494
474
|
included[rule.include] = true;
|
|
@@ -498,8 +478,7 @@ var require_moo = __commonJS({
|
|
|
498
478
|
}
|
|
499
479
|
for (var k = 0; k < newRules.length; k++) {
|
|
500
480
|
var newRule = newRules[k];
|
|
501
|
-
if (rules.indexOf(newRule) !== -1)
|
|
502
|
-
continue;
|
|
481
|
+
if (rules.indexOf(newRule) !== -1) continue;
|
|
503
482
|
splice.push(newRule);
|
|
504
483
|
}
|
|
505
484
|
}
|
|
@@ -580,8 +559,7 @@ var require_moo = __commonJS({
|
|
|
580
559
|
};
|
|
581
560
|
};
|
|
582
561
|
Lexer.prototype.setState = function(state) {
|
|
583
|
-
if (!state || this.state === state)
|
|
584
|
-
return;
|
|
562
|
+
if (!state || this.state === state) return;
|
|
585
563
|
this.state = state;
|
|
586
564
|
var info = this.states[state];
|
|
587
565
|
this.groups = info.groups;
|
|
@@ -649,7 +627,7 @@ var require_moo = __commonJS({
|
|
|
649
627
|
}
|
|
650
628
|
return this._token(group, text, index);
|
|
651
629
|
};
|
|
652
|
-
Lexer.prototype._token = function(group, text,
|
|
630
|
+
Lexer.prototype._token = function(group, text, offset3) {
|
|
653
631
|
var lineBreaks = 0;
|
|
654
632
|
if (group.lineBreaks) {
|
|
655
633
|
var matchNL = /\n/g;
|
|
@@ -668,7 +646,7 @@ var require_moo = __commonJS({
|
|
|
668
646
|
value: typeof group.value === "function" ? group.value(text) : text,
|
|
669
647
|
text,
|
|
670
648
|
toString: tokenToString,
|
|
671
|
-
offset:
|
|
649
|
+
offset: offset3,
|
|
672
650
|
lineBreaks,
|
|
673
651
|
line: this.line,
|
|
674
652
|
col: this.col
|
|
@@ -685,12 +663,9 @@ var require_moo = __commonJS({
|
|
|
685
663
|
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
686
664
|
throw err;
|
|
687
665
|
}
|
|
688
|
-
if (group.pop)
|
|
689
|
-
|
|
690
|
-
else if (group.
|
|
691
|
-
this.pushState(group.push);
|
|
692
|
-
else if (group.next)
|
|
693
|
-
this.setState(group.next);
|
|
666
|
+
if (group.pop) this.popState();
|
|
667
|
+
else if (group.push) this.pushState(group.push);
|
|
668
|
+
else if (group.next) this.setState(group.next);
|
|
694
669
|
return token;
|
|
695
670
|
};
|
|
696
671
|
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
@@ -1043,7 +1018,7 @@ var require_parser = __commonJS({
|
|
|
1043
1018
|
// packages/affix/index.js
|
|
1044
1019
|
import { html as html3 } from "lit";
|
|
1045
1020
|
|
|
1046
|
-
// node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.
|
|
1021
|
+
// node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.61.3_postcss@8.4.39_rollup@4.18.1_vite@_fn7nbuinwdlc4yeboswpxt5lie/node_modules/@warp-ds/css/component-classes/index.js
|
|
1047
1022
|
var badge = {
|
|
1048
1023
|
base: "py-4 px-8 border-0 rounded-4 text-xs inline-flex",
|
|
1049
1024
|
neutral: "bg-[--w-color-badge-neutral-background] s-text",
|
|
@@ -1452,14 +1427,14 @@ var attention = {
|
|
|
1452
1427
|
import WarpElement from "@warp-ds/elements-core";
|
|
1453
1428
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
1454
1429
|
|
|
1455
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1430
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/search-16.js
|
|
1456
1431
|
import { LitElement } from "lit";
|
|
1457
1432
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1458
1433
|
|
|
1459
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1434
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1460
1435
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1461
1436
|
|
|
1462
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1437
|
+
// node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1463
1438
|
var import_parser = __toESM(require_parser(), 1);
|
|
1464
1439
|
function processTokens(tokens, mapText) {
|
|
1465
1440
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1481,19 +1456,17 @@ function processTokens(tokens, mapText) {
|
|
|
1481
1456
|
return [token.arg, token.key];
|
|
1482
1457
|
}
|
|
1483
1458
|
}
|
|
1484
|
-
const
|
|
1459
|
+
const offset3 = token.pluralOffset;
|
|
1485
1460
|
const formatProps = {};
|
|
1486
|
-
token.cases.forEach((
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
mapText
|
|
1490
|
-
);
|
|
1461
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
1462
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
1463
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
1491
1464
|
});
|
|
1492
1465
|
return [
|
|
1493
1466
|
token.arg,
|
|
1494
1467
|
token.type,
|
|
1495
1468
|
__spreadValues({
|
|
1496
|
-
offset:
|
|
1469
|
+
offset: offset3
|
|
1497
1470
|
}, formatProps)
|
|
1498
1471
|
];
|
|
1499
1472
|
});
|
|
@@ -1509,7 +1482,7 @@ Message: ${message}`);
|
|
|
1509
1482
|
}
|
|
1510
1483
|
}
|
|
1511
1484
|
|
|
1512
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1485
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1513
1486
|
var isString = (s) => typeof s === "string";
|
|
1514
1487
|
var isFunction = (f2) => typeof f2 === "function";
|
|
1515
1488
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1535,7 +1508,7 @@ function number(locales, value, format) {
|
|
|
1535
1508
|
return formatter.format(value);
|
|
1536
1509
|
}
|
|
1537
1510
|
function plural(locales, ordinal, value, _a) {
|
|
1538
|
-
var _b = _a, { offset:
|
|
1511
|
+
var _b = _a, { offset: offset3 = 0 } = _b, rules = __objRest(_b, ["offset"]);
|
|
1539
1512
|
var _a2, _b2;
|
|
1540
1513
|
const _locales = normalizeLocales(locales);
|
|
1541
1514
|
const plurals = ordinal ? getMemoized(
|
|
@@ -1545,7 +1518,7 @@ function plural(locales, ordinal, value, _a) {
|
|
|
1545
1518
|
() => cacheKey("plural-cardinal", _locales),
|
|
1546
1519
|
() => new Intl.PluralRules(_locales, { type: "cardinal" })
|
|
1547
1520
|
);
|
|
1548
|
-
return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value -
|
|
1521
|
+
return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset3)]) != null ? _b2 : rules.other;
|
|
1549
1522
|
}
|
|
1550
1523
|
function getMemoized(getKey, construct) {
|
|
1551
1524
|
const key = getKey();
|
|
@@ -1574,14 +1547,14 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
|
1574
1547
|
};
|
|
1575
1548
|
return {
|
|
1576
1549
|
plural: (value, cases) => {
|
|
1577
|
-
const { offset:
|
|
1550
|
+
const { offset: offset3 = 0 } = cases;
|
|
1578
1551
|
const message = plural(locales, false, value, cases);
|
|
1579
|
-
return replaceOctothorpe(value -
|
|
1552
|
+
return replaceOctothorpe(value - offset3, message);
|
|
1580
1553
|
},
|
|
1581
1554
|
selectordinal: (value, cases) => {
|
|
1582
|
-
const { offset:
|
|
1555
|
+
const { offset: offset3 = 0 } = cases;
|
|
1583
1556
|
const message = plural(locales, true, value, cases);
|
|
1584
|
-
return replaceOctothorpe(value -
|
|
1557
|
+
return replaceOctothorpe(value - offset3, message);
|
|
1585
1558
|
},
|
|
1586
1559
|
select: selectFormatter,
|
|
1587
1560
|
number: (value, format) => number(locales, value, style(format)),
|
|
@@ -1595,11 +1568,11 @@ var selectFormatter = (value, rules) => {
|
|
|
1595
1568
|
function interpolate(translation, locale, locales) {
|
|
1596
1569
|
return (values = {}, formats) => {
|
|
1597
1570
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1598
|
-
const formatMessage = (tokens) => {
|
|
1571
|
+
const formatMessage = (tokens, replaceOctothorpe = false) => {
|
|
1599
1572
|
if (!Array.isArray(tokens))
|
|
1600
1573
|
return tokens;
|
|
1601
1574
|
return tokens.reduce((message, token) => {
|
|
1602
|
-
if (token === "#") {
|
|
1575
|
+
if (token === "#" && replaceOctothorpe) {
|
|
1603
1576
|
return message + OCTOTHORPE_PH;
|
|
1604
1577
|
}
|
|
1605
1578
|
if (isString(token)) {
|
|
@@ -1610,7 +1583,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1610
1583
|
if (type === "plural" || type === "selectordinal" || type === "select") {
|
|
1611
1584
|
Object.entries(format).forEach(
|
|
1612
1585
|
([key, value2]) => {
|
|
1613
|
-
interpolatedFormat[key] = formatMessage(
|
|
1586
|
+
interpolatedFormat[key] = formatMessage(
|
|
1587
|
+
value2,
|
|
1588
|
+
type === "plural" || type === "selectordinal"
|
|
1589
|
+
);
|
|
1614
1590
|
}
|
|
1615
1591
|
);
|
|
1616
1592
|
} else {
|
|
@@ -1778,6 +1754,9 @@ var I18n = class extends EventEmitter {
|
|
|
1778
1754
|
}
|
|
1779
1755
|
_(id, values, options) {
|
|
1780
1756
|
let message = options == null ? void 0 : options.message;
|
|
1757
|
+
if (!id) {
|
|
1758
|
+
id = "";
|
|
1759
|
+
}
|
|
1781
1760
|
if (!isString(id)) {
|
|
1782
1761
|
values = id.values || values;
|
|
1783
1762
|
message = id.message;
|
|
@@ -1818,7 +1797,7 @@ function setupI18n(params = {}) {
|
|
|
1818
1797
|
}
|
|
1819
1798
|
var i18n = setupI18n();
|
|
1820
1799
|
|
|
1821
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1800
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/search-16.js
|
|
1822
1801
|
var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
|
|
1823
1802
|
var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
|
|
1824
1803
|
var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
|
|
@@ -1907,7 +1886,7 @@ if (!customElements.get("w-icon-search-16")) {
|
|
|
1907
1886
|
customElements.define("w-icon-search-16", IconSearch16);
|
|
1908
1887
|
}
|
|
1909
1888
|
|
|
1910
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1889
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
|
|
1911
1890
|
import { LitElement as LitElement2 } from "lit";
|
|
1912
1891
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1913
1892
|
var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');
|
|
@@ -2017,8 +1996,7 @@ function kebabCaseAttributes(constructor) {
|
|
|
2017
1996
|
function classes(defn) {
|
|
2018
1997
|
const classes3 = [];
|
|
2019
1998
|
for (const [key, value] of Object.entries(defn)) {
|
|
2020
|
-
if (value)
|
|
2021
|
-
classes3.push(key);
|
|
1999
|
+
if (value) classes3.push(key);
|
|
2022
2000
|
}
|
|
2023
2001
|
return classes3.join(" ");
|
|
2024
2002
|
}
|
|
@@ -2097,8 +2075,7 @@ import { css, html as html8 } from "lit";
|
|
|
2097
2075
|
|
|
2098
2076
|
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
2099
2077
|
var r = function() {
|
|
2100
|
-
for (var t = [], n2 = arguments.length; n2--; )
|
|
2101
|
-
t[n2] = arguments[n2];
|
|
2078
|
+
for (var t = [], n2 = arguments.length; n2--; ) t[n2] = arguments[n2];
|
|
2102
2079
|
return t.reduce(function(t2, n3) {
|
|
2103
2080
|
return t2.concat("string" == typeof n3 ? n3 : Array.isArray(n3) ? r.apply(void 0, n3) : "object" == typeof n3 && n3 ? Object.keys(n3).map(function(r3) {
|
|
2104
2081
|
return n3[r3] ? r3 : "";
|
|
@@ -2109,7 +2086,7 @@ var r = function() {
|
|
|
2109
2086
|
// packages/alert/index.js
|
|
2110
2087
|
import WarpElement2 from "@warp-ds/elements-core";
|
|
2111
2088
|
|
|
2112
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2089
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
2113
2090
|
import { LitElement as LitElement3 } from "lit";
|
|
2114
2091
|
import { unsafeStatic as unsafeStatic3, html as html4 } from "lit/static-html.js";
|
|
2115
2092
|
var messages5 = JSON.parse('{"icon.title.info":"Informasjonssirkel"}');
|
|
@@ -2200,7 +2177,7 @@ if (!customElements.get("w-icon-info-16")) {
|
|
|
2200
2177
|
customElements.define("w-icon-info-16", IconInfo16);
|
|
2201
2178
|
}
|
|
2202
2179
|
|
|
2203
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2180
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/warning-16.js
|
|
2204
2181
|
import { LitElement as LitElement4 } from "lit";
|
|
2205
2182
|
import { unsafeStatic as unsafeStatic4, html as html5 } from "lit/static-html.js";
|
|
2206
2183
|
var messages6 = JSON.parse('{"icon.title.warning":"Varseltrekant med utropstegn"}');
|
|
@@ -2291,7 +2268,7 @@ if (!customElements.get("w-icon-warning-16")) {
|
|
|
2291
2268
|
customElements.define("w-icon-warning-16", IconWarning16);
|
|
2292
2269
|
}
|
|
2293
2270
|
|
|
2294
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2271
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/error-16.js
|
|
2295
2272
|
import { LitElement as LitElement5 } from "lit";
|
|
2296
2273
|
import { unsafeStatic as unsafeStatic5, html as html6 } from "lit/static-html.js";
|
|
2297
2274
|
var messages7 = JSON.parse('{"icon.title.error":"\xC5ttekant med utropstegn"}');
|
|
@@ -2382,7 +2359,7 @@ if (!customElements.get("w-icon-error-16")) {
|
|
|
2382
2359
|
customElements.define("w-icon-error-16", IconError16);
|
|
2383
2360
|
}
|
|
2384
2361
|
|
|
2385
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2362
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/success-16.js
|
|
2386
2363
|
import { LitElement as LitElement6 } from "lit";
|
|
2387
2364
|
import { unsafeStatic as unsafeStatic6, html as html7 } from "lit/static-html.js";
|
|
2388
2365
|
var messages8 = JSON.parse('{"icon.title.success":"Sirkel med sjekkmerke"}');
|
|
@@ -2517,8 +2494,7 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2517
2494
|
}
|
|
2518
2495
|
if (this.variant === variants.positive) {
|
|
2519
2496
|
return html8`<w-icon-success-16></w-icon-success-16>`;
|
|
2520
|
-
} else
|
|
2521
|
-
return "";
|
|
2497
|
+
} else return "";
|
|
2522
2498
|
}
|
|
2523
2499
|
render() {
|
|
2524
2500
|
return html8`
|
|
@@ -2563,7 +2539,7 @@ if (!customElements.get("w-alert")) {
|
|
|
2563
2539
|
// packages/attention/index.js
|
|
2564
2540
|
import { css as css2, html as html9, nothing } from "lit";
|
|
2565
2541
|
|
|
2566
|
-
// node_modules/.pnpm/@floating-ui+utils@0.2.
|
|
2542
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.4/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
2567
2543
|
var sides = ["top", "right", "bottom", "left"];
|
|
2568
2544
|
var min = Math.min;
|
|
2569
2545
|
var max = Math.max;
|
|
@@ -2634,8 +2610,7 @@ function getSideList(side2, isStart, rtl) {
|
|
|
2634
2610
|
switch (side2) {
|
|
2635
2611
|
case "top":
|
|
2636
2612
|
case "bottom":
|
|
2637
|
-
if (rtl)
|
|
2638
|
-
return isStart ? rl : lr;
|
|
2613
|
+
if (rtl) return isStart ? rl : lr;
|
|
2639
2614
|
return isStart ? lr : rl;
|
|
2640
2615
|
case "left":
|
|
2641
2616
|
case "right":
|
|
@@ -2693,7 +2668,7 @@ function rectToClientRect(rect) {
|
|
|
2693
2668
|
};
|
|
2694
2669
|
}
|
|
2695
2670
|
|
|
2696
|
-
// node_modules/.pnpm/@floating-ui+core@1.6.
|
|
2671
|
+
// node_modules/.pnpm/@floating-ui+core@1.6.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
2697
2672
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
2698
2673
|
let {
|
|
2699
2674
|
reference,
|
|
@@ -2930,14 +2905,14 @@ var arrow = (options) => ({
|
|
|
2930
2905
|
const min$1 = minPadding;
|
|
2931
2906
|
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
2932
2907
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2933
|
-
const
|
|
2934
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !==
|
|
2908
|
+
const offset3 = clamp(min$1, center, max2);
|
|
2909
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2935
2910
|
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
2936
2911
|
return {
|
|
2937
2912
|
[axis]: coords[axis] + alignmentOffset,
|
|
2938
2913
|
data: __spreadValues({
|
|
2939
|
-
[axis]:
|
|
2940
|
-
centerOffset: center -
|
|
2914
|
+
[axis]: offset3,
|
|
2915
|
+
centerOffset: center - offset3 - alignmentOffset
|
|
2941
2916
|
}, shouldAddOffset && {
|
|
2942
2917
|
alignmentOffset
|
|
2943
2918
|
}),
|
|
@@ -2981,10 +2956,12 @@ var flip = function(options) {
|
|
|
2981
2956
|
return {};
|
|
2982
2957
|
}
|
|
2983
2958
|
const side2 = getSide(placement);
|
|
2959
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
2984
2960
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
2985
2961
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
2986
2962
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
2987
|
-
|
|
2963
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
2964
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
2988
2965
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
2989
2966
|
}
|
|
2990
2967
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
@@ -3021,8 +2998,16 @@ var flip = function(options) {
|
|
|
3021
2998
|
if (!resetPlacement) {
|
|
3022
2999
|
switch (fallbackStrategy) {
|
|
3023
3000
|
case "bestFit": {
|
|
3024
|
-
var _overflowsData$
|
|
3025
|
-
const placement2 = (_overflowsData$
|
|
3001
|
+
var _overflowsData$filter2;
|
|
3002
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
|
|
3003
|
+
if (hasFallbackAxisSideDirection) {
|
|
3004
|
+
const currentSideAxis = getSideAxis(d2.placement);
|
|
3005
|
+
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
3006
|
+
// reading directions favoring greater width.
|
|
3007
|
+
currentSideAxis === "y";
|
|
3008
|
+
}
|
|
3009
|
+
return true;
|
|
3010
|
+
}).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
3026
3011
|
if (placement2) {
|
|
3027
3012
|
resetPlacement = placement2;
|
|
3028
3013
|
}
|
|
@@ -3171,7 +3156,7 @@ var offset = function(options) {
|
|
|
3171
3156
|
};
|
|
3172
3157
|
};
|
|
3173
3158
|
|
|
3174
|
-
// node_modules/.pnpm/@floating-ui+utils@0.2.
|
|
3159
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.4/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
3175
3160
|
function getNodeName(node) {
|
|
3176
3161
|
if (isNode(node)) {
|
|
3177
3162
|
return (node.nodeName || "").toLowerCase();
|
|
@@ -3213,6 +3198,15 @@ function isOverflowElement(element) {
|
|
|
3213
3198
|
function isTableElement(element) {
|
|
3214
3199
|
return ["table", "td", "th"].includes(getNodeName(element));
|
|
3215
3200
|
}
|
|
3201
|
+
function isTopLayer(element) {
|
|
3202
|
+
return [":popover-open", ":modal"].some((selector) => {
|
|
3203
|
+
try {
|
|
3204
|
+
return element.matches(selector);
|
|
3205
|
+
} catch (e) {
|
|
3206
|
+
return false;
|
|
3207
|
+
}
|
|
3208
|
+
});
|
|
3209
|
+
}
|
|
3216
3210
|
function isContainingBlock(element) {
|
|
3217
3211
|
const webkit = isWebKit();
|
|
3218
3212
|
const css11 = getComputedStyle(element);
|
|
@@ -3221,6 +3215,9 @@ function isContainingBlock(element) {
|
|
|
3221
3215
|
function getContainingBlock(element) {
|
|
3222
3216
|
let currentNode = getParentNode(element);
|
|
3223
3217
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3218
|
+
if (isTopLayer(currentNode)) {
|
|
3219
|
+
return null;
|
|
3220
|
+
}
|
|
3224
3221
|
if (isContainingBlock(currentNode)) {
|
|
3225
3222
|
return currentNode;
|
|
3226
3223
|
}
|
|
@@ -3229,8 +3226,7 @@ function getContainingBlock(element) {
|
|
|
3229
3226
|
return null;
|
|
3230
3227
|
}
|
|
3231
3228
|
function isWebKit() {
|
|
3232
|
-
if (typeof CSS === "undefined" || !CSS.supports)
|
|
3233
|
-
return false;
|
|
3229
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
3234
3230
|
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
3235
3231
|
}
|
|
3236
3232
|
function isLastTraversableNode(node) {
|
|
@@ -3247,8 +3243,8 @@ function getNodeScroll(element) {
|
|
|
3247
3243
|
};
|
|
3248
3244
|
}
|
|
3249
3245
|
return {
|
|
3250
|
-
scrollLeft: element.
|
|
3251
|
-
scrollTop: element.
|
|
3246
|
+
scrollLeft: element.scrollX,
|
|
3247
|
+
scrollTop: element.scrollY
|
|
3252
3248
|
};
|
|
3253
3249
|
}
|
|
3254
3250
|
function getParentNode(node) {
|
|
@@ -3291,7 +3287,7 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
3291
3287
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3292
3288
|
}
|
|
3293
3289
|
|
|
3294
|
-
// node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
3290
|
+
// node_modules/.pnpm/@floating-ui+dom@1.6.7/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
3295
3291
|
function getCssDimensions(element) {
|
|
3296
3292
|
const css11 = getComputedStyle(element);
|
|
3297
3293
|
let width = parseFloat(css11.width) || 0;
|
|
@@ -3409,16 +3405,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3409
3405
|
y: y2
|
|
3410
3406
|
});
|
|
3411
3407
|
}
|
|
3412
|
-
var topLayerSelectors = [":popover-open", ":modal"];
|
|
3413
|
-
function isTopLayer(floating) {
|
|
3414
|
-
return topLayerSelectors.some((selector) => {
|
|
3415
|
-
try {
|
|
3416
|
-
return floating.matches(selector);
|
|
3417
|
-
} catch (e) {
|
|
3418
|
-
return false;
|
|
3419
|
-
}
|
|
3420
|
-
});
|
|
3421
|
-
}
|
|
3422
3408
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
3423
3409
|
let {
|
|
3424
3410
|
elements,
|
|
@@ -3578,7 +3564,7 @@ function getClippingRect(_ref) {
|
|
|
3578
3564
|
rootBoundary,
|
|
3579
3565
|
strategy
|
|
3580
3566
|
} = _ref;
|
|
3581
|
-
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
3567
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
3582
3568
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
3583
3569
|
const firstClippingAncestor = clippingAncestors[0];
|
|
3584
3570
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -3637,6 +3623,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3637
3623
|
height: rect.height
|
|
3638
3624
|
};
|
|
3639
3625
|
}
|
|
3626
|
+
function isStaticPositioned(element) {
|
|
3627
|
+
return getComputedStyle(element).position === "static";
|
|
3628
|
+
}
|
|
3640
3629
|
function getTrueOffsetParent(element, polyfill) {
|
|
3641
3630
|
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
3642
3631
|
return null;
|
|
@@ -3647,28 +3636,41 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
3647
3636
|
return element.offsetParent;
|
|
3648
3637
|
}
|
|
3649
3638
|
function getOffsetParent(element, polyfill) {
|
|
3650
|
-
const
|
|
3651
|
-
if (
|
|
3652
|
-
return
|
|
3639
|
+
const win = getWindow(element);
|
|
3640
|
+
if (isTopLayer(element)) {
|
|
3641
|
+
return win;
|
|
3642
|
+
}
|
|
3643
|
+
if (!isHTMLElement(element)) {
|
|
3644
|
+
let svgOffsetParent = getParentNode(element);
|
|
3645
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
3646
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
3647
|
+
return svgOffsetParent;
|
|
3648
|
+
}
|
|
3649
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
3650
|
+
}
|
|
3651
|
+
return win;
|
|
3653
3652
|
}
|
|
3654
3653
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
3655
|
-
while (offsetParent && isTableElement(offsetParent) &&
|
|
3654
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
3656
3655
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
3657
3656
|
}
|
|
3658
|
-
if (offsetParent && (
|
|
3659
|
-
return
|
|
3657
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
3658
|
+
return win;
|
|
3660
3659
|
}
|
|
3661
|
-
return offsetParent || getContainingBlock(element) ||
|
|
3660
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
3662
3661
|
}
|
|
3663
3662
|
var getElementRects = async function(data) {
|
|
3664
3663
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
3665
3664
|
const getDimensionsFn = this.getDimensions;
|
|
3665
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
3666
3666
|
return {
|
|
3667
3667
|
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
3668
|
-
floating:
|
|
3668
|
+
floating: {
|
|
3669
3669
|
x: 0,
|
|
3670
|
-
y: 0
|
|
3671
|
-
|
|
3670
|
+
y: 0,
|
|
3671
|
+
width: floatingDimensions.width,
|
|
3672
|
+
height: floatingDimensions.height
|
|
3673
|
+
}
|
|
3672
3674
|
};
|
|
3673
3675
|
};
|
|
3674
3676
|
function isRTL(element) {
|
|
@@ -3686,6 +3688,7 @@ var platform = {
|
|
|
3686
3688
|
isElement,
|
|
3687
3689
|
isRTL
|
|
3688
3690
|
};
|
|
3691
|
+
var offset2 = offset;
|
|
3689
3692
|
var flip2 = flip;
|
|
3690
3693
|
var hide2 = hide;
|
|
3691
3694
|
var arrow2 = arrow;
|
|
@@ -3702,7 +3705,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
3702
3705
|
}));
|
|
3703
3706
|
};
|
|
3704
3707
|
|
|
3705
|
-
// node_modules/.pnpm/@warp-ds+core@1.1.
|
|
3708
|
+
// node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.7/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
|
|
3706
3709
|
var TOP_START = "top-start";
|
|
3707
3710
|
var TOP = "top";
|
|
3708
3711
|
var TOP_END = "top-end";
|
|
@@ -3793,10 +3796,12 @@ async function useRecompute(state) {
|
|
|
3793
3796
|
computePosition2(targetEl, attentionEl, {
|
|
3794
3797
|
placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
|
|
3795
3798
|
middleware: [
|
|
3796
|
-
|
|
3799
|
+
offset2({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
|
|
3800
|
+
// offers flexibility over how to place the attentionEl towards its targetEl both on the x and y axis (horizontally and vertically).
|
|
3797
3801
|
(state == null ? void 0 : state.flip) && flip2({
|
|
3798
3802
|
// when flip is set to true it will move the attentionEl's placement to its opposite side or to the preferred placements if fallbackPlacements has a value
|
|
3799
3803
|
crossAxis: state == null ? void 0 : state.crossAxis,
|
|
3804
|
+
// checks overflow to trigger a flip. When disabled, it will ignore overflow
|
|
3800
3805
|
fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
|
|
3801
3806
|
}),
|
|
3802
3807
|
!(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
|
|
@@ -3878,12 +3883,9 @@ function detectLocale7() {
|
|
|
3878
3883
|
}
|
|
3879
3884
|
}
|
|
3880
3885
|
var getMessages7 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
3881
|
-
if (locale === "nb")
|
|
3882
|
-
|
|
3883
|
-
if (locale === "
|
|
3884
|
-
return fiMsg;
|
|
3885
|
-
if (locale === "da")
|
|
3886
|
-
return daMsg;
|
|
3886
|
+
if (locale === "nb") return nbMsg;
|
|
3887
|
+
if (locale === "fi") return fiMsg;
|
|
3888
|
+
if (locale === "da") return daMsg;
|
|
3887
3889
|
return enMsg;
|
|
3888
3890
|
};
|
|
3889
3891
|
var activateI18n7 = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
@@ -4153,16 +4155,14 @@ ${JSON.stringify(directions)}`
|
|
|
4153
4155
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
4154
4156
|
}
|
|
4155
4157
|
keypressed(e) {
|
|
4156
|
-
if (!this.canClose)
|
|
4157
|
-
return;
|
|
4158
|
+
if (!this.canClose) return;
|
|
4158
4159
|
if (e.key === "Escape") {
|
|
4159
4160
|
e.preventDefault();
|
|
4160
4161
|
this.close();
|
|
4161
4162
|
}
|
|
4162
4163
|
}
|
|
4163
4164
|
render() {
|
|
4164
|
-
if (!this.callout && this._targetEl === void 0)
|
|
4165
|
-
return html9``;
|
|
4165
|
+
if (!this.callout && this._targetEl === void 0) return html9``;
|
|
4166
4166
|
return html9`
|
|
4167
4167
|
<div class=${ifDefined2(this.className ? this.className : void 0)}>
|
|
4168
4168
|
${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html9`
|
|
@@ -4330,7 +4330,7 @@ if (!customElements.get("w-box")) {
|
|
|
4330
4330
|
// packages/breadcrumbs/index.js
|
|
4331
4331
|
import { html as html12 } from "lit";
|
|
4332
4332
|
|
|
4333
|
-
// node_modules/.pnpm/@warp-ds+core@1.1.
|
|
4333
|
+
// node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.7/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
|
|
4334
4334
|
function interleave(array, separator2) {
|
|
4335
4335
|
return array.flatMap((el) => [el, separator2]).slice(0, -1);
|
|
4336
4336
|
}
|
|
@@ -4451,8 +4451,7 @@ __publicField(WarpBroadcast, "properties", {
|
|
|
4451
4451
|
_messages: {
|
|
4452
4452
|
state: true,
|
|
4453
4453
|
hasChanged(newVal, oldVal) {
|
|
4454
|
-
if (!oldVal || oldVal.length === 0)
|
|
4455
|
-
return true;
|
|
4454
|
+
if (!oldVal || oldVal.length === 0) return true;
|
|
4456
4455
|
const newIds = newVal.map(({ id }) => id).sort();
|
|
4457
4456
|
const oldIds = oldVal.map(({ id }) => id).sort();
|
|
4458
4457
|
return JSON.stringify(newIds) !== JSON.stringify(oldIds);
|
|
@@ -4639,8 +4638,7 @@ var WarpCard = class extends WarpElement9 {
|
|
|
4639
4638
|
return html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
|
|
4640
4639
|
}
|
|
4641
4640
|
keypressed(e) {
|
|
4642
|
-
if (!this.clickable || e.altKey || e.ctrlKey)
|
|
4643
|
-
return;
|
|
4641
|
+
if (!this.clickable || e.altKey || e.ctrlKey) return;
|
|
4644
4642
|
if (e.key === keys.ENTER || e.key === keys.SPACE) {
|
|
4645
4643
|
e.preventDefault();
|
|
4646
4644
|
this.click();
|
|
@@ -4686,7 +4684,7 @@ import { css as css5, html as html18 } from "lit";
|
|
|
4686
4684
|
import WarpElement10 from "@warp-ds/elements-core";
|
|
4687
4685
|
import { ifDefined as ifDefined4 } from "lit/directives/if-defined.js";
|
|
4688
4686
|
|
|
4689
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
4687
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
4690
4688
|
import { LitElement as LitElement7 } from "lit";
|
|
4691
4689
|
import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
|
|
4692
4690
|
var messages21 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
@@ -4777,7 +4775,7 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
4777
4775
|
customElements.define("w-icon-chevron-down-16", IconChevronDown16);
|
|
4778
4776
|
}
|
|
4779
4777
|
|
|
4780
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
4778
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
|
|
4781
4779
|
import { LitElement as LitElement8 } from "lit";
|
|
4782
4780
|
import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
|
|
4783
4781
|
var messages28 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
|
|
@@ -4893,61 +4891,61 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
|
4893
4891
|
}
|
|
4894
4892
|
get _expandableSlot() {
|
|
4895
4893
|
return html18`<div
|
|
4896
|
-
class
|
|
4894
|
+
class="${classes({
|
|
4897
4895
|
[this.contentClass || ""]: true,
|
|
4898
4896
|
[box.box]: this.box,
|
|
4899
4897
|
[expandable.paddingTop]: this._hasTitle && this.box
|
|
4900
|
-
})}>
|
|
4898
|
+
})}">
|
|
4901
4899
|
<slot></slot>
|
|
4902
4900
|
</div>`;
|
|
4903
4901
|
}
|
|
4904
4902
|
get _chevronUpClasses() {
|
|
4905
|
-
return
|
|
4903
|
+
return classes({
|
|
4906
4904
|
[expandable.elementsTransformChevronUpPart]: true,
|
|
4907
4905
|
[expandable.elementsChevronUpCollapsePart]: !this.expanded && this._showChevronUp
|
|
4908
4906
|
});
|
|
4909
4907
|
}
|
|
4910
4908
|
get _chevronDownClasses() {
|
|
4911
|
-
return
|
|
4909
|
+
return classes({
|
|
4912
4910
|
[expandable.elementsTransformChevronDownPart]: true,
|
|
4913
4911
|
[expandable.elementsChevronDownExpandPart]: this.expanded && !this._showChevronUp
|
|
4914
4912
|
});
|
|
4915
4913
|
}
|
|
4916
4914
|
render() {
|
|
4917
4915
|
return html18` <div
|
|
4918
|
-
class
|
|
4916
|
+
class="${classes({
|
|
4919
4917
|
[expandable.expandable]: true,
|
|
4920
4918
|
[expandable.expandableBox]: this.box,
|
|
4921
4919
|
[expandable.expandableBleed]: this.bleed
|
|
4922
|
-
})}>
|
|
4920
|
+
})}">
|
|
4923
4921
|
${this._hasTitle ? html18`<w-unstyled-heading level=${this.headingLevel}>
|
|
4924
4922
|
<button
|
|
4925
4923
|
type="button"
|
|
4926
4924
|
aria-expanded="${this.expanded}"
|
|
4927
|
-
class
|
|
4925
|
+
class="${classes({
|
|
4928
4926
|
[this.buttonClass || ""]: true,
|
|
4929
4927
|
[expandable.button]: true,
|
|
4930
4928
|
[expandable.buttonBox]: this.box
|
|
4931
|
-
})}
|
|
4929
|
+
})}"
|
|
4932
4930
|
@click=${() => this.expanded = !this.expanded}>
|
|
4933
4931
|
<div class="${expandable.title}">
|
|
4934
4932
|
${this.title ? html18`<span class="${expandable.titleType}">${this.title}</span>` : html18`<slot name="title"></slot>`}
|
|
4935
4933
|
${this.noChevron ? "" : html18`<div
|
|
4936
|
-
class
|
|
4934
|
+
class="${classes({
|
|
4937
4935
|
[expandable.chevron]: true,
|
|
4938
4936
|
[expandable.chevronBox]: this.box,
|
|
4939
4937
|
[expandable.chevronNonBox]: !this.box
|
|
4940
|
-
})}>
|
|
4938
|
+
})}">
|
|
4941
4939
|
${this._showChevronUp ? html18`<w-icon-chevron-up-16 class="${this._chevronUpClasses}"></w-icon-chevron-up-16>` : html18`<w-icon-chevron-down-16 class="${this._chevronDownClasses}"></w-icon-chevron-down-16>`}
|
|
4942
4940
|
</div>`}
|
|
4943
4941
|
</div>
|
|
4944
4942
|
</button>
|
|
4945
4943
|
</w-unstyled-heading>` : ""}
|
|
4946
4944
|
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html18`<div
|
|
4947
|
-
class
|
|
4945
|
+
class="${classes({
|
|
4948
4946
|
[expandable.expansion]: true,
|
|
4949
4947
|
[expandable.expansionNotExpanded]: !this.expanded
|
|
4950
|
-
})}
|
|
4948
|
+
})}"
|
|
4951
4949
|
aria-hidden=${ifDefined4(!this.expanded ? true : void 0)}>
|
|
4952
4950
|
${this._expandableSlot}
|
|
4953
4951
|
</div>`}
|
|
@@ -5049,8 +5047,7 @@ var windowExists2 = typeof window !== "undefined";
|
|
|
5049
5047
|
if (windowExists2) {
|
|
5050
5048
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5051
5049
|
const callback = ({ matches }) => reduceMotion = matches;
|
|
5052
|
-
if (query.addEventListener)
|
|
5053
|
-
query.addEventListener("change", callback);
|
|
5050
|
+
if (query.addEventListener) query.addEventListener("change", callback);
|
|
5054
5051
|
callback(query);
|
|
5055
5052
|
}
|
|
5056
5053
|
|
|
@@ -5081,8 +5078,7 @@ var Move = class {
|
|
|
5081
5078
|
}
|
|
5082
5079
|
async play() {
|
|
5083
5080
|
this.last = this.el.getBoundingClientRect();
|
|
5084
|
-
if (!this.el.animate)
|
|
5085
|
-
return;
|
|
5081
|
+
if (!this.el.animate) return;
|
|
5086
5082
|
const animation = this.el.animate(this.keyframes, this.animationOptions);
|
|
5087
5083
|
await animation.finished;
|
|
5088
5084
|
}
|
|
@@ -5096,15 +5092,13 @@ var Move = class {
|
|
|
5096
5092
|
return __spreadValues(__spreadValues({}, this.defaults), this.userAnimationOptions);
|
|
5097
5093
|
}
|
|
5098
5094
|
get animationOptions() {
|
|
5099
|
-
if (!this.shouldReduceMotion)
|
|
5100
|
-
|
|
5101
|
-
if (!reduceMotion)
|
|
5102
|
-
return this.mergedOptions;
|
|
5095
|
+
if (!this.shouldReduceMotion) return this.mergedOptions;
|
|
5096
|
+
if (!reduceMotion) return this.mergedOptions;
|
|
5103
5097
|
return __spreadProps(__spreadValues({}, this.mergedOptions), { duration: 0 });
|
|
5104
5098
|
}
|
|
5105
5099
|
};
|
|
5106
5100
|
|
|
5107
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
5101
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
|
|
5108
5102
|
import { LitElement as LitElement9 } from "lit";
|
|
5109
5103
|
import { unsafeStatic as unsafeStatic9, html as html20 } from "lit/static-html.js";
|
|
5110
5104
|
var messages30 = JSON.parse('{"icon.title.arrow-left":"Pil som peker mot venstre"}');
|
|
@@ -5238,8 +5232,7 @@ var ModalHeader = class extends CanCloseMixin(WarpElement12) {
|
|
|
5238
5232
|
</button>` : nothing3;
|
|
5239
5233
|
}
|
|
5240
5234
|
get closeButton() {
|
|
5241
|
-
if (this[NO_CLOSE_BUTTON])
|
|
5242
|
-
return nothing3;
|
|
5235
|
+
if (this[NO_CLOSE_BUTTON]) return nothing3;
|
|
5243
5236
|
return html21` <button
|
|
5244
5237
|
type="button"
|
|
5245
5238
|
class="${modalElement.headerButton} ${this._hasTopContent ? modalElement.headerCloseButtonOnImage : modalElement.headerCloseButton}"
|
|
@@ -5376,13 +5369,11 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5376
5369
|
`;
|
|
5377
5370
|
}
|
|
5378
5371
|
willUpdate(changedProperties) {
|
|
5379
|
-
if (changedProperties.has("show"))
|
|
5380
|
-
this[this.show ? "open" : "close"]();
|
|
5372
|
+
if (changedProperties.has("show")) this[this.show ? "open" : "close"]();
|
|
5381
5373
|
}
|
|
5382
5374
|
handleListeners(verb = "addEventListener") {
|
|
5383
5375
|
document[verb]("keydown", this.interceptEscape);
|
|
5384
|
-
if (!this[NO_BACKDROP_CLICKS])
|
|
5385
|
-
this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
|
|
5376
|
+
if (!this[NO_BACKDROP_CLICKS]) this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
|
|
5386
5377
|
this.dialogEl.value[verb]("close", this.eventPreventer);
|
|
5387
5378
|
this.dialogEl.value[verb]("cancel", this.eventPreventer);
|
|
5388
5379
|
this.dialogInnerEl.value[verb]("transitionend", this.modifyBorderRadius);
|
|
@@ -5393,8 +5384,7 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5393
5384
|
}
|
|
5394
5385
|
/** @param {MouseEvent} evt */
|
|
5395
5386
|
closeOnBackdropClick(evt) {
|
|
5396
|
-
if (this.dialogEl.value === evt.target)
|
|
5397
|
-
this.close();
|
|
5387
|
+
if (this.dialogEl.value === evt.target) this.close();
|
|
5398
5388
|
}
|
|
5399
5389
|
/** @param {KeyboardEvent} evt */
|
|
5400
5390
|
interceptEscape(evt) {
|
|
@@ -5404,10 +5394,8 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5404
5394
|
}
|
|
5405
5395
|
}
|
|
5406
5396
|
modifyBorderRadius() {
|
|
5407
|
-
if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight)
|
|
5408
|
-
|
|
5409
|
-
else
|
|
5410
|
-
this.dialogInnerEl.value.style.borderRadius = null;
|
|
5397
|
+
if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight) this.dialogInnerEl.value.style.borderRadius = "0px";
|
|
5398
|
+
else this.dialogInnerEl.value.style.borderRadius = null;
|
|
5411
5399
|
}
|
|
5412
5400
|
};
|
|
5413
5401
|
__publicField(ModalMain, "properties", {
|
|
@@ -5586,15 +5574,11 @@ var messages45 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
|
|
|
5586
5574
|
var messages46 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
|
|
5587
5575
|
|
|
5588
5576
|
// packages/select/index.js
|
|
5589
|
-
var
|
|
5577
|
+
var _WarpSelect_instances, classes_get, helpTextClasses_get, chevronClasses_get, id_get, helpId_get;
|
|
5590
5578
|
var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
5591
5579
|
constructor() {
|
|
5592
5580
|
super();
|
|
5593
|
-
__privateAdd(this,
|
|
5594
|
-
__privateAdd(this, _helpTextClasses);
|
|
5595
|
-
__privateAdd(this, _chevronClasses);
|
|
5596
|
-
__privateAdd(this, _id);
|
|
5597
|
-
__privateAdd(this, _helpId);
|
|
5581
|
+
__privateAdd(this, _WarpSelect_instances);
|
|
5598
5582
|
activateI18n7(messages44, messages46, messages45, messages43);
|
|
5599
5583
|
this._options = this.innerHTML;
|
|
5600
5584
|
}
|
|
@@ -5602,7 +5586,7 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
|
5602
5586
|
return html24`<div class="${select.wrapper}">
|
|
5603
5587
|
${when(
|
|
5604
5588
|
this.label,
|
|
5605
|
-
() => html24`<label class="${label.label}" for="${__privateGet(this,
|
|
5589
|
+
() => html24`<label class="${label.label}" for="${__privateGet(this, _WarpSelect_instances, id_get)}">
|
|
5606
5590
|
${this.label}
|
|
5607
5591
|
${when(
|
|
5608
5592
|
this.optional,
|
|
@@ -5618,30 +5602,29 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
|
5618
5602
|
)}
|
|
5619
5603
|
<div class="${select.selectWrapper}">
|
|
5620
5604
|
<select
|
|
5621
|
-
class="${__privateGet(this,
|
|
5622
|
-
id="${__privateGet(this,
|
|
5605
|
+
class="${__privateGet(this, _WarpSelect_instances, classes_get)}"
|
|
5606
|
+
id="${__privateGet(this, _WarpSelect_instances, id_get)}"
|
|
5623
5607
|
?autofocus=${this.autoFocus}
|
|
5624
|
-
aria-describedby="${ifDefined5(__privateGet(this,
|
|
5608
|
+
aria-describedby="${ifDefined5(__privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5625
5609
|
aria-invalid="${ifDefined5(this.invalid)}"
|
|
5626
|
-
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this,
|
|
5610
|
+
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _WarpSelect_instances, helpId_get))}">
|
|
5627
5611
|
${unsafeHTML(this._options)}
|
|
5628
5612
|
</select>
|
|
5629
|
-
<div class="${__privateGet(this,
|
|
5613
|
+
<div class="${__privateGet(this, _WarpSelect_instances, chevronClasses_get)}">
|
|
5630
5614
|
<w-icon-chevron-down-16></w-icon-chevron-down-16>
|
|
5631
5615
|
</div>
|
|
5632
5616
|
</div>
|
|
5633
|
-
${when(this.always || this.invalid, () => html24`<div id="${__privateGet(this,
|
|
5617
|
+
${when(this.always || this.invalid, () => html24`<div id="${__privateGet(this, _WarpSelect_instances, helpId_get)}" class="${__privateGet(this, _WarpSelect_instances, helpTextClasses_get)}">${this.hint}</div>`)}
|
|
5634
5618
|
</div>`;
|
|
5635
5619
|
}
|
|
5636
5620
|
};
|
|
5637
|
-
|
|
5621
|
+
_WarpSelect_instances = new WeakSet();
|
|
5638
5622
|
classes_get = function() {
|
|
5639
5623
|
return r({
|
|
5640
5624
|
[select.default]: true,
|
|
5641
5625
|
[select.invalid]: this.invalid
|
|
5642
5626
|
});
|
|
5643
5627
|
};
|
|
5644
|
-
_helpTextClasses = new WeakSet();
|
|
5645
5628
|
helpTextClasses_get = function() {
|
|
5646
5629
|
return r({
|
|
5647
5630
|
[helpText.helpText]: true,
|
|
@@ -5649,20 +5632,17 @@ helpTextClasses_get = function() {
|
|
|
5649
5632
|
[helpText.helpTextColorInvalid]: this.invalid
|
|
5650
5633
|
});
|
|
5651
5634
|
};
|
|
5652
|
-
_chevronClasses = new WeakSet();
|
|
5653
5635
|
chevronClasses_get = function() {
|
|
5654
5636
|
return r({
|
|
5655
5637
|
[select.chevron]: true,
|
|
5656
5638
|
[select.chevronDisabled]: this.disabled
|
|
5657
5639
|
});
|
|
5658
5640
|
};
|
|
5659
|
-
_id = new WeakSet();
|
|
5660
5641
|
id_get = function() {
|
|
5661
5642
|
return "select_id";
|
|
5662
5643
|
};
|
|
5663
|
-
_helpId = new WeakSet();
|
|
5664
5644
|
helpId_get = function() {
|
|
5665
|
-
return this.hint ? `${__privateGet(this,
|
|
5645
|
+
return this.hint ? `${__privateGet(this, _WarpSelect_instances, id_get)}__hint` : void 0;
|
|
5666
5646
|
};
|
|
5667
5647
|
__publicField(WarpSelect, "properties", {
|
|
5668
5648
|
// Whether the element should receive focus on render
|
|
@@ -5717,15 +5697,13 @@ var WarpTextField = class extends WarpElement16 {
|
|
|
5717
5697
|
}
|
|
5718
5698
|
}
|
|
5719
5699
|
get _helpId() {
|
|
5720
|
-
if (this.helpText)
|
|
5721
|
-
return `${this._id}__hint`;
|
|
5700
|
+
if (this.helpText) return `${this._id}__hint`;
|
|
5722
5701
|
}
|
|
5723
5702
|
get _id() {
|
|
5724
5703
|
return "textfield";
|
|
5725
5704
|
}
|
|
5726
5705
|
get _error() {
|
|
5727
|
-
if (this.invalid && this._helpId)
|
|
5728
|
-
return this._helpId;
|
|
5706
|
+
if (this.invalid && this._helpId) return this._helpId;
|
|
5729
5707
|
}
|
|
5730
5708
|
handler(e) {
|
|
5731
5709
|
const { name, value } = e.target;
|
|
@@ -5741,14 +5719,12 @@ var WarpTextField = class extends WarpElement16 {
|
|
|
5741
5719
|
prefixSlotChange(e) {
|
|
5742
5720
|
const el = this.renderRoot.querySelector("slot[name=prefix]");
|
|
5743
5721
|
const affixes = el.assignedElements();
|
|
5744
|
-
if (affixes.length)
|
|
5745
|
-
this._hasPrefix = true;
|
|
5722
|
+
if (affixes.length) this._hasPrefix = true;
|
|
5746
5723
|
}
|
|
5747
5724
|
suffixSlotChange(e) {
|
|
5748
5725
|
const el = this.renderRoot.querySelector("slot[name=suffix]");
|
|
5749
5726
|
const affixes = el.assignedElements();
|
|
5750
|
-
if (affixes.length)
|
|
5751
|
-
this._hasSuffix = true;
|
|
5727
|
+
if (affixes.length) this._hasSuffix = true;
|
|
5752
5728
|
}
|
|
5753
5729
|
render() {
|
|
5754
5730
|
return html25`
|
|
@@ -5825,8 +5801,7 @@ if (!customElements.get("w-textfield")) {
|
|
|
5825
5801
|
|
|
5826
5802
|
// packages/toast/api.js
|
|
5827
5803
|
function toast2(message, options) {
|
|
5828
|
-
if (!windowExists)
|
|
5829
|
-
return;
|
|
5804
|
+
if (!windowExists) return;
|
|
5830
5805
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5831
5806
|
const data = __spreadValues({
|
|
5832
5807
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),
|
|
@@ -5838,14 +5813,12 @@ function toast2(message, options) {
|
|
|
5838
5813
|
return data;
|
|
5839
5814
|
}
|
|
5840
5815
|
function removeToast(id) {
|
|
5841
|
-
if (!windowExists)
|
|
5842
|
-
return;
|
|
5816
|
+
if (!windowExists) return;
|
|
5843
5817
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5844
5818
|
return toast3.del(id);
|
|
5845
5819
|
}
|
|
5846
5820
|
function updateToast(id, options) {
|
|
5847
|
-
if (!windowExists)
|
|
5848
|
-
return;
|
|
5821
|
+
if (!windowExists) return;
|
|
5849
5822
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5850
5823
|
toast3.set(__spreadValues(__spreadValues({}, toast3.get(id)), options));
|
|
5851
5824
|
return toast3.get(id);
|
|
@@ -5866,10 +5839,8 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5866
5839
|
const keep = [];
|
|
5867
5840
|
const remove = [];
|
|
5868
5841
|
for (const toast3 of this._toasts) {
|
|
5869
|
-
if (Date.now() <= toast3[1].duration)
|
|
5870
|
-
|
|
5871
|
-
else
|
|
5872
|
-
remove.push(toast3);
|
|
5842
|
+
if (Date.now() <= toast3[1].duration) keep.push(toast3);
|
|
5843
|
+
else remove.push(toast3);
|
|
5873
5844
|
}
|
|
5874
5845
|
const collapseTasks = [];
|
|
5875
5846
|
for (const [id] of remove) {
|
|
@@ -5877,15 +5848,13 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5877
5848
|
collapseTasks.push(el.collapse());
|
|
5878
5849
|
}
|
|
5879
5850
|
Promise.all(collapseTasks).then(() => {
|
|
5880
|
-
if (keep.length !== this._toasts.size)
|
|
5881
|
-
this._toasts = new Map(keep);
|
|
5851
|
+
if (keep.length !== this._toasts.size) this._toasts = new Map(keep);
|
|
5882
5852
|
});
|
|
5883
5853
|
}, 500);
|
|
5884
5854
|
}
|
|
5885
5855
|
disconnectedCallback() {
|
|
5886
5856
|
super.disconnectedCallback();
|
|
5887
|
-
if (this._interval)
|
|
5888
|
-
clearTimeout(this._interval);
|
|
5857
|
+
if (this._interval) clearTimeout(this._interval);
|
|
5889
5858
|
}
|
|
5890
5859
|
static init() {
|
|
5891
5860
|
let el = document.querySelector("w-toast-container");
|
|
@@ -5907,8 +5876,7 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5907
5876
|
if (!id) {
|
|
5908
5877
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
5909
5878
|
}
|
|
5910
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
5911
|
-
throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5879
|
+
if (typeof id !== "string" && !Number.isInteger(id)) throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5912
5880
|
return this._toasts.get(id);
|
|
5913
5881
|
}
|
|
5914
5882
|
/**
|
|
@@ -5917,8 +5885,7 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5917
5885
|
* @returns {WarpToastContainer}
|
|
5918
5886
|
*/
|
|
5919
5887
|
set(toast3) {
|
|
5920
|
-
if (!toast3.id)
|
|
5921
|
-
throw new Error('invalid or undefined "id" on toast object');
|
|
5888
|
+
if (!toast3.id) throw new Error('invalid or undefined "id" on toast object');
|
|
5922
5889
|
const result = this._toasts.set(toast3.id, __spreadProps(__spreadValues({}, toast3), {
|
|
5923
5890
|
duration: Date.now() + (toast3.duration || 5e3)
|
|
5924
5891
|
}));
|
|
@@ -5934,11 +5901,9 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5934
5901
|
if (!id) {
|
|
5935
5902
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
5936
5903
|
}
|
|
5937
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
5938
|
-
throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5904
|
+
if (typeof id !== "string" && !Number.isInteger(id)) throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5939
5905
|
const el = this.renderRoot.querySelector(`#${id}`);
|
|
5940
|
-
if (!this._toasts.has(id))
|
|
5941
|
-
return false;
|
|
5906
|
+
if (!this._toasts.has(id)) return false;
|
|
5942
5907
|
await el.collapse();
|
|
5943
5908
|
const result = this._toasts.delete(id);
|
|
5944
5909
|
this._toasts = new Map(Array.from(this._toasts));
|
|
@@ -5990,8 +5955,7 @@ var prefersMotion = true;
|
|
|
5990
5955
|
if (windowExists3) {
|
|
5991
5956
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5992
5957
|
const callback = ({ matches }) => prefersMotion = !matches;
|
|
5993
|
-
if (query.addEventListener)
|
|
5994
|
-
query.addEventListener("change", callback);
|
|
5958
|
+
if (query.addEventListener) query.addEventListener("change", callback);
|
|
5995
5959
|
callback(query);
|
|
5996
5960
|
}
|
|
5997
5961
|
var removeTransition = (el) => {
|
|
@@ -6008,19 +5972,16 @@ var addTransition = (el) => {
|
|
|
6008
5972
|
var getAfterExpandCallback = (el, done) => () => {
|
|
6009
5973
|
el.style.height = "auto";
|
|
6010
5974
|
el.style.overflow = null;
|
|
6011
|
-
if (done)
|
|
6012
|
-
done();
|
|
5975
|
+
if (done) done();
|
|
6013
5976
|
};
|
|
6014
5977
|
var getAfterCollapseCallback = (done) => () => {
|
|
6015
|
-
if (done)
|
|
6016
|
-
done();
|
|
5978
|
+
if (done) done();
|
|
6017
5979
|
};
|
|
6018
5980
|
var expand = (el, done) => {
|
|
6019
5981
|
const returnPromise = (() => {
|
|
6020
|
-
if (!done)
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
});
|
|
5982
|
+
if (!done) return new Promise((r3) => {
|
|
5983
|
+
done = r3;
|
|
5984
|
+
});
|
|
6024
5985
|
})();
|
|
6025
5986
|
const afterExpandCallback = getAfterExpandCallback(el, done);
|
|
6026
5987
|
removeTransition(el);
|
|
@@ -6033,15 +5994,13 @@ var expand = (el, done) => {
|
|
|
6033
5994
|
addTransition(el);
|
|
6034
5995
|
requestAnimationFrame(() => el.style.height = dest + "px");
|
|
6035
5996
|
});
|
|
6036
|
-
if (returnPromise)
|
|
6037
|
-
return returnPromise;
|
|
5997
|
+
if (returnPromise) return returnPromise;
|
|
6038
5998
|
};
|
|
6039
5999
|
var collapse = (el, done) => {
|
|
6040
6000
|
const returnPromise = (() => {
|
|
6041
|
-
if (!done)
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
});
|
|
6001
|
+
if (!done) return new Promise((r3) => {
|
|
6002
|
+
done = r3;
|
|
6003
|
+
});
|
|
6045
6004
|
})();
|
|
6046
6005
|
const afterCollapseCallback = getAfterCollapseCallback(done);
|
|
6047
6006
|
removeTransition(el);
|
|
@@ -6053,8 +6012,7 @@ var collapse = (el, done) => {
|
|
|
6053
6012
|
addTransition(el);
|
|
6054
6013
|
requestAnimationFrame(() => el.style.height = "0px");
|
|
6055
6014
|
});
|
|
6056
|
-
if (returnPromise)
|
|
6057
|
-
return returnPromise;
|
|
6015
|
+
if (returnPromise) return returnPromise;
|
|
6058
6016
|
};
|
|
6059
6017
|
|
|
6060
6018
|
// packages/toast/toast.js
|
|
@@ -6104,8 +6062,7 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6104
6062
|
super.disconnectedCallback();
|
|
6105
6063
|
}
|
|
6106
6064
|
updated() {
|
|
6107
|
-
if (!this._expanded && this._wrapper)
|
|
6108
|
-
expand(this._wrapper, () => this._expanded = true);
|
|
6065
|
+
if (!this._expanded && this._wrapper) expand(this._wrapper, () => this._expanded = true);
|
|
6109
6066
|
}
|
|
6110
6067
|
get _primaryClasses() {
|
|
6111
6068
|
return classes2({
|
|
@@ -6159,19 +6116,14 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6159
6116
|
}
|
|
6160
6117
|
}
|
|
6161
6118
|
get _iconMarkup() {
|
|
6162
|
-
if (this._warning)
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
return html27`<w-icon-error-16></w-icon-error-16>`;
|
|
6166
|
-
else
|
|
6167
|
-
return html27`<w-icon-success-16></w-icon-success-16>`;
|
|
6119
|
+
if (this._warning) return html27`<w-icon-warning-16></w-icon-warning-16>`;
|
|
6120
|
+
if (this._error) return html27`<w-icon-error-16></w-icon-error-16>`;
|
|
6121
|
+
else return html27`<w-icon-success-16></w-icon-success-16>`;
|
|
6168
6122
|
}
|
|
6169
6123
|
async collapse() {
|
|
6170
6124
|
return new Promise((resolve) => {
|
|
6171
|
-
if (this._expanded && this._wrapper)
|
|
6172
|
-
|
|
6173
|
-
else
|
|
6174
|
-
resolve();
|
|
6125
|
+
if (this._expanded && this._wrapper) collapse(this._wrapper, resolve);
|
|
6126
|
+
else resolve();
|
|
6175
6127
|
});
|
|
6176
6128
|
}
|
|
6177
6129
|
close() {
|
|
@@ -6183,8 +6135,7 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6183
6135
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
6184
6136
|
}
|
|
6185
6137
|
render() {
|
|
6186
|
-
if (!this.text)
|
|
6187
|
-
return html27``;
|
|
6138
|
+
if (!this.text) return html27``;
|
|
6188
6139
|
return html27` <section class="${toast.wrapper}" aria-label="${this._typeLabel}">
|
|
6189
6140
|
<div class="${this._primaryClasses}">
|
|
6190
6141
|
<div class="${this._iconClasses}">${this._iconMarkup}</div>
|
|
@@ -6241,8 +6192,7 @@ var ExpandTransition = class extends WarpElement19 {
|
|
|
6241
6192
|
}
|
|
6242
6193
|
}
|
|
6243
6194
|
updated() {
|
|
6244
|
-
if (!this._wrapper)
|
|
6245
|
-
return;
|
|
6195
|
+
if (!this._wrapper) return;
|
|
6246
6196
|
if (!this._mounted) {
|
|
6247
6197
|
this._mounted = true;
|
|
6248
6198
|
return;
|