@epa-wg/custom-element-dist 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +2 -2
- package/README.md +4 -4
- package/coverage/coverage-final.json +21 -22
- package/coverage/index.html +19 -34
- 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 +491 -368
- package/coverage/src/custom-element/http-request.js.html +12 -12
- package/coverage/src/custom-element/index.html +19 -19
- 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 +11 -2
- package/coverage/src/stories/css.test.stories.ts.html +8 -2
- package/coverage/src/stories/dom-merge.test.stories.ts.html +3 -3
- package/coverage/src/stories/external-template.test.stories.ts.html +8 -2
- package/coverage/src/stories/form.test.stories.ts.html +8 -2
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +1 -1
- package/coverage/src/stories/local-storage.test.stories.ts.html +24 -18
- package/coverage/src/stories/location-element.test.stories.ts.html +8 -2
- package/coverage/src/stories/module-url.test.stories.ts.html +8 -2
- package/coverage/src/stories/set-url.test.stories.ts.html +8 -2
- package/coverage/src/stories/slice-events.test.stories.ts.html +8 -2
- package/coverage/src/stories/slots.test.stories.ts.html +8 -2
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/stories/version-select.test.stories.ts.html +8 -2
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-BOIPgtxz.js +565 -0
- package/dist/custom-element-CUsSENWc.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +22 -21
- package/dist/demo/a.svg +26 -26
- package/dist/demo/demo.css +0 -3
- package/dist/demo/s.xml +18 -3
- package/dist/demo/s.xslt +37 -54
- package/dist/demo/ss.html +24 -57
- package/package.json +13 -13
- package/public/demo/a.svg +26 -26
- package/public/demo/demo.css +0 -3
- package/public/demo/s.xml +18 -3
- package/public/demo/s.xslt +37 -54
- package/public/demo/ss.html +24 -57
- package/src/custom-element/custom-element.js +61 -20
- package/src/custom-element/demo/a.svg +26 -26
- package/src/custom-element/demo/demo.css +0 -3
- package/src/custom-element/demo/s.xml +18 -3
- package/src/custom-element/demo/s.xslt +37 -54
- package/src/custom-element/demo/ss.html +24 -57
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/dce-social-preview.png +0 -0
- package/src/material/angular.css +987 -0
- package/src/material/components/autocomplete.html +241 -0
- package/src/material/components/dropdown.html +115 -0
- package/src/material/components/icon-link.html +161 -0
- package/src/material/components/menu.html +235 -0
- package/src/material/components.html +121 -0
- package/src/material/demo.css +31 -0
- package/src/material/index.html +111 -0
- package/src/material/material.css +357 -0
- package/src/material/theme/README.md +18 -0
- package/src/material/theme/semantic.css +112 -0
- package/src/mocks/versions.mock.ts +8 -8
- package/src/stories/attributes.test.stories.ts +3 -0
- package/src/stories/css.test.stories.ts +2 -0
- package/src/stories/dom-merge.test.stories.ts +2 -2
- package/src/stories/external-template.test.stories.ts +2 -0
- package/src/stories/form.test.stories.ts +2 -0
- package/src/stories/local-storage.test.stories.ts +2 -0
- package/src/stories/location-element.test.stories.ts +2 -0
- package/src/stories/module-url.test.stories.ts +2 -0
- package/src/stories/set-url.test.stories.ts +2 -0
- package/src/stories/slice-events.test.stories.ts +2 -0
- package/src/stories/slots.test.stories.ts +2 -0
- package/src/stories/version-select.test.stories.ts +2 -0
- package/storybook-static/assets/Color-ERTF36HU-CQkSD2nd.js +1 -0
- package/storybook-static/assets/Configure-DOhzHFEs.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-BSJkbsd6.js +2 -0
- package/storybook-static/assets/{attributes.test.stories-Bt5V18qO.js → attributes.test.stories-BJBuuXgZ.js} +4 -4
- package/storybook-static/assets/{css.test.stories-CGYy2daE.js → css.test.stories-pgbBc17d.js} +1 -1
- package/storybook-static/assets/custom-element-BDGsYgbP.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-XlsZ0UvX.js → dom-merge.test.stories-CXcYP_-J.js} +5 -5
- package/storybook-static/assets/entry-preview-C313OLrj.js +26 -0
- package/storybook-static/assets/{entry-preview-docs-BMKNVQXA.js → entry-preview-docs-B7ORr9w5.js} +2 -2
- package/storybook-static/assets/{external-template.test.stories-Bt_Pflu8.js → external-template.test.stories-CpJ68Ghy.js} +13 -13
- package/storybook-static/assets/{form.test.stories-B0NoI8wm.js → form.test.stories-D35lyqd8.js} +2 -2
- package/storybook-static/assets/{handlers-B5969HUu.js → handlers-CW9pDZnt.js} +6 -6
- package/storybook-static/assets/{http-request.stories-B2skuTFV.js → http-request.stories-CBbknCOO.js} +6 -6
- package/storybook-static/assets/iframe-DOi4N7qI.js +2 -0
- package/storybook-static/assets/{index-C7lvoJNv.js → index-B3QjF0Ed.js} +1 -1
- package/storybook-static/assets/index-BSz1w4Gl.js +234 -0
- package/storybook-static/assets/index-BdcJ-iJ7.js +8 -0
- package/storybook-static/assets/index-CaL3Qp7t.js +634 -0
- package/storybook-static/assets/index-DgFM0Ce3.js +1 -0
- package/storybook-static/assets/index-YxUFxnQR.js +1 -0
- package/storybook-static/assets/{local-storage.test.stories-DfY6feqG.js → local-storage.test.stories-BY-PWhuk.js} +5 -5
- package/storybook-static/assets/{location-element.test.stories-944AotIJ.js → location-element.test.stories-3auBYEaU.js} +3 -3
- package/storybook-static/assets/{module-url.test.stories-DSKcwApl.js → module-url.test.stories-B7L9cL60.js} +6 -6
- package/storybook-static/assets/{preview-0Jj89qip.js → preview-BRPR-UXC.js} +1 -1
- package/storybook-static/assets/{preview-DB9FwMii.js → preview-BWzBA1C2.js} +1 -1
- package/storybook-static/assets/preview-BhhEZcNS.js +1 -0
- package/storybook-static/assets/{preview-CadgX-4y.js → preview-C992A1Y-.js} +2 -2
- package/storybook-static/assets/preview-CcS4DQh8.js +1 -0
- package/storybook-static/assets/{preview-AJR7rVPD.js → preview-CfWMRsRq.js} +1 -1
- package/storybook-static/assets/{preview-FpHGYA1q.js → preview-DHPc-V4N.js} +1 -1
- package/storybook-static/assets/preview-DYzi3Z2p.js +1 -0
- package/storybook-static/assets/{preview-4Up_z4Em.js → preview-caVMbCIR.js} +2 -2
- package/storybook-static/assets/preview-ncvtW_hb.js +34 -0
- package/storybook-static/assets/{set-url.test.stories-DjLHKkEh.js → set-url.test.stories-CuSuDLIx.js} +3 -3
- package/storybook-static/assets/{slice-events.test.stories-8I_BrHd6.js → slice-events.test.stories-BkRKsKem.js} +4 -4
- package/storybook-static/assets/{slots.test.stories-CvZz4jyP.js → slots.test.stories-BJCUWFkE.js} +8 -8
- package/storybook-static/assets/{version-select.test.stories-DSxmJylI.js → version-select.test.stories-B3ybJn_Z.js} +2 -2
- package/storybook-static/demo/a.svg +26 -26
- package/storybook-static/demo/demo.css +0 -3
- package/storybook-static/demo/s.xml +18 -3
- package/storybook-static/demo/s.xslt +37 -54
- package/storybook-static/demo/ss.html +24 -57
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +3 -7
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +9 -9
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +76 -94
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +211 -0
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +11 -0
- package/storybook-static/sb-manager/globals-runtime.js +27803 -26928
- package/storybook-static/sb-manager/runtime.js +10341 -10136
- package/storybook-static/sb-preview/runtime.js +3841 -3828
- package/.idea/custom-element-dist.iml +0 -9
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/coverage/src/custom-element/demo/coverage.svg +0 -10
- package/coverage/src/custom-element/demo/index.html +0 -116
- package/coverage/src/custom-element/demo/z.js/coverage.svg +0 -10
- package/coverage/src/custom-element/demo/z.js.html +0 -112
- package/dist/custom-element-BMMsP1Dy.js +0 -533
- package/dist/custom-element-CPSk7s0j.cjs +0 -87
- package/dist/demo/s1.xslt +0 -60
- package/dist/demo/z.html +0 -33
- package/dist/demo/z.js +0 -9
- package/dist/demo/z.xml +0 -60
- package/dist/demo/z1.html +0 -34
- package/public/demo/s1.xslt +0 -60
- package/public/demo/z.html +0 -33
- package/public/demo/z.js +0 -9
- package/public/demo/z.xml +0 -60
- package/public/demo/z1.html +0 -34
- package/src/custom-element/demo/s1.xslt +0 -60
- package/src/custom-element/demo/z.html +0 -33
- package/src/custom-element/demo/z.js +0 -9
- package/src/custom-element/demo/z.xml +0 -60
- package/src/custom-element/demo/z1.html +0 -34
- package/storybook-static/assets/Color-KGDBMAHA-CJo5gHY3.js +0 -1
- package/storybook-static/assets/Configure-DdXbGKhY.js +0 -173
- package/storybook-static/assets/DocsRenderer-PKQXORMH-DLnpL5hE.js +0 -2
- package/storybook-static/assets/custom-element-D8hcDZHh.js +0 -265
- package/storybook-static/assets/entry-preview-BKQ8UCxI.js +0 -8
- package/storybook-static/assets/iframe-Dfrt81rk.js +0 -2
- package/storybook-static/assets/index-Ay195x2L.js +0 -605
- package/storybook-static/assets/index-C3ChPTMh.js +0 -1
- package/storybook-static/assets/index-C8k3Z-3Y.js +0 -28
- package/storybook-static/assets/index-DGdNYaqV.js +0 -8
- package/storybook-static/assets/index-Gpdhz4ab.js +0 -1
- package/storybook-static/assets/lit-element-DzhCn-8W.js +0 -19
- package/storybook-static/assets/preview-BJPLiuSt.js +0 -1
- package/storybook-static/assets/preview-BMWqy4Bi.js +0 -1
- package/storybook-static/assets/preview-BnWGZYux.js +0 -1
- package/storybook-static/assets/preview-Djh1_Tal.js +0 -20
- package/storybook-static/demo/s1.xslt +0 -60
- package/storybook-static/demo/z.html +0 -33
- package/storybook-static/demo/z.js +0 -9
- package/storybook-static/demo/z.xml +0 -60
- package/storybook-static/demo/z1.html +0 -34
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +0 -336
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +0 -77
- package/storybook-static/sb-addons/interactions-10/manager-bundle.js +0 -234
- /package/{storybook-static/sb-addons/interactions-10/manager-bundle.js.LEGAL.txt → src/material/guide/getting-started/index.html} +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
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{flex:1; width: 100%; }
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
</head>
|
|
35
|
+
|
|
36
|
+
<body>
|
|
37
|
+
<custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<header class="cem-theme-teal">
|
|
41
|
+
<custom-element src="../index.html#nav-head" ></custom-element>
|
|
42
|
+
</header>
|
|
43
|
+
<main>
|
|
44
|
+
<p><code>cem-autocomplete</code> is autocomplete component from <custom-element> Material suite based on the
|
|
45
|
+
<a href="https://material.io/components" >Material Design specification</a>.
|
|
46
|
+
</p>
|
|
47
|
+
<custom-element tag="cem-autocomplete" hidden>
|
|
48
|
+
<template>
|
|
49
|
+
<attribute name="name"></attribute>
|
|
50
|
+
<attribute name="label"></attribute>
|
|
51
|
+
<attribute name="placeholder"></attribute>
|
|
52
|
+
<attribute name="type">search</attribute>
|
|
53
|
+
<attribute name="value"></attribute>
|
|
54
|
+
<style>
|
|
55
|
+
dce-root
|
|
56
|
+
{ position: relative;
|
|
57
|
+
display: flex; flex-direction: column; justify-content: center;
|
|
58
|
+
--drop-transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
59
|
+
--input-padding: 0;
|
|
60
|
+
|
|
61
|
+
--cem-input-outline: inset 0 -1px 0 black;
|
|
62
|
+
--cem-input-outline-focus: inset 0 -3px 0 var(--cem-outline-color-focus);
|
|
63
|
+
--cem-autocomplete-container-shape: 0.25rem;
|
|
64
|
+
--cem-autocomplete-background-color: var(--cem-list-background-color);
|
|
65
|
+
--cem-autocomplete-container-elevation-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);
|
|
66
|
+
|
|
67
|
+
background-color: var(--cem-filled-text-field-container-color, var(--cem-app-surface-variant));
|
|
68
|
+
|
|
69
|
+
min-height: 3.5rem;
|
|
70
|
+
|
|
71
|
+
& > fieldset,
|
|
72
|
+
& > fieldset[focus-within="0"]{display: none;}
|
|
73
|
+
|
|
74
|
+
& > fieldset[focus-within="1"],
|
|
75
|
+
& > fieldset[focus-within="2"]{ display: flex; max-height: 10rem; height: auto; overflow: auto; transition: var(--drop-transition) }
|
|
76
|
+
|
|
77
|
+
fieldset
|
|
78
|
+
{ position: absolute;
|
|
79
|
+
left: 0; right: 0; top:100%;
|
|
80
|
+
flex-direction: column; border: red; max-height: 0;
|
|
81
|
+
transition: var(--drop-transition);
|
|
82
|
+
overflow: hidden; padding: 0;
|
|
83
|
+
|
|
84
|
+
border-radius: var(--cem-autocomplete-container-shape);
|
|
85
|
+
border-top-left-radius: 0;
|
|
86
|
+
border-top-right-radius: 0;
|
|
87
|
+
box-shadow: var(--cem-autocomplete-container-elevation-shadow);
|
|
88
|
+
background-color: var(--cem-autocomplete-background-color );
|
|
89
|
+
|
|
90
|
+
transition-delay: 40ms;
|
|
91
|
+
transition-duration: 110ms;
|
|
92
|
+
|
|
93
|
+
label{ padding: 0.5rem;
|
|
94
|
+
&:hover{ background-color: var(--cem-list-background-color-hover);}
|
|
95
|
+
&:focus-within{ background-color: var(--cem-list-background-color-focus);}
|
|
96
|
+
input{ width: 0; overflow: hidden; display: inline-block; }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
&>label
|
|
100
|
+
{ display: flex; flex-direction: column; justify-content: center;
|
|
101
|
+
flex: 1; padding: 0.5rem 1rem;
|
|
102
|
+
box-shadow: var(--cem-input-outline);
|
|
103
|
+
transition: var(--drop-transition);
|
|
104
|
+
color: var(--cem-filled-text-field-label-text-color);
|
|
105
|
+
|
|
106
|
+
input
|
|
107
|
+
{ background: none; padding: var(--input-padding);
|
|
108
|
+
&,&:focus,&:focus-visible{ border: none; outline: none; }
|
|
109
|
+
&:placeholder-shown{ border: none; outline:none; }
|
|
110
|
+
&[value=""]{ height: 0; }
|
|
111
|
+
&:focus,&:focus-visible,&[placeholder*=""]{ height: auto; }
|
|
112
|
+
|
|
113
|
+
color: var(--cem-filled-text-field-input-text-color, var(--cem-app-on-surface));
|
|
114
|
+
caret-color: var(--cem-filled-text-field-caret-color, var(--cem-app-primary));
|
|
115
|
+
font-size: 1rem;
|
|
116
|
+
transition: var(--drop-transition);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
&:focus-within
|
|
120
|
+
{
|
|
121
|
+
&> label
|
|
122
|
+
{ box-shadow: var(--cem-input-outline-focus);
|
|
123
|
+
font-size: small; justify-content: space-between;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
label:has( input:not([value=""]) ){ font-size: small; justify-content: space-between;}
|
|
127
|
+
slice{display: none;}
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
130
|
+
<!-- <pre>-->
|
|
131
|
+
<!-- //focused {//focused}-->
|
|
132
|
+
<!-- //suggest {//suggest}-->
|
|
133
|
+
<!-- //selected {//selected}-->
|
|
134
|
+
<!-- </pre>-->
|
|
135
|
+
<slot name="input"><label>{$label}<xhtml:input
|
|
136
|
+
name="{$name}"
|
|
137
|
+
type="{$type}"
|
|
138
|
+
placeholder="{$placeholder}"
|
|
139
|
+
value="{//selected ?? $value}"
|
|
140
|
+
slice="selected" slice-event="input"
|
|
141
|
+
>
|
|
142
|
+
<slice name="focused" slice-event="blur" slice-value="0"></slice>
|
|
143
|
+
<slice name="focused" slice-event="focus" slice-value="1"></slice>
|
|
144
|
+
<slice name="filter" slice-event="blur input" slice-value="//selected"></slice>
|
|
145
|
+
</xhtml:input></label></slot>
|
|
146
|
+
<fieldset form="cem-autocomplete-form" >
|
|
147
|
+
<attribute name="focus-within">{//focused}</attribute>
|
|
148
|
+
<xsl:for-each select="/datadom/payload/*[normalize-space(text()) != '']">
|
|
149
|
+
<if test="normalize-space(//selected) = '' or contains(@value, //filter)">
|
|
150
|
+
<label value="{@value ?? .}"
|
|
151
|
+
><xhtml:input type="radio" value="{@value ?? .}" name="cem-autocomplete" slice="selected" slice-event="input">
|
|
152
|
+
<slice name="focused" slice-event="blur" slice-value="0"></slice>
|
|
153
|
+
<slice name="focused" slice-event="focus" slice-value="2"></slice>
|
|
154
|
+
</xhtml:input>
|
|
155
|
+
{.}</label>
|
|
156
|
+
</if>
|
|
157
|
+
</xsl:for-each>
|
|
158
|
+
</fieldset>
|
|
159
|
+
</template>
|
|
160
|
+
</custom-element>
|
|
161
|
+
|
|
162
|
+
<html-demo-element legend="No value" description="Focus to see the cursor in input with label shifted upward ">
|
|
163
|
+
<template>
|
|
164
|
+
<cem-autocomplete label="String field" ></cem-autocomplete>
|
|
165
|
+
</template>
|
|
166
|
+
</html-demo-element>
|
|
167
|
+
|
|
168
|
+
<html-demo-element legend="No value with placeholder" description="focus to see the placeholder text">
|
|
169
|
+
<template>
|
|
170
|
+
<cem-autocomplete label="Number" type="number" placeholder="Enter the numeric value"></cem-autocomplete>
|
|
171
|
+
</template>
|
|
172
|
+
</html-demo-element>
|
|
173
|
+
|
|
174
|
+
<html-demo-element legend="Value defined" description="The value should be visible" >
|
|
175
|
+
<template>
|
|
176
|
+
<cem-autocomplete label="Text" type="text" value="abc"></cem-autocomplete>
|
|
177
|
+
</template>
|
|
178
|
+
</html-demo-element>
|
|
179
|
+
|
|
180
|
+
<html-demo-element legend="No initial value with placeholder" >
|
|
181
|
+
<div slot="description"><code>data value="xxx</code> for selection item uses <code>data</code> attribute for value </div>
|
|
182
|
+
<template>
|
|
183
|
+
<cem-autocomplete label="Fruits and berries" type="text" placeholder="Enter the fruit name">
|
|
184
|
+
<data value="apple" > 🍎 Apple </data>
|
|
185
|
+
<data value="strawberry" > 🍓 Strawberry </data>
|
|
186
|
+
<data value="pineapple" > 🍍 Pineapple </data>
|
|
187
|
+
</cem-autocomplete>
|
|
188
|
+
</template>
|
|
189
|
+
</html-demo-element>
|
|
190
|
+
|
|
191
|
+
<html-demo-element legend="Number, No initial value without placeholder" description="label takes the space till input is focused" >
|
|
192
|
+
<template>
|
|
193
|
+
<cem-autocomplete label="Number" type="number" >
|
|
194
|
+
<data value="1">One </data>
|
|
195
|
+
<data value="2">Two </data>
|
|
196
|
+
<data value="3">Three </data>
|
|
197
|
+
</cem-autocomplete>
|
|
198
|
+
</template>
|
|
199
|
+
</html-demo-element>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<html-demo-element legend="Options text as value" description="The value is same as text" >
|
|
203
|
+
<template>
|
|
204
|
+
<cem-autocomplete label="Dinosaur" type="text" >
|
|
205
|
+
<option>Tyrannosaurus </option>
|
|
206
|
+
<option>Sauropod </option>
|
|
207
|
+
<option>Velociraptor </option>
|
|
208
|
+
</cem-autocomplete>
|
|
209
|
+
</template>
|
|
210
|
+
</html-demo-element>
|
|
211
|
+
|
|
212
|
+
<html-demo-element legend="Options Grouping" description="filter within eac group, empty groups are hidden" >
|
|
213
|
+
<template>
|
|
214
|
+
<cem-autocomplete label="Number" type="text" >
|
|
215
|
+
<optgroup label="🦖 Theropods">
|
|
216
|
+
<option>Tyrannosaurus </option>
|
|
217
|
+
<option>Sauropod </option>
|
|
218
|
+
<option>Velociraptor </option>
|
|
219
|
+
<option>Deinonychus </option>
|
|
220
|
+
</optgroup>
|
|
221
|
+
<optgroup label="🦕 Sauropods">
|
|
222
|
+
<option>Diplodocus </option>
|
|
223
|
+
<option>Saltasaurus </option>
|
|
224
|
+
<option>Apatosaurus </option>
|
|
225
|
+
</optgroup>
|
|
226
|
+
</cem-autocomplete>
|
|
227
|
+
</template>
|
|
228
|
+
</html-demo-element>
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
</main>
|
|
232
|
+
<footer>
|
|
233
|
+
<hr/>
|
|
234
|
+
Powered by Syngrafact Corp. ©2024.<br/>
|
|
235
|
+
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
236
|
+
</footer>
|
|
237
|
+
<!--<script type="module" src="./html-demo-element.js"></script>-->
|
|
238
|
+
<script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
|
|
239
|
+
|
|
240
|
+
</body>
|
|
241
|
+
</html>
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
<custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
43
|
+
|
|
44
|
+
<header class="cem-theme-teal">
|
|
45
|
+
<custom-element src="../index.html#nav-head" ></custom-element>
|
|
46
|
+
</header>
|
|
47
|
+
<main>
|
|
48
|
+
<p><code>cem-dropdown</code> is autocomplete component from <custom-element> Material suite based on the
|
|
49
|
+
<a href="https://material.io/components" >Material Design specification</a>.
|
|
50
|
+
</p>
|
|
51
|
+
<custom-element tag="cem-dropdown" hidden>
|
|
52
|
+
<template>
|
|
53
|
+
<attribute name="open"></attribute>
|
|
54
|
+
<attribute name="label"></attribute>
|
|
55
|
+
<style>
|
|
56
|
+
dce-root
|
|
57
|
+
{ position: relative;
|
|
58
|
+
|
|
59
|
+
--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);
|
|
60
|
+
|
|
61
|
+
&>aside
|
|
62
|
+
{ position: absolute;
|
|
63
|
+
left: 0; right: 0; top:100%;
|
|
64
|
+
transition: var(--drop-transition);
|
|
65
|
+
|
|
66
|
+
border-radius: var(--cem-autocomplete-container-shape);
|
|
67
|
+
border-top-left-radius: 0;
|
|
68
|
+
border-top-right-radius: 0;
|
|
69
|
+
box-shadow: var(--cem-dropdown-shadow);
|
|
70
|
+
|
|
71
|
+
transition-delay: 40ms;
|
|
72
|
+
transition-duration: 110ms;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
76
|
+
<pre>
|
|
77
|
+
//focused {//focused}
|
|
78
|
+
//suggest {//suggest}
|
|
79
|
+
//selected {//selected}
|
|
80
|
+
</pre>
|
|
81
|
+
<slot name="base"><label>{$label}</label></slot>
|
|
82
|
+
<aside><slot name=""></slot></aside>
|
|
83
|
+
</template>
|
|
84
|
+
</custom-element>
|
|
85
|
+
|
|
86
|
+
<html-demo-element legend="No value" description="Focus to see the cursor in input with label shifted upward ">
|
|
87
|
+
<template>
|
|
88
|
+
<cem-dropdown label="Hi" open="true">
|
|
89
|
+
<template>
|
|
90
|
+
<style>
|
|
91
|
+
label{ min-width: 5rem; }
|
|
92
|
+
menu{ padding: 1rem; display: flex; flex-direction: column; min-width: 12rem;}
|
|
93
|
+
</style>
|
|
94
|
+
<menu>
|
|
95
|
+
<a href="#">link 1</a>
|
|
96
|
+
<a href="#">link 2</a>
|
|
97
|
+
<a href="#">link 3</a>
|
|
98
|
+
</menu>
|
|
99
|
+
</template>
|
|
100
|
+
</cem-dropdown>
|
|
101
|
+
</template>
|
|
102
|
+
</html-demo-element>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
</main>
|
|
107
|
+
<footer>
|
|
108
|
+
<hr/>
|
|
109
|
+
Powered by Syngrafact Corp. ©2024.<br/>
|
|
110
|
+
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
111
|
+
</footer>
|
|
112
|
+
<script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
|
|
113
|
+
|
|
114
|
+
</body>
|
|
115
|
+
</html>
|
|
@@ -0,0 +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>
|
|
161
|
+
</html>
|