@everymatrix/general-input 1.10.2 → 1.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.
Files changed (96) hide show
  1. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +35539 -0
  2. package/dist/cjs/general-input.cjs.entry.js +34 -13
  3. package/dist/cjs/general-input.cjs.js +2 -2
  4. package/dist/cjs/{index-64a5cb7f.js → index-132a0774.js} +119 -6
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/locale.utils-7665b010.js +71 -0
  7. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +85 -0
  8. package/dist/cjs/tooltipIcon-092a795f.js +5 -0
  9. package/dist/collection/collection-manifest.json +3 -1
  10. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +62 -0
  11. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +366 -0
  12. package/dist/collection/components/checkbox-input/checkbox-input.css +47 -1
  13. package/dist/collection/components/checkbox-input/checkbox-input.js +143 -16
  14. package/dist/collection/components/date-input/date-input.css +64 -30
  15. package/dist/collection/components/date-input/date-input.js +194 -13
  16. package/dist/collection/components/email-input/email-input.css +63 -28
  17. package/dist/collection/components/email-input/email-input.js +197 -21
  18. package/dist/collection/components/general-input/general-input.js +163 -21
  19. package/dist/collection/components/number-input/number-input.css +65 -30
  20. package/dist/collection/components/number-input/number-input.js +174 -19
  21. package/dist/collection/components/password-input/password-input.css +120 -29
  22. package/dist/collection/components/password-input/password-input.js +341 -25
  23. package/dist/collection/components/radio-input/radio-input.css +22 -1
  24. package/dist/collection/components/radio-input/radio-input.js +89 -10
  25. package/dist/collection/components/select-input/select-input.css +75 -22
  26. package/dist/collection/components/select-input/select-input.js +180 -37
  27. package/dist/collection/components/tel-input/tel-input.css +91 -33
  28. package/dist/collection/components/tel-input/tel-input.js +202 -24
  29. package/dist/collection/components/text-input/text-input.css +63 -28
  30. package/dist/collection/components/text-input/text-input.js +208 -39
  31. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +76 -0
  32. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +324 -0
  33. package/dist/collection/utils/locale.utils.js +52 -13
  34. package/dist/collection/utils/tooltipIcon.svg +5 -0
  35. package/dist/components/active-mixin.js +975 -0
  36. package/dist/components/checkbox-group-input.d.ts +11 -0
  37. package/dist/components/checkbox-group-input.js +6 -0
  38. package/dist/components/checkbox-group-input2.js +1125 -0
  39. package/dist/components/checkbox-input2.js +62 -12
  40. package/dist/components/date-input2.js +10247 -15
  41. package/dist/components/email-input2.js +98 -21
  42. package/dist/components/field-mixin.js +12712 -0
  43. package/dist/components/general-input.js +1 -118
  44. package/dist/components/general-input2.js +331 -0
  45. package/dist/components/input-field-shared-styles.js +1114 -0
  46. package/dist/components/number-input2.js +92 -16
  47. package/dist/components/password-input2.js +924 -24
  48. package/dist/components/pattern-mixin.js +85 -0
  49. package/dist/components/radio-input2.js +45 -11
  50. package/dist/components/select-input2.js +87 -27
  51. package/dist/components/tel-input2.js +122 -22
  52. package/dist/components/text-input2.js +120 -34
  53. package/dist/components/toggle-checkbox-input.d.ts +11 -0
  54. package/dist/components/toggle-checkbox-input.js +6 -0
  55. package/dist/components/tooltipIcon.js +70 -0
  56. package/dist/components/vaadin-button.js +461 -0
  57. package/dist/components/vaadin-combo-box.js +4329 -0
  58. package/dist/components/virtual-keyboard-controller.js +2658 -0
  59. package/dist/esm/checkbox-group-input_10.entry.js +35526 -0
  60. package/dist/esm/general-input.entry.js +34 -13
  61. package/dist/esm/general-input.js +2 -2
  62. package/dist/esm/{index-df80f936.js → index-db76d5b5.js} +118 -7
  63. package/dist/esm/loader.js +2 -2
  64. package/dist/esm/locale.utils-95ea2605.js +68 -0
  65. package/dist/esm/toggle-checkbox-input.entry.js +81 -0
  66. package/dist/esm/tooltipIcon-99c1c7b7.js +3 -0
  67. package/dist/general-input/general-input.esm.js +1 -1
  68. package/dist/general-input/p-0966f523.entry.js +3581 -0
  69. package/dist/general-input/p-916a1319.entry.js +1 -0
  70. package/dist/general-input/p-b408093e.js +1 -0
  71. package/dist/general-input/p-c2d4d6ac.entry.js +1 -0
  72. package/dist/general-input/p-f4f4ccda.js +1 -0
  73. package/dist/general-input/p-f6132f1d.js +1 -0
  74. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +74 -0
  75. package/dist/types/components/checkbox-input/checkbox-input.d.ts +28 -2
  76. package/dist/types/components/date-input/date-input.d.ts +43 -1
  77. package/dist/types/components/email-input/email-input.d.ts +37 -3
  78. package/dist/types/components/general-input/general-input.d.ts +30 -0
  79. package/dist/types/components/number-input/number-input.d.ts +34 -3
  80. package/dist/types/components/password-input/password-input.d.ts +56 -7
  81. package/dist/types/components/radio-input/radio-input.d.ts +17 -1
  82. package/dist/types/components/select-input/select-input.d.ts +36 -3
  83. package/dist/types/components/tel-input/tel-input.d.ts +40 -5
  84. package/dist/types/components/text-input/text-input.d.ts +84 -0
  85. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +67 -0
  86. package/dist/types/components.d.ts +568 -9
  87. package/dist/types/utils/locale.utils.d.ts +9 -0
  88. package/dist/types/utils/types.d.ts +41 -9
  89. package/package.json +8 -1
  90. package/dist/cjs/checkbox-input_9.cjs.entry.js +0 -623
  91. package/dist/components/locale.utils.js +0 -29
  92. package/dist/esm/checkbox-input_9.entry.js +0 -611
  93. package/dist/general-input/p-1703fce3.entry.js +0 -1
  94. package/dist/general-input/p-d9f7fa2e.js +0 -1
  95. package/dist/general-input/p-dea0a4ac.entry.js +0 -1
  96. /package/dist/types/Users/{user/workspace/everymatrix → adrian.pripon/Documents/Work}/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -0
@@ -2,7 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-64a5cb7f.js');
5
+ const index = require('./index-132a0774.js');
6
+ const locale_utils = require('./locale.utils-7665b010.js');
6
7
 
7
8
  const generalInputCss = ":host{display:block}";
8
9
 
@@ -13,32 +14,52 @@ const GeneralInput = class {
13
14
  * Type the general-input should take. Can take the default HTML input values.
14
15
  */
15
16
  this.type = 'text';
17
+ /**
18
+ * Client custom styling via inline style
19
+ */
20
+ this.clientStyling = '';
21
+ /**
22
+ * Translations via URL
23
+ */
24
+ this.translationUrl = '';
16
25
  }
17
- render() {
18
- switch (this.type.toLowerCase()) {
26
+ connectedCallback() {
27
+ if (this.translationUrl) {
28
+ locale_utils.getTranslations(this.translationUrl);
29
+ }
30
+ }
31
+ renderInput() {
32
+ var _a;
33
+ switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
19
34
  case 'text':
20
- return index.h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
35
+ return index.h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
21
36
  case 'email':
22
- return index.h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
37
+ return index.h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
23
38
  case 'number':
24
- return index.h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
39
+ return index.h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
25
40
  case 'checkbox':
26
- return index.h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language });
41
+ return index.h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
42
+ case 'checkboxgroup':
43
+ return index.h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
44
+ case 'togglecheckbox':
45
+ return index.h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
27
46
  case 'datetime':
28
- return index.h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
47
+ return index.h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat });
29
48
  case 'password':
30
- return index.h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language });
49
+ return index.h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
31
50
  case 'radio':
32
- return index.h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language });
51
+ return index.h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling });
33
52
  case 'tel':
34
- return index.h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
53
+ return index.h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
35
54
  case 'dropdown':
36
- return index.h("select-input", { name: this.name, action: this.action, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language });
55
+ return index.h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
37
56
  default:
38
- // Nothing here
39
57
  return index.h("p", null, "The ", this.type, " input type is not valid");
40
58
  }
41
59
  }
60
+ render() {
61
+ return (index.h(index.Host, { class: `general-input--${this.name}` }, this.renderInput()));
62
+ }
42
63
  };
43
64
  GeneralInput.style = generalInputCss;
44
65
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-64a5cb7f.js');
3
+ const index = require('./index-132a0774.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["checkbox-input_9.cjs",[[1,"checkbox-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"date-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[1,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"email-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[1,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"number-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[2,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"password-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"isValid":[32],"errorMessage":[32]}],[1,"radio-input",{"name":[1],"displayName":[1,"display-name"],"optionsGroup":[16],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"select-input",{"name":[1],"displayName":[1,"display-name"],"action":[1],"options":[16],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"tel-input",{"name":[1],"displayName":[1,"display-name"],"showLabels":[4,"show-labels"],"action":[1],"validation":[16],"defaultValue":[8,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"isValid":[32],"errorMessage":[32]}],[1,"text-input",{"name":[1025],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[1025,"default-value"],"rules":[1],"language":[1],"checkValidity":[4,"check-validity"],"emitValue":[4,"emit-value"],"isValid":[32],"errorMessage":[32]}]]],["general-input.cjs",[[1,"general-input",{"type":[1],"name":[1],"displayName":[1,"display-name"],"action":[1],"validation":[16],"options":[8],"language":[1],"defaultValue":[8,"default-value"],"emitValue":[4,"emit-value"]}]]]], options);
18
+ return index.bootstrapLazy([["checkbox-group-input_10.cjs",[[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]]],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]]]],["general-input.cjs",[[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"]}]]],["toggle-checkbox-input.cjs",[[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]]]]]], options);
19
19
  });
@@ -47,6 +47,42 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
47
47
  return false;
48
48
  })()
49
49
  ;
50
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
51
+ if (listeners) {
52
+ listeners.map(([flags, name, method]) => {
53
+ const target = getHostListenerTarget(elm, flags) ;
54
+ const handler = hostListenerProxy(hostRef, method);
55
+ const opts = hostListenerOpts(flags);
56
+ plt.ael(target, name, handler, opts);
57
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
58
+ });
59
+ }
60
+ };
61
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
62
+ try {
63
+ {
64
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
65
+ // instance is ready, let's call it's member method for this event
66
+ hostRef.$lazyInstance$[methodName](ev);
67
+ }
68
+ else {
69
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
70
+ }
71
+ }
72
+ }
73
+ catch (e) {
74
+ consoleError(e);
75
+ }
76
+ };
77
+ const getHostListenerTarget = (elm, flags) => {
78
+ if (flags & 4 /* TargetDocument */)
79
+ return doc;
80
+ if (flags & 16 /* TargetBody */)
81
+ return doc.body;
82
+ return elm;
83
+ };
84
+ // prettier-ignore
85
+ const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
50
86
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
51
87
  const createTime = (fnName, tagName = '') => {
52
88
  {
@@ -154,6 +190,7 @@ const isComplexType = (o) => {
154
190
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
155
191
  const h = (nodeName, vnodeData, ...children) => {
156
192
  let child = null;
193
+ let key = null;
157
194
  let simple = false;
158
195
  let lastSimple = false;
159
196
  let vNodeChildren = [];
@@ -181,6 +218,10 @@ const h = (nodeName, vnodeData, ...children) => {
181
218
  };
182
219
  walk(children);
183
220
  if (vnodeData) {
221
+ // normalize class / classname attributes
222
+ if (vnodeData.key) {
223
+ key = vnodeData.key;
224
+ }
184
225
  {
185
226
  const classData = vnodeData.className || vnodeData.class;
186
227
  if (classData) {
@@ -198,6 +239,9 @@ const h = (nodeName, vnodeData, ...children) => {
198
239
  if (vNodeChildren.length > 0) {
199
240
  vnode.$children$ = vNodeChildren;
200
241
  }
242
+ {
243
+ vnode.$key$ = key;
244
+ }
201
245
  return vnode;
202
246
  };
203
247
  const newVNode = (tag, text) => {
@@ -211,6 +255,9 @@ const newVNode = (tag, text) => {
211
255
  {
212
256
  vnode.$attrs$ = null;
213
257
  }
258
+ {
259
+ vnode.$key$ = null;
260
+ }
214
261
  return vnode;
215
262
  };
216
263
  const Host = {};
@@ -234,6 +281,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
234
281
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
235
282
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
236
283
  }
284
+ else if (memberName === 'key')
285
+ ;
237
286
  else if (memberName === 'ref') {
238
287
  // minifier will clean this up
239
288
  if (newValue) {
@@ -405,6 +454,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
405
454
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
406
455
  let oldStartIdx = 0;
407
456
  let newStartIdx = 0;
457
+ let idxInOld = 0;
458
+ let i = 0;
408
459
  let oldEndIdx = oldCh.length - 1;
409
460
  let oldStartVnode = oldCh[0];
410
461
  let oldEndVnode = oldCh[oldEndIdx];
@@ -412,6 +463,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
412
463
  let newStartVnode = newCh[0];
413
464
  let newEndVnode = newCh[newEndIdx];
414
465
  let node;
466
+ let elmToMove;
415
467
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
416
468
  if (oldStartVnode == null) {
417
469
  // Vnode might have been moved left
@@ -449,7 +501,29 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
449
501
  newStartVnode = newCh[++newStartIdx];
450
502
  }
451
503
  else {
504
+ // createKeyToOldIdx
505
+ idxInOld = -1;
452
506
  {
507
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
508
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
509
+ idxInOld = i;
510
+ break;
511
+ }
512
+ }
513
+ }
514
+ if (idxInOld >= 0) {
515
+ elmToMove = oldCh[idxInOld];
516
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
517
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
518
+ }
519
+ else {
520
+ patch(elmToMove, newStartVnode);
521
+ oldCh[idxInOld] = undefined;
522
+ node = elmToMove.$elm$;
523
+ }
524
+ newStartVnode = newCh[++newStartIdx];
525
+ }
526
+ else {
453
527
  // new element
454
528
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
455
529
  newStartVnode = newCh[++newStartIdx];
@@ -472,7 +546,9 @@ const isSameVnode = (vnode1, vnode2) => {
472
546
  // compare if two vnode to see if they're "technically" the same
473
547
  // need to have the same element tag, and same key to be the same
474
548
  if (vnode1.$tag$ === vnode2.$tag$) {
475
- return true;
549
+ {
550
+ return vnode1.$key$ === vnode2.$key$;
551
+ }
476
552
  }
477
553
  return false;
478
554
  };
@@ -523,9 +599,14 @@ const callNodeRefs = (vNode) => {
523
599
  };
524
600
  const renderVdom = (hostRef, renderFnResults) => {
525
601
  const hostElm = hostRef.$hostElement$;
602
+ const cmpMeta = hostRef.$cmpMeta$;
526
603
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
527
604
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
528
605
  hostTagName = hostElm.tagName;
606
+ if (cmpMeta.$attrsToReflect$) {
607
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
608
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
609
+ }
529
610
  rootVnode.$tag$ = null;
530
611
  rootVnode.$flags$ |= 4 /* isHost */;
531
612
  hostRef.$vnode$ = rootVnode;
@@ -587,6 +668,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
587
668
  const instance = hostRef.$lazyInstance$ ;
588
669
  let promise;
589
670
  if (isInitialLoad) {
671
+ {
672
+ hostRef.$flags$ |= 256 /* isListenReady */;
673
+ if (hostRef.$queuedListeners$) {
674
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
675
+ hostRef.$queuedListeners$ = null;
676
+ }
677
+ }
590
678
  {
591
679
  promise = safeCall(instance, 'componentWillLoad');
592
680
  }
@@ -658,13 +746,20 @@ const postUpdateComponent = (hostRef) => {
658
746
  const tagName = hostRef.$cmpMeta$.$tagName$;
659
747
  const elm = hostRef.$hostElement$;
660
748
  const endPostUpdate = createTime('postUpdate', tagName);
749
+ const instance = hostRef.$lazyInstance$ ;
661
750
  const ancestorComponent = hostRef.$ancestorComponent$;
751
+ {
752
+ safeCall(instance, 'componentDidRender');
753
+ }
662
754
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
663
755
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
664
756
  {
665
757
  // DOM WRITE!
666
758
  addHydratedFlag(elm);
667
759
  }
760
+ {
761
+ safeCall(instance, 'componentDidLoad');
762
+ }
668
763
  endPostUpdate();
669
764
  {
670
765
  hostRef.$onReadyResolve$(elm);
@@ -747,10 +842,6 @@ const parsePropertyValue = (propValue, propType) => {
747
842
  // but we'll cheat here and say that the string "false" is the boolean false
748
843
  return propValue === 'false' ? false : propValue === '' || !!propValue;
749
844
  }
750
- if (propType & 2 /* Number */) {
751
- // force it to be a number
752
- return parseFloat(propValue);
753
- }
754
845
  if (propType & 1 /* String */) {
755
846
  // could have been passed as a number or boolean
756
847
  // but we still want it as a string
@@ -892,6 +983,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
892
983
  .map(([propName, m]) => {
893
984
  const attrName = m[1] || propName;
894
985
  attrNameToPropName.set(attrName, propName);
986
+ if (m[0] & 512 /* ReflectAttr */) {
987
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
988
+ }
895
989
  return attrName;
896
990
  });
897
991
  }
@@ -1021,6 +1115,10 @@ const connectedCallback = (elm) => {
1021
1115
  }
1022
1116
  }
1023
1117
  else {
1118
+ // not the first time this has connected
1119
+ // reattach any event listeners to the host
1120
+ // since they would have been removed when disconnected
1121
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1024
1122
  // fire off connectedCallback() on component instance
1025
1123
  fireConnectedCallback(hostRef.$lazyInstance$);
1026
1124
  }
@@ -1029,7 +1127,13 @@ const connectedCallback = (elm) => {
1029
1127
  };
1030
1128
  const disconnectedCallback = (elm) => {
1031
1129
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1032
- getHostRef(elm);
1130
+ const hostRef = getHostRef(elm);
1131
+ {
1132
+ if (hostRef.$rmListeners$) {
1133
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1134
+ hostRef.$rmListeners$ = undefined;
1135
+ }
1136
+ }
1033
1137
  }
1034
1138
  };
1035
1139
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1056,6 +1160,12 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1056
1160
  {
1057
1161
  cmpMeta.$members$ = compactMeta[2];
1058
1162
  }
1163
+ {
1164
+ cmpMeta.$listeners$ = compactMeta[3];
1165
+ }
1166
+ {
1167
+ cmpMeta.$attrsToReflect$ = [];
1168
+ }
1059
1169
  {
1060
1170
  cmpMeta.$watchers$ = {};
1061
1171
  }
@@ -1139,6 +1249,7 @@ const registerHost = (elm, cmpMeta) => {
1139
1249
  elm['s-p'] = [];
1140
1250
  elm['s-rc'] = [];
1141
1251
  }
1252
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1142
1253
  return hostRefs.set(elm, hostRef);
1143
1254
  };
1144
1255
  const isMemberInElement = (elm, memberName) => memberName in elm;
@@ -1207,8 +1318,10 @@ const flush = () => {
1207
1318
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1208
1319
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1209
1320
 
1321
+ exports.Host = Host;
1210
1322
  exports.bootstrapLazy = bootstrapLazy;
1211
1323
  exports.createEvent = createEvent;
1324
+ exports.getElement = getElement;
1212
1325
  exports.h = h;
1213
1326
  exports.promiseResolve = promiseResolve;
1214
1327
  exports.registerInstance = registerInstance;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-64a5cb7f.js');
5
+ const index = require('./index-132a0774.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["checkbox-input_9.cjs",[[1,"checkbox-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"date-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[1,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"email-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[1,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"number-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[2,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"password-input",{"name":[1],"displayName":[1,"display-name"],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"isValid":[32],"errorMessage":[32]}],[1,"radio-input",{"name":[1],"displayName":[1,"display-name"],"optionsGroup":[16],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"select-input",{"name":[1],"displayName":[1,"display-name"],"action":[1],"options":[16],"validation":[16],"language":[1],"emitValue":[4,"emit-value"],"errorMessage":[32],"isValid":[32]}],[1,"tel-input",{"name":[1],"displayName":[1,"display-name"],"showLabels":[4,"show-labels"],"action":[1],"validation":[16],"defaultValue":[8,"default-value"],"language":[1],"emitValue":[4,"emit-value"],"isValid":[32],"errorMessage":[32]}],[1,"text-input",{"name":[1025],"displayName":[1,"display-name"],"validation":[16],"defaultValue":[1025,"default-value"],"rules":[1],"language":[1],"checkValidity":[4,"check-validity"],"emitValue":[4,"emit-value"],"isValid":[32],"errorMessage":[32]}]]],["general-input.cjs",[[1,"general-input",{"type":[1],"name":[1],"displayName":[1,"display-name"],"action":[1],"validation":[16],"options":[8],"language":[1],"defaultValue":[8,"default-value"],"emitValue":[4,"emit-value"]}]]]], options);
17
+ return index.bootstrapLazy([["checkbox-group-input_10.cjs",[[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32]},[[4,"click","handleClickOutside"]]],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]]],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]]]]],["general-input.cjs",[[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"]}]]],["toggle-checkbox-input.cjs",[[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]]]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const TRANSLATIONS = {
5
+ "en": {
6
+ "dateError": 'The selected date should be between {min} and {max}',
7
+ "dateError2": 'The selected date is not within the accepted range',
8
+ "numberLengthError": 'The number should be between {min} and {max}',
9
+ "lengthError": `The length should be between {minLength} and {maxLength}`,
10
+ "requiredError": 'This input is required.',
11
+ "invalidOriginalPasswordError": "Initial password field does not validate all criteria.",
12
+ "passwordStrength": "Password strength",
13
+ "passwordStrengthWeak": "is not adequate",
14
+ "passwordStrengthStrong": "is adequate",
15
+ "SpecialCharactersNotAllowed": 'Should not contain special characters',
16
+ "InvalidEmailFormat": "Invalid email format.",
17
+ "EmailNotMatching": "Emails not matching!",
18
+ "PasswordNotMatching": "Passwords not matching",
19
+ "MustIncludeNumber": "include a number",
20
+ "MustContainCapital": "contain capital letters",
21
+ "MustIncludePunctation": "punctuation",
22
+ "OnlyNumbers": "Should contains only numbers."
23
+ },
24
+ "hu": {
25
+ "dateError": 'A választott dátumnak {min} és {max} között kell lennie',
26
+ "numberLengthError": 'A számnak {min} és {max} között kell lennie',
27
+ "lengthError": `A hossznak {minLength} és {maxLength} között kell lennie`,
28
+ "requiredError": 'Ez a beviteli mező kötelező.',
29
+ "invalidOriginalPasswordError": "Initial password field does not validate all criteria.",
30
+ "passwordStrength": "Jelszó erőssége",
31
+ "passwordStrengthWeak": "nem megfelelő",
32
+ "passwordStrengthStrong": "megfelelő",
33
+ "SpecialCharactersNotAllowed": 'Nem tartalmazhat speciális karaktereket',
34
+ "InvalidEmailFormat": "Érvénytelen e-mail formátum.",
35
+ "EmailNotMatching": "Az e-mailek nem egyeznek!",
36
+ "PasswordNotMatching": "A jelszavak nem egyeznek",
37
+ "MustIncludeNumber": "tartalmaznia kell egy számot",
38
+ "MustContainCapital": "nagybetűket kell tartalmaznia",
39
+ "MustIncludePunctation": "írásjelet",
40
+ "OnlyNumbers": "Csak számokat kell tartalmaznia."
41
+ }
42
+ };
43
+ const translate = (key, customLang, values) => {
44
+ const lang = customLang;
45
+ let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
46
+ if (values !== undefined) {
47
+ for (const [key, value] of Object.entries(values.values)) {
48
+ const regex = new RegExp(`{${key}}`, 'g');
49
+ translation = translation.replace(regex, value);
50
+ }
51
+ }
52
+ return translation;
53
+ };
54
+ const getTranslations = (url) => {
55
+ // fetch url, get the data, replace the TRANSLATIONS content
56
+ return new Promise((resolve) => {
57
+ fetch(url)
58
+ .then((res) => res.json())
59
+ .then((data) => {
60
+ Object.keys(data).forEach((item) => {
61
+ for (let key in data[item]) {
62
+ TRANSLATIONS[item][key] = data[item][key];
63
+ }
64
+ });
65
+ resolve(true);
66
+ });
67
+ });
68
+ };
69
+
70
+ exports.getTranslations = getTranslations;
71
+ exports.translate = translate;
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-132a0774.js');
6
+ const locale_utils = require('./locale.utils-7665b010.js');
7
+ const tooltipIcon = require('./tooltipIcon-092a795f.js');
8
+
9
+ const toggleCheckboxInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.togglecheckbox{font-family:\"Roboto\";font-style:normal;font-size:15px}.togglecheckbox__wrapper{position:relative}.togglecheckbox__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.togglecheckbox__wrapper--relative{position:relative;display:inline}.togglecheckbox__input{transform:scale(1.307, 1.307);margin-left:2px}.togglecheckbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:#2B2D3F;line-height:14px}.togglecheckbox__label-text{font-size:16px}.togglecheckbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.togglecheckbox__tooltip-icon{width:16px;height:auto}.togglecheckbox__tooltip{position:absolute;top:0;right:0;background-color:#FFFFFF;border:1px solid #B0B0B0;color:#2B2D3F;padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.togglecheckbox__tooltip.visible{opacity:1}.togglecheckbox__fields-wrapper{margin-top:40px;display:flex;flex-direction:column;gap:40px}.hidden{display:none}";
10
+
11
+ const ToggleCheckboxInput = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
15
+ this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
16
+ /**
17
+ * Default value for the input.
18
+ */
19
+ this.defaultValue = '';
20
+ /**
21
+ * Client custom styling via inline style
22
+ */
23
+ this.clientStyling = '';
24
+ this.limitStylingAppends = false;
25
+ this.showTooltip = false;
26
+ this.value = '';
27
+ this.setClientStyling = () => {
28
+ let sheet = document.createElement('style');
29
+ sheet.innerHTML = this.clientStyling;
30
+ this.stylingContainer.prepend(sheet);
31
+ };
32
+ }
33
+ validityStateHandler(inputStateEvent) {
34
+ this.sendValidityState.emit(inputStateEvent);
35
+ }
36
+ valueHandler(inputValueEvent) {
37
+ this.sendInputValue.emit(inputValueEvent);
38
+ }
39
+ handleClickOutside(event) {
40
+ if (event.composedPath()[0] === this.tooltipIconReference)
41
+ return;
42
+ if (event.composedPath()[0] !== this.tooltipReference)
43
+ this.showTooltip = false;
44
+ }
45
+ componentDidRender() {
46
+ // start custom styling area
47
+ if (!this.limitStylingAppends && this.stylingContainer) {
48
+ if (this.clientStyling)
49
+ this.setClientStyling();
50
+ this.limitStylingAppends = true;
51
+ }
52
+ // end custom styling area
53
+ }
54
+ handleClick() {
55
+ this.showFields = this.checkboxReference.checked;
56
+ this.errorMessage = this.setErrorMessage();
57
+ this.isValid = this.setValidity();
58
+ }
59
+ setValidity() {
60
+ return this.checkboxReference.validity.valid;
61
+ }
62
+ setErrorMessage() {
63
+ if (this.checkboxReference.validity.valueMissing) {
64
+ return locale_utils.translate('requiredError', this.language);
65
+ }
66
+ }
67
+ renderLabel() {
68
+ return (index.h("label", { class: 'togglecheckbox__label', htmlFor: `${this.name}__input` }, index.h("div", { class: 'togglecheckbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
69
+ }
70
+ renderTooltip() {
71
+ if (this.showTooltip) {
72
+ return (index.h("div", { class: `togglecheckbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
73
+ }
74
+ return null;
75
+ }
76
+ render() {
77
+ return index.h("div", { class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { class: 'togglecheckbox__wrapper--flex' }, index.h("input", { class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), index.h("small", { class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
78
+ index.h("img", { class: 'togglecheckbox__tooltip-icon', src: tooltipIcon.tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
79
+ return index.h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder });
80
+ })));
81
+ }
82
+ };
83
+ ToggleCheckboxInput.style = toggleCheckboxInputCss;
84
+
85
+ exports.toggle_checkbox_input = ToggleCheckboxInput;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
4
+
5
+ exports.tooltipIconSvg = tooltipIconSvg;
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "entries": [
3
+ "./components/checkbox-group-input/checkbox-group-input.js",
3
4
  "./components/checkbox-input/checkbox-input.js",
4
5
  "./components/date-input/date-input.js",
5
6
  "./components/email-input/email-input.js",
@@ -9,7 +10,8 @@
9
10
  "./components/radio-input/radio-input.js",
10
11
  "./components/select-input/select-input.js",
11
12
  "./components/tel-input/tel-input.js",
12
- "./components/text-input/text-input.js"
13
+ "./components/text-input/text-input.js",
14
+ "./components/toggle-checkbox-input/toggle-checkbox-input.js"
13
15
  ],
14
16
  "compiler": {
15
17
  "name": "@stencil/core",