UNPKG

filepond

Version:

FilePond, where files go to stretch their bits.

54 lines (53 loc) • 2.76 kB
/*! * FilePond v5.0.2 * Copyright (c) 2017-2026 Pqina B.V. * Released under the MIT License * https://filepond.com */ import { get as u } from "../../../vendor/svelte/src/internal/client/runtime.js"; import { pop as T, push as B } from "../../../vendor/svelte/src/internal/client/context.js"; import { state as N, set as P } from "../../../vendor/svelte/src/internal/client/reactivity/sources.js"; import { template_effect as j } from "../../../vendor/svelte/src/internal/client/reactivity/effects.js"; import { user_derived as q } from "../../../vendor/svelte/src/internal/client/reactivity/deriveds.js"; import { delegate as w, delegated as A, event as l } from "../../../vendor/svelte/src/internal/client/dom/elements/events.js"; import { from_html as C, append as D } from "../../../vendor/svelte/src/internal/client/dom/template.js"; import { set_value as G, set_attribute as a } from "../../../vendor/svelte/src/internal/client/dom/elements/attributes.js"; import { set_class as H } from "../../../vendor/svelte/src/internal/client/dom/elements/class.js"; import { clsx as J } from "../../../vendor/svelte/src/internal/shared/attributes.js"; import { bind_this as L } from "../../../vendor/svelte/src/internal/client/dom/elements/bindings/this.js"; import { prop as o } from "../../../vendor/svelte/src/internal/client/reactivity/props.js"; import { noop as r } from "../../../utils/placeholder.js"; import { isFunction as M } from "../../../utils/test.js"; import { routeKeyboardEvent as O, Key as Q } from "../../../utils/dom.js"; var S = C("<input/>"); function re(c, t) { B(t, !0); let d = o(t, "class", 3, void 0), m = o(t, "value", 7, ""), p = o(t, "type", 3, "text"), s = o(t, "inputmode", 3, "text"), v = o(t, "spellcheck", 3, "false"), h = o(t, "autocapitalize", 3, "off"), b = o(t, "autocorrect", 3, "off"), y = o(t, "autocomplete", 3, "off"), _ = o(t, "oninput", 3, r), k = o(t, "onfocus", 3, r), x = o(t, "onblur", 3, r), f = o(t, "onconfirm", 3, void 0), E = o(t, "disabled", 3, !1), n = N(void 0); function g() { m(u(n).value), _()(u(n).value); } function z() { x()(u(n).value); } function K() { k()(u(n).value); } const F = { [Q.ENTER]: (i) => { f()?.(u(n).value), u(n).blur(); } }; function I(i) { O(i, F); } var e = S(), R = q(() => M(f()) ? I : void 0); L(e, (i) => P(n, i), () => u(n)), j(() => { H(e, 1, J(d())), G(e, m()), a(e, "type", p()), a(e, "spellcheck", v()), a(e, "autocapitalize", h()), a(e, "autocomplete", y()), a(e, "autocorrect", b()), a(e, "inputmode", s()), e.disabled = E(); }), A("input", e, g), l("focus", e, K), l("blur", e, z), l("keypress", e, function(...i) { u(R)?.apply(this, i); }), D(c, e), T(); } w(["input"]); export { re as default };