@oliasoft-open-source/react-ui-library 7.0.2-beta-1 → 7.0.2-beta-2
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.
|
@@ -9,6 +9,6 @@ interface IUseSynchronizedDisplayLayerOptions {
|
|
|
9
9
|
unitkey: string;
|
|
10
10
|
value?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const useSynchronizedDisplayLayer: ({ error, initDisplayUnit, noConversion, unitkey, value, }: IUseSynchronizedDisplayLayerOptions) => readonly [IDisplayLayer,
|
|
12
|
+
export declare const useSynchronizedDisplayLayer: ({ error, initDisplayUnit, noConversion, unitkey, value, }: IUseSynchronizedDisplayLayerOptions) => readonly [IDisplayLayer, (nextDisplayLayer: IDisplayLayer) => void];
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=use-synchronized-display-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-synchronized-display-layer.d.ts","sourceRoot":"","sources":["../../../../src/components/unit-input/hooks/use-synchronized-display-layer.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,mCAAmC;IAC3C,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"use-synchronized-display-layer.d.ts","sourceRoot":"","sources":["../../../../src/components/unit-input/hooks/use-synchronized-display-layer.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,mCAAmC;IAC3C,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAaD,eAAO,MAAM,2BAA2B,GAAI,2DAMzC,mCAAmC,iDA6Bf,aAAa,UAUnC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6616,44 +6616,39 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6616
6616
|
exactPrecision: !0
|
|
6617
6617
|
}) : { value: e };
|
|
6618
6618
|
}, jd = ({ error: e, initDisplayUnit: t, noConversion: n, unitkey: r, value: i }) => {
|
|
6619
|
-
let [a = "", o = ""] = i === void 0 ? [] : or(i),
|
|
6620
|
-
|
|
6619
|
+
let [a = "", o = ""] = i === void 0 ? [] : or(i), c = f(() => ({
|
|
6620
|
+
error: e,
|
|
6621
|
+
initDisplayUnit: t,
|
|
6622
|
+
value: i
|
|
6623
|
+
}), [
|
|
6624
|
+
e,
|
|
6625
|
+
t,
|
|
6626
|
+
i
|
|
6627
|
+
]), l = (e) => {
|
|
6628
|
+
let { value: t } = Ad({
|
|
6621
6629
|
value: i,
|
|
6622
|
-
toUnit:
|
|
6630
|
+
toUnit: e,
|
|
6623
6631
|
unitkey: r,
|
|
6624
6632
|
defaultFromUnit: o,
|
|
6625
6633
|
doNotConvertValue: n
|
|
6626
6634
|
});
|
|
6627
|
-
return
|
|
6635
|
+
return t === "" ? {
|
|
6628
6636
|
value: a,
|
|
6629
6637
|
unit: o
|
|
6630
6638
|
} : {
|
|
6631
|
-
value:
|
|
6632
|
-
unit:
|
|
6639
|
+
value: t,
|
|
6640
|
+
unit: e
|
|
6633
6641
|
};
|
|
6634
|
-
}
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
toUnit: a,
|
|
6643
|
-
unitkey: r,
|
|
6644
|
-
defaultFromUnit: o,
|
|
6645
|
-
doNotConvertValue: n
|
|
6642
|
+
}, [u, d] = h(() => ({
|
|
6643
|
+
displayLayer: l(t),
|
|
6644
|
+
externalState: c
|
|
6645
|
+
})), p = u.externalState.error !== e || u.externalState.initDisplayUnit !== t || u.externalState.value !== i, m = u.externalState.initDisplayUnit === t ? u.displayLayer.unit : t;
|
|
6646
|
+
return [p ? l(m) : u.displayLayer, s((e) => {
|
|
6647
|
+
d({
|
|
6648
|
+
displayLayer: e,
|
|
6649
|
+
externalState: c
|
|
6646
6650
|
});
|
|
6647
|
-
|
|
6648
|
-
error: e,
|
|
6649
|
-
initDisplayUnit: t,
|
|
6650
|
-
value: i
|
|
6651
|
-
}), c({
|
|
6652
|
-
value: d,
|
|
6653
|
-
unit: a
|
|
6654
|
-
});
|
|
6655
|
-
}
|
|
6656
|
-
return [s, c];
|
|
6651
|
+
}, [c])];
|
|
6657
6652
|
}, Md = (e, t) => {
|
|
6658
6653
|
let n = t == null ? void 0 : t[e];
|
|
6659
6654
|
if (!n) {
|
package/package.json
CHANGED