@budibase/server
Version:
Budibase Web Server
573 lines (572 loc) • 13.8 kB
JavaScript
import { S as Z, i as B, s as E, e as v, a as A, b as m, d as b, f as W, g as q, l as ee, k as h, z as L, n as g, A as M, o as I, bZ as ne, I as F, c as S, m as w, p as z, ab as K, ac as j, ai as le, h as ie, ah as ae, aj as fe, bT as oe, bQ as ue, aa as te, bR as se, y as re, ci as de } from "./index-fc73233e.js";
function N(e) {
let n, i, a;
return i = new F({
props: {
name: "warning",
color: "var(--spectrum-semantic-negative-color-icon)"
}
}), {
c() {
n = v("div"), S(i.$$.fragment), m(n, "class", "error-icon svelte-1eqovy0");
},
m(l, s) {
W(l, n, s), w(i, n, null), a = !0;
},
i(l) {
a || (h(i.$$.fragment, l), a = !0);
},
o(l) {
g(i.$$.fragment, l), a = !1;
},
d(l) {
l && I(n), z(i);
}
};
}
function Q(e) {
let n, i, a;
return i = new F({ props: { name: (
/*icon*/
e[7]
) } }), {
c() {
n = v("button"), S(i.$$.fragment), m(n, "type", "button"), m(n, "class", "spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button"), m(n, "tabindex", "-1"), b(n, "is-invalid", !!/*error*/
e[3]);
},
m(l, s) {
W(l, n, s), w(i, n, null), a = !0;
},
p(l, s) {
const c = {};
s & /*icon*/
128 && (c.name = /*icon*/
l[7]), i.$set(c), (!a || s & /*error*/
8) && b(n, "is-invalid", !!/*error*/
l[3]);
},
i(l) {
a || (h(i.$$.fragment, l), a = !0);
},
o(l) {
g(i.$$.fragment, l), a = !1;
},
d(l) {
l && I(n), z(i);
}
};
}
function ce(e) {
let n, i, a, l, s, c, _, k, o = !!/*error*/
e[3] && N(), f = !/*disabled*/
e[1] && !/*readonly*/
e[2] && Q(e);
return {
c() {
n = v("div"), i = v("div"), o && o.c(), a = A(), l = v("input"), s = A(), f && f.c(), l.disabled = /*disabled*/
e[1], l.readOnly = /*readonly*/
e[2], m(l, "data-input", ""), m(l, "type", "text"), m(l, "class", "spectrum-Textfield-input spectrum-InputGroup-input svelte-1eqovy0"), m(
l,
"placeholder",
/*placeholder*/
e[5]
), m(
l,
"id",
/*id*/
e[6]
), l.value = /*displayValue*/
e[8], b(
l,
"is-disabled",
/*disabled*/
e[1]
), m(i, "class", "spectrum-Textfield spectrum-InputGroup-textfield svelte-1eqovy0"), b(
i,
"is-disabled",
/*disabled*/
e[1]
), b(i, "is-invalid", !!/*error*/
e[3]), m(n, "class", "spectrum-InputGroup spectrum-Datepicker svelte-1eqovy0"), m(
n,
"aria-readonly",
/*readonly*/
e[2]
), m(n, "aria-required", "false"), m(n, "aria-haspopup", "true"), b(
n,
"is-disabled",
/*disabled*/
e[1] || /*readonly*/
e[2]
), b(n, "is-invalid", !!/*error*/
e[3]), b(
n,
"is-focused",
/*focused*/
e[4]
);
},
m(u, d) {
W(u, n, d), q(n, i), o && o.m(i, null), q(i, a), q(i, l), q(n, s), f && f.m(n, null), e[13](n), c = !0, _ || (k = ee(
n,
"click",
/*click_handler*/
e[12]
), _ = !0);
},
p(u, [d]) {
/*error*/
u[3] ? o ? d & /*error*/
8 && h(o, 1) : (o = N(), o.c(), h(o, 1), o.m(i, a)) : o && (L(), g(o, 1, 1, () => {
o = null;
}), M()), (!c || d & /*disabled*/
2) && (l.disabled = /*disabled*/
u[1]), (!c || d & /*readonly*/
4) && (l.readOnly = /*readonly*/
u[2]), (!c || d & /*placeholder*/
32) && m(
l,
"placeholder",
/*placeholder*/
u[5]
), (!c || d & /*id*/
64) && m(
l,
"id",
/*id*/
u[6]
), (!c || d & /*displayValue*/
256 && l.value !== /*displayValue*/
u[8]) && (l.value = /*displayValue*/
u[8]), (!c || d & /*disabled*/
2) && b(
l,
"is-disabled",
/*disabled*/
u[1]
), (!c || d & /*disabled*/
2) && b(
i,
"is-disabled",
/*disabled*/
u[1]
), (!c || d & /*error*/
8) && b(i, "is-invalid", !!/*error*/
u[3]), !/*disabled*/
u[1] && !/*readonly*/
u[2] ? f ? (f.p(u, d), d & /*disabled, readonly*/
6 && h(f, 1)) : (f = Q(u), f.c(), h(f, 1), f.m(n, null)) : f && (L(), g(f, 1, 1, () => {
f = null;
}), M()), (!c || d & /*readonly*/
4) && m(
n,
"aria-readonly",
/*readonly*/
u[2]
), (!c || d & /*disabled, readonly*/
6) && b(
n,
"is-disabled",
/*disabled*/
u[1] || /*readonly*/
u[2]
), (!c || d & /*error*/
8) && b(n, "is-invalid", !!/*error*/
u[3]), (!c || d & /*focused*/
16) && b(
n,
"is-focused",
/*focused*/
u[4]
);
},
i(u) {
c || (h(o), h(f), c = !0);
},
o(u) {
g(o), g(f), c = !1;
},
d(u) {
u && I(n), o && o.d(), f && f.d(), e[13](null), _ = !1, k();
}
};
}
function me(e, n, i) {
let a, { anchor: l } = n, { disabled: s } = n, { readonly: c } = n, { error: _ } = n, { focused: k } = n, { placeholder: o } = n, { id: f } = n, { value: u } = n, { icon: d } = n, { enableTime: O } = n, { timeOnly: y } = n;
function P(r) {
K.call(this, e, r);
}
function D(r) {
j[r ? "unshift" : "push"](() => {
l = r, i(0, l);
});
}
return e.$$set = (r) => {
"anchor" in r && i(0, l = r.anchor), "disabled" in r && i(1, s = r.disabled), "readonly" in r && i(2, c = r.readonly), "error" in r && i(3, _ = r.error), "focused" in r && i(4, k = r.focused), "placeholder" in r && i(5, o = r.placeholder), "id" in r && i(6, f = r.id), "value" in r && i(9, u = r.value), "icon" in r && i(7, d = r.icon), "enableTime" in r && i(10, O = r.enableTime), "timeOnly" in r && i(11, y = r.timeOnly);
}, e.$$.update = () => {
e.$$.dirty & /*value, enableTime, timeOnly*/
3584 && i(8, a = ne(u, { enableTime: O, timeOnly: y }));
}, [
l,
s,
c,
_,
k,
o,
f,
d,
a,
u,
O,
y,
P,
D
];
}
class be extends Z {
constructor(n) {
super(), B(this, n, me, ce, E, {
anchor: 0,
disabled: 1,
readonly: 2,
error: 3,
focused: 4,
placeholder: 5,
id: 6,
value: 9,
icon: 7,
enableTime: 10,
timeOnly: 11
});
}
}
function R(e) {
let n, i;
return n = new de({
props: {
useKeyboardShortcuts: (
/*useKeyboardShortcuts*/
e[8]
),
ignoreTimezones: (
/*ignoreTimezones*/
e[7]
),
enableTime: (
/*enableTime*/
e[4]
),
timeOnly: (
/*timeOnly*/
e[6]
),
startDayOfWeek: (
/*resolvedStartDayOfWeek*/
e[15]
),
value: (
/*parsedValue*/
e[14]
)
}
}), n.$on(
"change",
/*change_handler*/
e[22]
), {
c() {
S(n.$$.fragment);
},
m(a, l) {
w(n, a, l), i = !0;
},
p(a, l) {
const s = {};
l & /*useKeyboardShortcuts*/
256 && (s.useKeyboardShortcuts = /*useKeyboardShortcuts*/
a[8]), l & /*ignoreTimezones*/
128 && (s.ignoreTimezones = /*ignoreTimezones*/
a[7]), l & /*enableTime*/
16 && (s.enableTime = /*enableTime*/
a[4]), l & /*timeOnly*/
64 && (s.timeOnly = /*timeOnly*/
a[6]), l & /*resolvedStartDayOfWeek*/
32768 && (s.startDayOfWeek = /*resolvedStartDayOfWeek*/
a[15]), l & /*parsedValue*/
16384 && (s.value = /*parsedValue*/
a[14]), n.$set(s);
},
i(a) {
i || (h(n.$$.fragment, a), i = !0);
},
o(a) {
g(n.$$.fragment, a), i = !1;
},
d(a) {
z(n, a);
}
};
}
function he(e) {
let n, i, a = (
/*isOpen*/
e[11] && R(e)
);
return {
c() {
a && a.c(), n = re();
},
m(l, s) {
a && a.m(l, s), W(l, n, s), i = !0;
},
p(l, s) {
/*isOpen*/
l[11] ? a ? (a.p(l, s), s & /*isOpen*/
2048 && h(a, 1)) : (a = R(l), a.c(), h(a, 1), a.m(n.parentNode, n)) : a && (L(), g(a, 1, 1, () => {
a = null;
}), M());
},
i(l) {
i || (h(a), i = !0);
},
o(l) {
g(a), i = !1;
},
d(l) {
l && I(n), a && a.d(l);
}
};
}
function _e(e) {
let n, i, a, l, s;
function c(o) {
e[21](o);
}
let _ = {
disabled: (
/*disabled*/
e[1]
),
readonly: (
/*readonly*/
e[2]
),
error: (
/*error*/
e[3]
),
placeholder: (
/*placeholder*/
e[5]
),
id: (
/*id*/
e[0]
),
enableTime: (
/*enableTime*/
e[4]
),
timeOnly: (
/*timeOnly*/
e[6]
),
focused: (
/*isOpen*/
e[11]
),
value: (
/*parsedValue*/
e[14]
),
icon: (
/*timeOnly*/
e[6] ? "clock" : "calendar"
)
};
/*anchor*/
e[12] !== void 0 && (_.anchor = /*anchor*/
e[12]), n = new be({ props: _ }), j.push(() => le(n, "anchor", c)), n.$on("click", function() {
var o, f;
ie(
/*popover*/
(o = e[13]) == null ? void 0 : o.show
) && ((f = e[13]) == null || f.show.apply(this, arguments));
});
let k = {
portalTarget: (
/*appendTo*/
e[9]
),
anchor: (
/*anchor*/
e[12]
),
align: (
/*align*/
e[10]
),
resizable: !1,
$$slots: { default: [he] },
$$scope: { ctx: e }
};
return l = new ae({ props: k }), e[23](l), l.$on(
"open",
/*open_handler*/
e[24]
), l.$on(
"close",
/*close_handler*/
e[25]
), l.$on(
"open",
/*onOpen*/
e[16]
), l.$on(
"close",
/*onClose*/
e[17]
), {
c() {
S(n.$$.fragment), a = A(), S(l.$$.fragment);
},
m(o, f) {
w(n, o, f), W(o, a, f), w(l, o, f), s = !0;
},
p(o, [f]) {
e = o;
const u = {};
f & /*disabled*/
2 && (u.disabled = /*disabled*/
e[1]), f & /*readonly*/
4 && (u.readonly = /*readonly*/
e[2]), f & /*error*/
8 && (u.error = /*error*/
e[3]), f & /*placeholder*/
32 && (u.placeholder = /*placeholder*/
e[5]), f & /*id*/
1 && (u.id = /*id*/
e[0]), f & /*enableTime*/
16 && (u.enableTime = /*enableTime*/
e[4]), f & /*timeOnly*/
64 && (u.timeOnly = /*timeOnly*/
e[6]), f & /*isOpen*/
2048 && (u.focused = /*isOpen*/
e[11]), f & /*parsedValue*/
16384 && (u.value = /*parsedValue*/
e[14]), f & /*timeOnly*/
64 && (u.icon = /*timeOnly*/
e[6] ? "clock" : "calendar"), !i && f & /*anchor*/
4096 && (i = !0, u.anchor = /*anchor*/
e[12], fe(() => i = !1)), n.$set(u);
const d = {};
f & /*appendTo*/
512 && (d.portalTarget = /*appendTo*/
e[9]), f & /*anchor*/
4096 && (d.anchor = /*anchor*/
e[12]), f & /*align*/
1024 && (d.align = /*align*/
e[10]), f & /*$$scope, useKeyboardShortcuts, ignoreTimezones, enableTime, timeOnly, resolvedStartDayOfWeek, parsedValue, isOpen*/
134269392 && (d.$$scope = { dirty: f, ctx: e }), l.$set(d);
},
i(o) {
s || (h(n.$$.fragment, o), h(l.$$.fragment, o), s = !0);
},
o(o) {
g(n.$$.fragment, o), g(l.$$.fragment, o), s = !1;
},
d(o) {
o && I(a), z(n, o), e[23](null), z(l, o);
}
};
}
function ge(e, n, i) {
let a, l, { id: s = null } = n, { disabled: c = !1 } = n, { readonly: _ = !1 } = n, { error: k = null } = n, { enableTime: o = !0 } = n, { value: f = null } = n, { placeholder: u = null } = n, { timeOnly: d = !1 } = n, { ignoreTimezones: O = !1 } = n, { useKeyboardShortcuts: y = !0 } = n, { appendTo: P = void 0 } = n, { api: D = null } = n, { align: r = oe.Left } = n;
const H = ue();
let { startDayOfWeek: G = void 0 } = n, C = !1, V, T;
const J = () => {
i(11, C = !0);
}, U = () => {
i(11, C = !1);
};
te(() => {
i(18, D = {
open: () => T == null ? void 0 : T.show(),
close: () => T == null ? void 0 : T.hide()
});
});
function X(t) {
V = t, i(12, V);
}
function Y(t) {
K.call(this, e, t);
}
function p(t) {
j[t ? "unshift" : "push"](() => {
T = t, i(13, T);
});
}
function x(t) {
K.call(this, e, t);
}
function $(t) {
K.call(this, e, t);
}
return e.$$set = (t) => {
"id" in t && i(0, s = t.id), "disabled" in t && i(1, c = t.disabled), "readonly" in t && i(2, _ = t.readonly), "error" in t && i(3, k = t.error), "enableTime" in t && i(4, o = t.enableTime), "value" in t && i(19, f = t.value), "placeholder" in t && i(5, u = t.placeholder), "timeOnly" in t && i(6, d = t.timeOnly), "ignoreTimezones" in t && i(7, O = t.ignoreTimezones), "useKeyboardShortcuts" in t && i(8, y = t.useKeyboardShortcuts), "appendTo" in t && i(9, P = t.appendTo), "api" in t && i(18, D = t.api), "align" in t && i(10, r = t.align), "startDayOfWeek" in t && i(20, G = t.startDayOfWeek);
}, e.$$.update = () => {
e.$$.dirty & /*startDayOfWeek*/
1048576 && i(15, a = G ?? H), e.$$.dirty & /*value, enableTime*/
524304 && i(14, l = se(f, { enableTime: o }));
}, [
s,
c,
_,
k,
o,
u,
d,
O,
y,
P,
r,
C,
V,
T,
l,
a,
J,
U,
D,
f,
G,
X,
Y,
p,
x,
$
];
}
class Te extends Z {
constructor(n) {
super(), B(this, n, ge, _e, E, {
id: 0,
disabled: 1,
readonly: 2,
error: 3,
enableTime: 4,
value: 19,
placeholder: 5,
timeOnly: 6,
ignoreTimezones: 7,
useKeyboardShortcuts: 8,
appendTo: 9,
api: 18,
align: 10,
startDayOfWeek: 20
});
}
}
export {
Te as D
};