@design-factory/angular 21.0.3 → 21.1.0-next.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/drawer/README.md +54 -0
- package/fesm2022/design-factory-angular-drawer.mjs +202 -67
- package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
- package/fesm2022/design-factory-angular-internals.mjs +439 -17
- package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
- package/fesm2022/design-factory-angular-sidenav.mjs +223 -210
- package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
- package/fesm2022/design-factory-angular-theme.mjs +198 -0
- package/fesm2022/design-factory-angular-theme.mjs.map +1 -0
- package/fesm2022/design-factory-angular-topnav.mjs +1538 -0
- package/fesm2022/design-factory-angular-topnav.mjs.map +1 -0
- package/node_modules/@agnos-ui/core/README.md +5 -0
- package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +314 -0
- package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +315 -0
- package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +9 -0
- package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +10 -0
- package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +94 -0
- package/node_modules/@agnos-ui/core/collapse-CP79atna.js +95 -0
- package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +73 -0
- package/node_modules/@agnos-ui/core/common-DFyZvkII.js +74 -0
- package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +333 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.cjs +7 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.js +7 -0
- package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +37 -0
- package/node_modules/@agnos-ui/core/components/alert/common.d.ts +138 -0
- package/node_modules/@agnos-ui/core/components/alert/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/alert/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/alert/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +247 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.cjs +292 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.js +292 -0
- package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +135 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/commonProps.d.ts +11 -0
- package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +279 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/modal/index.cjs +8 -0
- package/node_modules/@agnos-ui/core/components/modal/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/modal/index.js +8 -0
- package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +245 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +313 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +91 -0
- package/node_modules/@agnos-ui/core/components/rating/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/rating/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/rating/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +191 -0
- package/node_modules/@agnos-ui/core/components/slider/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/slider/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/slider/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +25 -0
- package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +383 -0
- package/node_modules/@agnos-ui/core/components/toast/index.cjs +7 -0
- package/node_modules/@agnos-ui/core/components/toast/index.d.ts +2 -0
- package/node_modules/@agnos-ui/core/components/toast/index.js +7 -0
- package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +66 -0
- package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +128 -0
- package/node_modules/@agnos-ui/core/components/tree/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/tree/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/tree/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +143 -0
- package/node_modules/@agnos-ui/core/config.cjs +36 -0
- package/node_modules/@agnos-ui/core/config.d.ts +117 -0
- package/node_modules/@agnos-ui/core/config.js +36 -0
- package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +523 -0
- package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +522 -0
- package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +328 -0
- package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +329 -0
- package/node_modules/@agnos-ui/core/index.cjs +134 -0
- package/node_modules/@agnos-ui/core/index.d.ts +29 -0
- package/node_modules/@agnos-ui/core/index.js +134 -0
- package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +32 -0
- package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +31 -0
- package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +252 -0
- package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +253 -0
- package/node_modules/@agnos-ui/core/package.json +57 -0
- package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +255 -0
- package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +254 -0
- package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +86 -0
- package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +87 -0
- package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +118 -0
- package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +119 -0
- package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +184 -0
- package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +183 -0
- package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +30 -0
- package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +31 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.cjs +41 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +31 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.js +41 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.cjs +111 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +76 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.js +111 -0
- package/node_modules/@agnos-ui/core/services/focusElement.cjs +46 -0
- package/node_modules/@agnos-ui/core/services/focusElement.d.ts +9 -0
- package/node_modules/@agnos-ui/core/services/focusElement.js +46 -0
- package/node_modules/@agnos-ui/core/services/focustrack.cjs +47 -0
- package/node_modules/@agnos-ui/core/services/focustrack.d.ts +40 -0
- package/node_modules/@agnos-ui/core/services/focustrack.js +47 -0
- package/node_modules/@agnos-ui/core/services/hash.cjs +15 -0
- package/node_modules/@agnos-ui/core/services/hash.d.ts +3 -0
- package/node_modules/@agnos-ui/core/services/hash.js +15 -0
- package/node_modules/@agnos-ui/core/services/intersection.cjs +53 -0
- package/node_modules/@agnos-ui/core/services/intersection.d.ts +30 -0
- package/node_modules/@agnos-ui/core/services/intersection.js +53 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.cjs +14 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +8 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.js +14 -0
- package/node_modules/@agnos-ui/core/services/navManager.cjs +166 -0
- package/node_modules/@agnos-ui/core/services/navManager.d.ts +144 -0
- package/node_modules/@agnos-ui/core/services/navManager.js +166 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +60 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +42 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +60 -0
- package/node_modules/@agnos-ui/core/services/portal.cjs +42 -0
- package/node_modules/@agnos-ui/core/services/portal.d.ts +16 -0
- package/node_modules/@agnos-ui/core/services/portal.js +42 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +54 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +18 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.js +54 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +44 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +16 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.js +44 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +186 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +166 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +186 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +40 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +49 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.js +40 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +32 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +25 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +32 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +37 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +47 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +37 -0
- package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +807 -0
- package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +808 -0
- package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +4 -0
- package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +3 -0
- package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +190 -0
- package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +191 -0
- package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +228 -0
- package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +229 -0
- package/node_modules/@agnos-ui/core/types.cjs +6 -0
- package/node_modules/@agnos-ui/core/types.d.ts +246 -0
- package/node_modules/@agnos-ui/core/types.js +6 -0
- package/node_modules/@agnos-ui/core/utils/directive.cjs +28 -0
- package/node_modules/@agnos-ui/core/utils/directive.d.ts +352 -0
- package/node_modules/@agnos-ui/core/utils/directive.js +28 -0
- package/node_modules/@agnos-ui/core/utils/func.cjs +7 -0
- package/node_modules/@agnos-ui/core/utils/func.d.ts +11 -0
- package/node_modules/@agnos-ui/core/utils/func.js +7 -0
- package/node_modules/@agnos-ui/core/utils/id.cjs +5 -0
- package/node_modules/@agnos-ui/core/utils/id.d.ts +6 -0
- package/node_modules/@agnos-ui/core/utils/id.js +5 -0
- package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +10 -0
- package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +57 -0
- package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +75 -0
- package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +9 -0
- package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +5 -0
- package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +98 -0
- package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +8 -0
- package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +16 -0
- package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +17 -0
- package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +7 -0
- package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +54 -0
- package/node_modules/@agnos-ui/core/utils/stores.cjs +172 -0
- package/node_modules/@agnos-ui/core/utils/stores.d.ts +224 -0
- package/node_modules/@agnos-ui/core/utils/stores.js +172 -0
- package/node_modules/@agnos-ui/core/utils/widget.cjs +8 -0
- package/node_modules/@agnos-ui/core/utils/widget.d.ts +11 -0
- package/node_modules/@agnos-ui/core/utils/widget.js +8 -0
- package/node_modules/@agnos-ui/core/utils/writables.cjs +16 -0
- package/node_modules/@agnos-ui/core/utils/writables.d.ts +95 -0
- package/node_modules/@agnos-ui/core/utils/writables.js +16 -0
- package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +103 -0
- package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +102 -0
- package/package.json +25 -6
- package/schematics/collection.json +1 -1
- package/types/design-factory-angular-drawer.d.ts +71 -13
- package/types/design-factory-angular-internals.d.ts +220 -31
- package/types/design-factory-angular-sidenav.d.ts +15 -7
- package/types/design-factory-angular-theme.d.ts +122 -0
- package/types/design-factory-angular-topnav.d.ts +435 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import type { ReadableSignal } from '@amadeus-it-group/tansu';
|
|
2
|
+
import type { AttributeValue, Directive, DirectivesAndOptParam, SSRHTMLElement, StyleKey, StyleKeyCustomProperty, StyleKeyKebabCase, StyleValue } from '../types';
|
|
3
|
+
import { type ClassValue } from 'clsx';
|
|
4
|
+
/**
|
|
5
|
+
* On a browser environment, returns true if the given element is an HTMLElement.
|
|
6
|
+
* On a server environment, always returns false.
|
|
7
|
+
* @param element - The element to check.
|
|
8
|
+
* @returns true in a browser environment if the given element is an HTMLElement, otherwise false.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isBrowserHTMLElement: (element: SSRHTMLElement) => element is HTMLElement;
|
|
11
|
+
/**
|
|
12
|
+
* A higher-order directive function that conditionally applies a directive based on the environment.
|
|
13
|
+
* If running in a browser environment, it applies the given directive to the node.
|
|
14
|
+
* If not in a browser environment, it returns a no-op function.
|
|
15
|
+
*
|
|
16
|
+
* @template T - The type of the directive's argument.
|
|
17
|
+
* @template U - The type of the HTML element the directive is applied to.
|
|
18
|
+
* @param directive - The directive to be conditionally applied.
|
|
19
|
+
* @returns - A directive that applies the given directive in a browser environment, or a no-op in a non-browser environment.
|
|
20
|
+
*/
|
|
21
|
+
export declare const browserDirective: <T, U extends HTMLElement>(directive: Directive<T, U>) => Directive<T, SSRHTMLElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Binds the given directive to a store that provides its argument.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
*
|
|
27
|
+
* The returned directive can be used without argument, it will ignore any argument passed to it
|
|
28
|
+
* and will call the provided directive with the content of the provided store as its argument,
|
|
29
|
+
* calling its update method when the content of the store changes.
|
|
30
|
+
*
|
|
31
|
+
* @template T - The type of the directive argument.
|
|
32
|
+
* @template U - The type of the SSRHTMLElement, defaults to SSRHTMLElement.
|
|
33
|
+
* @param directive - The directive to bind to the element.
|
|
34
|
+
* @param directiveArg$ - The signal to subscribe to for directive updates.
|
|
35
|
+
* @returns A directive that manages the lifecycle of the bound directive.
|
|
36
|
+
*/
|
|
37
|
+
export declare const bindDirective: <T, U extends SSRHTMLElement = SSRHTMLElement>(directive: Directive<T, U>, directiveArg$: ReadableSignal<T>) => Directive<void, U>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a directive that ignores any argument passed to it and calls the provided directive without any
|
|
40
|
+
* argument.
|
|
41
|
+
*
|
|
42
|
+
* @template T - The type of the directive's argument.
|
|
43
|
+
* @template U - The type of the SSRHTMLElement, defaults to SSRHTMLElement.
|
|
44
|
+
* @param directive - The directive to bind without arguments.
|
|
45
|
+
* @returns A new directive that does not require any arguments.
|
|
46
|
+
*/
|
|
47
|
+
export declare const bindDirectiveNoArg: <T, U extends SSRHTMLElement = SSRHTMLElement>(directive: Directive<T, U>) => Directive<void, U>;
|
|
48
|
+
/**
|
|
49
|
+
* Maps the argument of a directive to a new value using a provided function.
|
|
50
|
+
*
|
|
51
|
+
* @template T - The type of the original argument.
|
|
52
|
+
* @template U - The type of the mapped argument.
|
|
53
|
+
* @template V - The type of the SSRHTMLElement, defaults to SSRHTMLElement.
|
|
54
|
+
*
|
|
55
|
+
* @param directive - The original directive to be mapped.
|
|
56
|
+
* @param fn - The function to map the original argument to the new argument.
|
|
57
|
+
* @returns A new directive with the mapped argument.
|
|
58
|
+
*/
|
|
59
|
+
export declare const mapDirectiveArg: <T, U, V extends SSRHTMLElement = SSRHTMLElement>(directive: Directive<U, V>, fn: (arg: T) => U) => Directive<T, V>;
|
|
60
|
+
/**
|
|
61
|
+
* Returns a directive that subscribes to the given store while it is used on a DOM element,
|
|
62
|
+
* and that unsubscribes from it when it is no longer used.
|
|
63
|
+
*
|
|
64
|
+
* @param store - store on which there will be an active subscription while the returned directive is used.
|
|
65
|
+
* @param asyncUnsubscribe - true if unsubscribing from the store should be done asynchronously (which is the default), and
|
|
66
|
+
* false if it should be done synchronously when the directive is destroyed
|
|
67
|
+
* @returns The resulting directive.
|
|
68
|
+
*/
|
|
69
|
+
export declare const directiveSubscribe: (store: ReadableSignal<any>, asyncUnsubscribe?: boolean) => Directive;
|
|
70
|
+
/**
|
|
71
|
+
* Returns a directive that calls the provided function with the arguments passed to the directive
|
|
72
|
+
* on initialization and each time they are updated.
|
|
73
|
+
*
|
|
74
|
+
* @template T - The type of the argument that the update function accepts.
|
|
75
|
+
* @param update - Function called with the directive argument when the directive is initialized and when its argument is updated.
|
|
76
|
+
* @returns The resulting directive.
|
|
77
|
+
*/
|
|
78
|
+
export declare const directiveUpdate: <T>(update: (arg: T) => void) => Directive<T>;
|
|
79
|
+
/**
|
|
80
|
+
* Creates a registration array that allows elements to be added and removed.
|
|
81
|
+
*
|
|
82
|
+
* @template T - The type of elements in the array.
|
|
83
|
+
* @returns An object that includes a readable signal of the array and a register function.
|
|
84
|
+
*
|
|
85
|
+
* The returned object has the following properties:
|
|
86
|
+
* - `register`: A function to add an element to the array. It takes an element of type `T` as a parameter and returns a function to remove the element from the array.
|
|
87
|
+
*/
|
|
88
|
+
export declare const registrationArray: <T>() => ReadableSignal<T[]> & {
|
|
89
|
+
register: (element: T) => () => void;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Returns a directive and a store. The store contains at any time the array of all the DOM elements on which the directive is
|
|
93
|
+
* currently used.
|
|
94
|
+
*
|
|
95
|
+
* The directive is applied depending on the value of its argument:
|
|
96
|
+
* - `true` or `undefined`: Apply directive to the element.
|
|
97
|
+
* - `false`: Do not apply apply directive to the element.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* It is the same as {@link createConditionalBrowserStoreArrayDirective}, but the returned directive is also executed in a server environment
|
|
101
|
+
* and the type of the elements is {@link SSRHTMLElement} instead of HTMLElement.
|
|
102
|
+
*
|
|
103
|
+
* If the directive is intended to be used on a single element element, it may be more appropriate to use
|
|
104
|
+
* {@link createStoreDirective} instead.
|
|
105
|
+
*
|
|
106
|
+
*
|
|
107
|
+
* @returns An object with two properties: the `directive` property that is the directive to use on some DOM elements,
|
|
108
|
+
* and the `elements$` property that is the store containing an array of all the elements on which the directive is currently
|
|
109
|
+
* used.
|
|
110
|
+
*/
|
|
111
|
+
export declare const createConditionalStoreArrayDirective: () => {
|
|
112
|
+
directive: Directive<boolean | undefined>;
|
|
113
|
+
elements$: ReadableSignal<SSRHTMLElement[]>;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Returns a directive and a store. The store contains at any time the array of all the DOM elements on which the directive is
|
|
117
|
+
* currently used.
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* It is the same as {@link createBrowserStoreArrayDirective}, but the returned directive is also executed in a server environment
|
|
121
|
+
* and the type of the elements is {@link SSRHTMLElement} instead of HTMLElement.
|
|
122
|
+
*
|
|
123
|
+
* If the directive is intended to be used on a single element element, it may be more appropriate to use
|
|
124
|
+
* {@link createStoreDirective} instead.
|
|
125
|
+
*
|
|
126
|
+
* @returns An object with two properties: the `directive` property that is the directive to use on some DOM elements,
|
|
127
|
+
* and the `elements$` property that is the store containing an array of all the elements on which the directive is currently
|
|
128
|
+
* used.
|
|
129
|
+
*/
|
|
130
|
+
export declare const createStoreArrayDirective: () => {
|
|
131
|
+
directive: Directive;
|
|
132
|
+
elements$: ReadableSignal<SSRHTMLElement[]>;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Returns a directive and a store. The store contains at any time the array of all the DOM elements on which the directive is
|
|
136
|
+
* currently used.
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* It is the same as {@link createStoreArrayDirective}, but the returned directive is only executed in a browser environment
|
|
140
|
+
* and the type of the elements is HTMLElement instead of {@link SSRHTMLElement}.
|
|
141
|
+
*
|
|
142
|
+
* If the directive is intended to be used on a single element element, it may be more appropriate to use
|
|
143
|
+
* {@link createBrowserStoreDirective} instead.
|
|
144
|
+
*
|
|
145
|
+
* @returns An object with two properties: the `directive` property that is the directive to use on some DOM elements,
|
|
146
|
+
* and the `elements$` property that is the store containing an array of all the elements on which the directive is currently
|
|
147
|
+
* used.
|
|
148
|
+
*/
|
|
149
|
+
export declare const createBrowserStoreArrayDirective: () => {
|
|
150
|
+
directive: Directive<void, SSRHTMLElement>;
|
|
151
|
+
elements$: ReadableSignal<HTMLElement[]>;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Returns a directive and a store. The store contains at any time the array of all the DOM elements on which the directive is
|
|
155
|
+
* currently used.
|
|
156
|
+
*
|
|
157
|
+
* The directive is applied depending on the value of its argument:
|
|
158
|
+
* - `true` or `undefined`: Apply directive to the element.
|
|
159
|
+
* - `false`: Do not apply apply directive to the element.
|
|
160
|
+
*
|
|
161
|
+
* @remarks
|
|
162
|
+
* It is the same as {@link createConditionalStoreArrayDirective}, but the returned directive is only executed in a browser environment
|
|
163
|
+
* and the type of the elements is HTMLElement instead of {@link SSRHTMLElement}.
|
|
164
|
+
*
|
|
165
|
+
* If the directive is intended to be used on a single element element, it may be more appropriate to use
|
|
166
|
+
* {@link createBrowserStoreDirective} instead.
|
|
167
|
+
*
|
|
168
|
+
* @returns An object with two properties: the `directive` property that is the directive to use on some DOM elements,
|
|
169
|
+
* and the `elements$` property that is the store containing an array of all the elements on which the directive is currently
|
|
170
|
+
* used.
|
|
171
|
+
*/
|
|
172
|
+
export declare const createConditionalBrowserStoreArrayDirective: () => {
|
|
173
|
+
directive: Directive<boolean | undefined, SSRHTMLElement>;
|
|
174
|
+
elements$: ReadableSignal<HTMLElement[]>;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Returns a directive and a store. When the directive is used on a DOM element, the store contains that DOM element.
|
|
178
|
+
* When the directive is not used, the store contains null.
|
|
179
|
+
*
|
|
180
|
+
* @remarks
|
|
181
|
+
* It is the same as {@link createBrowserStoreDirective}, but the returned directive is also executed in a server environment
|
|
182
|
+
* and the type of the element is {@link SSRHTMLElement} instead of HTMLElement.
|
|
183
|
+
*
|
|
184
|
+
* If the directive is used on more than one element, an error is displayed in the console and the element is ignored.
|
|
185
|
+
* If the directive is intended to be used on more than one element, please use {@link createStoreArrayDirective} instead.
|
|
186
|
+
*
|
|
187
|
+
* @returns An object with two properties: the `directive` property that is the directive to use on one DOM element,
|
|
188
|
+
* and the `element$` property that is the store containing the element on which the directive is currently used (or null
|
|
189
|
+
* if the store is not currently used).
|
|
190
|
+
*/
|
|
191
|
+
export declare const createStoreDirective: () => {
|
|
192
|
+
directive: Directive;
|
|
193
|
+
element$: ReadableSignal<SSRHTMLElement | null>;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Returns a directive and a store. When the directive is used on a DOM element, the store contains that DOM element.
|
|
197
|
+
* When the directive is not used, the store contains null.
|
|
198
|
+
*
|
|
199
|
+
* @remarks
|
|
200
|
+
* It is the same as {@link createStoreDirective}, but the returned directive is only executed in a browser environment
|
|
201
|
+
* and the type of the element is HTMLElement instead of {@link SSRHTMLElement}.
|
|
202
|
+
*
|
|
203
|
+
* If the directive is used on more than one element, an error is displayed in the console and the element is ignored.
|
|
204
|
+
* If the directive is intended to be used on more than one element, please use {@link createStoreArrayDirective} instead.
|
|
205
|
+
*
|
|
206
|
+
* @returns An object with two properties: the `directive` property that is the directive to use on one DOM element,
|
|
207
|
+
* and the `element$` property that is the store containing the element on which the directive is currently used (or null
|
|
208
|
+
* if the store is not currently used).
|
|
209
|
+
*/
|
|
210
|
+
export declare const createBrowserStoreDirective: () => {
|
|
211
|
+
directive: Directive<void, SSRHTMLElement>;
|
|
212
|
+
element$: ReadableSignal<HTMLElement | null>;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Returns a directive that conditionally applies another directive.
|
|
216
|
+
*
|
|
217
|
+
* @param directive - The directive to conditionally apply.
|
|
218
|
+
* @param condition - The condition
|
|
219
|
+
* @returns A directive that applies the given directive when true, and removes it when false.
|
|
220
|
+
*/
|
|
221
|
+
export declare const conditionalDirective: <T, U extends SSRHTMLElement>(directive: Directive<T, U>, condition: ReadableSignal<boolean>) => Directive<T, U>;
|
|
222
|
+
/**
|
|
223
|
+
* Merges multiple directives into a single directive that executes all of them when called.
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* All directives receive the same argument upon initialization and update.
|
|
227
|
+
* Directives are created and updated in the same order as they appear in the arguments list,
|
|
228
|
+
* they are destroyed in the reverse order.
|
|
229
|
+
* All calls to the directives (to create, update and destroy them) are wrapped in a call to the
|
|
230
|
+
* batch function of tansu
|
|
231
|
+
*
|
|
232
|
+
* @template T - The type of the argument passed to the directive.
|
|
233
|
+
* @template U - The type of the SSRHTMLElement, defaults to SSRHTMLElement.
|
|
234
|
+
* @param args - The directives to merge.
|
|
235
|
+
* @returns A new directive that applies all the given directives.
|
|
236
|
+
*
|
|
237
|
+
* The returned directive has the following lifecycle methods:
|
|
238
|
+
* - `update(arg)`: Updates all merged directives with the given argument.
|
|
239
|
+
* - `destroy()`: Destroys all merged directives in reverse order.
|
|
240
|
+
*/
|
|
241
|
+
export declare const mergeDirectives: <T, U extends SSRHTMLElement = SSRHTMLElement>(...args: (Directive<T, U> | Directive<void, U>)[]) => Directive<T, U>;
|
|
242
|
+
/**
|
|
243
|
+
* Applies multiple directives to a given SSRHTMLElement and provides methods to update or destroy them.
|
|
244
|
+
*
|
|
245
|
+
* @template T - A tuple type representing the arguments for each directive.
|
|
246
|
+
* @template U - The type of the SSRHTMLElement, defaults to SSRHTMLElement.
|
|
247
|
+
*
|
|
248
|
+
* @param element - The SSRHTMLElement to which the directives will be applied.
|
|
249
|
+
* @param directives - An array of directives and their optional parameters.
|
|
250
|
+
*
|
|
251
|
+
* @returns An object containing:
|
|
252
|
+
* - `update`: A function to update the directives with new parameters.
|
|
253
|
+
* - `destroy`: A function to destroy all applied directives.
|
|
254
|
+
*/
|
|
255
|
+
export declare const multiDirective: <T extends any[], U extends SSRHTMLElement = SSRHTMLElement>(element: U, directives: DirectivesAndOptParam<T, U>) => {
|
|
256
|
+
update: (directives: DirectivesAndOptParam<any[], U>) => void;
|
|
257
|
+
destroy: () => void;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Properties for configuring server-side rendering directives.
|
|
261
|
+
*/
|
|
262
|
+
export interface AttributesDirectiveProps {
|
|
263
|
+
/**
|
|
264
|
+
* Events to be attached to an HTML element.
|
|
265
|
+
* @remarks
|
|
266
|
+
* Key-value pairs where keys are event types and values are event handlers.
|
|
267
|
+
xw
|
|
268
|
+
*/
|
|
269
|
+
events?: Partial<{
|
|
270
|
+
[K in keyof HTMLElementEventMap]: {
|
|
271
|
+
handler: (this: HTMLElement, event: HTMLElementEventMap[K]) => void;
|
|
272
|
+
options?: boolean | AddEventListenerOptions;
|
|
273
|
+
} | ((this: HTMLElement, event: HTMLElementEventMap[K]) => void);
|
|
274
|
+
}>;
|
|
275
|
+
/**
|
|
276
|
+
* Attributes to be added to the provided node.
|
|
277
|
+
* @remarks
|
|
278
|
+
* The `style` attribute must be added separately.
|
|
279
|
+
*/
|
|
280
|
+
attributes?: Record<string, ReadableSignal<AttributeValue>>;
|
|
281
|
+
/**
|
|
282
|
+
* Styles to be added to an HTML element.
|
|
283
|
+
* @remarks
|
|
284
|
+
* Key-value pairs where keys are CSS style properties and values are style values.
|
|
285
|
+
*/
|
|
286
|
+
styles?: Partial<Record<StyleKey, ReadableSignal<StyleValue>>>;
|
|
287
|
+
/**
|
|
288
|
+
* Class names to be added to an HTML element.
|
|
289
|
+
* @remarks
|
|
290
|
+
* Key-value pairs where keys are class names and values indicate whether the class should be added (true) or removed (false).
|
|
291
|
+
*/
|
|
292
|
+
classNames?: Record<string, ReadableSignal<boolean>>;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Creates a directive that binds attributes, styles, class names, and events to a DOM node.
|
|
296
|
+
*
|
|
297
|
+
* @template T - The type of the arguments passed to the directive.
|
|
298
|
+
* @param propsFn - A function that takes a readable signal of type `T` and returns an object containing
|
|
299
|
+
* attributes, styles, class names, and events to bind to the node.
|
|
300
|
+
* @returns A directive function that can be used to bind the specified properties to a DOM node.
|
|
301
|
+
*
|
|
302
|
+
* The returned directive function takes a DOM node and arguments of type `T`, and sets up the bindings
|
|
303
|
+
* specified by the `propsFn` function. It returns an object with `update` and `destroy` methods:
|
|
304
|
+
* - `update(args: T)`: Updates the arguments passed to the directive.
|
|
305
|
+
* - `destroy()`: Cleans up all bindings and event listeners.
|
|
306
|
+
*/
|
|
307
|
+
export declare const createAttributesDirective: <T = void>(propsFn: (arg: ReadableSignal<T>) => AttributesDirectiveProps) => Directive<T>;
|
|
308
|
+
/**
|
|
309
|
+
* Returns an object with the attributes, style and class keys containing information derived from a list of directives.
|
|
310
|
+
*
|
|
311
|
+
* - The `attributes` value is a JSON representation of key/value attributes, excepted for the `class` and `style` attributes
|
|
312
|
+
* - The `classNames` value is an array of string representing the classes to be applied
|
|
313
|
+
* - The `style` value is a JSON representation of the styles to be applied
|
|
314
|
+
*
|
|
315
|
+
* @template T - The type of the directives array.
|
|
316
|
+
* @param directives - List of directives to generate attributes from. Each parameter can be the directive or an array with the directive and its parameter
|
|
317
|
+
* @returns JSON object with the `attributes`, `class` and `style` keys.
|
|
318
|
+
*/
|
|
319
|
+
export declare const attributesData: <T extends any[]>(...directives: DirectivesAndOptParam<T>) => {
|
|
320
|
+
attributes: Record<string, string>;
|
|
321
|
+
classNames: string[];
|
|
322
|
+
style: Partial<Record<StyleKeyKebabCase | StyleKeyCustomProperty, StyleValue>>;
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Directive that takes as an argument a string, array or object containing CSS classes to be put on the HTML element.
|
|
326
|
+
* The class attribute is computed using the clsx library.
|
|
327
|
+
*/
|
|
328
|
+
export declare const classDirective: Directive<ClassValue>;
|
|
329
|
+
/**
|
|
330
|
+
* Combines multiple directives into a single attributes object.
|
|
331
|
+
*
|
|
332
|
+
* This function processes an array of directives and optional parameters,
|
|
333
|
+
* extracting attributes, class names, and styles. It then combines these
|
|
334
|
+
* into a single attributes object, where class names are joined into a
|
|
335
|
+
* single string and styles are formatted as a CSS string.
|
|
336
|
+
*
|
|
337
|
+
* @template T - The type of the directives and optional parameters.
|
|
338
|
+
* @param directives - The directives and optional parameters to process.
|
|
339
|
+
* @returns An object containing the combined attributes.
|
|
340
|
+
*/
|
|
341
|
+
export declare function directiveAttributes<T extends any[]>(...directives: DirectivesAndOptParam<T>): Record<string, string>;
|
|
342
|
+
/**
|
|
343
|
+
* Generates a record of SSR (Server-Side Rendering) attributes based on the provided directives.
|
|
344
|
+
*
|
|
345
|
+
* This function behaves differently depending on the environment:
|
|
346
|
+
* - In a browser environment (`BROWSER` is true), it returns an empty object.
|
|
347
|
+
* - In a non-browser environment, it delegates to the `directiveAttributes` function.
|
|
348
|
+
*
|
|
349
|
+
* @template T - A tuple type representing the directives and optional parameters.
|
|
350
|
+
* @returns A record of SSR attributes.
|
|
351
|
+
*/
|
|
352
|
+
export declare const ssrAttributes: <T extends any[]>(...directives: DirectivesAndOptParam<T>) => Record<string, string>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "@amadeus-it-group/tansu";
|
|
2
|
+
import "esm-env";
|
|
3
|
+
import { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v } from "../directive-Bsreu2z1.js";
|
|
4
|
+
import "./func.js";
|
|
5
|
+
export {
|
|
6
|
+
a as attributesData,
|
|
7
|
+
b as bindDirective,
|
|
8
|
+
c as bindDirectiveNoArg,
|
|
9
|
+
d as browserDirective,
|
|
10
|
+
e as classDirective,
|
|
11
|
+
f as conditionalDirective,
|
|
12
|
+
g as createAttributesDirective,
|
|
13
|
+
h as createBrowserStoreArrayDirective,
|
|
14
|
+
i as createBrowserStoreDirective,
|
|
15
|
+
j as createConditionalBrowserStoreArrayDirective,
|
|
16
|
+
k as createConditionalStoreArrayDirective,
|
|
17
|
+
l as createStoreArrayDirective,
|
|
18
|
+
m as createStoreDirective,
|
|
19
|
+
n as directiveAttributes,
|
|
20
|
+
o as directiveSubscribe,
|
|
21
|
+
p as directiveUpdate,
|
|
22
|
+
q as isBrowserHTMLElement,
|
|
23
|
+
r as mapDirectiveArg,
|
|
24
|
+
s as mergeDirectives,
|
|
25
|
+
t as multiDirective,
|
|
26
|
+
u as registrationArray,
|
|
27
|
+
v as ssrAttributes
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assigns the properties of `partial` to `json`, overwriting any existing properties in `json`.
|
|
3
|
+
* This function is useful to keep the type of `partial` as a Partial of `json`
|
|
4
|
+
* Returns a new object with the combined properties of `json` and `partial`.
|
|
5
|
+
*
|
|
6
|
+
* @param json The object to assign properties to.
|
|
7
|
+
* @param partial The object to assign properties from.
|
|
8
|
+
* @returns A new object with the combined properties of `json` and `partial`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function assign<T extends object>(json: T, partial: Partial<T>): T;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* a number type guard
|
|
3
|
+
* @param value - the value to check
|
|
4
|
+
* @returns true if the value is a number
|
|
5
|
+
*/
|
|
6
|
+
export declare function isNumber(value: any): value is number;
|
|
7
|
+
/**
|
|
8
|
+
* a boolean type guard
|
|
9
|
+
* @param value - the value to check
|
|
10
|
+
* @returns true if the value is a boolean
|
|
11
|
+
*/
|
|
12
|
+
export declare function isBoolean(value: any): value is boolean;
|
|
13
|
+
/**
|
|
14
|
+
* a function type guard
|
|
15
|
+
* @param value - the value to check
|
|
16
|
+
* @returns true if the value is a function
|
|
17
|
+
*/
|
|
18
|
+
export declare function isFunction(value: any): value is (...args: any[]) => any;
|
|
19
|
+
/**
|
|
20
|
+
* a string type guard
|
|
21
|
+
* @param value - the value to check
|
|
22
|
+
* @returns true if the value is a string
|
|
23
|
+
*/
|
|
24
|
+
export declare function isString(value: any): value is string;
|
|
25
|
+
/**
|
|
26
|
+
* an array type guard
|
|
27
|
+
* @returns true if the value is an array
|
|
28
|
+
*/
|
|
29
|
+
export declare const isArray: (arg: any) => arg is any[];
|
|
30
|
+
/**
|
|
31
|
+
* Clamp the value based on a maximum and optional minimum
|
|
32
|
+
* @param value - the value to check
|
|
33
|
+
* @param max - the max to clamp to
|
|
34
|
+
* @param [min] - the min to clamp to
|
|
35
|
+
* @returns the clamped value
|
|
36
|
+
*/
|
|
37
|
+
export declare function clamp(value: number, max: number, min?: number): number;
|
|
38
|
+
/**
|
|
39
|
+
* an html element type guard
|
|
40
|
+
* @param value - the value to check
|
|
41
|
+
* @returns true if the value is an instance of HTMLElement
|
|
42
|
+
*/
|
|
43
|
+
export declare const isHTMLElement: (value: any) => value is HTMLElement;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a new type guard that is based on the provided type guard and also returns true for null values.
|
|
46
|
+
* @param isType - base type guard
|
|
47
|
+
* @returns A type guard function that returns true for null values and calls the provided type guard for other values.
|
|
48
|
+
*/
|
|
49
|
+
export declare const allowNull: <T>(isType: (value: any) => value is T) => (value: any) => value is T | null;
|
|
50
|
+
/**
|
|
51
|
+
* Builds a new type guard to check if an element belongs to an enum list
|
|
52
|
+
*
|
|
53
|
+
* @template T - the type of the enum
|
|
54
|
+
* @param list - the list of all enum values
|
|
55
|
+
* @returns the type guard
|
|
56
|
+
*/
|
|
57
|
+
export declare function isFromEnum<T>(list: T[]): (value: any) => value is T;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ReadableSignal, UnsubscribeFunction, UnsubscribeObject } from '@amadeus-it-group/tansu';
|
|
2
|
+
import type { AttributeValue, SSRHTMLElement, StyleKey, StyleValue } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the common ancestor of the provided DOM elements.
|
|
5
|
+
* @param elements - array of DOM elements
|
|
6
|
+
* @returns the common ancestor, or null if the array is empty or if there is no common ancestor (e.g.: if elements are detached)
|
|
7
|
+
*/
|
|
8
|
+
export declare const computeCommonAncestor: (elements: HTMLElement[]) => HTMLElement | null;
|
|
9
|
+
/**
|
|
10
|
+
* Launch a reflow using a call to the provided html element getBoundingClientRect
|
|
11
|
+
* @param element - the html element
|
|
12
|
+
*/
|
|
13
|
+
export declare const reflow: (element?: SSRHTMLElement) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Attach the given css classes to the element
|
|
16
|
+
*
|
|
17
|
+
* @param element - the HTML element
|
|
18
|
+
* @param classes - the css classes
|
|
19
|
+
*/
|
|
20
|
+
export declare const addClasses: (element: SSRHTMLElement, classes?: string[]) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Remove the given css classes to the element
|
|
23
|
+
*
|
|
24
|
+
* @param element - the HTML element
|
|
25
|
+
* @param classes - the css classes
|
|
26
|
+
*/
|
|
27
|
+
export declare const removeClasses: (element: SSRHTMLElement, classes?: string[]) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Adds an event listener to the specified element.
|
|
30
|
+
*
|
|
31
|
+
* @param element - The HTML element to which the event listener will be added.
|
|
32
|
+
* @param type - A string representing the event type to listen for.
|
|
33
|
+
* @param fn - The event listener function or object.
|
|
34
|
+
* @param options - An options object that specifies characteristics about the event listener.
|
|
35
|
+
* @template K - event type
|
|
36
|
+
* @template T - event object type
|
|
37
|
+
* @returns A function that removes the event listener from the element.
|
|
38
|
+
*/
|
|
39
|
+
export declare function addEvent<K extends keyof HTMLElementEventMap, T extends HTMLElementEventMap[K]>(element: EventTarget, type: K, fn: (this: EventTarget, ev: T) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Binds a value from a `ReadableSignal` to the specified attribute of an HTML element.
|
|
42
|
+
* When the value emitted by the signal changes, it updates the attribute accordingly.
|
|
43
|
+
* If the value is null, undefined or `false`, the attribute is removed from the element.
|
|
44
|
+
* An empty string or `true` will result in an attribute with an empty value
|
|
45
|
+
*
|
|
46
|
+
* @param node The HTML element to bind the attribute to.
|
|
47
|
+
* @param attributeName The name of the attribute to bind.
|
|
48
|
+
* @param value$ The `ReadableSignal` representing the value to bind to the attribute.
|
|
49
|
+
*
|
|
50
|
+
* @returns unsubscription method to remove the binding
|
|
51
|
+
*/
|
|
52
|
+
export declare function bindAttribute(node: SSRHTMLElement, attributeName: string, value$: ReadableSignal<AttributeValue>): UnsubscribeFunction & UnsubscribeObject;
|
|
53
|
+
/**
|
|
54
|
+
* Binds a value from a `ReadableSignal` to the specified CSS style property of an HTML element.
|
|
55
|
+
* When the value emitted by the signal changes, it updates the style property accordingly.
|
|
56
|
+
* If the value is null, undefined or an empty string, the style property is cleared.
|
|
57
|
+
*
|
|
58
|
+
* @param node The HTML element to bind the style property to.
|
|
59
|
+
* @param styleName The name of the CSS style property to bind.
|
|
60
|
+
* @param value$ The `ReadableSignal` representing the value to bind to the style property.
|
|
61
|
+
*
|
|
62
|
+
* @returns unsubscription method to remove the binding
|
|
63
|
+
*/
|
|
64
|
+
export declare function bindStyle(node: SSRHTMLElement, styleName: StyleKey, value$: ReadableSignal<StyleValue>): UnsubscribeFunction & UnsubscribeObject;
|
|
65
|
+
/**
|
|
66
|
+
* Binds a `ReadableSignal` of boolean to the specified className of an HTML element.
|
|
67
|
+
* The className is added when the value is true, removed otherwise
|
|
68
|
+
*
|
|
69
|
+
* @param node - The HTML element to bind the style property to.
|
|
70
|
+
* @param className - The className to bind.
|
|
71
|
+
* @param value$ - The `ReadableSignal` representing the value to bind to the className.
|
|
72
|
+
*
|
|
73
|
+
* @returns unsubscription method to remove the binding
|
|
74
|
+
*/
|
|
75
|
+
export declare function bindClassName(node: SSRHTMLElement, className: string, value$: ReadableSignal<boolean>): () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the given HTML element is programmatically focusable.
|
|
3
|
+
* Warning: this is a best-effort approximation of whether the element is really focusable.
|
|
4
|
+
* It may not handle all use cases accurately.
|
|
5
|
+
*
|
|
6
|
+
* @param element - element to test
|
|
7
|
+
* @returns true if the element is programmatically focusable.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isFocusable: (element: HTMLElement) => boolean;
|