@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 numberInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.number__wrapper{position:relative;display:flex;
|
|
4
|
+
const numberInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.number{font-family:\"Roboto\";font-style:normal}.number__wrapper{position:relative;width:100%}.number__wrapper--autofilled{pointer-events:none}.number__wrapper--autofilled .number__label{color:#979797}.number__wrapper--autofilled .number__input{color:#979797}.number__wrapper--flex{display:flex;gap:5px}.number__wrapper--relative{position:relative}.number__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#2A3841}.number__label--required::after{content:\"*\";font-family:inherit;color:#2A3841;margin-left:2px}.number__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:10px 20px;width:inherit;position:relative;border:2px solid #DEE1EE;-moz-appearance:textfield;}.number__input:focus{outline-color:#3E3E3E}.number__input::-webkit-outer-spin-button,.number__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number__input--invalid{border:2px solid #cc0000b3}.number__input::placeholder{color:#979797}.number__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.number__tooltip-icon{width:16px;height:auto}.number__tooltip{position:absolute;top:0;left: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}.number__tooltip.visible{opacity:1}";
|
|
5
5
|
|
|
6
6
|
const NumberInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -10,6 +10,36 @@ const NumberInput = /*@__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
|
+
* Client custom styling via inline style
|
|
15
|
+
*/
|
|
16
|
+
this.clientStyling = '';
|
|
17
|
+
this.limitStylingAppends = false;
|
|
18
|
+
this.showTooltip = false;
|
|
19
|
+
this.validationPattern = '';
|
|
20
|
+
this.touched = false;
|
|
21
|
+
this.handleInput = (event) => {
|
|
22
|
+
this.value = event.target.value;
|
|
23
|
+
this.touched = true;
|
|
24
|
+
if (this.debounceTime) {
|
|
25
|
+
clearTimeout(this.debounceTime);
|
|
26
|
+
}
|
|
27
|
+
this.debounceTime = setTimeout(() => {
|
|
28
|
+
this.isValid = this.setValidity();
|
|
29
|
+
this.errorMessage = this.setErrorMessage();
|
|
30
|
+
this.emitValueHandler(true);
|
|
31
|
+
}, 500);
|
|
32
|
+
};
|
|
33
|
+
this.handleBlur = () => {
|
|
34
|
+
this.isValid = this.setValidity();
|
|
35
|
+
this.errorMessage = this.setErrorMessage();
|
|
36
|
+
this.touched = true;
|
|
37
|
+
};
|
|
38
|
+
this.setClientStyling = () => {
|
|
39
|
+
let sheet = document.createElement('style');
|
|
40
|
+
sheet.innerHTML = this.clientStyling;
|
|
41
|
+
this.stylingContainer.prepend(sheet);
|
|
42
|
+
};
|
|
13
43
|
}
|
|
14
44
|
validityChanged() {
|
|
15
45
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -28,17 +58,47 @@ const NumberInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
28
58
|
valueHandler(inputValueEvent) {
|
|
29
59
|
this.sendInputValue.emit(inputValueEvent);
|
|
30
60
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
61
|
+
handleClickOutside(event) {
|
|
62
|
+
if (event.composedPath()[0] === this.tooltipIconReference)
|
|
63
|
+
return;
|
|
64
|
+
if (event.composedPath()[0] !== this.tooltipReference)
|
|
65
|
+
this.showTooltip = false;
|
|
66
|
+
}
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
this.validationPattern = this.setPattern();
|
|
69
|
+
}
|
|
70
|
+
componentDidRender() {
|
|
71
|
+
// start custom styling area
|
|
72
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
73
|
+
if (this.clientStyling)
|
|
74
|
+
this.setClientStyling();
|
|
75
|
+
this.limitStylingAppends = true;
|
|
76
|
+
}
|
|
77
|
+
// end custom styling area
|
|
78
|
+
}
|
|
79
|
+
componentDidLoad() {
|
|
34
80
|
this.isValid = this.setValidity();
|
|
35
|
-
|
|
36
|
-
|
|
81
|
+
if (this.defaultValue) {
|
|
82
|
+
this.value = this.defaultValue;
|
|
83
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
84
|
+
}
|
|
37
85
|
}
|
|
38
86
|
setValidity() {
|
|
39
87
|
return this.inputReference.validity.valid;
|
|
40
88
|
}
|
|
89
|
+
setPattern() {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
92
|
+
return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
41
95
|
setErrorMessage() {
|
|
96
|
+
var _a, _b;
|
|
97
|
+
if (this.inputReference.validity.patternMismatch) {
|
|
98
|
+
const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
|
|
99
|
+
const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
|
|
100
|
+
return translate(`${errorCode}`, this.language) ? translate(`${errorCode}`, this.language) : errorMessage;
|
|
101
|
+
}
|
|
42
102
|
if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
|
|
43
103
|
return translate('numberLengthError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
|
|
44
104
|
}
|
|
@@ -46,9 +106,19 @@ const NumberInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
46
106
|
return translate('requiredError', this.language);
|
|
47
107
|
}
|
|
48
108
|
}
|
|
109
|
+
renderTooltip() {
|
|
110
|
+
if (this.showTooltip) {
|
|
111
|
+
return (h("div", { class: `number__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
49
115
|
render() {
|
|
50
|
-
|
|
51
|
-
|
|
116
|
+
let invalidClass = '';
|
|
117
|
+
if (this.touched) {
|
|
118
|
+
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
119
|
+
}
|
|
120
|
+
return h("div", { class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { class: 'number__wrapper--flex' }, h("label", { class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { class: 'number__wrapper--relative' }, this.tooltip &&
|
|
121
|
+
h("img", { class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { class: 'number__error-message' }, this.errorMessage));
|
|
52
122
|
}
|
|
53
123
|
static get watchers() { return {
|
|
54
124
|
"isValid": ["validityChanged"],
|
|
@@ -56,15 +126,21 @@ const NumberInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
56
126
|
}; }
|
|
57
127
|
static get style() { return numberInputCss; }
|
|
58
128
|
}, [1, "number-input", {
|
|
59
|
-
"name": [
|
|
60
|
-
"displayName": [
|
|
129
|
+
"name": [513],
|
|
130
|
+
"displayName": [513, "display-name"],
|
|
131
|
+
"placeholder": [513],
|
|
61
132
|
"validation": [16],
|
|
62
|
-
"defaultValue": [
|
|
63
|
-
"
|
|
64
|
-
"
|
|
133
|
+
"defaultValue": [513, "default-value"],
|
|
134
|
+
"autofilled": [516],
|
|
135
|
+
"tooltip": [513],
|
|
136
|
+
"language": [513],
|
|
137
|
+
"emitValue": [516, "emit-value"],
|
|
138
|
+
"clientStyling": [513, "client-styling"],
|
|
65
139
|
"errorMessage": [32],
|
|
66
|
-
"isValid": [32]
|
|
67
|
-
|
|
140
|
+
"isValid": [32],
|
|
141
|
+
"limitStylingAppends": [32],
|
|
142
|
+
"showTooltip": [32]
|
|
143
|
+
}, [[4, "click", "handleClickOutside"]]]);
|
|
68
144
|
function defineCustomElement() {
|
|
69
145
|
if (typeof customElements === "undefined") {
|
|
70
146
|
return;
|