@easyvision/easyvision-ui 1.9.2 → 1.9.3

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 CHANGED
@@ -693,7 +693,7 @@ Override per field with `toCondition: (value) => unknown` (return either a primi
693
693
  | `onPerform` | `(snap) => void` | — | Fires when perform commits — from Buscar, `performOnMount`, the imperative `perform()` ref, or (live mode) any value/field change after the debounce. Dispatched on a microtask so calling `setState` inside is safe. |
694
694
  | `onChange` | `(snap) => void` | — | Every change (per keystroke / option toggle). |
695
695
  | `onStateChange` | `(snap) => void` | — | Same as `onChange`; provided for API symmetry. |
696
- | `showClearAll` | `boolean` | `editable` | Clears values & active fields. |
696
+ | `showClearAll` | `boolean` | `editable` | Resets values & active fields to their initial state (`defaultValue`s and `pinned`/`initiallyActive` fields). |
697
697
  | `labels` | `Partial<MultifilterLabels>` | Spanish defaults | |
698
698
  | `className`, `persist`, `clearWhen` | as in Input/Selector | | |
699
699
 
package/dist/index.cjs CHANGED
@@ -1385,22 +1385,15 @@ var EasyVisionMultifilter = React9.forwardRef(function EasyVisionMultifilter2(pr
1385
1385
  );
1386
1386
  const [clearTick, setClearTick] = React9.useState(0);
1387
1387
  const clearAll = React9.useCallback(() => {
1388
- const seed = {};
1389
- if (config.searchField?.defaultValue !== void 0) {
1390
- seed[config.searchField.id] = config.searchField.defaultValue;
1391
- }
1392
1388
  patch({
1393
- values: seed,
1394
- activeFields: initialActive.filter((id2) => {
1395
- const def = config.fields.find((f) => f.id === id2);
1396
- return def?.pinned;
1397
- }).concat(config.searchField ? [config.searchField.id] : []),
1389
+ values: initialValues,
1390
+ activeFields: initialActive,
1398
1391
  lastConfirmedSnapshotJSON: null
1399
1392
  });
1400
1393
  if (lastConfirmedSnapshotJSON !== null && resolvedPerformMode !== "live") {
1401
1394
  setClearTick((n) => n + 1);
1402
1395
  }
1403
- }, [config, patch, initialActive, lastConfirmedSnapshotJSON, resolvedPerformMode]);
1396
+ }, [patch, initialValues, initialActive, lastConfirmedSnapshotJSON, resolvedPerformMode]);
1404
1397
  React9.useEffect(() => {
1405
1398
  if (clearTick > 0) performAction();
1406
1399
  }, [clearTick]);