bitboss-ui 2.1.130 → 2.1.132

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.
Files changed (185) hide show
  1. package/dist/ai/BbTable.md +58 -93
  2. package/dist/components/BbTable/types.d.ts +6 -4
  3. package/dist/index.css +1 -1
  4. package/dist/index109.js +9 -9
  5. package/dist/index110.js +18 -18
  6. package/dist/index118.js +1 -1
  7. package/dist/index124.js +3 -3
  8. package/dist/index126.js +314 -324
  9. package/dist/index134.js +1 -1
  10. package/dist/index136.js +4 -4
  11. package/dist/index138.js +1 -1
  12. package/dist/index14.js +1 -1
  13. package/dist/index142.js +2 -2
  14. package/dist/index146.js +1 -1
  15. package/dist/index150.js +1 -1
  16. package/dist/index151.js +2 -2
  17. package/dist/index16.js +3 -3
  18. package/dist/index18.js +3 -3
  19. package/dist/index20.js +9 -9
  20. package/dist/index22.js +14 -14
  21. package/dist/index225.js +2 -2
  22. package/dist/index226.js +2 -2
  23. package/dist/index227.js +3 -4
  24. package/dist/index228.js +13 -8
  25. package/dist/index229.js +19 -32
  26. package/dist/index230.js +5 -28
  27. package/dist/index231.js +7 -0
  28. package/dist/index232.js +5 -2
  29. package/dist/index233.js +5 -2
  30. package/dist/index234.js +3 -2
  31. package/dist/index235.js +2 -13
  32. package/dist/index236.js +6 -86
  33. package/dist/index238.js +268 -30
  34. package/dist/index239.js +52 -18
  35. package/dist/index24.js +10 -10
  36. package/dist/index240.js +52 -17
  37. package/dist/index241.js +31 -50
  38. package/dist/index242.js +60 -18
  39. package/dist/index243.js +5 -3
  40. package/dist/index244.js +8 -12
  41. package/dist/index245.js +10 -5
  42. package/dist/index246.js +3 -5
  43. package/dist/index247.js +4 -5
  44. package/dist/index248.js +3 -5
  45. package/dist/index249.js +373 -5
  46. package/dist/index251.js +160 -3
  47. package/dist/index253.js +7 -160
  48. package/dist/index254.js +4 -0
  49. package/dist/index255.js +5 -5
  50. package/dist/index256.js +5 -2
  51. package/dist/index257.js +5 -6
  52. package/dist/index258.js +3 -268
  53. package/dist/index259.js +6 -52
  54. package/dist/index26.js +3 -3
  55. package/dist/index260.js +15 -51
  56. package/dist/index261.js +2 -32
  57. package/dist/index262.js +11 -60
  58. package/dist/index263.js +86 -4
  59. package/dist/index265.js +32 -0
  60. package/dist/index266.js +17 -4
  61. package/dist/index267.js +50 -6
  62. package/dist/index268.js +18 -2
  63. package/dist/index269.js +11 -12
  64. package/dist/index270.js +17 -12
  65. package/dist/index271.js +9 -9
  66. package/dist/index272.js +2 -23
  67. package/dist/index273.js +2 -23
  68. package/dist/index274.js +34 -3
  69. package/dist/index275.js +32 -10
  70. package/dist/index276.js +26 -32
  71. package/dist/index278.js +4 -25
  72. package/dist/index279.js +25 -4
  73. package/dist/index28.js +1 -1
  74. package/dist/index280.js +105 -19
  75. package/dist/index282.js +100 -44
  76. package/dist/index284.js +8 -17
  77. package/dist/index285.js +44 -12
  78. package/dist/index286.js +51 -104
  79. package/dist/index287.js +15 -0
  80. package/dist/index288.js +13 -100
  81. package/dist/index289.js +25 -0
  82. package/dist/index290.js +17 -106
  83. package/dist/index291.js +12 -9
  84. package/dist/index292.js +107 -6
  85. package/dist/index293.js +6 -16
  86. package/dist/index294.js +21 -5
  87. package/dist/index296.js +1 -1
  88. package/dist/index297.js +8 -20
  89. package/dist/index298.js +23 -6
  90. package/dist/index299.js +3 -67
  91. package/dist/index30.js +3 -3
  92. package/dist/index300.js +2 -3
  93. package/dist/index301.js +6 -9
  94. package/dist/index302.js +7 -3
  95. package/dist/index303.js +3 -2
  96. package/dist/index304.js +5 -7
  97. package/dist/index305.js +67 -7
  98. package/dist/index306.js +7 -3
  99. package/dist/index307.js +280 -17
  100. package/dist/index308.js +2 -28
  101. package/dist/index309.js +16 -5
  102. package/dist/index310.js +2 -7
  103. package/dist/index311.js +16 -2
  104. package/dist/index312.js +2 -4
  105. package/dist/index313.js +29 -0
  106. package/dist/index314.js +2 -7
  107. package/dist/index315.js +2 -3
  108. package/dist/index316.js +2 -3
  109. package/dist/index317.js +2 -3
  110. package/dist/index318.js +2 -280
  111. package/dist/index319.js +28 -2
  112. package/dist/index32.js +2 -2
  113. package/dist/index320.js +2 -16
  114. package/dist/index321.js +3 -2
  115. package/dist/index322.js +17 -16
  116. package/dist/index323.js +3 -2
  117. package/dist/index324.js +3 -27
  118. package/dist/index325.js +2 -2
  119. package/dist/index326.js +4 -2
  120. package/dist/index328.js +7 -2
  121. package/dist/index329.js +3 -2
  122. package/dist/index330.js +125 -2
  123. package/dist/index331.js +2 -125
  124. package/dist/index332.js +15 -2
  125. package/dist/index333.js +2 -15
  126. package/dist/index334.js +19 -2
  127. package/dist/index335.js +2 -19
  128. package/dist/index336.js +719 -2
  129. package/dist/index337.js +366 -3
  130. package/dist/index338.js +57 -3
  131. package/dist/index339.js +3 -2
  132. package/dist/index34.js +8 -8
  133. package/dist/index340.js +3 -4
  134. package/dist/index341.js +2 -719
  135. package/dist/index342.js +5 -366
  136. package/dist/index343.js +5 -56
  137. package/dist/index344.js +2 -6
  138. package/dist/index345.js +5 -2
  139. package/dist/index348.js +3 -92
  140. package/dist/index349.js +5 -5
  141. package/dist/index352.js +1 -1
  142. package/dist/index353.js +1 -1
  143. package/dist/index354.js +7 -5
  144. package/dist/index355.js +34 -6
  145. package/dist/index356.js +126 -31
  146. package/dist/index357.js +383 -114
  147. package/dist/index358.js +198 -397
  148. package/dist/index359.js +208 -149
  149. package/dist/index36.js +4 -4
  150. package/dist/index360.js +18 -255
  151. package/dist/index362.js +95 -0
  152. package/dist/index364.js +1 -1
  153. package/dist/index365.js +1 -1
  154. package/dist/index366.js +1 -1
  155. package/dist/index370.js +1 -1
  156. package/dist/index38.js +21 -21
  157. package/dist/index40.js +7 -7
  158. package/dist/index42.js +2 -2
  159. package/dist/index44.js +8 -8
  160. package/dist/index46.js +6 -6
  161. package/dist/index54.js +1 -1
  162. package/dist/index56.js +1 -1
  163. package/dist/index58.js +2 -2
  164. package/dist/index60.js +2 -2
  165. package/dist/index62.js +5 -5
  166. package/dist/index68.js +1 -1
  167. package/dist/index74.js +4 -4
  168. package/dist/index82.js +6 -6
  169. package/dist/index84.js +1 -1
  170. package/dist/index86.js +2 -2
  171. package/dist/index88.js +3 -3
  172. package/dist/index90.js +1 -1
  173. package/dist/index93.js +3 -3
  174. package/dist/index95.js +2 -2
  175. package/dist/index97.js +5 -5
  176. package/dist/index99.js +1 -1
  177. package/package.json +2 -2
  178. package/dist/index250.js +0 -7
  179. package/dist/index264.js +0 -375
  180. package/dist/index277.js +0 -5
  181. package/dist/index281.js +0 -11
  182. package/dist/index283.js +0 -55
  183. package/dist/index327.js +0 -4
  184. package/dist/index361.js +0 -24
  185. /package/dist/{index252.js → index237.js} +0 -0
@@ -6,6 +6,7 @@
6
6
  <template>
7
7
  <component
8
8
  :is="containerTag"
9
+ :id="id"
9
10
  ref="containerRef"
10
11
  :aria-busy="loading"
11
12
  :aria-rowcount="hasProvidedAccessibilityData ? props.totalItems : undefined"
@@ -31,11 +32,7 @@
31
32
  <col
32
33
  v-for="track in columnTracks"
33
34
  :key="track.key"
34
- :style="{
35
- width: track.width,
36
- minWidth: track.locked ? track.width : undefined,
37
- maxWidth: track.locked ? track.width : undefined,
38
- }"
35
+ :style="{ width: track.width }"
39
36
  />
40
37
  </colgroup>
41
38
  <thead>
@@ -475,7 +472,6 @@ const props = withDefaults(defineProps<InternalProps<T>>(), {
475
472
  max: Infinity,
476
473
  multiple: true,
477
474
  modelValue: () => [],
478
- inheritColumnWidths: true,
479
475
  unselectedItems: () => [],
480
476
  });
481
477
 
@@ -533,17 +529,29 @@ const {
533
529
  : undefined,
534
530
  });
535
531
 
536
- const inheritColumnWidths = computed(() => props.inheritColumnWidths !== false);
532
+ /** Any column pinned to a parent track range — a per-column inherit signal. */
533
+ const hasSnap = computed(() => props.columns.some((c) => c.snap != null));
534
+
535
+ // Opt-in: inherit when explicitly enabled (`true`, or an ancestor id string),
536
+ // or implicitly when any column carries a `snap` — a snap only resolves against
537
+ // a parent's tracks, so asking for one is asking to inherit. An absent prop with
538
+ // no snaps does not inherit, so a plain nested table stays independent. An
539
+ // explicit `false` is authoritative and overrides the implicit snap signal.
540
+ const inheritColumnWidths = computed(
541
+ () => !!props.inheritColumnWidths || hasSnap.value
542
+ );
537
543
 
538
544
  /**
539
- * Assigned column widths (frozen or inherited) are only authoritative under
540
- * `table-layout: fixed`; in auto layout they behave like a minimum. So a table
541
- * that drives widths — explicitly `fixed`, inheriting from a parent, or with a
542
- * frozen column — uses fixed layout even when `fixed` was not set.
545
+ * Assigned column widths (frozen, snapped, or inherited) are only authoritative
546
+ * under `table-layout: fixed`; in auto layout they behave like a minimum. So a
547
+ * table that drives widths — explicitly `fixed`, inheriting from a parent, or
548
+ * with a column carrying a `width` or `snap` — uses fixed layout even when
549
+ * `fixed` was not set. (`snap` is a width definition: the parent track range.)
543
550
  */
544
551
  const fixedLayout = computed(
545
552
  () =>
546
553
  props.fixed ||
554
+ hasSnap.value ||
547
555
  props.columns.some((column) => column.width != null) ||
548
556
  (inheritColumnWidths.value && !!parentId.value)
549
557
  );
@@ -570,29 +578,6 @@ const toLength = (width: number | string) => {
570
578
  return /^-?\d*\.?\d+$/.test(trimmed) ? `${trimmed}px` : trimmed;
571
579
  };
572
580
 
573
- /**
574
- * Resolves a CSS length to px in the context of `host`.
575
- * Returns `null` when the value cannot be resolved reliably.
576
- */
577
- const resolveLengthToPx = (
578
- width: number | string,
579
- host: HTMLElement
580
- ): number | null => {
581
- const length = toLength(width);
582
- if (/^-?\d*\.?\d+px$/.test(length)) return parseFloat(length);
583
-
584
- const probe = document.createElement('div');
585
- probe.style.position = 'absolute';
586
- probe.style.visibility = 'hidden';
587
- probe.style.pointerEvents = 'none';
588
- probe.style.width = length;
589
- host.appendChild(probe);
590
- const px = probe.getBoundingClientRect().width;
591
- host.removeChild(probe);
592
-
593
- return Number.isFinite(px) && px > 0 ? px : null;
594
- };
595
-
596
581
  /** Number of data columns the parent renders (numeric track keys). */
597
582
  const parentDataColumns = computed(() => {
598
583
  const tracks = parentNode.value?.tracks;
@@ -803,10 +788,10 @@ const columnTracks = computed(() => {
803
788
  fixedLayout.value && structuralFit[key]
804
789
  ? (structuralFit[key] as string)
805
790
  : sync(key);
806
- const tracks: { key: string; width: string; locked?: boolean }[] = [];
791
+ const tracks: { key: string; width: string }[] = [];
807
792
 
808
793
  if (props.selectable) {
809
- tracks.push({ key: 'select', width: structural('select'), locked: false });
794
+ tracks.push({ key: 'select', width: structural('select') });
810
795
  }
811
796
 
812
797
  const lastIndex = props.columns.length - 1;
@@ -820,7 +805,7 @@ const columnTracks = computed(() => {
820
805
  // track plus the folded edge region plus any deficit. Skipped when the
821
806
  // table overflows: there is no leftover then, and it must content-size.
822
807
  if (index === fillColumnIndex.value && !overflowsParent.value) {
823
- tracks.push({ key, width: 'auto', locked: false });
808
+ tracks.push({ key, width: 'auto' });
824
809
  return;
825
810
  }
826
811
 
@@ -855,11 +840,11 @@ const columnTracks = computed(() => {
855
840
  ? `calc(${[...offsets, span ?? '0px'].join(' + ')})`
856
841
  : (span ?? 'auto');
857
842
 
858
- tracks.push({ key, width, locked: frozen != null });
843
+ tracks.push({ key, width });
859
844
  });
860
845
 
861
846
  if (props.actions) {
862
- tracks.push({ key: 'actions', width: structural('actions'), locked: false });
847
+ tracks.push({ key: 'actions', width: structural('actions') });
863
848
  }
864
849
 
865
850
  return tracks;
@@ -931,19 +916,27 @@ const measureStructuralFit = () => {
931
916
  const fit = (selector: string) => {
932
917
  let max = 0;
933
918
  table.querySelectorAll<HTMLElement>(selector).forEach((cell) => {
934
- // Combined horizontal extent of the children, not the widest one: an
935
- // actions cell holds several side-by-side controls whose total width is
936
- // what the column must fit. Measured from edges so it stays correct even
937
- // when the cell is narrower than its content (controls overflow on
938
- // `nowrap`), which keeps the pin-to-content convergence stable.
939
- let left = Infinity;
940
- let right = -Infinity;
919
+ // Sum each child's own intrinsic width (plus horizontal margins) an
920
+ // actions cell holds several side-by-side controls and the column must
921
+ // fit them all. Crucially this is *not* their shared extent: the extent
922
+ // depends on how the cell spreads them across its width, which feeds the
923
+ // column width back into its own measurement and runs away into the
924
+ // thousands. A child's own width does not depend on the cell, so this
925
+ // converges. Out-of-flow children (e.g. an `sr-only` label parked far
926
+ // off-screen) are skipped so they cannot inflate the result.
927
+ let content = 0;
941
928
  cell.querySelectorAll<HTMLElement>(':scope > *').forEach((child) => {
942
- const rect = child.getBoundingClientRect();
943
- left = Math.min(left, rect.left);
944
- right = Math.max(right, rect.right);
929
+ const childStyle = getComputedStyle(child);
930
+ if (
931
+ childStyle.position === 'absolute' ||
932
+ childStyle.position === 'fixed'
933
+ )
934
+ return;
935
+ const margin =
936
+ parseFloat(childStyle.marginLeft) +
937
+ parseFloat(childStyle.marginRight);
938
+ content += child.getBoundingClientRect().width + (margin || 0);
945
939
  });
946
- const content = right > left ? right - left : 0;
947
940
  const style = getComputedStyle(cell);
948
941
  const padding =
949
942
  parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
@@ -1016,19 +1009,6 @@ const fillValue = ref(0);
1016
1009
  */
1017
1010
  const naturalTotalWidth = ref<string | null>(null);
1018
1011
 
1019
- /**
1020
- * Width budget for probe distribution. Prefer the immediate parent's visible
1021
- * width (the scroll viewport) over this table's own offset width so a
1022
- * max-content growth loop in ancestors cannot recursively inflate probe output.
1023
- */
1024
- const probeViewportWidth = (container: HTMLElement): number => {
1025
- const parentWidth = container.parentElement?.clientWidth ?? 0;
1026
- const selfWidth = container.clientWidth || container.getBoundingClientRect().width;
1027
- const fallback = container.offsetWidth;
1028
- const width = parentWidth || selfWidth || fallback;
1029
- return Number.isFinite(width) && width > 0 ? width : 0;
1030
- };
1031
-
1032
1012
  const runNaturalWidthProbe = () => {
1033
1013
  const container = containerRef.value;
1034
1014
  if (!container || !fixedLayout.value) return;
@@ -1041,8 +1021,7 @@ const runNaturalWidthProbe = () => {
1041
1021
  )
1042
1022
  return;
1043
1023
 
1044
- const containerWidth = probeViewportWidth(container);
1045
- if (containerWidth <= 0) return;
1024
+ const containerWidth = container.offsetWidth;
1046
1025
  const dataOffset = props.selectable ? 1 : 0;
1047
1026
 
1048
1027
  // ── Real-table measurements ────────────────────────────────────────────
@@ -1054,21 +1033,17 @@ const runNaturalWidthProbe = () => {
1054
1033
  ? parseFloat(structuralFit.actions)
1055
1034
  : 0;
1056
1035
 
1057
- // Live rendered widths from the fixed-layout table. Frozen columns use their
1058
- // declared width (resolved to px) so an explicit width like `200` remains a
1059
- // true floor in the probe math even when the live render is under pressure.
1060
- // `frozenTotal` (declared widths) feeds the stable min-width floor;
1061
- // `nonFlexTotal` (frozen + inherited) is what the flex columns share.
1036
+ // Live rendered widths from the fixed-layout table. `frozenTotal` (declared
1037
+ // widths) feeds the stable min-width floor; `nonFlexTotal` (frozen + inherited)
1038
+ // is what the flex columns share the remainder of. The inherited part is only
1039
+ // used for that `available` figure never fed back into min-width, since those
1040
+ // widths stretch with the table and would otherwise lock min-width above
1041
+ // max-content and force a spurious uniform stretch on every column.
1062
1042
  const realThs = headerCells();
1063
1043
  let frozenTotal = 0;
1064
1044
  let nonFlexTotal = 0;
1065
1045
  props.columns.forEach((col, i) => {
1066
- const renderedWidth =
1067
- realThs[dataOffset + i]?.getBoundingClientRect().width ?? 0;
1068
- const declaredFrozenWidth =
1069
- col.width != null ? resolveLengthToPx(col.width, container) : null;
1070
- const width = declaredFrozenWidth ?? renderedWidth;
1071
-
1046
+ const width = realThs[dataOffset + i]?.getBoundingClientRect().width ?? 0;
1072
1047
  if (col.width != null) frozenTotal += width;
1073
1048
  if (!isFlexColumn(i)) nonFlexTotal += width;
1074
1049
  });
@@ -1760,10 +1735,12 @@ export type BbTableProps<Item = any> = {
1760
1735
  id?: string;
1761
1736
 
1762
1737
  /**
1763
- * Controls whether unfrozen columns inherit their width from an ancestor
1764
- * table's matching track, accounting for `select`/`actions` columns.
1765
- * - `true` (the default): inherit from the nearest ancestor table.
1766
- * - `false`: do not inherit.
1738
+ * Opt a nested table into inheriting its column widths from an ancestor
1739
+ * table's matching tracks (accounting for `select`/`actions` columns). This
1740
+ * also forces `table-layout: fixed`, so it is **off by default** — a nested
1741
+ * table renders independently unless you ask for alignment.
1742
+ * - `false` (the default): do not inherit; size independently.
1743
+ * - `true`: inherit from the nearest ancestor table.
1767
1744
  * - a table id (string): inherit from the specific ancestor in the chain with
1768
1745
  * that id rather than the immediate parent. Use this when an intermediate
1769
1746
  * table has a different column count, so the extra columns would otherwise
@@ -2166,27 +2143,15 @@ export type BbTableSlots<Item = any> = {
2166
2143
  }
2167
2144
 
2168
2145
  &--fixed {
2169
- table {
2146
+ > table {
2170
2147
  table-layout: fixed;
2171
2148
  width: 100%;
2172
2149
 
2173
2150
  thead {
2174
- th {
2175
- box-sizing: border-box;
2176
- min-width: 0;
2177
- }
2178
-
2179
2151
  .bb-table-header--actions {
2180
2152
  width: auto;
2181
2153
  }
2182
2154
  }
2183
-
2184
- tbody {
2185
- td {
2186
- box-sizing: border-box;
2187
- min-width: 0;
2188
- }
2189
- }
2190
2155
  }
2191
2156
  }
2192
2157
 
@@ -118,10 +118,12 @@ export type BbTableProps<Item = any> = {
118
118
  */
119
119
  id?: string;
120
120
  /**
121
- * Controls whether unfrozen columns inherit their width from an ancestor
122
- * table's matching track, accounting for `select`/`actions` columns.
123
- * - `true` (the default): inherit from the nearest ancestor table.
124
- * - `false`: do not inherit.
121
+ * Opt a nested table into inheriting its column widths from an ancestor
122
+ * table's matching tracks (accounting for `select`/`actions` columns). This
123
+ * also forces `table-layout: fixed`, so it is **off by default** — a nested
124
+ * table renders independently unless you ask for alignment.
125
+ * - `false` (the default): do not inherit; size independently.
126
+ * - `true`: inherit from the nearest ancestor table.
125
127
  * - a table id (string): inherit from the specific ancestor in the chain with
126
128
  * that id rather than the immediate parent. Use this when an intermediate
127
129
  * table has a different column count, so the extra columns would otherwise