krco
Version:
基于arco-design-vue的配置化表格表单组件
1,376 lines • 199 kB
JavaScript
import { defineComponent as Ee, mergeModels as _e, useSlots as Tt, useAttrs as Ft, useModel as Ce, ref as L, reactive as Ne, resolveComponent as x, resolveDirective as Ll, withDirectives as ht, openBlock as m, createBlock as I, mergeProps as Xe, unref as h, withCtx as v, createVNode as M, createElementBlock as j, Fragment as ke, renderList as De, normalizeStyle as Ue, normalizeProps as vl, createSlots as at, renderSlot as W, resolveDynamicComponent as Ct, createTextVNode as ie, toDisplayString as K, createCommentVNode as V, createElementVNode as G, normalizeClass as Lt, computed as be, onMounted as zt, getCurrentInstance as jl, watch as St, toRefs as nn, h as an, onUnmounted as rn, nextTick as Mt, isRef as ul, withModifiers as kt, vShow as dl, useCssVars as sn, onBeforeUnmount as un } from "vue";
import { d as Pe, v as Je, a as Ul, _ as it, u as dn, b as Il, c as Wl, e as pn } from "./index-C_vi7WqV.js";
import { h as Bi, g as $i, f as Mi } from "./index-C_vi7WqV.js";
const $o = /* @__PURE__ */ new WeakMap(), ho = new ResizeObserver((e) => {
for (const l of e) {
const t = $o.get(l.target);
t && t({
width: l.borderBoxSize[0].inlineSize,
height: l.borderBoxSize[0].blockSize
});
}
}), cn = {
install(e) {
e.directive("resize", {
//在创建自定义名称时不要带v-,使用时再携带
mounted(l, t) {
$o.set(l, t.value), ho.observe(l);
},
unmounted(l) {
ho.unobserve(l);
}
});
}
}, rt = (e) => (e.install = (l) => {
const t = e.name || e.__name;
l.component(t, e);
}, e), fn = (e, l) => {
const t = {};
if ((l.type === "input" || l.type === void 0) && (t.allowClear = !0, t.placeholder = `请输入${l.label}`), l.type === "input-password") {
const o = Pe(l);
return delete o.type, { ...t, ...o, msg: null };
}
return l.type === "input-number" && (t.placeholder = `请输入${l.label}`), l.type === "textarea" && (t.allowClear = !0, t.showWordLimit = l.showWordLimit ?? !0, t.placeholder = `请输入${l.label}`), l.type === "select" && (t.allowClear = !0, t.placeholder = `请选择${l.label}`, t.options = [], t.options = e[l.field] || l.dicData), l.type === "cascader" && (t.allowClear = !0, t.placeholder = `请选择${l.label}`, t.options = e[l.field] || l.dicData), l.type === "radio" && (t.options = e[l.field] || l.dicData), l.type === "radio-group" && (t.options = e[l.field] || l.dicData), l.type === "checkbox-group" && (t.options = e[l.field] || l.dicData), l.type === "checkbox" && (t.options = e[l.field] || l.dicData), l.type === "date-picker" && (t.placeholder = "请选择日期"), l.type === "time-picker" && (t.allowClear = !0, t.placeholder = "请选择时间"), { ...t, ...l, msg: null, field: null, type: null, onChange: (...o) => {
l.onChange && l.onChange(...o);
} };
}, hn = {
key: 0,
class: "form-plus-left-bot"
}, bn = /* @__PURE__ */ Ee({
name: "aFormPlus",
__name: "main",
props: /* @__PURE__ */ _e({
menuRight: { type: Boolean, default: !1 },
option: {},
loading: { type: Boolean, default: !1 },
disabled: { type: Boolean, default: !1 }
}, {
modelValue: {},
modelModifiers: {}
}),
emits: /* @__PURE__ */ _e(["submit", "reset", "form-change"], ["update:modelValue"]),
setup(e, { expose: l, emit: t }) {
const o = Tt(), i = Ft(), a = e, n = Ul, u = Ce(e, "modelValue"), d = L(null), b = t, s = Ne({}), r = Ne({
submit: !1,
reset: !1
});
function y() {
r.submit = !1;
}
const k = ({ values: c, errors: w }) => {
w === void 0 && (r.submit = !0, b("submit", c, y));
};
function A() {
d.value.resetFields(), d.value.clearValidate(), b("reset");
}
function S(c) {
return a.option.disabled ?? c ?? !1;
}
function P(c, w) {
b("form-change", c, w, y);
}
l(new Proxy({}, {
get(c, w) {
var B;
return w === "reset" ? A : w === "done" ? y : (B = d.value) == null ? void 0 : B[w];
},
has(c, w) {
return w === "reset" || w === "done" || w in d.value;
}
}));
function U(c) {
return Je(c.bind) ? Reflect.get(u.value, c.field) : ee(u.value, c.bind);
}
function J(c, w) {
Je(c.bind) ? Reflect.set(u.value, c.field, w) : (u[c.field] = w, re(u.value, c.bind, w));
}
const ee = (c, w) => w.split(".").reduce((B, $) => B && B[$], c), re = (c, w, B) => {
const $ = w.split("."), N = $.pop(), X = $.reduce((p, f) => p[f] = p[f] || {}, c);
X[N] = B;
}, Z = (c, w) => {
const B = {};
if ((w.type === "input" || w.type === void 0) && (B.allowClear = !0, B.placeholder = `请输入${w.label}`), w.type === "input-password") {
const $ = Pe(w);
return delete $.type, { ...B, ...$, msg: null };
}
return w.type === "input-number" && (B.placeholder = `请输入${w.label}`), w.type === "textarea" && (B.allowClear = !0, B.showWordLimit = w.showWordLimit ?? !0, B.placeholder = `请输入${w.label}`), w.type === "select" && (B.allowClear = !0, B.placeholder = `请选择${w.label}`, B.options = [], B.options = c[w.field] || w.dicData), w.type === "cascader" && (B.allowClear = !0, B.placeholder = `请选择${w.label}`, B.options = c[w.field] || w.dicData), w.type === "radio" && (B.options = c[w.field] || w.dicData), w.type === "radio-group" && (B.options = c[w.field] || w.dicData), w.type === "checkbox-group" && (B.options = c[w.field] || w.dicData), w.type === "checkbox" && (B.options = c[w.field] || w.dicData), w.type === "date-picker" && (B.placeholder = "请选择日期"), w.type === "time-picker" && (B.allowClear = !0, B.placeholder = "请选择时间"), { ...B, ...w, msg: null, field: null, type: null };
}, ae = L(!1);
function ge(c) {
ae.value = c.width < 300;
}
return (c, w) => {
const B = x("icon-question-circle-fill"), $ = x("a-tooltip"), N = x("a-form-item"), X = x("a-col"), p = x("a-row"), f = x("a-button"), R = x("a-space"), E = x("a-form"), C = Ll("resize");
return ht((m(), I(E, Xe({
ref_key: "formRef",
ref: d,
"auto-label-width": c.option.autoLabelWidth ?? h(n).autoLabelWidth,
layout: c.option.layout ?? h(n).layout ?? "horizontal",
scrollToFirstError: c.option.scrollToFirstError ?? h(n).scrollToFirstError,
size: c.option.size ?? h(n).size,
"label-align": c.option.labelAlign ?? h(n).labelAlign,
model: u.value,
onSubmit: k,
disabled: c.disabled
}, h(i)), {
default: v(() => [
M(p, {
class: "form-row__container",
justify: c.option.justify ?? h(n).justify,
align: c.option.align ?? h(n).align,
wrap: c.option.wrap ?? h(n).wrap,
cols: 24,
fill: "",
gutter: c.option.gutter || h(n).gutter,
colGap: c.option.colGap ?? h(n).colGap,
rowGap: c.option.rowGap ?? h(n).rowGap
}, {
default: v(() => [
(m(!0), j(ke, null, De(c.option.columns, (g) => (m(), j(ke, {
key: g.field
}, [
g.display ?? !0 ? (m(), I(X, {
key: 0,
style: Ue({ marginTop: c.option.marginTop ?? h(n).marginTop }),
span: ae.value ? 24 : g.span ?? c.option.span ?? h(n).span,
offset: g.offset ?? 0,
order: g.order ?? 0
}, {
default: v(() => [
M(N, vl({
[(r.submit ? "" : "disabled") || ""]: S(g.disabled),
label: g.label,
tooltip: g.tooltip,
help: g.help,
extra: g.extra,
"label-component": g.labelComponent,
"hide-label": g.hideLabel,
"hide-asterisk": g.hideAsterisk,
"content-flex": g.contentFlex,
feedback: g.feedback,
"label-col-style": {
paddingRight: "6px",
paddingLeft: "2px"
},
field: g.bind ?? g.field,
rules: g.rules
}), at({
default: v(() => [
h(o)[g.field] ? W(c.$slots, g.field, {
key: 0,
item: g,
size: c.option.size ?? h(n).size
}, void 0, !0) : (m(), I(Ct(g.component ? g.component : `a-${g.type || "input"}`), Xe({
key: 1,
style: { width: g.type === "switch" ? "" : "100%" },
size: c.option.size ?? h(n).size,
disabled: c.option.detail ?? g.disabled ?? !1,
modelValue: U(g),
"onUpdate:modelValue": (D) => J(g, D),
visibility: g.visibility,
"onUpdate:visibility": (D) => g.visibility = D,
ref_for: !0
}, Z(s, g), {
onChange: (D) => P(D, g)
}), null, 16, ["style", "size", "disabled", "modelValue", "onUpdate:modelValue", "visibility", "onUpdate:visibility", "onChange"]))
]),
_: 2
}, [
h(o)[g.field + "Label"] ? {
name: "label",
fn: v(() => [
W(c.$slots, g.field + "Label", {}, void 0, !0)
]),
key: "0"
} : void 0,
h(o)[g.field + "Label"] ? void 0 : {
name: "label",
fn: v(() => [
ie(K(g.label) + " ", 1),
g.helpIconText ? (m(), I($, {
key: 0,
content: g.helpIconText
}, {
default: v(() => [
M(B, {
size: c.option.size ?? h(n).size
}, null, 8, ["size"])
]),
_: 2
}, 1032, ["content"])) : V("", !0)
]),
key: "1"
},
h(o)[g.field + "Help"] || g.help ? {
name: "help",
fn: v(() => [
W(c.$slots, g.field + "Help", {}, void 0, !0),
G("span", null, K(g.help), 1)
]),
key: "2"
} : void 0,
h(o)[g.field + "Extra"] || g.extra ? {
name: "extra",
fn: v(() => [
W(c.$slots, g.field + "Extra", {}, void 0, !0),
G("span", null, K(g.extra), 1)
]),
key: "3"
} : void 0
]), 1040, ["label", "tooltip", "help", "extra", "label-component", "hide-label", "hide-asterisk", "content-flex", "feedback", "field", "rules"])
]),
_: 2
}, 1032, ["style", "span", "offset", "order"])) : V("", !0)
], 64))), 128))
]),
_: 3
}, 8, ["justify", "align", "wrap", "gutter", "colGap", "rowGap"]),
(m(!0), j(ke, null, De(c.option.groups, (g) => (m(), j(ke, null, [
(g.display, m(), I(p, {
key: 0,
style: Ue(c.option.groupContainerStyle ?? {})
}, {
default: v(() => [
M(X, { span: 24 }, {
default: v(() => [
!h(o)[g.field + "GroupHeader"] && !h(Je)(g.label) ? (m(), j("div", hn, K(g.label), 1)) : W(c.$slots, g.field + "GroupHeader", {
key: 1,
label: g.label,
record: g
}, void 0, !0)
]),
_: 2
}, 1024),
M(p, {
style: Ue([{ width: "100%" }, c.option.groupColStyle ?? {}]),
gutter: g.gutter ?? c.option.gutter ?? 0
}, {
default: v(() => [
(m(!0), j(ke, null, De(g.columns, (D) => (m(), j(ke, {
key: D.field
}, [
D.display ?? !0 ? (m(), I(X, {
key: 0,
span: ae.value ? 24 : D.span ?? c.option.span ?? h(n).span,
offset: D.offset ?? 0,
order: D.order ?? 100
}, {
default: v(() => [
M(N, vl({
"label-col-style": {
width: "100px"
},
[(r.submit ? "" : "disabled") || ""]: S(D.disabled),
label: D.label,
tooltip: D.tooltip,
help: D.help,
extra: D.extra,
"label-component": D.labelComponent,
"hide-label": D.hideLabel,
"hide-asterisk": D.hideAsterisk,
"content-flex": D.contentFlex,
feedback: D.feedback,
field: D.field,
rules: D.rules
}), at({
default: v(() => [
h(o)[D.field] ? W(c.$slots, D.field, {
key: 0,
item: D,
size: c.option.size ?? h(n).size
}, void 0, !0) : (m(), I(Ct(D.component ? D.component : `a-${D.type || "input"}`), Xe({
key: 1,
style: { width: D.type === "switch" ? "" : "100%" },
size: c.option.size ?? h(n).size,
disabled: c.option.detail ?? D.disabled ?? !1,
modelValue: U(D),
"onUpdate:modelValue": (de) => J(D, de),
visibility: D.visibility,
"onUpdate:visibility": (de) => D.visibility = de,
ref_for: !0
}, Z(s, D), {
onChange: (de) => P(de, D)
}), null, 16, ["style", "size", "disabled", "modelValue", "onUpdate:modelValue", "visibility", "onUpdate:visibility", "onChange"]))
]),
_: 2
}, [
h(o)[D.field + "Label"] ? {
name: "label",
fn: v(() => [
W(c.$slots, D.field + "Label", {}, void 0, !0)
]),
key: "0"
} : void 0,
h(o)[D.field + "Label"] ? void 0 : {
name: "label",
fn: v(() => [
ie(K(D.label) + " ", 1),
D.helpIconText ? (m(), I($, {
key: 0,
content: D.helpIconText
}, {
default: v(() => [
M(B, {
size: c.option.size ?? h(n).size
}, null, 8, ["size"])
]),
_: 2
}, 1032, ["content"])) : V("", !0)
]),
key: "1"
},
h(o)[D.field + "Help"] || D.help ? {
name: "help",
fn: v(() => [
W(c.$slots, D.field + "Help", {}, void 0, !0),
G("span", null, K(D.help), 1)
]),
key: "2"
} : void 0,
h(o)[D.field + "Extra"] || D.extra ? {
name: "extra",
fn: v(() => [
W(c.$slots, D.field + "Extra", {}, void 0, !0),
G("span", null, K(D.extra), 1)
]),
key: "3"
} : void 0
]), 1040, ["label", "tooltip", "help", "extra", "label-component", "hide-label", "hide-asterisk", "content-flex", "feedback", "field", "rules"])
]),
_: 2
}, 1032, ["span", "offset", "order"])) : V("", !0)
], 64))), 128))
]),
_: 2
}, 1032, ["style", "gutter"])
]),
_: 2
}, 1032, ["style"]))
], 64))), 256)),
!c.option.search && c.option.detail !== !0 ? (m(), I(p, {
key: 0,
class: Lt({ formMenuContainer: c.option.menu ?? !c.option.detail ?? !0 })
}, {
default: v(() => [
c.option.menu ?? !c.option.detail ?? !0 ? (m(), I(X, {
key: 0,
order: 1e4,
span: c.option.menuSpan ?? 24,
style: Ue({
textAlign: c.option.menuAlign ?? "center"
})
}, {
default: v(() => [
h(o).menu ? W(c.$slots, "menu", {
key: 0,
size: c.option.size ?? h(n).size,
loading: r.submit
}, void 0, !0) : V("", !0),
M(R, { wrap: "" }, {
default: v(() => [
W(c.$slots, "menuLeft", {
size: c.option.size ?? h(n).size,
loading: r.submit
}, void 0, !0),
W(c.$slots, "suffix", {
loading: r.submit
}, () => [
c.option.menuBtn ?? c.option.submitBtn ?? !0 ? (m(), I(f, {
key: 0,
size: c.option.size ?? h(n).size,
type: "primary",
loading: r.submit,
"html-type": "submit"
}, {
default: v(() => [
ie(K(c.option.submitBtnText ?? h(n).submitBtnText), 1)
]),
_: 1
}, 8, ["size", "loading"])) : V("", !0),
c.option.menuBtn ?? c.option.resetBtn ?? !0 ? (m(), I(f, {
key: 1,
size: c.option.size ?? h(n).size,
onClick: w[0] || (w[0] = (g) => A())
}, {
default: v(() => [
ie(K(c.option.resetBtnText ?? h(n).resetBtnText), 1)
]),
_: 1
}, 8, ["size"])) : V("", !0)
], !0),
W(c.$slots, "menuright", {
size: c.option.size ?? h(n).size,
loading: r.submit
}, void 0, !0)
]),
_: 3
})
]),
_: 3
}, 8, ["span", "style"])) : V("", !0)
]),
_: 3
}, 8, ["class"])) : V("", !0)
]),
_: 3
}, 16, ["auto-label-width", "layout", "scrollToFirstError", "size", "label-align", "model", "disabled"])), [
[C, ge]
]);
};
}
}), Cl = /* @__PURE__ */ it(bn, [["__scopeId", "data-v-fd095a4f"]]), vn = rt(Cl), mn = /* @__PURE__ */ Ee({
__name: "FormModel",
props: /* @__PURE__ */ _e({
title: {
type: String,
default: ""
},
option: {
type: Object,
default: () => ({})
}
}, {
visible: {
default: !1
},
visibleModifiers: {}
}),
emits: ["update:visible"],
setup(e) {
const l = L({}), t = e, o = Ce(e, "visible"), i = be(() => {
let d = Pe(t.option);
return Object.assign(d, {
menu: !0
});
}), a = L(!1);
function n(d, b) {
b();
}
function u() {
o.value = !1;
}
return (d, b) => {
const s = x("aFormPlus"), r = x("a-modal");
return m(), I(r, {
visible: o.value,
"onUpdate:visible": b[1] || (b[1] = (y) => o.value = y),
title: t.title,
footer: !1,
width: a.value ? "280px" : "60vw",
"render-to-body": !1,
"popup-container": "form-create-render",
onBeforeClose: u
}, {
default: v(() => [
M(s, {
modelValue: l.value,
"onUpdate:modelValue": b[0] || (b[0] = (y) => l.value = y),
option: i.value,
onSubmit: n
}, null, 8, ["modelValue", "option"])
]),
_: 1
}, 8, ["visible", "title", "width"]);
};
}
}), gn = { style: { height: "60vh" } }, yn = /* @__PURE__ */ Ee({
__name: "JsonModel",
props: /* @__PURE__ */ _e({
title: {
type: String,
default: ""
},
type: {
type: String,
default: ""
},
option: {
type: Object,
default: () => ({})
}
}, {
visible: {
default: !1
},
visibleModifiers: {}
}),
emits: /* @__PURE__ */ _e(["importJson"], ["update:visible"]),
setup(e, { emit: l }) {
const t = e, o = L({});
zt(() => {
t.type === "export" && (o.value = Pe(t.option));
});
const i = l, a = be(() => t.type === "export"), n = Ce(e, "visible");
function u() {
var d;
try {
Object.keys(o.value).length > 0 && ((d = o.value) != null && d.columns) && i("importJson", o.value);
} catch {
}
n.value = !1;
}
return (d, b) => {
const s = x("JsonEditor"), r = x("a-modal");
return m(), I(r, {
visible: n.value,
"onUpdate:visible": b[1] || (b[1] = (y) => n.value = y),
title: a.value ? "生成Json" : "导入Json",
footer: !a.value,
width: "60vw",
"hide-cancel": !0,
onOk: u,
"unmount-on-close": !0,
"render-to-body": a.value,
"popup-container": "form-create-render"
}, {
default: v(() => [
G("div", gn, [
M(s, {
style: { height: "60vh" },
modelValue: o.value,
"onUpdate:modelValue": b[0] || (b[0] = (y) => o.value = y)
}, null, 8, ["modelValue"])
])
]),
_: 1
}, 8, ["visible", "title", "footer", "render-to-body"]);
};
}
}), Mo = [
{
label: "基础组件",
list: [
{
label: "输入框",
icon: "biaodanzujian-shurukuang",
type: "input"
},
{
label: "数字输入框",
icon: "shuzishurukuang",
type: "input-number"
},
{
label: "验证码",
icon: "shuzishurukuang",
type: "verification-code"
},
{
label: "标签输入框",
icon: "shuzishurukuang",
type: "input-tag"
},
{
label: "多行输入框",
icon: "duohangshurukuang",
type: "textarea"
},
{
label: "下拉框",
icon: "jilian",
type: "select"
},
{
label: "单选",
icon: "danxuankuang-xuanzhong",
type: "radio-group"
},
{
label: "复选框",
icon: "duoxuan_xuanzhong",
type: "checkbox-group"
},
{
label: "评分",
icon: "pingfen",
type: "rate"
}
]
},
{
label: "时间组件",
list: [
{
label: "日期选择",
icon: "shijianxuanzeqi1",
type: "date-picker"
},
{
label: "日期范围",
icon: "shijianfanweixuanze",
type: "range-picker"
},
{
label: "时间选择",
icon: "shijianxuanzeqi1",
type: "time-picker"
},
{
label: "周",
icon: "shijianxuanzeqi1",
type: "week-picker"
},
{
label: "月份",
icon: "shijianxuanzeqi1",
type: "month-picker"
},
{
label: "年份",
icon: "shijianxuanzeqi1",
type: "year-picker"
},
{
label: "季度",
icon: "shijianxuanzeqi1",
type: "quarter-picker"
}
]
},
{
label: "高级组件",
list: [
{
label: "文件上传",
icon: "fujianshangchuan",
type: "upload"
},
{
label: "颜色选择器",
icon: "yansexuanzeqi",
type: "color-picker"
}
]
}
], wn = {
input: {
label: "输入框"
},
"verification-code": {
label: "验证码",
span: 24
},
"text-plus": {
hideLabel: !0
},
"radio-group": {
dicData: [
{
label: "选项1",
value: "1"
},
{
label: "选项2",
value: "2"
}
]
},
"checkbox-group": {
dicData: [
{
label: "选项1",
value: "1"
},
{
label: "选项2",
value: "2"
}
]
}
};
function bo(e) {
return wn[e] ?? {};
}
const kn = (e) => {
Array.isArray(e) && e.forEach((l) => {
l.list && Mo.push(l);
});
};
var _n = Object.defineProperty, ml = Object.getOwnPropertySymbols, Io = Object.prototype.hasOwnProperty, Ao = Object.prototype.propertyIsEnumerable, vo = (e, l, t) => l in e ? _n(e, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[l] = t, yt = (e, l) => {
for (var t in l || (l = {}))
Io.call(l, t) && vo(e, t, l[t]);
if (ml)
for (var t of ml(l))
Ao.call(l, t) && vo(e, t, l[t]);
return e;
}, Po = (e, l) => {
var t = {};
for (var o in e)
Io.call(e, o) && l.indexOf(o) < 0 && (t[o] = e[o]);
if (e != null && ml)
for (var o of ml(e))
l.indexOf(o) < 0 && Ao.call(e, o) && (t[o] = e[o]);
return t;
};
function mo(e, l, t) {
return t >= 0 && t < e.length && e.splice(t, 0, e.splice(l, 1)[0]), e;
}
function Cn(e) {
return e.replace(/-(\w)/g, (l, t) => t ? t.toUpperCase() : "");
}
function zn(e) {
return Object.keys(e).reduce((l, t) => (typeof e[t] < "u" && (l[Cn(t)] = e[t]), l), {});
}
function go(e, l) {
return Array.isArray(e) && e.splice(l, 1), e;
}
function yo(e, l, t) {
return Array.isArray(e) && e.splice(l, 0, t), e;
}
function Sn(e) {
return typeof e > "u";
}
function Dn(e) {
return typeof e == "string";
}
function wo(e, l, t) {
const o = e.children[t];
e.insertBefore(l, o);
}
function Sl(e) {
e.parentNode && e.parentNode.removeChild(e);
}
function Tn(e, l = document) {
var t;
let o = null;
return typeof (l == null ? void 0 : l.querySelector) == "function" ? o = (t = l == null ? void 0 : l.querySelector) == null ? void 0 : t.call(l, e) : o = document.querySelector(e), o || (`${e}`, void 0), o;
}
function xn(e, l, t = null) {
return function(...o) {
return e.apply(t, o), l.apply(t, o);
};
}
function En(e, l) {
const t = yt({}, e);
return Object.keys(l).forEach((o) => {
t[o] ? t[o] = xn(e[o], l[o]) : t[o] = l[o];
}), t;
}
function On(e) {
return e instanceof HTMLElement;
}
function ko(e, l) {
Object.keys(e).forEach((t) => {
l(t, e[t]);
});
}
function Vn(e) {
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
}
const Bn = Object.assign;
/**!
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/
function _o(e, l) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
l && (o = o.filter(function(i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function Ge(e) {
for (var l = 1; l < arguments.length; l++) {
var t = arguments[l] != null ? arguments[l] : {};
l % 2 ? _o(Object(t), !0).forEach(function(o) {
$n(e, o, t[o]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : _o(Object(t)).forEach(function(o) {
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
});
}
return e;
}
function pl(e) {
"@babel/helpers - typeof";
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? pl = function(l) {
return typeof l;
} : pl = function(l) {
return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
}, pl(e);
}
function $n(e, l, t) {
return l in e ? Object.defineProperty(e, l, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[l] = t, e;
}
function Ze() {
return Ze = Object.assign || function(e) {
for (var l = 1; l < arguments.length; l++) {
var t = arguments[l];
for (var o in t)
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
}
return e;
}, Ze.apply(this, arguments);
}
function Mn(e, l) {
if (e == null)
return {};
var t = {}, o = Object.keys(e), i, a;
for (a = 0; a < o.length; a++)
i = o[a], !(l.indexOf(i) >= 0) && (t[i] = e[i]);
return t;
}
function In(e, l) {
if (e == null)
return {};
var t = Mn(e, l), o, i;
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (i = 0; i < a.length; i++)
o = a[i], !(l.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
}
return t;
}
var An = "1.15.2";
function Ke(e) {
if (typeof window < "u" && window.navigator)
return !!/* @__PURE__ */ navigator.userAgent.match(e);
}
var Qe = Ke(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), jt = Ke(/Edge/i), Co = Ke(/firefox/i), It = Ke(/safari/i) && !Ke(/chrome/i) && !Ke(/android/i), Ro = Ke(/iP(ad|od|hone)/i), No = Ke(/chrome/i) && Ke(/android/i), Fo = {
capture: !1,
passive: !1
};
function ne(e, l, t) {
e.addEventListener(l, t, !Qe && Fo);
}
function le(e, l, t) {
e.removeEventListener(l, t, !Qe && Fo);
}
function gl(e, l) {
if (l) {
if (l[0] === ">" && (l = l.substring(1)), e)
try {
if (e.matches)
return e.matches(l);
if (e.msMatchesSelector)
return e.msMatchesSelector(l);
if (e.webkitMatchesSelector)
return e.webkitMatchesSelector(l);
} catch {
return !1;
}
return !1;
}
}
function Pn(e) {
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
}
function je(e, l, t, o) {
if (e) {
t = t || document;
do {
if (l != null && (l[0] === ">" ? e.parentNode === t && gl(e, l) : gl(e, l)) || o && e === t)
return e;
if (e === t)
break;
} while (e = Pn(e));
}
return null;
}
var zo = /\s+/g;
function Me(e, l, t) {
if (e && l)
if (e.classList)
e.classList[t ? "add" : "remove"](l);
else {
var o = (" " + e.className + " ").replace(zo, " ").replace(" " + l + " ", " ");
e.className = (o + (t ? " " + l : "")).replace(zo, " ");
}
}
function H(e, l, t) {
var o = e && e.style;
if (o) {
if (t === void 0)
return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (t = e.currentStyle), l === void 0 ? t : t[l];
!(l in o) && l.indexOf("webkit") === -1 && (l = "-webkit-" + l), o[l] = t + (typeof t == "string" ? "" : "px");
}
}
function _t(e, l) {
var t = "";
if (typeof e == "string")
t = e;
else
do {
var o = H(e, "transform");
o && o !== "none" && (t = o + " " + t);
} while (!l && (e = e.parentNode));
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
return i && new i(t);
}
function Lo(e, l, t) {
if (e) {
var o = e.getElementsByTagName(l), i = 0, a = o.length;
if (t)
for (; i < a; i++)
t(o[i], i);
return o;
}
return [];
}
function qe() {
var e = document.scrollingElement;
return e || document.documentElement;
}
function we(e, l, t, o, i) {
if (!(!e.getBoundingClientRect && e !== window)) {
var a, n, u, d, b, s, r;
if (e !== window && e.parentNode && e !== qe() ? (a = e.getBoundingClientRect(), n = a.top, u = a.left, d = a.bottom, b = a.right, s = a.height, r = a.width) : (n = 0, u = 0, d = window.innerHeight, b = window.innerWidth, s = window.innerHeight, r = window.innerWidth), (l || t) && e !== window && (i = i || e.parentNode, !Qe))
do
if (i && i.getBoundingClientRect && (H(i, "transform") !== "none" || t && H(i, "position") !== "static")) {
var y = i.getBoundingClientRect();
n -= y.top + parseInt(H(i, "border-top-width")), u -= y.left + parseInt(H(i, "border-left-width")), d = n + a.height, b = u + a.width;
break;
}
while (i = i.parentNode);
if (o && e !== window) {
var k = _t(i || e), A = k && k.a, S = k && k.d;
k && (n /= S, u /= A, r /= A, s /= S, d = n + s, b = u + r);
}
return {
top: n,
left: u,
bottom: d,
right: b,
width: r,
height: s
};
}
}
function So(e, l, t) {
for (var o = nt(e, !0), i = we(e)[l]; o; ) {
var a = we(o)[t], n = void 0;
if (n = i >= a, !n)
return o;
if (o === qe())
break;
o = nt(o, !1);
}
return !1;
}
function Dt(e, l, t, o) {
for (var i = 0, a = 0, n = e.children; a < n.length; ) {
if (n[a].style.display !== "none" && n[a] !== Y.ghost && (o || n[a] !== Y.dragged) && je(n[a], t.draggable, e, !1)) {
if (i === l)
return n[a];
i++;
}
a++;
}
return null;
}
function Hl(e, l) {
for (var t = e.lastElementChild; t && (t === Y.ghost || H(t, "display") === "none" || l && !gl(t, l)); )
t = t.previousElementSibling;
return t || null;
}
function Re(e, l) {
var t = 0;
if (!e || !e.parentNode)
return -1;
for (; e = e.previousElementSibling; )
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Y.clone && (!l || gl(e, l)) && t++;
return t;
}
function Do(e) {
var l = 0, t = 0, o = qe();
if (e)
do {
var i = _t(e), a = i.a, n = i.d;
l += e.scrollLeft * a, t += e.scrollTop * n;
} while (e !== o && (e = e.parentNode));
return [l, t];
}
function Rn(e, l) {
for (var t in e)
if (e.hasOwnProperty(t)) {
for (var o in l)
if (l.hasOwnProperty(o) && l[o] === e[t][o])
return Number(t);
}
return -1;
}
function nt(e, l) {
if (!e || !e.getBoundingClientRect)
return qe();
var t = e, o = !1;
do
if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
var i = H(t);
if (t.clientWidth < t.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
if (!t.getBoundingClientRect || t === document.body)
return qe();
if (o || l)
return t;
o = !0;
}
}
while (t = t.parentNode);
return qe();
}
function Nn(e, l) {
if (e && l)
for (var t in l)
l.hasOwnProperty(t) && (e[t] = l[t]);
return e;
}
function Dl(e, l) {
return Math.round(e.top) === Math.round(l.top) && Math.round(e.left) === Math.round(l.left) && Math.round(e.height) === Math.round(l.height) && Math.round(e.width) === Math.round(l.width);
}
var At;
function jo(e, l) {
return function() {
if (!At) {
var t = arguments, o = this;
t.length === 1 ? e.call(o, t[0]) : e.apply(o, t), At = setTimeout(function() {
At = void 0;
}, l);
}
};
}
function Fn() {
clearTimeout(At), At = void 0;
}
function Uo(e, l, t) {
e.scrollLeft += l, e.scrollTop += t;
}
function Wo(e) {
var l = window.Polymer, t = window.jQuery || window.Zepto;
return l && l.dom ? l.dom(e).cloneNode(!0) : t ? t(e).clone(!0)[0] : e.cloneNode(!0);
}
function Ho(e, l, t) {
var o = {};
return Array.from(e.children).forEach(function(i) {
var a, n, u, d;
if (!(!je(i, l.draggable, e, !1) || i.animated || i === t)) {
var b = we(i);
o.left = Math.min((a = o.left) !== null && a !== void 0 ? a : 1 / 0, b.left), o.top = Math.min((n = o.top) !== null && n !== void 0 ? n : 1 / 0, b.top), o.right = Math.max((u = o.right) !== null && u !== void 0 ? u : -1 / 0, b.right), o.bottom = Math.max((d = o.bottom) !== null && d !== void 0 ? d : -1 / 0, b.bottom);
}
}), o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
}
var Ae = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function Ln() {
var e = [], l;
return {
captureAnimationState: function() {
if (e = [], !!this.options.animation) {
var t = [].slice.call(this.el.children);
t.forEach(function(o) {
if (!(H(o, "display") === "none" || o === Y.ghost)) {
e.push({
target: o,
rect: we(o)
});
var i = Ge({}, e[e.length - 1].rect);
if (o.thisAnimationDuration) {
var a = _t(o, !0);
a && (i.top -= a.f, i.left -= a.e);
}
o.fromRect = i;
}
});
}
},
addAnimationState: function(t) {
e.push(t);
},
removeAnimationState: function(t) {
e.splice(Rn(e, {
target: t
}), 1);
},
animateAll: function(t) {
var o = this;
if (!this.options.animation) {
clearTimeout(l), typeof t == "function" && t();
return;
}
var i = !1, a = 0;
e.forEach(function(n) {
var u = 0, d = n.target, b = d.fromRect, s = we(d), r = d.prevFromRect, y = d.prevToRect, k = n.rect, A = _t(d, !0);
A && (s.top -= A.f, s.left -= A.e), d.toRect = s, d.thisAnimationDuration && Dl(r, s) && !Dl(b, s) && // Make sure animatingRect is on line between toRect & fromRect
(k.top - s.top) / (k.left - s.left) === (b.top - s.top) / (b.left - s.left) && (u = Un(k, r, y, o.options)), Dl(s, b) || (d.prevFromRect = b, d.prevToRect = s, u || (u = o.options.animation), o.animate(d, k, s, u)), u && (i = !0, a = Math.max(a, u), clearTimeout(d.animationResetTimer), d.animationResetTimer = setTimeout(function() {
d.animationTime = 0, d.prevFromRect = null, d.fromRect = null, d.prevToRect = null, d.thisAnimationDuration = null;
}, u), d.thisAnimationDuration = u);
}), clearTimeout(l), i ? l = setTimeout(function() {
typeof t == "function" && t();
}, a) : typeof t == "function" && t(), e = [];
},
animate: function(t, o, i, a) {
if (a) {
H(t, "transition", ""), H(t, "transform", "");
var n = _t(this.el), u = n && n.a, d = n && n.d, b = (o.left - i.left) / (u || 1), s = (o.top - i.top) / (d || 1);
t.animatingX = !!b, t.animatingY = !!s, H(t, "transform", "translate3d(" + b + "px," + s + "px,0)"), this.forRepaintDummy = jn(t), H(t, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), H(t, "transform", "translate3d(0,0,0)"), typeof t.animated == "number" && clearTimeout(t.animated), t.animated = setTimeout(function() {
H(t, "transition", ""), H(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1;
}, a);
}
}
};
}
function jn(e) {
return e.offsetWidth;
}
function Un(e, l, t, o) {
return Math.sqrt(Math.pow(l.top - e.top, 2) + Math.pow(l.left - e.left, 2)) / Math.sqrt(Math.pow(l.top - t.top, 2) + Math.pow(l.left - t.left, 2)) * o.animation;
}
var vt = [], Tl = {
initializeByDefault: !0
}, Ut = {
mount: function(e) {
for (var l in Tl)
Tl.hasOwnProperty(l) && !(l in e) && (e[l] = Tl[l]);
vt.forEach(function(t) {
if (t.pluginName === e.pluginName)
throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
}), vt.push(e);
},
pluginEvent: function(e, l, t) {
var o = this;
this.eventCanceled = !1, t.cancel = function() {
o.eventCanceled = !0;
};
var i = e + "Global";
vt.forEach(function(a) {
l[a.pluginName] && (l[a.pluginName][i] && l[a.pluginName][i](Ge({
sortable: l
}, t)), l.options[a.pluginName] && l[a.pluginName][e] && l[a.pluginName][e](Ge({
sortable: l
}, t)));
});
},
initializePlugins: function(e, l, t, o) {
vt.forEach(function(n) {
var u = n.pluginName;
if (!(!e.options[u] && !n.initializeByDefault)) {
var d = new n(e, l, e.options);
d.sortable = e, d.options = e.options, e[u] = d, Ze(t, d.defaults);
}
});
for (var i in e.options)
if (e.options.hasOwnProperty(i)) {
var a = this.modifyOption(e, i, e.options[i]);
typeof a < "u" && (e.options[i] = a);
}
},
getEventProperties: function(e, l) {
var t = {};
return vt.forEach(function(o) {
typeof o.eventProperties == "function" && Ze(t, o.eventProperties.call(l[o.pluginName], e));
}), t;
},
modifyOption: function(e, l, t) {
var o;
return vt.forEach(function(i) {
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[l] == "function" && (o = i.optionListeners[l].call(e[i.pluginName], t));
}), o;
}
};
function Wn(e) {
var l = e.sortable, t = e.rootEl, o = e.name, i = e.targetEl, a = e.cloneEl, n = e.toEl, u = e.fromEl, d = e.oldIndex, b = e.newIndex, s = e.oldDraggableIndex, r = e.newDraggableIndex, y = e.originalEvent, k = e.putSortable, A = e.extraEventProperties;
if (l = l || t && t[Ae], !!l) {
var S, P = l.options, U = "on" + o.charAt(0).toUpperCase() + o.substr(1);
window.CustomEvent && !Qe && !jt ? S = new CustomEvent(o, {
bubbles: !0,
cancelable: !0
}) : (S = document.createEvent("Event"), S.initEvent(o, !0, !0)), S.to = n || t, S.from = u || t, S.item = i || t, S.clone = a, S.oldIndex = d, S.newIndex = b, S.oldDraggableIndex = s, S.newDraggableIndex = r, S.originalEvent = y, S.pullMode = k ? k.lastPutMode : void 0;
var J = Ge(Ge({}, A), Ut.getEventProperties(o, l));
for (var ee in J)
S[ee] = J[ee];
t && t.dispatchEvent(S), P[U] && P[U].call(l, S);
}
}
var Hn = ["evt"], $e = function(e, l) {
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = t.evt, i = In(t, Hn);
Ut.pluginEvent.bind(Y)(e, l, Ge({
dragEl: z,
parentEl: me,
ghostEl: q,
rootEl: he,
nextEl: ft,
lastDownEl: cl,
cloneEl: ve,
cloneHidden: ot,
dragStarted: Vt,
putSortable: Se,
activeSortable: Y.active,
originalEvent: o,
oldIndex: wt,
oldDraggableIndex: Pt,
newIndex: Ie,
newDraggableIndex: lt,
hideGhostForTarget: Go,
unhideGhostForTarget: Jo,
cloneNowHidden: function() {
ot = !0;
},
cloneNowShown: function() {
ot = !1;
},
dispatchSortableEvent: function(a) {
Ve({
sortable: l,
name: a,
originalEvent: o
});
}
}, i));
};
function Ve(e) {
Wn(Ge({
putSortable: Se,
cloneEl: ve,
targetEl: z,
rootEl: he,
oldIndex: wt,
oldDraggableIndex: Pt,
newIndex: Ie,
newDraggableIndex: lt
}, e));
}
var z, me, q, he, ft, cl, ve, ot, wt, Ie, Pt, lt, nl, Se, gt = !1, yl = !1, wl = [], pt, Le, xl, El, To, xo, Vt, mt, Rt, Nt = !1, al = !1, fl, xe, Ol = [], Al = !1, kl = [], zl = typeof document < "u", il = Ro, Eo = jt || Qe ? "cssFloat" : "float", Yn = zl && !No && !Ro && "draggable" in document.createElement("div"), Yo = function() {
if (zl) {
if (Qe)
return !1;
var e = document.createElement("x");
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
}
}(), Xo = function(e, l) {
var t = H(e), o = parseInt(t.width) - parseInt(t.paddingLeft) - parseInt(t.paddingRight) - parseInt(t.borderLeftWidth) - parseInt(t.borderRightWidth), i = Dt(e, 0, l), a = Dt(e, 1, l), n = i && H(i), u = a && H(a), d = n && parseInt(n.marginLeft) + parseInt(n.marginRight) + we(i).width, b = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + we(a).width;
if (t.display === "flex")
return t.flexDirection === "column" || t.flexDirection === "column-reverse" ? "vertical" : "horizontal";
if (t.display === "grid")
return t.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
if (i && n.float && n.float !== "none") {
var s = n.float === "left" ? "left" : "right";
return a && (u.clear === "both" || u.clear === s) ? "vertical" : "horizontal";
}
return i && (n.display === "block" || n.display === "flex" || n.display === "table" || n.display === "grid" || d >= o && t[Eo] === "none" || a && t[Eo] === "none" && d + b > o) ? "vertical" : "horizontal";
}, Xn = function(e, l, t) {
var o = t ? e.left : e.top, i = t ? e.right : e.bottom, a = t ? e.width : e.height, n = t ? l.left : l.top, u = t ? l.right : l.bottom, d = t ? l.width : l.height;
return o === n || i === u || o + a / 2 === n + d / 2;
}, qn = function(e, l) {
var t;
return wl.some(function(o) {
var i = o[Ae].options.emptyInsertThreshold;
if (!(!i || Hl(o))) {
var a = we(o), n = e >= a.left - i && e <= a.right + i, u = l >= a.top - i && l <= a.bottom + i;
if (n && u)
return t = o;
}
}), t;
}, qo = function(e) {
function l(i, a) {
return function(n, u, d, b) {
var s = n.options.group.name && u.options.group.name && n.options.group.name === u.options.group.name;
if (i == null && (a || s))
return !0;
if (i == null || i === !1)
return !1;
if (a && i === "clone")
return i;
if (typeof i == "function")
return l(i(n, u, d, b), a)(n, u, d, b);
var r = (a ? n : u).options.group.name;
return i === !0 || typeof i == "string" && i === r || i.join && i.indexOf(r) > -1;
};
}
var t = {}, o = e.group;
(!o || pl(o) != "object") && (o = {
name: o
}), t.name = o.name, t.checkPull = l(o.pull, !0), t.checkPut = l(o.put), t.revertClone = o.revertClone, e.group = t;
}, Go = function() {
!Yo && q && H(q, "display", "none");
}, Jo = function() {
!Yo && q && H(q, "display", "");
};
zl && !No && document.addEventListener("click", function(e) {
if (yl)
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), yl = !1, !1;
}, !0);
var ct = function(e) {
if (z) {
e = e.touches ? e.touches[0] : e;
var l = qn(e.clientX, e.clientY);
if (l) {
var t = {};
for (var o in e)
e.hasOwnProperty(o) && (t[o] = e[o]);
t.target = t.rootEl = l, t.preventDefault = void 0, t.stopPropagation = void 0, l[Ae]._onDragOver(t);
}
}
}, Gn = function(e) {
z && z.parentNode[Ae]._isOutsideThisEl(e.target);
};
function Y(e, l) {
if (!(e && e.nodeType && e.nodeType === 1))
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
this.el = e, this.options = l = Ze({}, l), e[Ae] = this;
var t = {
group: null,
sort: !0,
disabled: !1,
store: null,
handle: null,
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
swapThreshold: 1,
// percentage; 0 <= x <= 1
invertSwap: !1,
// invert always
invertedSwapThreshold: null,
// will be set to same as swapThreshold if default
removeCloneOnHide: !0,
direction: function() {
return Xo(e, this.options);
},
ghostClass: "sortable-ghost",
chosenClass: "sortable-chosen",
dragClass: "sortable-drag",
ignore: "a, img",
filter: null,
preventOnFilter: !0,
animation: 0,
easing: null,
setData: function(a, n) {
a.setData("Text", n.textContent);
},
dropBubble: !1,
dragoverBubble: !1,
dataIdAttr: "data-id",
delay: 0,
delayOnTouchOnly: !1,
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
forceFallback: !1,
fallbackClass: "sortable-fallback",
fallbackOnBody: !1,
fallbackTolerance: 0,
fallbackOffset: {
x: 0,
y: 0
},
supportPointer: Y.supportPointer !== !1 && "PointerEvent" in window && !It,
emptyInsertThreshold: 5
};
Ut.initializePlugins(this, e, t);
for (var o in t)
!(o in l) && (l[o] = t[o]);
qo(l);
for (var i in this)
i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
this.nativeDraggable = l.forceFallback ? !1 : Yn, this.nativeDraggable && (this.options.touchStartThreshold = 1), l.supportPointer ? ne(e, "pointerdown", this._onTapStart) : (ne(e, "mousedown", this._onTapStart), ne(e, "touchstart", this._onTapStart)), this.nativeDraggable && (ne(e, "dragover", this), ne(e, "dragenter", this)), wl.push(this.el), l.store && l.store.get && this.sort(l.store.get(this) || []), Ze(this, Ln());
}
Y.prototype = /** @lends Sortable.prototype */
{
constructor: Y,
_isOutsideThisEl: function(e) {
!this.el.contains(e) && e !== this.el && (mt = null);
},
_getDirection: function(e, l) {
return typeof this.options.direction == "functi