@medyll/idae-be 0.75.0 → 0.77.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.
@@ -21,6 +21,8 @@ export class AttrHandler {
21
21
  return this.beElement;
22
22
  }
23
23
  get(name) {
24
+ if (typeof this.beElement.node === 'string')
25
+ return document.querySelector(this.beElement.node || '')?.getAttribute(name || '') || null;
24
26
  if (this.beElement.isWhat !== 'element')
25
27
  return null;
26
28
  const el = this.beElement.node;
@@ -92,7 +92,7 @@ export class StylesHandler {
92
92
  }
93
93
  // get style
94
94
  get(key) {
95
- return '';
95
+ return 'redfer';
96
96
  }
97
97
  // unset style
98
98
  unset(key) {
@@ -110,7 +110,9 @@ export class StylesHandler {
110
110
  }
111
111
  applyStyle(property, value) {
112
112
  this.beElement.eachNode((el) => {
113
- el.style.setProperty(property, value);
113
+ el.style[property] = value;
114
+ // el.style.setProperty(property, value);
115
+ // console.log(`Setting style ${property}: ${value}`);
114
116
  });
115
117
  }
116
118
  }
@@ -225,9 +225,8 @@ export class WalkHandler {
225
225
  try {
226
226
  const ret = [];
227
227
  this.beElement.eachNode((el) => {
228
- const result = this.selectWhile(el, method, qy);
229
- if (result)
230
- ret.push(result);
228
+ const results = this.selectWhile(el, method, qy);
229
+ ret.push(...results);
231
230
  });
232
231
  callback?.({
233
232
  root: this.beElement,
@@ -238,7 +237,6 @@ export class WalkHandler {
238
237
  }
239
238
  catch (e) {
240
239
  console.log(e);
241
- console.log(method);
242
240
  }
243
241
  return this.beElement;
244
242
  };
@@ -263,13 +261,16 @@ export class WalkHandler {
263
261
  closest: 'closest'
264
262
  };
265
263
  const property = dict[direction] ?? direction;
266
- let sibling = element[property];
264
+ if (property === 'children') {
265
+ const children = Array.from(element.children);
266
+ return selector ? children.filter((child) => child.matches(selector)) : children;
267
+ }
267
268
  if (property === 'closest') {
268
269
  return element.closest(selector ?? '*');
269
270
  }
271
+ let sibling = element[property];
270
272
  while (sibling) {
271
- console.log({ direction, selector, sibling });
272
- if (!selector || sibling?.matches(selector)) {
273
+ if (!selector || sibling.matches(selector)) {
273
274
  return sibling;
274
275
  }
275
276
  sibling = sibling[property];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@medyll/idae-be",
3
3
  "scope": "@medyll",
4
- "version": "0.75.0",
4
+ "version": "0.77.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",