@epa-wg/custom-element-dist 0.0.21 → 0.0.23
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/.gitignore +8 -0
- package/README.md +4 -4
- package/coverage/coverage-final.json +13 -11
- 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 +603 -420
- package/coverage/src/custom-element/http-request.js.html +10 -10
- package/coverage/src/custom-element/index.html +18 -18
- package/coverage/src/custom-element/local-storage.js.html +2 -2
- package/coverage/src/custom-element/location-element.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/{css.stories.ts → attributes.test.stories.ts}/coverage.svg +1 -1
- package/coverage/src/stories/{attributes.stories.ts.html → attributes.test.stories.ts.html} +113 -83
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/{css.stories.ts.html → css.test.stories.ts.html} +122 -65
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/{dom-merge.stories.ts.html → dom-merge.test.stories.ts.html} +118 -70
- package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/{external-template.stories.ts.html → external-template.test.stories.ts.html} +180 -150
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/form.test.stories.ts.html +655 -0
- package/coverage/src/stories/http-request.stories.ts.html +7 -7
- package/coverage/src/stories/index.html +118 -88
- package/coverage/src/stories/{dom-merge.stories.ts → local-storage.test.stories.ts}/coverage.svg +1 -1
- package/coverage/src/stories/{local-storage.stories.ts.html → local-storage.test.stories.ts.html} +475 -439
- package/coverage/src/stories/{external-template.stories.ts → location-element.test.stories.ts}/coverage.svg +1 -1
- package/coverage/src/stories/{location-element.stories.ts.html → location-element.test.stories.ts.html} +134 -98
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/slice-events.test.stories.ts.html +685 -0
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/slots.test.stories.ts.html +736 -0
- package/coverage/src/stories/{renderPlay.ts.html → testStoryBook.ts.html} +44 -26
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-BISbI4SU.js +463 -0
- package/dist/custom-element-N-sWiqGK.cjs +53 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +2 -2
- package/dist/mockServiceWorker.js +1 -1
- package/package.json +4 -4
- package/public/mockServiceWorker.js +1 -1
- package/src/custom-element/custom-element.d.ts +4 -0
- package/src/custom-element/custom-element.js +103 -42
- package/src/custom-element/demo/a.html +38 -41
- package/src/custom-element/demo/b.html +13 -0
- package/src/custom-element/demo/data-slices.html +32 -0
- package/src/custom-element/demo/form.html +240 -0
- package/src/custom-element/demo/s.xml +11 -14
- package/src/custom-element/demo/s.xslt +22 -38
- package/src/custom-element/demo/s1.xslt +60 -0
- package/src/custom-element/ide/customData-dce.json +14 -1
- package/src/custom-element/ide/web-types-dce.json +6 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +1 -0
- package/src/custom-element.test.ts +24 -8
- package/src/stories/{attributes.stories.ts → attributes.test.stories.ts} +19 -9
- package/src/stories/{css.stories.ts → css.test.stories.ts} +28 -9
- package/src/stories/{dom-merge.stories.ts → dom-merge.test.stories.ts} +19 -3
- package/src/stories/{external-template.stories.ts → external-template.test.stories.ts} +13 -3
- package/src/stories/form.test.stories.ts +190 -0
- package/src/stories/http-request.stories.ts +6 -6
- package/src/stories/http-request.test.ts +0 -9
- package/src/stories/{local-storage.stories.ts → local-storage.test.stories.ts} +24 -12
- package/src/stories/{location-element.stories.ts → location-element.test.stories.ts} +21 -9
- package/src/stories/{slice-events.stories.ts → slice-events.test.stories.ts} +88 -5
- package/src/stories/slots.test.stories.ts +217 -0
- package/src/stories/testStoryBook.ts +28 -0
- package/storybook-static/assets/{Color-RQJUDNI5-C4yZhNbM.js → Color-PRSJMWNM-BD_Ds9NW.js} +1 -1
- package/storybook-static/assets/{Configure-C7d36rng.js → Configure-70I_VApa.js} +1 -1
- package/storybook-static/assets/DocsRenderer-K4EAMTCU-9dn0-HCP.js +2 -0
- package/storybook-static/assets/WithTooltip-KJL26V4Q-C6g5GOU9.js +1 -0
- package/storybook-static/assets/{attributes.stories-ZB0RTY1d.js → attributes.test.stories-BEOraI4E.js} +22 -21
- package/storybook-static/assets/css.test.stories-D9WaxrEv.js +96 -0
- package/storybook-static/assets/custom-element-BV8-hRQS.js +219 -0
- package/storybook-static/assets/{dom-merge.stories-CgHZUABU.js → dom-merge.test.stories-BhbNeum_.js} +5 -6
- package/storybook-static/assets/{entry-preview-CQqNFx4W.js → entry-preview-DrgzXgwT.js} +1 -1
- package/storybook-static/assets/{entry-preview-docs-CWgqLfd3.js → entry-preview-docs-Bxv0qQWs.js} +1 -1
- package/storybook-static/assets/{external-template.stories-DtSLMxvg.js → external-template.test.stories-Bpr_wxBo.js} +23 -24
- package/storybook-static/assets/form.test.stories-3tURbEdv.js +250 -0
- package/storybook-static/assets/{formatter-B5HCVTEV-tKeEfJA9.js → formatter-2WMMO6ZP-6IvBq34u.js} +5 -5
- package/storybook-static/assets/http-request.stories-8K_qSs8C.js +300 -0
- package/storybook-static/assets/iframe-zdt9kuj6.js +2 -0
- package/storybook-static/assets/index-B3oZkK3F.js +1 -0
- package/storybook-static/assets/index-C30JwJMK.js +548 -0
- package/storybook-static/assets/index-CVRyq5ci.js +27 -0
- package/storybook-static/assets/index-DXimoRZY.js +1 -0
- package/storybook-static/assets/{index-DnEJ_bKa.js → index-DhXZyjEd.js} +1 -1
- package/storybook-static/assets/index-DuIEV_9C.js +13 -0
- package/storybook-static/assets/{lit-element-B4_0akdT.js → lit-element-CenEXOuS.js} +2 -2
- package/storybook-static/assets/{local-storage.stories-BkO6djDz.js → local-storage.test.stories-CtisAQBB.js} +28 -24
- package/storybook-static/assets/{location-element.stories-DCIOUd0D.js → location-element.test.stories-5O_t_m4Y.js} +11 -11
- package/storybook-static/assets/preview-4Up_z4Em.js +7 -0
- package/storybook-static/assets/preview-BKCN0mOr.js +1 -0
- package/storybook-static/assets/{preview-CkgAD_DE.js → preview-D0eCfQft.js} +2 -2
- package/storybook-static/assets/preview-DRnyIGXK.js +48 -0
- package/storybook-static/assets/preview-FpHGYA1q.js +1 -0
- package/storybook-static/assets/{preview-PxUn-cIn.js → preview-TCN6m6T-.js} +1 -1
- package/storybook-static/assets/slice-events.test.stories-BSXCLIA5.js +231 -0
- package/storybook-static/assets/slots.test.stories-B1vqfHmN.js +214 -0
- package/storybook-static/assets/syntaxhighlighter-BP7B2CQK-DpPBKyTO.js +1 -0
- package/storybook-static/iframe.html +153 -10
- package/storybook-static/index.html +1 -1
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +35 -29
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +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 +5 -5
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +35 -35
- 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-10/manager-bundle.js +18 -16
- package/storybook-static/sb-addons/links-1/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +1 -1
- package/storybook-static/sb-manager/WithTooltip-KJL26V4Q-5LS5AN27.js +1 -0
- package/storybook-static/sb-manager/{chunk-S4VOIVUE.js → chunk-B3YDJJJH.js} +9 -9
- package/storybook-static/sb-manager/{chunk-FEE35O7J.js → chunk-BLWCBWKL.js} +3 -3
- package/storybook-static/sb-manager/{chunk-XCO5HRLK.js → chunk-GUVK2GTO.js} +3 -3
- package/storybook-static/sb-manager/chunk-LFRML3ZV.js +186 -0
- package/storybook-static/sb-manager/chunk-MC7RAF2B.js +274 -0
- package/storybook-static/sb-manager/{chunk-XP3HGWTR.js → chunk-ZR5JZWHI.js} +1 -1
- package/storybook-static/sb-manager/{formatter-B5HCVTEV-7DCBOGO6.js → formatter-2WMMO6ZP-JI7RHVTW.js} +1 -1
- package/storybook-static/sb-manager/globals-module-info.js +1 -1
- package/storybook-static/sb-manager/globals-runtime.js +1 -1
- package/storybook-static/sb-manager/index.js +1 -1
- package/storybook-static/sb-manager/runtime.js +1 -1
- package/storybook-static/sb-manager/{syntaxhighlighter-JOJW2KGS-VF6EEVPI.js → syntaxhighlighter-BP7B2CQK-WOJYHKQR.js} +1 -1
- package/storybook-static/sb-preview/runtime.js +28 -11
- package/tsconfig.json +31 -21
- package/vite.config.js +5 -5
- package/yarn.lock +10242 -0
- package/.vscode/settings.json +0 -24
- package/coverage/src/stories/local-storage.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/location-element.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/renderPlay.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.stories.ts.html +0 -436
- package/dist/custom-element-B4v-KaIh.cjs +0 -53
- package/dist/custom-element-_g0GTup2.js +0 -436
- package/src/stories/attributes.test.ts +0 -14
- package/src/stories/css.test.ts +0 -12
- package/src/stories/dom-merge.test.ts +0 -12
- package/src/stories/external-template.test.ts +0 -12
- package/src/stories/local-storage.test.ts +0 -12
- package/src/stories/location-element.test.ts +0 -14
- package/src/stories/renderPlay.ts +0 -22
- package/src/stories/slice-events.test.ts +0 -12
- package/storybook-static/assets/DocsRenderer-K4EAMTCU-BLMupvSb.js +0 -2
- package/storybook-static/assets/WithTooltip-Y7J54OF7-BAQSPSFk.js +0 -1
- package/storybook-static/assets/css.stories-CLSX-Xxd.js +0 -86
- package/storybook-static/assets/custom-element-BLZZ00dz.js +0 -53
- package/storybook-static/assets/http-request.stories-CUzlXO89.js +0 -300
- package/storybook-static/assets/iframe-gCvlWuoC.js +0 -2
- package/storybook-static/assets/index-CBQwM6ST.js +0 -508
- package/storybook-static/assets/index-CDavW7r9.js +0 -193
- package/storybook-static/assets/index-CQA5dlr6.js +0 -13
- package/storybook-static/assets/index-DgaNIR0t.js +0 -1
- package/storybook-static/assets/index-Dkj0J1ds.js +0 -1
- package/storybook-static/assets/preview-C6t8KBFr.js +0 -1
- package/storybook-static/assets/preview-CYD85dwb.js +0 -7
- package/storybook-static/assets/preview-D8LadFCz.js +0 -48
- package/storybook-static/assets/preview-DNpCpRPf.js +0 -1
- package/storybook-static/assets/slice-events.stories-DXKjXI37.js +0 -115
- package/storybook-static/assets/syntaxhighlighter-JOJW2KGS-C04pIVD3.js +0 -1
- package/storybook-static/sb-manager/WithTooltip-Y7J54OF7-CEHQ77YF.js +0 -1
- package/storybook-static/sb-manager/chunk-E3WK6ZOZ.js +0 -234
- package/storybook-static/sb-manager/chunk-E6ABNH5R.js +0 -183
- /package/coverage/src/stories/{attributes.stories.ts → testStoryBook.ts}/coverage.svg +0 -0
|
@@ -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 http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
5
|
+
<title>Forms - Declarative Custom Element implementation demo</title>
|
|
6
|
+
<link rel="icon" href="./wc-square.svg"/>
|
|
7
|
+
|
|
8
|
+
<script type="module" src="../local-storage.js"></script>
|
|
9
|
+
<script type="module" src="../custom-element.js"></script>
|
|
10
|
+
<style>
|
|
11
|
+
@import "./demo.css";
|
|
12
|
+
|
|
13
|
+
label {
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
label:has(input[type="text"],input[type="password"],input:not([type]) ) {
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
nav {
|
|
22
|
+
max-width: 32em;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
<!-- https://github.com/mdn/learning-area/blob/main/html/forms/form-validation/custom-error-message.html
|
|
26
|
+
todo: apply setCustomValidity( warningStr )
|
|
27
|
+
-->
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
|
|
32
|
+
<nav>
|
|
33
|
+
<a href="../index.html"><h3><code>custom-element</code> demo</h3></a>
|
|
34
|
+
|
|
35
|
+
<p> <b>formData</b><br/>
|
|
36
|
+
The values of named form fields are populated into the <b>slice</b> as <b>form-data</b> on <var>change</var>
|
|
37
|
+
or <var>submit</var> event. The field values can be used in form validation via <var>custom-validity</var>
|
|
38
|
+
attribute
|
|
39
|
+
and in condition to enabling the form parts
|
|
40
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/API/FormData">formData MDN</a>
|
|
41
|
+
</p>
|
|
42
|
+
<details>
|
|
43
|
+
<summary>slice to form-data mapping</summary>
|
|
44
|
+
<html-demo-element>
|
|
45
|
+
<template>
|
|
46
|
+
<datadom hidden>
|
|
47
|
+
<slice>
|
|
48
|
+
<signin-form>
|
|
49
|
+
<form-data>
|
|
50
|
+
<username>QWE</username>
|
|
51
|
+
<password>ASD</password>
|
|
52
|
+
</form-data>
|
|
53
|
+
</signin-form>
|
|
54
|
+
</slice>
|
|
55
|
+
</datadom>
|
|
56
|
+
</template>
|
|
57
|
+
</html-demo-element>
|
|
58
|
+
</details>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<p> <b> custom-validity attribute </b><br/>
|
|
62
|
+
applied on the form itself or on the form field.<br/>
|
|
63
|
+
The value is an XPath over DCE <var>datadom</var>. When evaluated as <u>boolean</u>, it would enable(true) or
|
|
64
|
+
disable(false)
|
|
65
|
+
the form submission, acting as form validation mechanism.<br>
|
|
66
|
+
Alternatively, the value can be evaluated as a <u>string</u> which would be treated as an error and can be used
|
|
67
|
+
as
|
|
68
|
+
validation error message set as <var>@validation-message</var> attribute on the form slice.
|
|
69
|
+
Look for <var>email-form/@validation-message</var> example on the page.<br/>
|
|
70
|
+
</p>
|
|
71
|
+
<p> When <var>custom-validity</var> attribute is set on the field, its XPath evaluated value is propagated to
|
|
72
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validationMessage">
|
|
73
|
+
validationMessage property</a>. Which would be shown via browser system popup as the field validation error.
|
|
74
|
+
</p>
|
|
75
|
+
<p> <var>@validation-message</var> is set either by <var>custom-validity</var> attribute or by browser as system message.
|
|
76
|
+
By default, it is shown as popup on the field validation. But also is available for template as a string via
|
|
77
|
+
form field attribute. Like in <var>email-form/@validation-message</var>.
|
|
78
|
+
|
|
79
|
+
</p>
|
|
80
|
+
|
|
81
|
+
<a href="https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation">Form Validation MDN</a>
|
|
82
|
+
</nav>
|
|
83
|
+
|
|
84
|
+
<html-demo-element legend="1. Simple validation"
|
|
85
|
+
description="custom-validity boolean value prevents submission, username length switches Next to 'Sign In' button ">
|
|
86
|
+
<ol>
|
|
87
|
+
<li> Click Next, observe the warning</li>
|
|
88
|
+
<li> Fill input with 10+ characters</li>
|
|
89
|
+
<li> Click Next, the password and "Sign In" button should appear</li>
|
|
90
|
+
</ol>
|
|
91
|
+
<template>
|
|
92
|
+
<custom-element>
|
|
93
|
+
<template>
|
|
94
|
+
<form slice="signin-form"
|
|
95
|
+
custom-validity="
|
|
96
|
+
string-length(/datadom/slice/signin-form/form-data/username) > 10
|
|
97
|
+
and string-length(//form-data/password) > 3 "
|
|
98
|
+
>
|
|
99
|
+
<label> Email
|
|
100
|
+
<input name="username" autocomplete="username" placeholder="Email, phone, or username"
|
|
101
|
+
required="">
|
|
102
|
+
</label>
|
|
103
|
+
<variable name="showpassword" select="string-length(//form-data/username) > 10 "></variable>
|
|
104
|
+
<if test="not($showpassword)">
|
|
105
|
+
<button slice="confirm" slice-event="click" slice-value="'password'">Next</button>
|
|
106
|
+
</if>
|
|
107
|
+
<if test="$showpassword">
|
|
108
|
+
<label>Enter password: <input name="password" type="password" required> </label>
|
|
109
|
+
<button>Sign In</button>
|
|
110
|
+
</if>
|
|
111
|
+
username {//username}
|
|
112
|
+
</form>
|
|
113
|
+
</template>
|
|
114
|
+
</custom-element>
|
|
115
|
+
</template>
|
|
116
|
+
</html-demo-element>
|
|
117
|
+
|
|
118
|
+
<html-demo-element legend="2. Form life cycle demo"
|
|
119
|
+
description="form-data in the form slice is the source of truth">
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<custom-element>
|
|
123
|
+
<template>
|
|
124
|
+
<form slice="signin-form"
|
|
125
|
+
custom-validity="
|
|
126
|
+
string-length(/datadom/slice/signin-form/form-data/username) > 9
|
|
127
|
+
and ( ( //confirm-by = 'sms' )
|
|
128
|
+
or ( //confirm-by = 'email' )
|
|
129
|
+
or ( //confirm-by = 'password' and string-length(//form-data/password) > 3 )
|
|
130
|
+
)
|
|
131
|
+
"
|
|
132
|
+
>
|
|
133
|
+
<!-- form validity should be based on form-data -->
|
|
134
|
+
<variable name="warn">
|
|
135
|
+
<if test="string-length(//username-slice) < 9 ">
|
|
136
|
+
Should be 10 or more symbols.
|
|
137
|
+
<!-- updated by slice on input event -->
|
|
138
|
+
</if>
|
|
139
|
+
<if test="//form-data/confirm-by = 'sms'">
|
|
140
|
+
Message and Data Rates may apply.
|
|
141
|
+
<!-- updated by form change by radio select -->
|
|
142
|
+
</if>
|
|
143
|
+
</variable>
|
|
144
|
+
<label> Enter your email, phone, or user name
|
|
145
|
+
<input name="username" autocomplete="username"
|
|
146
|
+
placeholder="Email, phone, or username"
|
|
147
|
+
custom-validity="( string-length(//username-slice) > 9 ) ?? 'should be 10+ symbols'"
|
|
148
|
+
slice-event="input"
|
|
149
|
+
slice="username-slice"
|
|
150
|
+
required
|
|
151
|
+
/>
|
|
152
|
+
</label>
|
|
153
|
+
<var> {$warn} </var>
|
|
154
|
+
<fieldset>
|
|
155
|
+
<legend>Confirm by</legend>
|
|
156
|
+
<label><input type="radio" name="confirm-by" value="email"/> email </label>
|
|
157
|
+
<label><input type="radio" name="confirm-by" value="sms"/> text to phone </label>
|
|
158
|
+
<label><input type="radio" name="confirm-by" value="password"/> password </label>
|
|
159
|
+
<if test="/datadom/slice/signin-form/form-data/confirm-by = 'password'">
|
|
160
|
+
<label>Enter password: <input type="password" NAME="password"
|
|
161
|
+
custom-validity="( string-length(//form-data/password) > 3 ) ?? 'password is too short'"
|
|
162
|
+
/></label>
|
|
163
|
+
</if>
|
|
164
|
+
<if test="not(//confirm-by)">
|
|
165
|
+
Please select the auth method
|
|
166
|
+
</if>
|
|
167
|
+
</fieldset>
|
|
168
|
+
<section>
|
|
169
|
+
<button>Sign In</button>
|
|
170
|
+
</section>
|
|
171
|
+
</form>
|
|
172
|
+
//username-slice {//username-slice}<br/>
|
|
173
|
+
//username {//username}<br/>
|
|
174
|
+
//confirm-by {//confirm-by}<br/>
|
|
175
|
+
//password {//password}
|
|
176
|
+
</template>
|
|
177
|
+
</custom-element>
|
|
178
|
+
</template>
|
|
179
|
+
</html-demo-element>
|
|
180
|
+
|
|
181
|
+
<html-demo-element legend="3. read system validity message"
|
|
182
|
+
description="validationMessage propagated into slice as 'validation-message' attribute ">
|
|
183
|
+
<ol>
|
|
184
|
+
<li> type in input field</li>
|
|
185
|
+
<li> delete input field content</li>
|
|
186
|
+
<li> observe the warning in string bellow input</li>
|
|
187
|
+
<li> Click Next observe the system warning in dropdown and in string bellow input</li>
|
|
188
|
+
</ol>
|
|
189
|
+
<template>
|
|
190
|
+
<custom-element>
|
|
191
|
+
<template>
|
|
192
|
+
<form slice="email-form">
|
|
193
|
+
<label> Email
|
|
194
|
+
<input slice="username" slice-event="input" placeholder="non-empty" required>
|
|
195
|
+
</label>
|
|
196
|
+
<if test="//username/@validation-message">
|
|
197
|
+
<var>{//username/@validation-message}</var>
|
|
198
|
+
</if>
|
|
199
|
+
<button>Next</button>
|
|
200
|
+
<p>{//email-form/@validation-message}</p>
|
|
201
|
+
</form>
|
|
202
|
+
</template>
|
|
203
|
+
</custom-element>
|
|
204
|
+
</template>
|
|
205
|
+
</html-demo-element>
|
|
206
|
+
|
|
207
|
+
<html-demo-element legend="4. form validity message"
|
|
208
|
+
description="@validation-message propagated into form slice and ">
|
|
209
|
+
<ol>
|
|
210
|
+
<li> type up to 3 chars in input field</li>
|
|
211
|
+
<li> observe the slice value change</li>
|
|
212
|
+
<li> click next</li>
|
|
213
|
+
<li> observe the warning bellow the button</li>
|
|
214
|
+
</ol>
|
|
215
|
+
<template>
|
|
216
|
+
<custom-element>
|
|
217
|
+
<template>
|
|
218
|
+
<form slice="email-form"
|
|
219
|
+
custom-validity=" string-length(//slice/username) > 3 ??
|
|
220
|
+
concat('should be more than 3 characters, now is ',string-length(//slice/username) ) "
|
|
221
|
+
>
|
|
222
|
+
<label> Email
|
|
223
|
+
<input name="email" slice="username" slice-event="input" placeholder="non-empty" required/>
|
|
224
|
+
</label>
|
|
225
|
+
<if test="//username/@validation-message">
|
|
226
|
+
<var>{//username/@validation-message}</var>
|
|
227
|
+
</if>
|
|
228
|
+
<button>Next</button>
|
|
229
|
+
<p>//email-form/@validation-message: {//email-form/@validation-message} </p>
|
|
230
|
+
<p>//slice/username: {//slice/username} </p>
|
|
231
|
+
</form>
|
|
232
|
+
</template>
|
|
233
|
+
</custom-element>
|
|
234
|
+
</template>
|
|
235
|
+
</html-demo-element>
|
|
236
|
+
|
|
237
|
+
<script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
|
|
238
|
+
|
|
239
|
+
</body>
|
|
240
|
+
</html>
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<br />
|
|
13
|
-
undefined
|
|
14
|
-
</div>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<datadom>
|
|
3
|
+
<slice>
|
|
4
|
+
<signin-form>
|
|
5
|
+
<form-data>
|
|
6
|
+
<username>QWE</username>
|
|
7
|
+
<password>ASD</password>
|
|
8
|
+
</form-data>
|
|
9
|
+
</signin-form>
|
|
10
|
+
</slice>
|
|
11
|
+
</datadom>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
1
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
2
3
|
xmlns:dce="urn:schemas-epa-wg:dce" xmlns:exsl="http://exslt.org/common" version="1.0"
|
|
3
4
|
exclude-result-prefixes="exsl">
|
|
@@ -14,56 +15,39 @@
|
|
|
14
15
|
</xsl:template>
|
|
15
16
|
<xsl:template mode="payload" match="attributes">
|
|
16
17
|
<dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" data-dce-id="1">
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<button xmlns="" data-dce-id="5">
|
|
28
|
-
<xsl:value-of select="@name">
|
|
29
|
-
</xsl:value-of>
|
|
30
|
-
</button>
|
|
31
|
-
</xsl:for-each>
|
|
32
|
-
<xsl:for-each xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="//slice/s/value/*">
|
|
33
|
-
<ul xmlns="" data-dce-id="6">
|
|
34
|
-
<var data-testid="request-section" data-dce-id="7">
|
|
35
|
-
<dce-text data-dce-id="8">
|
|
36
|
-
<xsl:value-of select="name(.)"/>
|
|
37
|
-
</dce-text>
|
|
38
|
-
</var>
|
|
39
|
-
<xsl:for-each select="@*">
|
|
40
|
-
<div data-dce-id="9">
|
|
41
|
-
<var data-dce-id="10">@<xsl:value-of select="local-name(.)"/>
|
|
42
|
-
</var>
|
|
43
|
-
<dce-text data-dce-id="11">
|
|
44
|
-
=
|
|
45
|
-
</dce-text>
|
|
46
|
-
<code data-testid="attr-{local-name(.)}" data-dce-id="12">
|
|
47
|
-
<xsl:value-of select="."/>
|
|
48
|
-
</code>
|
|
49
|
-
</div>
|
|
50
|
-
</xsl:for-each>
|
|
51
|
-
</ul>
|
|
52
|
-
</xsl:for-each>
|
|
18
|
+
<u xmlns="" data-dce-id="2">
|
|
19
|
+
<dce-text data-dce-id="3">
|
|
20
|
+
<xsl:call-template name="slot">
|
|
21
|
+
<xsl:with-param name="slotname" select="''"/>
|
|
22
|
+
<xsl:with-param name="defaultvalue">
|
|
23
|
+
<dce-text xmlns="" data-dce-id="4">is green</dce-text>
|
|
24
|
+
</xsl:with-param>
|
|
25
|
+
</xsl:call-template>
|
|
26
|
+
</dce-text>
|
|
27
|
+
</u>
|
|
53
28
|
</dce-root>
|
|
54
29
|
</xsl:template>
|
|
55
30
|
<xsl:template match="/">
|
|
56
31
|
<xsl:apply-templates mode="payload" select="/datadom/attributes"/>
|
|
57
32
|
</xsl:template>
|
|
33
|
+
|
|
34
|
+
<xsl:template match="@*|node()" mode="copy-html">
|
|
35
|
+
<xsl:copy><xsl:apply-templates select="@*|node()" mode="copy-html"/></xsl:copy>
|
|
36
|
+
</xsl:template>
|
|
37
|
+
<xsl:template match="node()[starts-with(name(),'xhtml:')]" mode="copy-html">
|
|
38
|
+
<xsl:element name="{local-name()}"><xsl:apply-templates select="@*|node()" mode="copy-html"/></xsl:element>
|
|
39
|
+
</xsl:template>
|
|
40
|
+
|
|
41
|
+
|
|
58
42
|
<xsl:template name="slot">
|
|
59
43
|
<xsl:param name="slotname"/>
|
|
60
44
|
<xsl:param name="defaultvalue"/>
|
|
61
45
|
<xsl:choose>
|
|
62
46
|
<xsl:when test="//payload/*[@slot=$slotname]">
|
|
63
|
-
<xsl:copy-
|
|
47
|
+
<xsl:apply-templates mode="copy-html" select="//payload/*[@slot=$slotname]"/>
|
|
64
48
|
</xsl:when>
|
|
65
49
|
<xsl:otherwise>
|
|
66
|
-
<xsl:copy-
|
|
50
|
+
<xsl:apply-templates mode="copy-html" select="$defaultvalue"/>
|
|
67
51
|
</xsl:otherwise>
|
|
68
52
|
</xsl:choose>
|
|
69
53
|
</xsl:template>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
3
|
+
xmlns:dce="urn:schemas-epa-wg:dce" xmlns:exsl="http://exslt.org/common" version="1.0"
|
|
4
|
+
exclude-result-prefixes="exsl">
|
|
5
|
+
<xsl:template match="ignore">
|
|
6
|
+
<xsl:choose>
|
|
7
|
+
<xsl:when test="//attr">
|
|
8
|
+
<xsl:value-of select="//attr"/>
|
|
9
|
+
</xsl:when>
|
|
10
|
+
<xsl:otherwise>
|
|
11
|
+
<xsl:value-of select="def"/>
|
|
12
|
+
</xsl:otherwise>
|
|
13
|
+
</xsl:choose>
|
|
14
|
+
<xsl:value-of select="."/>
|
|
15
|
+
</xsl:template>
|
|
16
|
+
<xsl:template mode="payload" match="attributes">
|
|
17
|
+
<dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" data-dce-id="1">
|
|
18
|
+
<u xmlns="" data-dce-id="2">
|
|
19
|
+
<dce-text data-dce-id="3">
|
|
20
|
+
<xsl:call-template name="slot">
|
|
21
|
+
<xsl:with-param name="slotname" select="''"/>
|
|
22
|
+
<xsl:with-param name="defaultvalue">
|
|
23
|
+
<dce-text xmlns="" data-dce-id="4">is green</dce-text>
|
|
24
|
+
</xsl:with-param>
|
|
25
|
+
</xsl:call-template>
|
|
26
|
+
</dce-text>
|
|
27
|
+
</u>
|
|
28
|
+
</dce-root>
|
|
29
|
+
</xsl:template>
|
|
30
|
+
<xsl:template match="/">
|
|
31
|
+
<xsl:apply-templates mode="payload" select="/datadom/attributes"/>
|
|
32
|
+
</xsl:template>
|
|
33
|
+
|
|
34
|
+
<xsl:template match="@*|node()" mode="copy-html">
|
|
35
|
+
<xsl:copy><xsl:apply-templates select="@*|node()" mode="copy-html"/></xsl:copy>
|
|
36
|
+
</xsl:template>
|
|
37
|
+
<xsl:template match="node()[starts-with(name(),'xhtml:')]" mode="copy-html">
|
|
38
|
+
<xsl:element name="{local-name()}"><xsl:apply-templates select="@*|node()" mode="copy-html"/></xsl:element>
|
|
39
|
+
</xsl:template>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<xsl:template name="slot">
|
|
43
|
+
<xsl:param name="slotname"/>
|
|
44
|
+
<xsl:param name="defaultvalue"/>
|
|
45
|
+
<xsl:choose>
|
|
46
|
+
<xsl:when test="//payload/*[@slot=$slotname]">
|
|
47
|
+
<xsl:apply-templates mode="copy-html" select="//payload/*[@slot=$slotname]"/>
|
|
48
|
+
</xsl:when>
|
|
49
|
+
<xsl:otherwise>
|
|
50
|
+
<xsl:apply-templates mode="copy-html" select="$defaultvalue"/>
|
|
51
|
+
</xsl:otherwise>
|
|
52
|
+
</xsl:choose>
|
|
53
|
+
</xsl:template>
|
|
54
|
+
<xsl:variable name="js-injected-body">
|
|
55
|
+
<xsl:call-template name="slot">
|
|
56
|
+
<xsl:with-param name="slotname" select="''"/>
|
|
57
|
+
<xsl:with-param name="defaultvalue"/>
|
|
58
|
+
</xsl:call-template>
|
|
59
|
+
</xsl:variable>
|
|
60
|
+
</xsl:stylesheet>
|
|
@@ -27,6 +27,19 @@
|
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
"name": "custom-validity",
|
|
32
|
+
"description": {
|
|
33
|
+
"kind": "markdown",
|
|
34
|
+
"value": "XPath expression to return either boolean or error string to be shown by browser native UI on form validation event. Unless value is true, prevents the form submission."
|
|
35
|
+
},
|
|
36
|
+
"references": [
|
|
37
|
+
{
|
|
38
|
+
"name": "Demo",
|
|
39
|
+
"url": "https://unpkg.com/@epa-wg/custom-element/demo/form.html"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
30
43
|
{
|
|
31
44
|
"name": "slice-value",
|
|
32
45
|
"description": {
|
|
@@ -109,4 +122,4 @@
|
|
|
109
122
|
]
|
|
110
123
|
}
|
|
111
124
|
]
|
|
112
|
-
}
|
|
125
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@epa-wg/custom-element",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.23",
|
|
5
5
|
"js-types-syntax": "typescript",
|
|
6
6
|
"description-markup": "markdown",
|
|
7
7
|
"contributions": {
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
"description": "Defines the event name on which `value` would be synchronized with DCE slice\n\nOn: any component with `value` and associated change event",
|
|
18
18
|
"doc-url": "https://unpkg.com/@epa-wg/custom-element/demo/dom-merge.html"
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "custom-validity",
|
|
22
|
+
"description": "XPath expression to return either boolean or error string to be shown by browser native UI on form validation event. Unless value is true, prevents the form submission.",
|
|
23
|
+
"doc-url": "https://unpkg.com/@epa-wg/custom-element/demo/form.html"
|
|
24
|
+
},
|
|
20
25
|
{
|
|
21
26
|
"name": "slice-value",
|
|
22
27
|
"description": "XPath expression to populate into the slice",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<a href="./demo/scoped-css.html" >scoped CSS </a> |
|
|
36
36
|
<a href="./demo/parameters.html" >attributes </a> |
|
|
37
37
|
<a href="./demo/data-slices.html" >data slices/events </a> |
|
|
38
|
+
<a href="./demo/form.html" >Form validation </a> |
|
|
38
39
|
<a href="./demo/dom-merge.html" >DOM merge on dynamic update </a>
|
|
39
40
|
</section>
|
|
40
41
|
</nav>
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {expect, test} from 'vitest'
|
|
2
|
+
import {deepEqual, xml2dom, xmlString, obj2node } from './custom-element/custom-element.js'
|
|
3
3
|
|
|
4
|
-
test('deepEqual', () =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
test('deepEqual', () =>
|
|
5
|
+
{
|
|
6
|
+
expect(deepEqual(1, 1)).toBe(true);
|
|
7
|
+
expect(deepEqual({}, null)).toBe(false);
|
|
8
|
+
expect(deepEqual({a: 1}, {a: 1, b: 2})).toBe(false);
|
|
9
|
+
expect(deepEqual({a: 1}, {a: 2})).toBe(false);
|
|
10
|
+
expect(deepEqual({a: 1}, {a: 1})).toBe(true);
|
|
11
|
+
})
|
|
12
|
+
test('xml2dom', () =>
|
|
13
|
+
{
|
|
14
|
+
const dom = xml2dom('<a/>');
|
|
15
|
+
expect(dom.documentElement.localName).to.equal('a');
|
|
16
|
+
expect(dom.documentElement.childNodes.length).to.equal(0);
|
|
17
|
+
const xStr = xmlString(dom);
|
|
18
|
+
expect(xStr).to.include('<a');
|
|
19
|
+
})
|
|
20
|
+
test('obj2node', () =>
|
|
21
|
+
{
|
|
22
|
+
expect(obj2node(()=>{} , 'f',document).outerHTML).to.equal('<f></f>' );
|
|
23
|
+
expect(obj2node(9 , 'a',document).outerHTML).to.equal('<a>9</a>' );
|
|
24
|
+
expect(obj2node('abc' , 's',document).outerHTML).to.equal('<s>abc</s>' );
|
|
25
|
+
expect(obj2node({a:1,b:{c:'abc'}} , 's',document).outerHTML).to.equal('<s a="1"><b c="abc"></b></s>');
|
|
10
26
|
})
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// noinspection DuplicatedCode
|
|
2
2
|
|
|
3
|
-
import type { StoryObj }
|
|
4
|
-
import {expect,
|
|
3
|
+
import type { StoryObj } from '@storybook/web-components';
|
|
4
|
+
import {expect, within} from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
import '../custom-element/custom-element.js';
|
|
7
7
|
|
|
8
8
|
type TProps = { title: string; body:string};
|
|
9
9
|
|
|
10
10
|
type Story = StoryObj<TProps>;
|
|
11
|
+
|
|
11
12
|
function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); }
|
|
12
13
|
|
|
13
14
|
function render(args: TProps)
|
|
@@ -36,8 +37,8 @@ export const AttributeDefaults:Story =
|
|
|
36
37
|
<attribute name="p1">default_P1 </attribute>
|
|
37
38
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
38
39
|
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
39
|
-
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
40
|
-
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
40
|
+
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
41
|
+
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
41
42
|
p3: <code data-testid="p3">{$p3}</code>
|
|
42
43
|
</template>
|
|
43
44
|
</custom-element>
|
|
@@ -64,8 +65,8 @@ export const AttributesRuntimeChange:Story =
|
|
|
64
65
|
<attribute name="p1">default_P1 </attribute>
|
|
65
66
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
66
67
|
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
67
|
-
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
68
|
-
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
68
|
+
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
69
|
+
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
69
70
|
p3: <code data-testid="p3">{$p3}</code>
|
|
70
71
|
</template>
|
|
71
72
|
</custom-element>
|
|
@@ -110,8 +111,8 @@ export const InstanceAttributes:Story =
|
|
|
110
111
|
<attribute name="p1">default_P1 </attribute>
|
|
111
112
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
112
113
|
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
113
|
-
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
114
|
-
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
114
|
+
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
115
|
+
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
115
116
|
p3: <code data-testid="p3">{$p3}</code>
|
|
116
117
|
</template>
|
|
117
118
|
</custom-element>
|
|
@@ -122,7 +123,7 @@ export const InstanceAttributes:Story =
|
|
|
122
123
|
const titleText = AttributeDefaults.args!.title as string;
|
|
123
124
|
const canvas = within(canvasElement)
|
|
124
125
|
, code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
|
|
125
|
-
|
|
126
|
+
debugger;
|
|
126
127
|
await sleep(20)
|
|
127
128
|
expect( await code('p1') ).toEqual('123' );
|
|
128
129
|
expect( await code('p2') ).toEqual('always_p2' );
|
|
@@ -130,3 +131,12 @@ export const InstanceAttributes:Story =
|
|
|
130
131
|
},
|
|
131
132
|
};
|
|
132
133
|
|
|
134
|
+
/* istanbul ignore else -- @preserve */
|
|
135
|
+
if( 'test' === import.meta.env.MODE &&
|
|
136
|
+
!import.meta.url.includes('skiptest') )
|
|
137
|
+
{
|
|
138
|
+
const mod = await import('./attributes.test.stories.ts?skiptest');
|
|
139
|
+
const { testStoryBook } = await import('./testStoryBook')
|
|
140
|
+
const { describe } = await import('vitest')
|
|
141
|
+
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
142
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {StoryObj}
|
|
2
|
-
import {within, expect}
|
|
1
|
+
import type {StoryObj} from "@storybook/web-components";
|
|
2
|
+
import {within, expect} from "@storybook/test";
|
|
3
3
|
|
|
4
4
|
import '../custom-element/custom-element.js';
|
|
5
|
+
import {CharsCountInTextarea, WordCountOnType} from './dom-merge.test.stories';
|
|
5
6
|
|
|
6
7
|
type CssProps = { title: string; tag: string; style: string; slot: string; payload: string };
|
|
7
8
|
const defs = {title: '', tag: '', style: '', slot: '', payload: ''};
|
|
@@ -47,6 +48,12 @@ export const StyleDoesNotLeak: Story =
|
|
|
47
48
|
const color = st.getPropertyValue('color');
|
|
48
49
|
// @ts-ignore
|
|
49
50
|
expect(color).to.equal('rgb(0, 128, 0)')
|
|
51
|
+
await expect( el.closest('custom-element')).toBeInTheDocument();
|
|
52
|
+
const dce = el.closest('custom-element');
|
|
53
|
+
await expect( dce.xsltString).toContain('<xsl:stylesheet');
|
|
54
|
+
await expect( dce.dce.localName).toEqual('custom-element');
|
|
55
|
+
await expect( dce.dce.xsltString).toEqual(dce.xsltString);
|
|
56
|
+
await expect( dce.dce.xslt.documentElement.tagName ).toEqual('xsl:stylesheet');
|
|
50
57
|
},
|
|
51
58
|
};
|
|
52
59
|
|
|
@@ -80,13 +87,15 @@ export const OverrideInPayload: Story =
|
|
|
80
87
|
, style: `color:green`
|
|
81
88
|
, slot: 'is green'
|
|
82
89
|
, tag: 'dce-3'
|
|
83
|
-
, payload:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</
|
|
88
|
-
</
|
|
89
|
-
|
|
90
|
+
, payload: `<u>should be</u> ${RED}:
|
|
91
|
+
<dce-3 id="dce32">
|
|
92
|
+
<template>
|
|
93
|
+
<style> color:red; </style>
|
|
94
|
+
<u>red</u>
|
|
95
|
+
</template>
|
|
96
|
+
</dce-3> <br/>
|
|
97
|
+
should be ${GREEN}:
|
|
98
|
+
<dce-3 id="dce31">green</dce-3> `
|
|
90
99
|
}
|
|
91
100
|
, play: async ({canvasElement}) =>
|
|
92
101
|
{
|
|
@@ -102,3 +111,13 @@ export const OverrideInPayload: Story =
|
|
|
102
111
|
expect( color('#dce32 u') ).to .equal(color('i'));
|
|
103
112
|
},
|
|
104
113
|
};
|
|
114
|
+
|
|
115
|
+
/* istanbul ignore else -- @preserve */
|
|
116
|
+
if( 'test' === import.meta.env.MODE &&
|
|
117
|
+
!import.meta.url.includes('skiptest') )
|
|
118
|
+
{
|
|
119
|
+
const mod = await import('./css.test.stories.ts?skiptest');
|
|
120
|
+
const { testStoryBook } = await import('./testStoryBook')
|
|
121
|
+
const { describe } = await import('vitest')
|
|
122
|
+
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
123
|
+
}
|