@3t-transform/threeteeui 0.1.41 → 0.1.43

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 (123) hide show
  1. package/dist/cjs/{domsanitiser.options-277161b9.js → domsanitiser.options-975e3317.js} +12 -12
  2. package/dist/cjs/{index-76f14107.js → index-457ca775.js} +88 -2
  3. package/dist/cjs/loader.cjs.js +4 -3
  4. package/dist/cjs/tttx-button.cjs.entry.js +24 -24
  5. package/dist/cjs/tttx-filter.cjs.entry.js +177 -159
  6. package/dist/cjs/tttx-form.cjs.entry.js +458 -456
  7. package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
  8. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +59 -59
  9. package/dist/cjs/tttx-list.cjs.entry.js +32 -32
  10. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  11. package/dist/cjs/tttx-sorter.cjs.entry.js +102 -102
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +79 -79
  13. package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
  14. package/dist/cjs/tttx.cjs.js +7 -3
  15. package/dist/collection/collection-manifest.json +2 -2
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  18. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  19. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  20. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  21. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  22. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  23. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  24. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +369 -334
  25. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +73 -62
  26. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
  27. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -61
  28. package/dist/collection/components/molecules/tttx-form/tttx-form.js +479 -477
  29. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +272 -272
  30. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  31. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  32. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +224 -224
  33. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
  34. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
  35. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
  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/domsanitiser.options.js +12 -12
  44. package/dist/components/index.d.ts +9 -0
  45. package/dist/components/index.js +1 -1
  46. package/dist/components/tttx-button.js +48 -48
  47. package/dist/components/tttx-filter.js +210 -191
  48. package/dist/components/tttx-form.js +475 -473
  49. package/dist/components/tttx-icon2.js +28 -28
  50. package/dist/components/tttx-keyvalue-block.js +76 -76
  51. package/dist/components/tttx-list.js +53 -53
  52. package/dist/components/tttx-loading-spinner.js +33 -33
  53. package/dist/components/tttx-sorter.js +130 -130
  54. package/dist/components/tttx-standalone-input.js +130 -130
  55. package/dist/components/tttx-toolbar.js +26 -26
  56. package/dist/esm/{domsanitiser.options-cc420431.js → domsanitiser.options-3c7ded83.js} +12 -12
  57. package/dist/esm/{index-9cde46a5.js → index-d784fb3e.js} +88 -3
  58. package/dist/esm/loader.js +4 -3
  59. package/dist/esm/polyfills/core-js.js +0 -0
  60. package/dist/esm/polyfills/css-shim.js +1 -1
  61. package/dist/esm/polyfills/dom.js +0 -0
  62. package/dist/esm/polyfills/es5-html-element.js +0 -0
  63. package/dist/esm/polyfills/index.js +0 -0
  64. package/dist/esm/polyfills/system.js +0 -0
  65. package/dist/esm/tttx-button.entry.js +24 -24
  66. package/dist/esm/tttx-filter.entry.js +177 -159
  67. package/dist/esm/tttx-form.entry.js +458 -456
  68. package/dist/esm/tttx-icon.entry.js +11 -11
  69. package/dist/esm/tttx-keyvalue-block.entry.js +59 -59
  70. package/dist/esm/tttx-list.entry.js +32 -32
  71. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  72. package/dist/esm/tttx-sorter.entry.js +102 -102
  73. package/dist/esm/tttx-standalone-input.entry.js +79 -79
  74. package/dist/esm/tttx-toolbar.entry.js +10 -10
  75. package/dist/esm/tttx.js +4 -3
  76. package/dist/tttx/p-0ebffdfc.js +2 -0
  77. package/dist/tttx/{p-dc2a37b0.entry.js → p-1db3704e.entry.js} +1 -1
  78. package/dist/tttx/p-350ddb03.js +3 -0
  79. package/dist/tttx/{p-561224f5.entry.js → p-563605b2.entry.js} +1 -1
  80. package/dist/tttx/{p-aef96333.entry.js → p-798a098a.entry.js} +1 -1
  81. package/dist/tttx/{p-f885f17a.entry.js → p-92cade7f.entry.js} +1 -1
  82. package/dist/tttx/{p-bd1edaed.entry.js → p-aaf02902.entry.js} +1 -1
  83. package/dist/tttx/{p-e53c7f9d.entry.js → p-ab6ce9f6.entry.js} +1 -1
  84. package/dist/tttx/{p-9f1e9cc1.entry.js → p-b720c4ad.entry.js} +1 -1
  85. package/dist/tttx/{p-d2f1aa8e.entry.js → p-cac26a1b.entry.js} +1 -1
  86. package/dist/tttx/p-ec253eea.entry.js +1 -0
  87. package/dist/tttx/p-f702df4f.entry.js +1 -0
  88. package/dist/tttx/tttx.esm.js +1 -1
  89. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  90. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  91. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  92. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  93. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  94. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  95. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  96. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  97. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +41 -39
  98. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +70 -68
  99. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  100. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  101. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +133 -133
  102. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +278 -278
  103. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  104. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  105. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +19 -19
  106. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -30
  107. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
  108. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
  109. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  110. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  111. package/dist/types/components/palette.stories.d.ts +6 -6
  112. package/dist/types/components.d.ts +2 -0
  113. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  114. package/dist/types/icons.d.ts +2 -2
  115. package/dist/types/index.d.ts +1 -1
  116. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  117. package/dist/types/stencil-public-runtime.d.ts +59 -3
  118. package/loader/index.d.ts +9 -0
  119. package/package.json +2 -2
  120. package/dist/tttx/p-3b1be372.entry.js +0 -1
  121. package/dist/tttx/p-b4290a5b.js +0 -3
  122. package/dist/tttx/p-d0ff9ad0.entry.js +0 -1
  123. package/dist/tttx/p-db059a69.js +0 -2
@@ -1,17 +1,17 @@
1
- import { r as registerInstance, h, H as Host } from './index-9cde46a5.js';
1
+ import { r as registerInstance, h, H as Host } from './index-d784fb3e.js';
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 = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.icon = undefined;
9
- this.color = 'grey';
10
- }
11
- render() {
12
- return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
13
- }
14
- };
5
+ const TttxIcon = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.icon = undefined;
9
+ this.color = 'grey';
10
+ }
11
+ render() {
12
+ return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
13
+ }
14
+ };
15
15
  TttxIcon.style = tttxIconCss;
16
16
 
17
17
  export { TttxIcon as tttx_icon };
@@ -1,65 +1,65 @@
1
- import { r as registerInstance, h, H as Host } from './index-9cde46a5.js';
1
+ import { r as registerInstance, h, H as Host } from './index-d784fb3e.js';
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 = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.keyvalues = undefined;
9
- this.horizontal = undefined;
10
- }
11
- renderSingleElements(values) {
12
- const keys = Object.keys(values);
13
- const elements = [];
14
- const divSize = (100 / keys.length).toString() + '%';
15
- for (let i = 0; i < keys.length; i++) {
16
- if (this.horizontal) {
17
- elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", null, keys[i]), h("dd", null, values[keys[i]])));
18
- }
19
- else {
20
- elements.push(h("dt", null, keys[i]));
21
- elements.push(h("dd", null, values[keys[i]]));
22
- }
23
- }
24
- return elements;
25
- }
26
- renderArrayElements(values) {
27
- const elements = [];
28
- const divSize = (100 / values.length).toString() + '%';
29
- for (let i = 0; i < values.length; i++) {
30
- const value = values[i];
31
- if (this.horizontal) {
32
- elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
33
- }
34
- else {
35
- elements.push(h("dt", { class: 'mainTitle' }, value.title));
36
- elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
37
- elements.push(h("dd", null, value.data));
38
- }
39
- }
40
- return elements;
41
- }
42
- render() {
43
- if (!this.keyvalues) {
44
- return;
45
- }
46
- let values;
47
- if (typeof this.keyvalues === 'string') {
48
- values = JSON.parse(this.keyvalues);
49
- }
50
- else {
51
- values = this.keyvalues;
52
- }
53
- let elements;
54
- if (Array.isArray(values)) {
55
- elements = this.renderArrayElements(values);
56
- }
57
- else {
58
- elements = this.renderSingleElements(values);
59
- }
60
- return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
61
- }
62
- };
5
+ const TttxKeyvalueBlock = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.keyvalues = undefined;
9
+ this.horizontal = undefined;
10
+ }
11
+ renderSingleElements(values) {
12
+ const keys = Object.keys(values);
13
+ const elements = [];
14
+ const divSize = (100 / keys.length).toString() + '%';
15
+ for (let i = 0; i < keys.length; i++) {
16
+ if (this.horizontal) {
17
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", null, keys[i]), h("dd", null, values[keys[i]])));
18
+ }
19
+ else {
20
+ elements.push(h("dt", null, keys[i]));
21
+ elements.push(h("dd", null, values[keys[i]]));
22
+ }
23
+ }
24
+ return elements;
25
+ }
26
+ renderArrayElements(values) {
27
+ const elements = [];
28
+ const divSize = (100 / values.length).toString() + '%';
29
+ for (let i = 0; i < values.length; i++) {
30
+ const value = values[i];
31
+ if (this.horizontal) {
32
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
33
+ }
34
+ else {
35
+ elements.push(h("dt", { class: 'mainTitle' }, value.title));
36
+ elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
37
+ elements.push(h("dd", null, value.data));
38
+ }
39
+ }
40
+ return elements;
41
+ }
42
+ render() {
43
+ if (!this.keyvalues) {
44
+ return;
45
+ }
46
+ let values;
47
+ if (typeof this.keyvalues === 'string') {
48
+ values = JSON.parse(this.keyvalues);
49
+ }
50
+ else {
51
+ values = this.keyvalues;
52
+ }
53
+ let elements;
54
+ if (Array.isArray(values)) {
55
+ elements = this.renderArrayElements(values);
56
+ }
57
+ else {
58
+ elements = this.renderSingleElements(values);
59
+ }
60
+ return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
61
+ }
62
+ };
63
63
  TttxKeyvalueBlock.style = tttxKeyvalueBlockCss;
64
64
 
65
65
  export { TttxKeyvalueBlock as tttx_keyvalue_block };
@@ -1,38 +1,38 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-9cde46a5.js';
2
- import { p as purify, d as domSanitiserOptions } from './domsanitiser.options-cc420431.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-d784fb3e.js';
2
+ import { p as purify, d as domSanitiserOptions } from './domsanitiser.options-3c7ded83.js';
3
3
 
4
4
  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}";
5
5
 
6
- const TttxList = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.rowClick = createEvent(this, "listRowClick", 7);
10
- this.data = undefined;
11
- this.name = undefined;
12
- }
13
- onRowClickHandler(item) {
14
- if (!item.clickable || !item.rowData)
15
- return;
16
- this.rowClick.emit({ name: this.name, data: item.rowData });
17
- }
18
- renderListItem(item) {
19
- const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
20
- return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
21
- this.onRowClickHandler(item);
22
- } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
23
- }
24
- render() {
25
- if (!this.data)
26
- return;
27
- if (typeof this.data === 'string') {
28
- this._data = JSON.parse(this.data);
29
- }
30
- else {
31
- this._data = this.data;
32
- }
33
- return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
34
- }
35
- };
6
+ const TttxList = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.rowClick = createEvent(this, "listRowClick", 7);
10
+ this.data = undefined;
11
+ this.name = undefined;
12
+ }
13
+ onRowClickHandler(item) {
14
+ if (!item.clickable || !item.rowData)
15
+ return;
16
+ this.rowClick.emit({ name: this.name, data: item.rowData });
17
+ }
18
+ renderListItem(item) {
19
+ const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
20
+ return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
21
+ this.onRowClickHandler(item);
22
+ } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
23
+ }
24
+ render() {
25
+ if (!this.data)
26
+ return;
27
+ if (typeof this.data === 'string') {
28
+ this._data = JSON.parse(this.data);
29
+ }
30
+ else {
31
+ this._data = this.data;
32
+ }
33
+ return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
34
+ }
35
+ };
36
36
  TttxList.style = tttxListCss;
37
37
 
38
38
  export { TttxList as tttx_list };
@@ -1,22 +1,22 @@
1
- import { r as registerInstance, h } from './index-9cde46a5.js';
1
+ import { r as registerInstance, h } from './index-d784fb3e.js';
2
2
 
3
3
  const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.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 = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.loadingMessage = undefined;
9
- this.size = 'large';
10
- }
11
- renderLoadingMessage() {
12
- if (!this.loadingMessage)
13
- return '';
14
- return h("div", { class: "loading-text" }, "Loading, please wait...");
15
- }
16
- render() {
17
- return (h("div", null, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
18
- }
19
- };
5
+ const TttxLoadingSpinner = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.loadingMessage = undefined;
9
+ this.size = 'large';
10
+ }
11
+ renderLoadingMessage() {
12
+ if (!this.loadingMessage)
13
+ return '';
14
+ return h("div", { class: "loading-text" }, "Loading, please wait...");
15
+ }
16
+ render() {
17
+ return (h("div", null, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
18
+ }
19
+ };
20
20
  TttxLoadingSpinner.style = tttxLoadingSpinnerCss;
21
21
 
22
22
  export { TttxLoadingSpinner as tttx_loading_spinner };
@@ -1,108 +1,108 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-9cde46a5.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-d784fb3e.js';
2
2
 
3
3
  const tttxSorterCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.sorter-container{display:flex;flex-direction:row;position:relative;border:1px solid #d5d5d5;border-radius:4px;font-weight:400;box-sizing:border-box;height:36px}@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;background-color:white;border:none;border-bottom-left-radius:4px;border-top-left-radius:4px}@media (max-width: 475px){.sorter-container .arrow-toggle-button{padding-right:0px;padding-left:8px}}.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;flex-grow:1}.sorter-container .dropdown-selector .dropdown-selector-button{display:inline-flex;flex-direction:row;gap:4px;padding-right:4px;align-items:center;color:#212121;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;margin-left:auto;right:0;top:0;flex-direction:row;align-items:center;height:36px}.sorter-container .dropdown-selector .dropdown-selector-chevron .hydrated{height:24px}@media (max-width: 475px){.sorter-container .dropdown-selector .dropdown-selector-chevron{padding-right:2px}}.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;background-color:white}@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}}";
4
4
 
5
- const TttxSorter = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.sorterChangeEvent = createEvent(this, "sorterChangeEvent", 7);
9
- this.sorterKey = undefined;
10
- this.defaultSortDirection = 'descending';
11
- this.fieldOptionsData = null;
12
- this.defaultOption = '';
13
- this.selectedField = this.defaultOption;
14
- this.sortDirection = this.defaultSortDirection;
15
- this.dropdownExpand = false;
16
- this.dropdownOptions = undefined;
17
- }
18
- emitSortEvent() {
19
- this.sorterChangeEvent.emit({
20
- sorterDirection: this.sortDirection,
21
- sorterKey: this.sorterKey,
22
- sortField: this.selectedField,
23
- });
24
- }
25
- onSortToggleClick(event) {
26
- event.preventDefault();
27
- if (this.sortDirection == 'ascending') {
28
- this.sortDirection = 'descending';
29
- }
30
- else {
31
- this.sortDirection = 'ascending';
32
- }
33
- this.emitSortEvent();
34
- }
35
- onDropdownClicked() {
36
- this.dropdownExpand = !this.dropdownExpand;
37
- }
38
- onDropdownSelected(event) {
39
- this.dropdownExpand = false;
40
- const target = event.target;
41
- this.selectedField = target.innerHTML;
42
- this.emitSortEvent();
43
- }
44
- // getOptionsList() {
45
- // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
46
- // }
47
- // /* istanbul ignore next */
48
- // @Listen('keyup')
49
- // handleKeyDown(ev: KeyboardEvent) {
50
- // const keyboardEventValue = ev.key;
51
- // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
52
- // switch (keyboardEventValue) {
53
- // case 'Enter':
54
- // if (this._focussedElementIndex > -1) {
55
- // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
56
- // this.selectedField = options[this._focussedElementIndex].innerHTML;
57
- // this.emitSortEvent();
58
- // }
59
- // this.dropdownExpand = false;
60
- // break;
61
- // case 'Escape':
62
- // this.dropdownExpand = false;
63
- // break;
64
- // case 'ArrowDown':
65
- // this.dropdownExpand = true;
66
- // if (this._focussedElementIndex > -1) {
67
- // const options = this.getOptionsList();
68
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
69
- // currentOption.blur();
70
- // options[this._focussedElementIndex].focus();
71
- // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
72
- // } else {
73
- // this._focussedElementIndex++;
74
- // }
75
- // break;
76
- // case 'ArrowUp':
77
- // this.dropdownExpand = true;
78
- // if (this._focussedElementIndex == -1) {
79
- // const options = this.getOptionsList();
80
- // this._focussedElementIndex = options.length - 1;
81
- // } else {
82
- // const options = this.getOptionsList();
83
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
84
- // currentOption.blur();
85
- // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
86
- // options[this._focussedElementIndex].focus();
87
- // }
88
- // break;
89
- // }
90
- // }
91
- render() {
92
- const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
93
- if (!this.fieldOptionsData)
94
- return;
95
- const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
96
- const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
97
- const selectedOption = this.selectedField;
98
- const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
99
- const sorterKey = `sorter__${this.sorterKey}`;
100
- 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 => {
101
- return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
102
- }))))));
103
- }
104
- get el() { return getElement(this); }
105
- };
5
+ const TttxSorter = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.sorterChangeEvent = createEvent(this, "sorterChangeEvent", 7);
9
+ this.sorterKey = undefined;
10
+ this.defaultSortDirection = 'descending';
11
+ this.fieldOptionsData = null;
12
+ this.defaultOption = '';
13
+ this.selectedField = this.defaultOption;
14
+ this.sortDirection = this.defaultSortDirection;
15
+ this.dropdownExpand = false;
16
+ this.dropdownOptions = undefined;
17
+ }
18
+ emitSortEvent() {
19
+ this.sorterChangeEvent.emit({
20
+ sorterDirection: this.sortDirection,
21
+ sorterKey: this.sorterKey,
22
+ sortField: this.selectedField,
23
+ });
24
+ }
25
+ onSortToggleClick(event) {
26
+ event.preventDefault();
27
+ if (this.sortDirection == 'ascending') {
28
+ this.sortDirection = 'descending';
29
+ }
30
+ else {
31
+ this.sortDirection = 'ascending';
32
+ }
33
+ this.emitSortEvent();
34
+ }
35
+ onDropdownClicked() {
36
+ this.dropdownExpand = !this.dropdownExpand;
37
+ }
38
+ onDropdownSelected(event) {
39
+ this.dropdownExpand = false;
40
+ const target = event.target;
41
+ this.selectedField = target.innerHTML;
42
+ this.emitSortEvent();
43
+ }
44
+ // getOptionsList() {
45
+ // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
46
+ // }
47
+ // /* istanbul ignore next */
48
+ // @Listen('keyup')
49
+ // handleKeyDown(ev: KeyboardEvent) {
50
+ // const keyboardEventValue = ev.key;
51
+ // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
52
+ // switch (keyboardEventValue) {
53
+ // case 'Enter':
54
+ // if (this._focussedElementIndex > -1) {
55
+ // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
56
+ // this.selectedField = options[this._focussedElementIndex].innerHTML;
57
+ // this.emitSortEvent();
58
+ // }
59
+ // this.dropdownExpand = false;
60
+ // break;
61
+ // case 'Escape':
62
+ // this.dropdownExpand = false;
63
+ // break;
64
+ // case 'ArrowDown':
65
+ // this.dropdownExpand = true;
66
+ // if (this._focussedElementIndex > -1) {
67
+ // const options = this.getOptionsList();
68
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
69
+ // currentOption.blur();
70
+ // options[this._focussedElementIndex].focus();
71
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
72
+ // } else {
73
+ // this._focussedElementIndex++;
74
+ // }
75
+ // break;
76
+ // case 'ArrowUp':
77
+ // this.dropdownExpand = true;
78
+ // if (this._focussedElementIndex == -1) {
79
+ // const options = this.getOptionsList();
80
+ // this._focussedElementIndex = options.length - 1;
81
+ // } else {
82
+ // const options = this.getOptionsList();
83
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
84
+ // currentOption.blur();
85
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
86
+ // options[this._focussedElementIndex].focus();
87
+ // }
88
+ // break;
89
+ // }
90
+ // }
91
+ render() {
92
+ const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
93
+ if (!this.fieldOptionsData)
94
+ return;
95
+ const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
96
+ const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
97
+ const selectedOption = this.selectedField;
98
+ const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
99
+ const sorterKey = `sorter__${this.sorterKey}`;
100
+ 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 => {
101
+ return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
102
+ }))))));
103
+ }
104
+ get el() { return getElement(this); }
105
+ };
106
106
  TttxSorter.style = tttxSorterCss;
107
107
 
108
108
  export { TttxSorter as tttx_sorter };