@situaction/traq-ui-ste 1.1.32 → 1.1.33
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,14 +1,29 @@
|
|
|
1
1
|
import { SelectItem } from '../select/Select';
|
|
2
2
|
|
|
3
3
|
interface EditableSelectProps {
|
|
4
|
+
/** Label displayed above the select or static value */
|
|
4
5
|
label: string;
|
|
6
|
+
/** List of selectable items */
|
|
5
7
|
listItems: SelectItem[];
|
|
8
|
+
/** Static text value shown when not in edit mode */
|
|
6
9
|
value?: string;
|
|
10
|
+
/** Placeholder shown when no item is selected */
|
|
7
11
|
placeholder?: string;
|
|
12
|
+
/** Determines if the select is editable or read-only */
|
|
8
13
|
edit: boolean;
|
|
14
|
+
/** Callback triggered when an item is selected */
|
|
9
15
|
onSelect?: (selected: SelectItem) => void;
|
|
16
|
+
/** The currently selected item */
|
|
10
17
|
selected?: SelectItem;
|
|
11
|
-
|
|
18
|
+
/** Condition that automatically closes the dropdown */
|
|
19
|
+
autoCloseCondition?: boolean;
|
|
20
|
+
/** If true, the select takes full width */
|
|
21
|
+
fullWidth?: boolean;
|
|
12
22
|
}
|
|
13
|
-
|
|
23
|
+
/**
|
|
24
|
+
* EditableSelect is a component that toggles between a static text display
|
|
25
|
+
* and a Select dropdown based on the `edit` prop. It is commonly used
|
|
26
|
+
* in forms or data views where inline editing is required.
|
|
27
|
+
*/
|
|
28
|
+
export declare const EditableSelect: ({ label, listItems, value, placeholder, edit, onSelect, selected, autoCloseCondition, fullWidth }: EditableSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
29
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Select as
|
|
3
|
-
import '../../styles/EditableSelect.css';const
|
|
4
|
-
editableSelect:
|
|
5
|
-
statiqueField:
|
|
6
|
-
}, F = ({
|
|
1
|
+
import { jsxs as l, Fragment as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Select as x } from "../select/Select.js";
|
|
3
|
+
import '../../styles/EditableSelect.css';const p = "_editableSelect_6vsm4_30", _ = "_statiqueField_6vsm4_40", i = {
|
|
4
|
+
editableSelect: p,
|
|
5
|
+
statiqueField: _
|
|
6
|
+
}, F = ({
|
|
7
|
+
label: s,
|
|
8
|
+
listItems: a,
|
|
9
|
+
value: t,
|
|
10
|
+
placeholder: c,
|
|
11
|
+
edit: d,
|
|
12
|
+
onSelect: m,
|
|
13
|
+
selected: r,
|
|
14
|
+
autoCloseCondition: n = !1,
|
|
15
|
+
fullWidth: o = !1
|
|
16
|
+
}) => d ? /* @__PURE__ */ l(S, { children: [
|
|
7
17
|
/* @__PURE__ */ e("span", { className: "textSmall", children: s }),
|
|
8
18
|
/* @__PURE__ */ e(
|
|
9
|
-
|
|
19
|
+
x,
|
|
10
20
|
{
|
|
11
21
|
size: "s",
|
|
12
22
|
listItem: a,
|
|
@@ -14,12 +24,13 @@ import '../../styles/EditableSelect.css';const x = "_editableSelect_6vsm4_30", p
|
|
|
14
24
|
modeDisplay: "text",
|
|
15
25
|
onSelect: m,
|
|
16
26
|
selected: r,
|
|
17
|
-
autoCloseCondition: n
|
|
27
|
+
autoCloseCondition: n,
|
|
28
|
+
fullWidth: o
|
|
18
29
|
}
|
|
19
30
|
)
|
|
20
|
-
] }) : /* @__PURE__ */
|
|
31
|
+
] }) : /* @__PURE__ */ l("div", { className: i.editableSelect, children: [
|
|
21
32
|
/* @__PURE__ */ e("span", { className: "textSmall", children: s }),
|
|
22
|
-
/* @__PURE__ */ e("div", { className: `${
|
|
33
|
+
/* @__PURE__ */ e("div", { className: `${i.statiqueField} textSmall`, children: (t == null ? void 0 : t.trim()) || "-" })
|
|
23
34
|
] });
|
|
24
35
|
export {
|
|
25
36
|
F as EditableSelect
|