@3t-transform/threeteeui 0.0.6 → 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 -5
- 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 -3
- package/dist/components/index.js +6 -4
- 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/tttx-single-input.d.ts +11 -0
- 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/atoms/tttx-text-box/tttx-text-box.stories.d.ts +6 -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 +128 -51
- 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/toolbar-656be6e6.js +0 -34259
- package/dist/cjs/tttx-icon.cjs.entry.js +0 -21
- package/dist/cjs/tttx-page.cjs.entry.js +0 -927
- package/dist/cjs/tttx-worksheet.cjs.entry.js +0 -47
- 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/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/tttx-icon.js +0 -37
- package/dist/components/tttx-page.js +0 -953
- package/dist/components/tttx-worksheet.js +0 -6
- package/dist/components/tttx-worksheet2.js +0 -34288
- package/dist/esm/toolbar-cede4385.js +0 -34231
- package/dist/esm/tttx-icon.entry.js +0 -17
- package/dist/esm/tttx-page.entry.js +0 -923
- package/dist/esm/tttx-worksheet.entry.js +0 -43
- package/dist/tttx/p-4b57de2e.entry.js +0 -1
- package/dist/tttx/p-61f78304.entry.js +0 -1
- package/dist/tttx/p-7244abd4.entry.js +0 -1
- package/dist/tttx/p-d038fe18.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/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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* tttx custom elements */
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
2
|
+
export { TttxButton as TttxButton } from '../types/components/atoms/tttx-button/tttx-button';
|
|
3
|
+
export { TttxCheckbox as TttxCheckbox } from '../types/components/atoms/ttx-checkbox/tttx-checkbox';
|
|
4
|
+
export { TttxForm as TttxForm } from '../types/components/molecules/tttx-form/tttx-form';
|
|
5
|
+
export { TttxSingleInput as TttxSingleInput } from '../types/components/atoms/tttx-single-input/tttx-single-input';
|
|
6
|
+
export { TttxTextBox as TttxTextBox } from '../types/components/atoms/tttx-text-box/tttx-text-box';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Used to manually set the base path where assets can be found.
|
|
@@ -15,6 +17,15 @@ export { TttxWorksheet as TttxWorksheet } from '../types/components/patterns/ttt
|
|
|
15
17
|
*/
|
|
16
18
|
export declare const setAssetPath: (path: string) => void;
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
22
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
23
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
24
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
25
|
+
* will result in the same behavior.
|
|
26
|
+
*/
|
|
27
|
+
export declare const setNonce: (nonce: string) => void
|
|
28
|
+
|
|
18
29
|
export interface SetPlatformOptions {
|
|
19
30
|
raf?: (c: FrameRequestCallback) => number;
|
|
20
31
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
export { TttxButton, defineCustomElement as defineCustomElementTttxButton } from './tttx-button.js';
|
|
3
|
+
export { TttxCheckbox, defineCustomElement as defineCustomElementTttxCheckbox } from './tttx-checkbox.js';
|
|
4
|
+
export { TttxForm, defineCustomElement as defineCustomElementTttxForm } from './tttx-form.js';
|
|
5
|
+
export { TttxSingleInput, defineCustomElement as defineCustomElementTttxSingleInput } from './tttx-single-input.js';
|
|
6
|
+
export { TttxTextBox, defineCustomElement as defineCustomElementTttxTextBox } from './tttx-text-box.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface TttxButton extends Components.TttxButton, HTMLElement {}
|
|
4
|
+
export const TttxButton: {
|
|
5
|
+
prototype: TttxButton;
|
|
6
|
+
new (): TttxButton;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
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}";
|
|
4
|
+
|
|
5
|
+
const TttxButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.clickEvent = createEvent(this, "clickEvent", 7);
|
|
11
|
+
this.fontColor = undefined;
|
|
12
|
+
this.buttonStyle = undefined;
|
|
13
|
+
}
|
|
14
|
+
onClick() {
|
|
15
|
+
this.clickEvent.emit('clicked');
|
|
16
|
+
}
|
|
17
|
+
onClicked(event) {
|
|
18
|
+
console.log('Picked up a clickEvent', event);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (h(Host, null, h("button", { onClick: this.onClick.bind(this), class: `button ${this.fontColor} ${this.buttonStyle}` }, h("span", null, h("slot", null)))));
|
|
22
|
+
}
|
|
23
|
+
static get style() { return tttxButtonCss; }
|
|
24
|
+
}, [1, "tttx-button", {
|
|
25
|
+
"fontColor": [1, "font-color"],
|
|
26
|
+
"buttonStyle": [1, "button-style"]
|
|
27
|
+
}, [[0, "clickEvent", "onClicked"]]]);
|
|
28
|
+
function defineCustomElement$1() {
|
|
29
|
+
if (typeof customElements === "undefined") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const components = ["tttx-button"];
|
|
33
|
+
components.forEach(tagName => { switch (tagName) {
|
|
34
|
+
case "tttx-button":
|
|
35
|
+
if (!customElements.get(tagName)) {
|
|
36
|
+
customElements.define(tagName, TttxButton$1);
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
} });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const TttxButton = TttxButton$1;
|
|
43
|
+
const defineCustomElement = defineCustomElement$1;
|
|
44
|
+
|
|
45
|
+
export { TttxButton, defineCustomElement };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface TttxCheckbox extends Components.TttxCheckbox, HTMLElement {}
|
|
4
|
+
export const TttxCheckbox: {
|
|
5
|
+
prototype: TttxCheckbox;
|
|
6
|
+
new (): TttxCheckbox;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
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}";
|
|
4
|
+
|
|
5
|
+
const TttxCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
11
|
+
this.value = undefined;
|
|
12
|
+
this.label = undefined;
|
|
13
|
+
this.required = undefined;
|
|
14
|
+
}
|
|
15
|
+
handleClick(event) {
|
|
16
|
+
const target = event.target;
|
|
17
|
+
this.value = target.checked;
|
|
18
|
+
this.valueChanged.emit(target.checked);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
|
|
22
|
+
}
|
|
23
|
+
static get style() { return tttxCheckboxCss; }
|
|
24
|
+
}, [1, "tttx-checkbox", {
|
|
25
|
+
"value": [4],
|
|
26
|
+
"label": [1],
|
|
27
|
+
"required": [4]
|
|
28
|
+
}]);
|
|
29
|
+
function defineCustomElement$1() {
|
|
30
|
+
if (typeof customElements === "undefined") {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const components = ["tttx-checkbox"];
|
|
34
|
+
components.forEach(tagName => { switch (tagName) {
|
|
35
|
+
case "tttx-checkbox":
|
|
36
|
+
if (!customElements.get(tagName)) {
|
|
37
|
+
customElements.define(tagName, TttxCheckbox$1);
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
} });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const TttxCheckbox = TttxCheckbox$1;
|
|
44
|
+
const defineCustomElement = defineCustomElement$1;
|
|
45
|
+
|
|
46
|
+
export { TttxCheckbox, defineCustomElement };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface TttxForm extends Components.TttxForm, HTMLElement {}
|
|
4
|
+
export const TttxForm: {
|
|
5
|
+
prototype: TttxForm;
|
|
6
|
+
new (): TttxForm;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const TttxForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.__registerHost();
|
|
7
|
+
this.__attachShadow();
|
|
8
|
+
this.formSubmit = createEvent(this, "formSubmit", 7);
|
|
9
|
+
this.fetchFormData = () => {
|
|
10
|
+
let validForm = true;
|
|
11
|
+
const formData = {};
|
|
12
|
+
const elements = this.el.querySelectorAll(`[${this.dataAttribute}]`);
|
|
13
|
+
elements.forEach((element) => {
|
|
14
|
+
const inputElement = element;
|
|
15
|
+
validForm = validForm ? this.validateFormField(inputElement) : false;
|
|
16
|
+
formData[inputElement.getAttribute(this.dataAttribute)] = inputElement.value;
|
|
17
|
+
});
|
|
18
|
+
return validForm ? formData : null;
|
|
19
|
+
};
|
|
20
|
+
this.dataAttribute = 'form-data';
|
|
21
|
+
this.functionAttribute = 'function-data';
|
|
22
|
+
}
|
|
23
|
+
validateFormField(element) {
|
|
24
|
+
let isValid = true;
|
|
25
|
+
const isRequired = element.hasAttribute("required");
|
|
26
|
+
if (isRequired && !element.value) {
|
|
27
|
+
// required and not set, show error
|
|
28
|
+
element.setAttribute("showerrormsg", "true");
|
|
29
|
+
isValid = false;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// required and set, ensure error does not show
|
|
33
|
+
element.removeAttribute("showerrormsg");
|
|
34
|
+
}
|
|
35
|
+
return isValid;
|
|
36
|
+
}
|
|
37
|
+
componentDidLoad() {
|
|
38
|
+
const elements = this.el.querySelectorAll(`[${this.functionAttribute}]`);
|
|
39
|
+
elements.forEach((element) => {
|
|
40
|
+
element.addEventListener('click', event => {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
const formData = this.fetchFormData();
|
|
43
|
+
if (formData) {
|
|
44
|
+
// only emit event if form data is valid
|
|
45
|
+
this.formSubmit.emit(this.fetchFormData());
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (h("div", null, h("slot", null)));
|
|
52
|
+
}
|
|
53
|
+
get el() { return this; }
|
|
54
|
+
}, [1, "tttx-form", {
|
|
55
|
+
"dataAttribute": [1, "data-attribute"],
|
|
56
|
+
"functionAttribute": [1, "function-attribute"]
|
|
57
|
+
}]);
|
|
58
|
+
function defineCustomElement$1() {
|
|
59
|
+
if (typeof customElements === "undefined") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const components = ["tttx-form"];
|
|
63
|
+
components.forEach(tagName => { switch (tagName) {
|
|
64
|
+
case "tttx-form":
|
|
65
|
+
if (!customElements.get(tagName)) {
|
|
66
|
+
customElements.define(tagName, TttxForm$1);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
} });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const TttxForm = TttxForm$1;
|
|
73
|
+
const defineCustomElement = defineCustomElement$1;
|
|
74
|
+
|
|
75
|
+
export { TttxForm, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TttxSingleInput extends Components.TttxSingleInput, HTMLElement {}
|
|
4
|
+
export const TttxSingleInput: {
|
|
5
|
+
prototype: TttxSingleInput;
|
|
6
|
+
new (): TttxSingleInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
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}";
|
|
4
|
+
|
|
5
|
+
const TttxSingleInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
11
|
+
this.handleFocus = () => {
|
|
12
|
+
this.isfocused = true;
|
|
13
|
+
};
|
|
14
|
+
this.handleBlur = () => {
|
|
15
|
+
this.isfocused = false;
|
|
16
|
+
};
|
|
17
|
+
this.isfocused = false;
|
|
18
|
+
this.label = undefined;
|
|
19
|
+
this.valid = undefined;
|
|
20
|
+
this.showerrormsg = undefined;
|
|
21
|
+
this.errormsg = undefined;
|
|
22
|
+
this.value = undefined;
|
|
23
|
+
this.type = 'text';
|
|
24
|
+
this.placeholder = undefined;
|
|
25
|
+
this.pattern = undefined;
|
|
26
|
+
this.iconleft = undefined;
|
|
27
|
+
this.iconright = undefined;
|
|
28
|
+
this.required = undefined;
|
|
29
|
+
}
|
|
30
|
+
handleChange(event) {
|
|
31
|
+
const target = event.target;
|
|
32
|
+
this.value = target.value;
|
|
33
|
+
this.valueChanged.emit(target.value);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : '', this.iconleft ? 'iconleft' : ''].join(' ');
|
|
37
|
+
return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("div", { class: inputClass }, this.iconleft && (h("div", { class: "icon-left" }, h("span", { class: "material-symbols-rounded" }, this.iconleft))), 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 && (h("div", { class: "icon-right" }, h("span", { class: "material-symbols-rounded" }, this.iconright)))), this.showerrormsg && this.errormsg && h("div", { class: "errormsg" }, h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
38
|
+
}
|
|
39
|
+
static get style() { return tttxSingleInputCss; }
|
|
40
|
+
}, [1, "tttx-single-input", {
|
|
41
|
+
"label": [1],
|
|
42
|
+
"valid": [4],
|
|
43
|
+
"showerrormsg": [4],
|
|
44
|
+
"errormsg": [1],
|
|
45
|
+
"value": [1025],
|
|
46
|
+
"type": [1],
|
|
47
|
+
"placeholder": [1],
|
|
48
|
+
"pattern": [1],
|
|
49
|
+
"iconleft": [1],
|
|
50
|
+
"iconright": [1],
|
|
51
|
+
"required": [4],
|
|
52
|
+
"isfocused": [32]
|
|
53
|
+
}]);
|
|
54
|
+
function defineCustomElement$1() {
|
|
55
|
+
if (typeof customElements === "undefined") {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const components = ["tttx-single-input"];
|
|
59
|
+
components.forEach(tagName => { switch (tagName) {
|
|
60
|
+
case "tttx-single-input":
|
|
61
|
+
if (!customElements.get(tagName)) {
|
|
62
|
+
customElements.define(tagName, TttxSingleInput$1);
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
} });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const TttxSingleInput = TttxSingleInput$1;
|
|
69
|
+
const defineCustomElement = defineCustomElement$1;
|
|
70
|
+
|
|
71
|
+
export { TttxSingleInput, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TttxTextBox extends Components.TttxTextBox, HTMLElement {}
|
|
4
|
+
export const TttxTextBox: {
|
|
5
|
+
prototype: TttxTextBox;
|
|
6
|
+
new (): TttxTextBox;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
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}";
|
|
4
|
+
|
|
5
|
+
const TttxTextBox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
11
|
+
this.handleFocus = () => {
|
|
12
|
+
this.isfocused = true;
|
|
13
|
+
};
|
|
14
|
+
this.handleBlur = () => {
|
|
15
|
+
this.isfocused = false;
|
|
16
|
+
};
|
|
17
|
+
this.label = undefined;
|
|
18
|
+
this.showerrormsg = undefined;
|
|
19
|
+
this.errormsg = undefined;
|
|
20
|
+
this.required = undefined;
|
|
21
|
+
this.value = undefined;
|
|
22
|
+
this.isfocused = false;
|
|
23
|
+
}
|
|
24
|
+
handleChange(event) {
|
|
25
|
+
const target = event.target;
|
|
26
|
+
this.value = target.value;
|
|
27
|
+
this.valueChanged.emit(target.value);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : ''].join(' ');
|
|
31
|
+
return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("div", { class: inputClass }, 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 && h("div", { class: "errormsg" }, this.errormsg))));
|
|
32
|
+
}
|
|
33
|
+
static get style() { return tttxTextBoxCss; }
|
|
34
|
+
}, [1, "tttx-text-box", {
|
|
35
|
+
"label": [1],
|
|
36
|
+
"showerrormsg": [4],
|
|
37
|
+
"errormsg": [1],
|
|
38
|
+
"required": [4],
|
|
39
|
+
"value": [1025],
|
|
40
|
+
"isfocused": [32]
|
|
41
|
+
}]);
|
|
42
|
+
function defineCustomElement$1() {
|
|
43
|
+
if (typeof customElements === "undefined") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const components = ["tttx-text-box"];
|
|
47
|
+
components.forEach(tagName => { switch (tagName) {
|
|
48
|
+
case "tttx-text-box":
|
|
49
|
+
if (!customElements.get(tagName)) {
|
|
50
|
+
customElements.define(tagName, TttxTextBox$1);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
} });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const TttxTextBox = TttxTextBox$1;
|
|
57
|
+
const defineCustomElement = defineCustomElement$1;
|
|
58
|
+
|
|
59
|
+
export { TttxTextBox, defineCustomElement };
|