@rehagro/ui 1.0.55 → 1.0.56

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.mjs CHANGED
@@ -4083,6 +4083,7 @@ var CustomSelect = ({
4083
4083
  value,
4084
4084
  placeholder,
4085
4085
  rows: 1,
4086
+ onClick: (e) => e.stopPropagation(),
4086
4087
  onInput: (e) => {
4087
4088
  onChange(e.currentTarget.value);
4088
4089
  resizeTextArea();
@@ -4091,7 +4092,7 @@ var CustomSelect = ({
4091
4092
  color: inputTextColor,
4092
4093
  backgroundColor: backgroundColor || "transparent"
4093
4094
  },
4094
- className: "rh-table-textarea rh-flex rh-items-center rh-leading-[20px] rh-py-[7px] rh-w-full rh-min-h-[40px] rh-text-sm rh-px-1 rh-border rh-bg-surface rh-rounded-xs rh-border-transparent rh-line-height-[20px] rh-outline-none rh-resize-none rh-overflow-hidden hover:rh-border-primary focus:rh-border-primary focus:rh-ring-2 focus:rh-ring-gray-200"
4095
+ className: "rh-table-textarea rh-flex rh-items-center rh-leading-[20px] rh-py-[7px] rh-w-full rh-min-h-[40px] rh-text-sm rh-px-1 rh-border rh-bg-surface rh-rounded-xs rh-border-transparent rh-line-height-[20px] rh-outline-none rh-resize-none rh-overflow-hidden hover:rh-border-primary hover:rh-ring-2 hover:rh-ring-gray-200"
4095
4096
  }
4096
4097
  ),
4097
4098
  /* @__PURE__ */ jsx("style", { children: `.rh-table-textarea::placeholder { color: ${inputPlaceholderColor}; }` })
@@ -4102,13 +4103,16 @@ var CustomSelect = ({
4102
4103
  "button",
4103
4104
  {
4104
4105
  type: "button",
4105
- onClick: openDropdown,
4106
+ onClick: (e) => {
4107
+ e.stopPropagation();
4108
+ openDropdown();
4109
+ },
4106
4110
  style: { backgroundColor: backgroundColor || void 0 },
4107
4111
  className: "rh-w-full rh-min-h-[40px] rh-flex rh-items-center rh-border rh-bg-surface rh-rounded-sm rh-border-transparent rh-justify-between rh-py-2 hover:rh-border-primary hover:rh-ring-2 hover:rh-ring-gray-200 rh-cursor-pointer rh-text-left",
4108
4112
  children: /* @__PURE__ */ jsx("div", { className: "rh-flex rh-items-center rh-gap-2 rh-flex-1 rh-px-0.5", children: /* @__PURE__ */ jsx(
4109
4113
  "span",
4110
4114
  {
4111
- className: "rh-text-[14px] rh-px-2 rh-py-0.5 rh-rounded-xl rh-whitespace-normal rh-break-words",
4115
+ className: "rh-text-[14px] rh-px-3.5 rh-py-0.5 rh-rounded-xl rh-whitespace-normal rh-break-words",
4112
4116
  style: { backgroundColor: displayBg || "transparent", fontFamily: "Inter, sans-serif", color: displayTextColor },
4113
4117
  children: displayLabel
4114
4118
  }
@@ -4127,6 +4131,7 @@ var CustomSelect = ({
4127
4131
  type: "button",
4128
4132
  onMouseDown: (e) => {
4129
4133
  e.preventDefault();
4134
+ e.stopPropagation();
4130
4135
  onChange(option.value);
4131
4136
  setIsOpen(false);
4132
4137
  },
@@ -4187,6 +4192,8 @@ function TableInner({
4187
4192
  columns,
4188
4193
  data,
4189
4194
  rowKey,
4195
+ rowClickable = false,
4196
+ onRowClick,
4190
4197
  size = "md",
4191
4198
  variant = "default",
4192
4199
  sort,
@@ -4390,9 +4397,18 @@ function TableInner({
4390
4397
  style: bodyStyleInline,
4391
4398
  className: [
4392
4399
  "rh-border-b rh-border-border rh-transition-colors",
4400
+ rowClickable ? "rh-cursor-pointer" : "",
4393
4401
  "hover:rh-bg-background/50",
4394
4402
  variant === "striped" && index % 2 === 1 ? "rh-bg-background/50" : ""
4395
4403
  ].filter(Boolean).join(" "),
4404
+ onClick: (e) => {
4405
+ if (!rowClickable || !onRowClick) return;
4406
+ const target = e.target;
4407
+ if (!target) return;
4408
+ const interactiveSelector = 'button, a, input, select, textarea, label, [role="button"], [data-no-row-click]';
4409
+ if (target.closest(interactiveSelector)) return;
4410
+ onRowClick(row, index, e);
4411
+ },
4396
4412
  children: columns.map((column) => /* @__PURE__ */ jsx(
4397
4413
  "td",
4398
4414
  {
@@ -4402,7 +4418,7 @@ function TableInner({
4402
4418
  alignClasses[column.align || "left"],
4403
4419
  "rh-text-text"
4404
4420
  ].filter(Boolean).join(" "),
4405
- children: /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between rh-gap-2", children: [
4421
+ children: /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-stretch rh-justify-between rh-gap-2 rh-h-full", children: [
4406
4422
  isEditableCell(column) ? /* @__PURE__ */ jsx(
4407
4423
  CustomSelect,
4408
4424
  {