@navservice/web-components 1.8.0 → 1.10.0
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/build/es/index.d.ts +2 -10
- package/build/es/index.js +6 -1
- package/build/lib/index.d.ts +2 -10
- package/build/lib/index.js +13 -2
- package/package.json +1 -1
package/build/es/index.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { MyElement } from './my-element';
|
|
3
|
-
export
|
|
4
|
-
declare
|
|
5
|
-
namespace JSX {
|
|
6
|
-
interface IntrinsicElements {
|
|
7
|
-
'my-element': Partial<MyElement> & {
|
|
8
|
-
ref?: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
3
|
+
export { MyElement };
|
|
4
|
+
export declare function createMyElement(props?: Partial<MyElement>): MyElement;
|
package/build/es/index.js
CHANGED
|
@@ -418,4 +418,9 @@ class MyElement extends LitElement {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
if (!customElements.get('my-element')) customElements.define('my-element', MyElement);
|
|
421
|
-
|
|
421
|
+
function createMyElement(props) {
|
|
422
|
+
const el = document.createElement('my-element');
|
|
423
|
+
if (props) Object.assign(el, props);
|
|
424
|
+
return el;
|
|
425
|
+
}
|
|
426
|
+
export { MyElement, createMyElement };
|
package/build/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { MyElement } from './my-element';
|
|
3
|
-
export
|
|
4
|
-
declare
|
|
5
|
-
namespace JSX {
|
|
6
|
-
interface IntrinsicElements {
|
|
7
|
-
'my-element': Partial<MyElement> & {
|
|
8
|
-
ref?: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
3
|
+
export { MyElement };
|
|
4
|
+
export declare function createMyElement(props?: Partial<MyElement>): MyElement;
|
package/build/lib/index.js
CHANGED
|
@@ -49,7 +49,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49
49
|
|
|
50
50
|
// EXPORTS
|
|
51
51
|
__webpack_require__.d(__webpack_exports__, {
|
|
52
|
-
MyElement: () => (/* reexport */ MyElement)
|
|
52
|
+
MyElement: () => (/* reexport */ MyElement),
|
|
53
|
+
createMyElement: () => (/* binding */ createMyElement)
|
|
53
54
|
});
|
|
54
55
|
|
|
55
56
|
;// CONCATENATED MODULE: ./src/index.css
|
|
@@ -620,10 +621,20 @@ class MyElement extends lit_element_i {
|
|
|
620
621
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
621
622
|
|
|
622
623
|
|
|
623
|
-
|
|
624
|
+
// registra o custom element
|
|
624
625
|
if (!customElements.get('my-element')) {
|
|
625
626
|
customElements.define('my-element', MyElement);
|
|
626
627
|
}
|
|
628
|
+
// exporta a classe (opcional, mas útil)
|
|
629
|
+
|
|
630
|
+
// FACTORY UNIVERSAL TIPADO
|
|
631
|
+
function createMyElement(props) {
|
|
632
|
+
const el = document.createElement('my-element');
|
|
633
|
+
if (props) {
|
|
634
|
+
Object.assign(el, props);
|
|
635
|
+
}
|
|
636
|
+
return el;
|
|
637
|
+
}
|
|
627
638
|
|
|
628
639
|
return __webpack_exports__;
|
|
629
640
|
})()
|