@luscii-healthtech/web-ui 2.69.3 → 2.70.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/dist/components/Table/Table.types.d.ts +4 -0
- package/dist/web-ui.cjs.development.js +16 -5
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +16 -5
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,10 @@ export interface TableFieldConfig<Item> {
|
|
|
9
9
|
export declare type TableFieldContent<Item> = TableFieldText | [TableFieldAction<Item>?, TableFieldAction<Item>?];
|
|
10
10
|
export interface TableFieldText {
|
|
11
11
|
text: string;
|
|
12
|
+
description?: {
|
|
13
|
+
content: string;
|
|
14
|
+
breakAllWord?: boolean;
|
|
15
|
+
};
|
|
12
16
|
breakAllWord?: boolean;
|
|
13
17
|
tag?: {
|
|
14
18
|
text: string;
|
|
@@ -5112,7 +5112,7 @@ var Tag = function Tag(_ref) {
|
|
|
5112
5112
|
};
|
|
5113
5113
|
|
|
5114
5114
|
function isTableFieldText(content) {
|
|
5115
|
-
return "text" in content || "tag" in content;
|
|
5115
|
+
return "text" in content || "tag" in content || "description" in content;
|
|
5116
5116
|
}
|
|
5117
5117
|
function isTableFieldAction(content) {
|
|
5118
5118
|
return Array.isArray(content) && content.some(function (action) {
|
|
@@ -5125,6 +5125,7 @@ function TableBodyRowDataCell(props) {
|
|
|
5125
5125
|
|
|
5126
5126
|
var content = props.fieldConfig.content(props.item);
|
|
5127
5127
|
var emptyFieldContentText = (_props$emptyFieldCont = props.emptyFieldContentText) != null ? _props$emptyFieldCont : "";
|
|
5128
|
+
var isTextCellEmpty = isTableFieldText(content) && !content.text && !content.tag;
|
|
5128
5129
|
return /*#__PURE__*/React__default.createElement("td", {
|
|
5129
5130
|
className: classNames("px-2 first:pl-6 last:pr-6", {
|
|
5130
5131
|
"align-top": !isTableFieldAction(content)
|
|
@@ -5136,14 +5137,24 @@ function TableBodyRowDataCell(props) {
|
|
|
5136
5137
|
}, /*#__PURE__*/React__default.createElement(Tag, {
|
|
5137
5138
|
text: content.tag.text,
|
|
5138
5139
|
colorTheme: content.tag.color
|
|
5139
|
-
})), /*#__PURE__*/React__default.createElement(
|
|
5140
|
-
className:
|
|
5140
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
5141
|
+
className: "flex flex-col py-4"
|
|
5142
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
5143
|
+
className: classNames("text-left leading-5", {
|
|
5141
5144
|
"break-all": content.breakAllWord,
|
|
5142
5145
|
"break-words": !content.breakAllWord
|
|
5143
5146
|
}),
|
|
5144
|
-
text:
|
|
5147
|
+
text: isTextCellEmpty ? emptyFieldContentText : content.text,
|
|
5145
5148
|
type: "base"
|
|
5146
|
-
})
|
|
5149
|
+
}), content.description && /*#__PURE__*/React__default.createElement(Text, {
|
|
5150
|
+
className: classNames({
|
|
5151
|
+
"break-all": content.description.breakAllWord,
|
|
5152
|
+
"break-words": !content.description.breakAllWord
|
|
5153
|
+
}),
|
|
5154
|
+
text: content.description.content,
|
|
5155
|
+
type: "sm",
|
|
5156
|
+
color: "slate-500"
|
|
5157
|
+
}))), isTableFieldAction(content) && /*#__PURE__*/React__default.createElement("div", {
|
|
5147
5158
|
className: classNames("flex flex-row justify-end", "transition-opacity ease-in-out duration-300", {
|
|
5148
5159
|
"opacity-0": props.fieldConfig.onlyShowContentOnHovering,
|
|
5149
5160
|
"group-hover:opacity-100": props.fieldConfig.onlyShowContentOnHovering
|