@luftborn/custom-elements 1.1.44 → 1.4.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/README.md +2 -2
- package/assets/style.css +277 -277
- package/azure-pipeline.yml +54 -0
- package/demo/index.html +585 -585
- package/demo/index.js +6109 -0
- package/demo/index.min.js +6110 -0
- package/demo/index.min.js.map +1 -0
- package/demo/index.ts +11 -11
- package/demo/old/index.html +586 -586
- package/demo/old/index.js +10849 -10849
- package/demo/old/index.min.js +10850 -10850
- package/demo/old/index.ts +10 -10
- package/dist/custom-form.d.ts +20 -20
- package/dist/custom-form.js +147 -146
- package/dist/custom-form.js.map +1 -1
- package/dist/elements/Address/AddressElement.d.ts +28 -28
- package/dist/elements/Address/AddressElement.js +206 -206
- package/dist/elements/BankField/BankFieldElement.d.ts +22 -22
- package/dist/elements/BankField/BankFieldElement.js +127 -127
- package/dist/elements/CPRElement/CPRElement.d.ts +14 -14
- package/dist/elements/CPRElement/CPRElement.js +82 -82
- package/dist/elements/CVRElement/CVRElement.d.ts +14 -14
- package/dist/elements/CVRElement/CVRElement.js +82 -82
- package/dist/elements/CheckBoxElement/CheckBoxElement.d.ts +14 -14
- package/dist/elements/CheckBoxElement/CheckBoxElement.js +96 -96
- package/dist/elements/CheckBoxElement/CheckBoxElement.js.map +1 -1
- package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.d.ts +12 -12
- package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.js +82 -82
- package/dist/elements/DateField/DateFieldElement.d.ts +12 -12
- package/dist/elements/DateField/DateFieldElement.js +85 -85
- package/dist/elements/DropDownList/DropDownListElement.d.ts +14 -14
- package/dist/elements/DropDownList/DropDownListElement.js +93 -93
- package/dist/elements/DropDownList/DropDownListElement.js.map +1 -1
- package/dist/elements/Elements.d.ts +18 -18
- package/dist/elements/Elements.js +37 -37
- package/dist/elements/EmailField/EmailFieldElement.d.ts +13 -13
- package/dist/elements/EmailField/EmailFieldElement.js +83 -83
- package/dist/elements/FileField/FileFieldElement.d.ts +15 -12
- package/dist/elements/FileField/FileFieldElement.js +103 -83
- package/dist/elements/FileField/FileFieldElement.js.map +1 -1
- package/dist/elements/IdentificationElement/IdentificationElement.d.ts +18 -18
- package/dist/elements/IdentificationElement/IdentificationElement.js +94 -94
- package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.d.ts +16 -16
- package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.js +114 -108
- package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.js.map +1 -1
- package/dist/elements/NumericField/NumericFieldElement.d.ts +12 -12
- package/dist/elements/NumericField/NumericFieldElement.js +91 -91
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.d.ts +14 -14
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js +99 -99
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js.map +1 -1
- package/dist/elements/TextAreaElement/TextAreaElement.d.ts +12 -12
- package/dist/elements/TextAreaElement/TextAreaElement.js +79 -79
- package/dist/elements/TextField/TextFieldElement.d.ts +12 -12
- package/dist/elements/TextField/TextFieldElement.js +79 -79
- package/dist/elements/TypeAhead/TypeAheadElement.d.ts +24 -24
- package/dist/elements/TypeAhead/TypeAheadElement.js +209 -209
- package/dist/framework/CustomEvents.d.ts +21 -21
- package/dist/framework/CustomEvents.js +47 -47
- package/dist/framework/CustomInputElement.d.ts +50 -50
- package/dist/framework/CustomInputElement.js +258 -257
- package/dist/framework/CustomInputElement.js.map +1 -1
- package/dist/framework/Language/Languages/Base/BaseDictionary.d.ts +4 -4
- package/dist/framework/Language/Languages/Base/BaseDictionary.js +20 -20
- package/dist/framework/Language/Languages/CzechDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/CzechDictionary.js +40 -0
- package/dist/framework/Language/Languages/CzechDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/DanishDictionary.d.ts +4 -4
- package/dist/framework/Language/Languages/DanishDictionary.js +39 -39
- package/dist/framework/Language/Languages/DutchDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/DutchDictionary.js +40 -0
- package/dist/framework/Language/Languages/DutchDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/EnglishDictionary.d.ts +4 -4
- package/dist/framework/Language/Languages/EnglishDictionary.js +39 -39
- package/dist/framework/Language/Languages/EstonianDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/EstonianDictionary.js +40 -0
- package/dist/framework/Language/Languages/EstonianDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/FinnishDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/FinnishDictionary.js +40 -0
- package/dist/framework/Language/Languages/FinnishDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/FrenchDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/FrenchDictionary.js +40 -0
- package/dist/framework/Language/Languages/FrenchDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/GermanDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/GermanDictionary.js +40 -0
- package/dist/framework/Language/Languages/GermanDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/GreekDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/GreekDictionary.js +40 -0
- package/dist/framework/Language/Languages/GreekDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/HungarianDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/HungarianDictionary.js +40 -0
- package/dist/framework/Language/Languages/HungarianDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/IcelandicDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/IcelandicDictionary.js +40 -0
- package/dist/framework/Language/Languages/IcelandicDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/ItalianDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/ItalianDictionary.js +40 -0
- package/dist/framework/Language/Languages/ItalianDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/LatvianDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/LatvianDictionary.js +40 -0
- package/dist/framework/Language/Languages/LatvianDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/LituanianDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/LituanianDictionary.js +40 -0
- package/dist/framework/Language/Languages/LituanianDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/NorwegianDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/NorwegianDictionary.js +40 -0
- package/dist/framework/Language/Languages/NorwegianDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/PolishDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/PolishDictionary.js +40 -0
- package/dist/framework/Language/Languages/PolishDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/PortugueseDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/PortugueseDictionary.js +40 -0
- package/dist/framework/Language/Languages/PortugueseDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/SpanishDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/SpanishDictionary.js +40 -0
- package/dist/framework/Language/Languages/SpanishDictionary.js.map +1 -0
- package/dist/framework/Language/Languages/SwedishDictionary.d.ts +4 -0
- package/dist/framework/Language/Languages/SwedishDictionary.js +40 -0
- package/dist/framework/Language/Languages/SwedishDictionary.js.map +1 -0
- package/dist/framework/Language/Translator.d.ts +23 -6
- package/dist/framework/Language/Translator.js +115 -32
- package/dist/framework/Language/Translator.js.map +1 -1
- package/dist/framework/Models/OptionWithDescription.d.ts +6 -6
- package/dist/framework/Models/OptionWithDescription.js +9 -9
- package/dist/framework/Polyfills/getAttributeNamesPolyfill.d.ts +1 -1
- package/dist/framework/Polyfills/getAttributeNamesPolyfill.js +17 -17
- package/dist/framework/Translations/CaseConverter.d.ts +5 -5
- package/dist/framework/Translations/CaseConverter.js +50 -50
- package/dist/framework/Utilities/ArrayUtil.d.ts +6 -0
- package/dist/framework/Utilities/ArrayUtil.js +37 -0
- package/dist/framework/Utilities/ArrayUtil.js.map +1 -0
- package/dist/framework/Utilities/DomUtil.d.ts +21 -0
- package/dist/framework/Utilities/DomUtil.js +102 -0
- package/dist/framework/Utilities/DomUtil.js.map +1 -0
- package/dist/framework/Utilities/DomUtility.d.ts +3 -3
- package/dist/framework/Utilities/DomUtility.js +12 -12
- package/dist/framework/Utilities/MakeRequest.d.ts +8 -0
- package/dist/framework/Utilities/MakeRequest.js +49 -0
- package/dist/framework/Utilities/MakeRequest.js.map +1 -0
- package/dist/framework/Utilities/StringUtil.d.ts +4 -0
- package/dist/framework/Utilities/StringUtil.js +17 -0
- package/dist/framework/Utilities/StringUtil.js.map +1 -0
- package/dist/framework/Utilities/ViewportUtil.d.ts +8 -0
- package/dist/framework/Utilities/ViewportUtil.js +43 -0
- package/dist/framework/Utilities/ViewportUtil.js.map +1 -0
- package/dist/framework/Utilities/debouncer.d.ts +8 -8
- package/dist/framework/Utilities/debouncer.js +51 -51
- package/dist/framework/Validation/IValidator.interface.d.ts +3 -3
- package/dist/framework/Validation/IValidator.interface.js +2 -2
- package/dist/framework/Validation/Validators/BankAccount.d.ts +4 -4
- package/dist/framework/Validation/Validators/BankAccount.js +12 -12
- package/dist/framework/Validation/Validators/BankAccountRegistrationNumber.d.ts +4 -4
- package/dist/framework/Validation/Validators/BankAccountRegistrationNumber.js +12 -12
- package/dist/framework/Validation/Validators/BankIdNorway.d.ts +5 -5
- package/dist/framework/Validation/Validators/BankIdNorway.js +21 -21
- package/dist/framework/Validation/Validators/BankIdSweden.d.ts +5 -5
- package/dist/framework/Validation/Validators/BankIdSweden.js +21 -21
- package/dist/framework/Validation/Validators/CPR.d.ts +9 -9
- package/dist/framework/Validation/Validators/CPR.js +75 -75
- package/dist/framework/Validation/Validators/CVR.d.ts +5 -5
- package/dist/framework/Validation/Validators/CVR.js +30 -30
- package/dist/framework/custom-element.decorator.d.ts +9 -9
- package/dist/framework/custom-element.decorator.js +51 -51
- package/dist/index.d.ts +7 -7
- package/dist/index.js +14 -14
- package/node_modules/@webcomponents/webcomponentsjs/CHANGELOG.md +15 -0
- package/node_modules/@webcomponents/webcomponentsjs/README.md +13 -0
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js +31 -31
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js +15 -13
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_js.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +237 -223
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce.js +188 -176
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js +155 -144
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/package.json +31 -64
- package/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-pf_dom-index.js +2 -0
- package/node_modules/@webcomponents/webcomponentsjs/src/platform/event-listener-options.js +122 -0
- package/node_modules/@webcomponents/webcomponentsjs/src/platform/toggle-attribute.js +39 -0
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.d.ts +1 -0
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js +239 -225
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js +35 -3
- package/package.json +38 -39
- package/src/custom-form.ts +140 -139
- package/src/elements/Address/AddressElement.ts +216 -216
- package/src/elements/BankField/BankFieldElement.ts +127 -127
- package/src/elements/CPRElement/CPRElement.ts +74 -74
- package/src/elements/CVRElement/CVRElement.ts +75 -75
- package/src/elements/CheckBoxElement/CheckBoxElement.ts +99 -99
- package/src/elements/CustomRegularExpression/CustomRegularExpressionElement.ts +75 -75
- package/src/elements/DateField/DateFieldElement.ts +78 -78
- package/src/elements/DropDownList/DropDownListElement.ts +100 -100
- package/src/elements/Elements.ts +37 -37
- package/src/elements/EmailField/EmailFieldElement.ts +78 -78
- package/src/elements/FileField/FileFieldElement.ts +96 -76
- package/src/elements/IdentificationElement/IdentificationElement.ts +104 -104
- package/src/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.ts +116 -111
- package/src/elements/NumericField/NumericFieldElement.ts +84 -84
- package/src/elements/RadioButtonGroup/RadioButtonGroupElement.ts +103 -103
- package/src/elements/TextAreaElement/TextAreaElement.ts +72 -72
- package/src/elements/TextField/TextFieldElement.ts +72 -72
- package/src/elements/TypeAhead/TypeAheadElement.ts +248 -248
- package/src/framework/CustomEvents.ts +47 -47
- package/src/framework/CustomInputElement.ts +277 -276
- package/src/framework/Language/Languages/Base/BaseDictionary.ts +15 -15
- package/src/framework/Language/Languages/CzechDictionary.ts +18 -0
- package/src/framework/Language/Languages/DanishDictionary.ts +17 -17
- package/src/framework/Language/Languages/DutchDictionary.ts +18 -0
- package/src/framework/Language/Languages/EnglishDictionary.ts +18 -18
- package/src/framework/Language/Languages/EstonianDictionary.ts +18 -0
- package/src/framework/Language/Languages/FinnishDictionary.ts +18 -0
- package/src/framework/Language/Languages/FrenchDictionary.ts +18 -0
- package/src/framework/Language/Languages/GermanDictionary.ts +18 -0
- package/src/framework/Language/Languages/GreekDictionary.ts +18 -0
- package/src/framework/Language/Languages/HungarianDictionary.ts +18 -0
- package/src/framework/Language/Languages/IcelandicDictionary.ts +18 -0
- package/src/framework/Language/Languages/ItalianDictionary.ts +18 -0
- package/src/framework/Language/Languages/LatvianDictionary.ts +18 -0
- package/src/framework/Language/Languages/LituanianDictionary.ts +18 -0
- package/src/framework/Language/Languages/NorwegianDictionary.ts +18 -0
- package/src/framework/Language/Languages/PolishDictionary.ts +18 -0
- package/src/framework/Language/Languages/PortugueseDictionary.ts +18 -0
- package/src/framework/Language/Languages/SpanishDictionary.ts +18 -0
- package/src/framework/Language/Languages/SwedishDictionary.ts +18 -0
- package/src/framework/Language/Translator.ts +110 -26
- package/src/framework/Models/OptionWithDescription.ts +8 -8
- package/src/framework/Polyfills/getAttributeNamesPolyfill.ts +13 -13
- package/src/framework/Translations/CaseConverter.ts +43 -43
- package/src/framework/Utilities/ArrayUtil.ts +31 -0
- package/src/framework/Utilities/DomUtil.ts +117 -0
- package/src/framework/Utilities/DomUtility.ts +6 -6
- package/src/framework/Utilities/MakeRequest.ts +47 -0
- package/src/framework/Utilities/StringUtil.ts +9 -0
- package/src/framework/Utilities/ViewportUtil.ts +46 -0
- package/src/framework/Utilities/debouncer.ts +66 -66
- package/src/framework/Validation/IValidator.interface.ts +3 -3
- package/src/framework/Validation/Validators/BankAccount.ts +7 -7
- package/src/framework/Validation/Validators/BankAccountRegistrationNumber.ts +8 -8
- package/src/framework/Validation/Validators/BankIdNorway.ts +21 -21
- package/src/framework/Validation/Validators/BankIdSweden.ts +21 -21
- package/src/framework/Validation/Validators/CPR.ts +82 -82
- package/src/framework/Validation/Validators/CVR.ts +27 -27
- package/src/framework/custom-element.decorator.ts +57 -57
- package/src/index.ts +12 -12
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
2
|
-
import { Plugin } from 'intl-tel-input';
|
|
3
|
-
export declare class IntPhoneFieldElement extends CustomInputElement {
|
|
4
|
-
phone: HTMLInputElement;
|
|
5
|
-
fullPhone: HTMLInputElement;
|
|
6
|
-
intlTelInput: Plugin;
|
|
7
|
-
constructor();
|
|
8
|
-
get value(): string;
|
|
9
|
-
set value(value: string);
|
|
10
|
-
get valid(): boolean;
|
|
11
|
-
connectedCallback(): void;
|
|
12
|
-
initChildInputs(): void;
|
|
13
|
-
setIntlTelInput(): void;
|
|
14
|
-
change($event: any): void;
|
|
15
|
-
validate(): void;
|
|
16
|
-
}
|
|
1
|
+
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
2
|
+
import { Plugin } from 'intl-tel-input';
|
|
3
|
+
export declare class IntPhoneFieldElement extends CustomInputElement {
|
|
4
|
+
phone: HTMLInputElement;
|
|
5
|
+
fullPhone: HTMLInputElement;
|
|
6
|
+
intlTelInput: Plugin;
|
|
7
|
+
constructor();
|
|
8
|
+
get value(): string;
|
|
9
|
+
set value(value: string);
|
|
10
|
+
get valid(): boolean;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
initChildInputs(): void;
|
|
13
|
+
setIntlTelInput(): void;
|
|
14
|
+
change($event: any): void;
|
|
15
|
+
validate(): void;
|
|
16
|
+
}
|
|
@@ -1,109 +1,115 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.IntPhoneFieldElement = void 0;
|
|
25
|
-
var custom_element_decorator_1 = require("../../framework/custom-element.decorator");
|
|
26
|
-
var CustomInputElement_1 = require("../../framework/CustomInputElement");
|
|
27
|
-
var CustomEvents_1 = require("../../framework/CustomEvents");
|
|
28
|
-
var intlTelInput = require("intl-tel-input");
|
|
29
|
-
var
|
|
30
|
-
var IntPhoneFieldElement = /** @class */ (function (_super) {
|
|
31
|
-
__extends(IntPhoneFieldElement, _super);
|
|
32
|
-
function IntPhoneFieldElement() {
|
|
33
|
-
return _super.call(this) || this;
|
|
34
|
-
}
|
|
35
|
-
Object.defineProperty(IntPhoneFieldElement.prototype, "value", {
|
|
36
|
-
get: function () {
|
|
37
|
-
return this.intlTelInput.getNumber();
|
|
38
|
-
},
|
|
39
|
-
set: function (value) {
|
|
40
|
-
this.phone.value = value;
|
|
41
|
-
},
|
|
42
|
-
enumerable: false,
|
|
43
|
-
configurable: true
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(IntPhoneFieldElement.prototype, "valid", {
|
|
46
|
-
get: function () {
|
|
47
|
-
var patternValid = !this.intlTelInput.getNumber() || this.intlTelInput.isValidNumber();
|
|
48
|
-
return patternValid && this.phone.validity.valid;
|
|
49
|
-
},
|
|
50
|
-
enumerable: false,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
IntPhoneFieldElement.prototype.connectedCallback = function () {
|
|
54
|
-
this.setIntlTelInput();
|
|
55
|
-
_super.prototype.connectedCallback.call(this);
|
|
56
|
-
};
|
|
57
|
-
IntPhoneFieldElement.prototype.initChildInputs = function () {
|
|
58
|
-
this.phone.addEventListener('change', this.change.bind(this));
|
|
59
|
-
if (this.required) {
|
|
60
|
-
this.phone.setAttribute('required', '');
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
IntPhoneFieldElement.prototype.setIntlTelInput = function () {
|
|
64
|
-
var _this = this;
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.IntPhoneFieldElement = void 0;
|
|
25
|
+
var custom_element_decorator_1 = require("../../framework/custom-element.decorator");
|
|
26
|
+
var CustomInputElement_1 = require("../../framework/CustomInputElement");
|
|
27
|
+
var CustomEvents_1 = require("../../framework/CustomEvents");
|
|
28
|
+
var intlTelInput = require("intl-tel-input");
|
|
29
|
+
var MakeRequest_1 = require("../../framework/Utilities/MakeRequest");
|
|
30
|
+
var IntPhoneFieldElement = /** @class */ (function (_super) {
|
|
31
|
+
__extends(IntPhoneFieldElement, _super);
|
|
32
|
+
function IntPhoneFieldElement() {
|
|
33
|
+
return _super.call(this) || this;
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(IntPhoneFieldElement.prototype, "value", {
|
|
36
|
+
get: function () {
|
|
37
|
+
return this.intlTelInput.getNumber();
|
|
38
|
+
},
|
|
39
|
+
set: function (value) {
|
|
40
|
+
this.phone.value = value;
|
|
41
|
+
},
|
|
42
|
+
enumerable: false,
|
|
43
|
+
configurable: true
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(IntPhoneFieldElement.prototype, "valid", {
|
|
46
|
+
get: function () {
|
|
47
|
+
var patternValid = !this.intlTelInput.getNumber() || this.intlTelInput.isValidNumber();
|
|
48
|
+
return patternValid && this.phone.validity.valid;
|
|
49
|
+
},
|
|
50
|
+
enumerable: false,
|
|
51
|
+
configurable: true
|
|
52
|
+
});
|
|
53
|
+
IntPhoneFieldElement.prototype.connectedCallback = function () {
|
|
54
|
+
this.setIntlTelInput();
|
|
55
|
+
_super.prototype.connectedCallback.call(this);
|
|
56
|
+
};
|
|
57
|
+
IntPhoneFieldElement.prototype.initChildInputs = function () {
|
|
58
|
+
this.phone.addEventListener('change', this.change.bind(this));
|
|
59
|
+
if (this.required) {
|
|
60
|
+
this.phone.setAttribute('required', '');
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
IntPhoneFieldElement.prototype.setIntlTelInput = function () {
|
|
64
|
+
var _this = this;
|
|
65
|
+
var _a, _b;
|
|
66
|
+
this.phone = _super.prototype.getChildInput.call(this, '#phone-field');
|
|
67
|
+
var geoIpLookup = function (success, failure) {
|
|
68
|
+
return new MakeRequest_1.default('https://ipinfo.io/json?token=8226138217a68a', 'get', { 'content-type': 'application/json' })
|
|
69
|
+
.send()
|
|
70
|
+
.then(function (request) {
|
|
71
|
+
var res = JSON.parse(request);
|
|
72
|
+
return success(res.country);
|
|
73
|
+
})
|
|
74
|
+
.catch(function (err) {
|
|
75
|
+
return success('DK');
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
var isIplookUpDisabled = ((_a = this.getAttribute('data-disable-iplookup')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "true";
|
|
79
|
+
var defaultCountry = isIplookUpDisabled ? 'dk' : 'auto';
|
|
80
|
+
var country = (_b = this.getAttribute('data-country')) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
81
|
+
this.intlTelInput = intlTelInput(this.phone, {
|
|
82
|
+
geoIpLookup: isIplookUpDisabled ? null : geoIpLookup,
|
|
83
|
+
hiddenInput: 'fullphone',
|
|
84
|
+
initialCountry: country !== null && country !== void 0 ? country : defaultCountry,
|
|
85
|
+
preferredCountries: ["dk", "se", "gb"],
|
|
86
|
+
nationalMode: true,
|
|
87
|
+
utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/15.0.1/js/utils.js',
|
|
88
|
+
});
|
|
89
|
+
this.intlTelInput.promise.then(function (e) {
|
|
90
|
+
setTimeout(function () {
|
|
91
|
+
_this.fullPhone = _super.prototype.getChildInput.call(_this, '[name="fullphone"]');
|
|
92
|
+
}, 1000);
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
// events
|
|
96
|
+
IntPhoneFieldElement.prototype.change = function ($event) {
|
|
97
|
+
this.touched = true;
|
|
98
|
+
this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
|
|
99
|
+
};
|
|
100
|
+
IntPhoneFieldElement.prototype.validate = function () {
|
|
101
|
+
this.valid;
|
|
102
|
+
this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
|
|
103
|
+
};
|
|
104
|
+
IntPhoneFieldElement = __decorate([
|
|
105
|
+
(0, custom_element_decorator_1.default)({
|
|
106
|
+
selector: 'int-phone-element',
|
|
107
|
+
template: "\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.0/css/intlTelInput.css\" >\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"tel\" id=\"phone-field\" />\n\t\t\t</div>",
|
|
108
|
+
style: "\n :host{\n width:100%;\n }\n .wrapper{\n display:flex;\n }\n .iti {\n width: 100% !important;\n }\n input{\n box-sizing: border-box;\n width: 100% !important;\n border: none;\n background-color: #f1f4ff;\n margin: 2px;\n resize: none;\n }\n ",
|
|
109
|
+
useShadow: true,
|
|
110
|
+
})
|
|
111
|
+
], IntPhoneFieldElement);
|
|
112
|
+
return IntPhoneFieldElement;
|
|
113
|
+
}(CustomInputElement_1.CustomInputElement));
|
|
114
|
+
exports.IntPhoneFieldElement = IntPhoneFieldElement;
|
|
109
115
|
//# sourceMappingURL=InternationaPhoneNumberElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternationaPhoneNumberElement.js","sourceRoot":"","sources":["../../../src/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAqE;AACrE,yEAAwE;AACxE,6DAAsE;AACtE,6CAA+C;AAE/C,
|
|
1
|
+
{"version":3,"file":"InternationaPhoneNumberElement.js","sourceRoot":"","sources":["../../../src/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
2
|
-
export declare class NumericFieldElement extends CustomInputElement {
|
|
3
|
-
number: HTMLInputElement;
|
|
4
|
-
constructor();
|
|
5
|
-
get value(): any;
|
|
6
|
-
set value(value: any);
|
|
7
|
-
get valid(): boolean;
|
|
8
|
-
connectedCallback(): void;
|
|
9
|
-
initChildInputs(): void;
|
|
10
|
-
change($event: any): void;
|
|
11
|
-
validate(): void;
|
|
12
|
-
}
|
|
1
|
+
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
2
|
+
export declare class NumericFieldElement extends CustomInputElement {
|
|
3
|
+
number: HTMLInputElement;
|
|
4
|
+
constructor();
|
|
5
|
+
get value(): any;
|
|
6
|
+
set value(value: any);
|
|
7
|
+
get valid(): boolean;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
initChildInputs(): void;
|
|
10
|
+
change($event: any): void;
|
|
11
|
+
validate(): void;
|
|
12
|
+
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.NumericFieldElement = void 0;
|
|
25
|
-
var custom_element_decorator_1 = require("../../framework/custom-element.decorator");
|
|
26
|
-
var CustomInputElement_1 = require("../../framework/CustomInputElement");
|
|
27
|
-
var CustomEvents_1 = require("../../framework/CustomEvents");
|
|
28
|
-
var NumericFieldElement = /** @class */ (function (_super) {
|
|
29
|
-
__extends(NumericFieldElement, _super);
|
|
30
|
-
function NumericFieldElement() {
|
|
31
|
-
return _super.call(this) || this;
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(NumericFieldElement.prototype, "value", {
|
|
34
|
-
get: function () {
|
|
35
|
-
if (isNaN(this.number.valueAsNumber)) {
|
|
36
|
-
return '';
|
|
37
|
-
}
|
|
38
|
-
return this.number.valueAsNumber;
|
|
39
|
-
},
|
|
40
|
-
set: function (value) {
|
|
41
|
-
this.number.valueAsNumber = value;
|
|
42
|
-
},
|
|
43
|
-
enumerable: false,
|
|
44
|
-
configurable: true
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(NumericFieldElement.prototype, "valid", {
|
|
47
|
-
get: function () {
|
|
48
|
-
return this.number.validity.valid;
|
|
49
|
-
},
|
|
50
|
-
enumerable: false,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
NumericFieldElement.prototype.connectedCallback = function () {
|
|
54
|
-
_super.prototype.connectedCallback.call(this);
|
|
55
|
-
};
|
|
56
|
-
NumericFieldElement.prototype.initChildInputs = function () {
|
|
57
|
-
this.number = _super.prototype.getChildInput.call(this, '#numeric-field');
|
|
58
|
-
this.number.addEventListener('change', this.change.bind(this));
|
|
59
|
-
if (this.required) {
|
|
60
|
-
this.number.setAttribute('required', '');
|
|
61
|
-
}
|
|
62
|
-
if (this.max) {
|
|
63
|
-
this.number.setAttribute('max', this.max);
|
|
64
|
-
}
|
|
65
|
-
if (this.min) {
|
|
66
|
-
this.number.setAttribute('min', this.min);
|
|
67
|
-
}
|
|
68
|
-
if (this.step) {
|
|
69
|
-
this.number.setAttribute('step', this.step);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
// events
|
|
73
|
-
NumericFieldElement.prototype.change = function ($event) {
|
|
74
|
-
this.touched = true;
|
|
75
|
-
this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
|
|
76
|
-
};
|
|
77
|
-
NumericFieldElement.prototype.validate = function () {
|
|
78
|
-
this.valid;
|
|
79
|
-
this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
|
|
80
|
-
};
|
|
81
|
-
NumericFieldElement = __decorate([
|
|
82
|
-
(0, custom_element_decorator_1.default)({
|
|
83
|
-
selector: 'numeric-element',
|
|
84
|
-
template: "\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"number\" id='numeric-field'/>\n\t\t\t</div>",
|
|
85
|
-
style: "\n :host{\n width:100%;\n }\n .wrapper{\n display:flex;\n }\n input{\n box-sizing: border-box;\n width: 100% !important;\n border: none;\n background-color: #f1f4ff;\n margin: 2px;\n resize: none;\n }\n ",
|
|
86
|
-
useShadow: true,
|
|
87
|
-
})
|
|
88
|
-
], NumericFieldElement);
|
|
89
|
-
return NumericFieldElement;
|
|
90
|
-
}(CustomInputElement_1.CustomInputElement));
|
|
91
|
-
exports.NumericFieldElement = NumericFieldElement;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.NumericFieldElement = void 0;
|
|
25
|
+
var custom_element_decorator_1 = require("../../framework/custom-element.decorator");
|
|
26
|
+
var CustomInputElement_1 = require("../../framework/CustomInputElement");
|
|
27
|
+
var CustomEvents_1 = require("../../framework/CustomEvents");
|
|
28
|
+
var NumericFieldElement = /** @class */ (function (_super) {
|
|
29
|
+
__extends(NumericFieldElement, _super);
|
|
30
|
+
function NumericFieldElement() {
|
|
31
|
+
return _super.call(this) || this;
|
|
32
|
+
}
|
|
33
|
+
Object.defineProperty(NumericFieldElement.prototype, "value", {
|
|
34
|
+
get: function () {
|
|
35
|
+
if (isNaN(this.number.valueAsNumber)) {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
return this.number.valueAsNumber;
|
|
39
|
+
},
|
|
40
|
+
set: function (value) {
|
|
41
|
+
this.number.valueAsNumber = value;
|
|
42
|
+
},
|
|
43
|
+
enumerable: false,
|
|
44
|
+
configurable: true
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(NumericFieldElement.prototype, "valid", {
|
|
47
|
+
get: function () {
|
|
48
|
+
return this.number.validity.valid;
|
|
49
|
+
},
|
|
50
|
+
enumerable: false,
|
|
51
|
+
configurable: true
|
|
52
|
+
});
|
|
53
|
+
NumericFieldElement.prototype.connectedCallback = function () {
|
|
54
|
+
_super.prototype.connectedCallback.call(this);
|
|
55
|
+
};
|
|
56
|
+
NumericFieldElement.prototype.initChildInputs = function () {
|
|
57
|
+
this.number = _super.prototype.getChildInput.call(this, '#numeric-field');
|
|
58
|
+
this.number.addEventListener('change', this.change.bind(this));
|
|
59
|
+
if (this.required) {
|
|
60
|
+
this.number.setAttribute('required', '');
|
|
61
|
+
}
|
|
62
|
+
if (this.max) {
|
|
63
|
+
this.number.setAttribute('max', this.max);
|
|
64
|
+
}
|
|
65
|
+
if (this.min) {
|
|
66
|
+
this.number.setAttribute('min', this.min);
|
|
67
|
+
}
|
|
68
|
+
if (this.step) {
|
|
69
|
+
this.number.setAttribute('step', this.step);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
// events
|
|
73
|
+
NumericFieldElement.prototype.change = function ($event) {
|
|
74
|
+
this.touched = true;
|
|
75
|
+
this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
|
|
76
|
+
};
|
|
77
|
+
NumericFieldElement.prototype.validate = function () {
|
|
78
|
+
this.valid;
|
|
79
|
+
this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
|
|
80
|
+
};
|
|
81
|
+
NumericFieldElement = __decorate([
|
|
82
|
+
(0, custom_element_decorator_1.default)({
|
|
83
|
+
selector: 'numeric-element',
|
|
84
|
+
template: "\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"number\" id='numeric-field'/>\n\t\t\t</div>",
|
|
85
|
+
style: "\n :host{\n width:100%;\n }\n .wrapper{\n display:flex;\n }\n input{\n box-sizing: border-box;\n width: 100% !important;\n border: none;\n background-color: #f1f4ff;\n margin: 2px;\n resize: none;\n }\n ",
|
|
86
|
+
useShadow: true,
|
|
87
|
+
})
|
|
88
|
+
], NumericFieldElement);
|
|
89
|
+
return NumericFieldElement;
|
|
90
|
+
}(CustomInputElement_1.CustomInputElement));
|
|
91
|
+
exports.NumericFieldElement = NumericFieldElement;
|
|
92
92
|
//# sourceMappingURL=NumericFieldElement.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
2
|
-
export declare class RadioButtonGroupElement extends CustomInputElement {
|
|
3
|
-
radioButton: HTMLInputElement[];
|
|
4
|
-
radioButtonTemplate: string;
|
|
5
|
-
constructor();
|
|
6
|
-
get value(): string;
|
|
7
|
-
set value(value: string);
|
|
8
|
-
get valid(): boolean;
|
|
9
|
-
connectedCallback(): void;
|
|
10
|
-
initChildInputs(): void;
|
|
11
|
-
private addRadioButtons;
|
|
12
|
-
change($event: any): void;
|
|
13
|
-
validate(): void;
|
|
14
|
-
}
|
|
1
|
+
import { CustomInputElement } from '../../framework/CustomInputElement';
|
|
2
|
+
export declare class RadioButtonGroupElement extends CustomInputElement {
|
|
3
|
+
radioButton: HTMLInputElement[];
|
|
4
|
+
radioButtonTemplate: string;
|
|
5
|
+
constructor();
|
|
6
|
+
get value(): string;
|
|
7
|
+
set value(value: string);
|
|
8
|
+
get valid(): boolean;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
initChildInputs(): void;
|
|
11
|
+
private addRadioButtons;
|
|
12
|
+
change($event: any): void;
|
|
13
|
+
validate(): void;
|
|
14
|
+
}
|