@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -6,6 +6,9 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __typeError = (msg) => {
|
|
10
|
+
throw TypeError(msg);
|
|
11
|
+
};
|
|
9
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
13
|
var __spreadValues = (a, b) => {
|
|
11
14
|
for (var prop in b || (b = {}))
|
|
@@ -49,23 +52,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
49
52
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
50
53
|
mod
|
|
51
54
|
));
|
|
52
|
-
var __publicField = (obj, key, value) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var __accessCheck = (obj, member, msg) => {
|
|
57
|
-
if (!member.has(obj))
|
|
58
|
-
throw TypeError("Cannot " + msg);
|
|
59
|
-
};
|
|
60
|
-
var __privateGet = (obj, member, getter) => {
|
|
61
|
-
__accessCheck(obj, member, "read from private field");
|
|
62
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
63
|
-
};
|
|
64
|
-
var __privateAdd = (obj, member, value) => {
|
|
65
|
-
if (member.has(obj))
|
|
66
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
67
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
68
|
-
};
|
|
55
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
56
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
57
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
58
|
+
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);
|
|
69
59
|
|
|
70
60
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
71
61
|
var require_errors = __commonJS({
|
|
@@ -238,8 +228,7 @@ var require_moo = __commonJS({
|
|
|
238
228
|
return "(" + s + ")";
|
|
239
229
|
}
|
|
240
230
|
function reUnion(regexps) {
|
|
241
|
-
if (!regexps.length)
|
|
242
|
-
return "(?!)";
|
|
231
|
+
if (!regexps.length) return "(?!)";
|
|
243
232
|
var source = regexps.map(function(s) {
|
|
244
233
|
return "(?:" + s + ")";
|
|
245
234
|
}).join("|");
|
|
@@ -249,14 +238,10 @@ var require_moo = __commonJS({
|
|
|
249
238
|
if (typeof obj === "string") {
|
|
250
239
|
return "(?:" + reEscape(obj) + ")";
|
|
251
240
|
} else if (isRegExp(obj)) {
|
|
252
|
-
if (obj.ignoreCase)
|
|
253
|
-
|
|
254
|
-
if (obj.
|
|
255
|
-
|
|
256
|
-
if (obj.sticky)
|
|
257
|
-
throw new Error("RegExp /y flag is implied");
|
|
258
|
-
if (obj.multiline)
|
|
259
|
-
throw new Error("RegExp /m flag is implied");
|
|
241
|
+
if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
|
|
242
|
+
if (obj.global) throw new Error("RegExp /g flag is implied");
|
|
243
|
+
if (obj.sticky) throw new Error("RegExp /y flag is implied");
|
|
244
|
+
if (obj.multiline) throw new Error("RegExp /m flag is implied");
|
|
260
245
|
return obj.source;
|
|
261
246
|
} else {
|
|
262
247
|
throw new Error("Not a pattern: " + obj);
|
|
@@ -305,16 +290,14 @@ var require_moo = __commonJS({
|
|
|
305
290
|
var match = [];
|
|
306
291
|
rules.forEach(function(rule) {
|
|
307
292
|
if (isObject(rule)) {
|
|
308
|
-
if (match.length)
|
|
309
|
-
result.push(ruleOptions(key, match));
|
|
293
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
310
294
|
result.push(ruleOptions(key, rule));
|
|
311
295
|
match = [];
|
|
312
296
|
} else {
|
|
313
297
|
match.push(rule);
|
|
314
298
|
}
|
|
315
299
|
});
|
|
316
|
-
if (match.length)
|
|
317
|
-
result.push(ruleOptions(key, match));
|
|
300
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
318
301
|
}
|
|
319
302
|
return result;
|
|
320
303
|
}
|
|
@@ -449,8 +432,7 @@ var require_moo = __commonJS({
|
|
|
449
432
|
var fallbackRule = errorRule && errorRule.fallback;
|
|
450
433
|
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
451
434
|
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
452
|
-
if (unicodeFlag === true)
|
|
453
|
-
flags += "u";
|
|
435
|
+
if (unicodeFlag === true) flags += "u";
|
|
454
436
|
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
455
437
|
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
456
438
|
}
|
|
@@ -471,8 +453,7 @@ var require_moo = __commonJS({
|
|
|
471
453
|
var all = states.$all ? toRules(states.$all) : [];
|
|
472
454
|
delete states.$all;
|
|
473
455
|
var keys = Object.getOwnPropertyNames(states);
|
|
474
|
-
if (!start)
|
|
475
|
-
start = keys[0];
|
|
456
|
+
if (!start) start = keys[0];
|
|
476
457
|
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
477
458
|
for (var i = 0; i < keys.length; i++) {
|
|
478
459
|
var key = keys[i];
|
|
@@ -484,8 +465,7 @@ var require_moo = __commonJS({
|
|
|
484
465
|
var included = /* @__PURE__ */ Object.create(null);
|
|
485
466
|
for (var j = 0; j < rules.length; j++) {
|
|
486
467
|
var rule = rules[j];
|
|
487
|
-
if (!rule.include)
|
|
488
|
-
continue;
|
|
468
|
+
if (!rule.include) continue;
|
|
489
469
|
var splice = [j, 1];
|
|
490
470
|
if (rule.include !== key && !included[rule.include]) {
|
|
491
471
|
included[rule.include] = true;
|
|
@@ -495,8 +475,7 @@ var require_moo = __commonJS({
|
|
|
495
475
|
}
|
|
496
476
|
for (var k = 0; k < newRules.length; k++) {
|
|
497
477
|
var newRule = newRules[k];
|
|
498
|
-
if (rules.indexOf(newRule) !== -1)
|
|
499
|
-
continue;
|
|
478
|
+
if (rules.indexOf(newRule) !== -1) continue;
|
|
500
479
|
splice.push(newRule);
|
|
501
480
|
}
|
|
502
481
|
}
|
|
@@ -577,8 +556,7 @@ var require_moo = __commonJS({
|
|
|
577
556
|
};
|
|
578
557
|
};
|
|
579
558
|
Lexer.prototype.setState = function(state) {
|
|
580
|
-
if (!state || this.state === state)
|
|
581
|
-
return;
|
|
559
|
+
if (!state || this.state === state) return;
|
|
582
560
|
this.state = state;
|
|
583
561
|
var info = this.states[state];
|
|
584
562
|
this.groups = info.groups;
|
|
@@ -682,12 +660,9 @@ var require_moo = __commonJS({
|
|
|
682
660
|
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
683
661
|
throw err;
|
|
684
662
|
}
|
|
685
|
-
if (group.pop)
|
|
686
|
-
|
|
687
|
-
else if (group.
|
|
688
|
-
this.pushState(group.push);
|
|
689
|
-
else if (group.next)
|
|
690
|
-
this.setState(group.next);
|
|
663
|
+
if (group.pop) this.popState();
|
|
664
|
+
else if (group.push) this.pushState(group.push);
|
|
665
|
+
else if (group.next) this.setState(group.next);
|
|
691
666
|
return token;
|
|
692
667
|
};
|
|
693
668
|
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
@@ -1042,8 +1017,7 @@ import { html as html2 } from "lit";
|
|
|
1042
1017
|
|
|
1043
1018
|
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
1044
1019
|
var r = function() {
|
|
1045
|
-
for (var t = [], n = arguments.length; n--; )
|
|
1046
|
-
t[n] = arguments[n];
|
|
1020
|
+
for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
|
|
1047
1021
|
return t.reduce(function(t2, n2) {
|
|
1048
1022
|
return t2.concat("string" == typeof n2 ? n2 : Array.isArray(n2) ? r.apply(void 0, n2) : "object" == typeof n2 && n2 ? Object.keys(n2).map(function(r2) {
|
|
1049
1023
|
return n2[r2] ? r2 : "";
|
|
@@ -1051,10 +1025,10 @@ var r = function() {
|
|
|
1051
1025
|
}, []).join(" ");
|
|
1052
1026
|
};
|
|
1053
1027
|
|
|
1054
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1028
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1055
1029
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1056
1030
|
|
|
1057
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1031
|
+
// node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1058
1032
|
var import_parser = __toESM(require_parser(), 1);
|
|
1059
1033
|
function processTokens(tokens, mapText) {
|
|
1060
1034
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1078,11 +1052,9 @@ function processTokens(tokens, mapText) {
|
|
|
1078
1052
|
}
|
|
1079
1053
|
const offset = token.pluralOffset;
|
|
1080
1054
|
const formatProps = {};
|
|
1081
|
-
token.cases.forEach((
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
mapText
|
|
1085
|
-
);
|
|
1055
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
1056
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
1057
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
1086
1058
|
});
|
|
1087
1059
|
return [
|
|
1088
1060
|
token.arg,
|
|
@@ -1104,7 +1076,7 @@ Message: ${message}`);
|
|
|
1104
1076
|
}
|
|
1105
1077
|
}
|
|
1106
1078
|
|
|
1107
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1079
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1108
1080
|
var isString = (s) => typeof s === "string";
|
|
1109
1081
|
var isFunction = (f) => typeof f === "function";
|
|
1110
1082
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1190,11 +1162,11 @@ var selectFormatter = (value, rules) => {
|
|
|
1190
1162
|
function interpolate(translation, locale, locales) {
|
|
1191
1163
|
return (values = {}, formats) => {
|
|
1192
1164
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1193
|
-
const formatMessage = (tokens) => {
|
|
1165
|
+
const formatMessage = (tokens, replaceOctothorpe = false) => {
|
|
1194
1166
|
if (!Array.isArray(tokens))
|
|
1195
1167
|
return tokens;
|
|
1196
1168
|
return tokens.reduce((message, token) => {
|
|
1197
|
-
if (token === "#") {
|
|
1169
|
+
if (token === "#" && replaceOctothorpe) {
|
|
1198
1170
|
return message + OCTOTHORPE_PH;
|
|
1199
1171
|
}
|
|
1200
1172
|
if (isString(token)) {
|
|
@@ -1205,7 +1177,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1205
1177
|
if (type === "plural" || type === "selectordinal" || type === "select") {
|
|
1206
1178
|
Object.entries(format).forEach(
|
|
1207
1179
|
([key, value2]) => {
|
|
1208
|
-
interpolatedFormat[key] = formatMessage(
|
|
1180
|
+
interpolatedFormat[key] = formatMessage(
|
|
1181
|
+
value2,
|
|
1182
|
+
type === "plural" || type === "selectordinal"
|
|
1183
|
+
);
|
|
1209
1184
|
}
|
|
1210
1185
|
);
|
|
1211
1186
|
} else {
|
|
@@ -1334,17 +1309,17 @@ var I18n = class extends EventEmitter {
|
|
|
1334
1309
|
}
|
|
1335
1310
|
this.emit("change");
|
|
1336
1311
|
}
|
|
1337
|
-
_load(locale,
|
|
1312
|
+
_load(locale, messages6) {
|
|
1338
1313
|
const maybeMessages = this._messages[locale];
|
|
1339
1314
|
if (!maybeMessages) {
|
|
1340
|
-
this._messages[locale] =
|
|
1315
|
+
this._messages[locale] = messages6;
|
|
1341
1316
|
} else {
|
|
1342
|
-
Object.assign(maybeMessages,
|
|
1317
|
+
Object.assign(maybeMessages, messages6);
|
|
1343
1318
|
}
|
|
1344
1319
|
}
|
|
1345
|
-
load(localeOrMessages,
|
|
1346
|
-
if (typeof localeOrMessages == "string" && typeof
|
|
1347
|
-
this._load(localeOrMessages,
|
|
1320
|
+
load(localeOrMessages, messages6) {
|
|
1321
|
+
if (typeof localeOrMessages == "string" && typeof messages6 === "object") {
|
|
1322
|
+
this._load(localeOrMessages, messages6);
|
|
1348
1323
|
} else {
|
|
1349
1324
|
Object.entries(localeOrMessages).forEach(
|
|
1350
1325
|
([locale, messages23]) => this._load(locale, messages23)
|
|
@@ -1355,10 +1330,10 @@ var I18n = class extends EventEmitter {
|
|
|
1355
1330
|
/**
|
|
1356
1331
|
* @param options {@link LoadAndActivateOptions}
|
|
1357
1332
|
*/
|
|
1358
|
-
loadAndActivate({ locale, locales, messages:
|
|
1333
|
+
loadAndActivate({ locale, locales, messages: messages6 }) {
|
|
1359
1334
|
this._locale = locale;
|
|
1360
1335
|
this._locales = locales || void 0;
|
|
1361
|
-
this._messages[this._locale] =
|
|
1336
|
+
this._messages[this._locale] = messages6;
|
|
1362
1337
|
this.emit("change");
|
|
1363
1338
|
}
|
|
1364
1339
|
activate(locale, locales) {
|
|
@@ -1373,6 +1348,9 @@ var I18n = class extends EventEmitter {
|
|
|
1373
1348
|
}
|
|
1374
1349
|
_(id, values, options) {
|
|
1375
1350
|
let message = options == null ? void 0 : options.message;
|
|
1351
|
+
if (!id) {
|
|
1352
|
+
id = "";
|
|
1353
|
+
}
|
|
1376
1354
|
if (!isString(id)) {
|
|
1377
1355
|
values = id.values || values;
|
|
1378
1356
|
message = id.message;
|
|
@@ -1413,7 +1391,7 @@ function setupI18n(params = {}) {
|
|
|
1413
1391
|
}
|
|
1414
1392
|
var i18n = setupI18n();
|
|
1415
1393
|
|
|
1416
|
-
// node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.
|
|
1394
|
+
// 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
|
|
1417
1395
|
var box = {
|
|
1418
1396
|
box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1419
1397
|
// Relative here enables w-clickable
|
|
@@ -1708,7 +1686,7 @@ import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
|
1708
1686
|
import { when } from "lit/directives/when.js";
|
|
1709
1687
|
|
|
1710
1688
|
// packages/i18n.ts
|
|
1711
|
-
var supportedLocales = ["en", "nb", "fi"];
|
|
1689
|
+
var supportedLocales = ["en", "nb", "fi", "da"];
|
|
1712
1690
|
var defaultLocale2 = "en";
|
|
1713
1691
|
var getSupportedLocale = (usedLocale) => {
|
|
1714
1692
|
return supportedLocales.find(
|
|
@@ -1728,17 +1706,16 @@ function detectLocale() {
|
|
|
1728
1706
|
return defaultLocale2;
|
|
1729
1707
|
}
|
|
1730
1708
|
}
|
|
1731
|
-
var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
|
|
1732
|
-
if (locale === "nb")
|
|
1733
|
-
|
|
1734
|
-
if (locale === "
|
|
1735
|
-
return fiMsg;
|
|
1709
|
+
var getMessages = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
1710
|
+
if (locale === "nb") return nbMsg;
|
|
1711
|
+
if (locale === "fi") return fiMsg;
|
|
1712
|
+
if (locale === "da") return daMsg;
|
|
1736
1713
|
return enMsg;
|
|
1737
1714
|
};
|
|
1738
|
-
var activateI18n = (enMessages, nbMessages, fiMessages) => {
|
|
1715
|
+
var activateI18n = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
1739
1716
|
const locale = detectLocale();
|
|
1740
|
-
const
|
|
1741
|
-
i18n.load(locale,
|
|
1717
|
+
const messages6 = getMessages(locale, enMessages, nbMessages, fiMessages, daMessages);
|
|
1718
|
+
i18n.load(locale, messages6);
|
|
1742
1719
|
i18n.activate(locale);
|
|
1743
1720
|
};
|
|
1744
1721
|
|
|
@@ -1759,19 +1736,22 @@ function kebabCaseAttributes(constructor) {
|
|
|
1759
1736
|
};
|
|
1760
1737
|
}
|
|
1761
1738
|
|
|
1739
|
+
// packages/select/locales/da/messages.mjs
|
|
1740
|
+
var messages = JSON.parse('{"select.label.optional":"(valgfrit)"}');
|
|
1741
|
+
|
|
1762
1742
|
// packages/select/locales/en/messages.mjs
|
|
1763
|
-
var
|
|
1743
|
+
var messages2 = JSON.parse('{"select.label.optional":"(optional)"}');
|
|
1764
1744
|
|
|
1765
1745
|
// packages/select/locales/fi/messages.mjs
|
|
1766
|
-
var
|
|
1746
|
+
var messages3 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
|
|
1767
1747
|
|
|
1768
1748
|
// packages/select/locales/nb/messages.mjs
|
|
1769
|
-
var
|
|
1749
|
+
var messages4 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
|
|
1770
1750
|
|
|
1771
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1751
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
1772
1752
|
import { LitElement } from "lit";
|
|
1773
1753
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1774
|
-
var
|
|
1754
|
+
var messages5 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
1775
1755
|
var messages22 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
|
|
1776
1756
|
var messages32 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
|
|
1777
1757
|
var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
|
|
@@ -1848,7 +1828,7 @@ var activateI18n2 = (enMessages, nbMessages, fiMessages) => {
|
|
|
1848
1828
|
i18n.load(locale, messages42);
|
|
1849
1829
|
i18n.activate(locale);
|
|
1850
1830
|
};
|
|
1851
|
-
activateI18n2(messages22,
|
|
1831
|
+
activateI18n2(messages22, messages5, messages32);
|
|
1852
1832
|
var IconChevronDown16 = class extends LitElement {
|
|
1853
1833
|
render() {
|
|
1854
1834
|
const title = i18n.t({ message: `Downward arrow`, id: "icon.title.chevron-down", comment: "Title for chevron-down icon" });
|
|
@@ -1860,23 +1840,19 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
1860
1840
|
}
|
|
1861
1841
|
|
|
1862
1842
|
// packages/select/index.js
|
|
1863
|
-
var
|
|
1843
|
+
var _WarpSelect_instances, classes_get, helpTextClasses_get, chevronClasses_get, id_get, helpId_get;
|
|
1864
1844
|
var WarpSelect = class extends kebabCaseAttributes(WarpElement) {
|
|
1865
1845
|
constructor() {
|
|
1866
1846
|
super();
|
|
1867
|
-
__privateAdd(this,
|
|
1868
|
-
|
|
1869
|
-
__privateAdd(this, _chevronClasses);
|
|
1870
|
-
__privateAdd(this, _id);
|
|
1871
|
-
__privateAdd(this, _helpId);
|
|
1872
|
-
activateI18n(messages, messages3, messages2);
|
|
1847
|
+
__privateAdd(this, _WarpSelect_instances);
|
|
1848
|
+
activateI18n(messages2, messages4, messages3, messages);
|
|
1873
1849
|
this._options = this.innerHTML;
|
|
1874
1850
|
}
|
|
1875
1851
|
render() {
|
|
1876
1852
|
return html2`<div class="${select.wrapper}">
|
|
1877
1853
|
${when(
|
|
1878
1854
|
this.label,
|
|
1879
|
-
() => html2`<label class="${label.label}" for="${__privateGet(this,
|
|
1855
|
+
() => html2`<label class="${label.label}" for="${__privateGet(this, _WarpSelect_instances, id_get)}">
|
|
1880
1856
|
${this.label}
|
|
1881
1857
|
${when(
|
|
1882
1858
|
this.optional,
|
|
@@ -1892,30 +1868,29 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement) {
|
|
|
1892
1868
|
)}
|
|
1893
1869
|
<div class="${select.selectWrapper}">
|
|
1894
1870
|
<select
|
|
1895
|
-
class="${__privateGet(this,
|
|
1896
|
-
id="${__privateGet(this,
|
|
1871
|
+
class="${__privateGet(this, _WarpSelect_instances, classes_get)}"
|
|
1872
|
+
id="${__privateGet(this, _WarpSelect_instances, id_get)}"
|
|
1897
1873
|
?autofocus=${this.autoFocus}
|
|
1898
|
-
aria-describedby="${ifDefined(__privateGet(this,
|
|
1874
|
+
aria-describedby="${ifDefined(__privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
1899
1875
|
aria-invalid="${ifDefined(this.invalid)}"
|
|
1900
|
-
aria-errormessage="${ifDefined(this.invalid && __privateGet(this,
|
|
1876
|
+
aria-errormessage="${ifDefined(this.invalid && __privateGet(this, _WarpSelect_instances, helpId_get))}">
|
|
1901
1877
|
${unsafeHTML(this._options)}
|
|
1902
1878
|
</select>
|
|
1903
|
-
<div class="${__privateGet(this,
|
|
1879
|
+
<div class="${__privateGet(this, _WarpSelect_instances, chevronClasses_get)}">
|
|
1904
1880
|
<w-icon-chevron-down-16></w-icon-chevron-down-16>
|
|
1905
1881
|
</div>
|
|
1906
1882
|
</div>
|
|
1907
|
-
${when(this.always || this.invalid, () => html2`<div id="${__privateGet(this,
|
|
1883
|
+
${when(this.always || this.invalid, () => html2`<div id="${__privateGet(this, _WarpSelect_instances, helpId_get)}" class="${__privateGet(this, _WarpSelect_instances, helpTextClasses_get)}">${this.hint}</div>`)}
|
|
1908
1884
|
</div>`;
|
|
1909
1885
|
}
|
|
1910
1886
|
};
|
|
1911
|
-
|
|
1887
|
+
_WarpSelect_instances = new WeakSet();
|
|
1912
1888
|
classes_get = function() {
|
|
1913
1889
|
return r({
|
|
1914
1890
|
[select.default]: true,
|
|
1915
1891
|
[select.invalid]: this.invalid
|
|
1916
1892
|
});
|
|
1917
1893
|
};
|
|
1918
|
-
_helpTextClasses = new WeakSet();
|
|
1919
1894
|
helpTextClasses_get = function() {
|
|
1920
1895
|
return r({
|
|
1921
1896
|
[helpText.helpText]: true,
|
|
@@ -1923,20 +1898,17 @@ helpTextClasses_get = function() {
|
|
|
1923
1898
|
[helpText.helpTextColorInvalid]: this.invalid
|
|
1924
1899
|
});
|
|
1925
1900
|
};
|
|
1926
|
-
_chevronClasses = new WeakSet();
|
|
1927
1901
|
chevronClasses_get = function() {
|
|
1928
1902
|
return r({
|
|
1929
1903
|
[select.chevron]: true,
|
|
1930
1904
|
[select.chevronDisabled]: this.disabled
|
|
1931
1905
|
});
|
|
1932
1906
|
};
|
|
1933
|
-
_id = new WeakSet();
|
|
1934
1907
|
id_get = function() {
|
|
1935
1908
|
return "select_id";
|
|
1936
1909
|
};
|
|
1937
|
-
_helpId = new WeakSet();
|
|
1938
1910
|
helpId_get = function() {
|
|
1939
|
-
return this.hint ? `${__privateGet(this,
|
|
1911
|
+
return this.hint ? `${__privateGet(this, _WarpSelect_instances, id_get)}__hint` : void 0;
|
|
1940
1912
|
};
|
|
1941
1913
|
__publicField(WarpSelect, "properties", {
|
|
1942
1914
|
// Whether the element should receive focus on render
|