@luftborn/custom-elements 2.13.10 → 2.15.0
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/demo/index.html +269 -259
- package/demo/index.js +455 -125
- package/demo/index.min.js +454 -124
- package/demo/index.min.js.map +1 -1
- package/dist/elements/Address/AddressElement.js +3 -2
- package/dist/elements/Address/AddressElement.js.map +1 -1
- package/dist/elements/BankField/BankFieldElement.js +3 -2
- package/dist/elements/BankField/BankFieldElement.js.map +1 -1
- package/dist/elements/CPRElement/CPRElement.js +3 -2
- package/dist/elements/CPRElement/CPRElement.js.map +1 -1
- package/dist/elements/CVRElement/CVRElement.js +3 -2
- package/dist/elements/CVRElement/CVRElement.js.map +1 -1
- package/dist/elements/CheckBoxElement/CheckBoxElement.js +4 -2
- package/dist/elements/CheckBoxElement/CheckBoxElement.js.map +1 -1
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.js +3 -2
- package/dist/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.js.map +1 -1
- package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.js +3 -2
- package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.js.map +1 -1
- package/dist/elements/DateField/DateFieldElement.js +3 -2
- package/dist/elements/DateField/DateFieldElement.js.map +1 -1
- package/dist/elements/DropDownList/DropDownListElement.js +3 -2
- package/dist/elements/DropDownList/DropDownListElement.js.map +1 -1
- package/dist/elements/Elements.d.ts +2 -1
- package/dist/elements/Elements.js +3 -1
- package/dist/elements/Elements.js.map +1 -1
- package/dist/elements/EmailField/EmailFieldElement.js +3 -2
- package/dist/elements/EmailField/EmailFieldElement.js.map +1 -1
- package/dist/elements/FileField/FileFieldElement.js +3 -2
- package/dist/elements/FileField/FileFieldElement.js.map +1 -1
- package/dist/elements/IdentificationElement/IdentificationElement.js +3 -2
- package/dist/elements/IdentificationElement/IdentificationElement.js.map +1 -1
- package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.js +3 -2
- package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.js.map +1 -1
- package/dist/elements/NumericField/NumericFieldElement.js +3 -2
- package/dist/elements/NumericField/NumericFieldElement.js.map +1 -1
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js +4 -2
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js.map +1 -1
- package/dist/elements/ResidentIdentification/ResidentIdentificationElement.d.ts +22 -0
- package/dist/elements/ResidentIdentification/ResidentIdentificationElement.js +145 -0
- package/dist/elements/ResidentIdentification/ResidentIdentificationElement.js.map +1 -0
- package/dist/elements/SECompanyRegistrationElement/SECompanyRegistrationElement.js +3 -2
- package/dist/elements/SECompanyRegistrationElement/SECompanyRegistrationElement.js.map +1 -1
- package/dist/elements/SEPersonalNumberElement/SEPersonalNumberElement.js +3 -2
- package/dist/elements/SEPersonalNumberElement/SEPersonalNumberElement.js.map +1 -1
- package/dist/elements/TextAreaElement/TextAreaElement.js +3 -2
- package/dist/elements/TextAreaElement/TextAreaElement.js.map +1 -1
- package/dist/elements/TextField/TextFieldElement.js +3 -2
- package/dist/elements/TextField/TextFieldElement.js.map +1 -1
- package/dist/elements/TypeAhead/TypeAheadElement.js +3 -2
- package/dist/elements/TypeAhead/TypeAheadElement.js.map +1 -1
- package/dist/framework/CustomInputElement.d.ts +1 -0
- package/dist/framework/CustomInputElement.js +17 -0
- package/dist/framework/CustomInputElement.js.map +1 -1
- package/dist/framework/Language/Languages/CzechDictionary.js +7 -1
- package/dist/framework/Language/Languages/CzechDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/DanishDictionary.js +7 -1
- package/dist/framework/Language/Languages/DanishDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/DutchDictionary.js +7 -1
- package/dist/framework/Language/Languages/DutchDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/EnglishDictionary.js +7 -1
- package/dist/framework/Language/Languages/EnglishDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/EstonianDictionary.js +7 -1
- package/dist/framework/Language/Languages/EstonianDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/FinnishDictionary.js +7 -1
- package/dist/framework/Language/Languages/FinnishDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/FrenchDictionary.js +7 -1
- package/dist/framework/Language/Languages/FrenchDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/GermanDictionary.js +7 -1
- package/dist/framework/Language/Languages/GermanDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/GreekDictionary.js +7 -1
- package/dist/framework/Language/Languages/GreekDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/HungarianDictionary.js +7 -1
- package/dist/framework/Language/Languages/HungarianDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/IcelandicDictionary.js +7 -1
- package/dist/framework/Language/Languages/IcelandicDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/ItalianDictionary.js +7 -1
- package/dist/framework/Language/Languages/ItalianDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/LatvianDictionary.js +7 -1
- package/dist/framework/Language/Languages/LatvianDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/LituanianDictionary.js +7 -1
- package/dist/framework/Language/Languages/LituanianDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/NorwegianDictionary.js +7 -1
- package/dist/framework/Language/Languages/NorwegianDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/PolishDictionary.js +7 -1
- package/dist/framework/Language/Languages/PolishDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/PortugueseDictionary.js +7 -1
- package/dist/framework/Language/Languages/PortugueseDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/SpanishDictionary.js +7 -1
- package/dist/framework/Language/Languages/SpanishDictionary.js.map +1 -1
- package/dist/framework/Language/Languages/SwedishDictionary.js +7 -1
- package/dist/framework/Language/Languages/SwedishDictionary.js.map +1 -1
- package/dist/framework/Validation/Validators/ResidentIdentification.d.ts +5 -0
- package/dist/framework/Validation/Validators/ResidentIdentification.js +28 -0
- package/dist/framework/Validation/Validators/ResidentIdentification.js.map +1 -0
- package/package.json +1 -1
- package/src/elements/Address/AddressElement.ts +37 -18
- package/src/elements/BankField/BankFieldElement.ts +34 -16
- package/src/elements/CPRElement/CPRElement.ts +28 -10
- package/src/elements/CVRElement/CVRElement.ts +28 -10
- package/src/elements/CheckBoxElement/CheckBoxElement.ts +22 -3
- package/src/elements/CustomFormatDateFieldElement/CustomFormatDateFieldElement.ts +25 -7
- package/src/elements/CustomRegularExpression/CustomRegularExpressionElement.ts +28 -10
- package/src/elements/DateField/DateFieldElement.ts +28 -10
- package/src/elements/DropDownList/DropDownListElement.ts +42 -24
- package/src/elements/Elements.ts +2 -0
- package/src/elements/EmailField/EmailFieldElement.ts +28 -10
- package/src/elements/FileField/FileFieldElement.ts +28 -10
- package/src/elements/IdentificationElement/IdentificationElement.ts +32 -14
- package/src/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.ts +36 -19
- package/src/elements/NumericField/NumericFieldElement.ts +28 -10
- package/src/elements/RadioButtonGroup/RadioButtonGroupElement.ts +46 -27
- package/src/elements/ResidentIdentification/ResidentIdentificationElement.ts +155 -0
- package/src/elements/SECompanyRegistrationElement/SECompanyRegistrationElement.ts +24 -5
- package/src/elements/SEPersonalNumberElement/SEPersonalNumberElement.ts +24 -5
- package/src/elements/TextAreaElement/TextAreaElement.ts +28 -10
- package/src/elements/TextField/TextFieldElement.ts +30 -11
- package/src/elements/TypeAhead/TypeAheadElement.ts +27 -9
- package/src/framework/CustomInputElement.ts +18 -0
- package/src/framework/Language/Languages/CzechDictionary.ts +7 -1
- package/src/framework/Language/Languages/DanishDictionary.ts +8 -1
- package/src/framework/Language/Languages/DutchDictionary.ts +7 -1
- package/src/framework/Language/Languages/EnglishDictionary.ts +7 -1
- package/src/framework/Language/Languages/EstonianDictionary.ts +7 -1
- package/src/framework/Language/Languages/FinnishDictionary.ts +7 -1
- package/src/framework/Language/Languages/FrenchDictionary.ts +7 -1
- package/src/framework/Language/Languages/GermanDictionary.ts +7 -1
- package/src/framework/Language/Languages/GreekDictionary.ts +7 -1
- package/src/framework/Language/Languages/HungarianDictionary.ts +7 -1
- package/src/framework/Language/Languages/IcelandicDictionary.ts +7 -1
- package/src/framework/Language/Languages/ItalianDictionary.ts +7 -1
- package/src/framework/Language/Languages/LatvianDictionary.ts +7 -1
- package/src/framework/Language/Languages/LituanianDictionary.ts +7 -1
- package/src/framework/Language/Languages/NorwegianDictionary.ts +7 -1
- package/src/framework/Language/Languages/PolishDictionary.ts +7 -1
- package/src/framework/Language/Languages/PortugueseDictionary.ts +7 -1
- package/src/framework/Language/Languages/SpanishDictionary.ts +7 -1
- package/src/framework/Language/Languages/SwedishDictionary.ts +7 -1
- package/src/framework/Validation/Validators/ResidentIdentification.ts +28 -0
- package/src/elements/Address/html.html +0 -0
|
@@ -10,35 +10,51 @@ import GetFlags2XUrl from './Flags2x';
|
|
|
10
10
|
@CustomElement({
|
|
11
11
|
selector: 'int-phone-element',
|
|
12
12
|
template: `
|
|
13
|
+
<div class="field-label">
|
|
14
|
+
</div>
|
|
15
|
+
<div class="field-input">
|
|
13
16
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.0/css/intlTelInput.css" >
|
|
14
17
|
<div class="wrapper">
|
|
15
18
|
<input type="tel" id="phone-field" />
|
|
16
|
-
</div
|
|
19
|
+
</div>
|
|
20
|
+
</div>`,
|
|
17
21
|
style: `
|
|
18
|
-
|
|
22
|
+
:host{
|
|
19
23
|
width:100%;
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
}
|
|
25
|
+
.wrapper{
|
|
22
26
|
display:flex;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
}
|
|
28
|
+
.iti {
|
|
29
|
+
width: 100% !important;
|
|
30
|
+
}
|
|
31
|
+
input{
|
|
28
32
|
box-sizing: border-box;
|
|
29
33
|
width: 100% !important;
|
|
30
|
-
border:
|
|
31
|
-
|
|
34
|
+
border: .1rem solid #27282D;
|
|
35
|
+
border-radius: .25rem;
|
|
32
36
|
margin: 0.125rem;
|
|
33
37
|
resize: none;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}
|
|
39
|
+
input::placeholder {
|
|
40
|
+
color: rgb(117, 117, 117);
|
|
41
|
+
}
|
|
42
|
+
.field-label {
|
|
43
|
+
color: #27282d;
|
|
44
|
+
font-size: .75rem;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
word-wrap: break-word;
|
|
47
|
+
}
|
|
48
|
+
.field-input {
|
|
49
|
+
font-size: 0.813rem;
|
|
50
|
+
min-height: 1.438rem;
|
|
51
|
+
}
|
|
52
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
53
|
+
.iti__flag {
|
|
54
|
+
background-image: url('https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.0/img/flags@2x.png'), url(${GetFlags2XUrl()});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
42
58
|
useShadow: true,
|
|
43
59
|
})
|
|
44
60
|
export class IntPhoneFieldElement extends CustomInputElement {
|
|
@@ -68,6 +84,7 @@ export class IntPhoneFieldElement extends CustomInputElement {
|
|
|
68
84
|
connectedCallback(): void {
|
|
69
85
|
this.setIntlTelInput();
|
|
70
86
|
super.connectedCallback();
|
|
87
|
+
super.addLabel(this.phone);
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
initChildInputs() {
|
|
@@ -5,25 +5,42 @@ import { CustomElementEventArgs } from '../../framework/CustomEvents';
|
|
|
5
5
|
@CustomElement({
|
|
6
6
|
selector: 'numeric-element',
|
|
7
7
|
template: `
|
|
8
|
+
<div class="field-label">
|
|
9
|
+
</div>
|
|
10
|
+
<div class="field-input">
|
|
8
11
|
<div class="wrapper">
|
|
9
12
|
<input type="number" id="numeric-field" step="any" />
|
|
10
|
-
</div
|
|
13
|
+
</div>
|
|
14
|
+
</div>`,
|
|
11
15
|
style: `
|
|
12
|
-
|
|
16
|
+
:host{
|
|
13
17
|
width:100%;
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
}
|
|
19
|
+
.wrapper{
|
|
16
20
|
display:flex;
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
}
|
|
22
|
+
input{
|
|
19
23
|
box-sizing: border-box;
|
|
20
24
|
width: 100% !important;
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
border: .1rem solid #27282D;
|
|
26
|
+
border-radius: .25rem;
|
|
23
27
|
margin: 0.125rem;
|
|
24
28
|
resize: none;
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
}
|
|
30
|
+
input::placeholder {
|
|
31
|
+
color: rgb(117, 117, 117);
|
|
32
|
+
}
|
|
33
|
+
.field-label {
|
|
34
|
+
color: #27282d;
|
|
35
|
+
font-size: .75rem;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
word-wrap: break-word;
|
|
38
|
+
}
|
|
39
|
+
.field-input {
|
|
40
|
+
font-size: 0.813rem;
|
|
41
|
+
min-height: 1.438rem;
|
|
42
|
+
}
|
|
43
|
+
`,
|
|
27
44
|
useShadow: true,
|
|
28
45
|
})
|
|
29
46
|
export class NumericFieldElement extends CustomInputElement {
|
|
@@ -50,6 +67,7 @@ export class NumericFieldElement extends CustomInputElement {
|
|
|
50
67
|
|
|
51
68
|
connectedCallback(): void {
|
|
52
69
|
super.connectedCallback();
|
|
70
|
+
super.addLabel(this.number);
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
initChildInputs() {
|
|
@@ -6,35 +6,52 @@ import { StringUtil } from '../../framework/Utilities/StringUtil';
|
|
|
6
6
|
@CustomElement({
|
|
7
7
|
selector: 'radio-group-element',
|
|
8
8
|
template: `
|
|
9
|
+
<div class="field-label">
|
|
10
|
+
</div>
|
|
11
|
+
<div class="field-input">
|
|
9
12
|
<div class="wrapper">
|
|
10
|
-
</div
|
|
13
|
+
</div>
|
|
14
|
+
</div>`,
|
|
11
15
|
style: `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
:host{
|
|
17
|
+
width:100%;
|
|
18
|
+
}
|
|
19
|
+
.radio-button {
|
|
20
|
+
width: auto;
|
|
21
|
+
margin: auto 0.188rem;
|
|
22
|
+
color: rgba(72, 72, 72, 0.75);
|
|
23
|
+
font-size: 0.813rem;
|
|
24
|
+
margin-top: 0.25rem;
|
|
25
|
+
}
|
|
26
|
+
.radio-button:first-of-type {
|
|
27
|
+
margin-top: 0;
|
|
28
|
+
}
|
|
29
|
+
input{
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
width: auto !important;
|
|
32
|
+
border: .1rem solid #27282D;
|
|
33
|
+
border-radius: .25rem;
|
|
34
|
+
margin: 0.2rem;
|
|
35
|
+
resize: none;
|
|
36
|
+
}
|
|
37
|
+
input::placeholder {
|
|
38
|
+
color: rgb(117, 117, 117);
|
|
39
|
+
}
|
|
40
|
+
fieldset {
|
|
41
|
+
border: none;
|
|
42
|
+
padding: 0;
|
|
43
|
+
}
|
|
44
|
+
.field-label {
|
|
45
|
+
color: #27282d;
|
|
46
|
+
font-size: .75rem;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
word-wrap: break-word;
|
|
49
|
+
}
|
|
50
|
+
.field-input {
|
|
51
|
+
font-size: 0.813rem;
|
|
52
|
+
min-height: 1.438rem;
|
|
53
|
+
}
|
|
54
|
+
`,
|
|
38
55
|
useShadow: true,
|
|
39
56
|
})
|
|
40
57
|
export class RadioButtonGroupElement extends CustomInputElement {
|
|
@@ -70,6 +87,8 @@ export class RadioButtonGroupElement extends CustomInputElement {
|
|
|
70
87
|
|
|
71
88
|
connectedCallback(): void {
|
|
72
89
|
super.connectedCallback();
|
|
90
|
+
const firstRadioButton = super.getChildElement('input[type="radio"]') as HTMLInputElement;
|
|
91
|
+
super.addLabel(firstRadioButton);
|
|
73
92
|
}
|
|
74
93
|
|
|
75
94
|
initChildInputs() {
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import CustomElement from '../../framework/custom-element.decorator';
|
|
2
|
+
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
3
|
+
import { CustomElementEventArgs } from '../../framework/CustomEvents';
|
|
4
|
+
import Translator from '../../framework/Language/Translator';
|
|
5
|
+
import getAttributeNamesPolyfill from '../../framework/Polyfills/getAttributeNamesPolyfill';
|
|
6
|
+
import ResidentIdentificationValidator from '../../framework/Validation/Validators/ResidentIdentification';
|
|
7
|
+
|
|
8
|
+
@CustomElement({
|
|
9
|
+
selector: 'resident-identification-element',
|
|
10
|
+
template: `
|
|
11
|
+
<div class="field-label">
|
|
12
|
+
</div>
|
|
13
|
+
<div class="field-input">
|
|
14
|
+
<div class="field-wrapper">
|
|
15
|
+
<input class='field-part' id='company' type="text" placeholder='Company'/>
|
|
16
|
+
<input class='field-part' id='property' type="text" placeholder='Property'/>
|
|
17
|
+
<input class='field-part' id='tenancy' type="text" placeholder='Tenancy'/>
|
|
18
|
+
<input class='field-part' id='tenant' type="text" placeholder='Tenant'/>
|
|
19
|
+
</div>
|
|
20
|
+
</div>`,
|
|
21
|
+
style: `
|
|
22
|
+
.field-wrapper{
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: nowrap;
|
|
25
|
+
}
|
|
26
|
+
input.field-part{
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
border: .1rem solid #27282D;
|
|
29
|
+
border-radius: .25rem;
|
|
30
|
+
margin: 0.125rem;
|
|
31
|
+
resize: none;
|
|
32
|
+
width:33% !important;
|
|
33
|
+
}
|
|
34
|
+
input.field-part::placeholder {
|
|
35
|
+
color: rgb(117, 117, 117);
|
|
36
|
+
}
|
|
37
|
+
.field-label {
|
|
38
|
+
color: #27282d;
|
|
39
|
+
font-size: .75rem;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
word-wrap: break-word;
|
|
42
|
+
}
|
|
43
|
+
.field-input {
|
|
44
|
+
font-size: 0.813rem;
|
|
45
|
+
min-height: 1.438rem;
|
|
46
|
+
}
|
|
47
|
+
`,
|
|
48
|
+
templatePath: './html.html',
|
|
49
|
+
useShadow: true,
|
|
50
|
+
})
|
|
51
|
+
export class ResidentIdentificationElement extends CustomInputElement {
|
|
52
|
+
company: HTMLInputElement;
|
|
53
|
+
property: HTMLInputElement;
|
|
54
|
+
tenancy: HTMLInputElement;
|
|
55
|
+
tenant: HTMLInputElement;
|
|
56
|
+
validator: ResidentIdentificationValidator = new ResidentIdentificationValidator();
|
|
57
|
+
|
|
58
|
+
constructor() {
|
|
59
|
+
super();
|
|
60
|
+
getAttributeNamesPolyfill();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get value(): string {
|
|
64
|
+
let company = this.company.value || '';
|
|
65
|
+
let property = this.property.value ? `-${this.property.value}` : '';
|
|
66
|
+
let tenancy = this.tenancy.value ? `-${this.tenancy.value}` : '';
|
|
67
|
+
let tenant = this.tenant.value ? `-${this.tenant.value}` : '';
|
|
68
|
+
return `${company}${property}${tenancy}${tenant}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set value(value: string) {
|
|
72
|
+
const values = value.split(',');
|
|
73
|
+
this.company.value = values[0];
|
|
74
|
+
this.property.value = values[1];
|
|
75
|
+
this.tenancy.value = values[2];
|
|
76
|
+
this.tenant.value = values[3];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
get valid(): boolean {
|
|
80
|
+
return this.validator.isSatisfiedBy(this.value, !this.required);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
connectedCallback(): void {
|
|
84
|
+
super.connectedCallback();
|
|
85
|
+
super.addLabel(this.company);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
componentDidMount() {
|
|
89
|
+
this.initChildInputs();
|
|
90
|
+
this.getAttributeNames().forEach(attributeName => {
|
|
91
|
+
let attributeValue = this.getAttribute(attributeName);
|
|
92
|
+
this.attributeChanged(attributeName, null, attributeValue);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
initChildInputs() {
|
|
97
|
+
this.company = super.getChildInput('#company');
|
|
98
|
+
this.property = super.getChildInput('#property');
|
|
99
|
+
this.tenancy = super.getChildInput('#tenancy');
|
|
100
|
+
this.tenant = super.getChildInput('#tenant');
|
|
101
|
+
this.company.addEventListener('change', this.change.bind(this));
|
|
102
|
+
this.property.addEventListener('change', this.change.bind(this));
|
|
103
|
+
this.tenancy.addEventListener('change', this.change.bind(this));
|
|
104
|
+
this.tenant.addEventListener('change', this.change.bind(this));
|
|
105
|
+
if (this.required) {
|
|
106
|
+
this.company.setAttribute('required', 'required');
|
|
107
|
+
this.property.setAttribute('required', 'required');
|
|
108
|
+
this.tenancy.setAttribute('required', 'required');
|
|
109
|
+
this.tenant.setAttribute('required', 'required');
|
|
110
|
+
}
|
|
111
|
+
if (this.label) {
|
|
112
|
+
const wrapper = this.shadowRoot.querySelector('.field-wrapper');
|
|
113
|
+
if (wrapper) {
|
|
114
|
+
wrapper.setAttribute('aria-label', this.label);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// events
|
|
120
|
+
public change($event): void {
|
|
121
|
+
this.touched = true;
|
|
122
|
+
this.onChange.emit(new CustomElementEventArgs(this.value, 'change'));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public validate(): void {
|
|
126
|
+
this.valid;
|
|
127
|
+
this.onValidate.emit(
|
|
128
|
+
new CustomElementEventArgs(this.value, 'validate'),
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
changeLanguage(language: string) {
|
|
133
|
+
if (!this.company || !this.property || !this.tenancy || !this.tenant) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
this.company.placeholder = Translator.Translate('ResidentIdentificationElement.Company', language);
|
|
137
|
+
this.property.placeholder = Translator.Translate('ResidentIdentificationElement.Property', language);
|
|
138
|
+
this.tenancy.placeholder = Translator.Translate('ResidentIdentificationElement.Tenancy', language);
|
|
139
|
+
this.tenant.placeholder = Translator.Translate('ResidentIdentificationElement.Tenant', language);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
static get observedAttributes() {
|
|
143
|
+
return ['language'];
|
|
144
|
+
}
|
|
145
|
+
attributeChangedCallback(name: string, oldVal: string, newVal: string) {
|
|
146
|
+
this.attributeChanged(name, oldVal, newVal);
|
|
147
|
+
}
|
|
148
|
+
private attributeChanged(name: string, oldVal: string, newVal: string) {
|
|
149
|
+
switch (name) {
|
|
150
|
+
case 'language':
|
|
151
|
+
this.changeLanguage(newVal)
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -6,8 +6,12 @@ import SECompanyRegistrationValidator from '../../framework/Validation/Validator
|
|
|
6
6
|
@CustomElement({
|
|
7
7
|
selector: 'se-company-registration-element',
|
|
8
8
|
template: `
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
<div class="field-label">
|
|
10
|
+
</div>
|
|
11
|
+
<div class="field-input">
|
|
12
|
+
<div class="wrapper">
|
|
13
|
+
<input type="text" id='se-company-registration-field' placeholder='SSSSSSSSSS'/>
|
|
14
|
+
</div>
|
|
11
15
|
</div>`,
|
|
12
16
|
style: `
|
|
13
17
|
:host{
|
|
@@ -19,11 +23,25 @@ import SECompanyRegistrationValidator from '../../framework/Validation/Validator
|
|
|
19
23
|
input{
|
|
20
24
|
box-sizing: border-box;
|
|
21
25
|
width: 100% !important;
|
|
22
|
-
border:
|
|
23
|
-
|
|
26
|
+
border: .1rem solid #27282D;
|
|
27
|
+
border-radius: .25rem;
|
|
24
28
|
margin: 0.125rem;
|
|
25
29
|
resize: none;
|
|
26
|
-
}
|
|
30
|
+
}
|
|
31
|
+
input::placeholder {
|
|
32
|
+
color: rgb(117, 117, 117);
|
|
33
|
+
}
|
|
34
|
+
.field-label {
|
|
35
|
+
color: #27282d;
|
|
36
|
+
font-size: .75rem;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
}
|
|
40
|
+
.field-input {
|
|
41
|
+
font-size: 0.813rem;
|
|
42
|
+
min-height: 1.438rem;
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
27
45
|
useShadow: true,
|
|
28
46
|
})
|
|
29
47
|
export class SECompanyRegistrationElement extends CustomInputElement {
|
|
@@ -48,6 +66,7 @@ export class SECompanyRegistrationElement extends CustomInputElement {
|
|
|
48
66
|
|
|
49
67
|
connectedCallback(): void {
|
|
50
68
|
super.connectedCallback();
|
|
69
|
+
super.addLabel(this.text);
|
|
51
70
|
}
|
|
52
71
|
|
|
53
72
|
initChildInputs() {
|
|
@@ -6,8 +6,12 @@ import SEPersonalNumberValidator from '../../framework/Validation/Validators/SEP
|
|
|
6
6
|
@CustomElement({
|
|
7
7
|
selector: 'se-personal-number-element',
|
|
8
8
|
template: `
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
<div class="field-label">
|
|
10
|
+
</div>
|
|
11
|
+
<div class="field-input">
|
|
12
|
+
<div class="wrapper">
|
|
13
|
+
<input type="text" id='se-personal-number-field' placeholder='(YY)YYMMDD-SSSS'/>
|
|
14
|
+
</div>
|
|
11
15
|
</div>`,
|
|
12
16
|
style: `
|
|
13
17
|
:host{
|
|
@@ -19,11 +23,25 @@ import SEPersonalNumberValidator from '../../framework/Validation/Validators/SEP
|
|
|
19
23
|
input{
|
|
20
24
|
box-sizing: border-box;
|
|
21
25
|
width: 100% !important;
|
|
22
|
-
border:
|
|
23
|
-
|
|
26
|
+
border: .1rem solid #27282D;
|
|
27
|
+
border-radius: .25rem;
|
|
24
28
|
margin: 0.125rem;
|
|
25
29
|
resize: none;
|
|
26
|
-
}
|
|
30
|
+
}
|
|
31
|
+
input::placeholder {
|
|
32
|
+
color: rgb(117, 117, 117);
|
|
33
|
+
}
|
|
34
|
+
.field-label {
|
|
35
|
+
color: #27282d;
|
|
36
|
+
font-size: .75rem;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
}
|
|
40
|
+
.field-input {
|
|
41
|
+
font-size: 0.813rem;
|
|
42
|
+
min-height: 1.438rem;
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
27
45
|
useShadow: true,
|
|
28
46
|
})
|
|
29
47
|
export class SEPersonalNumberElement extends CustomInputElement {
|
|
@@ -48,6 +66,7 @@ export class SEPersonalNumberElement extends CustomInputElement {
|
|
|
48
66
|
|
|
49
67
|
connectedCallback(): void {
|
|
50
68
|
super.connectedCallback();
|
|
69
|
+
super.addLabel(this.text);
|
|
51
70
|
}
|
|
52
71
|
|
|
53
72
|
initChildInputs() {
|
|
@@ -5,25 +5,42 @@ import { CustomElementEventArgs } from '../../framework/CustomEvents';
|
|
|
5
5
|
@CustomElement({
|
|
6
6
|
selector: 'text-area-element',
|
|
7
7
|
template: `
|
|
8
|
+
<div class="field-label">
|
|
9
|
+
</div>
|
|
10
|
+
<div class="field-input">
|
|
8
11
|
<div class="wrapper">
|
|
9
12
|
<textarea rows=5 id='text-area-field'></textarea>
|
|
10
|
-
</div
|
|
13
|
+
</div>
|
|
14
|
+
</div>`,
|
|
11
15
|
style: `
|
|
12
|
-
|
|
16
|
+
:host{
|
|
13
17
|
width:100%;
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
}
|
|
19
|
+
.wrapper{
|
|
16
20
|
display:flex;
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
}
|
|
22
|
+
textarea{
|
|
19
23
|
box-sizing: border-box;
|
|
20
24
|
width: 100% !important;
|
|
21
|
-
border:
|
|
22
|
-
|
|
25
|
+
border: .1rem solid #27282D;
|
|
26
|
+
border-radius: .25rem;
|
|
23
27
|
margin: 0.125rem;
|
|
24
28
|
resize: none;
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
}
|
|
30
|
+
textarea::placeholder {
|
|
31
|
+
color: rgb(117, 117, 117);
|
|
32
|
+
}
|
|
33
|
+
.field-label {
|
|
34
|
+
color: #27282d;
|
|
35
|
+
font-size: .75rem;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
word-wrap: break-word;
|
|
38
|
+
}
|
|
39
|
+
.field-input {
|
|
40
|
+
font-size: 0.813rem;
|
|
41
|
+
min-height: 1.438rem;
|
|
42
|
+
}
|
|
43
|
+
`,
|
|
27
44
|
useShadow: true,
|
|
28
45
|
})
|
|
29
46
|
export class TextAreaElement extends CustomInputElement {
|
|
@@ -47,6 +64,7 @@ export class TextAreaElement extends CustomInputElement {
|
|
|
47
64
|
|
|
48
65
|
connectedCallback(): void {
|
|
49
66
|
super.connectedCallback();
|
|
67
|
+
super.addLabel(this.text);
|
|
50
68
|
}
|
|
51
69
|
|
|
52
70
|
initChildInputs() {
|
|
@@ -5,25 +5,43 @@ import { CustomElementEventArgs } from '../../framework/CustomEvents';
|
|
|
5
5
|
@CustomElement({
|
|
6
6
|
selector: 'text-element',
|
|
7
7
|
template: `
|
|
8
|
+
<div class="field-label">
|
|
9
|
+
</div>
|
|
10
|
+
<div class="field-input">
|
|
8
11
|
<div class="wrapper">
|
|
9
12
|
<input type="text" id='text-field' />
|
|
10
|
-
</div
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
11
16
|
style: `
|
|
12
|
-
|
|
17
|
+
:host{
|
|
13
18
|
width:100%;
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
}
|
|
20
|
+
.wrapper{
|
|
16
21
|
display:flex;
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
}
|
|
23
|
+
input{
|
|
19
24
|
box-sizing: border-box;
|
|
20
25
|
width: 100% !important;
|
|
21
|
-
border:
|
|
22
|
-
|
|
26
|
+
border: .1rem solid #27282D;
|
|
27
|
+
border-radius: .25rem;
|
|
23
28
|
margin: 0.125rem;
|
|
24
29
|
resize: none;
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
}
|
|
31
|
+
input::placeholder {
|
|
32
|
+
color: rgb(117, 117, 117);
|
|
33
|
+
}
|
|
34
|
+
.field-label {
|
|
35
|
+
color: #27282d;
|
|
36
|
+
font-size: .75rem;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
}
|
|
40
|
+
.field-input {
|
|
41
|
+
font-size: 0.813rem;
|
|
42
|
+
min-height: 1.438rem;
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
27
45
|
useShadow: true,
|
|
28
46
|
})
|
|
29
47
|
export class TextFieldElement extends CustomInputElement {
|
|
@@ -47,7 +65,8 @@ export class TextFieldElement extends CustomInputElement {
|
|
|
47
65
|
|
|
48
66
|
connectedCallback(): void {
|
|
49
67
|
super.connectedCallback();
|
|
50
|
-
|
|
68
|
+
super.addLabel(this.text);
|
|
69
|
+
}
|
|
51
70
|
|
|
52
71
|
initChildInputs() {
|
|
53
72
|
this.text = super.getChildInput('#text-field');
|
|
@@ -7,12 +7,16 @@ import DomUtility from '../../framework/Utilities/DomUtility';
|
|
|
7
7
|
@CustomElement({
|
|
8
8
|
selector: 'type-ahead-element',
|
|
9
9
|
template: `
|
|
10
|
-
<div class="
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<div
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
<div class="field-label">
|
|
11
|
+
</div>
|
|
12
|
+
<div class="field-input">
|
|
13
|
+
<div class="wrapper" role="combobox" aria-expanded="false" aria-owns="options-list" aria-haspopup="listbox">
|
|
14
|
+
<input type="text" class="text-input" id="text-input" aria-autocomplete="list" aria-controls="options-list" aria-activedescendant="" role="textbox">
|
|
15
|
+
<div id="description" aria-live="polite"></div>
|
|
16
|
+
<div id="options-list" role="listbox" class="options-list" hidden>
|
|
17
|
+
<!-- Options will be dynamically added here -->
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
16
20
|
</div>`,
|
|
17
21
|
style: `
|
|
18
22
|
:host {
|
|
@@ -25,14 +29,17 @@ import DomUtility from '../../framework/Utilities/DomUtility';
|
|
|
25
29
|
justify-content: center;
|
|
26
30
|
align-items: center;
|
|
27
31
|
}
|
|
28
|
-
|
|
32
|
+
.text-input {
|
|
29
33
|
box-sizing: border-box;
|
|
30
34
|
width: 100% !important;
|
|
31
|
-
border:
|
|
32
|
-
|
|
35
|
+
border: .1rem solid #27282D;
|
|
36
|
+
border-radius: .25rem;
|
|
33
37
|
margin: 0.125rem;
|
|
34
38
|
resize: none;
|
|
35
39
|
}
|
|
40
|
+
.text-input::placeholder {
|
|
41
|
+
color: rgb(117, 117, 117);
|
|
42
|
+
}
|
|
36
43
|
.wrapper #description {
|
|
37
44
|
width: 100%;
|
|
38
45
|
padding: 0 0.125rem;
|
|
@@ -69,6 +76,16 @@ import DomUtility from '../../framework/Utilities/DomUtility';
|
|
|
69
76
|
.options-list-item-description {
|
|
70
77
|
font-size: 0.625rem;
|
|
71
78
|
}
|
|
79
|
+
.field-label {
|
|
80
|
+
color: #27282d;
|
|
81
|
+
font-size: .75rem;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
word-wrap: break-word;
|
|
84
|
+
}
|
|
85
|
+
.field-input {
|
|
86
|
+
font-size: 0.813rem;
|
|
87
|
+
min-height: 1.438rem;
|
|
88
|
+
}
|
|
72
89
|
`,
|
|
73
90
|
useShadow: true,
|
|
74
91
|
})
|
|
@@ -122,6 +139,7 @@ export class TypeAheadElement extends CustomInputElement {
|
|
|
122
139
|
|
|
123
140
|
connectedCallback(): void {
|
|
124
141
|
super.connectedCallback();
|
|
142
|
+
super.addLabel(this.textInputElement);
|
|
125
143
|
}
|
|
126
144
|
|
|
127
145
|
initChildInputs() {
|