@everymatrix/general-input 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.
- package/dist/cjs/checkbox-group-input_10.cjs.entry.js +34870 -0
- package/dist/cjs/general-input.cjs.entry.js +51 -0
- package/dist/cjs/general-input.cjs.js +19 -0
- package/dist/cjs/index-1768513d.js +1286 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +62 -0
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +344 -0
- package/dist/collection/components/checkbox-input/checkbox-input.css +62 -0
- package/dist/collection/components/checkbox-input/checkbox-input.js +322 -0
- package/dist/collection/components/date-input/date-input.css +85 -0
- package/dist/collection/components/date-input/date-input.js +341 -0
- package/dist/collection/components/email-input/email-input.css +83 -0
- package/dist/collection/components/email-input/email-input.js +382 -0
- package/dist/collection/components/general-input/general-input.css +3 -0
- package/dist/collection/components/general-input/general-input.js +296 -0
- package/dist/collection/components/number-input/number-input.css +90 -0
- package/dist/collection/components/number-input/number-input.js +349 -0
- package/dist/collection/components/password-input/password-input.css +86 -0
- package/dist/collection/components/password-input/password-input.js +395 -0
- package/dist/collection/components/radio-input/radio-input.css +43 -0
- package/dist/collection/components/radio-input/radio-input.js +298 -0
- package/dist/collection/components/select-input/select-input.css +93 -0
- package/dist/collection/components/select-input/select-input.js +412 -0
- package/dist/collection/components/tel-input/tel-input.css +116 -0
- package/dist/collection/components/tel-input/tel-input.js +421 -0
- package/dist/collection/components/text-input/text-input.css +83 -0
- package/dist/collection/components/text-input/text-input.js +406 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +26 -0
- package/dist/collection/utils/tooltipIcon.svg +5 -0
- package/dist/collection/utils/types.js +1 -0
- package/dist/collection/utils/utils.js +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 +5793 -0
- package/dist/components/checkbox-input.d.ts +11 -0
- package/dist/components/checkbox-input.js +6 -0
- package/dist/components/checkbox-input2.js +127 -0
- package/dist/components/date-input.d.ts +11 -0
- package/dist/components/date-input.js +6 -0
- package/dist/components/date-input2.js +5182 -0
- package/dist/components/email-input.d.ts +11 -0
- package/dist/components/email-input.js +6 -0
- package/dist/components/email-input2.js +150 -0
- package/dist/components/field-mixin.js +12712 -0
- package/dist/components/general-input.d.ts +11 -0
- package/dist/components/general-input.js +140 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/input-field-shared-styles.js +1067 -0
- package/dist/components/number-input.d.ts +11 -0
- package/dist/components/number-input.js +6 -0
- package/dist/components/number-input2.js +139 -0
- package/dist/components/password-input.d.ts +11 -0
- package/dist/components/password-input.js +6 -0
- package/dist/components/password-input2.js +879 -0
- package/dist/components/pattern-mixin.js +85 -0
- package/dist/components/radio-input.d.ts +11 -0
- package/dist/components/radio-input.js +6 -0
- package/dist/components/radio-input2.js +115 -0
- package/dist/components/select-input.d.ts +11 -0
- package/dist/components/select-input.js +6 -0
- package/dist/components/select-input2.js +166 -0
- package/dist/components/tel-input.d.ts +11 -0
- package/dist/components/tel-input.js +6 -0
- package/dist/components/tel-input2.js +178 -0
- package/dist/components/text-input.d.ts +11 -0
- package/dist/components/text-input.js +6 -0
- package/dist/components/text-input2.js +157 -0
- package/dist/components/tooltipIcon.js +30 -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 +2693 -0
- package/dist/esm/checkbox-group-input_10.entry.js +34857 -0
- package/dist/esm/general-input.entry.js +47 -0
- package/dist/esm/general-input.js +17 -0
- package/dist/esm/index-7e24a6f1.js +1259 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/general-input/general-input.esm.js +1 -0
- package/dist/general-input/index.esm.js +0 -0
- package/dist/general-input/p-61d76ec3.entry.js +1 -0
- package/dist/general-input/p-a79eb0a3.entry.js +4413 -0
- package/dist/general-input/p-fb647820.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +2 -0
- package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +72 -0
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +64 -0
- package/dist/types/components/date-input/date-input.d.ts +70 -0
- package/dist/types/components/email-input/email-input.d.ts +77 -0
- package/dist/types/components/general-input/general-input.d.ts +60 -0
- package/dist/types/components/number-input/number-input.d.ts +70 -0
- package/dist/types/components/password-input/password-input.d.ts +79 -0
- package/dist/types/components/radio-input/radio-input.d.ts +59 -0
- package/dist/types/components/select-input/select-input.d.ts +82 -0
- package/dist/types/components/tel-input/tel-input.d.ts +85 -0
- package/dist/types/components/text-input/text-input.d.ts +81 -0
- package/dist/types/components.d.ts +1140 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +5 -0
- package/dist/types/utils/types.d.ts +76 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface NumberInput extends Components.NumberInput, HTMLElement {}
|
|
4
|
+
export const NumberInput: {
|
|
5
|
+
prototype: NumberInput;
|
|
6
|
+
new (): NumberInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { t as translate, a as tooltipIconSvg } from './tooltipIcon.js';
|
|
3
|
+
|
|
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--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:#1F1F1F}.number__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;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:8px 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__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
|
+
|
|
6
|
+
const NumberInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
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.setClientStyling = () => {
|
|
21
|
+
let sheet = document.createElement('style');
|
|
22
|
+
sheet.innerHTML = this.clientStyling;
|
|
23
|
+
this.stylingContainer.prepend(sheet);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
validityChanged() {
|
|
27
|
+
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
28
|
+
if (this.emitValue == true) {
|
|
29
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
validityStateHandler(inputStateEvent) {
|
|
33
|
+
this.sendValidityState.emit(inputStateEvent);
|
|
34
|
+
}
|
|
35
|
+
emitValueHandler(newValue) {
|
|
36
|
+
if (newValue == true && this.isValid) {
|
|
37
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
valueHandler(inputValueEvent) {
|
|
41
|
+
this.sendInputValue.emit(inputValueEvent);
|
|
42
|
+
}
|
|
43
|
+
handleClickOutside(event) {
|
|
44
|
+
if (event.composedPath()[0] === this.tooltipIconReference)
|
|
45
|
+
return;
|
|
46
|
+
if (event.composedPath()[0] !== this.tooltipReference)
|
|
47
|
+
this.showTooltip = false;
|
|
48
|
+
}
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
this.validationPattern = this.setPattern();
|
|
51
|
+
}
|
|
52
|
+
componentDidRender() {
|
|
53
|
+
// start custom styling area
|
|
54
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
55
|
+
if (this.clientStyling)
|
|
56
|
+
this.setClientStyling();
|
|
57
|
+
this.limitStylingAppends = true;
|
|
58
|
+
}
|
|
59
|
+
// end custom styling area
|
|
60
|
+
if (this.defaultValue) {
|
|
61
|
+
this.value = this.defaultValue;
|
|
62
|
+
this.valueHandler({ name: this.name, value: this.value });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
handleInput(event) {
|
|
66
|
+
this.value = event.target.value;
|
|
67
|
+
this.errorMessage = this.setErrorMessage();
|
|
68
|
+
this.isValid = this.setValidity();
|
|
69
|
+
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
70
|
+
this.emitValueHandler(true);
|
|
71
|
+
}
|
|
72
|
+
setValidity() {
|
|
73
|
+
return this.inputReference.validity.valid;
|
|
74
|
+
}
|
|
75
|
+
setPattern() {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
78
|
+
return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
setErrorMessage() {
|
|
82
|
+
var _a;
|
|
83
|
+
if (this.inputReference.validity.patternMismatch) {
|
|
84
|
+
return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
|
|
85
|
+
}
|
|
86
|
+
if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
|
|
87
|
+
return translate('numberLengthError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
|
|
88
|
+
}
|
|
89
|
+
if (this.inputReference.validity.valueMissing) {
|
|
90
|
+
return translate('requiredError', this.language);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
renderTooltip() {
|
|
94
|
+
if (this.showTooltip) {
|
|
95
|
+
return (h("div", { class: `number__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
const invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'number__input--invalid';
|
|
101
|
+
return h("div", { class: 'number__wrapper', 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 &&
|
|
102
|
+
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} ${this.placeholder && this.validation.mandatory ? '*' : ''}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onBlur: (e) => this.handleInput(e) }), h("small", { class: 'number__error-message' }, this.errorMessage));
|
|
103
|
+
}
|
|
104
|
+
static get watchers() { return {
|
|
105
|
+
"isValid": ["validityChanged"],
|
|
106
|
+
"emitValue": ["emitValueHandler"]
|
|
107
|
+
}; }
|
|
108
|
+
static get style() { return numberInputCss; }
|
|
109
|
+
}, [1, "number-input", {
|
|
110
|
+
"name": [513],
|
|
111
|
+
"displayName": [513, "display-name"],
|
|
112
|
+
"placeholder": [513],
|
|
113
|
+
"validation": [16],
|
|
114
|
+
"defaultValue": [513, "default-value"],
|
|
115
|
+
"autofilled": [516],
|
|
116
|
+
"tooltip": [513],
|
|
117
|
+
"language": [513],
|
|
118
|
+
"emitValue": [516, "emit-value"],
|
|
119
|
+
"clientStyling": [513, "client-styling"],
|
|
120
|
+
"errorMessage": [32],
|
|
121
|
+
"isValid": [32],
|
|
122
|
+
"limitStylingAppends": [32],
|
|
123
|
+
"showTooltip": [32]
|
|
124
|
+
}, [[4, "click", "handleClickOutside"]]]);
|
|
125
|
+
function defineCustomElement() {
|
|
126
|
+
if (typeof customElements === "undefined") {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const components = ["number-input"];
|
|
130
|
+
components.forEach(tagName => { switch (tagName) {
|
|
131
|
+
case "number-input":
|
|
132
|
+
if (!customElements.get(tagName)) {
|
|
133
|
+
customElements.define(tagName, NumberInput);
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
} });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { NumberInput as N, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PasswordInput extends Components.PasswordInput, HTMLElement {}
|
|
4
|
+
export const PasswordInput: {
|
|
5
|
+
prototype: PasswordInput;
|
|
6
|
+
new (): PasswordInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|