nve-designsystem 0.4.17 → 0.4.18
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as c, x as
|
|
1
|
+
import { r as c, x as l } from "../../chunks/lit-element.js";
|
|
2
2
|
import { n as s, t as m } from "../../chunks/property.js";
|
|
3
3
|
import { r as u } from "../../chunks/state.js";
|
|
4
4
|
import { e as b } from "../../chunks/query.js";
|
|
5
5
|
import v from "./nve-textarea.styles.js";
|
|
6
|
-
import { o
|
|
6
|
+
import { o } from "../../chunks/if-defined.js";
|
|
7
7
|
import { l as g } from "../../chunks/live.js";
|
|
8
8
|
import { e as f } from "../../chunks/class-map.js";
|
|
9
9
|
import "../nve-icon/nve-icon.component.js";
|
|
@@ -75,37 +75,37 @@ let e = class extends c {
|
|
|
75
75
|
this.toggleAttribute("data-valid", t), this.toggleAttribute("data-user-valid", t), this.toggleAttribute("data-invalid", !t), this.toggleAttribute("data-user-invalid", !t);
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
|
-
return
|
|
78
|
+
return l`
|
|
79
79
|
<div part="form-control" class=${f({ "form-control": !0, "form-control--has-label": this.label })}>
|
|
80
80
|
<div part="textarea-label" class="textarea__label">
|
|
81
|
-
${this.label ?
|
|
81
|
+
${this.label ? l`
|
|
82
82
|
<nve-label
|
|
83
83
|
aria-hidden=${this.label ? "false" : "true"}
|
|
84
84
|
value=${this.label}
|
|
85
|
-
tooltip=${
|
|
85
|
+
tooltip=${o(this.tooltip)}
|
|
86
86
|
></nve-label>
|
|
87
87
|
` : null}
|
|
88
|
-
${this.required && this.label ?
|
|
88
|
+
${this.required && this.label ? l`<span class="textarea__required-label">${this.requiredLabel}</span>` : null}
|
|
89
89
|
</div>
|
|
90
90
|
<div part="base" class="textarea__base">
|
|
91
91
|
<textarea
|
|
92
92
|
part="textarea"
|
|
93
93
|
class="textarea__control"
|
|
94
94
|
title=${this.title}
|
|
95
|
-
name=${
|
|
95
|
+
name=${o(this.name)}
|
|
96
96
|
.value=${g(this.value)}
|
|
97
97
|
?disabled=${this.disabled}
|
|
98
98
|
?readonly=${this.readonly}
|
|
99
99
|
?required=${this.required}
|
|
100
|
-
placeholder=${
|
|
101
|
-
minlength=${
|
|
102
|
-
maxlength=${
|
|
103
|
-
autocapitalize=${
|
|
104
|
-
autocorrect=${
|
|
100
|
+
placeholder=${o(this.placeholder)}
|
|
101
|
+
minlength=${o(this.minlength)}
|
|
102
|
+
maxlength=${o(this.maxlength)}
|
|
103
|
+
autocapitalize=${o(this.autocapitalize)}
|
|
104
|
+
autocorrect=${o(this.autocorrect)}
|
|
105
105
|
?autofocus=${this.autofocus}
|
|
106
|
-
inputmode=${
|
|
106
|
+
inputmode=${o(this.inputmode)}
|
|
107
107
|
aria-describedby="help-text"
|
|
108
|
-
rows=${
|
|
108
|
+
rows=${o(this.rows && this.rows >= 3 ? this.rows : 3)}
|
|
109
109
|
@change=${this.handleChange}
|
|
110
110
|
@input=${this.handleInput}
|
|
111
111
|
@blur=${this.handleBlur}
|
|
@@ -115,17 +115,17 @@ let e = class extends c {
|
|
|
115
115
|
Må gjøres sånn fordi vi vil ikke begrense textarea__base brede til fit-content (da textarea kan aldri ta så mye plass som er
|
|
116
116
|
tilgjengelig i nettleseren og man må alltid sette brede på den manuelt. Nei takk.) -->
|
|
117
117
|
<!-- Foreløpig kan man ha enten 'lock' eller 'error' ikone -->
|
|
118
|
-
${this.disabled || this.showErrorMessage ?
|
|
119
|
-
${this.disabled ?
|
|
120
|
-
${this.showErrorMessage ?
|
|
118
|
+
${this.disabled || this.showErrorMessage ? l`<div class="textarea__icon__container">
|
|
119
|
+
${this.disabled ? l`<nve-icon name="lock"></nve-icon>` : null}
|
|
120
|
+
${this.showErrorMessage ? l`<nve-icon class="textarea__icon--error" name="error"></nve-icon>` : null}
|
|
121
121
|
</div>` : null}
|
|
122
122
|
</div>
|
|
123
123
|
<div part="help-text-container" class="textarea__help-text__container">
|
|
124
124
|
<!-- Ikke vis hjelpe tekst mens feil -->
|
|
125
|
-
${!this.showErrorMessage && this.helpText ?
|
|
125
|
+
${!this.showErrorMessage && this.helpText ? l`<span class="textarea__help-text" aria-hidden=${this.helpText ? "false" : "true"}
|
|
126
126
|
>${this.helpText}</span
|
|
127
127
|
>` : null}
|
|
128
|
-
${this.showErrorMessage ?
|
|
128
|
+
${this.showErrorMessage ? l`<span class="textarea__help-text textarea__help-text--error">${this.errorMessage}</span>` : null}
|
|
129
129
|
</div>
|
|
130
130
|
</div>
|
|
131
131
|
`;
|
package/custom-elements.json
CHANGED
|
@@ -11405,7 +11405,7 @@
|
|
|
11405
11405
|
"package": {
|
|
11406
11406
|
"name": "nve-designsystem",
|
|
11407
11407
|
"description": "Designsystem for NVE",
|
|
11408
|
-
"version": "0.4.
|
|
11408
|
+
"version": "0.4.17",
|
|
11409
11409
|
"author": {
|
|
11410
11410
|
"name": "NVE",
|
|
11411
11411
|
"email": "nve@nve.no"
|