@star-insure/sdk 4.2.0 → 4.3.1
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 +41 -5
- 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 +41 -5
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/misc/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/filter/FilterItem.tsx +22 -0
- package/src/components/filter/PageHeader.tsx +22 -1
- package/src/types/misc/index.ts +1 -1
package/dist/sdk.esm.js
CHANGED
|
@@ -2615,7 +2615,7 @@ function Dropdown(_ref) {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
|
|
2617
2617
|
function FilterItem(_ref) {
|
|
2618
|
-
var _filter$options, _filter$options2, _filter$options3, _selected$, _selected$2;
|
|
2618
|
+
var _filter$options, _filter$options2, _filter$options3, _selected$, _selected$2, _selected$3;
|
|
2619
2619
|
|
|
2620
2620
|
var filter = _ref.filter;
|
|
2621
2621
|
|
|
@@ -2753,6 +2753,16 @@ function FilterItem(_ref) {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
}
|
|
2755
2755
|
|
|
2756
|
+
function handleText(e) {
|
|
2757
|
+
var value = e.currentTarget.value;
|
|
2758
|
+
|
|
2759
|
+
if (value) {
|
|
2760
|
+
setSelected([value]);
|
|
2761
|
+
} else {
|
|
2762
|
+
setSelected([]);
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2756
2766
|
function handleApply(e) {
|
|
2757
2767
|
e.preventDefault();
|
|
2758
2768
|
var search = new URLSearchParams(window.location.search); // Reset the page in the query
|
|
@@ -2925,6 +2935,15 @@ function FilterItem(_ref) {
|
|
|
2925
2935
|
})
|
|
2926
2936
|
});
|
|
2927
2937
|
}
|
|
2938
|
+
})), filter.type === 'text' && React__default.createElement("div", {
|
|
2939
|
+
className: 'w-full'
|
|
2940
|
+
}, React__default.createElement("input", {
|
|
2941
|
+
type: "text",
|
|
2942
|
+
name: filter.name,
|
|
2943
|
+
placeholder: filter.label,
|
|
2944
|
+
value: (_selected$3 = selected[0]) != null ? _selected$3 : '',
|
|
2945
|
+
onChange: handleText,
|
|
2946
|
+
className: "!p-2 text-sm w-full"
|
|
2928
2947
|
}))), React__default.createElement("div", {
|
|
2929
2948
|
className: "bg-gray-100 border-t border-gray-200 flex items-center gap-2 p-4 bottom-0 sticky"
|
|
2930
2949
|
}, React__default.createElement(Button, {
|
|
@@ -2954,7 +2973,8 @@ function PageHeader(_ref) {
|
|
|
2954
2973
|
_ref$filterOptions = _ref.filterOptions,
|
|
2955
2974
|
filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions,
|
|
2956
2975
|
_ref$focusSearchShort = _ref.focusSearchShortcut,
|
|
2957
|
-
focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort
|
|
2976
|
+
focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort,
|
|
2977
|
+
children = _ref.children;
|
|
2958
2978
|
|
|
2959
2979
|
var _React$useState = React__default.useState(false),
|
|
2960
2980
|
isSearchActive = _React$useState[0],
|
|
@@ -2966,6 +2986,15 @@ function PageHeader(_ref) {
|
|
|
2966
2986
|
overScroll = _React$useState2[0],
|
|
2967
2987
|
setOverScroll = _React$useState2[1];
|
|
2968
2988
|
|
|
2989
|
+
var actionChildren = []; // Categorize children based on their type
|
|
2990
|
+
|
|
2991
|
+
React__default.Children.forEach(children, function (child) {
|
|
2992
|
+
if (React__default.isValidElement(child)) {
|
|
2993
|
+
if (child.type === PageHeader.Action) {
|
|
2994
|
+
actionChildren.push(child);
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
});
|
|
2969
2998
|
React__default.useEffect(function () {
|
|
2970
2999
|
var current = scrollContainerRef.current;
|
|
2971
3000
|
if (!current) return;
|
|
@@ -3085,7 +3114,7 @@ function PageHeader(_ref) {
|
|
|
3085
3114
|
back: back,
|
|
3086
3115
|
className: "bg-gray-100 h-[60px] w-[60px] rounded"
|
|
3087
3116
|
}), React__default.createElement("div", {
|
|
3088
|
-
className: cn('w-full grid grid-cols-[
|
|
3117
|
+
className: cn('w-full grid grid-cols-[auto_1fr_auto_auto] h-[60px] rounded bg-gray-100 p-3 gap-4', innerClassName)
|
|
3089
3118
|
}, React__default.createElement("button", {
|
|
3090
3119
|
type: "button",
|
|
3091
3120
|
disabled: !search,
|
|
@@ -3134,8 +3163,15 @@ function PageHeader(_ref) {
|
|
|
3134
3163
|
return React__default.createElement(Action, Object.assign({
|
|
3135
3164
|
key: action.title + "-" + action.as + "-" + action.href
|
|
3136
3165
|
}, action));
|
|
3137
|
-
})))
|
|
3138
|
-
|
|
3166
|
+
}))), actionChildren && React__default.createElement("div", {
|
|
3167
|
+
className: "flex items-center gap-3 bg-gray-100"
|
|
3168
|
+
}, actionChildren)));
|
|
3169
|
+
} // Subcomponents
|
|
3170
|
+
|
|
3171
|
+
PageHeader.Action = function (_ref2) {
|
|
3172
|
+
var children = _ref2.children;
|
|
3173
|
+
return React__default.createElement("div", null, children);
|
|
3174
|
+
};
|
|
3139
3175
|
|
|
3140
3176
|
export { Button, Card, DateOfBirthField, ErrorList, FormTester, Modal, MoneyField, PageHeader, Pagination, QuoteRequestFormContext, QuoteRequestFormProvider, QuoteRequestOptionsProvider, RegistrationSearchField, SimplePagination, Table, TableActions, TableBody, TableCell, TableHead, TableHeader, TableRow, ToastItem, ToastProvider, Toasts, addGst, autocomplete, calcMonthlyEnhancementPrice, calcPurchaseOptionPricing, calculateAge, fixRoundingError, formatDate, formatDateForTable, formatDateNice, formatDateTime, formatMoney, formatNumber, getAddressData, getGst, gstCalc, initialData, round, sanitiseQuoteRequestFormData, sanitiseVehicleType, subtractGst, useAuth, useClickOutside, useInertiaOptions, useLocalStorage, useQuoteRequestForm, useQuoteRequestOptions, useToast };
|
|
3141
3177
|
//# sourceMappingURL=sdk.esm.js.map
|