bitboss-ui 2.1.128 → 2.1.129
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/dist/ai/BbTable.md +326 -90
- package/dist/components/BbTable/types.d.ts +10 -4
- package/dist/composables/useTableWidthContext.d.ts +7 -0
- package/dist/index.css +1 -1
- package/dist/index325.js +25 -21
- package/dist/index327.js +312 -280
- package/package.json +2 -2
package/dist/index325.js
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
import { useId as e } from "./index12.js";
|
|
2
|
-
import { computed as t, onBeforeUnmount as n, onMounted as r, reactive as i, ref as a, toValue as o,
|
|
2
|
+
import { computed as t, onBeforeUnmount as n, onMounted as r, reactive as i, ref as a, toValue as o, watch as s, watchEffect as c } from "vue";
|
|
3
3
|
//#region src/composables/useTableWidthContext.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
id:
|
|
4
|
+
var l = i(/* @__PURE__ */ new Map()), u = "[data-bb-table-id]";
|
|
5
|
+
function d(d) {
|
|
6
|
+
let f = e().id, p = t(() => o(d.id) || f.value), m = a(null), h = i({
|
|
7
|
+
id: p.value,
|
|
8
8
|
parentId: null,
|
|
9
9
|
tracks: {}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
c(() => {
|
|
12
|
+
h.id = p.value, h.parentId = m.value, l.set(p.value, h);
|
|
13
|
+
});
|
|
14
|
+
let g = () => {
|
|
15
|
+
let e = o(d.container), t = o(d.inheritFrom), n = e?.parentElement?.closest(u) ?? null;
|
|
16
|
+
if (t) for (; n && n.dataset.bbTableId !== t;) n = n.parentElement?.closest(u) ?? null;
|
|
17
|
+
m.value = n?.dataset.bbTableId ?? null;
|
|
18
|
+
};
|
|
19
|
+
r(g), s(() => o(d.inheritFrom), g), n(() => l.delete(p.value));
|
|
20
|
+
let _ = t(() => m.value ? l.get(m.value) ?? null : null);
|
|
17
21
|
return {
|
|
18
|
-
id:
|
|
19
|
-
parentId:
|
|
20
|
-
parentNode:
|
|
21
|
-
parentHasTrack: (e) => !!
|
|
22
|
-
parentVar: (e, t = "auto") =>
|
|
23
|
-
node:
|
|
24
|
-
registry:
|
|
22
|
+
id: p,
|
|
23
|
+
parentId: m,
|
|
24
|
+
parentNode: _,
|
|
25
|
+
parentHasTrack: (e) => !!_.value?.tracks[e],
|
|
26
|
+
parentVar: (e, t = "auto") => m.value ? `var(--bb-table-${m.value}-track-${e}, ${t})` : t,
|
|
27
|
+
node: h,
|
|
28
|
+
registry: l,
|
|
25
29
|
setTracks: (e) => {
|
|
26
|
-
|
|
30
|
+
h.tracks = e;
|
|
27
31
|
},
|
|
28
32
|
cssVars: t(() => {
|
|
29
33
|
let e = {};
|
|
30
|
-
for (let [t, n] of Object.entries(
|
|
34
|
+
for (let [t, n] of Object.entries(h.tracks)) e[`--bb-table-${p.value}-track-${t}`] = n;
|
|
31
35
|
return e;
|
|
32
36
|
})
|
|
33
37
|
};
|
|
34
38
|
}
|
|
35
39
|
//#endregion
|
|
36
|
-
export {
|
|
40
|
+
export { d as useTableWidthContext };
|