@epa-wg/custom-element-dist 0.0.32 → 0.0.33
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 +3 -7
- package/.storybook/preview.ts +4 -6
- package/README.md +4 -4
- package/coverage/coverage-final.json +7 -18
- package/coverage/index.html +30 -30
- 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 +579 -429
- package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
- package/coverage/src/custom-element/http-request.js.html +13 -13
- package/coverage/src/custom-element/index.html +29 -29
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +31 -31
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +20 -20
- 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/coverage.svg +1 -1
- package/coverage/src/stories/{local-storage.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +175 -0
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +14 -179
- package/coverage/src/stories/testStoryBook.ts.html +8 -8
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-6slVaFEs.cjs +97 -0
- package/dist/custom-element-WnOqmEOe.js +609 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +2 -2
- package/dist/demo/attributes.html +153 -0
- package/dist/demo/external-templates-sb-6.html +42 -0
- package/dist/demo/external-templates-sb-7.html +42 -0
- package/dist/demo/html-template.html +1 -1
- package/dist/demo/module-url-sb-2.html +46 -0
- package/dist/demo/module-url-sb-4.html +48 -0
- package/dist/demo/module-url-sb-5.html +53 -0
- package/dist/demo/s.xml +71 -8
- package/dist/demo/s.xslt +55 -31
- package/dist/demo/ss.html +13 -4
- package/dist/mockServiceWorker.js +31 -8
- package/package.json +25 -26
- package/public/demo/attributes.html +153 -0
- package/public/demo/external-templates-sb-6.html +42 -0
- package/public/demo/external-templates-sb-7.html +42 -0
- package/public/demo/html-template.html +1 -1
- package/public/demo/module-url-sb-2.html +46 -0
- package/public/demo/module-url-sb-4.html +48 -0
- package/public/demo/module-url-sb-5.html +53 -0
- package/public/demo/s.xml +71 -8
- package/public/demo/s.xslt +55 -31
- package/public/demo/ss.html +13 -4
- package/public/mockServiceWorker.js +31 -8
- package/src/custom-element/custom-element.d.ts +4 -0
- package/src/custom-element/custom-element.js +91 -41
- package/src/custom-element/demo/attributes.html +153 -0
- package/src/custom-element/demo/html-template.html +1 -1
- package/src/custom-element/demo/s.xml +71 -8
- package/src/custom-element/demo/s.xslt +55 -31
- package/src/custom-element/demo/ss.html +13 -4
- 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 +1 -1
- package/src/material/components/badge.html +240 -0
- package/src/material/components/dropdown.html +7 -12
- package/src/material/components/icon-link.html +1 -0
- package/src/material/components/icon.html +253 -0
- package/src/material/components/input.html +290 -82
- package/src/material/components/menu.html +7 -5
- package/src/material/components.html +48 -11
- package/src/material/theme/semantic.css +20 -1
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
- package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
- package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +83 -17
- package/src/stories/external-template.test.stories.ts +16 -14
- package/src/stories/frame.canvas.ts +31 -0
- package/src/stories/module-url.test.stories.ts +29 -61
- package/storybook-static/assets/Color-F6OSRLHC-Cbp293x2.js +1 -0
- package/storybook-static/assets/Configure-BrFr4SLE.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-DhHzJiIO.js +2 -0
- package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +1 -0
- package/storybook-static/assets/{attributes.test.stories-D1X6EBrd.js → attributes.test.stories-Gg9LQTEK.js} +109 -38
- package/storybook-static/assets/{css.test.stories-Cp_g2hE1.js → css.test.stories-B_3ltOrx.js} +1 -1
- package/storybook-static/assets/custom-element-CPnvJnn8.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-hbpdCka0.js → dom-merge.test.stories-nQxcgLoM.js} +1 -1
- package/storybook-static/assets/entry-preview-docs-Dwczwtsc.js +2 -0
- package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +1 -0
- package/storybook-static/assets/{external-template.test.stories-BK89h6sk.js → external-template.test.stories-DZ-rjnfd.js} +38 -40
- package/storybook-static/assets/{form.test.stories-BfoLe_rw.js → form.test.stories-DQhPYtMj.js} +1 -1
- package/storybook-static/assets/frame.canvas-ClTqYyMN.js +1 -0
- package/storybook-static/assets/{handlers-yVPwH_Nz.js → handlers-CLkps6Nz.js} +17 -14
- package/storybook-static/assets/{http-request.stories-CBFJS2Ws.js → http-request.stories-jo0f73nw.js} +1 -1
- package/storybook-static/assets/iframe-CZwRpnn9.js +199 -0
- package/storybook-static/assets/index-B68YUdzy.js +621 -0
- package/storybook-static/assets/index-BwkS7JH_.js +8 -0
- package/storybook-static/assets/index-CJQtnF9V.js +1 -0
- package/storybook-static/assets/index-Dr4PwNfd.js +240 -0
- package/storybook-static/assets/{local-storage.test.stories-C0Yzy6Am.js → local-storage.test.stories-uA5EKRPf.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-DNFrEu5A.js → location-element.test.stories-Cu-6Elcg.js} +1 -1
- package/storybook-static/assets/module-url.test.stories-CD_wusXQ.js +142 -0
- package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +1 -0
- package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
- package/storybook-static/assets/preview-BFlNN3Wj.js +1 -0
- package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
- package/storybook-static/assets/preview-Cm4PPhHS.js +50 -0
- package/storybook-static/assets/preview-CuCH40jj.js +2 -0
- package/storybook-static/assets/preview-DfTudP20.js +1 -0
- package/storybook-static/assets/{set-url.test.stories-BBfLxv2u.js → set-url.test.stories-CY7B9BVZ.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-HcXF8XQI.js → slice-events.test.stories-BVnPXm6e.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-i6mnIFM2.js → slots.test.stories-Dxsa9KdA.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-BsUFH6Va.js → version-select.test.stories-Buga1PAa.js} +1 -1
- package/storybook-static/demo/attributes.html +153 -0
- package/storybook-static/demo/external-templates-sb-6.html +42 -0
- package/storybook-static/demo/external-templates-sb-7.html +42 -0
- package/storybook-static/demo/html-template.html +1 -1
- package/storybook-static/demo/module-url-sb-2.html +46 -0
- package/storybook-static/demo/module-url-sb-4.html +48 -0
- package/storybook-static/demo/module-url-sb-5.html +53 -0
- package/storybook-static/demo/s.xml +71 -8
- package/storybook-static/demo/s.xslt +55 -31
- package/storybook-static/demo/ss.html +13 -4
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +6 -10
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +31 -8
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +230 -0
- 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 +58 -58
- package/storybook-static/sb-manager/globals-module-info.js +9 -0
- package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
- package/storybook-static/sb-manager/runtime.js +4944 -6321
- package/coverage/src/stories/attributes.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/attributes.test.stories.ts.html +0 -814
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/css.test.stories.ts.html +0 -460
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
- package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/form.test.stories.ts.html +0 -661
- package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
- package/coverage/src/stories/location-element.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
- package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
- package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slots.test.stories.ts.html +0 -742
- package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
- package/dist/custom-element-D2wf_rqP.js +0 -576
- package/dist/custom-element-Dtzhbjkc.cjs +0 -97
- package/storybook-static/assets/Color-F6OSRLHC-BU3iy8jH.js +0 -1
- package/storybook-static/assets/Configure-DN6ifayP.js +0 -165
- package/storybook-static/assets/DocsRenderer-CFRXHY34-BaVEufDj.js +0 -2
- package/storybook-static/assets/custom-element-uuAtIYWS.js +0 -97
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
- package/storybook-static/assets/iframe-CJEL_4Nu.js +0 -2
- package/storybook-static/assets/index-BcZLpTeD.js +0 -8
- package/storybook-static/assets/index-CxRwF5Or.js +0 -234
- package/storybook-static/assets/index-D-8MO0q_.js +0 -1
- package/storybook-static/assets/index-D5fBh-7N.js +0 -1
- package/storybook-static/assets/index-DM-KBPdl.js +0 -1
- package/storybook-static/assets/index-RSFf30w1.js +0 -1
- package/storybook-static/assets/index-SnjB5uV8.js +0 -769
- package/storybook-static/assets/module-url.test.stories-CXibF5Ta.js +0 -208
- package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
- package/storybook-static/assets/preview-Bnd0XhaF.js +0 -52
- package/storybook-static/assets/preview-CNKoaWES.js +0 -1
- package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
- package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
- package/storybook-static/assets/preview-DJMlNTk8.js +0 -2
- package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -7174
- package/test-runner-jest.config.js +0 -15
- /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
|
@@ -34,8 +34,12 @@
|
|
|
34
34
|
</head>
|
|
35
35
|
|
|
36
36
|
<body>
|
|
37
|
+
<custom-element tag="cem-icon" hidden src="./components/icon.html#cem-icon" ></custom-element>
|
|
38
|
+
<custom-element tag="cem-input" hidden src="./components/input.html#cem-input" ></custom-element>
|
|
37
39
|
<custom-element tag="cem-icon-link" hidden src="./components/icon-link.html#cem-icon-link" ></custom-element>
|
|
38
|
-
<custom-element tag="cem-menu"
|
|
40
|
+
<custom-element tag="cem-menu" hidden src="./components/menu.html#cem-menu"></custom-element>
|
|
41
|
+
<custom-element tag="cem-badge" hidden src="./components/badge.html#cem-badge" ></custom-element>
|
|
42
|
+
<custom-element tag="cem-dropdown" hidden src="./components/dropdown.html#cem-dropdown" ></custom-element>
|
|
39
43
|
|
|
40
44
|
<header class="cem-theme-teal">
|
|
41
45
|
<custom-element src="./index.html#nav-head" ></custom-element>
|
|
@@ -49,8 +53,10 @@
|
|
|
49
53
|
<attribute name="head"></attribute>
|
|
50
54
|
<attribute name="description"></attribute>
|
|
51
55
|
<style>
|
|
56
|
+
&{ display: flex;}
|
|
52
57
|
&>dce-root
|
|
53
|
-
{ display: inline-flex; flex-direction: column;
|
|
58
|
+
{ display: inline-flex; flex-direction: column; justify-content: space-between;
|
|
59
|
+
flex: 1;
|
|
54
60
|
transition: background .3s ease;
|
|
55
61
|
border: 1px solid #c4c6d0;
|
|
56
62
|
border-radius: 12px;
|
|
@@ -59,6 +65,7 @@
|
|
|
59
65
|
&>a
|
|
60
66
|
{ color: var(--cem-action-secondary-color, black);
|
|
61
67
|
background-color:var(--cem-action-secondary-background, silver);
|
|
68
|
+
min-height: 6rem;
|
|
62
69
|
transition: background .3s ease;
|
|
63
70
|
transform: translateZ(0);
|
|
64
71
|
&:hover { background-color: var(--cem-action-secondary-background-hover); }
|
|
@@ -79,7 +86,19 @@
|
|
|
79
86
|
</template>
|
|
80
87
|
</custom-element>
|
|
81
88
|
|
|
82
|
-
<demo-list-card head="icon
|
|
89
|
+
<demo-list-card head="icon" description="Icons from popular collections">
|
|
90
|
+
<cem-icon image="https://www.gstatic.com/images/icons/material/apps/fonts/1x/catalog/v5/favicon.svg"
|
|
91
|
+
>Material Icon </cem-icon>
|
|
92
|
+
<cem-icon image="recycling"
|
|
93
|
+
> Recycling </cem-icon>
|
|
94
|
+
|
|
95
|
+
</demo-list-card>
|
|
96
|
+
|
|
97
|
+
<demo-list-card head="input" description="Text input field">
|
|
98
|
+
<cem-input leading="search" label="Text input" supporting="required field"></cem-input>
|
|
99
|
+
</demo-list-card>
|
|
100
|
+
|
|
101
|
+
<demo-list-card head="icon-link" description="Button like link">
|
|
83
102
|
<cem-icon-link icon="format_color_fill"
|
|
84
103
|
title="Select a theme for the documentation"
|
|
85
104
|
href="./components/icon-link.html"
|
|
@@ -95,6 +114,16 @@
|
|
|
95
114
|
</cem-menu>
|
|
96
115
|
</demo-list-card>
|
|
97
116
|
|
|
117
|
+
<demo-list-card head="badge" description="A small value indicator that can be overlaid on another object.">
|
|
118
|
+
<template>
|
|
119
|
+
<div style="display: inline-flex; gap:2rem;">
|
|
120
|
+
<cem-badge text="0" color="secondary"><template> <cem-icon image="far fa-envelope" ></cem-icon> </template></cem-badge>
|
|
121
|
+
<cem-badge text="999+" ><template> <cem-icon image="🛒" vertical="middle" ></cem-icon> </template></cem-badge>
|
|
122
|
+
<cem-badge text="999+" dot ><template> <cem-icon image="notifications" vertical="middle" ></cem-icon> </template></cem-badge>
|
|
123
|
+
</div>
|
|
124
|
+
</template>
|
|
125
|
+
</demo-list-card>
|
|
126
|
+
|
|
98
127
|
<demo-list-card head="autocomplete" description="Suggests relevant options as the user types.">
|
|
99
128
|
<cem-autocomplete placeholder="Greetings" >
|
|
100
129
|
<p>hello</p>
|
|
@@ -102,15 +131,23 @@
|
|
|
102
131
|
</cem-autocomplete>
|
|
103
132
|
</demo-list-card>
|
|
104
133
|
<demo-list-card head="dropdown" description="dropdown overlay which hangs above the background html">
|
|
105
|
-
<
|
|
106
|
-
|
|
134
|
+
<div>
|
|
135
|
+
<cem-dropdown label="drop base" >
|
|
136
|
+
<template>
|
|
137
|
+
<style>aside{background-color: silver; padding: 1rem; }</style>
|
|
138
|
+
dropped content
|
|
139
|
+
</template>
|
|
140
|
+
|
|
107
141
|
</cem-dropdown>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
142
|
+
<hr/>
|
|
143
|
+
<hr/>
|
|
144
|
+
<hr/>
|
|
145
|
+
<hr/>
|
|
146
|
+
<hr/>
|
|
147
|
+
<hr/>
|
|
148
|
+
<hr/>
|
|
149
|
+
<hr/>
|
|
150
|
+
</div>
|
|
114
151
|
</demo-list-card>
|
|
115
152
|
</main>
|
|
116
153
|
<footer>
|
|
@@ -51,9 +51,16 @@
|
|
|
51
51
|
/*#region semantic colors */
|
|
52
52
|
:root, .cem-theme-default, .cem-theme-azure{
|
|
53
53
|
|
|
54
|
+
--cem-icon-size: 2rem;
|
|
55
|
+
--cem-icon-size-small: 1rem;
|
|
56
|
+
--cem-icon-size-large: 3rem;
|
|
57
|
+
|
|
58
|
+
--cem-sys-body-small-size: .75rem;
|
|
59
|
+
--cem-form-field-subscript-text-size: var(--cem-sys-body-small-size);
|
|
60
|
+
|
|
54
61
|
--primary-background-color: var(--ng-azure-90);
|
|
55
62
|
--secondary-background-color: var(--ng-azure-80);
|
|
56
|
-
--alert-color: var(--ng-
|
|
63
|
+
--alert-color: var(--ng-error-40);
|
|
57
64
|
--text-color: var(--ng-azure-10);
|
|
58
65
|
|
|
59
66
|
--cem-action-primary-color: var(--text-color);
|
|
@@ -75,12 +82,17 @@
|
|
|
75
82
|
--cem-app-surface-variant: var(--ng-azure-variant-90);
|
|
76
83
|
--cem-app-on-surface: var(--ng-azure-variant-70);
|
|
77
84
|
--cem-app-primary: var(--ng-azure-variant-60);
|
|
85
|
+
--cem-on-surface-variant: var(--cem-action-secondary-color);
|
|
78
86
|
|
|
79
87
|
--cem-filled-text-field-container-color: var(--ng-azure-variant-90);
|
|
88
|
+
--cem-filled-text-field-container-color-hover: var(--ng-azure-variant-80);
|
|
80
89
|
--cem-filled-text-field-label-text-color: var(--ng-azure-variant-30);
|
|
81
90
|
--cem-filled-text-field-input-text-color: var(--ng-azure-variant-0);
|
|
82
91
|
--cem-filled-text-field-caret-color: var(--ng-azure-variant-10);
|
|
83
92
|
--cem-outline-color-focus: var(--ng-azure-40);
|
|
93
|
+
--cem-focus-outline-height: 3px;
|
|
94
|
+
--cem-input-outline-color: black;
|
|
95
|
+
--cem-input-outline: inset 0 -1px 0 var(--cem-input-outline-color,black);
|
|
84
96
|
|
|
85
97
|
--cem-list-background-color: var(--ng-azure-neutral-94);
|
|
86
98
|
--cem-list-background-color-hover: var(--ng-azure-variant-90);
|
|
@@ -93,6 +105,13 @@
|
|
|
93
105
|
--cem-menu-item-hover-color: black;
|
|
94
106
|
--cem-menu-item-padding: 0.5rem;
|
|
95
107
|
--cem-menu-item-font-weight: bold;
|
|
108
|
+
|
|
109
|
+
--cem-badge-color-primary: var(--ng-azure-50);
|
|
110
|
+
--cem-badge-color-secondary: var(--ng-magenta-50);
|
|
111
|
+
--cem-badge-color-success: var(--ng-cyan-60);
|
|
112
|
+
--cem-badge-color-alert: var(--ng-error-50);
|
|
113
|
+
--cem-badge-color: var(--cem-badge-color-primary);
|
|
114
|
+
|
|
96
115
|
}
|
|
97
116
|
|
|
98
117
|
.cem-theme-teal{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
Binary file
|
package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { StoryObj } from '@storybook/web-components';
|
|
4
4
|
import {expect, userEvent, within} from '@storybook/test';
|
|
5
5
|
|
|
6
|
-
import {cloneAs, mix} from'../custom-element/custom-element.js';
|
|
6
|
+
import {cloneAs, mix, mergeAttr} from'../custom-element/custom-element.js';
|
|
7
7
|
|
|
8
8
|
type TProps = { title: string; body:string};
|
|
9
9
|
|
|
@@ -29,6 +29,11 @@ const meta =
|
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
|
|
32
|
+
function html2Element( htmlStr: string)
|
|
33
|
+
{ const n = document.createElement('div');
|
|
34
|
+
n.innerHTML = htmlStr;
|
|
35
|
+
return n.firstElementChild as HTMLElement;
|
|
36
|
+
}
|
|
32
37
|
export const CloneAs:Story =
|
|
33
38
|
{ args : {title: 'cloneAs(el,newTag)', body:`
|
|
34
39
|
<p><code>cloneAs()</code> used for conversion of <code>attribute</code> to <code>xsl:param</code></p>
|
|
@@ -62,6 +67,69 @@ export const Mix:Story =
|
|
|
62
67
|
await expect( mix({},{a:1,b:'2'})).toEqual({a:1,b:'2'});
|
|
63
68
|
},
|
|
64
69
|
};
|
|
70
|
+
export const MergeAttr:Story =
|
|
71
|
+
{ args : {title: 'mergeAttr( from, to )', body:`
|
|
72
|
+
<p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
|
|
73
|
+
`}
|
|
74
|
+
, play: async () =>
|
|
75
|
+
{
|
|
76
|
+
const from = html2Element('<br title="a" id="b" readonly />');
|
|
77
|
+
const to = html2Element('<br removed/>');
|
|
78
|
+
|
|
79
|
+
await expect( to).toHaveAttribute('removed');
|
|
80
|
+
|
|
81
|
+
mergeAttr(from!,to);
|
|
82
|
+
|
|
83
|
+
await expect( to).toHaveAttribute('title','a');
|
|
84
|
+
await expect( to).toHaveAttribute('id','b');
|
|
85
|
+
await expect( to).toHaveAttribute('readonly');
|
|
86
|
+
await expect( to.getAttributeNames().length).toEqual(3);
|
|
87
|
+
await expect( to).not.toHaveAttribute('removed');
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
export const dceExportedAttributes:Story =
|
|
91
|
+
{ args : {title: 'mergeAttr( from, to )', body:`
|
|
92
|
+
<p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
|
|
93
|
+
<p><code>dceExportedAttributes</code> property on target element defines the set of attributes which
|
|
94
|
+
would not be removed from target element</p>
|
|
95
|
+
`}
|
|
96
|
+
, play: async () =>
|
|
97
|
+
{
|
|
98
|
+
const from = html2Element('<br id="b" readonly />');
|
|
99
|
+
const to = html2Element('<br removed/>') as (HTMLElement & {dceExportedAttributes:Set<string>});
|
|
100
|
+
to.dceExportedAttributes = new Set(['enforced']);
|
|
101
|
+
to.setAttribute('enforced',"defined by inner component");
|
|
102
|
+
await expect( to).toHaveAttribute('enforced');
|
|
103
|
+
|
|
104
|
+
mergeAttr(from,to);
|
|
105
|
+
|
|
106
|
+
await expect( to).toHaveAttribute('id','b');
|
|
107
|
+
await expect( to).toHaveAttribute('readonly');
|
|
108
|
+
await expect( to).not.toHaveAttribute('removed');
|
|
109
|
+
await expect( to).toHaveAttribute('enforced',"defined by inner component");
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
export const dceExportedAttributes_attr:Story =
|
|
113
|
+
{ args : {title: 'mergeAttr( from, to )', body:`
|
|
114
|
+
<p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
|
|
115
|
+
<p><code>dce-exported-attributes</code> attribute on target element defines the space separated list of attributes which
|
|
116
|
+
would not be removed from target element</p>
|
|
117
|
+
`}
|
|
118
|
+
, play: async () =>
|
|
119
|
+
{
|
|
120
|
+
const from = html2Element('<br id="b" readonly />');
|
|
121
|
+
const to = html2Element('<br removed dce-exported-attributes="enforced"/>') as (HTMLElement & {dceExportedAttributes:Set<string>});
|
|
122
|
+
to.setAttribute('enforced',"defined by inner component");
|
|
123
|
+
await expect( to).toHaveAttribute('enforced');
|
|
124
|
+
|
|
125
|
+
mergeAttr(from,to);
|
|
126
|
+
|
|
127
|
+
await expect( to).toHaveAttribute('id','b');
|
|
128
|
+
await expect( to).toHaveAttribute('readonly');
|
|
129
|
+
await expect( to).not.toHaveAttribute('removed');
|
|
130
|
+
await expect( to).toHaveAttribute('enforced',"defined by inner component");
|
|
131
|
+
},
|
|
132
|
+
};
|
|
65
133
|
|
|
66
134
|
export const AttributeDefaults:Story =
|
|
67
135
|
{ args : {title: 'Attributes definition', body:`
|
|
@@ -70,7 +138,7 @@ export const AttributeDefaults:Story =
|
|
|
70
138
|
<template>
|
|
71
139
|
<attribute name="p1">default_P1</attribute>
|
|
72
140
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
73
|
-
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
141
|
+
<attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
|
|
74
142
|
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
75
143
|
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
76
144
|
p3: <code data-testid="p3">{$p3}</code>
|
|
@@ -80,9 +148,7 @@ export const AttributeDefaults:Story =
|
|
|
80
148
|
`}
|
|
81
149
|
, play: async ({canvasElement}) =>
|
|
82
150
|
{
|
|
83
|
-
const
|
|
84
|
-
const canvas = within(canvasElement)
|
|
85
|
-
, code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
|
|
151
|
+
const canvas = within(canvasElement);
|
|
86
152
|
|
|
87
153
|
expect( await await canvas.findByTestId('p1') ).toHaveTextContent('default_P1' );
|
|
88
154
|
expect( await await canvas.findByTestId('p2') ).toHaveTextContent('always_p2' );
|
|
@@ -97,14 +163,14 @@ export const AttributesRuntimeChange:Story =
|
|
|
97
163
|
<template>
|
|
98
164
|
<attribute name="p1">default_P1 </attribute>
|
|
99
165
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
100
|
-
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
166
|
+
<attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
|
|
101
167
|
p1: <code data-testid="t1">{$p1}</code> <br/>
|
|
102
168
|
p2: <code data-testid="t2">{$p2}</code> <br/>
|
|
103
169
|
p3: <code data-testid="t3">{$p3}</code>
|
|
104
170
|
</template>
|
|
105
171
|
</custom-element>
|
|
106
172
|
<section>
|
|
107
|
-
<dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br
|
|
173
|
+
<dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br/>
|
|
108
174
|
<div><input id="i1" value="P1"> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
|
|
109
175
|
<div><input id="i2" value="P2"> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
|
|
110
176
|
<div><input id="i3" value="P3"> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
|
|
@@ -143,7 +209,7 @@ export const InstanceAttributes:Story =
|
|
|
143
209
|
<template>
|
|
144
210
|
<attribute name="p1">default_P1 </attribute>
|
|
145
211
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
146
|
-
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
212
|
+
<attribute name="p3" select="//attributes/p3 ?? 'def_P3' "></attribute>
|
|
147
213
|
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
148
214
|
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
149
215
|
p3: <code data-testid="p3">{$p3}</code>
|
|
@@ -156,7 +222,7 @@ export const InstanceAttributes:Story =
|
|
|
156
222
|
const titleText = AttributeDefaults.args!.title as string;
|
|
157
223
|
const canvas = within(canvasElement)
|
|
158
224
|
, code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
|
|
159
|
-
await sleep(
|
|
225
|
+
await sleep(200)
|
|
160
226
|
expect( await code('p1') ).toEqual('123' );
|
|
161
227
|
expect( await code('p2') ).toEqual('always_p2' );
|
|
162
228
|
expect( await code('p3') ).toEqual('qwe' );
|
|
@@ -173,11 +239,11 @@ export const AttributesPropagationUp:Story =
|
|
|
173
239
|
<attribute name="data-testid"></attribute>
|
|
174
240
|
<attribute name="p1"></attribute>
|
|
175
241
|
<attribute name="p2">DEFAULT VALUE</attribute>
|
|
176
|
-
<attribute name="p3" select=" //from-input
|
|
242
|
+
<attribute name="p3" select=" //from-input "></attribute>
|
|
177
243
|
<input slice="from-input" slice-event="input"/><br/>
|
|
178
244
|
p1:<code data-testid="{$data-testid}-p1" >{ $p1 }</code><br/>
|
|
179
245
|
p2:<code data-testid="{$data-testid}-p2" >{ $p2 }</code><br/>
|
|
180
|
-
|
|
246
|
+
p3:<code data-testid="{$data-testid}-p3" >{ $p3 }</code><br/>
|
|
181
247
|
//from-input: {//from-input} <hr/>
|
|
182
248
|
</template>
|
|
183
249
|
</custom-element>
|
|
@@ -195,32 +261,32 @@ export const AttributesPropagationUp:Story =
|
|
|
195
261
|
|
|
196
262
|
await expect( await code('t1-p1') ).toEqual('' );
|
|
197
263
|
await expect( await code('t1-p2') ).toEqual('DEFAULT VALUE' );
|
|
198
|
-
await expect( await code('t1-p3') ).toEqual('
|
|
264
|
+
await expect( await code('t1-p3') ).toEqual('' );
|
|
199
265
|
|
|
200
266
|
const t1 = await canvas.findByTestId('t1');
|
|
201
267
|
await expect( t1 ).toHaveAttribute('value','123');
|
|
202
268
|
await expect( t1 ).toHaveAttribute('p2','DEFAULT VALUE');
|
|
203
|
-
await expect( t1 ).toHaveAttribute('p3','
|
|
269
|
+
await expect( t1 ).toHaveAttribute('p3','');
|
|
204
270
|
await expect( t1 ).not.toHaveAttribute('p1');
|
|
205
271
|
|
|
206
272
|
await expect( await code('t2-p1') ).toEqual('P1' );
|
|
207
273
|
await expect( await code('t2-p2') ).toEqual('123' );
|
|
208
|
-
await expect( await code('t2-p3') ).toEqual('
|
|
274
|
+
await expect( await code('t2-p3') ).toEqual('' );
|
|
209
275
|
|
|
210
276
|
const t2 = await canvas.findByTestId('t2');
|
|
211
277
|
await expect( t2 ).toHaveAttribute('p1','P1');
|
|
212
278
|
await expect( t2 ).toHaveAttribute('p2','123');
|
|
213
|
-
await expect( t2 ).toHaveAttribute('p3','
|
|
279
|
+
await expect( t2 ).toHaveAttribute('p3','');
|
|
214
280
|
|
|
215
281
|
|
|
216
282
|
await expect( await code('t3-p1') ).toEqual('' );
|
|
217
283
|
await expect( await code('t3-p2') ).toEqual('DEFAULT VALUE' );
|
|
218
|
-
await expect( await code('t3-p3') ).toEqual('
|
|
284
|
+
await expect( await code('t3-p3') ).toEqual('' );
|
|
219
285
|
|
|
220
286
|
const t3 = await canvas.findByTestId('t3');
|
|
221
287
|
await expect( t1 ).not.toHaveAttribute('p1');
|
|
222
288
|
await expect( t3 ).toHaveAttribute('p2','DEFAULT VALUE');
|
|
223
|
-
await expect( t3 ).toHaveAttribute('p3','
|
|
289
|
+
await expect( t3 ).toHaveAttribute('p3','');
|
|
224
290
|
|
|
225
291
|
t3.querySelector('input')?.focus();
|
|
226
292
|
await userEvent.keyboard('DCE');
|
|
@@ -4,7 +4,7 @@ import type { StoryObj } from '@storybook/web-components';
|
|
|
4
4
|
import {expect, getByTestId, within} from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
import '../custom-element/custom-element.js';
|
|
7
|
-
import {
|
|
7
|
+
import {frameCanvas} from "./frame.canvas";
|
|
8
8
|
|
|
9
9
|
type TProps = { title: string; body:string};
|
|
10
10
|
|
|
@@ -75,7 +75,7 @@ export const ExternalSvg:Story =
|
|
|
75
75
|
<template><i>loading from SVG ...</i></template>
|
|
76
76
|
</custom-element>
|
|
77
77
|
<dce-external></dce-external>
|
|
78
|
-
<custom-element src="confused.svg">
|
|
78
|
+
<custom-element src="/confused.svg">
|
|
79
79
|
<i>inline DCE loading from SVG ...</i>
|
|
80
80
|
</custom-element>
|
|
81
81
|
<custom-element src="no.svg">
|
|
@@ -92,7 +92,7 @@ export const ExternalSvg:Story =
|
|
|
92
92
|
// needs separate test
|
|
93
93
|
// await expect( await canvas.findByText('loading from SVG ...')).toBeInTheDocument();
|
|
94
94
|
|
|
95
|
-
expect(canvasElement.querySelector('[src="confused.svg"]').innerHTML).to.include('loading from SVG ...');
|
|
95
|
+
expect(canvasElement.querySelector('[src="/confused.svg"]').innerHTML).to.include('loading from SVG ...');
|
|
96
96
|
await expect(await canvas.findByText('fallback for missing image')).toBeInTheDocument();
|
|
97
97
|
await expect(await canvas.findByTitle('Confused')).toBeInTheDocument();
|
|
98
98
|
},
|
|
@@ -188,32 +188,34 @@ export const SvgWithinHtmlFile:Story =
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
export const MathMLWithinHtmlFile:Story =
|
|
191
|
-
{ args : {title: 'external HTML template - MathML by id', body:`
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
</custom-element>
|
|
191
|
+
{ args : {title: '6. external HTML template - MathML by id', body:`
|
|
192
|
+
<iframe src="/demo/external-templates-sb-6.html" data-testid="fr"></iframe>
|
|
193
|
+
|
|
195
194
|
`}
|
|
196
195
|
, play: async ({canvasElement}) =>
|
|
197
196
|
{
|
|
198
197
|
const canvas = within(canvasElement);
|
|
199
198
|
await canvas.findByText(MathMLWithinHtmlFile.args!.title as string);
|
|
200
|
-
const
|
|
199
|
+
const frCanvas = await frameCanvas('fr',canvas);
|
|
200
|
+
|
|
201
|
+
const ml = await frCanvas.findByTestId('ml-test');
|
|
201
202
|
expect(ml.firstElementChild.localName).toEqual('mrow');
|
|
202
203
|
},
|
|
203
204
|
};
|
|
204
205
|
|
|
205
206
|
export const ByIdWithinXsltFile:Story =
|
|
206
|
-
{ args : {title: 'external XHTML template - xsl by id', body:`
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
</custom-element>
|
|
207
|
+
{ args : {title: '7. external XHTML template - xsl by id', body:`
|
|
208
|
+
<iframe src="/demo/external-templates-sb-7.html" data-testid="fr"></iframe>
|
|
209
|
+
|
|
210
210
|
`}
|
|
211
211
|
, play: async ({canvasElement}) =>
|
|
212
212
|
{
|
|
213
213
|
const canvas = within(canvasElement);
|
|
214
214
|
await canvas.findByText(ByIdWithinXsltFile.args!.title as string);
|
|
215
|
-
const
|
|
216
|
-
|
|
215
|
+
const frCanvas = await frameCanvas('fr',canvas);
|
|
216
|
+
|
|
217
|
+
await expect( await frCanvas.findByText('whole XSLT is embedded into HTML body') ).toBeInTheDocument();
|
|
218
|
+
await expect( await frCanvas.findByText('./html-template.xhtml#embedded-xsl') ).toBeInTheDocument();
|
|
217
219
|
},
|
|
218
220
|
};
|
|
219
221
|
export const MissingIdWithinXsltFile:Story =
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {within} from "@storybook/test";
|
|
2
|
+
/*
|
|
3
|
+
example of use
|
|
4
|
+
|
|
5
|
+
import {frameCanvas} from "./frame.canvas";
|
|
6
|
+
|
|
7
|
+
export const ModuleByName:Story =
|
|
8
|
+
{ args : {title: '4. module path by symbolic name', body:`
|
|
9
|
+
<iframe src="../demo/module-url-sb-4.html" name="sb" data-testid="fr"></iframe>
|
|
10
|
+
|
|
11
|
+
`}
|
|
12
|
+
, play: async ({canvasElement}) =>
|
|
13
|
+
{
|
|
14
|
+
const canvas = within(canvasElement);
|
|
15
|
+
await canvas.findByText(ModuleByName.args!.title as string);
|
|
16
|
+
const frCanvas = await frameCanvas('fr',canvas);
|
|
17
|
+
|
|
18
|
+
await expect(await frCanvas.findByText('👌 from embed-relative-hash invoking')).toBeInTheDocument();
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
*/
|
|
22
|
+
export async function
|
|
23
|
+
frameCanvas(frameTestId: string, canvas: ReturnType<typeof within>)
|
|
24
|
+
: Promise<ReturnType<typeof within>>
|
|
25
|
+
{
|
|
26
|
+
const frEl: HTMLIFrameElement = await canvas.findByTestId(frameTestId);
|
|
27
|
+
return new Promise(resolve => frEl.addEventListener('load', () =>
|
|
28
|
+
{
|
|
29
|
+
resolve(within(frEl.contentWindow?.document.documentElement!));
|
|
30
|
+
}));
|
|
31
|
+
}
|