@oliasoft-open-source/react-ui-library 10.3.1-beta-2 → 10.4.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/global.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +38 -37
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1758,6 +1758,7 @@ export declare interface ITabsProps {
|
|
|
1758
1758
|
onChange?: TTabsChangeEventHandler;
|
|
1759
1759
|
padding?: boolean;
|
|
1760
1760
|
margin?: boolean;
|
|
1761
|
+
small?: boolean;
|
|
1761
1762
|
testId?: string;
|
|
1762
1763
|
/** Default router link component for tab options with `to`. */
|
|
1763
1764
|
linkComponent?: ElementType_2;
|
|
@@ -2194,7 +2195,7 @@ export declare const Table: (props: ITableProps) => JSX.Element;
|
|
|
2194
2195
|
|
|
2195
2196
|
export declare const TableImportExport: ({ config, smartUploadConfig, testId }: ITableImportExportProps) => JSX.Element;
|
|
2196
2197
|
|
|
2197
|
-
export declare const Tabs: ({ name, options: rawOptions, value: rawValue, onChange, padding, margin, testId, linkComponent, }: ITabsProps) => JSX.Element | null;
|
|
2198
|
+
export declare const Tabs: ({ name, options: rawOptions, value: rawValue, onChange, padding, margin, small, testId, linkComponent, }: ITabsProps) => JSX.Element | null;
|
|
2198
2199
|
|
|
2199
2200
|
export declare type TAlign = 'left' | 'right' | 'center';
|
|
2200
2201
|
|
package/dist/index.js
CHANGED
|
@@ -7475,70 +7475,71 @@ var To = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Eo =
|
|
|
7475
7475
|
title: n == null ? void 0 : n.toString(),
|
|
7476
7476
|
children: e
|
|
7477
7477
|
}) : /* @__PURE__ */ S(x, { children: e }), ep = {
|
|
7478
|
-
tabs: "
|
|
7479
|
-
padding: "
|
|
7480
|
-
margin: "
|
|
7481
|
-
contentPadding: "
|
|
7482
|
-
item: "
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7478
|
+
tabs: "_tabs_1olt8_1",
|
|
7479
|
+
padding: "_padding_1olt8_7",
|
|
7480
|
+
margin: "_margin_1olt8_11",
|
|
7481
|
+
contentPadding: "_contentPadding_1olt8_14",
|
|
7482
|
+
item: "_item_1olt8_17",
|
|
7483
|
+
small: "_small_1olt8_35",
|
|
7484
|
+
left: "_left_1olt8_67",
|
|
7485
|
+
right: "_right_1olt8_67",
|
|
7486
|
+
selectionIndicator: "_selectionIndicator_1olt8_70"
|
|
7487
|
+
}, tp = ({ name: e = void 0, options: t = null, value: n = void 0, onChange: r = bn, padding: i = !1, margin: a = !0, small: o = !1, testId: s, linkComponent: c }) => {
|
|
7488
|
+
let l = u(W), { simpleInputs: d, options: f, selectedOptions: p } = Xc(t, n), m = mn(p) ? void 0 : d ? p : p.value, h = (e) => {
|
|
7488
7489
|
var t;
|
|
7489
|
-
return (t = e.component) == null ?
|
|
7490
|
-
},
|
|
7490
|
+
return (t = e.component) == null ? c : t;
|
|
7491
|
+
}, g = (e) => !!(e.to && h(e)), _ = (t) => {
|
|
7491
7492
|
var n;
|
|
7492
|
-
let i = (n =
|
|
7493
|
+
let i = (n = f == null ? void 0 : f.findIndex((e) => e.value === t)) == null ? -1 : n;
|
|
7493
7494
|
if (i === -1) return;
|
|
7494
|
-
let a =
|
|
7495
|
-
a.disabled ||
|
|
7495
|
+
let a = f[i];
|
|
7496
|
+
a.disabled || l || r({ target: {
|
|
7496
7497
|
name: e == null ? "" : e,
|
|
7497
7498
|
value: a.value,
|
|
7498
7499
|
label: String(a.label)
|
|
7499
7500
|
} });
|
|
7500
|
-
},
|
|
7501
|
-
let t =
|
|
7502
|
-
t &&
|
|
7503
|
-
},
|
|
7504
|
-
e.metaKey || e.ctrlKey || e.altKey || e.shiftKey ||
|
|
7505
|
-
},
|
|
7506
|
-
let { label: t, url: n, to: r, disabled: i, value: a, right:
|
|
7501
|
+
}, v = (e) => {
|
|
7502
|
+
let t = f == null ? void 0 : f.find((t) => g(t) && t.to === e);
|
|
7503
|
+
t && _(t.value);
|
|
7504
|
+
}, y = (e, t) => {
|
|
7505
|
+
e.metaKey || e.ctrlKey || e.altKey || e.shiftKey || _(t);
|
|
7506
|
+
}, x = f.filter((e) => !e.hidden || e.value === m), w = f.some(g), T = (e) => {
|
|
7507
|
+
let { label: t, url: n, to: r, disabled: i, value: a, right: s, invalid: c, badge: u, testId: d } = e, f = g(e), p = h(e), m = f ? r : n;
|
|
7507
7508
|
return /* @__PURE__ */ C(yi, {
|
|
7508
7509
|
id: a,
|
|
7509
|
-
...
|
|
7510
|
+
...m ? { href: m } : {},
|
|
7510
7511
|
shouldSelectOnPressUp: !0,
|
|
7511
|
-
isDisabled: i ||
|
|
7512
|
-
className: b(ep.item,
|
|
7513
|
-
"data-testid":
|
|
7514
|
-
render:
|
|
7512
|
+
isDisabled: i || l,
|
|
7513
|
+
className: b(ep.item, s ? ep.right : ep.left, o ? ep.small : ""),
|
|
7514
|
+
"data-testid": d,
|
|
7515
|
+
render: f && p ? (e) => "href" in e ? /* @__PURE__ */ S(p, {
|
|
7515
7516
|
...e,
|
|
7516
7517
|
to: r,
|
|
7517
7518
|
onClick: (t) => {
|
|
7518
7519
|
var n;
|
|
7519
|
-
(n = e.onClick) == null || n.call(e, t),
|
|
7520
|
+
(n = e.onClick) == null || n.call(e, t), y(t, a);
|
|
7520
7521
|
}
|
|
7521
7522
|
}) : /* @__PURE__ */ S("div", { ...e }) : void 0,
|
|
7522
7523
|
children: [/* @__PURE__ */ S($f, {
|
|
7523
7524
|
label: t,
|
|
7524
|
-
invalid:
|
|
7525
|
-
badge:
|
|
7525
|
+
invalid: c,
|
|
7526
|
+
badge: u
|
|
7526
7527
|
}), /* @__PURE__ */ S(vi, { className: ep.selectionIndicator })]
|
|
7527
7528
|
}, a);
|
|
7528
7529
|
};
|
|
7529
|
-
if (
|
|
7530
|
+
if (f) {
|
|
7530
7531
|
let t = /* @__PURE__ */ S(xi, {
|
|
7531
|
-
selectedKey:
|
|
7532
|
-
onSelectionChange:
|
|
7533
|
-
"data-testid":
|
|
7532
|
+
selectedKey: m,
|
|
7533
|
+
onSelectionChange: _,
|
|
7534
|
+
"data-testid": s,
|
|
7534
7535
|
children: /* @__PURE__ */ S(bi, {
|
|
7535
7536
|
"aria-label": e == null ? "Tabs" : e,
|
|
7536
7537
|
className: b(ep.tabs, i ? ep.padding : "", a ? ep.margin : ""),
|
|
7537
|
-
children:
|
|
7538
|
+
children: x.map(T)
|
|
7538
7539
|
})
|
|
7539
7540
|
});
|
|
7540
|
-
return
|
|
7541
|
-
navigate:
|
|
7541
|
+
return w ? /* @__PURE__ */ S(Yt, {
|
|
7542
|
+
navigate: v,
|
|
7542
7543
|
children: t
|
|
7543
7544
|
}) : t;
|
|
7544
7545
|
}
|
package/package.json
CHANGED