intable 0.0.79 → 0.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__uno.css +1 -1
- package/dist/components/Select.js +2 -2
- package/dist/hooks/useControlled.d.ts +25 -25
- package/dist/hooks/useControlled.js +9 -9
- package/dist/hooks/useSelector.d.ts +8 -8
- package/dist/plugins/AggregatePlugin.js +2 -2
- package/dist/plugins/AutoFillPlugin.js +2 -2
- package/dist/plugins/ColumnVisibilityPlugin.js +1 -1
- package/dist/plugins/EditablePlugin.js +2 -2
- package/dist/plugins/ExpressPlugin.d.ts +2 -2
- package/dist/plugins/ExpressPlugin.js +20 -21
- package/dist/plugins/FilterPlugin.js +82 -82
- package/dist/plugins/OrmPlugin.js +1 -1
- package/dist/plugins/RenderPlugin/components.js +1 -1
- package/dist/plugins/RenderPlugin/index.d.ts +1 -2
- package/dist/plugins/SortPlugin.js +41 -41
- package/dist/style.css +2 -2
- package/dist/theme/antd.scss +8 -8
- package/dist/theme/dark.scss +11 -11
- package/dist/theme/element-plus.scss +9 -9
- package/dist/theme/github.scss +22 -22
- package/dist/theme/material.scss +22 -22
- package/dist/theme/shadcn.scss +21 -21
- package/dist/theme/stripe.scss +12 -12
- package/package.json +1 -1
|
@@ -4,38 +4,38 @@ import { useControlled } from "../hooks/useControlled.js";
|
|
|
4
4
|
import { normalizeType } from "../components/AndOrFields.js";
|
|
5
5
|
import { Filter, firstRule, isRuleNode } from "../components/Filter.js";
|
|
6
6
|
import { createComponent, memo } from "solid-js/web";
|
|
7
|
-
import { Show, mergeProps as mergeProps$1 } from "solid-js";
|
|
7
|
+
import { Show, mergeProps as mergeProps$1, runWithOwner, untrack } from "solid-js";
|
|
8
8
|
import { keyBy } from "es-toolkit";
|
|
9
9
|
function isBlank(e) {
|
|
10
10
|
return e == null || String(e).trim() === "";
|
|
11
11
|
}
|
|
12
12
|
function toNum(e) {
|
|
13
|
-
let
|
|
14
|
-
return Number.isNaN(
|
|
13
|
+
let g = Number(e);
|
|
14
|
+
return Number.isNaN(g) ? null : g;
|
|
15
15
|
}
|
|
16
16
|
function toDateTs(e) {
|
|
17
17
|
if (isBlank(e)) return null;
|
|
18
|
-
let
|
|
19
|
-
return Number.isNaN(
|
|
18
|
+
let g = new Date(String(e)).getTime();
|
|
19
|
+
return Number.isNaN(g) ? null : g;
|
|
20
20
|
}
|
|
21
21
|
function toBool(e) {
|
|
22
22
|
if (typeof e == "boolean") return e;
|
|
23
23
|
if (typeof e == "number") return e !== 0;
|
|
24
|
-
let
|
|
24
|
+
let g = String(e ?? "").trim().toLowerCase();
|
|
25
25
|
return [
|
|
26
26
|
"1",
|
|
27
27
|
"true",
|
|
28
28
|
"yes",
|
|
29
29
|
"y",
|
|
30
30
|
"on"
|
|
31
|
-
].includes(
|
|
31
|
+
].includes(g) ? !0 : [
|
|
32
32
|
"0",
|
|
33
33
|
"false",
|
|
34
34
|
"no",
|
|
35
35
|
"n",
|
|
36
36
|
"off",
|
|
37
37
|
""
|
|
38
|
-
].includes(
|
|
38
|
+
].includes(g) ? !1 : !!e;
|
|
39
39
|
}
|
|
40
40
|
function toList(e) {
|
|
41
41
|
return Array.isArray(e) ? e : e == null || String(e).trim() === "" ? [] : String(e).split(",").map((e) => e.trim()).filter(Boolean);
|
|
@@ -43,8 +43,8 @@ function toList(e) {
|
|
|
43
43
|
function toPair(e) {
|
|
44
44
|
if (Array.isArray(e)) return [e[0], e[1]];
|
|
45
45
|
if (e == null || String(e).trim() === "") return [void 0, void 0];
|
|
46
|
-
let
|
|
47
|
-
return [
|
|
46
|
+
let g = String(e).split(",").map((e) => e.trim());
|
|
47
|
+
return [g[0], g[1]];
|
|
48
48
|
}
|
|
49
49
|
function hasActiveRule(e) {
|
|
50
50
|
return !!e.op;
|
|
@@ -52,109 +52,109 @@ function hasActiveRule(e) {
|
|
|
52
52
|
function hasActiveTree(e) {
|
|
53
53
|
return e ? isRuleNode(e) ? hasActiveRule(e) : (e.children ?? []).some(hasActiveTree) : !1;
|
|
54
54
|
}
|
|
55
|
-
function matchFilter(e,
|
|
56
|
-
let
|
|
57
|
-
if (
|
|
58
|
-
if (
|
|
59
|
-
if (
|
|
60
|
-
if (
|
|
61
|
-
let
|
|
62
|
-
if (
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
65
|
-
if (
|
|
66
|
-
if (
|
|
67
|
-
if (
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
55
|
+
function matchFilter(e, g, _) {
|
|
56
|
+
let v = g.op;
|
|
57
|
+
if (v === "blank") return isBlank(e);
|
|
58
|
+
if (v === "noblank") return !isBlank(e);
|
|
59
|
+
if (v === "true") return toBool(e);
|
|
60
|
+
if (v === "false") return !toBool(e);
|
|
61
|
+
let y = g.value;
|
|
62
|
+
if (_ === "number") {
|
|
63
|
+
let g = toNum(e), _ = toNum(y), b = toList(y).map(toNum).filter((e) => e != null), [x, S] = toPair(y), C = toNum(x), w = toNum(S);
|
|
64
|
+
if (g == null) return !1;
|
|
65
|
+
if (v === "eq") return g === _;
|
|
66
|
+
if (v === "ne") return g !== _;
|
|
67
|
+
if (v === "in") return b.includes(g);
|
|
68
|
+
if (v === "not_in") return !b.includes(g);
|
|
69
|
+
if (v === "between") return C != null && w != null && g >= Math.min(C, w) && g <= Math.max(C, w);
|
|
70
|
+
if (v === "not_between") return C != null && w != null && (g < Math.min(C, w) || g > Math.max(C, w));
|
|
71
|
+
if (_ == null) return !1;
|
|
72
|
+
if (v === "lt") return g < _;
|
|
73
|
+
if (v === "gt") return g > _;
|
|
74
|
+
if (v === "lte") return g <= _;
|
|
75
|
+
if (v === "gte") return g >= _;
|
|
76
76
|
}
|
|
77
|
-
if (
|
|
78
|
-
let
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
if (
|
|
82
|
-
if (
|
|
83
|
-
if (
|
|
84
|
-
if (
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
if (
|
|
88
|
-
if (
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
77
|
+
if (_ === "date") {
|
|
78
|
+
let g = toDateTs(e), _ = toDateTs(y), b = toList(y).map(toDateTs).filter((e) => e != null), [x, S] = toPair(y), C = toDateTs(x), w = toDateTs(S);
|
|
79
|
+
if (g == null) return !1;
|
|
80
|
+
if (v === "eq") return g === _;
|
|
81
|
+
if (v === "ne") return g !== _;
|
|
82
|
+
if (v === "in") return b.includes(g);
|
|
83
|
+
if (v === "not_in") return !b.includes(g);
|
|
84
|
+
if (v === "between") return C != null && w != null && g >= Math.min(C, w) && g <= Math.max(C, w);
|
|
85
|
+
if (v === "not_between") return C != null && w != null && (g < Math.min(C, w) || g > Math.max(C, w));
|
|
86
|
+
if (_ == null) return !1;
|
|
87
|
+
if (v === "lt") return g < _;
|
|
88
|
+
if (v === "gt") return g > _;
|
|
89
|
+
if (v === "lte") return g <= _;
|
|
90
|
+
if (v === "gte") return g >= _;
|
|
91
91
|
}
|
|
92
|
-
let
|
|
93
|
-
return
|
|
92
|
+
let b = String(e ?? "").toLowerCase(), x = String(y ?? "").toLowerCase(), S = toList(y).map((e) => String(e).toLowerCase()), [C, w] = toPair(y), T = String(C ?? "").toLowerCase(), E = String(w ?? "").toLowerCase();
|
|
93
|
+
return v === "eq" ? b === x : v === "ne" ? b !== x : v === "in" ? S.includes(b) : v === "not_in" ? !S.includes(b) : v === "between" ? T !== "" && E !== "" && b >= (T < E ? T : E) && b <= (T < E ? E : T) : v === "not_between" ? T !== "" && E !== "" && (b < (T < E ? T : E) || b > (T < E ? E : T)) : v === "startwith" ? b.startsWith(x) : v === "endwith" ? b.endsWith(x) : b.includes(x);
|
|
94
94
|
}
|
|
95
|
-
function evaluateFilterTree(e,
|
|
96
|
-
if (isRuleNode(
|
|
97
|
-
let
|
|
98
|
-
return
|
|
95
|
+
function evaluateFilterTree(e, g, _) {
|
|
96
|
+
if (isRuleNode(g)) return hasActiveRule(g) ? matchFilter(e[g.field], g, _(g)) : !0;
|
|
97
|
+
let v = (g.children ?? []).filter(hasActiveTree);
|
|
98
|
+
return v.length ? g.op === "or" ? v.some((g) => evaluateFilterTree(e, g, _)) : v.every((g) => evaluateFilterTree(e, g, _)) : !0;
|
|
99
99
|
}
|
|
100
|
-
function passesFilters(e,
|
|
101
|
-
let
|
|
100
|
+
function passesFilters(e, g, _) {
|
|
101
|
+
let v = keyBy(_, (e) => e.id);
|
|
102
102
|
return evaluateFilterTree(e, {
|
|
103
103
|
op: "and",
|
|
104
|
-
children:
|
|
105
|
-
}, (e) => normalizeType(
|
|
104
|
+
children: g
|
|
105
|
+
}, (e) => normalizeType(v[e.field]));
|
|
106
106
|
}
|
|
107
107
|
const FilterPlugin = {
|
|
108
108
|
name: "filter",
|
|
109
109
|
rewriteProps: {
|
|
110
|
-
filter: ({ filter: e }, { store:
|
|
110
|
+
filter: ({ filter: e }, { store: g }) => (e = mergeProps$1({
|
|
111
111
|
autoMatch: !0,
|
|
112
112
|
initialValue: [],
|
|
113
113
|
...e
|
|
114
|
-
}, e),
|
|
115
|
-
newRow: ({ newRow: e }, { store:
|
|
116
|
-
let
|
|
117
|
-
return
|
|
118
|
-
if (e[
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
ne: `not ${
|
|
122
|
-
between: toArr(
|
|
114
|
+
}, e), untrack(() => g.filter ??= runWithOwner(g.owner, () => useControlled(e))), g.filter.$setOpt(e), g.filter),
|
|
115
|
+
newRow: ({ newRow: e }, { store: _ }) => function(...v) {
|
|
116
|
+
let y = e(...v), { columns: b } = _.props;
|
|
117
|
+
return b.forEach((e) => {
|
|
118
|
+
if (e[_.internal] || !e.filterable) return;
|
|
119
|
+
let v = _.props.filter.value.find((g) => isRuleNode(g) && g.field === e.id);
|
|
120
|
+
v && isRuleNode(v) && (y[e.id] = {
|
|
121
|
+
ne: `not ${v.value}`,
|
|
122
|
+
between: toArr(v.value)[0],
|
|
123
123
|
not_between: NaN,
|
|
124
|
-
in: toArr(
|
|
124
|
+
in: toArr(v.value)[0],
|
|
125
125
|
not_in: "",
|
|
126
|
-
lt:
|
|
127
|
-
gt:
|
|
126
|
+
lt: v.value - 1,
|
|
127
|
+
gt: v.value + 1,
|
|
128
128
|
blank: "",
|
|
129
129
|
noblank: "default",
|
|
130
130
|
true: !0,
|
|
131
131
|
false: !1
|
|
132
|
-
}[
|
|
133
|
-
}),
|
|
132
|
+
}[v.op] ?? v.value);
|
|
133
|
+
}), y;
|
|
134
134
|
},
|
|
135
|
-
data: ({ data: e }, { store:
|
|
135
|
+
data: ({ data: e }, { store: g }) => {
|
|
136
136
|
if (!e) return e;
|
|
137
|
-
let { columns:
|
|
138
|
-
return !
|
|
137
|
+
let { columns: _ } = g.props, v = g.props.filter;
|
|
138
|
+
return !v.autoMatch || !v.value.some(hasActiveTree) ? e : e.filter((e) => passesFilters(e, v.value, _));
|
|
139
139
|
},
|
|
140
|
-
Th: ({ Th:
|
|
141
|
-
let
|
|
142
|
-
return createComponent(
|
|
143
|
-
return [memo(() =>
|
|
140
|
+
Th: ({ Th: g }, { store: v }) => (y) => {
|
|
141
|
+
let S = () => !!y.col.filterable && !y.col[v.internal];
|
|
142
|
+
return createComponent(g, mergeProps$2(y, { get children() {
|
|
143
|
+
return [memo(() => y.children), createComponent(Show, {
|
|
144
144
|
get when() {
|
|
145
|
-
return
|
|
145
|
+
return S();
|
|
146
146
|
},
|
|
147
147
|
get children() {
|
|
148
148
|
return createComponent(Filter, {
|
|
149
149
|
get col() {
|
|
150
|
-
return
|
|
150
|
+
return y.col;
|
|
151
151
|
},
|
|
152
152
|
get tree() {
|
|
153
|
-
return findret(
|
|
153
|
+
return findret(v.props.filter.value, (e) => firstRule(e)?.field === y.col.id ? e : null);
|
|
154
154
|
},
|
|
155
155
|
setTree: (e) => {
|
|
156
|
-
let
|
|
157
|
-
e ?
|
|
156
|
+
let g = [...v.props.filter.value], _ = g.findIndex((e) => firstRule(e)?.field == y.col.id);
|
|
157
|
+
e ? _ > -1 ? g[_] = e : g.push(e) : _ > -1 && g.splice(_, 1), v.props.filter?.onChange?.(g);
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -157,7 +157,7 @@ var createEditor = (e) => (y) => createRoot((b) => {
|
|
|
157
157
|
get valueObject() {
|
|
158
158
|
return !T();
|
|
159
159
|
},
|
|
160
|
-
class: "min-h-full outline-1.5 outline-offset--1.5 outline-[--c-primary] bg-[--table-bg] py-1",
|
|
160
|
+
class: "min-h-full outline-1.5 outline-offset--1.5 outline-[--in-c-primary] bg-[--in-table-bg] py-1",
|
|
161
161
|
border: !1,
|
|
162
162
|
get multiple() {
|
|
163
163
|
return w();
|
|
@@ -140,7 +140,7 @@ const Checkbox = (e) => {
|
|
|
140
140
|
let C = () => {
|
|
141
141
|
let S = Number(e.value) || 0;
|
|
142
142
|
return S <= 1 ? Math.round(S * 100) : Math.min(100, Math.max(0, Math.round(S)));
|
|
143
|
-
}, w = () => "var(--c-primary)";
|
|
143
|
+
}, w = () => "var(--in-c-primary)";
|
|
144
144
|
return S = combineProps({ get class() {
|
|
145
145
|
return "in-progress flex items-center h-full w-full";
|
|
146
146
|
} }, S), (() => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type JSX } from 'solid-js';
|
|
2
1
|
import { type Plugin, type TDProps } from '../..';
|
|
3
2
|
declare module '../../index' {
|
|
4
3
|
interface TableProps {
|
|
@@ -19,7 +18,7 @@ declare module '../../index' {
|
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
|
-
export type Render = (props: TDProps) =>
|
|
21
|
+
export type Render = (props: TDProps) => any;
|
|
23
22
|
export declare const RenderPlugin: Plugin;
|
|
24
23
|
export { text2colorMap } from './components';
|
|
25
24
|
export declare const renders: Record<string, Render>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { mergeProps as mergeProps$2 } from "../mergeProps2.js";
|
|
2
2
|
import { useControlled } from "../hooks/useControlled.js";
|
|
3
3
|
import { createComponent, insert, memo, template } from "solid-js/web";
|
|
4
|
-
import { Show, mergeProps as mergeProps$1 } from "solid-js";
|
|
4
|
+
import { Show, mergeProps as mergeProps$1, runWithOwner, untrack } from "solid-js";
|
|
5
5
|
import { combineProps } from "@solid-primitives/props";
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2 class=\"w-3.5 h-3.5 opacity-50 shrink-0 flex-none ml-1\"><path stroke-linecap=round stroke-linejoin=round d=\"M8 9l4-4 4 4M16 15l-4 4-4-4\">"), _tmpl$2 = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2.5 class=\"w-3.5 h-3.5 shrink-0 flex-none ml-1\"style=color:var(--c-primary,#6366f1)><path stroke-linecap=round stroke-linejoin=round d=\"M5 15l7-7 7 7\">"), _tmpl$3 = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2.5 class=\"w-3.5 h-3.5 shrink-0 flex-none ml-1\"style=color:var(--c-primary,#6366f1)><path stroke-linecap=round stroke-linejoin=round d=\"M19 9l-7 7-7-7\">"), _tmpl$4 = /* @__PURE__ */ template("<div class=\"flex items-center w-full\">");
|
|
7
|
-
function compareValues(e,
|
|
8
|
-
if (e == null &&
|
|
6
|
+
var _tmpl$ = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2 class=\"w-3.5 h-3.5 opacity-50 shrink-0 flex-none ml-1\"><path stroke-linecap=round stroke-linejoin=round d=\"M8 9l4-4 4 4M16 15l-4 4-4-4\">"), _tmpl$2 = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2.5 class=\"w-3.5 h-3.5 shrink-0 flex-none ml-1\"style=color:var(--in-c-primary,#6366f1)><path stroke-linecap=round stroke-linejoin=round d=\"M5 15l7-7 7 7\">"), _tmpl$3 = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2.5 class=\"w-3.5 h-3.5 shrink-0 flex-none ml-1\"style=color:var(--in-c-primary,#6366f1)><path stroke-linecap=round stroke-linejoin=round d=\"M19 9l-7 7-7-7\">"), _tmpl$4 = /* @__PURE__ */ template("<div class=\"flex items-center w-full\">");
|
|
7
|
+
function compareValues(e, u) {
|
|
8
|
+
if (e == null && u == null) return 0;
|
|
9
9
|
if (e == null) return -1;
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
if (!Number.isNaN(
|
|
13
|
-
if (typeof e == "string" && typeof
|
|
14
|
-
let
|
|
15
|
-
if (!Number.isNaN(
|
|
10
|
+
if (u == null) return 1;
|
|
11
|
+
let d = Number(e), f = Number(u);
|
|
12
|
+
if (!Number.isNaN(d) && !Number.isNaN(f)) return d - f;
|
|
13
|
+
if (typeof e == "string" && typeof u == "string") {
|
|
14
|
+
let d = Date.parse(e), f = Date.parse(u);
|
|
15
|
+
if (!Number.isNaN(d) && !Number.isNaN(f) && d !== f) return d - f;
|
|
16
16
|
}
|
|
17
|
-
return typeof e == "boolean" && typeof
|
|
17
|
+
return typeof e == "boolean" && typeof u == "boolean" ? Number(e) - Number(u) : String(e).localeCompare(String(u), void 0, {
|
|
18
18
|
numeric: !0,
|
|
19
19
|
sensitivity: "base"
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function applySort(e,
|
|
23
|
-
return
|
|
24
|
-
for (let { field:
|
|
25
|
-
let
|
|
26
|
-
if (
|
|
22
|
+
function applySort(e, u, d) {
|
|
23
|
+
return u.length ? [...e].sort((e, f) => {
|
|
24
|
+
for (let { field: p, order: m } of u) {
|
|
25
|
+
let u = d[p], h = u?.sortComparator ? u.sortComparator(e[p], f[p]) : compareValues(e[p], f[p]);
|
|
26
|
+
if (h !== 0) return m === "asc" ? h : -h;
|
|
27
27
|
}
|
|
28
28
|
return 0;
|
|
29
29
|
}) : e;
|
|
@@ -33,56 +33,56 @@ const SortPlugin = [{
|
|
|
33
33
|
name: "sort",
|
|
34
34
|
priority: -1,
|
|
35
35
|
rewriteProps: {
|
|
36
|
-
sort: ({ sort: e }, { store:
|
|
36
|
+
sort: ({ sort: e }, { store: d }) => (e = mergeProps$1({
|
|
37
37
|
multiple: !1,
|
|
38
38
|
autoSort: !0,
|
|
39
39
|
initialValue: []
|
|
40
|
-
}, e),
|
|
41
|
-
data: ({ data: e }, { store:
|
|
42
|
-
let
|
|
43
|
-
if (!
|
|
44
|
-
let
|
|
45
|
-
return applySort(e,
|
|
40
|
+
}, e), untrack(() => d.sort ??= runWithOwner(d.owner, () => useControlled(e))), d.sort.$setOpt(e), d.sort),
|
|
41
|
+
data: ({ data: e }, { store: u }) => {
|
|
42
|
+
let d = u.props.sort;
|
|
43
|
+
if (!d.value?.length || !d.autoSort) return e;
|
|
44
|
+
let f = Object.fromEntries(u.props.columns.map((e) => [e.id, e]));
|
|
45
|
+
return applySort(e, d.value, f);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}, {
|
|
49
49
|
name: "sort-th",
|
|
50
|
-
rewriteProps: { Th: ({ Th:
|
|
51
|
-
let
|
|
50
|
+
rewriteProps: { Th: ({ Th: u }, { store: m }) => (g) => {
|
|
51
|
+
let _ = mergeProps$2(() => m.props.sort), v = () => !!g.col.sortable && !g.col[m.internal], y = () => v() ? _.value.find((e) => e.field === g.col.id) : void 0, b = combineProps(g, {
|
|
52
52
|
get class() {
|
|
53
|
-
return
|
|
53
|
+
return v() ? "cursor-pointer select-none" : "";
|
|
54
54
|
},
|
|
55
55
|
onClick: () => {
|
|
56
|
-
if (!
|
|
57
|
-
let e =
|
|
58
|
-
if (
|
|
59
|
-
else if (
|
|
60
|
-
let
|
|
61
|
-
|
|
56
|
+
if (!v()) return;
|
|
57
|
+
let e = g.col.id, u = y(), d = u ? u.order === "asc" ? "desc" : null : "asc", f = _.multiple, p = [..._.value];
|
|
58
|
+
if (f) if (d === null) p = _.value.filter((u) => u.field !== e);
|
|
59
|
+
else if (u) {
|
|
60
|
+
let u = _.value.findIndex((u) => u.field === e);
|
|
61
|
+
p[u] = _.value[u] = {
|
|
62
62
|
field: e,
|
|
63
|
-
order:
|
|
63
|
+
order: d
|
|
64
64
|
};
|
|
65
|
-
} else
|
|
65
|
+
} else p = [..._.value, {
|
|
66
66
|
field: e,
|
|
67
67
|
order: "asc"
|
|
68
68
|
}];
|
|
69
|
-
else
|
|
69
|
+
else p = d ? [{
|
|
70
70
|
field: e,
|
|
71
|
-
order:
|
|
71
|
+
order: d
|
|
72
72
|
}] : [];
|
|
73
|
-
|
|
73
|
+
_.onChange([...p]);
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
-
return createComponent(
|
|
76
|
+
return createComponent(u, mergeProps$2(b, { get children() {
|
|
77
77
|
var e = _tmpl$4();
|
|
78
|
-
return insert(e, () =>
|
|
78
|
+
return insert(e, () => g.children, null), insert(e, createComponent(Show, {
|
|
79
79
|
get when() {
|
|
80
|
-
return
|
|
80
|
+
return v();
|
|
81
81
|
},
|
|
82
82
|
get children() {
|
|
83
83
|
return createComponent(Show, {
|
|
84
84
|
get when() {
|
|
85
|
-
return
|
|
85
|
+
return y();
|
|
86
86
|
},
|
|
87
87
|
get fallback() {
|
|
88
88
|
return createComponent(IconUnsorted, {});
|