@htmlplus/element 0.7.3 → 0.7.4

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.
@@ -0,0 +1,2 @@
1
+ import { PlusElement } from '../../types';
2
+ export declare function Host(): (target: PlusElement, propertyKey: PropertyKey) => void;
@@ -0,0 +1,10 @@
1
+ import { defineProperty, host } from '../utils/index.js';
2
+ export function Host() {
3
+ return function (target, propertyKey) {
4
+ defineProperty(target, propertyKey, {
5
+ get() {
6
+ return host(this);
7
+ }
8
+ });
9
+ };
10
+ }
@@ -1,8 +1,11 @@
1
1
  export * from './bind.js';
2
2
  export * from './element.js';
3
3
  export * from './event.js';
4
+ export * from './host.js';
4
5
  export * from './listen.js';
5
6
  export * from './method.js';
6
7
  export * from './property.js';
8
+ export * from './query.js';
9
+ export * from './queryAll.js';
7
10
  export * from './state.js';
8
11
  export * from './watch.js';
@@ -1,8 +1,11 @@
1
1
  export * from './bind.js';
2
2
  export * from './element.js';
3
3
  export * from './event.js';
4
+ export * from './host.js';
4
5
  export * from './listen.js';
5
6
  export * from './method.js';
6
7
  export * from './property.js';
8
+ export * from './query.js';
9
+ export * from './queryAll.js';
7
10
  export * from './state.js';
8
11
  export * from './watch.js';
@@ -0,0 +1,2 @@
1
+ import { PlusElement } from '../../types';
2
+ export declare function Query(selectors: string): (target: PlusElement, propertyKey: PropertyKey) => void;
@@ -0,0 +1,11 @@
1
+ import { defineProperty, shadowRoot } from '../utils/index.js';
2
+ export function Query(selectors) {
3
+ return function (target, propertyKey) {
4
+ defineProperty(target, propertyKey, {
5
+ get() {
6
+ var _a;
7
+ return (_a = shadowRoot(this)) === null || _a === void 0 ? void 0 : _a.querySelector(selectors);
8
+ }
9
+ });
10
+ };
11
+ }
@@ -0,0 +1,2 @@
1
+ import { PlusElement } from '../../types';
2
+ export declare function QueryAll(selectors: string): (target: PlusElement, propertyKey: PropertyKey) => void;
@@ -0,0 +1,11 @@
1
+ import { defineProperty, shadowRoot } from '../utils/index.js';
2
+ export function QueryAll(selectors) {
3
+ return function (target, propertyKey) {
4
+ defineProperty(target, propertyKey, {
5
+ get() {
6
+ var _a;
7
+ return (_a = shadowRoot(this)) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selectors);
8
+ }
9
+ });
10
+ };
11
+ }
@@ -1 +1 @@
1
- export { classes, direction, getConfig, host, isRTL, isServer, on, off, query, queryAll, slots, styles, toUnit, setConfig } from '../utils/index.js';
1
+ export { classes, direction, getConfig, host, isRTL, isServer, on, off, slots, styles, toUnit, setConfig } from '../utils/index.js';
@@ -1 +1 @@
1
- export { classes, direction, getConfig, host, isRTL, isServer, on, off, query, queryAll, slots, styles, toUnit, setConfig } from '../utils/index.js';
1
+ export { classes, direction, getConfig, host, isRTL, isServer, on, off, slots, styles, toUnit, setConfig } from '../utils/index.js';
@@ -18,8 +18,6 @@ export * from './isEvent.js';
18
18
  export * from './isRTL.js';
19
19
  export * from './isServer.js';
20
20
  export * from './merge.js';
21
- export * from './query.js';
22
- export * from './queryAll.js';
23
21
  export * from './request.js';
24
22
  export * from './shadowRoot.js';
25
23
  export * from './slots.js';
@@ -18,8 +18,6 @@ export * from './isEvent.js';
18
18
  export * from './isRTL.js';
19
19
  export * from './isServer.js';
20
20
  export * from './merge.js';
21
- export * from './query.js';
22
- export * from './queryAll.js';
23
21
  export * from './request.js';
24
22
  export * from './shadowRoot.js';
25
23
  export * from './slots.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlplus/element",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "author": "Masood Abdolian <m.abdolian@gmail.com>",
@@ -1,3 +0,0 @@
1
- export declare function query<K extends keyof HTMLElementTagNameMap>(target: any, selectors: K): HTMLElementTagNameMap[K] | null;
2
- export declare function query<K extends keyof SVGElementTagNameMap>(target: any, selectors: K): SVGElementTagNameMap[K] | null;
3
- export declare function query<E extends Element = Element>(target: any, selectors: string): E | null;
@@ -1,5 +0,0 @@
1
- import { shadowRoot } from './shadowRoot.js';
2
- export function query(target, selectors) {
3
- var _a;
4
- return (_a = shadowRoot(target)) === null || _a === void 0 ? void 0 : _a.querySelector(selectors);
5
- }
@@ -1,3 +0,0 @@
1
- export declare function queryAll<K extends keyof HTMLElementTagNameMap>(target: any, selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
2
- export declare function queryAll<K extends keyof SVGElementTagNameMap>(target: any, selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
3
- export declare function queryAll<E extends Element = Element>(target: any, selectors: string): NodeListOf<E>;
@@ -1,5 +0,0 @@
1
- import { shadowRoot } from './shadowRoot.js';
2
- export function queryAll(target, selectors) {
3
- var _a;
4
- return (_a = shadowRoot(target)) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selectors);
5
- }