@react-querybuilder/core 8.22.1 → 8.22.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.
@@ -5671,6 +5671,14 @@ interface QueryManagerOptions<F extends FullField = FullField, O extends FullOpe
5671
5671
  autoSelectOperator?: boolean;
5672
5672
  /** When `false`, an empty placeholder option is prepended to each value list. */
5673
5673
  autoSelectValue?: boolean;
5674
+ /**
5675
+ * Translations, accepting the same shape as the `translations` prop. Only the placeholder
5676
+ * properties of `fields`, `operators`, and `values` are used, and only when the corresponding
5677
+ * `autoSelect*` option is `false`; the remaining keys describe UI elements that have no
5678
+ * meaning outside the `QueryBuilder` component. Labels are typed as `unknown` so the React
5679
+ * `Translations` type, whose labels are `ReactNode`, can be passed as-is.
5680
+ */
5681
+ translations?: Partial<BaseTranslations<unknown>>;
5674
5682
  /** The default `field` for rules created by {@link QueryManager.createRule}. */
5675
5683
  getDefaultField?: string | ((fieldsData: FullOptionList<F>) => string);
5676
5684
  /** The default `operator` for a given field. */
@@ -5885,6 +5893,50 @@ declare class QueryManager<RG extends RuleGroupTypeAny = RuleGroupType, F extend
5885
5893
  * `targetPathOrID` and `sourcePathOrID`.
5886
5894
  */
5887
5895
  group(sourcePathOrID: Path | string, targetPathOrID: Path | string, options?: GroupOptions & StrictOptions): this;
5896
+ /**
5897
+ * The options currently in effect, as a frozen shallow copy. Reflects everything applied by
5898
+ * the constructor and any subsequent {@link QueryManager.reconfigure} calls, but not the
5899
+ * defaults filled in for options that were never provided.
5900
+ */
5901
+ getOptions(): Readonly<QueryManagerOptions<F, O, C>>;
5902
+ /**
5903
+ * Updates the manager's configuration in place, keeping the current query, the undo/redo
5904
+ * history, and every subscriber. Use this to propagate new `translations`, `fields`,
5905
+ * `operators`, and so on without discarding state:
5906
+ *
5907
+ * ```ts
5908
+ * q.reconfigure({ translations: { fields: { placeholderLabel: 'Choisir un champ' } } });
5909
+ * ```
5910
+ *
5911
+ * The incoming options are shallow-merged over the current ones, so keys left out are
5912
+ * preserved. Passing a key explicitly as `undefined` resets it to its default. Object-valued
5913
+ * options like `translations` are replaced wholesale rather than deep-merged — spread the
5914
+ * current value in yourself to patch one key. Pass `{ replace: true }` to discard the
5915
+ * existing options entirely and start from the incoming set.
5916
+ *
5917
+ * The query is never rewritten, even when the new options no longer describe it: a rule whose
5918
+ * `field` is not in the new `fields` list is left as-is. Call
5919
+ * {@link QueryManager.validate validate} to detect that, or `setQuery(getQuery())` to
5920
+ * re-normalize.
5921
+ *
5922
+ * History options are honored immediately: lowering `maxHistory` trims the undo stack, and
5923
+ * turning history off clears both stacks. Subscribers are notified once, and
5924
+ * {@link QueryManager.getConfigVersion} is incremented, even inside a
5925
+ * {@link QueryManager.batch batch} — configuration is not part of a batch's rollback.
5926
+ */
5927
+ reconfigure(options: Partial<QueryManagerOptions<F, O, C>>, config?: {
5928
+ replace?: boolean;
5929
+ }): this;
5930
+ /**
5931
+ * A counter incremented by every {@link QueryManager.reconfigure} call. Because reconfiguring
5932
+ * leaves the query object untouched, subscribers that compare query identity alone cannot see
5933
+ * it; this provides a snapshot that does change.
5934
+ *
5935
+ * Bound to the instance, so it can be passed directly to `useSyncExternalStore` alongside
5936
+ * {@link QueryManager.subscribe}. The `useQueryManager` hook from `react-querybuilder`
5937
+ * already does this.
5938
+ */
5939
+ getConfigVersion: () => number;
5888
5940
  /**
5889
5941
  * Creates an independent manager with the same configuration and the current query.
5890
5942
  *