@epa-wg/custom-element-dist 0.0.31 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/inspectionProfiles/Project_Default.xml +2 -1
- package/.storybook/main.ts +3 -7
- package/.storybook/preview.ts +4 -6
- package/README.md +4 -4
- package/coverage/coverage-final.json +7 -18
- package/coverage/index.html +30 -30
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +719 -473
- package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
- package/coverage/src/custom-element/http-request.js.html +6 -6
- package/coverage/src/custom-element/index.html +29 -29
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +31 -31
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +20 -20
- package/coverage/src/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/{attributes.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +175 -0
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +14 -179
- package/coverage/src/stories/testStoryBook.ts.html +8 -8
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-6slVaFEs.cjs +97 -0
- package/dist/custom-element-WnOqmEOe.js +609 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +30 -28
- package/dist/demo/a.html +51 -38
- package/dist/demo/attributes.html +153 -0
- package/dist/demo/data-slices.html +2 -2
- package/dist/demo/external-template.html +1 -0
- package/dist/demo/external-templates-sb-6.html +42 -0
- package/dist/demo/external-templates-sb-7.html +42 -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/html-template.html +1 -1
- package/dist/demo/module-url-sb-2.html +46 -0
- package/dist/demo/module-url-sb-4.html +48 -0
- package/dist/demo/module-url-sb-5.html +53 -0
- package/dist/demo/parameters.html +20 -1
- package/dist/demo/s.xml +66 -9
- package/dist/demo/s.xslt +89 -16
- package/dist/demo/ss.html +12 -22
- package/dist/mockServiceWorker.js +31 -8
- package/package.json +25 -26
- package/public/demo/a.html +51 -38
- package/public/demo/attributes.html +153 -0
- package/public/demo/data-slices.html +2 -2
- package/public/demo/external-template.html +1 -0
- package/public/demo/external-templates-sb-6.html +42 -0
- package/public/demo/external-templates-sb-7.html +42 -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/html-template.html +1 -1
- package/public/demo/module-url-sb-2.html +46 -0
- package/public/demo/module-url-sb-4.html +48 -0
- package/public/demo/module-url-sb-5.html +53 -0
- package/public/demo/parameters.html +20 -1
- package/public/demo/s.xml +66 -9
- package/public/demo/s.xslt +89 -16
- package/public/demo/ss.html +12 -22
- package/public/mockServiceWorker.js +31 -8
- package/src/custom-element/custom-element.d.ts +4 -0
- package/src/custom-element/custom-element.js +148 -66
- package/src/custom-element/demo/a.html +51 -38
- package/src/custom-element/demo/attributes.html +153 -0
- package/src/custom-element/demo/data-slices.html +2 -2
- 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/html-template.html +1 -1
- package/src/custom-element/demo/parameters.html +20 -1
- package/src/custom-element/demo/s.xml +66 -9
- package/src/custom-element/demo/s.xslt +89 -16
- package/src/custom-element/demo/ss.html +12 -22
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +1 -1
- package/src/material/components/badge.html +240 -0
- package/src/material/components/dropdown.html +26 -14
- package/src/material/components/icon-link.html +1 -0
- package/src/material/components/icon.html +253 -0
- package/src/material/components/input.html +571 -0
- package/src/material/components/menu.html +7 -5
- package/src/material/components.html +48 -11
- package/src/material/theme/semantic.css +20 -1
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
- package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
- package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +177 -11
- package/src/stories/external-template.test.stories.ts +17 -15
- package/src/stories/frame.canvas.ts +31 -0
- package/src/stories/module-url.test.stories.ts +29 -61
- package/storybook-static/assets/Color-F6OSRLHC-Cbp293x2.js +1 -0
- package/storybook-static/assets/Configure-BrFr4SLE.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-DhHzJiIO.js +2 -0
- package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +1 -0
- package/storybook-static/assets/attributes.test.stories-Gg9LQTEK.js +349 -0
- package/storybook-static/assets/{css.test.stories-Cgn6ICr0.js → css.test.stories-B_3ltOrx.js} +1 -1
- package/storybook-static/assets/custom-element-CPnvJnn8.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-CBObfPWg.js → dom-merge.test.stories-nQxcgLoM.js} +1 -1
- package/storybook-static/assets/entry-preview-docs-Dwczwtsc.js +2 -0
- package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +1 -0
- package/storybook-static/assets/{external-template.test.stories-VfKUQ8eu.js → external-template.test.stories-DZ-rjnfd.js} +39 -41
- package/storybook-static/assets/{form.test.stories-CnuGN7Zw.js → form.test.stories-DQhPYtMj.js} +1 -1
- package/storybook-static/assets/frame.canvas-ClTqYyMN.js +1 -0
- package/storybook-static/assets/{handlers-V_T7WjNK.js → handlers-CLkps6Nz.js} +17 -14
- package/storybook-static/assets/{http-request.stories-8NN1Coqm.js → http-request.stories-jo0f73nw.js} +1 -1
- package/storybook-static/assets/iframe-CZwRpnn9.js +199 -0
- package/storybook-static/assets/index-B68YUdzy.js +621 -0
- package/storybook-static/assets/index-BwkS7JH_.js +8 -0
- package/storybook-static/assets/index-CJQtnF9V.js +1 -0
- package/storybook-static/assets/index-Dr4PwNfd.js +240 -0
- package/storybook-static/assets/{local-storage.test.stories-Dk5Yqc7m.js → local-storage.test.stories-uA5EKRPf.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-56um6s5L.js → location-element.test.stories-Cu-6Elcg.js} +1 -1
- package/storybook-static/assets/module-url.test.stories-CD_wusXQ.js +142 -0
- package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +1 -0
- package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
- package/storybook-static/assets/preview-BFlNN3Wj.js +1 -0
- package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
- package/storybook-static/assets/preview-Cm4PPhHS.js +50 -0
- package/storybook-static/assets/preview-CuCH40jj.js +2 -0
- package/storybook-static/assets/preview-DfTudP20.js +1 -0
- package/storybook-static/assets/{set-url.test.stories-B4E6hIe-.js → set-url.test.stories-CY7B9BVZ.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BR0F-B6I.js → slice-events.test.stories-BVnPXm6e.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-CgfJIyCr.js → slots.test.stories-Dxsa9KdA.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-nmxATIwv.js → version-select.test.stories-Buga1PAa.js} +1 -1
- package/storybook-static/demo/a.html +51 -38
- package/storybook-static/demo/attributes.html +153 -0
- package/storybook-static/demo/data-slices.html +2 -2
- package/storybook-static/demo/external-template.html +1 -0
- package/storybook-static/demo/external-templates-sb-6.html +42 -0
- package/storybook-static/demo/external-templates-sb-7.html +42 -0
- package/storybook-static/demo/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/html-template.html +1 -1
- package/storybook-static/demo/module-url-sb-2.html +46 -0
- package/storybook-static/demo/module-url-sb-4.html +48 -0
- package/storybook-static/demo/module-url-sb-5.html +53 -0
- package/storybook-static/demo/parameters.html +20 -1
- package/storybook-static/demo/s.xml +66 -9
- package/storybook-static/demo/s.xslt +89 -16
- package/storybook-static/demo/ss.html +12 -22
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +6 -10
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +31 -8
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +230 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
- package/storybook-static/sb-manager/globals-module-info.js +9 -0
- package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
- package/storybook-static/sb-manager/runtime.js +4944 -6321
- package/coverage/src/stories/attributes.test.stories.ts.html +0 -514
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/css.test.stories.ts.html +0 -460
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
- package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/form.test.stories.ts.html +0 -661
- package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
- package/coverage/src/stories/location-element.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
- package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
- package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slots.test.stories.ts.html +0 -742
- package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
- package/dist/custom-element-BbJMY20-.cjs +0 -97
- package/dist/custom-element-CoRNKeEP.js +0 -567
- package/storybook-static/assets/Color-F6OSRLHC-CFyd3TND.js +0 -1
- package/storybook-static/assets/Configure-UGTbPRKK.js +0 -165
- package/storybook-static/assets/DocsRenderer-CFRXHY34-Dpr5iB0o.js +0 -2
- package/storybook-static/assets/attributes.test.stories-DSOLHHOW.js +0 -152
- package/storybook-static/assets/custom-element-D59Fok1f.js +0 -97
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
- package/storybook-static/assets/iframe-DnhkgdtG.js +0 -2
- package/storybook-static/assets/index-3Sfy-t3H.js +0 -769
- package/storybook-static/assets/index-BcZLpTeD.js +0 -8
- package/storybook-static/assets/index-CIBI7sCB.js +0 -1
- package/storybook-static/assets/index-CxRwF5Or.js +0 -234
- package/storybook-static/assets/index-D-8MO0q_.js +0 -1
- package/storybook-static/assets/index-DN1RoK17.js +0 -1
- package/storybook-static/assets/index-DjJD7gkO.js +0 -1
- package/storybook-static/assets/module-url.test.stories-DEponQ7l.js +0 -208
- package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
- package/storybook-static/assets/preview-CNKoaWES.js +0 -1
- package/storybook-static/assets/preview-Czc-sw5H.js +0 -2
- package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
- package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
- package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
- package/storybook-static/assets/preview-vbpHsp94.js +0 -52
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -7174
- package/test-runner-jest.config.js +0 -15
- /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<dce-root data-dce-id="1"
|
|
3
|
-
xmlns="http://www.w3.org/1999/xhtml"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</
|
|
14
|
-
<fieldset data-dce-id="8" form="cem-autocomplete-form" xmlns=""><label data-dce-id="9" value="one"><input
|
|
15
|
-
data-dce-id="10" name="cem-autocomplete" slice="suggest" slice-event="input" type="radio" value="one"/>
|
|
16
|
-
<dce-text data-dce-id="11">One</dce-text>
|
|
17
|
-
</label><label data-dce-id="9" value="two"><input data-dce-id="10" name="cem-autocomplete" slice="suggest" slice-event="input"
|
|
18
|
-
type="radio" value="two"/>
|
|
19
|
-
<dce-text data-dce-id="11">Two</dce-text>
|
|
20
|
-
</label><label data-dce-id="9" value="three"><input data-dce-id="10" name="cem-autocomplete" slice="suggest"
|
|
21
|
-
slice-event="input" type="radio" value="three"/>
|
|
22
|
-
<dce-text data-dce-id="11">Three</dce-text>
|
|
23
|
-
</label></fieldset>
|
|
2
|
+
<dce-root data-dce-id="1" xmlns="http://www.w3.org/1999/xhtml" xmlns:dce="urn:schemas-epa-wg:dce"
|
|
3
|
+
xmlns:xhtml="http://www.w3.org/1999/xhtml"><label data-dce-id="2" xmlns=""><input data-dce-id="3"
|
|
4
|
+
slice="disabled-slice"
|
|
5
|
+
type="checkbox"
|
|
6
|
+
value="disabled"/>
|
|
7
|
+
<dce-text data-dce-id="4">disabled</dce-text>
|
|
8
|
+
</label>
|
|
9
|
+
<cem-input data-dce-id="6" value="123"/>
|
|
10
|
+
<button data-dce-id="7">Next</button>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
</p></form>
|
|
24
14
|
</dce-root>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<a href="./demo/module-url.html" >importmap </a> <br/>
|
|
52
52
|
<a href="./demo/hex-grid.html" >hex grid lib </a> |
|
|
53
53
|
<a href="./demo/scoped-css.html" >scoped CSS </a> |
|
|
54
|
-
<a href="./demo/
|
|
54
|
+
<a href="./demo/attributes.html" >attributes </a> |
|
|
55
55
|
<a href="./demo/data-slices.html" >data slices/events </a> |
|
|
56
56
|
<a href="./demo/form.html" >Form validation </a> |
|
|
57
57
|
<a href="./demo/dom-merge.html" >DOM merge on dynamic update </a><br/>
|
|
@@ -0,0 +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
|
|
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
|
+
var{ color: darkgreen; font-weight: bold; }
|
|
38
|
+
html-demo-element { [slot="demo"] { display: flex; gap: 8rem; } } }
|
|
39
|
+
flex-3x{ display: inline-flex; flex-wrap: wrap;gap:3rem; max-width:12rem;}
|
|
40
|
+
</style>
|
|
41
|
+
</head>
|
|
42
|
+
<!--
|
|
43
|
+
ToDO
|
|
44
|
+
* docs w/ how to use
|
|
45
|
+
-->
|
|
46
|
+
<body>
|
|
47
|
+
<template id="cem-badge">
|
|
48
|
+
<attribute name="text"
|
|
49
|
+
aria-description="Badge text content. Up to 4 characters including + sign."
|
|
50
|
+
></attribute>
|
|
51
|
+
<attribute name="dot"
|
|
52
|
+
aria-description="attribute defines the small dot presentation without visible text. Default 'true' "
|
|
53
|
+
></attribute>
|
|
54
|
+
<attribute name="color"
|
|
55
|
+
aria-description="semantic colors. Default is 'primary'. Values: primary|secondary|success|alert"
|
|
56
|
+
></attribute>
|
|
57
|
+
<attribute name="align"
|
|
58
|
+
aria-description="Vertical & horizontal align. Default is 'top right'. Values: top|middle|bottom|left|center|right"
|
|
59
|
+
></attribute>
|
|
60
|
+
<attribute name="invisible"
|
|
61
|
+
aria-description="Boolean. Default is 'false'. Values: true|false"
|
|
62
|
+
></attribute>
|
|
63
|
+
<style>
|
|
64
|
+
&[dot]>*>dd{ height: 0; width: 0; min-width: 0.5rem; color: transparent; padding: 0; min-height: 0.5rem; }
|
|
65
|
+
&[invisible]>*>dd{ height: 0; width: 0; min-width: 0; color: transparent; padding: 0; min-height:0; }
|
|
66
|
+
&[align~=left]>*>dd{ --cem-badge-align-h: -100%; }
|
|
67
|
+
&[align~=center]>*>dd{ --cem-badge-align-h: -25%; }
|
|
68
|
+
&[align~=right]>*>dd{ --cem-badge-align-h: 50%; }
|
|
69
|
+
&[align~=top]>*>dd{ --cem-badge-align-v: -50%; }
|
|
70
|
+
&[align~=middle]>*>dd{ --cem-badge-align-v: 25%; }
|
|
71
|
+
&[align~=bottom]>*>dd{ --cem-badge-align-v: 75%; }
|
|
72
|
+
&{ position: relative; display: inline-block; --cem-badge-align-v: -50%; --cem-badge-align-h: 50%; }
|
|
73
|
+
&>*>dd{
|
|
74
|
+
/*position: absolute; top:-0.5rem; border-radius: 0.5rem; */
|
|
75
|
+
/*padding: 0.25rem; background-color: red;*/
|
|
76
|
+
display: flex ;
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
-webkit-box-pack: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-content: center;
|
|
82
|
+
-webkit-box-align: center;
|
|
83
|
+
align-items: center;
|
|
84
|
+
position: absolute;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
font-family: Roboto, Helvetica, Arial, sans-serif;
|
|
87
|
+
font-weight: 500;
|
|
88
|
+
font-size: 0.75rem;
|
|
89
|
+
min-width: 20px;
|
|
90
|
+
line-height: 1;
|
|
91
|
+
height: 20px;
|
|
92
|
+
z-index: 1;
|
|
93
|
+
background-color: var(--cem-badge-color, --cem-badge-color-primary);
|
|
94
|
+
color: var(--cem-badge-text-color,rgb(255, 255, 255));
|
|
95
|
+
top: 0;
|
|
96
|
+
right: 0;
|
|
97
|
+
transform: scale(1) translate(var(--cem-badge-align-h), var(--cem-badge-align-v));
|
|
98
|
+
transform-origin: 100% 0%;
|
|
99
|
+
padding: 0 6px;
|
|
100
|
+
border-radius: 10px;
|
|
101
|
+
border: var(--cem-badge-border, none);
|
|
102
|
+
transition: all 225ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
103
|
+
}
|
|
104
|
+
&[color="secondary"]>*>dd{ background-color: var(--cem-badge-color-secondary); }
|
|
105
|
+
&[color="success"]>*>dd{ background-color: var(--cem-badge-color-success); }
|
|
106
|
+
&[color="alert"]>*>dd{ background-color: var(--cem-badge-color-alert); }
|
|
107
|
+
|
|
108
|
+
</style>
|
|
109
|
+
<dd>{text}</dd>
|
|
110
|
+
<slot></slot>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<custom-element hidden src="#cem-badge" tag="cem-badge"></custom-element>
|
|
114
|
+
<custom-element hidden src="./icon-link.html#cem-badge-link" tag="cem-badge-link"></custom-element>
|
|
115
|
+
<custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
|
|
116
|
+
<custom-element hidden src="./icon.html#cem-icon" tag="cem-icon"></custom-element>
|
|
117
|
+
|
|
118
|
+
<header class="cem-theme-teal">
|
|
119
|
+
<custom-element src="../index.html#nav-head"></custom-element>
|
|
120
|
+
</header>
|
|
121
|
+
<main>
|
|
122
|
+
<aside>
|
|
123
|
+
<p><code>cem-badge</code> is badge component from <custom-element> Material suite based on the
|
|
124
|
+
<a href="https://m3.material.io/components/badges/overview">Material Design specification for Badges</a>.<br/>
|
|
125
|
+
Badges show notifications, counts, or status information on navigation items and icons.
|
|
126
|
+
Inspired by <a href="https://mui.com/material-ui/react-badge/">MUI</a>
|
|
127
|
+
</p>
|
|
128
|
+
<h1>Attributes</h1>
|
|
129
|
+
<div> <code>text</code> attribute defines the Up to 4 characters including + sign.</div>
|
|
130
|
+
<div> <code>dot</code> attribute defines the small dot presentation without visible text. Default 'true'. </div>
|
|
131
|
+
<div> <code>invisible</code> attribute hides badge. </div>
|
|
132
|
+
<div> <code>align</code> attribute defines the vertical & horizontal align. Default is 'top right'. Values: top|middle|bottom|left|center|right. </div>
|
|
133
|
+
</aside>
|
|
134
|
+
|
|
135
|
+
<html-demo-element legend="Variations">
|
|
136
|
+
<p slot="description">
|
|
137
|
+
|
|
138
|
+
</p>
|
|
139
|
+
<template>
|
|
140
|
+
<cem-badge text="0" color="secondary"> <cem-icon image="far fa-envelope"></cem-icon> </cem-badge>
|
|
141
|
+
<cem-badge text="999+" > <cem-icon image="🛒" vertical="middle"></cem-icon> </cem-badge>
|
|
142
|
+
<cem-badge text="999+" dot > <cem-icon image="notifications" vertical="middle"></cem-icon> </cem-badge>
|
|
143
|
+
</template>
|
|
144
|
+
</html-demo-element>
|
|
145
|
+
|
|
146
|
+
<html-demo-element legend="color attribute">
|
|
147
|
+
<p slot="description">
|
|
148
|
+
Semantic colors
|
|
149
|
+
</p>
|
|
150
|
+
<template>
|
|
151
|
+
<cem-badge text="0" > <cem-icon image="✉"></cem-icon> </cem-badge>
|
|
152
|
+
<cem-badge text="1" color="primary" > <cem-icon image="✉"></cem-icon> </cem-badge>
|
|
153
|
+
<cem-badge text="2" color="secondary"> <cem-icon image="✉"></cem-icon> </cem-badge>
|
|
154
|
+
<cem-badge text="3" color="success" > <cem-icon image="✉"></cem-icon> </cem-badge>
|
|
155
|
+
<cem-badge text="4" color="alert" > <cem-icon image="✉"></cem-icon> </cem-badge>
|
|
156
|
+
</template>
|
|
157
|
+
</html-demo-element>
|
|
158
|
+
|
|
159
|
+
<html-demo-element legend="custom color">
|
|
160
|
+
<p slot="description">
|
|
161
|
+
Override by CE
|
|
162
|
+
</p>
|
|
163
|
+
<template>
|
|
164
|
+
<custom-element>
|
|
165
|
+
<template>
|
|
166
|
+
<style>
|
|
167
|
+
&
|
|
168
|
+
{ --cem-badge-text-color:red;
|
|
169
|
+
--cem-badge-color:#FF08;
|
|
170
|
+
--cem-badge-border: 1px blue solid;
|
|
171
|
+
cem-badge dd{box-shadow: -2px 3px 8px blue;}
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
174
|
+
<cem-badge text="123"> CUSTOM COLOR </cem-badge>
|
|
175
|
+
</template>
|
|
176
|
+
</custom-element>
|
|
177
|
+
</template>
|
|
178
|
+
</html-demo-element>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<html-demo-element legend="invisible attribute">
|
|
182
|
+
<p slot="description">
|
|
183
|
+
hides badge, animated
|
|
184
|
+
</p>
|
|
185
|
+
<template>
|
|
186
|
+
<custom-element>
|
|
187
|
+
<template>
|
|
188
|
+
<label>
|
|
189
|
+
<input type="checkbox" slice="is-checked" value="on" />
|
|
190
|
+
invisible</label>
|
|
191
|
+
<cem-badge text="1" >
|
|
192
|
+
<if test="/datadom/slice/is-checked = 'on'">
|
|
193
|
+
<attribute name="invisible">on</attribute>
|
|
194
|
+
</if>
|
|
195
|
+
<cem-icon image="mail" ></cem-icon>
|
|
196
|
+
</cem-badge>
|
|
197
|
+
|
|
198
|
+
<cem-badge dot>
|
|
199
|
+
<if test="/datadom/slice/is-checked = 'on'">
|
|
200
|
+
<attribute name="invisible">on</attribute>
|
|
201
|
+
</if>
|
|
202
|
+
<cem-icon image="mail" ></cem-icon>
|
|
203
|
+
</cem-badge>
|
|
204
|
+
</template>
|
|
205
|
+
</custom-element>
|
|
206
|
+
</template>
|
|
207
|
+
</html-demo-element>
|
|
208
|
+
|
|
209
|
+
<html-demo-element legend="align attribute">
|
|
210
|
+
<p slot="description">
|
|
211
|
+
sets vertical( top, middle, bottom ) and horizontal( left, center, right) badge align.<br/>
|
|
212
|
+
Default is right top.
|
|
213
|
+
</p>
|
|
214
|
+
<template>
|
|
215
|
+
<flex-3x>
|
|
216
|
+
<cem-badge text="1" align="left top" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
217
|
+
<cem-badge text="2" align="center top" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
218
|
+
<cem-badge text="3" align="right top" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
219
|
+
|
|
220
|
+
<cem-badge text="4" align="left middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
221
|
+
<cem-badge text="5" align="center middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
222
|
+
<cem-badge text="6" align="right middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
223
|
+
|
|
224
|
+
<cem-badge text="7" align="left bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
225
|
+
<cem-badge text="8" align="center bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
226
|
+
<cem-badge text="9" align="right bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
|
|
227
|
+
</flex-3x>
|
|
228
|
+
</template>
|
|
229
|
+
</html-demo-element>
|
|
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 src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js" type="module"></script>
|
|
238
|
+
|
|
239
|
+
</body>
|
|
240
|
+
</html>
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
[slot="description"] dd {
|
|
54
54
|
padding: 0;
|
|
55
55
|
}
|
|
56
|
+
[slot="demo"]{ min-height: 8rem; }
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
</style>
|
|
@@ -66,25 +67,23 @@
|
|
|
66
67
|
<custom-element src="../index.html#nav-head"></custom-element>
|
|
67
68
|
</header>
|
|
68
69
|
<main>
|
|
69
|
-
<p><code>cem-dropdown</code> is
|
|
70
|
+
<p><code>cem-dropdown</code> is popover component from <custom-element> Material suite based on the
|
|
70
71
|
<a href="https://material.io/components">Material Design specification</a>.
|
|
71
72
|
</p>
|
|
73
|
+
<p>The visibility of dropdown content is driven by <code>open</code> attribute</p>
|
|
72
74
|
<custom-element hidden tag="cem-dropdown">
|
|
73
75
|
<template id="cem-dropdown">
|
|
74
76
|
<attribute name="open"></attribute>
|
|
75
77
|
<attribute name="label"></attribute>
|
|
76
78
|
<style>
|
|
77
|
-
|
|
79
|
+
&[open="false"]>*>aside{ max-height: 0; }
|
|
80
|
+
&>* {
|
|
78
81
|
position: relative;
|
|
79
82
|
|
|
80
83
|
--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
84
|
--cem-dropdown-max-height: 10rem;
|
|
82
85
|
--cem-dropdown-base-min-width: 8em;
|
|
83
86
|
|
|
84
|
-
&[open="false"]{
|
|
85
|
-
&>aside{ max-height: 0;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
87
|
& > label {
|
|
89
88
|
min-width: var(--cem-dropdown-base-min-width);
|
|
90
89
|
display: inline-block;
|
|
@@ -117,10 +116,22 @@
|
|
|
117
116
|
</custom-element>
|
|
118
117
|
|
|
119
118
|
<html-demo-element
|
|
120
|
-
legend="
|
|
121
|
-
description="
|
|
119
|
+
legend="HTML in dropdown"
|
|
120
|
+
description="any HTML payload is OK. The image is just for reference." >
|
|
122
121
|
<template>
|
|
123
|
-
<cem-dropdown label="
|
|
122
|
+
<cem-dropdown label="Image in drop" open="true">
|
|
123
|
+
<img src="../../custom-element/demo/confused.svg"/>
|
|
124
|
+
</cem-dropdown>
|
|
125
|
+
<hr/>
|
|
126
|
+
<hr/>
|
|
127
|
+
<hr/>
|
|
128
|
+
<hr/>
|
|
129
|
+
</template>
|
|
130
|
+
</html-demo-element>
|
|
131
|
+
|
|
132
|
+
<html-demo-element legend="Menu in dropdown">
|
|
133
|
+
<template>
|
|
134
|
+
<cem-dropdown label="Vertical menu" >
|
|
124
135
|
<cem-menu direction="column">
|
|
125
136
|
<a href="#">link 1</a>
|
|
126
137
|
<a href="#">link 2</a>
|
|
@@ -130,14 +141,16 @@
|
|
|
130
141
|
</template>
|
|
131
142
|
</html-demo-element>
|
|
132
143
|
|
|
133
|
-
<html-demo-element
|
|
134
|
-
|
|
144
|
+
<html-demo-element legend="Hide dropdown dynamically"
|
|
145
|
+
description="open=false hides dropdown"
|
|
146
|
+
>
|
|
135
147
|
<template>
|
|
136
148
|
<custom-element>
|
|
137
149
|
<template>
|
|
138
|
-
<label><input slice="opened" type="checkbox" value="1"
|
|
139
|
-
|
|
150
|
+
<label><input slice="opened" type="checkbox" value="1" checked/>
|
|
151
|
+
open</label><br/>
|
|
140
152
|
<cem-dropdown label="Vertical menu" open="{//opened='1'}">
|
|
153
|
+
|
|
141
154
|
<cem-menu direction="column">
|
|
142
155
|
<a href="#">link 1</a>
|
|
143
156
|
<a href="#">link 2</a>
|
|
@@ -149,7 +162,6 @@
|
|
|
149
162
|
</template>
|
|
150
163
|
</html-demo-element>
|
|
151
164
|
|
|
152
|
-
|
|
153
165
|
</main>
|
|
154
166
|
<footer>
|
|
155
167
|
<hr/>
|