@medyll/idae-be 0.81.0 → 0.83.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 +8 -5
- package/dist/be.js +8 -10
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/modules/attrs.js +1 -1
- package/dist/modules/classes.d.ts +2 -0
- package/dist/modules/classes.js +4 -20
- package/dist/modules/data.d.ts +44 -1
- package/dist/modules/data.js +45 -7
- package/dist/modules/dom.d.ts +1 -0
- package/dist/modules/dom.js +1 -0
- package/dist/modules/position.d.ts +1 -0
- package/dist/modules/position.js +3 -5
- package/dist/modules/styles.d.ts +2 -0
- package/dist/modules/styles.js +19 -10
- package/dist/modules/text.d.ts +8 -8
- package/dist/modules/text.js +46 -20
- package/dist/modules/timers.d.ts +5 -4
- package/dist/modules/timers.js +64 -24
- package/dist/modules/walk.d.ts +2 -0
- package/dist/modules/walk.js +5 -4
- package/package.json +1 -1
- package/dist/modules/props.d.ts +0 -28
- package/dist/modules/props.js +0 -67
package/dist/be.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { IsWhat } from './types.js';
|
|
|
4
4
|
import { type DataHandlerHandle, DataHandler } from './modules/data.js';
|
|
5
5
|
import { EventsHandler, type EventHandlerHandle } from './modules/events.js';
|
|
6
6
|
import { type ClassHandlerHandler, ClassesHandler } from './modules/classes.js';
|
|
7
|
-
import { type PropsHandlerHandle } from './modules/props.js';
|
|
8
7
|
import { DomHandler, type DomHandlerHandle } from './modules/dom.js';
|
|
9
8
|
import { PositionHandler, type PositionHandlerHandle } from './modules/position.js';
|
|
10
9
|
import { WalkHandler } from './modules/walk.js';
|
|
@@ -13,15 +12,13 @@ import { TimersHandler } from './modules/timers.js';
|
|
|
13
12
|
export declare class Be {
|
|
14
13
|
inputNode: HTMLElement | HTMLElement[] | string;
|
|
15
14
|
isWhat: IsWhat;
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
timerOut: NodeJS.Timeout | null;
|
|
16
|
+
timerInterval: NodeJS.Timeout | null;
|
|
18
17
|
styles: (actions: BeStylesHandler) => Be;
|
|
19
18
|
private styleHandler;
|
|
20
19
|
setStyle: StylesHandler['set'];
|
|
21
20
|
getStyle: StylesHandler['get'];
|
|
22
21
|
unsetStyle: StylesHandler['unset'];
|
|
23
|
-
props: (actions: PropsHandlerHandle) => Be;
|
|
24
|
-
private propHandler;
|
|
25
22
|
data: (actions: DataHandlerHandle) => Be;
|
|
26
23
|
private dataHandler;
|
|
27
24
|
setData: DataHandler['set'];
|
|
@@ -57,6 +54,12 @@ export declare class Be {
|
|
|
57
54
|
private textHandler;
|
|
58
55
|
appendText: TextHandler['append'];
|
|
59
56
|
prependText: TextHandler['prepend'];
|
|
57
|
+
updateText: TextHandler['update'];
|
|
58
|
+
replaceText: TextHandler['replace'];
|
|
59
|
+
removeText: TextHandler['remove'];
|
|
60
|
+
clearText: TextHandler['clear'];
|
|
61
|
+
normalizeText: TextHandler['normalize'];
|
|
62
|
+
wrapText: TextHandler['wrap'];
|
|
60
63
|
events: (actions: EventHandlerHandle) => Be;
|
|
61
64
|
private eventHandler;
|
|
62
65
|
on: EventsHandler['on'];
|
package/dist/be.js
CHANGED
|
@@ -4,7 +4,6 @@ import { BeUtils } from './utils.js';
|
|
|
4
4
|
import { DataHandler } from './modules/data.js';
|
|
5
5
|
import { EventsHandler } from './modules/events.js';
|
|
6
6
|
import { ClassesHandler } from './modules/classes.js';
|
|
7
|
-
import { PropsHandler } from './modules/props.js';
|
|
8
7
|
import { DomHandler } from './modules/dom.js';
|
|
9
8
|
import { PositionHandler } from './modules/position.js';
|
|
10
9
|
import { WalkHandler } from './modules/walk.js';
|
|
@@ -14,17 +13,14 @@ export class Be {
|
|
|
14
13
|
inputNode;
|
|
15
14
|
isWhat;
|
|
16
15
|
//
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
timerOut = null;
|
|
17
|
+
timerInterval = null;
|
|
19
18
|
// styles
|
|
20
19
|
styles;
|
|
21
20
|
styleHandler;
|
|
22
21
|
setStyle;
|
|
23
22
|
getStyle;
|
|
24
23
|
unsetStyle;
|
|
25
|
-
// properties
|
|
26
|
-
props;
|
|
27
|
-
propHandler;
|
|
28
24
|
// dataSet
|
|
29
25
|
data;
|
|
30
26
|
dataHandler;
|
|
@@ -65,6 +61,12 @@ export class Be {
|
|
|
65
61
|
textHandler;
|
|
66
62
|
appendText;
|
|
67
63
|
prependText;
|
|
64
|
+
updateText;
|
|
65
|
+
replaceText;
|
|
66
|
+
removeText;
|
|
67
|
+
clearText;
|
|
68
|
+
normalizeText;
|
|
69
|
+
wrapText;
|
|
68
70
|
// events
|
|
69
71
|
events;
|
|
70
72
|
eventHandler;
|
|
@@ -114,10 +116,6 @@ export class Be {
|
|
|
114
116
|
this.styleHandler = new StylesHandler(this);
|
|
115
117
|
this.styles = this.handle(this.styleHandler);
|
|
116
118
|
this.attach(StylesHandler, 'Style');
|
|
117
|
-
// properties
|
|
118
|
-
this.propHandler = new PropsHandler(this);
|
|
119
|
-
this.props = this.handle(this.styleHandler);
|
|
120
|
-
this.attach(PropsHandler, 'Prop');
|
|
121
119
|
// dataSet
|
|
122
120
|
this.dataHandler = new DataHandler(this);
|
|
123
121
|
this.data = this.handle(this.styleHandler);
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './modules/walk.js';
|
|
|
5
5
|
export * from './modules/timers.js';
|
|
6
6
|
export * from './modules/text.js';
|
|
7
7
|
export * from './modules/styles.js';
|
|
8
|
-
export * from './modules/props.js';
|
|
9
8
|
export * from './modules/position.js';
|
|
10
9
|
export * from './modules/events.js';
|
|
11
10
|
export * from './modules/dom.js';
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export * from './modules/walk.js';
|
|
|
6
6
|
export * from './modules/timers.js';
|
|
7
7
|
export * from './modules/text.js';
|
|
8
8
|
export * from './modules/styles.js';
|
|
9
|
-
export * from './modules/props.js';
|
|
10
9
|
export * from './modules/position.js';
|
|
11
10
|
export * from './modules/events.js';
|
|
12
11
|
export * from './modules/dom.js';
|
package/dist/modules/attrs.js
CHANGED
|
@@ -47,7 +47,7 @@ export class AttrHandler {
|
|
|
47
47
|
el.removeAttribute(nameOrObject);
|
|
48
48
|
}
|
|
49
49
|
else if (typeof nameOrObject === 'object') {
|
|
50
|
-
Object.entries(nameOrObject).forEach(([name
|
|
50
|
+
Object.entries(nameOrObject).forEach(([name]) => {
|
|
51
51
|
el.removeAttribute(name);
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -32,6 +32,8 @@ export declare class ClassesHandler implements CommonHandler<ClassesHandler, Cla
|
|
|
32
32
|
private beElement;
|
|
33
33
|
static methods: classesMethods[];
|
|
34
34
|
constructor(beElement: Be);
|
|
35
|
+
methods: string[] | keyof ClassesHandler;
|
|
36
|
+
valueOf(): string;
|
|
35
37
|
handle(actions: ClassHandlerHandlerHandle): Be;
|
|
36
38
|
add(className: string | string[]): Be;
|
|
37
39
|
/**
|
package/dist/modules/classes.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BeUtils } from '../utils.js';
|
|
2
1
|
import { Be } from '../be.js';
|
|
3
2
|
var classesMethods;
|
|
4
3
|
(function (classesMethods) {
|
|
@@ -16,6 +15,10 @@ export class ClassesHandler {
|
|
|
16
15
|
constructor(beElement) {
|
|
17
16
|
this.beElement = beElement;
|
|
18
17
|
}
|
|
18
|
+
methods = ClassesHandler.methods;
|
|
19
|
+
valueOf() {
|
|
20
|
+
return `[ClassesHandler: methods=${this.methods}]`;
|
|
21
|
+
}
|
|
19
22
|
handle(actions) {
|
|
20
23
|
if (!actions)
|
|
21
24
|
return this.beElement;
|
|
@@ -26,25 +29,6 @@ export class ClassesHandler {
|
|
|
26
29
|
break;
|
|
27
30
|
}
|
|
28
31
|
});
|
|
29
|
-
/* this.beElement.eachNode((el) => {
|
|
30
|
-
if (actions.replace) {
|
|
31
|
-
let replacements: [string, string][];
|
|
32
|
-
if (typeof actions.replace === 'string') {
|
|
33
|
-
replacements = actions.replace
|
|
34
|
-
.split(';')
|
|
35
|
-
.map((pair) => pair.trim().split(' ') as [string, string]);
|
|
36
|
-
} else if (Array.isArray(actions.replace) && actions.replace.every(Array.isArray)) {
|
|
37
|
-
replacements = actions.replace as [string, string][];
|
|
38
|
-
} else {
|
|
39
|
-
replacements = [actions.replace.split(' ') as [string, string]];
|
|
40
|
-
}
|
|
41
|
-
replacements.forEach(([oldClass, newClass]) => {
|
|
42
|
-
if (oldClass && newClass) {
|
|
43
|
-
el.classList.replace(oldClass, newClass);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}); */
|
|
48
32
|
return this.beElement;
|
|
49
33
|
}
|
|
50
34
|
add(className) {
|
package/dist/modules/data.d.ts
CHANGED
|
@@ -6,19 +6,62 @@ declare enum dataMethods {
|
|
|
6
6
|
delete = "delete",
|
|
7
7
|
getKey = "getKey"
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Type definition for DataHandler actions.
|
|
11
|
+
*/
|
|
9
12
|
export type DataHandlerHandle = {
|
|
13
|
+
get: (keyOrObject: string | Record<string, string>, value?: string) => Be;
|
|
10
14
|
set: (keyOrObject: string | Record<string, string>, value?: string) => Be;
|
|
11
15
|
delete: (keyOrObject: string | Record<string, string>, value?: string) => Be;
|
|
16
|
+
getKey: (keyOrObject: string | Record<string, string>, value?: string) => Be;
|
|
12
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Handles operations on `data-*` attributes for Be elements.
|
|
20
|
+
*/
|
|
13
21
|
export declare class DataHandler implements CommonHandler<DataHandler> {
|
|
14
22
|
private beElement;
|
|
15
23
|
static methods: dataMethods[];
|
|
24
|
+
/**
|
|
25
|
+
* Initializes the DataHandler with a Be element.
|
|
26
|
+
* @param element - The Be element to operate on.
|
|
27
|
+
*/
|
|
16
28
|
constructor(element: Be);
|
|
29
|
+
methods: string[] | keyof DataHandler;
|
|
30
|
+
/**
|
|
31
|
+
* Handles dynamic method calls for data operations.
|
|
32
|
+
* @param actions - The action to perform (e.g., set, get, delete).
|
|
33
|
+
* @returns The Be element for chaining.
|
|
34
|
+
*/
|
|
17
35
|
handle(actions: Partial<DataHandlerHandle>): Be;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the value of a `data-*` attribute.
|
|
38
|
+
* @param key - The key of the `data-*` attribute to retrieve.
|
|
39
|
+
* @returns The value of the attribute, or `null` if not found.
|
|
40
|
+
*/
|
|
18
41
|
get(key: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Sets one or more `data-*` attributes.
|
|
44
|
+
* @param keyOrObject - A key-value pair or an object containing multiple key-value pairs.
|
|
45
|
+
* @param value - The value to set if a single key is provided.
|
|
46
|
+
* @returns The Be element for chaining.
|
|
47
|
+
*/
|
|
19
48
|
set(keyOrObject: string | Record<string, string>, value?: string): Be;
|
|
20
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Deletes one or more `data-*` attributes.
|
|
51
|
+
* @param keyOrObject - A key or an object containing multiple keys to delete.
|
|
52
|
+
* @returns The Be element for chaining.
|
|
53
|
+
*/
|
|
54
|
+
delete(keyOrObject: string | Record<string, string>): Be;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the value of a specific `data-*` attribute.
|
|
57
|
+
* @param key - The key of the `data-*` attribute to retrieve.
|
|
58
|
+
* @returns The value of the attribute, or `null` if not found.
|
|
59
|
+
*/
|
|
21
60
|
getKey(key: string | string[]): string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves all `data-*` attributes as a DOMStringMap.
|
|
63
|
+
* @returns A DOMStringMap containing all `data-*` attributes, or `null` if not applicable.
|
|
64
|
+
*/
|
|
22
65
|
valueOf(): DOMStringMap | null;
|
|
23
66
|
}
|
|
24
67
|
export {};
|
package/dist/modules/data.js
CHANGED
|
@@ -7,14 +7,27 @@ var dataMethods;
|
|
|
7
7
|
dataMethods["delete"] = "delete";
|
|
8
8
|
dataMethods["getKey"] = "getKey";
|
|
9
9
|
})(dataMethods || (dataMethods = {}));
|
|
10
|
+
/**
|
|
11
|
+
* Handles operations on `data-*` attributes for Be elements.
|
|
12
|
+
*/
|
|
10
13
|
export class DataHandler {
|
|
11
14
|
beElement;
|
|
12
15
|
static methods = Object.values(dataMethods);
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the DataHandler with a Be element.
|
|
18
|
+
* @param element - The Be element to operate on.
|
|
19
|
+
*/
|
|
13
20
|
constructor(element) {
|
|
14
21
|
this.beElement = element;
|
|
15
22
|
}
|
|
23
|
+
methods = DataHandler.methods;
|
|
24
|
+
/**
|
|
25
|
+
* Handles dynamic method calls for data operations.
|
|
26
|
+
* @param actions - The action to perform (e.g., set, get, delete).
|
|
27
|
+
* @returns The Be element for chaining.
|
|
28
|
+
*/
|
|
16
29
|
handle(actions) {
|
|
17
|
-
const { method, props } = BeUtils.resolveIndirection(
|
|
30
|
+
const { method, props } = BeUtils.resolveIndirection(this, actions);
|
|
18
31
|
switch (method) {
|
|
19
32
|
case 'set':
|
|
20
33
|
case 'delete':
|
|
@@ -23,12 +36,22 @@ export class DataHandler {
|
|
|
23
36
|
}
|
|
24
37
|
return this.beElement;
|
|
25
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the value of a `data-*` attribute.
|
|
41
|
+
* @param key - The key of the `data-*` attribute to retrieve.
|
|
42
|
+
* @returns The value of the attribute, or `null` if not found.
|
|
43
|
+
*/
|
|
26
44
|
get(key) {
|
|
27
|
-
// if space in string
|
|
28
45
|
if (this.beElement.isWhat !== 'element')
|
|
29
46
|
return null;
|
|
30
47
|
return this.beElement.inputNode.dataset[key] || null;
|
|
31
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets one or more `data-*` attributes.
|
|
51
|
+
* @param keyOrObject - A key-value pair or an object containing multiple key-value pairs.
|
|
52
|
+
* @param value - The value to set if a single key is provided.
|
|
53
|
+
* @returns The Be element for chaining.
|
|
54
|
+
*/
|
|
32
55
|
set(keyOrObject, value) {
|
|
33
56
|
this.beElement.eachNode((el) => {
|
|
34
57
|
if (typeof keyOrObject === 'string' && value !== undefined) {
|
|
@@ -42,25 +65,40 @@ export class DataHandler {
|
|
|
42
65
|
});
|
|
43
66
|
return this.beElement;
|
|
44
67
|
}
|
|
45
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Deletes one or more `data-*` attributes.
|
|
70
|
+
* @param keyOrObject - A key or an object containing multiple keys to delete.
|
|
71
|
+
* @returns The Be element for chaining.
|
|
72
|
+
*/
|
|
73
|
+
delete(keyOrObject) {
|
|
46
74
|
this.beElement.eachNode((el) => {
|
|
47
|
-
if (typeof keyOrObject === 'string'
|
|
48
|
-
|
|
75
|
+
if (typeof keyOrObject === 'string') {
|
|
76
|
+
// Deletes a single attribute
|
|
77
|
+
delete el.dataset[keyOrObject];
|
|
49
78
|
}
|
|
50
79
|
else if (typeof keyOrObject === 'object') {
|
|
51
|
-
|
|
80
|
+
// Deletes multiple attributes
|
|
81
|
+
Object.keys(keyOrObject).forEach((key) => {
|
|
52
82
|
delete el.dataset[key];
|
|
53
83
|
});
|
|
54
84
|
}
|
|
55
85
|
});
|
|
56
86
|
return this.beElement;
|
|
57
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Retrieves the value of a specific `data-*` attribute.
|
|
90
|
+
* @param key - The key of the `data-*` attribute to retrieve.
|
|
91
|
+
* @returns The value of the attribute, or `null` if not found.
|
|
92
|
+
*/
|
|
58
93
|
getKey(key) {
|
|
59
|
-
// if spaces in string
|
|
60
94
|
if (this.beElement.isWhat !== 'element')
|
|
61
95
|
return null;
|
|
62
96
|
return this.beElement.inputNode.dataset[key] || null;
|
|
63
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves all `data-*` attributes as a DOMStringMap.
|
|
100
|
+
* @returns A DOMStringMap containing all `data-*` attributes, or `null` if not applicable.
|
|
101
|
+
*/
|
|
64
102
|
valueOf() {
|
|
65
103
|
if (this.beElement.isWhat !== 'element')
|
|
66
104
|
return null;
|
package/dist/modules/dom.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export declare class DomHandler implements DomHandlerInterface, CommonHandler<Do
|
|
|
70
70
|
private beElement;
|
|
71
71
|
static methods: domMethods[];
|
|
72
72
|
constructor(element: Be);
|
|
73
|
+
methods: string[] | keyof DomHandler;
|
|
73
74
|
/**
|
|
74
75
|
* Handles various DOM operations on the element(s).
|
|
75
76
|
* @param actions An object specifying the DOM actions to perform.
|
package/dist/modules/dom.js
CHANGED
|
@@ -23,6 +23,7 @@ export declare class PositionHandler implements CommonHandler<PositionHandler, P
|
|
|
23
23
|
private beElement;
|
|
24
24
|
static methods: positionMethods[];
|
|
25
25
|
constructor(beElement: Be);
|
|
26
|
+
methods: string[] | keyof PositionHandler;
|
|
26
27
|
handle(actions: PositionHandlerHandle): Be;
|
|
27
28
|
/**
|
|
28
29
|
* Clones the position of a source element to this element.
|
package/dist/modules/position.js
CHANGED
|
@@ -12,6 +12,7 @@ export class PositionHandler {
|
|
|
12
12
|
constructor(beElement) {
|
|
13
13
|
this.beElement = beElement;
|
|
14
14
|
}
|
|
15
|
+
methods = PositionHandler.methods;
|
|
15
16
|
handle(actions) {
|
|
16
17
|
Object.entries(actions).forEach(([method, props]) => {
|
|
17
18
|
switch (method) {
|
|
@@ -141,11 +142,8 @@ export class PositionHandler {
|
|
|
141
142
|
const sourceRect = this.beElement.inputNode.getBoundingClientRect();
|
|
142
143
|
const targetRect = targetEl.getBoundingClientRect();
|
|
143
144
|
const { sourceAnchor, targetAnchor, offset = { x: 0, y: 0 } } = options;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
[sourceX, sourceY] = BeUtils.calculateAnchorPoint(sourceRect, sourceAnchor);
|
|
147
|
-
// Calculate target anchor point
|
|
148
|
-
[targetX, targetY] = BeUtils.calculateAnchorPoint(targetRect, targetAnchor);
|
|
145
|
+
const [sourceX, sourceY] = BeUtils.calculateAnchorPoint(sourceRect, sourceAnchor);
|
|
146
|
+
const [targetX, targetY] = BeUtils.calculateAnchorPoint(targetRect, targetAnchor);
|
|
149
147
|
// Calculate final position
|
|
150
148
|
const x = targetX - sourceX + offset.x;
|
|
151
149
|
const y = targetY - sourceY + offset.y;
|
package/dist/modules/styles.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type BeStylesHandlerMethods = keyof typeof beStyleMethods;
|
|
|
14
14
|
export declare class StylesHandler implements CommonHandler<StylesHandler> {
|
|
15
15
|
private beElement;
|
|
16
16
|
constructor(beElement: Be);
|
|
17
|
+
methods: string[];
|
|
18
|
+
valueOf(): string;
|
|
17
19
|
static methods: beStyleMethods[];
|
|
18
20
|
handle(actions: BeStylesHandler): Be;
|
|
19
21
|
private resolveIndirection;
|
package/dist/modules/styles.js
CHANGED
|
@@ -10,10 +10,14 @@ export class StylesHandler {
|
|
|
10
10
|
constructor(beElement) {
|
|
11
11
|
this.beElement = beElement;
|
|
12
12
|
}
|
|
13
|
+
methods = Object.keys(beStyleMethods);
|
|
14
|
+
valueOf() {
|
|
15
|
+
return `[StylesHandler: ${this.methods.join(', ')}]`;
|
|
16
|
+
}
|
|
13
17
|
static methods = Object.values(beStyleMethods);
|
|
14
18
|
handle(actions) {
|
|
15
19
|
const { method, args } = this.resolveIndirection(actions);
|
|
16
|
-
this.beElement.eachNode((
|
|
20
|
+
this.beElement.eachNode(() => {
|
|
17
21
|
switch (method) {
|
|
18
22
|
case 'set':
|
|
19
23
|
if (typeof args === 'string') {
|
|
@@ -37,7 +41,7 @@ export class StylesHandler {
|
|
|
37
41
|
}
|
|
38
42
|
break;
|
|
39
43
|
case 'get':
|
|
40
|
-
|
|
44
|
+
this.get(args);
|
|
41
45
|
break;
|
|
42
46
|
case 'unset':
|
|
43
47
|
this.unset(args);
|
|
@@ -47,15 +51,16 @@ export class StylesHandler {
|
|
|
47
51
|
return this.beElement;
|
|
48
52
|
}
|
|
49
53
|
resolveIndirection(actions) {
|
|
50
|
-
let method;
|
|
54
|
+
let method = 'get'; // Default to 'get' or any valid method
|
|
51
55
|
let args;
|
|
52
56
|
Object.keys(actions).forEach((action) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
const actionKey = action;
|
|
58
|
+
if (StylesHandler.methods.includes(actionKey)) {
|
|
59
|
+
method = actionKey;
|
|
60
|
+
args = actions[actionKey];
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
|
-
return { method, args };
|
|
63
|
+
return { method: method, args };
|
|
59
64
|
}
|
|
60
65
|
/**
|
|
61
66
|
* setStyle Sets one or more CSS styles for the selected element(s), including CSS custom properties.
|
|
@@ -92,7 +97,9 @@ export class StylesHandler {
|
|
|
92
97
|
get(key) {
|
|
93
98
|
let css = null;
|
|
94
99
|
this.beElement.eachNode((el) => {
|
|
100
|
+
// Prioritize inline styles
|
|
95
101
|
css = el.style[key] || null;
|
|
102
|
+
// Fallback to computed styles if inline style is not set
|
|
96
103
|
if (!css) {
|
|
97
104
|
const computedStyle = window.getComputedStyle(el);
|
|
98
105
|
css = computedStyle.getPropertyValue(key).trim();
|
|
@@ -109,9 +116,8 @@ export class StylesHandler {
|
|
|
109
116
|
}
|
|
110
117
|
applyStyle(property, value) {
|
|
111
118
|
this.beElement.eachNode((el) => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// console.log(`Setting style ${property}: ${value}`);
|
|
119
|
+
const kebabProperty = toKebabCase(property);
|
|
120
|
+
el.style.setProperty(kebabProperty, value);
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
123
|
getKey(key) {
|
|
@@ -122,3 +128,6 @@ export class StylesHandler {
|
|
|
122
128
|
return value;
|
|
123
129
|
}
|
|
124
130
|
}
|
|
131
|
+
function toKebabCase(property) {
|
|
132
|
+
return property.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
133
|
+
}
|
package/dist/modules/text.d.ts
CHANGED
|
@@ -25,17 +25,17 @@ export declare class TextHandler implements CommonHandler<TextHandler> {
|
|
|
25
25
|
private beElement;
|
|
26
26
|
static methods: textMethods[];
|
|
27
27
|
constructor(element: Be);
|
|
28
|
+
methods: string[] | keyof TextHandler;
|
|
28
29
|
get text(): string | null;
|
|
29
30
|
handle(actions: TextHandlerHandle): Be;
|
|
30
|
-
update(content: TextHandlerHandle['update'], callback?: HandlerCallBackFn):
|
|
31
|
-
updateText(content: TextHandlerHandle['updateText'], callback?: HandlerCallBackFn): void;
|
|
31
|
+
update(content: TextHandlerHandle['update'], callback?: HandlerCallBackFn): Be;
|
|
32
32
|
append(content: TextHandlerHandle['append'], callback?: HandlerCallBackFn): Be;
|
|
33
|
-
prepend(content: TextHandlerHandle['prepend'], callback?: HandlerCallBackFn):
|
|
34
|
-
replace(content: TextHandlerHandle['replace'], callback?: HandlerCallBackFn):
|
|
35
|
-
remove(
|
|
36
|
-
clear(
|
|
37
|
-
normalize(
|
|
38
|
-
wrap(content: TextHandlerHandle['wrap'], callback?: HandlerCallBackFn):
|
|
33
|
+
prepend(content: TextHandlerHandle['prepend'], callback?: HandlerCallBackFn): Be;
|
|
34
|
+
replace(content: TextHandlerHandle['replace'], callback?: HandlerCallBackFn): Be;
|
|
35
|
+
remove(callback?: HandlerCallBackFn): Be;
|
|
36
|
+
clear(callback?: HandlerCallBackFn): Be;
|
|
37
|
+
normalize(callback?: HandlerCallBackFn): Be;
|
|
38
|
+
wrap(content: TextHandlerHandle['wrap'], callback?: HandlerCallBackFn): Be;
|
|
39
39
|
valueOf(): string | null;
|
|
40
40
|
}
|
|
41
41
|
export {};
|
package/dist/modules/text.js
CHANGED
|
@@ -17,6 +17,7 @@ export class TextHandler {
|
|
|
17
17
|
constructor(element) {
|
|
18
18
|
this.beElement = element;
|
|
19
19
|
}
|
|
20
|
+
methods = TextHandler.methods;
|
|
20
21
|
get text() {
|
|
21
22
|
if (this.beElement.isWhat !== 'element')
|
|
22
23
|
return null;
|
|
@@ -24,29 +25,57 @@ export class TextHandler {
|
|
|
24
25
|
}
|
|
25
26
|
handle(actions) {
|
|
26
27
|
this.beElement.eachNode((el) => {
|
|
27
|
-
const { method, props } = BeUtils.resolveIndirection(TextHandler, actions);
|
|
28
|
+
const { method, props } = BeUtils.resolveIndirection(new TextHandler(this.beElement), actions);
|
|
28
29
|
switch (method) {
|
|
29
30
|
case 'update':
|
|
30
|
-
|
|
31
|
+
if (typeof props === 'string') {
|
|
32
|
+
el.innerText = props;
|
|
33
|
+
}
|
|
31
34
|
break;
|
|
32
|
-
case 'prepend':
|
|
33
|
-
|
|
35
|
+
case 'prepend':
|
|
36
|
+
if (typeof props === 'string') {
|
|
37
|
+
el.insertAdjacentText('afterbegin', props);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw new Error('Invalid props for prepend: must be a string.');
|
|
41
|
+
}
|
|
34
42
|
break;
|
|
35
43
|
case 'append':
|
|
36
|
-
|
|
44
|
+
if (typeof props === 'string') {
|
|
45
|
+
el.insertAdjacentText('beforeend', props);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new Error('Invalid props for append: must be a string.');
|
|
49
|
+
}
|
|
37
50
|
break;
|
|
38
51
|
case 'replace':
|
|
39
|
-
|
|
52
|
+
if (typeof props === 'string') {
|
|
53
|
+
el.textContent = props;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
throw new Error('Invalid props for replace: must be a string.');
|
|
57
|
+
}
|
|
40
58
|
break;
|
|
41
59
|
case 'remove':
|
|
42
60
|
el.remove();
|
|
43
61
|
break;
|
|
44
62
|
case 'clear':
|
|
45
|
-
el.
|
|
63
|
+
el.innerHTML = '';
|
|
46
64
|
break;
|
|
47
65
|
case 'normalize':
|
|
48
66
|
el.normalize();
|
|
49
67
|
break;
|
|
68
|
+
case 'wrap':
|
|
69
|
+
if (typeof props === 'string') {
|
|
70
|
+
const wrapper = document.createElement('div');
|
|
71
|
+
wrapper.innerHTML = props.trim();
|
|
72
|
+
const parent = wrapper.firstElementChild;
|
|
73
|
+
if (parent) {
|
|
74
|
+
el.parentNode?.insertBefore(parent, el);
|
|
75
|
+
parent.appendChild(el);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
50
79
|
}
|
|
51
80
|
actions?.callback?.({
|
|
52
81
|
fragment: props,
|
|
@@ -57,31 +86,28 @@ export class TextHandler {
|
|
|
57
86
|
return this.beElement;
|
|
58
87
|
}
|
|
59
88
|
update(content, callback) {
|
|
60
|
-
this.handle({ update: content, callback });
|
|
61
|
-
}
|
|
62
|
-
updateText(content, callback) {
|
|
63
|
-
this.handle({ updateText: content, callback });
|
|
89
|
+
return this.handle({ update: content, callback });
|
|
64
90
|
}
|
|
65
91
|
append(content, callback) {
|
|
66
92
|
return this.handle({ append: content, callback });
|
|
67
93
|
}
|
|
68
94
|
prepend(content, callback) {
|
|
69
|
-
this.handle({ prepend: content, callback });
|
|
95
|
+
return this.handle({ prepend: content, callback });
|
|
70
96
|
}
|
|
71
97
|
replace(content, callback) {
|
|
72
|
-
this.handle({ replace: content, callback });
|
|
98
|
+
return this.handle({ replace: content, callback });
|
|
73
99
|
}
|
|
74
|
-
remove(
|
|
75
|
-
this.handle({ remove:
|
|
100
|
+
remove(callback) {
|
|
101
|
+
return this.handle({ remove: undefined, callback });
|
|
76
102
|
}
|
|
77
|
-
clear(
|
|
78
|
-
this.handle({ clear:
|
|
103
|
+
clear(callback) {
|
|
104
|
+
return this.handle({ clear: undefined, callback });
|
|
79
105
|
}
|
|
80
|
-
normalize(
|
|
81
|
-
this.handle({ normalize:
|
|
106
|
+
normalize(callback) {
|
|
107
|
+
return this.handle({ normalize: undefined, callback });
|
|
82
108
|
}
|
|
83
109
|
wrap(content, callback) {
|
|
84
|
-
this.handle({ wrap: content, callback });
|
|
110
|
+
return this.handle({ wrap: content, callback });
|
|
85
111
|
}
|
|
86
112
|
valueOf() {
|
|
87
113
|
if (this.beElement.isWhat !== 'element')
|
package/dist/modules/timers.d.ts
CHANGED
|
@@ -10,15 +10,16 @@ type cd = Record<'timeout' | 'interval', number> & HandlerCallBack;
|
|
|
10
10
|
type cds = Record<'clearTimeout' | 'clearInterval', HandlerCallBackFn>;
|
|
11
11
|
type TimerHandlerHandle = cd & cds;
|
|
12
12
|
export declare class TimersHandler implements CommonHandler<TimersHandler> {
|
|
13
|
+
#private;
|
|
13
14
|
private beElement;
|
|
14
15
|
static methods: timersMethods[];
|
|
15
|
-
_timer: NodeJS.Timeout | null;
|
|
16
|
-
_interval: NodeJS.Timeout | null;
|
|
17
16
|
constructor(element: Be);
|
|
17
|
+
methods: string[] | keyof TimersHandler;
|
|
18
|
+
valueOf(): unknown;
|
|
18
19
|
handle(actions: TimerHandlerHandle): Be;
|
|
19
20
|
timeout(value: TimerHandlerHandle['timeout'], callback?: HandlerCallBackFn): Be;
|
|
20
21
|
interval(value: TimerHandlerHandle['interval'], callback?: HandlerCallBackFn): Be;
|
|
21
|
-
clearTimeout(callback?: HandlerCallBackFn):
|
|
22
|
-
clearInterval(callback?: HandlerCallBackFn):
|
|
22
|
+
clearTimeout(callback?: HandlerCallBackFn): Be;
|
|
23
|
+
clearInterval(callback?: HandlerCallBackFn): Be;
|
|
23
24
|
}
|
|
24
25
|
export {};
|
package/dist/modules/timers.js
CHANGED
|
@@ -9,11 +9,19 @@ var timersMethods;
|
|
|
9
9
|
export class TimersHandler {
|
|
10
10
|
beElement;
|
|
11
11
|
static methods = Object.values(timersMethods);
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
#timer = null;
|
|
13
|
+
#interval = null;
|
|
14
14
|
constructor(element) {
|
|
15
15
|
this.beElement = element;
|
|
16
16
|
}
|
|
17
|
+
methods = TimersHandler.methods;
|
|
18
|
+
valueOf() {
|
|
19
|
+
return {
|
|
20
|
+
methods: this.methods,
|
|
21
|
+
timer: this.#timer,
|
|
22
|
+
interval: this.#interval
|
|
23
|
+
};
|
|
24
|
+
}
|
|
17
25
|
handle(actions) {
|
|
18
26
|
if (!actions)
|
|
19
27
|
return this.beElement;
|
|
@@ -32,7 +40,15 @@ export class TimersHandler {
|
|
|
32
40
|
return this.beElement;
|
|
33
41
|
}
|
|
34
42
|
timeout(value, callback) {
|
|
35
|
-
this.beElement.
|
|
43
|
+
this.beElement.timerOut = setTimeout(() => {
|
|
44
|
+
callback?.({
|
|
45
|
+
method: 'timeout',
|
|
46
|
+
fragment: this.beElement.timerOut,
|
|
47
|
+
be: this.beElement,
|
|
48
|
+
root: this.beElement
|
|
49
|
+
});
|
|
50
|
+
}, value);
|
|
51
|
+
/* this.beElement.eachNode((el: HTMLElement) => {
|
|
36
52
|
const aug = be(el);
|
|
37
53
|
aug.BeTimer = setTimeout(() => {
|
|
38
54
|
callback?.({
|
|
@@ -42,43 +58,67 @@ export class TimersHandler {
|
|
|
42
58
|
root: this.beElement
|
|
43
59
|
});
|
|
44
60
|
}, value);
|
|
45
|
-
});
|
|
61
|
+
}); */
|
|
46
62
|
return this.beElement;
|
|
47
63
|
}
|
|
48
64
|
interval(value, callback) {
|
|
49
|
-
this.beElement.
|
|
65
|
+
this.beElement.timerInterval = setInterval(() => {
|
|
66
|
+
callback?.({
|
|
67
|
+
method: 'interval',
|
|
68
|
+
fragment: this.beElement.timerInterval,
|
|
69
|
+
be: this.beElement,
|
|
70
|
+
root: this.beElement
|
|
71
|
+
});
|
|
72
|
+
}, value);
|
|
73
|
+
/* this.beElement.eachNode((el: HTMLElement) => {
|
|
50
74
|
const aug = be(el);
|
|
51
|
-
aug.
|
|
75
|
+
aug.BeInterval = setInterval(() => {
|
|
52
76
|
callback?.({
|
|
53
77
|
method: 'interval',
|
|
54
|
-
fragment: aug.
|
|
78
|
+
fragment: aug.BeInterval,
|
|
55
79
|
be: be(el),
|
|
56
80
|
root: this.beElement
|
|
57
81
|
});
|
|
58
82
|
}, value);
|
|
59
|
-
});
|
|
83
|
+
}); */
|
|
60
84
|
return this.beElement;
|
|
61
85
|
}
|
|
62
86
|
clearTimeout(callback) {
|
|
63
|
-
this.beElement.
|
|
64
|
-
clearTimeout(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
87
|
+
if (this.beElement.timerOut)
|
|
88
|
+
clearTimeout(this.beElement.timerOut);
|
|
89
|
+
this.beElement.timerOut = null;
|
|
90
|
+
/* this.beElement.eachNode((el: HTMLElement) => {
|
|
91
|
+
const aug = be(el);
|
|
92
|
+
if (aug.BeTimer !== null) {
|
|
93
|
+
clearTimeout(aug.BeTimer);
|
|
94
|
+
aug.BeTimer = null;
|
|
95
|
+
}
|
|
96
|
+
}); */
|
|
97
|
+
callback?.({
|
|
98
|
+
method: 'clearTimeout',
|
|
99
|
+
fragment: null,
|
|
100
|
+
be: this.beElement,
|
|
101
|
+
root: this.beElement
|
|
71
102
|
});
|
|
103
|
+
return this.beElement;
|
|
72
104
|
}
|
|
73
105
|
clearInterval(callback) {
|
|
74
|
-
this.beElement.
|
|
75
|
-
clearInterval(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
106
|
+
if (this.beElement.timerInterval)
|
|
107
|
+
clearInterval(this.beElement.timerInterval);
|
|
108
|
+
this.beElement.timerInterval = null;
|
|
109
|
+
/* this.beElement.eachNode((el: HTMLElement) => {
|
|
110
|
+
const aug = be(el);
|
|
111
|
+
if (aug.BeInterval !== null) {
|
|
112
|
+
clearInterval(aug.BeInterval);
|
|
113
|
+
aug.BeInterval = null;
|
|
114
|
+
}
|
|
115
|
+
}); */
|
|
116
|
+
callback?.({
|
|
117
|
+
method: 'clearInterval',
|
|
118
|
+
fragment: null,
|
|
119
|
+
be: this.beElement,
|
|
120
|
+
root: this.beElement
|
|
82
121
|
});
|
|
122
|
+
return this.beElement;
|
|
83
123
|
}
|
|
84
124
|
}
|
package/dist/modules/walk.d.ts
CHANGED
|
@@ -101,6 +101,8 @@ export declare class WalkHandler implements WalkHandlerInterface, CommonHandler<
|
|
|
101
101
|
* @param beElement - The Be element to operate on.
|
|
102
102
|
*/
|
|
103
103
|
constructor(beElement: Be);
|
|
104
|
+
methods: string[];
|
|
105
|
+
valueOf(): unknown;
|
|
104
106
|
/**
|
|
105
107
|
* Handles multiple walk operations.
|
|
106
108
|
* @param actions - The actions to perform.
|
package/dist/modules/walk.js
CHANGED
|
@@ -29,6 +29,10 @@ export class WalkHandler {
|
|
|
29
29
|
constructor(beElement) {
|
|
30
30
|
this.beElement = beElement;
|
|
31
31
|
}
|
|
32
|
+
methods = WalkHandler.methods;
|
|
33
|
+
valueOf() {
|
|
34
|
+
return this.beElement;
|
|
35
|
+
}
|
|
32
36
|
/**
|
|
33
37
|
* Handles multiple walk operations.
|
|
34
38
|
* @param actions - The actions to perform.
|
|
@@ -114,7 +118,6 @@ export class WalkHandler {
|
|
|
114
118
|
this.beElement.eachNode((el) => {
|
|
115
119
|
if (el.parentNode) {
|
|
116
120
|
const siblings = Array.from(el.parentNode.children).filter((child) => child !== el);
|
|
117
|
-
console.log('siblings found:', siblings); // Debug
|
|
118
121
|
ret.push(...siblings.filter((sibling) => !qy || sibling.matches(qy)));
|
|
119
122
|
}
|
|
120
123
|
});
|
|
@@ -188,7 +191,6 @@ export class WalkHandler {
|
|
|
188
191
|
const ret = [];
|
|
189
192
|
this.beElement.eachNode((el) => {
|
|
190
193
|
const found = el.querySelector(qy);
|
|
191
|
-
console.log('find result:', found); // Debug
|
|
192
194
|
if (found)
|
|
193
195
|
ret.push(found);
|
|
194
196
|
});
|
|
@@ -231,7 +233,6 @@ export class WalkHandler {
|
|
|
231
233
|
const ret = [];
|
|
232
234
|
this.beElement.eachNode((el) => {
|
|
233
235
|
const result = this.selectWhile(el, method, qy);
|
|
234
|
-
console.log(`methodize result for ${method}:`, typeof result, result); // Debug
|
|
235
236
|
if (result)
|
|
236
237
|
ret.push(...(Array.isArray(result) ? result : [result]));
|
|
237
238
|
});
|
|
@@ -245,7 +246,7 @@ export class WalkHandler {
|
|
|
245
246
|
return resultBe;
|
|
246
247
|
}
|
|
247
248
|
catch (e) {
|
|
248
|
-
console.error(`Error in methodize for ${method}:`, e);
|
|
249
|
+
console.error(`Error in methodize for ${method}:`, e);
|
|
249
250
|
}
|
|
250
251
|
return this.beElement;
|
|
251
252
|
};
|
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.83.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",
|
package/dist/modules/props.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Be } from '../be.js';
|
|
2
|
-
import type { CommonHandler, HandlerCallBack, HandlerCallBackFn } from '../types.js';
|
|
3
|
-
declare enum PropsMethods {
|
|
4
|
-
set = "set",
|
|
5
|
-
get = "get",
|
|
6
|
-
delete = "delete",
|
|
7
|
-
getKey = "getKey"
|
|
8
|
-
}
|
|
9
|
-
export interface PropsHandlerHandle {
|
|
10
|
-
set?: {
|
|
11
|
-
[key: string]: unknown;
|
|
12
|
-
} & HandlerCallBack;
|
|
13
|
-
delete?: {
|
|
14
|
-
keys: string[];
|
|
15
|
-
} & HandlerCallBack;
|
|
16
|
-
}
|
|
17
|
-
export declare class PropsHandler implements CommonHandler<PropsHandler, PropsHandlerHandle> {
|
|
18
|
-
private beElement;
|
|
19
|
-
static methods: PropsMethods[];
|
|
20
|
-
constructor(element: Be);
|
|
21
|
-
handle(actions: PropsHandlerHandle): Be;
|
|
22
|
-
get(name: string, callback?: HandlerCallBackFn): any;
|
|
23
|
-
set(nameOrObject: string | Record<string, any>, value?: any, callback?: HandlerCallBackFn): Be;
|
|
24
|
-
delete(name: string, callback?: HandlerCallBackFn): Be;
|
|
25
|
-
getKey(key: string, callback?: HandlerCallBackFn): string | null;
|
|
26
|
-
valueOf(): Record<string, any> | null;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
package/dist/modules/props.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Be } from '../be.js';
|
|
2
|
-
var PropsMethods;
|
|
3
|
-
(function (PropsMethods) {
|
|
4
|
-
PropsMethods["set"] = "set";
|
|
5
|
-
PropsMethods["get"] = "get";
|
|
6
|
-
PropsMethods["delete"] = "delete";
|
|
7
|
-
PropsMethods["getKey"] = "getKey";
|
|
8
|
-
})(PropsMethods || (PropsMethods = {}));
|
|
9
|
-
export class PropsHandler {
|
|
10
|
-
beElement;
|
|
11
|
-
static methods = Object.values(PropsMethods);
|
|
12
|
-
constructor(element) {
|
|
13
|
-
this.beElement = element;
|
|
14
|
-
}
|
|
15
|
-
handle(actions) {
|
|
16
|
-
if (!actions)
|
|
17
|
-
return this.beElement;
|
|
18
|
-
Object.entries(actions).forEach(([method, props]) => {
|
|
19
|
-
switch (method) {
|
|
20
|
-
case 'set':
|
|
21
|
-
{
|
|
22
|
-
const [key, val] = Object.entries(props)[0];
|
|
23
|
-
this.set(key, val, props.callback);
|
|
24
|
-
}
|
|
25
|
-
break;
|
|
26
|
-
case 'delete':
|
|
27
|
-
this.delete(props.delete);
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return this.beElement;
|
|
32
|
-
}
|
|
33
|
-
get(name, callback) {
|
|
34
|
-
if (this.beElement.isWhat !== 'element')
|
|
35
|
-
return null;
|
|
36
|
-
return this.beElement.inputNode[name];
|
|
37
|
-
}
|
|
38
|
-
set(nameOrObject, value, callback) {
|
|
39
|
-
this.beElement.eachNode((el) => {
|
|
40
|
-
if (typeof nameOrObject === 'string' && value !== undefined) {
|
|
41
|
-
el[nameOrObject] = value;
|
|
42
|
-
}
|
|
43
|
-
else if (typeof nameOrObject === 'object') {
|
|
44
|
-
Object.entries(nameOrObject).forEach(([name, val]) => {
|
|
45
|
-
el[name] = val;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return this.beElement;
|
|
50
|
-
}
|
|
51
|
-
delete(name, callback) { }
|
|
52
|
-
getKey(key, callback) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
valueOf() {
|
|
56
|
-
if (this.beElement.isWhat !== 'element')
|
|
57
|
-
return null;
|
|
58
|
-
const el = this.beElement.inputNode;
|
|
59
|
-
const props = {};
|
|
60
|
-
for (let prop in el) {
|
|
61
|
-
if (el.hasOwnProperty(prop)) {
|
|
62
|
-
props[prop] = el[prop];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return props;
|
|
66
|
-
}
|
|
67
|
-
}
|