nntc-ui 0.0.36 → 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 +16 -10
- 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
|
}
|
|
@@ -1806,7 +1806,8 @@ function MultiSelect(props) {
|
|
|
1806
1806
|
value: title2,
|
|
1807
1807
|
onClick: inputClickHandler,
|
|
1808
1808
|
disabled: disabled2,
|
|
1809
|
-
title: activeItems.map((i) => i.name).join(", ")
|
|
1809
|
+
title: activeItems.map((i) => i.name).join(", "),
|
|
1810
|
+
autoComplete: "off"
|
|
1810
1811
|
}
|
|
1811
1812
|
),
|
|
1812
1813
|
!!icon6 && /* @__PURE__ */ jsx20("span", { onClick: inputClickHandler, className: classnames11(icon5, classes?.icon), children: icon6 }),
|
|
@@ -2261,7 +2262,7 @@ import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
|
2261
2262
|
function Tooltip(props) {
|
|
2262
2263
|
const {
|
|
2263
2264
|
label: label7,
|
|
2264
|
-
clickable,
|
|
2265
|
+
clickable: clickable2,
|
|
2265
2266
|
initialOpen,
|
|
2266
2267
|
placement,
|
|
2267
2268
|
withoutArrow,
|
|
@@ -2284,8 +2285,8 @@ function Tooltip(props) {
|
|
|
2284
2285
|
{
|
|
2285
2286
|
placement,
|
|
2286
2287
|
initialOpen,
|
|
2287
|
-
open:
|
|
2288
|
-
onOpenChange:
|
|
2288
|
+
open: clickable2 ? showTooltip : void 0,
|
|
2289
|
+
onOpenChange: clickable2 ? setShowTooltip : void 0,
|
|
2289
2290
|
withoutArrow,
|
|
2290
2291
|
arrowRef,
|
|
2291
2292
|
root: root22,
|
|
@@ -2294,7 +2295,7 @@ function Tooltip(props) {
|
|
|
2294
2295
|
TooltipTrigger,
|
|
2295
2296
|
{
|
|
2296
2297
|
wrapTrigger,
|
|
2297
|
-
onClick:
|
|
2298
|
+
onClick: clickable2 ? () => setShowTooltip((prev) => !prev) : void 0,
|
|
2298
2299
|
className: wrapTrigger ? classnames16(trigger2, classes?.trigger) : void 0,
|
|
2299
2300
|
children: children2
|
|
2300
2301
|
}
|
|
@@ -2566,6 +2567,7 @@ __export(virtualTable_exports, {
|
|
|
2566
2567
|
bordersHorizontal: () => bordersHorizontal,
|
|
2567
2568
|
bordersVertical: () => bordersVertical,
|
|
2568
2569
|
bottomBorder: () => bottomBorder,
|
|
2570
|
+
clickable: () => clickable,
|
|
2569
2571
|
default: () => virtualTable_default,
|
|
2570
2572
|
error: () => error2,
|
|
2571
2573
|
evenRow: () => evenRow,
|
|
@@ -2626,6 +2628,7 @@ var viewCell = "virtualTable_viewCell";
|
|
|
2626
2628
|
var error2 = "virtualTable_error";
|
|
2627
2629
|
var viewSpan = "virtualTable_viewSpan";
|
|
2628
2630
|
var showInModal = "virtualTable_showInModal";
|
|
2631
|
+
var clickable = "virtualTable_clickable";
|
|
2629
2632
|
var modalContent = "virtualTable_modalContent";
|
|
2630
2633
|
var verticalAlignFlexStart = "virtualTable_verticalAlignFlexStart";
|
|
2631
2634
|
var verticalAlignCenter = "virtualTable_verticalAlignCenter";
|
|
@@ -2662,6 +2665,7 @@ var virtualTable_default = {
|
|
|
2662
2665
|
error: error2,
|
|
2663
2666
|
viewSpan,
|
|
2664
2667
|
showInModal,
|
|
2668
|
+
clickable,
|
|
2665
2669
|
modalContent,
|
|
2666
2670
|
verticalAlignFlexStart,
|
|
2667
2671
|
verticalAlignCenter,
|
|
@@ -2705,6 +2709,7 @@ var DefaultColumn = {
|
|
|
2705
2709
|
viewCell,
|
|
2706
2710
|
!!meta?.rowsAlign ? virtualTable_exports[`align${meta?.rowsAlign}`] : void 0,
|
|
2707
2711
|
meta?.showInModal ? showInModal : void 0,
|
|
2712
|
+
meta?.onClick && original[id]?.payload ? clickable : void 0,
|
|
2708
2713
|
original[id]?.error ? error2 : void 0,
|
|
2709
2714
|
!!meta?.verticalAlign ? virtualTable_exports[`verticalAlign${meta?.verticalAlign}`] : void 0
|
|
2710
2715
|
),
|
|
@@ -2712,7 +2717,7 @@ var DefaultColumn = {
|
|
|
2712
2717
|
setIsEdit(true);
|
|
2713
2718
|
} : meta?.showInModal ? () => {
|
|
2714
2719
|
setShowModal(true);
|
|
2715
|
-
} : void 0,
|
|
2720
|
+
} : meta?.onClick && original[id]?.payload ? () => meta?.onClick?.(original[id]?.payload ?? {}) : void 0,
|
|
2716
2721
|
children: [
|
|
2717
2722
|
/* @__PURE__ */ jsx30("span", { className: viewSpan, children: shownValue }),
|
|
2718
2723
|
showModal && /* @__PURE__ */ jsx30(Modal, { open: showModal, onClose: () => closeModalRef.current?.(), children: /* @__PURE__ */ jsx30(Surface, { type: "panel", children: /* @__PURE__ */ jsx30("div", { className: modalContent, children: shownValue }) }) })
|
|
@@ -3088,6 +3093,7 @@ var createMeta = (column) => {
|
|
|
3088
3093
|
rowsAlign: column.rowsAlign,
|
|
3089
3094
|
valueFormat: column.valueFormat,
|
|
3090
3095
|
showInModal: column.showInModal,
|
|
3096
|
+
onClick: column.onClick,
|
|
3091
3097
|
label: column.label,
|
|
3092
3098
|
verticalAlign: column.verticalAlign,
|
|
3093
3099
|
toFixed: column.toFixed
|