@trendyol/baklava 2.0.0-beta.79 → 2.0.0-beta.81
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/baklava-react.d.ts +5 -3
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +2 -2
- package/dist/baklava.js +1 -1
- package/dist/{chunk-VHM6RRSN.js → chunk-2FBI46AY.js} +3 -3
- package/dist/chunk-2FBI46AY.js.map +7 -0
- package/dist/chunk-3B64VOWB.js +2 -0
- package/dist/{chunk-AEVRCHAZ.js.map → chunk-3B64VOWB.js.map} +4 -4
- package/dist/chunk-AYSPIQ23.js +26 -0
- package/dist/chunk-AYSPIQ23.js.map +7 -0
- package/dist/{chunk-2E7PEDV6.js → chunk-BD5KXTYS.js} +2 -2
- package/dist/chunk-DJOD4BTL.js +2 -0
- package/dist/chunk-DJOD4BTL.js.map +7 -0
- package/dist/{chunk-F3CGCLRX.js → chunk-DSM6T5MC.js} +2 -2
- package/dist/chunk-J774WKKH.js +51 -0
- package/dist/chunk-J774WKKH.js.map +7 -0
- package/dist/{chunk-VGPPX6IG.js → chunk-KUOLIJCN.js} +3 -3
- package/dist/{chunk-VGPPX6IG.js.map → chunk-KUOLIJCN.js.map} +2 -2
- package/dist/chunk-MCWRM3WC.js +19 -0
- package/dist/chunk-MCWRM3WC.js.map +7 -0
- package/dist/chunk-RST5NVHY.js +2 -0
- package/dist/chunk-RST5NVHY.js.map +7 -0
- package/dist/chunk-THIPCHAK.js +13 -0
- package/dist/chunk-THIPCHAK.js.map +7 -0
- package/dist/chunk-VAF7XRXM.js +42 -0
- package/dist/chunk-VAF7XRXM.js.map +7 -0
- package/dist/components/button/bl-button.d.ts +8 -0
- package/dist/components/button/bl-button.d.ts.map +1 -1
- package/dist/components/button/bl-button.js +1 -1
- package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
- package/dist/components/dialog/bl-dialog.js +1 -1
- package/dist/components/drawer/bl-drawer.js +1 -1
- package/dist/components/dropdown/bl-dropdown.js +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
- package/dist/components/input/bl-input.d.ts +3 -3
- package/dist/components/input/bl-input.d.ts.map +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/pagination/bl-pagination.d.ts.map +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/radio-group/bl-radio-group.js +1 -1
- package/dist/components/radio-group/radio/bl-radio.js +1 -1
- package/dist/components/select/bl-select.d.ts +48 -18
- package/dist/components/select/bl-select.d.ts.map +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/dist/components/select/option/bl-select-option.d.ts +24 -3
- package/dist/components/select/option/bl-select-option.d.ts.map +1 -1
- package/dist/components/select/option/bl-select-option.js +1 -1
- package/dist/components/textarea/bl-textarea.d.ts +1 -1
- package/dist/components/textarea/bl-textarea.d.ts.map +1 -1
- package/dist/components/textarea/bl-textarea.js +1 -1
- package/dist/custom-elements.json +78 -3
- package/package.json +3 -3
- package/dist/chunk-2PVZLIDX.js +0 -19
- package/dist/chunk-2PVZLIDX.js.map +0 -7
- package/dist/chunk-4WJJQP4L.js +0 -13
- package/dist/chunk-4WJJQP4L.js.map +0 -7
- package/dist/chunk-7K5FMQLQ.js +0 -2
- package/dist/chunk-7K5FMQLQ.js.map +0 -7
- package/dist/chunk-7R56R3UM.js +0 -35
- package/dist/chunk-7R56R3UM.js.map +0 -7
- package/dist/chunk-A6IEG6S5.js +0 -52
- package/dist/chunk-A6IEG6S5.js.map +0 -7
- package/dist/chunk-AEVRCHAZ.js +0 -2
- package/dist/chunk-TAU2CM6U.js +0 -26
- package/dist/chunk-TAU2CM6U.js.map +0 -7
- package/dist/chunk-VHM6RRSN.js.map +0 -7
- /package/dist/{chunk-2E7PEDV6.js.map → chunk-BD5KXTYS.js.map} +0 -0
- /package/dist/{chunk-F3CGCLRX.js.map → chunk-DSM6T5MC.js.map} +0 -0
|
@@ -95,7 +95,7 @@ export default class BlTextarea extends BlTextarea_base {
|
|
|
95
95
|
private inputHandler;
|
|
96
96
|
private changeHandler;
|
|
97
97
|
firstUpdated(): void;
|
|
98
|
-
protected updated(changedProperties: PropertyValues): void
|
|
98
|
+
protected updated(changedProperties: PropertyValues): Promise<void>;
|
|
99
99
|
reportValidity(): boolean;
|
|
100
100
|
valueChangedCallback(value: string): void;
|
|
101
101
|
validityCallback(): string | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/bl-textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AASvF,OAAO,4BAA4B,CAAC;AAGpC,oBAAY,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;;AACxD;;;GAGG;AAEH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAA4B;IAClE,MAAM,KAAK,MAAM,IAAI,cAAc,CAElC;IAED,MAAM,CAAC,qBAAqB;;;;;;;;;;;;SAAsB;IAGlD,gBAAgB,EAAE,mBAAmB,CAAC;IAEtC;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,MAAM,UAAS;IAEf;;OAEG;IAEH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IAEH,IAAI,CAAC,EAAE,YAAY,CAAY;IAE/B;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAEH,UAAU,UAAS;IAEnB;;OAEG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IAEH,gBAAgB,UAAS;IAEzB;;OAEG;IAEH,QAAQ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AAM,CAAC;IAEf;;OAEG;IAEH,UAAU,UAAS;IAEnB;;OAEG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IAEH,gBAAgB,UAAS;IAEzB;;OAEG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IAEH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IAEH,KAAK,SAAM;IAEX;;OAEG;IAEH,IAAI,CAAC,EAAE,MAAM,CAAK;IAEC,OAAO,CAAC,OAAO,CAA0B;IAExC,OAAO,CAAC,QAAQ,CAA0B;IAEzC,OAAO,CAAC,SAAS,CAAiC;IAGvE,OAAO,CAAC,kBAAkB,CAAuB;IAEjD,iBAAiB;IAOjB,OAAO,CAAC,OAAO,CAEb;IAEF,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,aAAa;IAQrB,YAAY;cAKI,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAczD,cAAc;IAKd,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzC,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC,OAAO,CAAC,UAAU;IAWT,OAAO,CAAC,KAAK,CAAS;IAE/B,MAAM,IAAI,cAAc;CAwDzB;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-KUOLIJCN.js";import"../../chunk-RST5NVHY.js";import"../../chunk-3B64VOWB.js";import"../../chunk-EPJ347EQ.js";import"../../chunk-DJOD4BTL.js";import"../../chunk-OLPYXE2P.js";import"../../chunk-KPAWUBRO.js";import"../../chunk-RLMJN536.js";import"../../chunk-23UFIOHV.js";import"../../chunk-57PTZNIL.js";import"../../chunk-NZ3RGSR6.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-textarea.js.map
|
|
@@ -228,6 +228,23 @@
|
|
|
228
228
|
"description": "Sets the button label. Used for accessibility.",
|
|
229
229
|
"fieldName": "label"
|
|
230
230
|
},
|
|
231
|
+
{
|
|
232
|
+
"name": "loading-label",
|
|
233
|
+
"type": {
|
|
234
|
+
"text": "string"
|
|
235
|
+
},
|
|
236
|
+
"description": "Sets the button label for loading status.",
|
|
237
|
+
"fieldName": "loadingLabel"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "loading",
|
|
241
|
+
"type": {
|
|
242
|
+
"text": "boolean"
|
|
243
|
+
},
|
|
244
|
+
"default": "false",
|
|
245
|
+
"description": "Sets loading state of button",
|
|
246
|
+
"fieldName": "loading"
|
|
247
|
+
},
|
|
231
248
|
{
|
|
232
249
|
"name": "disabled",
|
|
233
250
|
"type": {
|
|
@@ -1284,15 +1301,38 @@
|
|
|
1284
1301
|
"kind": "class",
|
|
1285
1302
|
"description": "",
|
|
1286
1303
|
"name": "BlSelect",
|
|
1304
|
+
"cssProperties": [
|
|
1305
|
+
{
|
|
1306
|
+
"description": "Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element. Default value is `fixed`",
|
|
1307
|
+
"name": "--bl-popover-position"
|
|
1308
|
+
}
|
|
1309
|
+
],
|
|
1287
1310
|
"events": [
|
|
1288
1311
|
{
|
|
1289
1312
|
"type": {
|
|
1290
|
-
"text": "CustomEvent<ISelectOption[]>"
|
|
1313
|
+
"text": "CustomEvent<ISelectOption<ValueType>[]>"
|
|
1291
1314
|
},
|
|
1315
|
+
"description": "Fires when selection changes",
|
|
1292
1316
|
"name": "bl-select"
|
|
1293
1317
|
}
|
|
1294
1318
|
],
|
|
1295
1319
|
"attributes": [
|
|
1320
|
+
{
|
|
1321
|
+
"name": "name",
|
|
1322
|
+
"type": {
|
|
1323
|
+
"text": "string"
|
|
1324
|
+
},
|
|
1325
|
+
"description": "Sets name of the select field",
|
|
1326
|
+
"fieldName": "name"
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
"name": "value",
|
|
1330
|
+
"type": {
|
|
1331
|
+
"text": "ValueType | ValueType[] | null"
|
|
1332
|
+
},
|
|
1333
|
+
"description": "Sets the value of the select",
|
|
1334
|
+
"fieldName": "value"
|
|
1335
|
+
},
|
|
1296
1336
|
{
|
|
1297
1337
|
"name": "label",
|
|
1298
1338
|
"type": {
|
|
@@ -1371,11 +1411,25 @@
|
|
|
1371
1411
|
"fieldName": "customInvalidText"
|
|
1372
1412
|
}
|
|
1373
1413
|
],
|
|
1414
|
+
"mixins": [
|
|
1415
|
+
{
|
|
1416
|
+
"name": "FormControlMixin",
|
|
1417
|
+
"package": "@open-wc/form-control"
|
|
1418
|
+
}
|
|
1419
|
+
],
|
|
1374
1420
|
"superclass": {
|
|
1375
1421
|
"name": "LitElement",
|
|
1376
1422
|
"package": "lit"
|
|
1377
1423
|
},
|
|
1378
1424
|
"tagName": "bl-select",
|
|
1425
|
+
"summary": "Baklava Select component",
|
|
1426
|
+
"typeParameters": [
|
|
1427
|
+
{
|
|
1428
|
+
"name": "ValueType",
|
|
1429
|
+
"extends": "FormValue",
|
|
1430
|
+
"default": "string"
|
|
1431
|
+
}
|
|
1432
|
+
],
|
|
1379
1433
|
"customElement": true
|
|
1380
1434
|
}
|
|
1381
1435
|
],
|
|
@@ -2160,17 +2214,31 @@
|
|
|
2160
2214
|
"events": [
|
|
2161
2215
|
{
|
|
2162
2216
|
"type": {
|
|
2163
|
-
"text": "CustomEvent<
|
|
2217
|
+
"text": "CustomEvent<ValueType | string | null>"
|
|
2164
2218
|
},
|
|
2165
2219
|
"description": "Fires when clicked on the option",
|
|
2166
2220
|
"name": "bl-select-option"
|
|
2221
|
+
},
|
|
2222
|
+
{
|
|
2223
|
+
"type": {
|
|
2224
|
+
"text": "CustomEvent<ValueType | string | null>"
|
|
2225
|
+
},
|
|
2226
|
+
"description": "Fires when checkbox is focused",
|
|
2227
|
+
"name": "bl-focus"
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
"type": {
|
|
2231
|
+
"text": "CustomEvent<ValueType | string | null>"
|
|
2232
|
+
},
|
|
2233
|
+
"description": "Fires when checkbox is blurred",
|
|
2234
|
+
"name": "bl-blur"
|
|
2167
2235
|
}
|
|
2168
2236
|
],
|
|
2169
2237
|
"attributes": [
|
|
2170
2238
|
{
|
|
2171
2239
|
"name": "value",
|
|
2172
2240
|
"type": {
|
|
2173
|
-
"text": "
|
|
2241
|
+
"text": "ValueType"
|
|
2174
2242
|
},
|
|
2175
2243
|
"description": "Sets the value for the option",
|
|
2176
2244
|
"fieldName": "value"
|
|
@@ -2198,6 +2266,13 @@
|
|
|
2198
2266
|
"name": "LitElement",
|
|
2199
2267
|
"package": "lit"
|
|
2200
2268
|
},
|
|
2269
|
+
"typeParameters": [
|
|
2270
|
+
{
|
|
2271
|
+
"name": "ValueType",
|
|
2272
|
+
"extends": "FormValue",
|
|
2273
|
+
"default": "string"
|
|
2274
|
+
}
|
|
2275
|
+
],
|
|
2201
2276
|
"tagName": "bl-select-option",
|
|
2202
2277
|
"customElement": true
|
|
2203
2278
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trendyol/baklava",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.81",
|
|
4
4
|
"description": "Trendyol Baklava Design System",
|
|
5
5
|
"main": "dist/baklava.js",
|
|
6
6
|
"module": "dist/baklava.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@floating-ui/dom": "^0.5.4",
|
|
60
60
|
"@fontsource/rubik": "^4.5.9",
|
|
61
61
|
"@lit-labs/react": "^1.1.1",
|
|
62
|
-
"@open-wc/form-control": "^0.
|
|
63
|
-
"@open-wc/form-helpers": "^0.2.
|
|
62
|
+
"@open-wc/form-control": "^0.7.0",
|
|
63
|
+
"@open-wc/form-helpers": "^0.2.2",
|
|
64
64
|
"element-internals-polyfill": "^1.2.3",
|
|
65
65
|
"lit": "^2.6.1"
|
|
66
66
|
},
|
package/dist/chunk-2PVZLIDX.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-OLPYXE2P.js";import{a}from"./chunk-KPAWUBRO.js";import{a as f}from"./chunk-23UFIOHV.js";import{a as v,b as n,f as p,g as h,h as r,i as u,j as m}from"./chunk-57PTZNIL.js";import{a as o}from"./chunk-NZ3RGSR6.js";var y=l=>{if(l.reportValidity()){let c=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});l.dispatchEvent(c),c.defaultPrevented||l.submit()}else return};var x=v`:host{display:var(--bl-button-display,inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-hover);--text-hover-color:var(--bl-color-secondary-background);--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify,center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:6px;text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(:hover) .button,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size='small']) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size='large']) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:0}.button:focus-visible{position:relative;outline:0}.button:focus-visible::after{border:2px solid var(--main-color);border-radius:var(--bl-border-radius-l);content:"";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant='secondary']) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant='tertiary']) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind='neutral']) .button{--main-color:var(--bl-color-secondary);--main-hover-color:var(--bl-color-secondary-hover)}:host([kind='success']) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-hover)}:host([kind='danger']) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-hover)}:host([disabled]){cursor:not-allowed}:host([disabled]) .button{--main-color:var(--bl-color-tertiary);--main-hover-color:var(--bl-color-tertiary);--content-color:var(--bl-color-content-passive);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant='tertiary'][disabled]) .button{--main-color:transparent}:host([variant='secondary']:hover:not([disabled])) .button,:host([variant='secondary'].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__:not([disabled])) .button{--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-hover-color)}:host([variant='tertiary']:hover:not([disabled])) .button,:host([variant='tertiary'].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__:not([disabled])) .button{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant='secondary']) .active.button{--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-hover-color)}:host([variant='tertiary']) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-tertiary);--border-color:transparent}`,_=x;var t=class extends p{constructor(){super(...arguments);this.variant="primary";this.kind="default";this.size="medium";this.disabled=!1;this.target="_self";this.dropdown=!1;this.active=!1}static get styles(){return[_]}get _isActive(){return this.active}connectedCallback(){super.connectedCallback(),this.form=this.closest("form")}caretTemplate(){return n` <bl-icon class="open" name="arrow_up"></bl-icon>
|
|
2
|
-
<bl-icon class="close" name="arrow_down"></bl-icon>`}_handleClick(){this.type==="submit"&&this.form&&y(this.form),this.onClick("Click event fired!")}focus(){this.button.focus()}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}get _hasDefaultSlot(){return[...this.childNodes].some(e=>{var s;let i=e.nodeType;return i===e.TEXT_NODE&&((s=e.textContent)==null?void 0:s.trim())!==""||i===e.ELEMENT_NODE&&!e.hasAttribute("slot")})}render(){let b=!!this.href,e=this.icon?n`<bl-icon name=${this.icon}></bl-icon>`:"",i=n`<slot name="icon">${e}</slot> <span class="label"><slot></slot></span>`,s=this.dropdown?this.caretTemplate():"",d=g({button:!0,"has-icon":this.icon||this._hasIconSlot,"has-content":this._hasDefaultSlot,active:!b&&this._isActive});return b?n`<a
|
|
3
|
-
class=${d}
|
|
4
|
-
aria-disabled="${a(this.disabled)}"
|
|
5
|
-
aria-label="${a(this.label)}"
|
|
6
|
-
href=${a(this.href)}
|
|
7
|
-
target=${a(this.target)}
|
|
8
|
-
role="button"
|
|
9
|
-
>${i}
|
|
10
|
-
</a>`:n`<button
|
|
11
|
-
class=${d}
|
|
12
|
-
aria-disabled="${a(this.disabled)}"
|
|
13
|
-
aria-label="${a(this.label)}"
|
|
14
|
-
?disabled=${this.disabled}
|
|
15
|
-
@click="${this._handleClick}"
|
|
16
|
-
>
|
|
17
|
-
${i} ${s}
|
|
18
|
-
</button>`}};o([r({type:String,reflect:!0})],t.prototype,"variant",2),o([r({type:String,reflect:!0})],t.prototype,"kind",2),o([r({type:String,reflect:!0})],t.prototype,"size",2),o([r({type:String})],t.prototype,"label",2),o([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),o([r({type:String})],t.prototype,"href",2),o([r({type:String})],t.prototype,"icon",2),o([r({type:String})],t.prototype,"target",2),o([r({type:String})],t.prototype,"type",2),o([r({type:Boolean})],t.prototype,"dropdown",2),o([u({})],t.prototype,"active",2),o([m(".button")],t.prototype,"button",2),o([f("bl-click")],t.prototype,"onClick",2),t=o([h("bl-button")],t);export{y as a,t as b};
|
|
19
|
-
//# sourceMappingURL=chunk-2PVZLIDX.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../node_modules/@open-wc/form-helpers/src/index.ts", "../src/components/button/bl-button.css", "../src/components/button/bl-button.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Implicitly submit a form by first validating all controls. If the form\n * is valid, issue a submit event and if that event is not prevented, manually\n * call the form's submit method.\n *\n * @param form {HTMLFormElement} - A form to implicitly submit\n */\nexport const submit = (form: HTMLFormElement): void => {\n if (!form.reportValidity()) {\n return;\n } else {\n const submitEvent = new SubmitEvent('submit', {\n bubbles: true,\n cancelable: true\n });\n form.dispatchEvent(submitEvent);\n if (!submitEvent.defaultPrevented) {\n form.submit();\n }\n }\n};\n\nexport type FormValue = string|FormData|File|FormValue[];\n\n/**\n * Parse a form and return a set of values based on the name/value pair.\n * If multiple controls of a similar name exist, return an array for those values;\n * otherwise return a single value.\n *\n * @param form {HTMLFormElement} - The form to parse for values\n * @returns {Record<string, any>} - An object representing the form's current values\n */\nexport const formValues = (form: HTMLFormElement): Record<string, FormValue> => {\n const formData = new FormData(form);\n const values: Record<string, FormValue> = {};\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore This does exist in all browsers. TypeScript is wrong\n for (const [key, value] of formData.entries()) {\n if (!values.hasOwnProperty(key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n const pointer = values[key] as FormValue[];\n pointer.push(value);\n } else {\n values[key] = [values[key], value];\n }\n }\n\n return values;\n};\n\n/**\n * This method takes a form and parses it as an object. If any form control has a `.`\n * in its name, this utility will evaluate that name as a deep key for an object;\n * in other words, if a form has a named control, `name.first` and another, `name.last`\n * it will report back a nested object, name, with first and last properties\n * representing those controls' values.\n *\n * This can be useful when you have a complex model that you are attempting to represent\n * in declaratively in HTML.\n *\n * @param form {HTMLFormElement} - The form to grab values from\n * @returns {Object<string, FormValue>} - An object representation of the form\n */\nexport const parseFormAsObject = (form: HTMLFormElement): Record<string, FormValue> => {\n const data = formValues(form);\n const output: Record<string, FormValue> = {};\n\n Object.entries(data).forEach(([key, value]) => {\n /** If the key has a '.', parse it as an object */\n if (key.includes('.')) {\n const path = key.split('.');\n const destination: string | undefined = path.pop();\n let pointer = output;\n\n while (path.length) {\n const key = path.shift();\n pointer[key as string] = pointer[key as string] || ({} as FormValue);\n pointer = pointer[key as string] as unknown as Record<string, FormValue>;\n }\n\n pointer[destination as string] = value;\n } else {\n output[key] = data[key];\n }\n });\n\n return output;\n};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:var(--bl-button-display,inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-hover);--text-hover-color:var(--bl-color-secondary-background);--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify,center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:6px;text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(:hover) .button,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size='small']) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size='large']) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:0}.button:focus-visible{position:relative;outline:0}.button:focus-visible::after{border:2px solid var(--main-color);border-radius:var(--bl-border-radius-l);content:\"\";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant='secondary']) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant='tertiary']) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind='neutral']) .button{--main-color:var(--bl-color-secondary);--main-hover-color:var(--bl-color-secondary-hover)}:host([kind='success']) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-hover)}:host([kind='danger']) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-hover)}:host([disabled]){cursor:not-allowed}:host([disabled]) .button{--main-color:var(--bl-color-tertiary);--main-hover-color:var(--bl-color-tertiary);--content-color:var(--bl-color-content-passive);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant='tertiary'][disabled]) .button{--main-color:transparent}:host([variant='secondary']:hover:not([disabled])) .button,:host([variant='secondary'].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__:not([disabled])) .button{--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-hover-color)}:host([variant='tertiary']:hover:not([disabled])) .button,:host([variant='tertiary'].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__:not([disabled])) .button{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant='secondary']) .active.button{--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-hover-color)}:host([variant='tertiary']) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-tertiary);--border-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { submit } from '@open-wc/form-helpers';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport style from './bl-button.css';\nimport '../icon/bl-icon';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'tertiary';\nexport type ButtonKind = 'default' | 'neutral' | 'success' | 'danger';\nexport type ButtonSize = 'small' | 'medium' | 'large';\nexport type TargetType = '_blank' | '_parent' | '_self' | '_top';\n\n/**\n * @tag bl-button\n * @summary Baklava Button component\n *\n * @cssproperty --bl-button-display - Sets the display property of button. Default value is 'inline-block'.\n * @cssproperty --bl-button-justify - Sets the justify-content property of button. Default value is 'center'.\n *\n */\n@customElement('bl-button')\nexport default class BlButton extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = 'primary';\n\n /**\n * Sets the button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = 'default';\n\n /**\n * Sets the button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = 'medium';\n\n /**\n * Sets the button label. Used for accessibility.\n */\n @property({ type: String })\n label: string;\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Set link url. If set, button will be rendered as anchor tag.\n */\n @property({ type: String })\n href?: string;\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n @property({ type: String })\n icon?: string;\n\n /**\n * Sets the anchor target. Used when `href` is set.\n */\n @property({ type: String })\n target?: TargetType = '_self';\n\n /**\n * Sets the type of the button. Set `submit` to use button as the submitter of parent form.\n */\n @property({ type: String })\n type: 'submit' | null;\n\n /**\n * Sets button type to dropdown\n */\n @property({ type: Boolean })\n dropdown = false;\n\n /**\n * Active state\n */\n @state({})\n active = false;\n\n @query('.button')\n private button: HTMLAnchorElement | HTMLButtonElement;\n\n /**\n * Fires when button clicked\n */\n @event('bl-click') private onClick: EventDispatcher<string>;\n\n private get _isActive() {\n return this.active;\n }\n\n private form: HTMLFormElement | null;\n\n connectedCallback() {\n super.connectedCallback();\n this.form = this.closest('form');\n }\n\n private caretTemplate(): TemplateResult {\n return html` <bl-icon class=\"open\" name=\"arrow_up\"></bl-icon>\n <bl-icon class=\"close\" name=\"arrow_down\"></bl-icon>`;\n }\n\n private _handleClick() {\n if (this.type === 'submit' && this.form) {\n submit(this.form);\n }\n\n this.onClick('Click event fired!');\n }\n\n focus() {\n this.button.focus();\n }\n\n get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n get _hasDefaultSlot() {\n const childNodes = [...this.childNodes];\n return childNodes.some(node => {\n const nodeType = node.nodeType;\n // has only text node.\n if (nodeType === node.TEXT_NODE && node.textContent?.trim() !== '') {\n return true;\n }\n // has element node, it should not have slot attribute.\n if (nodeType === node.ELEMENT_NODE) {\n if (!(node as HTMLElement).hasAttribute('slot')) {\n return true;\n }\n }\n return false;\n });\n }\n\n render(): TemplateResult {\n const isAnchor = !!this.href;\n const icon = this.icon ? html`<bl-icon name=${this.icon}></bl-icon>` : '';\n const slots = html`<slot name=\"icon\">${icon}</slot> <span class=\"label\"><slot></slot></span>`;\n const caret = this.dropdown ? this.caretTemplate() : '';\n const classes = classMap({\n 'button': true,\n 'has-icon': this.icon || this._hasIconSlot,\n 'has-content': this._hasDefaultSlot,\n 'active': !isAnchor && this._isActive,\n });\n\n return isAnchor\n ? html`<a\n class=${classes}\n aria-disabled=\"${ifDefined(this.disabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n href=${ifDefined(this.href)}\n target=${ifDefined(this.target)}\n role=\"button\"\n >${slots}\n </a>`\n : html`<button\n class=${classes}\n aria-disabled=\"${ifDefined(this.disabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n ?disabled=${this.disabled}\n @click=\"${this._handleClick}\"\n >\n ${slots} ${caret}\n </button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-button': BlButton;\n }\n}\n"],
|
|
5
|
-
"mappings": "6OAOO,IAAMA,EAAUC,GAA+B,CACpD,GAAKA,EAAK,eAAc,EAEjB,CACL,IAAMC,EAAc,IAAI,YAAY,SAAU,CAC5C,QAAS,GACT,WAAY,GACb,EACDD,EAAK,cAAcC,CAAW,EACzBA,EAAY,kBACfD,EAAK,OAAM,MARb,OAWJ,ECnBO,IAAME,EAASC,mxHACfC,EAAQF,ECqBf,IAAqBG,EAArB,cAAsCC,CAAW,CAAjD,kCASE,aAAyB,UAMzB,UAAmB,UAMnB,UAAmB,SAYnB,cAAW,GAkBX,YAAsB,QAYtB,cAAW,GAMX,YAAS,GApET,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA4EA,IAAY,WAAY,CACtB,OAAO,KAAK,MACd,CAIA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,KAAK,KAAO,KAAK,QAAQ,MAAM,CACjC,CAEQ,eAAgC,CACtC,OAAOC;AAAA,0DAET,CAEQ,cAAe,CACjB,KAAK,OAAS,UAAY,KAAK,MACjCC,EAAO,KAAK,IAAI,EAGlB,KAAK,QAAQ,oBAAoB,CACnC,CAEA,OAAQ,CACN,KAAK,OAAO,MAAM,CACpB,CAEA,IAAI,cAAe,CACjB,OAAO,KAAK,cA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CAAC,GA1BPhB,EA2BnB,qBAMAe,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAhCvBhB,EAiCnB,wBAMAe,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAtCPhB,EAuCnB,oBAMAe,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GA5CPhB,EA6CnB,oBAMAe,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAlDPhB,EAmDnB,sBAMAe,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAxDPhB,EAyDnB,oBAMAe,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA9DRhB,EA+DnB,wBAMAe,EAAA,CADCE,EAAM,CAAC,CAAC,GApEUjB,EAqEnB,sBAGQe,EAAA,CADPG,EAAM,SAAS,GAvEGlB,EAwEX,sBAKmBe,EAAA,CAA1BI,EAAM,UAAU,GA7EEnB,EA6EQ,uBA7ERA,EAArBe,EAAA,CADCC,EAAc,WAAW,GACLhB",
|
|
6
|
-
"names": ["submit", "form", "submitEvent", "styles", "i", "bl_button_default", "BlButton", "s", "bl_button_default", "y", "submit", "node", "_a", "nodeType", "isAnchor", "icon", "slots", "caret", "classes", "o", "l", "__decorateClass", "e", "t", "i", "event"]
|
|
7
|
-
}
|
package/dist/chunk-4WJJQP4L.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-23UFIOHV.js";import{a as s,b as l,f as r,g as a,h as i,i as c}from"./chunk-57PTZNIL.js";import{a as o}from"./chunk-NZ3RGSR6.js";var h=s`:host{position:relative}.option-container{--option-font:var(--bl-font-title-3-regular);--option-padding:var(--bl-size-xs) 0;--option-selected-color:var(--bl-color-primary);--option-hover-color:var(--bl-color-primary-hover);--option-color:var(--bl-color-secondary);--option-disabled-color:var(--bl-color-content-passive);--option-seperator:1px solid var(--bl-color-border);--option-gap:var(--bl-size-2xs);--option-transition:color 120ms ease-out}.option-container::after{position:absolute;content:'';width:100%;bottom:0;border-bottom:var(--option-seperator)}:host(:last-of-type) .option-container::after{border-bottom:0}.single-option{width:100%;display:block;cursor:pointer;color:var(--option-color);padding:var(--option-padding);transition:var(--option-transition);font:var(--option-font);user-select:none}:host(:hover) .single-option,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .single-option{color:var(--option-hover-color)}:host([selected]) .single-option{color:var(--option-selected-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .single-option{color:var(--option-disabled-color);cursor:not-allowed;pointer-events:none}.checkbox-option{width:100%;display:block;color:var(--option-color);padding:var(--option-padding)}`,d=h;var e=class extends r{constructor(){super(...arguments);this.disabled=!1;this.selected=!1;this.multiple=!1}static get styles(){return[d]}singleOptionTemplate(){return l`<div class="single-option" @click="${this._onClickOption}">
|
|
2
|
-
<slot></slot>
|
|
3
|
-
</div>`}checkboxOptionTemplate(){return l`<bl-checkbox
|
|
4
|
-
class="checkbox-option"
|
|
5
|
-
.checked="${this.selected}"
|
|
6
|
-
.disabled="${this.disabled}"
|
|
7
|
-
@bl-checkbox-change="${this._onCheckboxChange}"
|
|
8
|
-
>
|
|
9
|
-
<slot></slot>
|
|
10
|
-
</bl-checkbox>`}render(){return l`<div class="option-container">
|
|
11
|
-
${this.multiple?this.checkboxOptionTemplate():this.singleOptionTemplate()}
|
|
12
|
-
</div>`}_handleEvent(){this._onSelect({value:this.value,text:this.textContent,selected:this.selected})}_onClickOption(){this.selected=!this.selected,this._handleEvent()}_onCheckboxChange(t){this.selected=t.detail,this._handleEvent()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t,n;this.blSelect=this.closest("bl-select"),this.multiple=((t=this.blSelect)==null?void 0:t.multiple)||!1,(n=this.blSelect)==null||n.registerOption(this)})}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.blSelect)==null||t.unregisterOption(this)}};o([i({})],e.prototype,"value",2),o([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),o([i({type:Boolean,reflect:!0})],e.prototype,"selected",2),o([c()],e.prototype,"multiple",2),o([p("bl-select-option")],e.prototype,"_onSelect",2),e=o([a("bl-select-option")],e);export{e as a};
|
|
13
|
-
//# sourceMappingURL=chunk-4WJJQP4L.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/select/option/bl-select-option.css", "../src/components/select/option/bl-select-option.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{position:relative}.option-container{--option-font:var(--bl-font-title-3-regular);--option-padding:var(--bl-size-xs) 0;--option-selected-color:var(--bl-color-primary);--option-hover-color:var(--bl-color-primary-hover);--option-color:var(--bl-color-secondary);--option-disabled-color:var(--bl-color-content-passive);--option-seperator:1px solid var(--bl-color-border);--option-gap:var(--bl-size-2xs);--option-transition:color 120ms ease-out}.option-container::after{position:absolute;content:'';width:100%;bottom:0;border-bottom:var(--option-seperator)}:host(:last-of-type) .option-container::after{border-bottom:0}.single-option{width:100%;display:block;cursor:pointer;color:var(--option-color);padding:var(--option-padding);transition:var(--option-transition);font:var(--option-font);user-select:none}:host(:hover) .single-option,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .single-option{color:var(--option-hover-color)}:host([selected]) .single-option{color:var(--option-selected-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .single-option{color:var(--option-disabled-color);cursor:not-allowed;pointer-events:none}.checkbox-option{width:100%;display:block;color:var(--option-color);padding:var(--option-padding)}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { event, EventDispatcher } from '../../../utilities/event';\nimport BlSelect, { ISelectOption } from '../bl-select';\nimport style from './bl-select-option.css';\n\n@customElement('bl-select-option')\nexport default class BlSelectOption extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /* Declare reactive properties */\n /**\n * Sets the value for the option\n */\n @property({})\n value: string;\n\n /**\n * Sets option as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets option as selected state\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n @state()\n multiple = false;\n\n /**\n * Fires when clicked on the option\n */\n @event('bl-select-option') private _onSelect: EventDispatcher<ISelectOption>;\n\n private blSelect: BlSelect | null;\n\n private singleOptionTemplate() {\n return html`<div class=\"single-option\" @click=\"${this._onClickOption}\">\n <slot></slot>\n </div>`;\n }\n\n private checkboxOptionTemplate() {\n return html`<bl-checkbox\n class=\"checkbox-option\"\n .checked=\"${this.selected}\"\n .disabled=\"${this.disabled}\"\n @bl-checkbox-change=\"${this._onCheckboxChange}\"\n >\n <slot></slot>\n </bl-checkbox>`;\n }\n\n render() {\n return html`<div class=\"option-container\">\n ${this.multiple ? this.checkboxOptionTemplate() : this.singleOptionTemplate()}\n </div>`;\n }\n\n private _handleEvent() {\n this._onSelect({\n value: this.value,\n text: this.textContent,\n selected: this.selected,\n } as ISelectOption);\n }\n\n private _onClickOption() {\n this.selected = !this.selected;\n this._handleEvent();\n }\n\n private _onCheckboxChange(event: CustomEvent) {\n this.selected = event.detail;\n this._handleEvent();\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.updateComplete.then(() => {\n this.blSelect = this.closest<BlSelect>('bl-select');\n // FIXME: We should warn when parent is not bl-select\n\n this.multiple = this.blSelect?.multiple || false;\n this.blSelect?.registerOption(this);\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.blSelect?.unregisterOption(this);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-select-option': BlSelectOption;\n }\n}\n"],
|
|
5
|
-
"mappings": "2JACO,IAAMA,EAASC,guCACfC,EAAQF,ECKf,IAAqBG,EAArB,cAA4CC,CAAW,CAAvD,kCAgBE,cAAW,GAMX,cAAW,GAGX,cAAW,GAxBX,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,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,kBAAkB,GACZR",
|
|
6
|
-
"names": ["styles", "i", "bl_select_option_default", "BlSelectOption", "s", "bl_select_option_default", "y", "event", "_a", "_b", "__decorateClass", "e", "t"]
|
|
7
|
-
}
|
package/dist/chunk-7K5FMQLQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var d=function(u,c,f,n){if(f==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof c=="function"?u!==c||!n:!c.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?n:f==="a"?n.call(u):n?n.value:c.get(u)},E=function(u,c,f,n,y){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!y)throw new TypeError("Private accessor was defined without a setter");if(typeof c=="function"?u!==c||!y:!c.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?y.call(u,f):y?y.value=f:c.set(u,f),f};function pt(u){var c,f,n,y,V,W,F,P,A,D,$,O,T,k,C,q,U,z;class J extends u{constructor(...s){super(...s),c.add(this),this.internals=this.attachInternals(),f.set(this,!1),n.set(this,!1),y.set(this,!1),V.set(this,void 0),W.set(this,void 0),P.set(this,""),A.set(this,()=>{E(this,y,!0,"f"),E(this,f,!0,"f"),d(this,c,"m",C).call(this)}),D.set(this,()=>{E(this,f,!1,"f"),d(this,c,"m",q).call(this,this.shouldFormValueUpdate()?d(this,P,"f"):""),!this.validity.valid&&d(this,y,"f")&&E(this,n,!0,"f");let r=d(this,c,"m",C).call(this);this.validationMessageCallback&&this.validationMessageCallback(r?this.internals.validationMessage:"")}),$.set(this,()=>{var r;E(this,n,!0,"f"),d(this,c,"m",C).call(this),(r=this===null||this===void 0?void 0:this.validationMessageCallback)===null||r===void 0||r.call(this,this.showError?this.internals.validationMessage:"")}),O.set(this,void 0),T.set(this,!1),k.set(this,Promise.resolve()),this.addEventListener("focus",d(this,A,"f")),this.addEventListener("blur",d(this,D,"f")),this.addEventListener("invalid",d(this,$,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let s=this.validators.map(g=>g.attribute).flat(),r=super.observedAttributes||[];return[...new Set([...r,...s])]}static getValidator(s){return this.validators.find(r=>r.attribute===s)||null}static getValidators(s){return this.validators.filter(r=>{var p;if(r.attribute===s||!((p=r.attribute)===null||p===void 0)&&p.includes(s))return!0})}get form(){return this.internals.form}get showError(){return d(this,c,"m",C).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(s,r,p){var g;(g=super.attributeChangedCallback)===null||g===void 0||g.call(this,s,r,p);let S=this.constructor.getValidators(s);S!=null&&S.length&&this.validationTarget&&this.setValue(d(this,P,"f"))}setValue(s){var r;E(this,n,!1,"f"),(r=this.validationMessageCallback)===null||r===void 0||r.call(this,""),E(this,P,s,"f");let g=this.shouldFormValueUpdate()?s:null;this.internals.setFormValue(g),d(this,c,"m",q).call(this,g),this.valueChangedCallback&&this.valueChangedCallback(g),d(this,c,"m",C).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(s=>s(d(this,k,"f")))}formResetCallback(){var s,r;E(this,y,!1,"f"),E(this,n,!1,"f"),d(this,c,"m",C).call(this),(s=this.resetFormControl)===null||s===void 0||s.call(this),(r=this.validationMessageCallback)===null||r===void 0||r.call(this,d(this,c,"m",C).call(this)?this.validationMessage:"")}}return f=new WeakMap,n=new WeakMap,y=new WeakMap,V=new WeakMap,W=new WeakMap,P=new WeakMap,A=new WeakMap,D=new WeakMap,$=new WeakMap,O=new WeakMap,T=new WeakMap,k=new WeakMap,c=new WeakSet,F=function(){let s=this.getRootNode(),r=`${this.localName}[name="${this.getAttribute("name")}"]`;return s.querySelectorAll(r)},C=function(){if(this.hasAttribute("disabled"))return!1;let s=d(this,n,"f")||d(this,y,"f")&&!this.validity.valid&&!d(this,f,"f");return s&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),s},q=function(s){let r=this.constructor,p={},g=r.validators,R=[],S=g.some(b=>b.isValid instanceof Promise);d(this,T,"f")||(E(this,k,new Promise(b=>{E(this,O,b,"f")}),"f"),E(this,T,!0,"f")),d(this,V,"f")&&(d(this,V,"f").abort(),E(this,W,d(this,V,"f"),"f"));let x=new AbortController;E(this,V,x,"f");let H,B=!1;g.length&&(g.forEach(b=>{let G=b.key||"customError",L=b.isValid(this,s,x.signal);L instanceof Promise?(R.push(L),L.then(K=>{K!=null&&(p[G]=!K,H=d(this,c,"m",z).call(this,b,s),d(this,c,"m",U).call(this,p,H))})):(p[G]=!L,this.validity[G]!==!L&&(B=!0),!L&&!H&&(H=d(this,c,"m",z).call(this,b,s)))}),Promise.allSettled(R).then(()=>{var b;x!=null&&x.signal.aborted||(E(this,T,!1,"f"),(b=d(this,O,"f"))===null||b===void 0||b.call(this))}),(B||!S)&&d(this,c,"m",U).call(this,p,H))},U=function(s,r){if(this.validationTarget)this.internals.setValidity(s,r,this.validationTarget);else{if(this.internals.setValidity(s,r),this.internals.validity.valid)return;let p=0,g=setInterval(()=>{p>=100||this.validity.valid?clearInterval(g):this.validationTarget&&(this.internals.setValidity(this.validity,r,this.validationTarget),clearInterval(g)),p+=1},0)}},z=function(s,r){if(this.validityCallback){let p=this.validityCallback(s.key||"customError");if(p)return p}return s.message instanceof Function?s.message(this,r):s.message},J}(function(){"use strict";let u=new WeakMap,c=new WeakMap,f=new WeakMap,n=new WeakMap,y=new WeakMap,V=new WeakMap,W=new WeakMap,F=new WeakMap,P=new WeakMap,A=new WeakMap,D=new WeakMap,$=new WeakMap,O=new WeakMap,T=new WeakMap,k=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},q=(e,t)=>{for(let a in C){t[a]=null;let i=null,o=C[a];Object.defineProperty(t,a,{get(){return i},set(h){i=h,e.isConnected?e.setAttribute(o,h):A.set(e,t)}})}};function U(e){let t=n.get(e),{form:a}=t;et(e,a,t),B(e,t.labels)}let z=(e,t=!1)=>{let a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(h){return n.has(h)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=a.nextNode(),o=!t||e.disabled;for(;i;)i.formDisabledCallback&&o&&R(i,e.disabled),i=a.nextNode()},J={attributes:!0,attributeFilter:["disabled"]},I=new MutationObserver(e=>{for(let t of e){let a=t.target;a.constructor.formAssociated?R(a,a.hasAttribute("disabled")):a.localName==="fieldset"&&z(a)}});function s(e){e.forEach(t=>{let{addedNodes:a,removedNodes:i}=t,o=Array.from(a),h=Array.from(i);o.forEach(l=>{if(n.has(l)&&l.constructor.formAssociated&&U(l),A.has(l)){let v=A.get(l);Object.keys(C).filter(m=>v[m]!==null).forEach(m=>{l.setAttribute(C[m],v[m])}),A.delete(l)}if(k.has(l)){let v=k.get(l);l.setAttribute("internals-valid",v.validity.valid.toString()),l.setAttribute("internals-invalid",(!v.validity.valid).toString()),l.setAttribute("aria-invalid",(!v.validity.valid).toString()),k.delete(l)}if(l.localName==="form"){let v=F.get(l),M=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(w){return n.has(w)&&!(v&&v.has(w))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),m=M.nextNode();for(;m;)U(m),m=M.nextNode()}l.localName==="fieldset"&&(I.observe(l,J),z(l,!0))}),h.forEach(l=>{let v=n.get(l);v&&f.get(v)&&S(v),W.has(l)&&W.get(l).disconnect()})})}function r(e){e.forEach(t=>{let{removedNodes:a}=t;a.forEach(i=>{let o=O.get(t.target);n.has(i)&&it(i),o.disconnect()})})}let p=e=>{let t=new MutationObserver(r);t.observe(e,{childList:!0}),O.set(e,t)};new MutationObserver(s);let g={childList:!0,subtree:!0},R=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},S=e=>{f.get(e).forEach(a=>{a.remove()}),f.set(e,[])},x=(e,t)=>{let a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),f.get(t).push(a),a},H=(e,t)=>{f.set(t,[]),I.observe(e,J)},B=(e,t)=>{if(t.length){Array.from(t).forEach(i=>i.addEventListener("click",e.click.bind(e)));let a=t[0].id;t[0].id||(a=`${t[0].htmlFor}_Label`,t[0].id=a),e.setAttribute("aria-labelledby",a)}},b=e=>{let t=Array.from(e.elements).filter(h=>!h.tagName.includes("-")&&h.validity).map(h=>h.validity.valid),a=F.get(e)||[],i=Array.from(a).filter(h=>h.isConnected).map(h=>n.get(h).validity.valid),o=[...t,...i].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},G=e=>{b(Q(e.target))},L=e=>{b(Q(e.target))},tt=e=>{let t=":is(:is(button, input)[type=submit], button:not([type])):not([disabled])",a=`${t}:not([form])`;e.id&&(a+=`,${t}[form='${e.id}']`),e.addEventListener("click",i=>{if(i.target.closest(a)){let h=F.get(e);if(e.noValidate)return;h.size&&Array.from(h).reverse().map(M=>n.get(M).reportValidity()).includes(!1)&&i.preventDefault()}})},K=e=>{let t=F.get(e.target);t&&t.size&&t.forEach(a=>{a.constructor.formAssociated&&a.formResetCallback&&a.formResetCallback.apply(a)})},et=(e,t,a)=>{if(t){let i=F.get(t);if(i)i.add(e);else{let o=new Set;o.add(e),F.set(t,o),tt(t),t.addEventListener("reset",K),t.addEventListener("input",G),t.addEventListener("change",L)}V.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),b(t)}},Q=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=Q(t)),t},_=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},at=(e,t,a)=>{let i=F.get(e);return i&&i.size&&i.forEach(o=>{n.get(o)[a]()||(t=!1)}),t},it=e=>{if(e.constructor.formAssociated){let t=n.get(e),{labels:a,form:i}=t;B(e,a),et(e,i,t)}};class nt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}let lt=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ct=(e,t,a)=>(e.valid=dt(t),Object.keys(t).forEach(i=>e[i]=t[i]),a&&b(a),e),dt=e=>{let t=!0;for(let a in e)a!=="valid"&&e[a]!==!1&&(t=!1);return t},Z=new WeakMap;class X extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Z.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);let a=super.add(t),i=Z.get(this);return i.toggleAttribute(`state${t}`,!0),i.part&&i.part.add(`state${t}`),a}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){let a=super.delete(t),i=Z.get(this);return i.toggleAttribute(`state${t}`,!1),i.part&&i.part.remove(`state${t}`),a}}function st(e,t,a,i){if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?i:a==="a"?i.call(e):i?i.value:t.get(e)}function ht(e,t,a,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,a):o?o.value=a:t.set(e,a),a}var j;class ut{constructor(t){j.set(this,void 0),ht(this,j,t,"f");for(let a=0;a<t.length;a++){let i=t[a];this[a]=i,i.hasAttribute("name")&&(this[i.getAttribute("name")]=i)}Object.freeze(this)}get length(){return st(this,j,"f").length}[(j=new WeakMap,Symbol.iterator)](){return st(this,j,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}class rt{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");let a=t.getRootNode(),i=new nt;this.states=new X(t),u.set(this,t),c.set(this,i),n.set(t,this),q(t,this),H(t,this),Object.seal(this),it(t),a instanceof DocumentFragment&&p(a)}checkValidity(){let t=u.get(this);if(_(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=c.get(this);if(!a.valid){let i=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(i)}return a.valid}get form(){let t=u.get(this);_(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let a;return t.constructor.formAssociated===!0&&(a=Q(t)),a}get labels(){let t=u.get(this);_(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");let a=t.getAttribute("id"),i=t.getRootNode();return i&&a?i.querySelectorAll(`[for="${a}"]`):[]}reportValidity(){let t=u.get(this);if(_(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=this.checkValidity(),i=$.get(this);if(i&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!a&&i&&(t.focus(),i.focus()),a}setFormValue(t){let a=u.get(this);if(_(a,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),S(this),t!=null&&!(t instanceof FormData)){if(a.getAttribute("name")){let i=x(a,this);i.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([i,o])=>{if(typeof o=="string"){let h=x(a,this);h.name=i,h.value=o}});P.set(a,t)}setValidity(t,a,i){let o=u.get(this);if(_(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");$.set(this,i);let h=c.get(this),l={};for(let m in t)l[m]=t[m];Object.keys(l).length===0&<(h);let v={...h,...l};delete v.valid;let{valid:M}=ct(h,v,this.form);if(!M&&!a)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");y.set(this,M?"":a),o.isConnected?(o.toggleAttribute("internals-invalid",!M),o.toggleAttribute("internals-valid",M),o.setAttribute("aria-invalid",`${!M}`)):k.set(o,this)}get shadowRoot(){let t=u.get(this),a=D.get(t);return a||null}get validationMessage(){let t=u.get(this);return _(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),y.get(this)}get validity(){let t=u.get(this);return _(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),c.get(this)}get willValidate(){let t=u.get(this);return _(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function mt(){if(!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);let a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(i=>i in a.internals)}if(mt()){if(!window.CustomStateSet){window.CustomStateSet=X;let e=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(...t){let a=e.call(this,t);return a.states=new X(this),a}}}else{let t=function(...m){let w=o.apply(this,m),N=new MutationObserver(s);return D.set(this,w),window.ShadyDOM?N.observe(this,g):N.observe(w,g),W.set(this,N),w},a=function(...m){let w=l.apply(this,m);return at(this,w,"checkValidity")},i=function(...m){let w=v.apply(this,m);return at(this,w,"reportValidity")};window.ElementInternals=rt;let e=customElements.define;customElements.define=function(m,w,N){if(w.formAssociated){let Y=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){T.has(this)||(T.set(this,!0),this.hasAttribute("disabled")&&R(this,!0)),Y!=null&&Y.apply(this)}}e.apply(customElements,[m,w,N])},HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new rt(this)};let o=Element.prototype.attachShadow;Element.prototype.attachShadow=t,new MutationObserver(s).observe(document.documentElement,g);let l=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=a;let v=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=i;let{get:M}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...m){let w=M.call(this,...m),N=Array.from(F.get(this)||[]);if(N.length===0)return w;let Y=Array.from(w).concat(N).sort((ot,ft)=>ot.compareDocumentPosition?ot.compareDocumentPosition(ft)&2?1:-1:0);return new ut(Y)}}),window.CustomStateSet||(window.CustomStateSet=X)}})();export{pt as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7K5FMQLQ.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../node_modules/@open-wc/form-control/src/FormControlMixin.ts", "../node_modules/element-internals-polyfill/dist/index.js"],
|
|
4
|
-
"sourcesContent": ["import { Constructor, CustomValidityState, FormControlInterface, FormValue, IControlHost, validationMessageCallback, Validator } from './types.js';\n\nexport function FormControlMixin<\n TBase extends Constructor<HTMLElement & IControlHost> & { observedAttributes?: string [] }\n>(SuperClass: TBase) {\n class FormControl extends SuperClass {\n /** Wires up control instances to be form associated */\n static get formAssociated(): boolean {\n return true;\n }\n\n /**\n * A list of Validator objects that will be evaluated when a control's form\n * value is modified or optionally when a given attribute changes.\n *\n * When a Validator's callback returns false, the entire form control will\n * be set to an invalid state.\n */\n declare static formControlValidators: Validator[];\n\n /**\n * If set to true the control described should be evaluated and validated\n * as part of a group. Like a radio, if any member of the group's validity\n * changes the the other members should update as well.\n */\n declare static formControlValidationGroup: boolean;\n\n private static get validators(): Validator[] {\n return this.formControlValidators || [];\n }\n\n /**\n * Allows the FormControl instance to respond to Validator attributes.\n * For instance, if a given Validator has a `required` attribute, that\n * validator will be evaluated whenever the host's required attribute\n * is updated.\n */\n static get observedAttributes(): string[] {\n const validatorAttributes = this.validators.map((validator) => validator.attribute).flat();\n\n const observedAttributes = super.observedAttributes || [];\n\n /** Make sure there are no duplicates inside the attributes list */\n const attributeSet = new Set([...observedAttributes, ...validatorAttributes]);\n return [...attributeSet] as string[];\n }\n\n /**\n * Return the validator associated with a given attribute. If no\n * Validator is associated with the attribute, it will return null.\n */\n static getValidator(attribute: string): Validator | null {\n return this.validators.find((validator) => validator.attribute === attribute) || null;\n }\n\n /**\n * Get all validators that are set to react to a given attribute\n * @param {string} attribute - The attribute that has changed\n * @returns {Validator[]}\n */\n static getValidators(attribute: string): Validator[] | null {\n return this.validators.filter(validator => {\n if (validator.attribute === attribute || validator.attribute?.includes(attribute)) {\n return true;\n }\n });\n }\n\n /** The ElementInternals instance for the control. */\n internals = this.attachInternals();\n\n /**\n * Keep track of if the control has focus\n * @private\n */\n #focused = false;\n\n /**\n * Exists to control when an error should be displayed\n * @private\n */\n #forceError = false;\n\n /**\n * Toggles to true whenever the element has been focused. This property\n * will reset whenever the control's formResetCallback is called.\n * @private\n */\n #touched = false;\n\n /** An internal abort controller for cancelling pending async validation */\n #abortController?: AbortController;\n #previousAbortController?: AbortController;\n\n /** All of the controls within a root with a matching local name and form name */\n get #formValidationGroup(): NodeListOf<FormControl> {\n const rootNode = this.getRootNode() as HTMLElement;\n const selector = `${this.localName}[name=\"${this.getAttribute('name')}\"]`;\n return rootNode.querySelectorAll<FormControl>(selector);\n }\n\n /**\n * Acts as a cache for the current value so the value can be re-evaluated\n * whenever an attribute changes or on some other event.\n */\n #value: FormValue = '';\n\n /**\n * Set this[touched] and this[focused]\n * to true when the element is focused\n * @private\n */\n #onFocus = (): void => {\n this.#touched = true;\n this.#focused = true;\n this.#shouldShowError();\n };\n\n /**\n * Reset this[focused] on blur\n * @private\n */\n #onBlur = (): void => {\n this.#focused = false;\n\n this.#runValidators(this.shouldFormValueUpdate() ? this.#value : '');\n\n /**\n * Set forceError to ensure error messages persist until\n * the value is changed.\n */\n if (!this.validity.valid && this.#touched) {\n this.#forceError = true;\n }\n const showError = this.#shouldShowError();\n if (this.validationMessageCallback) {\n this.validationMessageCallback(showError ? this.internals.validationMessage : '');\n }\n };\n\n /**\n * For the show error state on invalid\n * @private\n */\n #onInvalid = (): void => {\n this.#forceError = true;\n this.#shouldShowError();\n this?.validationMessageCallback?.(this.showError ? this.internals.validationMessage : '');\n };\n\n /** Return a reference to the control's form */\n get form(): HTMLFormElement {\n return this.internals.form;\n }\n\n /**\n * Will return true if it is recommended that the control shows an internal\n * error. If using this property, it is wise to listen for 'invalid' events\n * on the element host and call preventDefault on the event. Doing this will\n * prevent browsers from showing a validation popup.\n */\n get showError(): boolean {\n return this.#shouldShowError();\n }\n\n /**\n * Forward the internals checkValidity method\n * will return the valid state of the control.\n */\n checkValidity(): boolean {\n return this.internals.checkValidity();\n }\n\n /** The element's validity state */\n get validity(): ValidityState {\n return this.internals.validity;\n }\n\n /**\n * The validation message shown by a given Validator object. If the control\n * is in a valid state this should be falsy.\n */\n get validationMessage(): string {\n return this.internals.validationMessage;\n }\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n constructor(...args: any[]) {\n super(...args);\n this.addEventListener('focus', this.#onFocus);\n this.addEventListener('blur', this.#onBlur);\n this.addEventListener('invalid', this.#onInvalid);\n this.setValue(null);\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n /**\n * Check to see if a Validator is associated with the changed attribute.\n * If one exists, call control's validate function which will perform\n * control validation.\n */\n const proto = this.constructor as typeof FormControl;\n const validators = proto.getValidators(name);\n\n if (validators?.length && this.validationTarget) {\n this.setValue(this.#value);\n }\n }\n\n /** PUBLIC LIFECYCLE METHODS */\n\n /**\n * Sets the control's form value if the call to `shouldFormValueUpdate`\n * returns `true`.\n * @param value {FormValue} - The value to pass to the form\n */\n setValue(value: FormValue): void {\n this.#forceError = false;\n this.validationMessageCallback?.('');\n this.#value = value;\n const valueShouldUpdate = this.shouldFormValueUpdate();\n const valueToUpdate = valueShouldUpdate ? value : null;\n this.internals.setFormValue(valueToUpdate as string);\n this.#runValidators(valueToUpdate);\n if (this.valueChangedCallback) {\n this.valueChangedCallback(valueToUpdate);\n }\n this.#shouldShowError();\n }\n\n /**\n * This method can be overridden to determine if the control's form value\n * should be set on a call to `setValue`. An example of when a user might want\n * to skip this step is when implementing checkbox-like behavior, first checking\n * to see if `this.checked` is set to a truthy value. By default this returns\n * `true`.\n */\n shouldFormValueUpdate(): boolean {\n return true;\n }\n\n /** Save a reference to the validation complete resolver */\n #validationCompleteResolver?: (value: void | PromiseLike<void>) => void;\n\n /** When true validation will be pending */\n #isValidationPending = false;\n\n #validationComplete = Promise.resolve();\n\n /** A promise that will resolve when all pending validations are complete */\n get validationComplete(): Promise<void> {\n return new Promise(resolve => resolve(this.#validationComplete));\n }\n\n /** DECLARED INSTANCE METHODS AND PROPERTIES*/\n\n /**\n * Resets a form control to its initial state\n */\n declare resetFormControl: () => void;\n\n /**\n * This method is used to override the controls' validity message\n * for a given Validator key. This has the highest level of priority when\n * setting a validationMessage, so use this method wisely.\n *\n * The returned value will be used as the validationMessage for the given key.\n * @param validationKey {string} - The key that has returned invalid\n */\n declare validityCallback: (validationKey: string) => string | void;\n\n /**\n * Called when the control's validationMessage should be changed\n * @param message { string } - The new validation message\n */\n declare validationMessageCallback: (message: string) => void;\n\n /**\n * A callback for when the controls' form value changes. The value\n * passed to this function should not be confused with the control's\n * value property, this is the value that will appear on the form.\n *\n * In cases where `checked` did not exist on the control's prototype\n * upon initialization, this value and the value property will be identical;\n * in cases where `checked` is present upon initialization, this will be\n * effectively `this.checked && this.value`.\n */\n declare valueChangedCallback: (value: FormValue) => void;\n\n /**\n * The element that will receive focus when the control's validity\n * state is reported either by a form submission or via API\n *\n * We use declare since this is optional and we don't particularly\n * care how the consuming component implements this (as a field, member\n * or getter/setter)\n */\n declare validationTarget: HTMLElement | null;\n\n /** PRIVATE LIFECYCLE METHODS */\n\n /**\n * Check to see if an error should be shown. This method will also\n * update the internals state object with the --show-error state\n * if necessary.\n * @private\n */\n #shouldShowError(): boolean {\n if (this.hasAttribute('disabled')) {\n return false;\n }\n\n const showError = this.#forceError || (this.#touched && !this.validity.valid && !this.#focused);\n\n /**\n * At the time of writing Firefox doesn't support states\n * TODO: Remove when check for states when fully support is in place\n */\n if (showError && this.internals.states) {\n this.internals.states.add('--show-error');\n } else if (this.internals.states) {\n this.internals.states.delete('--show-error');\n }\n\n return showError;\n }\n\n #runValidators(value: FormValue): void {\n const proto = this.constructor as typeof FormControl;\n const validity: CustomValidityState = {};\n const validators = proto.validators;\n const asyncValidators: Promise<boolean|void>[] = [];\n const hasAsyncValidators = validators.some((validator) => validator.isValid instanceof Promise)\n\n if (!this.#isValidationPending) {\n this.#validationComplete = new Promise(resolve => {\n this.#validationCompleteResolver = resolve\n });\n this.#isValidationPending = true;\n }\n\n /**\n * If an abort controller exists from a previous validation step\n * notify still-running async validators that we are requesting they\n * discontinue any work.\n */\n if (this.#abortController) {\n this.#abortController.abort();\n this.#previousAbortController = this.#abortController;\n }\n\n /**\n * Create a new abort controller and replace the instance reference\n * so we can clean it up for next time\n */\n const abortController = new AbortController();\n this.#abortController = abortController;\n let validationMessage: string | undefined = undefined;\n\n /** Track to see if any validity key has changed */\n let hasChange = false;\n\n if (!validators.length) {\n return;\n }\n\n validators.forEach(validator => {\n const key = validator.key || 'customError';\n const isValid = validator.isValid(this, value, abortController.signal);\n const isAsyncValidator = isValid instanceof Promise;\n\n if (isAsyncValidator) {\n asyncValidators.push(isValid);\n\n isValid.then(isValidatorValid => {\n if (isValidatorValid === undefined || isValidatorValid === null) {\n return;\n }\n /** Invert the validity state to correspond to the ValidityState API */\n validity[key] = !isValidatorValid;\n\n validationMessage = this.#getValidatorMessageForValue(validator, value);\n this.#setValidityWithOptionalTarget(validity, validationMessage);\n });\n } else {\n /** Invert the validity state to correspond to the ValidityState API */\n validity[key] = !isValid;\n\n if (this.validity[key] !== !isValid) {\n hasChange = true;\n }\n\n // only update the validationMessage for the first invalid scenario\n // so that earlier invalid validators dont get their messages overwritten by later ones\n // in the validators array\n if (!isValid && !validationMessage) {\n validationMessage = this.#getValidatorMessageForValue(validator, value);\n }\n }\n });\n\n /** Once all the async validators have settled, resolve validationComplete */\n Promise.allSettled(asyncValidators)\n .then(() => {\n /** Don't resolve validations if the signal is aborted */\n if (!abortController?.signal.aborted) {\n this.#isValidationPending = false;\n this.#validationCompleteResolver?.();\n }\n });\n\n /**\n * If async validators are present:\n * Only run updates when a sync validator has a change. This is to prevent\n * situations where running sync validators can override async validators\n * that are still in progress\n *\n * If async validators are not present, always update validity\n */\n if (hasChange || !hasAsyncValidators) {\n this.#setValidityWithOptionalTarget(validity, validationMessage);\n }\n }\n\n /**\n * If the validationTarget is not set, the user can decide how they would\n * prefer to handle focus when the field is validated.\n */\n #setValidityWithOptionalTarget(validity: Partial<ValidityState>, validationMessage: string|undefined): void {\n if (this.validationTarget) {\n this.internals.setValidity(validity, validationMessage, this.validationTarget);\n } else {\n this.internals.setValidity(validity, validationMessage);\n\n if (this.internals.validity.valid) {\n return;\n }\n /**\n * It could be that a give component hasn't rendered by the time it is first\n * validated. If it hasn't been, wait a bit and add the validationTarget\n * to the setValidity call.\n *\n * TODO: Document the edge case that an element doesn't have a validationTarget\n * and must be focusable some other way\n */\n let tick = 0;\n const id = setInterval(() => {\n if (tick >= 100 || this.validity.valid) {\n clearInterval(id);\n } else if (this.validationTarget) {\n this.internals.setValidity(this.validity, validationMessage, this.validationTarget);\n clearInterval(id);\n }\n tick += 1;\n }, 0);\n }\n }\n\n /** Process the validator message attribute */\n #getValidatorMessageForValue(validator: Validator, value: FormValue): string {\n /** If the validity callback exists and returns, use that as the result */\n if (this.validityCallback) {\n const message = this.validityCallback(validator.key || 'customError');\n\n if (message) {\n return message;\n }\n }\n\n if (validator.message instanceof Function) {\n return (validator.message as validationMessageCallback)(this, value);\n } else {\n return validator.message as string;\n }\n }\n\n /** Reset control state when the form is reset */\n formResetCallback() {\n this.#touched = false;\n this.#forceError = false;\n this.#shouldShowError();\n this.resetFormControl?.();\n\n this.validationMessageCallback?.(\n this.#shouldShowError() ? this.validationMessage : ''\n );\n }\n }\n\n return FormControl as Constructor<FormControlInterface> & TBase;\n}\n", "(function () {\n 'use strict';\n\n const refMap = new WeakMap();\n const validityMap = new WeakMap();\n const hiddenInputMap = new WeakMap();\n const internalsMap = new WeakMap();\n const validationMessageMap = new WeakMap();\n const formsMap = new WeakMap();\n const shadowHostsMap = new WeakMap();\n const formElementsMap = new WeakMap();\n const refValueMap = new WeakMap();\n const upgradeMap = new WeakMap();\n const shadowRootMap = new WeakMap();\n const validationAnchorMap = new WeakMap();\n const documentFragmentMap = new WeakMap();\n const connectedCallbackMap = new WeakMap();\n const validityUpgradeMap = new WeakMap();\n\n const aom = {\n ariaAtomic: 'aria-atomic',\n ariaAutoComplete: 'aria-autocomplete',\n ariaBusy: 'aria-busy',\n ariaChecked: 'aria-checked',\n ariaColCount: 'aria-colcount',\n ariaColIndex: 'aria-colindex',\n ariaColIndexText: 'aria-colindextext',\n ariaColSpan: 'aria-colspan',\n ariaCurrent: 'aria-current',\n ariaDisabled: 'aria-disabled',\n ariaExpanded: 'aria-expanded',\n ariaHasPopup: 'aria-haspopup',\n ariaHidden: 'aria-hidden',\n ariaInvalid: 'aria-invalid',\n ariaKeyShortcuts: 'aria-keyshortcuts',\n ariaLabel: 'aria-label',\n ariaLevel: 'aria-level',\n ariaLive: 'aria-live',\n ariaModal: 'aria-modal',\n ariaMultiLine: 'aria-multiline',\n ariaMultiSelectable: 'aria-multiselectable',\n ariaOrientation: 'aria-orientation',\n ariaPlaceholder: 'aria-placeholder',\n ariaPosInSet: 'aria-posinset',\n ariaPressed: 'aria-pressed',\n ariaReadOnly: 'aria-readonly',\n ariaRelevant: 'aria-relevant',\n ariaRequired: 'aria-required',\n ariaRoleDescription: 'aria-roledescription',\n ariaRowCount: 'aria-rowcount',\n ariaRowIndex: 'aria-rowindex',\n ariaRowIndexText: 'aria-rowindextext',\n ariaRowSpan: 'aria-rowspan',\n ariaSelected: 'aria-selected',\n ariaSetSize: 'aria-setsize',\n ariaSort: 'aria-sort',\n ariaValueMax: 'aria-valuemax',\n ariaValueMin: 'aria-valuemin',\n ariaValueNow: 'aria-valuenow',\n ariaValueText: 'aria-valuetext',\n role: 'role'\n };\n const initAom = (ref, internals) => {\n for (let key in aom) {\n internals[key] = null;\n let closureValue = null;\n const attributeName = aom[key];\n Object.defineProperty(internals, key, {\n get() {\n return closureValue;\n },\n set(value) {\n closureValue = value;\n if (ref.isConnected) {\n ref.setAttribute(attributeName, value);\n }\n else {\n upgradeMap.set(ref, internals);\n }\n }\n });\n }\n };\n\n function initNode(node) {\n const internals = internalsMap.get(node);\n const { form } = internals;\n initForm(node, form, internals);\n initLabels(node, internals.labels);\n }\n const walkFieldset = (node, firstRender = false) => {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n return internalsMap.has(node) ?\n NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n let current = walker.nextNode();\n const isCallNecessary = (!firstRender || node.disabled);\n while (current) {\n if (current.formDisabledCallback && isCallNecessary) {\n setDisabled(current, node.disabled);\n }\n current = walker.nextNode();\n }\n };\n const disabledObserverConfig = { attributes: true, attributeFilter: ['disabled'] };\n const disabledObserver = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n const target = mutation.target;\n if (target.constructor['formAssociated']) {\n setDisabled(target, target.hasAttribute('disabled'));\n }\n else if (target.localName === 'fieldset') {\n walkFieldset(target);\n }\n }\n });\n function observerCallback(mutationList) {\n mutationList.forEach(mutationRecord => {\n const { addedNodes, removedNodes } = mutationRecord;\n const added = Array.from(addedNodes);\n const removed = Array.from(removedNodes);\n added.forEach(node => {\n if (internalsMap.has(node) && node.constructor['formAssociated']) {\n initNode(node);\n }\n if (upgradeMap.has(node)) {\n const internals = upgradeMap.get(node);\n const aomKeys = Object.keys(aom);\n aomKeys\n .filter(key => internals[key] !== null)\n .forEach(key => {\n node.setAttribute(aom[key], internals[key]);\n });\n upgradeMap.delete(node);\n }\n if (validityUpgradeMap.has(node)) {\n const internals = validityUpgradeMap.get(node);\n node.setAttribute('internals-valid', internals.validity.valid.toString());\n node.setAttribute('internals-invalid', (!internals.validity.valid).toString());\n node.setAttribute('aria-invalid', (!internals.validity.valid).toString());\n validityUpgradeMap.delete(node);\n }\n if (node.localName === 'form') {\n const formElements = formElementsMap.get(node);\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n return internalsMap.has(node) && !(formElements && formElements.has(node)) ?\n NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n let current = walker.nextNode();\n while (current) {\n initNode(current);\n current = walker.nextNode();\n }\n }\n if (node.localName === 'fieldset') {\n disabledObserver.observe(node, disabledObserverConfig);\n walkFieldset(node, true);\n }\n });\n removed.forEach(node => {\n const internals = internalsMap.get(node);\n if (internals && hiddenInputMap.get(internals)) {\n removeHiddenInputs(internals);\n }\n if (shadowHostsMap.has(node)) {\n const observer = shadowHostsMap.get(node);\n observer.disconnect();\n }\n });\n });\n }\n function fragmentObserverCallback(mutationList) {\n mutationList.forEach(mutation => {\n const { removedNodes } = mutation;\n removedNodes.forEach(node => {\n const observer = documentFragmentMap.get(mutation.target);\n if (internalsMap.has(node)) {\n upgradeInternals(node);\n }\n observer.disconnect();\n });\n });\n }\n const deferUpgrade = (fragment) => {\n const observer = new MutationObserver(fragmentObserverCallback);\n observer.observe(fragment, { childList: true });\n documentFragmentMap.set(fragment, observer);\n };\n new MutationObserver(observerCallback);\n const observerConfig = {\n childList: true,\n subtree: true\n };\n\n const setDisabled = (ref, disabled) => {\n ref.toggleAttribute('internals-disabled', disabled);\n if (disabled) {\n ref.setAttribute('aria-disabled', 'true');\n }\n else {\n ref.removeAttribute('aria-disabled');\n }\n if (ref.formDisabledCallback) {\n ref.formDisabledCallback.apply(ref, [disabled]);\n }\n };\n const removeHiddenInputs = (internals) => {\n const hiddenInputs = hiddenInputMap.get(internals);\n hiddenInputs.forEach(hiddenInput => {\n hiddenInput.remove();\n });\n hiddenInputMap.set(internals, []);\n };\n const createHiddenInput = (ref, internals) => {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = ref.getAttribute('name');\n ref.after(input);\n hiddenInputMap.get(internals).push(input);\n return input;\n };\n const initRef = (ref, internals) => {\n hiddenInputMap.set(internals, []);\n disabledObserver.observe(ref, disabledObserverConfig);\n };\n const initLabels = (ref, labels) => {\n if (labels.length) {\n Array.from(labels).forEach(label => label.addEventListener('click', ref.click.bind(ref)));\n let firstLabelId = labels[0].id;\n if (!labels[0].id) {\n firstLabelId = `${labels[0].htmlFor}_Label`;\n labels[0].id = firstLabelId;\n }\n ref.setAttribute('aria-labelledby', firstLabelId);\n }\n };\n const setFormValidity = (form) => {\n const nativeControlValidity = Array.from(form.elements)\n .filter((element) => !element.tagName.includes('-') && element.validity)\n .map((element) => element.validity.valid);\n const polyfilledElements = formElementsMap.get(form) || [];\n const polyfilledValidity = Array.from(polyfilledElements)\n .filter(control => control.isConnected)\n .map((control) => internalsMap.get(control).validity.valid);\n const hasInvalid = [...nativeControlValidity, ...polyfilledValidity].includes(false);\n form.toggleAttribute('internals-invalid', hasInvalid);\n form.toggleAttribute('internals-valid', !hasInvalid);\n };\n const formInputCallback = (event) => {\n setFormValidity(findParentForm(event.target));\n };\n const formChangeCallback = (event) => {\n setFormValidity(findParentForm(event.target));\n };\n const wireSubmitLogic = (form) => {\n const SUBMIT_BUTTON_SELECTOR = ':is(:is(button, input)[type=submit], button:not([type])):not([disabled])';\n let submitButtonSelector = `${SUBMIT_BUTTON_SELECTOR}:not([form])`;\n if (form.id) {\n submitButtonSelector += `,${SUBMIT_BUTTON_SELECTOR}[form='${form.id}']`;\n }\n form.addEventListener('click', event => {\n const target = event.target;\n if (target.closest(submitButtonSelector)) {\n const elements = formElementsMap.get(form);\n if (form.noValidate) {\n return;\n }\n if (elements.size) {\n const nodes = Array.from(elements);\n const validityList = nodes\n .reverse()\n .map(node => {\n const internals = internalsMap.get(node);\n return internals.reportValidity();\n });\n if (validityList.includes(false)) {\n event.preventDefault();\n }\n }\n }\n });\n };\n const formResetCallback = (event) => {\n const elements = formElementsMap.get(event.target);\n if (elements && elements.size) {\n elements.forEach(element => {\n if (element.constructor.formAssociated && element.formResetCallback) {\n element.formResetCallback.apply(element);\n }\n });\n }\n };\n const initForm = (ref, form, internals) => {\n if (form) {\n const formElements = formElementsMap.get(form);\n if (formElements) {\n formElements.add(ref);\n }\n else {\n const initSet = new Set();\n initSet.add(ref);\n formElementsMap.set(form, initSet);\n wireSubmitLogic(form);\n form.addEventListener('reset', formResetCallback);\n form.addEventListener('input', formInputCallback);\n form.addEventListener('change', formChangeCallback);\n }\n formsMap.set(form, { ref, internals });\n if (ref.constructor['formAssociated'] && ref.formAssociatedCallback) {\n setTimeout(() => {\n ref.formAssociatedCallback.apply(ref, [form]);\n }, 0);\n }\n setFormValidity(form);\n }\n };\n const findParentForm = (elem) => {\n let parent = elem.parentNode;\n if (parent && parent.tagName !== 'FORM') {\n parent = findParentForm(parent);\n }\n return parent;\n };\n const throwIfNotFormAssociated = (ref, message, ErrorType = DOMException) => {\n if (!ref.constructor['formAssociated']) {\n throw new ErrorType(message);\n }\n };\n const overrideFormMethod = (form, returnValue, method) => {\n const elements = formElementsMap.get(form);\n if (elements && elements.size) {\n elements.forEach(element => {\n const internals = internalsMap.get(element);\n const valid = internals[method]();\n if (!valid) {\n returnValue = false;\n }\n });\n }\n return returnValue;\n };\n const upgradeInternals = (ref) => {\n if (ref.constructor['formAssociated']) {\n const internals = internalsMap.get(ref);\n const { labels, form } = internals;\n initLabels(ref, labels);\n initForm(ref, form, internals);\n }\n };\n\n class ValidityState {\n constructor() {\n this.badInput = false;\n this.customError = false;\n this.patternMismatch = false;\n this.rangeOverflow = false;\n this.rangeUnderflow = false;\n this.stepMismatch = false;\n this.tooLong = false;\n this.tooShort = false;\n this.typeMismatch = false;\n this.valid = true;\n this.valueMissing = false;\n Object.seal(this);\n }\n }\n const setValid = (validityObject) => {\n validityObject.badInput = false;\n validityObject.customError = false;\n validityObject.patternMismatch = false;\n validityObject.rangeOverflow = false;\n validityObject.rangeUnderflow = false;\n validityObject.stepMismatch = false;\n validityObject.tooLong = false;\n validityObject.tooShort = false;\n validityObject.typeMismatch = false;\n validityObject.valid = true;\n validityObject.valueMissing = false;\n return validityObject;\n };\n const reconcileValidity = (validityObject, newState, form) => {\n validityObject.valid = isValid(newState);\n Object.keys(newState).forEach(key => validityObject[key] = newState[key]);\n if (form) {\n setFormValidity(form);\n }\n return validityObject;\n };\n const isValid = (validityState) => {\n let valid = true;\n for (let key in validityState) {\n if (key !== 'valid' && validityState[key] !== false) {\n valid = false;\n }\n }\n return valid;\n };\n\n const customStateMap = new WeakMap();\n class CustomStateSet extends Set {\n static get isPolyfilled() {\n return true;\n }\n constructor(ref) {\n super();\n if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) {\n throw new TypeError('Illegal constructor');\n }\n customStateMap.set(this, ref);\n }\n add(state) {\n if (!/^--/.test(state) || typeof state !== 'string') {\n throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${state} must start with '--'.`);\n }\n const result = super.add(state);\n const ref = customStateMap.get(this);\n ref.toggleAttribute(`state${state}`, true);\n if (ref.part) {\n ref.part.add(`state${state}`);\n }\n return result;\n }\n clear() {\n for (let [entry] of this.entries()) {\n this.delete(entry);\n }\n super.clear();\n }\n delete(state) {\n const result = super.delete(state);\n const ref = customStateMap.get(this);\n ref.toggleAttribute(`state${state}`, false);\n if (ref.part) {\n ref.part.remove(`state${state}`);\n }\n return result;\n }\n }\n\n function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n }\n function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n }\n\n var _HTMLFormControlsCollection_elements;\n class HTMLFormControlsCollection {\n constructor(elements) {\n _HTMLFormControlsCollection_elements.set(this, void 0);\n __classPrivateFieldSet(this, _HTMLFormControlsCollection_elements, elements, \"f\");\n for (let i = 0; i < elements.length; i++) {\n let element = elements[i];\n this[i] = element;\n if (element.hasAttribute('name')) {\n this[element.getAttribute('name')] = element;\n }\n }\n Object.freeze(this);\n }\n get length() {\n return __classPrivateFieldGet(this, _HTMLFormControlsCollection_elements, \"f\").length;\n }\n [(_HTMLFormControlsCollection_elements = new WeakMap(), Symbol.iterator)]() {\n return __classPrivateFieldGet(this, _HTMLFormControlsCollection_elements, \"f\")[Symbol.iterator]();\n }\n item(i) {\n return this[i] == null ? null : this[i];\n }\n namedItem(name) {\n return this[name] == null ? null : this[name];\n }\n }\n\n class ElementInternals {\n static get isPolyfilled() {\n return true;\n }\n constructor(ref) {\n if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) {\n throw new TypeError('Illegal constructor');\n }\n const rootNode = ref.getRootNode();\n const validity = new ValidityState();\n this.states = new CustomStateSet(ref);\n refMap.set(this, ref);\n validityMap.set(this, validity);\n internalsMap.set(ref, this);\n initAom(ref, this);\n initRef(ref, this);\n Object.seal(this);\n upgradeInternals(ref);\n if (rootNode instanceof DocumentFragment) {\n deferUpgrade(rootNode);\n }\n }\n checkValidity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!this.willValidate) {\n return true;\n }\n const validity = validityMap.get(this);\n if (!validity.valid) {\n const validityEvent = new Event('invalid', {\n bubbles: false,\n cancelable: true,\n composed: false\n });\n ref.dispatchEvent(validityEvent);\n }\n return validity.valid;\n }\n get form() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n let form;\n if (ref.constructor['formAssociated'] === true) {\n form = findParentForm(ref);\n }\n return form;\n }\n get labels() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n const id = ref.getAttribute('id');\n const hostRoot = ref.getRootNode();\n if (hostRoot && id) {\n return hostRoot.querySelectorAll(`[for=\"${id}\"]`);\n }\n return [];\n }\n reportValidity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!this.willValidate) {\n return true;\n }\n const valid = this.checkValidity();\n const anchor = validationAnchorMap.get(this);\n if (anchor && !ref.constructor['formAssociated']) {\n throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n }\n if (!valid && anchor) {\n ref.focus();\n anchor.focus();\n }\n return valid;\n }\n setFormValue(value) {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`);\n removeHiddenInputs(this);\n if (value != null && !(value instanceof FormData)) {\n if (ref.getAttribute('name')) {\n const hiddenInput = createHiddenInput(ref, this);\n hiddenInput.value = value;\n }\n }\n else if (value != null && value instanceof FormData) {\n Array.from(value).reverse().forEach(([formDataKey, formDataValue]) => {\n if (typeof formDataValue === 'string') {\n const hiddenInput = createHiddenInput(ref, this);\n hiddenInput.name = formDataKey;\n hiddenInput.value = formDataValue;\n }\n });\n }\n refValueMap.set(ref, value);\n }\n setValidity(validityChanges, validationMessage, anchor) {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!validityChanges) {\n throw new TypeError('Failed to execute \\'setValidity\\' on \\'ElementInternals\\': 1 argument required, but only 0 present.');\n }\n validationAnchorMap.set(this, anchor);\n const validity = validityMap.get(this);\n const validityChangesObj = {};\n for (const key in validityChanges) {\n validityChangesObj[key] = validityChanges[key];\n }\n if (Object.keys(validityChangesObj).length === 0) {\n setValid(validity);\n }\n const check = { ...validity, ...validityChangesObj };\n delete check.valid;\n const { valid } = reconcileValidity(validity, check, this.form);\n if (!valid && !validationMessage) {\n throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);\n }\n validationMessageMap.set(this, valid ? '' : validationMessage);\n if (ref.isConnected) {\n ref.toggleAttribute('internals-invalid', !valid);\n ref.toggleAttribute('internals-valid', valid);\n ref.setAttribute('aria-invalid', `${!valid}`);\n }\n else {\n validityUpgradeMap.set(ref, this);\n }\n }\n get shadowRoot() {\n const ref = refMap.get(this);\n const shadowRoot = shadowRootMap.get(ref);\n if (shadowRoot) {\n return shadowRoot;\n }\n return null;\n }\n get validationMessage() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n return validationMessageMap.get(this);\n }\n get validity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n const validity = validityMap.get(this);\n return validity;\n }\n get willValidate() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n if ((ref.disabled || ref.hasAttribute('disabled')) ||\n ref.hasAttribute('readonly')) {\n return false;\n }\n return true;\n }\n }\n function isElementInternalsSupported() {\n if (!window.ElementInternals || !HTMLElement.prototype.attachInternals) {\n return false;\n }\n class ElementInternalsFeatureDetection extends HTMLElement {\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n }\n const randomName = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, '')}`;\n customElements.define(randomName, ElementInternalsFeatureDetection);\n const featureDetectionElement = new ElementInternalsFeatureDetection();\n return [\n 'shadowRoot',\n 'form',\n 'willValidate',\n 'validity',\n 'validationMessage',\n 'labels',\n 'setFormValue',\n 'setValidity',\n 'checkValidity',\n 'reportValidity'\n ].every(prop => prop in featureDetectionElement.internals);\n }\n if (!isElementInternalsSupported()) {\n window.ElementInternals = ElementInternals;\n const define = customElements.define;\n customElements.define = function (name, constructor, options) {\n if (constructor.formAssociated) {\n const connectedCallback = constructor.prototype.connectedCallback;\n constructor.prototype.connectedCallback = function () {\n if (!connectedCallbackMap.has(this)) {\n connectedCallbackMap.set(this, true);\n if (this.hasAttribute('disabled')) {\n setDisabled(this, true);\n }\n }\n if (connectedCallback != null) {\n connectedCallback.apply(this);\n }\n };\n }\n define.apply(customElements, [name, constructor, options]);\n };\n function attachShadowObserver(...args) {\n const shadowRoot = attachShadow.apply(this, args);\n const observer = new MutationObserver(observerCallback);\n shadowRootMap.set(this, shadowRoot);\n if (window.ShadyDOM) {\n observer.observe(this, observerConfig);\n }\n else {\n observer.observe(shadowRoot, observerConfig);\n }\n shadowHostsMap.set(this, observer);\n return shadowRoot;\n }\n function checkValidityOverride(...args) {\n let returnValue = checkValidity.apply(this, args);\n return overrideFormMethod(this, returnValue, 'checkValidity');\n }\n function reportValidityOverride(...args) {\n let returnValue = reportValidity.apply(this, args);\n return overrideFormMethod(this, returnValue, 'reportValidity');\n }\n HTMLElement.prototype.attachInternals = function () {\n if (!this.tagName) {\n return {};\n }\n else if (this.tagName.indexOf('-') === -1) {\n throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);\n }\n if (internalsMap.has(this)) {\n throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);\n }\n return new ElementInternals(this);\n };\n const attachShadow = Element.prototype.attachShadow;\n Element.prototype.attachShadow = attachShadowObserver;\n const documentObserver = new MutationObserver(observerCallback);\n documentObserver.observe(document.documentElement, observerConfig);\n const checkValidity = HTMLFormElement.prototype.checkValidity;\n HTMLFormElement.prototype.checkValidity = checkValidityOverride;\n const reportValidity = HTMLFormElement.prototype.reportValidity;\n HTMLFormElement.prototype.reportValidity = reportValidityOverride;\n const { get } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'elements');\n Object.defineProperty(HTMLFormElement.prototype, 'elements', {\n get(...args) {\n const elements = get.call(this, ...args);\n const polyfilledElements = Array.from(formElementsMap.get(this) || []);\n if (polyfilledElements.length === 0) {\n return elements;\n }\n const orderedElements = Array.from(elements).concat(polyfilledElements).sort((a, b) => {\n if (a.compareDocumentPosition) {\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n return 0;\n });\n return new HTMLFormControlsCollection(orderedElements);\n },\n });\n if (!window.CustomStateSet) {\n window.CustomStateSet = CustomStateSet;\n }\n }\n else if (!window.CustomStateSet) {\n window.CustomStateSet = CustomStateSet;\n const attachInternals = HTMLElement.prototype.attachInternals;\n HTMLElement.prototype.attachInternals = function (...args) {\n const internals = attachInternals.call(this, args);\n internals.states = new CustomStateSet(this);\n return internals;\n };\n }\n\n})();\n"],
|
|
5
|
-
"mappings": "0pBAEM,SAAUA,GAEdC,EAAiB,yCACjB,MAAMC,UAAoBD,CAAU,CAsLlC,eAAeE,EAAW,CACxB,MAAM,GAAGA,CAAI,cAvHf,KAAA,UAAY,KAAK,gBAAe,EAMhCC,EAAA,IAAA,KAAW,EAAK,EAMhBC,EAAA,IAAA,KAAc,EAAK,EAOnBC,EAAA,IAAA,KAAW,EAAK,EAGhBC,EAAA,IAA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["FormControlMixin", "SuperClass", "FormControl", "args", "_FormControl_focused", "_FormControl_forceError", "_FormControl_touched", "_FormControl_abortController", "_FormControl_previousAbortController", "_FormControl_value", "_FormControl_onFocus", "__classPrivateFieldSet", "__classPrivateFieldGet", "_FormControl_instances", "_FormControl_shouldShowError", "_FormControl_onBlur", "_FormControl_runValidators", "showError", "_FormControl_onInvalid", "_a", "_FormControl_validationCompleteResolver", "_FormControl_isValidationPending", "_FormControl_validationComplete", "validatorAttributes", "validator", "observedAttributes", "attribute", "name", "oldValue", "newValue", "validators", "value", "valueToUpdate", "resolve", "_b", "rootNode", "selector", "proto", "validity", "asyncValidators", "hasAsyncValidators", "abortController", "validationMessage", "hasChange", "key", "isValid", "isValidatorValid", "_FormControl_getValidatorMessageForValue", "_FormControl_setValidityWithOptionalTarget", "tick", "id", "message", "refMap", "validityMap", "hiddenInputMap", "internalsMap", "validationMessageMap", "formsMap", "shadowHostsMap", "formElementsMap", "refValueMap", "upgradeMap", "shadowRootMap", "validationAnchorMap", "documentFragmentMap", "connectedCallbackMap", "validityUpgradeMap", "aom", "initAom", "ref", "internals", "key", "closureValue", "attributeName", "value", "initNode", "node", "form", "initForm", "initLabels", "walkFieldset", "firstRender", "walker", "current", "isCallNecessary", "setDisabled", "disabledObserverConfig", "disabledObserver", "mutationsList", "mutation", "target", "observerCallback", "mutationList", "mutationRecord", "addedNodes", "removedNodes", "added", "removed", "formElements", "removeHiddenInputs", "fragmentObserverCallback", "observer", "upgradeInternals", "deferUpgrade", "fragment", "observerConfig", "disabled", "hiddenInput", "createHiddenInput", "input", "initRef", "labels", "label", "firstLabelId", "setFormValidity", "nativeControlValidity", "element", "polyfilledElements", "polyfilledValidity", "control", "hasInvalid", "formInputCallback", "event", "findParentForm", "formChangeCallback", "wireSubmitLogic", "SUBMIT_BUTTON_SELECTOR", "submitButtonSelector", "elements", "formResetCallback", "initSet", "elem", "parent", "throwIfNotFormAssociated", "message", "ErrorType", "overrideFormMethod", "returnValue", "method", "ValidityState", "setValid", "validityObject", "reconcileValidity", "newState", "isValid", "validityState", "valid", "customStateMap", "CustomStateSet", "state", "result", "entry", "__classPrivateFieldGet", "receiver", "kind", "f", "__classPrivateFieldSet", "_HTMLFormControlsCollection_elements", "HTMLFormControlsCollection", "i", "name", "ElementInternals", "rootNode", "validity", "validityEvent", "id", "hostRoot", "anchor", "formDataKey", "formDataValue", "validityChanges", "validationMessage", "validityChangesObj", "check", "shadowRoot", "isElementInternalsSupported", "ElementInternalsFeatureDetection", "randomName", "featureDetectionElement", "prop", "attachInternals", "args", "attachShadowObserver", "attachShadow", "checkValidityOverride", "checkValidity", "reportValidityOverride", "reportValidity", "define", "constructor", "options", "connectedCallback", "get", "orderedElements", "a", "b"]
|
|
7
|
-
}
|
package/dist/chunk-7R56R3UM.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{b as f,c as m,e as g,g as _,h as x}from"./chunk-5ODNFE7B.js";import{a as b}from"./chunk-OLPYXE2P.js";import{a as u}from"./chunk-23UFIOHV.js";import{a as c,b as i,f as d,g as v,h as n,i as r,j as a,k as h}from"./chunk-57PTZNIL.js";import{a as l}from"./chunk-NZ3RGSR6.js";var z=c`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--background-color:var(--bl-color-primary-background);--border-color:var(--bl-color-border);--border-focus-color:var(--bl-color-primary-hover);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--label-color:var(--bl-color-content-secondary);--placeholder-color:var(--bl-color-content-tertiary);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-tertiary);--z-index:1;--menu-height:250px}:host([size='large']) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}.placeholder{color:var(--placeholder-color);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}:host([disabled]) .placeholder{--placeholder-color:var(--bl-color-content-passive)}.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-hover);--label-color:var(--bl-color-danger)}.select-input{display:flex;align-items:center;justify-content:space-between;cursor:pointer;outline:0;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 var(--padding-horizontal);border-radius:var(--bl-border-radius-s);color:var(--text-color);user-select:none}.remove-all{display:none}.remove-all::after{content:'';position:absolute;left:1.5rem;bottom:4px;height:1rem;border-left:1px solid var(--bl-color-border)}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-secondary)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-content-passive)}.select-open .select-input{border:solid 1px var(--border-focus-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;margin:0;list-style:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:', '}:host([disabled]) .selected-options li{color:var(--bl-color-content-passive)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-2xs);margin-left:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:fixed;border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--z-index);width:100%;top:var(--top);left:var(--left)}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);right:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));max-width:max-content;transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color);padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:where(.select-open,.selected) label{top:0;left:var(--bl-size-2xs);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);padding:0 var(--bl-size-3xs);background-color:var(--bl-color-primary-background);pointer-events:initial;right:var(--padding-horizontal)}:host([label-fixed]) .select-wrapper{padding-top:var(--bl-size-m)}:host([label-fixed]) label{top:0;left:0;right:0;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color)}.help-text,.invalid-text{margin:var(--bl-size-3xs) 0 0 var(--bl-size-2xs);font:var(--bl-font-title-4-regular);padding:var(--bl-size-3xs) var(--bl-input-padding-horizontal)}.help-text{color:var(--bl-color-content-secondary)}.invalid-text{color:var(--bl-color-danger)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}`,O=z;var o=class extends d{constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.multiple=!1;this.labelFixed=!1;this._isPopoverOpen=!1;this._selectedOptions=[];this._additionalSelectedOptionCount=0;this._isInvalid=!1;this._connectedOptions=[];this._cleanUpPopover=null;this._clickOutsideHandler=e=>{var s;let t=e.composedPath();(s=t==null?void 0:t.find(p=>p.tagName==="BL-SELECT"))!=null&&s.contains(this)||(this.close(),this._checkRequired())}}static get styles(){return[O]}get options(){return this._connectedOptions}get opened(){return this._isPopoverOpen}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}get isInvalid(){return this._isInvalid}open(){this._isPopoverOpen=!0,this._setupPopover(),document.addEventListener("click",this._clickOutsideHandler)}close(){this._isPopoverOpen=!1,this._cleanUpPopover&&this._cleanUpPopover(),document.removeEventListener("click",this._clickOutsideHandler)}_setupPopover(){this._cleanUpPopover=_(this._selectInput,this._popover,()=>{x(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[f(),m(8),g({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:t})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${t}px`)})})}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){let e=i`<ul class="selected-options">
|
|
2
|
-
${this._selectedOptions.map(y=>i`<li>${y.text}</li>`)}
|
|
3
|
-
</ul>`,t=this._additionalSelectedOptionCount?i`<span>+${this._additionalSelectedOptionCount}</span>`:null,s=i`<bl-button
|
|
4
|
-
class="remove-all"
|
|
5
|
-
size="small"
|
|
6
|
-
variant="tertiary"
|
|
7
|
-
kind="neutral"
|
|
8
|
-
icon="close"
|
|
9
|
-
@click=${this._onClickRemove}></bl-button>`,p=this._showPlaceHolder?i`<span class="placeholder">${this.placeholder}</span>`:"";return i`<div
|
|
10
|
-
class="select-input"
|
|
11
|
-
?disabled=${this.disabled}
|
|
12
|
-
@click=${this._onClickSelectInput}
|
|
13
|
-
>
|
|
14
|
-
${p} ${e} ${t}
|
|
15
|
-
<div class="actions">
|
|
16
|
-
${this.multiple?s:null}
|
|
17
|
-
<bl-icon
|
|
18
|
-
class="dropdown-icon open"
|
|
19
|
-
name="arrow_up"
|
|
20
|
-
></bl-icon>
|
|
21
|
-
|
|
22
|
-
<bl-icon
|
|
23
|
-
class="dropdown-icon closed"
|
|
24
|
-
name="arrow_down"
|
|
25
|
-
></bl-icon>
|
|
26
|
-
</div>
|
|
27
|
-
</div>`}menuTemplate(){return i`<div class="popover" @bl-select-option=${this._handleSelectOptionEvent}>
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</div>`}render(){let e=this._isInvalid&&this.customInvalidText?i`<p class="invalid-text">${this.customInvalidText}</p>`:"",t=this.helpText&&!e?i`<p class="help-text">${this.helpText}</p>`:"",s=this.label?i`<label>${this.label}</label>`:"";return i`<div
|
|
30
|
-
class=${b({"select-wrapper":!0,"select-open":this.opened,selected:this._selectedOptions.length>0,invalid:this._isInvalid})}
|
|
31
|
-
tabindex="-1"
|
|
32
|
-
>
|
|
33
|
-
${s} ${this.inputTemplate()} ${this.menuTemplate()} ${t} ${e}
|
|
34
|
-
</div> `}get _showPlaceHolder(){return this.label&&!this.labelFixed?!this._selectedOptions.length&&this._isPopoverOpen:!this._selectedOptions.length}_onClickSelectInput(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){this._onBlSelect(this._selectedOptions)}_handleSingleSelect(e){let t=this._connectedOptions.find(s=>s.value!==e.value&&s.selected);t&&(t.selected=!1),this._selectedOptions=[e],this._handleSelectEvent(),this._isPopoverOpen=!1}_handleMultipleSelect(e){let{value:t}=e;e.selected?this._selectedOptions=[...this._selectedOptions,e]:this._selectedOptions=this._selectedOptions.filter(s=>s.value!==t),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.detail;this.multiple?this._handleMultipleSelect(t):this._handleSingleSelect(t)}_onClickRemove(e){e.stopPropagation(),this._connectedOptions.filter(t=>t.selected).forEach(t=>{t.selected=!1}),this._selectedOptions=[],this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple)return;let e=0;for(let t of this._selectedOptionsItems)if(t.offsetLeft<this._selectedOptionsContainer.offsetWidth)e++;else break;this._additionalSelectedOptionCount=this._selectedOptionsItems.length-e}_checkRequired(){this.required&&(this._isInvalid=this._selectedOptions.length===0)}updated(e){e.has("_selectedOptions")&&e.get("_selectedOptions")instanceof Array?(this._checkRequired(),this._checkAdditionalItemCount()):e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this._connectedOptions.forEach(t=>{t.multiple=this.multiple,t.selected=!1}),this._selectedOptions=[])}registerOption(e){if(this._connectedOptions.push(e),e.selected){let t={value:e.value,text:e.textContent,selected:e.selected};this.multiple?this._selectedOptions=[...this._selectedOptions,t]:this._selectedOptions=[t],this.requestUpdate()}}unregisterOption(e){this._connectedOptions.splice(this._connectedOptions.indexOf(e),1),this._selectedOptions=this._selectedOptions.filter(t=>t.value!==e.value)}};l([n({reflect:!0})],o.prototype,"label",2),l([n({})],o.prototype,"placeholder",2),l([n({type:String,reflect:!0})],o.prototype,"size",2),l([n({type:Boolean})],o.prototype,"required",2),l([n({type:Boolean,reflect:!0})],o.prototype,"disabled",2),l([n({type:Boolean})],o.prototype,"multiple",2),l([n({type:Boolean,attribute:"label-fixed",reflect:!0})],o.prototype,"labelFixed",2),l([n({type:String,attribute:"help-text"})],o.prototype,"helpText",2),l([n({type:String,attribute:"invalid-text"})],o.prototype,"customInvalidText",2),l([r()],o.prototype,"_isPopoverOpen",2),l([r()],o.prototype,"_selectedOptions",2),l([r()],o.prototype,"_additionalSelectedOptionCount",2),l([r()],o.prototype,"_isInvalid",2),l([a(".selected-options")],o.prototype,"_selectedOptionsContainer",2),l([h(".selected-options li")],o.prototype,"_selectedOptionsItems",2),l([a(".popover")],o.prototype,"_popover",2),l([a(".select-input")],o.prototype,"_selectInput",2),l([u("bl-select")],o.prototype,"_onBlSelect",2),o=l([v("bl-select")],o);export{o as a};
|
|
35
|
-
//# sourceMappingURL=chunk-7R56R3UM.js.map
|