@warp-ds/elements 2.5.1-next.3 → 2.5.1
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/.storybook/utilities.d.ts +0 -1
- package/dist/.storybook/utilities.js +14 -22
- package/dist/custom-elements.json +0 -466
- package/dist/index.d.ts +0 -259
- package/dist/packages/combobox/combobox.d.ts +0 -5
- package/dist/packages/combobox/combobox.js +12 -12
- package/dist/packages/combobox/combobox.js.map +3 -3
- package/dist/packages/combobox/combobox.stories.js +7 -7
- package/dist/packages/combobox/combobox.test.js +0 -90
- package/dist/web-types.json +1 -81
- package/package.json +1 -9
- package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/da/messages.mjs +0 -1
- package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/en/messages.mjs +0 -1
- package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
- package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
- package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
- package/dist/packages/pagination/pagination.d.ts +0 -32
- package/dist/packages/pagination/pagination.js +0 -2503
- package/dist/packages/pagination/pagination.js.map +0 -7
- package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
- package/dist/packages/pagination/pagination.react.stories.js +0 -45
- package/dist/packages/pagination/pagination.stories.d.ts +0 -14
- package/dist/packages/pagination/pagination.stories.js +0 -56
- package/dist/packages/pagination/pagination.test.d.ts +0 -1
- package/dist/packages/pagination/pagination.test.js +0 -76
- package/dist/packages/pagination/react.d.ts +0 -5
- package/dist/packages/pagination/react.js +0 -15
- package/dist/packages/pagination/styles.d.ts +0 -1
- package/dist/packages/pagination/styles.js +0 -2
- package/dist/packages/textarea/locales/da/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/da/messages.mjs +0 -1
- package/dist/packages/textarea/locales/en/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/en/messages.mjs +0 -1
- package/dist/packages/textarea/locales/fi/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/fi/messages.mjs +0 -1
- package/dist/packages/textarea/locales/nb/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/nb/messages.mjs +0 -1
- package/dist/packages/textarea/locales/sv/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/sv/messages.mjs +0 -1
- package/dist/packages/textarea/react.d.ts +0 -11
- package/dist/packages/textarea/react.js +0 -21
- package/dist/packages/textarea/styles.d.ts +0 -1
- package/dist/packages/textarea/styles.js +0 -2
- package/dist/packages/textarea/textarea.d.ts +0 -49
- package/dist/packages/textarea/textarea.js +0 -2475
- package/dist/packages/textarea/textarea.js.map +0 -7
- package/dist/packages/textarea/textarea.react.stories.d.ts +0 -33
- package/dist/packages/textarea/textarea.react.stories.js +0 -41
- package/dist/packages/textarea/textarea.stories.d.ts +0 -19
- package/dist/packages/textarea/textarea.stories.js +0 -85
- package/dist/packages/textarea/textarea.test.d.ts +0 -1
- package/dist/packages/textarea/textarea.test.js +0 -84
- package/dist/packages/utils.d.ts +0 -1
- package/dist/packages/utils.js +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -23,8 +23,6 @@ import type { WarpTab } from "./packages/tab/tab.ts";
|
|
|
23
23
|
import type { WarpTabPanel } from "./packages/tab-panel/tab-panel.ts";
|
|
24
24
|
import type { WarpTabs } from "./packages/tabs/tabs.ts";
|
|
25
25
|
import type { WIcon } from "./packages/icon/icon.ts";
|
|
26
|
-
import type { WarpPagination } from "./packages/pagination/pagination.ts";
|
|
27
|
-
import type { WarpTextarea } from "./packages/textarea/textarea.ts";
|
|
28
26
|
|
|
29
27
|
/**
|
|
30
28
|
* This type can be used to create scoped tags for your components.
|
|
@@ -1270,137 +1268,6 @@ export type WIconSolidJsProps = {
|
|
|
1270
1268
|
textContent?: string | number;
|
|
1271
1269
|
};
|
|
1272
1270
|
|
|
1273
|
-
export type WarpPaginationProps = {
|
|
1274
|
-
/** */
|
|
1275
|
-
"base-url"?: WarpPagination["baseUrl"];
|
|
1276
|
-
/** */
|
|
1277
|
-
baseUrl?: WarpPagination["baseUrl"];
|
|
1278
|
-
/** */
|
|
1279
|
-
pages?: WarpPagination["pages"];
|
|
1280
|
-
/** */
|
|
1281
|
-
"current-page"?: WarpPagination["currentPageNumber"];
|
|
1282
|
-
/** */
|
|
1283
|
-
currentPageNumber?: WarpPagination["currentPageNumber"];
|
|
1284
|
-
/** */
|
|
1285
|
-
"visible-pages"?: WarpPagination["visiblePages"];
|
|
1286
|
-
/** */
|
|
1287
|
-
visiblePages?: WarpPagination["visiblePages"];
|
|
1288
|
-
|
|
1289
|
-
/** Triggered when a link button in the pagination is clicked. Contains the page number in `string` form. */
|
|
1290
|
-
"onpage-click"?: (e: CustomEvent) => void;
|
|
1291
|
-
};
|
|
1292
|
-
|
|
1293
|
-
export type WarpPaginationSolidJsProps = {
|
|
1294
|
-
/** */
|
|
1295
|
-
"attr:base-url"?: WarpPagination["baseUrl"];
|
|
1296
|
-
/** */
|
|
1297
|
-
"prop:baseUrl"?: WarpPagination["baseUrl"];
|
|
1298
|
-
/** */
|
|
1299
|
-
"prop:pages"?: WarpPagination["pages"];
|
|
1300
|
-
/** */
|
|
1301
|
-
"attr:current-page"?: WarpPagination["currentPageNumber"];
|
|
1302
|
-
/** */
|
|
1303
|
-
"prop:currentPageNumber"?: WarpPagination["currentPageNumber"];
|
|
1304
|
-
/** */
|
|
1305
|
-
"attr:visible-pages"?: WarpPagination["visiblePages"];
|
|
1306
|
-
/** */
|
|
1307
|
-
"prop:visiblePages"?: WarpPagination["visiblePages"];
|
|
1308
|
-
/** Triggered when a link button in the pagination is clicked. Contains the page number in `string` form. */
|
|
1309
|
-
"on:page-click"?: (e: CustomEvent) => void;
|
|
1310
|
-
|
|
1311
|
-
/** Set the innerHTML of the element */
|
|
1312
|
-
innerHTML?: string;
|
|
1313
|
-
/** Set the textContent of the element */
|
|
1314
|
-
textContent?: string | number;
|
|
1315
|
-
};
|
|
1316
|
-
|
|
1317
|
-
export type WarpTextareaProps = {
|
|
1318
|
-
/** */
|
|
1319
|
-
disabled?: WarpTextarea["disabled"];
|
|
1320
|
-
/** */
|
|
1321
|
-
invalid?: WarpTextarea["invalid"];
|
|
1322
|
-
/** */
|
|
1323
|
-
label?: WarpTextarea["label"];
|
|
1324
|
-
/** */
|
|
1325
|
-
"help-text"?: WarpTextarea["helpText"];
|
|
1326
|
-
/** */
|
|
1327
|
-
helpText?: WarpTextarea["helpText"];
|
|
1328
|
-
/** */
|
|
1329
|
-
"maximum-rows"?: WarpTextarea["maxRows"];
|
|
1330
|
-
/** */
|
|
1331
|
-
maxRows?: WarpTextarea["maxRows"];
|
|
1332
|
-
/** */
|
|
1333
|
-
"minimum-rows"?: WarpTextarea["minRows"];
|
|
1334
|
-
/** */
|
|
1335
|
-
minRows?: WarpTextarea["minRows"];
|
|
1336
|
-
/** */
|
|
1337
|
-
name?: WarpTextarea["name"];
|
|
1338
|
-
/** */
|
|
1339
|
-
placeholder?: WarpTextarea["placeholder"];
|
|
1340
|
-
/** @deprecated Use the native readonly attribute instead. Here for API consistency with `w-textfield`. */
|
|
1341
|
-
"read-only"?: WarpTextarea["readOnly"];
|
|
1342
|
-
/** @deprecated Use the native readonly attribute instead. Here for API consistency with `w-textfield`. */
|
|
1343
|
-
readOnly?: WarpTextarea["readOnly"];
|
|
1344
|
-
/** */
|
|
1345
|
-
readonly?: WarpTextarea["readonly"];
|
|
1346
|
-
/** */
|
|
1347
|
-
required?: WarpTextarea["required"];
|
|
1348
|
-
/** */
|
|
1349
|
-
value?: WarpTextarea["value"];
|
|
1350
|
-
/** */
|
|
1351
|
-
optional?: WarpTextarea["optional"];
|
|
1352
|
-
/** */
|
|
1353
|
-
minHeight?: WarpTextarea["minHeight"];
|
|
1354
|
-
/** */
|
|
1355
|
-
maxHeight?: WarpTextarea["maxHeight"];
|
|
1356
|
-
};
|
|
1357
|
-
|
|
1358
|
-
export type WarpTextareaSolidJsProps = {
|
|
1359
|
-
/** */
|
|
1360
|
-
"prop:disabled"?: WarpTextarea["disabled"];
|
|
1361
|
-
/** */
|
|
1362
|
-
"prop:invalid"?: WarpTextarea["invalid"];
|
|
1363
|
-
/** */
|
|
1364
|
-
"prop:label"?: WarpTextarea["label"];
|
|
1365
|
-
/** */
|
|
1366
|
-
"attr:help-text"?: WarpTextarea["helpText"];
|
|
1367
|
-
/** */
|
|
1368
|
-
"prop:helpText"?: WarpTextarea["helpText"];
|
|
1369
|
-
/** */
|
|
1370
|
-
"attr:maximum-rows"?: WarpTextarea["maxRows"];
|
|
1371
|
-
/** */
|
|
1372
|
-
"prop:maxRows"?: WarpTextarea["maxRows"];
|
|
1373
|
-
/** */
|
|
1374
|
-
"attr:minimum-rows"?: WarpTextarea["minRows"];
|
|
1375
|
-
/** */
|
|
1376
|
-
"prop:minRows"?: WarpTextarea["minRows"];
|
|
1377
|
-
/** */
|
|
1378
|
-
"prop:name"?: WarpTextarea["name"];
|
|
1379
|
-
/** */
|
|
1380
|
-
"prop:placeholder"?: WarpTextarea["placeholder"];
|
|
1381
|
-
/** @deprecated Use the native readonly attribute instead. Here for API consistency with `w-textfield`. */
|
|
1382
|
-
"bool:read-only"?: WarpTextarea["readOnly"];
|
|
1383
|
-
/** @deprecated Use the native readonly attribute instead. Here for API consistency with `w-textfield`. */
|
|
1384
|
-
"prop:readOnly"?: WarpTextarea["readOnly"];
|
|
1385
|
-
/** */
|
|
1386
|
-
"prop:readonly"?: WarpTextarea["readonly"];
|
|
1387
|
-
/** */
|
|
1388
|
-
"prop:required"?: WarpTextarea["required"];
|
|
1389
|
-
/** */
|
|
1390
|
-
"prop:value"?: WarpTextarea["value"];
|
|
1391
|
-
/** */
|
|
1392
|
-
"prop:optional"?: WarpTextarea["optional"];
|
|
1393
|
-
/** */
|
|
1394
|
-
"prop:minHeight"?: WarpTextarea["minHeight"];
|
|
1395
|
-
/** */
|
|
1396
|
-
"prop:maxHeight"?: WarpTextarea["maxHeight"];
|
|
1397
|
-
|
|
1398
|
-
/** Set the innerHTML of the element */
|
|
1399
|
-
innerHTML?: string;
|
|
1400
|
-
/** Set the textContent of the element */
|
|
1401
|
-
textContent?: string | number;
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
1271
|
export type CustomElements = {
|
|
1405
1272
|
/**
|
|
1406
1273
|
* This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.
|
|
@@ -2043,66 +1910,6 @@ export type CustomElements = {
|
|
|
2043
1910
|
* - `locale`: Locale used in CDN URL
|
|
2044
1911
|
*/
|
|
2045
1912
|
"w-icon": Partial<WIconProps & BaseProps<WIcon> & BaseEvents>;
|
|
2046
|
-
|
|
2047
|
-
/**
|
|
2048
|
-
* Pagination allows users to navigate through multiple pages of content by providing navigation controls with page numbers and directional arrows.
|
|
2049
|
-
*
|
|
2050
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-pagination--docs)
|
|
2051
|
-
*
|
|
2052
|
-
* ## Attributes & Properties
|
|
2053
|
-
*
|
|
2054
|
-
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2055
|
-
*
|
|
2056
|
-
* - `base-url`/`baseUrl`: undefined
|
|
2057
|
-
* - `pages`: undefined
|
|
2058
|
-
* - `current-page`/`currentPageNumber`: undefined
|
|
2059
|
-
* - `visible-pages`/`visiblePages`: undefined
|
|
2060
|
-
*
|
|
2061
|
-
* ## Events
|
|
2062
|
-
*
|
|
2063
|
-
* Events that will be emitted by the component.
|
|
2064
|
-
*
|
|
2065
|
-
* - `page-click`: Triggered when a link button in the pagination is clicked. Contains the page number in `string` form.
|
|
2066
|
-
*/
|
|
2067
|
-
"w-pagination": Partial<
|
|
2068
|
-
WarpPaginationProps & BaseProps<WarpPagination> & BaseEvents
|
|
2069
|
-
>;
|
|
2070
|
-
|
|
2071
|
-
/**
|
|
2072
|
-
* A single line text input element.
|
|
2073
|
-
*
|
|
2074
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)
|
|
2075
|
-
*
|
|
2076
|
-
* ## Attributes & Properties
|
|
2077
|
-
*
|
|
2078
|
-
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2079
|
-
*
|
|
2080
|
-
* - `disabled`: undefined
|
|
2081
|
-
* - `invalid`: undefined
|
|
2082
|
-
* - `label`: undefined
|
|
2083
|
-
* - `help-text`/`helpText`: undefined
|
|
2084
|
-
* - `maximum-rows`/`maxRows`: undefined
|
|
2085
|
-
* - `minimum-rows`/`minRows`: undefined
|
|
2086
|
-
* - `name`: undefined
|
|
2087
|
-
* - `placeholder`: undefined
|
|
2088
|
-
* - `read-only`/`readOnly`: undefined
|
|
2089
|
-
* - `readonly`: undefined
|
|
2090
|
-
* - `required`: undefined
|
|
2091
|
-
* - `value`: undefined
|
|
2092
|
-
* - `optional`: undefined
|
|
2093
|
-
* - `minHeight`: undefined (property only)
|
|
2094
|
-
* - `maxHeight`: undefined (property only)
|
|
2095
|
-
*
|
|
2096
|
-
* ## Methods
|
|
2097
|
-
*
|
|
2098
|
-
* Methods that can be called to access component functionality.
|
|
2099
|
-
*
|
|
2100
|
-
* - `resetFormControl() => void`: undefined
|
|
2101
|
-
* - `handler(e: InputEvent) => void`: undefined
|
|
2102
|
-
*/
|
|
2103
|
-
"w-textarea": Partial<
|
|
2104
|
-
WarpTextareaProps & BaseProps<WarpTextarea> & BaseEvents
|
|
2105
|
-
>;
|
|
2106
1913
|
};
|
|
2107
1914
|
|
|
2108
1915
|
export type CustomElementsSolidJs = {
|
|
@@ -2817,72 +2624,6 @@ export type CustomElementsSolidJs = {
|
|
|
2817
2624
|
"w-icon": Partial<
|
|
2818
2625
|
WIconProps & WIconSolidJsProps & BaseProps<WIcon> & BaseEvents
|
|
2819
2626
|
>;
|
|
2820
|
-
|
|
2821
|
-
/**
|
|
2822
|
-
* Pagination allows users to navigate through multiple pages of content by providing navigation controls with page numbers and directional arrows.
|
|
2823
|
-
*
|
|
2824
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-pagination--docs)
|
|
2825
|
-
*
|
|
2826
|
-
* ## Attributes & Properties
|
|
2827
|
-
*
|
|
2828
|
-
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2829
|
-
*
|
|
2830
|
-
* - `base-url`/`baseUrl`: undefined
|
|
2831
|
-
* - `pages`: undefined
|
|
2832
|
-
* - `current-page`/`currentPageNumber`: undefined
|
|
2833
|
-
* - `visible-pages`/`visiblePages`: undefined
|
|
2834
|
-
*
|
|
2835
|
-
* ## Events
|
|
2836
|
-
*
|
|
2837
|
-
* Events that will be emitted by the component.
|
|
2838
|
-
*
|
|
2839
|
-
* - `page-click`: Triggered when a link button in the pagination is clicked. Contains the page number in `string` form.
|
|
2840
|
-
*/
|
|
2841
|
-
"w-pagination": Partial<
|
|
2842
|
-
WarpPaginationProps &
|
|
2843
|
-
WarpPaginationSolidJsProps &
|
|
2844
|
-
BaseProps<WarpPagination> &
|
|
2845
|
-
BaseEvents
|
|
2846
|
-
>;
|
|
2847
|
-
|
|
2848
|
-
/**
|
|
2849
|
-
* A single line text input element.
|
|
2850
|
-
*
|
|
2851
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)
|
|
2852
|
-
*
|
|
2853
|
-
* ## Attributes & Properties
|
|
2854
|
-
*
|
|
2855
|
-
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2856
|
-
*
|
|
2857
|
-
* - `disabled`: undefined
|
|
2858
|
-
* - `invalid`: undefined
|
|
2859
|
-
* - `label`: undefined
|
|
2860
|
-
* - `help-text`/`helpText`: undefined
|
|
2861
|
-
* - `maximum-rows`/`maxRows`: undefined
|
|
2862
|
-
* - `minimum-rows`/`minRows`: undefined
|
|
2863
|
-
* - `name`: undefined
|
|
2864
|
-
* - `placeholder`: undefined
|
|
2865
|
-
* - `read-only`/`readOnly`: undefined
|
|
2866
|
-
* - `readonly`: undefined
|
|
2867
|
-
* - `required`: undefined
|
|
2868
|
-
* - `value`: undefined
|
|
2869
|
-
* - `optional`: undefined
|
|
2870
|
-
* - `minHeight`: undefined (property only)
|
|
2871
|
-
* - `maxHeight`: undefined (property only)
|
|
2872
|
-
*
|
|
2873
|
-
* ## Methods
|
|
2874
|
-
*
|
|
2875
|
-
* Methods that can be called to access component functionality.
|
|
2876
|
-
*
|
|
2877
|
-
* - `resetFormControl() => void`: undefined
|
|
2878
|
-
* - `handler(e: InputEvent) => void`: undefined
|
|
2879
|
-
*/
|
|
2880
|
-
"w-textarea": Partial<
|
|
2881
|
-
WarpTextareaProps &
|
|
2882
|
-
WarpTextareaSolidJsProps &
|
|
2883
|
-
BaseProps<WarpTextarea> &
|
|
2884
|
-
BaseEvents
|
|
2885
|
-
>;
|
|
2886
2627
|
};
|
|
2887
2628
|
|
|
2888
2629
|
export type CustomCssProperties = {};
|
|
@@ -50,8 +50,6 @@ export declare class WarpCombobox extends WarpCombobox_base {
|
|
|
50
50
|
private _currentOptions;
|
|
51
51
|
/** @internal Unique identifier counter for options */
|
|
52
52
|
private _optionIdCounter;
|
|
53
|
-
/** @internal The text displayed in the input field (may differ from value when option has label) */
|
|
54
|
-
private _displayValue;
|
|
55
53
|
static styles: import("lit").CSSResult[];
|
|
56
54
|
constructor();
|
|
57
55
|
firstUpdated(changedProps: Map<string, unknown>): void;
|
|
@@ -60,9 +58,6 @@ export declare class WarpCombobox extends WarpCombobox_base {
|
|
|
60
58
|
private get _listboxId();
|
|
61
59
|
private get _id();
|
|
62
60
|
private get _helpId();
|
|
63
|
-
/** Get the display text for the navigation option or current display value */
|
|
64
|
-
private get _navigationLabelOrDisplayValue();
|
|
65
|
-
/** Get the actual value for the navigation option or current value */
|
|
66
61
|
private get _navigationValueOrInputValue();
|
|
67
62
|
/** Generate options with unique IDs and match information */
|
|
68
63
|
private _createOptionsWithIdAndMatch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Ze(o){return He.get(o)||o}var Ke=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function ge(o,r=!1){return o.replace(Ke,function(e,t,a,s,
|
|
1
|
+
var Ve=Object.create;var W=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var se=o=>{throw TypeError(o)};var le=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports);var De=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Pe(r))!Ne.call(o,a)&&a!==e&&W(o,a,{get:()=>r[a],enumerable:!(t=ne(r,a))||t.enumerable});return o};var je=(o,r,e)=>(e=o!=null?Ve(Re(o)):{},De(r||!o||!o.__esModule?W(e,"default",{value:o,enumerable:!0}):e,o));var p=(o,r,e,t)=>{for(var a=t>1?void 0:t?ne(r,e):r,n=o.length-1,s;n>=0;n--)(s=o[n])&&(a=(t?s(r,e,a):s(a))||a);return t&&a&&W(r,e,a),a};var ce=(o,r,e)=>r.has(o)||se("Cannot "+e);var de=(o,r,e)=>(ce(o,r,"read from private field"),e?e.call(o):r.get(o)),ue=(o,r,e)=>r.has(o)?se("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),he=(o,r,e,t)=>(ce(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e);var pe=le(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.errorMessages=T.ErrorType=void 0;var P;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(P=T.ErrorType||(T.ErrorType={}));T.errorMessages=new Map([[P.MalformedUnicode,"malformed Unicode character escape sequence"],[P.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[P.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[P.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[P.EndOfString,"malformed escape sequence at end of string"]])});var ve=le(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.unraw=M.errorMessages=M.ErrorType=void 0;var f=pe();Object.defineProperty(M,"ErrorType",{enumerable:!0,get:function(){return f.ErrorType}});Object.defineProperty(M,"errorMessages",{enumerable:!0,get:function(){return f.errorMessages}});function Ue(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function q(o,r,e){let t=Ue(o);if(Number.isNaN(t)||e!==void 0&&e!==o.length)throw new SyntaxError(f.errorMessages.get(r));return t}function Ye(o){let r=q(o,f.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(r)}function be(o,r){let e=q(o,f.ErrorType.MalformedUnicode,4);if(r!==void 0){let t=q(r,f.ErrorType.MalformedUnicode,4);return String.fromCharCode(e,t)}return String.fromCharCode(e)}function Be(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function qe(o){if(!Be(o))throw new SyntaxError(f.errorMessages.get(f.ErrorType.MalformedUnicode));let r=o.slice(1,-1),e=q(r,f.ErrorType.MalformedUnicode);try{return String.fromCodePoint(e)}catch(t){throw t instanceof RangeError?new SyntaxError(f.errorMessages.get(f.ErrorType.CodePointLimit)):t}}function Xe(o,r=!1){if(r)throw new SyntaxError(f.errorMessages.get(f.ErrorType.OctalDeprecation));let e=parseInt(o,8);return String.fromCharCode(e)}var He=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Ze(o){return He.get(o)||o}var Ke=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function ge(o,r=!1){return o.replace(Ke,function(e,t,a,n,s,i,c,v,_){if(t!==void 0)return"\\";if(a!==void 0)return Ye(a);if(n!==void 0)return qe(n);if(s!==void 0)return be(s,i);if(c!==void 0)return be(c);if(v==="0")return"\0";if(v!==void 0)return Xe(v,!r);if(_!==void 0)return Ze(_);throw new SyntaxError(f.errorMessages.get(f.ErrorType.EndOfString))})}M.unraw=ge;M.default=ge});var Y=function(){for(var o=[],r=arguments.length;r--;)o[r]=arguments[r];return o.reduce(function(e,t){return e.concat(typeof t=="string"?t:Array.isArray(t)?Y.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var we=je(ve(),1);var S=o=>typeof o=="string",Ge=o=>typeof o=="function",me=new Map,xe="en";function te(o){return[...Array.isArray(o)?o:[o],xe]}function oe(o,r,e){let t=te(o);e||(e="default");let a;if(typeof e=="string")switch(a={day:"numeric",month:"short",year:"numeric"},e){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=e;return X(()=>H("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(S(r)?new Date(r):r)}function Je(o,r,e){let t;if(e||(e="default"),typeof e=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},e){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=e;return oe(o,r,t)}function Q(o,r,e){let t=te(o);return X(()=>H("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function fe(o,r,e,{offset:t=0,...a}){var i,c;let n=te(o),s=r?X(()=>H("plural-ordinal",n),()=>new Intl.PluralRules(n,{type:"ordinal"})):X(()=>H("plural-cardinal",n),()=>new Intl.PluralRules(n,{type:"cardinal"}));return(c=(i=a[e])!=null?i:a[s.select(e-t)])!=null?c:a.other}function X(o,r){let e=o(),t=me.get(e);return t||(t=r(),me.set(e,t)),t}function H(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var ke=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ye="%__lingui_octothorpe__%",We=(o,r,e={})=>{let t=r||o,a=s=>typeof s=="object"?s:e[s],n=(s,i)=>{let c=Object.keys(e).length?a("number"):void 0,v=Q(t,s,c);return i.replace(new RegExp(ye,"g"),v)};return{plural:(s,i)=>{let{offset:c=0}=i,v=fe(t,!1,s,i);return n(s-c,v)},selectordinal:(s,i)=>{let{offset:c=0}=i,v=fe(t,!0,s,i);return n(s-c,v)},select:Qe,number:(s,i)=>Q(t,s,a(i)||{style:i}),date:(s,i)=>oe(t,s,a(i)||i),time:(s,i)=>Je(t,s,a(i)||i)}},Qe=(o,r)=>{var e;return(e=r[o])!=null?e:r.other};function er(o,r,e){return(t={},a)=>{let n=We(r,e,a),s=(c,v=!1)=>Array.isArray(c)?c.reduce((_,z)=>{if(z==="#"&&v)return _+ye;if(S(z))return _+z;let[L,k,E]=z,F={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(E).forEach(([I,R])=>{F[I]=s(R,k==="plural"||k==="selectordinal")}):F=E;let x;if(k){let I=n[k];x=I(t[L],F)}else x=t[L];return x==null?_:_+x},""):c,i=s(o);return S(i)&&ke.test(i)?(0,we.unraw)(i):S(i)?i:i?String(i):""}}var rr=Object.defineProperty,tr=(o,r,e)=>r in o?rr(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,or=(o,r,e)=>(tr(o,typeof r!="symbol"?r+"":r,e),e),ee=class{constructor(){or(this,"_events",{})}on(r,e){var a;var t;return(a=(t=this._events)[r])!=null||(t[r]=[]),this._events[r].push(e),()=>this.removeListener(r,e)}removeListener(r,e){let t=this._getListeners(r);if(!t)return;let a=t.indexOf(e);~a&&t.splice(a,1)}emit(r,...e){let t=this._getListeners(r);t&&t.map(a=>a.apply(this,e))}_getListeners(r){let e=this._events[r];return Array.isArray(e)?e:!1}},ar=Object.defineProperty,ir=(o,r,e)=>r in o?ar(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,$=(o,r,e)=>(ir(o,typeof r!="symbol"?r+"":r,e),e),re=class extends ee{constructor(r){var e;super(),$(this,"_locale",""),$(this,"_locales"),$(this,"_localeData",{}),$(this,"_messages",{}),$(this,"_missing"),$(this,"_messageCompiler"),$(this,"t",this._.bind(this)),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),r.localeData!=null&&this.loadLocaleData(r.localeData),(typeof r.locale=="string"||r.locales)&&this.activate((e=r.locale)!=null?e:xe,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var r;return(r=this._messages[this._locale])!=null?r:{}}get localeData(){var r;return(r=this._localeData[this._locale])!=null?r:{}}_loadLocaleData(r,e){let t=this._localeData[r];t?Object.assign(t,e):this._localeData[r]=e}setMessagesCompiler(r){return this._messageCompiler=r,this}loadLocaleData(r,e){typeof r=="string"?this._loadLocaleData(r,e):Object.keys(r).forEach(t=>this._loadLocaleData(t,r[t])),this.emit("change")}_load(r,e){let t=this._messages[r];t?Object.assign(t,e):this._messages[r]=e}load(r,e){typeof r=="string"&&typeof e=="object"?this._load(r,e):Object.entries(r).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:r,locales:e,messages:t}){this._locale=r,this._locales=e||void 0,this._messages[this._locale]=t,this.emit("change")}activate(r,e){this._locale=r,this._locales=e,this.emit("change")}_(r,e,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;r||(r=""),S(r)||(e=r.values||e,a=r.message,r=r.id);let n=this.messages[r],s=n===void 0,i=this._missing;if(i&&s)return Ge(i)?i(this._locale,r):i;s&&this.emit("missing",{id:r,locale:this._locale});let c=n||a||r;return S(c)&&(this._messageCompiler?c=this._messageCompiler(c):console.warn(`Uncompiled message detected! Message:
|
|
3
3
|
|
|
4
4
|
> ${c}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),S(c)&&ke.test(c)?JSON.parse(`"${c}"`):S(c)?c:er(c,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return oe(this._locales||this._locale,r,e)}number(r,e){return Q(this._locales||this._locale,r,e)}};function
|
|
10
|
+
`)),S(c)&&ke.test(c)?JSON.parse(`"${c}"`):S(c)?c:er(c,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return oe(this._locales||this._locale,r,e)}number(r,e){return Q(this._locales||this._locale,r,e)}};function nr(o={}){return new re(o)}var O=nr();var u=function(o,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?o!==r||!t:!r.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(o):t?t.value:r.get(o)},g=function(o,r,e,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?o!==r||!a:!r.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,e):a?a.value=e:r.set(o,e),e};function _e(o){var r,e,t,a,n,s,i,c,v,_,z,L,k,E,F,x,I,R,K;class Le extends o{constructor(...l){var d,b,m;super(...l),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),t.set(this,!1),a.set(this,!1),n.set(this,void 0),s.set(this,void 0),i.set(this,!0),v.set(this,""),_.set(this,()=>{g(this,a,!0,"f"),g(this,e,!0,"f"),u(this,r,"m",x).call(this)}),z.set(this,()=>{g(this,e,!1,"f"),u(this,r,"m",I).call(this,this.shouldFormValueUpdate()?u(this,v,"f"):""),!this.validity.valid&&u(this,a,"f")&&g(this,t,!0,"f");let C=u(this,r,"m",x).call(this);this.validationMessageCallback&&this.validationMessageCallback(C?this.internals.validationMessage:"")}),L.set(this,()=>{var C;u(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),g(this,i,!1,"f")),g(this,a,!0,"f"),g(this,t,!0,"f"),u(this,r,"m",x).call(this),(C=this===null||this===void 0?void 0:this.validationMessageCallback)===null||C===void 0||C.call(this,this.showError?this.internals.validationMessage:"")}),k.set(this,void 0),E.set(this,!1),F.set(this,Promise.resolve()),(d=this.addEventListener)===null||d===void 0||d.call(this,"focus",u(this,_,"f")),(b=this.addEventListener)===null||b===void 0||b.call(this,"blur",u(this,z,"f")),(m=this.addEventListener)===null||m===void 0||m.call(this,"invalid",u(this,L,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(m=>m.attribute).flat(),d=super.observedAttributes||[];return[...new Set([...d,...l])]}static getValidator(l){return this.validators.find(d=>d.attribute===l)||null}static getValidators(l){return this.validators.filter(d=>{var b;if(d.attribute===l||!((b=d.attribute)===null||b===void 0)&&b.includes(l))return!0})}get form(){return this.internals.form}get showError(){return u(this,r,"m",x).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,d,b){var m;(m=super.attributeChangedCallback)===null||m===void 0||m.call(this,l,d,b);let D=this.constructor.getValidators(l);D!=null&&D.length&&this.validationTarget&&this.setValue(u(this,v,"f"))}setValue(l){var d;g(this,t,!1,"f"),(d=this.validationMessageCallback)===null||d===void 0||d.call(this,""),g(this,v,l,"f");let m=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(m),u(this,r,"m",I).call(this,m),this.valueChangedCallback&&this.valueChangedCallback(m),u(this,r,"m",x).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(u(this,F,"f")))}formResetCallback(){var l,d;g(this,a,!1,"f"),g(this,t,!1,"f"),u(this,r,"m",x).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(d=this.validationMessageCallback)===null||d===void 0||d.call(this,u(this,r,"m",x).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,a=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,v=new WeakMap,_=new WeakMap,z=new WeakMap,L=new WeakMap,k=new WeakMap,E=new WeakMap,F=new WeakMap,r=new WeakSet,c=function(){let l=this.getRootNode(),d=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(d)},x=function(){if(this.hasAttribute("disabled"))return!1;let l=u(this,t,"f")||u(this,a,"f")&&!this.validity.valid&&!u(this,e,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},I=function(l){let d=this.constructor,b={},m=d.validators,C=[],D=m.some(y=>y.isValid instanceof Promise);u(this,E,"f")||(g(this,F,new Promise(y=>{g(this,k,y,"f")}),"f"),g(this,E,!0,"f")),u(this,n,"f")&&(u(this,n,"f").abort(),g(this,s,u(this,n,"f"),"f"));let j=new AbortController;g(this,n,j,"f");let U,ie=!1;m.length&&(m.forEach(y=>{let G=y.key||"customError",V=y.isValid(this,l,j.signal);V instanceof Promise?(C.push(V),V.then(J=>{J!=null&&(b[G]=!J,U=u(this,r,"m",K).call(this,y,l),u(this,r,"m",R).call(this,b,U))})):(b[G]=!V,this.validity[G]!==!V&&(ie=!0),!V&&!U&&(U=u(this,r,"m",K).call(this,y,l)))}),Promise.allSettled(C).then(()=>{var y;j!=null&&j.signal.aborted||(g(this,E,!1,"f"),(y=u(this,k,"f"))===null||y===void 0||y.call(this))}),(ie||!D)&&u(this,r,"m",R).call(this,b,U))},R=function(l,d){if(this.validationTarget)this.internals.setValidity(l,d,this.validationTarget),g(this,i,!1,"f");else{if(this.internals.setValidity(l,d),this.internals.validity.valid)return;g(this,i,!0,"f")}},K=function(l,d){if(this.validityCallback){let b=this.validityCallback(l.key||"customError");if(b)return b}return l.message instanceof Function?l.message(this,d):l.message},Le}import{html as ae,LitElement as dr}from"lit";import{property as w,state as Z}from"lit/decorators.js";import{repeat as ur}from"lit/directives/repeat.js";var sr=["en","nb","fi","da","sv"],Ce="en",Oe=o=>sr.find(r=>o===r||o.toLowerCase().includes(r))||Ce;function lr(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Oe(o)}try{let o=document.documentElement.lang;return Oe(o)}catch(o){return console.warn("could not detect locale, falling back to source locale",o),Ce}}var Me=(o,r,e,t,a)=>{O.load("en",o),O.load("nb",r),O.load("fi",e),O.load("da",t),O.load("sv",a);let n=lr();O.activate(n)};import{css as ze}from"lit";var Ee=ze`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -2446,13 +2446,13 @@ Please compile your catalog first.
|
|
|
2446
2446
|
display: none
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
`;var Fe=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultater"]}]],"combobox.aria.noResults":["Ingen resultater"]}');var Se=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," result"],"other":["#"," results"]}]],"combobox.aria.noResults":["No results"]}');var Ae=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," tulos"],"other":["#"," tulosta"]}]],"combobox.aria.noResults":["Ei tuloksia"]}');var
|
|
2450
|
-
.z-0{z-index:0;}.z-20{z-index:20;}`;var A={wrapper:"relative z-0",base:"absolute z-20 left-0 right-0 s-bg pb-4 rounded-8 overflow-hidden shadow-m",listbox:"m-0 p-0 select-none list-none",option:"block cursor-pointer p-8",optionUnselected:"hover:s-bg-hover",optionSelected:"s-bg-selected hover:s-bg-selected-hover",textMatch:"font-bold",a11y:"sr-only"},
|
|
2451
|
-
>${e.substring(
|
|
2449
|
+
`;var Fe=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultater"]}]],"combobox.aria.noResults":["Ingen resultater"]}');var Se=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," result"],"other":["#"," results"]}]],"combobox.aria.noResults":["No results"]}');var Ae=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," tulos"],"other":["#"," tulosta"]}]],"combobox.aria.noResults":["Ei tuloksia"]}');var Ie=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultater"]}]],"combobox.aria.noResults":["Ingen resultater"]}');var Te=JSON.parse('{"combobox.aria.pluralResults":[["numResults","plural",{"one":["#"," resultat"],"other":["#"," resultat"]}]],"combobox.aria.noResults":["Inga resultat"]}');import{css as cr}from"lit";var $e=cr`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.rounded-8{border-radius:8px}.block{display:block}.overflow-hidden{overflow:hidden}.list-none{list-style-type:none}.left-0{left:0}.right-0{right:0}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-selected{background-color:var(--w-s-color-background-selected)}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-selected-hover:hover{background-color:var(--w-s-color-background-selected-hover)}.shadow-m{box-shadow:var(--w-shadow-m)}.m-0{margin:0}.p-0{padding:0}.p-8{padding:.8rem}.pb-4{padding-bottom:.4rem}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.select-none{-webkit-user-select:none;user-select:none};
|
|
2450
|
+
.z-0{z-index:0;}.z-20{z-index:20;}`;var A={wrapper:"relative z-0",base:"absolute z-20 left-0 right-0 s-bg pb-4 rounded-8 overflow-hidden shadow-m",listbox:"m-0 p-0 select-none list-none",option:"block cursor-pointer p-8",optionUnselected:"hover:s-bg-hover",optionSelected:"s-bg-selected hover:s-bg-selected-hover",textMatch:"font-bold",a11y:"sr-only"},B,h=class extends _e(dr){constructor(){super();this.options=[];this.value="";this.openOnFocus=!1;this.selectOnBlur=!0;this.matchTextSegments=!1;this.disableStaticFiltering=!1;this.invalid=!1;this.disabled=!1;this.required=!1;this.optional=!1;this.autocomplete="off";this._isOpen=!1;this._navigationOption=null;this._currentOptions=[];this._optionIdCounter=0;ue(this,B,null);Me(Se,Ie,Ae,Fe,Te)}firstUpdated(e){he(this,B,this.value)}updated(e){e.has("value")&&this.setValue(this.value)}resetFormControl(){this.value=de(this,B)}get _listboxId(){return`${this._id}-listbox`}get _id(){return"combobox"}get _helpId(){return this.helpText?`${this._id}__hint`:void 0}get _navigationValueOrInputValue(){var e;return((e=this._navigationOption)==null?void 0:e.value)||this.value}_createOptionsWithIdAndMatch(e,t){return e.map((a,n)=>({...a,id:`${this._id}-option-${this._optionIdCounter+n}`,key:a.key||a.value,currentInputValue:t}))}_getAriaText(e,t){if(!e||!t)return"";let a=e.filter(i=>i.value.toLowerCase().includes(t.toLowerCase())),n=O._({id:"combobox.aria.pluralResults",message:"{numResults, plural, one {# result} other {# results}}",comment:"Aria text for combobox when one or more results",values:{numResults:a.length}}),s=O._({id:"combobox.aria.noResults",message:"No results",comment:"Aria text for combobox when no results"});return a.length?n:s}_getOptionClasses(e){var t;return Y(A.option,((t=this._navigationOption)==null?void 0:t.id)===(e==null?void 0:e.id)?A.optionSelected:A.optionUnselected)}_handleKeyDown(e){let t=["ArrowDown","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key),a=["ArrowDown","ArrowLeft","ArrowUp","ArrowRight"];if(t&&!this._isOpen){this._isOpen=!0;return}if(t&&this._isOpen){this._findAndSetActiveOption(e);return}if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.key){case"Enter":this._navigationOption&&(e.preventDefault(),this._handleSelect(this._navigationOption),requestAnimationFrame(()=>{var i,c;let n=(i=this.shadowRoot)==null?void 0:i.querySelector("w-textfield"),s=(c=n==null?void 0:n.shadowRoot)==null?void 0:c.querySelector("input");s&&(s.value=this.value)})),this._isOpen=!1;break;case"Tab":case"Delete":this._isOpen=!1;break;case"Escape":this._isOpen?this._isOpen=!1:this._handleChange(""),this._navigationOption=null;break;case"Backspace":this._handleChange(this._navigationValueOrInputValue),this._navigationOption=null,this._isOpen=!0;break;default:if(a.includes(e.key))break;this._isOpen=!0,this._navigationOption?(this._handleChange(this._navigationOption.value),this._navigationOption=null):this._handleChange(this.value);break}}_findAndSetActiveOption(e){e.preventDefault();let t=this._currentOptions.findIndex(s=>{var i;return s.id===((i=this._navigationOption)==null?void 0:i.id)}),a=t+1,n=t-1;switch(e.key){case"ArrowDown":this._navigationOption=a>this._currentOptions.length-1?null:this._currentOptions[a];break;case"ArrowUp":this._navigationOption=n===-2?this._currentOptions[this._currentOptions.length-1]:n<0?null:this._currentOptions[n];break;case"PageUp":this._navigationOption=t-10<0?this._currentOptions[0]:this._currentOptions[t-10];break;case"PageDown":this._navigationOption=t+10>this._currentOptions.length-1?this._currentOptions[this._currentOptions.length-1]:this._currentOptions[t+10];break;case"Home":this._navigationOption=this._currentOptions[0];break;case"End":this._navigationOption=this._currentOptions[this._currentOptions.length-1];break}}_handleSelect(e){this.value=e.value,this.setValue(this.value);let t=new CustomEvent("select",{detail:{value:e.value},bubbles:!0,composed:!0});this.dispatchEvent(t),this._isOpen=!1,this._navigationOption=null,this.disableStaticFiltering&&(this._currentOptions=[])}_handleChange(e){if(e===void 0)return;this.value=e;let t=new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0});this.dispatchEvent(t)}_handleFocus(){if(!this.openOnFocus)return;let e=new CustomEvent("focus",{bubbles:!0,composed:!0});this.dispatchEvent(e),this._isOpen=!0}_handleBlur(e){var n,s;let t=e.relatedTarget;if(t&&((n=this.shadowRoot)!=null&&n.contains(t)))return;if(this._isOpen=!1,this.selectOnBlur&&(this._navigationOption||!this._navigationOption&&this._currentOptions.findIndex(i=>i.value===this.value)!==-1)){let i=((s=this._navigationOption)==null?void 0:s.value)||this.value;this.value=i;let c=new CustomEvent("select",{detail:{value:i},bubbles:!0,composed:!0});this.dispatchEvent(c)}this._navigationOption=null;let a=new CustomEvent("blur",{detail:{value:this._navigationValueOrInputValue},bubbles:!0,composed:!0});this.dispatchEvent(a)}_handleOptionClick(e,t){this._handleSelect(t),requestAnimationFrame(()=>{var s,i;let a=(s=this.shadowRoot)==null?void 0:s.querySelector("w-textfield"),n=(i=a==null?void 0:a.shadowRoot)==null?void 0:i.querySelector("input");n&&(n.value=t.value)})}_handleContainerBlur(e){(!e.currentTarget||!e.currentTarget.contains(e.relatedTarget))&&(this._isOpen=!1)}_renderTextMatch(e,t){if(!this.matchTextSegments)return e;let a=e.toLowerCase().indexOf(t.currentInputValue.toLowerCase());if(a!==-1){let n=a+t.currentInputValue.length;return ae`${e.substring(0,a)}<span class="${A.textMatch}">${e.substring(a,n)}</span
|
|
2451
|
+
>${e.substring(n)}`}return e}willUpdate(e){(e.has("options")||e.has("value")||e.has("disableStaticFiltering"))&&(this._optionIdCounter+=this.options.length,this._currentOptions=this._createOptionsWithIdAndMatch(this.options,this.value).filter(t=>this.disableStaticFiltering?!0:t.value.toLowerCase().includes(this.value.toLowerCase()))),this.disableStaticFiltering&&this._currentOptions.length&&this._currentOptions.length===1&&!this._currentOptions.some(t=>t.value===this.value)&&!this._isOpen&&(this._isOpen=!0)}render(){var e;return ae`
|
|
2452
2452
|
<div class=${Y(A.wrapper)} @blur=${this._handleContainerBlur}>
|
|
2453
2453
|
<w-textfield
|
|
2454
2454
|
class="w-combobox-textfield"
|
|
2455
|
-
.value=${this.
|
|
2455
|
+
.value=${this._navigationValueOrInputValue}
|
|
2456
2456
|
.label=${this.label}
|
|
2457
2457
|
.placeholder=${this.placeholder}
|
|
2458
2458
|
.invalid=${this.invalid}
|
|
@@ -2472,23 +2472,23 @@ Please compile your catalog first.
|
|
|
2472
2472
|
@blur=${this._handleBlur}
|
|
2473
2473
|
@keydown=${this._handleKeyDown}></w-textfield>
|
|
2474
2474
|
|
|
2475
|
-
<span class="${A.a11y}" role="status"> ${this._getAriaText(this._currentOptions,this.
|
|
2475
|
+
<span class="${A.a11y}" role="status"> ${this._getAriaText(this._currentOptions,this.value)} </span>
|
|
2476
2476
|
|
|
2477
2477
|
<div ?hidden=${!this._isOpen||!this._currentOptions.length} class=${Y(A.base)}>
|
|
2478
2478
|
<ul id=${this._listboxId} role="listbox" class="${A.listbox}">
|
|
2479
|
-
${ur(this._currentOptions,t=>t.key,t=>{var
|
|
2479
|
+
${ur(this._currentOptions,t=>t.key,t=>{var n;let a=t.label||t.value;return ae`
|
|
2480
2480
|
<li
|
|
2481
2481
|
id=${t.id}
|
|
2482
2482
|
role="option"
|
|
2483
|
-
aria-selected=${((
|
|
2483
|
+
aria-selected=${((n=this._navigationOption)==null?void 0:n.id)===t.id}
|
|
2484
2484
|
tabindex="-1"
|
|
2485
2485
|
class=${this._getOptionClasses(t)}
|
|
2486
|
-
@mousedown=${
|
|
2486
|
+
@mousedown=${s=>this._handleOptionClick(s,t)}>
|
|
2487
2487
|
${this._renderTextMatch(a,t)}
|
|
2488
2488
|
</li>
|
|
2489
2489
|
`})}
|
|
2490
2490
|
</ul>
|
|
2491
2491
|
</div>
|
|
2492
2492
|
</div>
|
|
2493
|
-
`}};
|
|
2493
|
+
`}};B=new WeakMap,h.styles=[Ee,$e],p([w({type:Array})],h.prototype,"options",2),p([w({type:String,reflect:!0})],h.prototype,"label",2),p([w({type:String,reflect:!0})],h.prototype,"placeholder",2),p([w({type:String,reflect:!0})],h.prototype,"value",2),p([w({type:Boolean,attribute:"open-on-focus"})],h.prototype,"openOnFocus",2),p([w({type:Boolean,attribute:"select-on-blur"})],h.prototype,"selectOnBlur",2),p([w({type:Boolean,attribute:"match-text-segments"})],h.prototype,"matchTextSegments",2),p([w({type:Boolean,attribute:"disable-static-filtering"})],h.prototype,"disableStaticFiltering",2),p([w({type:Boolean,reflect:!0})],h.prototype,"invalid",2),p([w({type:String,attribute:"help-text",reflect:!0})],h.prototype,"helpText",2),p([w({type:Boolean,reflect:!0})],h.prototype,"disabled",2),p([w({type:Boolean,reflect:!0})],h.prototype,"required",2),p([w({type:Boolean,reflect:!0})],h.prototype,"optional",2),p([w({type:String,reflect:!0})],h.prototype,"name",2),p([w({type:String,reflect:!0})],h.prototype,"autocomplete",2),p([Z()],h.prototype,"_isOpen",2),p([Z()],h.prototype,"_navigationOption",2),p([Z()],h.prototype,"_currentOptions",2),p([Z()],h.prototype,"_optionIdCounter",2);customElements.get("w-combobox")||customElements.define("w-combobox",h);export{h as WarpCombobox};
|
|
2494
2494
|
//# sourceMappingURL=combobox.js.map
|