@3t-transform/threeteeui 0.0.24 → 0.1.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/{index-bc080fb4.js → index-451f61dd.js} +51 -60
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +1 -1
- package/dist/cjs/tttx-form.cjs.entry.js +377 -0
- package/dist/cjs/tttx-icon.cjs.entry.js +2 -2
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +8 -5
- package/dist/cjs/tttx-list.cjs.entry.js +1677 -7
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +7 -3
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +4 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +7 -4
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -0
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +336 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.css +8 -2
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +33 -7
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +46 -14
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +25 -3
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +57 -1
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +14 -1
- package/dist/collection/shared/domsanitiser.options.js +14 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{tttx-table.d.ts → tttx-form.d.ts} +4 -4
- package/dist/components/tttx-form.js +394 -0
- package/dist/components/tttx-icon2.js +1 -1
- package/dist/components/tttx-keyvalue-block.js +7 -4
- package/dist/components/tttx-list.js +1678 -7
- package/dist/components/tttx-standalone-input.js +9 -2
- package/dist/esm/{index-901bfd55.js → index-0350f122.js} +51 -60
- package/dist/esm/loader.js +2 -2
- package/dist/esm/tttx-button.entry.js +1 -1
- package/dist/esm/tttx-form.entry.js +373 -0
- package/dist/esm/tttx-icon.entry.js +2 -2
- package/dist/esm/tttx-keyvalue-block.entry.js +8 -5
- package/dist/esm/tttx-list.entry.js +1677 -7
- package/dist/esm/tttx-loading-spinner.entry.js +1 -1
- package/dist/esm/tttx-standalone-input.entry.js +7 -3
- package/dist/esm/tttx.js +2 -2
- package/dist/tttx/{p-a4077908.entry.js → p-1b015a9d.entry.js} +1 -1
- package/dist/tttx/{p-9a382959.entry.js → p-4f3958fa.entry.js} +1 -1
- package/dist/tttx/p-62869344.js +2 -0
- package/dist/tttx/{p-0ae51ec5.entry.js → p-92465671.entry.js} +1 -1
- package/dist/tttx/p-a0179cb1.entry.js +1 -0
- package/dist/tttx/p-b0a6b872.entry.js +1 -0
- package/dist/tttx/p-cd1565e0.entry.js +3 -0
- package/dist/tttx/p-ce015353.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -0
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -0
- package/dist/types/components/molecules/{tttx-table/tttx-table.stories.d.ts → tttx-form/tttx-form.stories.d.ts} +2 -10
- package/dist/types/components/molecules/tttx-list/interfaces.d.ts +4 -2
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +3 -1
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +7 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +3 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +16 -0
- package/dist/types/components.d.ts +32 -28
- package/dist/types/shared/domsanitiser.options.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/tttx-table.cjs.entry.js +0 -60
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.e2e.js +0 -9
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.spec.js +0 -43
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.e2e.js +0 -9
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.spec.js +0 -16
- package/dist/collection/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.js +0 -164
- package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +0 -64
- package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +0 -151
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.js +0 -9
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.js +0 -146
- package/dist/collection/components/molecules/tttx-table/test/tttx-table.e2e.js +0 -9
- package/dist/collection/components/molecules/tttx-table/tttx-table.css +0 -166
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +0 -174
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +0 -81
- package/dist/components/tttx-table.js +0 -85
- package/dist/esm/tttx-table.entry.js +0 -56
- package/dist/tttx/p-1ec23160.entry.js +0 -1
- package/dist/tttx/p-300ff6a8.entry.js +0 -1
- package/dist/tttx/p-32ad02d3.entry.js +0 -1
- package/dist/tttx/p-80cf5236.entry.js +0 -1
- package/dist/tttx/p-a1bd16a1.entry.js +0 -1
- package/dist/tttx/p-a6953900.entry.js +0 -1
- package/dist/tttx/p-b46e3c59.entry.js +0 -1
- package/dist/tttx/p-c290160b.js +0 -2
- package/dist/tttx/p-dc179257.entry.js +0 -1
- package/dist/tttx/p-e19eb07e.entry.js +0 -1
- package/dist/tttx/p-e4341658.entry.js +0 -1
- package/dist/types/components/atoms/tttx-button/test/tttx-button.e2e.d.ts +0 -1
- package/dist/types/components/atoms/tttx-button/test/tttx-button.spec.d.ts +0 -1
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.e2e.d.ts +0 -1
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.spec.d.ts +0 -1
- package/dist/types/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.d.ts +0 -1
- package/dist/types/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-list/test/tttx-list.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.d.ts +0 -1
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-table/test/tttx-table.e2e.d.ts +0 -1
- package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +0 -15
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-451f61dd.js');
|
|
6
6
|
|
|
7
7
|
const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.spinner-container{position:absolute}.loading-box{display:flex;align-items:center;justify-content:center}.loading-text{font-size:16px;font-weight:400;padding-top:10px;text-align:center}.spinner{border:solid #1479c6;border-bottom-color:#d5d5d5;border-radius:50%;position:relative;box-sizing:border-box;animation:rotation 1s linear infinite}.spinner.small{height:20px;width:20px;border-width:4px}.spinner.large{height:60px;width:60px;border-width:8px}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
8
8
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-451f61dd.js');
|
|
6
6
|
|
|
7
|
-
const tttxStandaloneInputCss = ".material-symbols-rounded.sc-tttx-standalone-input{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded.sc-tttx-standalone-input{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.icon-left.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input{flex-basis:24px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-left:4px}.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-right:4px}.icon-right.sc-tttx-standalone-input{margin-top:5px
|
|
7
|
+
const tttxStandaloneInputCss = ".material-symbols-rounded.sc-tttx-standalone-input{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded.sc-tttx-standalone-input{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.icon-left.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input{flex-basis:24px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-left:4px}.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-right:4px}.icon-right.sc-tttx-standalone-input{margin-top:5px}.icon-left.sc-tttx-standalone-input{margin-top:5px;margin-left:4px}.iconleft.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-left:4px}.iconright.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-right:4px}.input-icon.sc-tttx-standalone-input{position:absolute;margin-top:9px;margin-left:4px}.errormsg.sc-tttx-standalone-input{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#dc0000}.errormsg.sc-tttx-standalone-input .validationicon.sc-tttx-standalone-input{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger.sc-tttx-standalone-input{color:#dc0000}.optional.sc-tttx-standalone-input{color:#757575;font-weight:normal}label.inputBlock.sc-tttx-standalone-input{display:block;position:relative;line-height:21px}label.inputInline.sc-tttx-standalone-input{display:flex;white-space:nowrap;align-items:center}label.inputInline.sc-tttx-standalone-input .input-container.sc-tttx-standalone-input{margin:0 4px;width:100%;display:flex;align-items:center;gap:4px}label.sc-tttx-standalone-input{font-weight:500;font-size:16px}input.sc-tttx-standalone-input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}input[type=date].sc-tttx-standalone-input{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid.sc-tttx-standalone-input:invalid,input.standalone.invalid.sc-tttx-standalone-input{border:1px solid #dc0000}.input-icon.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding:0 32px}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input{min-height:27px;position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input:not(.visible){visibility:hidden}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input span.sc-tttx-standalone-input{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid.sc-tttx-standalone-input:invalid~.errorBubble.sc-tttx-standalone-input{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input.sc-tttx-standalone-input:focus{border-color:#1479c6}input.sc-tttx-standalone-input:focus-visible{outline:none}.sc-tttx-standalone-input-h{display:block}";
|
|
8
8
|
|
|
9
9
|
const TttxInput = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -15,9 +15,12 @@ const TttxInput = class {
|
|
|
15
15
|
this.invalidChanged = index.createEvent(this, "invalidChanged", 7);
|
|
16
16
|
this.label = undefined;
|
|
17
17
|
this.showerrormsg = undefined;
|
|
18
|
+
this.showerrorbubble = true;
|
|
18
19
|
this.errormsg = undefined;
|
|
19
20
|
this.iconleft = undefined;
|
|
20
21
|
this.iconright = undefined;
|
|
22
|
+
this.inputicon = undefined;
|
|
23
|
+
this.inline = undefined;
|
|
21
24
|
this.inputAutocapitalize = undefined;
|
|
22
25
|
this.inputAutofocus = undefined;
|
|
23
26
|
this.inputKeyhint = undefined;
|
|
@@ -53,12 +56,13 @@ const TttxInput = class {
|
|
|
53
56
|
this.blurChanged.emit(target.value);
|
|
54
57
|
}
|
|
55
58
|
handleInvalid(event) {
|
|
59
|
+
event.preventDefault();
|
|
56
60
|
const target = event.target;
|
|
57
61
|
this.invalidChanged.emit(target.value);
|
|
58
62
|
}
|
|
59
63
|
render() {
|
|
60
64
|
const classNames = ['standalone', this.showerrormsg ? 'invalid' : ''].join(' ');
|
|
61
|
-
return (index.h(index.Host, null, index.h("label", { class: 'inputBlock' }, this.label, !this.required ? index.h("span", { class: "optional" }, "\u00A0(optional)") : '', this.iconleft && (index.h("div", { class: "icon-left" }, index.h("tttx-icon", { icon: this.iconleft, color: "grey" }))), index.h("input", { class: classNames, autocapitalize: this.inputAutocapitalize, autofocus: this.inputAutofocus, enterkeyhint: this.inputKeyhint, tabindex: this.inputIndex, title: this.inputTitle, autocomplete: this.autocomplete, checked: this.checked, disabled: this.disabled, max: this.max, maxlength: this.maxlength, min: this.min, minlength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readonly: this.readonly, required: this.required, step: this.step, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this), onInvalid: this.handleInvalid.bind(this) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.iconright, color: "grey" }))), index.h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
65
|
+
return (index.h(index.Host, null, index.h("label", { class: this.inline ? 'inputInline' : 'inputBlock' }, this.label, !this.required ? index.h("span", { class: "optional" }, "\u00A0(optional)") : '', this.iconleft && (index.h("div", { class: "icon-left" }, index.h("tttx-icon", { icon: this.iconleft, color: "grey" }))), index.h("div", { class: "input-container" }, this.inputicon && (index.h("tttx-icon", { class: "input-icon", icon: this.inputicon, color: "grey" })), index.h("input", { class: classNames, autocapitalize: this.inputAutocapitalize, autofocus: this.inputAutofocus, enterkeyhint: this.inputKeyhint, tabindex: this.inputIndex, title: this.inputTitle, autocomplete: this.autocomplete, checked: this.checked, disabled: this.disabled, max: this.max, maxlength: this.maxlength, min: this.min, minlength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readonly: this.readonly, required: this.required, step: this.step, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this), onInvalid: this.handleInvalid.bind(this) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.iconright, color: "grey" }))), this.showerrorbubble && (index.h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))))));
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
68
|
TttxInput.style = tttxStandaloneInputCss;
|
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-451f61dd.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["tttx-
|
|
18
|
+
return index.bootstrapLazy([["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputicon":[1],"inline":[4],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"submitValue":[1032,"submit-value"]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]]], options);
|
|
19
19
|
});
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"./components/atoms/tttx-icon/tttx-icon.js",
|
|
6
6
|
"./components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js",
|
|
7
7
|
"./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
|
|
8
|
-
"./components/molecules/tttx-
|
|
9
|
-
"./components/molecules/tttx-
|
|
8
|
+
"./components/molecules/tttx-form/tttx-form.js",
|
|
9
|
+
"./components/molecules/tttx-list/tttx-list.js"
|
|
10
10
|
],
|
|
11
11
|
"compiler": {
|
|
12
12
|
"name": "@stencil/core",
|
|
@@ -24,17 +24,20 @@ export class TttxKeyvalueBlock {
|
|
|
24
24
|
for (let i = 0; i < values.length; i++) {
|
|
25
25
|
const value = values[i];
|
|
26
26
|
if (this.horizontal) {
|
|
27
|
-
elements.push(h("div", null, h("dt", { class:
|
|
27
|
+
elements.push(h("div", null, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
elements.push(h("dt", { class:
|
|
31
|
-
elements.push(h("dt", { class:
|
|
30
|
+
elements.push(h("dt", { class: 'mainTitle' }, value.title));
|
|
31
|
+
elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
|
|
32
32
|
elements.push(h("dd", null, value.data));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
return elements;
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
+
if (!this.keyvalues) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
38
41
|
let values;
|
|
39
42
|
if (typeof this.keyvalues === 'string') {
|
|
40
43
|
values = JSON.parse(this.keyvalues);
|
|
@@ -49,7 +52,7 @@ export class TttxKeyvalueBlock {
|
|
|
49
52
|
else {
|
|
50
53
|
elements = this.renderSingleElements(values);
|
|
51
54
|
}
|
|
52
|
-
return (h(Host, null, h("dl", { class: this.horizontal ?
|
|
55
|
+
return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
|
|
53
56
|
}
|
|
54
57
|
static get is() { return "tttx-keyvalue-block"; }
|
|
55
58
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sets the error state of an input field by updating its class and error message.
|
|
3
|
+
* If an error was detected, it sets the input field's class to "invalid" and
|
|
4
|
+
* displays the error message in an error bubble. If no error was detected,
|
|
5
|
+
* it removes the "invalid" class from the input field and clears the error bubble.
|
|
6
|
+
*
|
|
7
|
+
* @param {HTMLInputElement} target - The input field to update.
|
|
8
|
+
* @param {boolean} hasError - Whether an error was detected in the field.
|
|
9
|
+
* @param {string} errorMessage - The error message to display (if any).
|
|
10
|
+
* @return {void}
|
|
11
|
+
*/
|
|
12
|
+
function setErrorState(target, hasError, errorMessage) {
|
|
13
|
+
// Find the error bubble element for the input field
|
|
14
|
+
const errorBubble = target.parentElement.querySelector('.errorBubble');
|
|
15
|
+
// If an error was detected, set the input field's class to "invalid" and display the error message in the error bubble
|
|
16
|
+
if (hasError) {
|
|
17
|
+
target.className = 'invalid';
|
|
18
|
+
const errorIcon = document.createElement('span');
|
|
19
|
+
// Set the class of the error icon to a pre-defined CSS class that specifies the icon's appearance
|
|
20
|
+
errorIcon.className = 'material-symbols-rounded';
|
|
21
|
+
// Set the text content of the error icon to the word "warning"
|
|
22
|
+
errorIcon.textContent = 'warning';
|
|
23
|
+
// errorBubble.replaceChildren cannot be used here because the tests don't support this new feature :(
|
|
24
|
+
errorBubble.innerHTML = '';
|
|
25
|
+
errorBubble.append(errorIcon);
|
|
26
|
+
errorBubble.append(errorMessage);
|
|
27
|
+
// errorBubble.replaceChildren(errorIcon, errorMessage);
|
|
28
|
+
}
|
|
29
|
+
// If no error was detected, remove the "invalid" class from the input field and clear the error bubble
|
|
30
|
+
else {
|
|
31
|
+
target.className = '';
|
|
32
|
+
errorBubble.innerHTML = '';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export default setErrorState;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates the input field on focusout event by checking its validity state,
|
|
3
|
+
* sets an error message if there's an issue, and emits a "dataChanged" event to
|
|
4
|
+
* the parent component with the field name and its new value.
|
|
5
|
+
*
|
|
6
|
+
* @param {Event} event - The focusout event triggered by the input field.
|
|
7
|
+
* @return {void}
|
|
8
|
+
*/
|
|
9
|
+
function validityCheck(event) {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
const target = event.target;
|
|
13
|
+
let hasError = true;
|
|
14
|
+
let errorMessage = '';
|
|
15
|
+
// validity object on HTML5 inputs has the following options
|
|
16
|
+
// badInput
|
|
17
|
+
// customError
|
|
18
|
+
// patternMismatch
|
|
19
|
+
// rangeOverflow
|
|
20
|
+
// rangeUnderflow
|
|
21
|
+
// stepMismatch
|
|
22
|
+
// tooLong
|
|
23
|
+
// tooShort
|
|
24
|
+
// typeMismatch
|
|
25
|
+
// valid
|
|
26
|
+
// valueMissing
|
|
27
|
+
// customErrors can be set with
|
|
28
|
+
// target.setCustomValidity('custom error!');
|
|
29
|
+
// and cleared with
|
|
30
|
+
// target.setCustomValidity('');
|
|
31
|
+
// Check the validity of the input field and set an error message if needed
|
|
32
|
+
switch (true) {
|
|
33
|
+
// The field is required, but has no value
|
|
34
|
+
case target.validity.valueMissing:
|
|
35
|
+
errorMessage = (_a = target.dataset.required) !== null && _a !== void 0 ? _a : 'This field is required';
|
|
36
|
+
break;
|
|
37
|
+
// The field's value does not match the expected pattern
|
|
38
|
+
case target.validity.patternMismatch:
|
|
39
|
+
errorMessage = (_b = target.dataset.pattern) !== null && _b !== void 0 ? _b : 'Incorrect format';
|
|
40
|
+
break;
|
|
41
|
+
// The field's value is not of the correct input type
|
|
42
|
+
case target.validity.badInput:
|
|
43
|
+
// IE string in a number field
|
|
44
|
+
errorMessage = (_c = target.dataset.badinput) !== null && _c !== void 0 ? _c : 'Wrong input type';
|
|
45
|
+
break;
|
|
46
|
+
// The field's value is above or below the range set in the "min" and "max" attributes
|
|
47
|
+
case target.validity.rangeOverflow || target.validity.rangeUnderflow:
|
|
48
|
+
// IE date or number is above or below value set in min or max tags
|
|
49
|
+
errorMessage = (_d = target.dataset.range) !== null && _d !== void 0 ? _d : 'Invalid value';
|
|
50
|
+
break;
|
|
51
|
+
// No error detected
|
|
52
|
+
default:
|
|
53
|
+
hasError = false;
|
|
54
|
+
}
|
|
55
|
+
// Return the error state
|
|
56
|
+
return { target, hasError, errorMessage };
|
|
57
|
+
}
|
|
58
|
+
export default validityCheck;
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.material-symbols-rounded {
|
|
6
|
+
font-family: "Material Symbols Rounded", sans-serif;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-size: 24px;
|
|
10
|
+
line-height: 1;
|
|
11
|
+
letter-spacing: normal;
|
|
12
|
+
text-transform: none;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
word-wrap: normal;
|
|
16
|
+
direction: ltr;
|
|
17
|
+
text-rendering: optimizeLegibility;
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
color: #9e9e9e;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon-left,
|
|
23
|
+
.icon-right {
|
|
24
|
+
flex-basis: 24px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.icon-left span,
|
|
28
|
+
.icon-right span {
|
|
29
|
+
font-size: 24px;
|
|
30
|
+
line-height: 24px;
|
|
31
|
+
text-align: center;
|
|
32
|
+
display: block;
|
|
33
|
+
width: 24px;
|
|
34
|
+
height: 24px;
|
|
35
|
+
margin-top: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.icon-left span {
|
|
39
|
+
margin-left: 4px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-right span {
|
|
43
|
+
margin-right: 4px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-right {
|
|
47
|
+
margin-top: 5px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-left {
|
|
51
|
+
margin-top: 5px;
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.iconleft .input {
|
|
56
|
+
padding-left: 4px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.iconright .input {
|
|
60
|
+
padding-right: 4px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.input-icon {
|
|
64
|
+
position: absolute;
|
|
65
|
+
margin-top: 9px;
|
|
66
|
+
margin-left: 4px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.errormsg {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
float: left;
|
|
74
|
+
margin-bottom: 16px;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
height: 26px;
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
border-radius: none;
|
|
80
|
+
z-index: 2;
|
|
81
|
+
color: #dc0000;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.errormsg .validationicon {
|
|
85
|
+
width: 16px;
|
|
86
|
+
height: 16px;
|
|
87
|
+
font-size: 16px;
|
|
88
|
+
margin-right: 4px;
|
|
89
|
+
vertical-align: middle;
|
|
90
|
+
color: #dc0000;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.danger {
|
|
94
|
+
color: #dc0000;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.optional {
|
|
98
|
+
color: #757575;
|
|
99
|
+
font-weight: normal;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
label.inputBlock {
|
|
103
|
+
display: block;
|
|
104
|
+
position: relative;
|
|
105
|
+
line-height: 21px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
label.inputInline {
|
|
109
|
+
display: flex;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
align-items: center;
|
|
112
|
+
}
|
|
113
|
+
label.inputInline .input-container {
|
|
114
|
+
margin: 0 4px;
|
|
115
|
+
width: 100%;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 4px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
label {
|
|
122
|
+
font-weight: 500;
|
|
123
|
+
font-size: 16px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
input:not([type=submit]) {
|
|
127
|
+
font-family: "Roboto", serif;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 36px;
|
|
131
|
+
padding: 0 16px;
|
|
132
|
+
font-size: 16px;
|
|
133
|
+
border: 1px solid #d5d5d5;
|
|
134
|
+
border-radius: 4px;
|
|
135
|
+
margin-top: 4px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* iPhone OS fix */
|
|
139
|
+
input[type=date] {
|
|
140
|
+
background: white;
|
|
141
|
+
display: block;
|
|
142
|
+
min-width: calc(100% - 18px);
|
|
143
|
+
line-height: 37px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
input.invalid:invalid, input.standalone.invalid {
|
|
147
|
+
border: 1px solid #dc0000;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.input-icon ~ input {
|
|
151
|
+
padding: 0 32px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
input ~ .errorBubble {
|
|
155
|
+
min-height: 27px;
|
|
156
|
+
position: relative;
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
font-weight: normal;
|
|
159
|
+
width: 100%;
|
|
160
|
+
font-family: "Roboto", sans-serif;
|
|
161
|
+
color: #dc0000;
|
|
162
|
+
display: flex;
|
|
163
|
+
align-content: center;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-items: center;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
input ~ .errorBubble:not(.visible) {
|
|
169
|
+
visibility: hidden;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
input ~ .errorBubble span {
|
|
173
|
+
color: #dc0000;
|
|
174
|
+
font-size: 16px;
|
|
175
|
+
margin-right: 4px;
|
|
176
|
+
height: 16px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
input.invalid:invalid ~ .errorBubble {
|
|
180
|
+
position: relative;
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
font-weight: normal;
|
|
183
|
+
width: 100%;
|
|
184
|
+
font-family: "Roboto", sans-serif;
|
|
185
|
+
color: #dc0000;
|
|
186
|
+
visibility: visible;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
input:focus {
|
|
190
|
+
border-color: #1479c6;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
input:focus-visible {
|
|
194
|
+
outline: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.button {
|
|
198
|
+
font-family: Roboto, serif;
|
|
199
|
+
box-sizing: border-box;
|
|
200
|
+
height: 36px;
|
|
201
|
+
min-width: 36px;
|
|
202
|
+
padding: 0;
|
|
203
|
+
margin: 0;
|
|
204
|
+
background: transparent;
|
|
205
|
+
color: #212121;
|
|
206
|
+
border: 1px solid #c8c8c8;
|
|
207
|
+
border-radius: 4px;
|
|
208
|
+
text-transform: uppercase;
|
|
209
|
+
display: flex;
|
|
210
|
+
justify-content: left;
|
|
211
|
+
align-items: center;
|
|
212
|
+
font-size: 14px;
|
|
213
|
+
font-weight: 400;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.button-content {
|
|
217
|
+
display: block;
|
|
218
|
+
padding: 0 16px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.icon-left, .icon-right {
|
|
222
|
+
margin-top: 4px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.iconleft {
|
|
226
|
+
padding-left: 8px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.iconleft .button-content {
|
|
230
|
+
padding-left: 4px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.iconright {
|
|
234
|
+
padding-right: 8px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.iconright .button-content {
|
|
238
|
+
padding-right: 4px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.notext {
|
|
242
|
+
padding: 0 6px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.button:hover {
|
|
246
|
+
background: rgba(17, 17, 17, 0.1);
|
|
247
|
+
border: 1px solid #D5D5D5;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.button:active {
|
|
251
|
+
background: rgba(17, 17, 17, 0.2);
|
|
252
|
+
border: 1px solid #D5D5D5;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.primary {
|
|
256
|
+
background: #1479c6;
|
|
257
|
+
border: 1px solid #1479c6;
|
|
258
|
+
color: white;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.primary:hover {
|
|
262
|
+
background: #146EB3;
|
|
263
|
+
border: 1px solid #146EB3;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.primary:active {
|
|
267
|
+
background: #1464A2;
|
|
268
|
+
border: 1px solid #1464A2;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.borderless {
|
|
272
|
+
background: transparent;
|
|
273
|
+
border: none;
|
|
274
|
+
color: #212121;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.borderless:hover {
|
|
278
|
+
background: rgba(17, 17, 17, 0.1);
|
|
279
|
+
border: none;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.borderless:active {
|
|
283
|
+
background: rgba(17, 17, 17, 0.2);
|
|
284
|
+
border: none;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.danger {
|
|
288
|
+
background: #DC0000;
|
|
289
|
+
border: 1px solid #DC0000;
|
|
290
|
+
color: white;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.danger:hover {
|
|
294
|
+
background: #C60000;
|
|
295
|
+
border: 1px solid #C60000;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.danger:active {
|
|
299
|
+
background: #B00000;
|
|
300
|
+
border: 1px solid #B00000;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.disabled {
|
|
304
|
+
background: #aeaeae;
|
|
305
|
+
border: none;
|
|
306
|
+
color: #4c4c4c;
|
|
307
|
+
cursor: not-allowed;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.disabled:hover {
|
|
311
|
+
background: #aeaeae;
|
|
312
|
+
border: none;
|
|
313
|
+
color: #4c4c4c;
|
|
314
|
+
cursor: not-allowed;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.disabled:active {
|
|
318
|
+
background: #aeaeae;
|
|
319
|
+
border: none;
|
|
320
|
+
color: #4c4c4c;
|
|
321
|
+
cursor: not-allowed;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:host {
|
|
325
|
+
display: block;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
fieldset {
|
|
329
|
+
margin: 0;
|
|
330
|
+
padding: 0;
|
|
331
|
+
border: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
input[type=submit] {
|
|
335
|
+
margin-left: auto;
|
|
336
|
+
}
|