@agnos-ui/core 0.1.1 → 0.3.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/README.md +3 -3
- package/accordion-BaWN0_n-.js +330 -0
- package/accordion-BuIgxZ0S.cjs +329 -0
- package/alert-C4jCg9Pl.cjs +8 -0
- package/alert-Dlf-BV98.js +9 -0
- package/common-DRdsw5m8.js +76 -0
- package/common-nJRMXbwj.cjs +75 -0
- package/components/accordion/accordion.d.ts +57 -64
- package/components/accordion/index.cjs +7 -0
- package/components/accordion/index.js +7 -1
- package/components/alert/alert.d.ts +3 -12
- package/components/alert/common.d.ts +4 -13
- package/components/alert/index.cjs +10 -0
- package/components/alert/index.js +10 -2
- package/components/modal/index.cjs +7 -0
- package/components/modal/index.js +7 -1
- package/components/modal/modal.d.ts +7 -49
- package/components/pagination/index.cjs +5 -0
- package/components/pagination/index.d.ts +0 -1
- package/components/pagination/index.js +5 -2
- package/components/pagination/pagination.d.ts +107 -128
- package/components/progressbar/index.cjs +5 -0
- package/components/progressbar/index.js +5 -1
- package/components/progressbar/progressbar.d.ts +6 -22
- package/components/rating/index.cjs +5 -0
- package/components/rating/index.js +5 -1
- package/components/rating/rating.d.ts +16 -11
- package/components/select/index.cjs +6 -0
- package/components/select/index.js +6 -1
- package/components/select/select.d.ts +45 -57
- package/components/slider/index.cjs +5 -0
- package/components/slider/index.js +5 -1
- package/components/slider/slider.d.ts +63 -5
- package/components/toast/index.cjs +5 -0
- package/components/toast/index.d.ts +1 -0
- package/components/toast/index.js +5 -0
- package/components/toast/toast.d.ts +47 -0
- package/config.cjs +38 -0
- package/config.d.ts +6 -1
- package/config.js +35 -50
- package/directive-BTSEYLF3.cjs +404 -0
- package/directive-DCYlDznf.js +405 -0
- package/func-DR0n-ShK.js +7 -0
- package/func-Qd3cD9a3.cjs +6 -0
- package/index.cjs +119 -0
- package/index.d.ts +3 -1
- package/index.js +119 -31
- package/modal-BI2qUu1M.js +251 -0
- package/modal-rzMpATf5.cjs +250 -0
- package/package.json +30 -22
- package/pagination--GkwduJn.js +263 -0
- package/pagination-EWSWQT1I.cjs +262 -0
- package/progressbar-DH7DHYMp.cjs +83 -0
- package/progressbar-DuRX7_my.js +84 -0
- package/promise-BMJ8qhA8.cjs +118 -0
- package/promise-CY2U8bTP.js +119 -0
- package/rating-BR5wD7y2.js +173 -0
- package/rating-CmuYUSxy.cjs +172 -0
- package/select-BCs6HQWn.js +358 -0
- package/select-CCIKn8WR.cjs +357 -0
- package/services/extendWidget.cjs +32 -0
- package/services/extendWidget.d.ts +10 -5
- package/services/extendWidget.js +31 -34
- package/services/floatingUI.cjs +131 -0
- package/services/floatingUI.d.ts +30 -14
- package/services/floatingUI.js +128 -102
- package/services/focustrack.cjs +47 -0
- package/services/focustrack.js +45 -44
- package/services/hash.cjs +15 -0
- package/services/hash.d.ts +2 -0
- package/services/hash.js +15 -0
- package/services/intersection.cjs +53 -0
- package/services/intersection.js +48 -50
- package/services/matchMedia.cjs +13 -0
- package/services/matchMedia.d.ts +7 -0
- package/services/matchMedia.js +13 -0
- package/services/navManager.cjs +196 -0
- package/services/navManager.d.ts +24 -17
- package/services/navManager.js +186 -162
- package/services/portal.cjs +43 -0
- package/services/portal.js +41 -42
- package/services/resizeObserver.cjs +32 -0
- package/services/resizeObserver.d.ts +14 -0
- package/services/resizeObserver.js +32 -0
- package/services/siblingsInert.cjs +40 -0
- package/services/siblingsInert.js +31 -31
- package/services/transitions/baseTransitions.cjs +171 -0
- package/services/transitions/baseTransitions.d.ts +16 -16
- package/services/transitions/baseTransitions.js +159 -170
- package/services/transitions/collapse.cjs +44 -0
- package/services/transitions/collapse.js +41 -49
- package/services/transitions/cssTransitions.cjs +32 -0
- package/services/transitions/cssTransitions.d.ts +2 -1
- package/services/transitions/cssTransitions.js +29 -39
- package/services/transitions/simpleClassTransition.cjs +31 -0
- package/services/transitions/simpleClassTransition.js +30 -41
- package/slider-CA_fszn7.js +536 -0
- package/slider-DsLvT87U.cjs +535 -0
- package/toast-8tWp6x89.js +63 -0
- package/toast-Aw8o0Iwe.cjs +62 -0
- package/types.cjs +12 -0
- package/types.d.ts +21 -1
- package/types.js +11 -13
- package/utils/directive.cjs +26 -0
- package/utils/directive.d.ts +155 -4
- package/utils/directive.js +25 -189
- package/utils/internal/dom.d.ts +57 -3
- package/utils/internal/promise.d.ts +2 -2
- package/utils/internal/ssrHTMLElement.d.ts +7 -0
- package/utils/internal/textDirection.d.ts +1 -1
- package/utils/stores.cjs +163 -0
- package/utils/stores.d.ts +23 -20
- package/utils/stores.js +151 -269
- package/utils/writables.cjs +13 -0
- package/utils/writables.js +12 -71
- package/writables-D46sFgGK.cjs +85 -0
- package/writables-DoU_XYTX.js +86 -0
- package/components/accordion/accordion.js +0 -267
- package/components/alert/alert.js +0 -22
- package/components/alert/common.js +0 -69
- package/components/commonProps.js +0 -1
- package/components/modal/modal.js +0 -186
- package/components/pagination/bootstrap.d.ts +0 -8
- package/components/pagination/bootstrap.js +0 -110
- package/components/pagination/pagination.js +0 -149
- package/components/progressbar/progressbar.js +0 -78
- package/components/rating/rating.js +0 -138
- package/components/select/select.js +0 -266
- package/components/slider/slider.js +0 -415
- package/services/transitions/bootstrap/collapse.d.ts +0 -2
- package/services/transitions/bootstrap/collapse.js +0 -15
- package/services/transitions/bootstrap/fade.d.ts +0 -1
- package/services/transitions/bootstrap/fade.js +0 -7
- package/services/transitions/bootstrap.d.ts +0 -2
- package/services/transitions/bootstrap.js +0 -2
- package/utils/internal/checks.js +0 -60
- package/utils/internal/dom.js +0 -61
- package/utils/internal/func.js +0 -11
- package/utils/internal/isFocusable.js +0 -35
- package/utils/internal/math.js +0 -13
- package/utils/internal/promise.js +0 -169
- package/utils/internal/scrollbars.js +0 -33
- package/utils/internal/sort.js +0 -28
- package/utils/internal/textDirection.js +0 -7
- package/utils/internal/traversal.js +0 -105
package/utils/stores.cjs
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
+
const types = require("../types.cjs");
|
|
5
|
+
const func = require("../func-Qd3cD9a3.cjs");
|
|
6
|
+
function createPatch(stores) {
|
|
7
|
+
return function(storesValues) {
|
|
8
|
+
tansu.batch(() => {
|
|
9
|
+
var _a;
|
|
10
|
+
for (const [name, value] of Object.entries(storesValues ?? {})) {
|
|
11
|
+
(_a = stores[`${name}$`]) == null ? void 0 : _a.set(value);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function findChangedProperties(obj1, obj2) {
|
|
17
|
+
if (obj1 === obj2) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
let hasUpdate = false;
|
|
21
|
+
const changedValues = {};
|
|
22
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(obj1), ...Object.keys(obj2)]);
|
|
23
|
+
for (const key of keys) {
|
|
24
|
+
const value = obj2[key];
|
|
25
|
+
if (obj1[key] !== value) {
|
|
26
|
+
changedValues[key] = value;
|
|
27
|
+
hasUpdate = true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return hasUpdate ? changedValues : null;
|
|
31
|
+
}
|
|
32
|
+
function writableWithDefault(defValue, config$ = tansu.readable(void 0), options = {}, own$ = tansu.writable(void 0)) {
|
|
33
|
+
const { normalizeValue = func.identity, equal = Object.is } = options;
|
|
34
|
+
const getDefValue = () => defValue;
|
|
35
|
+
const callNormalizeValue = (value, defValue2 = getDefValue) => {
|
|
36
|
+
const normalizedValue = value === void 0 ? void 0 : normalizeValue(value);
|
|
37
|
+
if (normalizedValue === types.INVALID_VALUE) {
|
|
38
|
+
console.error("Not using invalid value", value);
|
|
39
|
+
return defValue2();
|
|
40
|
+
}
|
|
41
|
+
if (normalizedValue === void 0) {
|
|
42
|
+
return defValue2();
|
|
43
|
+
}
|
|
44
|
+
return normalizedValue;
|
|
45
|
+
};
|
|
46
|
+
const validatedDefConfig$ = tansu.computed(() => callNormalizeValue(config$()), { equal });
|
|
47
|
+
const validatedOwnValue$ = tansu.computed(() => callNormalizeValue(own$(), validatedDefConfig$), { equal });
|
|
48
|
+
return tansu.asWritable(validatedOwnValue$, (value) => {
|
|
49
|
+
if (value !== void 0) {
|
|
50
|
+
const normalizedValue = normalizeValue(value);
|
|
51
|
+
if (normalizedValue === types.INVALID_VALUE) {
|
|
52
|
+
console.error("Not setting invalid value", value);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
value = normalizedValue;
|
|
56
|
+
}
|
|
57
|
+
own$.set(value);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const isStore = (x) => !!(x && typeof x === "function" && "subscribe" in x);
|
|
61
|
+
const toReadableStore = (x) => isStore(x) ? x : tansu.readable(x);
|
|
62
|
+
const toWritableStore = (x) => isStore(x) ? x : tansu.writable(x);
|
|
63
|
+
const normalizeConfigStores = (keys, config) => {
|
|
64
|
+
const res = {};
|
|
65
|
+
if (config) {
|
|
66
|
+
const configIsStore = isStore(config);
|
|
67
|
+
for (const key of keys) {
|
|
68
|
+
res[key] = configIsStore ? tansu.computed(() => config()[key]) : toReadableStore(config[key]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return res;
|
|
72
|
+
};
|
|
73
|
+
const mergeConfigStores = (keys, config1, config2) => {
|
|
74
|
+
const res = {};
|
|
75
|
+
for (const key of keys) {
|
|
76
|
+
const config1Store = config1 == null ? void 0 : config1[key];
|
|
77
|
+
const config2Store = config2 == null ? void 0 : config2[key];
|
|
78
|
+
res[key] = config1Store && config2Store ? tansu.computed(() => config1Store() ?? config2Store()) : config1Store || config2Store;
|
|
79
|
+
}
|
|
80
|
+
return res;
|
|
81
|
+
};
|
|
82
|
+
const writablesWithDefault = (defConfig, propsConfig, options) => {
|
|
83
|
+
const res = {};
|
|
84
|
+
const keys = Object.keys(defConfig);
|
|
85
|
+
const configStores = normalizeConfigStores(keys, propsConfig == null ? void 0 : propsConfig.config);
|
|
86
|
+
const props = propsConfig == null ? void 0 : propsConfig.props;
|
|
87
|
+
for (const key of keys) {
|
|
88
|
+
const propValue = props == null ? void 0 : props[key];
|
|
89
|
+
res[`${key}$`] = writableWithDefault(defConfig[key], configStores[key], options == null ? void 0 : options[key], toWritableStore(propValue));
|
|
90
|
+
}
|
|
91
|
+
return res;
|
|
92
|
+
};
|
|
93
|
+
const writablesForProps = (defConfig, propsConfig, options) => {
|
|
94
|
+
const stores = writablesWithDefault(defConfig, propsConfig, options);
|
|
95
|
+
return [stores, createPatch(stores)];
|
|
96
|
+
};
|
|
97
|
+
const stateStores = (inputStores) => {
|
|
98
|
+
const storesNames = [];
|
|
99
|
+
const storesArray = [];
|
|
100
|
+
const stores = {};
|
|
101
|
+
for (const [key, store] of Object.entries(inputStores)) {
|
|
102
|
+
if (key.endsWith("$")) {
|
|
103
|
+
storesNames.push(key.substring(0, key.length - 1));
|
|
104
|
+
storesArray.push(store);
|
|
105
|
+
stores[key] = tansu.asReadable(store);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
stores,
|
|
110
|
+
state$: tansu.computed(() => {
|
|
111
|
+
const values = storesArray.map(tansu.get);
|
|
112
|
+
const res = {};
|
|
113
|
+
storesNames.forEach((name, index) => {
|
|
114
|
+
res[name] = values[index];
|
|
115
|
+
});
|
|
116
|
+
return res;
|
|
117
|
+
})
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
const bindableDerived = (onChange$, stores, adjustValue = (arg) => arg[0], equal = (currentValue, newValue) => newValue === currentValue) => {
|
|
121
|
+
let currentValue = stores[0]();
|
|
122
|
+
return tansu.asWritable(
|
|
123
|
+
tansu.derived(stores, {
|
|
124
|
+
derive(values) {
|
|
125
|
+
const newValue = adjustValue(values);
|
|
126
|
+
const rectifiedValue = !equal(values[0], newValue);
|
|
127
|
+
if (rectifiedValue) {
|
|
128
|
+
stores[0].set(newValue);
|
|
129
|
+
}
|
|
130
|
+
if (rectifiedValue || !equal(currentValue, newValue)) {
|
|
131
|
+
currentValue = newValue;
|
|
132
|
+
onChange$()(newValue);
|
|
133
|
+
}
|
|
134
|
+
return newValue;
|
|
135
|
+
},
|
|
136
|
+
equal
|
|
137
|
+
}),
|
|
138
|
+
stores[0].set.bind(stores[0])
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
const bindableProp = (store$, onChange$, adjustValue = func.identity, equal = tansu.equal) => tansu.asWritable(
|
|
142
|
+
tansu.computed(() => adjustValue(store$()), { equal }),
|
|
143
|
+
(newValue) => {
|
|
144
|
+
const adjustedValue = adjustValue(newValue);
|
|
145
|
+
if (!equal(store$(), adjustedValue)) {
|
|
146
|
+
store$.set(adjustedValue);
|
|
147
|
+
onChange$()(adjustedValue);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
exports.bindableDerived = bindableDerived;
|
|
152
|
+
exports.bindableProp = bindableProp;
|
|
153
|
+
exports.createPatch = createPatch;
|
|
154
|
+
exports.findChangedProperties = findChangedProperties;
|
|
155
|
+
exports.isStore = isStore;
|
|
156
|
+
exports.mergeConfigStores = mergeConfigStores;
|
|
157
|
+
exports.normalizeConfigStores = normalizeConfigStores;
|
|
158
|
+
exports.stateStores = stateStores;
|
|
159
|
+
exports.toReadableStore = toReadableStore;
|
|
160
|
+
exports.toWritableStore = toWritableStore;
|
|
161
|
+
exports.writableWithDefault = writableWithDefault;
|
|
162
|
+
exports.writablesForProps = writablesForProps;
|
|
163
|
+
exports.writablesWithDefault = writablesWithDefault;
|
package/utils/stores.d.ts
CHANGED
|
@@ -7,12 +7,6 @@ export type ReadableSignals<T extends object> = {
|
|
|
7
7
|
[K in keyof T]?: ReadableSignal<T[K] | undefined>;
|
|
8
8
|
};
|
|
9
9
|
export type WithoutDollar<S extends `${string}$`> = S extends `${infer U}$` ? U : never;
|
|
10
|
-
export type ValueOfStore<S extends ReadableSignal<any>> = S extends ReadableSignal<infer U> ? U : never;
|
|
11
|
-
export type ToState<S extends {
|
|
12
|
-
[K in keyof S & `${string}$`]: ReadableSignal<any>;
|
|
13
|
-
}> = {
|
|
14
|
-
[K in keyof S & `${string}$` as WithoutDollar<K>]: ValueOfStore<S[K]>;
|
|
15
|
-
};
|
|
16
10
|
/**
|
|
17
11
|
*
|
|
18
12
|
* Utility function designed to create a `patch` function related to the provided stores.
|
|
@@ -72,13 +66,13 @@ export declare const isStore: (x: any) => x is ReadableSignal<any>;
|
|
|
72
66
|
* @param x - either a store or a simple value
|
|
73
67
|
* @returns either x if x is already a store, or readable(x) otherwise
|
|
74
68
|
*/
|
|
75
|
-
export declare const toReadableStore: <T>(x: T |
|
|
69
|
+
export declare const toReadableStore: <T>(x: ReadableSignal<T> | T) => ReadableSignal<T>;
|
|
76
70
|
/**
|
|
77
71
|
* If the provided argument is already a store, it is returned as is, otherwise, a writable store is created with the provided argument as its initial value.
|
|
78
72
|
* @param x - either a writable store or a simple value
|
|
79
73
|
* @returns either x if x is already a store, or writable(x) otherwise
|
|
80
74
|
*/
|
|
81
|
-
export declare const toWritableStore: <T>(x: T |
|
|
75
|
+
export declare const toWritableStore: <T>(x: WritableSignal<T> | T) => WritableSignal<T, T>;
|
|
82
76
|
/**
|
|
83
77
|
* Extract and normalize config stores.
|
|
84
78
|
*
|
|
@@ -86,7 +80,7 @@ export declare const toWritableStore: <T>(x: T | WritableSignal<T, T>) => Writab
|
|
|
86
80
|
* @param config - the config stores
|
|
87
81
|
* @returns the normalized config stores
|
|
88
82
|
*/
|
|
89
|
-
export declare const normalizeConfigStores: <T extends object>(keys: (keyof T)[], config?: ReadableSignal<Partial<T>> | ValuesOrReadableSignals<T>
|
|
83
|
+
export declare const normalizeConfigStores: <T extends object>(keys: (keyof T)[], config?: ReadableSignal<Partial<T>> | ValuesOrReadableSignals<T>) => ReadableSignals<T>;
|
|
90
84
|
/**
|
|
91
85
|
* Merge two stores configs into one
|
|
92
86
|
*
|
|
@@ -95,7 +89,7 @@ export declare const normalizeConfigStores: <T extends object>(keys: (keyof T)[]
|
|
|
95
89
|
* @param config2 - the second config
|
|
96
90
|
* @returns the merged config
|
|
97
91
|
*/
|
|
98
|
-
export declare const mergeConfigStores: <T extends object>(keys: (keyof T)[], config1?: ReadableSignals<T
|
|
92
|
+
export declare const mergeConfigStores: <T extends object>(keys: (keyof T)[], config1?: ReadableSignals<T>, config2?: ReadableSignals<T>) => ReadableSignals<T>;
|
|
99
93
|
/**
|
|
100
94
|
* Returns an object containing, for each property of `defConfig`, a corresponding writable with the normalization and default value logic
|
|
101
95
|
* described in {@link writableWithDefault}. Keys in the returned object are the same as the ones present in `defConfig`,
|
|
@@ -123,7 +117,7 @@ export declare const mergeConfigStores: <T extends object>(keys: (keyof T)[], co
|
|
|
123
117
|
* const {propA$, propB$} = writablesWithDefault(defConfig, {config}, validation);
|
|
124
118
|
* ```
|
|
125
119
|
*/
|
|
126
|
-
export declare const writablesWithDefault: <T extends object>(defConfig: T, propsConfig?: PropsConfig<T
|
|
120
|
+
export declare const writablesWithDefault: <T extends object>(defConfig: T, propsConfig?: PropsConfig<T>, options?: ConfigValidator<T>) => ToWritableSignal<T>;
|
|
127
121
|
/**
|
|
128
122
|
* Shortcut for calling both {@link writablesWithDefault} and {@link createPatch} in one call.
|
|
129
123
|
* @param defConfig - object containing, for each property, a default value to use in case `config` does not provide the suitable default
|
|
@@ -150,25 +144,34 @@ export declare const writablesWithDefault: <T extends object>(defConfig: T, prop
|
|
|
150
144
|
* const [{propA$, propB$}, patch] = writablesForProps(defConfig, config, validation);
|
|
151
145
|
* ```
|
|
152
146
|
*/
|
|
153
|
-
export declare const writablesForProps: <T extends object>(defConfig: T, propsConfig?: PropsConfig<T
|
|
147
|
+
export declare const writablesForProps: <T extends object>(defConfig: T, propsConfig?: PropsConfig<T>, options?: { [K in keyof T]?: WritableWithDefaultOptions<T[K]> | undefined; } | undefined) => [ToWritableSignal<T>, ReturnType<typeof createPatch<T>>];
|
|
154
148
|
/**
|
|
155
149
|
* Using input stores, this function builds an object containing the stores as readable and a global state.
|
|
156
150
|
*
|
|
157
151
|
* @param inputStores - the input stores
|
|
158
152
|
* @returns the object containing the stores as readable and the global state
|
|
159
153
|
*/
|
|
160
|
-
export declare const stateStores: <A extends {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
state$: ReadableSignal<ToState<A>>;
|
|
164
|
-
stores: { [key in `${string}$` & keyof A]: ReadableSignal<ValueOfStore<A[key]>>; };
|
|
154
|
+
export declare const stateStores: <A extends object>(inputStores: { [K in keyof A as `${K & string}$`]: ReadableSignal<any>; }) => {
|
|
155
|
+
state$: ReadableSignal<A>;
|
|
156
|
+
stores: { [K_1 in keyof A as `${K_1 & string}$`]: ReadableSignal<A[K_1]>; };
|
|
165
157
|
};
|
|
166
158
|
/**
|
|
167
|
-
* Creates a
|
|
168
|
-
* @param onChange$ - A readable signal callback function to execute when the value changes.
|
|
159
|
+
* Creates a derived store that binds to multiple stores and triggers a callback when the value changes for any reason.
|
|
160
|
+
* @param onChange$ - A readable signal containing a callback function to execute when the value changes.
|
|
169
161
|
* @param stores - An array of Svelte stores, with the main store at index 0.
|
|
170
162
|
* @param adjustValue - A function to adjust the value of the main store. By default, the value of the main store is returned.
|
|
171
163
|
* @param equal - A function to determine if two values are equal. Used to compare the ajusted value with the current one.
|
|
172
164
|
* @returns The derived store that reflects the combined state of the input stores.
|
|
173
165
|
*/
|
|
174
|
-
export declare const bindableDerived: <T, U extends [WritableSignal<T, T>, ...StoreInput<any>[]]>(onChange$: ReadableSignal<(value: T) => void>, stores: U, adjustValue?: (arg: StoresInputValues<U>) => T, equal?: (currentValue: T, newValue: T) => boolean) =>
|
|
166
|
+
export declare const bindableDerived: <T, U extends [WritableSignal<T, T>, ...StoreInput<any>[]]>(onChange$: ReadableSignal<(value: T) => void>, stores: U, adjustValue?: (arg: StoresInputValues<U>) => T, equal?: (currentValue: T, newValue: T) => boolean) => WritableSignal<T, T>;
|
|
167
|
+
/**
|
|
168
|
+
* Creates a computed store that contains the adjusted value of the given store and that triggers a callback when the value changes from the set or update
|
|
169
|
+
* method of the returned writable store.
|
|
170
|
+
* @param store$ - store to be bound
|
|
171
|
+
* @param onChange$ - A readable signal containing a callback function to execute when the value changes from the set or update method of the returned writable store.
|
|
172
|
+
* @param adjustValue - A function to adjust the value of the store, called in a reactive context each time the value changes or any called dependency changes.
|
|
173
|
+
* By default, the value of store$ is returned.
|
|
174
|
+
* @param equal - A function to determine if two values are equal.
|
|
175
|
+
* @returns A writable store that contains the adjusted value of the given store, with the set or update functions that trigger the onChange$ callback.
|
|
176
|
+
*/
|
|
177
|
+
export declare const bindableProp: <T>(store$: WritableSignal<T, T | undefined>, onChange$: ReadableSignal<(newValue: T) => void>, adjustValue?: (value: T) => T, equal?: (a: T, b: T) => boolean) => WritableSignal<T, T>;
|