hazo_ui 2.2.1 → 2.2.2
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/README.md +24 -0
- package/dist/index.cjs +11 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -151,6 +151,8 @@ function DataTable() {
|
|
|
151
151
|
availableFields={availableFields}
|
|
152
152
|
onFilterChange={handleFilterChange}
|
|
153
153
|
initialFilters={filters}
|
|
154
|
+
title="Filter Products" // Optional: customize dialog title (default: "Filter")
|
|
155
|
+
description="Filter by product attributes" // Optional: customize description
|
|
154
156
|
/>
|
|
155
157
|
{/* Your table/grid component */}
|
|
156
158
|
</div>
|
|
@@ -158,6 +160,16 @@ function DataTable() {
|
|
|
158
160
|
}
|
|
159
161
|
```
|
|
160
162
|
|
|
163
|
+
#### Props
|
|
164
|
+
|
|
165
|
+
| Prop | Type | Required | Default | Description |
|
|
166
|
+
|------|------|----------|---------|-------------|
|
|
167
|
+
| `availableFields` | `FilterField[]` | Yes | - | Array of field definitions for filtering |
|
|
168
|
+
| `onFilterChange` | `(filters: FilterConfig[]) => void` | Yes | - | Callback when filters are applied |
|
|
169
|
+
| `initialFilters` | `FilterConfig[]` | No | `[]` | Initial filter configuration |
|
|
170
|
+
| `title` | `string` | No | `"Filter"` | Dialog title text |
|
|
171
|
+
| `description` | `string` | No | `"Add multiple fields to filter by..."` | Dialog description text |
|
|
172
|
+
|
|
161
173
|
#### Example Input
|
|
162
174
|
|
|
163
175
|
```tsx
|
|
@@ -325,6 +337,8 @@ function DataTable() {
|
|
|
325
337
|
availableFields={availableFields}
|
|
326
338
|
onSortChange={handleSortChange}
|
|
327
339
|
initialSortFields={sorts}
|
|
340
|
+
title="Sort Products" // Optional: customize dialog title (default: "Sort")
|
|
341
|
+
description="Drag to reorder sort priority" // Optional: customize description
|
|
328
342
|
/>
|
|
329
343
|
{/* Your table/grid component */}
|
|
330
344
|
</div>
|
|
@@ -332,6 +346,16 @@ function DataTable() {
|
|
|
332
346
|
}
|
|
333
347
|
```
|
|
334
348
|
|
|
349
|
+
#### Props
|
|
350
|
+
|
|
351
|
+
| Prop | Type | Required | Default | Description |
|
|
352
|
+
|------|------|----------|---------|-------------|
|
|
353
|
+
| `availableFields` | `SortField[]` | Yes | - | Array of field definitions for sorting |
|
|
354
|
+
| `onSortChange` | `(sorts: SortConfig[]) => void` | Yes | - | Callback when sorts are applied |
|
|
355
|
+
| `initialSortFields` | `SortConfig[]` | No | `[]` | Initial sort configuration |
|
|
356
|
+
| `title` | `string` | No | `"Sort"` | Dialog title text |
|
|
357
|
+
| `description` | `string` | No | `"Add multiple fields to sort by..."` | Dialog description text |
|
|
358
|
+
|
|
335
359
|
#### Example Input
|
|
336
360
|
|
|
337
361
|
```tsx
|
package/dist/index.cjs
CHANGED
|
@@ -263,7 +263,7 @@ var CommandItem = React6__namespace.forwardRef(({ className, onSelect, value, ..
|
|
|
263
263
|
{
|
|
264
264
|
ref,
|
|
265
265
|
className: cn(
|
|
266
|
-
"relative flex cursor-
|
|
266
|
+
"relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
267
267
|
className
|
|
268
268
|
),
|
|
269
269
|
onClick: handleClick,
|
|
@@ -665,7 +665,9 @@ function FilterFieldItem({
|
|
|
665
665
|
function HazoUiMultiFilterDialog({
|
|
666
666
|
availableFields,
|
|
667
667
|
onFilterChange,
|
|
668
|
-
initialFilters = []
|
|
668
|
+
initialFilters = [],
|
|
669
|
+
title = "Filter",
|
|
670
|
+
description = "Add multiple fields to filter by. Select a field and set its filter value."
|
|
669
671
|
}) {
|
|
670
672
|
const [isOpen, setIsOpen] = React6.useState(false);
|
|
671
673
|
const [filterFields, setFilterFields] = React6.useState(initialFilters);
|
|
@@ -787,8 +789,8 @@ function HazoUiMultiFilterDialog({
|
|
|
787
789
|
] }) }),
|
|
788
790
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "cls_filter_dialog_content max-w-lg w-full max-h-[90vh] overflow-y-auto", children: [
|
|
789
791
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
790
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children:
|
|
791
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children:
|
|
792
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: title }),
|
|
793
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: description })
|
|
792
794
|
] }),
|
|
793
795
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_filter_dialog_body space-y-4 py-4", children: [
|
|
794
796
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_add_field_section", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isComboboxOpen, onOpenChange: setIsComboboxOpen, children: [
|
|
@@ -985,7 +987,9 @@ function SortableSortFieldItem({
|
|
|
985
987
|
function HazoUiMultiSortDialog({
|
|
986
988
|
availableFields,
|
|
987
989
|
onSortChange,
|
|
988
|
-
initialSortFields = []
|
|
990
|
+
initialSortFields = [],
|
|
991
|
+
title = "Sort",
|
|
992
|
+
description = "Add multiple fields to sort by and reorder them. Use the switch to toggle between ascending and descending."
|
|
989
993
|
}) {
|
|
990
994
|
const [isOpen, setIsOpen] = React6.useState(false);
|
|
991
995
|
const [sortFields, setSortFields] = React6.useState(initialSortFields);
|
|
@@ -1089,8 +1093,8 @@ function HazoUiMultiSortDialog({
|
|
|
1089
1093
|
] }) }),
|
|
1090
1094
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "cls_sort_dialog_content max-w-lg", children: [
|
|
1091
1095
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
1092
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children:
|
|
1093
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children:
|
|
1096
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: title }),
|
|
1097
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: description })
|
|
1094
1098
|
] }),
|
|
1095
1099
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_sort_dialog_body space-y-4 py-4", children: [
|
|
1096
1100
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_add_field_section", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isComboboxOpen, onOpenChange: setIsComboboxOpen, children: [
|