@everymatrix/general-input-hsl 0.0.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 (95) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_13.cjs.entry.js +7303 -0
  3. package/dist/cjs/general-input-hsl-2832e412.js +5800 -0
  4. package/dist/cjs/general-input-hsl.cjs.js +25 -0
  5. package/dist/cjs/index-6f821b8d.js +1299 -0
  6. package/dist/cjs/index.cjs.js +10 -0
  7. package/dist/cjs/loader.cjs.js +15 -0
  8. package/dist/collection/collection-manifest.json +24 -0
  9. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +89 -0
  10. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +390 -0
  11. package/dist/collection/components/checkbox-input/checkbox-input.css +78 -0
  12. package/dist/collection/components/checkbox-input/checkbox-input.js +344 -0
  13. package/dist/collection/components/date-input/date-input.css +101 -0
  14. package/dist/collection/components/date-input/date-input.js +466 -0
  15. package/dist/collection/components/email-input/email-input.css +95 -0
  16. package/dist/collection/components/email-input/email-input.js +429 -0
  17. package/dist/collection/components/general-input-hsl/general-input-hsl.css +4 -0
  18. package/dist/collection/components/general-input-hsl/general-input-hsl.js +438 -0
  19. package/dist/collection/components/general-input-hsl/index.js +1 -0
  20. package/dist/collection/components/number-input/number-input.css +102 -0
  21. package/dist/collection/components/number-input/number-input.js +393 -0
  22. package/dist/collection/components/password-input/password-input.css +193 -0
  23. package/dist/collection/components/password-input/password-input.js +573 -0
  24. package/dist/collection/components/radio-input/radio-input.css +43 -0
  25. package/dist/collection/components/radio-input/radio-input.js +319 -0
  26. package/dist/collection/components/select-input/select-input.css +121 -0
  27. package/dist/collection/components/select-input/select-input.js +488 -0
  28. package/dist/collection/components/tel-input/tel-input.css +145 -0
  29. package/dist/collection/components/tel-input/tel-input.js +468 -0
  30. package/dist/collection/components/text-input/text-input.css +97 -0
  31. package/dist/collection/components/text-input/text-input.js +489 -0
  32. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +82 -0
  33. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +366 -0
  34. package/dist/collection/components/twofa-input/twofa-input.css +56 -0
  35. package/dist/collection/components/twofa-input/twofa-input.js +495 -0
  36. package/dist/collection/index.js +1 -0
  37. package/dist/collection/utils/locale.utils.js +81 -0
  38. package/dist/collection/utils/tooltipIcon.svg +5 -0
  39. package/dist/collection/utils/types.js +1 -0
  40. package/dist/collection/utils/utils.js +3 -0
  41. package/dist/esm/app-globals-0f993ce5.js +3 -0
  42. package/dist/esm/checkbox-group-input_13.entry.js +7288 -0
  43. package/dist/esm/general-input-hsl-31f19ad0.js +5797 -0
  44. package/dist/esm/general-input-hsl.js +20 -0
  45. package/dist/esm/index-8598bfb7.js +1270 -0
  46. package/dist/esm/index.js +2 -0
  47. package/dist/esm/loader.js +11 -0
  48. package/dist/general-input-hsl/app-globals-0f993ce5.js +1 -0
  49. package/dist/general-input-hsl/checkbox-group-input_13.entry.js +1 -0
  50. package/dist/general-input-hsl/general-input-hsl-31f19ad0.js +5614 -0
  51. package/dist/general-input-hsl/general-input-hsl.esm.js +1 -0
  52. package/dist/general-input-hsl/index-8598bfb7.js +2 -0
  53. package/dist/general-input-hsl/index.esm.js +1 -0
  54. package/dist/index.cjs.js +1 -0
  55. package/dist/index.js +1 -0
  56. package/dist/stencil.config.dev.js +19 -0
  57. package/dist/stencil.config.js +19 -0
  58. package/dist/storybook/main.js +43 -0
  59. package/dist/storybook/preview.js +9 -0
  60. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  61. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/stencil.config.d.ts +2 -0
  62. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/stencil.config.dev.d.ts +2 -0
  63. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/storybook/main.d.ts +3 -0
  64. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/storybook/preview.d.ts +70 -0
  65. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/index.d.ts +3 -0
  66. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  67. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  68. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  69. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +74 -0
  70. package/dist/types/components/checkbox-input/checkbox-input.d.ts +67 -0
  71. package/dist/types/components/date-input/date-input.d.ts +89 -0
  72. package/dist/types/components/email-input/email-input.d.ts +81 -0
  73. package/dist/types/components/general-input-hsl/general-input-hsl.d.ts +84 -0
  74. package/dist/types/components/general-input-hsl/index.d.ts +1 -0
  75. package/dist/types/components/number-input/number-input.d.ts +75 -0
  76. package/dist/types/components/password-input/password-input.d.ts +97 -0
  77. package/dist/types/components/radio-input/radio-input.d.ts +60 -0
  78. package/dist/types/components/select-input/select-input.d.ts +85 -0
  79. package/dist/types/components/tel-input/tel-input.d.ts +89 -0
  80. package/dist/types/components/text-input/text-input.d.ts +86 -0
  81. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +73 -0
  82. package/dist/types/components/twofa-input/twofa-input.d.ts +84 -0
  83. package/dist/types/components.d.ts +1599 -0
  84. package/dist/types/index.d.ts +1 -0
  85. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  86. package/dist/types/utils/locale.utils.d.ts +13 -0
  87. package/dist/types/utils/types.d.ts +111 -0
  88. package/dist/types/utils/utils.d.ts +1 -0
  89. package/loader/cdn.js +1 -0
  90. package/loader/index.cjs.js +1 -0
  91. package/loader/index.d.ts +24 -0
  92. package/loader/index.es2017.js +1 -0
  93. package/loader/index.js +2 -0
  94. package/loader/package.json +11 -0
  95. package/package.json +27 -0
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const generalInputHsl = require('./general-input-hsl-2832e412.js');
6
+ require('./index-6f821b8d.js');
7
+
8
+
9
+
10
+ exports.GeneralInputHsl = generalInputHsl.GeneralInputHsl;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-6f821b8d.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["checkbox-group-input_13.cjs",[[1,"general-input-hsl",{"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"],"hidePasswordComplexity":[516,"hide-password-complexity"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"],"emitOnClick":[516,"emit-on-click"],"twofaDestination":[513,"twofa-destination"],"twofaResendIntervalSeconds":[514,"twofa-resend-interval-seconds"]}],[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],"showCheckboxes":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"selectedValues":["setValue"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"],"emitOnClick":[516,"emit-on-click"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"],"hidePasswordComplexity":[516,"hide-password-complexity"],"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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"value":["valueChanged"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"],[16,"validationChange","handleValidationChange"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[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"]],{"clientStyling":["handleStylingChange"]}],[1,"twofa-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"destination":[513],"resendIntervalSeconds":[514,"resend-interval-seconds"],"clientStyling":[513,"client-styling"],"limitStylingAppends":[32],"isValid":[32],"isResendButtonAvailable":[32],"showTooltip":[32],"errorMessage":[32],"code":[32],"resendIntervalSecondsLeft":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}]]]], options);
12
+ };
13
+
14
+ exports.setNonce = index.setNonce;
15
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,24 @@
1
+ {
2
+ "entries": [
3
+ "components/general-input-hsl/general-input-hsl.js",
4
+ "components/checkbox-group-input/checkbox-group-input.js",
5
+ "components/checkbox-input/checkbox-input.js",
6
+ "components/date-input/date-input.js",
7
+ "components/email-input/email-input.js",
8
+ "components/number-input/number-input.js",
9
+ "components/password-input/password-input.js",
10
+ "components/radio-input/radio-input.js",
11
+ "components/select-input/select-input.js",
12
+ "components/tel-input/tel-input.js",
13
+ "components/text-input/text-input.js",
14
+ "components/toggle-checkbox-input/toggle-checkbox-input.js",
15
+ "components/twofa-input/twofa-input.js"
16
+ ],
17
+ "compiler": {
18
+ "name": "@stencil/core",
19
+ "version": "4.19.2",
20
+ "typescriptVersion": "5.4.5"
21
+ },
22
+ "collections": [],
23
+ "bundles": []
24
+ }
@@ -0,0 +1,89 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ vaadin-checkbox-group {
10
+ margin-top: 5px;
11
+ margin-left: 40px;
12
+ }
13
+
14
+ .checkboxgroup {
15
+ font-family: "Roboto";
16
+ font-style: normal;
17
+ font-size: 15px;
18
+ }
19
+ .checkboxgroup__wrapper {
20
+ position: relative;
21
+ }
22
+ .checkboxgroup__wrapper--flex {
23
+ display: flex;
24
+ gap: 5px;
25
+ align-content: flex-start;
26
+ }
27
+ .checkboxgroup__wrapper--relative {
28
+ position: relative;
29
+ display: inline;
30
+ }
31
+ .checkboxgroup__input {
32
+ vertical-align: baseline;
33
+ }
34
+ .checkboxgroup__input[indeterminate]::part(checkbox)::after, .checkboxgroup__input[indeterminate]::part(checkbox), .checkboxgroup__input[checked]::part(checkbox) {
35
+ background-color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
36
+ }
37
+ .checkboxgroup__label {
38
+ font-style: inherit;
39
+ font-family: inherit;
40
+ font-weight: 400;
41
+ font-size: 16px;
42
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
43
+ line-height: 1.5;
44
+ padding-left: 10px;
45
+ vertical-align: baseline;
46
+ }
47
+ .checkboxgroup__label-text {
48
+ font-size: 16px;
49
+ }
50
+ .checkboxgroup__label a {
51
+ color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
52
+ }
53
+ .checkboxgroup__error-message {
54
+ position: absolute;
55
+ top: calc(100% + 5px);
56
+ left: 0;
57
+ color: var(--emw--color-error, var(--emw--color-red, #ed0909));
58
+ }
59
+ .checkboxgroup__tooltip-icon {
60
+ width: 16px;
61
+ height: auto;
62
+ }
63
+ .checkboxgroup__tooltip {
64
+ position: absolute;
65
+ top: 0;
66
+ right: 0;
67
+ background-color: var(--emw--color-white, #FFFFFF);
68
+ border: 1px solid var(--emw--color-gray-100, #E6E6E6);
69
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
70
+ padding: 10px;
71
+ border-radius: 5px;
72
+ opacity: 0;
73
+ transition: opacity 0.3s ease-in-out;
74
+ z-index: 10;
75
+ }
76
+ .checkboxgroup__tooltip.visible {
77
+ opacity: 1;
78
+ }
79
+
80
+ .checkbox__input::part(checkbox) {
81
+ background-color: var(--emw--color-white, #FFFFFF);
82
+ transform: scale(0.8, 0.8);
83
+ border-radius: var(--emw--border-radius-small, 2px);
84
+ box-shadow: 0 0px 0px 2px var(--emw--color-gray, #7a7a7a);
85
+ }
86
+ .checkbox__input[indeterminate]::part(checkbox), .checkbox__input[checked]::part(checkbox) {
87
+ background-color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
88
+ box-shadow: none;
89
+ }
@@ -0,0 +1,390 @@
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import tooltipIcon from "../../utils/tooltipIcon.svg";
4
+ export class CheckboxGroupInput {
5
+ constructor() {
6
+ this.value = null;
7
+ this.setClientStyling = () => {
8
+ let sheet = document.createElement('style');
9
+ sheet.innerHTML = this.clientStyling;
10
+ this.stylingContainer.prepend(sheet);
11
+ };
12
+ this.name = undefined;
13
+ this.displayName = undefined;
14
+ this.defaultValue = '';
15
+ this.autofilled = undefined;
16
+ this.tooltip = undefined;
17
+ this.options = undefined;
18
+ this.validation = undefined;
19
+ this.language = undefined;
20
+ this.emitValue = undefined;
21
+ this.clientStyling = '';
22
+ this.errorMessage = undefined;
23
+ this.isValid = undefined;
24
+ this.limitStylingAppends = false;
25
+ this.showTooltip = false;
26
+ this.selectedValues = [];
27
+ this.showCheckboxes = false;
28
+ }
29
+ handleStylingChange(newValue, oldValue) {
30
+ if (newValue !== oldValue)
31
+ this.setClientStyling();
32
+ }
33
+ validityChanged() {
34
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
35
+ if (this.emitValue == true) {
36
+ this.valueHandler({ name: this.name, value: this.value, type: 'checkboxgroup' });
37
+ }
38
+ }
39
+ setValue() {
40
+ this.value = this.options.reduce((acc, option) => {
41
+ acc[option.name] = this.selectedValues.includes(option.name);
42
+ return acc;
43
+ }, {});
44
+ this.emitValueHandler(true);
45
+ }
46
+ validityStateHandler(inputStateEvent) {
47
+ this.sendValidityState.emit(inputStateEvent);
48
+ }
49
+ emitValueHandler(newValue) {
50
+ if (newValue == true && this.isValid) {
51
+ this.valueHandler({ name: this.name, value: this.value, type: 'checkboxgroup' });
52
+ }
53
+ }
54
+ valueHandler(inputValueEvent) {
55
+ this.sendInputValue.emit(inputValueEvent);
56
+ }
57
+ handleClickOutside(event) {
58
+ if (event.composedPath()[0] === this.tooltipIconReference)
59
+ return;
60
+ if (event.composedPath()[0] !== this.tooltipReference)
61
+ this.showTooltip = false;
62
+ }
63
+ componentDidRender() {
64
+ // start custom styling area
65
+ if (!this.limitStylingAppends && this.stylingContainer) {
66
+ if (this.clientStyling)
67
+ this.setClientStyling();
68
+ this.limitStylingAppends = true;
69
+ }
70
+ // end custom styling area
71
+ }
72
+ componentDidLoad() {
73
+ this.inputReference = this.element.shadowRoot.querySelector('input');
74
+ // For now this input has no validation. Send isValid as true immediately.
75
+ //@TODO: add validation logic to it, if business reason arises.
76
+ this.isValid = this.setValidity();
77
+ if (this.defaultValue) {
78
+ this.showCheckboxes = true;
79
+ this.selectedValues = this.options.map((checkbox) => checkbox.name);
80
+ this.value = this.defaultValue;
81
+ this.valueHandler({ name: this.name, value: this.value });
82
+ }
83
+ }
84
+ setValidity() {
85
+ return this.inputReference.validity.valid;
86
+ }
87
+ setErrorMessage() {
88
+ if (this.inputReference.validity.valueMissing) {
89
+ return translate('requiredError', this.language);
90
+ }
91
+ }
92
+ renderTooltip() {
93
+ if (this.showTooltip) {
94
+ return (h("div", { class: `checkboxgroup__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
95
+ }
96
+ return null;
97
+ }
98
+ handleParentCheckbox(e) {
99
+ const isChecked = e.target.checked;
100
+ this.showCheckboxes = isChecked;
101
+ this.selectedValues = isChecked
102
+ ? this.options.map((checkbox) => checkbox.name)
103
+ : [];
104
+ }
105
+ renderLabel() {
106
+ return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
107
+ }
108
+ render() {
109
+ return h("div", { key: '2eab716c27576d42a67d791b546022d58e89e21d', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '9e246685583dd06a156d6b11308b2cb355d37d01', class: 'checkboxgroup__wrapper--flex' }, h("vaadin-checkbox", { key: 'ba6a64bdd1d1141407ed65213684d3b4d643effc', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
110
+ h("img", { key: '2c23ca2dfe4213d9287958b5e6f09f76e9e3b031', class: 'checkboxgroup__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: '3180a35a47e4b57d8634da2f516d0c5c71ee0e9f', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (h("vaadin-checkbox-group", { key: 'b28fee432aa7bffe6aedf708f1ce9603a52833de', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
111
+ this.selectedValues = event.detail.value;
112
+ } }, this.options.map((checkbox) => h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName })))));
113
+ }
114
+ static get is() { return "checkbox-group-input"; }
115
+ static get encapsulation() { return "shadow"; }
116
+ static get originalStyleUrls() {
117
+ return {
118
+ "$": ["checkbox-group-input.scss"]
119
+ };
120
+ }
121
+ static get styleUrls() {
122
+ return {
123
+ "$": ["checkbox-group-input.css"]
124
+ };
125
+ }
126
+ static get properties() {
127
+ return {
128
+ "name": {
129
+ "type": "string",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "string",
133
+ "resolved": "string",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": false,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": "Name of the input."
141
+ },
142
+ "attribute": "name",
143
+ "reflect": true
144
+ },
145
+ "displayName": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": false,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": "Name of input to be shown to the user."
158
+ },
159
+ "attribute": "display-name",
160
+ "reflect": true
161
+ },
162
+ "defaultValue": {
163
+ "type": "string",
164
+ "mutable": false,
165
+ "complexType": {
166
+ "original": "string",
167
+ "resolved": "string",
168
+ "references": {}
169
+ },
170
+ "required": false,
171
+ "optional": false,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": "Default value for the input."
175
+ },
176
+ "attribute": "default-value",
177
+ "reflect": true,
178
+ "defaultValue": "''"
179
+ },
180
+ "autofilled": {
181
+ "type": "boolean",
182
+ "mutable": false,
183
+ "complexType": {
184
+ "original": "boolean",
185
+ "resolved": "boolean",
186
+ "references": {}
187
+ },
188
+ "required": false,
189
+ "optional": false,
190
+ "docs": {
191
+ "tags": [],
192
+ "text": "Boolean. Determines if input should be readonly."
193
+ },
194
+ "attribute": "autofilled",
195
+ "reflect": true
196
+ },
197
+ "tooltip": {
198
+ "type": "string",
199
+ "mutable": false,
200
+ "complexType": {
201
+ "original": "string",
202
+ "resolved": "string",
203
+ "references": {}
204
+ },
205
+ "required": false,
206
+ "optional": false,
207
+ "docs": {
208
+ "tags": [],
209
+ "text": "Tooltip text."
210
+ },
211
+ "attribute": "tooltip",
212
+ "reflect": true
213
+ },
214
+ "options": {
215
+ "type": "unknown",
216
+ "mutable": false,
217
+ "complexType": {
218
+ "original": "RegCfgContentField[]",
219
+ "resolved": "RegCfgContentField[]",
220
+ "references": {
221
+ "RegCfgContentField": {
222
+ "location": "import",
223
+ "path": "../../utils/types",
224
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::RegCfgContentField"
225
+ }
226
+ }
227
+ },
228
+ "required": false,
229
+ "optional": false,
230
+ "docs": {
231
+ "tags": [],
232
+ "text": "Options of the input."
233
+ }
234
+ },
235
+ "validation": {
236
+ "type": "unknown",
237
+ "mutable": false,
238
+ "complexType": {
239
+ "original": "ValidationSchema",
240
+ "resolved": "ValidationSchema",
241
+ "references": {
242
+ "ValidationSchema": {
243
+ "location": "import",
244
+ "path": "../../utils/types",
245
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::ValidationSchema"
246
+ }
247
+ }
248
+ },
249
+ "required": false,
250
+ "optional": false,
251
+ "docs": {
252
+ "tags": [],
253
+ "text": "Object of validation rules for the input."
254
+ }
255
+ },
256
+ "language": {
257
+ "type": "string",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "string",
261
+ "resolved": "string",
262
+ "references": {}
263
+ },
264
+ "required": false,
265
+ "optional": false,
266
+ "docs": {
267
+ "tags": [],
268
+ "text": "Currently selected language."
269
+ },
270
+ "attribute": "language",
271
+ "reflect": true
272
+ },
273
+ "emitValue": {
274
+ "type": "boolean",
275
+ "mutable": false,
276
+ "complexType": {
277
+ "original": "boolean",
278
+ "resolved": "boolean",
279
+ "references": {}
280
+ },
281
+ "required": false,
282
+ "optional": false,
283
+ "docs": {
284
+ "tags": [],
285
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
286
+ },
287
+ "attribute": "emit-value",
288
+ "reflect": true
289
+ },
290
+ "clientStyling": {
291
+ "type": "string",
292
+ "mutable": false,
293
+ "complexType": {
294
+ "original": "string",
295
+ "resolved": "string",
296
+ "references": {}
297
+ },
298
+ "required": false,
299
+ "optional": false,
300
+ "docs": {
301
+ "tags": [],
302
+ "text": "Client custom styling via inline style"
303
+ },
304
+ "attribute": "client-styling",
305
+ "reflect": true,
306
+ "defaultValue": "''"
307
+ }
308
+ };
309
+ }
310
+ static get states() {
311
+ return {
312
+ "errorMessage": {},
313
+ "isValid": {},
314
+ "limitStylingAppends": {},
315
+ "showTooltip": {},
316
+ "selectedValues": {},
317
+ "showCheckboxes": {}
318
+ };
319
+ }
320
+ static get events() {
321
+ return [{
322
+ "method": "sendValidityState",
323
+ "name": "sendValidityState",
324
+ "bubbles": true,
325
+ "cancelable": true,
326
+ "composed": true,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": ""
330
+ },
331
+ "complexType": {
332
+ "original": "InputStateEvent",
333
+ "resolved": "InputStateEvent",
334
+ "references": {
335
+ "InputStateEvent": {
336
+ "location": "import",
337
+ "path": "../../utils/types",
338
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::InputStateEvent"
339
+ }
340
+ }
341
+ }
342
+ }, {
343
+ "method": "sendInputValue",
344
+ "name": "sendInputValue",
345
+ "bubbles": true,
346
+ "cancelable": true,
347
+ "composed": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": ""
351
+ },
352
+ "complexType": {
353
+ "original": "InputValueEvent",
354
+ "resolved": "InputValueEvent",
355
+ "references": {
356
+ "InputValueEvent": {
357
+ "location": "import",
358
+ "path": "../../utils/types",
359
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::InputValueEvent"
360
+ }
361
+ }
362
+ }
363
+ }];
364
+ }
365
+ static get elementRef() { return "element"; }
366
+ static get watchers() {
367
+ return [{
368
+ "propName": "clientStyling",
369
+ "methodName": "handleStylingChange"
370
+ }, {
371
+ "propName": "isValid",
372
+ "methodName": "validityChanged"
373
+ }, {
374
+ "propName": "selectedValues",
375
+ "methodName": "setValue"
376
+ }, {
377
+ "propName": "emitValue",
378
+ "methodName": "emitValueHandler"
379
+ }];
380
+ }
381
+ static get listeners() {
382
+ return [{
383
+ "name": "click",
384
+ "method": "handleClickOutside",
385
+ "target": "document",
386
+ "capture": false,
387
+ "passive": false
388
+ }];
389
+ }
390
+ }
@@ -0,0 +1,78 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .checkbox {
10
+ font-family: "Roboto";
11
+ font-style: normal;
12
+ font-size: 15px;
13
+ }
14
+ .checkbox__wrapper {
15
+ display: flex;
16
+ gap: 10px;
17
+ position: relative;
18
+ align-items: baseline;
19
+ }
20
+ .checkbox__wrapper--relative {
21
+ position: relative;
22
+ }
23
+ .checkbox__input[indeterminate]::part(checkbox)::after, .checkbox__input[indeterminate]::part(checkbox), .checkbox__input[checked]::part(checkbox) {
24
+ background-color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
25
+ }
26
+ .checkbox__label {
27
+ font-style: inherit;
28
+ font-family: inherit;
29
+ font-weight: 400;
30
+ font-size: 16px;
31
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
32
+ line-height: 1.5;
33
+ padding: 0px;
34
+ vertical-align: baseline;
35
+ }
36
+ .checkbox__label a {
37
+ color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
38
+ }
39
+ .checkbox__error-message {
40
+ position: absolute;
41
+ top: calc(100% + 5px);
42
+ left: 0;
43
+ color: var(--emw--color-error, var(--emw--color-red, #ed0909));
44
+ }
45
+ .checkbox__tooltip-icon {
46
+ width: 16px;
47
+ height: auto;
48
+ }
49
+ .checkbox__tooltip {
50
+ position: absolute;
51
+ top: 0;
52
+ right: 20px;
53
+ background-color: var(--emw--color-white, #FFFFFF);
54
+ border: 1px solid var(--emw--color-gray-100, #E6E6E6);
55
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
56
+ padding: 10px;
57
+ border-radius: 5px;
58
+ opacity: 0;
59
+ transition: opacity 0.3s ease-in-out;
60
+ z-index: 10;
61
+ }
62
+ .checkbox__tooltip.visible {
63
+ opacity: 1;
64
+ }
65
+
66
+ .checkbox__input::part(checkbox) {
67
+ background-color: var(--emw--color-white, #FFFFFF);
68
+ transform: scale(0.8, 0.8);
69
+ border-radius: var(--emw--border-radius-small, 2px);
70
+ box-shadow: 0 0px 0px 2px var(--emw--color-gray, #7a7a7a);
71
+ }
72
+ .checkbox__input::part(required-indicator)::after {
73
+ content: "*";
74
+ }
75
+ .checkbox__input[indeterminate]::part(checkbox), .checkbox__input[checked]::part(checkbox) {
76
+ background-color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
77
+ box-shadow: none;
78
+ }