@epa-wg/custom-element-dist 0.0.26 → 0.0.28
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.
- package/.storybook/main.ts +2 -2
- package/.storybook/preview.ts +1 -1
- package/README.md +4 -4
- package/bin/vitest/vitest-browser-importmaps.mjs +20 -20
- package/coverage/coverage-final.json +22 -22
- package/coverage/index.html +26 -26
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +662 -380
- package/coverage/src/custom-element/demo/index.html +1 -1
- package/coverage/src/custom-element/demo/z.js.html +1 -1
- package/coverage/src/custom-element/http-request.js.html +12 -12
- package/coverage/src/custom-element/index.html +21 -21
- package/coverage/src/custom-element/local-storage.js.html +78 -63
- package/coverage/src/custom-element/location-element.js.html +4 -4
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +16 -10
- package/coverage/src/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/attributes.test.stories.ts.html +17 -11
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts.html +8 -2
- package/coverage/src/stories/dom-merge.test.stories.ts.html +17 -11
- package/coverage/src/stories/external-template.test.stories.ts.html +13 -10
- package/coverage/src/stories/form.test.stories.ts.html +8 -2
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +26 -26
- package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/local-storage.test.stories.ts.html +106 -76
- package/coverage/src/stories/location-element.test.stories.ts.html +8 -2
- package/coverage/src/stories/module-url.test.stories.ts.html +8 -2
- package/coverage/src/stories/set-url.test.stories.ts.html +8 -2
- package/coverage/src/stories/slice-events.test.stories.ts.html +8 -2
- package/coverage/src/stories/slots.test.stories.ts.html +8 -2
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/stories/version-select.test.stories.ts.html +8 -2
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-BOIPgtxz.js +565 -0
- package/dist/custom-element-CUsSENWc.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +25 -21
- package/dist/demo/a.svg +27 -0
- package/dist/demo/demo.css +6 -7
- package/dist/demo/external-template.html +3 -3
- package/dist/demo/npm-versions-demo.html +21 -8
- package/dist/demo/npm-versions.html +54 -25
- package/dist/demo/s.xml +11 -21
- package/dist/demo/s.xslt +16 -74
- package/dist/demo/s1.xslt +59 -59
- package/dist/demo/ss.html +24 -57
- package/dist/demo/z.html +33 -62
- package/dist/demo/z.xml +59 -59
- package/dist/demo/z1.html +34 -0
- package/dist/local-storage-78EivJ_B.cjs +1 -0
- package/dist/local-storage-DzmNKzgN.js +66 -0
- package/dist/mockServiceWorker.js +1 -1
- package/package.json +27 -25
- package/public/demo/a.svg +27 -0
- package/public/demo/demo.css +6 -7
- package/public/demo/external-template.html +3 -3
- package/public/demo/npm-versions-demo.html +21 -8
- package/public/demo/npm-versions.html +54 -25
- package/public/demo/s.xml +11 -21
- package/public/demo/s.xslt +16 -74
- package/public/demo/s1.xslt +59 -59
- package/public/demo/ss.html +24 -57
- package/public/demo/z.html +33 -62
- package/public/demo/z.xml +59 -59
- package/public/demo/z1.html +34 -0
- package/public/mockServiceWorker.js +1 -1
- package/src/custom-element/custom-element.js +123 -29
- package/src/custom-element/demo/a.svg +27 -0
- package/src/custom-element/demo/demo.css +6 -7
- package/src/custom-element/demo/external-template.html +3 -3
- package/src/custom-element/demo/npm-versions-demo.html +21 -8
- package/src/custom-element/demo/npm-versions.html +54 -25
- package/src/custom-element/demo/s.xml +11 -21
- package/src/custom-element/demo/s.xslt +16 -74
- package/src/custom-element/demo/s1.xslt +59 -59
- package/src/custom-element/demo/ss.html +24 -57
- package/src/custom-element/demo/z.html +33 -62
- package/src/custom-element/demo/z.xml +59 -59
- package/src/custom-element/demo/z1.html +34 -0
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +19 -2
- package/src/custom-element/local-storage.js +19 -14
- package/src/custom-element/module-url.js +3 -2
- package/src/dce-social-preview.png +0 -0
- package/src/material/angular.css +987 -0
- package/src/material/components/autocomplete.html +241 -0
- package/src/material/components/dropdown.html +115 -0
- package/src/material/components/menu.html +235 -0
- package/src/material/components.html +109 -0
- package/src/material/demo.css +31 -0
- package/src/material/index.html +169 -0
- package/src/material/material.css +357 -0
- package/src/material/theme/README.md +18 -0
- package/src/material/theme/semantic.css +112 -0
- package/src/mocks/versions.mock.ts +8 -8
- package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +6 -4
- package/src/stories/css.test.stories.ts +2 -0
- package/src/stories/dom-merge.test.stories.ts +11 -9
- package/src/stories/external-template.test.stories.ts +4 -3
- package/src/stories/form.test.stories.ts +2 -0
- package/src/stories/local-storage.test.stories.ts +63 -53
- package/src/stories/location-element.test.stories.ts +2 -0
- package/src/stories/module-url.test.stories.ts +2 -0
- package/src/stories/set-url.test.stories.ts +2 -0
- package/src/stories/slice-events.test.stories.ts +2 -0
- package/src/stories/slots.test.stories.ts +2 -0
- package/src/stories/version-select.test.stories.ts +2 -0
- package/src/sum.test.ts +5 -5
- package/src/sum.ts +3 -3
- package/storybook-static/assets/Color-ERTF36HU-ChyYtq0t.js +1 -0
- package/storybook-static/assets/Configure-CJVwFVjC.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-Bz6q-OqD.js +2 -0
- package/storybook-static/assets/{attributes.test.stories-DIQXccHc.js → attributes.test.stories-BJBuuXgZ.js} +13 -14
- package/storybook-static/assets/{css.test.stories-BV2hi4CY.js → css.test.stories-pgbBc17d.js} +1 -1
- package/storybook-static/assets/custom-element-BDGsYgbP.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-Dws0C2-g.js → dom-merge.test.stories-CXcYP_-J.js} +26 -24
- package/storybook-static/assets/entry-preview-C313OLrj.js +26 -0
- package/storybook-static/assets/{entry-preview-docs-BMKNVQXA.js → entry-preview-docs-B7ORr9w5.js} +2 -2
- package/storybook-static/assets/{external-template.test.stories-BHO48b0j.js → external-template.test.stories-CpJ68Ghy.js} +19 -20
- package/storybook-static/assets/{form.test.stories-dv9mwp24.js → form.test.stories-D35lyqd8.js} +2 -2
- package/storybook-static/assets/{handlers-CaCq2ZPF.js → handlers-B-OZtf2K.js} +13 -13
- package/storybook-static/assets/{http-request.stories-B2ke7LtS.js → http-request.stories-DccXgHyF.js} +6 -6
- package/storybook-static/assets/iframe-Ddc_axoC.js +2 -0
- package/storybook-static/assets/index-BSz1w4Gl.js +234 -0
- package/storybook-static/assets/index-BdcJ-iJ7.js +8 -0
- package/storybook-static/assets/index-CiCdFubk.js +634 -0
- package/storybook-static/assets/{index-Dz4OaB2k.js → index-f2MAjm2i.js} +1 -1
- package/storybook-static/assets/index-lY6s0fkU.js +1 -0
- package/storybook-static/assets/index-tfEkrhWr.js +1 -0
- package/storybook-static/assets/local-storage.test.stories-BY-PWhuk.js +420 -0
- package/storybook-static/assets/{location-element.test.stories-BiFvBop7.js → location-element.test.stories-3auBYEaU.js} +3 -3
- package/storybook-static/assets/{module-url.test.stories-BXoM34tX.js → module-url.test.stories-B7L9cL60.js} +6 -6
- package/storybook-static/assets/{preview-0Jj89qip.js → preview-BRPR-UXC.js} +1 -1
- package/storybook-static/assets/preview-BUQm51_C.js +52 -0
- package/storybook-static/assets/{preview-DB9FwMii.js → preview-BWzBA1C2.js} +1 -1
- package/storybook-static/assets/preview-BhhEZcNS.js +1 -0
- package/storybook-static/assets/preview-CcS4DQh8.js +1 -0
- package/storybook-static/assets/{preview-Cg7hXPRq.js → preview-CfH4_OzN.js} +2 -2
- package/storybook-static/assets/{preview-FpHGYA1q.js → preview-DHPc-V4N.js} +1 -1
- package/storybook-static/assets/preview-DYzi3Z2p.js +1 -0
- package/storybook-static/assets/{preview-4Up_z4Em.js → preview-caVMbCIR.js} +2 -2
- package/storybook-static/assets/preview-ncvtW_hb.js +34 -0
- package/storybook-static/assets/{set-url.test.stories-Cg5Z0r7x.js → set-url.test.stories-CuSuDLIx.js} +3 -3
- package/storybook-static/assets/{slice-events.test.stories-D_ttGp3g.js → slice-events.test.stories-BkRKsKem.js} +4 -4
- package/storybook-static/assets/{slots.test.stories-DBNXOm0T.js → slots.test.stories-BJCUWFkE.js} +8 -8
- package/storybook-static/assets/{version-select.test.stories-CgV3UCim.js → version-select.test.stories-B3ybJn_Z.js} +2 -2
- package/storybook-static/demo/a.svg +27 -0
- package/storybook-static/demo/demo.css +6 -7
- package/storybook-static/demo/external-template.html +3 -3
- package/storybook-static/demo/npm-versions-demo.html +21 -8
- package/storybook-static/demo/npm-versions.html +54 -25
- package/storybook-static/demo/s.xml +11 -21
- package/storybook-static/demo/s.xslt +16 -74
- package/storybook-static/demo/s1.xslt +59 -59
- package/storybook-static/demo/ss.html +24 -57
- package/storybook-static/demo/z.html +33 -62
- package/storybook-static/demo/z.xml +59 -59
- package/storybook-static/demo/z1.html +34 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +3 -7
- package/storybook-static/mockServiceWorker.js +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +9 -9
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +76 -94
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +211 -0
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +11 -0
- package/storybook-static/sb-manager/globals-runtime.js +27803 -26928
- package/storybook-static/sb-manager/runtime.js +10341 -10136
- package/storybook-static/sb-preview/runtime.js +3841 -3828
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/compiler.xml +0 -6
- package/.idea/custom-element-dist.iml +0 -13
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.vscode/settings.json +0 -24
- package/dist/custom-element-CckoVsvO.cjs +0 -53
- package/dist/custom-element-b7c_7Kz4.js +0 -485
- package/dist/local-storage-Boafngui.cjs +0 -1
- package/dist/local-storage-BqDEu2kF.js +0 -59
- package/storybook-static/assets/Color-KGDBMAHA-CH-YyWYq.js +0 -1
- package/storybook-static/assets/Configure-DFL_bm2M.js +0 -173
- package/storybook-static/assets/DocsRenderer-PKQXORMH-Bz-_1hmS.js +0 -2
- package/storybook-static/assets/custom-element-wn23PUwN.js +0 -231
- package/storybook-static/assets/entry-preview-BKQ8UCxI.js +0 -8
- package/storybook-static/assets/iframe-D4Sos1HO.js +0 -2
- package/storybook-static/assets/index-BnXBQqj9.js +0 -605
- package/storybook-static/assets/index-C8k3Z-3Y.js +0 -28
- package/storybook-static/assets/index-Cpxqn5iQ.js +0 -1
- package/storybook-static/assets/index-DGdNYaqV.js +0 -8
- package/storybook-static/assets/index-sm7QlJZE.js +0 -1
- package/storybook-static/assets/lit-element-DzhCn-8W.js +0 -19
- package/storybook-static/assets/local-storage.test.stories-BpogLNq-.js +0 -419
- package/storybook-static/assets/preview-BJPLiuSt.js +0 -1
- package/storybook-static/assets/preview-BMWqy4Bi.js +0 -1
- package/storybook-static/assets/preview-BnWGZYux.js +0 -1
- package/storybook-static/assets/preview-Djh1_Tal.js +0 -20
- package/storybook-static/assets/preview-oHxXRSIu.js +0 -48
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +0 -333
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/interactions-10/manager-bundle.js +0 -234
- /package/{storybook-static/sb-addons/interactions-10/manager-bundle.js.LEGAL.txt → src/material/guide/getting-started/index.html} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
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 */
|
|
@@ -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.
|
|
6
|
+
"latest": "0.0.28"
|
|
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.
|
|
620
|
+
"0.0.28": {
|
|
621
621
|
"name": "@epa-wg/custom-element-dist",
|
|
622
|
-
"version": "0.0.
|
|
622
|
+
"version": "0.0.28",
|
|
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.
|
|
639
|
+
"@epa-wg/custom-element": "0.0.28"
|
|
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.
|
|
710
|
+
"_id": "@epa-wg/custom-element-dist@0.0.28",
|
|
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.
|
|
718
|
+
"tarball": "https://registry.npmjs.org/@epa-wg/custom-element-dist/-/custom-element-dist-0.0.28.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.
|
|
754
|
+
"0.0.28": "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.
|
|
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.28/coverage/src/custom-element/coverage.svg\n[coverage-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.28/coverage/src/custom-element/index.html\n[sb-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.28/storybook-static/index.html\n[bundle-url]: https://unpkg.com/@epa-wg/custom-element-dist@0.0.28/dist/custom-element-bundle.js\n",
|
|
785
785
|
"readmeFilename": "README.md"
|
|
786
786
|
}
|
|
Binary file
|
|
@@ -50,10 +50,9 @@ export const AttributeDefaults:Story =
|
|
|
50
50
|
const canvas = within(canvasElement)
|
|
51
51
|
, code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
|
|
52
52
|
|
|
53
|
-
await
|
|
54
|
-
expect( await
|
|
55
|
-
expect( await
|
|
56
|
-
expect( await code('p3') ).toEqual('def_P3' );
|
|
53
|
+
expect( await await canvas.findByTestId('p1') ).toHaveTextContent('default_P1' );
|
|
54
|
+
expect( await await canvas.findByTestId('p2') ).toHaveTextContent('always_p2' );
|
|
55
|
+
expect( await await canvas.findByTestId('p3') ).toHaveTextContent('def_P3' );
|
|
57
56
|
},
|
|
58
57
|
};
|
|
59
58
|
|
|
@@ -130,6 +129,8 @@ export const InstanceAttributes:Story =
|
|
|
130
129
|
},
|
|
131
130
|
};
|
|
132
131
|
|
|
132
|
+
|
|
133
|
+
//#region unit tests
|
|
133
134
|
/* istanbul ignore else -- @preserve */
|
|
134
135
|
if( 'test' === import.meta.env.MODE &&
|
|
135
136
|
!import.meta.url.includes('skiptest') )
|
|
@@ -139,3 +140,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
139
140
|
const { describe } = await import('vitest')
|
|
140
141
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
141
142
|
}
|
|
143
|
+
//#endregion
|
|
@@ -112,6 +112,7 @@ export const OverrideInPayload: Story =
|
|
|
112
112
|
},
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
//#region unit tests
|
|
115
116
|
/* istanbul ignore else -- @preserve */
|
|
116
117
|
if( 'test' === import.meta.env.MODE &&
|
|
117
118
|
!import.meta.url.includes('skiptest') )
|
|
@@ -121,3 +122,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
121
122
|
const { describe } = await import('vitest')
|
|
122
123
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
123
124
|
}
|
|
125
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// noinspection DuplicatedCode
|
|
2
2
|
|
|
3
3
|
import type { StoryObj } from '@storybook/web-components';
|
|
4
|
-
import {expect,
|
|
4
|
+
import {expect, within, userEvent, fireEvent} from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
import '../custom-element/custom-element.js';
|
|
7
7
|
import {
|
|
@@ -123,16 +123,16 @@ export const OrderPreservingOn2ndTransform:Story =
|
|
|
123
123
|
<p>IF condition content should be displayed in place where it is defined (not shifted down on the parent children)</p>
|
|
124
124
|
<custom-element>
|
|
125
125
|
<form slice="f1">
|
|
126
|
-
<label>
|
|
127
|
-
<input type="checkbox" name="c1"
|
|
126
|
+
<label data-testid="cb1">
|
|
127
|
+
<input type="checkbox" name="c1" />
|
|
128
128
|
click to display #1 bellow
|
|
129
129
|
</label>
|
|
130
130
|
<br data-testid="beforeC1"/>
|
|
131
131
|
<if test="//c1">
|
|
132
132
|
<p data-testid="isC1">#1</p>
|
|
133
133
|
</if>
|
|
134
|
-
<label>
|
|
135
|
-
<input type="checkbox" name="c2"
|
|
134
|
+
<label data-testid="cb2">
|
|
135
|
+
<input type="checkbox" name="c2" />
|
|
136
136
|
click to display #2 bellow
|
|
137
137
|
</label>
|
|
138
138
|
<br data-testid="beforeC2"/>
|
|
@@ -148,9 +148,11 @@ export const OrderPreservingOn2ndTransform:Story =
|
|
|
148
148
|
const canvas = within(canvasElement);
|
|
149
149
|
await canvas.findByText(titleText);
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
// userEvent breaks under FF in vitest, fireEvent works
|
|
152
|
+
await fireEvent.click(await canvas.findByTestId('cb1'));
|
|
152
153
|
await expect(await canvas.findByText('#1')).toBeInTheDocument();
|
|
153
|
-
|
|
154
|
+
|
|
155
|
+
await fireEvent.click(canvas.getByTestId('cb2'));
|
|
154
156
|
await expect(await canvas.findByText('#2')).toBeInTheDocument();
|
|
155
157
|
await expect(canvas.getByTestId("beforeC1").nextElementSibling).toEqual(canvas.getByTestId("isC1"))
|
|
156
158
|
},
|
|
@@ -192,7 +194,7 @@ export const ReadSystemValidityMessage:Story =
|
|
|
192
194
|
},
|
|
193
195
|
};
|
|
194
196
|
|
|
195
|
-
|
|
197
|
+
//#region unit tests
|
|
196
198
|
/* istanbul ignore else -- @preserve */
|
|
197
199
|
if( 'test' === import.meta.env.MODE &&
|
|
198
200
|
!import.meta.url.includes('skiptest') )
|
|
@@ -202,4 +204,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
202
204
|
const { describe } = await import('vitest')
|
|
203
205
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
204
206
|
}
|
|
205
|
-
|
|
207
|
+
//#endregion
|
|
@@ -115,9 +115,8 @@ export const ExternalXsltFile:Story =
|
|
|
115
115
|
await canvas.findByText(ExternalXsltFile.args!.title as string);
|
|
116
116
|
expect(canvasElement.querySelector('dce-external-4').innerHTML).to.include('Hi');
|
|
117
117
|
expect(canvasElement.querySelector('[data-smile="👼"]').innerHTML).to.include('loading from XSLT ...');
|
|
118
|
-
await
|
|
119
|
-
expect(canvas.
|
|
120
|
-
expect(canvas.getByTestId('data-smile').innerHTML).to.include('👼');
|
|
118
|
+
await expect(await canvas.findByTestId('data-fruit')).toHaveTextContent('🍌');
|
|
119
|
+
await expect(await canvas.findByTestId('data-smile')).toHaveTextContent('👼');
|
|
121
120
|
},
|
|
122
121
|
};
|
|
123
122
|
|
|
@@ -248,6 +247,7 @@ export const EmbeddingInAnotherFile:Story =
|
|
|
248
247
|
},
|
|
249
248
|
};
|
|
250
249
|
|
|
250
|
+
//#region unit tests
|
|
251
251
|
/* istanbul ignore else -- @preserve */
|
|
252
252
|
if( 'test' === import.meta.env.MODE &&
|
|
253
253
|
!import.meta.url.includes('skiptest') )
|
|
@@ -257,3 +257,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
257
257
|
const { describe } = await import('vitest')
|
|
258
258
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
259
259
|
}
|
|
260
|
+
//#endregion
|
|
@@ -179,6 +179,7 @@ export const FormCustomValidityString:Story =
|
|
|
179
179
|
};
|
|
180
180
|
// custom validity rules on form : boolean and string values
|
|
181
181
|
|
|
182
|
+
//#region unit tests
|
|
182
183
|
/* istanbul ignore else -- @preserve */
|
|
183
184
|
if( 'test' === import.meta.env.MODE &&
|
|
184
185
|
!import.meta.url.includes('skiptest') )
|
|
@@ -188,3 +189,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
188
189
|
const { describe } = await import('vitest')
|
|
189
190
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
190
191
|
}
|
|
192
|
+
//#endregion
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// noinspection DuplicatedCode
|
|
2
2
|
|
|
3
3
|
import type { StoryObj } from '@storybook/web-components';
|
|
4
|
-
import {expect,
|
|
4
|
+
import {expect, userEvent, within} from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
import '../custom-element/custom-element.js';
|
|
7
7
|
import '../custom-element/local-storage.js';
|
|
8
|
+
import {localStorage_clear, localStorage_removeItem, localStorageSetItem} from "../custom-element";
|
|
8
9
|
|
|
9
10
|
type TProps = { title: string; slice: string; key: string; value:string; live:string; body:string};
|
|
10
11
|
const defs: TProps =
|
|
@@ -50,41 +51,47 @@ const meta =
|
|
|
50
51
|
|
|
51
52
|
export default meta;
|
|
52
53
|
|
|
54
|
+
window['localStorageSetItem'] = localStorageSetItem;
|
|
55
|
+
window['localStorage_clear'] = localStorage_clear;
|
|
56
|
+
window['localStorage_removeItem'] = localStorage_removeItem;
|
|
57
|
+
|
|
53
58
|
export const Demo:Story =
|
|
54
59
|
{ args : {title: 'live value', live:'live', body:`
|
|
55
60
|
<input placeholder="value for localStorage" id="textinput"
|
|
56
61
|
slice="${defs.slice}"
|
|
57
62
|
value="{ //${defs.slice} ?? '${ defs.value }' }"/>
|
|
58
|
-
<button onclick="
|
|
59
|
-
<button onclick="
|
|
60
|
-
<button onclick="
|
|
61
|
-
<button onclick="
|
|
63
|
+
<button onclick="localStorageSetItem('${defs.key}',textinput.value )">set</button>
|
|
64
|
+
<button onclick="localStorageSetItem('${defs.key}','text value' )">text value</button>
|
|
65
|
+
<button onclick="localStorageSetItem('${defs.key}','another text')">another text</button>
|
|
66
|
+
<button onclick="localStorage_removeItem('${defs.key}' )">set blank</button>
|
|
62
67
|
`}
|
|
63
68
|
, play: async ({canvasElement}) =>
|
|
64
69
|
{
|
|
70
|
+
localStorage_clear();
|
|
65
71
|
const canvas = within(canvasElement);
|
|
66
72
|
await canvas.findByText(Demo.args!.title as string);
|
|
67
73
|
const val = ()=> canvas.getByTestId('slice-value').textContent
|
|
68
|
-
|
|
74
|
+
await userEvent.click(await canvas.findByText('set blank'));
|
|
75
|
+
await expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');
|
|
76
|
+
await expect( val() ).toEqual('');
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');
|
|
72
|
-
expect( val() ).toEqual('');
|
|
73
|
-
byText('text value').click();
|
|
78
|
+
await userEvent.click(canvas.getByText('text value'));
|
|
74
79
|
await sleep(10);
|
|
75
|
-
expect(
|
|
80
|
+
await expect(localStorage.getItem(defs.key)).toEqual('text value', 'from localStorage');
|
|
81
|
+
await expect( val() ).toEqual('text value');
|
|
76
82
|
|
|
77
83
|
window['textinput'].value = 'textinput.value';
|
|
78
|
-
|
|
84
|
+
|
|
85
|
+
await userEvent.click(canvas.getByText('set'));
|
|
79
86
|
await sleep(10);
|
|
80
87
|
expect( val() ).toEqual('textinput.value');
|
|
81
88
|
|
|
82
|
-
|
|
89
|
+
await userEvent.click(canvas.getByText('another text'));
|
|
83
90
|
await sleep(10);
|
|
84
91
|
expect( val() ).toEqual('another text');
|
|
85
92
|
|
|
93
|
+
await userEvent.click(canvas.getByText('set blank'));
|
|
86
94
|
|
|
87
|
-
byText('set blank').click();
|
|
88
95
|
await sleep(10);
|
|
89
96
|
expect( val() ).toEqual('');
|
|
90
97
|
},
|
|
@@ -94,31 +101,32 @@ export const Demo:Story =
|
|
|
94
101
|
export const AlwaysOverride:Story =
|
|
95
102
|
{ args : {title: 'AlwaysOverride', live:'', value:'ABC', body:`
|
|
96
103
|
buttons are changing the localStorage value, but without 'live' attribute slice ^^ from <i>local-storage</i> is not updated<br/>
|
|
97
|
-
<button onclick="
|
|
98
|
-
<button onclick="
|
|
104
|
+
<button onclick="localStorageSetItem('${defs.key}','text value')">text value</button>
|
|
105
|
+
<button onclick="localStorage_removeItem('${defs.key}')">set blank</button>
|
|
99
106
|
`}
|
|
100
107
|
, play: async ({canvasElement}) =>
|
|
101
108
|
{
|
|
102
109
|
const canvas = within(canvasElement);
|
|
103
110
|
await canvas.findByText(AlwaysOverride.args!.title as string);
|
|
104
|
-
const val = ()=> canvas.getByTestId('slice-value').textContent
|
|
105
|
-
|
|
111
|
+
const val = ()=> canvas.getByTestId('slice-value').textContent;
|
|
112
|
+
const click = async (text)=> await userEvent.click( await canvas.findByText(text) );
|
|
113
|
+
await sleep(10);
|
|
106
114
|
|
|
107
|
-
expect(localStorage.getItem(defs.key)).toEqual('ABC'
|
|
115
|
+
await expect( localStorage.getItem(defs.key)).toEqual('ABC');
|
|
108
116
|
|
|
109
|
-
|
|
110
|
-
expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');
|
|
117
|
+
await click('set blank')
|
|
118
|
+
await expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');
|
|
111
119
|
await sleep(10);
|
|
112
|
-
expect( val() ).toEqual('ABC');
|
|
120
|
+
await expect( val() ).toEqual('ABC');
|
|
113
121
|
|
|
114
|
-
|
|
122
|
+
await click('text value');
|
|
115
123
|
await sleep(10);
|
|
116
|
-
expect(localStorage.getItem(defs.key)).toEqual('text value', 'from localStorage');
|
|
117
|
-
expect( val() ).toEqual('ABC');
|
|
124
|
+
await expect(localStorage.getItem(defs.key)).toEqual('text value', 'from localStorage');
|
|
125
|
+
await expect( val() ).toEqual('ABC');
|
|
118
126
|
|
|
119
|
-
|
|
127
|
+
await click('set blank');
|
|
120
128
|
await sleep(10);
|
|
121
|
-
expect( val() ).toEqual('ABC');
|
|
129
|
+
await expect( val() ).toEqual('ABC');
|
|
122
130
|
},
|
|
123
131
|
};
|
|
124
132
|
|
|
@@ -126,15 +134,15 @@ export const FromStorageWithDefault:Story =
|
|
|
126
134
|
{ args : {title: 'live value with defaults', live:'', value:'ABC', body:`
|
|
127
135
|
|
|
128
136
|
<local-storage key="attr2Key" slice="attr2-key" type="text" live="live" slice-value="@value ?? 'DEF2'"></local-storage>
|
|
129
|
-
<button onclick="
|
|
130
|
-
<button onclick="
|
|
137
|
+
<button onclick="localStorage_removeItem('attr2Key')">clear key</button>
|
|
138
|
+
<button onclick="localStorageSetItem('attr2Key','attr2Key value')">update attr2-key value</button>
|
|
131
139
|
//attr2-key: <code data-testid="key2-value">{//attr2-key}</code><br/>
|
|
132
140
|
|
|
133
141
|
<local-storage key="attr3Key" slice="attr3-key" type="text" live="live" slice-value="@value ?? 'DEF3'"></local-storage>
|
|
134
|
-
<button onclick="
|
|
135
|
-
<button onclick="
|
|
142
|
+
<button onclick="localStorage_removeItem('attr3Key')">clear attr3-key key</button>
|
|
143
|
+
<button onclick="localStorageSetItem('attr3Key','attr3Key value')">update attr3-key value</button>
|
|
136
144
|
//attr3-key: <code data-testid="key3-value">{//attr3-key}</code><br/>
|
|
137
|
-
<button onclick="
|
|
145
|
+
<button onclick="localStorage_clear()">clear localStorage</button>
|
|
138
146
|
`}
|
|
139
147
|
, play: async ({canvasElement}) =>
|
|
140
148
|
{
|
|
@@ -177,39 +185,39 @@ export const TypeAttribute:Story =
|
|
|
177
185
|
<local-storage key="jsonKey" slice="json-key" type="json" live="live"></local-storage>
|
|
178
186
|
<input id="typesinput" placeholder="set value"><button onclick="
|
|
179
187
|
'textKey,dateKey,timeKey,localDateTimeKey,numberKey,jsonKey'.split(',')
|
|
180
|
-
.map( k=>
|
|
188
|
+
.map( k=> localStorageSetItem(k, typesinput.value) )
|
|
181
189
|
"> set to all</button><br>
|
|
182
190
|
<hr>
|
|
183
191
|
text-key:
|
|
184
|
-
<button onclick="
|
|
192
|
+
<button onclick="localStorageSetItem('textKey', 'ABC' )">ABC</button>
|
|
185
193
|
<code data-testid="text-key">{//text-key }</code><br>
|
|
186
194
|
date-key:
|
|
187
|
-
<button onclick="
|
|
188
|
-
<button onclick="
|
|
189
|
-
<button onclick="
|
|
195
|
+
<button onclick="localStorageSetItem('dateKey', '2024-04-20T03:58:42.131Z')">2024-04-21T03:58:42.131Z </button>
|
|
196
|
+
<button onclick="localStorageSetItem('dateKey', new Date(Date.now()).toISOString())">now </button>
|
|
197
|
+
<button onclick="localStorageSetItem('dateKey', 'ABC' )">date ABC - invalid </button>
|
|
190
198
|
<code data-testid="date-key">{//date-key }</code><br>
|
|
191
199
|
time-key:
|
|
192
|
-
<button onclick="
|
|
200
|
+
<button onclick="localStorageSetItem('timeKey', '13:30')">13:30 </button>
|
|
193
201
|
<code data-testid="time-key">{//time-key }</code><br>
|
|
194
202
|
local-date-time:
|
|
195
|
-
<button onclick="
|
|
203
|
+
<button onclick="localStorageSetItem('localDateTimeKey', '1977-04-01T14:00:30')">1977-04-01T14:00:30 - local </button>
|
|
196
204
|
<code data-testid="local-date-time">{//local-date-time}</code><br>
|
|
197
205
|
number-key:
|
|
198
|
-
<button onclick="
|
|
199
|
-
<button onclick="
|
|
200
|
-
<button onclick="
|
|
201
|
-
<button onclick="
|
|
202
|
-
<button onclick="
|
|
203
|
-
<button onclick="
|
|
204
|
-
<button onclick="
|
|
206
|
+
<button onclick="localStorageSetItem('numberKey', '2024' )">2024 - number </button>
|
|
207
|
+
<button onclick="localStorageSetItem('numberKey', '24' )">24 - number </button>
|
|
208
|
+
<button onclick="localStorageSetItem('numberKey', '1.23456e+5' )">1.23456e+5 </button>
|
|
209
|
+
<button onclick="localStorageSetItem('numberKey', '0001' )">0001 </button>
|
|
210
|
+
<button onclick="localStorageSetItem('numberKey', '000' )">000 </button>
|
|
211
|
+
<button onclick="localStorageSetItem('numberKey', '0' )">0 </button>
|
|
212
|
+
<button onclick="localStorageSetItem('numberKey', 'ABC' )">ABC - invalid, NaN </button>
|
|
205
213
|
<code data-testid="number-key">{//number-key }</code> <br>
|
|
206
214
|
<fieldset>
|
|
207
215
|
<legend>json-key: </legend>
|
|
208
216
|
|
|
209
|
-
<button onclick="
|
|
210
|
-
<button onclick="
|
|
211
|
-
<button onclick="
|
|
212
|
-
<button onclick="
|
|
217
|
+
<button onclick="localStorageSetItem('jsonKey', JSON.stringify('ABC'))">'ABC' - string </button>
|
|
218
|
+
<button onclick="localStorageSetItem('jsonKey', JSON.stringify(12.345))">12.345 - number </button>
|
|
219
|
+
<button onclick="localStorageSetItem('jsonKey', JSON.stringify(window.JsonSample) )">a:1,b:'B' -json </button>
|
|
220
|
+
<button onclick="localStorageSetItem('jsonKey', 'ABC' )">ABC - invalid </button><br>
|
|
213
221
|
json-key:<code data-testid="json-key"><xsl:apply-templates select="//json-key/value/@*|//json-key/text()|//json-key/value/text()" mode="json"></xsl:apply-templates></code>
|
|
214
222
|
</fieldset>
|
|
215
223
|
<xsl:template mode="json" match="*|@*">
|
|
@@ -224,8 +232,8 @@ export const TypeAttribute:Story =
|
|
|
224
232
|
await canvas.findByText(TypeAttribute.args!.title as string);
|
|
225
233
|
const byText = txt => canvas.getByText(txt)
|
|
226
234
|
, val = testId => canvas.getByTestId(testId).textContent
|
|
227
|
-
, expectVal = (key,value) => { expect(val( key )).toEqual( value, key ) };
|
|
228
|
-
|
|
235
|
+
, expectVal = (key,value) => { expect(val( key ).trim()).toEqual( value, key ) };
|
|
236
|
+
localStorage_clear(); // cleanup before test
|
|
229
237
|
await sleep(10);
|
|
230
238
|
|
|
231
239
|
expectVal('text-key' ,'');
|
|
@@ -385,10 +393,11 @@ export const TypeAttribute:Story =
|
|
|
385
393
|
expectVal('time-key' ,'' );
|
|
386
394
|
expectVal('local-date-time','' );
|
|
387
395
|
expectVal('number-key' ,'NaN' );
|
|
388
|
-
expectVal('json-key' ,'
|
|
396
|
+
expectVal('json-key' ,'a : 1b : B' );
|
|
389
397
|
},
|
|
390
398
|
};
|
|
391
399
|
|
|
400
|
+
//#region unit tests
|
|
392
401
|
/* istanbul ignore else -- @preserve */
|
|
393
402
|
if( 'test' === import.meta.env.MODE &&
|
|
394
403
|
!import.meta.url.includes('skiptest') )
|
|
@@ -398,3 +407,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
398
407
|
const { describe } = await import('vitest')
|
|
399
408
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
400
409
|
}
|
|
410
|
+
//#endregion
|
|
@@ -134,6 +134,7 @@ export const SrcAttribute:Story =
|
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
|
|
137
|
+
//#region unit tests
|
|
137
138
|
/* istanbul ignore else -- @preserve */
|
|
138
139
|
if( 'test' === import.meta.env.MODE &&
|
|
139
140
|
!import.meta.url.includes('skiptest') )
|
|
@@ -143,3 +144,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
143
144
|
const { describe } = await import('vitest')
|
|
144
145
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
145
146
|
}
|
|
147
|
+
//#endregion
|
|
@@ -172,6 +172,7 @@ export const HashWithinLib:Story =
|
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
|
|
175
|
+
//#region unit tests
|
|
175
176
|
/* istanbul ignore else -- @preserve */
|
|
176
177
|
if( 'test' === import.meta.env.MODE &&
|
|
177
178
|
!import.meta.url.includes('skiptest') )
|
|
@@ -181,3 +182,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
181
182
|
const { describe } = await import('vitest')
|
|
182
183
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
183
184
|
}
|
|
185
|
+
//#endregion
|
|
@@ -104,6 +104,7 @@ export const DynamicMethod: Story =
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
|
|
107
|
+
//#region unit tests
|
|
107
108
|
/* istanbul ignore else -- @preserve */
|
|
108
109
|
if ('test' === import.meta.env.MODE &&
|
|
109
110
|
!import.meta.url.includes('skiptest')) {
|
|
@@ -112,3 +113,4 @@ if ('test' === import.meta.env.MODE &&
|
|
|
112
113
|
const {describe} = await import('vitest')
|
|
113
114
|
describe(meta.title, () => testStoryBook(mod, meta));
|
|
114
115
|
}
|
|
116
|
+
//#endregion
|
|
@@ -189,6 +189,7 @@ export const SlicesInAttrAndName:Story =
|
|
|
189
189
|
},
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
+
//#region unit tests
|
|
192
193
|
/* istanbul ignore else -- @preserve */
|
|
193
194
|
if( 'test' === import.meta.env.MODE &&
|
|
194
195
|
!import.meta.url.includes('skiptest') )
|
|
@@ -198,3 +199,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
198
199
|
const { describe } = await import('vitest')
|
|
199
200
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
200
201
|
}
|
|
202
|
+
//#endregion
|
|
@@ -206,6 +206,7 @@ export const TemplateWithAttributesAndCondition:Story =
|
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
+
//#region unit tests
|
|
209
210
|
/* istanbul ignore else -- @preserve */
|
|
210
211
|
if( 'test' === import.meta.env.MODE &&
|
|
211
212
|
!import.meta.url.includes('skiptest') )
|
|
@@ -215,3 +216,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
215
216
|
const { describe } = await import('vitest')
|
|
216
217
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
217
218
|
}
|
|
219
|
+
//#endregion
|
|
@@ -91,6 +91,7 @@ export const VersionsSelect:Story =
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
//#region unit tests
|
|
94
95
|
/* istanbul ignore else -- @preserve */
|
|
95
96
|
if( 'test' === import.meta.env.MODE &&
|
|
96
97
|
!import.meta.url.includes('skiptest') )
|
|
@@ -100,3 +101,4 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
100
101
|
const { describe } = await import('vitest')
|
|
101
102
|
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
102
103
|
}
|
|
104
|
+
//#endregion
|