@3t-transform/threeteeui 0.1.5 → 0.1.7

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 (167) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/css-shim-211819bc.js +6 -0
  3. package/dist/cjs/dom-9deb26c8.js +75 -0
  4. package/dist/cjs/index-11cfdabe.js +3297 -0
  5. package/dist/cjs/{index-906c2757.js → index-451f61dd.js} +3 -102
  6. package/dist/cjs/loader.cjs.js +19 -4
  7. package/dist/cjs/shadow-css-bf3843d2.js +389 -0
  8. package/dist/cjs/{tttx-button_2.cjs.entry.js → tttx-button.cjs.entry.js} +24 -50
  9. package/dist/cjs/tttx-form.cjs.entry.js +364 -364
  10. package/dist/cjs/tttx-icon.cjs.entry.js +21 -0
  11. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +57 -57
  12. package/dist/cjs/tttx-list.cjs.entry.js +76 -46
  13. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  14. package/dist/cjs/tttx-standalone-input.cjs.entry.js +61 -58
  15. package/dist/cjs/tttx-toolbar.cjs.entry.js +20 -0
  16. package/dist/cjs/tttx.cjs.js +117 -9
  17. package/dist/collection/collection-manifest.json +4 -3
  18. package/dist/collection/components/atoms/tttx-button/test/tttx-button.e2e.js +9 -0
  19. package/dist/collection/components/atoms/tttx-button/test/tttx-button.spec.js +83 -0
  20. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -116
  21. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  22. package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.e2e.js +9 -0
  23. package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.spec.js +16 -0
  24. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +4 -0
  25. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  26. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  27. package/dist/collection/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.js +216 -0
  28. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +107 -107
  29. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  30. package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +64 -0
  31. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  32. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  33. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -35
  34. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.spec.js +38 -0
  35. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -58
  36. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.spec.js +214 -0
  37. package/dist/collection/components/molecules/tttx-form/test/tttx-form.e2e.js +9 -0
  38. package/dist/collection/components/molecules/tttx-form/test/tttx-form.spec.js +232 -0
  39. package/dist/collection/components/molecules/tttx-form/tttx-form.css +32 -3
  40. package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -364
  41. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -127
  42. package/dist/collection/components/molecules/tttx-list/test/ttttx-list.spec.e2e.js +26 -0
  43. package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +183 -0
  44. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  45. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  46. package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.js +9 -0
  47. package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.js +219 -0
  48. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +32 -3
  49. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +627 -572
  50. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +148 -135
  51. package/dist/collection/components/molecules/tttx-toolbar/test/tttx-toolbar.test.js +0 -0
  52. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.css +30 -0
  53. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -0
  54. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +20 -0
  55. package/dist/collection/components/palette.stories.js +7 -7
  56. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  57. package/dist/collection/icons.js +2838 -2838
  58. package/dist/collection/index.js +1 -1
  59. package/dist/collection/shared/domsanitiser.options.js +14 -14
  60. package/dist/collection/shared/test/domsanitiser.options.spec.js +23 -0
  61. package/dist/components/index.d.ts +1 -9
  62. package/dist/components/index.js +6 -1
  63. package/dist/components/tttx-button.js +48 -59
  64. package/dist/components/tttx-form.js +381 -381
  65. package/dist/components/tttx-icon2.js +29 -29
  66. package/dist/components/tttx-keyvalue-block.js +74 -74
  67. package/dist/components/tttx-list.js +98 -68
  68. package/dist/components/tttx-loading-spinner.js +33 -33
  69. package/dist/components/tttx-standalone-input.js +108 -102
  70. package/dist/components/tttx-toolbar.d.ts +11 -0
  71. package/dist/components/tttx-toolbar.js +36 -0
  72. package/dist/esm/app-globals-0f993ce5.js +3 -0
  73. package/dist/esm/css-shim-9d54a2f2.js +4 -0
  74. package/dist/esm/dom-6be6f662.js +73 -0
  75. package/dist/esm/{index-4010ad69.js → index-0350f122.js} +4 -101
  76. package/dist/esm/index-dbe25028.js +3262 -0
  77. package/dist/esm/loader.js +19 -4
  78. package/dist/esm/polyfills/core-js.js +0 -0
  79. package/dist/esm/polyfills/css-shim.js +1 -1
  80. package/dist/esm/polyfills/dom.js +0 -0
  81. package/dist/esm/polyfills/es5-html-element.js +0 -0
  82. package/dist/esm/polyfills/index.js +0 -0
  83. package/dist/esm/polyfills/system.js +0 -0
  84. package/dist/esm/shadow-css-ed4599f8.js +387 -0
  85. package/dist/esm/{tttx-button_2.entry.js → tttx-button.entry.js} +25 -50
  86. package/dist/esm/tttx-form.entry.js +364 -364
  87. package/dist/esm/tttx-icon.entry.js +17 -0
  88. package/dist/esm/tttx-keyvalue-block.entry.js +57 -57
  89. package/dist/esm/tttx-list.entry.js +76 -46
  90. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  91. package/dist/esm/tttx-standalone-input.entry.js +61 -58
  92. package/dist/esm/tttx-toolbar.entry.js +16 -0
  93. package/dist/esm/tttx.js +117 -6
  94. package/dist/tttx/app-globals-0f993ce5.js +3 -0
  95. package/dist/tttx/css-shim-9d54a2f2.js +4 -0
  96. package/dist/tttx/dom-6be6f662.js +73 -0
  97. package/dist/tttx/index-dbe25028.js +3262 -0
  98. package/dist/tttx/index.esm.js +1 -0
  99. package/dist/tttx/p-0a85dda4.entry.js +1 -0
  100. package/dist/tttx/{p-3281444a.entry.js → p-1b015a9d.entry.js} +1 -1
  101. package/dist/tttx/p-4f3958fa.entry.js +1 -0
  102. package/dist/tttx/p-5cae1beb.entry.js +1 -0
  103. package/dist/tttx/p-62869344.js +2 -0
  104. package/dist/tttx/p-92465671.entry.js +1 -0
  105. package/dist/tttx/{p-dab7ee1b.entry.js → p-a0179cb1.entry.js} +1 -1
  106. package/dist/tttx/p-cc6644c9.entry.js +1 -0
  107. package/dist/tttx/p-cd1565e0.entry.js +3 -0
  108. package/dist/tttx/shadow-css-ed4599f8.js +387 -0
  109. package/dist/tttx/tttx-button.entry.js +30 -0
  110. package/dist/tttx/tttx-form.entry.js +373 -0
  111. package/dist/tttx/tttx-icon.entry.js +17 -0
  112. package/dist/tttx/tttx-keyvalue-block.entry.js +63 -0
  113. package/dist/tttx/tttx-list.entry.js +1730 -0
  114. package/dist/tttx/tttx-loading-spinner.entry.js +22 -0
  115. package/dist/tttx/tttx-standalone-input.entry.js +66 -0
  116. package/dist/tttx/tttx-toolbar.entry.js +16 -0
  117. package/dist/tttx/tttx.esm.js +129 -1
  118. package/dist/types/components/atoms/tttx-button/test/tttx-button.e2e.d.ts +1 -0
  119. package/dist/types/components/atoms/tttx-button/test/tttx-button.spec.d.ts +1 -0
  120. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -13
  121. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  122. package/dist/types/components/atoms/tttx-icon/test/tttx-icon.e2e.d.ts +1 -0
  123. package/dist/types/components/atoms/tttx-icon/test/tttx-icon.spec.d.ts +1 -0
  124. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  125. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  126. package/dist/types/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.d.ts +1 -0
  127. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  128. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  129. package/dist/types/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.d.ts +1 -0
  130. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  131. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  132. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  133. package/dist/types/components/molecules/tttx-form/lib/setErrorState.spec.d.ts +1 -0
  134. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  135. package/dist/types/components/molecules/tttx-form/lib/validityCheck.spec.d.ts +1 -0
  136. package/dist/types/components/molecules/tttx-form/test/tttx-form.e2e.d.ts +1 -0
  137. package/dist/types/components/molecules/tttx-form/test/tttx-form.spec.d.ts +1 -0
  138. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -114
  139. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +13 -13
  140. package/dist/types/components/molecules/tttx-list/test/ttttx-list.spec.e2e.d.ts +1 -0
  141. package/dist/types/components/molecules/tttx-list/test/tttx-list.spec.d.ts +1 -0
  142. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  143. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  144. package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.d.ts +1 -0
  145. package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.d.ts +1 -0
  146. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +56 -53
  147. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +122 -106
  148. package/dist/types/components/molecules/tttx-toolbar/test/tttx-toolbar.test.d.ts +0 -0
  149. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -0
  150. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -0
  151. package/dist/types/components/palette.stories.d.ts +6 -6
  152. package/dist/types/components.d.ts +21 -0
  153. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  154. package/dist/types/icons.d.ts +2 -2
  155. package/dist/types/index.d.ts +1 -1
  156. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  157. package/dist/types/shared/test/domsanitiser.options.spec.d.ts +1 -0
  158. package/dist/types/stencil-public-runtime.d.ts +3 -59
  159. package/loader/index.d.ts +0 -9
  160. package/package.json +1 -1
  161. package/dist/collection/transform-tag-name.js +0 -5
  162. package/dist/tttx/p-083eeedc.entry.js +0 -1
  163. package/dist/tttx/p-5687f4ad.js +0 -2
  164. package/dist/tttx/p-5c9a1626.entry.js +0 -3
  165. package/dist/tttx/p-931e42c9.entry.js +0 -1
  166. package/dist/tttx/p-b5c1dd86.entry.js +0 -1
  167. package/dist/types/transform-tag-name.d.ts +0 -1
@@ -1,30 +1,30 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
- export default {
3
- title: 'molecules/List',
4
- component: 'tttx-list',
5
- parameters: {
6
- actions: {
7
- handles: ['listRowClick'],
8
- },
9
- },
10
- decorators: [withActions],
11
- };
1
+ import { withActions } from '@storybook/addon-actions/decorator';
2
+ export default {
3
+ title: 'molecules/List',
4
+ component: 'tttx-list',
5
+ parameters: {
6
+ actions: {
7
+ handles: ['listRowClick'],
8
+ },
9
+ },
10
+ decorators: [withActions],
11
+ };
12
12
  const TemplateStringList = ({ data }) => `
13
13
  <tttx-list
14
14
  data='${JSON.stringify(data)}'
15
15
  id='list'
16
16
  name='stringList'
17
17
  ></tttx-list>
18
- `;
19
- export const BasicStringList = TemplateStringList.bind({});
20
- BasicStringList.args = {
21
- data: [
22
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Demulon 1,000,000' },
23
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Patrick' },
24
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="orange" /></span> Lee' },
25
- { element: '<span><tttx-icon icon="egg" color="red" /></span> Ben' },
26
- ],
27
- };
18
+ `;
19
+ export const BasicStringList = TemplateStringList.bind({});
20
+ BasicStringList.args = {
21
+ data: [
22
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Demulon 1,000,000' },
23
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Patrick' },
24
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="orange" /></span> Lee' },
25
+ { element: '<span><tttx-icon icon="egg" color="red" /></span> Ben' },
26
+ ],
27
+ };
28
28
  const TemplateObjectList = ({ data }) => `
29
29
  <tttx-list
30
30
  id='objectList'
@@ -36,16 +36,16 @@ const TemplateObjectList = ({ data }) => `
36
36
  }
37
37
  objectList.data = ${JSON.stringify(data)};
38
38
  </script>
39
- `;
40
- export const BasicObjectList = TemplateObjectList.bind({});
41
- BasicObjectList.args = {
42
- data: [
43
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000' },
44
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
45
- { icon: 'chevron_right', element: '<span><tttx-icon icon="add" /></span> Lee' },
46
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
47
- ],
48
- };
39
+ `;
40
+ export const BasicObjectList = TemplateObjectList.bind({});
41
+ BasicObjectList.args = {
42
+ data: [
43
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000' },
44
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
45
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="add" /></span> Lee' },
46
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
47
+ ],
48
+ };
49
49
  const TemplateClickableList = ({ data }) => `
50
50
  <tttx-list
51
51
  id='clickableList'
@@ -57,15 +57,15 @@ const TemplateClickableList = ({ data }) => `
57
57
  }
58
58
  clickableList.data = ${JSON.stringify(data)};
59
59
  </script>
60
- `;
61
- export const BasicClickableList = TemplateClickableList.bind({});
62
- BasicClickableList.args = {
63
- data: [
64
- { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000', rowData: '[{ "name": "Demulon 1,000,000" }]' },
65
- { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Emma', rowData: [{ name: 'Emma' }] },
66
- { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Eulogio', rowData: 'Eulogio' },
67
- { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
68
- { clickable: false, icon: 'chevron_right', element: '<span><tttx-icon icon="add" /></span> Lee ' },
69
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
70
- ],
71
- };
60
+ `;
61
+ export const BasicClickableList = TemplateClickableList.bind({});
62
+ BasicClickableList.args = {
63
+ data: [
64
+ { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000', rowData: '[{ "name": "Demulon 1,000,000" }]' },
65
+ { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Emma', rowData: [{ name: 'Emma' }] },
66
+ { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Eulogio', rowData: 'Eulogio' },
67
+ { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
68
+ { clickable: false, icon: 'chevron_right', element: '<span><tttx-icon icon="add" /></span> Lee ' },
69
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
70
+ ],
71
+ };
@@ -0,0 +1,9 @@
1
+ import { newE2EPage } from '@stencil/core/testing';
2
+ describe('tttx-standalone-input', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<tttx-standalone-input></tttx-standalone-input>');
6
+ const element = await page.find('tttx-standalone-input');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
@@ -0,0 +1,219 @@
1
+ import { newSpecPage } from '@stencil/core/testing';
2
+ import { TttxInput } from '../tttx-standalone-input';
3
+ describe('tttx-standalone-input', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [TttxInput],
7
+ html: '<tttx-standalone-input />',
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <tttx-standalone-input>
11
+ <label class="inputBlock">
12
+ <span class="optional">
13
+ (optional)
14
+ </span>
15
+ <div class="input-container">
16
+ <input class="standalone" type="text">
17
+ <span class="errorBubble">
18
+ <span class="material-symbols-rounded validationicon">
19
+ warning
20
+ </span>
21
+ </span>
22
+ </div>
23
+ </label>
24
+ </tttx-standalone-input>
25
+ `);
26
+ });
27
+ it('renders the input field with the left icon', async () => {
28
+ const page = await newSpecPage({
29
+ components: [TttxInput],
30
+ html: '<tttx-standalone-input iconleft="info" />',
31
+ });
32
+ expect(page.root).toEqualHtml(`
33
+ <tttx-standalone-input iconleft="info">
34
+ <label class="inputBlock">
35
+ <span class="optional">
36
+ (optional)
37
+ </span>
38
+ <div class="icon-left">
39
+ <tttx-icon color="grey" icon="info"></tttx-icon>
40
+ </div>
41
+ <div class="input-container">
42
+ <input class="standalone" type="text">
43
+ <span class="errorBubble">
44
+ <span class="material-symbols-rounded validationicon">
45
+ warning
46
+ </span>
47
+ </span>
48
+ </div>
49
+ </label>
50
+ </tttx-standalone-input>
51
+ `);
52
+ });
53
+ it('renders the input field with the right icon', async () => {
54
+ const page = await newSpecPage({
55
+ components: [TttxInput],
56
+ html: '<tttx-standalone-input iconright="info" />',
57
+ });
58
+ expect(page.root).toEqualHtml(`
59
+ <tttx-standalone-input iconright="info">
60
+ <label class="inputBlock">
61
+ <span class="optional">
62
+ (optional)
63
+ </span>
64
+ <div class="input-container">
65
+ <input class="standalone" type="text">
66
+ <div class="icon-right">
67
+ <tttx-icon color="grey" icon="info"></tttx-icon>
68
+ </div>
69
+ <span class="errorBubble">
70
+ <span class="material-symbols-rounded validationicon">
71
+ warning
72
+ </span>
73
+ </span>
74
+ </div>
75
+ </label>
76
+ </tttx-standalone-input>
77
+ `);
78
+ });
79
+ it('renders the input field with an error message', async () => {
80
+ const page = await newSpecPage({
81
+ components: [TttxInput],
82
+ html: '<tttx-standalone-input required showerrormsg errormsg="The field is required" />',
83
+ });
84
+ expect(page.root).toEqualHtml(`
85
+ <tttx-standalone-input errormsg="The field is required" required="" showerrormsg="">
86
+ <label class="inputBlock">
87
+ <div class="input-container">
88
+ <input class="invalid standalone" required="" type="text">
89
+ <span class="errorBubble visible">
90
+ <span class="material-symbols-rounded validationicon">
91
+ warning
92
+ </span>
93
+ The field is required
94
+ </span>
95
+ </div>
96
+ </label>
97
+ </tttx-standalone-input>
98
+ `);
99
+ });
100
+ it('renders the label as inline', async () => {
101
+ const page = await newSpecPage({
102
+ components: [TttxInput],
103
+ html: '<tttx-standalone-input inline />',
104
+ });
105
+ expect(page.root).toEqualHtml(`
106
+ <tttx-standalone-input inline="">
107
+ <label class="inputInline">
108
+ <span class="optional">
109
+ (optional)
110
+ </span>
111
+ <div class="input-container">
112
+ <input class="standalone" type="text">
113
+ <span class="errorBubble">
114
+ <span class="material-symbols-rounded validationicon">
115
+ warning
116
+ </span>
117
+ </span>
118
+ </div>
119
+ </label>
120
+ </tttx-standalone-input>
121
+ `);
122
+ });
123
+ it('renders the input with an icon within the field', async () => {
124
+ const page = await newSpecPage({
125
+ components: [TttxInput],
126
+ html: '<tttx-standalone-input inputicon="search" />',
127
+ });
128
+ expect(page.root).toEqualHtml(`
129
+ <tttx-standalone-input inputicon="search">
130
+ <label class="inputBlock">
131
+ <span class="optional">
132
+ (optional)
133
+ </span>
134
+ <div class="input-container">
135
+ <tttx-icon class="input-icon" icon="search" color="grey"></tttx-icon>
136
+ <input class="standalone" type="text">
137
+ <span class="errorBubble">
138
+ <span class="material-symbols-rounded validationicon">
139
+ warning
140
+ </span>
141
+ </span>
142
+ </div>
143
+ </label>
144
+ </tttx-standalone-input>
145
+ `);
146
+ });
147
+ it('renders the input without the errorbubble', async () => {
148
+ const page = await newSpecPage({
149
+ components: [TttxInput],
150
+ html: '<tttx-standalone-input showerrorbubble="false" />',
151
+ });
152
+ expect(page.root).toEqualHtml(`
153
+ <tttx-standalone-input showerrorbubble="false">
154
+ <label class="inputBlock">
155
+ <span class="optional">
156
+ (optional)
157
+ </span>
158
+ <div class="input-container">
159
+ <input class="standalone" type="text">
160
+ </div>
161
+ </label>
162
+ </tttx-standalone-input>
163
+ `);
164
+ });
165
+ it('can trigger onInput handler', async () => {
166
+ const page = await newSpecPage({
167
+ components: [TttxInput],
168
+ html: '<tttx-standalone-input />',
169
+ });
170
+ const callbackFn = jest.fn();
171
+ page.doc.addEventListener('valueChanged', callbackFn);
172
+ const input = page.root.querySelector('input');
173
+ input.value = 'a';
174
+ const event = new CustomEvent('input', { composed: true, bubbles: true });
175
+ input.dispatchEvent(event);
176
+ expect(callbackFn).toHaveBeenCalled();
177
+ });
178
+ it('can trigger onFocus handler', async () => {
179
+ const page = await newSpecPage({
180
+ components: [TttxInput],
181
+ html: '<tttx-standalone-input />',
182
+ });
183
+ const callbackFn = jest.fn();
184
+ page.doc.addEventListener('focusChanged', callbackFn);
185
+ const input = page.root.querySelector('input');
186
+ input.focus();
187
+ const event = new CustomEvent('focus', { composed: true, bubbles: true });
188
+ input.dispatchEvent(event);
189
+ expect(callbackFn).toHaveBeenCalled();
190
+ });
191
+ it('can trigger onBlur handler', async () => {
192
+ const page = await newSpecPage({
193
+ components: [TttxInput],
194
+ html: '<tttx-standalone-input />',
195
+ });
196
+ const callbackFn = jest.fn();
197
+ page.doc.addEventListener('blurChanged', callbackFn);
198
+ const input = page.root.querySelector('input');
199
+ input.blur();
200
+ const event = new CustomEvent('blur', { composed: true, bubbles: true });
201
+ input.dispatchEvent(event);
202
+ expect(callbackFn).toHaveBeenCalled();
203
+ });
204
+ it('can trigger onInvalid handler', async () => {
205
+ const page = await newSpecPage({
206
+ components: [TttxInput],
207
+ html: '<tttx-standalone-input />',
208
+ });
209
+ const callbackFn = jest.fn();
210
+ page.doc.addEventListener('invalidChanged', callbackFn);
211
+ const input = page.root.querySelector('input');
212
+ // Doesn't work:
213
+ // input.setCustomValidity('required');
214
+ // input.checkValidity();
215
+ const event = new CustomEvent('invalid', { composed: true, bubbles: true });
216
+ input.dispatchEvent(event);
217
+ expect(callbackFn).toHaveBeenCalled();
218
+ });
219
+ });
@@ -45,7 +45,6 @@
45
45
 
46
46
  .icon-right {
47
47
  margin-top: 5px;
48
- margin-right: 4px;
49
48
  }
50
49
 
51
50
  .icon-left {
@@ -61,8 +60,10 @@
61
60
  padding-right: 4px;
62
61
  }
63
62
 
64
- .focused {
65
- border-color: #1479c6;
63
+ .input-icon {
64
+ position: absolute;
65
+ margin-top: 9px;
66
+ margin-left: 4px;
66
67
  }
67
68
 
68
69
  .errormsg {
@@ -104,6 +105,20 @@ label.inputBlock {
104
105
  line-height: 21px;
105
106
  }
106
107
 
108
+ label.inputInline {
109
+ display: flex;
110
+ white-space: nowrap;
111
+ align-items: center;
112
+ }
113
+ label.inputInline .input-container {
114
+ margin: 0 4px;
115
+ width: 100%;
116
+ display: flex;
117
+ align-items: center;
118
+ gap: 4px;
119
+ position: relative;
120
+ }
121
+
107
122
  label {
108
123
  font-weight: 500;
109
124
  font-size: 16px;
@@ -129,10 +144,20 @@ input[type=date] {
129
144
  line-height: 37px;
130
145
  }
131
146
 
147
+ /* Android device date alignment fix */
148
+ @media (max-width: 600px) {
149
+ input[type=date] {
150
+ padding-top: 6px;
151
+ }
152
+ }
132
153
  input.invalid:invalid, input.standalone.invalid {
133
154
  border: 1px solid #dc0000;
134
155
  }
135
156
 
157
+ .input-icon ~ input {
158
+ padding: 0 32px;
159
+ }
160
+
136
161
  input ~ .errorBubble {
137
162
  min-height: 27px;
138
163
  position: relative;
@@ -172,6 +197,10 @@ input:focus {
172
197
  border-color: #1479c6;
173
198
  }
174
199
 
200
+ input:focus-visible {
201
+ outline: none;
202
+ }
203
+
175
204
  :host {
176
205
  display: block;
177
206
  }