intable 0.0.41 → 0.0.43

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.
@@ -1,3 +1,4 @@
1
+ import { renderComponent } from "../components/utils.js";
1
2
  import { Tooltip } from "../components/Tooltip.js";
2
3
  import { createComponent, mergeProps } from "solid-js/web";
3
4
  import { Show, createSignal } from "solid-js";
@@ -5,32 +6,32 @@ import { combineProps } from "@solid-primitives/props";
5
6
  import { offset } from "floating-ui-solid";
6
7
  const TooltipPlugin = {
7
8
  name: "tooltip",
8
- rewriteProps: { Td: ({ Td: s }) => (c) => {
9
- let l = () => {
10
- let e = c.col.tooltip;
11
- if (e != null) return typeof e == "boolean" ? e && c.value != null ? String(c.value) : void 0 : typeof e == "string" ? e : e(c);
12
- }, [u, d] = createSignal();
13
- return c = combineProps({ ref: d }, c), createComponent(s, mergeProps(c, { get children() {
9
+ rewriteProps: { Td: ({ Td: c }, { store: l }) => (u) => {
10
+ let d = () => {
11
+ let s = u.col.tooltip;
12
+ if (s != null) return typeof s == "boolean" && (s = s && u.value != null ? String(u.value) : void 0), typeof s == "function" && (s = s(u)), renderComponent(s, u, l);
13
+ }, [f, p] = createSignal();
14
+ return u = combineProps({ ref: p }, u), createComponent(c, mergeProps(u, { get children() {
14
15
  return createComponent(Show, {
15
16
  get when() {
16
- return l();
17
+ return d();
17
18
  },
18
19
  get fallback() {
19
- return c.children;
20
+ return u.children;
20
21
  },
21
- children: (o) => createComponent(Tooltip, {
22
+ children: (e) => createComponent(Tooltip, {
22
23
  get content() {
23
- return o();
24
+ return e();
24
25
  },
25
26
  strategy: "fixed",
26
27
  get target() {
27
- return u();
28
+ return f();
28
29
  },
29
30
  get middleware() {
30
31
  return [offset({ mainAxis: 4 })];
31
32
  },
32
33
  get children() {
33
- return c.children;
34
+ return u.children;
34
35
  }
35
36
  })
36
37
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intable",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [