@3t-transform/threeteeui 0.0.10 → 0.0.11
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-8a4cb9bc.js → index-bf39be87.js} +41 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +2 -2
- package/dist/cjs/tttx-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/tttx-form.cjs.entry.js +169 -41
- package/dist/cjs/tttx-icon.cjs.entry.js +2 -2
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +4 -4
- package/dist/cjs/tttx-popover-content.cjs.entry.js +2 -2
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +134 -0
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/tttx-button/tttx-button.css +1 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +3 -3
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +3 -3
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +15 -15
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +1 -1
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +2 -2
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +1 -1
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +3 -3
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +85 -39
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +1 -1
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +5 -5
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +230 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +195 -55
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +97 -28
- package/dist/collection/components/molecules/{tttx-input/tttx-input.css → tttx-standalone-input/tttx-standalone-input.css} +77 -49
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +561 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +156 -0
- package/dist/collection/components/palette.stories.js +81 -81
- package/dist/collection/docs/gettingstarted-developer.stories.js +4 -4
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/tttx-button.js +1 -1
- package/dist/components/tttx-checkbox.js +2 -2
- package/dist/components/tttx-form.js +167 -39
- package/dist/components/tttx-icon2.js +1 -1
- package/dist/components/tttx-loading-spinner.js +3 -3
- package/dist/components/tttx-popover-content.js +1 -1
- package/dist/components/{tttx-input.d.ts → tttx-standalone-input.d.ts} +4 -4
- package/dist/components/tttx-standalone-input.js +178 -0
- package/dist/esm/{index-9654537d.js → index-63c4d25e.js} +41 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/tttx-button.entry.js +2 -2
- package/dist/esm/tttx-checkbox.entry.js +3 -3
- package/dist/esm/tttx-form.entry.js +169 -41
- package/dist/esm/tttx-icon.entry.js +2 -2
- package/dist/esm/tttx-loading-spinner.entry.js +4 -4
- package/dist/esm/tttx-popover-content.entry.js +2 -2
- package/dist/esm/tttx-standalone-input.entry.js +130 -0
- package/dist/esm/tttx.js +3 -3
- package/dist/tttx/{p-3cb692d6.entry.js → p-1a4eb1f3.entry.js} +1 -1
- package/dist/tttx/p-2d54f8aa.entry.js +1 -0
- package/dist/tttx/p-338b3976.entry.js +1 -0
- package/dist/tttx/{p-674e2f18.entry.js → p-4c57bcbd.entry.js} +1 -1
- package/dist/tttx/{p-f4855113.entry.js → p-709246f5.entry.js} +1 -1
- package/dist/tttx/p-95a29e09.entry.js +1 -0
- package/dist/tttx/{p-1884203f.entry.js → p-ad0c3fe4.entry.js} +1 -1
- package/dist/tttx/p-bec472d8.js +2 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +14 -7
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +1 -8
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -0
- package/dist/types/components.d.ts +66 -41
- package/package.json +67 -65
- package/readme.md +89 -86
- package/dist/cjs/tttx-input.cjs.entry.js +0 -44
- package/dist/collection/components/molecules/tttx-input/tttx-input.js +0 -259
- package/dist/collection/components/molecules/tttx-input/tttx-input.stories.js +0 -106
- package/dist/components/tttx-input.js +0 -77
- package/dist/esm/tttx-input.entry.js +0 -40
- package/dist/tttx/p-317b13d3.entry.js +0 -1
- package/dist/tttx/p-3cd7ad04.entry.js +0 -1
- package/dist/tttx/p-b6cc2780.js +0 -2
- package/dist/tttx/p-f30a0e84.entry.js +0 -1
- package/dist/types/components/molecules/tttx-input/tttx-input.d.ts +0 -20
- package/dist/types/components/molecules/tttx-input/tttx-input.stories.d.ts +0 -60
|
@@ -303,6 +303,9 @@ const attachStyles = (hostRef) => {
|
|
|
303
303
|
// DOM WRITE!!
|
|
304
304
|
elm['s-sc'] = scopeId;
|
|
305
305
|
elm.classList.add(scopeId + '-h');
|
|
306
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
307
|
+
elm.classList.add(scopeId + '-s');
|
|
308
|
+
}
|
|
306
309
|
}
|
|
307
310
|
endAttachStyles();
|
|
308
311
|
};
|
|
@@ -848,6 +851,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
848
851
|
promise = safeCall(instance, 'componentWillLoad');
|
|
849
852
|
}
|
|
850
853
|
}
|
|
854
|
+
{
|
|
855
|
+
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
856
|
+
}
|
|
851
857
|
endSchedule();
|
|
852
858
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
853
859
|
};
|
|
@@ -917,6 +923,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
917
923
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
918
924
|
const instance = hostRef.$lazyInstance$ ;
|
|
919
925
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
926
|
+
{
|
|
927
|
+
safeCall(instance, 'componentDidRender');
|
|
928
|
+
}
|
|
920
929
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
921
930
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
922
931
|
{
|
|
@@ -981,6 +990,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
981
990
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
982
991
|
// check our new property value against our internal value
|
|
983
992
|
const hostRef = getHostRef(ref);
|
|
993
|
+
const elm = hostRef.$hostElement$ ;
|
|
984
994
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
985
995
|
const flags = hostRef.$flags$;
|
|
986
996
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -993,6 +1003,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
993
1003
|
// set our new value!
|
|
994
1004
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
995
1005
|
if (instance) {
|
|
1006
|
+
// get an array of method names of watch functions to call
|
|
1007
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1008
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1009
|
+
if (watchMethods) {
|
|
1010
|
+
// this instance is watching for when this property changed
|
|
1011
|
+
watchMethods.map((watchMethodName) => {
|
|
1012
|
+
try {
|
|
1013
|
+
// fire off each of the watch methods that are watching this property
|
|
1014
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1015
|
+
}
|
|
1016
|
+
catch (e) {
|
|
1017
|
+
consoleError(e, elm);
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
996
1022
|
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
997
1023
|
// looks like this value actually changed, so we've got work to do!
|
|
998
1024
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -1015,6 +1041,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1015
1041
|
*/
|
|
1016
1042
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1017
1043
|
if (cmpMeta.$members$) {
|
|
1044
|
+
if (Cstr.watchers) {
|
|
1045
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1046
|
+
}
|
|
1018
1047
|
// It's better to have a const than two Object.entries()
|
|
1019
1048
|
const members = Object.entries(cmpMeta.$members$);
|
|
1020
1049
|
const prototype = Cstr.prototype;
|
|
@@ -1119,6 +1148,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1119
1148
|
endLoad();
|
|
1120
1149
|
}
|
|
1121
1150
|
if (!Cstr.isProxied) {
|
|
1151
|
+
// we've never proxied this Constructor before
|
|
1152
|
+
// let's add the getters/setters to its prototype before
|
|
1153
|
+
// the first time we create an instance of the implementation
|
|
1154
|
+
{
|
|
1155
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1156
|
+
}
|
|
1122
1157
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1123
1158
|
Cstr.isProxied = true;
|
|
1124
1159
|
}
|
|
@@ -1142,6 +1177,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1142
1177
|
{
|
|
1143
1178
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1144
1179
|
}
|
|
1180
|
+
{
|
|
1181
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1182
|
+
}
|
|
1145
1183
|
endNewInstance();
|
|
1146
1184
|
}
|
|
1147
1185
|
if (Cstr.style) {
|
|
@@ -1261,6 +1299,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1261
1299
|
{
|
|
1262
1300
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1263
1301
|
}
|
|
1302
|
+
{
|
|
1303
|
+
cmpMeta.$watchers$ = {};
|
|
1304
|
+
}
|
|
1264
1305
|
const tagName = cmpMeta.$tagName$;
|
|
1265
1306
|
const HostElement = class extends HTMLElement {
|
|
1266
1307
|
// StencilLazyHost
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["tttx-input.cjs",[[
|
|
17
|
+
return index.bootstrapLazy([["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"autocapitalize":[1],"autocomplete":[1],"autofocus":[4],"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],"isfocused":[32]}]]],["tttx-button.cjs",[[1,"tttx-button",{"fontColor":[1,"font-color"],"buttonStyle":[1,"button-style"]},[[0,"clickEvent","onClicked"]]]]],["tttx-checkbox.cjs",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[8],"submitValue":[8,"submit-value"]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content.cjs",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"colour":[1]},[[4,"click","handleDocumentClick"]]]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
7
|
-
const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{height:36px;padding:8px 16px;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:inline-block}.spacingleft{margin-left:8px}.font-white{color:white}.font-black{color:#212121}";
|
|
7
|
+
const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{height:36px;padding:8px 16px;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6;color:white}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:inline-block}.spacingleft{margin-left:8px}.font-white{color:white}.font-black{color:#212121}";
|
|
8
8
|
|
|
9
9
|
const TttxButton = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
7
|
-
const tttxCheckboxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{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}.
|
|
7
|
+
const tttxCheckboxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{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,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.focused{border-color:#1479c6}.errormsg{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 .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger{color:#dc0000}.optional{color:#757575;font-weight:normal}label.inputBlock{display:block;position:relative;line-height:21px}label{font-weight:500;font-size:16px}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]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}input~.errorBubble{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~.errorBubble:not(.visible){visibility:hidden}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input:focus{border-color:#1479c6}:host{display:block}.spacing{margin-bottom:16px}";
|
|
8
8
|
|
|
9
9
|
const TttxCheckbox = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -20,7 +20,7 @@ const TttxCheckbox = class {
|
|
|
20
20
|
this.valueChanged.emit(target.checked);
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return (index.h(index.Host, null, index.h("div", { class: "field spacing" }, this.label && index.h("label", { class: "label" }, this.label, !this.required ? index.h("span", { class: "optional" }, " (optional)") : ''), index.h("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
|
|
23
|
+
return (index.h(index.Host, null, index.h("div", { class: "field spacing" }, this.label && (index.h("label", { class: "label" }, this.label, !this.required ? index.h("span", { class: "optional" }, " (optional)") : '')), index.h("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
TttxCheckbox.style = tttxCheckboxCss;
|
|
@@ -2,57 +2,185 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bf39be87.js');
|
|
6
|
+
|
|
7
|
+
const tttxFormCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{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,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.focused{border-color:#1479c6}.errormsg{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 .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger{color:#dc0000}.optional{color:#757575;font-weight:normal}label.inputBlock{display:block;position:relative;line-height:21px}label{font-weight:500;font-size:16px}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]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}input~.errorBubble{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~.errorBubble:not(.visible){visibility:hidden}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input:focus{border-color:#1479c6}.button{height:36px;padding:8px 16px;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6;color:white}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:block}fieldset{margin:0;padding:0;border:none}input[type=submit]{margin-left:auto}";
|
|
6
8
|
|
|
7
9
|
const TttxForm = class {
|
|
8
10
|
constructor(hostRef) {
|
|
9
11
|
index.registerInstance(this, hostRef);
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
this.submitEvent = index.createEvent(this, "submitEvent", 7);
|
|
13
|
+
this.template = document.createElement('template');
|
|
14
|
+
this.formschema = undefined;
|
|
15
|
+
this.submitValue = undefined;
|
|
16
|
+
}
|
|
17
|
+
onFormSchemaChange(newValue) {
|
|
18
|
+
if (typeof newValue === 'string') {
|
|
19
|
+
this._formSchema = JSON.parse(newValue);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this._formSchema = newValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
validityCheck(event) {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
const target = event.target;
|
|
29
|
+
let hasError = true;
|
|
30
|
+
let errorMessage = '';
|
|
31
|
+
// validity object on HTML5 inputs has the following options
|
|
32
|
+
// badInput
|
|
33
|
+
// customError
|
|
34
|
+
// patternMismatch
|
|
35
|
+
// rangeOverflow
|
|
36
|
+
// rangeUnderflow
|
|
37
|
+
// stepMismatch
|
|
38
|
+
// tooLong
|
|
39
|
+
// tooShort
|
|
40
|
+
// typeMismatch
|
|
41
|
+
// valid
|
|
42
|
+
// valueMissing
|
|
43
|
+
// customErrors can be set with
|
|
44
|
+
// target.setCustomValidity('custom error!');
|
|
45
|
+
// and cleared with
|
|
46
|
+
// target.setCustomValidity('');
|
|
47
|
+
if (target.validity.valueMissing) {
|
|
48
|
+
errorMessage = (_a = target.dataset.required) !== null && _a !== void 0 ? _a : 'This field is required';
|
|
49
|
+
}
|
|
50
|
+
else if (target.validity.patternMismatch) {
|
|
51
|
+
errorMessage = (_b = target.dataset.pattern) !== null && _b !== void 0 ? _b : 'Incorrect format';
|
|
52
|
+
}
|
|
53
|
+
else if (target.validity.badInput) {
|
|
54
|
+
// IE string in a number field
|
|
55
|
+
errorMessage = (_c = target.dataset.badinput) !== null && _c !== void 0 ? _c : 'Wrong input type';
|
|
56
|
+
}
|
|
57
|
+
else if (target.validity.rangeOverflow || target.validity.rangeUnderflow) {
|
|
58
|
+
// IE date or number is above or below value set in min or max tags
|
|
59
|
+
errorMessage = (_d = target.dataset.range) !== null && _d !== void 0 ? _d : 'Invalid value';
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// no error
|
|
63
|
+
hasError = false;
|
|
64
|
+
}
|
|
65
|
+
if (hasError) {
|
|
66
|
+
target.className = 'invalid';
|
|
67
|
+
const errorIcon = document.createElement('span');
|
|
68
|
+
errorIcon.className = 'material-symbols-rounded';
|
|
69
|
+
errorIcon.textContent = 'warning';
|
|
70
|
+
target.parentElement.querySelector('.errorBubble').replaceChildren();
|
|
71
|
+
target.parentElement.querySelector('.errorBubble').append(errorIcon);
|
|
72
|
+
target.parentElement.querySelector('.errorBubble').append(errorMessage);
|
|
32
73
|
}
|
|
33
74
|
else {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
75
|
+
target.className = '';
|
|
76
|
+
target.parentElement.querySelector('.errorBubble').replaceChildren();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
doSubmit(event) {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
const formData = new FormData(event.target);
|
|
82
|
+
// Key value pair matching the key names given by the JSON schema will be output line by line
|
|
83
|
+
// TODO: Emit an event so external components can handle the resulting form data
|
|
84
|
+
// let output = "";
|
|
85
|
+
// for (var [key, value] of formData.entries()) {
|
|
86
|
+
// output += `${key} -> ${value}\n`;
|
|
87
|
+
// }
|
|
88
|
+
// console.log(output);
|
|
89
|
+
this.submitEvent.emit(formData);
|
|
90
|
+
}
|
|
91
|
+
fieldsetChange(event) {
|
|
92
|
+
console.log(event.target.name + ' has changed');
|
|
93
|
+
// The correct input box will always be the target of the incoming event
|
|
94
|
+
// TODO: Emit an event so external components can change based on form values input
|
|
95
|
+
}
|
|
96
|
+
componentWillLoad() {
|
|
97
|
+
// set proper on initial render
|
|
98
|
+
this.onFormSchemaChange(this.formschema);
|
|
99
|
+
}
|
|
100
|
+
componentWillRender() {
|
|
101
|
+
this.template.content.replaceChildren(); // clear the template to account for a potential re-render scenario
|
|
102
|
+
this.populateFormFromSchema();
|
|
103
|
+
}
|
|
104
|
+
populateFormFromSchema() {
|
|
105
|
+
if (!this._formSchema)
|
|
106
|
+
return;
|
|
107
|
+
const properties = this._formSchema.properties;
|
|
108
|
+
const propertyKeys = Object.keys(properties);
|
|
109
|
+
propertyKeys.forEach(formKey => {
|
|
110
|
+
var _a, _b, _c;
|
|
111
|
+
const formItem = properties[formKey];
|
|
112
|
+
const formProperties = formItem.form;
|
|
113
|
+
const input = document.createElement('input');
|
|
114
|
+
input.name = formKey;
|
|
115
|
+
input.type = formProperties.type;
|
|
116
|
+
input.placeholder = (_a = formProperties.placeholder) !== null && _a !== void 0 ? _a : '';
|
|
117
|
+
input.autocomplete = 'off';
|
|
118
|
+
input.autocapitalize = 'off';
|
|
119
|
+
if (formProperties.validation) {
|
|
120
|
+
const validation = formProperties.validation;
|
|
121
|
+
if (validation.required) {
|
|
122
|
+
input.setAttribute('required', '');
|
|
123
|
+
input.setAttribute('data-required', (_b = validation.required.message) !== null && _b !== void 0 ? _b : '');
|
|
48
124
|
}
|
|
49
|
-
|
|
125
|
+
if (validation.pattern) {
|
|
126
|
+
input.setAttribute('pattern', validation.pattern.pattern);
|
|
127
|
+
input.setAttribute('data-pattern', (_c = validation.pattern.message) !== null && _c !== void 0 ? _c : '');
|
|
128
|
+
}
|
|
129
|
+
if (validation.badInput) {
|
|
130
|
+
input.setAttribute('data-badinput', validation.badInput.message);
|
|
131
|
+
}
|
|
132
|
+
if (validation.minmax) {
|
|
133
|
+
input.setAttribute('min', validation.minmax.min);
|
|
134
|
+
input.setAttribute('max', validation.minmax.max);
|
|
135
|
+
input.setAttribute('data-range', validation.minmax.message);
|
|
136
|
+
}
|
|
137
|
+
if (validation.maxlength) {
|
|
138
|
+
input.setAttribute('maxlength', validation.maxlength);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const errorBubble = document.createElement('div');
|
|
142
|
+
errorBubble.className = 'errorBubble';
|
|
143
|
+
const label = document.createElement('label');
|
|
144
|
+
label.className = 'inputBlock';
|
|
145
|
+
label.innerText = formProperties.label;
|
|
146
|
+
if (!formProperties.validation) {
|
|
147
|
+
const optionalSpan = document.createElement('span');
|
|
148
|
+
optionalSpan.className = 'optional';
|
|
149
|
+
optionalSpan.innerHTML = ' (optional)';
|
|
150
|
+
label.appendChild(optionalSpan);
|
|
151
|
+
}
|
|
152
|
+
label.appendChild(input);
|
|
153
|
+
label.appendChild(errorBubble);
|
|
154
|
+
this.template.content.append(label);
|
|
155
|
+
});
|
|
156
|
+
const submitButton = document.createElement('input');
|
|
157
|
+
submitButton.type = 'submit';
|
|
158
|
+
submitButton.className = 'button primary-blue';
|
|
159
|
+
console.log(this.submitValue);
|
|
160
|
+
submitButton.value = 'Save';
|
|
161
|
+
this.template.content.append(submitButton);
|
|
162
|
+
}
|
|
163
|
+
componentDidRender() {
|
|
164
|
+
if (!this._formSchema)
|
|
165
|
+
return;
|
|
166
|
+
const formItems = this.template.content.cloneNode(true);
|
|
167
|
+
// bind to events here as you can't do it in a template in stencil
|
|
168
|
+
const properties = this._formSchema.properties;
|
|
169
|
+
const propertyKeys = Object.keys(properties);
|
|
170
|
+
propertyKeys.forEach(formKey => {
|
|
171
|
+
formItems.querySelector(`[name=${formKey}]`).oninvalid = this.validityCheck.bind(this);
|
|
172
|
+
formItems.querySelector(`[name=${formKey}]`).onblur = this.validityCheck.bind(this);
|
|
50
173
|
});
|
|
174
|
+
// append to the fieldset
|
|
175
|
+
this.fieldset.appendChild(formItems);
|
|
51
176
|
}
|
|
52
177
|
render() {
|
|
53
|
-
return (index.h("
|
|
178
|
+
return (index.h(index.Host, null, index.h("form", { onSubmit: this.doSubmit.bind(this) }, index.h("fieldset", { onChange: this.fieldsetChange, ref: el => (this.fieldset = el) }))));
|
|
54
179
|
}
|
|
55
|
-
get
|
|
56
|
-
|
|
180
|
+
static get watchers() { return {
|
|
181
|
+
"formschema": ["onFormSchemaChange"]
|
|
182
|
+
}; }
|
|
183
|
+
};
|
|
184
|
+
TttxForm.style = tttxFormCss;
|
|
57
185
|
|
|
58
186
|
exports.tttx_form = TttxForm;
|
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
7
7
|
var top = 'top';
|
|
8
8
|
var bottom = 'bottom';
|
|
@@ -1801,7 +1801,7 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
1801
1801
|
defaultModifiers: defaultModifiers
|
|
1802
1802
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
1803
1803
|
|
|
1804
|
-
const tttxIconCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{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}:host{display:block}.tooltip{background:#ffffff;color:#343434;font-weight:bold;padding:8px 16px;font-size:13px;border-radius:4px;box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3);display:none}.tooltip[data-show]{display:block}.arrow,.arrow::before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}.tooltip[data-popper-placement^=left]>.arrow{right:-4px}.tooltip[data-popper-placement^=right]>.arrow{left:-4px}.red{color:#
|
|
1804
|
+
const tttxIconCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{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}:host{display:block}.tooltip{background:#ffffff;color:#343434;font-weight:bold;padding:8px 16px;font-size:13px;border-radius:4px;box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3);display:none}.tooltip[data-show]{display:block}.arrow,.arrow::before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}.tooltip[data-popper-placement^=left]>.arrow{right:-4px}.tooltip[data-popper-placement^=right]>.arrow{left:-4px}.red{color:#dc0000}.orange{color:#f59500}.blue{color:#1479c6}.green{color:#a2bb31}.gray{color:#757575}.black{color:#212121}.white{color:white}.clickable{cursor:pointer}";
|
|
1805
1805
|
|
|
1806
1806
|
const TttxIcon = class {
|
|
1807
1807
|
constructor(hostRef) {
|
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
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:#
|
|
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
|
|
|
9
9
|
const TttxLoadingSpinner = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -15,10 +15,10 @@ const TttxLoadingSpinner = class {
|
|
|
15
15
|
renderLoadingMessage() {
|
|
16
16
|
if (!this.loadingMessage)
|
|
17
17
|
return '';
|
|
18
|
-
return index.h("div", { class:
|
|
18
|
+
return index.h("div", { class: "loading-text" }, "Loading, please wait...");
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return index.h("div", { class:
|
|
21
|
+
return (index.h("div", { class: "spinner-container" }, index.h("div", { class: "loading-box" }, index.h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
TttxLoadingSpinner.style = tttxLoadingSpinnerCss;
|
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
7
7
|
const tttxPopoverContentCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block;max-width:400px}h4{margin:0;font-size:15px;font-weight:700;color:black;margin-bottom:4px}p{margin:0;font-size:14px;font-weight:normal;color:black;margin-bottom:4px}.linky{color:#1479c6;text-decoration:none;cursor:pointer}";
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ const TttxPopoverContent = class {
|
|
|
15
15
|
this.linktext = undefined;
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (index.h(index.Host, null, this.header && index.h("h4", null, this.header), this.body && index.h("p", null, this.body), this.linkcontext && index.h("span", { class: "linky", onClick:
|
|
18
|
+
return (index.h(index.Host, null, this.header && index.h("h4", null, this.header), this.body && index.h("p", null, this.body), this.linkcontext && (index.h("span", { class: "linky", onClick: evt => console.log(this.linkcontext, evt) }, this.linktext || 'More Information'))));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
TttxPopoverContent.style = tttxPopoverContentCss;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-bf39be87.js');
|
|
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;margin-right:4px}.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}.focused.sc-tttx-standalone-input{border-color:#1479c6}.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.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.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}.sc-tttx-standalone-input-h{display:block}";
|
|
8
|
+
|
|
9
|
+
const TttxInput = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
+
this.isfocused = false;
|
|
14
|
+
this.label = undefined;
|
|
15
|
+
this.valid = undefined;
|
|
16
|
+
this.showerrormsg = undefined;
|
|
17
|
+
this.errormsg = undefined;
|
|
18
|
+
this.iconleft = undefined;
|
|
19
|
+
this.iconright = undefined;
|
|
20
|
+
this.autocapitalize = undefined;
|
|
21
|
+
this.autocomplete = undefined;
|
|
22
|
+
this.autofocus = undefined;
|
|
23
|
+
this.checked = undefined;
|
|
24
|
+
this.disabled = undefined;
|
|
25
|
+
this.max = undefined;
|
|
26
|
+
this.maxlength = undefined;
|
|
27
|
+
this.min = undefined;
|
|
28
|
+
this.minlength = undefined;
|
|
29
|
+
this.name = undefined;
|
|
30
|
+
this.pattern = undefined;
|
|
31
|
+
this.placeholder = undefined;
|
|
32
|
+
this.readonly = undefined;
|
|
33
|
+
this.required = undefined;
|
|
34
|
+
this.step = undefined;
|
|
35
|
+
this.type = 'text';
|
|
36
|
+
this.value = undefined;
|
|
37
|
+
}
|
|
38
|
+
handleChange(event) {
|
|
39
|
+
const target = event.target;
|
|
40
|
+
this.value = target.value;
|
|
41
|
+
this.valueChanged.emit(target.value);
|
|
42
|
+
}
|
|
43
|
+
handleFocus() {
|
|
44
|
+
this.isfocused = true;
|
|
45
|
+
}
|
|
46
|
+
handleBlur() {
|
|
47
|
+
this.isfocused = false;
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
const classNames = ['standalone', this.showerrormsg ? 'invalid' : ''].join(' ');
|
|
51
|
+
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, colour: "grey" }))), index.h("input", { class: classNames, autocapitalize: this.type === 'url' || this.type === 'email' || this.type === 'password' ? this.autocapitalize : null, autofocus: this.autofocus, autocomplete: this.type === 'text' ||
|
|
52
|
+
this.type === 'search' ||
|
|
53
|
+
this.type === 'url' ||
|
|
54
|
+
this.type === 'tel' ||
|
|
55
|
+
this.type === 'email' ||
|
|
56
|
+
this.type === 'password' ||
|
|
57
|
+
this.type === 'datepickers' ||
|
|
58
|
+
this.type === 'range' ||
|
|
59
|
+
this.type === 'color'
|
|
60
|
+
? this.autocomplete
|
|
61
|
+
: null, checked: this.type === 'checkbox' || this.type === 'radio' ? this.checked : null, disabled: !this.required ? this.disabled : null, max: this.type === 'date' ||
|
|
62
|
+
this.type === 'month' ||
|
|
63
|
+
this.type === 'week' ||
|
|
64
|
+
this.type === 'time' ||
|
|
65
|
+
this.type === 'datetime-local' ||
|
|
66
|
+
this.type === 'number' ||
|
|
67
|
+
this.type === 'range'
|
|
68
|
+
? this.max
|
|
69
|
+
: null, maxlength: this.maxlength, min: this.type === 'date' ||
|
|
70
|
+
this.type === 'month' ||
|
|
71
|
+
this.type === 'week' ||
|
|
72
|
+
this.type === 'time' ||
|
|
73
|
+
this.type === 'datetime-local' ||
|
|
74
|
+
this.type === 'number' ||
|
|
75
|
+
this.type === 'range'
|
|
76
|
+
? this.min
|
|
77
|
+
: null, minlength: this.maxlength, name: this.name, pattern: this.type === 'text' ||
|
|
78
|
+
this.type === 'date' ||
|
|
79
|
+
this.type === 'search' ||
|
|
80
|
+
this.type === 'url' ||
|
|
81
|
+
this.type === 'tel' ||
|
|
82
|
+
this.type === 'email' ||
|
|
83
|
+
this.type === 'password'
|
|
84
|
+
? this.pattern
|
|
85
|
+
: null, placeholder: this.type === 'text' ||
|
|
86
|
+
this.type === 'tel' ||
|
|
87
|
+
this.type === 'email' ||
|
|
88
|
+
this.type === 'url' ||
|
|
89
|
+
this.type === 'password' ||
|
|
90
|
+
this.type === 'search'
|
|
91
|
+
? this.placeholder
|
|
92
|
+
: null, readonly: this.type === 'text' ||
|
|
93
|
+
this.type === 'search' ||
|
|
94
|
+
this.type === 'url' ||
|
|
95
|
+
this.type === 'tel' ||
|
|
96
|
+
this.type === 'email' ||
|
|
97
|
+
this.type === 'password' ||
|
|
98
|
+
this.type === 'date' ||
|
|
99
|
+
this.type === 'month' ||
|
|
100
|
+
this.type === 'week' ||
|
|
101
|
+
this.type === 'time' ||
|
|
102
|
+
this.type === 'datetime-local' ||
|
|
103
|
+
this.type === 'number'
|
|
104
|
+
? this.readonly
|
|
105
|
+
: null, required: this.type === 'text' ||
|
|
106
|
+
this.type === 'search' ||
|
|
107
|
+
this.type === 'url' ||
|
|
108
|
+
this.type === 'tel' ||
|
|
109
|
+
this.type === 'email' ||
|
|
110
|
+
this.type === 'password' ||
|
|
111
|
+
this.type === 'date' ||
|
|
112
|
+
this.type === 'month' ||
|
|
113
|
+
this.type === 'week' ||
|
|
114
|
+
this.type === 'time' ||
|
|
115
|
+
this.type === 'datetime-local' ||
|
|
116
|
+
this.type === 'number' ||
|
|
117
|
+
this.type === 'checkbox' ||
|
|
118
|
+
this.type === 'radio' ||
|
|
119
|
+
this.type === 'file'
|
|
120
|
+
? this.required
|
|
121
|
+
: null, step: this.type === 'date' ||
|
|
122
|
+
this.type === 'month' ||
|
|
123
|
+
this.type === 'week' ||
|
|
124
|
+
this.type === 'time' ||
|
|
125
|
+
this.type === 'datetime-local' ||
|
|
126
|
+
this.type === 'number' ||
|
|
127
|
+
this.type === 'range'
|
|
128
|
+
? this.step
|
|
129
|
+
: null, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.iconright, colour: "grey" }))), index.h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
TttxInput.style = tttxStandaloneInputCss;
|
|
133
|
+
|
|
134
|
+
exports.tttx_standalone_input = TttxInput;
|
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -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-bf39be87.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["tttx-input.cjs",[[
|
|
20
|
+
return index.bootstrapLazy([["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"autocapitalize":[1],"autocomplete":[1],"autofocus":[4],"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],"isfocused":[32]}]]],["tttx-button.cjs",[[1,"tttx-button",{"fontColor":[1,"font-color"],"buttonStyle":[1,"button-style"]},[[0,"clickEvent","onClicked"]]]]],["tttx-checkbox.cjs",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[8],"submitValue":[8,"submit-value"]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content.cjs",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"colour":[1]},[[4,"click","handleDocumentClick"]]]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|