@telia-ace/alliance-ui 1.0.9 → 1.0.10-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/chunks/alliance-link-2b1c9985.js +290 -0
- package/chunks/alliance-link-2b1c9985.js.map +1 -0
- package/chunks/alliance-modal-06ec7d6a.js +1 -1
- package/chunks/close-7d423291.js.map +1 -1
- package/chunks/close-ac6e4f1c.js.map +1 -1
- package/chunks/telia-text-input2-db9121d9.js +169 -0
- package/chunks/telia-text-input2-db9121d9.js.map +1 -0
- package/components/alliance-link/alliance-link.d.ts +27 -0
- package/components/alliance-link/index.d.ts +1 -0
- package/components/alliance-link.js +3 -0
- package/components/alliance-link.js.map +1 -0
- package/components/alliance-modal.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +2 -1
- package/components/index.js.map +1 -1
- package/package.json +7 -8
- package/voca/components/telia-counter-badge.d.ts +1 -0
- package/voca/components/telia-counter-badge.js +45 -0
- package/voca/components/telia-counter-badge.js.map +1 -0
- package/voca/components/telia-date-picker.js +1 -1
- package/voca/components/telia-notification.js +1 -1
- package/voca/components/telia-search-input.d.ts +1 -0
- package/voca/components/telia-search-input.js +134 -0
- package/voca/components/telia-search-input.js.map +1 -0
- package/voca/components/telia-text-input.js +11 -166
- package/voca/components/telia-text-input.js.map +1 -1
- package/voca/icons/index.js +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SerializeableObject } from '@telia-ace/alliance-utilities/frontend';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
export declare class Link extends LitElement {
|
|
4
|
+
capability: string;
|
|
5
|
+
app: string;
|
|
6
|
+
args: SerializeableObject;
|
|
7
|
+
/**
|
|
8
|
+
* Link properties
|
|
9
|
+
*/
|
|
10
|
+
href?: string;
|
|
11
|
+
target?: string;
|
|
12
|
+
rel?: string;
|
|
13
|
+
download?: string;
|
|
14
|
+
navigate: () => void;
|
|
15
|
+
clickHandler: (event: MouseEvent) => void;
|
|
16
|
+
updateActive: () => void;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
attributeChangedCallback(_1: string, _2: string | null, _3: string | null): void;
|
|
20
|
+
/**
|
|
21
|
+
* Internal properties
|
|
22
|
+
*/
|
|
23
|
+
private _href;
|
|
24
|
+
private active;
|
|
25
|
+
private computeHref;
|
|
26
|
+
render(): import("lit").TemplateResult<1>;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './alliance-link';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alliance-link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -8,5 +8,5 @@ import "../chunks/getSvgContent-f2389ce0.js";
|
|
|
8
8
|
import "../chunks/telia-vst2-dfb33a56.js";
|
|
9
9
|
import "../chunks/telia-heading2-38ae44ae.js";
|
|
10
10
|
import "../chunks/index-d925c796.js";
|
|
11
|
-
import "../chunks/close-
|
|
11
|
+
import "../chunks/close-7d423291.js";
|
|
12
12
|
//# sourceMappingURL=alliance-modal.js.map
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../chunks/alliance-link-2b1c9985.js";
|
|
1
2
|
import "../chunks/alliance-modal-06ec7d6a.js";
|
|
2
3
|
import "../chunks/alliance-paginator-button-4cc1a5cf.js";
|
|
3
4
|
import "../chunks/alliance-table-row-ec104b1e.js";
|
|
@@ -10,7 +11,7 @@ import "../chunks/getSvgContent-f2389ce0.js";
|
|
|
10
11
|
import "../chunks/telia-vst2-dfb33a56.js";
|
|
11
12
|
import "../chunks/telia-heading2-38ae44ae.js";
|
|
12
13
|
import "../chunks/index-d925c796.js";
|
|
13
|
-
import "../chunks/close-
|
|
14
|
+
import "../chunks/close-7d423291.js";
|
|
14
15
|
import "../chunks/variables-ecb680f0.js";
|
|
15
16
|
import "../chunks/telia-label2-f4c1eb47.js";
|
|
16
17
|
import "../chunks/chevron-right-788ce8a9.js";
|
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/alliance-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10-next.1",
|
|
4
4
|
"description": "UI components used by ACE Alliance apps.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"exports": {
|
|
18
18
|
"./components": {
|
|
19
19
|
"types": "./components/index.d.ts",
|
|
20
|
-
"import": "./components/index"
|
|
20
|
+
"import": "./components/index.js"
|
|
21
21
|
},
|
|
22
22
|
"./components/*": {
|
|
23
23
|
"types": "./components/*/index.d.ts",
|
|
24
|
-
"import": "./components
|
|
24
|
+
"import": "./components/*.js"
|
|
25
25
|
},
|
|
26
26
|
"./voca/components/*": {
|
|
27
27
|
"types": "./voca/components/*.d.ts",
|
|
28
|
-
"import": "./voca/components
|
|
28
|
+
"import": "./voca/components/*.js"
|
|
29
29
|
},
|
|
30
30
|
"./voca/icons": {
|
|
31
31
|
"types": "./voca/icons/index.d.ts",
|
|
32
|
-
"import": "./voca/icons/index"
|
|
32
|
+
"import": "./voca/icons/index.js"
|
|
33
33
|
},
|
|
34
34
|
"./voca/foundations": {
|
|
35
35
|
"types": "./voca/foundations/index.d.ts",
|
|
36
|
-
"import": "./voca/foundations/index"
|
|
36
|
+
"import": "./voca/foundations/index.js"
|
|
37
37
|
},
|
|
38
38
|
"./voca/foundations/component-library-styling": {
|
|
39
39
|
"types": "./voca/foundations/component-library-styling.d.ts",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@telia-ace/alliance-
|
|
45
|
-
"@telia-ace/alliance-utilities": "1.0.9",
|
|
44
|
+
"@telia-ace/alliance-utilities": "1.0.10-next.2",
|
|
46
45
|
"@teliads/components": "^21.3.1",
|
|
47
46
|
"@types/fs-extra": "^11.0.1",
|
|
48
47
|
"fs-extra": "^11.1.1",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@teliads/components/dist/components/telia-counter-badge';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { p as l, H as i, h as a, a as r } from "../../chunks/index-eef143db.js";
|
|
2
|
+
import { d as s } from "../../chunks/telia-vst2-dfb33a56.js";
|
|
3
|
+
const n = '.telia-counter-badge{background-color:#5e0092;border-radius:calc(99.9rem * var(--voca-rem-multiplier));font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:500;font-size:calc(1.2rem * var(--voca-rem-multiplier));color:#ffffff;display:inline-block;line-height:1;width:calc(1.4rem * var(--voca-rem-multiplier));max-height:calc(1.4rem * var(--voca-rem-multiplier));padding:calc(0.1rem * var(--voca-rem-multiplier)) calc(0.4rem * var(--voca-rem-multiplier));text-align:center}.telia-counter-badge--long{width:auto}.telia-counter-badge--placeholder{display:flex;justify-content:center;align-items:center}', o = /* @__PURE__ */ l(class extends i {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(), this.__registerHost(), this.__attachShadow(), this.value = 0, this.allyLabel = null, this.dataTrackingId = "telia-counter-badge";
|
|
6
|
+
}
|
|
7
|
+
sanitizeValue(t) {
|
|
8
|
+
const e = Number.parseInt(t);
|
|
9
|
+
if (e > 0)
|
|
10
|
+
return e;
|
|
11
|
+
throw Error("Value needs to be a number (1-9)");
|
|
12
|
+
}
|
|
13
|
+
formatValue(t) {
|
|
14
|
+
return t > 999 ? "999+" : t.toString();
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return a(r, { class: {
|
|
18
|
+
"telia-counter-badge": !!this.value,
|
|
19
|
+
["telia-counter-badge--long"]: this.value > 9
|
|
20
|
+
}, "data-testid": this.dataTestid }, a("span", { class: "telia-counter-badge--placeholder", role: "status", "aria-label": this.allyLabel }, this.formatValue(this.sanitizeValue(this.value))), a("telia-vst", { dataTrackingId: this.dataTrackingId }));
|
|
21
|
+
}
|
|
22
|
+
static get style() {
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
}, [1, "telia-counter-badge", {
|
|
26
|
+
dataTestid: [1, "data-testid"],
|
|
27
|
+
value: [2],
|
|
28
|
+
allyLabel: [1, "ally-label"]
|
|
29
|
+
}]);
|
|
30
|
+
function c() {
|
|
31
|
+
if (typeof customElements > "u")
|
|
32
|
+
return;
|
|
33
|
+
["telia-counter-badge", "telia-vst"].forEach((e) => {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "telia-counter-badge":
|
|
36
|
+
customElements.get(e) || customElements.define(e, o);
|
|
37
|
+
break;
|
|
38
|
+
case "telia-vst":
|
|
39
|
+
customElements.get(e) || s();
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
c();
|
|
45
|
+
//# sourceMappingURL=telia-counter-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telia-counter-badge.js","sources":["../../../../node_modules/.pnpm/@teliads+components@21.3.1/node_modules/@teliads/components/dist/components/telia-counter-badge.js"],"sourcesContent":["import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';\nimport { d as defineCustomElement$2 } from './telia-vst2.js';\n\nconst teliaCounterBadgeCss = \".telia-counter-badge{background-color:#5e0092;border-radius:calc(99.9rem * var(--voca-rem-multiplier));font-family:\\\"TeliaSans\\\", Helvetica, Arial, \\\"Lucida Grande\\\", sans-serif;font-weight:500;font-size:calc(1.2rem * var(--voca-rem-multiplier));color:#ffffff;display:inline-block;line-height:1;width:calc(1.4rem * var(--voca-rem-multiplier));max-height:calc(1.4rem * var(--voca-rem-multiplier));padding:calc(0.1rem * var(--voca-rem-multiplier)) calc(0.4rem * var(--voca-rem-multiplier));text-align:center}.telia-counter-badge--long{width:auto}.telia-counter-badge--placeholder{display:flex;justify-content:center;align-items:center}\";\n\nconst TeliaCounterBadge$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n /** The numeric value displayed in the badge. */\n this.value = 0;\n /** Describe unclear button context for better accessibility support */\n this.allyLabel = null;\n /** Tracking id is used to identify and count Component usage */\n this.dataTrackingId = 'telia-counter-badge';\n }\n sanitizeValue(value) {\n const integerValue = Number.parseInt(value);\n if (integerValue > 0) {\n return integerValue;\n }\n else {\n throw Error('Value needs to be a number (1-9)');\n }\n }\n formatValue(value) {\n return value > 999 ? '999+' : value.toString();\n }\n render() {\n return (h(Host, { class: {\n 'telia-counter-badge': !!this.value,\n [`telia-counter-badge--long`]: this.value > 9,\n }, \"data-testid\": this.dataTestid }, h(\"span\", { class: \"telia-counter-badge--placeholder\", role: \"status\", \"aria-label\": this.allyLabel }, this.formatValue(this.sanitizeValue(this.value))), h(\"telia-vst\", { dataTrackingId: this.dataTrackingId })));\n }\n static get style() { return teliaCounterBadgeCss; }\n}, [1, \"telia-counter-badge\", {\n \"dataTestid\": [1, \"data-testid\"],\n \"value\": [2],\n \"allyLabel\": [1, \"ally-label\"]\n }]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"telia-counter-badge\", \"telia-vst\"];\n components.forEach(tagName => { switch (tagName) {\n case \"telia-counter-badge\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, TeliaCounterBadge$1);\n }\n break;\n case \"telia-vst\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst TeliaCounterBadge = TeliaCounterBadge$1;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { TeliaCounterBadge, defineCustomElement };\n"],"names":["teliaCounterBadgeCss","TeliaCounterBadge$1","proxyCustomElement","HTMLElement","value","integerValue","h","Host","defineCustomElement$1","tagName","defineCustomElement$2"],"mappings":";;AAGA,MAAMA,IAAuB,ynBAEvBC,IAAoC,gBAAAC,EAAmB,cAAcC,EAAY;AAAA,EACrF,cAAc;AACZ,aACA,KAAK,eAAc,GACnB,KAAK,eAAc,GAEnB,KAAK,QAAQ,GAEb,KAAK,YAAY,MAEjB,KAAK,iBAAiB;AAAA,EACvB;AAAA,EACD,cAAcC,GAAO;AACnB,UAAMC,IAAe,OAAO,SAASD,CAAK;AAC1C,QAAIC,IAAe;AACjB,aAAOA;AAGP,UAAM,MAAM,kCAAkC;AAAA,EAEjD;AAAA,EACD,YAAYD,GAAO;AACjB,WAAOA,IAAQ,MAAM,SAASA,EAAM,SAAQ;AAAA,EAC7C;AAAA,EACD,SAAS;AACP,WAAQE,EAAEC,GAAM,EAAE,OAAO;AAAA,MACrB,uBAAuB,CAAC,CAAC,KAAK;AAAA,MAC9B,CAAC,2BAA2B,GAAG,KAAK,QAAQ;AAAA,IAC7C,GAAE,eAAe,KAAK,WAAU,GAAID,EAAE,QAAQ,EAAE,OAAO,oCAAoC,MAAM,UAAU,cAAc,KAAK,UAAW,GAAE,KAAK,YAAY,KAAK,cAAc,KAAK,KAAK,CAAC,CAAC,GAAGA,EAAE,aAAa,EAAE,gBAAgB,KAAK,eAAc,CAAE,CAAC;AAAA,EACzP;AAAA,EACD,WAAW,QAAQ;AAAE,WAAON;AAAA,EAAuB;AACrD,GAAG,CAAC,GAAG,uBAAuB;AAAA,EAC1B,YAAc,CAAC,GAAG,aAAa;AAAA,EAC/B,OAAS,CAAC,CAAC;AAAA,EACX,WAAa,CAAC,GAAG,YAAY;AAC9B,CAAA,CAAC;AACJ,SAASQ,IAAwB;AAC/B,MAAI,OAAO,iBAAmB;AAC5B;AAGF,EADmB,CAAC,uBAAuB,WAAW,EAC3C,QAAQ,CAAAC,MAAW;AAAE,YAAQA,GAAO;AAAA,MAC7C,KAAK;AACH,QAAK,eAAe,IAAIA,CAAO,KAC7B,eAAe,OAAOA,GAASR,CAAmB;AAEpD;AAAA,MACF,KAAK;AACH,QAAK,eAAe,IAAIQ,CAAO,KAC7BC;AAEF;AAAA,IACH;AAAA,EAAA,CAAE;AACL;AACAF,EAAuB;","x_google_ignoreList":[0]}
|
|
@@ -2,7 +2,7 @@ import { p as G, H as K, c as I, h as i, a as $, F as W } from "../../chunks/ind
|
|
|
2
2
|
import { u as k } from "../../chunks/uniqueId-0daf01ec.js";
|
|
3
3
|
import { s as X } from "../../chunks/stringCombiner-10b57054.js";
|
|
4
4
|
import { c as E } from "../../chunks/chevron-down-50d47dd6.js";
|
|
5
|
-
import { c as j } from "../../chunks/close-
|
|
5
|
+
import { c as j } from "../../chunks/close-ac6e4f1c.js";
|
|
6
6
|
import { d as J } from "../../chunks/telia-button2-7783c019.js";
|
|
7
7
|
import { d as U } from "../../chunks/telia-field-assistive-text2-173ba2fb.js";
|
|
8
8
|
import { d as Q } from "../../chunks/telia-field-error2-75dc8ceb.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as o, H as l, c as n, h as t } from "../../chunks/index-eef143db.js";
|
|
2
2
|
import { c as r } from "../../chunks/check-circle-filled-42095247.js";
|
|
3
|
-
import { c } from "../../chunks/close-
|
|
3
|
+
import { c } from "../../chunks/close-ac6e4f1c.js";
|
|
4
4
|
import { e as s } from "../../chunks/error-filled-8de50bdd.js";
|
|
5
5
|
import { d as m } from "../../chunks/telia-button2-7783c019.js";
|
|
6
6
|
import { d } from "../../chunks/telia-heading2-38ae44ae.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@teliads/components/dist/components/telia-search-input';
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { p as n, H as s, c, h as i } from "../../chunks/index-eef143db.js";
|
|
2
|
+
import { d as u } from "../../chunks/telia-button2-7783c019.js";
|
|
3
|
+
import { d as o } from "../../chunks/telia-field-assistive-text2-173ba2fb.js";
|
|
4
|
+
import { d as p } from "../../chunks/telia-field-error2-75dc8ceb.js";
|
|
5
|
+
import { d as h } from "../../chunks/telia-field-valid2-0f6759ac.js";
|
|
6
|
+
import { d as m } from "../../chunks/telia-icon2-d0e7c715.js";
|
|
7
|
+
import { d } from "../../chunks/telia-label2-f4c1eb47.js";
|
|
8
|
+
import { d as v } from "../../chunks/telia-text-input2-db9121d9.js";
|
|
9
|
+
import { d as b } from "../../chunks/telia-vst2-dfb33a56.js";
|
|
10
|
+
import "../../chunks/error-filled-8de50bdd.js";
|
|
11
|
+
import "../../chunks/check-circle-filled-42095247.js";
|
|
12
|
+
import "../../chunks/getSvgContent-f2389ce0.js";
|
|
13
|
+
import "../../chunks/uniqueId-0daf01ec.js";
|
|
14
|
+
import "../../chunks/stringCombiner-10b57054.js";
|
|
15
|
+
const a = {
|
|
16
|
+
DEFAULT: "default",
|
|
17
|
+
SIMPLE: "simple",
|
|
18
|
+
ADVANCED: "advanced"
|
|
19
|
+
};
|
|
20
|
+
Object.values(a);
|
|
21
|
+
const r = {
|
|
22
|
+
PRIMARY: "primary",
|
|
23
|
+
SECONDARY: "secondary",
|
|
24
|
+
EXPRESSIVE: "expressive",
|
|
25
|
+
DESTRUCTIVE: "destructive",
|
|
26
|
+
TERTIARY_PURPLE: "tertiary-purple",
|
|
27
|
+
TEXT: "text",
|
|
28
|
+
PRIMARY_WHITE: "primary-white",
|
|
29
|
+
SECONDARY_WHITE: "secondary-white",
|
|
30
|
+
EXPRESSIVE_WHITE: "expressive-white"
|
|
31
|
+
};
|
|
32
|
+
Object.values(r);
|
|
33
|
+
const _ = ":host{--right-padding-default:calc(12rem * var(--voca-rem-multiplier));--right-padding-simple:calc(6.5rem * var(--voca-rem-multiplier));--right-padding-advanced:calc(12.1rem * var(--voca-rem-multiplier))}.telia-search-input{position:relative}.telia-search-input__leading-icon{color:rgba(0, 0, 0, 0.6);position:absolute;bottom:calc((1.6rem * var(--voca-rem-multiplier)) - (0.2rem * var(--voca-rem-multiplier)));left:calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input--isDisabled .telia-search-input__leading-icon{color:rgba(0, 0, 0, 0.4)}.telia-search-input--hasInput .telia-search-input__leading-icon,.telia-search-input--hasInput~.telia-search-input__leading-icon,.telia-search-input telia-text-input:focus-within .telia-search-input__leading-icon,.telia-search-input telia-text-input:focus-within~.telia-search-input__leading-icon{display:none}.telia-search-input .telia-search-input__input input::placeholder{color:rgba(0, 0, 0, 0.6);opacity:1}.telia-search-input .telia-search-input__input input:disabled::placeholder{color:rgba(0, 0, 0, 0.4)}.telia-search-input--simple .telia-search-input__input input::placeholder,.telia-search-input--advanced .telia-search-input__input input::placeholder{padding-left:calc(2rem * var(--voca-rem-multiplier))}.telia-search-input .telia-text-input__input{height:calc(4.4rem * var(--voca-rem-multiplier));padding:calc((0.8rem * var(--voca-rem-multiplier)) + (0.2rem * var(--voca-rem-multiplier))) calc(0.8rem * var(--voca-rem-multiplier));margin-top:0}.telia-search-input .telia-text-input__input:hover{padding:calc((0.8rem * var(--voca-rem-multiplier)) + (0.2rem * var(--voca-rem-multiplier))) calc((0.8rem * var(--voca-rem-multiplier)) - (0.1rem * var(--voca-rem-multiplier)))}.telia-search-input .telia-text-input__input:focus,.telia-search-input .telia-text-input__input:disabled:hover{padding:calc((0.8rem * var(--voca-rem-multiplier)) + (0.2rem * var(--voca-rem-multiplier))) calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input .telia-text-input__input:focus-within::placeholder{padding-left:0}.telia-search-input--default .telia-text-input__input,.telia-search-input--default .telia-text-input__input:hover,.telia-search-input--default .telia-text-input__input:focus{padding-right:var(--right-padding-default, calc(10.5rem * var(--voca-rem-multiplier)))}.telia-search-input--simple .telia-text-input__input,.telia-search-input--simple .telia-text-input__input:hover,.telia-search-input--simple .telia-text-input__input:focus{padding-right:var(--right-padding-simple, calc(5.5rem * var(--voca-rem-multiplier)))}.telia-search-input--advanced .telia-text-input__input,.telia-search-input--advanced .telia-text-input__input:hover,.telia-search-input--advanced .telia-text-input__input:focus{padding-right:var(--right-padding-advanced, calc(13.5rem * var(--voca-rem-multiplier)))}.telia-search-input__button-wrapper{display:flex;position:absolute;bottom:0;right:calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input__button-wrapper .telia-search-input__search-button:last-child:not(:only-child){margin-left:calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input__button-wrapper .telia-button--text.telia-button--sm.telia-button--icon-only,.telia-search-input__button-wrapper .telia-search-input__reset-input-button .telia-button--text.telia-button--sm{padding:calc((1.6rem * var(--voca-rem-multiplier)) - (0.2rem * var(--voca-rem-multiplier))) calc(1.6rem * var(--voca-rem-multiplier))}.telia-search-input--advanced .telia-search-input__button-wrapper .telia-search-input__search-button .telia-button.telia-button--text.telia-button--sm:not(.telia-button--icon-only){padding:calc((1.6rem * var(--voca-rem-multiplier)) - (0.2rem * var(--voca-rem-multiplier))) 0}", f = /* @__PURE__ */ n(class extends s {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(), this.__registerHost(), this.__attachShadow(), this.vocaSearchButtonClicked = c(this, "vocaSearchButtonClicked", 7), this.placeholder = "Search...", this.variant = a.DEFAULT, this.ariaLabel = null, this.searchButtonText = "Search", this.searchButtonAriaLabel = "Search button", this.resetInputButtonAriaLabel = "Reset input button", this.disabled = !1, this.inputValue = "", this.classname = "telia-search-input", this.leadingIconVariants = [
|
|
36
|
+
a.SIMPLE,
|
|
37
|
+
a.ADVANCED
|
|
38
|
+
], this.searchButtonVariants = [
|
|
39
|
+
a.DEFAULT,
|
|
40
|
+
a.ADVANCED
|
|
41
|
+
], this.matchVariant = (e) => e.includes(this.variant), this.handleInput = (e) => {
|
|
42
|
+
this.inputValue = e.target.value;
|
|
43
|
+
}, this.handleResetInput = () => {
|
|
44
|
+
var e;
|
|
45
|
+
this.inputValue = "", (e = this.inputElement.querySelector("input")) === null || e === void 0 || e.focus();
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
renderIcon(e, t, l = !1) {
|
|
49
|
+
return i("telia-icon", { name: e, size: "sm", class: t, "aria-hidden": l });
|
|
50
|
+
}
|
|
51
|
+
renderResetInputButton() {
|
|
52
|
+
return i("telia-button", { variant: "text", size: "sm", class: `${this.classname}__reset-input-button`, onClick: this.handleResetInput, allyLabel: this.resetInputButtonAriaLabel, disabled: this.disabled }, this.renderIcon("close"));
|
|
53
|
+
}
|
|
54
|
+
renderSearchButton() {
|
|
55
|
+
const e = {
|
|
56
|
+
variant: r.TEXT,
|
|
57
|
+
size: "sm",
|
|
58
|
+
class: `${this.classname}__search-button`,
|
|
59
|
+
disabled: this.disabled,
|
|
60
|
+
allyLabel: this.searchButtonAriaLabel,
|
|
61
|
+
onClick: (t) => {
|
|
62
|
+
this.vocaSearchButtonClicked.emit({ value: this.inputValue, event: t });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
switch (this.variant) {
|
|
66
|
+
case a.DEFAULT:
|
|
67
|
+
return i("telia-button", Object.assign({}, e), this.renderIcon("search"));
|
|
68
|
+
case a.ADVANCED:
|
|
69
|
+
return i("telia-button", Object.assign({}, e), this.searchButtonText);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
const e = {
|
|
74
|
+
[this.classname]: !0,
|
|
75
|
+
[`${this.classname}--${this.variant}`]: !!this.variant,
|
|
76
|
+
[`${this.classname}--hasInput`]: !!this.inputValue,
|
|
77
|
+
[`${this.classname}--isDisabled`]: this.disabled
|
|
78
|
+
};
|
|
79
|
+
return i("div", { class: e, role: "search" }, i("telia-text-input", { class: `${this.classname}__input`, label: this.label, "aria-label": this.ariaLabel, disabled: this.disabled, placeholder: this.placeholder, "aria-placeholder": this.ariaPlaceholder, onInput: this.handleInput, value: this.inputValue, ref: (t) => {
|
|
80
|
+
this.inputElement = t;
|
|
81
|
+
} }), this.matchVariant(this.leadingIconVariants) && this.renderIcon("search", `${this.classname}__leading-icon`, !0), i("div", { class: `${this.classname}__button-wrapper` }, !!this.inputValue && this.renderResetInputButton(), this.matchVariant(this.searchButtonVariants) && this.renderSearchButton()), i("telia-vst", { dataTrackingId: `${this.classname}` }));
|
|
82
|
+
}
|
|
83
|
+
static get style() {
|
|
84
|
+
return _;
|
|
85
|
+
}
|
|
86
|
+
}, [1, "telia-search-input", {
|
|
87
|
+
placeholder: [1],
|
|
88
|
+
label: [1],
|
|
89
|
+
variant: [8],
|
|
90
|
+
ariaLabel: [1, "aria-label"],
|
|
91
|
+
ariaPlaceholder: [1, "aria-placeholder"],
|
|
92
|
+
searchButtonText: [1, "search-button-text"],
|
|
93
|
+
searchButtonAriaLabel: [1, "search-button-aria-label"],
|
|
94
|
+
resetInputButtonAriaLabel: [1, "reset-input-button-aria-label"],
|
|
95
|
+
disabled: [4],
|
|
96
|
+
inputValue: [32]
|
|
97
|
+
}]);
|
|
98
|
+
function E() {
|
|
99
|
+
if (typeof customElements > "u")
|
|
100
|
+
return;
|
|
101
|
+
["telia-search-input", "telia-button", "telia-field-assistive-text", "telia-field-error", "telia-field-valid", "telia-icon", "telia-label", "telia-text-input", "telia-vst"].forEach((t) => {
|
|
102
|
+
switch (t) {
|
|
103
|
+
case "telia-search-input":
|
|
104
|
+
customElements.get(t) || customElements.define(t, f);
|
|
105
|
+
break;
|
|
106
|
+
case "telia-button":
|
|
107
|
+
customElements.get(t) || u();
|
|
108
|
+
break;
|
|
109
|
+
case "telia-field-assistive-text":
|
|
110
|
+
customElements.get(t) || o();
|
|
111
|
+
break;
|
|
112
|
+
case "telia-field-error":
|
|
113
|
+
customElements.get(t) || p();
|
|
114
|
+
break;
|
|
115
|
+
case "telia-field-valid":
|
|
116
|
+
customElements.get(t) || h();
|
|
117
|
+
break;
|
|
118
|
+
case "telia-icon":
|
|
119
|
+
customElements.get(t) || m();
|
|
120
|
+
break;
|
|
121
|
+
case "telia-label":
|
|
122
|
+
customElements.get(t) || d();
|
|
123
|
+
break;
|
|
124
|
+
case "telia-text-input":
|
|
125
|
+
customElements.get(t) || v();
|
|
126
|
+
break;
|
|
127
|
+
case "telia-vst":
|
|
128
|
+
customElements.get(t) || b();
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
E();
|
|
134
|
+
//# sourceMappingURL=telia-search-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telia-search-input.js","sources":["../../../../node_modules/.pnpm/@teliads+components@21.3.1/node_modules/@teliads/components/dist/components/telia-search-input.js"],"sourcesContent":["import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';\nimport { d as defineCustomElement$9 } from './telia-button2.js';\nimport { d as defineCustomElement$8 } from './telia-field-assistive-text2.js';\nimport { d as defineCustomElement$7 } from './telia-field-error2.js';\nimport { d as defineCustomElement$6 } from './telia-field-valid2.js';\nimport { d as defineCustomElement$5 } from './telia-icon2.js';\nimport { d as defineCustomElement$4 } from './telia-label2.js';\nimport { d as defineCustomElement$3 } from './telia-text-input2.js';\nimport { d as defineCustomElement$2 } from './telia-vst2.js';\n\nconst SearchInputVariants = {\n DEFAULT: 'default',\n SIMPLE: 'simple',\n ADVANCED: 'advanced',\n};\nObject.values(SearchInputVariants);\n\nconst ButtonVariant = {\n PRIMARY: 'primary',\n SECONDARY: 'secondary',\n EXPRESSIVE: 'expressive',\n DESTRUCTIVE: 'destructive',\n TERTIARY_PURPLE: 'tertiary-purple',\n TEXT: 'text',\n PRIMARY_WHITE: 'primary-white',\n SECONDARY_WHITE: 'secondary-white',\n EXPRESSIVE_WHITE: 'expressive-white',\n};\nObject.values(ButtonVariant);\n\nconst searchInputCss = \":host{--right-padding-default:calc(12rem * var(--voca-rem-multiplier));--right-padding-simple:calc(6.5rem * var(--voca-rem-multiplier));--right-padding-advanced:calc(12.1rem * var(--voca-rem-multiplier))}.telia-search-input{position:relative}.telia-search-input__leading-icon{color:rgba(0, 0, 0, 0.6);position:absolute;bottom:calc((1.6rem * var(--voca-rem-multiplier)) - (0.2rem * var(--voca-rem-multiplier)));left:calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input--isDisabled .telia-search-input__leading-icon{color:rgba(0, 0, 0, 0.4)}.telia-search-input--hasInput .telia-search-input__leading-icon,.telia-search-input--hasInput~.telia-search-input__leading-icon,.telia-search-input telia-text-input:focus-within .telia-search-input__leading-icon,.telia-search-input telia-text-input:focus-within~.telia-search-input__leading-icon{display:none}.telia-search-input .telia-search-input__input input::placeholder{color:rgba(0, 0, 0, 0.6);opacity:1}.telia-search-input .telia-search-input__input input:disabled::placeholder{color:rgba(0, 0, 0, 0.4)}.telia-search-input--simple .telia-search-input__input input::placeholder,.telia-search-input--advanced .telia-search-input__input input::placeholder{padding-left:calc(2rem * var(--voca-rem-multiplier))}.telia-search-input .telia-text-input__input{height:calc(4.4rem * var(--voca-rem-multiplier));padding:calc((0.8rem * var(--voca-rem-multiplier)) + (0.2rem * var(--voca-rem-multiplier))) calc(0.8rem * var(--voca-rem-multiplier));margin-top:0}.telia-search-input .telia-text-input__input:hover{padding:calc((0.8rem * var(--voca-rem-multiplier)) + (0.2rem * var(--voca-rem-multiplier))) calc((0.8rem * var(--voca-rem-multiplier)) - (0.1rem * var(--voca-rem-multiplier)))}.telia-search-input .telia-text-input__input:focus,.telia-search-input .telia-text-input__input:disabled:hover{padding:calc((0.8rem * var(--voca-rem-multiplier)) + (0.2rem * var(--voca-rem-multiplier))) calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input .telia-text-input__input:focus-within::placeholder{padding-left:0}.telia-search-input--default .telia-text-input__input,.telia-search-input--default .telia-text-input__input:hover,.telia-search-input--default .telia-text-input__input:focus{padding-right:var(--right-padding-default, calc(10.5rem * var(--voca-rem-multiplier)))}.telia-search-input--simple .telia-text-input__input,.telia-search-input--simple .telia-text-input__input:hover,.telia-search-input--simple .telia-text-input__input:focus{padding-right:var(--right-padding-simple, calc(5.5rem * var(--voca-rem-multiplier)))}.telia-search-input--advanced .telia-text-input__input,.telia-search-input--advanced .telia-text-input__input:hover,.telia-search-input--advanced .telia-text-input__input:focus{padding-right:var(--right-padding-advanced, calc(13.5rem * var(--voca-rem-multiplier)))}.telia-search-input__button-wrapper{display:flex;position:absolute;bottom:0;right:calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input__button-wrapper .telia-search-input__search-button:last-child:not(:only-child){margin-left:calc(0.8rem * var(--voca-rem-multiplier))}.telia-search-input__button-wrapper .telia-button--text.telia-button--sm.telia-button--icon-only,.telia-search-input__button-wrapper .telia-search-input__reset-input-button .telia-button--text.telia-button--sm{padding:calc((1.6rem * var(--voca-rem-multiplier)) - (0.2rem * var(--voca-rem-multiplier))) calc(1.6rem * var(--voca-rem-multiplier))}.telia-search-input--advanced .telia-search-input__button-wrapper .telia-search-input__search-button .telia-button.telia-button--text.telia-button--sm:not(.telia-button--icon-only){padding:calc((1.6rem * var(--voca-rem-multiplier)) - (0.2rem * var(--voca-rem-multiplier))) 0}\";\n\nconst TeliaSearchInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.vocaSearchButtonClicked = createEvent(this, \"vocaSearchButtonClicked\", 7);\n /** Placeholder text */\n this.placeholder = 'Search...';\n /** Variant */\n this.variant = SearchInputVariants.DEFAULT;\n /** Accessibility: aria-label for the input */\n this.ariaLabel = null;\n /** Text for \"Expressive\" variant search button */\n this.searchButtonText = 'Search';\n /** Accessibility: aria-label for the search button */\n this.searchButtonAriaLabel = 'Search button';\n /** Accessibility: aria-label for the reset input button */\n this.resetInputButtonAriaLabel = 'Reset input button';\n /** Set button disabled */\n this.disabled = false;\n /** Input value */\n this.inputValue = '';\n this.classname = 'telia-search-input';\n this.leadingIconVariants = [\n SearchInputVariants.SIMPLE,\n SearchInputVariants.ADVANCED,\n ];\n this.searchButtonVariants = [\n SearchInputVariants.DEFAULT,\n SearchInputVariants.ADVANCED,\n ];\n this.matchVariant = (variants) => {\n return variants.includes(this.variant);\n };\n this.handleInput = (event) => {\n this.inputValue = event.target.value;\n };\n this.handleResetInput = () => {\n var _a;\n this.inputValue = '';\n (_a = this.inputElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.focus();\n };\n }\n renderIcon(iconName, className, ariaHidden = false) {\n return (h(\"telia-icon\", { name: iconName, size: \"sm\", class: className, \"aria-hidden\": ariaHidden }));\n }\n renderResetInputButton() {\n return (h(\"telia-button\", { variant: \"text\", size: \"sm\", class: `${this.classname}__reset-input-button`, onClick: this.handleResetInput, allyLabel: this.resetInputButtonAriaLabel, disabled: this.disabled }, this.renderIcon('close')));\n }\n renderSearchButton() {\n const commonProps = {\n variant: ButtonVariant.TEXT,\n size: 'sm',\n class: `${this.classname}__search-button`,\n disabled: this.disabled,\n allyLabel: this.searchButtonAriaLabel,\n onClick: (event) => {\n this.vocaSearchButtonClicked.emit({ value: this.inputValue, event });\n },\n };\n switch (this.variant) {\n case SearchInputVariants.DEFAULT:\n return (h(\"telia-button\", Object.assign({}, commonProps), this.renderIcon('search')));\n case SearchInputVariants.ADVANCED:\n return (h(\"telia-button\", Object.assign({}, commonProps), this.searchButtonText));\n }\n return;\n }\n render() {\n const wrapperClasses = {\n [this.classname]: true,\n [`${this.classname}--${this.variant}`]: !!this.variant,\n [`${this.classname}--hasInput`]: !!this.inputValue,\n [`${this.classname}--isDisabled`]: this.disabled,\n };\n return (h(\"div\", { class: wrapperClasses, role: \"search\" }, h(\"telia-text-input\", { class: `${this.classname}__input`, label: this.label, \"aria-label\": this.ariaLabel, disabled: this.disabled, placeholder: this.placeholder, \"aria-placeholder\": this.ariaPlaceholder, onInput: this.handleInput, value: this.inputValue, ref: ref => {\n this.inputElement = ref;\n } }), this.matchVariant(this.leadingIconVariants) &&\n this.renderIcon('search', `${this.classname}__leading-icon`, true), h(\"div\", { class: `${this.classname}__button-wrapper` }, !!this.inputValue && this.renderResetInputButton(), this.matchVariant(this.searchButtonVariants) &&\n this.renderSearchButton()), h(\"telia-vst\", { dataTrackingId: `${this.classname}` })));\n }\n static get style() { return searchInputCss; }\n}, [1, \"telia-search-input\", {\n \"placeholder\": [1],\n \"label\": [1],\n \"variant\": [8],\n \"ariaLabel\": [1, \"aria-label\"],\n \"ariaPlaceholder\": [1, \"aria-placeholder\"],\n \"searchButtonText\": [1, \"search-button-text\"],\n \"searchButtonAriaLabel\": [1, \"search-button-aria-label\"],\n \"resetInputButtonAriaLabel\": [1, \"reset-input-button-aria-label\"],\n \"disabled\": [4],\n \"inputValue\": [32]\n }]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"telia-search-input\", \"telia-button\", \"telia-field-assistive-text\", \"telia-field-error\", \"telia-field-valid\", \"telia-icon\", \"telia-label\", \"telia-text-input\", \"telia-vst\"];\n components.forEach(tagName => { switch (tagName) {\n case \"telia-search-input\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, TeliaSearchInput$1);\n }\n break;\n case \"telia-button\":\n if (!customElements.get(tagName)) {\n defineCustomElement$9();\n }\n break;\n case \"telia-field-assistive-text\":\n if (!customElements.get(tagName)) {\n defineCustomElement$8();\n }\n break;\n case \"telia-field-error\":\n if (!customElements.get(tagName)) {\n defineCustomElement$7();\n }\n break;\n case \"telia-field-valid\":\n if (!customElements.get(tagName)) {\n defineCustomElement$6();\n }\n break;\n case \"telia-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$5();\n }\n break;\n case \"telia-label\":\n if (!customElements.get(tagName)) {\n defineCustomElement$4();\n }\n break;\n case \"telia-text-input\":\n if (!customElements.get(tagName)) {\n defineCustomElement$3();\n }\n break;\n case \"telia-vst\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst TeliaSearchInput = TeliaSearchInput$1;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { TeliaSearchInput, defineCustomElement };\n"],"names":["SearchInputVariants","ButtonVariant","searchInputCss","TeliaSearchInput$1","proxyCustomElement","HTMLElement","createEvent","variants","event","_a","iconName","className","ariaHidden","h","commonProps","wrapperClasses","ref","defineCustomElement$1","tagName","defineCustomElement$9","defineCustomElement$8","defineCustomElement$7","defineCustomElement$6","defineCustomElement$5","defineCustomElement$4","defineCustomElement$3","defineCustomElement$2"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -1,169 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { d as _ } from "../../chunks/telia-label2-f4c1eb47.js";
|
|
9
|
-
import { d as b } from "../../chunks/telia-vst2-dfb33a56.js";
|
|
1
|
+
import "../../chunks/telia-text-input2-db9121d9.js";
|
|
2
|
+
import "../../chunks/index-eef143db.js";
|
|
3
|
+
import "../../chunks/uniqueId-0daf01ec.js";
|
|
4
|
+
import "../../chunks/stringCombiner-10b57054.js";
|
|
5
|
+
import "../../chunks/telia-field-assistive-text2-173ba2fb.js";
|
|
6
|
+
import "../../chunks/telia-vst2-dfb33a56.js";
|
|
7
|
+
import "../../chunks/telia-field-error2-75dc8ceb.js";
|
|
10
8
|
import "../../chunks/error-filled-8de50bdd.js";
|
|
11
|
-
import "../../chunks/
|
|
9
|
+
import "../../chunks/telia-icon2-d0e7c715.js";
|
|
12
10
|
import "../../chunks/getSvgContent-f2389ce0.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
email: "email",
|
|
17
|
-
tel: "tel",
|
|
18
|
-
search: "search",
|
|
19
|
-
password: "password"
|
|
20
|
-
}, E = '.telia-text-input{display:flex;flex-direction:column}.telia-text-input__input{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3);border-radius:calc(0.2rem * var(--voca-rem-multiplier));background-color:#ffffff;font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:normal;font-size:calc(1.6rem * var(--voca-rem-multiplier));line-height:1.5;-webkit-appearance:none;appearance:none;box-sizing:border-box;color:rgba(0, 0, 0, 0.85);display:block;margin:0;padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier));width:100%;height:calc(4.6rem * var(--voca-rem-multiplier));margin:calc(0.4rem * var(--voca-rem-multiplier)) 0 0;order:2}.telia-text-input__input:required{box-shadow:none}.telia-text-input__input[type=search]{-webkit-appearance:textfield;outline-offset:calc(-0.2rem * var(--voca-rem-multiplier))}.telia-text-input__input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.telia-text-input__input[type=number]~.telia-text-input__valid-icon-container,.telia-text-input__input[type=search]~.telia-text-input__valid-icon-container{margin:calc(-1 * (4.6rem * var(--voca-rem-multiplier))) calc(1.2rem * var(--voca-rem-multiplier)) 0 calc(100% - (3.2rem * var(--voca-rem-multiplier)));width:0}.telia-text-input__input:hover{border:calc(0.2rem * var(--voca-rem-multiplier)) solid #29003e;padding:calc(calc(1rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier))) calc(calc(1.2rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier)))}.telia-text-input__input:hover:focus{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3)}.telia-text-input__input:focus{outline:solid calc(0.3rem * var(--voca-rem-multiplier)) #0099ff;outline-offset:calc(0.2rem * var(--voca-rem-multiplier));padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-text-input__input:focus:hover{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3)}.telia-text-input__input:read-only{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;background-color:rgba(0, 0, 0, 0.05)}.telia-text-input__input:read-only:hover{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #c8c8cd;padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-text-input__input:disabled{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.15);background-color:rgba(0, 0, 0, 0.1);color:rgba(0, 0, 0, 0.4);cursor:not-allowed;-webkit-text-fill-color:#606064}.telia-text-input__input:disabled:hover{padding:calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-text-input__input:disabled~telia-label .telia-label{color:rgba(0, 0, 0, 0.4);cursor:not-allowed}.telia-text-input__input:disabled~.telia-text-input__additional{color:rgba(0, 0, 0, 0.4)}.telia-text-input__input:invalid{box-shadow:none}.telia-text-input__input--icon-shown{padding:calc(1rem * var(--voca-rem-multiplier)) calc(4.5rem * var(--voca-rem-multiplier)) calc(1rem * var(--voca-rem-multiplier)) calc(1.2rem * var(--voca-rem-multiplier))}.telia-text-input__input--touched:invalid{border:calc(0.1rem * var(--voca-rem-multiplier)) solid #e4175c}.telia-text-input__input--touched:invalid:focus{border:calc(0.1rem * var(--voca-rem-multiplier)) solid rgba(0, 0, 0, 0.3)}.telia-text-input__input--touched:invalid:hover:not(:focus){border:calc(0.2rem * var(--voca-rem-multiplier)) solid #e4175c;padding:calc(calc(1rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier))) calc(calc(1.2rem * var(--voca-rem-multiplier)) - calc(0.1rem * var(--voca-rem-multiplier)))}.telia-text-input__valid-icon-container{align-items:center;display:flex;flex-direction:row;height:calc(4.6rem * var(--voca-rem-multiplier));justify-content:flex-end;margin:calc(calc(4.6rem * var(--voca-rem-multiplier)) * -1) calc(1.2rem * var(--voca-rem-multiplier)) 0 calc(100% - calc(1.2rem * var(--voca-rem-multiplier)));order:3}.telia-text-input__additional{order:4}.telia-text-input__error{margin:calc(0.4rem * var(--voca-rem-multiplier)) 0 0;order:5}', V = /* @__PURE__ */ c(class extends d {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(), this.__registerHost(), this.valueChange = m(this, "valueChange", 7), this.type = x.text, this.value = "", this.additionalId = s("additional"), this.inputId = s("input"), this.errorId = s("error"), this.disabled = !1, this.readonly = !1, this.required = !1, this.showValidIcon = !1, this.dataTrackingId = "telia-text-input", this.touched = !1, this.dirty = !1, this.inputValue = "", this.errorMessageState = "", this.updateInputValue = () => {
|
|
23
|
-
this.inputValue = this.inputElement ? this.inputElement.value : this.value;
|
|
24
|
-
}, this.isValuePatternValid = () => this.pattern ? new RegExp("^(?:" + this.pattern + ")$").test(this.inputValue) : !0, this.isValueLessThanMinlength = () => this.inputValue.length > 0 && this.inputValue.length < this.minlength, this.isValueTypeInvalid = () => {
|
|
25
|
-
var t;
|
|
26
|
-
return (t = this.inputElement) === null || t === void 0 ? void 0 : t.validity.typeMismatch;
|
|
27
|
-
}, this.updateErrorMessage = (t) => {
|
|
28
|
-
var e;
|
|
29
|
-
(e = this.inputElement) === null || e === void 0 || e.setCustomValidity(t), this.errorMessageState = t;
|
|
30
|
-
}, this.isValueMissing = () => this.inputValue.length === 0, this.updateErrorState = () => {
|
|
31
|
-
var t, e;
|
|
32
|
-
const a = !!(!((t = this.errorMessageState) === null || t === void 0) && t.length), l = this.required, r = !!this.pattern, n = this.minlength, u = !!(!((e = this.errorMessage) === null || e === void 0) && e.length), o = !!this.emailErrorMessage && this.type === "email";
|
|
33
|
-
if (u) {
|
|
34
|
-
this.updateErrorMessage(this.errorMessage), this.touched = !0;
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (r && !this.isValueMissing() && this.touched && this.patternErrorMessage && !this.isValuePatternValid() && this.updateErrorMessage(this.patternErrorMessage), n && this.touched && this.minlengthErrorMessage && this.isValueLessThanMinlength() && this.updateErrorMessage(this.minlengthErrorMessage), l && (o && this.isValueTypeInvalid() && this.touched && this.updateErrorMessage(this.emailErrorMessage), this.touched && this.requiredErrorMessage && this.isValueMissing() && this.updateErrorMessage(this.requiredErrorMessage)), a) {
|
|
38
|
-
if (r && !this.isValuePatternValid() || n && this.isValueLessThanMinlength() || l && this.isValueMissing() || o && this.isValueTypeInvalid())
|
|
39
|
-
return;
|
|
40
|
-
this.updateErrorMessage("");
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Sets focus on input
|
|
46
|
-
*/
|
|
47
|
-
async focusInput() {
|
|
48
|
-
this.inputElement.focus();
|
|
49
|
-
}
|
|
50
|
-
componentWillLoad() {
|
|
51
|
-
this.updateInputValue(), this.updateErrorState();
|
|
52
|
-
}
|
|
53
|
-
componentWillUpdate() {
|
|
54
|
-
this.updateErrorState();
|
|
55
|
-
}
|
|
56
|
-
componentDidRender() {
|
|
57
|
-
var t, e, a;
|
|
58
|
-
this.inputElement && (!((t = this.inputElement) === null || t === void 0) && t.setCustomValidity) && ((e = this.inputElement) === null || e === void 0 || e.setCustomValidity(this.errorMessageState)), this.htmlForm && ((a = this.inputElement) === null || a === void 0 || a.setAttribute("form", this.htmlForm));
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Watch if value attributes changes after initial load.
|
|
62
|
-
* Needed for prefilling functionality to work with input validations.
|
|
63
|
-
* @param value value attribute
|
|
64
|
-
*/
|
|
65
|
-
componentValueChanged(t) {
|
|
66
|
-
this.inputValue = t, this.updateErrorState();
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* This method is used to determine
|
|
70
|
-
* if a 'valid icon' can be shown to the user.
|
|
71
|
-
* Given the complexity of the validation logic
|
|
72
|
-
* in this component, using this method
|
|
73
|
-
* to determine 'validity' in a general sense
|
|
74
|
-
* should be carefully considered and tested.
|
|
75
|
-
*/
|
|
76
|
-
isValid() {
|
|
77
|
-
return !this.errorMessage && !this.isValueMissing() && !this.isValueLessThanMinlength() && !this.isValueTypeInvalid() && this.isValuePatternValid();
|
|
78
|
-
}
|
|
79
|
-
render() {
|
|
80
|
-
const t = this.touched && !!this.errorMessageState.length, e = !!this.additional, a = p({
|
|
81
|
-
[this.additionalId]: e,
|
|
82
|
-
[this.errorId]: this.errorMessageState.length
|
|
83
|
-
}), l = this.showValidIcon && this.dirty && this.isValid();
|
|
84
|
-
return i("div", { class: "telia-text-input" }, i("input", { class: {
|
|
85
|
-
"telia-text-input__input": !0,
|
|
86
|
-
"telia-text-input__input--touched": this.touched,
|
|
87
|
-
"telia-text-input__input--icon-shown": l
|
|
88
|
-
}, placeholder: this.placeholder, type: this.type, id: this.inputId, "aria-describedby": a, minlength: this.minlength, maxlength: this.maxlength, disabled: this.disabled, readonly: this.readonly, value: this.value, name: this.name, onChange: (r) => {
|
|
89
|
-
this.valueChange.emit(r);
|
|
90
|
-
}, onInput: () => {
|
|
91
|
-
this.dirty = !0, this.updateInputValue(), this.updateErrorState();
|
|
92
|
-
}, inputmode: this.inputmode, list: this.list, autocomplete: this.autocomplete, required: this.required, onBlur: () => {
|
|
93
|
-
this.touched = !0, this.updateErrorState();
|
|
94
|
-
}, ref: (r) => this.inputElement = r, pattern: this.pattern, onInvalid: (r) => {
|
|
95
|
-
r.preventDefault(), this.touched = !0, this.updateErrorState();
|
|
96
|
-
}, form: this.htmlForm }), l && i("div", { class: "telia-text-input__valid-icon-container" }, i("telia-field-valid", { class: "telia-text-input__valid-icon" })), i("telia-label", { class: "telia-text-input__label", htmlFor: this.inputId }, this.required && i("span", { "aria-hidden": "true" }, "* "), this.label), e && i("telia-field-assistive-text", { class: "telia-text-input__additional", id: this.additionalId }, this.additional), t && i("telia-field-error", { id: this.errorId, class: "telia-text-input__error" }, this.errorMessageState), i("telia-vst", { dataTrackingId: this.dataTrackingId }));
|
|
97
|
-
}
|
|
98
|
-
static get watchers() {
|
|
99
|
-
return {
|
|
100
|
-
value: ["componentValueChanged"]
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
static get style() {
|
|
104
|
-
return E;
|
|
105
|
-
}
|
|
106
|
-
}, [0, "telia-text-input", {
|
|
107
|
-
dataTestid: [1, "data-testid"],
|
|
108
|
-
htmlForm: [1, "html-form"],
|
|
109
|
-
type: [1],
|
|
110
|
-
label: [1],
|
|
111
|
-
value: [1],
|
|
112
|
-
placeholder: [1],
|
|
113
|
-
name: [1],
|
|
114
|
-
additional: [1],
|
|
115
|
-
additionalId: [1, "additional-id"],
|
|
116
|
-
inputId: [1, "input-id"],
|
|
117
|
-
errorId: [1, "error-id"],
|
|
118
|
-
disabled: [4],
|
|
119
|
-
minlength: [2],
|
|
120
|
-
maxlength: [2],
|
|
121
|
-
readonly: [4],
|
|
122
|
-
inputmode: [1],
|
|
123
|
-
list: [1],
|
|
124
|
-
autocomplete: [1],
|
|
125
|
-
required: [4],
|
|
126
|
-
requiredErrorMessage: [1, "required-error-message"],
|
|
127
|
-
emailErrorMessage: [1, "email-error-message"],
|
|
128
|
-
minlengthErrorMessage: [1, "minlength-error-message"],
|
|
129
|
-
showValidIcon: [4, "show-valid-icon"],
|
|
130
|
-
pattern: [1],
|
|
131
|
-
patternErrorMessage: [1, "pattern-error-message"],
|
|
132
|
-
errorMessage: [1, "error-message"],
|
|
133
|
-
touched: [32],
|
|
134
|
-
dirty: [32],
|
|
135
|
-
inputValue: [32],
|
|
136
|
-
errorMessageState: [32],
|
|
137
|
-
focusInput: [64]
|
|
138
|
-
}]);
|
|
139
|
-
function M() {
|
|
140
|
-
if (typeof customElements > "u")
|
|
141
|
-
return;
|
|
142
|
-
["telia-text-input", "telia-field-assistive-text", "telia-field-error", "telia-field-valid", "telia-icon", "telia-label", "telia-vst"].forEach((e) => {
|
|
143
|
-
switch (e) {
|
|
144
|
-
case "telia-text-input":
|
|
145
|
-
customElements.get(e) || customElements.define(e, V);
|
|
146
|
-
break;
|
|
147
|
-
case "telia-field-assistive-text":
|
|
148
|
-
customElements.get(e) || h();
|
|
149
|
-
break;
|
|
150
|
-
case "telia-field-error":
|
|
151
|
-
customElements.get(e) || v();
|
|
152
|
-
break;
|
|
153
|
-
case "telia-field-valid":
|
|
154
|
-
customElements.get(e) || g();
|
|
155
|
-
break;
|
|
156
|
-
case "telia-icon":
|
|
157
|
-
customElements.get(e) || f();
|
|
158
|
-
break;
|
|
159
|
-
case "telia-label":
|
|
160
|
-
customElements.get(e) || _();
|
|
161
|
-
break;
|
|
162
|
-
case "telia-vst":
|
|
163
|
-
customElements.get(e) || b();
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
M();
|
|
11
|
+
import "../../chunks/telia-field-valid2-0f6759ac.js";
|
|
12
|
+
import "../../chunks/check-circle-filled-42095247.js";
|
|
13
|
+
import "../../chunks/telia-label2-f4c1eb47.js";
|
|
169
14
|
//# sourceMappingURL=telia-text-input.js.map
|