@3t-transform/threeteeui 0.1.21 → 0.1.22

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 (120) hide show
  1. package/dist/cjs/{index-b8a62ede.js → index-dc6cc829.js} +2 -88
  2. package/dist/cjs/loader.cjs.js +3 -4
  3. package/dist/cjs/tttx-button.cjs.entry.js +24 -24
  4. package/dist/cjs/tttx-filter.cjs.entry.js +152 -152
  5. package/dist/cjs/tttx-form.cjs.entry.js +363 -363
  6. package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +59 -59
  8. package/dist/cjs/tttx-list.cjs.entry.js +43 -43
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  10. package/dist/cjs/tttx-sorter.cjs.entry.js +112 -0
  11. package/dist/cjs/tttx-standalone-input.cjs.entry.js +60 -60
  12. package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
  13. package/dist/cjs/tttx.cjs.js +3 -7
  14. package/dist/collection/collection-manifest.json +3 -2
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  17. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  18. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  19. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  20. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  22. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  23. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +325 -325
  24. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +89 -89
  25. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -35
  26. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -58
  27. package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -364
  28. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -127
  29. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  30. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  31. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.css +116 -0
  32. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +224 -0
  33. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +47 -0
  34. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +627 -627
  35. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +157 -157
  36. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  37. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  38. package/dist/collection/components/palette.stories.js +7 -7
  39. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  40. package/dist/collection/icons.js +2838 -2838
  41. package/dist/collection/index.js +1 -1
  42. package/dist/collection/shared/domsanitiser.options.js +14 -14
  43. package/dist/components/index.d.ts +1 -9
  44. package/dist/components/index.js +2 -1
  45. package/dist/components/tttx-button.js +48 -48
  46. package/dist/components/tttx-filter.js +184 -184
  47. package/dist/components/tttx-form.js +380 -380
  48. package/dist/components/tttx-icon2.js +28 -28
  49. package/dist/components/tttx-keyvalue-block.js +76 -76
  50. package/dist/components/tttx-list.js +65 -65
  51. package/dist/components/tttx-loading-spinner.js +33 -33
  52. package/dist/components/tttx-sorter.d.ts +11 -0
  53. package/dist/components/tttx-sorter.js +141 -0
  54. package/dist/components/tttx-standalone-input.js +107 -107
  55. package/dist/components/tttx-toolbar.js +26 -26
  56. package/dist/esm/{index-e888a5f4.js → index-86faeaab.js} +3 -88
  57. package/dist/esm/loader.js +3 -4
  58. package/dist/esm/polyfills/core-js.js +0 -0
  59. package/dist/esm/polyfills/css-shim.js +1 -1
  60. package/dist/esm/polyfills/dom.js +0 -0
  61. package/dist/esm/polyfills/es5-html-element.js +0 -0
  62. package/dist/esm/polyfills/index.js +0 -0
  63. package/dist/esm/polyfills/system.js +0 -0
  64. package/dist/esm/tttx-button.entry.js +24 -24
  65. package/dist/esm/tttx-filter.entry.js +152 -152
  66. package/dist/esm/tttx-form.entry.js +363 -363
  67. package/dist/esm/tttx-icon.entry.js +11 -11
  68. package/dist/esm/tttx-keyvalue-block.entry.js +59 -59
  69. package/dist/esm/tttx-list.entry.js +43 -43
  70. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  71. package/dist/esm/tttx-sorter.entry.js +108 -0
  72. package/dist/esm/tttx-standalone-input.entry.js +60 -60
  73. package/dist/esm/tttx-toolbar.entry.js +10 -10
  74. package/dist/esm/tttx.js +3 -4
  75. package/dist/tttx/p-12fc0b16.entry.js +3 -0
  76. package/dist/tttx/p-52a47b7c.js +2 -0
  77. package/dist/tttx/p-5d9b6bc0.entry.js +1 -0
  78. package/dist/tttx/{p-41f5b296.entry.js → p-603f6ebe.entry.js} +1 -1
  79. package/dist/tttx/{p-e145951b.entry.js → p-72b4c98a.entry.js} +1 -1
  80. package/dist/tttx/{p-043f9b8a.entry.js → p-8f3badad.entry.js} +1 -1
  81. package/dist/tttx/{p-4cf3e1e0.entry.js → p-ae48fe5a.entry.js} +1 -1
  82. package/dist/tttx/{p-01f4628e.entry.js → p-bdb054b2.entry.js} +1 -1
  83. package/dist/tttx/{p-dc5c356b.entry.js → p-c72d1a03.entry.js} +1 -1
  84. package/dist/tttx/{p-96bbf1ed.entry.js → p-e25d5fe2.entry.js} +1 -1
  85. package/dist/tttx/{p-b3a03986.entry.js → p-f1d7eb35.entry.js} +1 -1
  86. package/dist/tttx/tttx.esm.js +1 -1
  87. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  88. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  89. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  90. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  91. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  92. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  93. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  94. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  95. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +37 -37
  96. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +43 -43
  97. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  98. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  99. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -114
  100. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +13 -13
  101. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  102. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  103. package/dist/types/components/molecules/tttx-sorter/interfaces.d.ts +9 -0
  104. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +19 -0
  105. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -0
  106. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +56 -56
  107. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +123 -123
  108. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  109. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  110. package/dist/types/components/palette.stories.d.ts +6 -6
  111. package/dist/types/components.d.ts +27 -0
  112. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  113. package/dist/types/icons.d.ts +2 -2
  114. package/dist/types/index.d.ts +1 -1
  115. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  116. package/dist/types/stencil-public-runtime.d.ts +3 -59
  117. package/loader/index.d.ts +0 -9
  118. package/package.json +1 -1
  119. package/dist/tttx/p-6dff6b5a.entry.js +0 -3
  120. package/dist/tttx/p-f764ffc4.js +0 -2
@@ -2,34 +2,34 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
 
3
3
  const tttxIconCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:inline-block;cursor:default;user-select:none}.icon-size{width:24px;height:24px}.tooltip{background:#ffffff;color:#343434;font-weight:bold;padding:8px 16px;font-size:13px;border-radius:4px;box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3);display:none}.tooltip[data-show]{display:block}.arrow,.arrow::before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}.tooltip[data-popper-placement^=left]>.arrow{right:-4px}.tooltip[data-popper-placement^=right]>.arrow{left:-4px}.red{color:#dc0000}.darkred{color:#A20000}.orange{color:#f59500}.blue{color:#1479c6}.green{color:#a2bb31}.gray{color:#757575}.black{color:#212121}.white{color:white}";
4
4
 
5
- const TttxIcon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- this.icon = undefined;
11
- this.color = 'grey';
12
- }
13
- render() {
14
- return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
15
- }
16
- static get style() { return tttxIconCss; }
17
- }, [1, "tttx-icon", {
18
- "icon": [1],
19
- "color": [1]
20
- }]);
21
- function defineCustomElement() {
22
- if (typeof customElements === "undefined") {
23
- return;
24
- }
25
- const components = ["tttx-icon"];
26
- components.forEach(tagName => { switch (tagName) {
27
- case "tttx-icon":
28
- if (!customElements.get(tagName)) {
29
- customElements.define(tagName, TttxIcon);
30
- }
31
- break;
32
- } });
5
+ const TttxIcon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.icon = undefined;
11
+ this.color = 'grey';
12
+ }
13
+ render() {
14
+ return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
15
+ }
16
+ static get style() { return tttxIconCss; }
17
+ }, [1, "tttx-icon", {
18
+ "icon": [1],
19
+ "color": [1]
20
+ }]);
21
+ function defineCustomElement() {
22
+ if (typeof customElements === "undefined") {
23
+ return;
24
+ }
25
+ const components = ["tttx-icon"];
26
+ components.forEach(tagName => { switch (tagName) {
27
+ case "tttx-icon":
28
+ if (!customElements.get(tagName)) {
29
+ customElements.define(tagName, TttxIcon);
30
+ }
31
+ break;
32
+ } });
33
33
  }
34
34
 
35
35
  export { TttxIcon as T, defineCustomElement as d };
@@ -2,82 +2,82 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
 
3
3
  const tttxKeyvalueBlockCss = ":host{display:block}dl{margin:0;padding:0;font-family:\"Roboto\", sans-serif;cursor:default}dt{font-weight:400;line-height:21px;font-size:16px}dt,dt.subTitle{color:#757575}dt.mainTitle{color:#212121}dt,dd{overflow-wrap:anywhere}dd{margin:0;font-weight:400;font-size:16px;color:#212121;line-height:21px;margin-bottom:18px}dl.horizontal{display:flex;flex-direction:row;width:100%}dl.horizontal div{flex-grow:1}@media (max-width: 769px){dl.horizontal{flex-wrap:wrap}dl.horizontal div{width:50%;max-width:50% !important}}@media (max-width: 600px){dl.horizontal div{width:100%;max-width:100% !important}}";
4
4
 
5
- const TttxKeyvalueBlock$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- this.keyvalues = undefined;
11
- this.horizontal = undefined;
12
- }
13
- renderSingleElements(values) {
14
- const keys = Object.keys(values);
15
- const elements = [];
16
- const divSize = (100 / keys.length).toString() + '%';
17
- for (let i = 0; i < keys.length; i++) {
18
- if (this.horizontal) {
19
- elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", null, keys[i]), h("dd", null, values[keys[i]])));
20
- }
21
- else {
22
- elements.push(h("dt", null, keys[i]));
23
- elements.push(h("dd", null, values[keys[i]]));
24
- }
25
- }
26
- return elements;
27
- }
28
- renderArrayElements(values) {
29
- const elements = [];
30
- const divSize = (100 / values.length).toString() + '%';
31
- for (let i = 0; i < values.length; i++) {
32
- const value = values[i];
33
- if (this.horizontal) {
34
- elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
35
- }
36
- else {
37
- elements.push(h("dt", { class: 'mainTitle' }, value.title));
38
- elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
39
- elements.push(h("dd", null, value.data));
40
- }
41
- }
42
- return elements;
43
- }
44
- render() {
45
- if (!this.keyvalues) {
46
- return;
47
- }
48
- let values;
49
- if (typeof this.keyvalues === 'string') {
50
- values = JSON.parse(this.keyvalues);
51
- }
52
- else {
53
- values = this.keyvalues;
54
- }
55
- let elements;
56
- if (Array.isArray(values)) {
57
- elements = this.renderArrayElements(values);
58
- }
59
- else {
60
- elements = this.renderSingleElements(values);
61
- }
62
- return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
63
- }
64
- static get style() { return tttxKeyvalueBlockCss; }
65
- }, [1, "tttx-keyvalue-block", {
66
- "keyvalues": [8],
67
- "horizontal": [4]
68
- }]);
69
- function defineCustomElement$1() {
70
- if (typeof customElements === "undefined") {
71
- return;
72
- }
73
- const components = ["tttx-keyvalue-block"];
74
- components.forEach(tagName => { switch (tagName) {
75
- case "tttx-keyvalue-block":
76
- if (!customElements.get(tagName)) {
77
- customElements.define(tagName, TttxKeyvalueBlock$1);
78
- }
79
- break;
80
- } });
5
+ const TttxKeyvalueBlock$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.keyvalues = undefined;
11
+ this.horizontal = undefined;
12
+ }
13
+ renderSingleElements(values) {
14
+ const keys = Object.keys(values);
15
+ const elements = [];
16
+ const divSize = (100 / keys.length).toString() + '%';
17
+ for (let i = 0; i < keys.length; i++) {
18
+ if (this.horizontal) {
19
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", null, keys[i]), h("dd", null, values[keys[i]])));
20
+ }
21
+ else {
22
+ elements.push(h("dt", null, keys[i]));
23
+ elements.push(h("dd", null, values[keys[i]]));
24
+ }
25
+ }
26
+ return elements;
27
+ }
28
+ renderArrayElements(values) {
29
+ const elements = [];
30
+ const divSize = (100 / values.length).toString() + '%';
31
+ for (let i = 0; i < values.length; i++) {
32
+ const value = values[i];
33
+ if (this.horizontal) {
34
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
35
+ }
36
+ else {
37
+ elements.push(h("dt", { class: 'mainTitle' }, value.title));
38
+ elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
39
+ elements.push(h("dd", null, value.data));
40
+ }
41
+ }
42
+ return elements;
43
+ }
44
+ render() {
45
+ if (!this.keyvalues) {
46
+ return;
47
+ }
48
+ let values;
49
+ if (typeof this.keyvalues === 'string') {
50
+ values = JSON.parse(this.keyvalues);
51
+ }
52
+ else {
53
+ values = this.keyvalues;
54
+ }
55
+ let elements;
56
+ if (Array.isArray(values)) {
57
+ elements = this.renderArrayElements(values);
58
+ }
59
+ else {
60
+ elements = this.renderSingleElements(values);
61
+ }
62
+ return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
63
+ }
64
+ static get style() { return tttxKeyvalueBlockCss; }
65
+ }, [1, "tttx-keyvalue-block", {
66
+ "keyvalues": [8],
67
+ "horizontal": [4]
68
+ }]);
69
+ function defineCustomElement$1() {
70
+ if (typeof customElements === "undefined") {
71
+ return;
72
+ }
73
+ const components = ["tttx-keyvalue-block"];
74
+ components.forEach(tagName => { switch (tagName) {
75
+ case "tttx-keyvalue-block":
76
+ if (!customElements.get(tagName)) {
77
+ customElements.define(tagName, TttxKeyvalueBlock$1);
78
+ }
79
+ break;
80
+ } });
81
81
  }
82
82
 
83
83
  const TttxKeyvalueBlock = TttxKeyvalueBlock$1;
@@ -1650,75 +1650,75 @@ var purify = createCommonjsModule(function (module, exports) {
1650
1650
  //# sourceMappingURL=purify.js.map
1651
1651
  });
1652
1652
 
1653
- function tagRegXp(tagName) {
1654
- return RegExp(/^tttx-/).exec(tagName);
1655
- }
1656
- function attributeNameCheck() {
1657
- return true;
1658
- }
1659
- const domSanitiserOptions = {
1660
- CUSTOM_ELEMENT_HANDLING: {
1661
- tagNameCheck: tagRegXp,
1662
- attributeNameCheck: attributeNameCheck,
1663
- allowCustomizedBuiltInElements: false, // customized built-ins are not allowed
1664
- }
1653
+ function tagRegXp(tagName) {
1654
+ return RegExp(/^tttx-/).exec(tagName);
1655
+ }
1656
+ function attributeNameCheck() {
1657
+ return true;
1658
+ }
1659
+ const domSanitiserOptions = {
1660
+ CUSTOM_ELEMENT_HANDLING: {
1661
+ tagNameCheck: tagRegXp,
1662
+ attributeNameCheck: attributeNameCheck,
1663
+ allowCustomizedBuiltInElements: false, // customized built-ins are not allowed
1664
+ }
1665
1665
  };
1666
1666
 
1667
1667
  const tttxListCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px;display:flex;align-items:center}.item:first-of-type{border-top:1px solid #d5d5d5}.item.clickable:hover{cursor:pointer}.item.clickable:active{background-color:#e6e6e6}.align-right{margin-left:auto}.item-content{display:flex;align-items:center}";
1668
1668
 
1669
- const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
1670
- constructor() {
1671
- super();
1672
- this.__registerHost();
1673
- this.__attachShadow();
1674
- this.rowClick = createEvent(this, "listRowClick", 7);
1675
- this.data = undefined;
1676
- this.name = undefined;
1677
- }
1678
- onRowClickHandler(item) {
1679
- if (!item.clickable || !item.rowData)
1680
- return;
1681
- this.rowClick.emit({ name: this.name, data: item.rowData });
1682
- }
1683
- renderListItem(item) {
1684
- const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
1685
- return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
1686
- this.onRowClickHandler(item);
1687
- } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
1688
- }
1689
- render() {
1690
- if (!this.data)
1691
- return;
1692
- if (typeof this.data === 'string') {
1693
- this._data = JSON.parse(this.data);
1694
- }
1695
- else {
1696
- this._data = this.data;
1697
- }
1698
- return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
1699
- }
1700
- static get style() { return tttxListCss; }
1701
- }, [1, "tttx-list", {
1702
- "data": [1025],
1703
- "name": [1]
1704
- }]);
1705
- function defineCustomElement$1() {
1706
- if (typeof customElements === "undefined") {
1707
- return;
1708
- }
1709
- const components = ["tttx-list", "tttx-icon"];
1710
- components.forEach(tagName => { switch (tagName) {
1711
- case "tttx-list":
1712
- if (!customElements.get(tagName)) {
1713
- customElements.define(tagName, TttxList$1);
1714
- }
1715
- break;
1716
- case "tttx-icon":
1717
- if (!customElements.get(tagName)) {
1718
- defineCustomElement$2();
1719
- }
1720
- break;
1721
- } });
1669
+ const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
1670
+ constructor() {
1671
+ super();
1672
+ this.__registerHost();
1673
+ this.__attachShadow();
1674
+ this.rowClick = createEvent(this, "listRowClick", 7);
1675
+ this.data = undefined;
1676
+ this.name = undefined;
1677
+ }
1678
+ onRowClickHandler(item) {
1679
+ if (!item.clickable || !item.rowData)
1680
+ return;
1681
+ this.rowClick.emit({ name: this.name, data: item.rowData });
1682
+ }
1683
+ renderListItem(item) {
1684
+ const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
1685
+ return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
1686
+ this.onRowClickHandler(item);
1687
+ } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
1688
+ }
1689
+ render() {
1690
+ if (!this.data)
1691
+ return;
1692
+ if (typeof this.data === 'string') {
1693
+ this._data = JSON.parse(this.data);
1694
+ }
1695
+ else {
1696
+ this._data = this.data;
1697
+ }
1698
+ return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
1699
+ }
1700
+ static get style() { return tttxListCss; }
1701
+ }, [1, "tttx-list", {
1702
+ "data": [1025],
1703
+ "name": [1]
1704
+ }]);
1705
+ function defineCustomElement$1() {
1706
+ if (typeof customElements === "undefined") {
1707
+ return;
1708
+ }
1709
+ const components = ["tttx-list", "tttx-icon"];
1710
+ components.forEach(tagName => { switch (tagName) {
1711
+ case "tttx-list":
1712
+ if (!customElements.get(tagName)) {
1713
+ customElements.define(tagName, TttxList$1);
1714
+ }
1715
+ break;
1716
+ case "tttx-icon":
1717
+ if (!customElements.get(tagName)) {
1718
+ defineCustomElement$2();
1719
+ }
1720
+ break;
1721
+ } });
1722
1722
  }
1723
1723
 
1724
1724
  const TttxList = TttxList$1;
@@ -2,39 +2,39 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
2
2
 
3
3
  const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.spinner-container{position:absolute}.loading-box{display:flex;align-items:center;justify-content:center}.loading-text{font-size:16px;font-weight:400;padding-top:10px;text-align:center}.spinner{border:solid #1479c6;border-bottom-color:#d5d5d5;border-radius:50%;position:relative;box-sizing:border-box;animation:rotation 1s linear infinite}.spinner.small{height:20px;width:20px;border-width:4px}.spinner.large{height:60px;width:60px;border-width:8px}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
4
4
 
5
- const TttxLoadingSpinner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- this.loadingMessage = undefined;
11
- this.size = 'large';
12
- }
13
- renderLoadingMessage() {
14
- if (!this.loadingMessage)
15
- return '';
16
- return h("div", { class: "loading-text" }, "Loading, please wait...");
17
- }
18
- render() {
19
- return (h("div", { class: "spinner-container" }, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
20
- }
21
- static get style() { return tttxLoadingSpinnerCss; }
22
- }, [1, "tttx-loading-spinner", {
23
- "loadingMessage": [1028, "loading-message"],
24
- "size": [1025]
25
- }]);
26
- function defineCustomElement$1() {
27
- if (typeof customElements === "undefined") {
28
- return;
29
- }
30
- const components = ["tttx-loading-spinner"];
31
- components.forEach(tagName => { switch (tagName) {
32
- case "tttx-loading-spinner":
33
- if (!customElements.get(tagName)) {
34
- customElements.define(tagName, TttxLoadingSpinner$1);
35
- }
36
- break;
37
- } });
5
+ const TttxLoadingSpinner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.loadingMessage = undefined;
11
+ this.size = 'large';
12
+ }
13
+ renderLoadingMessage() {
14
+ if (!this.loadingMessage)
15
+ return '';
16
+ return h("div", { class: "loading-text" }, "Loading, please wait...");
17
+ }
18
+ render() {
19
+ return (h("div", { class: "spinner-container" }, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
20
+ }
21
+ static get style() { return tttxLoadingSpinnerCss; }
22
+ }, [1, "tttx-loading-spinner", {
23
+ "loadingMessage": [1028, "loading-message"],
24
+ "size": [1025]
25
+ }]);
26
+ function defineCustomElement$1() {
27
+ if (typeof customElements === "undefined") {
28
+ return;
29
+ }
30
+ const components = ["tttx-loading-spinner"];
31
+ components.forEach(tagName => { switch (tagName) {
32
+ case "tttx-loading-spinner":
33
+ if (!customElements.get(tagName)) {
34
+ customElements.define(tagName, TttxLoadingSpinner$1);
35
+ }
36
+ break;
37
+ } });
38
38
  }
39
39
 
40
40
  const TttxLoadingSpinner = TttxLoadingSpinner$1;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface TttxSorter extends Components.TttxSorter, HTMLElement {}
4
+ export const TttxSorter: {
5
+ prototype: TttxSorter;
6
+ new (): TttxSorter;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,141 @@
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 tttxSorterCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.sorter-container{display:inline-flex;flex-direction:row;position:relative;height:36px;border:1px solid #d5d5d5;border-radius:4px;font-family:\"Roboto\", serif;font-weight:400}@media (max-width: 475px){.sorter-container{width:68px}}.sorter-container .arrow-toggle-button{display:inline-flex;justify-content:center;align-items:center;flex-direction:column;height:36px;background-color:white;font-size:16px;border:none;border-bottom-left-radius:4px;border-top-left-radius:4px}.sorter-container .arrow-toggle-button .hydrated{display:flex;justify-content:center;align-items:center}.sorter-container .arrow-toggle-button span{display:block;margin:auto;line-height:16px}.sorter-container .arrow-toggle-button .material-symbols-rounded{color:#212121}.sorter-container .dropdown-selector{display:inline-flex;position:relative;height:36px;flex-grow:1}.sorter-container .dropdown-selector .dropdown-selector-button{display:inline-flex;flex-direction:row;gap:4px;padding-right:4px;align-items:center;height:36px;font-size:16px;line-height:21px;color:#212121;box-sizing:border-box;width:100%}@media (max-width: 475px){.sorter-container .dropdown-selector .dropdown-selector-button .dropdown-selector-text{display:none}}.sorter-container .dropdown-selector .dropdown-selector-chevron{display:inline-flex;right:0;top:0;flex-direction:row;align-items:center;align-self:flex-end;height:36px}.sorter-container .dropdown-selector .dropdown-selector-chevron .hydrated{height:24px}.sorter-container .dropdown-options-list{position:absolute;top:36px;left:0;z-index:1;width:100%;line-height:21px;font-size:16px;border-radius:4px;padding-top:8px;padding-bottom:7px;box-shadow:0px 1px 5px #1111114D;box-sizing:border-box}@media (max-width: 475px){.sorter-container .dropdown-options-list{width:220px;padding-top:8px}}.sorter-container .dropdown-options-list .dropdown-option{padding:8px 16px;font-size:16px;line-height:21px}.sorter-container .dropdown-options-list .dropdown-option:hover,.sorter-container .dropdown-options-list .dropdown-option:focus{background-color:#e7f1f9}.sorter-container.--expanded{border-color:#1579c6}@media (max-width: 475px){.sorter-container.--expanded{border:none}}";
5
+
6
+ const TttxSorter$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ this.sorterChangeEvent = createEvent(this, "sorterChangeEvent", 7);
12
+ this.sorterKey = undefined;
13
+ this.defaultSortDirection = 'descending';
14
+ this.fieldOptionsData = null;
15
+ this.defaultOption = '';
16
+ this.selectedField = this.defaultOption;
17
+ this.sortDirection = this.defaultSortDirection;
18
+ this.dropdownExpand = false;
19
+ this.dropdownOptions = undefined;
20
+ }
21
+ emitSortEvent() {
22
+ this.sorterChangeEvent.emit({
23
+ sorterDirection: this.sortDirection,
24
+ sorterKey: this.sorterKey,
25
+ sortField: this.selectedField,
26
+ });
27
+ }
28
+ onSortToggleClick(event) {
29
+ event.preventDefault();
30
+ if (this.sortDirection == 'ascending') {
31
+ this.sortDirection = 'descending';
32
+ }
33
+ else {
34
+ this.sortDirection = 'ascending';
35
+ }
36
+ this.emitSortEvent();
37
+ }
38
+ onDropdownClicked() {
39
+ this.dropdownExpand = !this.dropdownExpand;
40
+ }
41
+ onDropdownSelected(event) {
42
+ this.dropdownExpand = false;
43
+ const target = event.target;
44
+ this.selectedField = target.innerHTML;
45
+ this.emitSortEvent();
46
+ }
47
+ // getOptionsList() {
48
+ // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
49
+ // }
50
+ // /* istanbul ignore next */
51
+ // @Listen('keyup')
52
+ // handleKeyDown(ev: KeyboardEvent) {
53
+ // const keyboardEventValue = ev.key;
54
+ // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
55
+ // switch (keyboardEventValue) {
56
+ // case 'Enter':
57
+ // if (this._focussedElementIndex > -1) {
58
+ // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
59
+ // this.selectedField = options[this._focussedElementIndex].innerHTML;
60
+ // this.emitSortEvent();
61
+ // }
62
+ // this.dropdownExpand = false;
63
+ // break;
64
+ // case 'Escape':
65
+ // this.dropdownExpand = false;
66
+ // break;
67
+ // case 'ArrowDown':
68
+ // this.dropdownExpand = true;
69
+ // if (this._focussedElementIndex > -1) {
70
+ // const options = this.getOptionsList();
71
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
72
+ // currentOption.blur();
73
+ // options[this._focussedElementIndex].focus();
74
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
75
+ // } else {
76
+ // this._focussedElementIndex++;
77
+ // }
78
+ // break;
79
+ // case 'ArrowUp':
80
+ // this.dropdownExpand = true;
81
+ // if (this._focussedElementIndex == -1) {
82
+ // const options = this.getOptionsList();
83
+ // this._focussedElementIndex = options.length - 1;
84
+ // } else {
85
+ // const options = this.getOptionsList();
86
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
87
+ // currentOption.blur();
88
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
89
+ // options[this._focussedElementIndex].focus();
90
+ // }
91
+ // break;
92
+ // }
93
+ // }
94
+ render() {
95
+ const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
96
+ if (!this.fieldOptionsData)
97
+ return;
98
+ const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
99
+ const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
100
+ const selectedOption = this.selectedField;
101
+ const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
102
+ const sorterKey = `sorter__${this.sorterKey}`;
103
+ return (h(Host, { id: sorterKey }, h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, h("tttx-icon", { icon: arrowIcon, color: "black" })), h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, h("div", { class: "dropdown-selector-button" }, h("div", { class: "dropdown-selector-text" }, selectedOption), h("div", { class: "dropdown-selector-chevron" }, h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
104
+ return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
105
+ }))))));
106
+ }
107
+ get el() { return this; }
108
+ static get style() { return tttxSorterCss; }
109
+ }, [1, "tttx-sorter", {
110
+ "sorterKey": [1, "sorter-key"],
111
+ "defaultSortDirection": [1, "default-sort-direction"],
112
+ "fieldOptionsData": [1, "field-options-data"],
113
+ "defaultOption": [1, "default-option"],
114
+ "selectedField": [32],
115
+ "sortDirection": [32],
116
+ "dropdownExpand": [32],
117
+ "dropdownOptions": [32]
118
+ }]);
119
+ function defineCustomElement$1() {
120
+ if (typeof customElements === "undefined") {
121
+ return;
122
+ }
123
+ const components = ["tttx-sorter", "tttx-icon"];
124
+ components.forEach(tagName => { switch (tagName) {
125
+ case "tttx-sorter":
126
+ if (!customElements.get(tagName)) {
127
+ customElements.define(tagName, TttxSorter$1);
128
+ }
129
+ break;
130
+ case "tttx-icon":
131
+ if (!customElements.get(tagName)) {
132
+ defineCustomElement$2();
133
+ }
134
+ break;
135
+ } });
136
+ }
137
+
138
+ const TttxSorter = TttxSorter$1;
139
+ const defineCustomElement = defineCustomElement$1;
140
+
141
+ export { TttxSorter, defineCustomElement };