intable 0.0.3 → 0.0.4

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 (42) hide show
  1. package/README.md +2 -1
  2. package/dist/__uno.css +1 -1
  3. package/dist/chevron-right.js +3 -5
  4. package/dist/components/Columns.js +50 -84
  5. package/dist/components/DocTree.js +21 -29
  6. package/dist/components/Menu.js +81 -105
  7. package/dist/components/Popover.js +23 -31
  8. package/dist/components/Render.js +10 -11
  9. package/dist/components/Split.js +34 -46
  10. package/dist/components/Tree.js +38 -57
  11. package/dist/components/utils.js +4 -6
  12. package/dist/hooks/index.js +91 -128
  13. package/dist/hooks/useDir.js +22 -39
  14. package/dist/hooks/useSort.js +47 -70
  15. package/dist/hooks/useVirtualizer.js +43 -68
  16. package/dist/index.js +158 -213
  17. package/dist/loading.js +3 -5
  18. package/dist/plugins/CellMergePlugin.d.ts +0 -2
  19. package/dist/plugins/CellSelectionPlugin.js +77 -117
  20. package/dist/plugins/CommandPlugin.js +3 -6
  21. package/dist/plugins/CopyPastePlugin.js +24 -37
  22. package/dist/plugins/DiffPlugin.js +33 -45
  23. package/dist/plugins/DragPlugin.d.ts +2 -2
  24. package/dist/plugins/DragPlugin.js +29 -45
  25. package/dist/plugins/EditablePlugin.js +88 -139
  26. package/dist/plugins/ExpandPlugin.js +26 -30
  27. package/dist/plugins/HistoryPlugin.js +16 -21
  28. package/dist/plugins/MenuPlugin.js +51 -76
  29. package/dist/plugins/RenderPlugin/components.js +45 -63
  30. package/dist/plugins/RenderPlugin/index.js +29 -42
  31. package/dist/plugins/ResizePlugin.js +44 -80
  32. package/dist/plugins/RowGroupPlugin.js +57 -73
  33. package/dist/plugins/RowSelectionPlugin.js +31 -42
  34. package/dist/plugins/VirtualScrollPlugin.js +54 -79
  35. package/dist/plus.js +3 -5
  36. package/dist/style.css +2 -192
  37. package/dist/utils.js +44 -65
  38. package/dist/wc.js +11 -11
  39. package/dist/x.js +3 -5
  40. package/package.json +2 -1
  41. package/dist/plugins/DragColumnPlugin.d.ts +0 -2
  42. package/dist/plugins/DragColumnPlugin.js +0 -4
package/dist/index.js CHANGED
@@ -19,109 +19,100 @@ import { combineProps } from "@solid-primitives/props";
19
19
  import { difference, mapValues, sumBy } from "es-toolkit";
20
20
  import { createElementSize, createResizeObserver } from "@solid-primitives/resize-observer";
21
21
  import { createScrollPosition } from "@solid-primitives/scroll";
22
- var _tmpl$ = /* @__PURE__ */ template(`<table>`), _tmpl$2 = /* @__PURE__ */ template(`<thead>`), _tmpl$3 = /* @__PURE__ */ template(`<tbody>`), _tmpl$4 = /* @__PURE__ */ template(`<tr>`), _tmpl$5 = /* @__PURE__ */ template(`<th>`), _tmpl$6 = /* @__PURE__ */ template(`<td>`), _tmpl$7 = /* @__PURE__ */ template(`<div><div class=data-table__layers></div><table class=data-table--table>`);
22
+ var _tmpl$ = /* @__PURE__ */ template("<table>"), _tmpl$2 = /* @__PURE__ */ template("<thead>"), _tmpl$3 = /* @__PURE__ */ template("<tbody>"), _tmpl$4 = /* @__PURE__ */ template("<tr>"), _tmpl$5 = /* @__PURE__ */ template("<th>"), _tmpl$6 = /* @__PURE__ */ template("<td>"), _tmpl$7 = /* @__PURE__ */ template("<div><div class=data-table__layers></div><table class=data-table--table>");
23
23
  const Ctx = createContext({
24
24
  props: {},
25
25
  store: {}
26
- });
27
- const Intable = (props) => {
28
- props = mergeProps$1({ rowKey: "id" }, props);
29
- const plugins = createMemo(() => [
26
+ }), Intable = (g) => {
27
+ g = mergeProps$1({ rowKey: "id" }, g);
28
+ let q = createMemo(() => [
30
29
  ...defaultsPlugins,
31
- ...props.plugins || [],
30
+ ...g.plugins || [],
32
31
  RenderPlugin
33
- ].sort((a, b) => (b.priority || 0) - (a.priority || 0)));
34
- const store = createMutable({
32
+ ].sort((g, G) => (G.priority || 0) - (g.priority || 0))), J = createMutable({
35
33
  get rawProps() {
36
- return props;
34
+ return g;
37
35
  },
38
36
  get plugins() {
39
- return plugins();
37
+ return q();
40
38
  }
41
- });
42
- const owner = getOwner();
43
- createComputed((old) => {
44
- const added = difference(plugins(), old);
45
- runWithOwner(owner, () => {
46
- added.forEach((e) => Object.assign(store, e.store?.(store)));
47
- });
48
- return plugins();
39
+ }), Y = getOwner();
40
+ createComputed((g) => {
41
+ let G = difference(q(), g);
42
+ return runWithOwner(Y, () => {
43
+ G.forEach((g) => Object.assign(J, g.store?.(J)));
44
+ }), q();
49
45
  }, []);
50
- const pluginsProps = mapArray(plugins, () => createSignal({}));
51
- createComputed(mapArray(plugins, (e, i) => {
52
- const prev = () => pluginsProps()[i() - 1]?.[0]() || props;
53
- const ret = mergeProps$1(prev, toReactive(mapValues(e.rewriteProps || {}, (v) => useMemo(() => v(prev(), { store })))));
54
- pluginsProps()[i()][1](ret);
46
+ let X = mapArray(q, () => createSignal({}));
47
+ createComputed(mapArray(q, (q, Y) => {
48
+ let Z = () => X()[Y() - 1]?.[0]() || g, Q = mergeProps$1(Z, toReactive(mapValues(q.rewriteProps || {}, (g) => useMemo(() => g(Z(), { store: J })))));
49
+ X()[Y()][1](Q);
55
50
  }));
56
- const mProps = toReactive(() => pluginsProps()[pluginsProps().length - 1][0]());
57
- store.props = mProps;
58
- onMount(() => {
59
- createEffect(mapArray(plugins, (e) => e.onMount?.(store)));
51
+ let Q = toReactive(() => X()[X().length - 1][0]());
52
+ J.props = Q, onMount(() => {
53
+ createEffect(mapArray(q, (g) => g.onMount?.(J)));
60
54
  });
61
- const ctx = createMutable({
62
- props: mProps,
63
- store
55
+ let $ = createMutable({
56
+ props: Q,
57
+ store: J
64
58
  });
65
- window.store = store;
66
- window.ctx = ctx;
67
- return createComponent(Ctx.Provider, {
68
- value: ctx,
59
+ return window.store = J, window.ctx = $, createComponent(Ctx.Provider, {
60
+ value: $,
69
61
  get children() {
70
- return createComponent(ctx.props.Table, { get children() {
62
+ return createComponent($.props.Table, { get children() {
71
63
  return [createComponent(THead, {}), createComponent(TBody, {})];
72
64
  } });
73
65
  }
74
66
  });
75
67
  };
76
68
  var THead = () => {
77
- const { props } = useContext(Ctx);
78
- return createComponent(props.Thead, { get children() {
79
- return createComponent(props.Tr, { get children() {
80
- return createComponent(props.EachCells, {
69
+ let { props: g } = useContext(Ctx);
70
+ return createComponent(g.Thead, { get children() {
71
+ return createComponent(g.Tr, { get children() {
72
+ return createComponent(g.EachCells, {
81
73
  get each() {
82
- return props.columns || [];
74
+ return g.columns || [];
83
75
  },
84
- children: (col, colIndex) => createComponent(props.Th, {
85
- col,
76
+ children: (G, K) => createComponent(g.Th, {
77
+ col: G,
86
78
  get x() {
87
- return colIndex();
79
+ return K();
88
80
  },
89
81
  get children() {
90
- return col.name;
82
+ return G.name;
91
83
  }
92
84
  })
93
85
  });
94
86
  } });
95
87
  } });
96
- };
97
- var TBody = () => {
98
- const { props } = useContext(Ctx);
99
- return createComponent(props.Tbody, { get children() {
100
- return createComponent(props.EachRows, {
88
+ }, TBody = () => {
89
+ let { props: g } = useContext(Ctx);
90
+ return createComponent(g.Tbody, { get children() {
91
+ return createComponent(g.EachRows, {
101
92
  get each() {
102
- return props.data;
93
+ return g.data;
103
94
  },
104
- children: (row, rowIndex) => createComponent(props.Tr, {
95
+ children: (G, K) => createComponent(g.Tr, {
105
96
  get y() {
106
- return rowIndex();
97
+ return K();
107
98
  },
108
- data: row,
99
+ data: G,
109
100
  get children() {
110
- return createComponent(props.EachCells, {
101
+ return createComponent(g.EachCells, {
111
102
  get each() {
112
- return props.columns;
103
+ return g.columns;
113
104
  },
114
- children: (col, colIndex) => createComponent(props.Td, {
115
- col,
105
+ children: (q, J) => createComponent(g.Td, {
106
+ col: q,
116
107
  get x() {
117
- return colIndex();
108
+ return J();
118
109
  },
119
110
  get y() {
120
- return rowIndex();
111
+ return K();
121
112
  },
122
- data: row,
113
+ data: G,
123
114
  get children() {
124
- return row[col.id];
115
+ return G[q.id];
125
116
  }
126
117
  })
127
118
  });
@@ -129,46 +120,33 @@ var TBody = () => {
129
120
  })
130
121
  });
131
122
  } });
132
- };
133
- var src_default = Intable;
123
+ }, src_default = Intable;
134
124
  function BasePlugin() {
135
- const omits = {
125
+ let G = {
136
126
  col: null,
137
127
  data: null
138
- };
139
- const table = (o) => (() => {
140
- var _el$ = _tmpl$();
141
- spread(_el$, o, false, false);
142
- return _el$;
143
- })();
144
- const thead = (o) => (() => {
145
- var _el$2 = _tmpl$2();
146
- spread(_el$2, o, false, false);
147
- return _el$2;
148
- })();
149
- const tbody = (o) => (() => {
150
- var _el$3 = _tmpl$3();
151
- spread(_el$3, o, false, false);
152
- return _el$3;
153
- })();
154
- const tr = (o) => (() => {
155
- var _el$4 = _tmpl$4();
156
- spread(_el$4, mergeProps(o, omits), false, false);
157
- return _el$4;
158
- })();
159
- const th = (o) => (() => {
160
- var _el$5 = _tmpl$5();
161
- spread(_el$5, mergeProps(o, omits), false, false);
162
- return _el$5;
163
- })();
164
- const td = (o) => (() => {
165
- var _el$6 = _tmpl$6();
166
- spread(_el$6, mergeProps(o, omits), false, false);
167
- return _el$6;
128
+ }, K = (g) => (() => {
129
+ var G = _tmpl$();
130
+ return spread(G, g, !1, !1), G;
131
+ })(), q = (g) => (() => {
132
+ var G = _tmpl$2();
133
+ return spread(G, g, !1, !1), G;
134
+ })(), J = (g) => (() => {
135
+ var G = _tmpl$3();
136
+ return spread(G, g, !1, !1), G;
137
+ })(), Y = (g) => (() => {
138
+ var K = _tmpl$4();
139
+ return spread(K, mergeProps(g, G), !1, !1), K;
140
+ })(), X = (g) => (() => {
141
+ var K = _tmpl$5();
142
+ return spread(K, mergeProps(g, G), !1, !1), K;
143
+ })(), Z = (g) => (() => {
144
+ var K = _tmpl$6();
145
+ return spread(K, mergeProps(g, G), !1, !1), K;
168
146
  })();
169
147
  return {
170
148
  priority: Infinity,
171
- store: (store) => ({
149
+ store: (g) => ({
172
150
  ths: [],
173
151
  thSizes: [],
174
152
  trs: [],
@@ -177,182 +155,149 @@ function BasePlugin() {
177
155
  raw: Symbol("raw")
178
156
  }),
179
157
  rewriteProps: {
180
- data: ({ data = [] }) => data,
181
- columns: ({ columns = [] }) => columns,
182
- newRow: ({ newRow = () => ({}) }) => newRow,
183
- Table: ({ Table = table }, { store }) => (o) => {
184
- const [el, setEl] = createSignal();
185
- const { props } = useContext(Ctx);
186
- o = combineProps({
187
- ref: setEl,
158
+ data: ({ data: g = [] }) => g,
159
+ columns: ({ columns: g = [] }) => g,
160
+ newRow: ({ newRow: g = () => ({}) }) => g,
161
+ Table: ({ Table: g = K }, { store: G }) => (G) => {
162
+ let [K, q] = createSignal(), { props: J } = useContext(Ctx);
163
+ return G = combineProps({
164
+ ref: q,
188
165
  get class() {
189
- return `data-table ${props.class} ${props.border && "data-table--border"} data-table--${props.size}`;
166
+ return `data-table ${J.class} ${J.border && "data-table--border"} data-table--${J.size}`;
190
167
  },
191
168
  get style() {
192
- return props.style;
169
+ return J.style;
193
170
  }
194
- }, o);
195
- return createComponent(Table, o);
196
- },
197
- Thead: ({ Thead = thead }, { store }) => (o) => {
198
- o = combineProps({ ref: (el) => store.thead = el }, o);
199
- return createComponent(Thead, o);
171
+ }, G), createComponent(g, G);
200
172
  },
201
- Tbody: ({ Tbody = tbody }, { store }) => (o) => {
202
- o = combineProps({ ref: (el) => store.tbody = el }, o);
203
- return createComponent(Tbody, o);
173
+ Thead: ({ Thead: g = q }, { store: G }) => (K) => (K = combineProps({ ref: (g) => G.thead = g }, K), createComponent(g, K)),
174
+ Tbody: ({ Tbody: g = J }, { store: G }) => (K) => (K = combineProps({ ref: (g) => G.tbody = g }, K), createComponent(g, K)),
175
+ Tr: ({ Tr: g = Y }, { store: G }) => (K) => {
176
+ let [q, J] = createSignal();
177
+ return K = combineProps({ ref: J }, K), createEffect(() => {
178
+ let { y: g } = K;
179
+ G.trs[g] = q(), G.trSizes[g] = createElementSize(q()), onCleanup(() => G.trSizes[g] = G.trs[g] = void 0);
180
+ }), createComponent(g, K);
204
181
  },
205
- Tr: ({ Tr = tr }, { store }) => (o) => {
206
- const [el, setEl] = createSignal();
207
- o = combineProps({ ref: setEl }, o);
208
- createEffect(() => {
209
- const { y } = o;
210
- store.trs[y] = el();
211
- store.trSizes[y] = createElementSize(el());
212
- onCleanup(() => store.trSizes[y] = store.trs[y] = void 0);
213
- });
214
- return createComponent(Tr, o);
215
- },
216
- Th: ({ Th = th }, { store }) => (o) => {
217
- const [el, setEl] = createSignal();
218
- const { props } = useContext(Ctx);
219
- const mProps = combineProps(o, { ref: setEl }, {
182
+ Th: ({ Th: G = X }, { store: K }) => (q) => {
183
+ let [J, Y] = createSignal(), { props: X } = useContext(Ctx), Z = combineProps(q, { ref: Y }, {
220
184
  get class() {
221
- return unFn(props.cellClass, o);
185
+ return unFn(X.cellClass, q);
222
186
  },
223
187
  get style() {
224
- return unFn(props.cellStyle, o);
188
+ return unFn(X.cellStyle, q);
225
189
  }
226
190
  }, {
227
191
  get class() {
228
- return o.col.class;
192
+ return q.col.class;
229
193
  },
230
194
  get style() {
231
- return o.col.style;
195
+ return q.col.style;
232
196
  }
233
197
  }, { get style() {
234
- return o.col.width ? `width: ${o.col.width}px` : "";
198
+ return q.col.width ? `width: ${q.col.width}px` : "";
235
199
  } });
236
- createEffect(() => {
237
- const { x } = o;
238
- store.ths[x] = el();
239
- store.thSizes[x] = createElementSize(el());
240
- onCleanup(() => store.thSizes[x] = store.ths[x] = void 0);
241
- });
242
- return createComponent(Th, mergeProps(mProps, { get children() {
243
- return o.children;
200
+ return createEffect(() => {
201
+ let { x: g } = q;
202
+ K.ths[g] = J(), K.thSizes[g] = createElementSize(J()), onCleanup(() => K.thSizes[g] = K.ths[g] = void 0);
203
+ }), createComponent(G, mergeProps(Z, { get children() {
204
+ return q.children;
244
205
  } }));
245
206
  },
246
- Td: ({ Td = td }, { store }) => (o) => {
247
- const { props } = useContext(Ctx);
248
- const mProps = combineProps(o, {
207
+ Td: ({ Td: G = Z }, { store: K }) => (K) => {
208
+ let { props: q } = useContext(Ctx), J = combineProps(K, {
249
209
  get class() {
250
- return unFn(props.cellClass, o);
210
+ return unFn(q.cellClass, K);
251
211
  },
252
212
  get style() {
253
- return unFn(props.cellStyle, o);
213
+ return unFn(q.cellStyle, K);
254
214
  }
255
215
  }, {
256
216
  get class() {
257
- return o.col.class;
217
+ return K.col.class;
258
218
  },
259
219
  get style() {
260
- return o.col.style;
220
+ return K.col.style;
261
221
  }
262
222
  }, { get style() {
263
- return o.col.width ? `width: ${o.col.width}px` : "";
223
+ return K.col.width ? `width: ${K.col.width}px` : "";
264
224
  } });
265
- return createComponent(Td, mergeProps(mProps, { get children() {
266
- return o.children;
225
+ return createComponent(G, mergeProps(J, { get children() {
226
+ return K.children;
267
227
  } }));
268
228
  },
269
- EachRows: ({ EachRows }) => EachRows || For,
270
- EachCells: ({ EachCells }) => EachCells || For,
271
- renderer: ({ renderer = (a) => a }) => renderer
229
+ EachRows: ({ EachRows: g }) => g || For,
230
+ EachCells: ({ EachCells: g }) => g || For,
231
+ renderer: ({ renderer: g = (g) => g }) => g
272
232
  }
273
233
  };
274
234
  }
275
235
  var IndexPlugin = {
276
- store: (store) => ({ $index: {
236
+ store: (g) => ({ $index: {
277
237
  name: "",
278
238
  id: Symbol("index"),
279
239
  fixed: "left",
280
- [store.internal]: 1,
240
+ [g.internal]: 1,
281
241
  width: 40,
282
242
  style: "text-align: center",
283
243
  class: "index",
284
- render: solidComponent((o) => memo(() => o.y + 1))
244
+ render: solidComponent((g) => memo(() => g.y + 1))
285
245
  } }),
286
- rewriteProps: { columns: (props, { store }) => store.props?.index ? [store.$index, ...props.columns || []] : props.columns }
287
- };
288
- var StickyHeaderPlugin = { rewriteProps: { Thead: ({ Thead }) => (o) => {
289
- const { props } = useContext(Ctx);
290
- o = combineProps({ get class() {
291
- return props.stickyHeader ? "sticky-header" : "";
292
- } }, o);
293
- return createComponent(Thead, o);
294
- } } };
295
- var FixedColumnPlugin = { rewriteProps: {
296
- columns: ({ columns }) => [
297
- ...columns?.filter((e) => e.fixed == "left") || [],
298
- ...columns?.filter((e) => !e.fixed) || [],
299
- ...columns?.filter((e) => e.fixed == "right") || []
246
+ rewriteProps: { columns: (g, { store: G }) => G.props?.index ? [G.$index, ...g.columns || []] : g.columns }
247
+ }, StickyHeaderPlugin = { rewriteProps: { Thead: ({ Thead: g }) => (G) => {
248
+ let { props: K } = useContext(Ctx);
249
+ return G = combineProps({ get class() {
250
+ return K.stickyHeader ? "sticky-header" : "";
251
+ } }, G), createComponent(g, G);
252
+ } } }, FixedColumnPlugin = { rewriteProps: {
253
+ columns: ({ columns: g }) => [
254
+ ...g?.filter((g) => g.fixed == "left") || [],
255
+ ...g?.filter((g) => !g.fixed) || [],
256
+ ...g?.filter((g) => g.fixed == "right") || []
300
257
  ],
301
- cellClass: ({ cellClass }) => (o) => (unFn(cellClass, o) || "") + (o.col.fixed ? ` fixed-${o.col.fixed}` : ""),
302
- cellStyle: ({ cellStyle }, { store }) => (o) => (unFn(cellStyle, o) || "") + (o.col.fixed ? `; ${o.col.fixed}: ${sumBy(store.thSizes.slice(o.col.fixed == "left" ? 0 : o.x + 1, o.col.fixed == "left" ? o.x : Infinity), (size) => size?.width || 0)}px` : "")
303
- } };
304
- var FitColWidthPlugin = {
258
+ cellClass: ({ cellClass: G }) => (K) => (unFn(G, K) || "") + (K.col.fixed ? ` fixed-${K.col.fixed}` : ""),
259
+ cellStyle: ({ cellStyle: G }, { store: K }) => (q) => (unFn(G, q) || "") + (q.col.fixed ? `; ${q.col.fixed}: ${sumBy(K.thSizes.slice(q.col.fixed == "left" ? 0 : q.x + 1, q.col.fixed == "left" ? q.x : Infinity), (g) => g?.width || 0)}px` : "")
260
+ } }, FitColWidthPlugin = {
305
261
  priority: -Infinity,
306
262
  rewriteProps: {
307
- Table: (prev, { store }) => (o) => {
308
- const size = createMutable({ width: 0 });
309
- createResizeObserver(() => store.scroll_el, (_, el, e) => size.width = e.contentBoxSize[0].inlineSize);
310
- createEffect(on(() => [size.width, prev.columns.map((e) => e.width)], async () => {
311
- if (!size.width) return;
312
- store.__fit_col_width__cols_temp = null;
313
- await Promise.resolve();
314
- const gap = (size.width - store.table.getBoundingClientRect().width) / store.props.columns.filter((e) => !e.width).length;
315
- store.__fit_col_width__cols_temp = store.props.columns.map((e, i) => e.width ? null : { width: Math.max((store.ths[i]?.getBoundingClientRect().width || 0) + gap, 80) });
316
- }));
317
- return createComponent(prev.Table, o);
263
+ Table: (g, { store: G }) => (K) => {
264
+ let q = createMutable({ width: 0 });
265
+ return createResizeObserver(() => G.scroll_el, (g, G, K) => q.width = K.contentBoxSize[0].inlineSize), createEffect(on(() => [q.width, g.columns.map((g) => g.width)], async () => {
266
+ if (!q.width) return;
267
+ G.__fit_col_width__cols_temp = null, await Promise.resolve();
268
+ let g = (q.width - G.table.getBoundingClientRect().width) / G.props.columns.filter((g) => !g.width).length;
269
+ G.__fit_col_width__cols_temp = G.props.columns.map((K, q) => K.width ? null : { width: Math.max((G.ths[q]?.getBoundingClientRect().width || 0) + g, 80) });
270
+ })), createComponent(g.Table, K);
318
271
  },
319
- columns: ({ columns }, { store }) => (columns = columns.map((e, i) => ({
320
- ...e,
321
- ...store.__fit_col_width__cols_temp?.[i],
322
- [store.raw]: e[store.raw] ?? e
323
- })), untrack(() => batch(() => reconcile(columns, { key: store.raw })(store.__fit_col_width__cols ??= []))))
272
+ columns: ({ columns: g }, { store: G }) => (g = g.map((g, K) => ({
273
+ ...g,
274
+ ...G.__fit_col_width__cols_temp?.[K],
275
+ [G.raw]: g[G.raw] ?? g
276
+ })), untrack(() => batch(() => reconcile(g, { key: G.raw })(G.__fit_col_width__cols ??= []))))
324
277
  }
325
278
  };
326
279
  const ScrollPlugin = {
327
280
  priority: Infinity,
328
- rewriteProps: { Table: (prev, { store }) => (o) => {
329
- const pos = createScrollPosition(() => store.scroll_el);
330
- const size = createElementSize(() => store.scroll_el);
331
- const clazz = createMemo(() => {
332
- const el = store.scroll_el;
333
- if (!el) return;
334
- const isleft = pos.x == 0;
335
- const isright = pos.x >= el.scrollWidth - (size.width || 0);
336
- return isleft && isright ? "" : !isleft && !isright ? "is-scroll-mid" : isleft ? "is-scroll-left" : isright ? "is-scroll-right" : "";
281
+ rewriteProps: { Table: (g, { store: G }) => (g) => {
282
+ let K = createScrollPosition(() => G.scroll_el), q = createElementSize(() => G.scroll_el), J = createMemo(() => {
283
+ let g = G.scroll_el;
284
+ if (!g) return;
285
+ let J = K.x == 0, Y = K.x >= g.scrollWidth - (q.width || 0);
286
+ return J && Y ? "" : !J && !Y ? "is-scroll-mid" : J ? "is-scroll-left" : Y ? "is-scroll-right" : "";
337
287
  });
338
- o = combineProps(o, {
339
- ref: (el) => store.scroll_el = el,
288
+ g = combineProps(g, {
289
+ ref: (g) => G.scroll_el = g,
340
290
  class: "data-table--scroll-view"
341
291
  }, { get class() {
342
- return clazz();
292
+ return J();
343
293
  } });
344
- const layers = mapArray(() => store.plugins.flatMap((e) => e.layers ?? []), (Layer) => createComponent(Layer, store));
294
+ let Y = mapArray(() => G.plugins.flatMap((g) => g.layers ?? []), (g) => createComponent(g, G));
345
295
  return (() => {
346
- var _el$7 = _tmpl$7(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
347
- spread(_el$7, o, false, true);
348
- insert(_el$8, layers);
349
- use((el) => store.table = el, _el$9);
350
- insert(_el$9, () => o.children);
351
- return _el$7;
296
+ var K = _tmpl$7(), q = K.firstChild, J = q.nextSibling;
297
+ return spread(K, g, !1, !0), insert(q, Y), use((g) => G.table = g, J), insert(J, () => g.children), K;
352
298
  })();
353
299
  } }
354
- };
355
- const defaultsPlugins = [
300
+ }, defaultsPlugins = [
356
301
  ScrollPlugin,
357
302
  BasePlugin(),
358
303
  CommandPlugin,
package/dist/loading.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import { spread, template } from "solid-js/web";
2
- var _tmpl$ = /* @__PURE__ */ template(`<svg width=1.2em height=1.2em xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"><g><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.14></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.29 transform="rotate(30 12 12)"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.43 transform="rotate(60 12 12)"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.57 transform="rotate(90 12 12)"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.71 transform="rotate(120 12 12)"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.86 transform="rotate(150 12 12)"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor transform="rotate(180 12 12)"></rect><animateTransform attributeName=transform calcMode=discrete dur=0.75s repeatCount=indefinite type=rotate values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12">`);
3
- var loading_default = (props = {}) => (() => {
4
- var _el$ = _tmpl$();
5
- spread(_el$, props, true, true);
6
- return _el$;
2
+ var _tmpl$ = /* @__PURE__ */ template("<svg width=1.2em height=1.2em xmlns=http://www.w3.org/2000/svg viewBox=\"0 0 24 24\"><g><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.14></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.29 transform=\"rotate(30 12 12)\"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.43 transform=\"rotate(60 12 12)\"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.57 transform=\"rotate(90 12 12)\"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.71 transform=\"rotate(120 12 12)\"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor opacity=.86 transform=\"rotate(150 12 12)\"></rect><rect width=2 height=5 x=11 y=1 fill=currentColor transform=\"rotate(180 12 12)\"></rect><animateTransform attributeName=transform calcMode=discrete dur=0.75s repeatCount=indefinite type=rotate values=\"0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12\">"), loading_default = (n = {}) => (() => {
3
+ var r = _tmpl$();
4
+ return spread(r, n, !0, !0), r;
7
5
  })();
8
6
  export { loading_default as default };
@@ -1,8 +1,6 @@
1
1
  import { type Plugin } from "../index";
2
2
  declare module '../index' {
3
3
  interface TableProps {
4
- colDrag: boolean;
5
- rowDrag: boolean;
6
4
  }
7
5
  interface TableColumn {
8
6
  }