smartsell-ui-kit 0.1.22 → 0.1.23

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as ButtonProps, C as ControlSize } from './types-CSdgG6bT.cjs';
2
- export { a as Button, b as Card, c as CardProps, d as CardSmall, e as CardSmallProps, f as Checkbox, g as CheckboxProps, h as ComposableModal, i as ComposableModalProps, j as ComposableModalSlotRenderProps, k as ComposableModalSlotRenderer, D as DatePicker, l as DatePickerChangeContext, m as DatePickerChangeReason, n as DatePickerMode, o as DatePickerProps, p as DatePickerValue, I as Input, q as InputProps, M as Modal, r as ModalAction, s as ModalProps, t as ModalSlotContext, u as ModalSlotIds, v as ModalTheme, w as ModalThemeSource, S as Select, x as SelectAsync, y as SelectAsyncLoadContext, z as SelectAsyncLoadResult, A as SelectAsyncOption, E as SelectAsyncOptionValue, F as SelectAsyncProps, G as SelectProps, H as Separator, J as SeparatorOrientation, K as SeparatorProps, L as SharedTableProps, N as StandardModalProps, T as Table, O as TableAction, P as TableActionSource, Q as TableActionTone, R as TableAsync, U as TableAsyncLoadContext, V as TableAsyncLoadResult, W as TableAsyncProps, X as TableColumn, Y as TableColumnAlign, Z as TableColumnType, _ as TableLabels, $ as TableProps, a0 as TableRowClickHandler, a1 as Textarea, a2 as TextareaProps, a3 as UiKitTheme, a4 as createModalSlotIds, a5 as useUiKitTheme } from './types-CSdgG6bT.cjs';
1
+ import { B as ButtonProps, C as ControlSize } from './types-SEt2ljGe.cjs';
2
+ export { a as Button, b as Card, c as CardProps, d as CardSmall, e as CardSmallProps, f as Checkbox, g as CheckboxProps, h as ComposableModal, i as ComposableModalProps, j as ComposableModalSlotRenderProps, k as ComposableModalSlotRenderer, D as DatePicker, l as DatePickerChangeContext, m as DatePickerChangeReason, n as DatePickerMode, o as DatePickerProps, p as DatePickerValue, I as Input, q as InputProps, M as Modal, r as ModalAction, s as ModalProps, t as ModalSlotContext, u as ModalSlotIds, v as ModalTheme, w as ModalThemeSource, S as Select, x as SelectAsync, y as SelectAsyncLoadContext, z as SelectAsyncLoadResult, A as SelectAsyncOption, E as SelectAsyncOptionValue, F as SelectAsyncProps, G as SelectProps, H as Separator, J as SeparatorOrientation, K as SeparatorProps, L as SharedTableProps, N as StandardModalProps, T as Table, O as TableAction, P as TableActionSource, Q as TableActionTone, R as TableAsync, U as TableAsyncLoadContext, V as TableAsyncLoadResult, W as TableAsyncProps, X as TableColumn, Y as TableColumnAlign, Z as TableColumnType, _ as TableLabels, $ as TableProps, a0 as TableRowClickHandler, a1 as Textarea, a2 as TextareaProps, a3 as UiKitTheme, a4 as createModalSlotIds, a5 as useUiKitTheme } from './types-SEt2ljGe.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { HTMLAttributes, ReactNode, AriaRole, CSSProperties } from 'react';
5
5
  import 'smartsell-theme';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as ButtonProps, C as ControlSize } from './types-CSdgG6bT.js';
2
- export { a as Button, b as Card, c as CardProps, d as CardSmall, e as CardSmallProps, f as Checkbox, g as CheckboxProps, h as ComposableModal, i as ComposableModalProps, j as ComposableModalSlotRenderProps, k as ComposableModalSlotRenderer, D as DatePicker, l as DatePickerChangeContext, m as DatePickerChangeReason, n as DatePickerMode, o as DatePickerProps, p as DatePickerValue, I as Input, q as InputProps, M as Modal, r as ModalAction, s as ModalProps, t as ModalSlotContext, u as ModalSlotIds, v as ModalTheme, w as ModalThemeSource, S as Select, x as SelectAsync, y as SelectAsyncLoadContext, z as SelectAsyncLoadResult, A as SelectAsyncOption, E as SelectAsyncOptionValue, F as SelectAsyncProps, G as SelectProps, H as Separator, J as SeparatorOrientation, K as SeparatorProps, L as SharedTableProps, N as StandardModalProps, T as Table, O as TableAction, P as TableActionSource, Q as TableActionTone, R as TableAsync, U as TableAsyncLoadContext, V as TableAsyncLoadResult, W as TableAsyncProps, X as TableColumn, Y as TableColumnAlign, Z as TableColumnType, _ as TableLabels, $ as TableProps, a0 as TableRowClickHandler, a1 as Textarea, a2 as TextareaProps, a3 as UiKitTheme, a4 as createModalSlotIds, a5 as useUiKitTheme } from './types-CSdgG6bT.js';
1
+ import { B as ButtonProps, C as ControlSize } from './types-SEt2ljGe.js';
2
+ export { a as Button, b as Card, c as CardProps, d as CardSmall, e as CardSmallProps, f as Checkbox, g as CheckboxProps, h as ComposableModal, i as ComposableModalProps, j as ComposableModalSlotRenderProps, k as ComposableModalSlotRenderer, D as DatePicker, l as DatePickerChangeContext, m as DatePickerChangeReason, n as DatePickerMode, o as DatePickerProps, p as DatePickerValue, I as Input, q as InputProps, M as Modal, r as ModalAction, s as ModalProps, t as ModalSlotContext, u as ModalSlotIds, v as ModalTheme, w as ModalThemeSource, S as Select, x as SelectAsync, y as SelectAsyncLoadContext, z as SelectAsyncLoadResult, A as SelectAsyncOption, E as SelectAsyncOptionValue, F as SelectAsyncProps, G as SelectProps, H as Separator, J as SeparatorOrientation, K as SeparatorProps, L as SharedTableProps, N as StandardModalProps, T as Table, O as TableAction, P as TableActionSource, Q as TableActionTone, R as TableAsync, U as TableAsyncLoadContext, V as TableAsyncLoadResult, W as TableAsyncProps, X as TableColumn, Y as TableColumnAlign, Z as TableColumnType, _ as TableLabels, $ as TableProps, a0 as TableRowClickHandler, a1 as Textarea, a2 as TextareaProps, a3 as UiKitTheme, a4 as createModalSlotIds, a5 as useUiKitTheme } from './types-SEt2ljGe.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { HTMLAttributes, ReactNode, AriaRole, CSSProperties } from 'react';
5
5
  import 'smartsell-theme';
package/dist/index.js CHANGED
@@ -4905,12 +4905,15 @@ function ChevronIcon({ direction }) {
4905
4905
  }
4906
4906
  );
4907
4907
  }
4908
- function OverflowMenu({ label, children }) {
4908
+ function OverflowMenu({ label, children, openRequest }) {
4909
4909
  const [isOpen, setIsOpen] = useState6(false);
4910
4910
  const [menuPosition, setMenuPosition] = useState6(null);
4911
4911
  const containerRef = useRef5(null);
4912
4912
  const buttonRef = useRef5(null);
4913
4913
  const menuRef = useRef5(null);
4914
+ useEffect7(() => {
4915
+ if (openRequest) setIsOpen(true);
4916
+ }, [openRequest]);
4914
4917
  const updateMenuPosition = () => {
4915
4918
  var _a, _b, _c;
4916
4919
  const triggerRect = (_a = buttonRef.current) == null ? void 0 : _a.getBoundingClientRect();
@@ -5034,6 +5037,7 @@ function TableBase({
5034
5037
  mobileColumns,
5035
5038
  getRowId: getCustomRowId,
5036
5039
  onRowClick,
5040
+ rowClickOpensActions = false,
5037
5041
  actions,
5038
5042
  stickyActionsColumn = true,
5039
5043
  maxInlineActions = DEFAULT_MAX_INLINE_ACTIONS,
@@ -5064,6 +5068,7 @@ function TableBase({
5064
5068
  const containerRef = useRef5(null);
5065
5069
  const [containerWidth, setContainerWidth] = useState6(null);
5066
5070
  const [isSettingsModalOpen, setIsSettingsModalOpen] = useState6(false);
5071
+ const [requestedActions, setRequestedActions] = useState6({ rowId: "", count: 0 });
5067
5072
  const resolvedLabels = mergeTableLabels({
5068
5073
  ...labels != null ? labels : {},
5069
5074
  ...translations != null ? translations : {}
@@ -5123,7 +5128,15 @@ function TableBase({
5123
5128
  ariaLabel,
5124
5129
  normalizedPage
5125
5130
  );
5126
- const hasRowClick = Boolean(onRowClick);
5131
+ const hasRowClick = Boolean(onRowClick || rowClickOpensActions);
5132
+ const handleRowClick = (item, rowIndex) => {
5133
+ if (rowClickOpensActions) {
5134
+ const rowId = getRowId(item, rowIndex, getCustomRowId);
5135
+ setRequestedActions((current) => ({ rowId, count: current.count + 1 }));
5136
+ } else {
5137
+ onRowClick == null ? void 0 : onRowClick(item, rowIndex);
5138
+ }
5139
+ };
5127
5140
  const shouldStickActionsColumn = Boolean(actions) && stickyActionsColumn;
5128
5141
  const getStickyActionsCellStyle = (backgroundColor, backgroundImage, isHeader = false) => ({
5129
5142
  position: "sticky",
@@ -5236,9 +5249,16 @@ function TableBase({
5236
5249
  inlineActions.map(
5237
5250
  (action) => renderActionButton(action, item, rowIndex, "inline")
5238
5251
  ),
5239
- overflowActions.length > 0 ? /* @__PURE__ */ jsx18(OverflowMenu, { label: resolvedLabels.actionsMenuLabel, children: overflowActions.map(
5240
- (action) => renderActionButton(action, item, rowIndex, "menu")
5241
- ) }) : null
5252
+ overflowActions.length > 0 ? /* @__PURE__ */ jsx18(
5253
+ OverflowMenu,
5254
+ {
5255
+ label: resolvedLabels.actionsMenuLabel,
5256
+ openRequest: requestedActions.rowId === getRowId(item, rowIndex, getCustomRowId) ? requestedActions.count : void 0,
5257
+ children: overflowActions.map(
5258
+ (action) => renderActionButton(action, item, rowIndex, "menu")
5259
+ )
5260
+ }
5261
+ ) : null
5242
5262
  ]
5243
5263
  }
5244
5264
  );
@@ -5370,7 +5390,7 @@ function TableBase({
5370
5390
  "px-3.5 py-3 shadow-none",
5371
5391
  hasRowClick ? "cursor-pointer" : ""
5372
5392
  ].join(" "),
5373
- onClick: onRowClick ? () => onRowClick(item, rowIndex) : void 0,
5393
+ onClick: hasRowClick ? () => handleRowClick(item, rowIndex) : void 0,
5374
5394
  children: [
5375
5395
  /* @__PURE__ */ jsx18(
5376
5396
  "div",
@@ -5541,7 +5561,7 @@ function TableBase({
5541
5561
  isAlternateRow ? "bg-[var(--theme-background)]" : "bg-[var(--theme-surface)]",
5542
5562
  hasRowClick ? "cursor-pointer" : ""
5543
5563
  ].join(" "),
5544
- onClick: onRowClick ? () => onRowClick(item, rowIndex) : void 0,
5564
+ onClick: hasRowClick ? () => handleRowClick(item, rowIndex) : void 0,
5545
5565
  children: [
5546
5566
  desktopColumns.map((column, columnIndex) => {
5547
5567
  return renderDesktopCell(