intable 0.0.21 → 0.0.23

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.
@@ -19,7 +19,7 @@ const EditablePlugin = {
19
19
  Td: ({ Td: e }, { store: h }) => (_) => {
20
20
  let v, { props: x } = useContext(Ctx), S = createMemo(() => unFn(x.editable, _)), [w, T] = createSignal(!1), A = "", j = createMemo(() => (([e, h]) => _.x == e && _.y == h)(h.selected.start || [])), M = createMemo(() => j() && S() && !w()), [N, P] = createSignal(!1), F = createAsyncMemo(() => {
21
21
  if (w()) {
22
- let e = !1, g = _.data[_.col.id], v = ((e) => typeof e == "string" ? h.editors[e] : e)(_.col.editor || "text"), y = {
22
+ let e = !1, g = _.data[_.col.id], v = ((e) => typeof e == "string" ? h.editors[e] : e)(_.col.editor ?? _.col.type ?? "text"), y = {
23
23
  props: _.col.editorProps,
24
24
  col: _.col,
25
25
  eventKey: A,
@@ -32,20 +32,16 @@ const EditablePlugin = {
32
32
  onChange: (e) => w() && I(e).catch(() => {})
33
33
  }, b = v(y);
34
34
  return onCleanup(() => {
35
- if (!e && b.getValue() !== g) {
36
- let e = [...x.data];
37
- e[_.y] = {
38
- ...e[_.y],
39
- [_.col.id]: b.getValue()
40
- }, x.onDataChange?.(e);
41
- }
42
- e || I(b.getValue()).catch(() => {}), b.destroy();
35
+ !e && b.getValue() !== g && h.commands.rowChange({
36
+ ...x.data[_.y],
37
+ [_.col.id]: b.getValue()
38
+ }), e || I(b.getValue()).catch(() => {}), A = "", b.destroy();
43
39
  }), [y, b];
44
40
  }
45
41
  });
46
42
  async function I(e) {
47
43
  try {
48
- P(!0), console.log("validate", e), await h.validateCell(e, _.data, _.col);
44
+ P(!0), await h.validateCell(e, _.data, _.col);
49
45
  } finally {
50
46
  P(!1);
51
47
  }
@@ -0,0 +1,14 @@
1
+ import type { Plugin } from '..';
2
+ import type { AndOrNode } from '../components/AndOr';
3
+ declare module '../index' {
4
+ interface TableProps {
5
+ filterable?: boolean;
6
+ }
7
+ interface TableColumn {
8
+ filterable?: boolean;
9
+ }
10
+ interface TableStore {
11
+ filters: Record<string, AndOrNode>;
12
+ }
13
+ }
14
+ export declare const FilterPlugin: Plugin;
@@ -0,0 +1,138 @@
1
+ import { normalizeType } from "../components/AndOrFields.js";
2
+ import { Filter } from "../components/Filter.js";
3
+ import { createComponent, memo, mergeProps } from "solid-js/web";
4
+ import { Show } from "solid-js";
5
+ function isBlank(e) {
6
+ return e == null || String(e).trim() === "";
7
+ }
8
+ function toNum(e) {
9
+ let u = Number(e);
10
+ return Number.isNaN(u) ? null : u;
11
+ }
12
+ function toDateTs(e) {
13
+ if (isBlank(e)) return null;
14
+ let u = new Date(String(e)).getTime();
15
+ return Number.isNaN(u) ? null : u;
16
+ }
17
+ function toBool(e) {
18
+ if (typeof e == "boolean") return e;
19
+ if (typeof e == "number") return e !== 0;
20
+ let u = String(e ?? "").trim().toLowerCase();
21
+ return [
22
+ "1",
23
+ "true",
24
+ "yes",
25
+ "y",
26
+ "on"
27
+ ].includes(u) ? !0 : [
28
+ "0",
29
+ "false",
30
+ "no",
31
+ "n",
32
+ "off",
33
+ ""
34
+ ].includes(u) ? !1 : !!e;
35
+ }
36
+ function isRuleNode(e) {
37
+ return "field" in e;
38
+ }
39
+ function hasActiveRule(e) {
40
+ return !!e.op;
41
+ }
42
+ function hasActiveTree(e) {
43
+ return e ? isRuleNode(e) ? hasActiveRule(e) : (e.children ?? []).some(hasActiveTree) : !1;
44
+ }
45
+ function matchFilter(e, u, d) {
46
+ let f = u.op;
47
+ if (f === "blank") return isBlank(e);
48
+ if (f === "noblank") return !isBlank(e);
49
+ if (f === "true") return toBool(e);
50
+ if (f === "false") return !toBool(e);
51
+ let p = u.value;
52
+ if (d === "number") {
53
+ let u = toNum(e), d = toNum(p);
54
+ if (u == null || d == null) return !1;
55
+ if (f === "eq") return u === d;
56
+ if (f === "lt") return u < d;
57
+ if (f === "gt") return u > d;
58
+ if (f === "lte") return u <= d;
59
+ if (f === "gte") return u >= d;
60
+ }
61
+ if (d === "date") {
62
+ let u = toDateTs(e), d = toDateTs(p);
63
+ if (u == null || d == null) return !1;
64
+ if (f === "eq") return u === d;
65
+ if (f === "lt") return u < d;
66
+ if (f === "gt") return u > d;
67
+ if (f === "lte") return u <= d;
68
+ if (f === "gte") return u >= d;
69
+ }
70
+ let m = String(e ?? "").toLowerCase(), v = String(p ?? "").toLowerCase();
71
+ return f === "eq" ? m === v : f === "neq" ? m !== v : f === "startwith" ? m.startsWith(v) : f === "endwith" ? m.endsWith(v) : m.includes(v);
72
+ }
73
+ function getFilterTree(e, u) {
74
+ return e[u.id];
75
+ }
76
+ function setFilterTree(e, u, d) {
77
+ if (!d) {
78
+ delete e[u.id];
79
+ return;
80
+ }
81
+ e[u.id] = d;
82
+ }
83
+ function evaluateFilterTree(e, u, d) {
84
+ if (isRuleNode(u)) return hasActiveRule(u) ? matchFilter(e, u, d) : !0;
85
+ let f = (u.children ?? []).filter(hasActiveTree);
86
+ return f.length ? u.op === "or" ? f.some((u) => evaluateFilterTree(e, u, d)) : f.every((u) => evaluateFilterTree(e, u, d)) : !0;
87
+ }
88
+ function passesFilters(u, d, f, p, m) {
89
+ return f.every((f) => {
90
+ if (f[m] || !(f.filterable ?? p)) return !0;
91
+ let h = getFilterTree(d, f);
92
+ return !h || !hasActiveTree(h) ? !0 : evaluateFilterTree(u[f.id], h, normalizeType(f));
93
+ });
94
+ }
95
+ const FilterPlugin = {
96
+ name: "filter",
97
+ store: () => ({ filters: {} }),
98
+ rewriteProps: {
99
+ data: ({ data: e }, { store: u }) => {
100
+ if (!e) return e;
101
+ let { filters: d } = u, { columns: f = [], filterable: p } = u.props;
102
+ return Object.values(d).some(hasActiveTree) ? e.filter((e) => passesFilters(e, d, f, p, u.internal)) : e;
103
+ },
104
+ onDataChange: ({ onDataChange: e }, { store: u }) => (d) => {
105
+ let f = u.rawProps.data ?? [], { columns: p = [], filterable: m } = u.props;
106
+ if (!Object.values(u.filters).some(hasActiveTree)) {
107
+ e?.(d);
108
+ return;
109
+ }
110
+ let h = [...f], g = 0;
111
+ f.forEach((e, f) => {
112
+ passesFilters(e, u.filters, p, m, u.internal) && (h[f] = d[g++]);
113
+ }), e?.(h);
114
+ },
115
+ Th: ({ Th: e }, { store: h }) => (g) => {
116
+ let _ = () => !!(g.col.filterable ?? h.props.filterable) && !g.col[h.internal];
117
+ return createComponent(e, mergeProps(g, { get children() {
118
+ return [memo(() => g.children), createComponent(Show, {
119
+ get when() {
120
+ return _();
121
+ },
122
+ get children() {
123
+ return createComponent(Filter, {
124
+ get col() {
125
+ return g.col;
126
+ },
127
+ get tree() {
128
+ return getFilterTree(h.filters, g.col);
129
+ },
130
+ setTree: (e) => setFilterTree(h.filters, g.col, e)
131
+ });
132
+ }
133
+ })];
134
+ } }));
135
+ }
136
+ }
137
+ };
138
+ export { FilterPlugin };
@@ -71,15 +71,16 @@ const MenuPlugin = {
71
71
  }
72
72
  ],
73
73
  commands: (e) => ({
74
- rowEquals(e, r) {
75
- return e == r;
74
+ rowEquals(r, i) {
75
+ let a = e.props.rowKey;
76
+ return r == i || a != null && r?.[a] == i?.[a];
76
77
  },
77
78
  rowIndexOf(r, i) {
78
79
  return r.findIndex((r) => e.commands.rowEquals(r, i));
79
80
  },
80
81
  rowChange(r, i) {
81
82
  let a = [...e.rawProps.data || []];
82
- i = i == null ? e.commands.rowIndexOf(a, r) : a.findIndex((r) => r == e.props.data[i]), i > -1 && (a[i] = r, e.props.onDataChange?.(a));
83
+ i = i == null ? e.commands.rowIndexOf(a, r) : a.findIndex((r) => e.commands.rowEquals(r, e.props.data[i])), i > -1 && (a[i] = r, e.props.onDataChange?.(a));
83
84
  },
84
85
  addRows(r, i, a = !0) {
85
86
  addRows(e, r, i, a);
@@ -4,6 +4,7 @@ declare module '../../index' {
4
4
  interface TableProps {
5
5
  }
6
6
  interface TableColumn {
7
+ type?: string;
7
8
  render?: Render;
8
9
  enum?: Record<string, any> | {
9
10
  label?: string;
@@ -10,7 +10,7 @@ const RenderPlugin = {
10
10
  store: () => ({ renders: { ...renders } }),
11
11
  rewriteProps: { Td: ({ Td: e }, { store: p }) => (m) => createComponent(e, mergeProps(m, { get children() {
12
12
  return (() => {
13
- let e = ((e) => typeof e == "string" ? p.renders[e] : e)(m.col.render) || text;
13
+ let e = ((e) => typeof e == "string" ? p.renders[e] : e)(m.col.render ?? m.col.type) || text;
14
14
  return renderComponent(e, mergeProps$1(m, { onChange: (e) => p.commands.rowChange({
15
15
  ...m.data,
16
16
  [m.col.id]: e
@@ -1,72 +1,73 @@
1
+ import { isEmpty } from "../utils.js";
1
2
  import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
2
3
  import { combineProps } from "@solid-primitives/props";
3
- var _tmpl$ = /* @__PURE__ */ template("<div class=cell-validation-error>"), _tmpl$2 = /* @__PURE__ */ template("<span class=\"mr-1 c-red/75\">*"), isEmpty = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || typeof e == "object" && Object.keys(e).length === 0;
4
+ var _tmpl$ = /* @__PURE__ */ template("<div class=cell-validation-error>"), _tmpl$2 = /* @__PURE__ */ template("<span class=\"mr-1 c-red/75\">*");
4
5
  const ValidatorPlugin = {
5
6
  name: "validator",
6
- store: (e) => ({
7
+ store: (t) => ({
7
8
  cellValidationErrors: {},
8
- validateCell: async (t, n, r, i) => {
9
- if (n[e.internal] || r[e.internal]) return;
10
- let a = [
9
+ validateCell: async (n, r, i, a) => {
10
+ if (r[t.internal] || i[t.internal]) return;
11
+ let o = [
11
12
  () => {
12
- if (r.required && isEmpty(t)) throw Error("Required");
13
+ if (i.required && isEmpty(n)) throw Error("Required");
13
14
  },
14
- r.validator,
15
- e.props.validator
16
- ], o = n[e.props.rowKey];
17
- for (let s of a) {
18
- if (!s) continue;
15
+ i.validator,
16
+ t.props.validator
17
+ ], s = r[t.props.rowKey];
18
+ for (let e of o) {
19
+ if (!e) continue;
19
20
  try {
20
- await s(t, n, r);
21
- } catch (t) {
22
- let a = t.message || "Error";
23
- throw e.cellValidationErrors[o] ??= {}, e.cellValidationErrors[o][r.id] = a, i && e.scrollToCell?.(r, n), Error(a);
21
+ await e(n, r, i);
22
+ } catch (e) {
23
+ let n = e.message || "Error";
24
+ throw t.cellValidationErrors[s] ??= {}, t.cellValidationErrors[s][i.id] = n, a && t.scrollToCell?.(i, r), Error(n);
24
25
  }
25
26
  }
26
- e.cellValidationErrors[o] ??= {}, e.cellValidationErrors[o][r.id] = null;
27
+ t.cellValidationErrors[s] ??= {}, t.cellValidationErrors[s][i.id] = null;
27
28
  },
28
- validateRow: async (t, n) => {
29
- let r = e.props.columns, i = r.map((n) => e.validateCell(t[n.id], t, n)), a = await Promise.all(i.map((e) => e.catch((e) => e))), o = a.map((e, t) => e instanceof Error ? [r[t].id, e] : null).filter((e) => e);
29
+ validateRow: async (e, n) => {
30
+ let r = t.props.columns, i = r.map((n) => t.validateCell(e[n.id], e, n)), a = await Promise.all(i.map((e) => e.catch((e) => e))), o = a.map((e, t) => e instanceof Error ? [r[t].id, e] : null).filter((e) => e);
30
31
  if (o.length) {
31
32
  if (n) {
32
33
  let n = r[a.findIndex((e) => e instanceof Error)];
33
- e.scrollToCell?.(n, t);
34
+ t.scrollToCell?.(n, e);
34
35
  }
35
36
  throw Object.fromEntries(o);
36
37
  }
37
38
  },
38
39
  validate: async () => {
39
- let t = (e.rawProps.data || []).map((t) => e.validateRow(t)), n = (await Promise.all(t.map((e) => e.catch((e) => e)))).map((e, t) => e ? [t, e] : null).filter((e) => e);
40
- if (n.length) throw e.scrollToCell?.(e.props.columns.findIndex((e) => e.id === Object.keys(n[0][1])[0]), e.props.data?.[n[0][0]]), n[0][1];
40
+ let e = (t.rawProps.data || []).map((e) => t.validateRow(e)), n = (await Promise.all(e.map((e) => e.catch((e) => e)))).map((e, t) => e ? [t, e] : null).filter((e) => e);
41
+ if (n.length) throw t.scrollToCell?.(t.props.columns.findIndex((e) => e.id === Object.keys(n[0][1])[0]), t.props.data?.[n[0][0]]), n[0][1];
41
42
  },
42
- clearCellValidation: (t, n) => {
43
- let r = t[e.props.rowKey];
44
- e.cellValidationErrors[r] && (e.cellValidationErrors[r][n.id] = null);
43
+ clearCellValidation: (e, n) => {
44
+ let r = e[t.props.rowKey];
45
+ t.cellValidationErrors[r] && (t.cellValidationErrors[r][n.id] = null);
45
46
  },
46
- clearRowValidation: (t) => {
47
- let n = t[e.props.rowKey];
48
- if (!e.cellValidationErrors[n]) return;
49
- let r = e.props.columns;
50
- for (let t of r) e.cellValidationErrors[n][t.id] = null;
47
+ clearRowValidation: (e) => {
48
+ let n = e[t.props.rowKey];
49
+ if (!t.cellValidationErrors[n]) return;
50
+ let r = t.props.columns;
51
+ for (let e of r) t.cellValidationErrors[n][e.id] = null;
51
52
  },
52
53
  clearValidation: () => {
53
- e.cellValidationErrors = {};
54
+ t.cellValidationErrors = {};
54
55
  }
55
56
  }),
56
57
  rewriteProps: {
57
- Td: ({ Td: i }, { store: s }) => (c) => {
58
- let l = () => s.cellValidationErrors[c.data[s.props.rowKey]]?.[c.col.id], u = combineProps(c, { get class() {
58
+ Td: ({ Td: e }, { store: a }) => (c) => {
59
+ let l = () => a.cellValidationErrors[c.data[a.props.rowKey]]?.[c.col.id], u = combineProps(c, { get class() {
59
60
  return l() == null ? "" : "is-invalid";
60
61
  } });
61
- return createComponent(i, mergeProps(u, { get children() {
62
+ return createComponent(e, mergeProps(u, { get children() {
62
63
  return [memo(() => c.children), memo(() => memo(() => l() != null)() && (() => {
63
64
  var e = _tmpl$();
64
65
  return insert(e, l), e;
65
66
  })())];
66
67
  } }));
67
68
  },
68
- Th: ({ Th: t }, { store: i }) => (i) => createComponent(t, mergeProps(i, { get children() {
69
- return [memo(() => memo(() => !!i.col.required)() && _tmpl$2()), memo(() => i.children)];
69
+ Th: ({ Th: e }, { store: n }) => (n) => createComponent(e, mergeProps(n, { get children() {
70
+ return [memo(() => memo(() => !!n.col.required)() && _tmpl$2()), memo(() => n.children)];
70
71
  } }))
71
72
  }
72
73
  };
package/dist/style.css CHANGED
@@ -1,3 +1,3 @@
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-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-outline-opacity:100%}}@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-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@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}:root,:host{--spacing:.25rem;--colors-gray-DEFAULT:#99a1af;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--radius-sm:.25rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--colors-green-DEFAULT:#05df72;--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";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--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% -.832707 -8.17474);--colors-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803);--colors-red-DEFAULT:lab(63.7053% 60.7449 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9265 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-3\.5{font-size:.875rem}.c-red\/75{color:color-mix(in srgb,var(--colors-red-DEFAULT)75%,transparent)}.lh-\[1\]{--un-leading:1;line-height:1}.m9{margin:36px}.mx-1{margin-inline:4px}.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}.p-1{padding:4px}.px,.px-4{padding-inline:16px}.px-2{padding-inline:8px}.py-1{padding-block:4px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.b{border-width:1px}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.bg-\#fff{background-color:color-mix(in oklab,#fff 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}.op-20{opacity:.2}.op-75{opacity:.75}.op40{opacity:.4}.flex{display:flex}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-2{gap:8px}.grid{display:grid}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.w-10px\!{width:10px!important}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-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))}.items-center{align-items:center}.box-border{box-sizing:border-box}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.z--1{z-index:-1}.z-1{z-index:1}.z-9{z-index:9}.overflow-auto{overflow:auto}.table{display:table}.table-cell{display:table-cell}@supports (color:color-mix(in lab, red, red)){.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-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}}
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-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-outline-opacity:100%}}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--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;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--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";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--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% -.832707 -8.17474);--colors-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803);--colors-red-DEFAULT:lab(63.7053% 60.7449 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9265 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-3{font-size:.75rem}.text-3\.5{font-size:.875rem}.text-4{font-size:1rem}.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-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}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.m9{margin:36px}.mx-1{margin-inline:4px}.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-1{padding:4px}.p-4\!{padding:16px!important}.px,.px-4{padding-inline:16px}.px-1\.5{padding-inline:6px}.px-2{padding-inline:8px}.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}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.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}.b,.b-1,.border{border-width:1px}.b-r-0{border-right-width:0}.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-2{border-radius:.5rem}.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-\#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% .744224 15.5662/.85)}.bg-blue\/20\!{background-color:color-mix(in srgb,var(--colors-blue-DEFAULT)20%,transparent)!important}.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-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}.group:hover .group-hover\:op-100{opacity:1}.flex{display:flex}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.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-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.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-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-a\!{width:auto!important}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.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)}.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)}.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-opacity{transition-property:opacity;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.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!important}.justify-center{justify-content:center}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.z--1{z-index:-1}.z-1{z-index:1}.z-2{z-index:2}.z-9{z-index:9}.overflow-auto{overflow:auto}.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}: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-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\/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);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%}.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:max-content}@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)}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.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{border-width:1px}.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:1;position:absolute;top:0;left:0}.data-table__layers>*{position:absolute}.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}.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% -.0610626 -.157539/.4)}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}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);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)}}.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}@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);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%}.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:max-content}@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)}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.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{border-width:1px}.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:1;position:absolute;top:0;left:0}.data-table__layers>*{position:absolute}.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;background-color:#0000;outline-style:none;width:100%;margin-top:4px;padding-block:2px;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}.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% -.0610626 -.157539/.4)}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}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);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)}}.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}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
package/dist/utils.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare function getStyles(el?: ParentNode): string;
15
15
  export declare const unFn: (fn: any, ...args: any[]) => any;
16
16
  export declare const log: (...args: any[]) => any;
17
17
  export declare const toArr: (v: any) => any[];
18
+ export declare const isEmpty: (v: any) => boolean;
18
19
  export declare const parseStyle: (s: any) => any;
19
20
  export declare function findret<T, R>(arr: readonly T[], cb: (e: T, i: number) => R): R | undefined;
20
21
  export declare function emptyObject(o: any): any;
@@ -29,3 +30,4 @@ export declare function resolveOptions(opts: Fnable<Awatable<Record<string, any>
29
30
  label: any;
30
31
  value: any;
31
32
  }[];
33
+ export declare function throttlePromise(of: any): () => Promise<unknown>;
package/dist/utils.js CHANGED
@@ -2,62 +2,62 @@ import { useMemoAsync } from "./hooks/index.js";
2
2
  import { tree_exports } from "./tree.js";
3
3
  import { delay, isFunction, isPlainObject, isPromise } from "es-toolkit";
4
4
  function file2base64(e) {
5
- return new Promise((y, b) => {
6
- let x = new FileReader();
7
- x.readAsDataURL(e), x.onload = () => y(x.result);
5
+ return new Promise((x, S) => {
6
+ let C = new FileReader();
7
+ C.readAsDataURL(e), C.onload = () => x(C.result);
8
8
  });
9
9
  }
10
10
  function chooseFile(e) {
11
- return new Promise((y, b) => {
12
- let x = document.createElement("input");
13
- x.type = "file", x.accept = e?.accept, x.multiple = e?.multiple, x.onchange = () => {
14
- x.files && x.files.length > 0 && y(x.multiple ? [...x.files] : x.files[0]);
15
- }, x.oncancel = b, x.click();
11
+ return new Promise((x, S) => {
12
+ let C = document.createElement("input");
13
+ C.type = "file", C.accept = e?.accept, C.multiple = e?.multiple, C.onchange = () => {
14
+ C.files && C.files.length > 0 && x(C.multiple ? [...C.files] : C.files[0]);
15
+ }, C.oncancel = S, C.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 y = document.createElement("iframe");
23
- y.srcdoc = `${[...document.querySelectorAll("style"), ...document.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n")}\n\n${e}`, Object.assign(y.style, {
22
+ let x = document.createElement("iframe");
23
+ x.srcdoc = `${[...document.querySelectorAll("style"), ...document.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n")}\n\n${e}`, Object.assign(x.style, {
24
24
  position: "fixed",
25
25
  display: "none"
26
- }), document.body.append(y), await new Promise((e) => y.contentWindow.addEventListener("load", e, { once: !0 })), await delay(300), y.contentWindow.print(), y.remove();
26
+ }), document.body.append(x), await new Promise((e) => x.contentWindow.addEventListener("load", e, { once: !0 })), await delay(300), x.contentWindow.print(), x.remove();
27
27
  }
28
- function mergeRect(e, y) {
28
+ function mergeRect(e, x) {
29
29
  return DOMRect.fromRect({
30
- x: Math.min(e.x, y.x),
31
- y: Math.min(e.y, y.y),
32
- width: Math.max(e.right, y.right) - Math.min(e.x, y.x),
33
- height: Math.max(e.bottom, y.bottom) - Math.min(e.y, y.y)
30
+ x: Math.min(e.x, x.x),
31
+ y: Math.min(e.y, x.y),
32
+ width: Math.max(e.right, x.right) - Math.min(e.x, x.x),
33
+ height: Math.max(e.bottom, x.bottom) - Math.min(e.y, x.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, ...y) => typeof e == "function" ? e(...y) : e, log = (...e) => (console.log(...e), e[0]), toArr = (e) => Array.isArray(e) ? e : e == null ? [] : [e], parseStyle = (e) => e ? e.split(";").reduce((e, y) => ((([y, b]) => e[y.trim()] = b.trim())(y.split(":")), e), {}) : {};
40
- function findret(e, y) {
41
- for (let b = 0; b < e.length; b++) {
42
- let x = y(e[b], b);
43
- if (x != null) return x;
39
+ const unFn = (e, ...x) => typeof e == "function" ? e(...x) : 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, x) => ((([x, S]) => e[x.trim()] = S.trim())(x.split(":")), e), {}) : {};
40
+ function findret(e, x) {
41
+ for (let S = 0; S < e.length; S++) {
42
+ let C = x(e[S], S);
43
+ if (C != null) return C;
44
44
  }
45
45
  }
46
46
  function emptyObject(e) {
47
- for (let y of Object.keys(e)) delete e[y];
47
+ for (let x of Object.keys(e)) delete e[x];
48
48
  return e;
49
49
  }
50
- async function findAsync(e, y) {
51
- for (let b = 0; b < e.length; b++) if (await y(e[b], b)) return e[b];
50
+ async function findAsync(e, x) {
51
+ for (let S = 0; S < e.length; S++) if (await x(e[S], S)) return e[S];
52
52
  }
53
53
  var cache = /* @__PURE__ */ new WeakMap();
54
- function resolveOptions(y) {
55
- let b = y;
56
- return isFunction(b) && (b = b()), isPromise(b) ? (cache.has(b) || cache.set(b, useMemoAsync(() => b.then((e) => e.map((e) => resolveOptions(e))))), cache.get(b)()) : (isPlainObject(b) && (b = Object.entries(b).map(([e, y]) => ({
54
+ function resolveOptions(x) {
55
+ let S = x;
56
+ return isFunction(S) && (S = S()), isPromise(S) ? (cache.has(S) || cache.set(S, useMemoAsync(() => S.then((e) => e.map((e) => resolveOptions(e))))), cache.get(S)()) : (isPlainObject(S) && (S = Object.entries(S).map(([e, x]) => ({
57
57
  value: e,
58
- label: y,
59
- ...y
60
- }))), b?.map((e) => resolveOpt(e)) || []);
58
+ label: x,
59
+ ...x
60
+ }))), S?.map((e) => resolveOpt(e)) || []);
61
61
  }
62
62
  function resolveOpt(e) {
63
63
  return isPlainObject(e) ? e : Array.isArray(e) ? {
@@ -68,4 +68,15 @@ function resolveOpt(e) {
68
68
  value: e
69
69
  };
70
70
  }
71
- export { chooseFile, chooseImage, emptyObject, file2base64, findAsync, findret, getStyles, log, mergeRect, parseStyle, print, resolveOptions, toArr, tree_exports as tree, unFn };
71
+ function throttlePromise(e) {
72
+ let x = !1, S;
73
+ return () => {
74
+ let C = new Promise(function(e) {
75
+ S = e;
76
+ });
77
+ return x ? C : (x = !0, e(() => {
78
+ S(), x = !1, S = null;
79
+ }), C);
80
+ };
81
+ }
82
+ export { chooseFile, chooseImage, emptyObject, file2base64, findAsync, findret, getStyles, isEmpty, log, mergeRect, parseStyle, print, 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.21",
3
+ "version": "0.0.23",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,2 +0,0 @@
1
- import type { Plugin } from '..';
2
- export declare function CellChangeHighlightPlugin(): Plugin;
@@ -1,4 +0,0 @@
1
- function CellChangeHighlightPlugin() {
2
- return {};
3
- }
4
- export { CellChangeHighlightPlugin };