zs3-ui-components 1.1.9 → 1.1.10

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.

Potentially problematic release.


This version of zs3-ui-components might be problematic. Click here for more details.

package/README.md CHANGED
@@ -167,19 +167,23 @@ La classe `ZS3` proporciona una API similar a jQuery per a la manipulacio d'elem
167
167
  ```typescript
168
168
  // Seleccionar elements amb la funcio $
169
169
  const element = $('selector') // Retorna ZS3 | null (cerca des de document)
170
- const element = $('selector', rootEl) // Cerca dins d'un HTMLElement concret
170
+ const element = $('selector', rootEl) // Cerca dins d'un HTMLElement, Document o ShadowRoot
171
171
  const element = new ZS3('selector') // Constructor directe (cerca des de document)
172
- const element = new ZS3('selector', rootEl) // Constructor amb element arrel
172
+ const element = new ZS3('selector', rootEl) // Constructor amb element arrel (HTMLElement, Document o ShadowRoot)
173
173
 
174
174
  // Crear ZS3 des d'un HTMLElement
175
175
  const zs3 = ZS3.fromElement(htmlElement)
176
176
  ```
177
177
 
178
- El segon parametre (`root`) es opcional i per defecte es `document`. Permet limitar el `querySelectorAll` a un subarbre del DOM concret, util per exemple dins de Shadow DOM o components:
178
+ El segon parametre (`root`) es opcional i per defecte es `document`. Accepta `Document`, `HTMLElement` o `ShadowRoot`, la qual cosa permet limitar la cerca a un subarbre del DOM concret, incloent shadow roots de Web Components:
179
179
 
180
180
  ```typescript
181
181
  const container = document.getElementById('app')
182
182
  const buttons = $('button', container) // Nomes els botons dins de #app
183
+
184
+ // Dins d'un Web Component (shadow DOM)
185
+ const btn = $('button', this.root) // this.root pot ser ShadowRoot o HTMLElement
186
+ btn?.addEvent('click', handler)
183
187
  ```
184
188
 
185
189
  ### Propietats
@@ -376,8 +380,8 @@ El mateix parell `selector:eventType` pot estar actiu en múltiples roots simult
376
380
 
377
381
  | Metode | Signatura | Descripcio |
378
382
  |--------|-----------|------------|
379
- | `start()` | `(selector: string, eventType: keyof HTMLElementEventMap, root?: Document \| HTMLElement) => void` | Inicia el debug. Es poden registrar múltiples roots per al mateix selector+event. |
380
- | `stop()` | `(selector: string, eventType: keyof HTMLElementEventMap, root?: Document \| HTMLElement) => void` | Atura el debug per al root indicat. Si hi ha més roots actius per al mateix selector+event, els altres continuen. |
383
+ | `start()` | `(selector: string, eventType: keyof HTMLElementEventMap, root?: Document \| HTMLElement \| ShadowRoot) => void` | Inicia el debug. Es poden registrar múltiples roots per al mateix selector+event. |
384
+ | `stop()` | `(selector: string, eventType: keyof HTMLElementEventMap, root?: Document \| HTMLElement \| ShadowRoot) => void` | Atura el debug per al root indicat. Si hi ha més roots actius per al mateix selector+event, els altres continuen. |
381
385
  | `stopAll()` | `() => void` | Atura tot el debugging, per a tots els selectors, events i roots actius. |
382
386
  | `list()` | `() => string[]` | Llista tots els debugs actius en format `selector:eventType`. Si hi ha múltiples roots per al mateix parell, apareix una entrada per cada root. |
383
387
 
@@ -2073,7 +2077,7 @@ ZS3 suporta handlers d'events inline directament als atributs HTML dels componen
2073
2077
 
2074
2078
  | Variable | Tipus | Descripcio |
2075
2079
  |----------|-------|------------|
2076
- | `$` | `(selector: string, root?: Document \| HTMLElement) => ZS3 \| null` | Funcio de seleccio d'elements. El segon parametre opcional limita la cerca a un element arrel. |
2080
+ | `$` | `(selector: string, root?: Document \| HTMLElement \| ShadowRoot) => ZS3 \| null` | Funcio de seleccio d'elements. El segon parametre opcional limita la cerca a un element arrel. |
2077
2081
  | `log` | `$Log` | Sistema de logging. |
2078
2082
  | `debug` | `$Debug` | Utilitat de debugging. |
2079
2083
  | `params` | `$Parameters` | Gestio de parametres d'URL. |
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ class E {
2
2
  /**
3
3
  * Creates a new instance by selecting elements using a CSS selector.
4
4
  * @param {string} selector - CSS selector string.
5
- * @param {Document | HTMLElement} [root=document] - Element arrel des d'on es fa el querySelectorAll. Per defecte és document.
5
+ * @param {Document | HTMLElement | ShadowRoot} [root=document] - Element arrel des d'on es fa el querySelectorAll. Per defecte és document.
6
6
  */
7
7
  constructor(t, s = document) {
8
8
  this.list = [];
@@ -14,7 +14,7 @@ class E {
14
14
  * @returns {string} Library version.
15
15
  */
16
16
  static version() {
17
- return "1.1.9";
17
+ return "1.1.10";
18
18
  }
19
19
  /**
20
20
  * Creates a ZS3 instance from an HTMLElement.
package/dist/zs3.d.ts CHANGED
@@ -27,9 +27,9 @@ export declare class ZS3 {
27
27
  /**
28
28
  * Creates a new instance by selecting elements using a CSS selector.
29
29
  * @param {string} selector - CSS selector string.
30
- * @param {Document | HTMLElement} [root=document] - Element arrel des d'on es fa el querySelectorAll. Per defecte és document.
30
+ * @param {Document | HTMLElement | ShadowRoot} [root=document] - Element arrel des d'on es fa el querySelectorAll. Per defecte és document.
31
31
  */
32
- constructor(selector: string, root?: Document | HTMLElement);
32
+ constructor(selector: string, root?: Document | HTMLElement | ShadowRoot);
33
33
  /**
34
34
  * Returns the current library version.
35
35
  * @returns {string} Library version.
@@ -276,7 +276,7 @@ export declare class ZS3 {
276
276
  * @param selector Selector CSS
277
277
  * @param root Element arrel des d'on es fa el querySelectorAll (opcional, per defecte document)
278
278
  */
279
- export declare const $: (selector?: string, root?: Document | HTMLElement) => ZS3 | null;
279
+ export declare const $: (selector?: string, root?: Document | HTMLElement | ShadowRoot) => ZS3 | null;
280
280
  /**
281
281
  * Retorna informació de l'entorn d'execució.
282
282
  */
@@ -317,7 +317,7 @@ export declare class $Parameters {
317
317
  type DebugEntry = {
318
318
  selector: string;
319
319
  eventType: keyof HTMLElementEventMap;
320
- root: Document | HTMLElement;
320
+ root: Document | HTMLElement | ShadowRoot;
321
321
  };
322
322
  export declare class $Debug {
323
323
  /** Mapa de sessions de debug actives, indexades per "selector:eventType". Cada entrada pot tenir múltiples roots. */
@@ -330,7 +330,7 @@ export declare class $Debug {
330
330
  * @param eventType Tipus d'event
331
331
  * @param root Element arrel des d'on es fa la cerca (opcional, per defecte document)
332
332
  */
333
- start: (selector: string, eventType: keyof HTMLElementEventMap, root?: Document | HTMLElement) => void;
333
+ start: (selector: string, eventType: keyof HTMLElementEventMap, root?: Document | HTMLElement | ShadowRoot) => void;
334
334
  /**
335
335
  * Atura el debug d'un event sobre un selector per a un root concret.
336
336
  * Si el selector+eventType té més d'un root actiu, només s'elimina el root indicat.
@@ -338,7 +338,7 @@ export declare class $Debug {
338
338
  * @param eventType Tipus d'event
339
339
  * @param root Element arrel (opcional, per defecte document)
340
340
  */
341
- stop: (selector: string, eventType: keyof HTMLElementEventMap, root?: Document | HTMLElement) => void;
341
+ stop: (selector: string, eventType: keyof HTMLElementEventMap, root?: Document | HTMLElement | ShadowRoot) => void;
342
342
  /**
343
343
  * Atura tot el debugging, per a tots els selectors, events i roots actius.
344
344
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zs3-ui-components",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",