@3t-transform/threeteeui 0.0.5 → 0.0.7
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-8a7479e4.js → index-253ca97c.js} +239 -415
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/tttx-button.cjs.entry.js +28 -0
- package/dist/cjs/tttx-checkbox.cjs.entry.js +28 -0
- package/dist/cjs/tttx-form.cjs.entry.js +58 -0
- package/dist/cjs/tttx-single-input.cjs.entry.js +44 -0
- package/dist/cjs/tttx-text-box.cjs.entry.js +38 -0
- package/dist/cjs/tttx.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +7 -6
- package/dist/collection/components/atoms/tttx-button/tttx-button.css +61 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +93 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +30 -0
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.css +142 -0
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.js +259 -0
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.stories.js +92 -0
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.css +142 -0
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.js +150 -0
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.stories.js +17 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +138 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +101 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +13 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +109 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +37 -0
- package/dist/collection/icons.js +2838 -0
- package/dist/components/index.d.ts +14 -4
- package/dist/components/index.js +6 -5
- package/dist/components/{tttx-page.d.ts → tttx-button.d.ts} +4 -4
- package/dist/components/tttx-button.js +45 -0
- package/dist/components/{tttx-worksheet.d.ts → tttx-checkbox.d.ts} +4 -4
- package/dist/components/tttx-checkbox.js +46 -0
- package/dist/components/{tttx-icon.d.ts → tttx-form.d.ts} +4 -4
- package/dist/components/tttx-form.js +75 -0
- package/dist/components/{qualifications-list.d.ts → tttx-single-input.d.ts} +4 -4
- package/dist/components/tttx-single-input.js +71 -0
- package/dist/components/tttx-text-box.d.ts +11 -0
- package/dist/components/tttx-text-box.js +59 -0
- package/dist/esm/{index-854ff56f.js → index-fcca6c58.js} +237 -416
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/tttx-button.entry.js +24 -0
- package/dist/esm/tttx-checkbox.entry.js +24 -0
- package/dist/esm/tttx-form.entry.js +54 -0
- package/dist/esm/tttx-single-input.entry.js +40 -0
- package/dist/esm/tttx-text-box.entry.js +34 -0
- package/dist/esm/tttx.js +4 -3
- package/dist/tttx/p-05d7d002.entry.js +1 -0
- package/dist/tttx/p-40709c59.entry.js +1 -0
- package/dist/tttx/p-64703252.entry.js +1 -0
- package/dist/tttx/p-8d1f2e5c.entry.js +1 -0
- package/dist/tttx/p-9bf836ed.entry.js +1 -0
- package/dist/tttx/p-a7b95fd2.js +2 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +9 -0
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +20 -0
- package/dist/types/components/atoms/tttx-single-input/tttx-single-input.d.ts +20 -0
- package/dist/types/components/atoms/tttx-single-input/tttx-single-input.stories.d.ts +27 -0
- package/dist/types/components/atoms/tttx-text-box/tttx-text-box.d.ts +14 -0
- package/dist/types/components/{patterns/qualifications-list/qualifications-list.stories.d.ts → atoms/tttx-text-box/tttx-text-box.stories.d.ts} +1 -0
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -0
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +11 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +6 -0
- package/dist/types/components.d.ts +120 -56
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +59 -3
- package/loader/index.d.ts +9 -0
- package/package.json +58 -59
- package/readme.md +1 -6
- package/dist/cjs/qualifications-list.cjs.entry.js +0 -7149
- package/dist/cjs/toolbar-02115550.js +0 -864
- package/dist/cjs/tttx-icon.cjs.entry.js +0 -21
- package/dist/cjs/tttx-page.cjs.entry.js +0 -928
- package/dist/cjs/tttx-worksheet.cjs.entry.js +0 -48
- package/dist/cjs/ui.popover-27780a1d.js +0 -33576
- package/dist/collection/components/components/tttx-icon/tttx-icon.css +0 -89
- package/dist/collection/components/components/tttx-icon/tttx-icon.js +0 -59
- package/dist/collection/components/components/tttx-icon/tttx-icon.stories.js +0 -40
- package/dist/collection/components/patterns/qualifications-list/qualifications-list.js +0 -32
- package/dist/collection/components/patterns/qualifications-list/qualifications-list.stories.js +0 -7
- package/dist/collection/components/patterns/tttx-page/tttx-page.css +0 -162
- package/dist/collection/components/patterns/tttx-page/tttx-page.js +0 -213
- package/dist/collection/components/patterns/tttx-page/tttx-page.stories.js +0 -80
- package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.css +0 -134
- package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.js +0 -70
- package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.stories.js +0 -44
- package/dist/components/qualifications-list.js +0 -7162
- package/dist/components/tttx-icon.js +0 -37
- package/dist/components/tttx-page.js +0 -954
- package/dist/components/tttx-worksheet.js +0 -6
- package/dist/components/tttx-worksheet2.js +0 -918
- package/dist/components/ui.popover.js +0 -33449
- package/dist/esm/qualifications-list.entry.js +0 -7145
- package/dist/esm/toolbar-b147a3aa.js +0 -862
- package/dist/esm/tttx-icon.entry.js +0 -17
- package/dist/esm/tttx-page.entry.js +0 -924
- package/dist/esm/tttx-worksheet.entry.js +0 -44
- package/dist/esm/ui.popover-0c8f8d79.js +0 -33449
- package/dist/tttx/p-4f4963aa.entry.js +0 -1
- package/dist/tttx/p-69ca02f6.entry.js +0 -1
- package/dist/tttx/p-7244abd4.entry.js +0 -1
- package/dist/tttx/p-7eb8146c.entry.js +0 -1
- package/dist/tttx/p-81cad444.js +0 -1
- package/dist/tttx/p-955d89ac.js +0 -1
- package/dist/tttx/p-ddfeb0ba.js +0 -2
- package/dist/tttx/tttx.css +0 -1
- package/dist/types/components/components/tttx-icon/tttx-icon.d.ts +0 -5
- package/dist/types/components/components/tttx-icon/tttx-icon.stories.d.ts +0 -24
- package/dist/types/components/patterns/qualifications-list/qualifications-list.d.ts +0 -6
- package/dist/types/components/patterns/tttx-page/tttx-page.d.ts +0 -21
- package/dist/types/components/patterns/tttx-page/tttx-page.stories.d.ts +0 -48
- package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.d.ts +0 -9
- package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.stories.d.ts +0 -23
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,8 +14,9 @@ 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-
|
|
17
|
+
return index.bootstrapLazy([["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",{"dataAttribute":[1,"data-attribute"],"functionAttribute":[1,"function-attribute"]}]]],["tttx-single-input.cjs",[[1,"tttx-single-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"value":[1025],"type":[1],"placeholder":[1],"pattern":[1],"iconleft":[1],"iconright":[1],"required":[4],"isfocused":[32]}]]],["tttx-text-box.cjs",[[1,"tttx-text-box",{"label":[1],"showerrormsg":[4],"errormsg":[1],"required":[4],"value":[1025],"isfocused":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
exports.setNonce = index.setNonce;
|
|
21
22
|
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
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}";
|
|
8
|
+
|
|
9
|
+
const TttxButton = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.clickEvent = index.createEvent(this, "clickEvent", 7);
|
|
13
|
+
this.fontColor = undefined;
|
|
14
|
+
this.buttonStyle = undefined;
|
|
15
|
+
}
|
|
16
|
+
onClick() {
|
|
17
|
+
this.clickEvent.emit('clicked');
|
|
18
|
+
}
|
|
19
|
+
onClicked(event) {
|
|
20
|
+
console.log('Picked up a clickEvent', event);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (index.h(index.Host, null, index.h("button", { onClick: this.onClick.bind(this), class: `button ${this.fontColor} ${this.buttonStyle}` }, index.h("span", null, index.h("slot", null)))));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
TttxButton.style = tttxButtonCss;
|
|
27
|
+
|
|
28
|
+
exports.tttx_button = TttxButton;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
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\";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}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.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}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;font-size:16px;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{height:16px;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;color:white;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}:host{display:block}.spacing{margin-bottom:16px}";
|
|
8
|
+
|
|
9
|
+
const TttxCheckbox = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
+
this.value = undefined;
|
|
14
|
+
this.label = undefined;
|
|
15
|
+
this.required = undefined;
|
|
16
|
+
}
|
|
17
|
+
handleClick(event) {
|
|
18
|
+
const target = event.target;
|
|
19
|
+
this.value = target.checked;
|
|
20
|
+
this.valueChanged.emit(target.checked);
|
|
21
|
+
}
|
|
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 }))));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
TttxCheckbox.style = tttxCheckboxCss;
|
|
27
|
+
|
|
28
|
+
exports.tttx_checkbox = TttxCheckbox;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
6
|
+
|
|
7
|
+
const TttxForm = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.formSubmit = index.createEvent(this, "formSubmit", 7);
|
|
11
|
+
this.fetchFormData = () => {
|
|
12
|
+
let validForm = true;
|
|
13
|
+
const formData = {};
|
|
14
|
+
const elements = this.el.querySelectorAll(`[${this.dataAttribute}]`);
|
|
15
|
+
elements.forEach((element) => {
|
|
16
|
+
const inputElement = element;
|
|
17
|
+
validForm = validForm ? this.validateFormField(inputElement) : false;
|
|
18
|
+
formData[inputElement.getAttribute(this.dataAttribute)] = inputElement.value;
|
|
19
|
+
});
|
|
20
|
+
return validForm ? formData : null;
|
|
21
|
+
};
|
|
22
|
+
this.dataAttribute = 'form-data';
|
|
23
|
+
this.functionAttribute = 'function-data';
|
|
24
|
+
}
|
|
25
|
+
validateFormField(element) {
|
|
26
|
+
let isValid = true;
|
|
27
|
+
const isRequired = element.hasAttribute("required");
|
|
28
|
+
if (isRequired && !element.value) {
|
|
29
|
+
// required and not set, show error
|
|
30
|
+
element.setAttribute("showerrormsg", "true");
|
|
31
|
+
isValid = false;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// required and set, ensure error does not show
|
|
35
|
+
element.removeAttribute("showerrormsg");
|
|
36
|
+
}
|
|
37
|
+
return isValid;
|
|
38
|
+
}
|
|
39
|
+
componentDidLoad() {
|
|
40
|
+
const elements = this.el.querySelectorAll(`[${this.functionAttribute}]`);
|
|
41
|
+
elements.forEach((element) => {
|
|
42
|
+
element.addEventListener('click', event => {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
const formData = this.fetchFormData();
|
|
45
|
+
if (formData) {
|
|
46
|
+
// only emit event if form data is valid
|
|
47
|
+
this.formSubmit.emit(this.fetchFormData());
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
return (index.h("div", null, index.h("slot", null)));
|
|
54
|
+
}
|
|
55
|
+
get el() { return index.getElement(this); }
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.tttx_form = TttxForm;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
6
|
+
|
|
7
|
+
const tttxSingleInputCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\";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}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.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}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;font-size:16px;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{height:16px;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;color:white;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}:host{display:block}.spacing{margin-bottom:16px}.errorstate{border-color:#DC0000}";
|
|
8
|
+
|
|
9
|
+
const TttxSingleInput = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
+
this.handleFocus = () => {
|
|
14
|
+
this.isfocused = true;
|
|
15
|
+
};
|
|
16
|
+
this.handleBlur = () => {
|
|
17
|
+
this.isfocused = false;
|
|
18
|
+
};
|
|
19
|
+
this.isfocused = false;
|
|
20
|
+
this.label = undefined;
|
|
21
|
+
this.valid = undefined;
|
|
22
|
+
this.showerrormsg = undefined;
|
|
23
|
+
this.errormsg = undefined;
|
|
24
|
+
this.value = undefined;
|
|
25
|
+
this.type = 'text';
|
|
26
|
+
this.placeholder = undefined;
|
|
27
|
+
this.pattern = undefined;
|
|
28
|
+
this.iconleft = undefined;
|
|
29
|
+
this.iconright = undefined;
|
|
30
|
+
this.required = undefined;
|
|
31
|
+
}
|
|
32
|
+
handleChange(event) {
|
|
33
|
+
const target = event.target;
|
|
34
|
+
this.value = target.value;
|
|
35
|
+
this.valueChanged.emit(target.value);
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : '', this.iconleft ? 'iconleft' : ''].join(' ');
|
|
39
|
+
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("div", { class: inputClass }, this.iconleft && (index.h("div", { class: "icon-left" }, index.h("span", { class: "material-symbols-rounded" }, this.iconleft))), index.h("input", { class: "input", onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this), type: this.type, placeholder: this.placeholder, value: this.value, onInput: event => this.handleChange(event) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("span", { class: "material-symbols-rounded" }, this.iconright)))), this.showerrormsg && this.errormsg && index.h("div", { class: "errormsg" }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
TttxSingleInput.style = tttxSingleInputCss;
|
|
43
|
+
|
|
44
|
+
exports.tttx_single_input = TttxSingleInput;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
6
|
+
|
|
7
|
+
const tttxTextBoxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\";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}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.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}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;font-size:16px;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{height:16px;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;color:white;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}:host{display:block}.spacing{margin-bottom:16px}.errorstate{border-color:#DC0000}";
|
|
8
|
+
|
|
9
|
+
const TttxTextBox = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
+
this.handleFocus = () => {
|
|
14
|
+
this.isfocused = true;
|
|
15
|
+
};
|
|
16
|
+
this.handleBlur = () => {
|
|
17
|
+
this.isfocused = false;
|
|
18
|
+
};
|
|
19
|
+
this.label = undefined;
|
|
20
|
+
this.showerrormsg = undefined;
|
|
21
|
+
this.errormsg = undefined;
|
|
22
|
+
this.required = undefined;
|
|
23
|
+
this.value = undefined;
|
|
24
|
+
this.isfocused = false;
|
|
25
|
+
}
|
|
26
|
+
handleChange(event) {
|
|
27
|
+
const target = event.target;
|
|
28
|
+
this.value = target.value;
|
|
29
|
+
this.valueChanged.emit(target.value);
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : ''].join(' ');
|
|
33
|
+
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("div", { class: inputClass }, index.h("input", { class: "input", type: "text", value: this.value, required: this.required, onInput: event => this.handleChange(event), onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this) })), this.showerrormsg && this.errormsg && index.h("div", { class: "errormsg" }, this.errormsg))));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
TttxTextBox.style = tttxTextBoxCss;
|
|
37
|
+
|
|
38
|
+
exports.tttx_text_box = TttxTextBox;
|
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-253ca97c.js');
|
|
4
6
|
|
|
5
7
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
8
|
+
Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
7
9
|
*/
|
|
8
10
|
const patchBrowser = () => {
|
|
9
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tttx.cjs.js', document.baseURI).href));
|
|
@@ -15,5 +17,7 @@ const patchBrowser = () => {
|
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["tttx-
|
|
20
|
+
return index.bootstrapLazy([["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",{"dataAttribute":[1,"data-attribute"],"functionAttribute":[1,"function-attribute"]}]]],["tttx-single-input.cjs",[[1,"tttx-single-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"value":[1025],"type":[1],"placeholder":[1],"pattern":[1],"iconleft":[1],"iconright":[1],"required":[4],"isfocused":[32]}]]],["tttx-text-box.cjs",[[1,"tttx-text-box",{"label":[1],"showerrormsg":[4],"errormsg":[1],"required":[4],"value":[1025],"isfocused":[32]}]]]], options);
|
|
19
21
|
});
|
|
22
|
+
|
|
23
|
+
exports.setNonce = index.setNonce;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"./components/
|
|
4
|
-
"./components/
|
|
5
|
-
"./components/
|
|
6
|
-
"./components/
|
|
3
|
+
"./components/atoms/tttx-button/tttx-button.js",
|
|
4
|
+
"./components/atoms/tttx-single-input/tttx-single-input.js",
|
|
5
|
+
"./components/atoms/tttx-text-box/tttx-text-box.js",
|
|
6
|
+
"./components/atoms/ttx-checkbox/tttx-checkbox.js",
|
|
7
|
+
"./components/molecules/tttx-form/tttx-form.js"
|
|
7
8
|
],
|
|
8
9
|
"compiler": {
|
|
9
10
|
"name": "@stencil/core",
|
|
10
|
-
"version": "2.
|
|
11
|
-
"typescriptVersion": "4.
|
|
11
|
+
"version": "2.22.3",
|
|
12
|
+
"typescriptVersion": "4.9.4"
|
|
12
13
|
},
|
|
13
14
|
"collections": [],
|
|
14
15
|
"bundles": []
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.button {
|
|
6
|
+
height: 36px;
|
|
7
|
+
padding: 8px 16px;
|
|
8
|
+
margin: 0;
|
|
9
|
+
background: transparent;
|
|
10
|
+
color: #212121;
|
|
11
|
+
border: 1px solid #c8c8c8;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
text-transform: uppercase;
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: left;
|
|
16
|
+
align-items: center;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.button:hover {
|
|
22
|
+
background: #f0f0f0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.button:active {
|
|
26
|
+
background: #e3e3e3;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.primary-blue {
|
|
30
|
+
background: #1479c6;
|
|
31
|
+
border: 1px solid #1479c6;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.primary-blue:hover {
|
|
35
|
+
background: #1169ba;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.primary-blue:active {
|
|
39
|
+
background: #0951a8;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.secondary-white {
|
|
43
|
+
background: white;
|
|
44
|
+
border: 1px solid #212121;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host {
|
|
48
|
+
display: inline-block;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.spacingleft {
|
|
52
|
+
margin-left: 8px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.font-white {
|
|
56
|
+
color: white;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.font-black {
|
|
60
|
+
color: #212121;
|
|
61
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class TttxButton {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.fontColor = undefined;
|
|
5
|
+
this.buttonStyle = undefined;
|
|
6
|
+
}
|
|
7
|
+
onClick() {
|
|
8
|
+
this.clickEvent.emit('clicked');
|
|
9
|
+
}
|
|
10
|
+
onClicked(event) {
|
|
11
|
+
console.log('Picked up a clickEvent', event);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, null, h("button", { onClick: this.onClick.bind(this), class: `button ${this.fontColor} ${this.buttonStyle}` }, h("span", null, h("slot", null)))));
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "tttx-button"; }
|
|
17
|
+
static get encapsulation() { return "shadow"; }
|
|
18
|
+
static get originalStyleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["tttx-button.scss"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["tttx-button.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get properties() {
|
|
29
|
+
return {
|
|
30
|
+
"fontColor": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"mutable": false,
|
|
33
|
+
"complexType": {
|
|
34
|
+
"original": "string",
|
|
35
|
+
"resolved": "string",
|
|
36
|
+
"references": {}
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"optional": false,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": ""
|
|
43
|
+
},
|
|
44
|
+
"attribute": "font-color",
|
|
45
|
+
"reflect": false
|
|
46
|
+
},
|
|
47
|
+
"buttonStyle": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "string",
|
|
52
|
+
"resolved": "string",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"attribute": "button-style",
|
|
62
|
+
"reflect": false
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get events() {
|
|
67
|
+
return [{
|
|
68
|
+
"method": "clickEvent",
|
|
69
|
+
"name": "clickEvent",
|
|
70
|
+
"bubbles": true,
|
|
71
|
+
"cancelable": true,
|
|
72
|
+
"composed": true,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": ""
|
|
76
|
+
},
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "string",
|
|
79
|
+
"resolved": "string",
|
|
80
|
+
"references": {}
|
|
81
|
+
}
|
|
82
|
+
}];
|
|
83
|
+
}
|
|
84
|
+
static get listeners() {
|
|
85
|
+
return [{
|
|
86
|
+
"name": "clickEvent",
|
|
87
|
+
"method": "onClicked",
|
|
88
|
+
"target": undefined,
|
|
89
|
+
"capture": false,
|
|
90
|
+
"passive": false
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Atoms/Button',
|
|
3
|
+
component: 'tttx-button',
|
|
4
|
+
argTypes: {
|
|
5
|
+
fontColor: {
|
|
6
|
+
control: {
|
|
7
|
+
type: 'select',
|
|
8
|
+
options: ['font-white', 'font-black'],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
buttonStyle: {
|
|
12
|
+
control: {
|
|
13
|
+
type: 'select',
|
|
14
|
+
options: ['primary-blue', 'secondary-white'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const Template = ({ content, fontColor, buttonStyle }) => `
|
|
20
|
+
<tttx-button font-color=${fontColor} button-style=${buttonStyle}
|
|
21
|
+
>
|
|
22
|
+
${content}
|
|
23
|
+
</tttx-button>
|
|
24
|
+
`;
|
|
25
|
+
export const Default = Template.bind({});
|
|
26
|
+
Default.args = {
|
|
27
|
+
content: 'My Button',
|
|
28
|
+
fontColor: 'font-white',
|
|
29
|
+
buttonStyle: 'primary-blue'
|
|
30
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
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";
|
|
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
|
+
.field {
|
|
23
|
+
clear: both;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
height: 36px;
|
|
31
|
+
border: 1px solid #c8c8c8;
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.icon-left,
|
|
36
|
+
.icon-right {
|
|
37
|
+
flex-basis: 24px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon-left span,
|
|
41
|
+
.icon-right span {
|
|
42
|
+
font-size: 24px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
text-align: center;
|
|
45
|
+
display: block;
|
|
46
|
+
width: 24px;
|
|
47
|
+
height: 24px;
|
|
48
|
+
margin-top: 4px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.icon-left span {
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.icon-right span {
|
|
56
|
+
margin-right: 4px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.input {
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
border: none;
|
|
62
|
+
outline: none;
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
padding: 8px 16px;
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.iconleft .input {
|
|
69
|
+
padding-left: 4px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.iconright .input {
|
|
73
|
+
padding-right: 4px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.label {
|
|
77
|
+
display: block;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
height: 18px;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
color: #212121;
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
margin-bottom: 4px;
|
|
84
|
+
z-index: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.disabled {
|
|
88
|
+
background: #f0f0f0;
|
|
89
|
+
color: #9e9e9e;
|
|
90
|
+
border-color: #c8c8c8;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.focused {
|
|
94
|
+
border-color: #1479c6;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.errormsg {
|
|
98
|
+
height: 16px;
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
align-items: center;
|
|
102
|
+
float: left;
|
|
103
|
+
margin-bottom: 16px;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
height: 26px;
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
color: white;
|
|
109
|
+
border-radius: none;
|
|
110
|
+
z-index: 2;
|
|
111
|
+
color: #DC0000;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.errormsg .validationicon {
|
|
115
|
+
width: 16px;
|
|
116
|
+
height: 16px;
|
|
117
|
+
font-size: 16px;
|
|
118
|
+
margin-right: 4px;
|
|
119
|
+
vertical-align: middle;
|
|
120
|
+
color: #DC0000;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.danger {
|
|
124
|
+
color: #DC0000;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.optional {
|
|
128
|
+
color: #757575;
|
|
129
|
+
font-weight: normal;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host {
|
|
133
|
+
display: block;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.spacing {
|
|
137
|
+
margin-bottom: 16px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.errorstate {
|
|
141
|
+
border-color: #DC0000;
|
|
142
|
+
}
|