@3t-transform/threeteeui 0.1.52 → 0.1.57

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 (117) hide show
  1. package/dist/cjs/{domsanitiser.options-b2d88e35.js → domsanitiser.options-cd2932a9.js} +17 -17
  2. package/dist/cjs/tttx-button.cjs.entry.js +23 -23
  3. package/dist/cjs/tttx-dialog-box.cjs.entry.js +69 -69
  4. package/dist/cjs/tttx-filter.cjs.entry.js +182 -180
  5. package/dist/cjs/tttx-form.cjs.entry.js +457 -457
  6. package/dist/cjs/tttx-icon.cjs.entry.js +10 -10
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +58 -58
  8. package/dist/cjs/tttx-list.cjs.entry.js +31 -31
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +15 -15
  10. package/dist/cjs/tttx-qrcode.cjs.entry.js +27 -27
  11. package/dist/cjs/tttx-sorter.cjs.entry.js +107 -104
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +78 -78
  13. package/dist/cjs/tttx-toolbar.cjs.entry.js +9 -9
  14. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  16. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  17. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  18. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  19. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  20. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  22. package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.js +81 -81
  23. package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.stories.js +22 -22
  24. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +172 -172
  25. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +289 -289
  26. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +416 -400
  27. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +80 -80
  28. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
  29. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -61
  30. package/dist/collection/components/molecules/tttx-form/tttx-form.js +479 -479
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +272 -272
  32. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  33. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  34. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +253 -236
  35. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
  36. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
  37. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
  38. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  39. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  40. package/dist/collection/components/palette.stories.js +7 -7
  41. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  42. package/dist/collection/icons.js +2838 -2838
  43. package/dist/collection/index.js +1 -1
  44. package/dist/collection/shared/domsanitiser.options.js +14 -14
  45. package/dist/components/domsanitiser.options.js +17 -17
  46. package/dist/components/tttx-button2.js +48 -48
  47. package/dist/components/tttx-dialog-box.js +97 -97
  48. package/dist/components/tttx-filter.js +217 -215
  49. package/dist/components/tttx-form.js +475 -475
  50. package/dist/components/tttx-icon2.js +28 -28
  51. package/dist/components/tttx-keyvalue-block.js +76 -76
  52. package/dist/components/tttx-list.js +53 -53
  53. package/dist/components/tttx-loading-spinner.js +33 -33
  54. package/dist/components/tttx-qrcode.js +45 -45
  55. package/dist/components/tttx-sorter.js +136 -133
  56. package/dist/components/tttx-standalone-input.js +130 -130
  57. package/dist/components/tttx-toolbar.js +26 -26
  58. package/dist/esm/{domsanitiser.options-81611f82.js → domsanitiser.options-563c1cf3.js} +17 -17
  59. package/dist/esm/polyfills/core-js.js +0 -0
  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 +23 -23
  65. package/dist/esm/tttx-dialog-box.entry.js +69 -69
  66. package/dist/esm/tttx-filter.entry.js +182 -180
  67. package/dist/esm/tttx-form.entry.js +457 -457
  68. package/dist/esm/tttx-icon.entry.js +10 -10
  69. package/dist/esm/tttx-keyvalue-block.entry.js +58 -58
  70. package/dist/esm/tttx-list.entry.js +31 -31
  71. package/dist/esm/tttx-loading-spinner.entry.js +15 -15
  72. package/dist/esm/tttx-qrcode.entry.js +27 -27
  73. package/dist/esm/tttx-sorter.entry.js +107 -104
  74. package/dist/esm/tttx-standalone-input.entry.js +78 -78
  75. package/dist/esm/tttx-toolbar.entry.js +9 -9
  76. package/dist/tttx/p-225e6fa6.entry.js +1 -0
  77. package/dist/tttx/{p-bc3b9283.entry.js → p-58d7c978.entry.js} +1 -1
  78. package/dist/tttx/{p-c751ebc2.entry.js → p-8b511fff.entry.js} +1 -1
  79. package/dist/tttx/{p-6a6ff7b7.entry.js → p-909c090d.entry.js} +1 -1
  80. package/dist/tttx/p-a658e1ac.entry.js +1 -0
  81. package/dist/tttx/{p-0b25ac9c.js → p-d3835fde.js} +2 -2
  82. package/dist/tttx/tttx.esm.js +1 -1
  83. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  84. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  85. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  86. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  87. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  88. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  89. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  90. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  91. package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.d.ts +8 -8
  92. package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.stories.d.ts +23 -23
  93. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.d.ts +18 -18
  94. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.d.ts +24 -24
  95. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +44 -43
  96. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +76 -0
  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 +133 -133
  100. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +278 -0
  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 -0
  103. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +21 -20
  104. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -0
  105. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
  106. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
  107. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  108. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  109. package/dist/types/components/palette.stories.d.ts +6 -6
  110. package/dist/types/components.d.ts +2 -0
  111. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  112. package/dist/types/icons.d.ts +2 -2
  113. package/dist/types/index.d.ts +1 -1
  114. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  115. package/package.json +1 -1
  116. package/dist/tttx/p-3b29e8af.entry.js +0 -1
  117. package/dist/tttx/p-637e7e88.entry.js +0 -1
@@ -6,16 +6,16 @@ const index = require('./index-43af0e62.js');
6
6
 
7
7
  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}";
8
8
 
9
- const TttxIcon = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.icon = undefined;
13
- this.color = 'grey';
14
- }
15
- render() {
16
- return (index.h(index.Host, null, index.h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
17
- }
18
- };
9
+ const TttxIcon = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.icon = undefined;
13
+ this.color = 'grey';
14
+ }
15
+ render() {
16
+ return (index.h(index.Host, null, index.h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
17
+ }
18
+ };
19
19
  TttxIcon.style = tttxIconCss;
20
20
 
21
21
  exports.tttx_icon = TttxIcon;
@@ -6,64 +6,64 @@ const index = require('./index-43af0e62.js');
6
6
 
7
7
  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}}";
8
8
 
9
- const TttxKeyvalueBlock = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.keyvalues = undefined;
13
- this.horizontal = undefined;
14
- }
15
- renderSingleElements(values) {
16
- const keys = Object.keys(values);
17
- const elements = [];
18
- const divSize = (100 / keys.length).toString() + '%';
19
- for (let i = 0; i < keys.length; i++) {
20
- if (this.horizontal) {
21
- elements.push(index.h("div", { style: { maxWidth: divSize } }, index.h("dt", null, keys[i]), index.h("dd", null, values[keys[i]])));
22
- }
23
- else {
24
- elements.push(index.h("dt", null, keys[i]));
25
- elements.push(index.h("dd", null, values[keys[i]]));
26
- }
27
- }
28
- return elements;
29
- }
30
- renderArrayElements(values) {
31
- const elements = [];
32
- const divSize = (100 / values.length).toString() + '%';
33
- for (let i = 0; i < values.length; i++) {
34
- const value = values[i];
35
- if (this.horizontal) {
36
- elements.push(index.h("div", { style: { maxWidth: divSize } }, index.h("dt", { class: 'mainTitle' }, value.title), index.h("dt", { class: 'subTitle' }, value.subTitle), index.h("dd", null, value.data)));
37
- }
38
- else {
39
- elements.push(index.h("dt", { class: 'mainTitle' }, value.title));
40
- elements.push(index.h("dt", { class: 'subTitle' }, value.subTitle));
41
- elements.push(index.h("dd", null, value.data));
42
- }
43
- }
44
- return elements;
45
- }
46
- render() {
47
- if (!this.keyvalues) {
48
- return;
49
- }
50
- let values;
51
- if (typeof this.keyvalues === 'string') {
52
- values = JSON.parse(this.keyvalues);
53
- }
54
- else {
55
- values = this.keyvalues;
56
- }
57
- let elements;
58
- if (Array.isArray(values)) {
59
- elements = this.renderArrayElements(values);
60
- }
61
- else {
62
- elements = this.renderSingleElements(values);
63
- }
64
- return (index.h(index.Host, null, index.h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
65
- }
66
- };
9
+ const TttxKeyvalueBlock = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.keyvalues = undefined;
13
+ this.horizontal = undefined;
14
+ }
15
+ renderSingleElements(values) {
16
+ const keys = Object.keys(values);
17
+ const elements = [];
18
+ const divSize = (100 / keys.length).toString() + '%';
19
+ for (let i = 0; i < keys.length; i++) {
20
+ if (this.horizontal) {
21
+ elements.push(index.h("div", { style: { maxWidth: divSize } }, index.h("dt", null, keys[i]), index.h("dd", null, values[keys[i]])));
22
+ }
23
+ else {
24
+ elements.push(index.h("dt", null, keys[i]));
25
+ elements.push(index.h("dd", null, values[keys[i]]));
26
+ }
27
+ }
28
+ return elements;
29
+ }
30
+ renderArrayElements(values) {
31
+ const elements = [];
32
+ const divSize = (100 / values.length).toString() + '%';
33
+ for (let i = 0; i < values.length; i++) {
34
+ const value = values[i];
35
+ if (this.horizontal) {
36
+ elements.push(index.h("div", { style: { maxWidth: divSize } }, index.h("dt", { class: 'mainTitle' }, value.title), index.h("dt", { class: 'subTitle' }, value.subTitle), index.h("dd", null, value.data)));
37
+ }
38
+ else {
39
+ elements.push(index.h("dt", { class: 'mainTitle' }, value.title));
40
+ elements.push(index.h("dt", { class: 'subTitle' }, value.subTitle));
41
+ elements.push(index.h("dd", null, value.data));
42
+ }
43
+ }
44
+ return elements;
45
+ }
46
+ render() {
47
+ if (!this.keyvalues) {
48
+ return;
49
+ }
50
+ let values;
51
+ if (typeof this.keyvalues === 'string') {
52
+ values = JSON.parse(this.keyvalues);
53
+ }
54
+ else {
55
+ values = this.keyvalues;
56
+ }
57
+ let elements;
58
+ if (Array.isArray(values)) {
59
+ elements = this.renderArrayElements(values);
60
+ }
61
+ else {
62
+ elements = this.renderSingleElements(values);
63
+ }
64
+ return (index.h(index.Host, null, index.h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
65
+ }
66
+ };
67
67
  TttxKeyvalueBlock.style = tttxKeyvalueBlockCss;
68
68
 
69
69
  exports.tttx_keyvalue_block = TttxKeyvalueBlock;
@@ -3,41 +3,41 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-43af0e62.js');
6
- const domsanitiser_options = require('./domsanitiser.options-b2d88e35.js');
6
+ const domsanitiser_options = require('./domsanitiser.options-cd2932a9.js');
7
7
  require('./_commonjsHelpers-537d719a.js');
8
8
 
9
9
  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}";
10
10
 
11
- const TttxList = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.rowClick = index.createEvent(this, "listRowClick", 7);
15
- this.data = undefined;
16
- this.name = undefined;
17
- }
18
- onRowClickHandler(item) {
19
- if (!item.clickable || !item.rowData)
20
- return;
21
- this.rowClick.emit({ name: this.name, data: item.rowData });
22
- }
23
- renderListItem(item) {
24
- const cleanHTML = domsanitiser_options.purify.sanitize(item.element, domsanitiser_options.domSanitiserOptions);
25
- return (index.h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
26
- this.onRowClickHandler(item);
27
- } }, item.element && index.h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && index.h("tttx-icon", { class: "align-right ", icon: item.icon })));
28
- }
29
- render() {
30
- if (!this.data)
31
- return;
32
- if (typeof this.data === 'string') {
33
- this._data = JSON.parse(this.data);
34
- }
35
- else {
36
- this._data = this.data;
37
- }
38
- return index.h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
39
- }
40
- };
11
+ const TttxList = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.rowClick = index.createEvent(this, "listRowClick", 7);
15
+ this.data = undefined;
16
+ this.name = undefined;
17
+ }
18
+ onRowClickHandler(item) {
19
+ if (!item.clickable || !item.rowData)
20
+ return;
21
+ this.rowClick.emit({ name: this.name, data: item.rowData });
22
+ }
23
+ renderListItem(item) {
24
+ const cleanHTML = domsanitiser_options.purify.sanitize(item.element, domsanitiser_options.domSanitiserOptions);
25
+ return (index.h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
26
+ this.onRowClickHandler(item);
27
+ } }, item.element && index.h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && index.h("tttx-icon", { class: "align-right ", icon: item.icon })));
28
+ }
29
+ render() {
30
+ if (!this.data)
31
+ return;
32
+ if (typeof this.data === 'string') {
33
+ this._data = JSON.parse(this.data);
34
+ }
35
+ else {
36
+ this._data = this.data;
37
+ }
38
+ return index.h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
39
+ }
40
+ };
41
41
  TttxList.style = tttxListCss;
42
42
 
43
43
  exports.tttx_list = TttxList;
@@ -6,21 +6,21 @@ const index = require('./index-43af0e62.js');
6
6
 
7
7
  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)}}";
8
8
 
9
- const TttxLoadingSpinner = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.loadingMessage = undefined;
13
- this.size = 'large';
14
- }
15
- renderLoadingMessage() {
16
- if (!this.loadingMessage)
17
- return '';
18
- return index.h("div", { class: "loading-text" }, "Loading, please wait...");
19
- }
20
- render() {
21
- return (index.h("div", null, index.h("div", { class: "loading-box" }, index.h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
22
- }
23
- };
9
+ const TttxLoadingSpinner = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.loadingMessage = undefined;
13
+ this.size = 'large';
14
+ }
15
+ renderLoadingMessage() {
16
+ if (!this.loadingMessage)
17
+ return '';
18
+ return index.h("div", { class: "loading-text" }, "Loading, please wait...");
19
+ }
20
+ render() {
21
+ return (index.h("div", null, index.h("div", { class: "loading-box" }, index.h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
22
+ }
23
+ };
24
24
  TttxLoadingSpinner.style = tttxLoadingSpinnerCss;
25
25
 
26
26
  exports.tttx_loading_spinner = TttxLoadingSpinner;
@@ -11,33 +11,33 @@ var qrcode_min = _commonjsHelpers.createCommonjsModule(function (module, exports
11
11
 
12
12
  const tttxQrcodeCss = "";
13
13
 
14
- const TttxQrCode = class {
15
- constructor(hostRef) {
16
- index.registerInstance(this, hostRef);
17
- this.link = 'https://example.com';
18
- this.size = 258;
19
- }
20
- componentDidLoad() {
21
- const options = {
22
- width: this.size,
23
- height: this.size,
24
- correctLevel: qrcode_min.QRErrorCorrectLevel.H,
25
- background: '#ffffff',
26
- foreground: '#000000',
27
- text: this.link,
28
- };
29
- this.setShadowCanvas('qrcode', options);
30
- }
31
- setShadowCanvas(id, options) {
32
- const parent = this.hostElement.shadowRoot.getElementById(id);
33
- parent.innerHTML = '';
34
- parent.appendChild(qrcode_min.QRCode.createCanvas(options));
35
- }
36
- render() {
37
- return index.h("div", { id: "qrcode" });
38
- }
39
- get hostElement() { return index.getElement(this); }
40
- };
14
+ const TttxQrCode = class {
15
+ constructor(hostRef) {
16
+ index.registerInstance(this, hostRef);
17
+ this.link = 'https://example.com';
18
+ this.size = 258;
19
+ }
20
+ componentDidLoad() {
21
+ const options = {
22
+ width: this.size,
23
+ height: this.size,
24
+ correctLevel: qrcode_min.QRErrorCorrectLevel.H,
25
+ background: '#ffffff',
26
+ foreground: '#000000',
27
+ text: this.link,
28
+ };
29
+ this.setShadowCanvas('qrcode', options);
30
+ }
31
+ setShadowCanvas(id, options) {
32
+ const parent = this.hostElement.shadowRoot.getElementById(id);
33
+ parent.innerHTML = '';
34
+ parent.appendChild(qrcode_min.QRCode.createCanvas(options));
35
+ }
36
+ render() {
37
+ return index.h("div", { id: "qrcode" });
38
+ }
39
+ get hostElement() { return index.getElement(this); }
40
+ };
41
41
  TttxQrCode.style = tttxQrcodeCss;
42
42
 
43
43
  exports.tttx_qrcode = TttxQrCode;
@@ -6,110 +6,113 @@ const index = require('./index-43af0e62.js');
6
6
 
7
7
  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;cursor:pointer;width:220px}@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;cursor:pointer}.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;cursor:pointer}@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:220px;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:#ebfbfc}.sorter-container.--expanded{border-color:#1579c6}@media (max-width: 475px){.sorter-container.--expanded{border:none}}";
8
8
 
9
- const TttxSorter = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.sorterChangeEvent = index.createEvent(this, "sorterChangeEvent", 7);
13
- this.sorterKey = undefined;
14
- this.defaultSortDirection = 'descending';
15
- this.fieldOptionsData = null;
16
- this.defaultOption = '';
17
- this.selectedField = this.defaultOption;
18
- this.sortDirection = this.defaultSortDirection;
19
- this.dropdownExpand = false;
20
- this.dropdownOptions = undefined;
21
- }
22
- handleCloseSorter() {
23
- this.dropdownExpand = false;
24
- }
25
- emitSortEvent() {
26
- this.sorterChangeEvent.emit({
27
- sorterDirection: this.sortDirection,
28
- sorterKey: this.sorterKey,
29
- sortField: this.selectedField,
30
- });
31
- }
32
- onSortToggleClick(event) {
33
- event.preventDefault();
34
- if (this.sortDirection == 'ascending') {
35
- this.sortDirection = 'descending';
36
- }
37
- else {
38
- this.sortDirection = 'ascending';
39
- }
40
- this.emitSortEvent();
41
- }
42
- onDropdownClicked() {
43
- this.dropdownExpand = !this.dropdownExpand;
44
- }
45
- onDropdownSelected(event) {
46
- this.dropdownExpand = false;
47
- const target = event.target;
48
- this.selectedField = target.innerHTML;
49
- this.emitSortEvent();
50
- }
51
- // getOptionsList() {
52
- // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
53
- // }
54
- // /* istanbul ignore next */
55
- // @Listen('keyup')
56
- // handleKeyDown(ev: KeyboardEvent) {
57
- // const keyboardEventValue = ev.key;
58
- // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
59
- // switch (keyboardEventValue) {
60
- // case 'Enter':
61
- // if (this._focussedElementIndex > -1) {
62
- // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
63
- // this.selectedField = options[this._focussedElementIndex].innerHTML;
64
- // this.emitSortEvent();
65
- // }
66
- // this.dropdownExpand = false;
67
- // break;
68
- // case 'Escape':
69
- // this.dropdownExpand = false;
70
- // break;
71
- // case 'ArrowDown':
72
- // this.dropdownExpand = true;
73
- // if (this._focussedElementIndex > -1) {
74
- // const options = this.getOptionsList();
75
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
76
- // currentOption.blur();
77
- // options[this._focussedElementIndex].focus();
78
- // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
79
- // } else {
80
- // this._focussedElementIndex++;
81
- // }
82
- // break;
83
- // case 'ArrowUp':
84
- // this.dropdownExpand = true;
85
- // if (this._focussedElementIndex == -1) {
86
- // const options = this.getOptionsList();
87
- // this._focussedElementIndex = options.length - 1;
88
- // } else {
89
- // const options = this.getOptionsList();
90
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
91
- // currentOption.blur();
92
- // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
93
- // options[this._focussedElementIndex].focus();
94
- // }
95
- // break;
96
- // }
97
- // }
98
- render() {
99
- const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
100
- if (!this.fieldOptionsData)
101
- return;
102
- const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
103
- const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
104
- const selectedOption = this.selectedField;
105
- const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
106
- const sorterKey = `sorter__${this.sorterKey}`;
107
- return (index.h(index.Host, { id: sorterKey }, index.h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, index.h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, index.h("tttx-icon", { icon: arrowIcon, color: "black" })), index.h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, index.h("div", { class: "dropdown-selector-button" }, index.h("div", { class: "dropdown-selector-text" }, selectedOption), index.h("div", { class: "dropdown-selector-chevron" }, index.h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (index.h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
108
- return (index.h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
109
- }))))));
110
- }
111
- get el() { return index.getElement(this); }
112
- };
9
+ const TttxSorter = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.sorterChangeEvent = index.createEvent(this, "sorterChangeEvent", 7);
13
+ this.toggleSorter = index.createEvent(this, "toggleSorter", 7);
14
+ this.sorterKey = undefined;
15
+ this.defaultSortDirection = 'descending';
16
+ this.fieldOptionsData = null;
17
+ this.defaultOption = '';
18
+ this.selectedField = this.defaultOption;
19
+ this.sortDirection = this.defaultSortDirection;
20
+ this.dropdownExpand = false;
21
+ this.dropdownOptions = undefined;
22
+ }
23
+ handleCloseSorter() {
24
+ this.dropdownExpand = false;
25
+ }
26
+ emitSortEvent() {
27
+ this.sorterChangeEvent.emit({
28
+ sorterDirection: this.sortDirection,
29
+ sorterKey: this.sorterKey,
30
+ sortField: this.selectedField,
31
+ });
32
+ }
33
+ onSortToggleClick(event) {
34
+ event.preventDefault();
35
+ if (this.sortDirection == 'ascending') {
36
+ this.sortDirection = 'descending';
37
+ }
38
+ else {
39
+ this.sortDirection = 'ascending';
40
+ }
41
+ this.emitSortEvent();
42
+ }
43
+ onDropdownClicked() {
44
+ this.dropdownExpand = !this.dropdownExpand;
45
+ this.toggleSorter.emit(this.dropdownExpand);
46
+ }
47
+ onDropdownSelected(event) {
48
+ this.dropdownExpand = false;
49
+ const target = event.target;
50
+ this.selectedField = target.innerHTML;
51
+ this.emitSortEvent();
52
+ this.toggleSorter.emit(this.dropdownExpand);
53
+ }
54
+ // getOptionsList() {
55
+ // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
56
+ // }
57
+ // /* istanbul ignore next */
58
+ // @Listen('keyup')
59
+ // handleKeyDown(ev: KeyboardEvent) {
60
+ // const keyboardEventValue = ev.key;
61
+ // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
62
+ // switch (keyboardEventValue) {
63
+ // case 'Enter':
64
+ // if (this._focussedElementIndex > -1) {
65
+ // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
66
+ // this.selectedField = options[this._focussedElementIndex].innerHTML;
67
+ // this.emitSortEvent();
68
+ // }
69
+ // this.dropdownExpand = false;
70
+ // break;
71
+ // case 'Escape':
72
+ // this.dropdownExpand = false;
73
+ // break;
74
+ // case 'ArrowDown':
75
+ // this.dropdownExpand = true;
76
+ // if (this._focussedElementIndex > -1) {
77
+ // const options = this.getOptionsList();
78
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
79
+ // currentOption.blur();
80
+ // options[this._focussedElementIndex].focus();
81
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
82
+ // } else {
83
+ // this._focussedElementIndex++;
84
+ // }
85
+ // break;
86
+ // case 'ArrowUp':
87
+ // this.dropdownExpand = true;
88
+ // if (this._focussedElementIndex == -1) {
89
+ // const options = this.getOptionsList();
90
+ // this._focussedElementIndex = options.length - 1;
91
+ // } else {
92
+ // const options = this.getOptionsList();
93
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
94
+ // currentOption.blur();
95
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
96
+ // options[this._focussedElementIndex].focus();
97
+ // }
98
+ // break;
99
+ // }
100
+ // }
101
+ render() {
102
+ const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
103
+ if (!this.fieldOptionsData)
104
+ return;
105
+ const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
106
+ const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
107
+ const selectedOption = this.selectedField;
108
+ const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
109
+ const sorterKey = `sorter__${this.sorterKey}`;
110
+ return (index.h(index.Host, { id: sorterKey }, index.h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, index.h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, index.h("tttx-icon", { icon: arrowIcon, color: "black" })), index.h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, index.h("div", { class: "dropdown-selector-button" }, index.h("div", { class: "dropdown-selector-text" }, selectedOption), index.h("div", { class: "dropdown-selector-chevron" }, index.h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (index.h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
111
+ return (index.h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
112
+ }))))));
113
+ }
114
+ get el() { return index.getElement(this); }
115
+ };
113
116
  TttxSorter.style = tttxSorterCss;
114
117
 
115
118
  exports.tttx_sorter = TttxSorter;