@3t-transform/threeteeui 0.1.59 → 0.1.61

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.
Files changed (52) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tttx-button.cjs.entry.js +5 -3
  3. package/dist/cjs/tttx-form.cjs.entry.js +1 -1
  4. package/dist/cjs/tttx-select-box.cjs.entry.js +79 -0
  5. package/dist/cjs/tttx-tree-view.cjs.entry.js +92 -0
  6. package/dist/cjs/tttx.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +3 -1
  8. package/dist/collection/components/atoms/tttx-button/tttx-button.css +20 -0
  9. package/dist/collection/components/atoms/tttx-button/tttx-button.js +22 -2
  10. package/dist/collection/components/molecules/tttx-form/tttx-form.css +20 -0
  11. package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.css +89 -0
  12. package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.js +235 -0
  13. package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.stories.js +69 -0
  14. package/dist/collection/components/molecules/tttx-tree-view/helper/helper.js +1 -0
  15. package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.css +72 -0
  16. package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.js +140 -0
  17. package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.stories.js +698 -0
  18. package/dist/components/index.d.ts +2 -0
  19. package/dist/components/index.js +2 -0
  20. package/dist/components/tttx-button2.js +6 -3
  21. package/dist/components/tttx-form.js +1 -1
  22. package/dist/components/tttx-select-box.d.ts +11 -0
  23. package/dist/components/tttx-select-box.js +113 -0
  24. package/dist/components/tttx-standalone-input.js +1 -136
  25. package/dist/components/tttx-standalone-input2.js +138 -0
  26. package/dist/components/tttx-tree-view.d.ts +11 -0
  27. package/dist/components/tttx-tree-view.js +120 -0
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/esm/tttx-button.entry.js +5 -3
  30. package/dist/esm/tttx-form.entry.js +1 -1
  31. package/dist/esm/tttx-select-box.entry.js +75 -0
  32. package/dist/esm/tttx-tree-view.entry.js +88 -0
  33. package/dist/esm/tttx.js +1 -1
  34. package/dist/tttx/p-2f066b53.entry.js +1 -0
  35. package/dist/tttx/p-3c7e11d9.entry.js +1 -0
  36. package/dist/tttx/{p-5a4eacd9.entry.js → p-57621fdb.entry.js} +1 -1
  37. package/dist/tttx/p-f94b26dc.entry.js +1 -0
  38. package/dist/tttx/tttx.esm.js +1 -1
  39. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +1 -0
  40. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +1 -1
  41. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +1 -1
  42. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +1 -1
  43. package/dist/types/components/molecules/tttx-select-box/interfaces.d.ts +5 -0
  44. package/dist/types/components/molecules/tttx-select-box/tttx-select-box.d.ts +23 -0
  45. package/dist/types/components/molecules/tttx-select-box/tttx-select-box.stories.d.ts +7 -0
  46. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +1 -1
  47. package/dist/types/components/molecules/tttx-tree-view/helper/helper.d.ts +14 -0
  48. package/dist/types/components/molecules/tttx-tree-view/tttx-tree-view.d.ts +14 -0
  49. package/dist/types/components/molecules/tttx-tree-view/tttx-tree-view.stories.d.ts +20 -0
  50. package/dist/types/components.d.ts +53 -0
  51. package/package.json +1 -1
  52. package/dist/tttx/p-28d80500.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$1 } from './tttx-icon2.js';
3
3
 
4
- const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}button{cursor:pointer}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;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-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:inline-block}tttx-icon{cursor:inherit}.spacingleft{margin-left:8px}";
4
+ const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}button{cursor:pointer}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;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-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:inline-block}tttx-icon{cursor:inherit}.spacingleft{margin-left:8px}";
5
5
 
6
6
  const TttxButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
@@ -12,19 +12,21 @@ const TttxButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  this.notext = undefined;
13
13
  this.icon = undefined;
14
14
  this.iconposition = 'left';
15
+ this.iconcolor = 'black';
15
16
  this.design = 'default';
16
17
  }
17
18
  componentWillLoad() {
18
19
  this._design = this.design;
19
- const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
20
+ const designs = ['primary', 'default', 'disabled', 'danger', 'borderless', 'borderless-circle'];
20
21
  if (!designs.includes(this.design)) {
21
22
  this._design = 'default';
22
23
  }
23
24
  if (this._design === 'primary' || this._design === 'danger') {
24
- this._iconcolor = 'white';
25
+ this.iconcolor = 'white';
25
26
  }
26
27
  }
27
28
  render() {
29
+ this._iconcolor = this.iconcolor;
28
30
  return (h(Host, null, h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (h("div", { class: "icon-left" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && h("div", { class: "button-content" }, h("slot", null)), this.icon && this.iconposition === 'right' && (h("div", { class: "icon-right" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
29
31
  }
30
32
  static get style() { return tttxButtonCss; }
@@ -32,6 +34,7 @@ const TttxButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
32
34
  "notext": [4],
33
35
  "icon": [1],
34
36
  "iconposition": [1],
37
+ "iconcolor": [1025],
35
38
  "design": [1]
36
39
  }]);
37
40
  function defineCustomElement() {
@@ -99,7 +99,7 @@ function setErrorState(target, hasError, errorMessage) {
99
99
  }
100
100
  }
101
101
 
102
- const tttxFormCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.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:normal;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}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.input-icon{position:absolute;margin-top:9px;margin-left:4px}.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;line-height:16px;border-radius:none;z-index:2;color:#dc0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;line-height:19px;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.inputInline{display:flex;white-space:nowrap;align-items:center}label.inputInline .input-container{margin:0 4px;width:100%;display:flex;align-items:center;gap:4px;position:relative}label{font-weight:500;font-size:16px;line-height:19px;margin-bottom:16px}input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;line-height:19px;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}@media (max-width: 600px){input[type=date]{padding-top:6px}}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}.input-icon~input{padding:0 32px}input~.errorBubble{position:relative;font-size:14px;line-height:16px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center;margin-top:4px}input~.errorBubble:not(.visible){display:none}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000}input:focus{border-color:#1479c6}input:focus-visible{outline:none}.secondarylabel{color:#757575;font-size:14px;line-height:16px;font-weight:normal;display:flex;margin-top:4px}label.inputBlock.readonly{pointer-events:none;user-select:none;color:gray}input[readonly]{cursor:default;pointer-events:none;user-select:none;color:gray}button{cursor:pointer}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;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-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:block}fieldset{margin:0;padding:0;border:none}label.inputBlock.inlineBlock{display:inline-block}.inlineLabel{font-weight:400;display:inline-block;vertical-align:top;padding-top:4px}input[type=checkbox]{width:18px;height:18px}input~label{font-weight:400}select{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}.placeholder{color:#9e9e9e}.placeholder option{color:initial}select.invalid:invalid{border:1px solid #dc0000}select~.errorBubble{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}select~.errorBubble:not(.visible){visibility:hidden}select~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}select.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}select:focus{border-color:#1479c6}select:focus-visible{outline:none}.button{padding:0 16px}.footer{display:flex;gap:16px;flex-direction:row-reverse}";
102
+ const tttxFormCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.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:normal;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}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.input-icon{position:absolute;margin-top:9px;margin-left:4px}.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;line-height:16px;border-radius:none;z-index:2;color:#dc0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;line-height:19px;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.inputInline{display:flex;white-space:nowrap;align-items:center}label.inputInline .input-container{margin:0 4px;width:100%;display:flex;align-items:center;gap:4px;position:relative}label{font-weight:500;font-size:16px;line-height:19px;margin-bottom:16px}input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;line-height:19px;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}@media (max-width: 600px){input[type=date]{padding-top:6px}}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}.input-icon~input{padding:0 32px}input~.errorBubble{position:relative;font-size:14px;line-height:16px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center;margin-top:4px}input~.errorBubble:not(.visible){display:none}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000}input:focus{border-color:#1479c6}input:focus-visible{outline:none}.secondarylabel{color:#757575;font-size:14px;line-height:16px;font-weight:normal;display:flex;margin-top:4px}label.inputBlock.readonly{pointer-events:none;user-select:none;color:gray}input[readonly]{cursor:default;pointer-events:none;user-select:none;color:gray}button{cursor:pointer}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;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-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:block}fieldset{margin:0;padding:0;border:none}label.inputBlock.inlineBlock{display:inline-block}.inlineLabel{font-weight:400;display:inline-block;vertical-align:top;padding-top:4px}input[type=checkbox]{width:18px;height:18px}input~label{font-weight:400}select{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}.placeholder{color:#9e9e9e}.placeholder option{color:initial}select.invalid:invalid{border:1px solid #dc0000}select~.errorBubble{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}select~.errorBubble:not(.visible){visibility:hidden}select~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}select.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}select:focus{border-color:#1479c6}select:focus-visible{outline:none}.button{padding:0 16px}.footer{display:flex;gap:16px;flex-direction:row-reverse}";
103
103
 
104
104
  const TttxForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
105
105
  constructor() {
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface TttxSelectBox extends Components.TttxSelectBox, HTMLElement {}
4
+ export const TttxSelectBox: {
5
+ prototype: TttxSelectBox;
6
+ new (): TttxSelectBox;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,113 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
3
+ import { d as defineCustomElement$3 } from './tttx-icon2.js';
4
+ import { d as defineCustomElement$2 } from './tttx-standalone-input2.js';
5
+
6
+ const tttxSelectBoxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:flex;gap:4px}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border:1px solid #d5d5d5;border-radius:4px}.dropdown-selector{align-items:center;gap:8px;padding:8px 8px 8px 16px;cursor:pointer}.dropdown-selector-chevron{margin-left:auto;height:24px}.dropdown-body{display:flex;flex-direction:column;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px}.dropdown-body.search{max-height:410px}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;max-height:368px}.dropdown-option{padding:8px 8px 8px 16px;cursor:pointer}.dropdown-option:hover{background-color:#1111110D}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#9e9e9e}.searchbox{padding:8px 16px 0 16px}.searchbox tttx-standalone-input{margin-top:-4px}.hidden{display:none}";
7
+
8
+ const TttxSelectBox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.selectItemEvent = createEvent(this, "selectItemEvent", 3);
14
+ this.toggleOpen = createEvent(this, "toggleOpen", 3);
15
+ this.optionsData = null;
16
+ this.label = undefined;
17
+ this.inline = undefined;
18
+ this.placeholder = '';
19
+ this.searchEnabled = undefined;
20
+ this.open = false;
21
+ this.selectedItem = undefined;
22
+ this.searchTerm = '';
23
+ }
24
+ handleCloseSelectBox() {
25
+ this.open = false;
26
+ }
27
+ handleBlur() {
28
+ this.open = false;
29
+ this.toggleOpen.emit(false);
30
+ }
31
+ onDropdownClicked() {
32
+ this.open = !this.open;
33
+ this.searchTerm = '';
34
+ this.toggleOpen.emit(this.open);
35
+ }
36
+ onItemSelected(option) {
37
+ this.selectedItem = option;
38
+ this.selectItemEvent.emit(this.selectedItem);
39
+ this.el.blur();
40
+ }
41
+ dropdownSelectorContent() {
42
+ if (!this.selectedItem)
43
+ return h("div", { class: "placeholder" }, this.placeholder);
44
+ return h("div", null, this.selectedItem.label);
45
+ }
46
+ dropdownOption(option) {
47
+ /* istanbul ignore next */
48
+ const hideOption = this.searchEnabled && option.label.toLowerCase().indexOf(this.searchTerm.toLowerCase()) === -1;
49
+ const selected = this.selectedItem && option.value === this.selectedItem.value;
50
+ if (option.html) {
51
+ const sanitisedHTML = purify.sanitize(option.html, domSanitiserOptions);
52
+ /* istanbul ignore next */
53
+ return (h("div", { class: `dropdown-option ${hideOption ? 'hidden' : ''} ${selected ? 'selected' : ''}`, onClick: this.onItemSelected.bind(this, option), key: option.label, innerHTML: sanitisedHTML }));
54
+ }
55
+ /* istanbul ignore next */
56
+ return (h("div", { class: `dropdown-option ${hideOption ? 'hidden' : ''} ${selected ? 'selected' : ''}`, onClick: this.onItemSelected.bind(this, option), key: option.label }, option.label));
57
+ }
58
+ /* istanbul ignore next */
59
+ handleSearchInput(event) {
60
+ const target = event.target;
61
+ this.searchTerm = target.value;
62
+ }
63
+ render() {
64
+ if (!this.optionsData)
65
+ return;
66
+ const parsedOptionsData = typeof this.optionsData === 'string' ? JSON.parse(this.optionsData) : this.optionsData;
67
+ const chevronIcon = this.open ? 'expand_less' : 'expand_more';
68
+ return (h(Host, { class: this.inline ? 'inline' : 'block' }, this.label && h("div", { class: "label" }, this.label), h("div", { tabindex: "0", class: "dropdown-container" }, h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, this.dropdownSelectorContent(), h("div", { class: "dropdown-selector-chevron" }, h("tttx-icon", { icon: chevronIcon, color: "black" }))), this.open && (h("div", { class: "dropdown-body" }, this.searchEnabled &&
69
+ /* istanbul ignore next */
70
+ h("div", { class: "searchbox" }, h("tttx-standalone-input", { type: "text", label: "", required: true, showerrorbubble: false, iconleft: 'search', onInput: this.handleSearchInput.bind(this) })), h("div", { class: "dropdown-options-list" }, parsedOptionsData.map((option) => {
71
+ return this.dropdownOption(option);
72
+ })))))));
73
+ }
74
+ get el() { return this; }
75
+ static get style() { return tttxSelectBoxCss; }
76
+ }, [1, "tttx-select-box", {
77
+ "optionsData": [1, "options-data"],
78
+ "label": [1],
79
+ "inline": [4],
80
+ "placeholder": [1],
81
+ "searchEnabled": [4, "search-enabled"],
82
+ "open": [32],
83
+ "selectedItem": [32],
84
+ "searchTerm": [32]
85
+ }, [[0, "closeSelectBox", "handleCloseSelectBox"], [0, "blur", "handleBlur"]]]);
86
+ function defineCustomElement$1() {
87
+ if (typeof customElements === "undefined") {
88
+ return;
89
+ }
90
+ const components = ["tttx-select-box", "tttx-icon", "tttx-standalone-input"];
91
+ components.forEach(tagName => { switch (tagName) {
92
+ case "tttx-select-box":
93
+ if (!customElements.get(tagName)) {
94
+ customElements.define(tagName, TttxSelectBox$1);
95
+ }
96
+ break;
97
+ case "tttx-icon":
98
+ if (!customElements.get(tagName)) {
99
+ defineCustomElement$3();
100
+ }
101
+ break;
102
+ case "tttx-standalone-input":
103
+ if (!customElements.get(tagName)) {
104
+ defineCustomElement$2();
105
+ }
106
+ break;
107
+ } });
108
+ }
109
+
110
+ const TttxSelectBox = TttxSelectBox$1;
111
+ const defineCustomElement = defineCustomElement$1;
112
+
113
+ export { TttxSelectBox, defineCustomElement };
@@ -1,139 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
-
4
- 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-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:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.icon-left.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input{flex-basis:24px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-left:4px}.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-right:4px}.icon-right.sc-tttx-standalone-input{margin-top:5px}.icon-left.sc-tttx-standalone-input{margin-top:5px;margin-left:4px}.iconleft.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-left:4px}.iconright.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-right:4px}.input-icon.sc-tttx-standalone-input{position:absolute;margin-top:9px;margin-left:4px}.errormsg.sc-tttx-standalone-input{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;line-height:16px;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;line-height:19px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger.sc-tttx-standalone-input{color:#dc0000}.optional.sc-tttx-standalone-input{color:#757575;font-weight:normal}label.inputBlock.sc-tttx-standalone-input{display:block;position:relative;line-height:21px}label.inputInline.sc-tttx-standalone-input{display:flex;white-space:nowrap;align-items:center}label.inputInline.sc-tttx-standalone-input .input-container.sc-tttx-standalone-input{margin:0 4px;width:100%;display:flex;align-items:center;gap:4px;position:relative}label.sc-tttx-standalone-input{font-weight:500;font-size:16px;line-height:19px;margin-bottom: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;line-height:19px;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}@media (max-width: 600px){input[type=date].sc-tttx-standalone-input{padding-top:6px}}input.invalid.sc-tttx-standalone-input:invalid,input.standalone.invalid.sc-tttx-standalone-input{border:1px solid #dc0000}.input-icon.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding:0 32px}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input{position:relative;font-size:14px;line-height:16px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center;margin-top:4px}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input:not(.visible){display:none}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input span.sc-tttx-standalone-input{color:#dc0000;font-size:16px;margin-right:4px}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}input.sc-tttx-standalone-input:focus{border-color:#1479c6}input.sc-tttx-standalone-input:focus-visible{outline:none}.secondarylabel.sc-tttx-standalone-input{color:#757575;font-size:14px;line-height:16px;font-weight:normal;display:flex;margin-top:4px}label.inputBlock.readonly.sc-tttx-standalone-input{pointer-events:none;user-select:none;color:gray}input[readonly].sc-tttx-standalone-input{cursor:default;pointer-events:none;user-select:none;color:gray}.sc-tttx-standalone-input-h{display:block}.input-container.sc-tttx-standalone-input{position:relative}#icon-left.sc-tttx-standalone-input{position:absolute;left:8px;top:10px}#icon-left.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding-left:36px}#icon-right.sc-tttx-standalone-input{position:absolute;right:8px;top:10px}#icon-right.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding-right:36px}";
5
-
6
- const TttxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
- constructor() {
8
- super();
9
- this.__registerHost();
10
- this.valueChanged = createEvent(this, "valueChanged", 7);
11
- this.focusChanged = createEvent(this, "focusChanged", 7);
12
- this.blurChanged = createEvent(this, "blurChanged", 7);
13
- this.invalidChanged = createEvent(this, "invalidChanged", 7);
14
- this.inputIconClick = createEvent(this, "inputIconClick", 7);
15
- this.leftIconClick = createEvent(this, "leftIconClick", 7);
16
- this.rightIconClick = createEvent(this, "rightIconClick", 7);
17
- this.label = undefined;
18
- this.secondarylabel = undefined;
19
- this.showerrormsg = undefined;
20
- this.showerrorbubble = true;
21
- this.errormsg = undefined;
22
- this.iconleft = undefined;
23
- this.iconleftcolor = 'grey';
24
- this.iconright = undefined;
25
- this.iconrightcolor = 'grey';
26
- this.inputicon = undefined;
27
- this.inputiconcolor = 'grey';
28
- this.inline = undefined;
29
- this.inputautocapitalize = undefined;
30
- this.inputautofocus = undefined;
31
- this.inputkeyhint = undefined;
32
- this.inputindex = undefined;
33
- this.inputtitle = undefined;
34
- this.autocomplete = undefined;
35
- this.checked = undefined;
36
- this.disabled = undefined;
37
- this.max = undefined;
38
- this.maxlength = undefined;
39
- this.min = undefined;
40
- this.minlength = undefined;
41
- this.name = undefined;
42
- this.pattern = undefined;
43
- this.placeholder = undefined;
44
- this.readonly = undefined;
45
- this.required = undefined;
46
- this.step = undefined;
47
- this.type = 'text';
48
- this.value = undefined;
49
- }
50
- handleChange(event) {
51
- const target = event.target;
52
- this.value = target.value;
53
- this.valueChanged.emit(target.value);
54
- }
55
- handleFocus(event) {
56
- const target = event.target;
57
- this.focusChanged.emit(target.value);
58
- }
59
- handleBlur(event) {
60
- const target = event.target;
61
- this.blurChanged.emit(target.value);
62
- }
63
- handleInvalid(event) {
64
- event.preventDefault();
65
- const target = event.target;
66
- this.invalidChanged.emit(target.value);
67
- }
68
- handleInputIconClick(event) {
69
- event.preventDefault();
70
- this.inputIconClick.emit();
71
- }
72
- handleLeftIconClick(event) {
73
- event.preventDefault();
74
- this.leftIconClick.emit();
75
- }
76
- handleRightIconClick(event) {
77
- event.preventDefault();
78
- this.rightIconClick.emit();
79
- }
80
- render() {
81
- const classNames = ['standalone', this.showerrormsg ? 'invalid' : ''].join(' ');
82
- return (h(Host, null, h("label", { class: this.inline ? 'inputInline' : 'inputBlock' }, this.label, !this.required ? h("span", { class: "optional" }, "\u00A0(optional)") : '', h("div", { class: "input-container" }, this.inputicon && (h("tttx-icon", { class: "input-icon", icon: this.inputicon, color: this.inputiconcolor, onClick: this.handleInputIconClick.bind(this) })), this.iconleft && (h("tttx-icon", { id: "icon-left", icon: this.iconleft, color: this.iconleftcolor, onClick: this.handleLeftIconClick.bind(this) })), this.iconright && (h("tttx-icon", { id: "icon-right", icon: this.iconright, color: this.iconrightcolor, onClick: this.handleRightIconClick.bind(this) })), h("input", { class: classNames, autocapitalize: this.inputautocapitalize, autofocus: this.inputautofocus, enterkeyhint: this.inputkeyhint, tabindex: this.inputindex, title: this.inputtitle, autocomplete: this.autocomplete, checked: this.checked, disabled: this.disabled, max: this.max, maxlength: this.maxlength, min: this.min, minlength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readonly: this.readonly, required: this.required, step: this.step, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this), onInvalid: this.handleInvalid.bind(this) }), this.secondarylabel && h("span", { class: "secondarylabel" }, this.secondarylabel), this.showerrorbubble && (h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))))));
83
- }
84
- static get style() { return tttxStandaloneInputCss; }
85
- }, [2, "tttx-standalone-input", {
86
- "label": [1],
87
- "secondarylabel": [1],
88
- "showerrormsg": [4],
89
- "showerrorbubble": [4],
90
- "errormsg": [1],
91
- "iconleft": [1],
92
- "iconleftcolor": [1],
93
- "iconright": [1],
94
- "iconrightcolor": [1],
95
- "inputicon": [1],
96
- "inputiconcolor": [1],
97
- "inline": [4],
98
- "inputautocapitalize": [1],
99
- "inputautofocus": [4],
100
- "inputkeyhint": [1],
101
- "inputindex": [8],
102
- "inputtitle": [1],
103
- "autocomplete": [1],
104
- "checked": [4],
105
- "disabled": [4],
106
- "max": [8],
107
- "maxlength": [8],
108
- "min": [8],
109
- "minlength": [8],
110
- "name": [1],
111
- "pattern": [1],
112
- "placeholder": [1],
113
- "readonly": [8],
114
- "required": [4],
115
- "step": [8],
116
- "type": [1],
117
- "value": [1032]
118
- }]);
119
- function defineCustomElement$1() {
120
- if (typeof customElements === "undefined") {
121
- return;
122
- }
123
- const components = ["tttx-standalone-input", "tttx-icon"];
124
- components.forEach(tagName => { switch (tagName) {
125
- case "tttx-standalone-input":
126
- if (!customElements.get(tagName)) {
127
- customElements.define(tagName, TttxInput);
128
- }
129
- break;
130
- case "tttx-icon":
131
- if (!customElements.get(tagName)) {
132
- defineCustomElement$2();
133
- }
134
- break;
135
- } });
136
- }
1
+ import { T as TttxInput, d as defineCustomElement$1 } from './tttx-standalone-input2.js';
137
2
 
138
3
  const TttxStandaloneInput = TttxInput;
139
4
  const defineCustomElement = defineCustomElement$1;
@@ -0,0 +1,138 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$1 } from './tttx-icon2.js';
3
+
4
+ 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-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:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.icon-left.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input{flex-basis:24px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-left:4px}.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-right:4px}.icon-right.sc-tttx-standalone-input{margin-top:5px}.icon-left.sc-tttx-standalone-input{margin-top:5px;margin-left:4px}.iconleft.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-left:4px}.iconright.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-right:4px}.input-icon.sc-tttx-standalone-input{position:absolute;margin-top:9px;margin-left:4px}.errormsg.sc-tttx-standalone-input{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;line-height:16px;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;line-height:19px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger.sc-tttx-standalone-input{color:#dc0000}.optional.sc-tttx-standalone-input{color:#757575;font-weight:normal}label.inputBlock.sc-tttx-standalone-input{display:block;position:relative;line-height:21px}label.inputInline.sc-tttx-standalone-input{display:flex;white-space:nowrap;align-items:center}label.inputInline.sc-tttx-standalone-input .input-container.sc-tttx-standalone-input{margin:0 4px;width:100%;display:flex;align-items:center;gap:4px;position:relative}label.sc-tttx-standalone-input{font-weight:500;font-size:16px;line-height:19px;margin-bottom: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;line-height:19px;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}@media (max-width: 600px){input[type=date].sc-tttx-standalone-input{padding-top:6px}}input.invalid.sc-tttx-standalone-input:invalid,input.standalone.invalid.sc-tttx-standalone-input{border:1px solid #dc0000}.input-icon.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding:0 32px}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input{position:relative;font-size:14px;line-height:16px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center;margin-top:4px}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input:not(.visible){display:none}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input span.sc-tttx-standalone-input{color:#dc0000;font-size:16px;margin-right:4px}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}input.sc-tttx-standalone-input:focus{border-color:#1479c6}input.sc-tttx-standalone-input:focus-visible{outline:none}.secondarylabel.sc-tttx-standalone-input{color:#757575;font-size:14px;line-height:16px;font-weight:normal;display:flex;margin-top:4px}label.inputBlock.readonly.sc-tttx-standalone-input{pointer-events:none;user-select:none;color:gray}input[readonly].sc-tttx-standalone-input{cursor:default;pointer-events:none;user-select:none;color:gray}.sc-tttx-standalone-input-h{display:block}.input-container.sc-tttx-standalone-input{position:relative}#icon-left.sc-tttx-standalone-input{position:absolute;left:8px;top:10px}#icon-left.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding-left:36px}#icon-right.sc-tttx-standalone-input{position:absolute;right:8px;top:10px}#icon-right.sc-tttx-standalone-input~input.sc-tttx-standalone-input{padding-right:36px}";
5
+
6
+ const TttxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.valueChanged = createEvent(this, "valueChanged", 7);
11
+ this.focusChanged = createEvent(this, "focusChanged", 7);
12
+ this.blurChanged = createEvent(this, "blurChanged", 7);
13
+ this.invalidChanged = createEvent(this, "invalidChanged", 7);
14
+ this.inputIconClick = createEvent(this, "inputIconClick", 7);
15
+ this.leftIconClick = createEvent(this, "leftIconClick", 7);
16
+ this.rightIconClick = createEvent(this, "rightIconClick", 7);
17
+ this.label = undefined;
18
+ this.secondarylabel = undefined;
19
+ this.showerrormsg = undefined;
20
+ this.showerrorbubble = true;
21
+ this.errormsg = undefined;
22
+ this.iconleft = undefined;
23
+ this.iconleftcolor = 'grey';
24
+ this.iconright = undefined;
25
+ this.iconrightcolor = 'grey';
26
+ this.inputicon = undefined;
27
+ this.inputiconcolor = 'grey';
28
+ this.inline = undefined;
29
+ this.inputautocapitalize = undefined;
30
+ this.inputautofocus = undefined;
31
+ this.inputkeyhint = undefined;
32
+ this.inputindex = undefined;
33
+ this.inputtitle = undefined;
34
+ this.autocomplete = undefined;
35
+ this.checked = undefined;
36
+ this.disabled = undefined;
37
+ this.max = undefined;
38
+ this.maxlength = undefined;
39
+ this.min = undefined;
40
+ this.minlength = undefined;
41
+ this.name = undefined;
42
+ this.pattern = undefined;
43
+ this.placeholder = undefined;
44
+ this.readonly = undefined;
45
+ this.required = undefined;
46
+ this.step = undefined;
47
+ this.type = 'text';
48
+ this.value = undefined;
49
+ }
50
+ handleChange(event) {
51
+ const target = event.target;
52
+ this.value = target.value;
53
+ this.valueChanged.emit(target.value);
54
+ }
55
+ handleFocus(event) {
56
+ const target = event.target;
57
+ this.focusChanged.emit(target.value);
58
+ }
59
+ handleBlur(event) {
60
+ const target = event.target;
61
+ this.blurChanged.emit(target.value);
62
+ }
63
+ handleInvalid(event) {
64
+ event.preventDefault();
65
+ const target = event.target;
66
+ this.invalidChanged.emit(target.value);
67
+ }
68
+ handleInputIconClick(event) {
69
+ event.preventDefault();
70
+ this.inputIconClick.emit();
71
+ }
72
+ handleLeftIconClick(event) {
73
+ event.preventDefault();
74
+ this.leftIconClick.emit();
75
+ }
76
+ handleRightIconClick(event) {
77
+ event.preventDefault();
78
+ this.rightIconClick.emit();
79
+ }
80
+ render() {
81
+ const classNames = ['standalone', this.showerrormsg ? 'invalid' : ''].join(' ');
82
+ return (h(Host, null, h("label", { class: this.inline ? 'inputInline' : 'inputBlock' }, this.label, !this.required ? h("span", { class: "optional" }, "\u00A0(optional)") : '', h("div", { class: "input-container" }, this.inputicon && (h("tttx-icon", { class: "input-icon", icon: this.inputicon, color: this.inputiconcolor, onClick: this.handleInputIconClick.bind(this) })), this.iconleft && (h("tttx-icon", { id: "icon-left", icon: this.iconleft, color: this.iconleftcolor, onClick: this.handleLeftIconClick.bind(this) })), this.iconright && (h("tttx-icon", { id: "icon-right", icon: this.iconright, color: this.iconrightcolor, onClick: this.handleRightIconClick.bind(this) })), h("input", { class: classNames, autocapitalize: this.inputautocapitalize, autofocus: this.inputautofocus, enterkeyhint: this.inputkeyhint, tabindex: this.inputindex, title: this.inputtitle, autocomplete: this.autocomplete, checked: this.checked, disabled: this.disabled, max: this.max, maxlength: this.maxlength, min: this.min, minlength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readonly: this.readonly, required: this.required, step: this.step, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this), onInvalid: this.handleInvalid.bind(this) }), this.secondarylabel && h("span", { class: "secondarylabel" }, this.secondarylabel), this.showerrorbubble && (h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))))));
83
+ }
84
+ static get style() { return tttxStandaloneInputCss; }
85
+ }, [2, "tttx-standalone-input", {
86
+ "label": [1],
87
+ "secondarylabel": [1],
88
+ "showerrormsg": [4],
89
+ "showerrorbubble": [4],
90
+ "errormsg": [1],
91
+ "iconleft": [1],
92
+ "iconleftcolor": [1],
93
+ "iconright": [1],
94
+ "iconrightcolor": [1],
95
+ "inputicon": [1],
96
+ "inputiconcolor": [1],
97
+ "inline": [4],
98
+ "inputautocapitalize": [1],
99
+ "inputautofocus": [4],
100
+ "inputkeyhint": [1],
101
+ "inputindex": [8],
102
+ "inputtitle": [1],
103
+ "autocomplete": [1],
104
+ "checked": [4],
105
+ "disabled": [4],
106
+ "max": [8],
107
+ "maxlength": [8],
108
+ "min": [8],
109
+ "minlength": [8],
110
+ "name": [1],
111
+ "pattern": [1],
112
+ "placeholder": [1],
113
+ "readonly": [8],
114
+ "required": [4],
115
+ "step": [8],
116
+ "type": [1],
117
+ "value": [1032]
118
+ }]);
119
+ function defineCustomElement() {
120
+ if (typeof customElements === "undefined") {
121
+ return;
122
+ }
123
+ const components = ["tttx-standalone-input", "tttx-icon"];
124
+ components.forEach(tagName => { switch (tagName) {
125
+ case "tttx-standalone-input":
126
+ if (!customElements.get(tagName)) {
127
+ customElements.define(tagName, TttxInput);
128
+ }
129
+ break;
130
+ case "tttx-icon":
131
+ if (!customElements.get(tagName)) {
132
+ defineCustomElement$1();
133
+ }
134
+ break;
135
+ } });
136
+ }
137
+
138
+ export { TttxInput as T, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface TttxTreeView extends Components.TttxTreeView, HTMLElement {}
4
+ export const TttxTreeView: {
5
+ prototype: TttxTreeView;
6
+ new (): TttxTreeView;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,120 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
3
+ import { d as defineCustomElement$3 } from './tttx-button2.js';
4
+ import { d as defineCustomElement$2 } from './tttx-icon2.js';
5
+
6
+ const tttxTreeViewCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.tree-view-element{margin-left:-50px}.inline-tree-item{display:flex;align-items:center}.element{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;width:100%}.element-row{min-height:36px;font-family:\"Roboto\", serif;font-size:16px;padding:8px 0px;border-bottom:1px solid #d5d5d5}.rowHover{cursor:pointer}li{list-style-type:none}.toggleNode{padding-right:3px}.padding-icon{padding:6px 6px;height:24px;width:24px;display:flex;align-items:center;justify-content:center}.treeNode{font-weight:500}.treeLeaf{font-weight:400}.right-buttons-container{margin-left:auto;display:flex}.borderless:active{outline-style:none}@media (hover: hover){.rowHover:hover{background-color:rgba(17, 17, 17, 0.05)}}";
7
+
8
+ const TttxTreeView$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.clickEvent = createEvent(this, "clickEvent", 7);
14
+ this.data = undefined;
15
+ this.treeData = undefined;
16
+ }
17
+ onClickHandler(clickName, event, node) {
18
+ event.stopPropagation();
19
+ const returnJsonObject = JSON.stringify(node);
20
+ this.clickEvent.emit({ eventName: clickName, returnJsonObject });
21
+ }
22
+ toggleNode(node, event) {
23
+ event.stopPropagation();
24
+ node.isOpen = !node.isOpen;
25
+ this.treeData = [...this.treeData];
26
+ }
27
+ handleCheckboxChange(node, event) {
28
+ event.stopPropagation();
29
+ node.checked = !node.checked;
30
+ this.updateChildrenCheckStatus(node);
31
+ this.treeData = [...this.treeData];
32
+ }
33
+ updateChildrenCheckStatus(node) {
34
+ if (node.child) {
35
+ node.child.forEach(childNode => {
36
+ childNode.checked = node.checked;
37
+ this.updateChildrenCheckStatus(childNode);
38
+ });
39
+ }
40
+ }
41
+ renderNode(node) {
42
+ let checkboxIcon, checkboxColor;
43
+ if (node.checked) {
44
+ checkboxIcon = 'check_box';
45
+ checkboxColor = 'blue';
46
+ }
47
+ else {
48
+ checkboxIcon = 'check_box_outline_blank';
49
+ checkboxColor = 'grey';
50
+ }
51
+ const rowHoverActive = node.chevronActive ? 'rowHover' : '';
52
+ const expanderIcon = node.isOpen ? 'arrow_drop_down' : 'arrow_right';
53
+ if (node.child && node.child.length > 0) {
54
+ return (h("li", null, h("div", { class: `inline-tree-item element-row ${rowHoverActive}`, onClick: (event) => {
55
+ if (node.chevronActive) {
56
+ event.stopPropagation();
57
+ this.onClickHandler('row', event, node);
58
+ }
59
+ } }, h("tttx-button", { class: "toggleNode", design: "borderless-circle", notext: true, icon: expanderIcon, color: "black", onClick: event => this.toggleNode(node, event) }), this.htmlcode('treeNode', node, checkboxIcon, checkboxColor)), node.isOpen ? (h("ul", null, h("div", { class: "child-node" }, node.child.map(childNode => {
60
+ return this.renderNode(childNode);
61
+ })))) : null));
62
+ }
63
+ else {
64
+ return (h("li", null, h("div", { class: `inline-tree-item element-row ${rowHoverActive}`, onClick: (event) => {
65
+ if (node.chevronActive) {
66
+ event.stopPropagation();
67
+ this.onClickHandler('row', event, node);
68
+ }
69
+ } }, this.htmlcode('treeLeaf', node, checkboxIcon, checkboxColor))));
70
+ }
71
+ }
72
+ htmlcode(type, node, check_box, check_boxColor) {
73
+ const htmlcode = (h("div", { class: 'inline-tree-item element' }, node.hasCheckbox && (h("tttx-button", { design: "borderless-circle", notext: true, icon: check_box, iconcolor: check_boxColor, class: "padding-icon checkbox", onClick: event => this.handleCheckboxChange(node, event) })), !node.html && node.hasIcon && h("tttx-icon", { icon: node.icon, color: node.iconColor, class: "padding-icon" }), !node.html && h("div", { class: type }, node.title), node.html && h("div", { class: type, innerHTML: purify.sanitize(node.html, domSanitiserOptions) }), (node.menuActive || node.chevronActive) && (h("div", { class: "right-buttons-container" }, node.menuActive && (h("tttx-button", { design: "borderless-circle", notext: true, icon: "more_vert", color: "black", class: "padding-icon menu-button", onClick: (event) => {
74
+ event.stopPropagation();
75
+ this.onClickHandler('menu', event, node);
76
+ } })), node.chevronActive && (h("tttx-icon", { icon: "chevron_right", color: "black", class: "padding-icon chevron-button", onClick: (event) => {
77
+ event.stopPropagation();
78
+ this.onClickHandler('chevron', event, node);
79
+ } }))))));
80
+ return htmlcode;
81
+ }
82
+ render() {
83
+ if (!this.data)
84
+ return;
85
+ this.treeData = typeof this.data === 'string' ? JSON.parse(this.data) : this.data;
86
+ return (h("div", { class: "tree-view-element" }, h("ul", null, this.treeData.map((node) => this.renderNode(node)))));
87
+ }
88
+ static get style() { return tttxTreeViewCss; }
89
+ }, [1, "tttx-tree-view", {
90
+ "data": [1040],
91
+ "treeData": [32]
92
+ }]);
93
+ function defineCustomElement$1() {
94
+ if (typeof customElements === "undefined") {
95
+ return;
96
+ }
97
+ const components = ["tttx-tree-view", "tttx-button", "tttx-icon"];
98
+ components.forEach(tagName => { switch (tagName) {
99
+ case "tttx-tree-view":
100
+ if (!customElements.get(tagName)) {
101
+ customElements.define(tagName, TttxTreeView$1);
102
+ }
103
+ break;
104
+ case "tttx-button":
105
+ if (!customElements.get(tagName)) {
106
+ defineCustomElement$3();
107
+ }
108
+ break;
109
+ case "tttx-icon":
110
+ if (!customElements.get(tagName)) {
111
+ defineCustomElement$2();
112
+ }
113
+ break;
114
+ } });
115
+ }
116
+
117
+ const TttxTreeView = TttxTreeView$1;
118
+ const defineCustomElement = defineCustomElement$1;
119
+
120
+ export { TttxTreeView, defineCustomElement };