web-component-wrapper 0.0.613 → 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/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
- Project status
13
+ <!--|deDE:Projektstatus-->
14
+ Project Status
14
15
  --------------
15
16
 
16
17
  [![npm](https://img.shields.io/npm/v/web-component-wrapper?color=%23d55e5d&label=npm%20package%20version&logoColor=%23d55e5d&style=for-the-badge)](https://www.npmjs.com/package/web-component-wrapper)
@@ -28,7 +29,7 @@ Project status
28
29
  [![deploy web documentation](https://img.shields.io/github/actions/workflow/status/thaibault/web-component-wrapper/deploy-web-documentation.yaml?label=deploy%20web%20documentation&style=for-the-badge)](https://github.com/thaibault/web-component-wrapper/actions/workflows/deploy-web-documentation.yaml)
29
30
  [![web documentation](https://img.shields.io/website-up-down-green-red/https/torben.website/web-component-wrapper.svg?label=web-documentation&style=for-the-badge)](https://torben.website/web-component-wrapper)
30
31
 
31
- <!--|deDE:Einsatz-->
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/decorator'
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
- class MyGreeting extends webComponentWrapper.Web {
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
- webComponentWrapper.property()({self: MyGreeting}, 'greetingName')
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
- class MyReactGreeting extends webComponentWrapper.ReactWeb {
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
- webComponentWrapper.property()({self: MyReactGreeting}, 'name')
178
+ property()({self: MyReactGreeting}, 'name')
182
179
 
183
180
  customElements.define('my-react-greeting', MyReactGreeting)
184
181
  ```