@svgrid/grid-wc 2.7.0 → 3.0.1
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/README.md +110 -110
- package/dist/GridMenus-YwTw9Upd.js +1123 -0
- package/dist/SvDateRangeInput-CrxeppBV.js +196 -0
- package/dist/SvDateTimePicker-xAO-Pb4S.js +765 -0
- package/dist/{dismissable-Nx79OIVg.js → SvField-CE345DyF.js} +11 -51
- package/dist/{shadow/SvGrid.helpers-BZPDBcza.js → SvGrid.helpers-BdVDtjUm.js} +24 -14
- package/dist/SvGridCellEditor-D7SyHtff.js +550 -0
- package/dist/SvGridChart-CMaVmlso.js +1477 -0
- package/dist/SvGridChartPanel-Pc_IW0eA.js +833 -0
- package/dist/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
- package/dist/{SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
- package/dist/{shadow/cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
- package/dist/chart-GRBAgN1M.js +1658 -0
- package/dist/date-format-D_oQ5Yw0.js +1127 -0
- package/dist/dismissable-DvhBKm3q.js +41 -0
- package/dist/{export-format-B6FUgOll.js → export-format-uGayRKWM.js} +3 -3
- package/dist/{shadow/row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
- package/dist/shadow/GridMenus-YwTw9Upd.js +1123 -0
- package/dist/shadow/SvDateRangeInput-CrxeppBV.js +196 -0
- package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +765 -0
- package/dist/shadow/{dismissable-Nx79OIVg.js → SvField-CE345DyF.js} +11 -51
- package/dist/{SvGrid.helpers-BZPDBcza.js → shadow/SvGrid.helpers-BdVDtjUm.js} +24 -14
- package/dist/shadow/SvGridCellEditor-D7SyHtff.js +550 -0
- package/dist/shadow/SvGridChart-CMaVmlso.js +1477 -0
- package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +833 -0
- package/dist/shadow/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
- package/dist/shadow/{SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
- package/dist/{cell-formatting-C0OsDmi_.js → shadow/cell-formatting-Eypm-id0.js} +1 -1
- package/dist/shadow/chart-GRBAgN1M.js +1658 -0
- package/dist/shadow/date-format-D_oQ5Yw0.js +1127 -0
- package/dist/shadow/dismissable-DvhBKm3q.js +41 -0
- package/dist/shadow/{export-format-C8kZGZfz.js → export-format-DhdZREP1.js} +3 -3
- package/dist/{row-drag-touch-Ddaa-QeB.js → shadow/row-drag-touch-CycRR65n.js} +12 -10
- package/dist/shadow/sv-grid-shadow-element.js +2896 -2628
- package/dist/sv-grid-element.js +2894 -2626
- package/package.json +3 -3
- package/dist/GridMenus-DE0zNY_3.js +0 -1022
- package/dist/SvDateTimePicker-BpeEupA2.js +0 -1885
- package/dist/SvGridCellEditor-_rqEaig7.js +0 -531
- package/dist/SvGridChart-yK5Zv85y.js +0 -1199
- package/dist/SvGridChartPanel-B38_VjXM.js +0 -584
- package/dist/chart-uvs3sFJA.js +0 -1220
- package/dist/shadow/GridMenus-DE0zNY_3.js +0 -1022
- package/dist/shadow/SvDateTimePicker-BpeEupA2.js +0 -1885
- package/dist/shadow/SvGridCellEditor-_rqEaig7.js +0 -531
- package/dist/shadow/SvGridChart-yK5Zv85y.js +0 -1199
- package/dist/shadow/SvGridChartPanel-B38_VjXM.js +0 -584
- package/dist/shadow/chart-uvs3sFJA.js +0 -1220
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { $ as e, E as t, F as n, H as r, I as i, J as a, K as o, R as s, V as c, X as l, Y as u, Z as d, a as f, d as p, et as m, f as h, h as g, j as _, k as v, n as y, q as ee, rt as b, tt as x, u as te, v as ne, x as S, y as C } from "./client-DjwUji8D.js";
|
|
2
|
+
import { a as w, i as T, t as re } from "./editor-contract-peBDxir_.js";
|
|
3
|
+
import { i as E, o as D, r as ie, t as O } from "./date-format-D_oQ5Yw0.js";
|
|
4
|
+
import { n as ae, r as oe, t as se } from "./popover-WsGlvtQv.js";
|
|
5
|
+
import { t as k } from "./SvField-CE345DyF.js";
|
|
6
|
+
//#region ../grid/dist/SvDateRangeInput.svelte
|
|
7
|
+
var ce = _("<button type=\"button\" class=\"sv-dri__clear svelte-1rb3yee\">×</button>"), le = _("<div class=\"sv-dri__panel\" role=\"dialog\"><!></div>"), A = _("<input type=\"hidden\"/> <input type=\"hidden\"/>", 1), ue = _("<div><div><svg class=\"sv-dri__icon svelte-1rb3yee\" viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"></rect><path d=\"M16 2v4M8 2v4M3 10h18\"></path></svg> <input/> <!></div> <!> <!></div>");
|
|
8
|
+
function j(n, _) {
|
|
9
|
+
x(_, !0);
|
|
10
|
+
let j = {
|
|
11
|
+
dialog: "Choose a date range",
|
|
12
|
+
clear: "Clear",
|
|
13
|
+
open: "Open calendar",
|
|
14
|
+
to: "to"
|
|
15
|
+
}, M = y(_, "value", 3, null), de = y(_, "formatString", 3, "yyyy-MM-dd"), fe = y(_, "min", 3, null), pe = y(_, "max", 3, null), me = y(_, "months", 3, 2), he = y(_, "firstDayOfWeek", 3, 0), ge = y(_, "weekNumbers", 3, !1), N = y(_, "locale", 19, () => typeof navigator < "u" ? navigator.language : "en-US"), P = y(_, "placeholder", 3, "Select date range"), F = y(_, "animate", 3, !1), I = y(_, "autoOpen", 3, !1), L = y(_, "disabled", 3, !1), _e = y(_, "readonly", 3, !1), ve = y(_, "size", 3, "md"), R = y(_, "invalid", 3, !1), ye = y(_, "block", 3, !1), z = y(_, "required", 3, !1), be = T("sv-daterange"), B = e(() => _.id ?? be), V = e(() => w(j, _.messages)), H = e(() => _.dir === "ltr" || _.dir === "rtl" ? _.dir : void 0), U = e(() => !L() && !_e()), W = (e) => O(e, de(), N()), xe = e(() => {
|
|
16
|
+
if (!M()) return "";
|
|
17
|
+
let [e, t] = M();
|
|
18
|
+
return e && t ? `${W(e)} ${s(V).to} ${W(t)}` : e ? W(e) : "";
|
|
19
|
+
}), Se = e(() => M() ? E(M()[0], M()[1]) : null), G = d(!1);
|
|
20
|
+
function K() {
|
|
21
|
+
s(U) && !s(G) && l(G, !0);
|
|
22
|
+
}
|
|
23
|
+
function q() {
|
|
24
|
+
l(G, !1);
|
|
25
|
+
}
|
|
26
|
+
function J() {
|
|
27
|
+
s(G) ? q() : K();
|
|
28
|
+
}
|
|
29
|
+
function Ce() {
|
|
30
|
+
_.onChange?.(null);
|
|
31
|
+
}
|
|
32
|
+
function we(e) {
|
|
33
|
+
if (!e.length) return;
|
|
34
|
+
let t = e[0], n = e[e.length - 1];
|
|
35
|
+
_.onChange?.([D(t), D(n)]), e.length >= 1 && t !== n && q();
|
|
36
|
+
}
|
|
37
|
+
let Y = d(null), X = d(null), Z = d(null), Q = d(u({
|
|
38
|
+
top: 0,
|
|
39
|
+
left: 0,
|
|
40
|
+
width: 0,
|
|
41
|
+
openUpward: !1,
|
|
42
|
+
maxHeight: 0,
|
|
43
|
+
availHeight: 0
|
|
44
|
+
}));
|
|
45
|
+
function $() {
|
|
46
|
+
s(Y) && l(Q, se(s(Y).getBoundingClientRect(), {
|
|
47
|
+
estimatedHeight: 360,
|
|
48
|
+
minWidth: 300
|
|
49
|
+
}), !0);
|
|
50
|
+
}
|
|
51
|
+
r(() => {
|
|
52
|
+
if (!s(G)) return;
|
|
53
|
+
$();
|
|
54
|
+
let e = () => $();
|
|
55
|
+
window.addEventListener("scroll", e, !0), window.addEventListener("resize", e);
|
|
56
|
+
let t = (e) => {
|
|
57
|
+
let t = e.target;
|
|
58
|
+
t && (s(Y)?.contains(t) || s(Z)?.contains(t) || q());
|
|
59
|
+
};
|
|
60
|
+
return document.addEventListener("pointerdown", t, !0), () => {
|
|
61
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("pointerdown", t, !0);
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
function Te(e) {
|
|
65
|
+
e.key === "Escape" ? q() : e.key === "ArrowDown" && (e.altKey || !M()) && (e.preventDefault(), K());
|
|
66
|
+
}
|
|
67
|
+
function Ee(e) {
|
|
68
|
+
I() && (e.focus(), K());
|
|
69
|
+
}
|
|
70
|
+
k(n, {
|
|
71
|
+
get id() {
|
|
72
|
+
return s(B);
|
|
73
|
+
},
|
|
74
|
+
get label() {
|
|
75
|
+
return _.label;
|
|
76
|
+
},
|
|
77
|
+
get hint() {
|
|
78
|
+
return _.hint;
|
|
79
|
+
},
|
|
80
|
+
get error() {
|
|
81
|
+
return _.error;
|
|
82
|
+
},
|
|
83
|
+
get required() {
|
|
84
|
+
return z();
|
|
85
|
+
},
|
|
86
|
+
get dir() {
|
|
87
|
+
return _.dir;
|
|
88
|
+
},
|
|
89
|
+
children: (e, n) => {
|
|
90
|
+
var r = ue();
|
|
91
|
+
let u;
|
|
92
|
+
var d = o(r);
|
|
93
|
+
let m;
|
|
94
|
+
var y = a(o(d), 2);
|
|
95
|
+
te(y, (e) => ({
|
|
96
|
+
id: s(B),
|
|
97
|
+
class: "sv-dri__input",
|
|
98
|
+
type: "text",
|
|
99
|
+
readonly: !0,
|
|
100
|
+
placeholder: P(),
|
|
101
|
+
value: s(xe),
|
|
102
|
+
disabled: L(),
|
|
103
|
+
...e,
|
|
104
|
+
"aria-haspopup": "dialog",
|
|
105
|
+
"aria-expanded": s(G),
|
|
106
|
+
onkeydown: Te
|
|
107
|
+
}), [() => re({
|
|
108
|
+
id: s(B),
|
|
109
|
+
invalid: R(),
|
|
110
|
+
required: z(),
|
|
111
|
+
error: _.error,
|
|
112
|
+
hint: _.hint,
|
|
113
|
+
ariaLabel: _.ariaLabel
|
|
114
|
+
})], void 0, void 0, "svelte-1rb3yee", !0), f(y, (e) => l(X, e), () => s(X)), S(y, (e) => Ee?.(e));
|
|
115
|
+
var x = a(y, 2), w = (e) => {
|
|
116
|
+
var t = ce();
|
|
117
|
+
c(() => h(t, "aria-label", s(V).clear)), i("click", t, (e) => {
|
|
118
|
+
e.stopPropagation(), Ce();
|
|
119
|
+
}), v(e, t);
|
|
120
|
+
};
|
|
121
|
+
t(x, (e) => {
|
|
122
|
+
M() && s(U) && e(w);
|
|
123
|
+
}), b(d), f(d, (e) => l(Y, e), () => s(Y));
|
|
124
|
+
var T = a(d, 2), E = (e) => {
|
|
125
|
+
var t = le();
|
|
126
|
+
let n;
|
|
127
|
+
var r = o(t);
|
|
128
|
+
ie(r, {
|
|
129
|
+
get value() {
|
|
130
|
+
return s(Se);
|
|
131
|
+
},
|
|
132
|
+
selectionMode: "range",
|
|
133
|
+
get min() {
|
|
134
|
+
return fe();
|
|
135
|
+
},
|
|
136
|
+
get max() {
|
|
137
|
+
return pe();
|
|
138
|
+
},
|
|
139
|
+
get months() {
|
|
140
|
+
return me();
|
|
141
|
+
},
|
|
142
|
+
get firstDayOfWeek() {
|
|
143
|
+
return he();
|
|
144
|
+
},
|
|
145
|
+
get weekNumbers() {
|
|
146
|
+
return ge();
|
|
147
|
+
},
|
|
148
|
+
get locale() {
|
|
149
|
+
return N();
|
|
150
|
+
},
|
|
151
|
+
get presets() {
|
|
152
|
+
return _.presets;
|
|
153
|
+
},
|
|
154
|
+
get animate() {
|
|
155
|
+
return F();
|
|
156
|
+
},
|
|
157
|
+
get dir() {
|
|
158
|
+
return s(H);
|
|
159
|
+
},
|
|
160
|
+
onChange: we
|
|
161
|
+
}), b(t), f(t, (e) => l(Z, e), () => s(Z)), S(t, (e) => oe?.(e)), S(t, (e, t) => ae?.(e, t), () => ({ up: s(Q).openUpward })), c(() => {
|
|
162
|
+
h(t, "aria-label", s(V).dialog), h(t, "dir", s(H)), n = ne(t, "", n, {
|
|
163
|
+
position: "fixed",
|
|
164
|
+
top: `${s(Q).top}px`,
|
|
165
|
+
left: `${s(Q).left}px`
|
|
166
|
+
}), t.dir = t.dir;
|
|
167
|
+
}), v(e, t);
|
|
168
|
+
};
|
|
169
|
+
t(T, (e) => {
|
|
170
|
+
s(G) && e(E);
|
|
171
|
+
});
|
|
172
|
+
var D = a(T, 2), O = (e) => {
|
|
173
|
+
var t = A(), n = ee(t);
|
|
174
|
+
p(n);
|
|
175
|
+
var r = a(n, 2);
|
|
176
|
+
p(r), c((e, t) => {
|
|
177
|
+
h(n, "name", `${_.name}_start`), g(n, e), h(r, "name", `${_.name}_end`), g(r, t);
|
|
178
|
+
}, [() => M()?.[0] ? M()[0].toISOString() : "", () => M()?.[1] ? M()[1].toISOString() : ""]), v(e, t);
|
|
179
|
+
};
|
|
180
|
+
t(D, (e) => {
|
|
181
|
+
_.name && e(O);
|
|
182
|
+
}), b(r), c(() => {
|
|
183
|
+
u = C(r, 1, "sv-dri svelte-1rb3yee", null, u, {
|
|
184
|
+
"is-block": ye(),
|
|
185
|
+
"sv-dri--disabled": L()
|
|
186
|
+
}), m = C(d, 1, `sv-dri__field sv-dri__field--${ve() ?? ""}`, "svelte-1rb3yee", m, { "is-invalid": R() }), h(d, "dir", s(H)), d.dir = d.dir;
|
|
187
|
+
}), i("click", d, () => {
|
|
188
|
+
s(U) && (s(X)?.focus(), J());
|
|
189
|
+
}), v(e, r);
|
|
190
|
+
},
|
|
191
|
+
$$slots: { default: !0 }
|
|
192
|
+
}), m();
|
|
193
|
+
}
|
|
194
|
+
n(["click"]);
|
|
195
|
+
//#endregion
|
|
196
|
+
export { j as default };
|