@epa-wg/custom-element-dist 0.0.29 → 0.0.31
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 +24 -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 +24 -24
- 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 +247 -241
- package/coverage/src/custom-element/http-request.js.html +3 -3
- package/coverage/src/custom-element/index.html +14 -14
- 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.html +28 -28
- 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 +1 -1
- 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 +19 -19
- 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 +7 -7
- package/coverage/src/stories/version-select.test.stories.ts.html +1 -1
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-BbJMY20-.cjs +97 -0
- package/dist/{custom-element-BOIPgtxz.js → custom-element-CoRNKeEP.js} +122 -120
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +2 -2
- package/dist/demo/a.svg +26 -26
- package/dist/demo/data-slices.html +37 -0
- package/package.json +13 -13
- package/public/demo/a.svg +26 -26
- package/public/demo/data-slices.html +37 -0
- package/src/custom-element/custom-element.js +4 -2
- package/src/custom-element/demo/a.svg +26 -26
- package/src/custom-element/demo/data-slices.html +37 -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/material/angular.css +987 -987
- package/src/material/components/autocomplete.html +239 -240
- package/src/material/components/dropdown.html +92 -45
- package/src/material/components/icon-link.html +160 -160
- 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 +20 -20
- 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-CFyd3TND.js +1 -0
- package/storybook-static/assets/{Configure-DOhzHFEs.js → Configure-UGTbPRKK.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-BSJkbsd6.js → DocsRenderer-CFRXHY34-Dpr5iB0o.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-BJBuuXgZ.js → attributes.test.stories-DSOLHHOW.js} +38 -36
- package/storybook-static/assets/{css.test.stories-pgbBc17d.js → css.test.stories-Cgn6ICr0.js} +1 -1
- package/storybook-static/assets/custom-element-D59Fok1f.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-CXcYP_-J.js → dom-merge.test.stories-CBObfPWg.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-VfKUQ8eu.js} +1 -1
- package/storybook-static/assets/{form.test.stories-D35lyqd8.js → form.test.stories-CnuGN7Zw.js} +1 -1
- package/storybook-static/assets/{handlers-CW9pDZnt.js → handlers-V_T7WjNK.js} +21 -21
- package/storybook-static/assets/{http-request.stories-CBbknCOO.js → http-request.stories-8NN1Coqm.js} +1 -1
- package/storybook-static/assets/iframe-DnhkgdtG.js +2 -0
- package/storybook-static/assets/index-3Sfy-t3H.js +769 -0
- package/storybook-static/assets/index-BcZLpTeD.js +8 -0
- package/storybook-static/assets/index-CIBI7sCB.js +1 -0
- package/storybook-static/assets/{index-BSz1w4Gl.js → index-CxRwF5Or.js} +130 -130
- package/storybook-static/assets/{index-YxUFxnQR.js → index-DN1RoK17.js} +1 -1
- package/storybook-static/assets/{index-B3QjF0Ed.js → index-DjJD7gkO.js} +1 -1
- package/storybook-static/assets/{local-storage.test.stories-BY-PWhuk.js → local-storage.test.stories-Dk5Yqc7m.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-3auBYEaU.js → location-element.test.stories-56um6s5L.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-B7L9cL60.js → module-url.test.stories-DEponQ7l.js} +1 -1
- package/storybook-static/assets/{preview-BRPR-UXC.js → preview-CNKoaWES.js} +1 -1
- package/storybook-static/assets/preview-Czc-sw5H.js +2 -0
- package/storybook-static/assets/preview-DAeyCMnM.js +1 -0
- package/storybook-static/assets/{preview-CfWMRsRq.js → preview-vbpHsp94.js} +2 -2
- package/storybook-static/assets/{set-url.test.stories-CuSuDLIx.js → set-url.test.stories-B4E6hIe-.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BkRKsKem.js → slice-events.test.stories-BR0F-B6I.js} +138 -13
- package/storybook-static/assets/{slots.test.stories-BJCUWFkE.js → slots.test.stories-CgfJIyCr.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-nmxATIwv.js} +1 -1
- package/storybook-static/demo/a.svg +26 -26
- package/storybook-static/demo/data-slices.html +37 -0
- 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-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/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,36 @@
|
|
|
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
|
+
}
|
|
36
56
|
}
|
|
37
57
|
}
|
|
38
58
|
</style>
|
|
@@ -40,67 +60,94 @@
|
|
|
40
60
|
|
|
41
61
|
<body>
|
|
42
62
|
<custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
63
|
+
<custom-element hidden src="./menu.html#cem-menu" tag="cem-menu"></custom-element>
|
|
43
64
|
|
|
44
65
|
<header class="cem-theme-teal">
|
|
45
|
-
<custom-element src="../index.html#nav-head"
|
|
66
|
+
<custom-element src="../index.html#nav-head"></custom-element>
|
|
46
67
|
</header>
|
|
47
68
|
<main>
|
|
48
69
|
<p><code>cem-dropdown</code> is autocomplete component from <custom-element> Material suite based on the
|
|
49
|
-
<a href="https://material.io/components"
|
|
70
|
+
<a href="https://material.io/components">Material Design specification</a>.
|
|
50
71
|
</p>
|
|
51
|
-
<custom-element tag="cem-dropdown"
|
|
52
|
-
<template>
|
|
72
|
+
<custom-element hidden tag="cem-dropdown">
|
|
73
|
+
<template id="cem-dropdown">
|
|
53
74
|
<attribute name="open"></attribute>
|
|
54
75
|
<attribute name="label"></attribute>
|
|
55
76
|
<style>
|
|
56
|
-
dce-root
|
|
57
|
-
|
|
77
|
+
dce-root {
|
|
78
|
+
position: relative;
|
|
58
79
|
|
|
59
80
|
--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);
|
|
81
|
+
--cem-dropdown-max-height: 10rem;
|
|
82
|
+
--cem-dropdown-base-min-width: 8em;
|
|
60
83
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
84
|
+
&[open="false"]{
|
|
85
|
+
&>aside{ max-height: 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
& > label {
|
|
89
|
+
min-width: var(--cem-dropdown-base-min-width);
|
|
90
|
+
display: inline-block;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& > aside {
|
|
94
|
+
position: absolute;
|
|
95
|
+
left: 0;
|
|
96
|
+
top: 100%;
|
|
97
|
+
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
max-height: var(--cem-dropdown-max-height);
|
|
100
|
+
transition: var(--cem-drop-transition);
|
|
101
|
+
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
65
104
|
|
|
66
105
|
border-radius: var(--cem-autocomplete-container-shape);
|
|
67
106
|
border-top-left-radius: 0;
|
|
68
107
|
border-top-right-radius: 0;
|
|
69
108
|
box-shadow: var(--cem-dropdown-shadow);
|
|
70
|
-
|
|
71
|
-
transition-delay: 40ms;
|
|
72
|
-
transition-duration: 110ms;
|
|
73
109
|
}
|
|
74
110
|
}
|
|
75
111
|
</style>
|
|
76
|
-
<pre>
|
|
77
|
-
//focused {//focused}
|
|
78
|
-
//suggest {//suggest}
|
|
79
|
-
//selected {//selected}
|
|
80
|
-
</pre>
|
|
81
112
|
<slot name="base"><label>{$label}</label></slot>
|
|
82
|
-
<aside
|
|
113
|
+
<aside>
|
|
114
|
+
<slot name=""></slot>
|
|
115
|
+
</aside>
|
|
83
116
|
</template>
|
|
84
117
|
</custom-element>
|
|
85
118
|
|
|
86
|
-
<html-demo-element
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
<a href="#">link 2</a>
|
|
97
|
-
<a href="#">link 3</a>
|
|
98
|
-
</menu>
|
|
99
|
-
</template>
|
|
119
|
+
<html-demo-element
|
|
120
|
+
legend="Menu in dropdown"
|
|
121
|
+
description="Focus to see the cursor in input with label shifted upward" >
|
|
122
|
+
<template>
|
|
123
|
+
<cem-dropdown label="Vertical menu" open="true">
|
|
124
|
+
<cem-menu direction="column">
|
|
125
|
+
<a href="#">link 1</a>
|
|
126
|
+
<a href="#">link 2</a>
|
|
127
|
+
<a href="#">link 3</a>
|
|
128
|
+
</cem-menu>
|
|
100
129
|
</cem-dropdown>
|
|
101
|
-
|
|
102
|
-
</html-demo-element>
|
|
130
|
+
</template>
|
|
131
|
+
</html-demo-element>
|
|
132
|
+
|
|
133
|
+
<html-demo-element description="Focus to see the cursor in input with label shifted upward "
|
|
134
|
+
legend="Collapsing by slice">
|
|
135
|
+
<template>
|
|
136
|
+
<custom-element>
|
|
137
|
+
<template>
|
|
138
|
+
<label><input slice="opened" type="checkbox" value="1"/> open</label><br/>
|
|
103
139
|
|
|
140
|
+
<cem-dropdown label="Vertical menu" open="{//opened='1'}">
|
|
141
|
+
<cem-menu direction="column">
|
|
142
|
+
<a href="#">link 1</a>
|
|
143
|
+
<a href="#">link 2</a>
|
|
144
|
+
<a href="#">link 3</a>
|
|
145
|
+
</cem-menu>
|
|
146
|
+
</cem-dropdown>
|
|
147
|
+
</template>
|
|
148
|
+
</custom-element>
|
|
149
|
+
</template>
|
|
150
|
+
</html-demo-element>
|
|
104
151
|
|
|
105
152
|
|
|
106
153
|
</main>
|
|
@@ -109,7 +156,7 @@
|
|
|
109
156
|
Powered by Syngrafact Corp. ©2024.<br/>
|
|
110
157
|
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
111
158
|
</footer>
|
|
112
|
-
<script
|
|
159
|
+
<script src="https://unpkg.com/html-demo-element@1/html-demo-element.js" type="module"></script>
|
|
113
160
|
|
|
114
161
|
</body>
|
|
115
162
|
</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>
|