@epa-wg/custom-element-dist 0.0.29 → 0.0.32

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 (175) hide show
  1. package/.idea/custom-element-dist.iml +11 -0
  2. package/.idea/inspectionProfiles/Project_Default.xml +25 -0
  3. package/.idea/misc.xml +6 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.storybook/main.ts +21 -19
  7. package/.storybook/preview.ts +25 -25
  8. package/README.md +4 -4
  9. package/coverage/coverage-final.json +21 -21
  10. package/coverage/index.html +26 -26
  11. package/coverage/src/custom-element/coverage.svg +1 -1
  12. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  13. package/coverage/src/custom-element/custom-element.js.html +543 -441
  14. package/coverage/src/custom-element/http-request.js.html +12 -12
  15. package/coverage/src/custom-element/index.html +18 -18
  16. package/coverage/src/custom-element/local-storage.js.html +52 -52
  17. package/coverage/src/custom-element/location-element.js.html +4 -4
  18. package/coverage/src/custom-element/module-url.js.html +1 -1
  19. package/coverage/src/index.html +1 -1
  20. package/coverage/src/mocks/handlers.ts.html +1 -1
  21. package/coverage/src/mocks/index.html +1 -1
  22. package/coverage/src/stories/attributes.test.stories.ts/coverage.svg +1 -1
  23. package/coverage/src/stories/attributes.test.stories.ts.html +335 -35
  24. package/coverage/src/stories/coverage.svg +1 -1
  25. package/coverage/src/stories/css.test.stories.ts.html +1 -1
  26. package/coverage/src/stories/dom-merge.test.stories.ts.html +1 -1
  27. package/coverage/src/stories/external-template.test.stories.ts.html +2 -2
  28. package/coverage/src/stories/form.test.stories.ts.html +1 -1
  29. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  30. package/coverage/src/stories/index.html +22 -22
  31. package/coverage/src/stories/local-storage.test.stories.ts.html +17 -17
  32. package/coverage/src/stories/location-element.test.stories.ts.html +3 -6
  33. package/coverage/src/stories/module-url.test.stories.ts.html +1 -1
  34. package/coverage/src/stories/set-url.test.stories.ts.html +1 -1
  35. package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +1 -1
  36. package/coverage/src/stories/slice-events.test.stories.ts.html +284 -23
  37. package/coverage/src/stories/slots.test.stories.ts.html +1 -1
  38. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  39. package/coverage/src/stories/version-select.test.stories.ts.html +3 -3
  40. package/coverage/src/sum.ts.html +1 -1
  41. package/dist/custom-element-D2wf_rqP.js +576 -0
  42. package/dist/custom-element-Dtzhbjkc.cjs +97 -0
  43. package/dist/custom-element-bundle.cjs +1 -1
  44. package/dist/custom-element-bundle.js +30 -28
  45. package/dist/demo/a.html +51 -38
  46. package/dist/demo/a.svg +26 -26
  47. package/dist/demo/data-slices.html +37 -0
  48. package/dist/demo/external-template.html +1 -0
  49. package/dist/demo/form.html +42 -0
  50. package/dist/demo/hex-grid-dce.html +1 -1
  51. package/dist/demo/hex-grid.html +1 -1
  52. package/dist/demo/parameters.html +20 -1
  53. package/dist/demo/s.xml +6 -12
  54. package/dist/demo/s.xslt +64 -15
  55. package/dist/demo/ss.html +4 -23
  56. package/package.json +13 -13
  57. package/public/demo/a.html +51 -38
  58. package/public/demo/a.svg +26 -26
  59. package/public/demo/data-slices.html +37 -0
  60. package/public/demo/external-template.html +1 -0
  61. package/public/demo/form.html +42 -0
  62. package/public/demo/hex-grid-dce.html +1 -1
  63. package/public/demo/hex-grid.html +1 -1
  64. package/public/demo/parameters.html +20 -1
  65. package/public/demo/s.xml +6 -12
  66. package/public/demo/s.xslt +64 -15
  67. package/public/demo/ss.html +4 -23
  68. package/src/custom-element/custom-element.js +76 -42
  69. package/src/custom-element/demo/a.html +51 -38
  70. package/src/custom-element/demo/a.svg +26 -26
  71. package/src/custom-element/demo/data-slices.html +37 -0
  72. package/src/custom-element/demo/external-template.html +1 -0
  73. package/src/custom-element/demo/form.html +42 -0
  74. package/src/custom-element/demo/hex-grid-dce.html +1 -1
  75. package/src/custom-element/demo/hex-grid.html +1 -1
  76. package/src/custom-element/demo/parameters.html +20 -1
  77. package/src/custom-element/demo/s.xml +6 -12
  78. package/src/custom-element/demo/s.xslt +64 -15
  79. package/src/custom-element/demo/ss.html +4 -23
  80. package/src/custom-element/ide/web-types-dce.json +1 -1
  81. package/src/custom-element/ide/web-types-xsl.json +1 -1
  82. package/src/material/angular.css +987 -987
  83. package/src/material/components/autocomplete.html +239 -240
  84. package/src/material/components/dropdown.html +110 -46
  85. package/src/material/components/icon-link.html +160 -160
  86. package/src/material/components/input.html +363 -0
  87. package/src/material/components/menu.html +234 -234
  88. package/src/material/components.html +121 -120
  89. package/src/material/demo.css +36 -31
  90. package/src/material/index.html +110 -110
  91. package/src/material/material.css +356 -356
  92. package/src/material/theme/README.md +17 -17
  93. package/src/material/theme/semantic.css +113 -112
  94. package/src/mocks/versions.mock.ts +8 -8
  95. package/src/stories/attributes.test.stories.ts +123 -23
  96. package/src/stories/external-template.test.stories.ts +1 -1
  97. package/src/stories/location-element.test.stories.ts +1 -2
  98. package/src/stories/slice-events.test.stories.ts +87 -0
  99. package/storybook-static/assets/Color-F6OSRLHC-BU3iy8jH.js +1 -0
  100. package/storybook-static/assets/{Configure-DOhzHFEs.js → Configure-DN6ifayP.js} +1 -1
  101. package/storybook-static/assets/{DocsRenderer-CFRXHY34-BSJkbsd6.js → DocsRenderer-CFRXHY34-BaVEufDj.js} +2 -2
  102. package/storybook-static/assets/attributes.test.stories-D1X6EBrd.js +278 -0
  103. package/storybook-static/assets/{css.test.stories-pgbBc17d.js → css.test.stories-Cp_g2hE1.js} +1 -1
  104. package/storybook-static/assets/custom-element-uuAtIYWS.js +97 -0
  105. package/storybook-static/assets/{dom-merge.test.stories-CXcYP_-J.js → dom-merge.test.stories-hbpdCka0.js} +1 -1
  106. package/storybook-static/assets/entry-preview-DHVXbf3x.js +26 -0
  107. package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +2 -0
  108. package/storybook-static/assets/{external-template.test.stories-CpJ68Ghy.js → external-template.test.stories-BK89h6sk.js} +3 -3
  109. package/storybook-static/assets/{form.test.stories-D35lyqd8.js → form.test.stories-BfoLe_rw.js} +1 -1
  110. package/storybook-static/assets/{handlers-CW9pDZnt.js → handlers-yVPwH_Nz.js} +21 -21
  111. package/storybook-static/assets/{http-request.stories-CBbknCOO.js → http-request.stories-CBFJS2Ws.js} +1 -1
  112. package/storybook-static/assets/iframe-CJEL_4Nu.js +2 -0
  113. package/storybook-static/assets/index-BcZLpTeD.js +8 -0
  114. package/storybook-static/assets/{index-BSz1w4Gl.js → index-CxRwF5Or.js} +130 -130
  115. package/storybook-static/assets/index-D5fBh-7N.js +1 -0
  116. package/storybook-static/assets/{index-YxUFxnQR.js → index-DM-KBPdl.js} +1 -1
  117. package/storybook-static/assets/{index-B3QjF0Ed.js → index-RSFf30w1.js} +1 -1
  118. package/storybook-static/assets/index-SnjB5uV8.js +769 -0
  119. package/storybook-static/assets/{local-storage.test.stories-BY-PWhuk.js → local-storage.test.stories-C0Yzy6Am.js} +1 -1
  120. package/storybook-static/assets/{location-element.test.stories-3auBYEaU.js → location-element.test.stories-DNFrEu5A.js} +1 -1
  121. package/storybook-static/assets/{module-url.test.stories-B7L9cL60.js → module-url.test.stories-CXibF5Ta.js} +1 -1
  122. package/storybook-static/assets/{preview-CfWMRsRq.js → preview-Bnd0XhaF.js} +2 -2
  123. package/storybook-static/assets/{preview-BRPR-UXC.js → preview-CNKoaWES.js} +1 -1
  124. package/storybook-static/assets/preview-DAeyCMnM.js +1 -0
  125. package/storybook-static/assets/preview-DJMlNTk8.js +2 -0
  126. package/storybook-static/assets/{set-url.test.stories-CuSuDLIx.js → set-url.test.stories-BBfLxv2u.js} +1 -1
  127. package/storybook-static/assets/{slice-events.test.stories-BkRKsKem.js → slice-events.test.stories-HcXF8XQI.js} +138 -13
  128. package/storybook-static/assets/{slots.test.stories-BJCUWFkE.js → slots.test.stories-i6mnIFM2.js} +1 -1
  129. package/storybook-static/assets/tiny-invariant-CopsF_GD.js +1 -0
  130. package/storybook-static/assets/{version-select.test.stories-B3ybJn_Z.js → version-select.test.stories-BsUFH6Va.js} +1 -1
  131. package/storybook-static/demo/a.html +51 -38
  132. package/storybook-static/demo/a.svg +26 -26
  133. package/storybook-static/demo/data-slices.html +37 -0
  134. package/storybook-static/demo/external-template.html +1 -0
  135. package/storybook-static/demo/form.html +42 -0
  136. package/storybook-static/demo/hex-grid-dce.html +1 -1
  137. package/storybook-static/demo/hex-grid.html +1 -1
  138. package/storybook-static/demo/parameters.html +20 -1
  139. package/storybook-static/demo/s.xml +6 -12
  140. package/storybook-static/demo/s.xslt +64 -15
  141. package/storybook-static/demo/ss.html +4 -23
  142. package/storybook-static/iframe.html +2 -2
  143. package/storybook-static/index.html +4 -0
  144. package/storybook-static/index.json +1 -1
  145. package/storybook-static/project.json +1 -1
  146. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +333 -0
  147. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +40 -0
  148. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
  149. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
  150. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +82 -85
  151. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
  152. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
  153. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  154. package/storybook-static/sb-addons/interactions-9/manager-bundle.js +66 -67
  155. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +1 -1
  156. package/storybook-static/sb-manager/globals-module-info.js +25 -3
  157. package/storybook-static/sb-manager/globals-runtime.js +29585 -43124
  158. package/storybook-static/sb-manager/runtime.js +10647 -9399
  159. package/storybook-static/sb-preview/runtime.js +3536 -5860
  160. package/test-runner-jest.config.js +15 -0
  161. package/dist/custom-element-BOIPgtxz.js +0 -565
  162. package/dist/custom-element-CUsSENWc.cjs +0 -97
  163. package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
  164. package/storybook-static/assets/Color-ERTF36HU-CQkSD2nd.js +0 -1
  165. package/storybook-static/assets/attributes.test.stories-BJBuuXgZ.js +0 -150
  166. package/storybook-static/assets/custom-element-BDGsYgbP.js +0 -97
  167. package/storybook-static/assets/entry-preview-C313OLrj.js +0 -26
  168. package/storybook-static/assets/entry-preview-docs-B7ORr9w5.js +0 -2
  169. package/storybook-static/assets/iframe-DOi4N7qI.js +0 -2
  170. package/storybook-static/assets/index-BdcJ-iJ7.js +0 -8
  171. package/storybook-static/assets/index-CaL3Qp7t.js +0 -634
  172. package/storybook-static/assets/index-DgFM0Ce3.js +0 -1
  173. package/storybook-static/assets/preview-C992A1Y-.js +0 -2
  174. package/storybook-static/assets/preview-CcS4DQh8.js +0 -1
  175. package/storybook-static/assets/tiny-invariant-BxWVcicq.js +0 -1
@@ -1,18 +1,18 @@
1
- # Semantic theming
2
- Based on https://blog.firsov.net/search/label/Semantic%20Theme
3
-
4
-
5
- # Line thickness, stroke weight
6
- [Typography Guide Part 2: Weight and Width](https://creativebeacon.com/typography-guide-part-2-weight-and-width/)
7
- The different weights can be
8
- * **xx-light** ultra thin or ultra light,
9
- * **x-light** extra light,
10
- * **light**
11
- * **normal** or roman,
12
- * **bold**
13
- * **x-bold** extra bold,
14
- * **xx-bold** ultra bold or black,
15
-
16
- # Text Tracking/Spacing
17
- [wiki](https://en.wikipedia.org/wiki/Letter_spacing),
1
+ # Semantic theming
2
+ Based on https://blog.firsov.net/search/label/Semantic%20Theme
3
+
4
+
5
+ # Line thickness, stroke weight
6
+ [Typography Guide Part 2: Weight and Width](https://creativebeacon.com/typography-guide-part-2-weight-and-width/)
7
+ The different weights can be
8
+ * **xx-light** ultra thin or ultra light,
9
+ * **x-light** extra light,
10
+ * **light**
11
+ * **normal** or roman,
12
+ * **bold**
13
+ * **x-bold** extra bold,
14
+ * **xx-bold** ultra bold or black,
15
+
16
+ # Text Tracking/Spacing
17
+ [wiki](https://en.wikipedia.org/wiki/Letter_spacing),
18
18
  [units](https://css-tricks.com/keeping-track-letter-spacing-guidelines/)
@@ -1,112 +1,113 @@
1
- /* cem - custom-element material
2
- SEMANTIC THEME basic definitions
3
- based on https://blog.firsov.net/search/label/Semantic%20Theme
4
- */
5
- :root{
6
-
7
- /*#region SPACING DIMENSIONS */
8
- --cem-dim-xx-small : 0.25rem;
9
- --cem-dim-x-small : 0.5rem;
10
- --cem-dim-small : 0.75rem;
11
- --cem-dim-medium : 1rem;
12
- --cem-dim-large : 1.5rem;
13
- --cem-dim-x-large : 2rem;
14
- --cem-dim-xx-large : 4rem;
15
- --cem-dim-xxx-large : 8rem;
16
- /*#endregion */
17
-
18
- /*#region OUTLINE THIKNESS */
19
- --cem-thick-none: 0;
20
- --cem-thick-xx-light: 0.5px;
21
- --cem-thick-x-light : 1px;
22
- --cem-thick-light : 2px;
23
- --cem-thick-normal : 4px;
24
- --cem-thick-bold : 0.5rem;
25
- --cem-thick-x-bold : 1rem;
26
- --cem-thick-xx-bold : 4rem;
27
- /*#endregion */
28
-
29
- /*#region TEXT TRACKING/SPACING */
30
- --cem-tracking-negative : -0.25em;
31
- --cem-tracking-stick : 0;
32
- --cem-tracking-tight : 0.5px;
33
- --cem-tracking-normal : auto;
34
- --cem-tracking-loose : 0.25em;
35
- --cem-tracking-sparse : 0.5em;
36
- --cem-tracking-spread : 1em;
37
- /*#endregion */
38
-
39
- /*#region branded colors */
40
-
41
- /*#endregion */
42
-
43
- /*#region action */
44
-
45
- /*#endregion */
46
-
47
- }
48
-
49
-
50
- /*#region semantic colors */
51
- :root, .cem-theme-default, .cem-theme-azure{
52
-
53
- --primary-background-color: var(--ng-azure-90);
54
- --secondary-background-color: var(--ng-azure-80);
55
- --alert-color: var(--ng-magenta-80);
56
- --text-color: var(--ng-azure-10);
57
-
58
- --cem-action-primary-color: var(--text-color);
59
- --cem-action-primary-background: transparent;
60
- --cem-action-primary-background-hover: var(--ng-azure-80,lightgrey);
61
- --cem-action-primary-background-focus: var(--ng-azure-70,silver);
62
- --cem-action-primary-background-active: var(--ng-azure-60,grey);
63
-
64
- --cem-action-secondary-color: var(--text-color);
65
- --cem-action-secondary-background: var(--ng-azure-secondary-90);
66
- --cem-action-secondary-background-hover: var(--ng-azure-secondary-80,lightgrey);
67
- --cem-action-secondary-background-focus: var(--ng-azure-secondary-70,silver);
68
- --cem-action-secondary-background-active: var(--ng-azure-secondary-60,grey);
69
-
70
- --cem-action-box-shadow: var(--ng-action-elevation-shadow, 0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12));
71
- --cem-action-box-shadow-hover: var(--ng-action-box-shadow-hover);
72
- --cem-action-transition: var(--ng-action-transition);
73
-
74
- --cem-app-surface-variant: var(--ng-azure-variant-90);
75
- --cem-app-on-surface: var(--ng-azure-variant-70);
76
- --cem-app-primary: var(--ng-azure-variant-60);
77
-
78
- --cem-filled-text-field-container-color: var(--ng-azure-variant-90);
79
- --cem-filled-text-field-label-text-color: var(--ng-azure-variant-30);
80
- --cem-filled-text-field-input-text-color: var(--ng-azure-variant-0);
81
- --cem-filled-text-field-caret-color: var(--ng-azure-variant-10);
82
- --cem-outline-color-focus: var(--ng-azure-40);
83
-
84
- --cem-list-background-color: var(--ng-azure-neutral-94);
85
- --cem-list-background-color-hover: var(--ng-azure-variant-90);
86
- --cem-list-background-color-focus: var(--ng-azure-variant-80);
87
-
88
- --cem-menu-item-color: black;
89
- --cem-menu-item-color-disabled: var(--ng-azure-neutral-50);
90
- --cem-menu-item-background: var(--ng-azure-neutral-94);
91
- --cem-menu-item-hover-background: var(--ng-azure-neutral-80);
92
- --cem-menu-item-hover-color: black;
93
- --cem-menu-item-padding: 0.5rem;
94
- --cem-menu-item-font-weight: bold;
95
- }
96
-
97
- .cem-theme-teal{
98
-
99
- --primary-color: var(--ng-teal-primary);
100
- --secondary-color: var(--ng-teal-hover);
101
- --alert-color: var(--ng-magenta-80);
102
- --text-color: var(--ng-azure-40);
103
-
104
- --cem-action-primary-color: var(--primary-color);
105
-
106
- --cem-action-primary-background: transparent;
107
- --cem-action-primary-background-hover: var(--ng-teal-hover,lightgrey);
108
- --cem-action-primary-background-focus: var(--ng-teal-focus,silver);
109
- --cem-action-primary-background-active: var(--ng-teal-active,grey);
110
- }
111
-
112
- /*#endregion */
1
+ /* cem - custom-element material
2
+ SEMANTIC THEME basic definitions
3
+ based on https://blog.firsov.net/search/label/Semantic%20Theme
4
+ */
5
+ :root{
6
+
7
+ /*#region SPACING DIMENSIONS */
8
+ --cem-dim-xx-small : 0.25rem;
9
+ --cem-dim-x-small : 0.5rem;
10
+ --cem-dim-small : 0.75rem;
11
+ --cem-dim-medium : 1rem;
12
+ --cem-dim-large : 1.5rem;
13
+ --cem-dim-x-large : 2rem;
14
+ --cem-dim-xx-large : 4rem;
15
+ --cem-dim-xxx-large : 8rem;
16
+ /*#endregion */
17
+
18
+ /*#region OUTLINE THIKNESS */
19
+ --cem-thick-none: 0;
20
+ --cem-thick-xx-light: 0.5px;
21
+ --cem-thick-x-light : 1px;
22
+ --cem-thick-light : 2px;
23
+ --cem-thick-normal : 4px;
24
+ --cem-thick-bold : 0.5rem;
25
+ --cem-thick-x-bold : 1rem;
26
+ --cem-thick-xx-bold : 4rem;
27
+ /*#endregion */
28
+
29
+ /*#region TEXT TRACKING/SPACING */
30
+ --cem-tracking-negative : -0.25em;
31
+ --cem-tracking-stick : 0;
32
+ --cem-tracking-tight : 0.5px;
33
+ --cem-tracking-normal : auto;
34
+ --cem-tracking-loose : 0.25em;
35
+ --cem-tracking-sparse : 0.5em;
36
+ --cem-tracking-spread : 1em;
37
+ /*#endregion */
38
+
39
+ /*#region branded colors */
40
+
41
+ /*#endregion */
42
+
43
+ /*#region action */
44
+ --cem-drop-transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
45
+
46
+ /*#endregion */
47
+
48
+ }
49
+
50
+
51
+ /*#region semantic colors */
52
+ :root, .cem-theme-default, .cem-theme-azure{
53
+
54
+ --primary-background-color: var(--ng-azure-90);
55
+ --secondary-background-color: var(--ng-azure-80);
56
+ --alert-color: var(--ng-magenta-80);
57
+ --text-color: var(--ng-azure-10);
58
+
59
+ --cem-action-primary-color: var(--text-color);
60
+ --cem-action-primary-background: transparent;
61
+ --cem-action-primary-background-hover: var(--ng-azure-80,lightgrey);
62
+ --cem-action-primary-background-focus: var(--ng-azure-70,silver);
63
+ --cem-action-primary-background-active: var(--ng-azure-60,grey);
64
+
65
+ --cem-action-secondary-color: var(--text-color);
66
+ --cem-action-secondary-background: var(--ng-azure-secondary-90);
67
+ --cem-action-secondary-background-hover: var(--ng-azure-secondary-80,lightgrey);
68
+ --cem-action-secondary-background-focus: var(--ng-azure-secondary-70,silver);
69
+ --cem-action-secondary-background-active: var(--ng-azure-secondary-60,grey);
70
+
71
+ --cem-action-box-shadow: var(--ng-action-elevation-shadow, 0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12));
72
+ --cem-action-box-shadow-hover: var(--ng-action-box-shadow-hover);
73
+ --cem-action-transition: var(--ng-action-transition);
74
+
75
+ --cem-app-surface-variant: var(--ng-azure-variant-90);
76
+ --cem-app-on-surface: var(--ng-azure-variant-70);
77
+ --cem-app-primary: var(--ng-azure-variant-60);
78
+
79
+ --cem-filled-text-field-container-color: var(--ng-azure-variant-90);
80
+ --cem-filled-text-field-label-text-color: var(--ng-azure-variant-30);
81
+ --cem-filled-text-field-input-text-color: var(--ng-azure-variant-0);
82
+ --cem-filled-text-field-caret-color: var(--ng-azure-variant-10);
83
+ --cem-outline-color-focus: var(--ng-azure-40);
84
+
85
+ --cem-list-background-color: var(--ng-azure-neutral-94);
86
+ --cem-list-background-color-hover: var(--ng-azure-variant-90);
87
+ --cem-list-background-color-focus: var(--ng-azure-variant-80);
88
+
89
+ --cem-menu-item-color: black;
90
+ --cem-menu-item-color-disabled: var(--ng-azure-neutral-50);
91
+ --cem-menu-item-background: var(--ng-azure-neutral-94);
92
+ --cem-menu-item-hover-background: var(--ng-azure-neutral-80);
93
+ --cem-menu-item-hover-color: black;
94
+ --cem-menu-item-padding: 0.5rem;
95
+ --cem-menu-item-font-weight: bold;
96
+ }
97
+
98
+ .cem-theme-teal{
99
+
100
+ --primary-color: var(--ng-teal-primary);
101
+ --secondary-color: var(--ng-teal-hover);
102
+ --alert-color: var(--ng-magenta-80);
103
+ --text-color: var(--ng-azure-40);
104
+
105
+ --cem-action-primary-color: var(--primary-color);
106
+
107
+ --cem-action-primary-background: transparent;
108
+ --cem-action-primary-background-hover: var(--ng-teal-hover,lightgrey);
109
+ --cem-action-primary-background-focus: var(--ng-teal-focus,silver);
110
+ --cem-action-primary-background-active: var(--ng-teal-active,grey);
111
+ }
112
+
113
+ /*#endregion */
@@ -3,7 +3,7 @@ export default {
3
3
  "_rev": "5-df363ab4a2b9c478c01e021bde4fbafe",
4
4
  "name": "@epa-wg/custom-element-dist",
5
5
  "dist-tags": {
6
- "latest": "0.0.29"
6
+ "latest": "0.0.32"
7
7
  },
8
8
  "versions": {
9
9
  "0.0.1": {
@@ -617,9 +617,9 @@ export default {
617
617
  "host": "s3://npm-registry-packages"
618
618
  }
619
619
  },
620
- "0.0.29": {
620
+ "0.0.31": {
621
621
  "name": "@epa-wg/custom-element-dist",
622
- "version": "0.0.29",
622
+ "version": "0.0.31",
623
623
  "type": "module",
624
624
  "scripts": {
625
625
  "dev": "vite",
@@ -636,7 +636,7 @@ export default {
636
636
  "t": "vitest --no-file-parallelism --watch --browser.headless=false src/stories/attributes.test.stories.ts"
637
637
  },
638
638
  "dependencies": {
639
- "@epa-wg/custom-element": "0.0.29"
639
+ "@epa-wg/custom-element": "0.0.31"
640
640
  },
641
641
  "devDependencies": {
642
642
  "@chromatic-com/storybook": "^1.3.3",
@@ -707,7 +707,7 @@ export default {
707
707
  "./src/custom-element/ide/web-types-dce.json",
708
708
  "./src/custom-element/ide/web-types-xsl.json"
709
709
  ],
710
- "_id": "@epa-wg/custom-element-dist@0.0.29",
710
+ "_id": "@epa-wg/custom-element-dist@0.0.31",
711
711
  "gitHead": "a6a84bdc2cc433acf3d3afa827556c79ecacffb8",
712
712
  "description": "Binary distribution for [@epa-wg/custom-element][git-url] with StoryBook and test coverage",
713
713
  "_nodeVersion": "20.8.1",
@@ -715,7 +715,7 @@ export default {
715
715
  "dist": {
716
716
  "integrity": "sha512-ISVPKkirFGvTTNFanf9WxOTeEBJrAyjuebqQSJiH97QHgG7pxQQAWUC4heBRbJ9kUo5FUmBDph2d9Rep/POCDw==",
717
717
  "shasum": "1a68a8bc37315cbcab0f66247aa54c82d7bc159d",
718
- "tarball": "https://registry.npmjs.org/@epa-wg/custom-element-dist/-/custom-element-dist-0.0.29.tgz",
718
+ "tarball": "https://registry.npmjs.org/@epa-wg/custom-element-dist/-/custom-element-dist-0.0.31.tgz",
719
719
  "fileCount": 299,
720
720
  "unpackedSize": 9437753,
721
721
  "signatures": [
@@ -751,7 +751,7 @@ export default {
751
751
  "0.0.22": "2024-06-25T03:55:52.525Z",
752
752
  "0.0.23": "2024-06-27T03:25:14.314Z",
753
753
  "0.0.24": "2024-07-22T03:10:12.564Z",
754
- "0.0.29": "2024-08-06T07:29:39.264Z"
754
+ "0.0.31": "2024-08-06T07:29:39.264Z"
755
755
  },
756
756
  "bugs": {
757
757
  "url": "https://github.com/EPA-WG/custom-element/issues"
@@ -781,6 +781,6 @@ export default {
781
781
  "email": "suns@simulationworks.com"
782
782
  }
783
783
  ],
784
- "readme": "# custom-element-dist\nBinary distribution for [@epa-wg/custom-element][git-url] with StoryBook and test coverage\n\n`custom-element` [![git][github-image] GitHub][git-url]\n| [tests project][git-test-url]\n| [![NPM version][npm-image]][npm-url]\n| [![coverage][coverage-image]][coverage-url]\n| [StoryBook][sb-url]\n\n# Content\n[bin/build.sh] generates binaries to be kept as in Git release as in NPM package.\nIt serves the record of compliance on the moment of build.\n## [dist](dist)\nCan be used as CDN entry with minified bundle: [custom-element-bundle.js][bundle-url]\n\nEach individual component of `custom-element` lib is available as hashed JS.\n\n## [coverage](coverage)\nProvides the unit test coverage for lib and StoryBooks\n\n## [storybook-static][sb-url]\nCDN version of StoryBook.\n\n[git-url]: https://github.com/EPA-WG/custom-element\n[git-test-url]: https://github.com/EPA-WG/custom-element-dist\n[github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg\n[npm-image]: https://img.shields.io/npm/v/@epa-wg/custom-element-dist.svg\n[npm-url]: https://npmjs.org/package/@epa-wg/custom-element-dist\n[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.29/coverage/src/custom-element/coverage.svg\n[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.29/coverage/src/custom-element/index.html\n[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.29/storybook-static/index.html\n[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.29/dist/custom-element-bundle.js\n",
784
+ "readme": "# custom-element-dist\nBinary distribution for [@epa-wg/custom-element][git-url] with StoryBook and test coverage\n\n`custom-element` [![git][github-image] GitHub][git-url]\n| [tests project][git-test-url]\n| [![NPM version][npm-image]][npm-url]\n| [![coverage][coverage-image]][coverage-url]\n| [StoryBook][sb-url]\n\n# Content\n[bin/build.sh] generates binaries to be kept as in Git release as in NPM package.\nIt serves the record of compliance on the moment of build.\n## [dist](dist)\nCan be used as CDN entry with minified bundle: [custom-element-bundle.js][bundle-url]\n\nEach individual component of `custom-element` lib is available as hashed JS.\n\n## [coverage](coverage)\nProvides the unit test coverage for lib and StoryBooks\n\n## [storybook-static][sb-url]\nCDN version of StoryBook.\n\n[git-url]: https://github.com/EPA-WG/custom-element\n[git-test-url]: https://github.com/EPA-WG/custom-element-dist\n[github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg\n[npm-image]: https://img.shields.io/npm/v/@epa-wg/custom-element-dist.svg\n[npm-url]: https://npmjs.org/package/@epa-wg/custom-element-dist\n[coverage-image]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.31/coverage/src/custom-element/coverage.svg\n[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.31/coverage/src/custom-element/index.html\n[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.31/storybook-static/index.html\n[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.31/dist/custom-element-bundle.js\n",
785
785
  "readmeFilename": "README.md"
786
786
  }
@@ -1,9 +1,9 @@
1
1
  // noinspection DuplicatedCode
2
2
 
3
3
  import type { StoryObj } from '@storybook/web-components';
4
- import {expect, within} from '@storybook/test';
4
+ import {expect, userEvent, within} from '@storybook/test';
5
5
 
6
- import '../custom-element/custom-element.js';
6
+ import {cloneAs, mix} from'../custom-element/custom-element.js';
7
7
 
8
8
  type TProps = { title: string; body:string};
9
9
 
@@ -29,12 +29,46 @@ const meta =
29
29
 
30
30
  export default meta;
31
31
 
32
+ export const CloneAs:Story =
33
+ { args : {title: 'cloneAs(el,newTag)', body:`
34
+ <p><code>cloneAs()</code> used for conversion of <code>attribute</code> to <code>xsl:param</code></p>
35
+ <attribute data-testid="t1" >default_P1 </attribute>
36
+ <attribute data-testid="t2" select="'always_p2'" ></attribute>
37
+ <attribute data-testid="t3" ></attribute>
38
+ `}
39
+ , play: async ({canvasElement}) =>
40
+ {
41
+ const canvas = within(canvasElement);
42
+
43
+ const cmp = async ( tid:string ) =>
44
+ { const t1 = await canvas.findByTestId(tid);
45
+ const c1 = cloneAs(t1, 'xsl:param');
46
+ for( let a of t1.attributes )
47
+ { await expect(a.value).toEqual(c1.getAttribute(a.name)); }
48
+
49
+ await expect( c1.textContent ).toEqual(t1.textContent);
50
+ }
51
+ await cmp('t1');
52
+ await cmp('t2');
53
+ await cmp('t3');
54
+ },
55
+ };
56
+ export const Mix:Story =
57
+ { args : {title: 'mix(to,from)', body:`
58
+ <p><code>mix(to,from)</code> used for <code>attribute</code> collections</p>
59
+ `}
60
+ , play: async () =>
61
+ {
62
+ await expect( mix({},{a:1,b:'2'})).toEqual({a:1,b:'2'});
63
+ },
64
+ };
65
+
32
66
  export const AttributeDefaults:Story =
33
67
  { args : {title: 'Attributes definition', body:`
34
68
  <p>Params needed to declare DCE attributes and track the attributes changes. It also is used by IDE and validation.</p>
35
69
  <custom-element tag="dce-link" >
36
70
  <template>
37
- <attribute name="p1">default_P1 </attribute>
71
+ <attribute name="p1">default_P1</attribute>
38
72
  <attribute name="p2" select="'always_p2'" ></attribute>
39
73
  <attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
40
74
  p1: <code data-testid="p1">{$p1}</code> <br/>
@@ -64,40 +98,40 @@ export const AttributesRuntimeChange:Story =
64
98
  <attribute name="p1">default_P1 </attribute>
65
99
  <attribute name="p2" select="'always_p2'" ></attribute>
66
100
  <attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
67
- p1: <code data-testid="p1">{$p1}</code> <br/>
68
- p2: <code data-testid="p2">{$p2}</code> <br/>
69
- p3: <code data-testid="p3">{$p3}</code>
101
+ p1: <code data-testid="t1">{$p1}</code> <br/>
102
+ p2: <code data-testid="t2">{$p2}</code> <br/>
103
+ p3: <code data-testid="t3">{$p3}</code>
70
104
  </template>
71
105
  </custom-element>
72
106
  <section>
73
- <dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br>
74
- <div><input id="i1" value="p1"> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
75
- <div><input id="i2" value="p2"> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
76
- <div><input id="i3" value="p3"> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
107
+ <dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br>
108
+ <div><input id="i1" value="P1"> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
109
+ <div><input id="i2" value="P2"> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
110
+ <div><input id="i3" value="P3"> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
77
111
  </section>
78
112
  `}
79
113
  , play: async ({canvasElement}) =>
80
114
  {
81
- const titleText = AttributeDefaults.args!.title as string;
82
115
  const canvas = within(canvasElement)
83
- , code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
116
+ , code = async (id:string) => await canvas.findByTestId(id);
84
117
 
85
118
  await sleep(20)
86
- expect( await code('p1') ).toEqual('123' );
87
- expect( await code('p2') ).toEqual('always_p2', 'no overrides due to value is hardcoded' );
88
- expect( await code('p3') ).toEqual('def_P3' );
89
-
90
- dce2.setAttribute('p1',i1.value);
91
- await sleep(10)
92
- expect( await code('p1') ).toEqual('p1','set p1 in runtime' );
119
+ expect( await code('t1') ).toHaveTextContent('123' );
120
+ expect( await code('t2') ).toHaveTextContent('always_p2'); // no overrides due to value is hardcoded
121
+ expect( await code('t3') ).toHaveTextContent('def_P3' );
122
+ const dce2 = window.dce2;
123
+ dce2.setAttribute('P1',i1.value);
124
+ await expect(await canvas.findByText('P1')).toBeInTheDocument();
125
+ expect( await code('t1') ).toHaveTextContent('P1'); // 4. set p1 in runtime'
93
126
 
94
127
  dce2.setAttribute('p2',i2.value);
95
- await sleep(10)
96
- expect( await code('p2') ).toEqual('always_p2','can not set p2 in runtime' );
128
+ // await expect(await canvas.findByText('P2')).toBeInTheDocument();
129
+ expect( canvas.getByTestId('t2') ).toHaveTextContent('always_p2'); // can not set p2 in runtime
97
130
 
98
131
  dce2.setAttribute('p3',i3.value);
99
- await sleep(10)
100
- expect( await code('p3') ).toEqual('p3','set p3 in runtime' );
132
+ await expect(await canvas.findByText('P3')).toBeInTheDocument();
133
+
134
+ expect( canvas.getByTestId('t3') ).toHaveTextContent('P3'); // set p3 in runtime
101
135
  },
102
136
  };
103
137
 
@@ -130,6 +164,72 @@ export const InstanceAttributes:Story =
130
164
  };
131
165
 
132
166
 
167
+ export const AttributesPropagationUp:Story =
168
+ { args : {title: 'Instance Attributes', body:`
169
+ <p>Attributes with value(p2) or <code>select</code>(p3) should be propagated to DCE</p>
170
+ <p>p1 attribute is not propagated as does not have the value.</p>
171
+ <custom-element tag="sample-el">
172
+ <template>
173
+ <attribute name="data-testid"></attribute>
174
+ <attribute name="p1"></attribute>
175
+ <attribute name="p2">DEFAULT VALUE</attribute>
176
+ <attribute name="p3" select=" //from-input ?? 'abc' "></attribute>
177
+ <input slice="from-input" slice-event="input"/><br/>
178
+ p1:<code data-testid="{$data-testid}-p1" >{ $p1 }</code><br/>
179
+ p2:<code data-testid="{$data-testid}-p2" >{ $p2 }</code><br/>
180
+ p2:<code data-testid="{$data-testid}-p3" >{ $p3 }</code><br/>
181
+ //from-input: {//from-input} <hr/>
182
+ </template>
183
+ </custom-element>
184
+
185
+ <sample-el data-testid="t1" value="123" ></sample-el>
186
+ <sample-el data-testid="t2" p1="P1" p2="123" p3="P3" ></sample-el>
187
+ <sample-el data-testid="t3" ></sample-el>
188
+ `}
189
+ , play: async ({canvasElement}) =>
190
+ {
191
+ const canvas = within(canvasElement)
192
+ , code = async (id:string) => (await canvas.findByTestId(id)).textContent?.trim();
193
+
194
+ await sleep(20)
195
+
196
+ await expect( await code('t1-p1') ).toEqual('' );
197
+ await expect( await code('t1-p2') ).toEqual('DEFAULT VALUE' );
198
+ await expect( await code('t1-p3') ).toEqual('abc' );
199
+
200
+ const t1 = await canvas.findByTestId('t1');
201
+ await expect( t1 ).toHaveAttribute('value','123');
202
+ await expect( t1 ).toHaveAttribute('p2','DEFAULT VALUE');
203
+ await expect( t1 ).toHaveAttribute('p3','abc');
204
+ await expect( t1 ).not.toHaveAttribute('p1');
205
+
206
+ await expect( await code('t2-p1') ).toEqual('P1' );
207
+ await expect( await code('t2-p2') ).toEqual('123' );
208
+ await expect( await code('t2-p3') ).toEqual('abc' );
209
+
210
+ const t2 = await canvas.findByTestId('t2');
211
+ await expect( t2 ).toHaveAttribute('p1','P1');
212
+ await expect( t2 ).toHaveAttribute('p2','123');
213
+ await expect( t2 ).toHaveAttribute('p3','abc');
214
+
215
+
216
+ await expect( await code('t3-p1') ).toEqual('' );
217
+ await expect( await code('t3-p2') ).toEqual('DEFAULT VALUE' );
218
+ await expect( await code('t3-p3') ).toEqual('abc' );
219
+
220
+ const t3 = await canvas.findByTestId('t3');
221
+ await expect( t1 ).not.toHaveAttribute('p1');
222
+ await expect( t3 ).toHaveAttribute('p2','DEFAULT VALUE');
223
+ await expect( t3 ).toHaveAttribute('p3','abc');
224
+
225
+ t3.querySelector('input')?.focus();
226
+ await userEvent.keyboard('DCE');
227
+ await expect( t3 ).toHaveAttribute('p3','DCE');
228
+
229
+ },
230
+ };
231
+
232
+
133
233
  //#region unit tests
134
234
  /* istanbul ignore else -- @preserve */
135
235
  if( 'test' === import.meta.env.MODE &&
@@ -44,7 +44,7 @@ export const TemplateInPage:Story =
44
44
  {
45
45
  const canvas = within(canvasElement);
46
46
  await canvas.findByText(TemplateInPage.args!.title as string);
47
- const val = (prop)=> canvas.getByTestId(prop).textContent.trim();
47
+ const val = (prop:string)=> canvas.getByTestId(prop).textContent?.trim();
48
48
 
49
49
  expect(val('slot-override')).toEqual('👋 World!');
50
50
  expect(val('slot-default' )).toEqual('Hello World!');
@@ -1,11 +1,10 @@
1
1
  // noinspection DuplicatedCode
2
2
 
3
3
  import type { StoryObj } from '@storybook/web-components';
4
- import {expect, getByTestId, within} from '@storybook/test';
4
+ import {expect, within} from '@storybook/test';
5
5
 
6
6
  import '../custom-element/custom-element.js';
7
7
  import '../custom-element/location-element.js';
8
- import {RealtimeEventInSlice, SliceInitChangeEvent} from './slice-events.test.stories';
9
8
 
10
9
  type TProps = { title: string; slice: string; href: string; live:string; body:string};
11
10
  const defs: TProps =
@@ -189,6 +189,93 @@ export const SlicesInAttrAndName:Story =
189
189
  },
190
190
  };
191
191
 
192
+
193
+ export const CheckboxChecked:Story =
194
+ { args : {title: 'Checkbox value in slice ', body:`
195
+ <p> Checked value propagated into slice</p>
196
+ <custom-element>
197
+ <template>
198
+ <input type="checkbox" slice="s1" value="V1" checked/>
199
+ <p>slice: {//s1}</p>
200
+ </template>
201
+ </custom-element>
202
+ `}
203
+ , play: async ({canvasElement}) =>
204
+ {
205
+ const canvas = within(canvasElement);
206
+ await expect( await canvas.findByText( 'slice: V1')).toBeInTheDocument();
207
+ },
208
+ };
209
+
210
+ export const CheckboxUnchecked:Story =
211
+ { args : {title: 'UncheckedCheckbox value not in slice ', body:`
212
+ <p> Check to see the value propagated into slice. Uncheck to observe the empty string in the slice. </p>
213
+ <custom-element>
214
+ <template>
215
+ <input type="checkbox" slice="s1" value="V1" data-testid="i1"/>
216
+ <p data-testid="t1">slice: {//s1}</p>
217
+ </template>
218
+ </custom-element>
219
+ `}
220
+ , play: async ({canvasElement}) =>
221
+ {
222
+ const canvas = within(canvasElement);
223
+ const p =await canvas.findByTestId( 't1');
224
+ await expect(p.textContent ).toEqual("slice: ");
225
+ const cb = await canvas.findByTestId( 'i1');
226
+ await userEvent.click ( cb );
227
+ await expect( await canvas.findByText('slice: V1')).toBeInTheDocument();
228
+ await userEvent.click ( cb );
229
+ await expect( p.textContent).toEqual('slice: ');
230
+
231
+ },
232
+ };
233
+
234
+ export const CheckboxSliceValue:Story =
235
+ { args : {title: 'UncheckedCheckbox slice-value not in slice ', body:`
236
+ <p> Check to see the value propagated into slice. Uncheck to observe the empty string in the slice. </p>
237
+ <custom-element>
238
+ <template>
239
+ <input type="checkbox" slice="s1" slice-value="'V1'" data-testid="i1"/>
240
+ <p data-testid="t1">slice: {//s1}</p>
241
+ </template>
242
+ </custom-element>
243
+ `}
244
+ , play: async ({canvasElement}) =>
245
+ {
246
+ const canvas = within(canvasElement);
247
+ const p =await canvas.findByTestId( 't1');
248
+ await expect(p.textContent ).toEqual("slice: ");
249
+ const cb = await canvas.findByTestId( 'i1');
250
+ await userEvent.click ( cb );
251
+ await expect( await canvas.findByText('slice: V1')).toBeInTheDocument();
252
+ await userEvent.click ( cb );
253
+ await expect( p.textContent).toEqual('slice: ');
254
+
255
+ },
256
+ };
257
+
258
+ export const RadiogroupSliceValue:Story =
259
+ { args : {title: 'Radiogroup value', body:`
260
+ <p> The value propagated into slice from the last checked radiobutton. </p>
261
+ <custom-element>
262
+ <template>
263
+ <p>V1: <input type="radio" slice="s1" value="V1" data-testid="i1" name="group1"/></p>
264
+ <p>V2: <input type="radio" slice="s1" value="V2" data-testid="i2" name="group1"/></p>
265
+ <p data-testid="t1">slice: {//s1}</p>
266
+ </template>
267
+ </custom-element>
268
+ `}
269
+ , play: async ({canvasElement}) =>
270
+ {
271
+ const canvas = within(canvasElement);
272
+ await userEvent.click ( await canvas.findByTestId( 'i1') );
273
+ await expect( await canvas.findByText('slice: V1')).toBeInTheDocument();
274
+ await userEvent.click ( await canvas.findByTestId( 'i2') );
275
+ await expect( await canvas.findByText('slice: V2')).toBeInTheDocument();
276
+ },
277
+ };
278
+
192
279
  //#region unit tests
193
280
  /* istanbul ignore else -- @preserve */
194
281
  if( 'test' === import.meta.env.MODE &&