@almadar/ui 5.129.0 → 5.130.0

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.
@@ -26549,7 +26549,7 @@ var init_useQuerySingleton = __esm({
26549
26549
  queryStores = /* @__PURE__ */ new Map();
26550
26550
  }
26551
26551
  });
26552
- var resolveFilterType, lookStyles6, FilterGroup;
26552
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
26553
26553
  var init_FilterGroup = __esm({
26554
26554
  "components/core/molecules/FilterGroup.tsx"() {
26555
26555
  "use client";
@@ -26567,10 +26567,10 @@ var init_FilterGroup = __esm({
26567
26567
  toolbar: "",
26568
26568
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
26569
26569
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
26570
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
26570
+ "popover-trigger": "",
26571
26571
  "inline-column-header": "hidden"
26572
26572
  };
26573
- FilterGroup = ({
26573
+ FilterGroupControls = ({
26574
26574
  entity,
26575
26575
  filters,
26576
26576
  onFilterChange,
@@ -26906,7 +26906,7 @@ var init_FilterGroup = __esm({
26906
26906
  className: "text-muted-foreground",
26907
26907
  children: [
26908
26908
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "filter", className: "h-4 w-4" }),
26909
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
26909
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
26910
26910
  ]
26911
26911
  }
26912
26912
  ),
@@ -26997,6 +26997,42 @@ var init_FilterGroup = __esm({
26997
26997
  }
26998
26998
  );
26999
26999
  };
27000
+ FilterGroupControls.displayName = "FilterGroupControls";
27001
+ FilterGroupPopover = (props) => {
27002
+ const { t } = hooks.useTranslate();
27003
+ const [open, setOpen] = React91.useState(false);
27004
+ const queryState = useQuerySingleton(props.query);
27005
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
27006
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
27007
+ /* @__PURE__ */ jsxRuntime.jsx(
27008
+ Button,
27009
+ {
27010
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
27011
+ size: "sm",
27012
+ leftIcon: "filter",
27013
+ onClick: () => setOpen((o) => !o),
27014
+ "aria-expanded": open,
27015
+ "aria-haspopup": "true",
27016
+ children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
27017
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
27018
+ activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
27019
+ ] })
27020
+ }
27021
+ ),
27022
+ open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsxRuntime.jsx(
27023
+ FilterGroupControls,
27024
+ {
27025
+ ...props,
27026
+ className: void 0,
27027
+ look: "toolbar",
27028
+ variant: "vertical",
27029
+ showIcon: false
27030
+ }
27031
+ ) })
27032
+ ] });
27033
+ };
27034
+ FilterGroupPopover.displayName = "FilterGroupPopover";
27035
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
27000
27036
  FilterGroup.displayName = "FilterGroup";
27001
27037
  }
27002
27038
  });
@@ -30638,9 +30674,19 @@ function TableView({
30638
30674
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
30639
30675
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
30640
30676
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
30677
+ const colFloors = React91__namespace.default.useMemo(
30678
+ () => colDefs.map((col) => {
30679
+ const longest = data.reduce((widest, row) => {
30680
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
30681
+ return Math.max(widest, cell.length);
30682
+ }, columnLabel(col).length);
30683
+ return Math.min(longest, MAX_MEASURED_COL_CH);
30684
+ }),
30685
+ [colDefs, data]
30686
+ );
30641
30687
  const gridTemplateColumns = [
30642
30688
  selectable ? "auto" : null,
30643
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
30689
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
30644
30690
  actionsTrack
30645
30691
  ].filter(Boolean).join(" ");
30646
30692
  const header = /* @__PURE__ */ jsxRuntime.jsxs(
@@ -30807,7 +30853,7 @@ function TableView({
30807
30853
  }
30808
30854
  );
30809
30855
  }
30810
- var alignClass, weightClass, LOOKS;
30856
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
30811
30857
  var init_TableView = __esm({
30812
30858
  "components/core/molecules/TableView.tsx"() {
30813
30859
  "use client";
@@ -30825,6 +30871,7 @@ var init_TableView = __esm({
30825
30871
  init_Menu();
30826
30872
  init_useDataDnd();
30827
30873
  logger.createLogger("almadar:ui:table-view");
30874
+ MAX_MEASURED_COL_CH = 32;
30828
30875
  alignClass = {
30829
30876
  left: "justify-start text-left",
30830
30877
  center: "justify-center text-center",
package/dist/avl/index.js CHANGED
@@ -26473,7 +26473,7 @@ var init_useQuerySingleton = __esm({
26473
26473
  queryStores = /* @__PURE__ */ new Map();
26474
26474
  }
26475
26475
  });
26476
- var resolveFilterType, lookStyles6, FilterGroup;
26476
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
26477
26477
  var init_FilterGroup = __esm({
26478
26478
  "components/core/molecules/FilterGroup.tsx"() {
26479
26479
  "use client";
@@ -26491,10 +26491,10 @@ var init_FilterGroup = __esm({
26491
26491
  toolbar: "",
26492
26492
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
26493
26493
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
26494
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
26494
+ "popover-trigger": "",
26495
26495
  "inline-column-header": "hidden"
26496
26496
  };
26497
- FilterGroup = ({
26497
+ FilterGroupControls = ({
26498
26498
  entity,
26499
26499
  filters,
26500
26500
  onFilterChange,
@@ -26830,7 +26830,7 @@ var init_FilterGroup = __esm({
26830
26830
  className: "text-muted-foreground",
26831
26831
  children: [
26832
26832
  /* @__PURE__ */ jsx(Icon, { name: "filter", className: "h-4 w-4" }),
26833
- /* @__PURE__ */ jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
26833
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
26834
26834
  ]
26835
26835
  }
26836
26836
  ),
@@ -26921,6 +26921,42 @@ var init_FilterGroup = __esm({
26921
26921
  }
26922
26922
  );
26923
26923
  };
26924
+ FilterGroupControls.displayName = "FilterGroupControls";
26925
+ FilterGroupPopover = (props) => {
26926
+ const { t } = useTranslate();
26927
+ const [open, setOpen] = useState(false);
26928
+ const queryState = useQuerySingleton(props.query);
26929
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
26930
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", props.className), children: [
26931
+ /* @__PURE__ */ jsx(
26932
+ Button,
26933
+ {
26934
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
26935
+ size: "sm",
26936
+ leftIcon: "filter",
26937
+ onClick: () => setOpen((o) => !o),
26938
+ "aria-expanded": open,
26939
+ "aria-haspopup": "true",
26940
+ children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
26941
+ /* @__PURE__ */ jsx("span", { children: t("filterGroup.filters") }),
26942
+ activeFilterCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
26943
+ ] })
26944
+ }
26945
+ ),
26946
+ open && /* @__PURE__ */ jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsx(
26947
+ FilterGroupControls,
26948
+ {
26949
+ ...props,
26950
+ className: void 0,
26951
+ look: "toolbar",
26952
+ variant: "vertical",
26953
+ showIcon: false
26954
+ }
26955
+ ) })
26956
+ ] });
26957
+ };
26958
+ FilterGroupPopover.displayName = "FilterGroupPopover";
26959
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsx(FilterGroupControls, { ...props });
26924
26960
  FilterGroup.displayName = "FilterGroup";
26925
26961
  }
26926
26962
  });
@@ -30562,9 +30598,19 @@ function TableView({
30562
30598
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
30563
30599
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
30564
30600
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
30601
+ const colFloors = React91__default.useMemo(
30602
+ () => colDefs.map((col) => {
30603
+ const longest = data.reduce((widest, row) => {
30604
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
30605
+ return Math.max(widest, cell.length);
30606
+ }, columnLabel(col).length);
30607
+ return Math.min(longest, MAX_MEASURED_COL_CH);
30608
+ }),
30609
+ [colDefs, data]
30610
+ );
30565
30611
  const gridTemplateColumns = [
30566
30612
  selectable ? "auto" : null,
30567
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
30613
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
30568
30614
  actionsTrack
30569
30615
  ].filter(Boolean).join(" ");
30570
30616
  const header = /* @__PURE__ */ jsxs(
@@ -30731,7 +30777,7 @@ function TableView({
30731
30777
  }
30732
30778
  );
30733
30779
  }
30734
- var alignClass, weightClass, LOOKS;
30780
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
30735
30781
  var init_TableView = __esm({
30736
30782
  "components/core/molecules/TableView.tsx"() {
30737
30783
  "use client";
@@ -30749,6 +30795,7 @@ var init_TableView = __esm({
30749
30795
  init_Menu();
30750
30796
  init_useDataDnd();
30751
30797
  createLogger("almadar:ui:table-view");
30798
+ MAX_MEASURED_COL_CH = 32;
30752
30799
  alignClass = {
30753
30800
  left: "justify-start text-left",
30754
30801
  center: "justify-center text-center",
@@ -22705,7 +22705,7 @@ var init_useQuerySingleton = __esm({
22705
22705
  queryStores = /* @__PURE__ */ new Map();
22706
22706
  }
22707
22707
  });
22708
- var resolveFilterType, lookStyles6; exports.FilterGroup = void 0;
22708
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover; exports.FilterGroup = void 0;
22709
22709
  var init_FilterGroup = __esm({
22710
22710
  "components/core/molecules/FilterGroup.tsx"() {
22711
22711
  "use client";
@@ -22723,10 +22723,10 @@ var init_FilterGroup = __esm({
22723
22723
  toolbar: "",
22724
22724
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
22725
22725
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
22726
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
22726
+ "popover-trigger": "",
22727
22727
  "inline-column-header": "hidden"
22728
22728
  };
22729
- exports.FilterGroup = ({
22729
+ FilterGroupControls = ({
22730
22730
  entity,
22731
22731
  filters,
22732
22732
  onFilterChange,
@@ -23062,7 +23062,7 @@ var init_FilterGroup = __esm({
23062
23062
  className: "text-muted-foreground",
23063
23063
  children: [
23064
23064
  /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "filter", className: "h-4 w-4" }),
23065
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
23065
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
23066
23066
  ]
23067
23067
  }
23068
23068
  ),
@@ -23153,6 +23153,42 @@ var init_FilterGroup = __esm({
23153
23153
  }
23154
23154
  );
23155
23155
  };
23156
+ FilterGroupControls.displayName = "FilterGroupControls";
23157
+ FilterGroupPopover = (props) => {
23158
+ const { t } = hooks.useTranslate();
23159
+ const [open, setOpen] = React74.useState(false);
23160
+ const queryState = useQuerySingleton(props.query);
23161
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
23162
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
23163
+ /* @__PURE__ */ jsxRuntime.jsx(
23164
+ exports.Button,
23165
+ {
23166
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
23167
+ size: "sm",
23168
+ leftIcon: "filter",
23169
+ onClick: () => setOpen((o) => !o),
23170
+ "aria-expanded": open,
23171
+ "aria-haspopup": "true",
23172
+ children: /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "xs", align: "center", children: [
23173
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
23174
+ activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "primary", size: "sm", children: activeFilterCount })
23175
+ ] })
23176
+ }
23177
+ ),
23178
+ open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsxRuntime.jsx(
23179
+ FilterGroupControls,
23180
+ {
23181
+ ...props,
23182
+ className: void 0,
23183
+ look: "toolbar",
23184
+ variant: "vertical",
23185
+ showIcon: false
23186
+ }
23187
+ ) })
23188
+ ] });
23189
+ };
23190
+ FilterGroupPopover.displayName = "FilterGroupPopover";
23191
+ exports.FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
23156
23192
  exports.FilterGroup.displayName = "FilterGroup";
23157
23193
  }
23158
23194
  });
@@ -29606,9 +29642,19 @@ function TableView({
29606
29642
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
29607
29643
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
29608
29644
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
29645
+ const colFloors = React74__namespace.default.useMemo(
29646
+ () => colDefs.map((col) => {
29647
+ const longest = data.reduce((widest, row) => {
29648
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
29649
+ return Math.max(widest, cell.length);
29650
+ }, columnLabel(col).length);
29651
+ return Math.min(longest, MAX_MEASURED_COL_CH);
29652
+ }),
29653
+ [colDefs, data]
29654
+ );
29609
29655
  const gridTemplateColumns = [
29610
29656
  selectable ? "auto" : null,
29611
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
29657
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
29612
29658
  actionsTrack
29613
29659
  ].filter(Boolean).join(" ");
29614
29660
  const header = /* @__PURE__ */ jsxRuntime.jsxs(
@@ -29775,7 +29821,7 @@ function TableView({
29775
29821
  }
29776
29822
  );
29777
29823
  }
29778
- var alignClass, weightClass, LOOKS;
29824
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
29779
29825
  var init_TableView = __esm({
29780
29826
  "components/core/molecules/TableView.tsx"() {
29781
29827
  "use client";
@@ -29793,6 +29839,7 @@ var init_TableView = __esm({
29793
29839
  init_Menu();
29794
29840
  init_useDataDnd();
29795
29841
  logger.createLogger("almadar:ui:table-view");
29842
+ MAX_MEASURED_COL_CH = 32;
29796
29843
  alignClass = {
29797
29844
  left: "justify-start text-left",
29798
29845
  center: "justify-center text-center",
@@ -4011,10 +4011,6 @@ interface FilterGroupProps {
4011
4011
  /** Declarative clear event — emits UI:{clearEvent} via eventBus on clear-all (alongside canonical UI:CLEAR_FILTERS) */
4012
4012
  clearEvent?: EventKey;
4013
4013
  }
4014
- /**
4015
- * FilterGroup - Renders filter controls for entity data
4016
- * Uses atoms: Button, Select, Badge, HStack
4017
- */
4018
4014
  declare const FilterGroup: React__default.FC<FilterGroupProps>;
4019
4015
 
4020
4016
  /**
@@ -4011,10 +4011,6 @@ interface FilterGroupProps {
4011
4011
  /** Declarative clear event — emits UI:{clearEvent} via eventBus on clear-all (alongside canonical UI:CLEAR_FILTERS) */
4012
4012
  clearEvent?: EventKey;
4013
4013
  }
4014
- /**
4015
- * FilterGroup - Renders filter controls for entity data
4016
- * Uses atoms: Button, Select, Badge, HStack
4017
- */
4018
4014
  declare const FilterGroup: React__default.FC<FilterGroupProps>;
4019
4015
 
4020
4016
  /**
@@ -22630,7 +22630,7 @@ var init_useQuerySingleton = __esm({
22630
22630
  queryStores = /* @__PURE__ */ new Map();
22631
22631
  }
22632
22632
  });
22633
- var resolveFilterType, lookStyles6, FilterGroup;
22633
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
22634
22634
  var init_FilterGroup = __esm({
22635
22635
  "components/core/molecules/FilterGroup.tsx"() {
22636
22636
  "use client";
@@ -22648,10 +22648,10 @@ var init_FilterGroup = __esm({
22648
22648
  toolbar: "",
22649
22649
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
22650
22650
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
22651
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
22651
+ "popover-trigger": "",
22652
22652
  "inline-column-header": "hidden"
22653
22653
  };
22654
- FilterGroup = ({
22654
+ FilterGroupControls = ({
22655
22655
  entity,
22656
22656
  filters,
22657
22657
  onFilterChange,
@@ -22987,7 +22987,7 @@ var init_FilterGroup = __esm({
22987
22987
  className: "text-muted-foreground",
22988
22988
  children: [
22989
22989
  /* @__PURE__ */ jsx(Icon, { name: "filter", className: "h-4 w-4" }),
22990
- /* @__PURE__ */ jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
22990
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
22991
22991
  ]
22992
22992
  }
22993
22993
  ),
@@ -23078,6 +23078,42 @@ var init_FilterGroup = __esm({
23078
23078
  }
23079
23079
  );
23080
23080
  };
23081
+ FilterGroupControls.displayName = "FilterGroupControls";
23082
+ FilterGroupPopover = (props) => {
23083
+ const { t } = useTranslate();
23084
+ const [open, setOpen] = useState(false);
23085
+ const queryState = useQuerySingleton(props.query);
23086
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
23087
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", props.className), children: [
23088
+ /* @__PURE__ */ jsx(
23089
+ Button,
23090
+ {
23091
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
23092
+ size: "sm",
23093
+ leftIcon: "filter",
23094
+ onClick: () => setOpen((o) => !o),
23095
+ "aria-expanded": open,
23096
+ "aria-haspopup": "true",
23097
+ children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
23098
+ /* @__PURE__ */ jsx("span", { children: t("filterGroup.filters") }),
23099
+ activeFilterCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
23100
+ ] })
23101
+ }
23102
+ ),
23103
+ open && /* @__PURE__ */ jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsx(
23104
+ FilterGroupControls,
23105
+ {
23106
+ ...props,
23107
+ className: void 0,
23108
+ look: "toolbar",
23109
+ variant: "vertical",
23110
+ showIcon: false
23111
+ }
23112
+ ) })
23113
+ ] });
23114
+ };
23115
+ FilterGroupPopover.displayName = "FilterGroupPopover";
23116
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsx(FilterGroupControls, { ...props });
23081
23117
  FilterGroup.displayName = "FilterGroup";
23082
23118
  }
23083
23119
  });
@@ -29531,9 +29567,19 @@ function TableView({
29531
29567
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
29532
29568
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
29533
29569
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
29570
+ const colFloors = React74__default.useMemo(
29571
+ () => colDefs.map((col) => {
29572
+ const longest = data.reduce((widest, row) => {
29573
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
29574
+ return Math.max(widest, cell.length);
29575
+ }, columnLabel(col).length);
29576
+ return Math.min(longest, MAX_MEASURED_COL_CH);
29577
+ }),
29578
+ [colDefs, data]
29579
+ );
29534
29580
  const gridTemplateColumns = [
29535
29581
  selectable ? "auto" : null,
29536
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
29582
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
29537
29583
  actionsTrack
29538
29584
  ].filter(Boolean).join(" ");
29539
29585
  const header = /* @__PURE__ */ jsxs(
@@ -29700,7 +29746,7 @@ function TableView({
29700
29746
  }
29701
29747
  );
29702
29748
  }
29703
- var alignClass, weightClass, LOOKS;
29749
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
29704
29750
  var init_TableView = __esm({
29705
29751
  "components/core/molecules/TableView.tsx"() {
29706
29752
  "use client";
@@ -29718,6 +29764,7 @@ var init_TableView = __esm({
29718
29764
  init_Menu();
29719
29765
  init_useDataDnd();
29720
29766
  createLogger("almadar:ui:table-view");
29767
+ MAX_MEASURED_COL_CH = 32;
29721
29768
  alignClass = {
29722
29769
  left: "justify-start text-left",
29723
29770
  center: "justify-center text-center",
@@ -24283,7 +24283,7 @@ var init_useQuerySingleton = __esm({
24283
24283
  queryStores = /* @__PURE__ */ new Map();
24284
24284
  }
24285
24285
  });
24286
- var resolveFilterType, lookStyles6, FilterGroup;
24286
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
24287
24287
  var init_FilterGroup = __esm({
24288
24288
  "components/core/molecules/FilterGroup.tsx"() {
24289
24289
  "use client";
@@ -24301,10 +24301,10 @@ var init_FilterGroup = __esm({
24301
24301
  toolbar: "",
24302
24302
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
24303
24303
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
24304
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
24304
+ "popover-trigger": "",
24305
24305
  "inline-column-header": "hidden"
24306
24306
  };
24307
- FilterGroup = ({
24307
+ FilterGroupControls = ({
24308
24308
  entity,
24309
24309
  filters,
24310
24310
  onFilterChange,
@@ -24640,7 +24640,7 @@ var init_FilterGroup = __esm({
24640
24640
  className: "text-muted-foreground",
24641
24641
  children: [
24642
24642
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "filter", className: "h-4 w-4" }),
24643
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24643
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24644
24644
  ]
24645
24645
  }
24646
24646
  ),
@@ -24731,6 +24731,42 @@ var init_FilterGroup = __esm({
24731
24731
  }
24732
24732
  );
24733
24733
  };
24734
+ FilterGroupControls.displayName = "FilterGroupControls";
24735
+ FilterGroupPopover = (props) => {
24736
+ const { t } = hooks.useTranslate();
24737
+ const [open, setOpen] = React84.useState(false);
24738
+ const queryState = useQuerySingleton(props.query);
24739
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
24740
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
24741
+ /* @__PURE__ */ jsxRuntime.jsx(
24742
+ Button,
24743
+ {
24744
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
24745
+ size: "sm",
24746
+ leftIcon: "filter",
24747
+ onClick: () => setOpen((o) => !o),
24748
+ "aria-expanded": open,
24749
+ "aria-haspopup": "true",
24750
+ children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
24751
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
24752
+ activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
24753
+ ] })
24754
+ }
24755
+ ),
24756
+ open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsxRuntime.jsx(
24757
+ FilterGroupControls,
24758
+ {
24759
+ ...props,
24760
+ className: void 0,
24761
+ look: "toolbar",
24762
+ variant: "vertical",
24763
+ showIcon: false
24764
+ }
24765
+ ) })
24766
+ ] });
24767
+ };
24768
+ FilterGroupPopover.displayName = "FilterGroupPopover";
24769
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
24734
24770
  FilterGroup.displayName = "FilterGroup";
24735
24771
  }
24736
24772
  });
@@ -28372,9 +28408,19 @@ function TableView({
28372
28408
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
28373
28409
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
28374
28410
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
28411
+ const colFloors = React84__namespace.default.useMemo(
28412
+ () => colDefs.map((col) => {
28413
+ const longest = data.reduce((widest, row) => {
28414
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
28415
+ return Math.max(widest, cell.length);
28416
+ }, columnLabel(col).length);
28417
+ return Math.min(longest, MAX_MEASURED_COL_CH);
28418
+ }),
28419
+ [colDefs, data]
28420
+ );
28375
28421
  const gridTemplateColumns = [
28376
28422
  selectable ? "auto" : null,
28377
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
28423
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
28378
28424
  actionsTrack
28379
28425
  ].filter(Boolean).join(" ");
28380
28426
  const header = /* @__PURE__ */ jsxRuntime.jsxs(
@@ -28541,7 +28587,7 @@ function TableView({
28541
28587
  }
28542
28588
  );
28543
28589
  }
28544
- var alignClass, weightClass, LOOKS;
28590
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
28545
28591
  var init_TableView = __esm({
28546
28592
  "components/core/molecules/TableView.tsx"() {
28547
28593
  "use client";
@@ -28559,6 +28605,7 @@ var init_TableView = __esm({
28559
28605
  init_Menu();
28560
28606
  init_useDataDnd();
28561
28607
  logger.createLogger("almadar:ui:table-view");
28608
+ MAX_MEASURED_COL_CH = 32;
28562
28609
  alignClass = {
28563
28610
  left: "justify-start text-left",
28564
28611
  center: "justify-center text-center",
@@ -24209,7 +24209,7 @@ var init_useQuerySingleton = __esm({
24209
24209
  queryStores = /* @__PURE__ */ new Map();
24210
24210
  }
24211
24211
  });
24212
- var resolveFilterType, lookStyles6, FilterGroup;
24212
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
24213
24213
  var init_FilterGroup = __esm({
24214
24214
  "components/core/molecules/FilterGroup.tsx"() {
24215
24215
  "use client";
@@ -24227,10 +24227,10 @@ var init_FilterGroup = __esm({
24227
24227
  toolbar: "",
24228
24228
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
24229
24229
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
24230
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
24230
+ "popover-trigger": "",
24231
24231
  "inline-column-header": "hidden"
24232
24232
  };
24233
- FilterGroup = ({
24233
+ FilterGroupControls = ({
24234
24234
  entity,
24235
24235
  filters,
24236
24236
  onFilterChange,
@@ -24566,7 +24566,7 @@ var init_FilterGroup = __esm({
24566
24566
  className: "text-muted-foreground",
24567
24567
  children: [
24568
24568
  /* @__PURE__ */ jsx(Icon, { name: "filter", className: "h-4 w-4" }),
24569
- /* @__PURE__ */ jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24569
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24570
24570
  ]
24571
24571
  }
24572
24572
  ),
@@ -24657,6 +24657,42 @@ var init_FilterGroup = __esm({
24657
24657
  }
24658
24658
  );
24659
24659
  };
24660
+ FilterGroupControls.displayName = "FilterGroupControls";
24661
+ FilterGroupPopover = (props) => {
24662
+ const { t } = useTranslate();
24663
+ const [open, setOpen] = useState(false);
24664
+ const queryState = useQuerySingleton(props.query);
24665
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
24666
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", props.className), children: [
24667
+ /* @__PURE__ */ jsx(
24668
+ Button,
24669
+ {
24670
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
24671
+ size: "sm",
24672
+ leftIcon: "filter",
24673
+ onClick: () => setOpen((o) => !o),
24674
+ "aria-expanded": open,
24675
+ "aria-haspopup": "true",
24676
+ children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
24677
+ /* @__PURE__ */ jsx("span", { children: t("filterGroup.filters") }),
24678
+ activeFilterCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
24679
+ ] })
24680
+ }
24681
+ ),
24682
+ open && /* @__PURE__ */ jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsx(
24683
+ FilterGroupControls,
24684
+ {
24685
+ ...props,
24686
+ className: void 0,
24687
+ look: "toolbar",
24688
+ variant: "vertical",
24689
+ showIcon: false
24690
+ }
24691
+ ) })
24692
+ ] });
24693
+ };
24694
+ FilterGroupPopover.displayName = "FilterGroupPopover";
24695
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsx(FilterGroupControls, { ...props });
24660
24696
  FilterGroup.displayName = "FilterGroup";
24661
24697
  }
24662
24698
  });
@@ -28298,9 +28334,19 @@ function TableView({
28298
28334
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
28299
28335
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
28300
28336
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
28337
+ const colFloors = React84__default.useMemo(
28338
+ () => colDefs.map((col) => {
28339
+ const longest = data.reduce((widest, row) => {
28340
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
28341
+ return Math.max(widest, cell.length);
28342
+ }, columnLabel(col).length);
28343
+ return Math.min(longest, MAX_MEASURED_COL_CH);
28344
+ }),
28345
+ [colDefs, data]
28346
+ );
28301
28347
  const gridTemplateColumns = [
28302
28348
  selectable ? "auto" : null,
28303
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
28349
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
28304
28350
  actionsTrack
28305
28351
  ].filter(Boolean).join(" ");
28306
28352
  const header = /* @__PURE__ */ jsxs(
@@ -28467,7 +28513,7 @@ function TableView({
28467
28513
  }
28468
28514
  );
28469
28515
  }
28470
- var alignClass, weightClass, LOOKS;
28516
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
28471
28517
  var init_TableView = __esm({
28472
28518
  "components/core/molecules/TableView.tsx"() {
28473
28519
  "use client";
@@ -28485,6 +28531,7 @@ var init_TableView = __esm({
28485
28531
  init_Menu();
28486
28532
  init_useDataDnd();
28487
28533
  createLogger("almadar:ui:table-view");
28534
+ MAX_MEASURED_COL_CH = 32;
28488
28535
  alignClass = {
28489
28536
  left: "justify-start text-left",
28490
28537
  center: "justify-center text-center",
@@ -23773,7 +23773,7 @@ var init_FormField = __esm({
23773
23773
  FormField.displayName = "FormField";
23774
23774
  }
23775
23775
  });
23776
- var resolveFilterType, lookStyles6, FilterGroup;
23776
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
23777
23777
  var init_FilterGroup = __esm({
23778
23778
  "components/core/molecules/FilterGroup.tsx"() {
23779
23779
  "use client";
@@ -23791,10 +23791,10 @@ var init_FilterGroup = __esm({
23791
23791
  toolbar: "",
23792
23792
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
23793
23793
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
23794
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
23794
+ "popover-trigger": "",
23795
23795
  "inline-column-header": "hidden"
23796
23796
  };
23797
- FilterGroup = ({
23797
+ FilterGroupControls = ({
23798
23798
  entity,
23799
23799
  filters,
23800
23800
  onFilterChange,
@@ -24130,7 +24130,7 @@ var init_FilterGroup = __esm({
24130
24130
  className: "text-muted-foreground",
24131
24131
  children: [
24132
24132
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "filter", className: "h-4 w-4" }),
24133
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24133
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24134
24134
  ]
24135
24135
  }
24136
24136
  ),
@@ -24221,6 +24221,42 @@ var init_FilterGroup = __esm({
24221
24221
  }
24222
24222
  );
24223
24223
  };
24224
+ FilterGroupControls.displayName = "FilterGroupControls";
24225
+ FilterGroupPopover = (props) => {
24226
+ const { t } = hooks.useTranslate();
24227
+ const [open, setOpen] = React82.useState(false);
24228
+ const queryState = useQuerySingleton(props.query);
24229
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
24230
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
24231
+ /* @__PURE__ */ jsxRuntime.jsx(
24232
+ Button,
24233
+ {
24234
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
24235
+ size: "sm",
24236
+ leftIcon: "filter",
24237
+ onClick: () => setOpen((o) => !o),
24238
+ "aria-expanded": open,
24239
+ "aria-haspopup": "true",
24240
+ children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
24241
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
24242
+ activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
24243
+ ] })
24244
+ }
24245
+ ),
24246
+ open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsxRuntime.jsx(
24247
+ FilterGroupControls,
24248
+ {
24249
+ ...props,
24250
+ className: void 0,
24251
+ look: "toolbar",
24252
+ variant: "vertical",
24253
+ showIcon: false
24254
+ }
24255
+ ) })
24256
+ ] });
24257
+ };
24258
+ FilterGroupPopover.displayName = "FilterGroupPopover";
24259
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
24224
24260
  FilterGroup.displayName = "FilterGroup";
24225
24261
  }
24226
24262
  });
@@ -27862,9 +27898,19 @@ function TableView({
27862
27898
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
27863
27899
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
27864
27900
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
27901
+ const colFloors = React82__namespace.default.useMemo(
27902
+ () => colDefs.map((col) => {
27903
+ const longest = data.reduce((widest, row) => {
27904
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
27905
+ return Math.max(widest, cell.length);
27906
+ }, columnLabel(col).length);
27907
+ return Math.min(longest, MAX_MEASURED_COL_CH);
27908
+ }),
27909
+ [colDefs, data]
27910
+ );
27865
27911
  const gridTemplateColumns = [
27866
27912
  selectable ? "auto" : null,
27867
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
27913
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
27868
27914
  actionsTrack
27869
27915
  ].filter(Boolean).join(" ");
27870
27916
  const header = /* @__PURE__ */ jsxRuntime.jsxs(
@@ -28031,7 +28077,7 @@ function TableView({
28031
28077
  }
28032
28078
  );
28033
28079
  }
28034
- var alignClass, weightClass, LOOKS;
28080
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
28035
28081
  var init_TableView = __esm({
28036
28082
  "components/core/molecules/TableView.tsx"() {
28037
28083
  "use client";
@@ -28049,6 +28095,7 @@ var init_TableView = __esm({
28049
28095
  init_Menu();
28050
28096
  init_useDataDnd();
28051
28097
  logger.createLogger("almadar:ui:table-view");
28098
+ MAX_MEASURED_COL_CH = 32;
28052
28099
  alignClass = {
28053
28100
  left: "justify-start text-left",
28054
28101
  center: "justify-center text-center",
@@ -23699,7 +23699,7 @@ var init_FormField = __esm({
23699
23699
  FormField.displayName = "FormField";
23700
23700
  }
23701
23701
  });
23702
- var resolveFilterType, lookStyles6, FilterGroup;
23702
+ var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
23703
23703
  var init_FilterGroup = __esm({
23704
23704
  "components/core/molecules/FilterGroup.tsx"() {
23705
23705
  "use client";
@@ -23717,10 +23717,10 @@ var init_FilterGroup = __esm({
23717
23717
  toolbar: "",
23718
23718
  chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
23719
23719
  pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
23720
- "popover-trigger": "[&>*:not(:first-child)]:hidden",
23720
+ "popover-trigger": "",
23721
23721
  "inline-column-header": "hidden"
23722
23722
  };
23723
- FilterGroup = ({
23723
+ FilterGroupControls = ({
23724
23724
  entity,
23725
23725
  filters,
23726
23726
  onFilterChange,
@@ -24056,7 +24056,7 @@ var init_FilterGroup = __esm({
24056
24056
  className: "text-muted-foreground",
24057
24057
  children: [
24058
24058
  /* @__PURE__ */ jsx(Icon, { name: "filter", className: "h-4 w-4" }),
24059
- /* @__PURE__ */ jsx("span", { className: "text-sm font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24059
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
24060
24060
  ]
24061
24061
  }
24062
24062
  ),
@@ -24147,6 +24147,42 @@ var init_FilterGroup = __esm({
24147
24147
  }
24148
24148
  );
24149
24149
  };
24150
+ FilterGroupControls.displayName = "FilterGroupControls";
24151
+ FilterGroupPopover = (props) => {
24152
+ const { t } = useTranslate();
24153
+ const [open, setOpen] = useState(false);
24154
+ const queryState = useQuerySingleton(props.query);
24155
+ const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
24156
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", props.className), children: [
24157
+ /* @__PURE__ */ jsx(
24158
+ Button,
24159
+ {
24160
+ variant: activeFilterCount > 0 ? "secondary" : "ghost",
24161
+ size: "sm",
24162
+ leftIcon: "filter",
24163
+ onClick: () => setOpen((o) => !o),
24164
+ "aria-expanded": open,
24165
+ "aria-haspopup": "true",
24166
+ children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
24167
+ /* @__PURE__ */ jsx("span", { children: t("filterGroup.filters") }),
24168
+ activeFilterCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
24169
+ ] })
24170
+ }
24171
+ ),
24172
+ open && /* @__PURE__ */ jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsx(
24173
+ FilterGroupControls,
24174
+ {
24175
+ ...props,
24176
+ className: void 0,
24177
+ look: "toolbar",
24178
+ variant: "vertical",
24179
+ showIcon: false
24180
+ }
24181
+ ) })
24182
+ ] });
24183
+ };
24184
+ FilterGroupPopover.displayName = "FilterGroupPopover";
24185
+ FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsx(FilterGroupControls, { ...props });
24150
24186
  FilterGroup.displayName = "FilterGroup";
24151
24187
  }
24152
24188
  });
@@ -27788,9 +27824,19 @@ function TableView({
27788
27824
  const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
27789
27825
  const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
27790
27826
  const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
27827
+ const colFloors = React82__default.useMemo(
27828
+ () => colDefs.map((col) => {
27829
+ const longest = data.reduce((widest, row) => {
27830
+ const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
27831
+ return Math.max(widest, cell.length);
27832
+ }, columnLabel(col).length);
27833
+ return Math.min(longest, MAX_MEASURED_COL_CH);
27834
+ }),
27835
+ [colDefs, data]
27836
+ );
27791
27837
  const gridTemplateColumns = [
27792
27838
  selectable ? "auto" : null,
27793
- ...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
27839
+ ...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
27794
27840
  actionsTrack
27795
27841
  ].filter(Boolean).join(" ");
27796
27842
  const header = /* @__PURE__ */ jsxs(
@@ -27957,7 +28003,7 @@ function TableView({
27957
28003
  }
27958
28004
  );
27959
28005
  }
27960
- var alignClass, weightClass, LOOKS;
28006
+ var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
27961
28007
  var init_TableView = __esm({
27962
28008
  "components/core/molecules/TableView.tsx"() {
27963
28009
  "use client";
@@ -27975,6 +28021,7 @@ var init_TableView = __esm({
27975
28021
  init_Menu();
27976
28022
  init_useDataDnd();
27977
28023
  createLogger("almadar:ui:table-view");
28024
+ MAX_MEASURED_COL_CH = 32;
27978
28025
  alignClass = {
27979
28026
  left: "justify-start text-left",
27980
28027
  center: "justify-center text-center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.129.0",
3
+ "version": "5.130.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -122,7 +122,7 @@
122
122
  "@almadar/evaluator": "^2.37.0",
123
123
  "@almadar/logger": "^1.10.0",
124
124
  "@almadar/runtime": "^6.41.0",
125
- "@almadar/std": "^16.147.0",
125
+ "@almadar/std": "^16.148.0",
126
126
  "@almadar/syntax": "^1.13.0",
127
127
  "@dnd-kit/core": "^6.3.1",
128
128
  "@dnd-kit/sortable": "^10.0.0",