@underverse-ui/underverse 1.0.117 → 1.0.119
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/api-reference.json +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -2
- package/dist/index.d.ts +42 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -899,8 +899,8 @@ declare const DatePicker: React$1.FC<DatePickerProps>;
|
|
|
899
899
|
interface DateRangePickerProps {
|
|
900
900
|
id?: string;
|
|
901
901
|
startDate?: Date;
|
|
902
|
-
endDate?: Date;
|
|
903
|
-
onChange: (start: Date | undefined, end: Date | undefined) => void;
|
|
902
|
+
endDate?: Date | null;
|
|
903
|
+
onChange: (start: Date | undefined, end: Date | null | undefined) => void;
|
|
904
904
|
placeholder?: string;
|
|
905
905
|
className?: string;
|
|
906
906
|
label?: string;
|
|
@@ -1890,6 +1890,46 @@ interface CategoryTreeSelectBaseProps {
|
|
|
1890
1890
|
minSearchLength?: number;
|
|
1891
1891
|
/** Show a prompt instead of options while the query is shorter than `minSearchLength`. Default: `false`. */
|
|
1892
1892
|
showSearchPromptWhenEmptyQuery?: boolean;
|
|
1893
|
+
/**
|
|
1894
|
+
* Render custom actions at the trailing edge of each tree row.
|
|
1895
|
+
*
|
|
1896
|
+
* @remarks
|
|
1897
|
+
* The returned node is placed inside the row flex container, after the label/content area.
|
|
1898
|
+
* Click events on the returned node are stopped from propagating to the row, so action buttons
|
|
1899
|
+
* do not accidentally trigger selection or expansion.
|
|
1900
|
+
*
|
|
1901
|
+
* @example
|
|
1902
|
+
* <CategoryTreeSelect
|
|
1903
|
+
* renderItemActions={(category) => (
|
|
1904
|
+
* <button onClick={() => handleEdit(category)}>Edit</button>
|
|
1905
|
+
* )}
|
|
1906
|
+
* />
|
|
1907
|
+
*/
|
|
1908
|
+
renderItemActions?: (category: Category) => React__default.ReactNode;
|
|
1909
|
+
/**
|
|
1910
|
+
* Base left padding in rem applied to every node regardless of depth. Default: `0.75`.
|
|
1911
|
+
*
|
|
1912
|
+
* @remarks
|
|
1913
|
+
* Combined with `indentSize`, the final padding of a node at a given depth is:
|
|
1914
|
+
* `paddingLeft = level * indentSize + baseIndent` rem.
|
|
1915
|
+
*
|
|
1916
|
+
* @example
|
|
1917
|
+
* // Compact sidebar tree
|
|
1918
|
+
* <CategoryTreeSelect baseIndent={0.25} indentSize={0.75} />
|
|
1919
|
+
*/
|
|
1920
|
+
baseIndent?: number;
|
|
1921
|
+
/**
|
|
1922
|
+
* Additional left padding in rem added per depth level. Default: `1`.
|
|
1923
|
+
*
|
|
1924
|
+
* @remarks
|
|
1925
|
+
* Set to a smaller value (e.g. `0.75`) to reduce the visual gap between
|
|
1926
|
+
* parent and child nodes without touching DOM styles.
|
|
1927
|
+
*
|
|
1928
|
+
* @example
|
|
1929
|
+
* // Compact sidebar tree
|
|
1930
|
+
* <CategoryTreeSelect baseIndent={0.25} indentSize={0.75} />
|
|
1931
|
+
*/
|
|
1932
|
+
indentSize?: number;
|
|
1893
1933
|
}
|
|
1894
1934
|
/** Multi-select mode. This is the default when `singleSelect` is omitted. */
|
|
1895
1935
|
interface CategoryTreeSelectMultiProps extends CategoryTreeSelectBaseProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -899,8 +899,8 @@ declare const DatePicker: React$1.FC<DatePickerProps>;
|
|
|
899
899
|
interface DateRangePickerProps {
|
|
900
900
|
id?: string;
|
|
901
901
|
startDate?: Date;
|
|
902
|
-
endDate?: Date;
|
|
903
|
-
onChange: (start: Date | undefined, end: Date | undefined) => void;
|
|
902
|
+
endDate?: Date | null;
|
|
903
|
+
onChange: (start: Date | undefined, end: Date | null | undefined) => void;
|
|
904
904
|
placeholder?: string;
|
|
905
905
|
className?: string;
|
|
906
906
|
label?: string;
|
|
@@ -1890,6 +1890,46 @@ interface CategoryTreeSelectBaseProps {
|
|
|
1890
1890
|
minSearchLength?: number;
|
|
1891
1891
|
/** Show a prompt instead of options while the query is shorter than `minSearchLength`. Default: `false`. */
|
|
1892
1892
|
showSearchPromptWhenEmptyQuery?: boolean;
|
|
1893
|
+
/**
|
|
1894
|
+
* Render custom actions at the trailing edge of each tree row.
|
|
1895
|
+
*
|
|
1896
|
+
* @remarks
|
|
1897
|
+
* The returned node is placed inside the row flex container, after the label/content area.
|
|
1898
|
+
* Click events on the returned node are stopped from propagating to the row, so action buttons
|
|
1899
|
+
* do not accidentally trigger selection or expansion.
|
|
1900
|
+
*
|
|
1901
|
+
* @example
|
|
1902
|
+
* <CategoryTreeSelect
|
|
1903
|
+
* renderItemActions={(category) => (
|
|
1904
|
+
* <button onClick={() => handleEdit(category)}>Edit</button>
|
|
1905
|
+
* )}
|
|
1906
|
+
* />
|
|
1907
|
+
*/
|
|
1908
|
+
renderItemActions?: (category: Category) => React__default.ReactNode;
|
|
1909
|
+
/**
|
|
1910
|
+
* Base left padding in rem applied to every node regardless of depth. Default: `0.75`.
|
|
1911
|
+
*
|
|
1912
|
+
* @remarks
|
|
1913
|
+
* Combined with `indentSize`, the final padding of a node at a given depth is:
|
|
1914
|
+
* `paddingLeft = level * indentSize + baseIndent` rem.
|
|
1915
|
+
*
|
|
1916
|
+
* @example
|
|
1917
|
+
* // Compact sidebar tree
|
|
1918
|
+
* <CategoryTreeSelect baseIndent={0.25} indentSize={0.75} />
|
|
1919
|
+
*/
|
|
1920
|
+
baseIndent?: number;
|
|
1921
|
+
/**
|
|
1922
|
+
* Additional left padding in rem added per depth level. Default: `1`.
|
|
1923
|
+
*
|
|
1924
|
+
* @remarks
|
|
1925
|
+
* Set to a smaller value (e.g. `0.75`) to reduce the visual gap between
|
|
1926
|
+
* parent and child nodes without touching DOM styles.
|
|
1927
|
+
*
|
|
1928
|
+
* @example
|
|
1929
|
+
* // Compact sidebar tree
|
|
1930
|
+
* <CategoryTreeSelect baseIndent={0.25} indentSize={0.75} />
|
|
1931
|
+
*/
|
|
1932
|
+
indentSize?: number;
|
|
1893
1933
|
}
|
|
1894
1934
|
/** Multi-select mode. This is the default when `singleSelect` is omitted. */
|
|
1895
1935
|
interface CategoryTreeSelectMultiProps extends CategoryTreeSelectBaseProps {
|
package/dist/index.js
CHANGED
|
@@ -9149,9 +9149,11 @@ var DateRangePicker = ({
|
|
|
9149
9149
|
setTempStart(localDate);
|
|
9150
9150
|
setTempEnd(null);
|
|
9151
9151
|
setHoveredDate(null);
|
|
9152
|
+
onChange(localDate, null);
|
|
9152
9153
|
} else if (tempStart && !tempEnd) {
|
|
9153
9154
|
if (localDate < tempStart) {
|
|
9154
9155
|
setTempStart(localDate);
|
|
9156
|
+
onChange(localDate, null);
|
|
9155
9157
|
} else {
|
|
9156
9158
|
setTempEnd(localDate);
|
|
9157
9159
|
setLocalRequiredError(void 0);
|
|
@@ -17464,6 +17466,9 @@ function CategoryTreeSelect(props) {
|
|
|
17464
17466
|
searchDebounceMs = 0,
|
|
17465
17467
|
minSearchLength = 0,
|
|
17466
17468
|
showSearchPromptWhenEmptyQuery = false,
|
|
17469
|
+
baseIndent = TREE_NODE_BASE_PADDING_REM,
|
|
17470
|
+
indentSize = TREE_NODE_INDENT_REM,
|
|
17471
|
+
renderItemActions,
|
|
17467
17472
|
singleSelect = false
|
|
17468
17473
|
} = props;
|
|
17469
17474
|
const [isOpen, setIsOpen] = useState31(false);
|
|
@@ -17767,7 +17772,7 @@ function CategoryTreeSelect(props) {
|
|
|
17767
17772
|
// Selected state - đồng bộ cho tất cả
|
|
17768
17773
|
!viewOnly && isSelected && "bg-accent/40"
|
|
17769
17774
|
),
|
|
17770
|
-
style: { paddingLeft: `${level *
|
|
17775
|
+
style: { paddingLeft: `${level * indentSize + baseIndent}rem` },
|
|
17771
17776
|
children: [
|
|
17772
17777
|
hasChildren ? /* @__PURE__ */ jsx50(
|
|
17773
17778
|
"button",
|
|
@@ -17812,7 +17817,8 @@ function CategoryTreeSelect(props) {
|
|
|
17812
17817
|
),
|
|
17813
17818
|
hasChildren && !isSelected && /* @__PURE__ */ jsx50("span", { className: "ml-auto shrink-0 text-[10px] font-medium text-muted-foreground/50 bg-muted/50 px-1.5 py-0.5 rounded-md", children: children.length })
|
|
17814
17819
|
] })
|
|
17815
|
-
)
|
|
17820
|
+
),
|
|
17821
|
+
renderItemActions && /* @__PURE__ */ jsx50("div", { className: "shrink-0 ml-auto", onClick: (e) => e.stopPropagation(), children: renderItemActions(category) })
|
|
17816
17822
|
]
|
|
17817
17823
|
}
|
|
17818
17824
|
),
|