intable 0.0.61 → 0.0.63

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.
@@ -17,6 +17,7 @@ export declare function useSelector<T = any>(opt: UseSelectorOpt<T>): {
17
17
  del: (v: T) => void;
18
18
  toggle: (v: T) => void;
19
19
  isAll: (data: T[]) => boolean;
20
+ isIndeterminate: (data: T[]) => boolean;
20
21
  selectAll: (data: T[]) => void;
21
22
  readonly value: T;
22
23
  };
@@ -50,17 +50,18 @@ function useSelector(o) {
50
50
  }, _ = (e) => {
51
51
  let i = u([...d()]);
52
52
  i.delete(e), s?.(c ? [...i] : [...i][0]);
53
- };
53
+ }, v = (e) => {
54
+ f(e) ? _(e) : g(e);
55
+ }, y = (e) => (e = e.filter((e) => p(e)), !!e.length && e.every((e) => f(e)));
54
56
  return {
55
57
  clear: m,
56
58
  set: h,
57
59
  has: f,
58
60
  add: g,
59
61
  del: _,
60
- toggle: (e) => {
61
- f(e) ? _(e) : g(e);
62
- },
63
- isAll: (e) => !!e.length && e.every((e) => f(e)),
62
+ toggle: v,
63
+ isAll: y,
64
+ isIndeterminate: (e) => (e = e.filter((e) => p(e)), !!e.length && !y(e) && e.some((e) => f(e))),
64
65
  selectAll: (e) => {
65
66
  let i = e.filter((e) => p(e));
66
67
  s?.(c ? i : i[0]);
package/dist/index.d.ts CHANGED
@@ -74,6 +74,9 @@ export interface TableProps {
74
74
  rowKey?: any;
75
75
  size?: string;
76
76
  loading?: boolean;
77
+ scroll?: {
78
+ x?: number | string;
79
+ };
77
80
  newRow?: (i: number) => any;
78
81
  Scroll?: Component<any>;
79
82
  Table?: Component<any>;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { renderComponent, solidComponent } from "./components/utils.js";
2
- import { unFn } from "./utils.js";
2
+ import { pxsuffix, unFn } from "./utils.js";
3
3
  import './style.css';;/* empty css */
4
4
  /* empty css */
5
5
  import { CellSelectionPlugin } from "./plugins/CellSelectionPlugin.js";
@@ -39,49 +39,49 @@ var _tmpl$ = /* @__PURE__ */ template("<div>"), _tmpl$2 = /* @__PURE__ */ templa
39
39
  const Ctx = createContext({
40
40
  props: {},
41
41
  store: {}
42
- }), Intable = (_) => {
43
- _ = mergeProps$1({ rowKey: "id" }, _);
44
- let K = getOwner(), J = createMutable({
42
+ }), Intable = (g) => {
43
+ g = mergeProps$1({ rowKey: "id" }, g);
44
+ let G = getOwner(), K = createMutable({
45
45
  get rawProps() {
46
- return _[$PROXY] ||= _;
46
+ return g[$PROXY] ||= g;
47
47
  },
48
48
  get plugins() {
49
- return X();
49
+ return Y();
50
50
  },
51
51
  owner: getOwner()
52
- }), Y = memoize((_) => runWithOwner(K, () => unFn(_, J))), X = createMemo((q) => {
53
- let X = uniq([
52
+ }), J = memoize((g) => runWithOwner(G, () => unFn(g, K))), Y = createMemo((q) => {
53
+ let Y = uniq([
54
54
  ...defaultsPlugins,
55
- ..._.plugins || [],
55
+ ...g.plugins || [],
56
56
  RenderPlugin
57
- ].flat().map(Y).sort((_, K) => (K.priority || 0) - (_.priority || 0))), Q = difference(X, q);
58
- return runWithOwner(K, () => {
59
- Q.forEach((_) => Object.assign(J, _.store?.(J)));
60
- }), X;
57
+ ].flat().map(J).sort((g, G) => (G.priority || 0) - (g.priority || 0))), X = difference(Y, q);
58
+ return runWithOwner(G, () => {
59
+ X.forEach((g) => Object.assign(K, g.store?.(K)));
60
+ }), Y;
61
61
  }, [], { equals: isEqual });
62
- J.props = (() => {
63
- let K = getOwner(), q = {}, Y = (_) => q[_] ??= runWithOwner(K, () => createMemo(() => Z(_)));
64
- function Z(K) {
65
- return createMemo(() => X().map((_) => _.rewriteProps?.[K]).filter((_) => _), void 0, { equals: isEqual })().reduce((_, q) => q({ [K]: _ }, { store: J }), _[K]);
62
+ K.props = (() => {
63
+ let G = getOwner(), q = {}, J = (g) => q[g] ??= runWithOwner(G, () => createMemo(() => X(g)));
64
+ function X(G) {
65
+ return createMemo(() => Y().map((g) => g.rewriteProps?.[G]).filter((g) => g), void 0, { equals: isEqual })().reduce((g, q) => q({ [G]: g }, { store: K }), g[G]);
66
66
  }
67
- return new Proxy({}, { get(_, K, q) {
68
- return K == $PROXY ? q : Y(K)();
67
+ return new Proxy({}, { get(g, G, K) {
68
+ return G == $PROXY ? K : J(G)();
69
69
  } });
70
- })(), createComputed(mapArray(X, (_) => _.onInit?.(J))), onMount(() => {
71
- createEffect(mapArray(X, (_) => _.onMount?.(J)));
70
+ })(), createComputed(mapArray(Y, (g) => g.onInit?.(K))), onMount(() => {
71
+ createEffect(mapArray(Y, (g) => g.onMount?.(K)));
72
72
  });
73
- let Q = createMutable({
74
- props: J.props,
75
- store: J
73
+ let X = createMutable({
74
+ props: K.props,
75
+ store: K
76
76
  });
77
- return window.store = J, window.ctx = Q, createRenderEffect(() => {
78
- let _ = J.props.store;
79
- _ && (typeof _ == "function" ? _(J) : "value" in _ ? _.value = J : "current" in _ && (_.current = J));
77
+ return window.store = K, window.ctx = X, createRenderEffect(() => {
78
+ let g = K.props.store;
79
+ g && (typeof g == "function" ? g(K) : "value" in g ? g.value = K : "current" in g && (g.current = K));
80
80
  }), createComponent(Ctx.Provider, {
81
- value: Q,
81
+ value: X,
82
82
  get children() {
83
- return createComponent(Q.props.Scroll, { get children() {
84
- return createComponent(Q.props.Table, { get children() {
83
+ return createComponent(X.props.Scroll, { get children() {
84
+ return createComponent(X.props.Table, { get children() {
85
85
  return [createComponent(THead, {}), createComponent(TBody, {})];
86
86
  } });
87
87
  } });
@@ -89,65 +89,65 @@ const Ctx = createContext({
89
89
  });
90
90
  };
91
91
  var THead = () => {
92
- let { props: K, store: q } = useContext(Ctx);
93
- return createComponent(K.Thead, { get children() {
94
- return createComponent(K.Tr, { get children() {
95
- return createComponent(K.EachCells, {
92
+ let { props: G, store: K } = useContext(Ctx);
93
+ return createComponent(G.Thead, { get children() {
94
+ return createComponent(G.Tr, { get children() {
95
+ return createComponent(G.EachCells, {
96
96
  get each() {
97
- return K.columns || [];
97
+ return G.columns || [];
98
98
  },
99
- children: (J, Y) => createComponent(K.Th, {
99
+ children: (q, J) => createComponent(G.Th, {
100
100
  get col() {
101
- return J();
101
+ return q();
102
102
  },
103
103
  get x() {
104
- return Y();
104
+ return J();
105
105
  },
106
106
  get children() {
107
- return renderComponent(J().name, void 0, q);
107
+ return renderComponent(q().name, void 0, K);
108
108
  }
109
109
  })
110
110
  });
111
111
  } });
112
112
  } });
113
113
  }, TBody = () => {
114
- let { props: _, store: K } = useContext(Ctx);
115
- return createComponent(_.Tbody, { get children() {
116
- return createComponent(_.EachRows, {
114
+ let { props: g, store: G } = useContext(Ctx);
115
+ return createComponent(g.Tbody, { get children() {
116
+ return createComponent(g.EachRows, {
117
117
  get each() {
118
- return _.data;
118
+ return g.data;
119
119
  },
120
- children: (q, J) => createComponent(_.Tr, {
120
+ children: (K, q) => createComponent(g.Tr, {
121
121
  get y() {
122
- return J();
122
+ return q();
123
123
  },
124
124
  get data() {
125
- return q();
125
+ return K();
126
126
  },
127
127
  get children() {
128
- return createComponent(_.EachCells, {
128
+ return createComponent(g.EachCells, {
129
129
  get each() {
130
- return _.columns;
130
+ return g.columns;
131
131
  },
132
- children: (Y, X) => createComponent(_.Td, {
132
+ children: (J, Y) => createComponent(g.Td, {
133
133
  get col() {
134
- return Y();
134
+ return J();
135
135
  },
136
136
  get x() {
137
- return X();
137
+ return Y();
138
138
  },
139
139
  get y() {
140
- return J();
140
+ return q();
141
141
  },
142
142
  get data() {
143
- return q();
143
+ return K();
144
144
  },
145
145
  get value() {
146
- return q()[Y().id];
146
+ return K()[J().id];
147
147
  },
148
- onChange: (_) => K.commands.rowChange({
149
- ...q(),
150
- [Y().id]: _
148
+ onChange: (g) => G.commands.rowChange({
149
+ ...K(),
150
+ [J().id]: g
151
151
  })
152
152
  })
153
153
  });
@@ -157,60 +157,60 @@ var THead = () => {
157
157
  } });
158
158
  }, src_default = Intable;
159
159
  function BasePlugin() {
160
- let _ = {
160
+ let g = {
161
161
  col: null,
162
162
  data: null,
163
163
  onChange: null
164
- }, K = (_) => (() => {
165
- var K = _tmpl$();
166
- return spread(K, _, !1, !1), K;
167
- })(), J = (_) => (() => {
168
- var K = _tmpl$2();
169
- return spread(K, _, !1, !1), K;
170
- })(), Y = (_) => (() => {
171
- var K = _tmpl$3();
172
- return spread(K, _, !1, !1), K;
173
- })(), X = (_) => (() => {
174
- var K = _tmpl$4();
175
- return spread(K, _, !1, !1), K;
176
- })(), Z = (K) => (() => {
177
- var q = _tmpl$5();
178
- return spread(q, mergeProps(K, _), !1, !1), q;
179
- })(), Q = (K) => (() => {
180
- var q = _tmpl$6();
181
- return spread(q, mergeProps(K, _), !1, !1), q;
182
- })(), $ = (K) => (() => {
183
- var q = _tmpl$7();
184
- return spread(q, mergeProps(K, _), !1, !1), q;
164
+ }, G = (g) => (() => {
165
+ var G = _tmpl$();
166
+ return spread(G, g, !1, !1), G;
167
+ })(), J = (g) => (() => {
168
+ var G = _tmpl$2();
169
+ return spread(G, g, !1, !1), G;
170
+ })(), Y = (g) => (() => {
171
+ var G = _tmpl$3();
172
+ return spread(G, g, !1, !1), G;
173
+ })(), X = (g) => (() => {
174
+ var G = _tmpl$4();
175
+ return spread(G, g, !1, !1), G;
176
+ })(), Z = (G) => (() => {
177
+ var K = _tmpl$5();
178
+ return spread(K, mergeProps(G, g), !1, !1), K;
179
+ })(), Q = (G) => (() => {
180
+ var K = _tmpl$6();
181
+ return spread(K, mergeProps(G, g), !1, !1), K;
182
+ })(), $ = (G) => (() => {
183
+ var K = _tmpl$7();
184
+ return spread(K, mergeProps(G, g), !1, !1), K;
185
185
  })();
186
186
  return {
187
187
  name: "base",
188
188
  priority: Infinity,
189
- store: (_) => {
190
- let K = makeResizeObserver((K) => {
189
+ store: (g) => {
190
+ let G = makeResizeObserver((G) => {
191
191
  batch(() => {
192
- for (let q of K) {
193
- let K = q.target, { inlineSize: J, blockSize: Y } = q.borderBoxSize[0], X = K.getAttribute("x");
194
- X >= 0 && K.parentElement && (_.thSizes[X] = {
195
- width: J,
196
- height: Y
192
+ for (let K of G) {
193
+ let G = K.target, { inlineSize: q, blockSize: J } = K.borderBoxSize[0], Y = G.getAttribute("x");
194
+ Y >= 0 && G.parentElement && (g.thSizes[Y] = {
195
+ width: q,
196
+ height: J
197
197
  });
198
198
  }
199
199
  });
200
- }), q = makeResizeObserver((K) => {
200
+ }), K = makeResizeObserver((G) => {
201
201
  batch(() => {
202
- for (let q of K) {
203
- let K = q.target, { inlineSize: J, blockSize: Y } = q.borderBoxSize[0], X = K.getAttribute("y");
204
- X >= 0 && K.parentElement && (_.trSizes[X] = {
205
- width: J,
206
- height: Y
202
+ for (let K of G) {
203
+ let G = K.target, { inlineSize: q, blockSize: J } = K.borderBoxSize[0], Y = G.getAttribute("y");
204
+ Y >= 0 && G.parentElement && (g.trSizes[Y] = {
205
+ width: q,
206
+ height: J
207
207
  });
208
208
  }
209
209
  });
210
210
  });
211
211
  return {
212
- thObs: K,
213
- trObs: q,
212
+ thObs: G,
213
+ trObs: K,
214
214
  ths: [],
215
215
  thSizes: [],
216
216
  trs: [],
@@ -221,148 +221,149 @@ function BasePlugin() {
221
221
  };
222
222
  },
223
223
  rewriteProps: {
224
- data: ({ data: _ = [] }) => _,
225
- columns: ({ columns: _ = [] }) => _,
226
- newRow: ({ newRow: _ }, { store: K }) => function() {
227
- let q = _?.(...arguments) || {};
228
- return q[K.props.rowKey] ??= Symbol(), q;
224
+ data: ({ data: g = [] }) => g,
225
+ columns: ({ columns: g = [] }) => g,
226
+ newRow: ({ newRow: g }, { store: G }) => function() {
227
+ let K = g?.(...arguments) || {};
228
+ return K[G.props.rowKey] ??= Symbol(), K;
229
229
  },
230
- Scroll: ({ Scroll: _ = K }, { store: q }) => (K) => {
231
- let J = createScrollPosition(() => q.scroll_el), Y = createElementSize(() => q.scroll_el), X = createMemo(() => {
232
- let _ = q.scroll_el;
233
- if (!_) return;
234
- let K = J.x == 0, X = J.x >= _.scrollWidth - (Y.width || 0);
235
- return K && X ? "" : !K && !X ? "is-scroll-mid" : K ? "is-scroll-left" : X ? "is-scroll-right" : "";
230
+ Scroll: ({ Scroll: g = G }, { store: K }) => (G) => {
231
+ let q = createScrollPosition(() => K.scroll_el), J = createElementSize(() => K.scroll_el), Y = createMemo(() => {
232
+ let g = K.scroll_el;
233
+ if (!g) return;
234
+ let G = q.x == 0, Y = q.x >= g.scrollWidth - (J.width || 0);
235
+ return G && Y ? "" : !G && !Y ? "is-scroll-mid" : G ? "is-scroll-left" : Y ? "is-scroll-right" : "";
236
236
  });
237
- K = combineProps(K, { get class() {
238
- return `data-table data-table--${q.props.size} flex flex-col`;
237
+ G = combineProps(G, { get class() {
238
+ return `data-table data-table--${K.props.size} flex flex-col`;
239
239
  } }, {
240
240
  get class() {
241
- return q.props.class;
241
+ return K.props.class;
242
242
  },
243
243
  get style() {
244
- return q.props.style;
244
+ return K.props.style;
245
245
  }
246
246
  }, { get class() {
247
- return X();
247
+ return Y();
248
248
  } });
249
- let Z = mapArray(() => q.plugins.flatMap((_) => _.layers ?? []), (_) => createComponent(_, q));
250
- return createComponent(_, mergeProps({ tabindex: -1 }, K, { get children() {
249
+ let X = mapArray(() => K.plugins.flatMap((g) => g.layers ?? []), (g) => createComponent(g, K));
250
+ return createComponent(g, mergeProps({ tabindex: -1 }, G, { get children() {
251
251
  return [
252
- createComponent(q.props.Header, {}),
252
+ createComponent(K.props.Header, {}),
253
253
  (() => {
254
- var _ = _tmpl$8();
255
- return insert(_, Z), _;
254
+ var g = _tmpl$8();
255
+ return insert(g, X), g;
256
256
  })(),
257
257
  (() => {
258
- var _ = _tmpl$();
259
- return use((_) => q.scroll_el = _, _), insert(_, () => K.children, null), insert(_, createComponent(q.props.ScrollFooter, {}), null), insert(_, (() => {
260
- var _ = memo(() => !q.props.data.length);
261
- return () => _() && _tmpl$9();
262
- })(), null), effect(() => className(_, `data-table--scroll-view relative h-full max-h-inherit flex-1 ${q.props.border && "data-table--border"}`)), _;
258
+ var g = _tmpl$();
259
+ return use((g) => K.scroll_el = g, g), insert(g, () => G.children, null), insert(g, createComponent(K.props.ScrollFooter, {}), null), insert(g, (() => {
260
+ var g = memo(() => !K.props.data.length);
261
+ return () => g() && _tmpl$9();
262
+ })(), null), effect(() => className(g, `data-table--scroll-view relative h-full max-h-inherit flex-1 ${K.props.border && "data-table--border"}`)), g;
263
263
  })(),
264
- createComponent(q.props.Footer, {})
264
+ createComponent(K.props.Footer, {})
265
265
  ];
266
266
  } }));
267
267
  },
268
- Header: ({ Header: _ }) => (_ ??= (_) => (() => {
269
- var K = _tmpl$();
270
- return spread(K, mergeProps(() => combineProps({ class: "data-table__header" }, _)), !1, !1), K;
271
- })(), (K) => createComponent(_, K)),
272
- Footer: ({ Footer: _ }) => (_ ??= (_) => (() => {
273
- var K = _tmpl$();
274
- return spread(K, mergeProps(() => combineProps({ class: "data-table__footer" }, _)), !1, !1), K;
275
- })(), (K) => createComponent(_, K)),
276
- ScrollFooter: ({ ScrollFooter: _ }) => (_ ??= (_) => (() => {
277
- var K = _tmpl$();
278
- return spread(K, mergeProps(() => combineProps({ class: "data-table__scroll__footer" }, _)), !1, !1), K;
279
- })(), (K) => createComponent(_, K)),
280
- Table: ({ Table: _ = J }, { store: K }) => (q) => (q = combineProps({
281
- ref: (_) => K.table = _,
282
- class: "data-table--table"
283
- }, q), createComponent(_, q)),
284
- Thead: ({ Thead: _ = Y }, { store: K }) => (q) => (q = combineProps({ ref: (_) => K.thead = _ }, q), createComponent(_, q)),
285
- Tbody: ({ Tbody: _ = X }, { store: K }) => (q) => (q = combineProps({ ref: (_) => K.tbody = _ }, q), createComponent(_, q)),
286
- Tr: ({ Tr: _ = Z }, { store: K }) => (J) => {
287
- let [Y, X] = createSignal(), Z = combineProps({
288
- ref: X,
268
+ Header: ({ Header: g }) => (g ??= (g) => (() => {
269
+ var G = _tmpl$();
270
+ return spread(G, mergeProps(() => combineProps({ class: "data-table__header" }, g)), !1, !1), G;
271
+ })(), (G) => createComponent(g, G)),
272
+ Footer: ({ Footer: g }) => (g ??= (g) => (() => {
273
+ var G = _tmpl$();
274
+ return spread(G, mergeProps(() => combineProps({ class: "data-table__footer" }, g)), !1, !1), G;
275
+ })(), (G) => createComponent(g, G)),
276
+ ScrollFooter: ({ ScrollFooter: g }) => (g ??= (g) => (() => {
277
+ var G = _tmpl$();
278
+ return spread(G, mergeProps(() => combineProps({ class: "data-table__scroll__footer" }, g)), !1, !1), G;
279
+ })(), (G) => createComponent(g, G)),
280
+ Table: ({ Table: g = J }, { store: G }) => (q) => (q = combineProps({
281
+ ref: (g) => G.table = g,
282
+ class: "data-table--table",
283
+ style: `width: ${pxsuffix(G.props.scroll?.x) ?? ""}`
284
+ }, q), createComponent(g, q)),
285
+ Thead: ({ Thead: g = Y }, { store: G }) => (K) => (K = combineProps({ ref: (g) => G.thead = g }, K), createComponent(g, K)),
286
+ Tbody: ({ Tbody: g = X }, { store: G }) => (K) => (K = combineProps({ ref: (g) => G.tbody = g }, K), createComponent(g, K)),
287
+ Tr: ({ Tr: g = Z }, { store: G }) => (K) => {
288
+ let [J, Y] = createSignal(), X = combineProps({
289
+ ref: Y,
289
290
  get class() {
290
- return J.y == null ? "" : unFn(K.props.rowClass, J);
291
+ return K.y == null ? "" : unFn(G.props.rowClass, K);
291
292
  },
292
293
  get style() {
293
- return J.y == null ? "" : unFn(K.props.rowStyle, J);
294
+ return K.y == null ? "" : unFn(G.props.rowStyle, K);
294
295
  },
295
- onClick: (_) => J.y != null && K.props.onRowClick?.(J.data, J.y, _)
296
- }, J);
296
+ onClick: (g) => K.y != null && G.props.onRowClick?.(K.data, K.y, g)
297
+ }, K);
297
298
  return createEffect(() => {
298
- let { y: _ } = J;
299
- _ != null && (K.trs[_] = Y(), K.trObs.observe(Y()), onCleanup(() => {
300
- K.trObs.unobserve(Y()), K.trs[_] = void 0, !(K.props.data.length > _) && (K.trSizes[_] = void 0);
299
+ let { y: g } = K;
300
+ g != null && (G.trs[g] = J(), G.trObs.observe(J()), onCleanup(() => {
301
+ G.trObs.unobserve(J()), G.trs[g] = void 0, !(G.props.data.length > g) && (G.trSizes[g] = void 0);
301
302
  }));
302
- }), createComponent(_, Z);
303
+ }), createComponent(g, X);
303
304
  },
304
- Th: ({ Th: _ = Q }, { store: K }) => (J) => {
305
- let [Y, X] = createSignal(), { props: Z } = useContext(Ctx), Q = combineProps(J, {
306
- ref: X,
305
+ Th: ({ Th: g = Q }, { store: G }) => (K) => {
306
+ let [J, Y] = createSignal(), { props: X } = useContext(Ctx), Z = combineProps(K, {
307
+ ref: Y,
307
308
  get class() {
308
- return [unFn(Z.cellClass, J), J.col.class].filter(Boolean).join(" ");
309
+ return [unFn(X.cellClass, K), K.col.class].filter(Boolean).join(" ");
309
310
  },
310
311
  get style() {
311
312
  return [
312
- unFn(Z.cellStyle, J),
313
- J.col.style,
314
- J.col.width && `width: ${J.col.width}px; min-width: ${J.col.width}px; max-width: ${J.col.width}px`
313
+ unFn(X.cellStyle, K),
314
+ K.col.style,
315
+ K.col.width && `width: ${K.col.width}px; min-width: ${K.col.width}px; max-width: ${K.col.width}px`
315
316
  ].filter(Boolean).join(";");
316
317
  }
317
318
  });
318
319
  return createEffect(() => {
319
- if (J.covered || (J.colspan ?? 1) != 1) return;
320
- let { x: _ } = J;
321
- K.ths[_] = Y(), K.thObs.observe(Y()), onCleanup(() => {
322
- K.thObs.unobserve(Y()), K.ths[_] = void 0, !(K.props.columns.length > _) && (K.thSizes[_] = void 0);
320
+ if (K.covered || (K.colspan ?? 1) != 1) return;
321
+ let { x: g } = K;
322
+ G.ths[g] = J(), G.thObs.observe(J()), onCleanup(() => {
323
+ G.thObs.unobserve(J()), G.ths[g] = void 0, !(G.props.columns.length > g) && (G.thSizes[g] = void 0);
323
324
  });
324
- }), createComponent(_, mergeProps(Q, { get children() {
325
- return J.children;
325
+ }), createComponent(g, mergeProps(Z, { get children() {
326
+ return K.children;
326
327
  } }));
327
328
  },
328
- Td: ({ Td: _ = $ }, { store: K }) => (K) => {
329
- let { props: J } = useContext(Ctx), Y = mergeProps$1(K, {
329
+ Td: ({ Td: g = $ }, { store: G }) => (G) => {
330
+ let { props: K } = useContext(Ctx), J = mergeProps$1(G, {
330
331
  get class() {
331
332
  return [
332
- unFn(J.cellClass, K),
333
- K.col.class,
334
- K.class
333
+ unFn(K.cellClass, G),
334
+ G.col.class,
335
+ G.class
335
336
  ].filter(Boolean).join(" ");
336
337
  },
337
338
  get style() {
338
339
  return [
339
- unFn(J.cellStyle, K),
340
- K.col.style,
341
- K.col.width && `width: ${K.col.width}px; min-width: ${K.col.width}px; max-width: ${K.col.width}px`,
342
- K.style
340
+ unFn(K.cellStyle, G),
341
+ G.col.style,
342
+ G.col.width && `width: ${G.col.width}px; min-width: ${G.col.width}px; max-width: ${G.col.width}px`,
343
+ G.style
343
344
  ].filter(Boolean).join(";");
344
345
  }
345
346
  });
346
- return createComponent(_, Y);
347
+ return createComponent(g, J);
347
348
  },
348
- EachRows: ({ EachRows: _ }) => _ || ((_) => createComponent(For, {
349
+ EachRows: ({ EachRows: g }) => g || ((g) => createComponent(For, {
349
350
  get each() {
350
- return _.each;
351
+ return g.each;
351
352
  },
352
- children: (K, q) => _.children(() => K, q)
353
+ children: (G, K) => g.children(() => G, K)
353
354
  })),
354
- EachCells: ({ EachCells: _ }) => _ || ((_) => createComponent(For, {
355
+ EachCells: ({ EachCells: g }) => g || ((g) => createComponent(For, {
355
356
  get each() {
356
- return _.each;
357
+ return g.each;
357
358
  },
358
- children: (K, q) => _.children(() => K, q)
359
+ children: (G, K) => g.children(() => G, K)
359
360
  })),
360
- renderer: ({ renderer: _ = (_) => _ }) => _
361
+ renderer: ({ renderer: g = (g) => g }) => g
361
362
  },
362
- layers: [function(_) {
363
- return memo(() => memo(() => !!_.props.loading)() ? (() => {
364
- var _ = _tmpl$0();
365
- return insert(_, createComponent(loading_bold_default, { class: "text-2xl animate-spin" })), _;
363
+ layers: [function(g) {
364
+ return memo(() => memo(() => !!g.props.loading)() ? (() => {
365
+ var g = _tmpl$0();
366
+ return insert(g, createComponent(loading_bold_default, { class: "text-2xl animate-spin" })), g;
366
367
  })() : null);
367
368
  }]
368
369
  };
@@ -374,30 +375,30 @@ const defaultsPlugins = [
374
375
  CellSelectionPlugin,
375
376
  {
376
377
  name: "sticky-header",
377
- rewriteProps: { Thead: ({ Thead: _ }) => (K) => {
378
- let { props: q } = useContext(Ctx);
379
- return K = combineProps({ get class() {
380
- return q.stickyHeader ? "sticky-header" : "";
381
- } }, K), createComponent(_, K);
378
+ rewriteProps: { Thead: ({ Thead: g }) => (G) => {
379
+ let { props: K } = useContext(Ctx);
380
+ return G = combineProps({ get class() {
381
+ return K.stickyHeader ? "sticky-header" : "";
382
+ } }, G), createComponent(g, G);
382
383
  } }
383
384
  },
384
385
  HeaderGroupPlugin,
385
- (_) => {
386
- let K = createLazyMemo(() => {
387
- let K = {};
388
- for (let [q, J] of _.props.columns.entries()) J.fixed === "left" && (K[q] = sumBy(_.thSizes.slice(0, q), (_) => _?.width || 0)), J.fixed === "right" && (K[q] = sumBy(_.thSizes.slice(q + 1), (_) => _?.width || 0));
389
- return K;
390
- }), J = createLazyMemo(() => _.props.columns.filter((_) => _.fixed == "left").length - 1), Y = createLazyMemo(() => _.props.columns.length - _.props.columns.filter((_) => _.fixed == "right").length);
386
+ (g) => {
387
+ let G = createLazyMemo(() => {
388
+ let G = {};
389
+ for (let [K, q] of g.props.columns.entries()) q.fixed === "left" && (G[K] = sumBy(g.thSizes.slice(0, K), (g) => g?.width || 0)), q.fixed === "right" && (G[K] = sumBy(g.thSizes.slice(K + 1), (g) => g?.width || 0));
390
+ return G;
391
+ }), K = createLazyMemo(() => g.props.columns.filter((g) => g.fixed == "left").length - 1), J = createLazyMemo(() => g.props.columns.length - g.props.columns.filter((g) => g.fixed == "right").length);
391
392
  return {
392
393
  name: "fixed-column",
393
394
  rewriteProps: {
394
- columns: ({ columns: _ }) => [
395
- ..._?.filter((_) => _.fixed == "left") || [],
396
- ..._?.filter((_) => !_.fixed) || [],
397
- ..._?.filter((_) => _.fixed == "right") || []
395
+ columns: ({ columns: g }) => [
396
+ ...g?.filter((g) => g.fixed == "left") || [],
397
+ ...g?.filter((g) => !g.fixed) || [],
398
+ ...g?.filter((g) => g.fixed == "right") || []
398
399
  ],
399
- cellClass: ({ cellClass: _ }) => (K) => (unFn(_, K) || "") + (K.col.fixed ? ` fixed-${K.col.fixed} ${K.x == J() ? "is-last" : ""} ${K.x == Y() ? "is-first" : ""}` : ""),
400
- cellStyle: ({ cellStyle: _ }) => (J) => (unFn(_, J) || "") + (J.col.fixed ? `; ${J.col.fixed}: ${K()[J.x]}px` : "")
400
+ cellClass: ({ cellClass: g }) => (G) => (unFn(g, G) || "") + (G.col.fixed ? ` fixed-${G.col.fixed} ${G.x == K() ? "is-last" : ""} ${G.x == J() ? "is-first" : ""}` : ""),
401
+ cellStyle: ({ cellStyle: g }) => (K) => (unFn(g, K) || "") + (K.col.fixed ? `; ${K.col.fixed}: ${G()[K.x]}px` : "")
401
402
  }
402
403
  };
403
404
  },
@@ -408,17 +409,17 @@ const defaultsPlugins = [
408
409
  {
409
410
  name: "index",
410
411
  priority: -Infinity,
411
- store: (_) => ({ $index: {
412
+ store: (g) => ({ $index: {
412
413
  name: "",
413
414
  id: Symbol("index"),
414
415
  fixed: "left",
415
- [_.internal]: 1,
416
+ [g.internal]: 1,
416
417
  width: 40,
417
418
  style: "text-align: center",
418
419
  class: "index",
419
- render: solidComponent((_) => memo(() => _.y + 1))
420
+ render: solidComponent((g) => memo(() => g.y + 1))
420
421
  } }),
421
- rewriteProps: { columns: ({ columns: _ }, { store: K }) => K.props?.index ? [K.$index, ..._ || []] : _ }
422
+ rewriteProps: { columns: ({ columns: g }, { store: G }) => G.props?.index ? [G.$index, ...g || []] : g }
422
423
  },
423
424
  FilterPlugin,
424
425
  SortPlugin,
@@ -428,11 +429,11 @@ const defaultsPlugins = [
428
429
  TreePlugin,
429
430
  {
430
431
  name: "fit-col-width",
431
- rewriteProps: { Table: ({ Table: _ }, { store: K }) => (q) => {
432
- let J = createMemo(() => K.props.columns.some((_) => !_.width));
433
- return q = combineProps(q, { get style() {
434
- return J() ? "min-width: 100%" : "min-width: unset";
435
- } }), createComponent(_, q);
432
+ rewriteProps: { Table: ({ Table: g }, { store: G }) => (K) => {
433
+ let q = createMemo(() => G.props.columns.some((g) => !g.width));
434
+ return K = combineProps(K, { get style() {
435
+ return q() ? "min-width: 100%" : "min-width: unset";
436
+ } }), createComponent(g, K);
436
437
  } }
437
438
  },
438
439
  RowGroupPlugin,
@@ -6,13 +6,17 @@ import { combineProps } from "@solid-primitives/props";
6
6
  var _tmpl$ = /* @__PURE__ */ template("<input type=checkbox>"), _tmpl$2 = /* @__PURE__ */ template("<div>"), _tmpl$3 = /* @__PURE__ */ template("<span>★"), _tmpl$4 = /* @__PURE__ */ template("<div><div class=\"flex-1 h-2 rd-full bg-gray-200 overflow-hidden\"><div class=\"h-full rd-full transition-all duration-300\"></div></div><span class=\"ml-1 text-11px c-gray-500 min-w-30px text-right\">%");
7
7
  const Checkbox = (e) => {
8
8
  let x;
9
- return [e, x] = splitProps(e, ["value", "onChange"]), x = combineProps({ get class() {
10
- return `you-checkbox ${e.value && "checked"}`;
9
+ return [e, x] = splitProps(e, [
10
+ "value",
11
+ "indeterminate",
12
+ "onChange"
13
+ ]), x = combineProps({ get class() {
14
+ return `you-checkbox ${e.value && "checked"} ${e.indeterminate && "indeterminate"}`;
11
15
  } }, x), (() => {
12
16
  var S = _tmpl$();
13
17
  return S.addEventListener("change", (x) => e.onChange?.(x.currentTarget.checked)), spread(S, mergeProps({ get checked() {
14
18
  return e.value || !1;
15
- } }, x), !1, !1), S;
19
+ } }, x), !1, !1), effect(() => S.indeterminate = !!e.indeterminate), S;
16
20
  })();
17
21
  }, Files = (e) => {
18
22
  let x;
@@ -17,6 +17,9 @@ const RowSelectionPlugin = {
17
17
  name: solidComponent((e) => c.props.rowSelection?.multiple && (() => {
18
18
  var e = _tmpl$();
19
19
  return insert(e, createComponent(Checkbox, {
20
+ get indeterminate() {
21
+ return c.commands.rowSelector.isIndeterminate(c.props.data);
22
+ },
20
23
  get value() {
21
24
  return c.commands.rowSelector.isAll(c.props.data);
22
25
  },
package/dist/style.css CHANGED
@@ -1,3 +1,3 @@
1
1
  @supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--un-bg-opacity:100%;--un-leading:initial;--un-content:"";--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-text-opacity:100%;--un-border-opacity:100%;--un-outline-opacity:100%;--un-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-border-top-opacity:100%;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1}}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-leading{syntax:"*";inherits:false}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow-color{syntax:"*";inherits:false}@property --un-ring-color{syntax:"*";inherits:false}@property --un-ring-inset{syntax:"*";inherits:false}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0}@property --un-scale-x{syntax:"*";inherits:false;initial-value:1}@property --un-scale-y{syntax:"*";inherits:false;initial-value:1}@property --un-scale-z{syntax:"*";inherits:false;initial-value:1}@property --un-numeric-figure{syntax:"*";inherits:false}@property --un-numeric-fraction{syntax:"*";inherits:false}@property --un-numeric-spacing{syntax:"*";inherits:false}@property --un-ordinal{syntax:"*";inherits:false}@property --un-slashed-zero{syntax:"*";inherits:false}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--fontWeight-semibold:600;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--leading-snug:1.375;--colors-gray-800:#1e2939;--colors-white:#fff;--colors-gray-100:#f3f4f6;--colors-gray-900:#101828;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-md:.375rem;--radius-xl:.75rem;--fontWeight-medium:500;--tracking-wide:.025em;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--radius-sm:.25rem;--leading-none:1;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--colors-gray-200:#e5e7eb;--colors-gray-500:#6a7282;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--colors-green-DEFAULT:#05df72;--colors-black:#000;--font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832677 -8.17474);--colors-gray-800:lab(16.1051% -1.18239 -11.7533);--colors-gray-100:lab(96.1596% -.082314 -1.13575);--colors-gray-900:lab(8.11897% .811271 -12.254);--colors-blue-DEFAULT:lab(65.0361% -1.42065 -56.9802);--colors-red-DEFAULT:lab(63.7053% 60.745 31.3109);--colors-gray-200:lab(91.6229% -.159115 -2.26791);--colors-gray-500:lab(47.7841% -.393182 -10.0268);--colors-green-DEFAULT:lab(78.503% -64.9264 39.7492)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-featureSettings,normal);font-variation-settings:var(--default-font-variationSettings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-monoFont-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-monoFont-featureSettings,normal);font-variation-settings:var(--default-monoFont-variationSettings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden~=until-found])){display:none!important}.container{width:100%}.aic{align-items:center}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.text-11px{font-size:11px}.text-2xl{font-size:var(--text-2xl-fontSize);line-height:var(--un-leading,var(--text-2xl-lineHeight))}.text-3{font-size:.75rem}.text-4{font-size:1rem}.text-sm{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight))}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\[--c-primary\]{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent)}.c-\#1e3a8a{color:color-mix(in oklab,#1e3a8a var(--un-text-opacity),transparent)}.c-\#7c2d12{color:color-mix(in oklab,#7c2d12 var(--un-text-opacity),transparent)}.c-blue{color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray-500{color:color-mix(in srgb,var(--colors-gray-500)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in srgb,var(--colors-red-DEFAULT)75%,transparent)}.leading-5{--un-leading:calc(4px*5);line-height:20px}.lh-\[1\]{--un-leading:1;line-height:1}.lh-none{--un-leading:var(--leading-none);line-height:var(--leading-none)}.tracking-wide{--un-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.font-mono{font-family:var(--font-mono)}.font-semibold{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold)}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-2{margin-inline:8px}.mx-3\!{margin-inline:12px!important}.my-1{margin-block:4px}.ml{margin-left:16px}.ml-\.5{margin-left:2px}.ml-1{margin-left:4px}.mr--1{margin-right:-4px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-2\.5{margin-right:10px}.mt-1{margin-top:4px}.p-0\!{padding:0!important}.p-1{padding:4px}.p-4\!{padding:16px!important}.px,.px-4{padding-inline:16px}.px-1{padding-inline:4px}.px-1\.5{padding-inline:6px}.px-2{padding-inline:8px}.px-3{padding-inline:12px}.py-1{padding-block:4px}.py-1\.5{padding-block:6px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pl-4{padding-left:16px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.text-center{text-align:center}.text-right{text-align:right}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-1\.5px{outline-style:var(--un-outline-style);outline-width:1.5px}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-\[--c-primary\]{outline-color:color-mix(in oklab,var(--c-primary)var(--un-outline-opacity),transparent)}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.outline-none{--un-outline-style:none;outline-style:none}.outline-solid{--un-outline-style:solid;outline-style:solid}.b,.b-1,.border{border-width:1px}.b-2px{border-width:2px}.b-r-0{border-right-width:0}.b-\[--table-bg\]{border-color:color-mix(in oklab,var(--table-bg)var(--un-border-opacity),transparent)}.b-\#00000000\!{border-color:color-mix(in oklab,#0000 var(--un-border-opacity),transparent)!important}.b-\#4f7ff0{border-color:color-mix(in oklab,#4f7ff0 var(--un-border-opacity),transparent)}.b-\#f59e0b{border-color:color-mix(in oklab,#f59e0b var(--un-border-opacity),transparent)}.rd-1{border-radius:.25rem}.rd-1\.5{border-radius:.375rem}.rd-2{border-radius:.5rem}.rd-full{border-radius:3.40282e38px}.rd-sm{border-radius:var(--radius-sm)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rd-l-4{border-top-left-radius:1rem;border-bottom-left-radius:1rem}.b-dashed{--un-border-style:dashed;border-style:dashed}.b-solid{--un-border-style:solid;border-style:solid}.bg-\[--bg\]{background-color:color-mix(in oklab,var(--bg)var(--un-bg-opacity),transparent)}.bg-\[--c-primary\]{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.bg-\[--table-bg\]{background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent)}.bg-\[--table-header-bg\]{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.bg-\#dbe6ff\/75{background-color:#dbe6ffbf;background-color:lab(91.0303% -.143617 -13.4803/.75)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-\#fff3d6\/85{background-color:#fff3d6d9;background-color:lab(96.236% .744313 15.5662/.85)}.bg-blue\/20\!{background-color:color-mix(in srgb,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray-200{background-color:color-mix(in srgb,var(--colors-gray-200)var(--un-bg-opacity),transparent)}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in srgb,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in srgb,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-transparent{background-color:#0000}.hover\:bg-\[--li-hover-bg\]:hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.hover\:bg-black\/8:hover{background-color:color-mix(in srgb,var(--colors-black)8%,transparent)}.op-0{opacity:0}.op-15{opacity:.15}.op-60{opacity:.6}.op-75{opacity:.75}.op40{opacity:.4}.opacity-50{opacity:.5}.group:hover .group-hover\:op-100{opacity:1}.disabled\:op-30:disabled{opacity:.3}.hover\:underline:hover{text-decoration-line:underline}.flex{display:flex}.inline-flex{display:inline-flex}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-0\.5{gap:2px}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-2{gap:8px}.grid{display:grid}.size-3\.5{width:14px;height:14px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-2{height:8px}.h-2\.5{height:10px}.h-3\.5{height:14px}.h-5{height:20px}.h-6{height:24px}.h-6\.5{height:26px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.max-h-60{max-height:240px}.max-h-inherit{max-height:inherit}.min-h-16{min-height:64px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.min-w-24{min-width:96px}.min-w-30px{min-width:30px}.min-w-44{min-width:176px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-2\.5{width:10px}.w-3\.5{width:14px}.w-6\.5{width:26px}.w-8\!{width:32px!important}.w-a\!{width:auto!important}.w-full{width:100%}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.contents{display:contents}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-pointer{cursor:pointer}.cursor-crosshair{cursor:crosshair}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.uppercase{text-transform:uppercase}.shadow-sm{--un-shadow:0 1px 3px 0 var(--un-shadow-color,#0000001a),0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl{--un-shadow:0 20px 25px -5px var(--un-shadow-color,#0000001a),0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.translate-x--1\/2{--un-translate-x:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-y--1\/2{--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.hover\:scale-110:hover{--un-scale-x:110%;--un-scale-y:110%;scale:var(--un-scale-x)var(--un-scale-y)}.transform{transform:var(--un-rotate-x)var(--un-rotate-y)var(--un-rotate-z)var(--un-skew-x)var(--un-skew-y)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,--un-gradient-from,--un-gradient-via,--un-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.duration-300{--un-duration:.3s;transition-duration:.3s}.items-start{align-items:flex-start}.items-center{align-items:center}.box-border{box-sizing:border-box}.inset-0{inset:0}.bottom-0{bottom:0}.left--0,.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.justify-end{justify-content:flex-end}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.z--1{z-index:-1}.z-1{z-index:1}.z-2{z-index:2}.z-9{z-index:9}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.of-y-auto{overflow-y:auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.filter{filter:var(--un-blur,)var(--un-brightness,)var(--un-contrast,)var(--un-grayscale,)var(--un-hue-rotate,)var(--un-invert,)var(--un-saturate,)var(--un-sepia,)var(--un-drop-shadow,)}.table{display:table}.table-cell{display:table-cell}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal,)var(--un-slashed-zero,)var(--un-numeric-figure,)var(--un-numeric-spacing,)var(--un-numeric-fraction,)}:where(.space-y-5>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*5)*calc(1 - var(--un-space-y-reverse)))}@supports (color:color-mix(in lab, red, red)){.c-blue{color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray-500{color:color-mix(in oklab,var(--colors-gray-500)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in oklab,var(--colors-red-DEFAULT)75%,transparent)}.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-blue\/20\!{background-color:color-mix(in oklab,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray-200{background-color:color-mix(in oklab,var(--colors-gray-200)var(--un-bg-opacity),transparent)}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in oklab,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in oklab,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.hover\:bg-black\/8:hover{background-color:color-mix(in oklab,var(--colors-black)8%,transparent)}}
2
2
 
3
- .data-table{--bg:#fff;--c-primary:#51a2ff;--menu-bg:#fff;--li-hover-bg:#99a1af33;--table-b:1px solid var(--table-b-c);--table-b-c:#ebeef5;--table-c:#606266;--table-bg:#fff;--table-header-c:#909399;--table-header-bg:var(--table-bg);--table-row-hover-bg:#f5f7fa;--select-area-bg:#5292f71a;color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent);font-size:14px;position:relative}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table--table{color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);outline-style:var(--un-outline-style);border-collapse:collapse;table-layout:fixed;border-collapse:separate;border-spacing:0;border-width:0;outline-width:0;width:auto}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}.data-table thead{color:color-mix(in oklab,var(--table-header-c)var(--un-text-opacity),transparent)}.data-table tr:hover>td{background-color:color-mix(in oklab,var(--table-row-hover-bg)var(--un-bg-opacity),transparent)}.data-table th{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.data-table td{background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent)}.data-table td,.data-table th{vertical-align:middle;outline-style:var(--un-outline-style);border-width:0;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);--un-border-style:solid;box-sizing:border-box;text-align:inherit;background-image:linear-gradient(var(--table-b-c),var(--table-b-c));background-position:100% 100%,100% 0;background-repeat:no-repeat;background-size:100% 1px,1px 100%;border-style:solid;outline-width:0;padding-block:2px;padding-inline:8px}.data-table td:empty:after{content:"ㅤ"!important}.data-table--border{outline-style:var(--un-outline-style);outline-width:1px;outline-color:color-mix(in oklab,var(--table-b-c)var(--un-outline-opacity),transparent);--un-outline-style:solid;outline-style:solid}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table--border th,.data-table--border td{background-image:linear-gradient(var(--table-b-c),var(--table-b-c)),linear-gradient(var(--table-b-c),var(--table-b-c))}.data-table__empty{--un-leading:calc(4px*15);opacity:.4;justify-content:center;align-items:center;width:100%;line-height:60px;display:flex;position:sticky;left:0}@property --un-leading{syntax:"*";inherits:false}.data-table--scroll-view{overflow:auto}.data-table__layers{pointer-events:none;z-index:99;position:absolute;inset:0}.data-table__layers>*{position:absolute}.data-table__loading{background-color:color-mix(in oklab,var(--table-bg)70%,transparent);pointer-events:auto;z-index:99;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.data-table__load-more{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent);text-align:center;padding-block:8px;font-size:.75rem}@supports (color:color-mix(in lab, red, red)){.data-table__load-more{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}}.data-table__pagination{color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);border-top-width:1px;border-top-color:color-mix(in oklab,var(--table-b-c)var(--un-border-top-opacity),transparent);--un-border-top-opacity:var(--un-border-opacity);--un-border-style:solid;border-top-style:solid}@property --un-border-top-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table__pagination-btn{background-color:color-mix(in oklab,var(--table-row-hover-bg)var(--un-bg-opacity),transparent);cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:.25rem;min-width:28px;padding-block:4px;padding-inline:8px}.data-table__pagination-btn:not(:disabled):hover{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent);background-color:color-mix(in oklab,var(--c-primary)20%,transparent)}.data-table__pagination-btn.is-active{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold);color:color-mix(in srgb,var(--colors-white)var(--un-text-opacity),transparent)!important;background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)!important}@supports (color:color-mix(in lab, red, red)){.data-table__pagination-btn.is-active{color:color-mix(in oklab,var(--colors-white)var(--un-text-opacity),transparent)!important}}.data-table--small .data-table__pagination{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight));padding-block:4px}.data-table--small .data-table__pagination-btn{border-radius:.1875rem;min-width:24px;padding-block:4px;padding-inline:6px}.data-table__footer{flex-shrink:0}.range-selected{position:relative}.range-selected>.area{border-width:0;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--select-area-bg)var(--un-bg-opacity),transparent);pointer-events:none;border-style:solid;position:absolute;inset:0}.range-selected-l>.area{border-left-width:1.5px}.range-selected-r>.area{border-right-width:1.5px}.range-selected-t>.area{border-top-width:1.5px}.range-selected-b>.area{border-bottom-width:1.5px}.row-range-highlight,.col-range-highlight{position:relative}.row-range-highlight>.area,.col-range-highlight>.area{border-width:0;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--c-primary)10%,transparent);pointer-events:none;border-style:solid;position:absolute;inset:0}.row-range-highlight.index>.area{border-right-width:1px}.col-range-highlight>.area{border-bottom-width:1px}.sticky-header{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent);z-index:9;position:sticky;top:0}.sticky-header:after{pointer-events:none;--un-content:"";content:var(--un-content);width:100%;height:10px;position:absolute;top:100%;box-shadow:inset 0 10px 10px -10px #00000026}@property --un-content{syntax:"*";inherits:false;initial-value:""}.fixed-left,.fixed-right{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent);z-index:2;position:sticky!important}.fixed-left.is-first:after,.fixed-left.is-last:after,.fixed-right.is-first:after,.fixed-right.is-last:after{pointer-events:none;--un-content:"";content:var(--un-content);width:10px;height:100%;position:absolute;top:0}.is-scroll-right .fixed-left.is-last:after,.is-scroll-mid .fixed-left.is-last:after{left:100%;box-shadow:inset 10px 0 10px -10px #00000026}.is-scroll-left .fixed-right.is-first:after,.is-scroll-mid .fixed-right.is-first:after{right:100%;box-shadow:inset -10px 0 10px -10px #00000026}.filter-input{--un-outline-style:none;border-width:1px;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);border-radius:var(--radius-DEFAULT);box-sizing:border-box;outline-style:none;width:100%;margin-top:4px;padding-inline:6px;font-family:inherit;font-size:12px;display:block}.filter-input:focus{border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent)}.filter-input::placeholder{opacity:.3}.in-input{--un-outline-style:none;border-width:1px;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);border-radius:var(--radius-DEFAULT);box-sizing:border-box;outline-style:none;padding-block:2px;padding-inline:6px;font-family:inherit;font-size:12px}.in-input:focus{border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent)}.in-input::placeholder{opacity:.3}.copied .range-selected>.area{border-style:dashed}.data-table.virtual{display:block;overflow:auto}.data-table.virtual thead{width:fit-content;display:block}.data-table.virtual thead>tr{display:flex}.data-table.virtual thead>tr>th{flex:none;display:block}.data-table.virtual tbody{width:fit-content;display:block}.data-table.virtual tbody>tr{display:flex}.data-table.virtual tbody>tr>td{flex:none;display:block}.row-selection{width:40px;position:relative}.row-selection>label{justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;inset:0}.icon-clickable{box-sizing:border-box;border-radius:.25rem;justify-content:center;align-items:center;width:20px;height:20px;padding:2px;display:flex}.icon-clickable:hover{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent)}@supports (color:color-mix(in lab, red, red)){.icon-clickable:hover{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}.icon-clickable>svg{width:100%;height:100%}input[type=checkbox].you-checkbox{color:color-mix(in oklab,#2196f3 var(--un-text-opacity),transparent);appearance:none;outline-offset:0px;--un-border-style:solid;border:2px solid;border-radius:.25rem;width:16px;height:16px;margin:4px;position:relative}input[type=checkbox].you-checkbox:focus{outline-style:var(--un-outline-style);--un-outline-style:solid;outline:4px solid oklab(65.8156% -.0610627 -.157539/.4)}input[type=checkbox].you-checkbox.checked{background-color:currentColor}input[type=checkbox].you-checkbox.checked:after{color:color-mix(in oklab,#fff var(--un-text-opacity),transparent);--un-content:"✓";content:var(--un-content);--un-translate-x:-50%;--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y);z-index:1;font-size:.75rem;position:absolute;top:50%;left:50%}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0}td.is-editing{position:relative}td.is-invalid{outline-offset:-1.5px;outline:1.5px solid #ff4d4f;position:relative}.in-cell-edit-wrapper{z-index:1;position:absolute;inset:0;box-shadow:0 0 10px -2px #00000050}.cell-validating{border-width:2px;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);pointer-events:none;--un-translate-y:-50%;width:12px;height:12px;translate:var(--un-translate-x)var(--un-translate-y);border-top-color:#0000;border-radius:3.40282e38px;animation:1s linear infinite spin;display:block;position:absolute;top:50%;right:4px}.cell-validation-error{z-index:2;color:#ff4d4f;white-space:nowrap;pointer-events:none;background:#fff1f0;border:1px solid #ffccc7;border-radius:4px;padding:2px 8px;font-size:12px;position:absolute;top:100%;left:0;box-shadow:0 2px 8px #00000020}.cell-validation-error:empty{display:none}.in-cell__resize-handle{width:100%;height:100%;position:absolute}.in-cell__resize-handle:hover:after{background-color:color-mix(in oklab,var(--c-primary)40%,transparent)}.in-cell__resize-handle:active:after{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.in-cell__resize-handle:after{--un-content:"";content:var(--un-content)}.li{cursor:pointer;position:relative}.li:hover,.li.hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.li:active:before,.li.selected:before,.li.active:before{content:"";border-radius:inherit;background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)15%,transparent);pointer-events:none;position:absolute;inset:0}@supports (color:color-mix(in lab, red, red)){.li:active:before,.li.selected:before,.li.active:before{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)15%,transparent)}}.li.disabled,.li[disabled]{opacity:.4}.tt-menu{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight));border-width:1px;border-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--menu-bg)var(--un-bg-opacity),transparent);cursor:default;--un-shadow:0 10px 15px -3px var(--un-shadow-color,#0000001a),0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-style:solid;border-radius:.5rem;padding-block:4px}@supports (color:color-mix(in lab, red, red)){.tt-menu{border-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@property --un-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow-color{syntax:"*";inherits:false}@property --un-ring-color{syntax:"*";inherits:false}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-inset{syntax:"*";inherits:false}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}:where(.tt-menu>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*.5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*.5)*calc(1 - var(--un-space-y-reverse)))}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}.tt-menu-x{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight));border-width:1px;border-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--menu-bg)var(--un-bg-opacity),transparent);cursor:default;--un-shadow:0 10px 15px -3px var(--un-shadow-color,#0000001a),0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-style:solid;border-radius:.5rem;padding-inline:4px}@supports (color:color-mix(in lab, red, red)){.tt-menu-x{border-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}:where(.tt-menu-x>:not(:last-child)){--un-space-x-reverse:0;margin-inline-start:calc(calc(4px*.5)*var(--un-space-x-reverse));margin-inline-end:calc(calc(4px*.5)*calc(1 - var(--un-space-x-reverse)))}@property --un-space-x-reverse{syntax:"*";inherits:false;initial-value:0}.tt-menu-x>.hr{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);width:1px;margin-block:6px}@supports (color:color-mix(in lab, red, red)){.tt-menu-x>.hr{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}.in-tooltip{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight));color:color-mix(in srgb,var(--colors-white)var(--un-text-opacity),transparent);--un-leading:var(--leading-snug);line-height:var(--leading-snug);background-color:color-mix(in srgb,var(--colors-gray-800)var(--un-bg-opacity),transparent);-webkit-user-select:text;user-select:text;overflow-wrap:break-word;--un-shadow:0 4px 6px -1px var(--un-shadow-color,#0000001a),0 2px 4px -2px var(--un-shadow-color,#0000001a);width:max-content;box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);z-index:50;border-radius:.25rem;padding-block:8px;padding-inline:12px;animation:.15s both in-tooltip-in;position:relative}@supports (color:color-mix(in lab, red, red)){.in-tooltip{color:color-mix(in oklab,var(--colors-white)var(--un-text-opacity),transparent);background-color:color-mix(in oklab,var(--colors-gray-800)var(--un-bg-opacity),transparent)}}.dark .in-tooltip{color:color-mix(in srgb,var(--colors-gray-900)var(--un-text-opacity),transparent);background-color:color-mix(in srgb,var(--colors-gray-100)var(--un-bg-opacity),transparent)}@supports (color:color-mix(in lab, red, red)){.dark .in-tooltip{color:color-mix(in oklab,var(--colors-gray-900)var(--un-text-opacity),transparent);background-color:color-mix(in oklab,var(--colors-gray-100)var(--un-bg-opacity),transparent)}}.in-tooltip:before{background-color:inherit;--un-content:"";content:var(--un-content);width:8px;height:8px;position:absolute;rotate:45deg}.in-tooltip[data-placement=top]:before{bottom:-4px;left:calc(50% - 4px)}.in-tooltip[data-placement=bottom]:before{top:-4px;left:calc(50% - 4px)}.in-tooltip[data-placement=left]:before{top:calc(50% - 4px);right:-4px}.in-tooltip[data-placement=right]:before{top:calc(50% - 4px);left:-4px}.in-tooltip[data-placement=top-start]:before{bottom:-4px;left:12px}.in-tooltip[data-placement=top-end]:before{bottom:-4px;right:12px}.in-tooltip[data-placement=bottom-start]:before{top:-4px;left:12px}.in-tooltip[data-placement=bottom-end]:before{top:-4px;right:12px}@keyframes in-tooltip-in{0%{opacity:0}to{opacity:1}}.col__guide-line,.row__guide-line{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent);pointer-events:none;z-index:9;position:fixed;top:0;left:0}th[draggable=true],td[draggable=true]{cursor:move}.input-no-spin::-webkit-outer-spin-button{appearance:none}.input-no-spin::-webkit-inner-spin-button{appearance:none}.branch-graph-col{padding:0;overflow:hidden}.branch-graph-svg{display:block}.branch-graph-wrap{position:relative}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
3
+ .data-table{--bg:#fff;--c-primary:#51a2ff;--menu-bg:#fff;--li-hover-bg:#99a1af33;--table-b:1px solid var(--table-b-c);--table-b-c:#ebeef5;--table-c:#606266;--table-bg:#fff;--table-header-c:#909399;--table-header-bg:var(--table-bg);--table-row-hover-bg:#f5f7fa;--select-area-bg:#5292f71a;color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent);font-size:14px;position:relative}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table--table{color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);outline-style:var(--un-outline-style);border-collapse:collapse;table-layout:fixed;border-collapse:separate;border-spacing:0;border-width:0;outline-width:0;width:auto}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}.data-table thead{color:color-mix(in oklab,var(--table-header-c)var(--un-text-opacity),transparent)}.data-table tr:hover>td{background-color:color-mix(in oklab,var(--table-row-hover-bg)var(--un-bg-opacity),transparent)}.data-table th{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.data-table td{background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent)}.data-table td,.data-table th{vertical-align:middle;outline-style:var(--un-outline-style);border-width:0;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);--un-border-style:solid;box-sizing:border-box;text-align:inherit;background-image:linear-gradient(var(--table-b-c),var(--table-b-c));background-position:100% 100%,100% 0;background-repeat:no-repeat;background-size:100% 1px,1px 100%;border-style:solid;outline-width:0;padding-block:2px;padding-inline:8px}.data-table td:empty:after{content:"ㅤ"!important}.data-table--border{outline-style:var(--un-outline-style);outline-width:1px;outline-color:color-mix(in oklab,var(--table-b-c)var(--un-outline-opacity),transparent);--un-outline-style:solid;outline-style:solid}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table--border th,.data-table--border td{background-image:linear-gradient(var(--table-b-c),var(--table-b-c)),linear-gradient(var(--table-b-c),var(--table-b-c))}.data-table__empty{--un-leading:calc(4px*15);opacity:.4;justify-content:center;align-items:center;width:100%;line-height:60px;display:flex;position:sticky;left:0}@property --un-leading{syntax:"*";inherits:false}.data-table--scroll-view{overflow:auto}.data-table__layers{pointer-events:none;z-index:99;position:absolute;inset:0}.data-table__layers>*{position:absolute}.data-table__loading{background-color:color-mix(in oklab,var(--table-bg)70%,transparent);pointer-events:auto;z-index:99;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.data-table__load-more{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent);text-align:center;padding-block:8px;font-size:.75rem}@supports (color:color-mix(in lab, red, red)){.data-table__load-more{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}}.data-table__pagination{color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);border-top-width:1px;border-top-color:color-mix(in oklab,var(--table-b-c)var(--un-border-top-opacity),transparent);--un-border-top-opacity:var(--un-border-opacity);--un-border-style:solid;border-top-style:solid}@property --un-border-top-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table__pagination-btn{background-color:color-mix(in oklab,var(--table-row-hover-bg)var(--un-bg-opacity),transparent);cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:.25rem;min-width:28px;padding-block:4px;padding-inline:8px}.data-table__pagination-btn:not(:disabled):hover{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent);background-color:color-mix(in oklab,var(--c-primary)20%,transparent)}.data-table__pagination-btn.is-active{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold);color:color-mix(in srgb,var(--colors-white)var(--un-text-opacity),transparent)!important;background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)!important}@supports (color:color-mix(in lab, red, red)){.data-table__pagination-btn.is-active{color:color-mix(in oklab,var(--colors-white)var(--un-text-opacity),transparent)!important}}.data-table--small .data-table__pagination{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight));padding-block:4px}.data-table--small .data-table__pagination-btn{border-radius:.1875rem;min-width:24px;padding-block:4px;padding-inline:6px}.data-table__footer{flex-shrink:0}.range-selected{position:relative}.range-selected>.area{border-width:0;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--select-area-bg)var(--un-bg-opacity),transparent);pointer-events:none;border-style:solid;position:absolute;inset:0}.range-selected-l>.area{border-left-width:1.5px}.range-selected-r>.area{border-right-width:1.5px}.range-selected-t>.area{border-top-width:1.5px}.range-selected-b>.area{border-bottom-width:1.5px}.row-range-highlight,.col-range-highlight{position:relative}.row-range-highlight>.area,.col-range-highlight>.area{border-width:0;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--c-primary)10%,transparent);pointer-events:none;border-style:solid;position:absolute;inset:0}.row-range-highlight.index>.area{border-right-width:1px}.col-range-highlight>.area{border-bottom-width:1px}.sticky-header{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent);z-index:9;position:sticky;top:0}.sticky-header:after{pointer-events:none;--un-content:"";content:var(--un-content);width:100%;height:10px;position:absolute;top:100%;box-shadow:inset 0 10px 10px -10px #00000026}@property --un-content{syntax:"*";inherits:false;initial-value:""}.fixed-left,.fixed-right{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent);z-index:2;position:sticky!important}.fixed-left.is-first:after,.fixed-left.is-last:after,.fixed-right.is-first:after,.fixed-right.is-last:after{pointer-events:none;--un-content:"";content:var(--un-content);width:10px;height:100%;position:absolute;top:0}.is-scroll-right .fixed-left.is-last:after,.is-scroll-mid .fixed-left.is-last:after{left:100%;box-shadow:inset 10px 0 10px -10px #00000026}.is-scroll-left .fixed-right.is-first:after,.is-scroll-mid .fixed-right.is-first:after{right:100%;box-shadow:inset -10px 0 10px -10px #00000026}.filter-input{--un-outline-style:none;border-width:1px;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);border-radius:var(--radius-DEFAULT);box-sizing:border-box;outline-style:none;width:100%;margin-top:4px;padding-inline:6px;font-family:inherit;font-size:12px;display:block}.filter-input:focus{border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent)}.filter-input::placeholder{opacity:.3}.in-input{--un-outline-style:none;border-width:1px;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);border-radius:var(--radius-DEFAULT);box-sizing:border-box;outline-style:none;padding-block:2px;padding-inline:6px;font-family:inherit;font-size:12px}.in-input:focus{border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent)}.in-input::placeholder{opacity:.3}.copied .range-selected>.area{border-style:dashed}.data-table.virtual{display:block;overflow:auto}.data-table.virtual thead{width:fit-content;display:block}.data-table.virtual thead>tr{display:flex}.data-table.virtual thead>tr>th{flex:none;display:block}.data-table.virtual tbody{width:fit-content;display:block}.data-table.virtual tbody>tr{display:flex}.data-table.virtual tbody>tr>td{flex:none;display:block}.row-selection{width:40px;position:relative}.row-selection>label{justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;inset:0}.icon-clickable{box-sizing:border-box;border-radius:.25rem;justify-content:center;align-items:center;width:20px;height:20px;padding:2px;display:flex}.icon-clickable:hover{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent)}@supports (color:color-mix(in lab, red, red)){.icon-clickable:hover{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}.icon-clickable>svg{width:100%;height:100%}input[type=checkbox].you-checkbox{color:color-mix(in oklab,#2196f3 var(--un-text-opacity),transparent);appearance:none;outline-offset:0px;--un-border-style:solid;border:2px solid;border-radius:.25rem;width:16px;height:16px;margin:4px;position:relative}input[type=checkbox].you-checkbox:focus{outline-style:var(--un-outline-style);--un-outline-style:solid;outline:4px solid oklab(65.8156% -.0610627 -.157539/.4)}input[type=checkbox].you-checkbox.checked{background-color:currentColor}input[type=checkbox].you-checkbox.checked:after{color:color-mix(in oklab,#fff var(--un-text-opacity),transparent);--un-content:"✓";content:var(--un-content);--un-translate-x:-50%;--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y);z-index:1;font-size:.75rem;position:absolute;top:50%;left:50%}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0}input[type=checkbox].you-checkbox.indeterminate{background-color:currentColor}input[type=checkbox].you-checkbox.indeterminate:after{color:color-mix(in oklab,#fff var(--un-text-opacity),transparent);--un-content:"—";content:var(--un-content);--un-translate-x:-50%;--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y);z-index:1;font-size:.75rem;position:absolute;top:50%;left:50%}td.is-editing{position:relative}td.is-invalid{outline-offset:-1.5px;outline:1.5px solid #ff4d4f;position:relative}.in-cell-edit-wrapper{z-index:1;position:absolute;inset:0;box-shadow:0 0 10px -2px #00000050}.cell-validating{border-width:2px;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);pointer-events:none;--un-translate-y:-50%;width:12px;height:12px;translate:var(--un-translate-x)var(--un-translate-y);border-top-color:#0000;border-radius:3.40282e38px;animation:1s linear infinite spin;display:block;position:absolute;top:50%;right:4px}.cell-validation-error{z-index:2;color:#ff4d4f;white-space:nowrap;pointer-events:none;background:#fff1f0;border:1px solid #ffccc7;border-radius:4px;padding:2px 8px;font-size:12px;position:absolute;top:100%;left:0;box-shadow:0 2px 8px #00000020}.cell-validation-error:empty{display:none}.in-cell__resize-handle{width:100%;height:100%;position:absolute}.in-cell__resize-handle:hover:after{background-color:color-mix(in oklab,var(--c-primary)40%,transparent)}.in-cell__resize-handle:active:after{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.in-cell__resize-handle:after{--un-content:"";content:var(--un-content)}.li{cursor:pointer;position:relative}.li:hover,.li.hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.li:active:before,.li.selected:before,.li.active:before{content:"";border-radius:inherit;background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)15%,transparent);pointer-events:none;position:absolute;inset:0}@supports (color:color-mix(in lab, red, red)){.li:active:before,.li.selected:before,.li.active:before{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)15%,transparent)}}.li.disabled,.li[disabled]{opacity:.4}.tt-menu{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight));border-width:1px;border-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--menu-bg)var(--un-bg-opacity),transparent);cursor:default;--un-shadow:0 10px 15px -3px var(--un-shadow-color,#0000001a),0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-style:solid;border-radius:.5rem;padding-block:4px}@supports (color:color-mix(in lab, red, red)){.tt-menu{border-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@property --un-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow-color{syntax:"*";inherits:false}@property --un-ring-color{syntax:"*";inherits:false}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-inset{syntax:"*";inherits:false}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}:where(.tt-menu>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*.5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*.5)*calc(1 - var(--un-space-y-reverse)))}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}.tt-menu-x{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight));border-width:1px;border-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--menu-bg)var(--un-bg-opacity),transparent);cursor:default;--un-shadow:0 10px 15px -3px var(--un-shadow-color,#0000001a),0 4px 6px -4px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);border-style:solid;border-radius:.5rem;padding-inline:4px}@supports (color:color-mix(in lab, red, red)){.tt-menu-x{border-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}:where(.tt-menu-x>:not(:last-child)){--un-space-x-reverse:0;margin-inline-start:calc(calc(4px*.5)*var(--un-space-x-reverse));margin-inline-end:calc(calc(4px*.5)*calc(1 - var(--un-space-x-reverse)))}@property --un-space-x-reverse{syntax:"*";inherits:false;initial-value:0}.tt-menu-x>.hr{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);width:1px;margin-block:6px}@supports (color:color-mix(in lab, red, red)){.tt-menu-x>.hr{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}.in-tooltip{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight));color:color-mix(in srgb,var(--colors-white)var(--un-text-opacity),transparent);--un-leading:var(--leading-snug);line-height:var(--leading-snug);background-color:color-mix(in srgb,var(--colors-gray-800)var(--un-bg-opacity),transparent);-webkit-user-select:text;user-select:text;overflow-wrap:break-word;--un-shadow:0 4px 6px -1px var(--un-shadow-color,#0000001a),0 2px 4px -2px var(--un-shadow-color,#0000001a);width:max-content;box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);z-index:50;border-radius:.25rem;padding-block:8px;padding-inline:12px;animation:.15s both in-tooltip-in;position:relative}@supports (color:color-mix(in lab, red, red)){.in-tooltip{color:color-mix(in oklab,var(--colors-white)var(--un-text-opacity),transparent);background-color:color-mix(in oklab,var(--colors-gray-800)var(--un-bg-opacity),transparent)}}.dark .in-tooltip{color:color-mix(in srgb,var(--colors-gray-900)var(--un-text-opacity),transparent);background-color:color-mix(in srgb,var(--colors-gray-100)var(--un-bg-opacity),transparent)}@supports (color:color-mix(in lab, red, red)){.dark .in-tooltip{color:color-mix(in oklab,var(--colors-gray-900)var(--un-text-opacity),transparent);background-color:color-mix(in oklab,var(--colors-gray-100)var(--un-bg-opacity),transparent)}}.in-tooltip:before{background-color:inherit;--un-content:"";content:var(--un-content);width:8px;height:8px;position:absolute;rotate:45deg}.in-tooltip[data-placement=top]:before{bottom:-4px;left:calc(50% - 4px)}.in-tooltip[data-placement=bottom]:before{top:-4px;left:calc(50% - 4px)}.in-tooltip[data-placement=left]:before{top:calc(50% - 4px);right:-4px}.in-tooltip[data-placement=right]:before{top:calc(50% - 4px);left:-4px}.in-tooltip[data-placement=top-start]:before{bottom:-4px;left:12px}.in-tooltip[data-placement=top-end]:before{bottom:-4px;right:12px}.in-tooltip[data-placement=bottom-start]:before{top:-4px;left:12px}.in-tooltip[data-placement=bottom-end]:before{top:-4px;right:12px}@keyframes in-tooltip-in{0%{opacity:0}to{opacity:1}}.col__guide-line,.row__guide-line{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent);pointer-events:none;z-index:9;position:fixed;top:0;left:0}th[draggable=true],td[draggable=true]{cursor:move}.input-no-spin::-webkit-outer-spin-button{appearance:none}.input-no-spin::-webkit-inner-spin-button{appearance:none}.branch-graph-col{padding:0;overflow:hidden}.branch-graph-svg{display:block}.branch-graph-wrap{position:relative}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
package/dist/utils.d.ts CHANGED
@@ -17,6 +17,7 @@ export declare const log: (...args: any[]) => any;
17
17
  export declare const toArr: (v: any) => any[];
18
18
  export declare const isEmpty: (v: any) => boolean;
19
19
  export declare const parseStyle: (s: any) => any;
20
+ export declare const pxsuffix: (v: any) => any;
20
21
  export declare function findret<T, R>(arr: readonly T[], cb: (e: T, i: number) => R): R | undefined;
21
22
  export declare function emptyObject(o: any): any;
22
23
  export declare function findAsync<T>(arr: T[], cb: (e: T, i: number) => Promise<boolean> | boolean): Promise<T>;
package/dist/utils.js CHANGED
@@ -2,66 +2,66 @@ import { useMemoAsync } from "./hooks/index.js";
2
2
  import { tree_exports } from "./tree.js";
3
3
  import { delay, isFunction, isPlainObject, isPromise, keyBy } from "es-toolkit";
4
4
  function file2base64(e) {
5
- return new Promise((T, E) => {
6
- let D = new FileReader();
7
- D.readAsDataURL(e), D.onload = () => T(D.result);
5
+ return new Promise((E, D) => {
6
+ let O = new FileReader();
7
+ O.readAsDataURL(e), O.onload = () => E(O.result);
8
8
  });
9
9
  }
10
10
  function chooseFile(e) {
11
- return new Promise((T, E) => {
12
- let D = document.createElement("input");
13
- D.type = "file", D.accept = e?.accept, D.multiple = e?.multiple, D.onchange = () => {
14
- D.files && D.files.length > 0 && T(D.multiple ? [...D.files] : D.files[0]);
15
- }, D.oncancel = E, D.click();
11
+ return new Promise((E, D) => {
12
+ let O = document.createElement("input");
13
+ O.type = "file", O.accept = e?.accept, O.multiple = e?.multiple, O.onchange = () => {
14
+ O.files && O.files.length > 0 && E(O.multiple ? [...O.files] : O.files[0]);
15
+ }, O.oncancel = D, O.click();
16
16
  });
17
17
  }
18
18
  function chooseImage() {
19
19
  return chooseFile({ accept: "image/*" });
20
20
  }
21
21
  async function print(e) {
22
- let T = document.createElement("iframe");
23
- T.srcdoc = `${[...document.querySelectorAll("style"), ...document.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n")}\n\n${e}`, Object.assign(T.style, {
22
+ let E = document.createElement("iframe");
23
+ E.srcdoc = `${[...document.querySelectorAll("style"), ...document.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n")}\n\n${e}`, Object.assign(E.style, {
24
24
  position: "fixed",
25
25
  display: "none"
26
- }), document.body.append(T), await new Promise((e) => T.contentWindow.addEventListener("load", e, { once: !0 })), await delay(300), T.contentWindow.print(), T.remove();
26
+ }), document.body.append(E), await new Promise((e) => E.contentWindow.addEventListener("load", e, { once: !0 })), await delay(300), E.contentWindow.print(), E.remove();
27
27
  }
28
- function mergeRect(e, T) {
28
+ function mergeRect(e, E) {
29
29
  return DOMRect.fromRect({
30
- x: Math.min(e.x, T.x),
31
- y: Math.min(e.y, T.y),
32
- width: Math.max(e.right, T.right) - Math.min(e.x, T.x),
33
- height: Math.max(e.bottom, T.bottom) - Math.min(e.y, T.y)
30
+ x: Math.min(e.x, E.x),
31
+ y: Math.min(e.y, E.y),
32
+ width: Math.max(e.right, E.right) - Math.min(e.x, E.x),
33
+ height: Math.max(e.bottom, E.bottom) - Math.min(e.y, E.y)
34
34
  });
35
35
  }
36
36
  function getStyles(e = document) {
37
37
  return [...e.querySelectorAll("style"), ...e.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n");
38
38
  }
39
- const unFn = (e, ...T) => typeof e == "function" ? e(...T) : e, log = (...e) => (console.log(...e), e[0]), toArr = (e) => Array.isArray(e) ? e : e == null ? [] : [e], isEmpty = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || typeof e == "object" && Object.keys(e).length === 0, parseStyle = (e) => e ? e.split(";").reduce((e, T) => ((([T, E]) => e[T.trim()] = E.trim())(T.split(":")), e), {}) : {};
40
- function findret(e, T) {
41
- for (let E = 0; E < e.length; E++) {
42
- let D = T(e[E], E);
43
- if (D != null) return D;
39
+ const unFn = (e, ...E) => typeof e == "function" ? e(...E) : e, log = (...e) => (console.log(...e), e[0]), toArr = (e) => Array.isArray(e) ? e : e == null ? [] : [e], isEmpty = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || typeof e == "object" && Object.keys(e).length === 0, parseStyle = (e) => e ? e.split(";").reduce((e, E) => ((([E, D]) => e[E.trim()] = D.trim())(E.split(":")), e), {}) : {}, pxsuffix = (e) => typeof e == "number" ? `${e}px` : e;
40
+ function findret(e, E) {
41
+ for (let D = 0; D < e.length; D++) {
42
+ let O = E(e[D], D);
43
+ if (O != null) return O;
44
44
  }
45
45
  }
46
46
  function emptyObject(e) {
47
- for (let T of Object.keys(e)) delete e[T];
47
+ for (let E of Object.keys(e)) delete e[E];
48
48
  return e;
49
49
  }
50
- async function findAsync(e, T) {
51
- for (let E = 0; E < e.length; E++) if (await T(e[E], E)) return e[E];
50
+ async function findAsync(e, E) {
51
+ for (let D = 0; D < e.length; D++) if (await E(e[D], D)) return e[D];
52
52
  }
53
53
  var cache = /* @__PURE__ */ new WeakMap(), cache2 = /* @__PURE__ */ new WeakMap();
54
- function resolveOptions(T) {
55
- let E = T;
56
- return isFunction(E) && (E = E()), isPromise(E) ? (cache.has(T) || cache.set(T, useMemoAsync(() => E.then((e) => e.map((e) => resolveOptions(e))))), cache.get(T)()) : cache2.has(T) ? cache2.get(T) : (isPlainObject(E) && (E = Object.entries(E).map(([e, T]) => ({
54
+ function resolveOptions(E) {
55
+ let D = E;
56
+ return isFunction(D) && (D = D()), isPromise(D) ? (cache.has(E) || cache.set(E, useMemoAsync(() => D.then((e) => e.map((e) => resolveOptions(e))))), cache.get(E)()) : cache2.has(E) ? cache2.get(E) : (isPlainObject(D) && (D = Object.entries(D).map(([e, E]) => ({
57
57
  value: e,
58
- label: T,
59
- ...T
60
- }))), E = E?.map((e) => resolveOpt(e)) || [], cache2.set(T, E), E);
58
+ label: E,
59
+ ...E
60
+ }))), D = D?.map((e) => resolveOpt(e)) || [], cache2.set(E, D), D);
61
61
  }
62
62
  const getOpt = (() => {
63
63
  let e = /* @__PURE__ */ new WeakMap();
64
- return (T, E) => (e.get(T) ?? e.set(T, keyBy(resolveOptions(T), (e) => e.value)).get(T))[E];
64
+ return (E, D) => (e.get(E) ?? e.set(E, keyBy(resolveOptions(E), (e) => e.value)).get(E))[D];
65
65
  })();
66
66
  function resolveOpt(e) {
67
67
  return isPlainObject(e) ? e : Array.isArray(e) ? {
@@ -73,18 +73,18 @@ function resolveOpt(e) {
73
73
  };
74
74
  }
75
75
  function throttlePromise(e) {
76
- let T = !1, E;
76
+ let E = !1, D;
77
77
  return () => {
78
- let D = new Promise(function(e) {
79
- E = e;
78
+ let O = new Promise(function(e) {
79
+ D = e;
80
80
  });
81
- return T ? D : (T = !0, e(() => {
82
- E(), T = !1, E = null;
83
- }), D);
81
+ return E ? O : (E = !0, e(() => {
82
+ D(), E = !1, D = null;
83
+ }), O);
84
84
  };
85
85
  }
86
- function change2(e, T) {
87
- for (let E in e) E in T || delete e[E];
88
- return Object.assign(e, T), e;
86
+ function change2(e, E) {
87
+ for (let D in e) D in E || delete e[D];
88
+ return Object.assign(e, E), e;
89
89
  }
90
- export { change2, chooseFile, chooseImage, emptyObject, file2base64, findAsync, findret, getOpt, getStyles, isEmpty, log, mergeRect, parseStyle, print, resolveOptions, throttlePromise, toArr, tree_exports as tree, unFn };
90
+ export { change2, chooseFile, chooseImage, emptyObject, file2base64, findAsync, findret, getOpt, getStyles, isEmpty, log, mergeRect, parseStyle, print, pxsuffix, resolveOptions, throttlePromise, toArr, tree_exports as tree, unFn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intable",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [