@devtable/dashboard 13.27.11 → 13.27.12

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.
@@ -6126,7 +6126,7 @@ class vl {
6126
6126
  }), this.instanceRegistry.clear(), this.factoryRegistry.clear();
6127
6127
  }
6128
6128
  }
6129
- const gp = "13.27.11", Cw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6129
+ const gp = "13.27.12", Cw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6130
6130
  __proto__: null,
6131
6131
  version: gp
6132
6132
  }, Symbol.toStringTag, { value: "Module" }));
@@ -27487,13 +27487,13 @@ const V$ = ({
27487
27487
  const s = lt(), a = !!t.options_query_id, {
27488
27488
  state: o,
27489
27489
  error: l
27490
- } = s.getDataStuffByID(t.options_query_id), c = o === "loading", d = t.min_width ? t.min_width : "200px", u = a ? c : !1, h = (p) => i(p, !1);
27490
+ } = s.getDataStuffByID(t.options_query_id), c = o === "loading", d = t.min_width ? t.min_width : "200px", u = a ? c : !1, h = T(() => t.initialSelection(n), [n, t.initialSelection]), p = (m) => i(m, !1);
27491
27491
  return /* @__PURE__ */ r.jsx(q$, { label: e, options: t.options, style: {
27492
27492
  minWidth: "160px",
27493
27493
  width: d,
27494
27494
  maxWidth: u ? d : "unset",
27495
27495
  borderColor: "#e9ecef"
27496
- }, disabled: u, value: n, onChange: h, errorMessage: l, required: t.required });
27496
+ }, disabled: u, value: [...h], onChange: p, errorMessage: l, required: t.required });
27497
27497
  }), W$ = pe(({
27498
27498
  label: e,
27499
27499
  description: t,
@@ -28713,8 +28713,12 @@ const gP = x.model("FilterDateRangeConfigMeta", {
28713
28713
  default_selection_count: l
28714
28714
  });
28715
28715
  },
28716
- get default_selection() {
28717
- return e.usingQuery ? e.options.slice(0, e.default_selection_count).map((t) => t.value) : e.filter.formattedDefaultValue;
28716
+ get defaultSelection() {
28717
+ const t = e.filter.formattedDefaultValue;
28718
+ return Array.isArray(t) && t.length > 0 || !e.usingQuery ? t : e.options.slice(0, e.default_selection_count).map((n) => n.value);
28719
+ },
28720
+ initialSelection(t) {
28721
+ return t || this.defaultSelection;
28718
28722
  },
28719
28723
  truthy(t) {
28720
28724
  return Array.isArray(t) && t.length > 0;
@@ -28729,12 +28733,12 @@ const gP = x.model("FilterDateRangeConfigMeta", {
28729
28733
  setDefaultSelection() {
28730
28734
  if (e.optionsLoading)
28731
28735
  return;
28732
- const t = ft(e).content.filters, n = et(e).key, i = new Set(e.options.map((a) => a.value)), s = (t.values[n] ?? []).filter((a) => i.has(a));
28733
- s.length > 0 ? t.setValueByKey(n, s) : t.setValueByKey(n, e.default_selection);
28736
+ const t = ft(e).content.filters, n = et(e).key, i = new Set(e.options.map((o) => o.value)), a = (t.values[n] ?? []).filter((o) => i.has(o));
28737
+ a.length > 0 ? (console.debug(`setting filter[${e.filter.key}] to validValues: `, JSON.stringify(a)), t.setValueByKey(n, a)) : (console.debug(`setting filter[${e.filter.key}] to default: `, JSON.stringify(e.defaultSelection)), t.setValueByKey(n, e.defaultSelection));
28734
28738
  }
28735
28739
  })).actions((e) => ({
28736
28740
  afterCreate() {
28737
- dn(e, Bt(() => Qn(e.default_selection), e.setDefaultSelection, {
28741
+ dn(e, Bt(() => Qn(e.defaultSelection), e.setDefaultSelection, {
28738
28742
  fireImmediately: !0,
28739
28743
  delay: 0
28740
28744
  }));
@@ -29828,13 +29832,13 @@ const _x = x.model("FiltersRenderModel", {
29828
29832
  }
29829
29833
  })).actions((e) => ({
29830
29834
  setValues(t) {
29831
- e.values = t;
29835
+ console.debug("setting filter values: ", JSON.stringify(t)), e.values = t;
29832
29836
  },
29833
29837
  patchValues(t) {
29834
29838
  e.values = C.defaults({}, t, e.values);
29835
29839
  },
29836
29840
  setValueByKey(t, n) {
29837
- e.values = {
29841
+ console.debug(`setting filter[${t}] to value: `, JSON.stringify(n)), e.values = {
29838
29842
  ...e.values,
29839
29843
  [t]: n
29840
29844
  };