@warp-ds/elements 2.0.0-next.1 → 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 +290 -320
- 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 +140 -126
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/attention/locales/da/messages.d.mts +1 -0
- 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 +56 -68
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/locales/da/messages.d.mts +1 -0
- package/dist/packages/broadcast/index.js +2 -6
- package/dist/packages/broadcast/index.js.map +1 -1
- package/dist/packages/button/index.js +56 -69
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/button/locales/da/messages.d.mts +1 -0
- 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/i18n.d.ts +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 +58 -71
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/pill/locales/da/messages.d.mts +1 -0
- package/dist/packages/select/index.js +76 -104
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/select/locales/da/messages.d.mts +1 -0
- 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 +88 -125
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/locales/da/messages.d.mts +1 -0
- 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 {
|
|
@@ -1739,20 +1715,20 @@ var I18n = class extends EventEmitter {
|
|
|
1739
1715
|
}
|
|
1740
1716
|
this.emit("change");
|
|
1741
1717
|
}
|
|
1742
|
-
_load(locale,
|
|
1718
|
+
_load(locale, messages51) {
|
|
1743
1719
|
const maybeMessages = this._messages[locale];
|
|
1744
1720
|
if (!maybeMessages) {
|
|
1745
|
-
this._messages[locale] =
|
|
1721
|
+
this._messages[locale] = messages51;
|
|
1746
1722
|
} else {
|
|
1747
|
-
Object.assign(maybeMessages,
|
|
1723
|
+
Object.assign(maybeMessages, messages51);
|
|
1748
1724
|
}
|
|
1749
1725
|
}
|
|
1750
|
-
load(localeOrMessages,
|
|
1751
|
-
if (typeof localeOrMessages == "string" && typeof
|
|
1752
|
-
this._load(localeOrMessages,
|
|
1726
|
+
load(localeOrMessages, messages51) {
|
|
1727
|
+
if (typeof localeOrMessages == "string" && typeof messages51 === "object") {
|
|
1728
|
+
this._load(localeOrMessages, messages51);
|
|
1753
1729
|
} else {
|
|
1754
1730
|
Object.entries(localeOrMessages).forEach(
|
|
1755
|
-
([locale,
|
|
1731
|
+
([locale, messages211]) => this._load(locale, messages211)
|
|
1756
1732
|
);
|
|
1757
1733
|
}
|
|
1758
1734
|
this.emit("change");
|
|
@@ -1760,10 +1736,10 @@ var I18n = class extends EventEmitter {
|
|
|
1760
1736
|
/**
|
|
1761
1737
|
* @param options {@link LoadAndActivateOptions}
|
|
1762
1738
|
*/
|
|
1763
|
-
loadAndActivate({ locale, locales, messages:
|
|
1739
|
+
loadAndActivate({ locale, locales, messages: messages51 }) {
|
|
1764
1740
|
this._locale = locale;
|
|
1765
1741
|
this._locales = locales || void 0;
|
|
1766
|
-
this._messages[this._locale] =
|
|
1742
|
+
this._messages[this._locale] = messages51;
|
|
1767
1743
|
this.emit("change");
|
|
1768
1744
|
}
|
|
1769
1745
|
activate(locale, locales) {
|
|
@@ -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"}');
|
|
@@ -1892,8 +1871,8 @@ var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
1892
1871
|
};
|
|
1893
1872
|
var activateI18n = (enMessages, nbMessages, fiMessages) => {
|
|
1894
1873
|
const locale = detectLocale();
|
|
1895
|
-
const
|
|
1896
|
-
i18n.load(locale,
|
|
1874
|
+
const messages410 = getMessages(locale, enMessages, nbMessages, fiMessages);
|
|
1875
|
+
i18n.load(locale, messages410);
|
|
1897
1876
|
i18n.activate(locale);
|
|
1898
1877
|
};
|
|
1899
1878
|
activateI18n(messages2, messages, messages3);
|
|
@@ -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"}');
|
|
@@ -1983,8 +1962,8 @@ var getMessages2 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
1983
1962
|
};
|
|
1984
1963
|
var activateI18n2 = (enMessages, nbMessages, fiMessages) => {
|
|
1985
1964
|
const locale = detectLocale2();
|
|
1986
|
-
const
|
|
1987
|
-
i18n.load(locale,
|
|
1965
|
+
const messages410 = getMessages2(locale, enMessages, nbMessages, fiMessages);
|
|
1966
|
+
i18n.load(locale, messages410);
|
|
1988
1967
|
i18n.activate(locale);
|
|
1989
1968
|
};
|
|
1990
1969
|
activateI18n2(messages22, messages4, messages32);
|
|
@@ -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"}');
|
|
@@ -2185,8 +2162,8 @@ var getMessages3 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2185
2162
|
};
|
|
2186
2163
|
var activateI18n3 = (enMessages, nbMessages, fiMessages) => {
|
|
2187
2164
|
const locale = detectLocale3();
|
|
2188
|
-
const
|
|
2189
|
-
i18n.load(locale,
|
|
2165
|
+
const messages410 = getMessages3(locale, enMessages, nbMessages, fiMessages);
|
|
2166
|
+
i18n.load(locale, messages410);
|
|
2190
2167
|
i18n.activate(locale);
|
|
2191
2168
|
};
|
|
2192
2169
|
activateI18n3(messages23, messages5, messages33);
|
|
@@ -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"}');
|
|
@@ -2276,8 +2253,8 @@ var getMessages4 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2276
2253
|
};
|
|
2277
2254
|
var activateI18n4 = (enMessages, nbMessages, fiMessages) => {
|
|
2278
2255
|
const locale = detectLocale4();
|
|
2279
|
-
const
|
|
2280
|
-
i18n.load(locale,
|
|
2256
|
+
const messages410 = getMessages4(locale, enMessages, nbMessages, fiMessages);
|
|
2257
|
+
i18n.load(locale, messages410);
|
|
2281
2258
|
i18n.activate(locale);
|
|
2282
2259
|
};
|
|
2283
2260
|
activateI18n4(messages24, messages6, messages34);
|
|
@@ -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"}');
|
|
@@ -2367,8 +2344,8 @@ var getMessages5 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2367
2344
|
};
|
|
2368
2345
|
var activateI18n5 = (enMessages, nbMessages, fiMessages) => {
|
|
2369
2346
|
const locale = detectLocale5();
|
|
2370
|
-
const
|
|
2371
|
-
i18n.load(locale,
|
|
2347
|
+
const messages410 = getMessages5(locale, enMessages, nbMessages, fiMessages);
|
|
2348
|
+
i18n.load(locale, messages410);
|
|
2372
2349
|
i18n.activate(locale);
|
|
2373
2350
|
};
|
|
2374
2351
|
activateI18n5(messages25, messages7, messages35);
|
|
@@ -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"}');
|
|
@@ -2458,8 +2435,8 @@ var getMessages6 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2458
2435
|
};
|
|
2459
2436
|
var activateI18n6 = (enMessages, nbMessages, fiMessages) => {
|
|
2460
2437
|
const locale = detectLocale6();
|
|
2461
|
-
const
|
|
2462
|
-
i18n.load(locale,
|
|
2438
|
+
const messages410 = getMessages6(locale, enMessages, nbMessages, fiMessages);
|
|
2439
|
+
i18n.load(locale, messages410);
|
|
2463
2440
|
i18n.activate(locale);
|
|
2464
2441
|
};
|
|
2465
2442
|
activateI18n6(messages26, messages8, messages36);
|
|
@@ -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 }),
|
|
@@ -3857,7 +3862,7 @@ import WarpElement3 from "@warp-ds/elements-core";
|
|
|
3857
3862
|
import { ifDefined as ifDefined2 } from "lit/directives/if-defined.js";
|
|
3858
3863
|
|
|
3859
3864
|
// packages/i18n.ts
|
|
3860
|
-
var supportedLocales7 = ["en", "nb", "fi"];
|
|
3865
|
+
var supportedLocales7 = ["en", "nb", "fi", "da"];
|
|
3861
3866
|
var defaultLocale8 = "en";
|
|
3862
3867
|
var getSupportedLocale7 = (usedLocale) => {
|
|
3863
3868
|
return supportedLocales7.find(
|
|
@@ -3877,34 +3882,36 @@ function detectLocale7() {
|
|
|
3877
3882
|
return defaultLocale8;
|
|
3878
3883
|
}
|
|
3879
3884
|
}
|
|
3880
|
-
var getMessages7 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
3881
|
-
if (locale === "nb")
|
|
3882
|
-
|
|
3883
|
-
if (locale === "
|
|
3884
|
-
return fiMsg;
|
|
3885
|
+
var getMessages7 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
3886
|
+
if (locale === "nb") return nbMsg;
|
|
3887
|
+
if (locale === "fi") return fiMsg;
|
|
3888
|
+
if (locale === "da") return daMsg;
|
|
3885
3889
|
return enMsg;
|
|
3886
3890
|
};
|
|
3887
|
-
var activateI18n7 = (enMessages, nbMessages, fiMessages) => {
|
|
3891
|
+
var activateI18n7 = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
3888
3892
|
const locale = detectLocale7();
|
|
3889
|
-
const
|
|
3890
|
-
i18n.load(locale,
|
|
3893
|
+
const messages51 = getMessages7(locale, enMessages, nbMessages, fiMessages, daMessages);
|
|
3894
|
+
i18n.load(locale, messages51);
|
|
3891
3895
|
i18n.activate(locale);
|
|
3892
3896
|
};
|
|
3893
3897
|
|
|
3898
|
+
// packages/attention/locales/da/messages.mjs
|
|
3899
|
+
var messages9 = JSON.parse('{"attention.aria.callout":"En gr\xF8n taleboble der introducerer noget nyt","attention.aria.close":"Luk","attention.aria.highlight":"En opm\xE6rksomhedsskabende taleboble med vigtig information","attention.aria.pointingDown":"peger nedad","attention.aria.pointingLeft":"peger til venstre","attention.aria.pointingRight":"peger til h\xF8jre","attention.aria.pointingUp":"peger opad","attention.aria.popover":"En hvid taleboble med mere information","attention.aria.tooltip":"En sort taleboble med flere oplysninger"}');
|
|
3900
|
+
|
|
3894
3901
|
// packages/attention/locales/en/messages.mjs
|
|
3895
|
-
var
|
|
3902
|
+
var messages10 = JSON.parse('{"attention.aria.callout":"A green speech bubble introducing something new","attention.aria.close":"Close","attention.aria.highlight":"An attention speech bubble with important information","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"A white speech bubble providing additional information","attention.aria.tooltip":"A black speech bubble providing complementary information"}');
|
|
3896
3903
|
|
|
3897
3904
|
// packages/attention/locales/fi/messages.mjs
|
|
3898
|
-
var
|
|
3905
|
+
var messages11 = JSON.parse('{"attention.aria.callout":"Vihre\xE4 puhekupla, joka esittelee jotain uutta","attention.aria.close":"Sulje","attention.aria.highlight":"Puhekupla, joka sis\xE4lt\xE4\xE4 t\xE4rke\xE4\xE4 tietoa","attention.aria.pointingDown":"osoittaa alas","attention.aria.pointingLeft":"osoittaa vasemmalle","attention.aria.pointingRight":"osoittaa oikealle","attention.aria.pointingUp":"osoittaa yl\xF6s","attention.aria.popover":"Valkoinen puhekupla, joka tarjoaa lis\xE4tietoa","attention.aria.tooltip":"Musta puhekupla, joka tarjoaa t\xE4ydent\xE4v\xE4\xE4 tietoa"}');
|
|
3899
3906
|
|
|
3900
3907
|
// packages/attention/locales/nb/messages.mjs
|
|
3901
|
-
var
|
|
3908
|
+
var messages12 = JSON.parse('{"attention.aria.callout":"Gr\xF8nn taleboble som introduserer noe nytt","attention.aria.close":"Lukk","attention.aria.highlight":"En uthevet taleboble med viktig informasjon","attention.aria.pointingDown":"peker ned","attention.aria.pointingLeft":"peker til venstre","attention.aria.pointingRight":"peker til h\xF8yre","attention.aria.pointingUp":"peker opp","attention.aria.popover":"En hvit taleboble som gir tilleggsinformasjon","attention.aria.tooltip":"En svart taleboble som forklarer konteksten"}');
|
|
3902
3909
|
|
|
3903
3910
|
// packages/attention/index.js
|
|
3904
3911
|
var WarpAttention = class extends kebabCaseAttributes(WarpElement3) {
|
|
3905
3912
|
constructor() {
|
|
3906
3913
|
super();
|
|
3907
|
-
activateI18n7(
|
|
3914
|
+
activateI18n7(messages10, messages12, messages11, messages9);
|
|
3908
3915
|
this.handleDone = this.handleDone.bind(this);
|
|
3909
3916
|
this.show = false;
|
|
3910
3917
|
this.placement = "bottom";
|
|
@@ -4148,16 +4155,14 @@ ${JSON.stringify(directions)}`
|
|
|
4148
4155
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
4149
4156
|
}
|
|
4150
4157
|
keypressed(e) {
|
|
4151
|
-
if (!this.canClose)
|
|
4152
|
-
return;
|
|
4158
|
+
if (!this.canClose) return;
|
|
4153
4159
|
if (e.key === "Escape") {
|
|
4154
4160
|
e.preventDefault();
|
|
4155
4161
|
this.close();
|
|
4156
4162
|
}
|
|
4157
4163
|
}
|
|
4158
4164
|
render() {
|
|
4159
|
-
if (!this.callout && this._targetEl === void 0)
|
|
4160
|
-
return html9``;
|
|
4165
|
+
if (!this.callout && this._targetEl === void 0) return html9``;
|
|
4161
4166
|
return html9`
|
|
4162
4167
|
<div class=${ifDefined2(this.className ? this.className : void 0)}>
|
|
4163
4168
|
${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html9`
|
|
@@ -4325,7 +4330,7 @@ if (!customElements.get("w-box")) {
|
|
|
4325
4330
|
// packages/breadcrumbs/index.js
|
|
4326
4331
|
import { html as html12 } from "lit";
|
|
4327
4332
|
|
|
4328
|
-
// 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
|
|
4329
4334
|
function interleave(array, separator2) {
|
|
4330
4335
|
return array.flatMap((el) => [el, separator2]).slice(0, -1);
|
|
4331
4336
|
}
|
|
@@ -4333,21 +4338,24 @@ function interleave(array, separator2) {
|
|
|
4333
4338
|
// packages/breadcrumbs/index.js
|
|
4334
4339
|
import WarpElement6 from "@warp-ds/elements-core";
|
|
4335
4340
|
|
|
4341
|
+
// packages/breadcrumbs/locales/da/messages.mjs
|
|
4342
|
+
var messages13 = JSON.parse('{"breadcrumbs.ariaLabel":"Du er her"}');
|
|
4343
|
+
|
|
4336
4344
|
// packages/breadcrumbs/locales/en/messages.mjs
|
|
4337
|
-
var
|
|
4345
|
+
var messages14 = JSON.parse('{"breadcrumbs.ariaLabel":"You are here"}');
|
|
4338
4346
|
|
|
4339
4347
|
// packages/breadcrumbs/locales/fi/messages.mjs
|
|
4340
|
-
var
|
|
4348
|
+
var messages15 = JSON.parse('{"breadcrumbs.ariaLabel":"Olet t\xE4ss\xE4"}');
|
|
4341
4349
|
|
|
4342
4350
|
// packages/breadcrumbs/locales/nb/messages.mjs
|
|
4343
|
-
var
|
|
4351
|
+
var messages16 = JSON.parse('{"breadcrumbs.ariaLabel":"Her er du"}');
|
|
4344
4352
|
|
|
4345
4353
|
// packages/breadcrumbs/index.js
|
|
4346
4354
|
var separator = html12`<span class=${breadcrumbs.separator}>/</span>`;
|
|
4347
4355
|
var WarpBreadcrumbs = class extends kebabCaseAttributes(WarpElement6) {
|
|
4348
4356
|
constructor() {
|
|
4349
4357
|
super();
|
|
4350
|
-
activateI18n7(
|
|
4358
|
+
activateI18n7(messages14, messages16, messages15, messages13);
|
|
4351
4359
|
this.ariaLabel = i18n._({
|
|
4352
4360
|
id: "breadcrumbs.ariaLabel",
|
|
4353
4361
|
message: "You are here",
|
|
@@ -4427,11 +4435,11 @@ var WarpBroadcast = class extends WarpElement7 {
|
|
|
4427
4435
|
this._hiddenMessageIds = [.../* @__PURE__ */ new Set([...this._hiddenMessageIds, id])];
|
|
4428
4436
|
}
|
|
4429
4437
|
render() {
|
|
4430
|
-
const
|
|
4438
|
+
const messages51 = this._messages.filter((item) => !this._hiddenMessageIds.includes(item.id));
|
|
4431
4439
|
return html13`
|
|
4432
|
-
<aside class=${`${
|
|
4440
|
+
<aside class=${`${messages51.length === 0 ? "hidden" : "mb-16"}`}>
|
|
4433
4441
|
${repeat(
|
|
4434
|
-
|
|
4442
|
+
messages51,
|
|
4435
4443
|
({ id }) => `broadcast-${id}`,
|
|
4436
4444
|
({ id, message }) => html13`<w-toast id="broadcast-${id}" type="warning" text="${message}" canclose @close=${() => this._del(id)}> </w-toast>`
|
|
4437
4445
|
)}
|
|
@@ -4443,8 +4451,7 @@ __publicField(WarpBroadcast, "properties", {
|
|
|
4443
4451
|
_messages: {
|
|
4444
4452
|
state: true,
|
|
4445
4453
|
hasChanged(newVal, oldVal) {
|
|
4446
|
-
if (!oldVal || oldVal.length === 0)
|
|
4447
|
-
return true;
|
|
4454
|
+
if (!oldVal || oldVal.length === 0) return true;
|
|
4448
4455
|
const newIds = newVal.map(({ id }) => id).sort();
|
|
4449
4456
|
const oldIds = oldVal.map(({ id }) => id).sort();
|
|
4450
4457
|
return JSON.stringify(newIds) !== JSON.stringify(oldIds);
|
|
@@ -4469,21 +4476,24 @@ if (!customElements.get("w-broadcast")) {
|
|
|
4469
4476
|
import { html as html14 } from "lit";
|
|
4470
4477
|
import WarpElement8 from "@warp-ds/elements-core";
|
|
4471
4478
|
|
|
4479
|
+
// packages/button/locales/da/messages.mjs
|
|
4480
|
+
var messages17 = JSON.parse('{"button.aria.loading":"Indl\xE6ser..."}');
|
|
4481
|
+
|
|
4472
4482
|
// packages/button/locales/en/messages.mjs
|
|
4473
|
-
var
|
|
4483
|
+
var messages18 = JSON.parse('{"button.aria.loading":"Loading..."}');
|
|
4474
4484
|
|
|
4475
4485
|
// packages/button/locales/fi/messages.mjs
|
|
4476
|
-
var
|
|
4486
|
+
var messages19 = JSON.parse('{"button.aria.loading":"Ladataan..."}');
|
|
4477
4487
|
|
|
4478
4488
|
// packages/button/locales/nb/messages.mjs
|
|
4479
|
-
var
|
|
4489
|
+
var messages20 = JSON.parse('{"button.aria.loading":"Laster..."}');
|
|
4480
4490
|
|
|
4481
4491
|
// packages/button/index.js
|
|
4482
4492
|
var buttonTypes2 = ["primary", "secondary", "negative", "utility", "pill", "link"];
|
|
4483
4493
|
var WarpButton = class extends kebabCaseAttributes(WarpElement8) {
|
|
4484
4494
|
constructor() {
|
|
4485
4495
|
super();
|
|
4486
|
-
activateI18n7(
|
|
4496
|
+
activateI18n7(messages18, messages20, messages19, messages17);
|
|
4487
4497
|
this.variant = "secondary";
|
|
4488
4498
|
this.ariaValueTextLoading = i18n._({
|
|
4489
4499
|
id: "button.aria.loading",
|
|
@@ -4628,8 +4638,7 @@ var WarpCard = class extends WarpElement9 {
|
|
|
4628
4638
|
return html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
|
|
4629
4639
|
}
|
|
4630
4640
|
keypressed(e) {
|
|
4631
|
-
if (!this.clickable || e.altKey || e.ctrlKey)
|
|
4632
|
-
return;
|
|
4641
|
+
if (!this.clickable || e.altKey || e.ctrlKey) return;
|
|
4633
4642
|
if (e.key === keys.ENTER || e.key === keys.SPACE) {
|
|
4634
4643
|
e.preventDefault();
|
|
4635
4644
|
this.click();
|
|
@@ -4675,10 +4684,10 @@ import { css as css5, html as html18 } from "lit";
|
|
|
4675
4684
|
import WarpElement10 from "@warp-ds/elements-core";
|
|
4676
4685
|
import { ifDefined as ifDefined4 } from "lit/directives/if-defined.js";
|
|
4677
4686
|
|
|
4678
|
-
// 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
|
|
4679
4688
|
import { LitElement as LitElement7 } from "lit";
|
|
4680
4689
|
import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
|
|
4681
|
-
var
|
|
4690
|
+
var messages21 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
4682
4691
|
var messages27 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
|
|
4683
4692
|
var messages37 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
|
|
4684
4693
|
var supportedLocales8 = ["en", "nb", "fi", "da", "sv"];
|
|
@@ -4751,11 +4760,11 @@ var getMessages8 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
4751
4760
|
};
|
|
4752
4761
|
var activateI18n8 = (enMessages, nbMessages, fiMessages) => {
|
|
4753
4762
|
const locale = detectLocale8();
|
|
4754
|
-
const
|
|
4755
|
-
i18n.load(locale,
|
|
4763
|
+
const messages410 = getMessages8(locale, enMessages, nbMessages, fiMessages);
|
|
4764
|
+
i18n.load(locale, messages410);
|
|
4756
4765
|
i18n.activate(locale);
|
|
4757
4766
|
};
|
|
4758
|
-
activateI18n8(messages27,
|
|
4767
|
+
activateI18n8(messages27, messages21, messages37);
|
|
4759
4768
|
var IconChevronDown16 = class extends LitElement7 {
|
|
4760
4769
|
render() {
|
|
4761
4770
|
const title = i18n.t({ message: `Downward arrow`, id: "icon.title.chevron-down", comment: "Title for chevron-down icon" });
|
|
@@ -4766,11 +4775,11 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
4766
4775
|
customElements.define("w-icon-chevron-down-16", IconChevronDown16);
|
|
4767
4776
|
}
|
|
4768
4777
|
|
|
4769
|
-
// 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
|
|
4770
4779
|
import { LitElement as LitElement8 } from "lit";
|
|
4771
4780
|
import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
|
|
4772
|
-
var
|
|
4773
|
-
var
|
|
4781
|
+
var messages28 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
|
|
4782
|
+
var messages29 = JSON.parse('{"icon.title.chevron-up":"Upward arrow"}');
|
|
4774
4783
|
var messages38 = JSON.parse('{"icon.title.chevron-up":"Nuoli yl\xF6sp\xE4in"}');
|
|
4775
4784
|
var supportedLocales9 = ["en", "nb", "fi", "da", "sv"];
|
|
4776
4785
|
var defaultLocale10 = "en";
|
|
@@ -4842,11 +4851,11 @@ var getMessages9 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
4842
4851
|
};
|
|
4843
4852
|
var activateI18n9 = (enMessages, nbMessages, fiMessages) => {
|
|
4844
4853
|
const locale = detectLocale9();
|
|
4845
|
-
const
|
|
4846
|
-
i18n.load(locale,
|
|
4854
|
+
const messages410 = getMessages9(locale, enMessages, nbMessages, fiMessages);
|
|
4855
|
+
i18n.load(locale, messages410);
|
|
4847
4856
|
i18n.activate(locale);
|
|
4848
4857
|
};
|
|
4849
|
-
activateI18n9(
|
|
4858
|
+
activateI18n9(messages29, messages28, messages38);
|
|
4850
4859
|
var IconChevronUp16 = class extends LitElement8 {
|
|
4851
4860
|
render() {
|
|
4852
4861
|
const title = i18n.t({ message: `Upward arrow`, id: "icon.title.chevron-up", comment: "Title for chevron-up icon" });
|
|
@@ -4882,61 +4891,61 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
|
4882
4891
|
}
|
|
4883
4892
|
get _expandableSlot() {
|
|
4884
4893
|
return html18`<div
|
|
4885
|
-
class
|
|
4894
|
+
class="${classes({
|
|
4886
4895
|
[this.contentClass || ""]: true,
|
|
4887
4896
|
[box.box]: this.box,
|
|
4888
4897
|
[expandable.paddingTop]: this._hasTitle && this.box
|
|
4889
|
-
})}>
|
|
4898
|
+
})}">
|
|
4890
4899
|
<slot></slot>
|
|
4891
4900
|
</div>`;
|
|
4892
4901
|
}
|
|
4893
4902
|
get _chevronUpClasses() {
|
|
4894
|
-
return
|
|
4903
|
+
return classes({
|
|
4895
4904
|
[expandable.elementsTransformChevronUpPart]: true,
|
|
4896
4905
|
[expandable.elementsChevronUpCollapsePart]: !this.expanded && this._showChevronUp
|
|
4897
4906
|
});
|
|
4898
4907
|
}
|
|
4899
4908
|
get _chevronDownClasses() {
|
|
4900
|
-
return
|
|
4909
|
+
return classes({
|
|
4901
4910
|
[expandable.elementsTransformChevronDownPart]: true,
|
|
4902
4911
|
[expandable.elementsChevronDownExpandPart]: this.expanded && !this._showChevronUp
|
|
4903
4912
|
});
|
|
4904
4913
|
}
|
|
4905
4914
|
render() {
|
|
4906
4915
|
return html18` <div
|
|
4907
|
-
class
|
|
4916
|
+
class="${classes({
|
|
4908
4917
|
[expandable.expandable]: true,
|
|
4909
4918
|
[expandable.expandableBox]: this.box,
|
|
4910
4919
|
[expandable.expandableBleed]: this.bleed
|
|
4911
|
-
})}>
|
|
4920
|
+
})}">
|
|
4912
4921
|
${this._hasTitle ? html18`<w-unstyled-heading level=${this.headingLevel}>
|
|
4913
4922
|
<button
|
|
4914
4923
|
type="button"
|
|
4915
4924
|
aria-expanded="${this.expanded}"
|
|
4916
|
-
class
|
|
4925
|
+
class="${classes({
|
|
4917
4926
|
[this.buttonClass || ""]: true,
|
|
4918
4927
|
[expandable.button]: true,
|
|
4919
4928
|
[expandable.buttonBox]: this.box
|
|
4920
|
-
})}
|
|
4929
|
+
})}"
|
|
4921
4930
|
@click=${() => this.expanded = !this.expanded}>
|
|
4922
4931
|
<div class="${expandable.title}">
|
|
4923
4932
|
${this.title ? html18`<span class="${expandable.titleType}">${this.title}</span>` : html18`<slot name="title"></slot>`}
|
|
4924
4933
|
${this.noChevron ? "" : html18`<div
|
|
4925
|
-
class
|
|
4934
|
+
class="${classes({
|
|
4926
4935
|
[expandable.chevron]: true,
|
|
4927
4936
|
[expandable.chevronBox]: this.box,
|
|
4928
4937
|
[expandable.chevronNonBox]: !this.box
|
|
4929
|
-
})}>
|
|
4938
|
+
})}">
|
|
4930
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>`}
|
|
4931
4940
|
</div>`}
|
|
4932
4941
|
</div>
|
|
4933
4942
|
</button>
|
|
4934
4943
|
</w-unstyled-heading>` : ""}
|
|
4935
4944
|
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html18`<div
|
|
4936
|
-
class
|
|
4945
|
+
class="${classes({
|
|
4937
4946
|
[expandable.expansion]: true,
|
|
4938
4947
|
[expandable.expansionNotExpanded]: !this.expanded
|
|
4939
|
-
})}
|
|
4948
|
+
})}"
|
|
4940
4949
|
aria-hidden=${ifDefined4(!this.expanded ? true : void 0)}>
|
|
4941
4950
|
${this._expandableSlot}
|
|
4942
4951
|
</div>`}
|
|
@@ -5038,8 +5047,7 @@ var windowExists2 = typeof window !== "undefined";
|
|
|
5038
5047
|
if (windowExists2) {
|
|
5039
5048
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5040
5049
|
const callback = ({ matches }) => reduceMotion = matches;
|
|
5041
|
-
if (query.addEventListener)
|
|
5042
|
-
query.addEventListener("change", callback);
|
|
5050
|
+
if (query.addEventListener) query.addEventListener("change", callback);
|
|
5043
5051
|
callback(query);
|
|
5044
5052
|
}
|
|
5045
5053
|
|
|
@@ -5070,8 +5078,7 @@ var Move = class {
|
|
|
5070
5078
|
}
|
|
5071
5079
|
async play() {
|
|
5072
5080
|
this.last = this.el.getBoundingClientRect();
|
|
5073
|
-
if (!this.el.animate)
|
|
5074
|
-
return;
|
|
5081
|
+
if (!this.el.animate) return;
|
|
5075
5082
|
const animation = this.el.animate(this.keyframes, this.animationOptions);
|
|
5076
5083
|
await animation.finished;
|
|
5077
5084
|
}
|
|
@@ -5085,19 +5092,17 @@ var Move = class {
|
|
|
5085
5092
|
return __spreadValues(__spreadValues({}, this.defaults), this.userAnimationOptions);
|
|
5086
5093
|
}
|
|
5087
5094
|
get animationOptions() {
|
|
5088
|
-
if (!this.shouldReduceMotion)
|
|
5089
|
-
|
|
5090
|
-
if (!reduceMotion)
|
|
5091
|
-
return this.mergedOptions;
|
|
5095
|
+
if (!this.shouldReduceMotion) return this.mergedOptions;
|
|
5096
|
+
if (!reduceMotion) return this.mergedOptions;
|
|
5092
5097
|
return __spreadProps(__spreadValues({}, this.mergedOptions), { duration: 0 });
|
|
5093
5098
|
}
|
|
5094
5099
|
};
|
|
5095
5100
|
|
|
5096
|
-
// 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
|
|
5097
5102
|
import { LitElement as LitElement9 } from "lit";
|
|
5098
5103
|
import { unsafeStatic as unsafeStatic9, html as html20 } from "lit/static-html.js";
|
|
5099
|
-
var
|
|
5100
|
-
var
|
|
5104
|
+
var messages30 = JSON.parse('{"icon.title.arrow-left":"Pil som peker mot venstre"}');
|
|
5105
|
+
var messages210 = JSON.parse('{"icon.title.arrow-left":"Leftward-pointing arrow"}');
|
|
5101
5106
|
var messages39 = JSON.parse('{"icon.title.arrow-left":"Vasemmalle osoittava nuoli"}');
|
|
5102
5107
|
var supportedLocales10 = ["en", "nb", "fi", "da", "sv"];
|
|
5103
5108
|
var defaultLocale11 = "en";
|
|
@@ -5169,11 +5174,11 @@ var getMessages10 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
5169
5174
|
};
|
|
5170
5175
|
var activateI18n10 = (enMessages, nbMessages, fiMessages) => {
|
|
5171
5176
|
const locale = detectLocale10();
|
|
5172
|
-
const
|
|
5173
|
-
i18n.load(locale,
|
|
5177
|
+
const messages410 = getMessages10(locale, enMessages, nbMessages, fiMessages);
|
|
5178
|
+
i18n.load(locale, messages410);
|
|
5174
5179
|
i18n.activate(locale);
|
|
5175
5180
|
};
|
|
5176
|
-
activateI18n10(
|
|
5181
|
+
activateI18n10(messages210, messages30, messages39);
|
|
5177
5182
|
var IconArrowLeft16 = class extends LitElement9 {
|
|
5178
5183
|
render() {
|
|
5179
5184
|
const title = i18n.t({ message: `Leftward-pointing arrow`, id: "icon.title.arrow-left", comment: "Title for table arrow left icon" });
|
|
@@ -5227,8 +5232,7 @@ var ModalHeader = class extends CanCloseMixin(WarpElement12) {
|
|
|
5227
5232
|
</button>` : nothing3;
|
|
5228
5233
|
}
|
|
5229
5234
|
get closeButton() {
|
|
5230
|
-
if (this[NO_CLOSE_BUTTON])
|
|
5231
|
-
return nothing3;
|
|
5235
|
+
if (this[NO_CLOSE_BUTTON]) return nothing3;
|
|
5232
5236
|
return html21` <button
|
|
5233
5237
|
type="button"
|
|
5234
5238
|
class="${modalElement.headerButton} ${this._hasTopContent ? modalElement.headerCloseButtonOnImage : modalElement.headerCloseButton}"
|
|
@@ -5365,13 +5369,11 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5365
5369
|
`;
|
|
5366
5370
|
}
|
|
5367
5371
|
willUpdate(changedProperties) {
|
|
5368
|
-
if (changedProperties.has("show"))
|
|
5369
|
-
this[this.show ? "open" : "close"]();
|
|
5372
|
+
if (changedProperties.has("show")) this[this.show ? "open" : "close"]();
|
|
5370
5373
|
}
|
|
5371
5374
|
handleListeners(verb = "addEventListener") {
|
|
5372
5375
|
document[verb]("keydown", this.interceptEscape);
|
|
5373
|
-
if (!this[NO_BACKDROP_CLICKS])
|
|
5374
|
-
this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
|
|
5376
|
+
if (!this[NO_BACKDROP_CLICKS]) this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
|
|
5375
5377
|
this.dialogEl.value[verb]("close", this.eventPreventer);
|
|
5376
5378
|
this.dialogEl.value[verb]("cancel", this.eventPreventer);
|
|
5377
5379
|
this.dialogInnerEl.value[verb]("transitionend", this.modifyBorderRadius);
|
|
@@ -5382,8 +5384,7 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5382
5384
|
}
|
|
5383
5385
|
/** @param {MouseEvent} evt */
|
|
5384
5386
|
closeOnBackdropClick(evt) {
|
|
5385
|
-
if (this.dialogEl.value === evt.target)
|
|
5386
|
-
this.close();
|
|
5387
|
+
if (this.dialogEl.value === evt.target) this.close();
|
|
5387
5388
|
}
|
|
5388
5389
|
/** @param {KeyboardEvent} evt */
|
|
5389
5390
|
interceptEscape(evt) {
|
|
@@ -5393,10 +5394,8 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5393
5394
|
}
|
|
5394
5395
|
}
|
|
5395
5396
|
modifyBorderRadius() {
|
|
5396
|
-
if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight)
|
|
5397
|
-
|
|
5398
|
-
else
|
|
5399
|
-
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;
|
|
5400
5399
|
}
|
|
5401
5400
|
};
|
|
5402
5401
|
__publicField(ModalMain, "properties", {
|
|
@@ -5478,20 +5477,23 @@ if (!customElements.get("w-modal")) {
|
|
|
5478
5477
|
import { html as html23 } from "lit";
|
|
5479
5478
|
import WarpElement14 from "@warp-ds/elements-core";
|
|
5480
5479
|
|
|
5480
|
+
// packages/pill/locales/da/messages.mjs
|
|
5481
|
+
var messages31 = JSON.parse('{"pill.aria.openFilter":"\xC5bn filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
5482
|
+
|
|
5481
5483
|
// packages/pill/locales/en/messages.mjs
|
|
5482
|
-
var
|
|
5484
|
+
var messages40 = JSON.parse('{"pill.aria.openFilter":"Open filter","pill.aria.removeFilter":["Remove filter ",["label"]]}');
|
|
5483
5485
|
|
|
5484
5486
|
// packages/pill/locales/fi/messages.mjs
|
|
5485
|
-
var
|
|
5487
|
+
var messages41 = JSON.parse('{"pill.aria.openFilter":"Avaa suodatin","pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');
|
|
5486
5488
|
|
|
5487
5489
|
// packages/pill/locales/nb/messages.mjs
|
|
5488
|
-
var
|
|
5490
|
+
var messages42 = JSON.parse('{"pill.aria.openFilter":"\xC5pne filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
5489
5491
|
|
|
5490
5492
|
// packages/pill/index.js
|
|
5491
5493
|
var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
5492
5494
|
constructor() {
|
|
5493
5495
|
super();
|
|
5494
|
-
activateI18n7(
|
|
5496
|
+
activateI18n7(messages40, messages42, messages41, messages31);
|
|
5495
5497
|
this.canClose = false;
|
|
5496
5498
|
this.suggestion = false;
|
|
5497
5499
|
this.openFilterSrText = i18n._({
|
|
@@ -5559,33 +5561,32 @@ import { ifDefined as ifDefined5 } from "lit/directives/if-defined.js";
|
|
|
5559
5561
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
5560
5562
|
import { when } from "lit/directives/when.js";
|
|
5561
5563
|
|
|
5564
|
+
// packages/select/locales/da/messages.mjs
|
|
5565
|
+
var messages43 = JSON.parse('{"select.label.optional":"(valgfrit)"}');
|
|
5566
|
+
|
|
5562
5567
|
// packages/select/locales/en/messages.mjs
|
|
5563
|
-
var
|
|
5568
|
+
var messages44 = JSON.parse('{"select.label.optional":"(optional)"}');
|
|
5564
5569
|
|
|
5565
5570
|
// packages/select/locales/fi/messages.mjs
|
|
5566
|
-
var
|
|
5571
|
+
var messages45 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
|
|
5567
5572
|
|
|
5568
5573
|
// packages/select/locales/nb/messages.mjs
|
|
5569
|
-
var
|
|
5574
|
+
var messages46 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
|
|
5570
5575
|
|
|
5571
5576
|
// packages/select/index.js
|
|
5572
|
-
var
|
|
5577
|
+
var _WarpSelect_instances, classes_get, helpTextClasses_get, chevronClasses_get, id_get, helpId_get;
|
|
5573
5578
|
var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
5574
5579
|
constructor() {
|
|
5575
5580
|
super();
|
|
5576
|
-
__privateAdd(this,
|
|
5577
|
-
|
|
5578
|
-
__privateAdd(this, _chevronClasses);
|
|
5579
|
-
__privateAdd(this, _id);
|
|
5580
|
-
__privateAdd(this, _helpId);
|
|
5581
|
-
activateI18n7(messages40, messages42, messages41);
|
|
5581
|
+
__privateAdd(this, _WarpSelect_instances);
|
|
5582
|
+
activateI18n7(messages44, messages46, messages45, messages43);
|
|
5582
5583
|
this._options = this.innerHTML;
|
|
5583
5584
|
}
|
|
5584
5585
|
render() {
|
|
5585
5586
|
return html24`<div class="${select.wrapper}">
|
|
5586
5587
|
${when(
|
|
5587
5588
|
this.label,
|
|
5588
|
-
() => html24`<label class="${label.label}" for="${__privateGet(this,
|
|
5589
|
+
() => html24`<label class="${label.label}" for="${__privateGet(this, _WarpSelect_instances, id_get)}">
|
|
5589
5590
|
${this.label}
|
|
5590
5591
|
${when(
|
|
5591
5592
|
this.optional,
|
|
@@ -5601,30 +5602,29 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
|
5601
5602
|
)}
|
|
5602
5603
|
<div class="${select.selectWrapper}">
|
|
5603
5604
|
<select
|
|
5604
|
-
class="${__privateGet(this,
|
|
5605
|
-
id="${__privateGet(this,
|
|
5605
|
+
class="${__privateGet(this, _WarpSelect_instances, classes_get)}"
|
|
5606
|
+
id="${__privateGet(this, _WarpSelect_instances, id_get)}"
|
|
5606
5607
|
?autofocus=${this.autoFocus}
|
|
5607
|
-
aria-describedby="${ifDefined5(__privateGet(this,
|
|
5608
|
+
aria-describedby="${ifDefined5(__privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5608
5609
|
aria-invalid="${ifDefined5(this.invalid)}"
|
|
5609
|
-
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this,
|
|
5610
|
+
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _WarpSelect_instances, helpId_get))}">
|
|
5610
5611
|
${unsafeHTML(this._options)}
|
|
5611
5612
|
</select>
|
|
5612
|
-
<div class="${__privateGet(this,
|
|
5613
|
+
<div class="${__privateGet(this, _WarpSelect_instances, chevronClasses_get)}">
|
|
5613
5614
|
<w-icon-chevron-down-16></w-icon-chevron-down-16>
|
|
5614
5615
|
</div>
|
|
5615
5616
|
</div>
|
|
5616
|
-
${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>`)}
|
|
5617
5618
|
</div>`;
|
|
5618
5619
|
}
|
|
5619
5620
|
};
|
|
5620
|
-
|
|
5621
|
+
_WarpSelect_instances = new WeakSet();
|
|
5621
5622
|
classes_get = function() {
|
|
5622
5623
|
return r({
|
|
5623
5624
|
[select.default]: true,
|
|
5624
5625
|
[select.invalid]: this.invalid
|
|
5625
5626
|
});
|
|
5626
5627
|
};
|
|
5627
|
-
_helpTextClasses = new WeakSet();
|
|
5628
5628
|
helpTextClasses_get = function() {
|
|
5629
5629
|
return r({
|
|
5630
5630
|
[helpText.helpText]: true,
|
|
@@ -5632,20 +5632,17 @@ helpTextClasses_get = function() {
|
|
|
5632
5632
|
[helpText.helpTextColorInvalid]: this.invalid
|
|
5633
5633
|
});
|
|
5634
5634
|
};
|
|
5635
|
-
_chevronClasses = new WeakSet();
|
|
5636
5635
|
chevronClasses_get = function() {
|
|
5637
5636
|
return r({
|
|
5638
5637
|
[select.chevron]: true,
|
|
5639
5638
|
[select.chevronDisabled]: this.disabled
|
|
5640
5639
|
});
|
|
5641
5640
|
};
|
|
5642
|
-
_id = new WeakSet();
|
|
5643
5641
|
id_get = function() {
|
|
5644
5642
|
return "select_id";
|
|
5645
5643
|
};
|
|
5646
|
-
_helpId = new WeakSet();
|
|
5647
5644
|
helpId_get = function() {
|
|
5648
|
-
return this.hint ? `${__privateGet(this,
|
|
5645
|
+
return this.hint ? `${__privateGet(this, _WarpSelect_instances, id_get)}__hint` : void 0;
|
|
5649
5646
|
};
|
|
5650
5647
|
__publicField(WarpSelect, "properties", {
|
|
5651
5648
|
// Whether the element should receive focus on render
|
|
@@ -5700,15 +5697,13 @@ var WarpTextField = class extends WarpElement16 {
|
|
|
5700
5697
|
}
|
|
5701
5698
|
}
|
|
5702
5699
|
get _helpId() {
|
|
5703
|
-
if (this.helpText)
|
|
5704
|
-
return `${this._id}__hint`;
|
|
5700
|
+
if (this.helpText) return `${this._id}__hint`;
|
|
5705
5701
|
}
|
|
5706
5702
|
get _id() {
|
|
5707
5703
|
return "textfield";
|
|
5708
5704
|
}
|
|
5709
5705
|
get _error() {
|
|
5710
|
-
if (this.invalid && this._helpId)
|
|
5711
|
-
return this._helpId;
|
|
5706
|
+
if (this.invalid && this._helpId) return this._helpId;
|
|
5712
5707
|
}
|
|
5713
5708
|
handler(e) {
|
|
5714
5709
|
const { name, value } = e.target;
|
|
@@ -5724,14 +5719,12 @@ var WarpTextField = class extends WarpElement16 {
|
|
|
5724
5719
|
prefixSlotChange(e) {
|
|
5725
5720
|
const el = this.renderRoot.querySelector("slot[name=prefix]");
|
|
5726
5721
|
const affixes = el.assignedElements();
|
|
5727
|
-
if (affixes.length)
|
|
5728
|
-
this._hasPrefix = true;
|
|
5722
|
+
if (affixes.length) this._hasPrefix = true;
|
|
5729
5723
|
}
|
|
5730
5724
|
suffixSlotChange(e) {
|
|
5731
5725
|
const el = this.renderRoot.querySelector("slot[name=suffix]");
|
|
5732
5726
|
const affixes = el.assignedElements();
|
|
5733
|
-
if (affixes.length)
|
|
5734
|
-
this._hasSuffix = true;
|
|
5727
|
+
if (affixes.length) this._hasSuffix = true;
|
|
5735
5728
|
}
|
|
5736
5729
|
render() {
|
|
5737
5730
|
return html25`
|
|
@@ -5808,8 +5801,7 @@ if (!customElements.get("w-textfield")) {
|
|
|
5808
5801
|
|
|
5809
5802
|
// packages/toast/api.js
|
|
5810
5803
|
function toast2(message, options) {
|
|
5811
|
-
if (!windowExists)
|
|
5812
|
-
return;
|
|
5804
|
+
if (!windowExists) return;
|
|
5813
5805
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5814
5806
|
const data = __spreadValues({
|
|
5815
5807
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),
|
|
@@ -5821,14 +5813,12 @@ function toast2(message, options) {
|
|
|
5821
5813
|
return data;
|
|
5822
5814
|
}
|
|
5823
5815
|
function removeToast(id) {
|
|
5824
|
-
if (!windowExists)
|
|
5825
|
-
return;
|
|
5816
|
+
if (!windowExists) return;
|
|
5826
5817
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5827
5818
|
return toast3.del(id);
|
|
5828
5819
|
}
|
|
5829
5820
|
function updateToast(id, options) {
|
|
5830
|
-
if (!windowExists)
|
|
5831
|
-
return;
|
|
5821
|
+
if (!windowExists) return;
|
|
5832
5822
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5833
5823
|
toast3.set(__spreadValues(__spreadValues({}, toast3.get(id)), options));
|
|
5834
5824
|
return toast3.get(id);
|
|
@@ -5849,10 +5839,8 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5849
5839
|
const keep = [];
|
|
5850
5840
|
const remove = [];
|
|
5851
5841
|
for (const toast3 of this._toasts) {
|
|
5852
|
-
if (Date.now() <= toast3[1].duration)
|
|
5853
|
-
|
|
5854
|
-
else
|
|
5855
|
-
remove.push(toast3);
|
|
5842
|
+
if (Date.now() <= toast3[1].duration) keep.push(toast3);
|
|
5843
|
+
else remove.push(toast3);
|
|
5856
5844
|
}
|
|
5857
5845
|
const collapseTasks = [];
|
|
5858
5846
|
for (const [id] of remove) {
|
|
@@ -5860,15 +5848,13 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5860
5848
|
collapseTasks.push(el.collapse());
|
|
5861
5849
|
}
|
|
5862
5850
|
Promise.all(collapseTasks).then(() => {
|
|
5863
|
-
if (keep.length !== this._toasts.size)
|
|
5864
|
-
this._toasts = new Map(keep);
|
|
5851
|
+
if (keep.length !== this._toasts.size) this._toasts = new Map(keep);
|
|
5865
5852
|
});
|
|
5866
5853
|
}, 500);
|
|
5867
5854
|
}
|
|
5868
5855
|
disconnectedCallback() {
|
|
5869
5856
|
super.disconnectedCallback();
|
|
5870
|
-
if (this._interval)
|
|
5871
|
-
clearTimeout(this._interval);
|
|
5857
|
+
if (this._interval) clearTimeout(this._interval);
|
|
5872
5858
|
}
|
|
5873
5859
|
static init() {
|
|
5874
5860
|
let el = document.querySelector("w-toast-container");
|
|
@@ -5890,8 +5876,7 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5890
5876
|
if (!id) {
|
|
5891
5877
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
5892
5878
|
}
|
|
5893
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
5894
|
-
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');
|
|
5895
5880
|
return this._toasts.get(id);
|
|
5896
5881
|
}
|
|
5897
5882
|
/**
|
|
@@ -5900,8 +5885,7 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5900
5885
|
* @returns {WarpToastContainer}
|
|
5901
5886
|
*/
|
|
5902
5887
|
set(toast3) {
|
|
5903
|
-
if (!toast3.id)
|
|
5904
|
-
throw new Error('invalid or undefined "id" on toast object');
|
|
5888
|
+
if (!toast3.id) throw new Error('invalid or undefined "id" on toast object');
|
|
5905
5889
|
const result = this._toasts.set(toast3.id, __spreadProps(__spreadValues({}, toast3), {
|
|
5906
5890
|
duration: Date.now() + (toast3.duration || 5e3)
|
|
5907
5891
|
}));
|
|
@@ -5917,11 +5901,9 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5917
5901
|
if (!id) {
|
|
5918
5902
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
5919
5903
|
}
|
|
5920
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
5921
|
-
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');
|
|
5922
5905
|
const el = this.renderRoot.querySelector(`#${id}`);
|
|
5923
|
-
if (!this._toasts.has(id))
|
|
5924
|
-
return false;
|
|
5906
|
+
if (!this._toasts.has(id)) return false;
|
|
5925
5907
|
await el.collapse();
|
|
5926
5908
|
const result = this._toasts.delete(id);
|
|
5927
5909
|
this._toasts = new Map(Array.from(this._toasts));
|
|
@@ -5973,8 +5955,7 @@ var prefersMotion = true;
|
|
|
5973
5955
|
if (windowExists3) {
|
|
5974
5956
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5975
5957
|
const callback = ({ matches }) => prefersMotion = !matches;
|
|
5976
|
-
if (query.addEventListener)
|
|
5977
|
-
query.addEventListener("change", callback);
|
|
5958
|
+
if (query.addEventListener) query.addEventListener("change", callback);
|
|
5978
5959
|
callback(query);
|
|
5979
5960
|
}
|
|
5980
5961
|
var removeTransition = (el) => {
|
|
@@ -5991,19 +5972,16 @@ var addTransition = (el) => {
|
|
|
5991
5972
|
var getAfterExpandCallback = (el, done) => () => {
|
|
5992
5973
|
el.style.height = "auto";
|
|
5993
5974
|
el.style.overflow = null;
|
|
5994
|
-
if (done)
|
|
5995
|
-
done();
|
|
5975
|
+
if (done) done();
|
|
5996
5976
|
};
|
|
5997
5977
|
var getAfterCollapseCallback = (done) => () => {
|
|
5998
|
-
if (done)
|
|
5999
|
-
done();
|
|
5978
|
+
if (done) done();
|
|
6000
5979
|
};
|
|
6001
5980
|
var expand = (el, done) => {
|
|
6002
5981
|
const returnPromise = (() => {
|
|
6003
|
-
if (!done)
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
});
|
|
5982
|
+
if (!done) return new Promise((r3) => {
|
|
5983
|
+
done = r3;
|
|
5984
|
+
});
|
|
6007
5985
|
})();
|
|
6008
5986
|
const afterExpandCallback = getAfterExpandCallback(el, done);
|
|
6009
5987
|
removeTransition(el);
|
|
@@ -6016,15 +5994,13 @@ var expand = (el, done) => {
|
|
|
6016
5994
|
addTransition(el);
|
|
6017
5995
|
requestAnimationFrame(() => el.style.height = dest + "px");
|
|
6018
5996
|
});
|
|
6019
|
-
if (returnPromise)
|
|
6020
|
-
return returnPromise;
|
|
5997
|
+
if (returnPromise) return returnPromise;
|
|
6021
5998
|
};
|
|
6022
5999
|
var collapse = (el, done) => {
|
|
6023
6000
|
const returnPromise = (() => {
|
|
6024
|
-
if (!done)
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
});
|
|
6001
|
+
if (!done) return new Promise((r3) => {
|
|
6002
|
+
done = r3;
|
|
6003
|
+
});
|
|
6028
6004
|
})();
|
|
6029
6005
|
const afterCollapseCallback = getAfterCollapseCallback(done);
|
|
6030
6006
|
removeTransition(el);
|
|
@@ -6036,22 +6012,24 @@ var collapse = (el, done) => {
|
|
|
6036
6012
|
addTransition(el);
|
|
6037
6013
|
requestAnimationFrame(() => el.style.height = "0px");
|
|
6038
6014
|
});
|
|
6039
|
-
if (returnPromise)
|
|
6040
|
-
return returnPromise;
|
|
6015
|
+
if (returnPromise) return returnPromise;
|
|
6041
6016
|
};
|
|
6042
6017
|
|
|
6043
6018
|
// packages/toast/toast.js
|
|
6044
6019
|
import { classMap as classMap2 } from "lit/directives/class-map.js";
|
|
6045
6020
|
import { when as when2 } from "lit/directives/when.js";
|
|
6046
6021
|
|
|
6022
|
+
// packages/toast/locales/da/messages.mjs
|
|
6023
|
+
var messages47 = JSON.parse('{"toast.aria.error":"Fejl","toast.aria.successful":"Fuldf\xF8rt","toast.aria.warning":"Advarsel"}');
|
|
6024
|
+
|
|
6047
6025
|
// packages/toast/locales/en/messages.mjs
|
|
6048
|
-
var
|
|
6026
|
+
var messages48 = JSON.parse('{"toast.aria.error":"Error","toast.aria.successful":"Successful","toast.aria.warning":"Warning"}');
|
|
6049
6027
|
|
|
6050
6028
|
// packages/toast/locales/fi/messages.mjs
|
|
6051
|
-
var
|
|
6029
|
+
var messages49 = JSON.parse('{"toast.aria.error":"Virhe","toast.aria.successful":"Onnistui","toast.aria.warning":"Varoitus"}');
|
|
6052
6030
|
|
|
6053
6031
|
// packages/toast/locales/nb/messages.mjs
|
|
6054
|
-
var
|
|
6032
|
+
var messages50 = JSON.parse('{"toast.aria.error":"Feil","toast.aria.successful":"Vellykket","toast.aria.warning":"Advarsel"}');
|
|
6055
6033
|
|
|
6056
6034
|
// packages/toast/toast.js
|
|
6057
6035
|
var classes2 = (definition) => {
|
|
@@ -6071,7 +6049,7 @@ var toastType = {
|
|
|
6071
6049
|
var WarpToast = class extends WarpElement18 {
|
|
6072
6050
|
constructor() {
|
|
6073
6051
|
super();
|
|
6074
|
-
activateI18n7(
|
|
6052
|
+
activateI18n7(messages48, messages50, messages49, messages47);
|
|
6075
6053
|
this.id = Date.now().toString(36) + Math.random().toString(36).slice(2, 5);
|
|
6076
6054
|
this.type = "success";
|
|
6077
6055
|
this.text = "";
|
|
@@ -6084,8 +6062,7 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6084
6062
|
super.disconnectedCallback();
|
|
6085
6063
|
}
|
|
6086
6064
|
updated() {
|
|
6087
|
-
if (!this._expanded && this._wrapper)
|
|
6088
|
-
expand(this._wrapper, () => this._expanded = true);
|
|
6065
|
+
if (!this._expanded && this._wrapper) expand(this._wrapper, () => this._expanded = true);
|
|
6089
6066
|
}
|
|
6090
6067
|
get _primaryClasses() {
|
|
6091
6068
|
return classes2({
|
|
@@ -6139,19 +6116,14 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6139
6116
|
}
|
|
6140
6117
|
}
|
|
6141
6118
|
get _iconMarkup() {
|
|
6142
|
-
if (this._warning)
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
return html27`<w-icon-error-16></w-icon-error-16>`;
|
|
6146
|
-
else
|
|
6147
|
-
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>`;
|
|
6148
6122
|
}
|
|
6149
6123
|
async collapse() {
|
|
6150
6124
|
return new Promise((resolve) => {
|
|
6151
|
-
if (this._expanded && this._wrapper)
|
|
6152
|
-
|
|
6153
|
-
else
|
|
6154
|
-
resolve();
|
|
6125
|
+
if (this._expanded && this._wrapper) collapse(this._wrapper, resolve);
|
|
6126
|
+
else resolve();
|
|
6155
6127
|
});
|
|
6156
6128
|
}
|
|
6157
6129
|
close() {
|
|
@@ -6163,8 +6135,7 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6163
6135
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
6164
6136
|
}
|
|
6165
6137
|
render() {
|
|
6166
|
-
if (!this.text)
|
|
6167
|
-
return html27``;
|
|
6138
|
+
if (!this.text) return html27``;
|
|
6168
6139
|
return html27` <section class="${toast.wrapper}" aria-label="${this._typeLabel}">
|
|
6169
6140
|
<div class="${this._primaryClasses}">
|
|
6170
6141
|
<div class="${this._iconClasses}">${this._iconMarkup}</div>
|
|
@@ -6221,8 +6192,7 @@ var ExpandTransition = class extends WarpElement19 {
|
|
|
6221
6192
|
}
|
|
6222
6193
|
}
|
|
6223
6194
|
updated() {
|
|
6224
|
-
if (!this._wrapper)
|
|
6225
|
-
return;
|
|
6195
|
+
if (!this._wrapper) return;
|
|
6226
6196
|
if (!this._mounted) {
|
|
6227
6197
|
this._mounted = true;
|
|
6228
6198
|
return;
|