asma-ui-core 3.101.0 → 3.101.1
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.
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return /* @__PURE__ */ x("div", {
|
|
1
|
+
import { jsx as d, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
var m = ({ dataTest: a, options: c, value: t, title: n, valueKey: i = "value", labelKey: o = "label", renderLabel: r }) => {
|
|
3
|
+
const s = (e) => typeof e == "object" ? e?.[i] : e, f = (e) => typeof e == "object" ? e?.[o]?.toString() ?? "" : e?.toString() ?? "", l = t == null ? null : c.find((e) => s(e) === s(t)) ?? t;
|
|
4
|
+
return /* @__PURE__ */ u("div", {
|
|
6
5
|
"data-testid": `${a}-read-only`,
|
|
7
6
|
className: "flex flex-col gap-y-1",
|
|
8
7
|
children: [n && /* @__PURE__ */ d("span", {
|
|
@@ -10,11 +9,11 @@ var g = ({ dataTest: a, options: c, value: t, title: n, size: i = "medium", valu
|
|
|
10
9
|
children: n
|
|
11
10
|
}), /* @__PURE__ */ d("div", {
|
|
12
11
|
"data-testid": `${a}-read-only-value`,
|
|
13
|
-
className:
|
|
12
|
+
className: "text-base/6 text-delta-700",
|
|
14
13
|
children: l === null ? "-" : r ? r(l) : f(l)
|
|
15
14
|
})]
|
|
16
15
|
});
|
|
17
16
|
};
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
m as DynamicSelectReadOnlyValue
|
|
20
19
|
};
|
package/dist/src/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DynamicSelectOption, StyledDynamicSelectProps } from '../types';
|
|
2
|
-
type DynamicSelectReadOnlyValueProps<TOption extends DynamicSelectOption> = Pick<StyledDynamicSelectProps<TOption>, 'dataTest' | 'options' | 'title' | '
|
|
2
|
+
type DynamicSelectReadOnlyValueProps<TOption extends DynamicSelectOption> = Pick<StyledDynamicSelectProps<TOption>, 'dataTest' | 'options' | 'title' | 'valueKey' | 'labelKey' | 'renderLabel'> & {
|
|
3
3
|
value: TOption | null;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
@@ -7,8 +7,9 @@ type DynamicSelectReadOnlyValueProps<TOption extends DynamicSelectOption> = Pick
|
|
|
7
7
|
* input field, no helper/error row (there is nothing to validate). Applies whatever the option
|
|
8
8
|
* count, so the ≤5 chip variant and the 6+ autocomplete variant read the same.
|
|
9
9
|
*
|
|
10
|
-
* Text = Body Base 16/24 `text-icon/body` (delta-700)
|
|
11
|
-
* same placeholder the chip variant shows.
|
|
10
|
+
* Text = Body Base 16/24 `text-icon/body` (delta-700) at every `size`: `size` scales chips and
|
|
11
|
+
* buttons, and read-only draws neither. No value → `-`, the same placeholder the chip variant shows.
|
|
12
|
+
* Multiple selects never reach this component.
|
|
12
13
|
*/
|
|
13
|
-
export declare const DynamicSelectReadOnlyValue: <TOption extends DynamicSelectOption>({ dataTest, options, value, title,
|
|
14
|
+
export declare const DynamicSelectReadOnlyValue: <TOption extends DynamicSelectOption>({ dataTest, options, value, title, valueKey, labelKey, renderLabel, }: DynamicSelectReadOnlyValueProps<TOption>) => JSX.Element;
|
|
14
15
|
export {};
|