@svgrid/enterprise 3.1.9 → 3.1.11
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/LICENSE +17 -13
- package/dist/cdn/svgrid-enterprise.svelte-external.js +2 -1
- package/dist/designer/assets/{GridMenus-BUjkkAU2.js → GridMenus-CWAfhEeT.js} +2 -2
- package/dist/designer/assets/SvDateRangeInput-DbfmXqJj.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-r4FqmR6R.js +1 -0
- package/dist/designer/assets/SvGridCellEditor-DTYOEa8t.js +4 -0
- package/dist/designer/assets/{index-BPU2KNc5.js → index-BnjAONWv.js} +311 -311
- package/dist/designer/assets/index-CLQXR_oM.css +1 -0
- package/dist/designer/index.html +4 -4
- package/dist/fields/BaseTableView.svelte +43 -1
- package/dist/fields/LongTextEditor.svelte +6 -1
- package/dist/fields/RecordView.svelte +36 -9
- package/dist/fields/RowHeader.svelte +22 -3
- package/dist/fields/SelectEditor.svelte +8 -1
- package/dist/fields/SvBase.svelte +42 -2
- package/dist/fields/SvBase.svelte.d.ts +3 -0
- package/dist/fields/SvBaseViewBar.svelte +10 -0
- package/dist/fields/SvBaseViewBar.svelte.d.ts +5 -0
- package/dist/fields/activity.svelte.d.ts +42 -0
- package/dist/fields/activity.svelte.js +57 -0
- package/dist/fields/base-schema.d.ts +1 -1
- package/dist/fields/base-schema.js +7 -0
- package/dist/fields/base-sync.d.ts +21 -0
- package/dist/fields/base-sync.js +9 -7
- package/dist/fields/index.d.ts +1 -1
- package/dist/fields/index.js +9 -2
- package/dist/node/studio.js +3 -2
- package/dist/studio/ui-components.generated.js +1 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/dist/wc/{GridMenus-FtSN_8t9.js → GridMenus-wG7PFpPh.js} +1 -1
- package/dist/wc/{SvDateRangeInput-DR6m7bSM.js → SvDateRangeInput-BYNOfYxD.js} +68 -65
- package/dist/wc/{SvDateTimePicker-D-vRnaMo.js → SvDateTimePicker-Bq9N0Oiy.js} +57 -53
- package/dist/wc/{SvGridCellEditor-B_cLJrsp.js → SvGridCellEditor-C8iNUJrd.js} +158 -147
- package/dist/wc/sv-sheet-element.js +4 -4
- package/package.json +3 -3
- package/dist/designer/assets/SvDateRangeInput-BBRzrQeg.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-DCPg7WGN.js +0 -1
- package/dist/designer/assets/SvGridCellEditor-CJxThKL_.js +0 -4
- package/dist/designer/assets/index-BmvG99kR.css +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { C as e, D as t, G as n, H as r, I as i, L as a, M as o, O as s, P as c, Q as l, R as u, S as d, U as f, W as p, X as m, Y as h, _ as g, at as _, b as v, dt as y, et as b, h as ee, ht as x, i as te, it as S, j as C, m as w, mt as T, n as E, nt as D, p as O, st as k, tt as A, ut as j, w as M, y as ne } from "./client-DQIzjDBG.js";
|
|
2
2
|
import { C as re, d as ie, h as ae, m as oe, o as se, p as ce, v as le, x as ue } from "./SvGrid.helpers-B2GEKrxS.js";
|
|
3
|
-
import { n as de, r as fe, t as
|
|
3
|
+
import { n as de, r as fe, t as N } from "./editor-registry-DxGKqcvx.js";
|
|
4
4
|
//#region ../grid/dist/SvGridCellEditor.svelte
|
|
5
|
-
var
|
|
6
|
-
function
|
|
5
|
+
var P = u("<span class=\"sv-grid-chip sv-grid-chip-removable\"> <button type=\"button\" class=\"sv-grid-chip-remove\">×</button></span>"), F = u("<button type=\"button\" class=\"sv-grid-chip-commit\" aria-label=\"Commit chip selection\">Done</button>"), I = u("<div class=\"sv-grid-cell-editor sv-grid-cell-editor-chips\" role=\"group\"><div class=\"sv-grid-chips-row\"><!> <input class=\"sv-grid-chip-input\" type=\"text\"/> <!></div></div>"), L = u("<input type=\"checkbox\" class=\"sv-grid-fr-editor sv-grid-fr-checkbox\"/>"), R = u("<option> </option>"), z = u("<select class=\"sv-grid-cell-editor sv-grid-fr-editor\"></select>"), B = u("<input class=\"sv-grid-cell-editor sv-grid-fr-editor\"/>"), pe = u("<button type=\"button\" class=\"sv-grid-checkbox\" role=\"checkbox\" aria-label=\"Edit checkbox value\"></button>"), me = u("<button type=\"button\" role=\"radio\">★</button>"), he = u("<span class=\"sv-grid-rating-editor\" role=\"radiogroup\" aria-label=\"Rating\"><!> <button type=\"button\" aria-label=\"Clear rating\" class=\"sv-grid-rating-clear\">×</button></span>"), ge = u("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-textarea\" rows=\"4\"></textarea>"), _e = u("<button type=\"button\" class=\"sv-grid-autocomplete-option\" role=\"option\"> </button>"), ve = u("<div class=\"sv-grid-autocomplete-list\" role=\"listbox\"></div>"), ye = u("<div class=\"sv-grid-autocomplete\"><input class=\"sv-grid-cell-editor sv-grid-cell-editor-autocomplete\" type=\"text\"/> <!></div>"), be = u("<input type=\"color\"/>"), xe = u("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-text sv-grid-cell-editor-multiline\"></textarea>"), Se = u("<input/>");
|
|
6
|
+
function V(r, u) {
|
|
7
7
|
y(u, !0);
|
|
8
|
-
let
|
|
8
|
+
let V = (e, r = x, o = x, l = x, u = x) => {
|
|
9
9
|
var d = a(), m = A(d), g = (e) => {
|
|
10
10
|
var s = a(), c = A(s), l = (e) => {
|
|
11
11
|
var s = a(), c = A(s);
|
|
12
12
|
{
|
|
13
|
-
let e = k(() =>
|
|
14
|
-
t(c, () => n(
|
|
13
|
+
let e = k(() => H().editingCell?.value);
|
|
14
|
+
t(c, () => n(W), (t, i) => {
|
|
15
15
|
i(t, {
|
|
16
16
|
get options() {
|
|
17
17
|
return r();
|
|
@@ -28,14 +28,14 @@ function B(r, u) {
|
|
|
28
28
|
placeholder: "Pick…",
|
|
29
29
|
renderChipsInTrigger: !0,
|
|
30
30
|
onChange: (e) => {
|
|
31
|
-
|
|
32
|
-
...
|
|
31
|
+
H().editingCell = H().editingCell ? {
|
|
32
|
+
...H().editingCell,
|
|
33
33
|
value: e
|
|
34
|
-
} :
|
|
34
|
+
} : H().editingCell;
|
|
35
35
|
},
|
|
36
36
|
onCommit: () => n(J)(),
|
|
37
37
|
onCancel: () => {
|
|
38
|
-
|
|
38
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
});
|
|
@@ -43,28 +43,28 @@ function B(r, u) {
|
|
|
43
43
|
i(e, s);
|
|
44
44
|
};
|
|
45
45
|
C(c, (e) => {
|
|
46
|
-
n(
|
|
46
|
+
n(W) && e(l);
|
|
47
47
|
}), i(e, s);
|
|
48
48
|
}, _ = (e) => {
|
|
49
|
-
var t =
|
|
49
|
+
var t = I();
|
|
50
50
|
w(t, "tabindex", -1);
|
|
51
51
|
var r = b(t), a = b(r);
|
|
52
52
|
s(a, 19, l, (e, t) => String(e) + "_" + t, (e, t, r) => {
|
|
53
|
-
var a =
|
|
53
|
+
var a = P(), s = b(a), u = D(s);
|
|
54
54
|
T(a), h((e, t) => {
|
|
55
55
|
c(s, `${e ?? ""} `), w(u, "aria-label", `Remove ${t ?? ""}`);
|
|
56
56
|
}, [() => String(n(t)), () => String(n(t))]), f("mousedown", u, (e) => e.preventDefault()), f("click", u, () => {
|
|
57
57
|
let e = l().filter((e, t) => t !== n(r));
|
|
58
|
-
|
|
59
|
-
...
|
|
58
|
+
H().editingCell = H().editingCell ? {
|
|
59
|
+
...H().editingCell,
|
|
60
60
|
value: o() ? e : e[0] ?? null
|
|
61
|
-
} :
|
|
61
|
+
} : H().editingCell;
|
|
62
62
|
}), i(e, a);
|
|
63
63
|
});
|
|
64
64
|
var u = D(a, 2);
|
|
65
65
|
M(u, (e) => n(Z)?.(e));
|
|
66
66
|
var d = D(u, 2), m = (e) => {
|
|
67
|
-
var t =
|
|
67
|
+
var t = F();
|
|
68
68
|
f("mousedown", t, (e) => e.preventDefault()), f("click", t, () => n(J)()), i(e, t);
|
|
69
69
|
};
|
|
70
70
|
C(d, (e) => {
|
|
@@ -75,36 +75,36 @@ function B(r, u) {
|
|
|
75
75
|
let t = e.currentTarget, r = t.value.trim();
|
|
76
76
|
if (r) {
|
|
77
77
|
let e = o() ? [...l(), r] : [r];
|
|
78
|
-
|
|
79
|
-
...
|
|
78
|
+
H().editingCell = H().editingCell ? {
|
|
79
|
+
...H().editingCell,
|
|
80
80
|
value: o() ? e : r
|
|
81
|
-
} :
|
|
81
|
+
} : H().editingCell, t.value = "", o() || n(J)();
|
|
82
82
|
}
|
|
83
83
|
} else if (e.key === "Escape") n(X)(e);
|
|
84
84
|
else if (e.key === "Backspace" && e.currentTarget.value === "" && l().length > 0) {
|
|
85
85
|
e.preventDefault();
|
|
86
86
|
let t = l().slice(0, -1);
|
|
87
|
-
|
|
88
|
-
...
|
|
87
|
+
H().editingCell = H().editingCell ? {
|
|
88
|
+
...H().editingCell,
|
|
89
89
|
value: o() ? t : t[0] ?? null
|
|
90
|
-
} :
|
|
90
|
+
} : H().editingCell;
|
|
91
91
|
}
|
|
92
92
|
}), p("blur", u, () => n(J)()), i(e, t);
|
|
93
93
|
};
|
|
94
94
|
C(m, (e) => {
|
|
95
95
|
r().length > 0 ? e(g) : e(_, -1);
|
|
96
96
|
}), i(e, d);
|
|
97
|
-
},
|
|
97
|
+
}, H = E(u, "ctrl", 7), U = E(u, "fullRow", 3, !1), W = _(null), G = _(null);
|
|
98
98
|
m(() => {
|
|
99
|
-
let e =
|
|
100
|
-
(e === "list" || e === "chips" || e === "select" || e === "rich-select") && !n(
|
|
99
|
+
let e = H().editingCell?.editorType;
|
|
100
|
+
(e === "list" || e === "chips" || e === "select" || e === "rich-select") && !n(W) && import("./SvGridDropdown-45WsObLL.js").then((e) => S(W, e.default, !0)), (e === "date" || e === "datetime" || e === "time") && !n(G) && import("./SvDateTimePicker-Bq9N0Oiy.js").then((e) => S(G, e.default, !0));
|
|
101
101
|
});
|
|
102
|
-
let
|
|
102
|
+
let Ce = k(() => H().grid), we = k(() => H().fullRowEdit), K = k(() => H().getColumnEditorOptions), q = k(() => H().areEditorOptionsLoading), J = k(() => H().saveEditingCell), Y = k(() => H().updateEditingCellValue), X = k(() => H().onEditorKeyDown), Z = k(() => H().focusOnMount), Te = k(() => H().toggleCheckboxWithKeyboard);
|
|
103
103
|
function Ee(e, t = !0) {
|
|
104
104
|
t && e.focus({ preventScroll: !0 });
|
|
105
105
|
}
|
|
106
106
|
function Q(e) {
|
|
107
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
107
|
+
e.key === "Enter" ? (e.preventDefault(), H().commitFullRowEdit(), H().gridRootEl?.focus({ preventScroll: !0 })) : e.key === "Escape" && (e.preventDefault(), H().cancelFullRowEdit(), H().gridRootEl?.focus({ preventScroll: !0 }));
|
|
108
108
|
}
|
|
109
109
|
function De(e) {
|
|
110
110
|
return typeof e == "object" && e && "value" in e ? String(e.value) : String(e);
|
|
@@ -112,8 +112,13 @@ function B(r, u) {
|
|
|
112
112
|
function Oe(e) {
|
|
113
113
|
return typeof e == "object" && e && "label" in e ? String(e.label) : String(e);
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
let ke;
|
|
116
|
+
function Ae(e) {
|
|
117
|
+
let t = N(e);
|
|
118
|
+
return t && (ke = t), t ?? ke;
|
|
119
|
+
}
|
|
120
|
+
function je() {
|
|
121
|
+
let e = H().editingCell;
|
|
117
122
|
return {
|
|
118
123
|
value: e?.value,
|
|
119
124
|
rowId: e?.rowId ?? "",
|
|
@@ -121,36 +126,36 @@ function B(r, u) {
|
|
|
121
126
|
columnDef: u.column.columnDef,
|
|
122
127
|
row: u.row.original,
|
|
123
128
|
typed: e?.typed === !0,
|
|
124
|
-
grid:
|
|
129
|
+
grid: H(),
|
|
125
130
|
onChange: (e) => n(Y)(e),
|
|
126
131
|
onCommit: (e) => {
|
|
127
132
|
e !== void 0 && n(Y)(e), n(J)();
|
|
128
133
|
},
|
|
129
134
|
onCancel: () => {
|
|
130
|
-
|
|
135
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
131
136
|
},
|
|
132
137
|
onCommitAndMove: (e, t) => {
|
|
133
|
-
e !== void 0 && n(Y)(e),
|
|
138
|
+
e !== void 0 && n(Y)(e), H().commitAndMoveByTab(t === -1);
|
|
134
139
|
},
|
|
135
140
|
onCommitAndMoveDown: (e, t) => {
|
|
136
|
-
e !== void 0 && n(Y)(e),
|
|
141
|
+
e !== void 0 && n(Y)(e), H().commitAndMoveByEnter(t === !0);
|
|
137
142
|
},
|
|
138
143
|
onRequestClose: () => {
|
|
139
|
-
|
|
144
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
140
145
|
},
|
|
141
146
|
inCell: !0
|
|
142
147
|
};
|
|
143
148
|
}
|
|
144
|
-
var $ = a(),
|
|
145
|
-
let t = k(() => u.column.columnDef.editorType ?? "text"), r = k(() => n(
|
|
149
|
+
var $ = a(), Me = A($), Ne = (e) => {
|
|
150
|
+
let t = k(() => u.column.columnDef.editorType ?? "text"), r = k(() => n(we)?.draft[u.column.id]);
|
|
146
151
|
var o = a(), l = A(o), d = (e) => {
|
|
147
|
-
var t =
|
|
148
|
-
O(t), h((e) => ee(t, e), [() => !!n(r)]), f("change", t, (e) =>
|
|
152
|
+
var t = L();
|
|
153
|
+
O(t), h((e) => ee(t, e), [() => !!n(r)]), f("change", t, (e) => H().setFullRowDraft(u.column.id, e.currentTarget.checked)), f("keydown", t, Q), f("pointerdown", t, (e) => e.stopPropagation()), f("click", t, (e) => e.stopPropagation()), i(e, t);
|
|
149
154
|
}, p = (e) => {
|
|
150
155
|
let t = k(() => n(K)(u.column, u.row));
|
|
151
|
-
var a =
|
|
156
|
+
var a = z();
|
|
152
157
|
s(a, 21, () => n(t), (e) => De(e), (e, t) => {
|
|
153
|
-
var r =
|
|
158
|
+
var r = R(), a = b(r, !0);
|
|
154
159
|
T(r);
|
|
155
160
|
var o = {};
|
|
156
161
|
h((e, t) => {
|
|
@@ -160,18 +165,18 @@ function B(r, u) {
|
|
|
160
165
|
var o;
|
|
161
166
|
ne(a), h((e) => {
|
|
162
167
|
o !== (o = e) && (a.value = (a.__value = e) ?? "", v(a, e));
|
|
163
|
-
}, [() => String(n(r) ?? "")]), f("change", a, (e) =>
|
|
168
|
+
}, [() => String(n(r) ?? "")]), f("change", a, (e) => H().setFullRowDraft(u.column.id, e.currentTarget.value)), f("keydown", a, Q), f("pointerdown", a, (e) => e.stopPropagation()), f("click", a, (e) => e.stopPropagation()), i(e, a);
|
|
164
169
|
}, m = (e) => {
|
|
165
170
|
let a = k(() => n(t) === "number" ? "number" : n(t) === "date" ? "date" : n(t) === "datetime" ? "datetime-local" : n(t) === "time" ? "time" : n(t) === "password" ? "password" : "text");
|
|
166
|
-
var o =
|
|
171
|
+
var o = B();
|
|
167
172
|
O(o), h((e) => {
|
|
168
173
|
w(o, "type", n(a)), g(o, e);
|
|
169
|
-
}, [() => String(n(r) ?? "")]), f("input", o, (e) =>
|
|
174
|
+
}, [() => String(n(r) ?? "")]), f("input", o, (e) => H().setFullRowDraft(u.column.id, e.currentTarget.value)), f("keydown", o, Q), f("pointerdown", o, (e) => e.stopPropagation()), f("click", o, (e) => e.stopPropagation()), i(e, o);
|
|
170
175
|
};
|
|
171
176
|
C(l, (e) => {
|
|
172
177
|
n(t) === "checkbox" ? e(d) : n(t) === "list" || n(t) === "select" || n(t) === "rich-select" ? e(p, 1) : e(m, -1);
|
|
173
178
|
}), i(e, o);
|
|
174
|
-
},
|
|
179
|
+
}, Pe = (r) => {
|
|
175
180
|
var m = a(), _ = A(m), v = (e) => {
|
|
176
181
|
let t = k(() => u.column.columnDef.cellEditor);
|
|
177
182
|
var r = a(), s = A(r);
|
|
@@ -180,46 +185,46 @@ function B(r, u) {
|
|
|
180
185
|
cell: u.row.getAllCells().find((e) => e.column.id === u.column.id),
|
|
181
186
|
row: u.row,
|
|
182
187
|
column: u.column,
|
|
183
|
-
table: n(
|
|
184
|
-
getValue: () =>
|
|
185
|
-
value:
|
|
188
|
+
table: n(Ce),
|
|
189
|
+
getValue: () => H().editingCell?.value,
|
|
190
|
+
value: H().editingCell?.value,
|
|
186
191
|
update: (e) => {
|
|
187
|
-
|
|
188
|
-
...
|
|
192
|
+
H().editingCell = H().editingCell ? {
|
|
193
|
+
...H().editingCell,
|
|
189
194
|
value: e
|
|
190
|
-
} :
|
|
195
|
+
} : H().editingCell;
|
|
191
196
|
},
|
|
192
197
|
commit: (e) => {
|
|
193
|
-
e !== void 0 && (
|
|
194
|
-
...
|
|
198
|
+
e !== void 0 && (H().editingCell = H().editingCell ? {
|
|
199
|
+
...H().editingCell,
|
|
195
200
|
value: e
|
|
196
|
-
} :
|
|
201
|
+
} : H().editingCell), n(J)();
|
|
197
202
|
},
|
|
198
203
|
cancel: () => {
|
|
199
|
-
|
|
204
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
200
205
|
}
|
|
201
206
|
}));
|
|
202
207
|
o(s, () => n(t), () => n(e));
|
|
203
208
|
}
|
|
204
209
|
i(e, r);
|
|
205
210
|
}, y = (e) => {
|
|
206
|
-
var t =
|
|
207
|
-
M(t, (e) => Ee?.(e)), h((e) => w(t, "aria-checked", e), [() => !!
|
|
211
|
+
var t = pe();
|
|
212
|
+
M(t, (e) => Ee?.(e)), h((e) => w(t, "aria-checked", e), [() => !!H().editingCell.value]), f("click", t, (e) => {
|
|
208
213
|
e.stopPropagation();
|
|
209
|
-
let t = !
|
|
210
|
-
|
|
211
|
-
...
|
|
214
|
+
let t = !H().editingCell?.value;
|
|
215
|
+
H().editingCell = H().editingCell ? {
|
|
216
|
+
...H().editingCell,
|
|
212
217
|
value: t
|
|
213
|
-
} :
|
|
218
|
+
} : H().editingCell, n(J)();
|
|
214
219
|
}), f("keydown", t, (e) => {
|
|
215
220
|
if (e.key === "Enter" || e.key === " ") {
|
|
216
221
|
n(Te)(e, () => {
|
|
217
222
|
e.stopPropagation();
|
|
218
|
-
let t = !
|
|
219
|
-
|
|
220
|
-
...
|
|
223
|
+
let t = !H().editingCell?.value;
|
|
224
|
+
H().editingCell = H().editingCell ? {
|
|
225
|
+
...H().editingCell,
|
|
221
226
|
value: t
|
|
222
|
-
} :
|
|
227
|
+
} : H().editingCell, n(J)();
|
|
223
228
|
});
|
|
224
229
|
return;
|
|
225
230
|
}
|
|
@@ -230,8 +235,8 @@ function B(r, u) {
|
|
|
230
235
|
var c = a(), l = A(c), d = (e) => {
|
|
231
236
|
var c = a(), l = A(c);
|
|
232
237
|
{
|
|
233
|
-
let e = k(() =>
|
|
234
|
-
t(l, () => n(
|
|
238
|
+
let e = k(() => H().editingCell?.value);
|
|
239
|
+
t(l, () => n(W), (t, i) => {
|
|
235
240
|
i(t, {
|
|
236
241
|
get options() {
|
|
237
242
|
return n(r);
|
|
@@ -247,14 +252,14 @@ function B(r, u) {
|
|
|
247
252
|
},
|
|
248
253
|
placeholder: "Select…",
|
|
249
254
|
onChange: (e) => {
|
|
250
|
-
|
|
251
|
-
...
|
|
255
|
+
H().editingCell = H().editingCell ? {
|
|
256
|
+
...H().editingCell,
|
|
252
257
|
value: e
|
|
253
|
-
} :
|
|
258
|
+
} : H().editingCell;
|
|
254
259
|
},
|
|
255
260
|
onCommit: () => n(J)(),
|
|
256
261
|
onCancel: () => {
|
|
257
|
-
|
|
262
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
258
263
|
}
|
|
259
264
|
});
|
|
260
265
|
});
|
|
@@ -262,14 +267,14 @@ function B(r, u) {
|
|
|
262
267
|
i(e, c);
|
|
263
268
|
};
|
|
264
269
|
C(l, (e) => {
|
|
265
|
-
n(
|
|
270
|
+
n(W) && e(d);
|
|
266
271
|
}), i(e, c);
|
|
267
272
|
}, x = (e) => {
|
|
268
|
-
let t = k(() => n(K)(u.column, u.row)), r = k(() => n(q)(u.column, u.row)), i = k(() => u.column.columnDef.editorMultiple === !0), a = k(() => re(
|
|
269
|
-
|
|
273
|
+
let t = k(() => n(K)(u.column, u.row)), r = k(() => n(q)(u.column, u.row)), i = k(() => u.column.columnDef.editorMultiple === !0), a = k(() => re(H().editingCell?.value));
|
|
274
|
+
V(e, () => n(t), () => n(i), () => n(a), () => n(r));
|
|
270
275
|
}, S = (e) => {
|
|
271
|
-
let t = k(() => Math.max(0, Math.min(5, Math.round(Number(
|
|
272
|
-
var a =
|
|
276
|
+
let t = k(() => Math.max(0, Math.min(5, Math.round(Number(H().editingCell?.value) || 0)))), r = k(() => Math.min(5, Math.max(1, n(t))));
|
|
277
|
+
var a = he(), o = b(a);
|
|
273
278
|
s(o, 16, () => [
|
|
274
279
|
1,
|
|
275
280
|
2,
|
|
@@ -277,14 +282,14 @@ function B(r, u) {
|
|
|
277
282
|
4,
|
|
278
283
|
5
|
|
279
284
|
], (e) => e, (e, a) => {
|
|
280
|
-
var o =
|
|
285
|
+
var o = me();
|
|
281
286
|
M(o, (e, t) => Ee?.(e, t), () => a === n(r)), h(() => {
|
|
282
287
|
w(o, "aria-checked", n(t) >= a), w(o, "aria-label", `${a} ${a === 1 ? "star" : "stars"}`), d(o, 1, `sv-grid-rating-star ${n(t) >= a ? "sv-grid-rating-star-on" : ""}`);
|
|
283
288
|
}), f("mousedown", o, (e) => e.preventDefault()), f("click", o, (e) => {
|
|
284
|
-
e.stopPropagation(),
|
|
285
|
-
...
|
|
289
|
+
e.stopPropagation(), H().editingCell = H().editingCell ? {
|
|
290
|
+
...H().editingCell,
|
|
286
291
|
value: a
|
|
287
|
-
} :
|
|
292
|
+
} : H().editingCell, n(J)();
|
|
288
293
|
}), f("keydown", o, (e) => {
|
|
289
294
|
let r = e.key;
|
|
290
295
|
if (r !== "ArrowLeft" && r !== "ArrowRight" && r !== "Home" && r !== "End") {
|
|
@@ -293,26 +298,26 @@ function B(r, u) {
|
|
|
293
298
|
}
|
|
294
299
|
e.preventDefault(), e.stopPropagation();
|
|
295
300
|
let i = Math.min(5, Math.max(1, n(t))), a = r === "Home" ? 1 : r === "End" ? 5 : r === "ArrowLeft" ? Math.max(1, i - 1) : Math.min(5, i + 1);
|
|
296
|
-
|
|
297
|
-
...
|
|
301
|
+
H().editingCell = H().editingCell ? {
|
|
302
|
+
...H().editingCell,
|
|
298
303
|
value: a
|
|
299
|
-
} :
|
|
304
|
+
} : H().editingCell, (e.currentTarget.parentElement?.querySelectorAll(".sv-grid-rating-star"))?.[a - 1]?.focus({ preventScroll: !0 });
|
|
300
305
|
}), i(e, o);
|
|
301
306
|
});
|
|
302
307
|
var c = D(o, 2);
|
|
303
308
|
T(a), f("mousedown", c, (e) => e.preventDefault()), f("click", c, (e) => {
|
|
304
|
-
e.stopPropagation(),
|
|
305
|
-
...
|
|
309
|
+
e.stopPropagation(), H().editingCell = H().editingCell ? {
|
|
310
|
+
...H().editingCell,
|
|
306
311
|
value: 0
|
|
307
|
-
} :
|
|
312
|
+
} : H().editingCell, n(J)();
|
|
308
313
|
}), i(e, a);
|
|
309
314
|
}, E = (e) => {
|
|
310
315
|
let r = k(() => n(K)(u.column, u.row)), o = k(() => n(q)(u.column, u.row));
|
|
311
316
|
var s = a(), c = A(s), l = (e) => {
|
|
312
317
|
var s = a(), c = A(s);
|
|
313
318
|
{
|
|
314
|
-
let e = k(() =>
|
|
315
|
-
t(c, () => n(
|
|
319
|
+
let e = k(() => H().editingCell?.value);
|
|
320
|
+
t(c, () => n(W), (t, i) => {
|
|
316
321
|
i(t, {
|
|
317
322
|
get options() {
|
|
318
323
|
return n(r);
|
|
@@ -326,14 +331,14 @@ function B(r, u) {
|
|
|
326
331
|
multiple: !1,
|
|
327
332
|
placeholder: "Select…",
|
|
328
333
|
onChange: (e) => {
|
|
329
|
-
|
|
330
|
-
...
|
|
334
|
+
H().editingCell = H().editingCell ? {
|
|
335
|
+
...H().editingCell,
|
|
331
336
|
value: e
|
|
332
|
-
} :
|
|
337
|
+
} : H().editingCell;
|
|
333
338
|
},
|
|
334
339
|
onCommit: () => n(J)(),
|
|
335
340
|
onCancel: () => {
|
|
336
|
-
|
|
341
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
337
342
|
}
|
|
338
343
|
});
|
|
339
344
|
});
|
|
@@ -341,15 +346,15 @@ function B(r, u) {
|
|
|
341
346
|
i(e, s);
|
|
342
347
|
};
|
|
343
348
|
C(c, (e) => {
|
|
344
|
-
n(
|
|
349
|
+
n(W) && e(l);
|
|
345
350
|
}), i(e, s);
|
|
346
351
|
}, j = (e) => {
|
|
347
352
|
let r = k(() => n(K)(u.column, u.row)), o = k(() => n(q)(u.column, u.row));
|
|
348
353
|
var s = a(), c = A(s), l = (e) => {
|
|
349
354
|
var s = a(), c = A(s);
|
|
350
355
|
{
|
|
351
|
-
let e = k(() =>
|
|
352
|
-
t(c, () => n(
|
|
356
|
+
let e = k(() => H().editingCell?.value);
|
|
357
|
+
t(c, () => n(W), (t, i) => {
|
|
353
358
|
i(t, {
|
|
354
359
|
get options() {
|
|
355
360
|
return n(r);
|
|
@@ -364,14 +369,14 @@ function B(r, u) {
|
|
|
364
369
|
searchable: !0,
|
|
365
370
|
placeholder: "Search…",
|
|
366
371
|
onChange: (e) => {
|
|
367
|
-
|
|
368
|
-
...
|
|
372
|
+
H().editingCell = H().editingCell ? {
|
|
373
|
+
...H().editingCell,
|
|
369
374
|
value: e
|
|
370
|
-
} :
|
|
375
|
+
} : H().editingCell;
|
|
371
376
|
},
|
|
372
377
|
onCommit: () => n(J)(),
|
|
373
378
|
onCancel: () => {
|
|
374
|
-
|
|
379
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
375
380
|
}
|
|
376
381
|
});
|
|
377
382
|
});
|
|
@@ -379,36 +384,36 @@ function B(r, u) {
|
|
|
379
384
|
i(e, s);
|
|
380
385
|
};
|
|
381
386
|
C(c, (e) => {
|
|
382
|
-
n(
|
|
387
|
+
n(W) && e(l);
|
|
383
388
|
}), i(e, s);
|
|
384
389
|
}, ne = (e) => {
|
|
385
|
-
var t =
|
|
386
|
-
l(t), M(t, (e) => n(Z)?.(e)), h((e) => g(t, e), [() => String(
|
|
390
|
+
var t = ge();
|
|
391
|
+
l(t), M(t, (e) => n(Z)?.(e)), h((e) => g(t, e), [() => String(H().editingCell?.value ?? "")]), f("pointerdown", t, (e) => e.stopPropagation()), f("input", t, (e) => n(Y)(e.currentTarget.value)), f("keydown", t, (e) => {
|
|
387
392
|
if (e.stopPropagation(), e.key === "Escape") {
|
|
388
|
-
e.preventDefault(),
|
|
393
|
+
e.preventDefault(), H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
389
394
|
return;
|
|
390
395
|
}
|
|
391
396
|
if (e.key === "Tab") {
|
|
392
|
-
e.preventDefault(),
|
|
397
|
+
e.preventDefault(), H().commitAndMoveByTab(e.shiftKey);
|
|
393
398
|
return;
|
|
394
399
|
}
|
|
395
|
-
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), n(J)(),
|
|
400
|
+
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), n(J)(), H().gridRootEl?.focus({ preventScroll: !0 }));
|
|
396
401
|
}), p("blur", t, () => n(J)()), i(e, t);
|
|
397
402
|
}, N = (e) => {
|
|
398
|
-
let t = k(() => n(K)(u.column, u.row)), r = k(() => String(
|
|
399
|
-
var o =
|
|
403
|
+
let t = k(() => n(K)(u.column, u.row)), r = k(() => String(H().editingCell?.value ?? "")), a = k(() => n(r).trim() ? n(t).filter((e) => String(e.label).toLowerCase().includes(n(r).toLowerCase())) : n(t));
|
|
404
|
+
var o = ye(), l = b(o);
|
|
400
405
|
O(l), M(l, (e) => n(Z)?.(e));
|
|
401
406
|
var d = D(l, 2), m = (e) => {
|
|
402
|
-
var t =
|
|
407
|
+
var t = ve();
|
|
403
408
|
s(t, 21, () => n(a).slice(0, 50), (e) => e.value, (e, t) => {
|
|
404
|
-
var a =
|
|
409
|
+
var a = _e(), o = b(a, !0);
|
|
405
410
|
T(a), h((e) => {
|
|
406
411
|
w(a, "aria-selected", e), c(o, n(t).label);
|
|
407
412
|
}, [() => String(n(t).value) === n(r)]), f("mousedown", a, (e) => {
|
|
408
|
-
e.preventDefault(),
|
|
409
|
-
...
|
|
413
|
+
e.preventDefault(), H().editingCell = H().editingCell ? {
|
|
414
|
+
...H().editingCell,
|
|
410
415
|
value: n(t).value
|
|
411
|
-
} :
|
|
416
|
+
} : H().editingCell, n(J)();
|
|
412
417
|
}), i(e, a);
|
|
413
418
|
}), T(t), i(e, t);
|
|
414
419
|
};
|
|
@@ -421,8 +426,8 @@ function B(r, u) {
|
|
|
421
426
|
var r = a(), o = A(r), s = (e) => {
|
|
422
427
|
var r = a(), o = A(r);
|
|
423
428
|
{
|
|
424
|
-
let e = k(() =>
|
|
425
|
-
t(o, () => n(
|
|
429
|
+
let e = k(() => H().editingCell?.value), r = k(() => u.column.columnDef.editorFormatString ?? "yyyy-MM-dd");
|
|
430
|
+
t(o, () => n(G), (t, i) => {
|
|
426
431
|
i(t, {
|
|
427
432
|
get value() {
|
|
428
433
|
return n(e);
|
|
@@ -436,7 +441,7 @@ function B(r, u) {
|
|
|
436
441
|
onChange: (e) => n(Y)(e),
|
|
437
442
|
onCommit: () => n(J)(),
|
|
438
443
|
onCancel: () => {
|
|
439
|
-
|
|
444
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
440
445
|
}
|
|
441
446
|
});
|
|
442
447
|
});
|
|
@@ -444,14 +449,14 @@ function B(r, u) {
|
|
|
444
449
|
i(e, r);
|
|
445
450
|
};
|
|
446
451
|
C(o, (e) => {
|
|
447
|
-
n(
|
|
452
|
+
n(G) && e(s);
|
|
448
453
|
}), i(e, r);
|
|
449
454
|
}, F = (e) => {
|
|
450
455
|
var r = a(), o = A(r), s = (e) => {
|
|
451
456
|
var r = a(), o = A(r);
|
|
452
457
|
{
|
|
453
|
-
let e = k(() =>
|
|
454
|
-
t(o, () => n(
|
|
458
|
+
let e = k(() => H().editingCell?.value), r = k(() => u.column.columnDef.editorFormatString ?? "yyyy-MM-dd HH:mm");
|
|
459
|
+
t(o, () => n(G), (t, i) => {
|
|
455
460
|
i(t, {
|
|
456
461
|
get value() {
|
|
457
462
|
return n(e);
|
|
@@ -465,7 +470,7 @@ function B(r, u) {
|
|
|
465
470
|
onChange: (e) => n(Y)(e),
|
|
466
471
|
onCommit: () => n(J)(),
|
|
467
472
|
onCancel: () => {
|
|
468
|
-
|
|
473
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
469
474
|
}
|
|
470
475
|
});
|
|
471
476
|
});
|
|
@@ -473,14 +478,14 @@ function B(r, u) {
|
|
|
473
478
|
i(e, r);
|
|
474
479
|
};
|
|
475
480
|
C(o, (e) => {
|
|
476
|
-
n(
|
|
481
|
+
n(G) && e(s);
|
|
477
482
|
}), i(e, r);
|
|
478
483
|
}, I = (e) => {
|
|
479
484
|
var r = a(), o = A(r), s = (e) => {
|
|
480
485
|
var r = a(), o = A(r);
|
|
481
486
|
{
|
|
482
|
-
let e = k(() => ue(
|
|
483
|
-
t(o, () => n(
|
|
487
|
+
let e = k(() => ue(H().editingCell?.value));
|
|
488
|
+
t(o, () => n(G), (t, r) => {
|
|
484
489
|
r(t, {
|
|
485
490
|
get value() {
|
|
486
491
|
return n(e);
|
|
@@ -492,7 +497,7 @@ function B(r, u) {
|
|
|
492
497
|
onChange: (e) => n(Y)(se(e)),
|
|
493
498
|
onCommit: () => n(J)(),
|
|
494
499
|
onCancel: () => {
|
|
495
|
-
|
|
500
|
+
H().editingCell = null, H().gridRootEl?.focus({ preventScroll: !0 });
|
|
496
501
|
}
|
|
497
502
|
});
|
|
498
503
|
});
|
|
@@ -500,50 +505,56 @@ function B(r, u) {
|
|
|
500
505
|
i(e, r);
|
|
501
506
|
};
|
|
502
507
|
C(o, (e) => {
|
|
503
|
-
n(
|
|
508
|
+
n(G) && e(s);
|
|
504
509
|
}), i(e, r);
|
|
505
510
|
}, L = (t) => {
|
|
506
|
-
var r =
|
|
511
|
+
var r = be();
|
|
507
512
|
O(r), M(r, (e) => n(Z)?.(e)), h((e, t) => {
|
|
508
513
|
d(r, 1, e), g(r, t);
|
|
509
|
-
}, [() => e(oe("color")), () => ce("color",
|
|
514
|
+
}, [() => e(oe("color")), () => ce("color", H().editingCell?.value)]), f("input", r, (e) => n(Y)(e.currentTarget.value)), f("change", r, (e) => {
|
|
510
515
|
n(Y)(e.currentTarget.value), n(J)();
|
|
511
516
|
}), p("blur", r, () => n(J)()), f("keydown", r, function(...e) {
|
|
512
517
|
n(X)?.apply(this, e);
|
|
513
518
|
}), i(t, r);
|
|
514
519
|
}, R = (e) => {
|
|
515
|
-
let r = k(() =>
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
520
|
+
let r = k(() => Ae(String(H().editingCell?.editorType)));
|
|
521
|
+
var o = a(), s = A(o), c = (e) => {
|
|
522
|
+
let o = k(() => n(r).component);
|
|
523
|
+
var s = a(), c = A(s);
|
|
524
|
+
{
|
|
525
|
+
let e = k(() => fe(n(r), je()));
|
|
526
|
+
t(c, () => n(o), (t, r) => {
|
|
527
|
+
r(t, te(() => n(e)));
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
i(e, s);
|
|
531
|
+
};
|
|
532
|
+
C(s, (e) => {
|
|
533
|
+
n(r) && e(c);
|
|
534
|
+
}), i(e, o);
|
|
535
|
+
}, z = k(() => de(String(H().editingCell?.editorType ?? ""))), B = (e) => {
|
|
536
|
+
var t = xe();
|
|
526
537
|
l(t), M(t, (e) => n(Z)?.(e)), h((e, n) => {
|
|
527
538
|
w(t, "rows", e), g(t, n);
|
|
528
|
-
}, [() => Math.max(1, String(
|
|
539
|
+
}, [() => Math.max(1, String(H().editingCell?.value ?? "").split("\n").length), () => String(H().editingCell?.value ?? "")]), f("input", t, (e) => {
|
|
529
540
|
let t = e.currentTarget;
|
|
530
541
|
t.rows = Math.max(1, t.value.split("\n").length), n(Y)(t.value);
|
|
531
542
|
}), p("blur", t, () => n(J)()), f("keydown", t, function(...e) {
|
|
532
543
|
n(X)?.apply(this, e);
|
|
533
544
|
}), i(e, t);
|
|
534
|
-
},
|
|
535
|
-
let r = k(() =>
|
|
536
|
-
var o =
|
|
545
|
+
}, U = (t) => {
|
|
546
|
+
let r = k(() => H().editingCell?.editorType ?? "text"), a = k(() => ie(n(r)) === "text" && ae(n(r)) === "number");
|
|
547
|
+
var o = Se();
|
|
537
548
|
O(o), M(o, (e) => n(Z)?.(e)), h((e, t, r) => {
|
|
538
549
|
d(o, 1, e), w(o, "type", t), w(o, "inputmode", n(a) ? "decimal" : void 0), g(o, r);
|
|
539
550
|
}, [
|
|
540
551
|
() => e(oe(n(r))),
|
|
541
552
|
() => ie(n(r)),
|
|
542
|
-
() => ce(n(r),
|
|
553
|
+
() => ce(n(r), H().editingCell?.value)
|
|
543
554
|
]), f("input", o, (e) => {
|
|
544
555
|
let t = e.currentTarget;
|
|
545
556
|
if (n(a) && !le(t.value)) {
|
|
546
|
-
t.value = String(
|
|
557
|
+
t.value = String(H().editingCell?.value ?? "");
|
|
547
558
|
return;
|
|
548
559
|
}
|
|
549
560
|
n(Y)(t.value);
|
|
@@ -552,11 +563,11 @@ function B(r, u) {
|
|
|
552
563
|
}), i(t, o);
|
|
553
564
|
};
|
|
554
565
|
C(_, (e) => {
|
|
555
|
-
u.column.columnDef.cellEditor ? e(v) :
|
|
566
|
+
u.column.columnDef.cellEditor ? e(v) : H().editingCell?.editorType === "checkbox" ? e(y, 1) : H().editingCell?.editorType === "list" ? e(ee, 2) : H().editingCell?.editorType === "chips" ? e(x, 3) : H().editingCell?.editorType === "rating" ? e(S, 4) : H().editingCell?.editorType === "select" ? e(E, 5) : H().editingCell?.editorType === "rich-select" ? e(j, 6) : H().editingCell?.editorType === "textarea" ? e(ne, 7) : H().editingCell?.editorType === "autocomplete" ? e(N, 8) : H().editingCell?.editorType === "date" ? e(P, 9) : H().editingCell?.editorType === "datetime" ? e(F, 10) : H().editingCell?.editorType === "time" ? e(I, 11) : H().editingCell?.editorType === "color" ? e(L, 12) : n(z) ? e(R, 13) : (H().editingCell?.editorType ?? "text") === "text" && u.column?.columnDef.editorMultiline ? e(B, 14) : e(U, -1);
|
|
556
567
|
}), i(r, m);
|
|
557
568
|
};
|
|
558
|
-
C(
|
|
559
|
-
|
|
569
|
+
C(Me, (e) => {
|
|
570
|
+
U() ? e(Ne) : e(Pe, -1);
|
|
560
571
|
}), i(r, $), j();
|
|
561
572
|
}
|
|
562
573
|
r([
|
|
@@ -568,4 +579,4 @@ r([
|
|
|
568
579
|
"input"
|
|
569
580
|
]);
|
|
570
581
|
//#endregion
|
|
571
|
-
export {
|
|
582
|
+
export { V as default };
|