@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,4 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-db76d5b5.js';
|
|
2
|
+
import { g as getTranslations } from './locale.utils-95ea2605.js';
|
|
2
3
|
|
|
3
4
|
const generalInputCss = ":host{display:block}";
|
|
4
5
|
|
|
@@ -9,32 +10,52 @@ const GeneralInput = class {
|
|
|
9
10
|
* Type the general-input should take. Can take the default HTML input values.
|
|
10
11
|
*/
|
|
11
12
|
this.type = 'text';
|
|
13
|
+
/**
|
|
14
|
+
* Client custom styling via inline style
|
|
15
|
+
*/
|
|
16
|
+
this.clientStyling = '';
|
|
17
|
+
/**
|
|
18
|
+
* Translations via URL
|
|
19
|
+
*/
|
|
20
|
+
this.translationUrl = '';
|
|
12
21
|
}
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
if (this.translationUrl) {
|
|
24
|
+
getTranslations(this.translationUrl);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
renderInput() {
|
|
28
|
+
var _a;
|
|
29
|
+
switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
|
15
30
|
case 'text':
|
|
16
|
-
return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
|
|
31
|
+
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 });
|
|
17
32
|
case 'email':
|
|
18
|
-
return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
|
|
33
|
+
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 });
|
|
19
34
|
case 'number':
|
|
20
|
-
return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
|
|
35
|
+
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 });
|
|
21
36
|
case 'checkbox':
|
|
22
|
-
return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language });
|
|
37
|
+
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 });
|
|
38
|
+
case 'checkboxgroup':
|
|
39
|
+
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 });
|
|
40
|
+
case 'togglecheckbox':
|
|
41
|
+
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 });
|
|
23
42
|
case 'datetime':
|
|
24
|
-
return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language });
|
|
43
|
+
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 });
|
|
25
44
|
case 'password':
|
|
26
|
-
return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language });
|
|
45
|
+
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 });
|
|
27
46
|
case 'radio':
|
|
28
|
-
return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language });
|
|
47
|
+
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 });
|
|
29
48
|
case 'tel':
|
|
30
|
-
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 });
|
|
49
|
+
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 });
|
|
31
50
|
case 'dropdown':
|
|
32
|
-
return h("select-input", { name: this.name, action: this.action, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language });
|
|
51
|
+
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 });
|
|
33
52
|
default:
|
|
34
|
-
// Nothing here
|
|
35
53
|
return h("p", null, "The ", this.type, " input type is not valid");
|
|
36
54
|
}
|
|
37
55
|
}
|
|
56
|
+
render() {
|
|
57
|
+
return (h(Host, { class: `general-input--${this.name}` }, this.renderInput()));
|
|
58
|
+
}
|
|
38
59
|
};
|
|
39
60
|
GeneralInput.style = generalInputCss;
|
|
40
61
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-db76d5b5.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["checkbox-
|
|
16
|
+
return bootstrapLazy([["checkbox-group-input_10",[[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]},[[4,"click","handleClickOutside"]]],[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"]]],[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"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[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"]]],[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"]]],[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"],"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"]]],[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"]]],[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"]]],[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"]]],[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"]]]]],["general-input",[[1,"general-input",{"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"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"]}]]],["toggle-checkbox-input",[[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"]]]]]], options);
|
|
17
17
|
});
|
|
@@ -25,6 +25,42 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
25
25
|
return false;
|
|
26
26
|
})()
|
|
27
27
|
;
|
|
28
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
29
|
+
if (listeners) {
|
|
30
|
+
listeners.map(([flags, name, method]) => {
|
|
31
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
32
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
33
|
+
const opts = hostListenerOpts(flags);
|
|
34
|
+
plt.ael(target, name, handler, opts);
|
|
35
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
40
|
+
try {
|
|
41
|
+
{
|
|
42
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
43
|
+
// instance is ready, let's call it's member method for this event
|
|
44
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
consoleError(e);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
56
|
+
if (flags & 4 /* TargetDocument */)
|
|
57
|
+
return doc;
|
|
58
|
+
if (flags & 16 /* TargetBody */)
|
|
59
|
+
return doc.body;
|
|
60
|
+
return elm;
|
|
61
|
+
};
|
|
62
|
+
// prettier-ignore
|
|
63
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
28
64
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
29
65
|
const createTime = (fnName, tagName = '') => {
|
|
30
66
|
{
|
|
@@ -132,6 +168,7 @@ const isComplexType = (o) => {
|
|
|
132
168
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
133
169
|
const h = (nodeName, vnodeData, ...children) => {
|
|
134
170
|
let child = null;
|
|
171
|
+
let key = null;
|
|
135
172
|
let simple = false;
|
|
136
173
|
let lastSimple = false;
|
|
137
174
|
let vNodeChildren = [];
|
|
@@ -159,6 +196,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
159
196
|
};
|
|
160
197
|
walk(children);
|
|
161
198
|
if (vnodeData) {
|
|
199
|
+
// normalize class / classname attributes
|
|
200
|
+
if (vnodeData.key) {
|
|
201
|
+
key = vnodeData.key;
|
|
202
|
+
}
|
|
162
203
|
{
|
|
163
204
|
const classData = vnodeData.className || vnodeData.class;
|
|
164
205
|
if (classData) {
|
|
@@ -176,6 +217,9 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
176
217
|
if (vNodeChildren.length > 0) {
|
|
177
218
|
vnode.$children$ = vNodeChildren;
|
|
178
219
|
}
|
|
220
|
+
{
|
|
221
|
+
vnode.$key$ = key;
|
|
222
|
+
}
|
|
179
223
|
return vnode;
|
|
180
224
|
};
|
|
181
225
|
const newVNode = (tag, text) => {
|
|
@@ -189,6 +233,9 @@ const newVNode = (tag, text) => {
|
|
|
189
233
|
{
|
|
190
234
|
vnode.$attrs$ = null;
|
|
191
235
|
}
|
|
236
|
+
{
|
|
237
|
+
vnode.$key$ = null;
|
|
238
|
+
}
|
|
192
239
|
return vnode;
|
|
193
240
|
};
|
|
194
241
|
const Host = {};
|
|
@@ -212,6 +259,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
212
259
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
213
260
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
214
261
|
}
|
|
262
|
+
else if (memberName === 'key')
|
|
263
|
+
;
|
|
215
264
|
else if (memberName === 'ref') {
|
|
216
265
|
// minifier will clean this up
|
|
217
266
|
if (newValue) {
|
|
@@ -383,6 +432,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
383
432
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
384
433
|
let oldStartIdx = 0;
|
|
385
434
|
let newStartIdx = 0;
|
|
435
|
+
let idxInOld = 0;
|
|
436
|
+
let i = 0;
|
|
386
437
|
let oldEndIdx = oldCh.length - 1;
|
|
387
438
|
let oldStartVnode = oldCh[0];
|
|
388
439
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -390,6 +441,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
390
441
|
let newStartVnode = newCh[0];
|
|
391
442
|
let newEndVnode = newCh[newEndIdx];
|
|
392
443
|
let node;
|
|
444
|
+
let elmToMove;
|
|
393
445
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
394
446
|
if (oldStartVnode == null) {
|
|
395
447
|
// Vnode might have been moved left
|
|
@@ -427,7 +479,29 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
427
479
|
newStartVnode = newCh[++newStartIdx];
|
|
428
480
|
}
|
|
429
481
|
else {
|
|
482
|
+
// createKeyToOldIdx
|
|
483
|
+
idxInOld = -1;
|
|
430
484
|
{
|
|
485
|
+
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
486
|
+
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
487
|
+
idxInOld = i;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
if (idxInOld >= 0) {
|
|
493
|
+
elmToMove = oldCh[idxInOld];
|
|
494
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
495
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
patch(elmToMove, newStartVnode);
|
|
499
|
+
oldCh[idxInOld] = undefined;
|
|
500
|
+
node = elmToMove.$elm$;
|
|
501
|
+
}
|
|
502
|
+
newStartVnode = newCh[++newStartIdx];
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
431
505
|
// new element
|
|
432
506
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
433
507
|
newStartVnode = newCh[++newStartIdx];
|
|
@@ -450,7 +524,9 @@ const isSameVnode = (vnode1, vnode2) => {
|
|
|
450
524
|
// compare if two vnode to see if they're "technically" the same
|
|
451
525
|
// need to have the same element tag, and same key to be the same
|
|
452
526
|
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
453
|
-
|
|
527
|
+
{
|
|
528
|
+
return vnode1.$key$ === vnode2.$key$;
|
|
529
|
+
}
|
|
454
530
|
}
|
|
455
531
|
return false;
|
|
456
532
|
};
|
|
@@ -501,9 +577,14 @@ const callNodeRefs = (vNode) => {
|
|
|
501
577
|
};
|
|
502
578
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
503
579
|
const hostElm = hostRef.$hostElement$;
|
|
580
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
504
581
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
505
582
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
506
583
|
hostTagName = hostElm.tagName;
|
|
584
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
585
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
586
|
+
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
587
|
+
}
|
|
507
588
|
rootVnode.$tag$ = null;
|
|
508
589
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
509
590
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -565,6 +646,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
565
646
|
const instance = hostRef.$lazyInstance$ ;
|
|
566
647
|
let promise;
|
|
567
648
|
if (isInitialLoad) {
|
|
649
|
+
{
|
|
650
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
651
|
+
if (hostRef.$queuedListeners$) {
|
|
652
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
653
|
+
hostRef.$queuedListeners$ = null;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
568
656
|
{
|
|
569
657
|
promise = safeCall(instance, 'componentWillLoad');
|
|
570
658
|
}
|
|
@@ -636,13 +724,20 @@ const postUpdateComponent = (hostRef) => {
|
|
|
636
724
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
637
725
|
const elm = hostRef.$hostElement$;
|
|
638
726
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
727
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
639
728
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
729
|
+
{
|
|
730
|
+
safeCall(instance, 'componentDidRender');
|
|
731
|
+
}
|
|
640
732
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
641
733
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
642
734
|
{
|
|
643
735
|
// DOM WRITE!
|
|
644
736
|
addHydratedFlag(elm);
|
|
645
737
|
}
|
|
738
|
+
{
|
|
739
|
+
safeCall(instance, 'componentDidLoad');
|
|
740
|
+
}
|
|
646
741
|
endPostUpdate();
|
|
647
742
|
{
|
|
648
743
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -725,10 +820,6 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
725
820
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
726
821
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
727
822
|
}
|
|
728
|
-
if (propType & 2 /* Number */) {
|
|
729
|
-
// force it to be a number
|
|
730
|
-
return parseFloat(propValue);
|
|
731
|
-
}
|
|
732
823
|
if (propType & 1 /* String */) {
|
|
733
824
|
// could have been passed as a number or boolean
|
|
734
825
|
// but we still want it as a string
|
|
@@ -870,6 +961,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
870
961
|
.map(([propName, m]) => {
|
|
871
962
|
const attrName = m[1] || propName;
|
|
872
963
|
attrNameToPropName.set(attrName, propName);
|
|
964
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
965
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
966
|
+
}
|
|
873
967
|
return attrName;
|
|
874
968
|
});
|
|
875
969
|
}
|
|
@@ -999,6 +1093,10 @@ const connectedCallback = (elm) => {
|
|
|
999
1093
|
}
|
|
1000
1094
|
}
|
|
1001
1095
|
else {
|
|
1096
|
+
// not the first time this has connected
|
|
1097
|
+
// reattach any event listeners to the host
|
|
1098
|
+
// since they would have been removed when disconnected
|
|
1099
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1002
1100
|
// fire off connectedCallback() on component instance
|
|
1003
1101
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1004
1102
|
}
|
|
@@ -1007,7 +1105,13 @@ const connectedCallback = (elm) => {
|
|
|
1007
1105
|
};
|
|
1008
1106
|
const disconnectedCallback = (elm) => {
|
|
1009
1107
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1010
|
-
getHostRef(elm);
|
|
1108
|
+
const hostRef = getHostRef(elm);
|
|
1109
|
+
{
|
|
1110
|
+
if (hostRef.$rmListeners$) {
|
|
1111
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1112
|
+
hostRef.$rmListeners$ = undefined;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1011
1115
|
}
|
|
1012
1116
|
};
|
|
1013
1117
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
@@ -1034,6 +1138,12 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1034
1138
|
{
|
|
1035
1139
|
cmpMeta.$members$ = compactMeta[2];
|
|
1036
1140
|
}
|
|
1141
|
+
{
|
|
1142
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1143
|
+
}
|
|
1144
|
+
{
|
|
1145
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1146
|
+
}
|
|
1037
1147
|
{
|
|
1038
1148
|
cmpMeta.$watchers$ = {};
|
|
1039
1149
|
}
|
|
@@ -1117,6 +1227,7 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1117
1227
|
elm['s-p'] = [];
|
|
1118
1228
|
elm['s-rc'] = [];
|
|
1119
1229
|
}
|
|
1230
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1120
1231
|
return hostRefs.set(elm, hostRef);
|
|
1121
1232
|
};
|
|
1122
1233
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
@@ -1185,4 +1296,4 @@ const flush = () => {
|
|
|
1185
1296
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1186
1297
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1187
1298
|
|
|
1188
|
-
export { bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r };
|
|
1299
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-db76d5b5.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["checkbox-
|
|
13
|
+
return bootstrapLazy([["checkbox-group-input_10",[[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]},[[4,"click","handleClickOutside"]]],[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"]]],[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"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]]],[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"]]],[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"]]],[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"],"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"]]],[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"]]],[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"]]],[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"]]],[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"]]]]],["general-input",[[1,"general-input",{"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"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"]}]]],["toggle-checkbox-input",[[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"]]]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const TRANSLATIONS = {
|
|
3
|
+
"en": {
|
|
4
|
+
"dateError": 'The selected date should be between {min} and {max}',
|
|
5
|
+
"dateError2": 'The selected date is not within the accepted range',
|
|
6
|
+
"numberLengthError": 'The number should be between {min} and {max}',
|
|
7
|
+
"lengthError": `The length should be between {minLength} and {maxLength}`,
|
|
8
|
+
"requiredError": 'This input is required.',
|
|
9
|
+
"invalidOriginalPasswordError": "Initial password field does not validate all criteria.",
|
|
10
|
+
"passwordStrength": "Password strength",
|
|
11
|
+
"passwordStrengthWeak": "is not adequate",
|
|
12
|
+
"passwordStrengthStrong": "is adequate",
|
|
13
|
+
"SpecialCharactersNotAllowed": 'Should not contain special characters',
|
|
14
|
+
"InvalidEmailFormat": "Invalid email format.",
|
|
15
|
+
"EmailNotMatching": "Emails not matching!",
|
|
16
|
+
"PasswordNotMatching": "Passwords not matching",
|
|
17
|
+
"MustIncludeNumber": "include a number",
|
|
18
|
+
"MustContainCapital": "contain capital letters",
|
|
19
|
+
"MustIncludePunctation": "punctuation",
|
|
20
|
+
"OnlyNumbers": "Should contains only numbers."
|
|
21
|
+
},
|
|
22
|
+
"hu": {
|
|
23
|
+
"dateError": 'A választott dátumnak {min} és {max} között kell lennie',
|
|
24
|
+
"numberLengthError": 'A számnak {min} és {max} között kell lennie',
|
|
25
|
+
"lengthError": `A hossznak {minLength} és {maxLength} között kell lennie`,
|
|
26
|
+
"requiredError": 'Ez a beviteli mező kötelező.',
|
|
27
|
+
"invalidOriginalPasswordError": "Initial password field does not validate all criteria.",
|
|
28
|
+
"passwordStrength": "Jelszó erőssége",
|
|
29
|
+
"passwordStrengthWeak": "nem megfelelő",
|
|
30
|
+
"passwordStrengthStrong": "megfelelő",
|
|
31
|
+
"SpecialCharactersNotAllowed": 'Nem tartalmazhat speciális karaktereket',
|
|
32
|
+
"InvalidEmailFormat": "Érvénytelen e-mail formátum.",
|
|
33
|
+
"EmailNotMatching": "Az e-mailek nem egyeznek!",
|
|
34
|
+
"PasswordNotMatching": "A jelszavak nem egyeznek",
|
|
35
|
+
"MustIncludeNumber": "tartalmaznia kell egy számot",
|
|
36
|
+
"MustContainCapital": "nagybetűket kell tartalmaznia",
|
|
37
|
+
"MustIncludePunctation": "írásjelet",
|
|
38
|
+
"OnlyNumbers": "Csak számokat kell tartalmaznia."
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const translate = (key, customLang, values) => {
|
|
42
|
+
const lang = customLang;
|
|
43
|
+
let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
44
|
+
if (values !== undefined) {
|
|
45
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
46
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
47
|
+
translation = translation.replace(regex, value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return translation;
|
|
51
|
+
};
|
|
52
|
+
const getTranslations = (url) => {
|
|
53
|
+
// fetch url, get the data, replace the TRANSLATIONS content
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
fetch(url)
|
|
56
|
+
.then((res) => res.json())
|
|
57
|
+
.then((data) => {
|
|
58
|
+
Object.keys(data).forEach((item) => {
|
|
59
|
+
for (let key in data[item]) {
|
|
60
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
resolve(true);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { getTranslations as g, translate as t };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-db76d5b5.js';
|
|
2
|
+
import { t as translate } from './locale.utils-95ea2605.js';
|
|
3
|
+
import { t as tooltipIconSvg } from './tooltipIcon-99c1c7b7.js';
|
|
4
|
+
|
|
5
|
+
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:5px;align-content:flex-start}.togglecheckbox__wrapper--relative{position:relative;display:inline}.togglecheckbox__input{transform:scale(1.307, 1.307);margin-left:2px}.togglecheckbox__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:#2B2D3F;line-height:14px}.togglecheckbox__label-text{font-size:16px}.togglecheckbox__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}.togglecheckbox__tooltip-icon{width:16px;height:auto}.togglecheckbox__tooltip{position:absolute;top:0;right:0;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}.togglecheckbox__tooltip.visible{opacity:1}.togglecheckbox__fields-wrapper{margin-top:40px;display:flex;flex-direction:column;gap:40px}.hidden{display:none}";
|
|
6
|
+
|
|
7
|
+
const ToggleCheckboxInput = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
11
|
+
this.sendInputValue = createEvent(this, "sendInputValue", 7);
|
|
12
|
+
/**
|
|
13
|
+
* Default value for the input.
|
|
14
|
+
*/
|
|
15
|
+
this.defaultValue = '';
|
|
16
|
+
/**
|
|
17
|
+
* Client custom styling via inline style
|
|
18
|
+
*/
|
|
19
|
+
this.clientStyling = '';
|
|
20
|
+
this.limitStylingAppends = false;
|
|
21
|
+
this.showTooltip = false;
|
|
22
|
+
this.value = '';
|
|
23
|
+
this.setClientStyling = () => {
|
|
24
|
+
let sheet = document.createElement('style');
|
|
25
|
+
sheet.innerHTML = this.clientStyling;
|
|
26
|
+
this.stylingContainer.prepend(sheet);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
validityStateHandler(inputStateEvent) {
|
|
30
|
+
this.sendValidityState.emit(inputStateEvent);
|
|
31
|
+
}
|
|
32
|
+
valueHandler(inputValueEvent) {
|
|
33
|
+
this.sendInputValue.emit(inputValueEvent);
|
|
34
|
+
}
|
|
35
|
+
handleClickOutside(event) {
|
|
36
|
+
if (event.composedPath()[0] === this.tooltipIconReference)
|
|
37
|
+
return;
|
|
38
|
+
if (event.composedPath()[0] !== this.tooltipReference)
|
|
39
|
+
this.showTooltip = false;
|
|
40
|
+
}
|
|
41
|
+
componentDidRender() {
|
|
42
|
+
// start custom styling area
|
|
43
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
44
|
+
if (this.clientStyling)
|
|
45
|
+
this.setClientStyling();
|
|
46
|
+
this.limitStylingAppends = true;
|
|
47
|
+
}
|
|
48
|
+
// end custom styling area
|
|
49
|
+
}
|
|
50
|
+
handleClick() {
|
|
51
|
+
this.showFields = this.checkboxReference.checked;
|
|
52
|
+
this.errorMessage = this.setErrorMessage();
|
|
53
|
+
this.isValid = this.setValidity();
|
|
54
|
+
}
|
|
55
|
+
setValidity() {
|
|
56
|
+
return this.checkboxReference.validity.valid;
|
|
57
|
+
}
|
|
58
|
+
setErrorMessage() {
|
|
59
|
+
if (this.checkboxReference.validity.valueMissing) {
|
|
60
|
+
return translate('requiredError', this.language);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
renderLabel() {
|
|
64
|
+
return (h("label", { class: 'togglecheckbox__label', htmlFor: `${this.name}__input` }, h("div", { class: 'togglecheckbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
|
|
65
|
+
}
|
|
66
|
+
renderTooltip() {
|
|
67
|
+
if (this.showTooltip) {
|
|
68
|
+
return (h("div", { class: `togglecheckbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
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 &&
|
|
74
|
+
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 => {
|
|
75
|
+
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 });
|
|
76
|
+
})));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
ToggleCheckboxInput.style = toggleCheckboxInputCss;
|
|
80
|
+
|
|
81
|
+
export { ToggleCheckboxInput as toggle_checkbox_input };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
|
|
2
|
+
|
|
3
|
+
export { tooltipIconSvg as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as l,b as e}from"./p-b408093e.js";(()=>{const e=import.meta.url,i={};return""!==e&&(i.resourcesUrl=new URL(".",e).href),l(i)})().then((l=>e([["p-0966f523",[[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]},[[4,"click","handleClickOutside"]]],[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"]]],[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"],errorMessage:[32],isValid:[32],limitStylingAppends:[32],showTooltip:[32]},[[4,"click","handleClickOutside"]]],[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"]]],[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"]]],[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"],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"]]],[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"]]],[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"]]],[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"]]],[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"]]]]],["p-c2d4d6ac",[[1,"general-input",{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"],clientStyling:[520,"client-styling"],dateFormat:[513,"date-format"],translationUrl:[513,"translation-url"]}]]],["p-916a1319",[[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"]]]]]],l)));
|