braid-ui 1.0.24 → 1.0.25
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.cjs +42 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3213,6 +3213,29 @@ var BusinessFiltersSheet = ({
|
|
|
3213
3213
|
onFilterChange,
|
|
3214
3214
|
onResetFilters
|
|
3215
3215
|
}) => {
|
|
3216
|
+
const [localFilters, setLocalFilters] = React15.useState(filters);
|
|
3217
|
+
React15.useEffect(() => {
|
|
3218
|
+
setLocalFilters(filters);
|
|
3219
|
+
}, [filters]);
|
|
3220
|
+
const handleLocalFilterChange = (field, value) => {
|
|
3221
|
+
setLocalFilters((prev) => ({ ...prev, [field]: value }));
|
|
3222
|
+
};
|
|
3223
|
+
const handleApplyFilters = () => {
|
|
3224
|
+
Object.entries(localFilters).forEach(([key, value]) => {
|
|
3225
|
+
onFilterChange(key, value);
|
|
3226
|
+
});
|
|
3227
|
+
};
|
|
3228
|
+
const handleResetFilters = () => {
|
|
3229
|
+
const resetFilters = {
|
|
3230
|
+
name: "",
|
|
3231
|
+
productName: "",
|
|
3232
|
+
status: "",
|
|
3233
|
+
createdDateStart: void 0,
|
|
3234
|
+
createdDateEnd: void 0
|
|
3235
|
+
};
|
|
3236
|
+
setLocalFilters(resetFilters);
|
|
3237
|
+
onResetFilters();
|
|
3238
|
+
};
|
|
3216
3239
|
return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
3217
3240
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
|
|
3218
3241
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
|
|
@@ -3225,8 +3248,8 @@ var BusinessFiltersSheet = ({
|
|
|
3225
3248
|
EnhancedInput,
|
|
3226
3249
|
{
|
|
3227
3250
|
label: "Name",
|
|
3228
|
-
value:
|
|
3229
|
-
onChange: (e) =>
|
|
3251
|
+
value: localFilters.name,
|
|
3252
|
+
onChange: (e) => handleLocalFilterChange("name", e.target.value),
|
|
3230
3253
|
placeholder: "Enter business name"
|
|
3231
3254
|
}
|
|
3232
3255
|
),
|
|
@@ -3234,8 +3257,8 @@ var BusinessFiltersSheet = ({
|
|
|
3234
3257
|
EnhancedInput,
|
|
3235
3258
|
{
|
|
3236
3259
|
label: "Product Name",
|
|
3237
|
-
value:
|
|
3238
|
-
onChange: (e) =>
|
|
3260
|
+
value: localFilters.productName,
|
|
3261
|
+
onChange: (e) => handleLocalFilterChange("productName", e.target.value),
|
|
3239
3262
|
placeholder: "Enter product name"
|
|
3240
3263
|
}
|
|
3241
3264
|
),
|
|
@@ -3243,13 +3266,17 @@ var BusinessFiltersSheet = ({
|
|
|
3243
3266
|
EnhancedSelect,
|
|
3244
3267
|
{
|
|
3245
3268
|
label: "Status",
|
|
3246
|
-
value:
|
|
3247
|
-
onValueChange: (value) =>
|
|
3269
|
+
value: localFilters.status,
|
|
3270
|
+
onValueChange: (value) => handleLocalFilterChange("status", value),
|
|
3248
3271
|
placeholder: "Select status",
|
|
3249
3272
|
options: [
|
|
3250
|
-
{ value: "
|
|
3251
|
-
{ value: "
|
|
3252
|
-
{ value: "
|
|
3273
|
+
{ value: "ACTIVE", label: "Active" },
|
|
3274
|
+
{ value: "INACTIVE", label: "Inactive" },
|
|
3275
|
+
{ value: "BLOCKED", label: "Blocked" },
|
|
3276
|
+
{ value: "PENDING_APPROVAL", label: "Pending Approval" },
|
|
3277
|
+
{ value: "PENDING", label: "Pending" },
|
|
3278
|
+
{ value: "INITIALIZED", label: "Initialized" },
|
|
3279
|
+
{ value: "PENDING_UNBLOCKED", label: "Pending Unblocked" }
|
|
3253
3280
|
]
|
|
3254
3281
|
}
|
|
3255
3282
|
),
|
|
@@ -3259,8 +3286,8 @@ var BusinessFiltersSheet = ({
|
|
|
3259
3286
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3260
3287
|
DatePicker,
|
|
3261
3288
|
{
|
|
3262
|
-
date:
|
|
3263
|
-
onDateChange: (date) =>
|
|
3289
|
+
date: localFilters.createdDateStart,
|
|
3290
|
+
onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
|
|
3264
3291
|
placeholder: "MM/DD/YYYY",
|
|
3265
3292
|
buttonClassName: "w-full",
|
|
3266
3293
|
className: "bg-background z-50"
|
|
@@ -3272,8 +3299,8 @@ var BusinessFiltersSheet = ({
|
|
|
3272
3299
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3273
3300
|
DatePicker,
|
|
3274
3301
|
{
|
|
3275
|
-
date:
|
|
3276
|
-
onDateChange: (date) =>
|
|
3302
|
+
date: localFilters.createdDateEnd,
|
|
3303
|
+
onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
|
|
3277
3304
|
placeholder: "MM/DD/YYYY",
|
|
3278
3305
|
buttonClassName: "w-full",
|
|
3279
3306
|
className: "bg-background z-50"
|
|
@@ -3283,9 +3310,8 @@ var BusinessFiltersSheet = ({
|
|
|
3283
3310
|
] })
|
|
3284
3311
|
] }),
|
|
3285
3312
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
|
|
3286
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick:
|
|
3287
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick:
|
|
3288
|
-
}, children: "Apply Filters" })
|
|
3313
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleResetFilters, children: "Reset Filters" }),
|
|
3314
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleApplyFilters, children: "Apply Filters" })
|
|
3289
3315
|
] })
|
|
3290
3316
|
] })
|
|
3291
3317
|
] });
|