@rehagro/ui 1.0.59 → 1.0.61
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.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -13
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1580,17 +1580,21 @@ var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsx(
|
|
|
1580
1580
|
)
|
|
1581
1581
|
}
|
|
1582
1582
|
);
|
|
1583
|
-
var RadioIcon = ({ isSelected }) => /* @__PURE__ */
|
|
1584
|
-
"
|
|
1583
|
+
var RadioIcon = ({ isSelected }) => /* @__PURE__ */ jsxs(
|
|
1584
|
+
"svg",
|
|
1585
1585
|
{
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
"rh-border rh-rounded-full rh-transition-colors rh-duration-150",
|
|
1590
|
-
isSelected ? "rh-border-primary" : "rh-border-border rh-bg-surface"
|
|
1591
|
-
].filter(Boolean).join(" "),
|
|
1586
|
+
width: "16",
|
|
1587
|
+
height: "16",
|
|
1588
|
+
viewBox: "0 0 16 16",
|
|
1592
1589
|
"aria-hidden": "true",
|
|
1593
|
-
|
|
1590
|
+
className: [
|
|
1591
|
+
"rh-shrink-0 rh-transition-colors rh-duration-150",
|
|
1592
|
+
isSelected ? "rh-text-primary rh-fill-surface" : "rh-text-border rh-fill-surface"
|
|
1593
|
+
].join(" "),
|
|
1594
|
+
children: [
|
|
1595
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1" }),
|
|
1596
|
+
isSelected && /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "5", className: "rh-fill-primary", stroke: "none" })
|
|
1597
|
+
]
|
|
1594
1598
|
}
|
|
1595
1599
|
);
|
|
1596
1600
|
var Select = forwardRef(function Select2(props, ref) {
|
|
@@ -4567,7 +4571,8 @@ var CustomSelect = ({
|
|
|
4567
4571
|
textColor,
|
|
4568
4572
|
placeholderColor,
|
|
4569
4573
|
backgroundColor,
|
|
4570
|
-
type = "select"
|
|
4574
|
+
type = "select",
|
|
4575
|
+
disabled = false
|
|
4571
4576
|
}) => {
|
|
4572
4577
|
const [isOpen, setIsOpen] = useState(false);
|
|
4573
4578
|
const [dropdownStyle, setDropdownStyle] = useState({});
|
|
@@ -4601,6 +4606,7 @@ var CustomSelect = ({
|
|
|
4601
4606
|
};
|
|
4602
4607
|
};
|
|
4603
4608
|
const openDropdown = () => {
|
|
4609
|
+
if (disabled) return;
|
|
4604
4610
|
if (!isOpen) setDropdownStyle(calcPosition());
|
|
4605
4611
|
setIsOpen((prev) => !prev);
|
|
4606
4612
|
};
|
|
@@ -4649,6 +4655,7 @@ var CustomSelect = ({
|
|
|
4649
4655
|
{
|
|
4650
4656
|
ref: textAreaRef,
|
|
4651
4657
|
value,
|
|
4658
|
+
disabled,
|
|
4652
4659
|
placeholder,
|
|
4653
4660
|
rows: 1,
|
|
4654
4661
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -4660,7 +4667,7 @@ var CustomSelect = ({
|
|
|
4660
4667
|
color: inputTextColor,
|
|
4661
4668
|
backgroundColor: backgroundColor || "transparent"
|
|
4662
4669
|
},
|
|
4663
|
-
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"
|
|
4670
|
+
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 disabled:rh-opacity-60 disabled:rh-cursor-not-allowed disabled:hover:rh-border-transparent disabled:hover:rh-ring-0"
|
|
4664
4671
|
}
|
|
4665
4672
|
),
|
|
4666
4673
|
/* @__PURE__ */ jsx("style", { children: `.rh-table-textarea::placeholder { color: ${inputPlaceholderColor}; }` })
|
|
@@ -4671,12 +4678,13 @@ var CustomSelect = ({
|
|
|
4671
4678
|
"button",
|
|
4672
4679
|
{
|
|
4673
4680
|
type: "button",
|
|
4681
|
+
disabled,
|
|
4674
4682
|
onClick: (e) => {
|
|
4675
4683
|
e.stopPropagation();
|
|
4676
4684
|
openDropdown();
|
|
4677
4685
|
},
|
|
4678
4686
|
style: { backgroundColor: backgroundColor || void 0 },
|
|
4679
|
-
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",
|
|
4687
|
+
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 disabled:rh-cursor-not-allowed disabled:rh-opacity-60 disabled:hover:rh-border-transparent disabled:hover:rh-ring-0",
|
|
4680
4688
|
children: /* @__PURE__ */ jsx("div", { className: "rh-flex rh-items-center rh-gap-2 rh-flex-1 rh-px-0.5", children: /* @__PURE__ */ jsx(
|
|
4681
4689
|
"span",
|
|
4682
4690
|
{
|
|
@@ -4762,6 +4770,8 @@ function TableInner({
|
|
|
4762
4770
|
rowKey,
|
|
4763
4771
|
rowClickable = false,
|
|
4764
4772
|
onRowClick,
|
|
4773
|
+
disableEditableControls = false,
|
|
4774
|
+
disableEditableSelects = false,
|
|
4765
4775
|
size = "md",
|
|
4766
4776
|
variant = "default",
|
|
4767
4777
|
sort,
|
|
@@ -4781,6 +4791,7 @@ function TableInner({
|
|
|
4781
4791
|
className = "",
|
|
4782
4792
|
...rest
|
|
4783
4793
|
}, ref) {
|
|
4794
|
+
const shouldDisableEditableControls = disableEditableControls || disableEditableSelects;
|
|
4784
4795
|
const handleSort = (column) => {
|
|
4785
4796
|
if (!column.sortable || !onSortChange) return;
|
|
4786
4797
|
const newDirection = sort?.key === column.key ? sort.direction === "asc" ? "desc" : sort.direction === "desc" ? null : "asc" : "asc";
|
|
@@ -4873,7 +4884,7 @@ function TableInner({
|
|
|
4873
4884
|
}
|
|
4874
4885
|
return column.editablePlaceholderColor;
|
|
4875
4886
|
};
|
|
4876
|
-
return /* @__PURE__ */ jsx("div", { className: "rh-w-full rh-rounded
|
|
4887
|
+
return /* @__PURE__ */ jsx("div", { className: "rh-w-full rh-rounded", children: /* @__PURE__ */ jsxs(
|
|
4877
4888
|
"table",
|
|
4878
4889
|
{
|
|
4879
4890
|
ref,
|
|
@@ -4991,6 +5002,7 @@ function TableInner({
|
|
|
4991
5002
|
CustomSelect,
|
|
4992
5003
|
{
|
|
4993
5004
|
type: column.type ?? "select",
|
|
5005
|
+
disabled: shouldDisableEditableControls,
|
|
4994
5006
|
options: column.choices,
|
|
4995
5007
|
value: column.editableValue(row),
|
|
4996
5008
|
placeholder: column.editablePlaceholder,
|