@luftborn/custom-elements 1.4.0 → 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.
Files changed (196) hide show
  1. package/README.md +2 -2
  2. package/assets/style.css +277 -277
  3. package/azure-pipeline.yml +54 -0
  4. package/demo/index.html +585 -585
  5. package/demo/index.js +6109 -0
  6. package/demo/index.min.js +6110 -0
  7. package/demo/index.min.js.map +1 -0
  8. package/demo/index.ts +11 -11
  9. package/demo/old/index.html +586 -586
  10. package/demo/old/index.js +10849 -10849
  11. package/demo/old/index.min.js +10850 -10850
  12. package/demo/old/index.ts +10 -10
  13. package/dist/custom-form.d.ts +20 -20
  14. package/dist/custom-form.js +147 -147
  15. package/dist/elements/Address/AddressElement.d.ts +28 -28
  16. package/dist/elements/Address/AddressElement.js +206 -206
  17. package/dist/elements/BankField/BankFieldElement.d.ts +22 -22
  18. package/dist/elements/BankField/BankFieldElement.js +127 -127
  19. package/dist/elements/CPRElement/CPRElement.d.ts +14 -14
  20. package/dist/elements/CPRElement/CPRElement.js +82 -82
  21. package/dist/elements/CVRElement/CVRElement.d.ts +14 -14
  22. package/dist/elements/CVRElement/CVRElement.js +82 -82
  23. package/dist/elements/CheckBoxElement/CheckBoxElement.d.ts +14 -14
  24. package/dist/elements/CheckBoxElement/CheckBoxElement.js +96 -96
  25. package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.d.ts +12 -12
  26. package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.js +82 -82
  27. package/dist/elements/DateField/DateFieldElement.d.ts +12 -12
  28. package/dist/elements/DateField/DateFieldElement.js +85 -85
  29. package/dist/elements/DropDownList/DropDownListElement.d.ts +14 -14
  30. package/dist/elements/DropDownList/DropDownListElement.js +93 -93
  31. package/dist/elements/Elements.d.ts +18 -18
  32. package/dist/elements/Elements.js +37 -37
  33. package/dist/elements/EmailField/EmailFieldElement.d.ts +13 -13
  34. package/dist/elements/EmailField/EmailFieldElement.js +83 -83
  35. package/dist/elements/FileField/FileFieldElement.d.ts +15 -15
  36. package/dist/elements/FileField/FileFieldElement.js +103 -103
  37. package/dist/elements/IdentificationElement/IdentificationElement.d.ts +18 -18
  38. package/dist/elements/IdentificationElement/IdentificationElement.js +94 -94
  39. package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.d.ts +16 -16
  40. package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.js +114 -114
  41. package/dist/elements/NumericField/NumericFieldElement.d.ts +12 -12
  42. package/dist/elements/NumericField/NumericFieldElement.js +91 -91
  43. package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.d.ts +14 -14
  44. package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js +99 -99
  45. package/dist/elements/TextAreaElement/TextAreaElement.d.ts +12 -12
  46. package/dist/elements/TextAreaElement/TextAreaElement.js +79 -79
  47. package/dist/elements/TextField/TextFieldElement.d.ts +12 -12
  48. package/dist/elements/TextField/TextFieldElement.js +79 -79
  49. package/dist/elements/TypeAhead/TypeAheadElement.d.ts +24 -24
  50. package/dist/elements/TypeAhead/TypeAheadElement.js +209 -209
  51. package/dist/framework/CustomEvents.d.ts +21 -21
  52. package/dist/framework/CustomEvents.js +47 -47
  53. package/dist/framework/CustomInputElement.d.ts +50 -50
  54. package/dist/framework/CustomInputElement.js +258 -258
  55. package/dist/framework/Language/Languages/Base/BaseDictionary.d.ts +4 -4
  56. package/dist/framework/Language/Languages/Base/BaseDictionary.js +20 -20
  57. package/dist/framework/Language/Languages/CzechDictionary.d.ts +4 -4
  58. package/dist/framework/Language/Languages/CzechDictionary.js +39 -39
  59. package/dist/framework/Language/Languages/DanishDictionary.d.ts +4 -4
  60. package/dist/framework/Language/Languages/DanishDictionary.js +39 -39
  61. package/dist/framework/Language/Languages/DutchDictionary.d.ts +4 -4
  62. package/dist/framework/Language/Languages/DutchDictionary.js +39 -39
  63. package/dist/framework/Language/Languages/EnglishDictionary.d.ts +4 -4
  64. package/dist/framework/Language/Languages/EnglishDictionary.js +39 -39
  65. package/dist/framework/Language/Languages/EstonianDictionary.d.ts +4 -4
  66. package/dist/framework/Language/Languages/EstonianDictionary.js +39 -39
  67. package/dist/framework/Language/Languages/FinnishDictionary.d.ts +4 -4
  68. package/dist/framework/Language/Languages/FinnishDictionary.js +39 -39
  69. package/dist/framework/Language/Languages/FrenchDictionary.d.ts +4 -4
  70. package/dist/framework/Language/Languages/FrenchDictionary.js +39 -39
  71. package/dist/framework/Language/Languages/GermanDictionary.d.ts +4 -4
  72. package/dist/framework/Language/Languages/GermanDictionary.js +39 -39
  73. package/dist/framework/Language/Languages/GreekDictionary.d.ts +4 -4
  74. package/dist/framework/Language/Languages/GreekDictionary.js +39 -39
  75. package/dist/framework/Language/Languages/HungarianDictionary.d.ts +4 -4
  76. package/dist/framework/Language/Languages/HungarianDictionary.js +39 -39
  77. package/dist/framework/Language/Languages/IcelandicDictionary.d.ts +4 -4
  78. package/dist/framework/Language/Languages/IcelandicDictionary.js +39 -39
  79. package/dist/framework/Language/Languages/ItalianDictionary.d.ts +4 -4
  80. package/dist/framework/Language/Languages/ItalianDictionary.js +39 -39
  81. package/dist/framework/Language/Languages/LatvianDictionary.d.ts +4 -4
  82. package/dist/framework/Language/Languages/LatvianDictionary.js +39 -39
  83. package/dist/framework/Language/Languages/LituanianDictionary.d.ts +4 -4
  84. package/dist/framework/Language/Languages/LituanianDictionary.js +39 -39
  85. package/dist/framework/Language/Languages/NorwegianDictionary.d.ts +4 -4
  86. package/dist/framework/Language/Languages/NorwegianDictionary.js +39 -39
  87. package/dist/framework/Language/Languages/PolishDictionary.d.ts +4 -4
  88. package/dist/framework/Language/Languages/PolishDictionary.js +39 -39
  89. package/dist/framework/Language/Languages/PortugueseDictionary.d.ts +4 -4
  90. package/dist/framework/Language/Languages/PortugueseDictionary.js +39 -39
  91. package/dist/framework/Language/Languages/SpanishDictionary.d.ts +4 -4
  92. package/dist/framework/Language/Languages/SpanishDictionary.js +39 -39
  93. package/dist/framework/Language/Languages/SwedishDictionary.d.ts +4 -4
  94. package/dist/framework/Language/Languages/SwedishDictionary.js +39 -39
  95. package/dist/framework/Language/Translator.d.ts +23 -23
  96. package/dist/framework/Language/Translator.js +115 -115
  97. package/dist/framework/Models/OptionWithDescription.d.ts +6 -6
  98. package/dist/framework/Models/OptionWithDescription.js +9 -9
  99. package/dist/framework/Polyfills/getAttributeNamesPolyfill.d.ts +1 -1
  100. package/dist/framework/Polyfills/getAttributeNamesPolyfill.js +17 -17
  101. package/dist/framework/Translations/CaseConverter.d.ts +5 -5
  102. package/dist/framework/Translations/CaseConverter.js +50 -50
  103. package/dist/framework/Utilities/ArrayUtil.d.ts +6 -6
  104. package/dist/framework/Utilities/ArrayUtil.js +36 -36
  105. package/dist/framework/Utilities/DomUtil.d.ts +21 -21
  106. package/dist/framework/Utilities/DomUtil.js +101 -101
  107. package/dist/framework/Utilities/DomUtility.d.ts +3 -3
  108. package/dist/framework/Utilities/DomUtility.js +12 -12
  109. package/dist/framework/Utilities/MakeRequest.d.ts +8 -8
  110. package/dist/framework/Utilities/MakeRequest.js +48 -48
  111. package/dist/framework/Utilities/StringUtil.d.ts +4 -4
  112. package/dist/framework/Utilities/StringUtil.js +16 -16
  113. package/dist/framework/Utilities/ViewportUtil.d.ts +8 -8
  114. package/dist/framework/Utilities/ViewportUtil.js +42 -42
  115. package/dist/framework/Utilities/debouncer.d.ts +8 -8
  116. package/dist/framework/Utilities/debouncer.js +51 -51
  117. package/dist/framework/Validation/IValidator.interface.d.ts +3 -3
  118. package/dist/framework/Validation/IValidator.interface.js +2 -2
  119. package/dist/framework/Validation/Validators/BankAccount.d.ts +4 -4
  120. package/dist/framework/Validation/Validators/BankAccount.js +12 -12
  121. package/dist/framework/Validation/Validators/BankAccountRegistrationNumber.d.ts +4 -4
  122. package/dist/framework/Validation/Validators/BankAccountRegistrationNumber.js +12 -12
  123. package/dist/framework/Validation/Validators/BankIdNorway.d.ts +5 -5
  124. package/dist/framework/Validation/Validators/BankIdNorway.js +21 -21
  125. package/dist/framework/Validation/Validators/BankIdSweden.d.ts +5 -5
  126. package/dist/framework/Validation/Validators/BankIdSweden.js +21 -21
  127. package/dist/framework/Validation/Validators/CPR.d.ts +9 -9
  128. package/dist/framework/Validation/Validators/CPR.js +75 -75
  129. package/dist/framework/Validation/Validators/CVR.d.ts +5 -5
  130. package/dist/framework/Validation/Validators/CVR.js +30 -30
  131. package/dist/framework/custom-element.decorator.d.ts +9 -9
  132. package/dist/framework/custom-element.decorator.js +51 -51
  133. package/dist/index.d.ts +7 -7
  134. package/dist/index.js +14 -14
  135. package/package.json +38 -38
  136. package/src/custom-form.ts +140 -140
  137. package/src/elements/Address/AddressElement.ts +216 -216
  138. package/src/elements/BankField/BankFieldElement.ts +127 -127
  139. package/src/elements/CPRElement/CPRElement.ts +74 -74
  140. package/src/elements/CVRElement/CVRElement.ts +75 -75
  141. package/src/elements/CheckBoxElement/CheckBoxElement.ts +99 -99
  142. package/src/elements/CustomRegularExpression/CustomRegularExpressionElement.ts +75 -75
  143. package/src/elements/DateField/DateFieldElement.ts +78 -78
  144. package/src/elements/DropDownList/DropDownListElement.ts +100 -100
  145. package/src/elements/Elements.ts +37 -37
  146. package/src/elements/EmailField/EmailFieldElement.ts +78 -78
  147. package/src/elements/FileField/FileFieldElement.ts +96 -96
  148. package/src/elements/IdentificationElement/IdentificationElement.ts +104 -104
  149. package/src/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.ts +116 -116
  150. package/src/elements/NumericField/NumericFieldElement.ts +84 -84
  151. package/src/elements/RadioButtonGroup/RadioButtonGroupElement.ts +103 -103
  152. package/src/elements/TextAreaElement/TextAreaElement.ts +72 -72
  153. package/src/elements/TextField/TextFieldElement.ts +72 -72
  154. package/src/elements/TypeAhead/TypeAheadElement.ts +248 -248
  155. package/src/framework/CustomEvents.ts +47 -47
  156. package/src/framework/CustomInputElement.ts +277 -277
  157. package/src/framework/Language/Languages/Base/BaseDictionary.ts +15 -15
  158. package/src/framework/Language/Languages/CzechDictionary.ts +18 -18
  159. package/src/framework/Language/Languages/DanishDictionary.ts +17 -17
  160. package/src/framework/Language/Languages/DutchDictionary.ts +17 -17
  161. package/src/framework/Language/Languages/EnglishDictionary.ts +18 -18
  162. package/src/framework/Language/Languages/EstonianDictionary.ts +17 -17
  163. package/src/framework/Language/Languages/FinnishDictionary.ts +17 -17
  164. package/src/framework/Language/Languages/FrenchDictionary.ts +17 -17
  165. package/src/framework/Language/Languages/GermanDictionary.ts +17 -17
  166. package/src/framework/Language/Languages/GreekDictionary.ts +17 -17
  167. package/src/framework/Language/Languages/HungarianDictionary.ts +17 -17
  168. package/src/framework/Language/Languages/IcelandicDictionary.ts +17 -17
  169. package/src/framework/Language/Languages/ItalianDictionary.ts +17 -17
  170. package/src/framework/Language/Languages/LatvianDictionary.ts +17 -17
  171. package/src/framework/Language/Languages/LituanianDictionary.ts +17 -17
  172. package/src/framework/Language/Languages/NorwegianDictionary.ts +17 -17
  173. package/src/framework/Language/Languages/PolishDictionary.ts +17 -17
  174. package/src/framework/Language/Languages/PortugueseDictionary.ts +17 -17
  175. package/src/framework/Language/Languages/SpanishDictionary.ts +17 -17
  176. package/src/framework/Language/Languages/SwedishDictionary.ts +17 -17
  177. package/src/framework/Language/Translator.ts +110 -110
  178. package/src/framework/Models/OptionWithDescription.ts +8 -8
  179. package/src/framework/Polyfills/getAttributeNamesPolyfill.ts +13 -13
  180. package/src/framework/Translations/CaseConverter.ts +43 -43
  181. package/src/framework/Utilities/ArrayUtil.ts +31 -31
  182. package/src/framework/Utilities/DomUtil.ts +117 -117
  183. package/src/framework/Utilities/DomUtility.ts +6 -6
  184. package/src/framework/Utilities/MakeRequest.ts +47 -47
  185. package/src/framework/Utilities/StringUtil.ts +8 -8
  186. package/src/framework/Utilities/ViewportUtil.ts +46 -46
  187. package/src/framework/Utilities/debouncer.ts +66 -66
  188. package/src/framework/Validation/IValidator.interface.ts +3 -3
  189. package/src/framework/Validation/Validators/BankAccount.ts +7 -7
  190. package/src/framework/Validation/Validators/BankAccountRegistrationNumber.ts +8 -8
  191. package/src/framework/Validation/Validators/BankIdNorway.ts +21 -21
  192. package/src/framework/Validation/Validators/BankIdSweden.ts +21 -21
  193. package/src/framework/Validation/Validators/CPR.ts +82 -82
  194. package/src/framework/Validation/Validators/CVR.ts +27 -27
  195. package/src/framework/custom-element.decorator.ts +57 -57
  196. package/src/index.ts +12 -12
@@ -1,84 +1,84 @@
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.EmailFieldElement = 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 EmailFieldElement = /** @class */ (function (_super) {
29
- __extends(EmailFieldElement, _super);
30
- function EmailFieldElement() {
31
- var _this = _super.call(this) || this;
32
- _this.mailRegex = new RegExp(/^([a-zA-Z0-9ÆØÅæøå_.+-])+\@(([a-zA-Z0-9ÆØÅæøå-])+\.)+([a-zA-Z0-9ÆØÅæøå]{2,4})+$/);
33
- return _this;
34
- }
35
- Object.defineProperty(EmailFieldElement.prototype, "value", {
36
- get: function () {
37
- return "" + this.email.value;
38
- },
39
- set: function (value) {
40
- this.email.value = value;
41
- },
42
- enumerable: false,
43
- configurable: true
44
- });
45
- Object.defineProperty(EmailFieldElement.prototype, "valid", {
46
- get: function () {
47
- var patternValid = !this.value || this.mailRegex.test(this.value);
48
- return this.email.validity.valid && patternValid;
49
- },
50
- enumerable: false,
51
- configurable: true
52
- });
53
- EmailFieldElement.prototype.connectedCallback = function () {
54
- this.initChildInputs();
55
- _super.prototype.connectedCallback.call(this);
56
- };
57
- EmailFieldElement.prototype.initChildInputs = function () {
58
- this.email = _super.prototype.getChildInput.call(this, '#email-field');
59
- this.email.addEventListener('change', this.change.bind(this));
60
- if (this.required) {
61
- this.email.setAttribute('required', '');
62
- }
63
- };
64
- // events
65
- EmailFieldElement.prototype.change = function ($event) {
66
- this.touched = true;
67
- this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
68
- };
69
- EmailFieldElement.prototype.validate = function () {
70
- this.valid;
71
- this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
72
- };
73
- EmailFieldElement = __decorate([
74
- (0, custom_element_decorator_1.default)({
75
- selector: 'email-element',
76
- template: "\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"text\" id='email-field'/>\n\t\t\t</div>",
77
- 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 ",
78
- useShadow: true,
79
- })
80
- ], EmailFieldElement);
81
- return EmailFieldElement;
82
- }(CustomInputElement_1.CustomInputElement));
83
- exports.EmailFieldElement = EmailFieldElement;
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.EmailFieldElement = 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 EmailFieldElement = /** @class */ (function (_super) {
29
+ __extends(EmailFieldElement, _super);
30
+ function EmailFieldElement() {
31
+ var _this = _super.call(this) || this;
32
+ _this.mailRegex = new RegExp(/^([a-zA-Z0-9ÆØÅæøå_.+-])+\@(([a-zA-Z0-9ÆØÅæøå-])+\.)+([a-zA-Z0-9ÆØÅæøå]{2,4})+$/);
33
+ return _this;
34
+ }
35
+ Object.defineProperty(EmailFieldElement.prototype, "value", {
36
+ get: function () {
37
+ return "" + this.email.value;
38
+ },
39
+ set: function (value) {
40
+ this.email.value = value;
41
+ },
42
+ enumerable: false,
43
+ configurable: true
44
+ });
45
+ Object.defineProperty(EmailFieldElement.prototype, "valid", {
46
+ get: function () {
47
+ var patternValid = !this.value || this.mailRegex.test(this.value);
48
+ return this.email.validity.valid && patternValid;
49
+ },
50
+ enumerable: false,
51
+ configurable: true
52
+ });
53
+ EmailFieldElement.prototype.connectedCallback = function () {
54
+ this.initChildInputs();
55
+ _super.prototype.connectedCallback.call(this);
56
+ };
57
+ EmailFieldElement.prototype.initChildInputs = function () {
58
+ this.email = _super.prototype.getChildInput.call(this, '#email-field');
59
+ this.email.addEventListener('change', this.change.bind(this));
60
+ if (this.required) {
61
+ this.email.setAttribute('required', '');
62
+ }
63
+ };
64
+ // events
65
+ EmailFieldElement.prototype.change = function ($event) {
66
+ this.touched = true;
67
+ this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
68
+ };
69
+ EmailFieldElement.prototype.validate = function () {
70
+ this.valid;
71
+ this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
72
+ };
73
+ EmailFieldElement = __decorate([
74
+ (0, custom_element_decorator_1.default)({
75
+ selector: 'email-element',
76
+ template: "\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"text\" id='email-field'/>\n\t\t\t</div>",
77
+ 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 ",
78
+ useShadow: true,
79
+ })
80
+ ], EmailFieldElement);
81
+ return EmailFieldElement;
82
+ }(CustomInputElement_1.CustomInputElement));
83
+ exports.EmailFieldElement = EmailFieldElement;
84
84
  //# sourceMappingURL=EmailFieldElement.js.map
@@ -1,15 +1,15 @@
1
- import { CustomInputElement } from '../../framework/CustomInputElement';
2
- export declare class FileFieldElement extends CustomInputElement {
3
- file: HTMLInputElement;
4
- constructor();
5
- get value(): FileList;
6
- set value(files: FileList);
7
- get valid(): boolean;
8
- connectedCallback(): void;
9
- componentDidMount(): void;
10
- initChildInputs(): void;
11
- change($event: any): void;
12
- validate(): void;
13
- attributeChangedCallback(name: string, oldVal: string, newVal: string): void;
14
- private attributeChanged;
15
- }
1
+ import { CustomInputElement } from '../../framework/CustomInputElement';
2
+ export declare class FileFieldElement extends CustomInputElement {
3
+ file: HTMLInputElement;
4
+ constructor();
5
+ get value(): FileList;
6
+ set value(files: FileList);
7
+ get valid(): boolean;
8
+ connectedCallback(): void;
9
+ componentDidMount(): void;
10
+ initChildInputs(): void;
11
+ change($event: any): void;
12
+ validate(): void;
13
+ attributeChangedCallback(name: string, oldVal: string, newVal: string): void;
14
+ private attributeChanged;
15
+ }
@@ -1,104 +1,104 @@
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.FileFieldElement = 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 getAttributeNamesPolyfill_1 = require("../../framework/Polyfills/getAttributeNamesPolyfill");
29
- var FileFieldElement = /** @class */ (function (_super) {
30
- __extends(FileFieldElement, _super);
31
- function FileFieldElement() {
32
- var _this = _super.call(this) || this;
33
- (0, getAttributeNamesPolyfill_1.default)();
34
- return _this;
35
- }
36
- Object.defineProperty(FileFieldElement.prototype, "value", {
37
- get: function () {
38
- return this.file.files;
39
- },
40
- set: function (files) {
41
- this.file.files = files;
42
- },
43
- enumerable: false,
44
- configurable: true
45
- });
46
- Object.defineProperty(FileFieldElement.prototype, "valid", {
47
- get: function () {
48
- return this.file.validity.valid;
49
- },
50
- enumerable: false,
51
- configurable: true
52
- });
53
- FileFieldElement.prototype.connectedCallback = function () {
54
- this.initChildInputs();
55
- _super.prototype.connectedCallback.call(this);
56
- };
57
- FileFieldElement.prototype.componentDidMount = function () {
58
- var _this = this;
59
- this.getAttributeNames().forEach(function (attributeName) {
60
- var attributeValue = _this.getAttribute(attributeName);
61
- _this.attributeChanged(attributeName, null, attributeValue);
62
- });
63
- };
64
- FileFieldElement.prototype.initChildInputs = function () {
65
- this.file = _super.prototype.getChildInput.call(this, '#file-field');
66
- this.file.addEventListener('change', this.change.bind(this));
67
- if (this.required) {
68
- this.file.setAttribute('required', '');
69
- }
70
- if (this.multi) {
71
- this.file.setAttribute('multiple', '');
72
- }
73
- };
74
- // events
75
- FileFieldElement.prototype.change = function ($event) {
76
- this.touched = true;
77
- this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
78
- };
79
- FileFieldElement.prototype.validate = function () {
80
- this.valid;
81
- this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
82
- };
83
- FileFieldElement.prototype.attributeChangedCallback = function (name, oldVal, newVal) {
84
- this.attributeChanged(name, oldVal, newVal);
85
- };
86
- FileFieldElement.prototype.attributeChanged = function (name, oldVal, newVal) {
87
- switch (name) {
88
- case 'accept':
89
- this.file.accept = newVal;
90
- break;
91
- }
92
- };
93
- FileFieldElement = __decorate([
94
- (0, custom_element_decorator_1.default)({
95
- selector: 'file-element',
96
- template: "\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"file\" id='file-field' accept=\"image/*,application/pdf\"/>\n\t\t\t</div>",
97
- 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 ",
98
- useShadow: true,
99
- })
100
- ], FileFieldElement);
101
- return FileFieldElement;
102
- }(CustomInputElement_1.CustomInputElement));
103
- exports.FileFieldElement = FileFieldElement;
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.FileFieldElement = 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 getAttributeNamesPolyfill_1 = require("../../framework/Polyfills/getAttributeNamesPolyfill");
29
+ var FileFieldElement = /** @class */ (function (_super) {
30
+ __extends(FileFieldElement, _super);
31
+ function FileFieldElement() {
32
+ var _this = _super.call(this) || this;
33
+ (0, getAttributeNamesPolyfill_1.default)();
34
+ return _this;
35
+ }
36
+ Object.defineProperty(FileFieldElement.prototype, "value", {
37
+ get: function () {
38
+ return this.file.files;
39
+ },
40
+ set: function (files) {
41
+ this.file.files = files;
42
+ },
43
+ enumerable: false,
44
+ configurable: true
45
+ });
46
+ Object.defineProperty(FileFieldElement.prototype, "valid", {
47
+ get: function () {
48
+ return this.file.validity.valid;
49
+ },
50
+ enumerable: false,
51
+ configurable: true
52
+ });
53
+ FileFieldElement.prototype.connectedCallback = function () {
54
+ this.initChildInputs();
55
+ _super.prototype.connectedCallback.call(this);
56
+ };
57
+ FileFieldElement.prototype.componentDidMount = function () {
58
+ var _this = this;
59
+ this.getAttributeNames().forEach(function (attributeName) {
60
+ var attributeValue = _this.getAttribute(attributeName);
61
+ _this.attributeChanged(attributeName, null, attributeValue);
62
+ });
63
+ };
64
+ FileFieldElement.prototype.initChildInputs = function () {
65
+ this.file = _super.prototype.getChildInput.call(this, '#file-field');
66
+ this.file.addEventListener('change', this.change.bind(this));
67
+ if (this.required) {
68
+ this.file.setAttribute('required', '');
69
+ }
70
+ if (this.multi) {
71
+ this.file.setAttribute('multiple', '');
72
+ }
73
+ };
74
+ // events
75
+ FileFieldElement.prototype.change = function ($event) {
76
+ this.touched = true;
77
+ this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
78
+ };
79
+ FileFieldElement.prototype.validate = function () {
80
+ this.valid;
81
+ this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
82
+ };
83
+ FileFieldElement.prototype.attributeChangedCallback = function (name, oldVal, newVal) {
84
+ this.attributeChanged(name, oldVal, newVal);
85
+ };
86
+ FileFieldElement.prototype.attributeChanged = function (name, oldVal, newVal) {
87
+ switch (name) {
88
+ case 'accept':
89
+ this.file.accept = newVal;
90
+ break;
91
+ }
92
+ };
93
+ FileFieldElement = __decorate([
94
+ (0, custom_element_decorator_1.default)({
95
+ selector: 'file-element',
96
+ template: "\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"file\" id='file-field' accept=\"image/*,application/pdf\"/>\n\t\t\t</div>",
97
+ 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 ",
98
+ useShadow: true,
99
+ })
100
+ ], FileFieldElement);
101
+ return FileFieldElement;
102
+ }(CustomInputElement_1.CustomInputElement));
103
+ exports.FileFieldElement = FileFieldElement;
104
104
  //# sourceMappingURL=FileFieldElement.js.map
@@ -1,18 +1,18 @@
1
- import { CustomInputElement } from '../../framework/CustomInputElement';
2
- import IValidator from '../../framework/Validation/IValidator.interface';
3
- export declare class IdentificationElement extends CustomInputElement {
4
- typeSelector: HTMLInputElement;
5
- text: HTMLInputElement;
6
- type: string;
7
- validators: {
8
- [index: string]: IValidator;
9
- };
10
- constructor();
11
- get value(): string;
12
- set value(value: string);
13
- get valid(): boolean;
14
- connectedCallback(): void;
15
- initChildInputs(): void;
16
- change($event: any): void;
17
- validate(): void;
18
- }
1
+ import { CustomInputElement } from '../../framework/CustomInputElement';
2
+ import IValidator from '../../framework/Validation/IValidator.interface';
3
+ export declare class IdentificationElement extends CustomInputElement {
4
+ typeSelector: HTMLInputElement;
5
+ text: HTMLInputElement;
6
+ type: string;
7
+ validators: {
8
+ [index: string]: IValidator;
9
+ };
10
+ constructor();
11
+ get value(): string;
12
+ set value(value: string);
13
+ get valid(): boolean;
14
+ connectedCallback(): void;
15
+ initChildInputs(): void;
16
+ change($event: any): void;
17
+ validate(): void;
18
+ }
@@ -1,95 +1,95 @@
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.IdentificationElement = 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 CPR_1 = require("../../framework/Validation/Validators/CPR");
29
- var CVR_1 = require("../../framework/Validation/Validators/CVR");
30
- var BankIdSweden_1 = require("../../framework/Validation/Validators/BankIdSweden");
31
- var BankIdNorway_1 = require("../../framework/Validation/Validators/BankIdNorway");
32
- var IdentificationElement = /** @class */ (function (_super) {
33
- __extends(IdentificationElement, _super);
34
- function IdentificationElement() {
35
- var _this = _super.call(this) || this;
36
- _this.validators = {
37
- cpr: new CPR_1.default(),
38
- cvr: new CVR_1.default(),
39
- swe: new BankIdSweden_1.default(),
40
- nor: new BankIdNorway_1.default(),
41
- };
42
- return _this;
43
- }
44
- Object.defineProperty(IdentificationElement.prototype, "value", {
45
- get: function () {
46
- return "" + this.text.value;
47
- },
48
- set: function (value) {
49
- this.text.value = value;
50
- },
51
- enumerable: false,
52
- configurable: true
53
- });
54
- Object.defineProperty(IdentificationElement.prototype, "valid", {
55
- get: function () {
56
- return this.validators[this.type].isSatisfiedBy(this.value, !this.required);
57
- },
58
- enumerable: false,
59
- configurable: true
60
- });
61
- IdentificationElement.prototype.connectedCallback = function () {
62
- _super.prototype.connectedCallback.call(this);
63
- };
64
- IdentificationElement.prototype.initChildInputs = function () {
65
- this.text = _super.prototype.getChildInput.call(this, '#id-field');
66
- this.typeSelector = _super.prototype.getChildInput.call(this, '#id-type');
67
- this.text.addEventListener('change', this.change.bind(this));
68
- this.typeSelector.addEventListener('change', this.change.bind(this));
69
- if (this.required) {
70
- this.text.setAttribute('required', '');
71
- }
72
- this.type = this.typeSelector.value;
73
- };
74
- // events
75
- IdentificationElement.prototype.change = function ($event) {
76
- this.touched = true;
77
- this.type = this.typeSelector.value;
78
- this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
79
- };
80
- IdentificationElement.prototype.validate = function () {
81
- this.valid;
82
- this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
83
- };
84
- IdentificationElement = __decorate([
85
- (0, custom_element_decorator_1.default)({
86
- selector: 'id-element',
87
- template: "\n\t\t\t<div class=\"wrapper\">\n <select id='id-type'>\n <option value='cvr'>Danish CVR</option>\n <option value='cpr'>Danish CPR</option>\n <option value='swe'>Sweden Bank Id</option>\n <option value='nor'>Norway Bank Id</option>\n </select>\n\t\t\t\t<input type=\"text\" id='id-field' placeholder=''/>\n\t\t\t</div>",
88
- style: "\n :host{\n width:100%;\n }\n .wrapper{\n display:flex;\n }\n input, select{\n box-sizing: border-box;\n border: none;\n background-color: #f1f4ff;\n margin: 2px;\n resize: none;\n }\n input{\n width: 75% !important;\n }\n select{\n width: 25% !important;\n }\n ",
89
- useShadow: true,
90
- })
91
- ], IdentificationElement);
92
- return IdentificationElement;
93
- }(CustomInputElement_1.CustomInputElement));
94
- exports.IdentificationElement = IdentificationElement;
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.IdentificationElement = 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 CPR_1 = require("../../framework/Validation/Validators/CPR");
29
+ var CVR_1 = require("../../framework/Validation/Validators/CVR");
30
+ var BankIdSweden_1 = require("../../framework/Validation/Validators/BankIdSweden");
31
+ var BankIdNorway_1 = require("../../framework/Validation/Validators/BankIdNorway");
32
+ var IdentificationElement = /** @class */ (function (_super) {
33
+ __extends(IdentificationElement, _super);
34
+ function IdentificationElement() {
35
+ var _this = _super.call(this) || this;
36
+ _this.validators = {
37
+ cpr: new CPR_1.default(),
38
+ cvr: new CVR_1.default(),
39
+ swe: new BankIdSweden_1.default(),
40
+ nor: new BankIdNorway_1.default(),
41
+ };
42
+ return _this;
43
+ }
44
+ Object.defineProperty(IdentificationElement.prototype, "value", {
45
+ get: function () {
46
+ return "" + this.text.value;
47
+ },
48
+ set: function (value) {
49
+ this.text.value = value;
50
+ },
51
+ enumerable: false,
52
+ configurable: true
53
+ });
54
+ Object.defineProperty(IdentificationElement.prototype, "valid", {
55
+ get: function () {
56
+ return this.validators[this.type].isSatisfiedBy(this.value, !this.required);
57
+ },
58
+ enumerable: false,
59
+ configurable: true
60
+ });
61
+ IdentificationElement.prototype.connectedCallback = function () {
62
+ _super.prototype.connectedCallback.call(this);
63
+ };
64
+ IdentificationElement.prototype.initChildInputs = function () {
65
+ this.text = _super.prototype.getChildInput.call(this, '#id-field');
66
+ this.typeSelector = _super.prototype.getChildInput.call(this, '#id-type');
67
+ this.text.addEventListener('change', this.change.bind(this));
68
+ this.typeSelector.addEventListener('change', this.change.bind(this));
69
+ if (this.required) {
70
+ this.text.setAttribute('required', '');
71
+ }
72
+ this.type = this.typeSelector.value;
73
+ };
74
+ // events
75
+ IdentificationElement.prototype.change = function ($event) {
76
+ this.touched = true;
77
+ this.type = this.typeSelector.value;
78
+ this.onChange.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'change'));
79
+ };
80
+ IdentificationElement.prototype.validate = function () {
81
+ this.valid;
82
+ this.onValidate.emit(new CustomEvents_1.CustomElementEventArgs(this.value, 'validate'));
83
+ };
84
+ IdentificationElement = __decorate([
85
+ (0, custom_element_decorator_1.default)({
86
+ selector: 'id-element',
87
+ template: "\n\t\t\t<div class=\"wrapper\">\n <select id='id-type'>\n <option value='cvr'>Danish CVR</option>\n <option value='cpr'>Danish CPR</option>\n <option value='swe'>Sweden Bank Id</option>\n <option value='nor'>Norway Bank Id</option>\n </select>\n\t\t\t\t<input type=\"text\" id='id-field' placeholder=''/>\n\t\t\t</div>",
88
+ style: "\n :host{\n width:100%;\n }\n .wrapper{\n display:flex;\n }\n input, select{\n box-sizing: border-box;\n border: none;\n background-color: #f1f4ff;\n margin: 2px;\n resize: none;\n }\n input{\n width: 75% !important;\n }\n select{\n width: 25% !important;\n }\n ",
89
+ useShadow: true,
90
+ })
91
+ ], IdentificationElement);
92
+ return IdentificationElement;
93
+ }(CustomInputElement_1.CustomInputElement));
94
+ exports.IdentificationElement = IdentificationElement;
95
95
  //# sourceMappingURL=IdentificationElement.js.map