web-component-wrapper 0.0.614 → 0.0.615
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/dist/ReactWeb.js +10 -10
- package/dist/Web.js +7 -7
- package/dist/bundle/ReactWeb.js +157 -137
- package/dist/bundle/Web.js +154 -134
- package/dist/bundle/compatible/ReactWeb.js +156 -136
- package/dist/bundle/compatible/Web.js +153 -133
- package/dist/bundle/compatible/decorator.js +147 -127
- package/dist/bundle/compatible/index.js +156 -136
- package/dist/bundle/decorator.js +147 -127
- package/dist/bundle/index.js +158 -138
- package/dist/compatible/ReactWeb.js +9 -9
- package/dist/compatible/Web.js +6 -6
- package/dist/compatible/index.js +9 -9
- package/dist/index.js +11 -11
- package/package.json +12 -12
- package/readme.md +21 -24
package/readme.md
CHANGED
|
@@ -10,7 +10,8 @@ This library written by Torben Sickert stands under a creative commons naming
|
|
|
10
10
|
3.0 unported license. See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
11
11
|
endregion -->
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<!--|deDE:Projektstatus-->
|
|
14
|
+
Project Status
|
|
14
15
|
--------------
|
|
15
16
|
|
|
16
17
|
[](https://www.npmjs.com/package/web-component-wrapper)
|
|
@@ -28,7 +29,7 @@ Project status
|
|
|
28
29
|
[](https://github.com/thaibault/web-component-wrapper/actions/workflows/deploy-web-documentation.yaml)
|
|
29
30
|
[](https://torben.website/web-component-wrapper)
|
|
30
31
|
|
|
31
|
-
<!--|deDE:
|
|
32
|
+
<!--|deDE:Verwendung-->
|
|
32
33
|
Use case
|
|
33
34
|
--------
|
|
34
35
|
|
|
@@ -39,7 +40,6 @@ Encapsulate your components as web-components.
|
|
|
39
40
|
<!--wd-table-of-contents-->
|
|
40
41
|
</div>
|
|
41
42
|
|
|
42
|
-
<!--|deDE:Installation-->
|
|
43
43
|
Installation
|
|
44
44
|
------------
|
|
45
45
|
|
|
@@ -55,10 +55,14 @@ zip file here and inject or request via cdn in HTML:
|
|
|
55
55
|
npm install web-component-wrapper
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
<!--|deDE:Beispiele-->
|
|
59
|
+
<!--|frFR:Exemples-->
|
|
60
|
+
Examples
|
|
61
|
+
--------
|
|
62
|
+
|
|
58
63
|
```TypeScript
|
|
59
64
|
import {func, object} from 'clientnode/property-types'
|
|
60
|
-
import {property} from 'web-component-wrapper
|
|
61
|
-
import {Web} from 'web-component-wrapper/Web'
|
|
65
|
+
import {property, Web} from 'web-component-wrapper'
|
|
62
66
|
|
|
63
67
|
export class MyWebComponent<
|
|
64
68
|
TElement = HTMLElement,
|
|
@@ -128,35 +132,24 @@ export class MyWebComponent<
|
|
|
128
132
|
customElements.define('my-web-component', MyWebComponent)
|
|
129
133
|
```
|
|
130
134
|
|
|
131
|
-
<!--|deDE:Beispiele-->
|
|
132
|
-
Examples
|
|
133
|
-
--------
|
|
134
|
-
|
|
135
|
-
<!--|deDE:Lade via CDN-->
|
|
136
|
-
### Load via CDN
|
|
137
|
-
|
|
138
|
-
<!--showExample:hidden-->
|
|
139
|
-
|
|
140
|
-
```HTML
|
|
141
|
-
<script
|
|
142
|
-
src="https://unpkg.com/web-component-wrapper@latest/dist/bundle/index.js"
|
|
143
|
-
></script>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
135
|
<!--|deDE:Einfaches Web-Component Beispiel-->
|
|
147
136
|
### Simple Web-Component
|
|
148
137
|
|
|
149
138
|
<!--showExample:JavaScript-->
|
|
150
139
|
|
|
151
140
|
```JavaScript
|
|
152
|
-
|
|
141
|
+
import {
|
|
142
|
+
property, Web
|
|
143
|
+
} from 'https://unpkg.com/web-component-wrapper@latest/dist/bundle/index.js'
|
|
144
|
+
|
|
145
|
+
class MyGreeting extends Web {
|
|
153
146
|
static doRender = true
|
|
154
147
|
static evaluateSlots = true
|
|
155
148
|
static determineRootBinding = false
|
|
156
149
|
static content = '<div>Hello ${rootInstance.greetingName}</div>'
|
|
157
150
|
}
|
|
158
151
|
// Alternative to the decorator syntax:
|
|
159
|
-
|
|
152
|
+
property()({self: MyGreeting}, 'greetingName')
|
|
160
153
|
|
|
161
154
|
customElements.define('my-greeting', MyGreeting)
|
|
162
155
|
```
|
|
@@ -171,14 +164,18 @@ customElements.define('my-greeting', MyGreeting)
|
|
|
171
164
|
### Simple React-Web-Component
|
|
172
165
|
|
|
173
166
|
```JavaScript
|
|
174
|
-
|
|
167
|
+
import {
|
|
168
|
+
property, ReactWeb
|
|
169
|
+
} from 'https://unpkg.com/web-component-wrapper@latest/dist/bundle/index.js'
|
|
170
|
+
|
|
171
|
+
class MyReactGreeting extends ReactWeb {
|
|
175
172
|
static doRender = true
|
|
176
173
|
static evaluateSlots = true
|
|
177
174
|
// Content has a react component to wrap.
|
|
178
175
|
static content = ({name}) => <div>Hello {name}</div>
|
|
179
176
|
}
|
|
180
177
|
// Alternative to the decorator syntax:
|
|
181
|
-
|
|
178
|
+
property()({self: MyReactGreeting}, 'name')
|
|
182
179
|
|
|
183
180
|
customElements.define('my-react-greeting', MyReactGreeting)
|
|
184
181
|
```
|