@abdellatifui/react 3.1.94 → 3.1.96

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/nextgen.d.ts CHANGED
@@ -386,10 +386,15 @@ export declare interface InformationTableProps {
386
386
  className?: string;
387
387
  }
388
388
 
389
- export declare const InlineSpinner: default_2.MemoExoticComponent<default_2.ForwardRefExoticComponent<default_2.RefAttributes<unknown>>>;
389
+ export declare const InlineSpinner: default_2.MemoExoticComponent<default_2.ForwardRefExoticComponent<InlineSpinnerProps & default_2.RefAttributes<InlineSpinnerHandle>>>;
390
+
391
+ declare interface InlineSpinnerHandle extends ModelHandle {
392
+ }
390
393
 
391
394
  export declare interface InlineSpinnerProps extends SpinnerProps {
392
395
  inline?: boolean;
396
+ defaultOpen?: boolean;
397
+ modelClassName?: string | Record<string, any>;
393
398
  }
394
399
 
395
400
  export declare const Input: default_2.MemoExoticComponent<default_2.ForwardRefExoticComponent<default_2.RefAttributes<unknown>>>;
package/dist/nextgen.js CHANGED
@@ -6636,33 +6636,41 @@ const SpinnerDialog = forwardRef((props, ref) => {
6636
6636
  const rref = useRef();
6637
6637
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Model, { inline, ref: ref || rref, className: cn("z-[30000]", modelClassName), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { variant, size, period, onAbort, text, timeout: timeout2 }) }) });
6638
6638
  });
6639
- const InlineSpinnerComponent = forwardRef((props, ref) => {
6640
- const { defaultOpen } = props;
6641
- const rref = useRef({});
6642
- useEffect(() => {
6643
- if (defaultOpen) {
6644
- if (ref) {
6645
- if (ref.current) {
6646
- ref.open();
6647
- }
6648
- } else if (rref) {
6649
- if (rref.current) {
6650
- rref.open();
6651
- }
6639
+ const InlineSpinnerComponent = forwardRef(
6640
+ (props, ref) => {
6641
+ const { defaultOpen, ...restProps } = props;
6642
+ const internalRef = useRef(null);
6643
+ const spinnerRef = ref || internalRef;
6644
+ useEffect(() => {
6645
+ if (defaultOpen) {
6646
+ const timer = setTimeout(() => {
6647
+ var _a;
6648
+ const currentRef = ref || internalRef;
6649
+ if (currentRef && typeof currentRef === "object" && "current" in currentRef) {
6650
+ if ((_a = currentRef.current) == null ? void 0 : _a.open) {
6651
+ currentRef.current.open();
6652
+ }
6653
+ }
6654
+ }, 0);
6655
+ return () => clearTimeout(timer);
6652
6656
  }
6653
- }
6654
- }, [defaultOpen]);
6655
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
6656
- SpinnerDialog,
6657
- {
6658
- ...props,
6659
- inline: true,
6660
- open: true,
6661
- ref: ref || rref
6662
- }
6663
- );
6657
+ }, [defaultOpen]);
6658
+ const SpinnerDialogTyped = SpinnerDialog;
6659
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
6660
+ SpinnerDialogTyped,
6661
+ {
6662
+ ...restProps,
6663
+ inline: true,
6664
+ open: true,
6665
+ ref: spinnerRef
6666
+ }
6667
+ );
6668
+ }
6669
+ );
6670
+ InlineSpinnerComponent.displayName = "InlineSpinner";
6671
+ const InlineSpinner = memo(InlineSpinnerComponent, (prevProps, nextProps) => {
6672
+ return prevProps.defaultOpen === nextProps.defaultOpen && prevProps.variant === nextProps.variant && prevProps.size === nextProps.size && prevProps.text === nextProps.text && prevProps.timeout === nextProps.timeout && prevProps.period === nextProps.period && prevProps.onAbort === nextProps.onAbort && prevProps.className === nextProps.className && prevProps.modelClassName === nextProps.modelClassName;
6664
6673
  });
6665
- const InlineSpinner = memo(InlineSpinnerComponent);
6666
6674
  const buttonVariants = cva(
6667
6675
  "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-auto",
6668
6676
  {
@@ -12380,7 +12388,12 @@ const Model = forwardRef((props, ref) => {
12380
12388
  onContextMenu: handleContextMenu,
12381
12389
  onClick: handleWrapperClose,
12382
12390
  id,
12383
- className: cn(vrs$g({ variant, inline, blur }), "custom-click-away flex justify-center items-center opacity-100", className),
12391
+ className: cn(
12392
+ vrs$g({ variant, inline, blur }),
12393
+ "custom-click-away flex justify-center items-center opacity-100",
12394
+ className,
12395
+ open && "z-[300]"
12396
+ ),
12384
12397
  children
12385
12398
  }
12386
12399
  ) }) });
@@ -19425,7 +19438,7 @@ const Topbar = (props) => {
19425
19438
  );
19426
19439
  expandApi.triggerExpansion("internal", expandApi.expanded);
19427
19440
  }, [(_b = callback.cell) == null ? void 0 : _b.value]);
19428
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center w-full css-klk212 border-b p-2 overflow-hidden h-[55px]", children: [
19441
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center w-full css-klk212 border-b p-1 overflow-hidden h-[40px]", children: [
19429
19442
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "select-none font-aptos font-[400] flex w-[calc(100%)-80px]", children: [
19430
19443
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-black w-fit text-nowrap border-r mr-4 pr-2 ", children: tableName }),
19431
19444
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "select-none font-Roboto text-black text-nowrap w-full flex", children: [
@@ -19433,12 +19446,13 @@ const Topbar = (props) => {
19433
19446
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: " max-w-[300px] z-0 ml-2 text-gray-600 truncate", title: (_d = cell.value) == null ? void 0 : _d.toString(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "capitaliz", children: ((_e = cell.value) == null ? void 0 : _e.toString()) ? (_f = cell.value) == null ? void 0 : _f.toString() : "" }) })
19434
19447
  ] })
19435
19448
  ] }),
19436
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mr-1 p-1 border-l absolute right-0 css-klk212 z-10", children: [
19449
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mr-1 p-1 border-l absolute right-0 css-klk212 z-10 scale-90", children: [
19437
19450
  isFilterApplied ? /* @__PURE__ */ jsxRuntimeExports.jsx(
19438
19451
  IconButton$1,
19439
19452
  {
19440
19453
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FilterX, { color: "gray" }),
19441
19454
  tooltip: "Clear all filters.",
19455
+ outline: false,
19442
19456
  onClick: () => {
19443
19457
  setFilterItems((prev2) => {
19444
19458
  prev2.row.map((item) => {
@@ -19458,6 +19472,7 @@ const Topbar = (props) => {
19458
19472
  {
19459
19473
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCw, {}),
19460
19474
  tooltip: "Refresh",
19475
+ outline: false,
19461
19476
  disable: isRefreshDisabled,
19462
19477
  onClick: () => {
19463
19478
  onRefresh(callback);
@@ -19467,6 +19482,7 @@ const Topbar = (props) => {
19467
19482
  /* @__PURE__ */ jsxRuntimeExports.jsx(
19468
19483
  IconButton$1,
19469
19484
  {
19485
+ outline: false,
19470
19486
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Fullscreen, {}),
19471
19487
  tooltip: "Fullscreen",
19472
19488
  onClick: () => {
@@ -19480,6 +19496,7 @@ const Topbar = (props) => {
19480
19496
  {
19481
19497
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FoldHorizontal, {}),
19482
19498
  tooltip: "Autofit columns",
19499
+ outline: false,
19483
19500
  onClick: () => {
19484
19501
  callback.autoFit(false);
19485
19502
  }
@@ -19488,6 +19505,7 @@ const Topbar = (props) => {
19488
19505
  /* @__PURE__ */ jsxRuntimeExports.jsx(
19489
19506
  IconButton$1,
19490
19507
  {
19508
+ outline: false,
19491
19509
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Download, {}),
19492
19510
  tooltip: "Export(CSV)",
19493
19511
  onClick: () => {
@@ -19498,6 +19516,7 @@ const Topbar = (props) => {
19498
19516
  enableExpand && /* @__PURE__ */ jsxRuntimeExports.jsx(
19499
19517
  IconButton$1,
19500
19518
  {
19519
+ outline: false,
19501
19520
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Brackets, {}),
19502
19521
  disable: expandBtnDisable,
19503
19522
  tooltip: "Expand Cell Array Items",
@@ -19507,6 +19526,7 @@ const Topbar = (props) => {
19507
19526
  /* @__PURE__ */ jsxRuntimeExports.jsx(
19508
19527
  IconButton$1,
19509
19528
  {
19529
+ outline: false,
19510
19530
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LucideEllipsisVertical, {}),
19511
19531
  tooltip: "Show more options",
19512
19532
  onClick: (e) => {
@@ -19915,9 +19935,7 @@ const TableComponent = forwardRef((props, ref) => {
19915
19935
  setCell({ header: hasValue ? cell.header : " ", value: hasValue ? cell.value : " ", params });
19916
19936
  setShowCopyMenuButton(hasValue);
19917
19937
  event.preventDefault();
19918
- requestAnimationFrame(() => {
19919
- setTableBodyMenuEvent(event);
19920
- });
19938
+ setTableBodyMenuEvent(event);
19921
19939
  }, [cell.value, cell.header]);
19922
19940
  useEffect(() => {
19923
19941
  if (ready) {
@@ -20237,7 +20255,7 @@ const TableComponent = forwardRef((props, ref) => {
20237
20255
  close: false
20238
20256
  }
20239
20257
  ),
20240
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("w-full relative flex flex-col", topbar ? "h-[calc(100%-60px)] " : "h-full"), children: [
20258
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("w-full relative flex flex-col", topbar ? "h-[calc(100%-40px)] " : "h-full"), children: [
20241
20259
  showTableSpinner ? /* @__PURE__ */ jsxRuntimeExports.jsx(InlineSpinner, { variant: "white", defaultOpen: true }) : false,
20242
20260
  /* @__PURE__ */ jsxRuntimeExports.jsx(
20243
20261
  AgGridReact,
@@ -26191,30 +26209,41 @@ const TabItem = forwardRef((props, ref) => {
26191
26209
  className = "",
26192
26210
  defaultTab,
26193
26211
  full,
26194
- theme = "minimal"
26212
+ theme = "minimal",
26213
+ onMouseEnter = () => {
26214
+ },
26215
+ onMouseLeave = () => {
26216
+ }
26195
26217
  } = props;
26196
- const hanldeChange = useCallback(() => {
26218
+ const hanldeChange = useCallback((e) => {
26197
26219
  if (defaultTab === tab.value) {
26198
26220
  return;
26199
26221
  }
26200
26222
  setDefaultTab(tab.value);
26201
- onChange(tab, tab.value);
26223
+ onChange({ event: e, ...tab, currentTab: defaultTab, props, ref }, tab.value);
26202
26224
  if (tab.onSelected) {
26203
- tab.onSelected(tab, tab.value);
26225
+ tab.onSelected({ event: e, ...tab, currentTab: defaultTab, props, ref }, tab.value);
26204
26226
  }
26205
26227
  }, [tab.value, defaultTab, onChange, setDefaultTab, tab, props]);
26206
26228
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
26207
26229
  TabsTrigger,
26208
26230
  {
26209
26231
  ref,
26232
+ onMouseEnter: (e) => {
26233
+ onMouseEnter({ event: e, ...tab, currentTab: defaultTab, props, ref });
26234
+ },
26235
+ onMouseLeave: (e) => {
26236
+ onMouseLeave({ event: e, ...tab, currentTab: defaultTab, props, ref });
26237
+ },
26210
26238
  theme,
26211
26239
  className: cn(
26212
26240
  vrs2({ outline: outline2, full }),
26213
- className,
26214
26241
  theme === "modern" ? "min-w-[90px] relative before:absolute before:inset-0 before:rounded before:bg-gradient-to-r before:from-blue-500/5 before:to-purple-500/5 before:opacity-0 before:transition-opacity before:duration-300 hover:before:opacity-100 data-[state=active]:before:opacity-100" : "",
26215
- theme === "v2" ? "bg-transparent rounded-none p-2 font data-[state=active]:text-blue-500 !font-semibold" : ""
26242
+ theme === "v2" && "bg-transparent rounded-none p-2 font data-[state=active]:text-blue-500 !font-semibold",
26243
+ className
26216
26244
  ),
26217
26245
  value: tab.value,
26246
+ "data-selected": defaultTab === tab.value ? "true" : "false",
26218
26247
  onClick: hanldeChange,
26219
26248
  children: theme === "modern" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "relative z-10 transition-all duration-200 group-hover:scale-[1.01]", children: tab.label }) : tab.label
26220
26249
  },
@@ -26310,7 +26339,12 @@ const ShadcnTabs = forwardRef((props, ref) => {
26310
26339
  full,
26311
26340
  theme,
26312
26341
  ref: (el) => tabRefs.current[index] = el,
26313
- boxSize
26342
+ boxSize,
26343
+ className: (tab == null ? void 0 : tab.className) || "",
26344
+ onMouseEnter: (tab == null ? void 0 : tab.onMouseEnter) || (() => {
26345
+ }),
26346
+ onMouseLeave: (tab == null ? void 0 : tab.onMouseLeave) || (() => {
26347
+ })
26314
26348
  },
26315
26349
  (tab == null ? void 0 : tab.value) || key
26316
26350
  )),