@protonradio/proton-ui 0.7.13 → 0.7.15
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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +31 -18
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -437,10 +437,12 @@ declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
|
|
|
437
437
|
|
|
438
438
|
export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
|
|
439
439
|
align?: "left" | "center" | "right";
|
|
440
|
+
onClick?: (key: string) => void;
|
|
440
441
|
}
|
|
441
442
|
|
|
442
443
|
export declare interface ProtonRowProps<T = object> extends RowProps<T> {
|
|
443
444
|
backgroundColor?: string;
|
|
445
|
+
onClick?: (key: string) => void;
|
|
444
446
|
}
|
|
445
447
|
|
|
446
448
|
export declare interface ProtonTableBodyProps<T = object> extends TableBodyProps<T> {
|
package/dist/index.es.js
CHANGED
|
@@ -11412,46 +11412,49 @@ function Kh({
|
|
|
11412
11412
|
children: e,
|
|
11413
11413
|
state: n,
|
|
11414
11414
|
backgroundColor: r,
|
|
11415
|
-
|
|
11415
|
+
onClick: l,
|
|
11416
|
+
showLines: i = !0
|
|
11416
11417
|
}) {
|
|
11417
|
-
let
|
|
11418
|
+
let o = M(), a = n.selectionManager.isSelected(t.key), { rowProps: u, isPressed: s } = zp(
|
|
11418
11419
|
{
|
|
11419
11420
|
node: t
|
|
11420
11421
|
},
|
|
11421
11422
|
n,
|
|
11422
|
-
|
|
11423
|
-
), { isFocusVisible:
|
|
11423
|
+
o
|
|
11424
|
+
), { isFocusVisible: c, focusProps: d } = Xt();
|
|
11424
11425
|
return /* @__PURE__ */ b.jsx(
|
|
11425
11426
|
"tr",
|
|
11426
11427
|
{
|
|
11427
11428
|
className: W(
|
|
11428
11429
|
"proton-Table__row",
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11430
|
+
a ? "proton-Table__row--selected" : null,
|
|
11431
|
+
s ? "proton-Table__row--pressed" : null,
|
|
11432
|
+
c ? "proton-Table__row--focused" : null,
|
|
11433
|
+
i && "proton-Table__row--showLines"
|
|
11433
11434
|
),
|
|
11434
11435
|
style: r ? { backgroundColor: r } : void 0,
|
|
11435
|
-
...H(
|
|
11436
|
-
ref:
|
|
11436
|
+
...H(u, d),
|
|
11437
|
+
ref: o,
|
|
11438
|
+
onClick: l ? () => l(t.key) : void 0,
|
|
11437
11439
|
children: e
|
|
11438
11440
|
}
|
|
11439
11441
|
);
|
|
11440
11442
|
}
|
|
11441
|
-
function Mh({ cell: t, state: e, width: n }) {
|
|
11442
|
-
let
|
|
11443
|
-
const { align:
|
|
11443
|
+
function Mh({ cell: t, state: e, width: n, onClick: r }) {
|
|
11444
|
+
let l = M(), { gridCellProps: i } = Vp({ node: t }, e, l), { isFocusVisible: o, focusProps: a } = Xt();
|
|
11445
|
+
const { align: u = "left" } = t.props;
|
|
11444
11446
|
return /* @__PURE__ */ b.jsx(
|
|
11445
11447
|
"td",
|
|
11446
11448
|
{
|
|
11447
|
-
...H(
|
|
11449
|
+
...H(i, a),
|
|
11448
11450
|
className: W(
|
|
11449
11451
|
"proton-Table__cell",
|
|
11450
|
-
|
|
11451
|
-
`proton-Table__cell--${
|
|
11452
|
+
o ? "proton-Table__cell--focused" : null,
|
|
11453
|
+
`proton-Table__cell--${u}`
|
|
11452
11454
|
),
|
|
11453
11455
|
style: n ? { width: n } : void 0,
|
|
11454
|
-
ref:
|
|
11456
|
+
ref: l,
|
|
11457
|
+
onClick: r ? () => r(t.key) : void 0,
|
|
11455
11458
|
children: t.rendered
|
|
11456
11459
|
}
|
|
11457
11460
|
);
|
|
@@ -11482,7 +11485,17 @@ function f4(t) {
|
|
|
11482
11485
|
state: e,
|
|
11483
11486
|
backgroundColor: o.props.backgroundColor,
|
|
11484
11487
|
showLines: r.body.props.showLines,
|
|
11485
|
-
|
|
11488
|
+
onClick: o.props.onClick,
|
|
11489
|
+
children: Array.from(r.getChildren(o.key)).map((a) => /* @__PURE__ */ b.jsx(
|
|
11490
|
+
Mh,
|
|
11491
|
+
{
|
|
11492
|
+
cell: a,
|
|
11493
|
+
state: e,
|
|
11494
|
+
width: a.props.width,
|
|
11495
|
+
onClick: a.props.onClick
|
|
11496
|
+
},
|
|
11497
|
+
a.key
|
|
11498
|
+
))
|
|
11486
11499
|
},
|
|
11487
11500
|
o.key
|
|
11488
11501
|
)) })
|