@medyll/idae-be 0.86.0 → 0.88.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/dist/be.d.ts +6 -10
- package/dist/be.js +13 -18
- package/dist/modules/attrs.d.ts +1 -0
- package/dist/modules/attrs.js +1 -0
- package/dist/modules/timers.d.ts +1 -1
- package/package.json +1 -1
package/dist/be.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ import { EventsHandler, type EventHandlerHandle } from './modules/events.js';
|
|
|
6
6
|
import { type ClassHandlerHandler, ClassesHandler } from './modules/classes.js';
|
|
7
7
|
import { DomHandler, type DomHandlerHandle } from './modules/dom.js';
|
|
8
8
|
import { PositionHandler, type PositionHandlerHandle } from './modules/position.js';
|
|
9
|
-
import { WalkHandler } from './modules/walk.js';
|
|
9
|
+
import { WalkHandler, type WalkHandlerHandle } from './modules/walk.js';
|
|
10
10
|
import { TextHandler, type TextHandlerHandle } from './modules/text.js';
|
|
11
|
-
import { TimersHandler } from './modules/timers.js';
|
|
11
|
+
import { TimersHandler, type TimerHandlerHandle } from './modules/timers.js';
|
|
12
12
|
export declare class Be {
|
|
13
|
+
[key: string]: unknown;
|
|
13
14
|
inputNode: HTMLElement | HTMLElement[] | string;
|
|
14
15
|
isWhat: IsWhat;
|
|
15
16
|
timerOut: NodeJS.Timeout | null;
|
|
@@ -71,7 +72,7 @@ export declare class Be {
|
|
|
71
72
|
removeClass: ClassesHandler['remove'];
|
|
72
73
|
toggleClass: ClassesHandler['toggle'];
|
|
73
74
|
replaceClass: ClassesHandler['replace'];
|
|
74
|
-
walk: (actions:
|
|
75
|
+
walk: (actions: WalkHandlerHandle) => Be;
|
|
75
76
|
private walkHandler;
|
|
76
77
|
up: WalkHandler['up'];
|
|
77
78
|
next: WalkHandler['next'];
|
|
@@ -84,7 +85,7 @@ export declare class Be {
|
|
|
84
85
|
firstChild: WalkHandler['firstChild'];
|
|
85
86
|
find: WalkHandler['find'];
|
|
86
87
|
findAll: WalkHandler['findAll'];
|
|
87
|
-
timers: (actions:
|
|
88
|
+
timers: (actions: TimerHandlerHandle) => Be;
|
|
88
89
|
private timerHandler;
|
|
89
90
|
timeout: TimersHandler['timeout'];
|
|
90
91
|
interval: TimersHandler['interval'];
|
|
@@ -123,14 +124,9 @@ export declare class Be {
|
|
|
123
124
|
data?: T;
|
|
124
125
|
headers?: Record<string, string>;
|
|
125
126
|
}): Promise<any>;
|
|
126
|
-
get node(): HTMLElement | HTMLElement[];
|
|
127
127
|
eachNode(callback: (el: HTMLElement) => void, firstChild?: boolean): void;
|
|
128
|
-
/** DOM
|
|
129
|
-
* Handles various DOM operations on the element(s).
|
|
130
|
-
* @param actions An object specifying the DOM actions to perform.
|
|
131
|
-
* @returns The Be instance for method chaining.
|
|
132
|
-
*/
|
|
133
128
|
get html(): string | null;
|
|
129
|
+
get node(): HTMLElement | HTMLElement[];
|
|
134
130
|
private attach;
|
|
135
131
|
private handle;
|
|
136
132
|
}
|
package/dist/be.js
CHANGED
|
@@ -118,11 +118,11 @@ export class Be {
|
|
|
118
118
|
this.attach(StylesHandler, 'Style');
|
|
119
119
|
// dataSet
|
|
120
120
|
this.dataHandler = new DataHandler(this);
|
|
121
|
-
this.data = this.handle(this.
|
|
121
|
+
this.data = this.handle(this.dataHandler);
|
|
122
122
|
this.attach(DataHandler, 'Data');
|
|
123
123
|
// attributes
|
|
124
124
|
this.attrHandler = new AttrHandler(this);
|
|
125
|
-
this.attrs = this.handle(this.
|
|
125
|
+
this.attrs = this.handle(this.attrHandler);
|
|
126
126
|
this.attach(AttrHandler, 'Attr');
|
|
127
127
|
// position
|
|
128
128
|
this.positionHandler = new PositionHandler(this);
|
|
@@ -130,7 +130,7 @@ export class Be {
|
|
|
130
130
|
this.attach(PositionHandler);
|
|
131
131
|
// text
|
|
132
132
|
this.textHandler = new TextHandler(this);
|
|
133
|
-
this.
|
|
133
|
+
this.text = this.handle(this.textHandler);
|
|
134
134
|
this.attach(TextHandler, 'Text');
|
|
135
135
|
// dom and handle
|
|
136
136
|
this.domHandler = new DomHandler(this);
|
|
@@ -263,16 +263,6 @@ export class Be {
|
|
|
263
263
|
headers: options.headers || {}
|
|
264
264
|
}).then((response) => response.json());
|
|
265
265
|
}
|
|
266
|
-
get node() {
|
|
267
|
-
switch (this.isWhat) {
|
|
268
|
-
case 'element':
|
|
269
|
-
return this.inputNode;
|
|
270
|
-
case 'array':
|
|
271
|
-
return Array.from(this.inputNode);
|
|
272
|
-
case 'qy':
|
|
273
|
-
return Array.from(document.querySelectorAll(this.inputNode));
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
266
|
eachNode(callback, firstChild) {
|
|
277
267
|
switch (this.isWhat) {
|
|
278
268
|
case 'element':
|
|
@@ -294,14 +284,19 @@ export class Be {
|
|
|
294
284
|
break;
|
|
295
285
|
}
|
|
296
286
|
}
|
|
297
|
-
/** DOM
|
|
298
|
-
* Handles various DOM operations on the element(s).
|
|
299
|
-
* @param actions An object specifying the DOM actions to perform.
|
|
300
|
-
* @returns The Be instance for method chaining.
|
|
301
|
-
*/
|
|
302
287
|
get html() {
|
|
303
288
|
return this.isWhat === 'element' ? this.inputNode.innerHTML : null;
|
|
304
289
|
}
|
|
290
|
+
get node() {
|
|
291
|
+
switch (this.isWhat) {
|
|
292
|
+
case 'element':
|
|
293
|
+
return this.inputNode;
|
|
294
|
+
case 'array':
|
|
295
|
+
return Array.from(this.inputNode);
|
|
296
|
+
case 'qy':
|
|
297
|
+
return Array.from(document.querySelectorAll(this.inputNode));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
305
300
|
attach(Handler, suffix = '') {
|
|
306
301
|
const fromMethods = Handler.methods || [];
|
|
307
302
|
fromMethods.forEach((method) => {
|
package/dist/modules/attrs.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class AttrHandler implements CommonHandler<AttrHandler, AttrHandl
|
|
|
21
21
|
* @param element - The Be element to operate on.
|
|
22
22
|
*/
|
|
23
23
|
constructor(element: Be);
|
|
24
|
+
methods: string[] | keyof AttrHandler;
|
|
24
25
|
/**
|
|
25
26
|
* Handles dynamic method calls for attribute operations.
|
|
26
27
|
* @param actions - The actions to perform (e.g., set, get, delete).
|
package/dist/modules/attrs.js
CHANGED
package/dist/modules/timers.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare enum timersMethods {
|
|
|
8
8
|
}
|
|
9
9
|
type cd = Record<'timeout' | 'interval', number> & HandlerCallBack;
|
|
10
10
|
type cds = Record<'clearTimeout' | 'clearInterval', HandlerCallBackFn>;
|
|
11
|
-
type TimerHandlerHandle = cd & cds;
|
|
11
|
+
export type TimerHandlerHandle = cd & cds;
|
|
12
12
|
export declare class TimersHandler implements CommonHandler<TimersHandler> {
|
|
13
13
|
#private;
|
|
14
14
|
private beElement;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medyll/idae-be",
|
|
3
3
|
"scope": "@medyll",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.88.0",
|
|
5
5
|
"description": "A powerful DOM manipulation library with a callback-based approach for precise element targeting. Provides consistent chaining, comprehensive DOM traversal, event handling, style management, and more. Written in TypeScript for modern browsers.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite dev",
|