@3t-transform/threeteeui 0.1.42 → 0.1.44

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 (163) hide show
  1. package/dist/cjs/{domsanitiser.options-277161b9.js → domsanitiser.options-975e3317.js} +12 -12
  2. package/dist/cjs/{index-76f14107.js → index-2ea393bb.js} +146 -3
  3. package/dist/cjs/loader.cjs.js +4 -19
  4. package/dist/cjs/tttx-button.cjs.entry.js +24 -24
  5. package/dist/cjs/tttx-dialog-box.cjs.entry.js +80 -0
  6. package/dist/cjs/tttx-filter.cjs.entry.js +177 -159
  7. package/dist/cjs/tttx-form.cjs.entry.js +458 -458
  8. package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
  9. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +59 -59
  10. package/dist/cjs/tttx-list.cjs.entry.js +32 -32
  11. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  12. package/dist/cjs/tttx-sorter.cjs.entry.js +102 -102
  13. package/dist/cjs/tttx-standalone-input.cjs.entry.js +79 -79
  14. package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
  15. package/dist/cjs/tttx.cjs.js +9 -117
  16. package/dist/collection/collection-manifest.json +3 -2
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  18. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  19. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  20. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  21. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
  22. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  23. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  24. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  25. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.css +146 -0
  26. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +172 -0
  27. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +380 -0
  28. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +369 -334
  29. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +73 -62
  30. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
  31. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -61
  32. package/dist/collection/components/molecules/tttx-form/tttx-form.js +479 -479
  33. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +272 -272
  34. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  35. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  36. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +224 -224
  37. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
  38. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
  39. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
  40. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  41. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  42. package/dist/collection/components/palette.stories.js +7 -7
  43. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  44. package/dist/collection/icons.js +2838 -2838
  45. package/dist/collection/index.js +1 -1
  46. package/dist/collection/shared/domsanitiser.options.js +14 -14
  47. package/dist/components/domsanitiser.options.js +15 -45
  48. package/dist/components/index.d.ts +10 -0
  49. package/dist/components/index.js +2 -5
  50. package/dist/components/tttx-button.js +1 -54
  51. package/dist/{tttx/tttx-button.entry.js → components/tttx-button2.js} +52 -26
  52. package/dist/components/tttx-dialog-box.d.ts +11 -0
  53. package/dist/components/tttx-dialog-box.js +110 -0
  54. package/dist/components/tttx-filter.js +210 -191
  55. package/dist/components/tttx-form.js +475 -475
  56. package/dist/components/tttx-icon2.js +28 -28
  57. package/dist/components/tttx-keyvalue-block.js +76 -76
  58. package/dist/components/tttx-list.js +53 -53
  59. package/dist/components/tttx-loading-spinner.js +33 -33
  60. package/dist/components/tttx-sorter.js +130 -130
  61. package/dist/components/tttx-standalone-input.js +130 -130
  62. package/dist/components/tttx-toolbar.js +26 -26
  63. package/dist/esm/{domsanitiser.options-cc420431.js → domsanitiser.options-3c7ded83.js} +12 -12
  64. package/dist/esm/{index-9cde46a5.js → index-018a3e54.js} +146 -4
  65. package/dist/esm/loader.js +4 -19
  66. package/dist/esm/polyfills/core-js.js +0 -0
  67. package/dist/esm/polyfills/css-shim.js +1 -1
  68. package/dist/esm/polyfills/dom.js +0 -0
  69. package/dist/esm/polyfills/es5-html-element.js +0 -0
  70. package/dist/esm/polyfills/index.js +0 -0
  71. package/dist/esm/polyfills/system.js +0 -0
  72. package/dist/esm/tttx-button.entry.js +24 -24
  73. package/dist/esm/tttx-dialog-box.entry.js +76 -0
  74. package/dist/esm/tttx-filter.entry.js +177 -159
  75. package/dist/esm/tttx-form.entry.js +458 -458
  76. package/dist/esm/tttx-icon.entry.js +11 -11
  77. package/dist/esm/tttx-keyvalue-block.entry.js +59 -59
  78. package/dist/esm/tttx-list.entry.js +32 -32
  79. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  80. package/dist/esm/tttx-sorter.entry.js +102 -102
  81. package/dist/esm/tttx-standalone-input.entry.js +79 -79
  82. package/dist/esm/tttx-toolbar.entry.js +10 -10
  83. package/dist/esm/tttx.js +6 -117
  84. package/dist/tttx/index.esm.js +0 -1
  85. package/dist/tttx/{p-e53c7f9d.entry.js → p-01863bf1.entry.js} +1 -1
  86. package/dist/tttx/{p-4e637d50.entry.js → p-0ed6f369.entry.js} +1 -1
  87. package/dist/tttx/p-2dd43e97.entry.js +1 -0
  88. package/dist/tttx/{p-aef96333.entry.js → p-2e135be9.entry.js} +1 -1
  89. package/dist/tttx/p-350ddb03.js +3 -0
  90. package/dist/tttx/{p-d2f1aa8e.entry.js → p-48b15a3d.entry.js} +1 -1
  91. package/dist/tttx/{p-561224f5.entry.js → p-5e91cf1c.entry.js} +1 -1
  92. package/dist/tttx/p-71c244bd.js +2 -0
  93. package/dist/tttx/{p-dc2a37b0.entry.js → p-7bba2014.entry.js} +1 -1
  94. package/dist/tttx/p-d075a2c0.entry.js +1 -0
  95. package/dist/tttx/{p-bd1edaed.entry.js → p-deec335c.entry.js} +1 -1
  96. package/dist/tttx/{p-9f1e9cc1.entry.js → p-e061910d.entry.js} +1 -1
  97. package/dist/tttx/{p-f885f17a.entry.js → p-f247a7bc.entry.js} +1 -1
  98. package/dist/tttx/tttx.esm.js +1 -129
  99. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  100. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  101. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  102. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  103. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  104. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  105. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  106. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  107. package/dist/types/components/molecules/tttx-dialog-box/interfaces.d.ts +25 -0
  108. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.d.ts +18 -0
  109. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.d.ts +23 -0
  110. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +41 -39
  111. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +70 -68
  112. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  113. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  114. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +133 -133
  115. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +278 -278
  116. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  117. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  118. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +19 -19
  119. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -30
  120. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
  121. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
  122. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  123. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  124. package/dist/types/components/palette.stories.d.ts +6 -6
  125. package/dist/types/components.d.ts +26 -0
  126. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  127. package/dist/types/icons.d.ts +2 -2
  128. package/dist/types/index.d.ts +1 -1
  129. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  130. package/dist/types/stencil-public-runtime.d.ts +59 -3
  131. package/loader/index.d.ts +9 -0
  132. package/package.json +2 -2
  133. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  134. package/dist/cjs/css-shim-211819bc.js +0 -6
  135. package/dist/cjs/dom-9deb26c8.js +0 -75
  136. package/dist/cjs/domsanitiser.options-3f1501b5.js +0 -1697
  137. package/dist/cjs/index-39a867c5.js +0 -3298
  138. package/dist/cjs/shadow-css-bf3843d2.js +0 -389
  139. package/dist/esm/app-globals-0f993ce5.js +0 -3
  140. package/dist/esm/css-shim-9d54a2f2.js +0 -4
  141. package/dist/esm/dom-6be6f662.js +0 -73
  142. package/dist/esm/domsanitiser.options-6f2878c8.js +0 -1694
  143. package/dist/esm/index-e3e64631.js +0 -3262
  144. package/dist/esm/shadow-css-ed4599f8.js +0 -387
  145. package/dist/tttx/app-globals-0f993ce5.js +0 -3
  146. package/dist/tttx/css-shim-9d54a2f2.js +0 -4
  147. package/dist/tttx/dom-6be6f662.js +0 -73
  148. package/dist/tttx/domsanitiser.options-6f2878c8.js +0 -1694
  149. package/dist/tttx/index-e3e64631.js +0 -3262
  150. package/dist/tttx/p-3b1be372.entry.js +0 -1
  151. package/dist/tttx/p-b4290a5b.js +0 -3
  152. package/dist/tttx/p-d0ff9ad0.entry.js +0 -1
  153. package/dist/tttx/p-db059a69.js +0 -2
  154. package/dist/tttx/shadow-css-ed4599f8.js +0 -387
  155. package/dist/tttx/tttx-filter.entry.js +0 -165
  156. package/dist/tttx/tttx-form.entry.js +0 -468
  157. package/dist/tttx/tttx-icon.entry.js +0 -17
  158. package/dist/tttx/tttx-keyvalue-block.entry.js +0 -65
  159. package/dist/tttx/tttx-list.entry.js +0 -38
  160. package/dist/tttx/tttx-loading-spinner.entry.js +0 -22
  161. package/dist/tttx/tttx-sorter.entry.js +0 -108
  162. package/dist/tttx/tttx-standalone-input.entry.js +0 -85
  163. package/dist/tttx/tttx-toolbar.entry.js +0 -16
@@ -1,7 +1,7 @@
1
- export default {
2
- title: 'Atoms/Button',
3
- component: 'tttx-button'
4
- };
1
+ export default {
2
+ title: 'Atoms/Button',
3
+ component: 'tttx-button'
4
+ };
5
5
  const PrimaryButtons = () => `
6
6
  <h2>Standard</h2>
7
7
  <tttx-button design="primary">Primary</tttx-button>
@@ -14,8 +14,8 @@ const PrimaryButtons = () => `
14
14
  <hr />
15
15
  <h2>Icon Only</h2>
16
16
  <tttx-button design="primary" icon="more_vert" notext></tttx-button>
17
- `;
18
- export const Primary = PrimaryButtons.bind({});
17
+ `;
18
+ export const Primary = PrimaryButtons.bind({});
19
19
  const DefaultButtons = () => `
20
20
  <h2>Standard</h2>
21
21
  <tttx-button>Default</tttx-button>
@@ -28,8 +28,8 @@ const DefaultButtons = () => `
28
28
  <hr />
29
29
  <h2>Icon Only</h2>
30
30
  <tttx-button icon="more_vert" notext></tttx-button>
31
- `;
32
- export const Default = DefaultButtons.bind({});
31
+ `;
32
+ export const Default = DefaultButtons.bind({});
33
33
  const BorderlessButtons = () => `
34
34
  <h2>Standard</h2>
35
35
  <tttx-button design="borderless">Borderless</tttx-button>
@@ -42,8 +42,8 @@ const BorderlessButtons = () => `
42
42
  <hr />
43
43
  <h2>Icon Only</h2>
44
44
  <tttx-button design="borderless" icon="more_vert" notext></tttx-button>
45
- `;
46
- export const Borderless = BorderlessButtons.bind({});
45
+ `;
46
+ export const Borderless = BorderlessButtons.bind({});
47
47
  const DangerButtons = () => `
48
48
  <h2>Standard</h2>
49
49
  <tttx-button design="danger">Danger</tttx-button>
@@ -56,8 +56,8 @@ const DangerButtons = () => `
56
56
  <hr />
57
57
  <h2>Icon Only</h2>
58
58
  <tttx-button design="danger" icon="more_vert" notext></tttx-button>
59
- `;
60
- export const Danger = DangerButtons.bind({});
59
+ `;
60
+ export const Danger = DangerButtons.bind({});
61
61
  const DisabledButtons = () => `
62
62
  <h2>Standard</h2>
63
63
  <tttx-button design="disabled">Disabled</tttx-button>
@@ -70,5 +70,5 @@ const DisabledButtons = () => `
70
70
  <hr />
71
71
  <h2>Icon Only</h2>
72
72
  <tttx-button design="disabled" icon="more_vert" notext></tttx-button>
73
- `;
74
- export const Disabled = DisabledButtons.bind({});
73
+ `;
74
+ export const Disabled = DisabledButtons.bind({});
@@ -1,62 +1,62 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- import { Host, h } from '@stencil/core';
3
- export class TttxIcon {
4
- constructor() {
5
- this.icon = undefined;
6
- this.color = 'grey';
7
- }
8
- render() {
9
- return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
10
- }
11
- static get is() { return "tttx-icon"; }
12
- static get encapsulation() { return "shadow"; }
13
- static get originalStyleUrls() {
14
- return {
15
- "$": ["tttx-icon.scss"]
16
- };
17
- }
18
- static get styleUrls() {
19
- return {
20
- "$": ["tttx-icon.css"]
21
- };
22
- }
23
- static get properties() {
24
- return {
25
- "icon": {
26
- "type": "string",
27
- "mutable": false,
28
- "complexType": {
29
- "original": "string",
30
- "resolved": "string",
31
- "references": {}
32
- },
33
- "required": false,
34
- "optional": false,
35
- "docs": {
36
- "tags": [],
37
- "text": ""
38
- },
39
- "attribute": "icon",
40
- "reflect": false
41
- },
42
- "color": {
43
- "type": "string",
44
- "mutable": false,
45
- "complexType": {
46
- "original": "string",
47
- "resolved": "string",
48
- "references": {}
49
- },
50
- "required": false,
51
- "optional": false,
52
- "docs": {
53
- "tags": [],
54
- "text": ""
55
- },
56
- "attribute": "color",
57
- "reflect": false,
58
- "defaultValue": "'grey'"
59
- }
60
- };
61
- }
62
- }
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { Host, h } from '@stencil/core';
3
+ export class TttxIcon {
4
+ constructor() {
5
+ this.icon = undefined;
6
+ this.color = 'grey';
7
+ }
8
+ render() {
9
+ return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
10
+ }
11
+ static get is() { return "tttx-icon"; }
12
+ static get encapsulation() { return "shadow"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["tttx-icon.scss"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["tttx-icon.css"]
21
+ };
22
+ }
23
+ static get properties() {
24
+ return {
25
+ "icon": {
26
+ "type": "string",
27
+ "mutable": false,
28
+ "complexType": {
29
+ "original": "string",
30
+ "resolved": "string",
31
+ "references": {}
32
+ },
33
+ "required": false,
34
+ "optional": false,
35
+ "docs": {
36
+ "tags": [],
37
+ "text": ""
38
+ },
39
+ "attribute": "icon",
40
+ "reflect": false
41
+ },
42
+ "color": {
43
+ "type": "string",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "string",
47
+ "resolved": "string",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": false,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": ""
55
+ },
56
+ "attribute": "color",
57
+ "reflect": false,
58
+ "defaultValue": "'grey'"
59
+ }
60
+ };
61
+ }
62
+ }
@@ -1,22 +1,22 @@
1
- import icons from './../../../icons';
2
- const colors = ['red', 'blue', 'black', 'white', 'gray', 'green', 'orange', 'darkred'];
3
- export default {
4
- title: 'Atoms/Icons',
5
- component: 'tttx-icon',
6
- argTypes: {
7
- icon: {
8
- control: { type: 'select' },
9
- options: icons,
10
- },
11
- color: {
12
- control: { type: 'select' },
13
- options: colors,
14
- },
15
- },
16
- };
17
- const Template = ({ icon, color }) => `<tttx-icon icon="${icon}" color="${color}" />`;
18
- export const Icon = Template.bind({});
19
- Icon.args = {
20
- icon: 'warning',
21
- color: 'red',
22
- };
1
+ import icons from './../../../icons';
2
+ const colors = ['red', 'blue', 'black', 'white', 'gray', 'green', 'orange', 'darkred'];
3
+ export default {
4
+ title: 'Atoms/Icons',
5
+ component: 'tttx-icon',
6
+ argTypes: {
7
+ icon: {
8
+ control: { type: 'select' },
9
+ options: icons,
10
+ },
11
+ color: {
12
+ control: { type: 'select' },
13
+ options: colors,
14
+ },
15
+ },
16
+ };
17
+ const Template = ({ icon, color }) => `<tttx-icon icon="${icon}" color="${color}" />`;
18
+ export const Icon = Template.bind({});
19
+ Icon.args = {
20
+ icon: 'warning',
21
+ color: 'red',
22
+ };
@@ -1,109 +1,109 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- import { h, Host } from '@stencil/core';
3
- export class TttxKeyvalueBlock {
4
- constructor() {
5
- this.keyvalues = undefined;
6
- this.horizontal = undefined;
7
- }
8
- renderSingleElements(values) {
9
- const keys = Object.keys(values);
10
- const elements = [];
11
- const divSize = (100 / keys.length).toString() + '%';
12
- for (let i = 0; i < keys.length; i++) {
13
- if (this.horizontal) {
14
- elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", null, keys[i]), h("dd", null, values[keys[i]])));
15
- }
16
- else {
17
- elements.push(h("dt", null, keys[i]));
18
- elements.push(h("dd", null, values[keys[i]]));
19
- }
20
- }
21
- return elements;
22
- }
23
- renderArrayElements(values) {
24
- const elements = [];
25
- const divSize = (100 / values.length).toString() + '%';
26
- for (let i = 0; i < values.length; i++) {
27
- const value = values[i];
28
- if (this.horizontal) {
29
- elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
30
- }
31
- else {
32
- elements.push(h("dt", { class: 'mainTitle' }, value.title));
33
- elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
34
- elements.push(h("dd", null, value.data));
35
- }
36
- }
37
- return elements;
38
- }
39
- render() {
40
- if (!this.keyvalues) {
41
- return;
42
- }
43
- let values;
44
- if (typeof this.keyvalues === 'string') {
45
- values = JSON.parse(this.keyvalues);
46
- }
47
- else {
48
- values = this.keyvalues;
49
- }
50
- let elements;
51
- if (Array.isArray(values)) {
52
- elements = this.renderArrayElements(values);
53
- }
54
- else {
55
- elements = this.renderSingleElements(values);
56
- }
57
- return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
58
- }
59
- static get is() { return "tttx-keyvalue-block"; }
60
- static get encapsulation() { return "shadow"; }
61
- static get originalStyleUrls() {
62
- return {
63
- "$": ["tttx-keyvalue-block.scss"]
64
- };
65
- }
66
- static get styleUrls() {
67
- return {
68
- "$": ["tttx-keyvalue-block.css"]
69
- };
70
- }
71
- static get properties() {
72
- return {
73
- "keyvalues": {
74
- "type": "any",
75
- "mutable": false,
76
- "complexType": {
77
- "original": "any | any[] | string",
78
- "resolved": "any",
79
- "references": {}
80
- },
81
- "required": false,
82
- "optional": false,
83
- "docs": {
84
- "tags": [],
85
- "text": ""
86
- },
87
- "attribute": "keyvalues",
88
- "reflect": false
89
- },
90
- "horizontal": {
91
- "type": "boolean",
92
- "mutable": false,
93
- "complexType": {
94
- "original": "boolean",
95
- "resolved": "boolean",
96
- "references": {}
97
- },
98
- "required": false,
99
- "optional": false,
100
- "docs": {
101
- "tags": [],
102
- "text": ""
103
- },
104
- "attribute": "horizontal",
105
- "reflect": false
106
- }
107
- };
108
- }
109
- }
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { h, Host } from '@stencil/core';
3
+ export class TttxKeyvalueBlock {
4
+ constructor() {
5
+ this.keyvalues = undefined;
6
+ this.horizontal = undefined;
7
+ }
8
+ renderSingleElements(values) {
9
+ const keys = Object.keys(values);
10
+ const elements = [];
11
+ const divSize = (100 / keys.length).toString() + '%';
12
+ for (let i = 0; i < keys.length; i++) {
13
+ if (this.horizontal) {
14
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", null, keys[i]), h("dd", null, values[keys[i]])));
15
+ }
16
+ else {
17
+ elements.push(h("dt", null, keys[i]));
18
+ elements.push(h("dd", null, values[keys[i]]));
19
+ }
20
+ }
21
+ return elements;
22
+ }
23
+ renderArrayElements(values) {
24
+ const elements = [];
25
+ const divSize = (100 / values.length).toString() + '%';
26
+ for (let i = 0; i < values.length; i++) {
27
+ const value = values[i];
28
+ if (this.horizontal) {
29
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
30
+ }
31
+ else {
32
+ elements.push(h("dt", { class: 'mainTitle' }, value.title));
33
+ elements.push(h("dt", { class: 'subTitle' }, value.subTitle));
34
+ elements.push(h("dd", null, value.data));
35
+ }
36
+ }
37
+ return elements;
38
+ }
39
+ render() {
40
+ if (!this.keyvalues) {
41
+ return;
42
+ }
43
+ let values;
44
+ if (typeof this.keyvalues === 'string') {
45
+ values = JSON.parse(this.keyvalues);
46
+ }
47
+ else {
48
+ values = this.keyvalues;
49
+ }
50
+ let elements;
51
+ if (Array.isArray(values)) {
52
+ elements = this.renderArrayElements(values);
53
+ }
54
+ else {
55
+ elements = this.renderSingleElements(values);
56
+ }
57
+ return (h(Host, null, h("dl", { class: this.horizontal ? 'horizontal' : null }, elements)));
58
+ }
59
+ static get is() { return "tttx-keyvalue-block"; }
60
+ static get encapsulation() { return "shadow"; }
61
+ static get originalStyleUrls() {
62
+ return {
63
+ "$": ["tttx-keyvalue-block.scss"]
64
+ };
65
+ }
66
+ static get styleUrls() {
67
+ return {
68
+ "$": ["tttx-keyvalue-block.css"]
69
+ };
70
+ }
71
+ static get properties() {
72
+ return {
73
+ "keyvalues": {
74
+ "type": "any",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "any | any[] | string",
78
+ "resolved": "any",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": ""
86
+ },
87
+ "attribute": "keyvalues",
88
+ "reflect": false
89
+ },
90
+ "horizontal": {
91
+ "type": "boolean",
92
+ "mutable": false,
93
+ "complexType": {
94
+ "original": "boolean",
95
+ "resolved": "boolean",
96
+ "references": {}
97
+ },
98
+ "required": false,
99
+ "optional": false,
100
+ "docs": {
101
+ "tags": [],
102
+ "text": ""
103
+ },
104
+ "attribute": "horizontal",
105
+ "reflect": false
106
+ }
107
+ };
108
+ }
109
+ }
@@ -1,38 +1,38 @@
1
- export default {
2
- title: 'atoms/Key Value Block',
3
- component: 'tttx-keyvalue-block'
4
- };
5
- const keyValues = {
6
- 'Name': 'John Doe',
7
- 'Date of birth': '14 Jan 1981',
8
- 'Start of postcode': 'AB10'
9
- };
10
- export const KeyValueBlock = () => {
11
- return `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValues)}' />`;
12
- };
13
- const keyValueArray = [
14
- {
15
- title: "Electrical Designer",
16
- subTitle: "Satchwell",
17
- data: "18 Oct 2021 - Present"
18
- },
19
- {
20
- title: "Electrical Inspector",
21
- subTitle: "Fastned",
22
- data: "20 Dec 2016 - 10 Oct 2021"
23
- },
24
- {
25
- title: "Electrical Tech Prof I - Eng",
26
- subTitle: "Voltech",
27
- data: "20 Dec 2009 - 20 Nov 2016"
28
- },
29
- ];
30
- export const KeyValueSubtitleBlock = () => {
31
- return `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValueArray)}' />`;
32
- };
33
- export const HorizontalKeyValueBlock = () => {
34
- return `<tttx-keyvalue-block horizontal='true' keyvalues='${JSON.stringify(keyValues)}' />`;
35
- };
36
- export const HorizontalKeyValueSubtitleBlock = () => {
37
- return `<tttx-keyvalue-block horizontal='true' keyvalues='${JSON.stringify(keyValueArray)}' />`;
38
- };
1
+ export default {
2
+ title: 'atoms/Key Value Block',
3
+ component: 'tttx-keyvalue-block'
4
+ };
5
+ const keyValues = {
6
+ 'Name': 'John Doe',
7
+ 'Date of birth': '14 Jan 1981',
8
+ 'Start of postcode': 'AB10'
9
+ };
10
+ export const KeyValueBlock = () => {
11
+ return `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValues)}' />`;
12
+ };
13
+ const keyValueArray = [
14
+ {
15
+ title: "Electrical Designer",
16
+ subTitle: "Satchwell",
17
+ data: "18 Oct 2021 - Present"
18
+ },
19
+ {
20
+ title: "Electrical Inspector",
21
+ subTitle: "Fastned",
22
+ data: "20 Dec 2016 - 10 Oct 2021"
23
+ },
24
+ {
25
+ title: "Electrical Tech Prof I - Eng",
26
+ subTitle: "Voltech",
27
+ data: "20 Dec 2009 - 20 Nov 2016"
28
+ },
29
+ ];
30
+ export const KeyValueSubtitleBlock = () => {
31
+ return `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValueArray)}' />`;
32
+ };
33
+ export const HorizontalKeyValueBlock = () => {
34
+ return `<tttx-keyvalue-block horizontal='true' keyvalues='${JSON.stringify(keyValues)}' />`;
35
+ };
36
+ export const HorizontalKeyValueSubtitleBlock = () => {
37
+ return `<tttx-keyvalue-block horizontal='true' keyvalues='${JSON.stringify(keyValueArray)}' />`;
38
+ };
@@ -1,67 +1,67 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- import { h } from '@stencil/core';
3
- export class TttxLoadingSpinner {
4
- constructor() {
5
- this.loadingMessage = undefined;
6
- this.size = 'large';
7
- }
8
- renderLoadingMessage() {
9
- if (!this.loadingMessage)
10
- return '';
11
- return h("div", { class: "loading-text" }, "Loading, please wait...");
12
- }
13
- render() {
14
- return (h("div", null, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
15
- }
16
- static get is() { return "tttx-loading-spinner"; }
17
- static get encapsulation() { return "shadow"; }
18
- static get originalStyleUrls() {
19
- return {
20
- "$": ["tttx-loading-spinner.scss"]
21
- };
22
- }
23
- static get styleUrls() {
24
- return {
25
- "$": ["tttx-loading-spinner.css"]
26
- };
27
- }
28
- static get properties() {
29
- return {
30
- "loadingMessage": {
31
- "type": "boolean",
32
- "mutable": true,
33
- "complexType": {
34
- "original": "boolean",
35
- "resolved": "boolean",
36
- "references": {}
37
- },
38
- "required": false,
39
- "optional": false,
40
- "docs": {
41
- "tags": [],
42
- "text": ""
43
- },
44
- "attribute": "loading-message",
45
- "reflect": false
46
- },
47
- "size": {
48
- "type": "string",
49
- "mutable": true,
50
- "complexType": {
51
- "original": "'small' | 'large'",
52
- "resolved": "\"large\" | \"small\"",
53
- "references": {}
54
- },
55
- "required": false,
56
- "optional": false,
57
- "docs": {
58
- "tags": [],
59
- "text": ""
60
- },
61
- "attribute": "size",
62
- "reflect": false,
63
- "defaultValue": "'large'"
64
- }
65
- };
66
- }
67
- }
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { h } from '@stencil/core';
3
+ export class TttxLoadingSpinner {
4
+ constructor() {
5
+ this.loadingMessage = undefined;
6
+ this.size = 'large';
7
+ }
8
+ renderLoadingMessage() {
9
+ if (!this.loadingMessage)
10
+ return '';
11
+ return h("div", { class: "loading-text" }, "Loading, please wait...");
12
+ }
13
+ render() {
14
+ return (h("div", null, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
15
+ }
16
+ static get is() { return "tttx-loading-spinner"; }
17
+ static get encapsulation() { return "shadow"; }
18
+ static get originalStyleUrls() {
19
+ return {
20
+ "$": ["tttx-loading-spinner.scss"]
21
+ };
22
+ }
23
+ static get styleUrls() {
24
+ return {
25
+ "$": ["tttx-loading-spinner.css"]
26
+ };
27
+ }
28
+ static get properties() {
29
+ return {
30
+ "loadingMessage": {
31
+ "type": "boolean",
32
+ "mutable": true,
33
+ "complexType": {
34
+ "original": "boolean",
35
+ "resolved": "boolean",
36
+ "references": {}
37
+ },
38
+ "required": false,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": ""
43
+ },
44
+ "attribute": "loading-message",
45
+ "reflect": false
46
+ },
47
+ "size": {
48
+ "type": "string",
49
+ "mutable": true,
50
+ "complexType": {
51
+ "original": "'small' | 'large'",
52
+ "resolved": "\"large\" | \"small\"",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "size",
62
+ "reflect": false,
63
+ "defaultValue": "'large'"
64
+ }
65
+ };
66
+ }
67
+ }