@ally-ui/solid
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -6,7 +6,7 @@ import { Accessor } from 'solid-js'; | ||
*/ | ||
option: Accessor<Exclude<TOption, Function> | undefined>; | ||
option: Accessor<TOption | undefined>; | ||
/** | ||
* An accessor to the internal option value. This should be derived from internal state. | ||
*/ | ||
internal: Accessor<Exclude<TOption, Function>>; | ||
internal?: Accessor<TOption>; | ||
/** | ||
@@ -13,0 +13,0 @@ * Called with the new external option's value when it changes. |
@@ -1,41 +0,41 @@ | ||
import { onCleanup as m, createEffect as f, untrack as d, createMemo as a, splitProps as s } from "solid-js"; | ||
import { onCleanup as m, createEffect as c, untrack as r, createMemo as s, splitProps as b } from "solid-js"; | ||
function O(...e) { | ||
return (t) => e.forEach((i) => i == null ? void 0 : i(t)); | ||
return (i) => e.forEach((t) => t == null ? void 0 : t(i)); | ||
} | ||
function b(e, t) { | ||
function a(e, i) { | ||
return m(() => { | ||
e(null); | ||
}), t !== void 0 && f(() => { | ||
t() || e(null); | ||
}), (i) => { | ||
e(i); | ||
}), i !== void 0 && c(() => { | ||
i() || e(null); | ||
}), (t) => { | ||
e(t); | ||
}; | ||
} | ||
function R(e, t) { | ||
return b((i) => { | ||
setTimeout(() => e(i)); | ||
}, t); | ||
function R(e, i) { | ||
return a((t) => { | ||
setTimeout(() => e(t)); | ||
}, i); | ||
} | ||
function k({ | ||
option: e, | ||
internal: t, | ||
onOptionChange: i, | ||
internal: i, | ||
onOptionChange: t, | ||
onInternalChange: n | ||
}) { | ||
const u = d(e); | ||
u !== void 0 && u !== d(t) && i(u); | ||
let r = u; | ||
f(function() { | ||
const c = e(); | ||
c !== void 0 && c !== r && (r = c, i(c)); | ||
}, [e]), f(function() { | ||
n == null || n(t()); | ||
}, [t]); | ||
const u = r(e); | ||
u !== void 0 && i !== void 0 && u !== r(i) && t(u); | ||
let d = u; | ||
c(function() { | ||
const f = e(); | ||
f !== void 0 && f !== d && (d = f, t(f)); | ||
}, [e]), c(function() { | ||
i !== void 0 && (n == null || n(i())); | ||
}, [i]); | ||
} | ||
function y(e, t) { | ||
t instanceof Function ? t(e) : t !== void 0 && t[0](t[1], e); | ||
function y(e, i) { | ||
i instanceof Function ? i(e) : i !== void 0 && i[0](i[1], e); | ||
} | ||
function o(e, t) { | ||
return a(e, void 0, t ? void 0 : { | ||
equals: t | ||
function o(e, i) { | ||
return s(e, void 0, i ? void 0 : { | ||
equals: i | ||
}); | ||
@@ -51,9 +51,9 @@ } | ||
} | ||
const [, t] = s(e.props, ["asChild", "children"]), i = () => ({ | ||
const [, i] = b(e.props, ["asChild", "children"]), t = () => ({ | ||
...e.attributes, | ||
...t | ||
...i | ||
}); | ||
return o(() => e.children({ | ||
ref: e.ref, | ||
attributes: i, | ||
attributes: t, | ||
children: e.props.children | ||
@@ -65,3 +65,3 @@ })); | ||
O as combinedRef, | ||
b as createBindRef, | ||
a as createBindRef, | ||
R as createDelayedBindRef, | ||
@@ -68,0 +68,0 @@ k as createSyncedOption, |
export declare type CallbackRef<TInstance> = (instance: TInstance) => void; | ||
export declare type SolidReactiveProps<TReactive> = Partial<TReactive & SolidChangeHandlers<TReactive>>; | ||
declare type SolidChangeHandlers<TReactive> = { | ||
[TKey in keyof TReactive as ChangeHandler<TKey>]: (value: TReactive[TKey]) => void; | ||
}; | ||
declare type ChangeHandler<TKey> = `on${TKey extends string ? Capitalize<TKey> : never}Change`; | ||
export {}; |
{ | ||
"name": "@ally-ui/solid", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"scripts": { | ||
@@ -39,3 +39,3 @@ "example": "vite", | ||
}, | ||
"gitHead": "0698874cf6570ddc02b4730b2579103f84a65fb0" | ||
"gitHead": "6a50bd3ae5fdf2f3b48f4376b65fa177ce1f4b9b" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9301
184