@vialiq/web-components 0.13.0 → 0.15.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.
@@ -0,0 +1,33 @@
1
+ import { LitElement } from 'lit';
2
+ type Constructor<T = object> = new (...args: any[]) => T;
3
+ export declare class DraggableInterface {
4
+ draggable: boolean;
5
+ protected get _dragTarget(): HTMLElement | null;
6
+ protected get _dragHandle(): HTMLElement | null;
7
+ protected _resetDrag(): void;
8
+ protected _stopDrag(): void;
9
+ }
10
+ /**
11
+ * DraggableMixin
12
+ *
13
+ * Provides native drag-and-drop capabilities using Pointer Events to any LitElement.
14
+ * It is primarily designed for modals and dialogs that need to be repositioned by the user.
15
+ *
16
+ * By default, this applies a `transform: translate3d(x, y, 0)` to the element returned
17
+ * by `_dragTarget`. This is highly performant and avoids reflowing the layout.
18
+ *
19
+ * Subclasses MUST implement:
20
+ * - `_dragTarget`: The HTML element that moves (usually the outer container or dialog).
21
+ * - `_dragHandle`: The HTML element that accepts pointer events to initiate the drag (usually a header).
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * class MyModal extends DraggableMixin(LitElement) {
26
+ * protected get _dragTarget() { return this.shadowRoot.querySelector('.modal'); }
27
+ * protected get _dragHandle() { return this.shadowRoot.querySelector('.header'); }
28
+ * }
29
+ * ```
30
+ */
31
+ export declare function DraggableMixin<T extends Constructor<LitElement>>(Base: T): T & Constructor<DraggableInterface>;
32
+ export {};
33
+ //# sourceMappingURL=draggable-mixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draggable-mixin.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/draggable-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAItD,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,KAAK,WAAW,IAAI,WAAW,GAAG,IAAI,CAAC;IAChD,SAAS,KAAK,WAAW,IAAI,WAAW,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,UAAU,IAAI,IAAI;IAC5B,SAAS,CAAC,SAAS,IAAI,IAAI;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAC9D,IAAI,EAAE,CAAC,GACN,CAAC,GAAG,WAAW,CAAC,kBAAkB,CAAC,CA+NrC"}
@@ -14,13 +14,13 @@ export declare class FocusTrapInterface {
14
14
  * @param initialFocus - Optional element to focus first. Defaults to the
15
15
  * first focusable element found in the shadow root.
16
16
  */
17
- protected _activateFocusTrap(initialFocus?: HTMLElement): void;
17
+ protected _activateFocusTrap(initialFocus?: HTMLElement | null, autofocus?: boolean): void;
18
18
  /**
19
19
  * Deactivates the focus trap.
20
- * Removes the Tab intercept and restores focus to the element that was
21
- * focused immediately before `_activateFocusTrap()` was called.
20
+ * Removes the Tab intercept and restores focus to the specified returnFocus
21
+ * element, or falls back to the element that was focused before activation.
22
22
  */
23
- protected _deactivateFocusTrap(): void;
23
+ protected _deactivateFocusTrap(returnFocus?: HTMLElement | null): void;
24
24
  }
25
25
  /**
26
26
  * FocusTrapMixin
@@ -1 +1 @@
1
- {"version":3,"file":"focus-trap-mixin.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/focus-trap-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACrC;;;;;;;;OAQG;IACH,SAAS,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI;IAE9D;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,IAAI,IAAI;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAC9D,IAAI,EAAE,CAAC,GACN,CAAC,GAAG,WAAW,CAAC,kBAAkB,CAAC,CA2KrC"}
1
+ {"version":3,"file":"focus-trap-mixin.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/focus-trap-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACrC;;;;;;;;OAQG;IACH,SAAS,CAAC,kBAAkB,CAC1B,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,EACjC,SAAS,CAAC,EAAE,OAAO,GAClB,IAAI;IAEP;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;CACvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAC9D,IAAI,EAAE,CAAC,GACN,CAAC,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAqPrC"}
@@ -0,0 +1,58 @@
1
+ export type OverlayType = 'modal' | 'dropdown' | 'tooltip' | 'toast';
2
+ /**
3
+ * OverlayManagerService
4
+ *
5
+ * A singleton service responsible for managing the z-index stacking context
6
+ * of all floating elements (Modals, Dropdowns, Tooltips, Toasts) across the application.
7
+ *
8
+ * It ensures that newly opened overlays always appear on top of existing ones by
9
+ * maintaining a registry and dynamically calculating the next highest z-index.
10
+ * It also manages global state side-effects, such as locking `document.body` scroll
11
+ * when a modal is active.
12
+ */
13
+ declare class OverlayManagerService {
14
+ private _baseZIndexCache?;
15
+ private get baseZIndex();
16
+ private overlays;
17
+ private _previousOverflow;
18
+ /**
19
+ * Registers an element as an active overlay.
20
+ * Calculates and returns the appropriate z-index for this overlay.
21
+ *
22
+ * @param element The DOM element being registered (e.g., the modal dialog or dropdown listbox)
23
+ * @param type The type of overlay, used to determine behaviors like scroll-locking.
24
+ * @returns The calculated z-index to be applied to the element.
25
+ */
26
+ register(element: HTMLElement, type?: OverlayType): number;
27
+ /**
28
+ * Unregisters an element, removing it from the overlay stack.
29
+ * Should be called when the overlay is closed or disconnected from the DOM.
30
+ *
31
+ * @param element The DOM element to unregister.
32
+ */
33
+ unregister(element: HTMLElement): void;
34
+ /**
35
+ * Gets the assigned z-index for an element if it is currently registered.
36
+ *
37
+ * @param element The DOM element to query.
38
+ * @returns The z-index number, or null if the element is not registered.
39
+ */
40
+ getZIndex(element: HTMLElement): number | null;
41
+ /**
42
+ * Evaluates whether the provided element is currently the top-most active overlay.
43
+ * Useful for trapping focus or handling global Escape key presses.
44
+ *
45
+ * @param element The DOM element to check.
46
+ * @returns True if the element has the highest z-index in the registry.
47
+ */
48
+ isTopOverlay(element: HTMLElement): boolean;
49
+ /**
50
+ * Locks or unlocks the document.body scroll based on the presence of modals.
51
+ * Modals require the body to be unscrollable to trap scroll inside the modal.
52
+ * It applies a utility class `vi-scroll-locked` to the body.
53
+ */
54
+ private _updateBodyScroll;
55
+ }
56
+ export declare const OverlayManager: OverlayManagerService;
57
+ export {};
58
+ //# sourceMappingURL=overlay-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-manager.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/base/overlay-manager.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAQrE;;;;;;;;;;GAUG;AACH,cAAM,qBAAqB;IACzB,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,KAAK,UAAU,GAarB;IACD,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,iBAAiB,CAAuB;IAEhD;;;;;;;OAOG;IACI,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,GAAE,WAAwB,GAAG,MAAM;IAiB7E;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAK7C;;;;;OAKG;IACI,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAKrD;;;;;;OAMG;IACI,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAMlD;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;CAqB1B;AAGD,eAAO,MAAM,cAAc,uBAA8B,CAAC"}
@@ -22,7 +22,7 @@ declare const ViCheckbox_base: typeof ViElement & (new (...args: any[]) => impor
22
22
  *
23
23
  * @slot - Label text/content.
24
24
  *
25
- * @fires {CustomEvent<{checked:boolean; value:string}>} vialiq-change - Fires when user toggles checked state.
25
+ * @fires {CustomEvent<{checked:boolean; value:string}>} vi-checkbox-change - Fires when user toggles checked state.
26
26
  *
27
27
  * @csspart box - The visual checkbox square (custom-drawn box).
28
28
  * @csspart check - The SVG checkmark/indeterminate dash container.
@@ -1,7 +1,7 @@
1
1
  import { unsafeCSS, css, html } from 'lit';
2
2
  import { customElement, property } from 'lit/decorators.js';
3
3
  import { F as FocusableMixin } from '../focusable-mixin-CmxOyPX5.js';
4
- import { V as ValidityMixin } from '../validity-mixin-H4aOFJEr.js';
4
+ import { V as ValidityMixin } from '../validity-mixin-DO0ycRH2.js';
5
5
  import { V as ViElement } from '../vi-element-C6GfDPs3.js';
6
6
  import { classMap } from 'lit/directives/class-map.js';
7
7
 
@@ -594,7 +594,7 @@ new class extends _identity {
594
594
  const input = e.target;
595
595
  this.checked = input.checked;
596
596
  this.indeterminate = input.indeterminate;
597
- this.dispatchEvent(new CustomEvent('vialiq-change', {
597
+ this.dispatchEvent(new CustomEvent('vi-checkbox-change', {
598
598
  detail: {
599
599
  checked: this.checked,
600
600
  value: this.value