@solidpb/ui-kit 0.6.0 → 0.6.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.
@@ -57,7 +57,7 @@ interface FilterBarProps<T> {
57
57
  size?: "xs" | "sm" | "md" | "lg" | "xl";
58
58
  class?: string;
59
59
  savedFilters?: SavedFilterPreset<T>[];
60
- onSavePreset?: (name: string, items: (Filter<T> | FilterGroup<T> | AdvancedFilter)[]) => void;
60
+ onSavePreset?: (name: string, items: (Filter<T> | FilterGroup<T> | AdvancedFilter)[]) => Promise<void>;
61
61
  }
62
62
  export declare const FilterBar: <T>(props: FilterBarProps<T>) => import("solid-js").JSX.Element;
63
63
  export {};
@@ -222,10 +222,15 @@ export const FilterBar = (props) => {
222
222
  <Modal.Modal>
223
223
  <div class="flex flex-col gap-3">
224
224
  <Input value={filterPresetName()} onChange={setFilterPresetName} label="Name" inputProps={{ placeholder: "Name" }}/>
225
- <Button appearance="success" onClick={() => {
226
- if (filterPresetName()) {
227
- props.onSavePreset?.(filterPresetName(), props.items ?? []);
228
- setSaveFilterPresetOpen(false);
225
+ <Button appearance="success" onClick={async () => {
226
+ try {
227
+ if (filterPresetName()) {
228
+ await props.onSavePreset?.(filterPresetName(), props.items ?? []);
229
+ setSaveFilterPresetOpen(false);
230
+ }
231
+ }
232
+ catch (err) {
233
+ console.error("Error saving filter preset:", err);
229
234
  }
230
235
  }}>
231
236
  Save
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidpb/ui-kit",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",