@star-insure/sdk 4.2.0 → 4.3.0
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/components/filter/PageHeader.d.ts +9 -3
- package/dist/sdk.cjs.development.js +21 -4
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +21 -4
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/filter/PageHeader.tsx +22 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { FilterOption, TPageHeaderAction } from '../../types';
|
|
3
3
|
interface Props {
|
|
4
4
|
title: string;
|
|
@@ -10,6 +10,12 @@ interface Props {
|
|
|
10
10
|
backText?: string;
|
|
11
11
|
filterOptions?: FilterOption[];
|
|
12
12
|
focusSearchShortcut?: boolean;
|
|
13
|
+
children?: React.ReactNode;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
declare function PageHeader({ title, search, className, innerClassName, back, actions, filterOptions, focusSearchShortcut, children }: Props): JSX.Element;
|
|
16
|
+
declare namespace PageHeader {
|
|
17
|
+
var Action: ({ children }: {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export default PageHeader;
|
|
@@ -2961,7 +2961,8 @@ function PageHeader(_ref) {
|
|
|
2961
2961
|
_ref$filterOptions = _ref.filterOptions,
|
|
2962
2962
|
filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions,
|
|
2963
2963
|
_ref$focusSearchShort = _ref.focusSearchShortcut,
|
|
2964
|
-
focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort
|
|
2964
|
+
focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort,
|
|
2965
|
+
children = _ref.children;
|
|
2965
2966
|
|
|
2966
2967
|
var _React$useState = React__default.useState(false),
|
|
2967
2968
|
isSearchActive = _React$useState[0],
|
|
@@ -2973,6 +2974,15 @@ function PageHeader(_ref) {
|
|
|
2973
2974
|
overScroll = _React$useState2[0],
|
|
2974
2975
|
setOverScroll = _React$useState2[1];
|
|
2975
2976
|
|
|
2977
|
+
var actionChildren = []; // Categorize children based on their type
|
|
2978
|
+
|
|
2979
|
+
React__default.Children.forEach(children, function (child) {
|
|
2980
|
+
if (React__default.isValidElement(child)) {
|
|
2981
|
+
if (child.type === PageHeader.Action) {
|
|
2982
|
+
actionChildren.push(child);
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
});
|
|
2976
2986
|
React__default.useEffect(function () {
|
|
2977
2987
|
var current = scrollContainerRef.current;
|
|
2978
2988
|
if (!current) return;
|
|
@@ -3092,7 +3102,7 @@ function PageHeader(_ref) {
|
|
|
3092
3102
|
back: back,
|
|
3093
3103
|
className: "bg-gray-100 h-[60px] w-[60px] rounded"
|
|
3094
3104
|
}), React__default.createElement("div", {
|
|
3095
|
-
className: cn('w-full grid grid-cols-[
|
|
3105
|
+
className: cn('w-full grid grid-cols-[auto_1fr_auto_auto] h-[60px] rounded bg-gray-100 p-3 gap-4', innerClassName)
|
|
3096
3106
|
}, React__default.createElement("button", {
|
|
3097
3107
|
type: "button",
|
|
3098
3108
|
disabled: !search,
|
|
@@ -3141,8 +3151,15 @@ function PageHeader(_ref) {
|
|
|
3141
3151
|
return React__default.createElement(Action, Object.assign({
|
|
3142
3152
|
key: action.title + "-" + action.as + "-" + action.href
|
|
3143
3153
|
}, action));
|
|
3144
|
-
})))
|
|
3145
|
-
|
|
3154
|
+
}))), actionChildren && React__default.createElement("div", {
|
|
3155
|
+
className: "flex items-center gap-3 bg-gray-100"
|
|
3156
|
+
}, actionChildren)));
|
|
3157
|
+
} // Subcomponents
|
|
3158
|
+
|
|
3159
|
+
PageHeader.Action = function (_ref2) {
|
|
3160
|
+
var children = _ref2.children;
|
|
3161
|
+
return React__default.createElement("div", null, children);
|
|
3162
|
+
};
|
|
3146
3163
|
|
|
3147
3164
|
exports.Button = Button;
|
|
3148
3165
|
exports.Card = Card;
|