@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,241 +1,240 @@
|
|
|
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
|
-
--
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
--cem-input-outline: inset 0 -
|
|
62
|
-
--cem-
|
|
63
|
-
--cem-autocomplete-
|
|
64
|
-
--cem-autocomplete-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
& > fieldset
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
& > fieldset[focus-within="
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
border-radius:
|
|
85
|
-
border-top-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
transition-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
&:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
input
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
color: var(--cem-filled-text-field-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<!--
|
|
131
|
-
<!-- //
|
|
132
|
-
<!-- //
|
|
133
|
-
<!--
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
>
|
|
142
|
-
<slice name="focused" slice-event="
|
|
143
|
-
<slice name="
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<slice name="focused" slice-event="
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
<
|
|
184
|
-
<data value="
|
|
185
|
-
<data value="
|
|
186
|
-
|
|
187
|
-
</
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
<
|
|
194
|
-
<data value="
|
|
195
|
-
<data value="
|
|
196
|
-
|
|
197
|
-
</
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
<
|
|
205
|
-
<option>
|
|
206
|
-
<option>
|
|
207
|
-
|
|
208
|
-
</
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
<option>
|
|
217
|
-
<option>
|
|
218
|
-
<option>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
<option>
|
|
223
|
-
<option>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
</
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</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{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
|
+
--input-padding: 0;
|
|
59
|
+
|
|
60
|
+
--cem-input-outline: inset 0 -1px 0 black;
|
|
61
|
+
--cem-input-outline-focus: inset 0 -3px 0 var(--cem-outline-color-focus);
|
|
62
|
+
--cem-autocomplete-container-shape: 0.25rem;
|
|
63
|
+
--cem-autocomplete-background-color: var(--cem-list-background-color);
|
|
64
|
+
--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);
|
|
65
|
+
|
|
66
|
+
background-color: var(--cem-filled-text-field-container-color, var(--cem-app-surface-variant));
|
|
67
|
+
|
|
68
|
+
min-height: 3.5rem;
|
|
69
|
+
|
|
70
|
+
& > fieldset,
|
|
71
|
+
& > fieldset[focus-within="0"]{display: none;}
|
|
72
|
+
|
|
73
|
+
& > fieldset[focus-within="1"],
|
|
74
|
+
& > fieldset[focus-within="2"]{ display: flex; max-height: 10rem; height: auto; overflow: auto; transition: var(--cem-drop-transition) }
|
|
75
|
+
|
|
76
|
+
fieldset
|
|
77
|
+
{ position: absolute;
|
|
78
|
+
left: 0; right: 0; top:100%;
|
|
79
|
+
flex-direction: column; border: red; max-height: 0;
|
|
80
|
+
transition: var(--cem-drop-transition);
|
|
81
|
+
overflow: hidden; padding: 0;
|
|
82
|
+
|
|
83
|
+
border-radius: var(--cem-autocomplete-container-shape);
|
|
84
|
+
border-top-left-radius: 0;
|
|
85
|
+
border-top-right-radius: 0;
|
|
86
|
+
box-shadow: var(--cem-autocomplete-container-elevation-shadow);
|
|
87
|
+
background-color: var(--cem-autocomplete-background-color );
|
|
88
|
+
|
|
89
|
+
transition-delay: 40ms;
|
|
90
|
+
transition-duration: 110ms;
|
|
91
|
+
|
|
92
|
+
label{ padding: 0.5rem;
|
|
93
|
+
&:hover{ background-color: var(--cem-list-background-color-hover);}
|
|
94
|
+
&:focus-within{ background-color: var(--cem-list-background-color-focus);}
|
|
95
|
+
input{ width: 0; overflow: hidden; display: inline-block; }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
&>label
|
|
99
|
+
{ display: flex; flex-direction: column; justify-content: center;
|
|
100
|
+
flex: 1; padding: 0.5rem 1rem;
|
|
101
|
+
box-shadow: var(--cem-input-outline);
|
|
102
|
+
transition: var(--drop-transition);
|
|
103
|
+
color: var(--cem-filled-text-field-label-text-color);
|
|
104
|
+
|
|
105
|
+
input
|
|
106
|
+
{ background: none; padding: var(--input-padding);
|
|
107
|
+
&,&:focus,&:focus-visible{ border: none; outline: none; }
|
|
108
|
+
&:placeholder-shown{ border: none; outline:none; }
|
|
109
|
+
&[value=""]{ height: 0; }
|
|
110
|
+
&:focus,&:focus-visible,&[placeholder*=""]{ height: auto; }
|
|
111
|
+
|
|
112
|
+
color: var(--cem-filled-text-field-input-text-color, var(--cem-app-on-surface));
|
|
113
|
+
caret-color: var(--cem-filled-text-field-caret-color, var(--cem-app-primary));
|
|
114
|
+
font-size: 1rem;
|
|
115
|
+
transition: var(--drop-transition);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
&:focus-within
|
|
119
|
+
{
|
|
120
|
+
&> label
|
|
121
|
+
{ box-shadow: var(--cem-input-outline-focus);
|
|
122
|
+
font-size: small; justify-content: space-between;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
label:has( input:not([value=""]) ){ font-size: small; justify-content: space-between;}
|
|
126
|
+
slice{display: none;}
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
129
|
+
<!-- <pre>-->
|
|
130
|
+
<!-- //focused {//focused}-->
|
|
131
|
+
<!-- //suggest {//suggest}-->
|
|
132
|
+
<!-- //selected {//selected}-->
|
|
133
|
+
<!-- </pre>-->
|
|
134
|
+
<slot name="input"><label>{$label}<xhtml:input
|
|
135
|
+
name="{$name}"
|
|
136
|
+
type="{$type}"
|
|
137
|
+
placeholder="{$placeholder}"
|
|
138
|
+
value="{//selected ?? $value}"
|
|
139
|
+
slice="selected" slice-event="input"
|
|
140
|
+
>
|
|
141
|
+
<slice name="focused" slice-event="blur" slice-value="0"></slice>
|
|
142
|
+
<slice name="focused" slice-event="focus" slice-value="1"></slice>
|
|
143
|
+
<slice name="filter" slice-event="blur input" slice-value="//selected"></slice>
|
|
144
|
+
</xhtml:input></label></slot>
|
|
145
|
+
<fieldset form="cem-autocomplete-form" >
|
|
146
|
+
<attribute name="focus-within">{//focused}</attribute>
|
|
147
|
+
<xsl:for-each select="/datadom/payload/*[normalize-space(text()) != '']">
|
|
148
|
+
<if test="normalize-space(//selected) = '' or contains(@value, //filter)">
|
|
149
|
+
<label value="{@value ?? .}"
|
|
150
|
+
><xhtml:input type="radio" value="{@value ?? .}" name="cem-autocomplete" slice="selected" slice-event="input">
|
|
151
|
+
<slice name="focused" slice-event="blur" slice-value="0"></slice>
|
|
152
|
+
<slice name="focused" slice-event="focus" slice-value="2"></slice>
|
|
153
|
+
</xhtml:input>
|
|
154
|
+
{.}</label>
|
|
155
|
+
</if>
|
|
156
|
+
</xsl:for-each>
|
|
157
|
+
</fieldset>
|
|
158
|
+
</template>
|
|
159
|
+
</custom-element>
|
|
160
|
+
|
|
161
|
+
<html-demo-element legend="No value" description="Focus to see the cursor in input with label shifted upward ">
|
|
162
|
+
<template>
|
|
163
|
+
<cem-autocomplete label="String field" ></cem-autocomplete>
|
|
164
|
+
</template>
|
|
165
|
+
</html-demo-element>
|
|
166
|
+
|
|
167
|
+
<html-demo-element legend="No value with placeholder" description="focus to see the placeholder text">
|
|
168
|
+
<template>
|
|
169
|
+
<cem-autocomplete label="Number" type="number" placeholder="Enter the numeric value"></cem-autocomplete>
|
|
170
|
+
</template>
|
|
171
|
+
</html-demo-element>
|
|
172
|
+
|
|
173
|
+
<html-demo-element legend="Value defined" description="The value should be visible" >
|
|
174
|
+
<template>
|
|
175
|
+
<cem-autocomplete label="Text" type="text" value="abc"></cem-autocomplete>
|
|
176
|
+
</template>
|
|
177
|
+
</html-demo-element>
|
|
178
|
+
|
|
179
|
+
<html-demo-element legend="No initial value with placeholder" >
|
|
180
|
+
<div slot="description"><code>data value="xxx</code> for selection item uses <code>data</code> attribute for value </div>
|
|
181
|
+
<template>
|
|
182
|
+
<cem-autocomplete label="Fruits and berries" type="text" placeholder="Enter the fruit name">
|
|
183
|
+
<data value="apple" > 🍎 Apple </data>
|
|
184
|
+
<data value="strawberry" > 🍓 Strawberry </data>
|
|
185
|
+
<data value="pineapple" > 🍍 Pineapple </data>
|
|
186
|
+
</cem-autocomplete>
|
|
187
|
+
</template>
|
|
188
|
+
</html-demo-element>
|
|
189
|
+
|
|
190
|
+
<html-demo-element legend="Number, No initial value without placeholder" description="label takes the space till input is focused" >
|
|
191
|
+
<template>
|
|
192
|
+
<cem-autocomplete label="Number" type="number" >
|
|
193
|
+
<data value="1">One </data>
|
|
194
|
+
<data value="2">Two </data>
|
|
195
|
+
<data value="3">Three </data>
|
|
196
|
+
</cem-autocomplete>
|
|
197
|
+
</template>
|
|
198
|
+
</html-demo-element>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<html-demo-element legend="Options text as value" description="The value is same as text" >
|
|
202
|
+
<template>
|
|
203
|
+
<cem-autocomplete label="Dinosaur" type="text" >
|
|
204
|
+
<option>Tyrannosaurus </option>
|
|
205
|
+
<option>Sauropod </option>
|
|
206
|
+
<option>Velociraptor </option>
|
|
207
|
+
</cem-autocomplete>
|
|
208
|
+
</template>
|
|
209
|
+
</html-demo-element>
|
|
210
|
+
|
|
211
|
+
<html-demo-element legend="Options Grouping" description="filter within eac group, empty groups are hidden" >
|
|
212
|
+
<template>
|
|
213
|
+
<cem-autocomplete label="Number" type="text" >
|
|
214
|
+
<optgroup label="🦖 Theropods">
|
|
215
|
+
<option>Tyrannosaurus </option>
|
|
216
|
+
<option>Sauropod </option>
|
|
217
|
+
<option>Velociraptor </option>
|
|
218
|
+
<option>Deinonychus </option>
|
|
219
|
+
</optgroup>
|
|
220
|
+
<optgroup label="🦕 Sauropods">
|
|
221
|
+
<option>Diplodocus </option>
|
|
222
|
+
<option>Saltasaurus </option>
|
|
223
|
+
<option>Apatosaurus </option>
|
|
224
|
+
</optgroup>
|
|
225
|
+
</cem-autocomplete>
|
|
226
|
+
</template>
|
|
227
|
+
</html-demo-element>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
</main>
|
|
231
|
+
<footer>
|
|
232
|
+
<hr/>
|
|
233
|
+
Powered by Syngrafact Corp. ©2024.<br/>
|
|
234
|
+
<a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
|
|
235
|
+
</footer>
|
|
236
|
+
<!--<script type="module" src="./html-demo-element.js"></script>-->
|
|
237
|
+
<script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
|
|
238
|
+
|
|
239
|
+
</body>
|
|
241
240
|
</html>
|