@everymatrix/general-input 1.32.4 → 1.33.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 +36077 -0
- package/dist/cjs/general-input.cjs.entry.js +75 -0
- package/dist/cjs/general-input.cjs.js +19 -0
- package/dist/cjs/index-132a0774.js +1327 -0
- package/dist/cjs/index.cjs.js +18 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/locale.utils-cef1d3b6.js +128 -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 +23 -0
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +82 -0
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +366 -0
- package/dist/collection/components/checkbox-input/checkbox-input.css +68 -0
- package/dist/collection/components/checkbox-input/checkbox-input.js +324 -0
- package/dist/collection/components/date-input/date-input.css +101 -0
- package/dist/collection/components/date-input/date-input.js +396 -0
- package/dist/collection/components/email-input/email-input.css +95 -0
- package/dist/collection/components/email-input/email-input.js +403 -0
- package/dist/collection/components/general-input/general-input.css +4 -0
- package/dist/collection/components/general-input/general-input.js +373 -0
- package/dist/collection/components/number-input/number-input.css +102 -0
- package/dist/collection/components/number-input/number-input.js +368 -0
- package/dist/collection/components/password-input/password-input.css +182 -0
- package/dist/collection/components/password-input/password-input.js +527 -0
- package/dist/collection/components/radio-input/radio-input.css +43 -0
- package/dist/collection/components/radio-input/radio-input.js +297 -0
- package/dist/collection/components/select-input/select-input.css +122 -0
- package/dist/collection/components/select-input/select-input.js +429 -0
- package/dist/collection/components/tel-input/tel-input.css +145 -0
- package/dist/collection/components/tel-input/tel-input.js +440 -0
- package/dist/collection/components/text-input/text-input.css +98 -0
- package/dist/collection/components/text-input/text-input.js +448 -0
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +82 -0
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +324 -0
- package/dist/collection/index.js +17 -0
- package/dist/collection/utils/locale.utils.js +123 -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 +1078 -0
- package/dist/components/checkbox-input.d.ts +11 -0
- package/dist/components/checkbox-input.js +6 -0
- package/dist/components/checkbox-input2.js +129 -0
- package/dist/components/date-input.d.ts +11 -0
- package/dist/components/date-input.js +6 -0
- package/dist/components/date-input2.js +11556 -0
- package/dist/components/email-input.d.ts +11 -0
- package/dist/components/email-input.js +6 -0
- package/dist/components/email-input2.js +171 -0
- package/dist/components/field-mixin.js +12426 -0
- package/dist/components/general-input.d.ts +11 -0
- package/dist/components/general-input.js +6 -0
- package/dist/components/general-input2.js +341 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +18 -0
- package/dist/components/input-field-shared-styles.js +1211 -0
- package/dist/components/number-input.d.ts +11 -0
- package/dist/components/number-input.js +6 -0
- package/dist/components/number-input2.js +158 -0
- package/dist/components/password-input.d.ts +11 -0
- package/dist/components/password-input.js +6 -0
- package/dist/components/password-input2.js +1041 -0
- package/dist/components/radio-input.d.ts +11 -0
- package/dist/components/radio-input.js +6 -0
- package/dist/components/radio-input2.js +114 -0
- package/dist/components/select-input.d.ts +11 -0
- package/dist/components/select-input.js +6 -0
- package/dist/components/select-input2.js +183 -0
- package/dist/components/tel-input.d.ts +11 -0
- package/dist/components/tel-input.js +6 -0
- package/dist/components/tel-input2.js +197 -0
- package/dist/components/text-input.d.ts +11 -0
- package/dist/components/text-input.js +6 -0
- package/dist/components/text-input2.js +199 -0
- package/dist/components/toggle-checkbox-input.d.ts +11 -0
- package/dist/components/toggle-checkbox-input.js +6 -0
- package/dist/components/tooltipIcon.js +127 -0
- package/dist/components/vaadin-button.js +490 -0
- package/dist/components/vaadin-combo-box.js +4512 -0
- package/dist/components/virtual-keyboard-controller.js +2001 -0
- package/dist/esm/checkbox-group-input_10.entry.js +36064 -0
- package/dist/esm/general-input.entry.js +71 -0
- package/dist/esm/general-input.js +17 -0
- package/dist/esm/index-db76d5b5.js +1299 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/locale.utils-de759721.js +125 -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/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 -0
- package/dist/general-input/index.esm.js +1 -0
- package/dist/general-input/p-10efdf3f.js +1 -0
- package/dist/general-input/p-613c3e00.entry.js +1 -0
- package/dist/general-input/p-660bcdd1.entry.js +1 -0
- package/dist/general-input/p-9b6b0396.entry.js +3646 -0
- package/dist/general-input/p-b408093e.js +1 -0
- package/dist/general-input/p-f4f4ccda.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/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 +74 -0
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +65 -0
- package/dist/types/components/date-input/date-input.d.ts +84 -0
- package/dist/types/components/email-input/email-input.d.ts +80 -0
- package/dist/types/components/general-input/general-input.d.ts +75 -0
- package/dist/types/components/number-input/number-input.d.ts +74 -0
- package/dist/types/components/password-input/password-input.d.ts +91 -0
- package/dist/types/components/radio-input/radio-input.d.ts +59 -0
- package/dist/types/components/select-input/select-input.d.ts +83 -0
- package/dist/types/components/tel-input/tel-input.d.ts +89 -0
- 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 +1268 -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 +17 -0
- package/dist/types/utils/types.d.ts +87 -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 +2 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface GeneralInput extends Components.GeneralInput, HTMLElement {}
|
|
4
|
+
export const GeneralInput: {
|
|
5
|
+
prototype: GeneralInput;
|
|
6
|
+
new (): GeneralInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { t as translate, a as tooltipIconSvg, g as getTranslations } from './tooltipIcon.js';
|
|
3
|
+
import { d as defineCustomElement$b } from './checkbox-group-input2.js';
|
|
4
|
+
import { d as defineCustomElement$a } from './checkbox-input2.js';
|
|
5
|
+
import { d as defineCustomElement$9 } from './date-input2.js';
|
|
6
|
+
import { d as defineCustomElement$8 } from './email-input2.js';
|
|
7
|
+
import { d as defineCustomElement$7 } from './number-input2.js';
|
|
8
|
+
import { d as defineCustomElement$6 } from './password-input2.js';
|
|
9
|
+
import { d as defineCustomElement$5 } from './radio-input2.js';
|
|
10
|
+
import { d as defineCustomElement$4 } from './select-input2.js';
|
|
11
|
+
import { d as defineCustomElement$3 } from './tel-input2.js';
|
|
12
|
+
import { d as defineCustomElement$2 } from './text-input2.js';
|
|
13
|
+
|
|
14
|
+
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:10px;align-items:baseline}.togglecheckbox__wrapper--relative{position:relative;display:inline}.togglecheckbox__input{transform:scale(1.307, 1.307);margin-left:2px;accent-color:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C))}.togglecheckbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emfe-w-registration-typography, var(--emfe-w-color-black, #000000));line-height:1.5;cursor:pointer;padding:0}.togglecheckbox__label-text{font-size:16px}.togglecheckbox__label a{color:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C))}.togglecheckbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}.togglecheckbox__tooltip-icon{width:16px;height:auto}.togglecheckbox__tooltip{position:absolute;top:0;right:0;background-color:var(--emfe-w-color-white, #FFFFFF);border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);color:var(--emfe-w-registration-typography, var(--emfe-w-color-black, #000000));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}";
|
|
15
|
+
|
|
16
|
+
const ToggleCheckboxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.__registerHost();
|
|
20
|
+
this.__attachShadow();
|
|
21
|
+
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
22
|
+
this.sendInputValue = createEvent(this, "sendInputValue", 7);
|
|
23
|
+
/**
|
|
24
|
+
* Default value for the input.
|
|
25
|
+
*/
|
|
26
|
+
this.defaultValue = '';
|
|
27
|
+
/**
|
|
28
|
+
* Client custom styling via inline style
|
|
29
|
+
*/
|
|
30
|
+
this.clientStyling = '';
|
|
31
|
+
this.limitStylingAppends = false;
|
|
32
|
+
this.showTooltip = false;
|
|
33
|
+
this.value = '';
|
|
34
|
+
this.setClientStyling = () => {
|
|
35
|
+
let sheet = document.createElement('style');
|
|
36
|
+
sheet.innerHTML = this.clientStyling;
|
|
37
|
+
this.stylingContainer.prepend(sheet);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
validityStateHandler(inputStateEvent) {
|
|
41
|
+
this.sendValidityState.emit(inputStateEvent);
|
|
42
|
+
}
|
|
43
|
+
valueHandler(inputValueEvent) {
|
|
44
|
+
this.sendInputValue.emit(inputValueEvent);
|
|
45
|
+
}
|
|
46
|
+
handleClickOutside(event) {
|
|
47
|
+
if (event.composedPath()[0] === this.tooltipIconReference)
|
|
48
|
+
return;
|
|
49
|
+
if (event.composedPath()[0] !== this.tooltipReference)
|
|
50
|
+
this.showTooltip = false;
|
|
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
|
+
}
|
|
61
|
+
handleClick() {
|
|
62
|
+
this.showFields = this.checkboxReference.checked;
|
|
63
|
+
this.errorMessage = this.setErrorMessage();
|
|
64
|
+
this.isValid = this.setValidity();
|
|
65
|
+
}
|
|
66
|
+
setValidity() {
|
|
67
|
+
return this.checkboxReference.validity.valid;
|
|
68
|
+
}
|
|
69
|
+
setErrorMessage() {
|
|
70
|
+
if (this.checkboxReference.validity.valueMissing) {
|
|
71
|
+
return translate('requiredError', this.language);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
renderLabel() {
|
|
75
|
+
return (h("label", { class: 'togglecheckbox__label', htmlFor: `${this.name}__input` }, h("div", { class: 'togglecheckbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
|
|
76
|
+
}
|
|
77
|
+
renderTooltip() {
|
|
78
|
+
if (this.showTooltip) {
|
|
79
|
+
return (h("div", { class: `togglecheckbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
return h("div", { class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { class: 'togglecheckbox__wrapper--flex' }, 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()), h("small", { class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
|
|
85
|
+
h("img", { class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
|
|
86
|
+
return 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 });
|
|
87
|
+
})));
|
|
88
|
+
}
|
|
89
|
+
static get style() { return toggleCheckboxInputCss; }
|
|
90
|
+
}, [1, "toggle-checkbox-input", {
|
|
91
|
+
"name": [513],
|
|
92
|
+
"displayName": [513, "display-name"],
|
|
93
|
+
"defaultValue": [513, "default-value"],
|
|
94
|
+
"options": [16],
|
|
95
|
+
"autofilled": [516],
|
|
96
|
+
"tooltip": [513],
|
|
97
|
+
"validation": [16],
|
|
98
|
+
"language": [513],
|
|
99
|
+
"emitValue": [516, "emit-value"],
|
|
100
|
+
"clientStyling": [513, "client-styling"],
|
|
101
|
+
"errorMessage": [32],
|
|
102
|
+
"isValid": [32],
|
|
103
|
+
"limitStylingAppends": [32],
|
|
104
|
+
"showTooltip": [32],
|
|
105
|
+
"showFields": [32]
|
|
106
|
+
}, [[4, "click", "handleClickOutside"]]]);
|
|
107
|
+
function defineCustomElement$1() {
|
|
108
|
+
if (typeof customElements === "undefined") {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const components = ["toggle-checkbox-input", "checkbox-group-input", "checkbox-input", "date-input", "email-input", "general-input", "number-input", "password-input", "radio-input", "select-input", "tel-input", "text-input", "toggle-checkbox-input"];
|
|
112
|
+
components.forEach(tagName => { switch (tagName) {
|
|
113
|
+
case "toggle-checkbox-input":
|
|
114
|
+
if (!customElements.get(tagName)) {
|
|
115
|
+
customElements.define(tagName, ToggleCheckboxInput);
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case "checkbox-group-input":
|
|
119
|
+
if (!customElements.get(tagName)) {
|
|
120
|
+
defineCustomElement$b();
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case "checkbox-input":
|
|
124
|
+
if (!customElements.get(tagName)) {
|
|
125
|
+
defineCustomElement$a();
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
case "date-input":
|
|
129
|
+
if (!customElements.get(tagName)) {
|
|
130
|
+
defineCustomElement$9();
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
case "email-input":
|
|
134
|
+
if (!customElements.get(tagName)) {
|
|
135
|
+
defineCustomElement$8();
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
case "general-input":
|
|
139
|
+
if (!customElements.get(tagName)) {
|
|
140
|
+
defineCustomElement();
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
case "number-input":
|
|
144
|
+
if (!customElements.get(tagName)) {
|
|
145
|
+
defineCustomElement$7();
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
case "password-input":
|
|
149
|
+
if (!customElements.get(tagName)) {
|
|
150
|
+
defineCustomElement$6();
|
|
151
|
+
}
|
|
152
|
+
break;
|
|
153
|
+
case "radio-input":
|
|
154
|
+
if (!customElements.get(tagName)) {
|
|
155
|
+
defineCustomElement$5();
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case "select-input":
|
|
159
|
+
if (!customElements.get(tagName)) {
|
|
160
|
+
defineCustomElement$4();
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
case "tel-input":
|
|
164
|
+
if (!customElements.get(tagName)) {
|
|
165
|
+
defineCustomElement$3();
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
case "text-input":
|
|
169
|
+
if (!customElements.get(tagName)) {
|
|
170
|
+
defineCustomElement$2();
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
case "toggle-checkbox-input":
|
|
174
|
+
if (!customElements.get(tagName)) {
|
|
175
|
+
defineCustomElement$1();
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
} });
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const generalInputCss = ":host{display:block;height:100%}";
|
|
182
|
+
|
|
183
|
+
const GeneralInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
184
|
+
constructor() {
|
|
185
|
+
super();
|
|
186
|
+
this.__registerHost();
|
|
187
|
+
this.__attachShadow();
|
|
188
|
+
/**
|
|
189
|
+
* Type the general-input should take. Can take the default HTML input values.
|
|
190
|
+
*/
|
|
191
|
+
this.type = 'text';
|
|
192
|
+
/**
|
|
193
|
+
* Client custom styling via inline style
|
|
194
|
+
*/
|
|
195
|
+
this.clientStyling = '';
|
|
196
|
+
/**
|
|
197
|
+
* Translations via URL
|
|
198
|
+
*/
|
|
199
|
+
this.translationUrl = '';
|
|
200
|
+
/**
|
|
201
|
+
* Emit event on click
|
|
202
|
+
*/
|
|
203
|
+
this.emitOnClick = false;
|
|
204
|
+
this.handleClick = () => {
|
|
205
|
+
if (this.emitOnClick) {
|
|
206
|
+
window.postMessage({ type: `registration${this.name}Clicked` }, window.location.href);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
connectedCallback() {
|
|
211
|
+
if (this.translationUrl) {
|
|
212
|
+
getTranslations(this.translationUrl);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
renderInput() {
|
|
216
|
+
var _a;
|
|
217
|
+
switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
|
218
|
+
case 'text':
|
|
219
|
+
return 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 });
|
|
220
|
+
case 'email':
|
|
221
|
+
return 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 });
|
|
222
|
+
case 'number':
|
|
223
|
+
return 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 });
|
|
224
|
+
case 'checkbox':
|
|
225
|
+
return 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 });
|
|
226
|
+
case 'checkboxgroup':
|
|
227
|
+
return 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 });
|
|
228
|
+
case 'togglecheckbox':
|
|
229
|
+
return 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 });
|
|
230
|
+
case 'datetime':
|
|
231
|
+
return 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 });
|
|
232
|
+
case 'password':
|
|
233
|
+
return 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 });
|
|
234
|
+
case 'radio':
|
|
235
|
+
return 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 });
|
|
236
|
+
case 'tel':
|
|
237
|
+
return 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 });
|
|
238
|
+
case 'dropdown':
|
|
239
|
+
return 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 });
|
|
240
|
+
default:
|
|
241
|
+
return h("p", null, "The ", this.type, " input type is not valid");
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
render() {
|
|
245
|
+
return (h(Host, { class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
|
|
246
|
+
}
|
|
247
|
+
static get style() { return generalInputCss; }
|
|
248
|
+
}, [1, "general-input", {
|
|
249
|
+
"type": [513],
|
|
250
|
+
"name": [513],
|
|
251
|
+
"displayName": [513, "display-name"],
|
|
252
|
+
"placeholder": [513],
|
|
253
|
+
"action": [513],
|
|
254
|
+
"validation": [16],
|
|
255
|
+
"options": [520],
|
|
256
|
+
"language": [513],
|
|
257
|
+
"autofilled": [516],
|
|
258
|
+
"tooltip": [513],
|
|
259
|
+
"defaultValue": [520, "default-value"],
|
|
260
|
+
"emitValue": [516, "emit-value"],
|
|
261
|
+
"isDuplicateInput": [516, "is-duplicate-input"],
|
|
262
|
+
"clientStyling": [520, "client-styling"],
|
|
263
|
+
"dateFormat": [513, "date-format"],
|
|
264
|
+
"translationUrl": [513, "translation-url"],
|
|
265
|
+
"emitOnClick": [516, "emit-on-click"]
|
|
266
|
+
}]);
|
|
267
|
+
function defineCustomElement() {
|
|
268
|
+
if (typeof customElements === "undefined") {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const components = ["general-input", "checkbox-group-input", "checkbox-input", "date-input", "email-input", "general-input", "number-input", "password-input", "radio-input", "select-input", "tel-input", "text-input", "toggle-checkbox-input"];
|
|
272
|
+
components.forEach(tagName => { switch (tagName) {
|
|
273
|
+
case "general-input":
|
|
274
|
+
if (!customElements.get(tagName)) {
|
|
275
|
+
customElements.define(tagName, GeneralInput);
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
case "checkbox-group-input":
|
|
279
|
+
if (!customElements.get(tagName)) {
|
|
280
|
+
defineCustomElement$b();
|
|
281
|
+
}
|
|
282
|
+
break;
|
|
283
|
+
case "checkbox-input":
|
|
284
|
+
if (!customElements.get(tagName)) {
|
|
285
|
+
defineCustomElement$a();
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
case "date-input":
|
|
289
|
+
if (!customElements.get(tagName)) {
|
|
290
|
+
defineCustomElement$9();
|
|
291
|
+
}
|
|
292
|
+
break;
|
|
293
|
+
case "email-input":
|
|
294
|
+
if (!customElements.get(tagName)) {
|
|
295
|
+
defineCustomElement$8();
|
|
296
|
+
}
|
|
297
|
+
break;
|
|
298
|
+
case "general-input":
|
|
299
|
+
if (!customElements.get(tagName)) {
|
|
300
|
+
defineCustomElement();
|
|
301
|
+
}
|
|
302
|
+
break;
|
|
303
|
+
case "number-input":
|
|
304
|
+
if (!customElements.get(tagName)) {
|
|
305
|
+
defineCustomElement$7();
|
|
306
|
+
}
|
|
307
|
+
break;
|
|
308
|
+
case "password-input":
|
|
309
|
+
if (!customElements.get(tagName)) {
|
|
310
|
+
defineCustomElement$6();
|
|
311
|
+
}
|
|
312
|
+
break;
|
|
313
|
+
case "radio-input":
|
|
314
|
+
if (!customElements.get(tagName)) {
|
|
315
|
+
defineCustomElement$5();
|
|
316
|
+
}
|
|
317
|
+
break;
|
|
318
|
+
case "select-input":
|
|
319
|
+
if (!customElements.get(tagName)) {
|
|
320
|
+
defineCustomElement$4();
|
|
321
|
+
}
|
|
322
|
+
break;
|
|
323
|
+
case "tel-input":
|
|
324
|
+
if (!customElements.get(tagName)) {
|
|
325
|
+
defineCustomElement$3();
|
|
326
|
+
}
|
|
327
|
+
break;
|
|
328
|
+
case "text-input":
|
|
329
|
+
if (!customElements.get(tagName)) {
|
|
330
|
+
defineCustomElement$2();
|
|
331
|
+
}
|
|
332
|
+
break;
|
|
333
|
+
case "toggle-checkbox-input":
|
|
334
|
+
if (!customElements.get(tagName)) {
|
|
335
|
+
defineCustomElement$1();
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
} });
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export { GeneralInput as G, ToggleCheckboxInput as T, defineCustomElement$1 as a, defineCustomElement as d };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* GeneralInput custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
function safeDecorator(fn) {
|
|
4
|
+
// eslint-disable-next-line func-names
|
|
5
|
+
return function (...args) {
|
|
6
|
+
try {
|
|
7
|
+
return fn.apply(this, args);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error instanceof DOMException &&
|
|
11
|
+
error.message.includes('has already been used with this registry') || error.message.includes('Cannot define multiple custom elements with the same tag name')) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
customElements.define = safeDecorator(customElements.define);
|