@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.
- package/.idea/custom-element-dist.iml +11 -0
- package/.idea/inspectionProfiles/Project_Default.xml +25 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.storybook/main.ts +21 -19
- package/.storybook/preview.ts +25 -25
- package/README.md +4 -4
- package/coverage/coverage-final.json +21 -21
- 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 +543 -441
- package/coverage/src/custom-element/http-request.js.html +12 -12
- package/coverage/src/custom-element/index.html +18 -18
- package/coverage/src/custom-element/local-storage.js.html +52 -52
- package/coverage/src/custom-element/location-element.js.html +4 -4
- package/coverage/src/custom-element/module-url.js.html +1 -1
- 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/coverage.svg +1 -1
- package/coverage/src/stories/attributes.test.stories.ts.html +335 -35
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts.html +1 -1
- package/coverage/src/stories/dom-merge.test.stories.ts.html +1 -1
- package/coverage/src/stories/external-template.test.stories.ts.html +2 -2
- package/coverage/src/stories/form.test.stories.ts.html +1 -1
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +22 -22
- package/coverage/src/stories/local-storage.test.stories.ts.html +17 -17
- package/coverage/src/stories/location-element.test.stories.ts.html +3 -6
- package/coverage/src/stories/module-url.test.stories.ts.html +1 -1
- package/coverage/src/stories/set-url.test.stories.ts.html +1 -1
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/slice-events.test.stories.ts.html +284 -23
- package/coverage/src/stories/slots.test.stories.ts.html +1 -1
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/stories/version-select.test.stories.ts.html +3 -3
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-D2wf_rqP.js +576 -0
- package/dist/custom-element-Dtzhbjkc.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +30 -28
- package/dist/demo/a.html +51 -38
- package/dist/demo/a.svg +26 -26
- package/dist/demo/data-slices.html +37 -0
- package/dist/demo/external-template.html +1 -0
- package/dist/demo/form.html +42 -0
- package/dist/demo/hex-grid-dce.html +1 -1
- package/dist/demo/hex-grid.html +1 -1
- package/dist/demo/parameters.html +20 -1
- package/dist/demo/s.xml +6 -12
- package/dist/demo/s.xslt +64 -15
- package/dist/demo/ss.html +4 -23
- package/package.json +13 -13
- package/public/demo/a.html +51 -38
- package/public/demo/a.svg +26 -26
- package/public/demo/data-slices.html +37 -0
- package/public/demo/external-template.html +1 -0
- package/public/demo/form.html +42 -0
- package/public/demo/hex-grid-dce.html +1 -1
- package/public/demo/hex-grid.html +1 -1
- package/public/demo/parameters.html +20 -1
- package/public/demo/s.xml +6 -12
- package/public/demo/s.xslt +64 -15
- package/public/demo/ss.html +4 -23
- package/src/custom-element/custom-element.js +76 -42
- package/src/custom-element/demo/a.html +51 -38
- package/src/custom-element/demo/a.svg +26 -26
- package/src/custom-element/demo/data-slices.html +37 -0
- package/src/custom-element/demo/external-template.html +1 -0
- package/src/custom-element/demo/form.html +42 -0
- package/src/custom-element/demo/hex-grid-dce.html +1 -1
- package/src/custom-element/demo/hex-grid.html +1 -1
- package/src/custom-element/demo/parameters.html +20 -1
- package/src/custom-element/demo/s.xml +6 -12
- package/src/custom-element/demo/s.xslt +64 -15
- package/src/custom-element/demo/ss.html +4 -23
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/material/angular.css +987 -987
- package/src/material/components/autocomplete.html +239 -240
- package/src/material/components/dropdown.html +110 -46
- package/src/material/components/icon-link.html +160 -160
- package/src/material/components/input.html +363 -0
- package/src/material/components/menu.html +234 -234
- package/src/material/components.html +121 -120
- package/src/material/demo.css +36 -31
- package/src/material/index.html +110 -110
- package/src/material/material.css +356 -356
- package/src/material/theme/README.md +17 -17
- package/src/material/theme/semantic.css +113 -112
- package/src/mocks/versions.mock.ts +8 -8
- package/src/stories/attributes.test.stories.ts +123 -23
- package/src/stories/external-template.test.stories.ts +1 -1
- package/src/stories/location-element.test.stories.ts +1 -2
- package/src/stories/slice-events.test.stories.ts +87 -0
- package/storybook-static/assets/Color-F6OSRLHC-BU3iy8jH.js +1 -0
- package/storybook-static/assets/{Configure-DOhzHFEs.js → Configure-DN6ifayP.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-BSJkbsd6.js → DocsRenderer-CFRXHY34-BaVEufDj.js} +2 -2
- package/storybook-static/assets/attributes.test.stories-D1X6EBrd.js +278 -0
- package/storybook-static/assets/{css.test.stories-pgbBc17d.js → css.test.stories-Cp_g2hE1.js} +1 -1
- package/storybook-static/assets/custom-element-uuAtIYWS.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-CXcYP_-J.js → dom-merge.test.stories-hbpdCka0.js} +1 -1
- package/storybook-static/assets/entry-preview-DHVXbf3x.js +26 -0
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +2 -0
- package/storybook-static/assets/{external-template.test.stories-CpJ68Ghy.js → external-template.test.stories-BK89h6sk.js} +3 -3
- package/storybook-static/assets/{form.test.stories-D35lyqd8.js → form.test.stories-BfoLe_rw.js} +1 -1
- package/storybook-static/assets/{handlers-CW9pDZnt.js → handlers-yVPwH_Nz.js} +21 -21
- package/storybook-static/assets/{http-request.stories-CBbknCOO.js → http-request.stories-CBFJS2Ws.js} +1 -1
- package/storybook-static/assets/iframe-CJEL_4Nu.js +2 -0
- package/storybook-static/assets/index-BcZLpTeD.js +8 -0
- package/storybook-static/assets/{index-BSz1w4Gl.js → index-CxRwF5Or.js} +130 -130
- package/storybook-static/assets/index-D5fBh-7N.js +1 -0
- package/storybook-static/assets/{index-YxUFxnQR.js → index-DM-KBPdl.js} +1 -1
- package/storybook-static/assets/{index-B3QjF0Ed.js → index-RSFf30w1.js} +1 -1
- package/storybook-static/assets/index-SnjB5uV8.js +769 -0
- package/storybook-static/assets/{local-storage.test.stories-BY-PWhuk.js → local-storage.test.stories-C0Yzy6Am.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-3auBYEaU.js → location-element.test.stories-DNFrEu5A.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-B7L9cL60.js → module-url.test.stories-CXibF5Ta.js} +1 -1
- package/storybook-static/assets/{preview-CfWMRsRq.js → preview-Bnd0XhaF.js} +2 -2
- package/storybook-static/assets/{preview-BRPR-UXC.js → preview-CNKoaWES.js} +1 -1
- package/storybook-static/assets/preview-DAeyCMnM.js +1 -0
- package/storybook-static/assets/preview-DJMlNTk8.js +2 -0
- package/storybook-static/assets/{set-url.test.stories-CuSuDLIx.js → set-url.test.stories-BBfLxv2u.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BkRKsKem.js → slice-events.test.stories-HcXF8XQI.js} +138 -13
- package/storybook-static/assets/{slots.test.stories-BJCUWFkE.js → slots.test.stories-i6mnIFM2.js} +1 -1
- package/storybook-static/assets/tiny-invariant-CopsF_GD.js +1 -0
- package/storybook-static/assets/{version-select.test.stories-B3ybJn_Z.js → version-select.test.stories-BsUFH6Va.js} +1 -1
- package/storybook-static/demo/a.html +51 -38
- package/storybook-static/demo/a.svg +26 -26
- package/storybook-static/demo/data-slices.html +37 -0
- package/storybook-static/demo/external-template.html +1 -0
- package/storybook-static/demo/form.html +42 -0
- package/storybook-static/demo/hex-grid-dce.html +1 -1
- package/storybook-static/demo/hex-grid.html +1 -1
- package/storybook-static/demo/parameters.html +20 -1
- package/storybook-static/demo/s.xml +6 -12
- package/storybook-static/demo/s.xslt +64 -15
- package/storybook-static/demo/ss.html +4 -23
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/index.html +4 -0
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +333 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +82 -85
- 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-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +66 -67
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +1 -1
- package/storybook-static/sb-manager/globals-module-info.js +25 -3
- package/storybook-static/sb-manager/globals-runtime.js +29585 -43124
- package/storybook-static/sb-manager/runtime.js +10647 -9399
- package/storybook-static/sb-preview/runtime.js +3536 -5860
- package/test-runner-jest.config.js +15 -0
- package/dist/custom-element-BOIPgtxz.js +0 -565
- package/dist/custom-element-CUsSENWc.cjs +0 -97
- package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
- package/storybook-static/assets/Color-ERTF36HU-CQkSD2nd.js +0 -1
- package/storybook-static/assets/attributes.test.stories-BJBuuXgZ.js +0 -150
- package/storybook-static/assets/custom-element-BDGsYgbP.js +0 -97
- package/storybook-static/assets/entry-preview-C313OLrj.js +0 -26
- package/storybook-static/assets/entry-preview-docs-B7ORr9w5.js +0 -2
- package/storybook-static/assets/iframe-DOi4N7qI.js +0 -2
- package/storybook-static/assets/index-BdcJ-iJ7.js +0 -8
- package/storybook-static/assets/index-CaL3Qp7t.js +0 -634
- package/storybook-static/assets/index-DgFM0Ce3.js +0 -1
- package/storybook-static/assets/preview-C992A1Y-.js +0 -2
- package/storybook-static/assets/preview-CcS4DQh8.js +0 -1
- package/storybook-static/assets/tiny-invariant-BxWVcicq.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en"
|
|
2
|
+
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
|
|
@@ -23,16 +23,37 @@
|
|
|
23
23
|
@import "../material.css";
|
|
24
24
|
@import "../theme/semantic.css";
|
|
25
25
|
@import "../demo.css";
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
main {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-wrap: wrap;
|
|
28
30
|
gap: 3rem;
|
|
29
31
|
padding: 5rem;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
|
|
33
|
+
& > p {
|
|
34
|
+
min-width: 90%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
html-demo-element {
|
|
38
|
+
overflow: visible;
|
|
39
|
+
|
|
40
|
+
[slot="legend"] {
|
|
41
|
+
border-radius: 1rem 1rem 0 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[slot="description"] {
|
|
45
|
+
padding: 0 1rem 1rem 1rem;
|
|
46
|
+
|
|
47
|
+
dd {
|
|
48
|
+
padding: 0 !important;
|
|
49
|
+
margin: 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[slot="description"] dd {
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
[slot="demo"]{ min-height: 8rem; }
|
|
36
57
|
}
|
|
37
58
|
}
|
|
38
59
|
</style>
|
|
@@ -40,68 +61,111 @@
|
|
|
40
61
|
|
|
41
62
|
<body>
|
|
42
63
|
<custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
64
|
+
<custom-element hidden src="./menu.html#cem-menu" tag="cem-menu"></custom-element>
|
|
43
65
|
|
|
44
66
|
<header class="cem-theme-teal">
|
|
45
|
-
<custom-element src="../index.html#nav-head"
|
|
67
|
+
<custom-element src="../index.html#nav-head"></custom-element>
|
|
46
68
|
</header>
|
|
47
69
|
<main>
|
|
48
|
-
<p><code>cem-dropdown</code> is
|
|
49
|
-
<a href="https://material.io/components"
|
|
70
|
+
<p><code>cem-dropdown</code> is popover component from <custom-element> Material suite based on the
|
|
71
|
+
<a href="https://material.io/components">Material Design specification</a>.
|
|
50
72
|
</p>
|
|
51
|
-
<
|
|
52
|
-
|
|
73
|
+
<p>The visibility of dropdown content is driven by <code>open</code> attribute</p>
|
|
74
|
+
<custom-element hidden tag="cem-dropdown">
|
|
75
|
+
<template id="cem-dropdown">
|
|
53
76
|
<attribute name="open"></attribute>
|
|
54
77
|
<attribute name="label"></attribute>
|
|
55
78
|
<style>
|
|
56
|
-
dce-root
|
|
57
|
-
|
|
79
|
+
dce-root {
|
|
80
|
+
position: relative;
|
|
58
81
|
|
|
59
82
|
--cem-dropdown-shadow: 0px 3px 1px -2px rgba(0, 0, 0, .2), 0px 2px 2px 0px rgba(0, 0, 0, .14), 0px 1px 5px 0px rgba(0, 0, 0, .12);
|
|
83
|
+
--cem-dropdown-max-height: 10rem;
|
|
84
|
+
--cem-dropdown-base-min-width: 8em;
|
|
85
|
+
|
|
86
|
+
&[open="false"]{
|
|
87
|
+
&>aside{ max-height: 0;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
& > label {
|
|
91
|
+
min-width: var(--cem-dropdown-base-min-width);
|
|
92
|
+
display: inline-block;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
& > aside {
|
|
96
|
+
position: absolute;
|
|
97
|
+
left: 0;
|
|
98
|
+
top: 100%;
|
|
99
|
+
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
max-height: var(--cem-dropdown-max-height);
|
|
102
|
+
transition: var(--cem-drop-transition);
|
|
60
103
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
left: 0; right: 0; top:100%;
|
|
64
|
-
transition: var(--drop-transition);
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
65
106
|
|
|
66
107
|
border-radius: var(--cem-autocomplete-container-shape);
|
|
67
108
|
border-top-left-radius: 0;
|
|
68
109
|
border-top-right-radius: 0;
|
|
69
110
|
box-shadow: var(--cem-dropdown-shadow);
|
|
70
|
-
|
|
71
|
-
transition-delay: 40ms;
|
|
72
|
-
transition-duration: 110ms;
|
|
73
111
|
}
|
|
74
112
|
}
|
|
75
113
|
</style>
|
|
76
|
-
<pre>
|
|
77
|
-
//focused {//focused}
|
|
78
|
-
//suggest {//suggest}
|
|
79
|
-
//selected {//selected}
|
|
80
|
-
</pre>
|
|
81
114
|
<slot name="base"><label>{$label}</label></slot>
|
|
82
|
-
<aside
|
|
115
|
+
<aside>
|
|
116
|
+
<slot name=""></slot>
|
|
117
|
+
</aside>
|
|
83
118
|
</template>
|
|
84
119
|
</custom-element>
|
|
85
120
|
|
|
86
|
-
<html-demo-element
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
121
|
+
<html-demo-element
|
|
122
|
+
legend="HTML in dropdown"
|
|
123
|
+
description="any HTML payload is OK. The image is just for reference." >
|
|
124
|
+
<template>
|
|
125
|
+
<cem-dropdown label="Image in drop" open="true">
|
|
126
|
+
<img src="../../custom-element/demo/confused.svg"/>
|
|
127
|
+
</cem-dropdown>
|
|
128
|
+
<hr/>
|
|
129
|
+
<hr/>
|
|
130
|
+
<hr/>
|
|
131
|
+
<hr/>
|
|
132
|
+
</template>
|
|
133
|
+
</html-demo-element>
|
|
134
|
+
|
|
135
|
+
<html-demo-element
|
|
136
|
+
legend="Menu in dropdown"
|
|
137
|
+
description="Focus to see the cursor in input with label shifted upward" >
|
|
138
|
+
<template>
|
|
139
|
+
<cem-dropdown label="Vertical menu" open="true">
|
|
140
|
+
<cem-menu direction="column">
|
|
141
|
+
<a href="#">link 1</a>
|
|
142
|
+
<a href="#">link 2</a>
|
|
143
|
+
<a href="#">link 3</a>
|
|
144
|
+
</cem-menu>
|
|
100
145
|
</cem-dropdown>
|
|
101
|
-
|
|
102
|
-
</html-demo-element>
|
|
146
|
+
</template>
|
|
147
|
+
</html-demo-element>
|
|
103
148
|
|
|
149
|
+
<html-demo-element description="Focus to see the cursor in input with label shifted upward "
|
|
150
|
+
legend="Collapsing by slice">
|
|
151
|
+
<template>
|
|
152
|
+
<custom-element>
|
|
153
|
+
<template>
|
|
154
|
+
<label><input slice="opened" type="checkbox" value="1" checked/>
|
|
155
|
+
open</label><br/>
|
|
156
|
+
//opened:'{//opened}'
|
|
157
|
+
<cem-dropdown label="Vertical menu" open="{//opened='1'}">
|
|
104
158
|
|
|
159
|
+
<cem-menu direction="column">
|
|
160
|
+
<a href="#">link 1</a>
|
|
161
|
+
<a href="#">link 2</a>
|
|
162
|
+
<a href="#">link 3</a>
|
|
163
|
+
</cem-menu>
|
|
164
|
+
</cem-dropdown>
|
|
165
|
+
</template>
|
|
166
|
+
</custom-element>
|
|
167
|
+
</template>
|
|
168
|
+
</html-demo-element>
|
|
105
169
|
|
|
106
170
|
</main>
|
|
107
171
|
<footer>
|
|
@@ -109,7 +173,7 @@
|
|
|
109
173
|
Powered by Syngrafact Corp. ©2024.<br/>
|
|
110
174
|
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
111
175
|
</footer>
|
|
112
|
-
<script
|
|
176
|
+
<script src="https://unpkg.com/html-demo-element@1/html-demo-element.js" type="module"></script>
|
|
113
177
|
|
|
114
178
|
</body>
|
|
115
179
|
</html>
|
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
|
|
6
|
-
<title>Components - custom-element - Material Design</title>
|
|
7
|
-
<link href="../../custom-element/demo/wc-square.svg" rel="icon"/>
|
|
8
|
-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
|
|
9
|
-
<link crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
|
|
10
|
-
integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" rel="stylesheet"/>
|
|
11
|
-
|
|
12
|
-
<script type="importmap">
|
|
13
|
-
{
|
|
14
|
-
"imports": {
|
|
15
|
-
"@epa-wg/": "../../"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
<script src="../../custom-element/module-url.js" type="module"></script>
|
|
20
|
-
<script src="../../custom-element/custom-element.js" type="module"></script>
|
|
21
|
-
<style>
|
|
22
|
-
@import "../angular.css";
|
|
23
|
-
@import "../material.css";
|
|
24
|
-
@import "../theme/semantic.css";
|
|
25
|
-
@import "../demo.css";
|
|
26
|
-
main{
|
|
27
|
-
display: flex; flex-wrap: wrap;
|
|
28
|
-
gap: 3rem;
|
|
29
|
-
padding: 5rem;
|
|
30
|
-
&>p{ min-width: 90%; }
|
|
31
|
-
html-demo-element
|
|
32
|
-
{ overflow: visible;
|
|
33
|
-
[slot="legend"]{ border-radius: 1rem 1rem 0 0; }
|
|
34
|
-
[slot="description"]{ padding: 0 1rem 1rem 1rem; dd{ padding: 0 !important;margin: 0; }}
|
|
35
|
-
[slot="description"] dd{ padding: 0; }
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
</head>
|
|
40
|
-
|
|
41
|
-
<body>
|
|
42
|
-
<template id="cem-icon-link">
|
|
43
|
-
<attribute name="href"></attribute>
|
|
44
|
-
<attribute name="icon"></attribute>
|
|
45
|
-
<attribute aria-description="color appearance. Default value is 'normal'. Values: normal|primary|secondary|alert|blend"
|
|
46
|
-
name="kind"></attribute>
|
|
47
|
-
<style>
|
|
48
|
-
&:not([kind]) a, &[kind="normal"] a {
|
|
49
|
-
/*background-color: var(--mdc-theme-primary, #6200ee);*/
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
a {
|
|
53
|
-
display: inline-flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: 0.5rem;
|
|
56
|
-
padding: 0.5rem 1rem;;
|
|
57
|
-
border-radius: 1.5rem;
|
|
58
|
-
|
|
59
|
-
background-color: var(--cem-action-primary-background);
|
|
60
|
-
transition: var(--cem-action-transition);
|
|
61
|
-
box-shadow: var(--cem-action-box-shadow);
|
|
62
|
-
|
|
63
|
-
&:hover {
|
|
64
|
-
background-color: var(--cem-action-primary-background-hover);
|
|
65
|
-
box-shadow: var(--cem-action-box-shadow-hover);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&:focus {
|
|
69
|
-
background-color: var(--cem-action-primary-background-focus);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:active, &:focus:active {
|
|
73
|
-
background-color: var(--cem-action-primary-background-active);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&, &:visited {
|
|
77
|
-
text-decoration: none;
|
|
78
|
-
color: var(--mat-light-blue-900);
|
|
79
|
-
}
|
|
80
|
-
--icon-size: 2rem;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.icon {
|
|
84
|
-
font-size: var(--icon-size);
|
|
85
|
-
height: var(--icon-size);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
</style>
|
|
89
|
-
<a href="{$href}">
|
|
90
|
-
<choose>
|
|
91
|
-
<when test="contains($icon,'/')"><img alt="DCE logo" class="icon" src="{$icon}"/></when>
|
|
92
|
-
<when test="contains($icon,'fa-')"><i class="icon {$icon}"></i></when>
|
|
93
|
-
<when test="$icon"><span class="icon material-icons">{$icon}</span></when>
|
|
94
|
-
</choose>
|
|
95
|
-
<slot></slot>
|
|
96
|
-
</a>
|
|
97
|
-
</template>
|
|
98
|
-
|
|
99
|
-
<custom-element hidden src="#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
100
|
-
|
|
101
|
-
<header class="cem-theme-teal">
|
|
102
|
-
<custom-element src="../index.html#nav-head" ></custom-element>
|
|
103
|
-
</header>
|
|
104
|
-
<main>
|
|
105
|
-
<p><code>cem-icon-link</code> is button like component from <custom-element> Material suite based on the
|
|
106
|
-
<a href="https://material.io/components" >Material Design specification</a>.
|
|
107
|
-
</p>
|
|
108
|
-
<p>
|
|
109
|
-
<code>direction</code> attribute defines css <code>row</code> or <code>column</code> flex-direction.
|
|
110
|
-
</p>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<html-demo-element legend="Image from importmap module"
|
|
114
|
-
description="logo SVG with link to file in module">
|
|
115
|
-
<template>
|
|
116
|
-
<custom-element>
|
|
117
|
-
<template>
|
|
118
|
-
<module-url slice="cem-url" src="@epa-wg/material"></module-url>
|
|
119
|
-
<module-url slice="logo-url" src="@epa-wg/custom-element/demo/wc-square.svg"></module-url>
|
|
120
|
-
<cem-icon-link href="{//cem-url}/" icon="{//logo-url}"> custom-element</cem-icon-link>
|
|
121
|
-
<cem-icon-link icon="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/1.svg">
|
|
122
|
-
bulbasaur</cem-icon-link>
|
|
123
|
-
</template>
|
|
124
|
-
</custom-element>
|
|
125
|
-
</template>
|
|
126
|
-
</html-demo-element>
|
|
127
|
-
|
|
128
|
-
<html-demo-element legend="Google Material icon font" >
|
|
129
|
-
<p slot="description">
|
|
130
|
-
<a href="https://fonts.google.com/icons">Material Icon</a> example.
|
|
131
|
-
</p>
|
|
132
|
-
<template>
|
|
133
|
-
<cem-icon-link icon="recycling"> recycling</cem-icon-link>
|
|
134
|
-
<cem-icon-link icon="shopping_cart"> shopping_cart</cem-icon-link>
|
|
135
|
-
</template>
|
|
136
|
-
</html-demo-element>
|
|
137
|
-
|
|
138
|
-
<html-demo-element legend="Fontawesome" >
|
|
139
|
-
<p slot="description">
|
|
140
|
-
<a href="https://fontawesome.com/icons/">Fontawesome Icon</a> example.
|
|
141
|
-
</p>
|
|
142
|
-
<template>
|
|
143
|
-
<cem-icon-link icon="fab fa-github" > GitHub </cem-icon-link>
|
|
144
|
-
<cem-icon-link icon="fas fa-cloud-upload-alt" > Upload </cem-icon-link>
|
|
145
|
-
</template>
|
|
146
|
-
</html-demo-element>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
</main>
|
|
153
|
-
<footer>
|
|
154
|
-
<hr/>
|
|
155
|
-
Powered by Syngrafact Corp. ©2024.<br/>
|
|
156
|
-
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
157
|
-
</footer>
|
|
158
|
-
<script type="module" src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js"></script>
|
|
159
|
-
|
|
160
|
-
</body>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
|
|
6
|
+
<title>Components - custom-element - Material Design</title>
|
|
7
|
+
<link href="../../custom-element/demo/wc-square.svg" rel="icon"/>
|
|
8
|
+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
|
|
9
|
+
<link crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
|
|
10
|
+
integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" rel="stylesheet"/>
|
|
11
|
+
|
|
12
|
+
<script type="importmap">
|
|
13
|
+
{
|
|
14
|
+
"imports": {
|
|
15
|
+
"@epa-wg/": "../../"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<script src="../../custom-element/module-url.js" type="module"></script>
|
|
20
|
+
<script src="../../custom-element/custom-element.js" type="module"></script>
|
|
21
|
+
<style>
|
|
22
|
+
@import "../angular.css";
|
|
23
|
+
@import "../material.css";
|
|
24
|
+
@import "../theme/semantic.css";
|
|
25
|
+
@import "../demo.css";
|
|
26
|
+
main{
|
|
27
|
+
display: flex; flex-wrap: wrap;
|
|
28
|
+
gap: 3rem;
|
|
29
|
+
padding: 5rem;
|
|
30
|
+
&>p{ min-width: 90%; }
|
|
31
|
+
html-demo-element
|
|
32
|
+
{ overflow: visible;
|
|
33
|
+
[slot="legend"]{ border-radius: 1rem 1rem 0 0; }
|
|
34
|
+
[slot="description"]{ padding: 0 1rem 1rem 1rem; dd{ padding: 0 !important;margin: 0; }}
|
|
35
|
+
[slot="description"] dd{ padding: 0; }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
</head>
|
|
40
|
+
|
|
41
|
+
<body>
|
|
42
|
+
<template id="cem-icon-link">
|
|
43
|
+
<attribute name="href"></attribute>
|
|
44
|
+
<attribute name="icon"></attribute>
|
|
45
|
+
<attribute aria-description="color appearance. Default value is 'normal'. Values: normal|primary|secondary|alert|blend"
|
|
46
|
+
name="kind"></attribute>
|
|
47
|
+
<style>
|
|
48
|
+
&:not([kind]) a, &[kind="normal"] a {
|
|
49
|
+
/*background-color: var(--mdc-theme-primary, #6200ee);*/
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
a {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 0.5rem;
|
|
56
|
+
padding: 0.5rem 1rem;;
|
|
57
|
+
border-radius: 1.5rem;
|
|
58
|
+
|
|
59
|
+
background-color: var(--cem-action-primary-background);
|
|
60
|
+
transition: var(--cem-action-transition);
|
|
61
|
+
box-shadow: var(--cem-action-box-shadow);
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
background-color: var(--cem-action-primary-background-hover);
|
|
65
|
+
box-shadow: var(--cem-action-box-shadow-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:focus {
|
|
69
|
+
background-color: var(--cem-action-primary-background-focus);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:active, &:focus:active {
|
|
73
|
+
background-color: var(--cem-action-primary-background-active);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&, &:visited {
|
|
77
|
+
text-decoration: none;
|
|
78
|
+
color: var(--mat-light-blue-900);
|
|
79
|
+
}
|
|
80
|
+
--icon-size: 2rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.icon {
|
|
84
|
+
font-size: var(--icon-size);
|
|
85
|
+
height: var(--icon-size);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
</style>
|
|
89
|
+
<a href="{$href}">
|
|
90
|
+
<choose>
|
|
91
|
+
<when test="contains($icon,'/')"><img alt="DCE logo" class="icon" src="{$icon}"/></when>
|
|
92
|
+
<when test="contains($icon,'fa-')"><i class="icon {$icon}"></i></when>
|
|
93
|
+
<when test="$icon"><span class="icon material-icons">{$icon}</span></when>
|
|
94
|
+
</choose>
|
|
95
|
+
<slot></slot>
|
|
96
|
+
</a>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<custom-element hidden src="#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
100
|
+
|
|
101
|
+
<header class="cem-theme-teal">
|
|
102
|
+
<custom-element src="../index.html#nav-head" ></custom-element>
|
|
103
|
+
</header>
|
|
104
|
+
<main>
|
|
105
|
+
<p><code>cem-icon-link</code> is button like component from <custom-element> Material suite based on the
|
|
106
|
+
<a href="https://material.io/components" >Material Design specification</a>.
|
|
107
|
+
</p>
|
|
108
|
+
<p>
|
|
109
|
+
<code>direction</code> attribute defines css <code>row</code> or <code>column</code> flex-direction.
|
|
110
|
+
</p>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<html-demo-element legend="Image from importmap module"
|
|
114
|
+
description="logo SVG with link to file in module">
|
|
115
|
+
<template>
|
|
116
|
+
<custom-element>
|
|
117
|
+
<template>
|
|
118
|
+
<module-url slice="cem-url" src="@epa-wg/material"></module-url>
|
|
119
|
+
<module-url slice="logo-url" src="@epa-wg/custom-element/demo/wc-square.svg"></module-url>
|
|
120
|
+
<cem-icon-link href="{//cem-url}/" icon="{//logo-url}"> custom-element</cem-icon-link>
|
|
121
|
+
<cem-icon-link icon="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/1.svg">
|
|
122
|
+
bulbasaur</cem-icon-link>
|
|
123
|
+
</template>
|
|
124
|
+
</custom-element>
|
|
125
|
+
</template>
|
|
126
|
+
</html-demo-element>
|
|
127
|
+
|
|
128
|
+
<html-demo-element legend="Google Material icon font" >
|
|
129
|
+
<p slot="description">
|
|
130
|
+
<a href="https://fonts.google.com/icons">Material Icon</a> example.
|
|
131
|
+
</p>
|
|
132
|
+
<template>
|
|
133
|
+
<cem-icon-link icon="recycling"> recycling</cem-icon-link>
|
|
134
|
+
<cem-icon-link icon="shopping_cart"> shopping_cart</cem-icon-link>
|
|
135
|
+
</template>
|
|
136
|
+
</html-demo-element>
|
|
137
|
+
|
|
138
|
+
<html-demo-element legend="Fontawesome" >
|
|
139
|
+
<p slot="description">
|
|
140
|
+
<a href="https://fontawesome.com/icons/">Fontawesome Icon</a> example.
|
|
141
|
+
</p>
|
|
142
|
+
<template>
|
|
143
|
+
<cem-icon-link icon="fab fa-github" > GitHub </cem-icon-link>
|
|
144
|
+
<cem-icon-link icon="fas fa-cloud-upload-alt" > Upload </cem-icon-link>
|
|
145
|
+
</template>
|
|
146
|
+
</html-demo-element>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
</main>
|
|
153
|
+
<footer>
|
|
154
|
+
<hr/>
|
|
155
|
+
Powered by Syngrafact Corp. ©2024.<br/>
|
|
156
|
+
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
157
|
+
</footer>
|
|
158
|
+
<script type="module" src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js"></script>
|
|
159
|
+
|
|
160
|
+
</body>
|
|
161
161
|
</html>
|