@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.
- package/dist/cjs/checkbox-group-input_10.cjs.entry.js +35539 -0
- package/dist/cjs/general-input.cjs.entry.js +34 -13
- package/dist/cjs/general-input.cjs.js +2 -2
- package/dist/cjs/{index-64a5cb7f.js → index-132a0774.js} +119 -6
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/locale.utils-7665b010.js +71 -0
- package/dist/cjs/toggle-checkbox-input.cjs.entry.js +85 -0
- package/dist/cjs/tooltipIcon-092a795f.js +5 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +62 -0
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +366 -0
- package/dist/collection/components/checkbox-input/checkbox-input.css +47 -1
- package/dist/collection/components/checkbox-input/checkbox-input.js +143 -16
- package/dist/collection/components/date-input/date-input.css +64 -30
- package/dist/collection/components/date-input/date-input.js +194 -13
- package/dist/collection/components/email-input/email-input.css +63 -28
- package/dist/collection/components/email-input/email-input.js +197 -21
- package/dist/collection/components/general-input/general-input.js +163 -21
- package/dist/collection/components/number-input/number-input.css +65 -30
- package/dist/collection/components/number-input/number-input.js +174 -19
- package/dist/collection/components/password-input/password-input.css +120 -29
- package/dist/collection/components/password-input/password-input.js +341 -25
- package/dist/collection/components/radio-input/radio-input.css +22 -1
- package/dist/collection/components/radio-input/radio-input.js +89 -10
- package/dist/collection/components/select-input/select-input.css +75 -22
- package/dist/collection/components/select-input/select-input.js +180 -37
- package/dist/collection/components/tel-input/tel-input.css +91 -33
- package/dist/collection/components/tel-input/tel-input.js +202 -24
- package/dist/collection/components/text-input/text-input.css +63 -28
- package/dist/collection/components/text-input/text-input.js +208 -39
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +76 -0
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +324 -0
- package/dist/collection/utils/locale.utils.js +52 -13
- package/dist/collection/utils/tooltipIcon.svg +5 -0
- package/dist/components/active-mixin.js +975 -0
- package/dist/components/checkbox-group-input.d.ts +11 -0
- package/dist/components/checkbox-group-input.js +6 -0
- package/dist/components/checkbox-group-input2.js +1125 -0
- package/dist/components/checkbox-input2.js +62 -12
- package/dist/components/date-input2.js +10247 -15
- package/dist/components/email-input2.js +98 -21
- package/dist/components/field-mixin.js +12712 -0
- package/dist/components/general-input.js +1 -118
- package/dist/components/general-input2.js +331 -0
- package/dist/components/input-field-shared-styles.js +1114 -0
- package/dist/components/number-input2.js +92 -16
- package/dist/components/password-input2.js +924 -24
- package/dist/components/pattern-mixin.js +85 -0
- package/dist/components/radio-input2.js +45 -11
- package/dist/components/select-input2.js +87 -27
- package/dist/components/tel-input2.js +122 -22
- package/dist/components/text-input2.js +120 -34
- package/dist/components/toggle-checkbox-input.d.ts +11 -0
- package/dist/components/toggle-checkbox-input.js +6 -0
- package/dist/components/tooltipIcon.js +70 -0
- package/dist/components/vaadin-button.js +461 -0
- package/dist/components/vaadin-combo-box.js +4329 -0
- package/dist/components/virtual-keyboard-controller.js +2658 -0
- package/dist/esm/checkbox-group-input_10.entry.js +35526 -0
- package/dist/esm/general-input.entry.js +34 -13
- package/dist/esm/general-input.js +2 -2
- package/dist/esm/{index-df80f936.js → index-db76d5b5.js} +118 -7
- package/dist/esm/loader.js +2 -2
- package/dist/esm/locale.utils-95ea2605.js +68 -0
- package/dist/esm/toggle-checkbox-input.entry.js +81 -0
- package/dist/esm/tooltipIcon-99c1c7b7.js +3 -0
- package/dist/general-input/general-input.esm.js +1 -1
- package/dist/general-input/p-0966f523.entry.js +3581 -0
- package/dist/general-input/p-916a1319.entry.js +1 -0
- package/dist/general-input/p-b408093e.js +1 -0
- package/dist/general-input/p-c2d4d6ac.entry.js +1 -0
- package/dist/general-input/p-f4f4ccda.js +1 -0
- package/dist/general-input/p-f6132f1d.js +1 -0
- package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +74 -0
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +28 -2
- package/dist/types/components/date-input/date-input.d.ts +43 -1
- package/dist/types/components/email-input/email-input.d.ts +37 -3
- package/dist/types/components/general-input/general-input.d.ts +30 -0
- package/dist/types/components/number-input/number-input.d.ts +34 -3
- package/dist/types/components/password-input/password-input.d.ts +56 -7
- package/dist/types/components/radio-input/radio-input.d.ts +17 -1
- package/dist/types/components/select-input/select-input.d.ts +36 -3
- package/dist/types/components/tel-input/tel-input.d.ts +40 -5
- package/dist/types/components/text-input/text-input.d.ts +84 -0
- package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +67 -0
- package/dist/types/components.d.ts +568 -9
- package/dist/types/utils/locale.utils.d.ts +9 -0
- package/dist/types/utils/types.d.ts +41 -9
- package/package.json +8 -1
- package/dist/cjs/checkbox-input_9.cjs.entry.js +0 -623
- package/dist/components/locale.utils.js +0 -29
- package/dist/esm/checkbox-input_9.entry.js +0 -611
- package/dist/general-input/p-1703fce3.entry.js +0 -1
- package/dist/general-input/p-d9f7fa2e.js +0 -1
- package/dist/general-input/p-dea0a4ac.entry.js +0 -1
- /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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { t as translate } from './
|
|
2
|
+
import { t as translate, a as tooltipIconSvg } from './tooltipIcon.js';
|
|
3
3
|
|
|
4
|
-
const checkboxInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.checkbox__wrapper{display:flex;gap:10px;position:relative;align-items:baseline}.checkbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:
|
|
4
|
+
const checkboxInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.checkbox{font-family:\"Roboto\";font-style:normal}.checkbox__wrapper{display:flex;gap:10px;position:relative;align-items:baseline}.checkbox__wrapper--flex{display:flex;gap:5px}.checkbox__wrapper--relative{position:relative}.checkbox__input{transform:scale(1.307, 1.307);margin-left:2px}.checkbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:#2B2D3F;line-height:14px}.checkbox__label-text{font-size:16px}.checkbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.checkbox__tooltip-icon{width:16px;height:auto}.checkbox__tooltip{position:absolute;top:0;right:20px;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}.checkbox__tooltip.visible{opacity:1}";
|
|
5
5
|
|
|
6
6
|
const CheckboxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -10,6 +10,22 @@ const CheckboxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
12
12
|
this.sendInputValue = createEvent(this, "sendInputValue", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Default value for the input.
|
|
15
|
+
*/
|
|
16
|
+
this.defaultValue = '';
|
|
17
|
+
/**
|
|
18
|
+
* Client custom styling via inline style
|
|
19
|
+
*/
|
|
20
|
+
this.clientStyling = '';
|
|
21
|
+
this.limitStylingAppends = false;
|
|
22
|
+
this.showTooltip = false;
|
|
23
|
+
this.value = '';
|
|
24
|
+
this.setClientStyling = () => {
|
|
25
|
+
let sheet = document.createElement('style');
|
|
26
|
+
sheet.innerHTML = this.clientStyling;
|
|
27
|
+
this.stylingContainer.prepend(sheet);
|
|
28
|
+
};
|
|
13
29
|
}
|
|
14
30
|
validityChanged() {
|
|
15
31
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -28,13 +44,31 @@ const CheckboxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
28
44
|
valueHandler(inputValueEvent) {
|
|
29
45
|
this.sendInputValue.emit(inputValueEvent);
|
|
30
46
|
}
|
|
31
|
-
|
|
47
|
+
handleClickOutside(event) {
|
|
48
|
+
if (event.composedPath()[0] === this.tooltipIconReference)
|
|
49
|
+
return;
|
|
50
|
+
if (event.composedPath()[0] !== this.tooltipReference)
|
|
51
|
+
this.showTooltip = false;
|
|
52
|
+
}
|
|
53
|
+
componentDidRender() {
|
|
54
|
+
// start custom styling area
|
|
55
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
56
|
+
if (this.clientStyling)
|
|
57
|
+
this.setClientStyling();
|
|
58
|
+
this.limitStylingAppends = true;
|
|
59
|
+
}
|
|
60
|
+
// end custom styling area
|
|
61
|
+
}
|
|
62
|
+
componentDidLoad() {
|
|
63
|
+
if (this.defaultValue) {
|
|
64
|
+
this.value = this.defaultValue;
|
|
65
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
66
|
+
}
|
|
32
67
|
}
|
|
33
68
|
handleClick() {
|
|
34
|
-
this.value = this.inputReference.checked;
|
|
69
|
+
this.value = this.inputReference.checked.toString();
|
|
35
70
|
this.errorMessage = this.setErrorMessage();
|
|
36
71
|
this.isValid = this.setValidity();
|
|
37
|
-
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
38
72
|
this.emitValueHandler(true);
|
|
39
73
|
}
|
|
40
74
|
setValidity() {
|
|
@@ -45,8 +79,18 @@ const CheckboxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
45
79
|
return translate('requiredError', this.language);
|
|
46
80
|
}
|
|
47
81
|
}
|
|
82
|
+
renderLabel() {
|
|
83
|
+
return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input` }, h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
|
|
84
|
+
}
|
|
85
|
+
renderTooltip() {
|
|
86
|
+
if (this.showTooltip) {
|
|
87
|
+
return (h("div", { class: `checkbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
48
91
|
render() {
|
|
49
|
-
return h("div", { class:
|
|
92
|
+
return h("div", { class: `checkbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("input", { class: 'checkbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.inputReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel(), h("small", { class: 'checkbox__error-message' }, this.errorMessage), h("div", { class: 'checkbox__wrapper--relative' }, this.tooltip &&
|
|
93
|
+
h("img", { class: 'checkbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()));
|
|
50
94
|
}
|
|
51
95
|
static get watchers() { return {
|
|
52
96
|
"isValid": ["validityChanged"],
|
|
@@ -54,14 +98,20 @@ const CheckboxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
54
98
|
}; }
|
|
55
99
|
static get style() { return checkboxInputCss; }
|
|
56
100
|
}, [1, "checkbox-input", {
|
|
57
|
-
"name": [
|
|
58
|
-
"displayName": [
|
|
101
|
+
"name": [513],
|
|
102
|
+
"displayName": [513, "display-name"],
|
|
103
|
+
"defaultValue": [513, "default-value"],
|
|
104
|
+
"autofilled": [516],
|
|
105
|
+
"tooltip": [513],
|
|
59
106
|
"validation": [16],
|
|
60
|
-
"language": [
|
|
61
|
-
"emitValue": [
|
|
107
|
+
"language": [513],
|
|
108
|
+
"emitValue": [516, "emit-value"],
|
|
109
|
+
"clientStyling": [513, "client-styling"],
|
|
62
110
|
"errorMessage": [32],
|
|
63
|
-
"isValid": [32]
|
|
64
|
-
|
|
111
|
+
"isValid": [32],
|
|
112
|
+
"limitStylingAppends": [32],
|
|
113
|
+
"showTooltip": [32]
|
|
114
|
+
}, [[4, "click", "handleClickOutside"]]]);
|
|
65
115
|
function defineCustomElement() {
|
|
66
116
|
if (typeof customElements === "undefined") {
|
|
67
117
|
return;
|