@3t-transform/threeteeui 0.0.22 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/cjs/{index-bf777121.js → index-bc080fb4.js} +2 -148
  2. package/dist/cjs/loader.cjs.js +3 -4
  3. package/dist/cjs/tttx-button.cjs.entry.js +1 -1
  4. package/dist/cjs/tttx-icon.cjs.entry.js +1 -1
  5. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +1 -1
  6. package/dist/cjs/tttx-list.cjs.entry.js +14 -178
  7. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
  8. package/dist/cjs/tttx-standalone-input.cjs.entry.js +1 -1
  9. package/dist/cjs/tttx-table.cjs.entry.js +1 -1
  10. package/dist/cjs/tttx.cjs.js +3 -7
  11. package/dist/collection/collection-manifest.json +2 -6
  12. package/dist/collection/components/atoms/tttx-button/test/tttx-button.e2e.js +9 -0
  13. package/dist/collection/components/atoms/tttx-button/test/tttx-button.spec.js +43 -0
  14. package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.e2e.js +9 -0
  15. package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.spec.js +16 -0
  16. package/dist/collection/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.js +164 -0
  17. package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +64 -0
  18. package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +151 -0
  19. package/dist/collection/components/molecules/tttx-list/tttx-list.css +17 -20
  20. package/dist/collection/components/molecules/tttx-list/tttx-list.js +22 -255
  21. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +34 -32
  22. package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.js +9 -0
  23. package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.js +146 -0
  24. package/dist/collection/components/molecules/tttx-table/test/tttx-table.e2e.js +9 -0
  25. package/dist/components/index.d.ts +0 -13
  26. package/dist/components/index.js +1 -5
  27. package/dist/components/tttx-button.js +54 -1
  28. package/dist/components/tttx-list.js +19 -188
  29. package/dist/components/tttx-loading-spinner.js +38 -1
  30. package/dist/components/tttx-table.js +2 -8
  31. package/dist/esm/{index-a05bd606.js → index-901bfd55.js} +3 -147
  32. package/dist/esm/loader.js +3 -4
  33. package/dist/esm/polyfills/css-shim.js +1 -1
  34. package/dist/esm/tttx-button.entry.js +1 -1
  35. package/dist/esm/tttx-icon.entry.js +1 -1
  36. package/dist/esm/tttx-keyvalue-block.entry.js +1 -1
  37. package/dist/esm/tttx-list.entry.js +14 -178
  38. package/dist/esm/tttx-loading-spinner.entry.js +1 -1
  39. package/dist/esm/tttx-standalone-input.entry.js +1 -1
  40. package/dist/esm/tttx-table.entry.js +1 -1
  41. package/dist/esm/tttx.js +3 -4
  42. package/dist/tttx/{p-68ff0f39.entry.js → p-0ae51ec5.entry.js} +1 -1
  43. package/dist/tttx/{p-9536b8c4.entry.js → p-1ec23160.entry.js} +1 -1
  44. package/dist/tttx/p-300ff6a8.entry.js +1 -0
  45. package/dist/tttx/p-32ad02d3.entry.js +1 -0
  46. package/dist/tttx/{p-a96ca037.entry.js → p-80cf5236.entry.js} +1 -1
  47. package/dist/tttx/{p-a5808741.entry.js → p-9a382959.entry.js} +1 -1
  48. package/dist/tttx/{p-46b5551e.entry.js → p-a1bd16a1.entry.js} +1 -1
  49. package/dist/tttx/{p-93763d3c.entry.js → p-a4077908.entry.js} +1 -1
  50. package/dist/tttx/p-a6953900.entry.js +1 -0
  51. package/dist/tttx/p-b46e3c59.entry.js +1 -0
  52. package/dist/tttx/p-c290160b.js +2 -0
  53. package/dist/tttx/p-dc179257.entry.js +1 -0
  54. package/dist/tttx/p-e19eb07e.entry.js +1 -0
  55. package/dist/tttx/p-e4341658.entry.js +1 -0
  56. package/dist/tttx/tttx.esm.js +1 -1
  57. package/dist/types/components/atoms/tttx-button/test/tttx-button.e2e.d.ts +1 -0
  58. package/dist/types/components/atoms/tttx-button/test/tttx-button.spec.d.ts +1 -0
  59. package/dist/types/components/atoms/tttx-icon/test/tttx-icon.e2e.d.ts +1 -0
  60. package/dist/types/components/atoms/tttx-icon/test/tttx-icon.spec.d.ts +1 -0
  61. package/dist/types/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.d.ts +1 -0
  62. package/dist/types/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.d.ts +1 -0
  63. package/dist/types/components/molecules/tttx-list/interfaces.d.ts +4 -0
  64. package/dist/types/components/molecules/tttx-list/test/tttx-list.spec.d.ts +1 -0
  65. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +4 -46
  66. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +2 -8
  67. package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.d.ts +1 -0
  68. package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.d.ts +1 -0
  69. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +6 -6
  70. package/dist/types/components/molecules/tttx-table/test/tttx-table.e2e.d.ts +1 -0
  71. package/dist/types/components.d.ts +3 -91
  72. package/dist/types/stencil-public-runtime.d.ts +3 -59
  73. package/loader/index.d.ts +0 -9
  74. package/package.json +3 -2
  75. package/readme.md +20 -0
  76. package/dist/cjs/tttx-checkbox.cjs.entry.js +0 -28
  77. package/dist/cjs/tttx-form.cjs.entry.js +0 -374
  78. package/dist/cjs/tttx-input-calendar.cjs.entry.js +0 -125
  79. package/dist/cjs/tttx-popover-content.cjs.entry.js +0 -23
  80. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +0 -30
  81. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +0 -97
  82. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +0 -23
  83. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +0 -181
  84. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +0 -102
  85. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +0 -13
  86. package/dist/collection/components/molecules/tttx-form/tttx-form.css +0 -314
  87. package/dist/collection/components/molecules/tttx-form/tttx-form.js +0 -452
  88. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +0 -109
  89. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.css +0 -93
  90. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.js +0 -174
  91. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.js +0 -27
  92. package/dist/components/tttx-button2.js +0 -56
  93. package/dist/components/tttx-checkbox.d.ts +0 -11
  94. package/dist/components/tttx-checkbox.js +0 -46
  95. package/dist/components/tttx-form.d.ts +0 -11
  96. package/dist/components/tttx-form.js +0 -391
  97. package/dist/components/tttx-input-calendar.d.ts +0 -11
  98. package/dist/components/tttx-input-calendar.js +0 -157
  99. package/dist/components/tttx-loading-spinner2.js +0 -40
  100. package/dist/components/tttx-popover-content.d.ts +0 -11
  101. package/dist/components/tttx-popover-content.js +0 -6
  102. package/dist/components/tttx-popover-content2.js +0 -39
  103. package/dist/esm/tttx-checkbox.entry.js +0 -24
  104. package/dist/esm/tttx-form.entry.js +0 -370
  105. package/dist/esm/tttx-input-calendar.entry.js +0 -121
  106. package/dist/esm/tttx-popover-content.entry.js +0 -19
  107. package/dist/tttx/p-037d286f.entry.js +0 -1
  108. package/dist/tttx/p-07b134af.js +0 -2
  109. package/dist/tttx/p-1b63f16a.entry.js +0 -1
  110. package/dist/tttx/p-45afb84c.entry.js +0 -1
  111. package/dist/tttx/p-a92ca87e.entry.js +0 -1
  112. package/dist/tttx/p-f579ed1e.entry.js +0 -1
  113. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +0 -7
  114. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +0 -18
  115. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +0 -9
  116. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +0 -6
  117. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +0 -134
  118. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +0 -12
  119. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.d.ts +0 -19
  120. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.d.ts +0 -26
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-bf777121.js');
3
+ const index = require('./index-bc080fb4.js');
6
4
 
7
5
  /*
8
- Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
9
7
  */
10
8
  const patchBrowser = () => {
11
9
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tttx.cjs.js', document.baseURI).href));
@@ -17,7 +15,5 @@ const patchBrowser = () => {
17
15
  };
18
16
 
19
17
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["tttx-input-calendar.cjs",[[1,"tttx-input-calendar",{"months":[4],"years":[4],"showCalendar":[32],"selectedYear":[32],"selectedMonth":[32]}]]],["tttx-table.cjs",[[1,"tttx-table",{"headers":[16],"data":[16],"loading":[4],"selected":[2]},[[4,"keydown","handleKeyDown"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"name":[1],"selectable":[4],"items":[32],"selectedIds":[32],"loading":[32],"lastPage":[32]},[[4,"listPageLoad","listLoadHandler"],[4,"listClearDataCache","listClearDataCacheHandler"],[4,"listActionSelectedEvent","listActionSelectedEventHandler"]]]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-checkbox.cjs",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[8],"submitValue":[8,"submit-value"]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content.cjs",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]]], options);
18
+ return index.bootstrapLazy([["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-table.cjs",[[1,"tttx-table",{"headers":[16],"data":[16],"loading":[4],"selected":[2]},[[4,"keydown","handleKeyDown"]]]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]]], options);
21
19
  });
22
-
23
- exports.setNonce = index.setNonce;
@@ -5,17 +5,13 @@
5
5
  "./components/atoms/tttx-icon/tttx-icon.js",
6
6
  "./components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js",
7
7
  "./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
8
- "./components/atoms/tttx-popover-content/tttx-popover-content.js",
9
- "./components/atoms/ttx-checkbox/tttx-checkbox.js",
10
- "./components/molecules/tttx-form/tttx-form.js",
11
- "./components/molecules/tttx-input-calendar/tttx-input-calendar.js",
12
8
  "./components/molecules/tttx-list/tttx-list.js",
13
9
  "./components/molecules/tttx-table/tttx-table.js"
14
10
  ],
15
11
  "compiler": {
16
12
  "name": "@stencil/core",
17
- "version": "2.22.3",
18
- "typescriptVersion": "4.9.4"
13
+ "version": "2.20.0",
14
+ "typescriptVersion": "4.8.4"
19
15
  },
20
16
  "collections": [],
21
17
  "bundles": []
@@ -0,0 +1,9 @@
1
+ import { newE2EPage } from '@stencil/core/testing';
2
+ describe('tttx-button', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<tttx-button></tttx-button>');
6
+ const element = await page.find('tttx-button');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
@@ -0,0 +1,43 @@
1
+ import { newSpecPage } from '@stencil/core/testing';
2
+ import { TttxButton } from '../tttx-button';
3
+ describe('tttx-button', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [TttxButton],
7
+ html: '<tttx-button></tttx-button>',
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <tttx-button>
11
+ <mock:shadow-root>
12
+ <button class="button default">
13
+ <div class="button-content">
14
+ <slot></slot>
15
+ </div>
16
+ </button>
17
+ </mock:shadow-root>
18
+ </tttx-button>
19
+ `);
20
+ });
21
+ it('clicks', async () => {
22
+ const page = await newSpecPage({
23
+ components: [TttxButton],
24
+ html: '<tttx-button></tttx-button>',
25
+ });
26
+ expect(page.root).toEqualHtml(`
27
+ <tttx-button>
28
+ <mock:shadow-root>
29
+ <button class="button default">
30
+ <div class="button-content">
31
+ <slot></slot>
32
+ </div>
33
+ </button>
34
+ </mock:shadow-root>
35
+ </tttx-button>
36
+ `);
37
+ const callbackFn = jest.fn();
38
+ // add an event listener directly to the tttx-button host and click it
39
+ page.root.addEventListener('click', callbackFn);
40
+ page.root.click();
41
+ expect(callbackFn).toHaveBeenCalled();
42
+ });
43
+ });
@@ -0,0 +1,9 @@
1
+ import { newE2EPage } from '@stencil/core/testing';
2
+ describe('tttx-icon', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<tttx-icon></tttx-icon>');
6
+ const element = await page.find('tttx-icon');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
@@ -0,0 +1,16 @@
1
+ import { newSpecPage } from '@stencil/core/testing';
2
+ import { TttxIcon } from '../tttx-icon';
3
+ describe('tttx-icon', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [TttxIcon],
7
+ html: '<tttx-icon color="danger" icon="warning"></tttx-icon>',
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <tttx-icon color="danger" icon="warning">
11
+ <mock:shadow-root>
12
+ <span class="material-symbols-rounded danger">warning</span>
13
+ </mock:shadow-root>
14
+ </tttx-icon>`);
15
+ });
16
+ });
@@ -0,0 +1,164 @@
1
+ import { newSpecPage } from '@stencil/core/testing';
2
+ import { TttxKeyvalueBlock } from '../tttx-keyvalue-block';
3
+ describe('tttx-keyvalue-block', () => {
4
+ it('renders multiple key value pairs', async () => {
5
+ const keyValuePair = {
6
+ 'Name': 'John Doe',
7
+ 'Date of birth': '14 Jan 1981',
8
+ 'Start of postcode': 'AB10'
9
+ };
10
+ const page = await newSpecPage({
11
+ components: [TttxKeyvalueBlock],
12
+ html: `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValuePair)}' />`
13
+ });
14
+ await page.waitForChanges();
15
+ expect(page.root).toEqualHtml(`
16
+ <tttx-keyvalue-block keyvalues='{"Name":"John Doe","Date of birth":"14 Jan 1981","Start of postcode":"AB10"}'>
17
+ <mock:shadow-root>
18
+ <dl>
19
+ <dt>
20
+ Name
21
+ </dt>
22
+ <dd>
23
+ John Doe
24
+ </dd>
25
+ <dt>
26
+ Date of birth
27
+ </dt>
28
+ <dd>
29
+ 14 Jan 1981
30
+ </dd>
31
+ <dt>
32
+ Start of postcode
33
+ </dt>
34
+ <dd>
35
+ AB10
36
+ </dd>
37
+ </dl>
38
+ </mock:shadow-root>
39
+ </tttx-keyvalue-block>
40
+ `);
41
+ });
42
+ it('renders an array of key value subtitles', async () => {
43
+ const keyValueArray = [
44
+ { title: "title", subTitle: "sub", data: "data" },
45
+ { title: "title2", subTitle: "sub2", data: "data2" }
46
+ ];
47
+ const page = await newSpecPage({
48
+ components: [TttxKeyvalueBlock],
49
+ html: `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValueArray)}' />`
50
+ });
51
+ await page.waitForChanges();
52
+ expect(page.root).toEqualHtml(`
53
+ <tttx-keyvalue-block keyvalues='[{"title":"title","subTitle":"sub","data":"data"},{"title":"title2","subTitle":"sub2","data":"data2"}]'>
54
+ <mock:shadow-root>
55
+ <dl>
56
+ <dt class="mainTitle">
57
+ title
58
+ </dt>
59
+ <dt class="subTitle">
60
+ sub
61
+ </dt>
62
+ <dd>
63
+ data
64
+ </dd>
65
+ <dt class="mainTitle">
66
+ title2
67
+ </dt>
68
+ <dt class="subTitle">
69
+ sub2
70
+ </dt>
71
+ <dd>
72
+ data2
73
+ </dd>
74
+ </dl>
75
+ </mock:shadow-root>
76
+ </tttx-keyvalue-block>
77
+ `);
78
+ });
79
+ it('renders multiple horizontal key value pairs', async () => {
80
+ const keyValuePair = {
81
+ 'Name': 'John Doe',
82
+ 'Date of birth': '14 Jan 1981',
83
+ 'Start of postcode': 'AB10'
84
+ };
85
+ const page = await newSpecPage({
86
+ components: [TttxKeyvalueBlock],
87
+ html: `<tttx-keyvalue-block horizontal="true" keyvalues='${JSON.stringify(keyValuePair)}' />`
88
+ });
89
+ await page.waitForChanges();
90
+ expect(page.root).toEqualHtml(`
91
+ <tttx-keyvalue-block horizontal="true" keyvalues='{"Name":"John Doe","Date of birth":"14 Jan 1981","Start of postcode":"AB10"}'>
92
+ <mock:shadow-root>
93
+ <dl class="horizontal">
94
+ <div>
95
+ <dt>
96
+ Name
97
+ </dt>
98
+ <dd>
99
+ John Doe
100
+ </dd>
101
+ </div>
102
+ <div>
103
+ <dt>
104
+ Date of birth
105
+ </dt>
106
+ <dd>
107
+ 14 Jan 1981
108
+ </dd>
109
+ </div>
110
+ <div>
111
+ <dt>
112
+ Start of postcode
113
+ </dt>
114
+ <dd>
115
+ AB10
116
+ </dd>
117
+ </div>
118
+ </dl>
119
+ </mock:shadow-root>
120
+ </tttx-keyvalue-block>
121
+ `);
122
+ });
123
+ it('renders an array of horizontal key value subtitles', async () => {
124
+ const keyValueArray = [
125
+ { title: "title", subTitle: "sub", data: "data" },
126
+ { title: "title2", subTitle: "sub2", data: "data2" }
127
+ ];
128
+ const page = await newSpecPage({
129
+ components: [TttxKeyvalueBlock],
130
+ html: `<tttx-keyvalue-block horizontal="true" keyvalues='${JSON.stringify(keyValueArray)}' />`
131
+ });
132
+ await page.waitForChanges();
133
+ expect(page.root).toEqualHtml(`
134
+ <tttx-keyvalue-block horizontal="true" keyvalues='[{"title":"title","subTitle":"sub","data":"data"},{"title":"title2","subTitle":"sub2","data":"data2"}]'>
135
+ <mock:shadow-root>
136
+ <dl class="horizontal">
137
+ <div>
138
+ <dt class="mainTitle">
139
+ title
140
+ </dt>
141
+ <dt class="subTitle">
142
+ sub
143
+ </dt>
144
+ <dd>
145
+ data
146
+ </dd>
147
+ </div>
148
+ <div>
149
+ <dt class="mainTitle">
150
+ title2
151
+ </dt>
152
+ <dt class="subTitle">
153
+ sub2
154
+ </dt>
155
+ <dd>
156
+ data2
157
+ </dd>
158
+ </div>
159
+ </dl>
160
+ </mock:shadow-root>
161
+ </tttx-keyvalue-block>
162
+ `);
163
+ });
164
+ });
@@ -0,0 +1,64 @@
1
+ import { newSpecPage } from '@stencil/core/testing';
2
+ import { TttxLoadingSpinner } from '../tttx-loading-spinner';
3
+ describe('tttx-loading-spinner', () => {
4
+ it('renders the loading text when the loading message prop is set to true', async () => {
5
+ const page = await newSpecPage({
6
+ components: [TttxLoadingSpinner],
7
+ html: '<tttx-loading-spinner></tttx-loading-spinner>',
8
+ });
9
+ page.rootInstance.loadingMessage = true;
10
+ await page.waitForChanges();
11
+ expect(page.root).toEqualHtml(`
12
+ <tttx-loading-spinner>
13
+ <mock:shadow-root>
14
+ <div class='spinner-container'><div class="loading-box"><span class='spinner large'></span></div><div class='loading-text'>Loading, please wait...</div></div>
15
+ </mock:shadow-root>
16
+ </tttx-loading-spinner>
17
+ `);
18
+ });
19
+ it('renders without the loading text when the loading message prop is set to false', async () => {
20
+ const page = await newSpecPage({
21
+ components: [TttxLoadingSpinner],
22
+ html: '<tttx-loading-spinner></tttx-loading-spinner>',
23
+ });
24
+ page.rootInstance.loadingMessage = false;
25
+ await page.waitForChanges();
26
+ expect(page.root).toEqualHtml(`
27
+ <tttx-loading-spinner>
28
+ <mock:shadow-root>
29
+ <div class='spinner-container'><div class="loading-box"><span class='spinner large'></span></div></div>
30
+ </mock:shadow-root>
31
+ </tttx-loading-spinner>
32
+ `);
33
+ });
34
+ it('renders the small spinner when the size prop is set to small', async () => {
35
+ const page = await newSpecPage({
36
+ components: [TttxLoadingSpinner],
37
+ html: '<tttx-loading-spinner></tttx-loading-spinner>',
38
+ });
39
+ page.rootInstance.size = 'small';
40
+ await page.waitForChanges();
41
+ expect(page.root).toEqualHtml(`
42
+ <tttx-loading-spinner>
43
+ <mock:shadow-root>
44
+ <div class='spinner-container'><div class="loading-box"><span class='spinner small'></span></div></div>
45
+ </mock:shadow-root>
46
+ </tttx-loading-spinner>
47
+ `);
48
+ });
49
+ it('renders the large spinner when the size prop is set to large', async () => {
50
+ const page = await newSpecPage({
51
+ components: [TttxLoadingSpinner],
52
+ html: '<tttx-loading-spinner></tttx-loading-spinner>',
53
+ });
54
+ page.rootInstance.size = 'large';
55
+ await page.waitForChanges();
56
+ expect(page.root).toEqualHtml(`
57
+ <tttx-loading-spinner>
58
+ <mock:shadow-root>
59
+ <div class='spinner-container'><div class="loading-box"><span class='spinner large'></span></div></div>
60
+ </mock:shadow-root>
61
+ </tttx-loading-spinner>
62
+ `);
63
+ });
64
+ });
@@ -0,0 +1,151 @@
1
+ import { newSpecPage } from '@stencil/core/testing';
2
+ import { TttxList } from '../tttx-list';
3
+ describe('tttx-list', () => {
4
+ it('renders a spinner before loading in data', async () => {
5
+ const page = await newSpecPage({
6
+ components: [TttxList],
7
+ html: '<tttx-list name=\'before-load\' />',
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <tttx-list name='before-load'>
11
+ <mock:shadow-root>
12
+ <div class="list-item-container" tabindex="0">
13
+ </div>
14
+ <div class="load-indicator"><tttx-loading-spinner size='large' /></div>
15
+ </mock:shadow-root>
16
+ </tttx-list>
17
+ `);
18
+ });
19
+ it('renders a No Data message if not loading and empty', async () => {
20
+ const page = await newSpecPage({
21
+ components: [TttxList],
22
+ html: '<tttx-list name=\'empty-list\' />',
23
+ });
24
+ page.doc.dispatchEvent(new CustomEvent('listPageLoad', {
25
+ detail: {
26
+ name: 'empty-list',
27
+ lastPage: true,
28
+ items: []
29
+ }
30
+ }));
31
+ await page.waitForChanges();
32
+ expect(page.root).toEqualHtml(`
33
+ <tttx-list name="empty-list">
34
+ <mock:shadow-root>
35
+ <div class="list-item-container" tabindex="0">
36
+ No data to display
37
+ </div>
38
+ </mock:shadow-root>
39
+ </tttx-list>
40
+ `);
41
+ });
42
+ it('renders a simple list template when no template is provided', async () => {
43
+ const page = await newSpecPage({
44
+ components: [TttxList],
45
+ html: '<tttx-list name=\'simple-list\' />',
46
+ });
47
+ page.doc.dispatchEvent(new CustomEvent('listPageLoad', {
48
+ detail: {
49
+ name: 'simple-list',
50
+ lastPage: true,
51
+ items: [
52
+ { text: 'A row with only text' },
53
+ { text: 'A row with text and an icon', icon: 'settings' },
54
+ { text: 'A row with text and a coloured icon', icon: 'warning', iconColor: '#ff0000' }
55
+ ]
56
+ }
57
+ }));
58
+ await page.waitForChanges();
59
+ expect(page.root).toEqualHtml(`
60
+ <tttx-list name="simple-list">
61
+ <mock:shadow-root>
62
+ <div class="list-item-container" tabindex="0">
63
+ <div class="tttx-list__row">
64
+ <div class="generic-template__content">
65
+ A row with only text
66
+ </div>
67
+ </div>
68
+ <div class="tttx-list__row">
69
+ <div class="generic-template__content">
70
+ <span class="material-symbols-rounded">settings</span>A row with text and an icon
71
+ </div>
72
+ </div>
73
+ <div class="tttx-list__row">
74
+ <div class="generic-template__content">
75
+ <span class="material-symbols-rounded" style="color: #ff0000;">warning</span>A row with text and a coloured icon
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </mock:shadow-root>
80
+ </tttx-list>
81
+ `);
82
+ });
83
+ it('dispatches an event when clicking a row', async () => {
84
+ const page = await newSpecPage({
85
+ components: [TttxList],
86
+ html: '<tttx-list name=\'clickable-list\' />',
87
+ });
88
+ page.doc.dispatchEvent(new CustomEvent('listPageLoad', {
89
+ detail: {
90
+ name: 'clickable-list',
91
+ lastPage: true,
92
+ items: [
93
+ { text: 'A row with only text' },
94
+ ]
95
+ }
96
+ }));
97
+ await page.waitForChanges();
98
+ });
99
+ it('clears the list data when receiving a listClearDataCache event', async () => {
100
+ const page = await newSpecPage({
101
+ components: [TttxList],
102
+ html: '<tttx-list name=\'clearable-list\' />',
103
+ });
104
+ page.doc.dispatchEvent(new CustomEvent('listPageLoad', {
105
+ detail: {
106
+ name: 'clearable-list',
107
+ lastPage: true,
108
+ items: [
109
+ { text: 'A row with only text' },
110
+ ]
111
+ }
112
+ }));
113
+ await page.waitForChanges();
114
+ expect(page.root).toEqualHtml(`
115
+ <tttx-list name="clearable-list">
116
+ <mock:shadow-root>
117
+ <div class="list-item-container" tabindex="0">
118
+ <div class="tttx-list__row">
119
+ <div class="generic-template__content">
120
+ A row with only text
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </mock:shadow-root>
125
+ </tttx-list>
126
+ `);
127
+ page.doc.dispatchEvent(new CustomEvent('listClearDataCache', {
128
+ detail: {
129
+ name: 'clearable-list'
130
+ }
131
+ }));
132
+ await page.waitForChanges();
133
+ expect(page.root).toEqualHtml(`
134
+ <tttx-list name="clearable-list">
135
+ <mock:shadow-root>
136
+ <div class="list-item-container" tabindex="0">
137
+ No data to display
138
+ </div>
139
+ </mock:shadow-root>
140
+ </tttx-list>
141
+ `);
142
+ });
143
+ // describe('when selectable', () => {
144
+ // it('renders rows with a checkbox', () => {
145
+ // });
146
+ // it('responds with the selected row data when a listActionSelectedEvent event is dispatched', () => {
147
+ // });
148
+ // it('removes selected rows when listActionSelectedEvent instructs it to', () => {
149
+ // });
150
+ // });
151
+ });
@@ -24,33 +24,30 @@
24
24
  flex-direction: column;
25
25
  }
26
26
 
27
- .tttx-list__row {
28
- min-height: 52px;
29
- line-height: 36px;
30
- padding: 8px;
31
- display: flex;
32
- flex-direction: row;
33
- align-items: center;
34
- cursor: pointer;
35
- border-bottom: 1px solid #d5d5d5;
27
+ .list {
28
+ margin: 0;
29
+ padding: 0;
36
30
  }
37
- .tttx-list__row .generic-template__content {
38
- width: 100%;
31
+
32
+ .item {
33
+ list-style: none;
34
+ margin: 0;
35
+ padding: 0;
36
+ border-bottom: 1px solid #d5d5d5;
37
+ height: 36px;
38
+ /* center the contents vertically */
39
39
  display: flex;
40
40
  align-items: center;
41
- gap: 8px;
42
41
  }
43
- .tttx-list__row:first-of-type {
42
+ .item:first-of-type {
44
43
  border-top: 1px solid #d5d5d5;
45
44
  }
46
- .tttx-list__row:focus, .tttx-list__row:active {
47
- background-color: #e6e6e6;
48
- }
49
- .tttx-list__row.selected {
50
- background-color: #e7f1f9;
45
+
46
+ .align-right {
47
+ margin-left: auto;
51
48
  }
52
49
 
53
- .load-indicator {
50
+ .item-content {
54
51
  display: flex;
55
- justify-content: center;
52
+ align-items: center;
56
53
  }