nntc-ui 0.0.37 → 0.0.38
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/index.css +9 -0
- package/index.d.ts +6 -0
- package/index.js +14 -9
- package/package.json +1 -1
package/index.css
CHANGED
|
@@ -1775,7 +1775,9 @@
|
|
|
1775
1775
|
border-color: var(--theme-error);
|
|
1776
1776
|
}
|
|
1777
1777
|
.virtualTable_viewSpan {
|
|
1778
|
+
width: calc(100% - 20px);
|
|
1778
1779
|
margin: 4px 10px;
|
|
1780
|
+
overflow-wrap: break-word;
|
|
1779
1781
|
}
|
|
1780
1782
|
.virtualTable_showInModal {
|
|
1781
1783
|
position: relative;
|
|
@@ -1798,6 +1800,13 @@
|
|
|
1798
1800
|
background: var(--theme-table-even-row);
|
|
1799
1801
|
background: linear-gradient(rgba(0, 0, 0, 0) 0%, var(--theme-table-even-row) 65%);
|
|
1800
1802
|
}
|
|
1803
|
+
.virtualTable_clickable {
|
|
1804
|
+
text-decoration: underline;
|
|
1805
|
+
text-decoration-thickness: 1px;
|
|
1806
|
+
text-decoration-style: dashed;
|
|
1807
|
+
text-underline-offset: 2px;
|
|
1808
|
+
cursor: pointer;
|
|
1809
|
+
}
|
|
1801
1810
|
.virtualTable_modalContent {
|
|
1802
1811
|
width: 500px;
|
|
1803
1812
|
}
|
package/index.d.ts
CHANGED
|
@@ -241,6 +241,9 @@ declare function Tabs<T>(props: UiProps<Props$8<T>>): react_jsx_runtime.JSX.Elem
|
|
|
241
241
|
|
|
242
242
|
interface TableCell {
|
|
243
243
|
value?: string | number;
|
|
244
|
+
payload?: {
|
|
245
|
+
[key: string]: string;
|
|
246
|
+
};
|
|
244
247
|
error?: string;
|
|
245
248
|
}
|
|
246
249
|
|
|
@@ -281,6 +284,9 @@ interface TableColumn {
|
|
|
281
284
|
rowsAlign?: ColumnAlign;
|
|
282
285
|
valueFormat?: (value: string) => string;
|
|
283
286
|
showInModal?: boolean;
|
|
287
|
+
onClick?: (payload: {
|
|
288
|
+
[key: string]: string;
|
|
289
|
+
}) => void;
|
|
284
290
|
verticalAlign?: VerticalAlign;
|
|
285
291
|
toFixed?: number;
|
|
286
292
|
}
|
package/index.js
CHANGED
|
@@ -419,7 +419,7 @@ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
419
419
|
function Popover(props) {
|
|
420
420
|
const {
|
|
421
421
|
description,
|
|
422
|
-
clickable,
|
|
422
|
+
clickable: clickable2,
|
|
423
423
|
initialOpen,
|
|
424
424
|
placement,
|
|
425
425
|
wrapTrigger,
|
|
@@ -442,8 +442,8 @@ function Popover(props) {
|
|
|
442
442
|
{
|
|
443
443
|
placement,
|
|
444
444
|
initialOpen,
|
|
445
|
-
open: open !== void 0 ? open :
|
|
446
|
-
onOpenChange: onOpenChange !== void 0 ? onOpenChange :
|
|
445
|
+
open: open !== void 0 ? open : clickable2 ? showTooltip : void 0,
|
|
446
|
+
onOpenChange: onOpenChange !== void 0 ? onOpenChange : clickable2 ? setShowTooltip : void 0,
|
|
447
447
|
containerOffset,
|
|
448
448
|
root: root22,
|
|
449
449
|
children: [
|
|
@@ -451,7 +451,7 @@ function Popover(props) {
|
|
|
451
451
|
PopoverTrigger,
|
|
452
452
|
{
|
|
453
453
|
wrapTrigger,
|
|
454
|
-
onClick:
|
|
454
|
+
onClick: clickable2 ? () => setShowTooltip((prev) => !prev) : void 0,
|
|
455
455
|
className: classnames4(wrapTrigger ? trigger : void 0, classes?.trigger),
|
|
456
456
|
children: children2
|
|
457
457
|
}
|
|
@@ -2262,7 +2262,7 @@ import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
|
2262
2262
|
function Tooltip(props) {
|
|
2263
2263
|
const {
|
|
2264
2264
|
label: label7,
|
|
2265
|
-
clickable,
|
|
2265
|
+
clickable: clickable2,
|
|
2266
2266
|
initialOpen,
|
|
2267
2267
|
placement,
|
|
2268
2268
|
withoutArrow,
|
|
@@ -2285,8 +2285,8 @@ function Tooltip(props) {
|
|
|
2285
2285
|
{
|
|
2286
2286
|
placement,
|
|
2287
2287
|
initialOpen,
|
|
2288
|
-
open:
|
|
2289
|
-
onOpenChange:
|
|
2288
|
+
open: clickable2 ? showTooltip : void 0,
|
|
2289
|
+
onOpenChange: clickable2 ? setShowTooltip : void 0,
|
|
2290
2290
|
withoutArrow,
|
|
2291
2291
|
arrowRef,
|
|
2292
2292
|
root: root22,
|
|
@@ -2295,7 +2295,7 @@ function Tooltip(props) {
|
|
|
2295
2295
|
TooltipTrigger,
|
|
2296
2296
|
{
|
|
2297
2297
|
wrapTrigger,
|
|
2298
|
-
onClick:
|
|
2298
|
+
onClick: clickable2 ? () => setShowTooltip((prev) => !prev) : void 0,
|
|
2299
2299
|
className: wrapTrigger ? classnames16(trigger2, classes?.trigger) : void 0,
|
|
2300
2300
|
children: children2
|
|
2301
2301
|
}
|
|
@@ -2567,6 +2567,7 @@ __export(virtualTable_exports, {
|
|
|
2567
2567
|
bordersHorizontal: () => bordersHorizontal,
|
|
2568
2568
|
bordersVertical: () => bordersVertical,
|
|
2569
2569
|
bottomBorder: () => bottomBorder,
|
|
2570
|
+
clickable: () => clickable,
|
|
2570
2571
|
default: () => virtualTable_default,
|
|
2571
2572
|
error: () => error2,
|
|
2572
2573
|
evenRow: () => evenRow,
|
|
@@ -2627,6 +2628,7 @@ var viewCell = "virtualTable_viewCell";
|
|
|
2627
2628
|
var error2 = "virtualTable_error";
|
|
2628
2629
|
var viewSpan = "virtualTable_viewSpan";
|
|
2629
2630
|
var showInModal = "virtualTable_showInModal";
|
|
2631
|
+
var clickable = "virtualTable_clickable";
|
|
2630
2632
|
var modalContent = "virtualTable_modalContent";
|
|
2631
2633
|
var verticalAlignFlexStart = "virtualTable_verticalAlignFlexStart";
|
|
2632
2634
|
var verticalAlignCenter = "virtualTable_verticalAlignCenter";
|
|
@@ -2663,6 +2665,7 @@ var virtualTable_default = {
|
|
|
2663
2665
|
error: error2,
|
|
2664
2666
|
viewSpan,
|
|
2665
2667
|
showInModal,
|
|
2668
|
+
clickable,
|
|
2666
2669
|
modalContent,
|
|
2667
2670
|
verticalAlignFlexStart,
|
|
2668
2671
|
verticalAlignCenter,
|
|
@@ -2706,6 +2709,7 @@ var DefaultColumn = {
|
|
|
2706
2709
|
viewCell,
|
|
2707
2710
|
!!meta?.rowsAlign ? virtualTable_exports[`align${meta?.rowsAlign}`] : void 0,
|
|
2708
2711
|
meta?.showInModal ? showInModal : void 0,
|
|
2712
|
+
meta?.onClick && original[id]?.payload ? clickable : void 0,
|
|
2709
2713
|
original[id]?.error ? error2 : void 0,
|
|
2710
2714
|
!!meta?.verticalAlign ? virtualTable_exports[`verticalAlign${meta?.verticalAlign}`] : void 0
|
|
2711
2715
|
),
|
|
@@ -2713,7 +2717,7 @@ var DefaultColumn = {
|
|
|
2713
2717
|
setIsEdit(true);
|
|
2714
2718
|
} : meta?.showInModal ? () => {
|
|
2715
2719
|
setShowModal(true);
|
|
2716
|
-
} : void 0,
|
|
2720
|
+
} : meta?.onClick && original[id]?.payload ? () => meta?.onClick?.(original[id]?.payload ?? {}) : void 0,
|
|
2717
2721
|
children: [
|
|
2718
2722
|
/* @__PURE__ */ jsx30("span", { className: viewSpan, children: shownValue }),
|
|
2719
2723
|
showModal && /* @__PURE__ */ jsx30(Modal, { open: showModal, onClose: () => closeModalRef.current?.(), children: /* @__PURE__ */ jsx30(Surface, { type: "panel", children: /* @__PURE__ */ jsx30("div", { className: modalContent, children: shownValue }) }) })
|
|
@@ -3089,6 +3093,7 @@ var createMeta = (column) => {
|
|
|
3089
3093
|
rowsAlign: column.rowsAlign,
|
|
3090
3094
|
valueFormat: column.valueFormat,
|
|
3091
3095
|
showInModal: column.showInModal,
|
|
3096
|
+
onClick: column.onClick,
|
|
3092
3097
|
label: column.label,
|
|
3093
3098
|
verticalAlign: column.verticalAlign,
|
|
3094
3099
|
toFixed: column.toFixed
|