UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,356 lines 194 kB
var go = Object.defineProperty; var ho = (e, t, n) => t in e ? go(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var We = (e, t, n) => ho(e, typeof t != "symbol" ? t + "" : t, n); import { getCustomClass as mt, withInstall as pn, FormSchemaEntityField$Type as tn, FormSchemaEntityFieldTypeName as nn, useThirdComponent as vn, isMobilePhone as gn, getMaxZIndex as on } from "../../components/common/index.esm.js"; import yo, { tabsProps as hn, tabPageProps as yn, FTabPage as bo } from "../../components/tabs/index.esm.js"; import Yt, { schemaResolver as Co } from "../response-toolbar/index.esm.js"; import { computed as H, ref as C, watch as be, nextTick as Ee, createVNode as b, onMounted as Qe, defineComponent as Ne, Fragment as pt, reactive as zt, createApp as bn, onUnmounted as st, Transition as Cn, mergeProps as St, createTextVNode as wn, inject as rt, withDirectives as _t, resolveDirective as qt, onBeforeMount as wo, watchEffect as To, Teleport as So, shallowRef as Wt, render as Nt, h as Fo, cloneVNode as xo, provide as an, isVNode as Io } from "vue"; import { DgControl as rn, useDesignerComponent as Xt, UseTemplateDragAndDropRules as Tn, setPositionForSelectedElement as Po, setPositionOfButtonGroup as Ro, canvasChanged as Sn, FDesignerInnerItem as Bo, useDragulaCommonRule as Eo } from "../../components/designer-canvas/index.esm.js"; import { resolveAppearance as Ft, createPropsResolver as Ge, createTabsEventHandlerResolver as ko, schemaResolverMap as Oo, propertyEffectMap as Mo, propertyConfigSchemaMap as Do, schemaMap as jo, getPropsResolverGenerator as Lo } from "../../components/dynamic-resolver/index.esm.js"; import { responseToolbarProps as $o } from "../../components/response-toolbar/index.esm.js"; import { isPlainObject as ln, cloneDeep as Ut, isUndefined as Je, mergeWith as No, merge as Ho } from "lodash-es"; import Vo from "../../components/capsule/index.esm.js"; import { LocaleService as Ue } from "../../components/locale/index.esm.js"; import { useResizeObserver as Ao } from "@vueuse/core"; import { getHierarchyRow as zo, useIdentify as _o, useGroupData as qo, useFilter as Wo, useHierarchy as Uo, useLoading as Go, useDataView as Yo, useSelection as Xo, useSelectHierarchyItem as Qo, usePagination as Jo, useDataViewContainerStyle as Zo, useCommandColumn as Ko, useSettingColumn as ea, useColumn as ta, useSort as na, useGroupColumn as oa, useRow as aa, useEdit as ia, useVisualDataBound as ra, useVisualDataCell as la, useVisualDataRow as sa, useVisualData as ca, useCellPosition as ua, useSidebar as da, useVirtualScroll as fa, useFitColumn as ma, useFilterHistory as pa, useColumnFilter as va, useDragColumn as ga, getColumnHeader as ha, getSidebar as ya, getDisableMask as ba, getHorizontalScrollbar as Ca, getVerticalScrollbar as wa, getEmpty as Ta, getPagination as Sa, getSummary as Fa, ColumnSettingSolution as xa, COMMAND_COLUMN_DATA_TYPE as Ht, SETTING_COLUMN_DATA_TYPE as Vt } from "../../components/data-view/index.esm.js"; import Ia from "../../components/input-group/index.esm.js"; import Pa from "../../components/button/index.esm.js"; import { loadRegister as Ra, useComponentManager as Ba, useBindingData as Ea, useEntityState as ka, useDynamicViewUtils as Oa, componentMap as At, resolverMap as Ma, componentPropsConverter as Da } from "../../components/dynamic-view/index.esm.js"; import Fn from "../../components/section/index.esm.js"; import ja from "../../components/accordion/index.esm.js"; import La from "../../components/avatar/index.esm.js"; import $a from "../button-edit/index.esm.js"; import Na from "../../components/button-group/index.esm.js"; import Ha from "../../components/calendar/index.esm.js"; import Va from "../capsule/index.esm.js"; import sn from "../checkbox/index.esm.js"; import cn from "../checkbox-group/index.esm.js"; import Aa from "../../components/combo-list/index.esm.js"; import za from "../../components/combo-tree/index.esm.js"; import _a from "../../components/component/index.esm.js"; import qa from "../../components/color-picker/index.esm.js"; import Wa from "../../components/content-container/index.esm.js"; import Ua from "../date-picker/index.esm.js"; import Ga from "../data-grid/index.esm.js"; import Ya from "../../components/dropdown/index.esm.js"; import Xa from "../dynamic-form/index.esm.js"; import Qa from "../../components/events-editor/index.esm.js"; import Ja from "../../components/filter-bar/index.esm.js"; import Za from "../../components/field-selector/index.esm.js"; import Ka from "../../components/binding-selector/index.esm.js"; import ei from "../../components/image-cropper/index.esm.js"; import ti from "../input-group/index.esm.js"; import ni from "../../components/layout/index.esm.js"; import oi from "../../components/list-nav/index.esm.js"; import ai from "../list-view/index.esm.js"; import ii from "../../components/lookup/index.esm.js"; import ri from "../../components/mapping-editor/index.esm.js"; import li from "../../components/nav/index.esm.js"; import si from "../../components/number-range/index.esm.js"; import ci from "../number-spinner/index.esm.js"; import ui from "../../components/order/index.esm.js"; import di from "../../components/page-header/index.esm.js"; import fi from "../../components/page-footer/index.esm.js"; import mi from "../../components/pagination/index.esm.js"; import pi from "../../components/progress/index.esm.js"; import vi from "../../components/query-solution/index.esm.js"; import gi from "../radio-group/index.esm.js"; import hi from "../rate/index.esm.js"; import yi from "../../components/response-layout/index.esm.js"; import bi from "../response-layout-editor/index.esm.js"; import Ci from "../../components/search-box/index.esm.js"; import wi from "../section/index.esm.js"; import Ti from "../../components/smoke-detector/index.esm.js"; import Si from "../../components/splitter/index.esm.js"; import Fi from "../../components/step/index.esm.js"; import xi from "../switch/index.esm.js"; import Ii from "../tabs/index.esm.js"; import Pi from "../tags/index.esm.js"; import Ri from "../../components/text/index.esm.js"; import Bi from "../time-picker/index.esm.js"; import Ei from "../../components/transfer/index.esm.js"; import ki from "../../components/tree-view/index.esm.js"; import Oi from "../../components/uploader/index.esm.js"; import Mi from "../../components/verify-detail/index.esm.js"; import Di from "../../components/video/index.esm.js"; import ji from "../textarea/index.esm.js"; import Li from "../../components/schema-selector/index.esm.js"; import $i from "../tree-grid/index.esm.js"; import Ni from "../../components/event-parameter/index.esm.js"; import Hi from "../../components/filter-condition-editor/index.esm.js"; import Vi from "../../components/fieldset/index.esm.js"; import Ai from "../../components/sort-condition-editor/index.esm.js"; import zi from "../../components/menu-lookup/index.esm.js"; import _i from "../drawer/index.esm.js"; import qi from "../../components/json-editor/index.esm.js"; import Wi from "../../components/property-editor/index.esm.js"; import Ui from "../../components/expression-editor/index.esm.js"; import Gi from "../../components/code-editor/index.esm.js"; import Yi from "../../components/html-template/index.esm.js"; import Xi from "../../components/collection-property-editor/index.esm.js"; import Qi from "../modal/index.esm.js"; import Ji from "../../components/external-container/index.esm.js"; import Zi from "../../components/language-textbox/index.esm.js"; import Ki from "../../components/image/index.esm.js"; import er from "../../components/comment/index.esm.js"; import { BaseControlProperty as xn } from "../../components/property-panel/index.esm.js"; import "../../components/notify/index.esm.js"; const vt = /* @__PURE__ */ new Map([ ["appearance", Ft] ]); function tr(e, t) { var l, i; if (!(t != null && t.schema)) return; const n = ((i = (l = t.schema) == null ? void 0 : l.appearance) == null ? void 0 : i.class) || "", o = t.elementRef, a = window.getComputedStyle(o); a && a.display === "flex" && !n.includes("f-page-child-fill") && (e.appearance.class += " d-block"); } function nr(e, t) { var p; const n = Math.random().toString().slice(2, 6), o = t.parentComponentInstance, a = e.getSchemaByType("tab-page"); a.id = `tab-page-${n}`, a.title = "标题", a.toolbar = { id: `tab-page-toolbar-${n}`, buttons: [] }; const l = e.getSchemaByType("tabs"); Object.assign(l, { id: `tabs-${n}`, appearance: { class: "f-component-tabs f-tabs-has-grid" }, contents: [a], activeId: a.id }); const i = e.getSchemaByType("section"); Object.assign(i, { id: `section-${n}`, appearance: { class: "f-section-tabs f-section-in-mainsubcard" }, fill: !1, showHeader: !1, contents: [l] }); const r = e.getSchemaByType("content-container"); Object.assign(r, { id: `container-${n}`, appearance: { class: "f-struct-wrapper" }, contents: [i] }); const s = o.schema, u = ((p = s.appearance) == null ? void 0 : p.class) || ""; switch (s && s.type) { case rn["splitter-pane"].type: { i.appearance.class = "f-section-tabs f-section-in-main", l.appearance.class = "f-component-tabs", u.includes("f-page-child-fill") && (r.appearance.class += " f-struct-wrapper-child", i.fill = !0, l.fill = !0); break; } case rn["content-container"].type: s.isLikeCardContainer && u.includes("f-struct-like-card-child-fill") && (r.appearance.class += " f-struct-wrapper-child", i.fill = !0, l.fill = !0); } return tr(r, o), r; } function In(e, t, n) { if (n.parentComponentInstance) return nr(e, n); { const a = e.getSchemaByType("tab-page"); return t.contents = [a], t; } } function Pn(e, t, n) { return t; } const or = "https://json-schema.org/draft/2020-12/schema", ar = "https://farris-design.gitee.io/tabs.schema.json", ir = "tabs", rr = "A Farris Container Component", lr = "object", sr = { id: { description: "The unique identifier for a Tabs", type: "string" }, type: { description: "The type string of Tabs component", type: "string", default: "tabs" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, contents: { description: "", type: "array", default: [] }, autoTitleWidth: { description: "", type: "boolean", default: !1 }, titleWidth: { description: "", type: "number" }, titleLength: { description: "", type: "number", default: 7 }, fill: { description: "", type: "boolean", default: !1 }, visible: { description: "", type: "boolean", default: !0 }, activeId: { description: "", type: "string", default: "" } }, cr = [ "id", "type", "contents" ], ur = { onTabChange: "切换标签页事件", onTabRemove: "移除标签页事件" }, Rn = { $schema: or, $id: ar, title: ir, description: rr, type: lr, properties: sr, required: cr, events: ur }, dr = "https://json-schema.org/draft/2020-12/schema", fr = "https://farris-design.gitee.io/tab-toolbar.schema.json", mr = "tab-toolbar", pr = "A Farris Toolbar Component", vr = "object", gr = { id: { description: "The unique identifier for a Tab Toolbar", type: "string" }, type: { description: "The type string of Tab Toolbar", type: "string", default: "tab-toolbar" }, appearance: { description: "", type: "object", properties: { class: { type: "string", default: "" } } }, alignment: { description: "The alignment of Tab Toolbar Button.", type: "string", default: "right" }, buttons: { description: "The items of Tab Toolbar.", type: "array", default: [] }, buttonSize: { type: "string", default: "" }, visible: { description: "", type: "boolean", default: !0 } }, hr = [ "id", "type", "buttons" ], yr = { onClick: "点击事件" }, br = { $schema: dr, $id: fr, title: mr, description: pr, type: vr, properties: gr, required: hr, events: yr }, Cr = Ge(hn, Rn, vt, In), Bn = Object.assign({}, hn, { componentId: { type: String, default: "" } }), wr = Ge(Bn, Rn, vt, In), Tr = ko(), Sr = Ge( $o, br, vt, Co ); function Fr(e, t, n, o, a, l) { const { activeId: i, selectTab: r, removeDesignTab: s, selectDesignTab: u, addTabPageToolbar: p, resetPositionForSelectedElement: d } = a, f = H(() => ({ "st-tab-text": !0, "farris-title-auto": e.autoTitleWidth })), m = H(() => { const j = { "farris-component": !0, "nav-item": !0, "f-state-active": t.id === i.value }; return j[`${t.id}-design-item`] = !0, j; }), v = H(() => { const j = {}; return t.tabWidth && t.tabWidth > 0 && (j.width = `${t.tabWidth}px`), j; }), y = H(() => ({ "nav-link": !0, "tabs-text-truncate": !0, active: t.id === i.value })); function L() { return b("span", { class: f.value, title: t.title }, [t.title]); } const R = C(t.removeable); function S() { return R.value ? b("span", { class: "st-drop-close", style: "opacity:0.6" }, [b("i", { class: "f-icon f-icon-close" }, null)]) : ""; } function k() { return R.value ? t.titleHtml + `<span class="st-drop-close" style="opacity:0.6"> <i class="f-icon f-icon-close"></i> </span>` : t.titleHtml; } function I(j) { r(t.id), e.tabType === "one-page" && o.scrollToByPaggId(t.id); } function F(j) { j && (j.stopPropagation(), j.preventDefault()), u(j, t.id, l.value); } function N(j) { s(j, t.id); } function O(j) { p(j, t.id); } be(() => t.toolbarPosition, () => { Ee(() => { d(); }); }), be(() => t.tabWidth, () => { Ee(() => { d(); }); }), be(() => t.titleHtml, () => { Ee(() => { d(); }); }); function B() { return b("div", { role: "button", class: "btn component-settings-button", title: "删除", ref: "removeComponent", onClick: (j) => N(j) }, [b("i", { class: "f-icon f-icon-yxs_delete" }, null)]); } function M() { return b("div", { role: "button", class: "btn component-settings-button", title: "新增按钮", ref: "addComponent", onClick: (j) => O(j) }, [b("i", { class: "f-icon f-icon-plus-circle" }, null)]); } function x() { return b("div", { class: "component-btn-group", "data-noattach": "true" }, [b("div", null, [B(), !t.toolbar || !t.toolbar.buttons || !t.toolbar.buttons.length ? M() : ""])]); } function T() { return n.slots.title ? b("a", { class: y.value, onClick: I, id: `${t.id}-design-item` }, [n.slots.title(n), S()]) : t.titleHtml ? b("a", { class: y.value, onClick: I, id: `${t.id}-design-item`, innerHTML: k() }, null) : b("a", { class: y.value, onClick: I, id: `${t.id}-design-item` }, [L(), S()]); } return b("li", { onClick: (j) => F(j), class: m.value, style: v.value, pageId: `${t.id}-design-item` }, [x(), T()]); } function xr(e, t) { let n; function o(d) { const { properties: f, title: m, ignore: v } = d, y = v && Array.isArray(v), L = Object.keys(f).reduce((R, S) => ((!y || !v.find((k) => k === S)) && (R[S] = f[S].type === "object" && f[S].properties ? o(f[S]) : Ut(f[S].default)), R), {}); if (m && (!y || !v.find((R) => R === "id"))) { const R = m.toLowerCase().replace(/-/g, "_"); L.id = `${R}_${Math.random().toString().slice(2, 6)}`; } return L; } function a(d) { const { properties: f, title: m, required: v } = d; if (v && Array.isArray(v)) { const y = v.reduce((L, R) => (L[R] = f[R].type === "object" && f[R].properties ? o(f[R]) : Ut(f[R].default), L), {}); if (m && v.find((L) => L === "id")) { const L = m.toLowerCase().replace(/-/g, "_"); y.id = `${L}_${Math.random().toString().slice(2, 6)}`; } return y; } return { type: m }; } function l(d, f = {}, m) { const v = e[d]; if (v) { let y = a(v); const L = t[d]; return y = L ? L({ getSchemaByType: l }, y, f, m) : y, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(y), y; } return null; } function i(d, f) { const m = o(f); return Object.keys(m).reduce((v, y) => (Object.prototype.hasOwnProperty.call(d, y) && (v[y] && ln(v[y]) && ln(d[y] || !d[y]) ? Object.assign(v[y], d[y] || {}) : v[y] = d[y]), v), m), m; } function r(d, f) { return Object.keys(d).filter((v) => d[v] != null).reduce((v, y) => { if (f.has(y)) { const L = f.get(y); if (typeof L == "string") v[L] = d[y]; else { const R = L(y, d[y], d); Object.assign(v, R); } } else v[y] = d[y]; return v; }, {}); } function s(d, f, m = /* @__PURE__ */ new Map()) { const v = i(d, f); return r(v, m); } function u(d) { var m; const f = d.type; if (f) { const v = e[f]; if (!v) return d; const y = i(d, v), L = ((m = d.editor) == null ? void 0 : m.type) || ""; if (L) { const R = e[L], S = i(d.editor, R); y.editor = S; } return y; } return d; } function p(d) { n = d; } return { getSchemaByType: l, resolveSchemaWithDefaultValue: u, resolveSchemaToProps: s, mappingSchemaToProps: r, setDesignerContext: p }; } const Ir = {}, Pr = {}, { getSchemaByType: En } = xr(Ir, Pr); function Rr(e, t, n, o, a, l, i) { const { tabPages: r, selectTab: s, emitSelectionChange: u } = a, p = H(() => ({ spacer: !0, "f-utils-fill": !0 })), d = H(() => ({ width: "100%", "justify-content": e.justifyContent })), f = H(() => ({ nav: !0, "farris-nav-tabs": !0, "flex-nowrap": !0, "nav-fill": e.tabType === "fill", "nav-pills": e.tabType === "pills", "flex-row": e.position === "top" || e.position === "bottom", "flex-column": e.position === "left" || e.position === "right" })), m = H(() => ({ overflow: "auto" })), v = function(y) { var R; y && (y.stopPropagation(), y.preventDefault()); const L = En("tab-page"); L.id = `tab_page_${Math.random().toString().slice(2, 6)}`, L.title = "标题", L.toolbar = { id: `${L.id}_toolbar`, buttons: [], type: "tab-toolbar" }, (R = l.value.schema.contents) == null || R.push(L), s(L.id), Ee(() => { u(L.id, l.value); }); }; return () => b("div", { class: p.value, style: d.value }, [b("ul", { class: f.value, style: m.value, ref: t }, [r.value.map((y) => Fr(e, y.props, y, o, a, l)), b("li", { class: "nav-item no-drag add-nav-item" }, [b("a", { class: "nav-link tabs-text-truncate", title: "添加页签", onClick: (y) => v(y) }, [b("i", { class: "f-icon f-icon-plus", style: "font-size: 20px;margin: 0 auto;line-height: 24px;" }, null)])])])]); } function Br(e, t, n, o, a) { const l = C(), { shouldShowNavigationButtons: i } = n, { activeId: r, tabPages: s, selectTab: u } = a, p = C(r.value), d = H(() => s.value.map((y) => ({ name: y.props.title, value: y.props.id, show: y.props.show, disabled: y.props.disabled }))), f = H(() => ({ spacer: !0, "f-utils-fill": !0, "spacer-sides-dropdown": i.value })), m = H(() => ({ width: "100%", display: "flex", "justify-content": e.justifyContent })); Qe(() => { l.value && (t.value = l.value.$el); }); function v(y) { u(y); } return be(() => r.value, (y) => { y !== p.value && (p.value = y); }, { immediate: !0 }), () => b("div", { class: f.value, style: m.value }, [b(Vo, { items: d.value, modelValue: p.value, "onUpdate:modelValue": (y) => p.value = y, onChange: v, ref: l }, null)]); } function Er(e, t, n, o) { const a = C(!1), { selectTab: l, tabPages: i, needUpdateNavigationLayout: r, activeId: s } = o, u = 4, p = H(() => ({ btn: !0, "sc-nav-btn": !0, "px-1": !0, "sc-nav-lr": !0, "d-none": !a.value })), d = H(() => ({ "btn-group": !0, "sc-nav-btn": !0, dropdown: !0, "d-none": !a.value })), f = H(() => ({ btn: !0, "sc-nav-rg": !0, "d-none": !a.value })); function m(S, k) { if (!t.value) return; const I = t.value.scrollLeft, F = t.value.scrollWidth - t.value.offsetWidth; if (k > 0) { if (t.value.scrollLeft >= F) return; t.value.scrollLeft = I + e.scrollStep + S; } else if (k < 0) { if (t.value.scrollLeft <= 0) return; t.value.scrollLeft = I - e.scrollStep - S; } } function v(S = -1) { if (!a.value || !t.value) return; S < 0 && (S = i.value.findIndex((O) => O.props.id === s.value)); const k = e.tabType === "pills" ? ".f-capsule-item" : ".nav-item", I = t.value.querySelectorAll(k), { parentElement: F } = t.value, N = I[S]; if (N && F) { const O = F.getBoundingClientRect().left, B = F.getBoundingClientRect().right, M = N.getBoundingClientRect().left, x = N.getBoundingClientRect().right; M < O ? m(O - M, -1) : B < x && m(x - B, 1), e.tabType === "one-page" && n.scrollTo(S); } } function y() { var I; if (!t.value) return; const S = t.value, k = (I = t.value) == null ? void 0 : I.parentElement; a.value = k && S && k.offsetWidth < S.scrollWidth - u, a.value && Ee(() => { v(); }); } function L(S) { S.disabled || l(S.id); } function R() { ["default", "one-page"].indexOf(e.tabType) > -1 && Ee(() => { v(); }); } return be(r, () => { y(); }), { previousButtonClass: p, nextButtonGroupClass: d, nextButtonClass: f, scrollTab: m, selectAndScrollToTab: L, shouldShowNavigationButtons: a, updateNavigationLayout: y, scrollToSelectedTab: R }; } function kr(e, t) { const { tabPages: n } = t, o = C(""), a = C(!0), l = H(() => e.searchBoxVisible), i = H(() => l.value ? n.value.filter((s) => s.props.title.includes(o.value)) : n.value.slice()); return be(a, (r) => { r || (o.value = ""); }), { searchTabText: o, hideDropDown: a, shouldShowSearchBox: l, tabsInDropdownMenu: i }; } function Or(e, t, n) { const o = ".farris-tab-page", { tabPages: a } = n; function l(r) { const s = t.value; if (s) { const u = t.value.querySelectorAll(o); if (u.length > 0) { const p = u[r], { offsetTop: d } = p, f = d - 32 > 0 ? d - 32 : 0; s.scrollTop = f; } } } function i(r) { const s = a.value.findIndex((u) => u.props.id === r); s > -1 && l(s); } return { scrollTo: l, scrollToByPaggId: i }; } C(0); var Ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Mr(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function yt(e) { throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var kn = { exports: {} }; (function(e, t) { (function(n) { e.exports = n(); })(function() { return (/* @__PURE__ */ function() { function n(o, a, l) { function i(u, p) { if (!a[u]) { if (!o[u]) { var d = typeof yt == "function" && yt; if (!p && d) return d(u, !0); if (r) return r(u, !0); var f = new Error("Cannot find module '" + u + "'"); throw f.code = "MODULE_NOT_FOUND", f; } var m = a[u] = { exports: {} }; o[u][0].call(m.exports, function(v) { var y = o[u][1][v]; return i(y || v); }, m, m.exports, n, o, a, l); } return a[u].exports; } for (var r = typeof yt == "function" && yt, s = 0; s < l.length; s++) i(l[s]); return i; } return n; }())({ 1: [function(n, o, a) { var l = {}, i = "(?:^|\\s)", r = "(?:\\s|$)"; function s(d) { var f = l[d]; return f ? f.lastIndex = 0 : l[d] = f = new RegExp(i + d + r, "g"), f; } function u(d, f) { var m = d.className; m.length ? s(f).test(m) || (d.className += " " + f) : d.className = f; } function p(d, f) { d.className = d.className.replace(s(f), " ").trim(); } o.exports = { add: u, rm: p }; }, {}], 2: [function(n, o, a) { (function(l) { var i = n("contra/emitter"), r = n("crossvent"), s = n("./classes"), u = document, p = u.documentElement; function d(T, j) { var ne = arguments.length; ne === 1 && Array.isArray(T) === !1 && (j = T, T = []); var A, K, Z, ie, V, U, ee, X, se, xe = null, we, ae, Ie = !1, Pe = 0, ve, Q = j || {}; Q.moves === void 0 && (Q.moves = S), Q.accepts === void 0 && (Q.accepts = S), Q.invalid === void 0 && (Q.invalid = Ke), Q.containers === void 0 && (Q.containers = T || []), Q.isContainer === void 0 && (Q.isContainer = R), Q.copy === void 0 && (Q.copy = !1), Q.copySortSource === void 0 && (Q.copySortSource = !1), Q.revertOnSpill === void 0 && (Q.revertOnSpill = !1), Q.removeOnSpill === void 0 && (Q.removeOnSpill = !1), Q.direction === void 0 && (Q.direction = "vertical"), Q.ignoreInputTextSelection === void 0 && (Q.ignoreInputTextSelection = !0), Q.mirrorContainer === void 0 && (Q.mirrorContainer = u.body); var h = i({ containers: Q.containers, start: Re, end: et, cancel: Ye, remove: ot, destroy: re, canMove: Fe, dragging: !1 }); return Q.removeOnSpill === !0 && h.on("over", It).on("out", Pt), g(), h; function c(P) { return h.containers.indexOf(P) !== -1 || Q.isContainer(P); } function g(P) { var q = P ? "remove" : "add"; v(p, q, "mousedown", Ce), v(p, q, "mouseup", tt); } function w(P) { var q = P ? "remove" : "add"; v(p, q, "mousemove", de); } function $(P) { var q = P ? "remove" : "add"; r[q](p, "selectstart", le), r[q](p, "click", le); } function re() { g(!0), tt({}); } function le(P) { we && P.preventDefault(); } function Ce(P) { ie = P.clientX, V = P.clientY; var q = y(P) !== 1 || P.metaKey || P.ctrlKey; if (!q) { var Y = P.target, te = fe(Y); te && (we = te, w(), P.type === "mousedown" && (N(Y) ? Y.focus() : P.preventDefault())); } } function de(P) { if (we) { if (y(P) === 0) { tt({}); return; } if (!(P.clientX !== void 0 && Math.abs(P.clientX - ie) <= (Q.slideFactorX || 0) && P.clientY !== void 0 && Math.abs(P.clientY - V) <= (Q.slideFactorY || 0))) { if (Q.ignoreInputTextSelection) { var q = x("clientX", P) || 0, Y = x("clientY", P) || 0, te = u.elementFromPoint(q, Y); if (N(te)) return; } var me = we; w(!0), $(), et(), Oe(me), s.add(X || Z, "gu-transit"), Bt(), Rt(), Pe = 0, Te(P); } } } function fe(P) { if (!(h.dragging && A) && !c(P)) { for (var q = P; F(P) && c(F(P)) === !1; ) if (Q.invalid(P, q) || (P = F(P), !P)) return; var Y = F(P); if (Y && !Q.invalid(P, q)) { var te = Q.moves(P, Y, q, B(P)); if (te) return { item: P, source: Y }; } } } function Fe(P) { return !!fe(P); } function Re(P) { var q = fe(P); q && Oe(q); } function Oe(P) { $t(P.item, P.source) && (X = P.item.cloneNode(!0), h.emit("cloned", X, P.item, "copy")), K = P.source, Z = P.item, U = ee = B(P.item), h.dragging = !0, h.emit("drag", Z, K); } function Ke() { return !1; } function et() { if (h.dragging) { var P = X || Z; nt(P, F(P)); } } function Be() { we = !1, w(!0), $(!0); } function tt(P) { if (Be(), !!h.dragging) { var q = X || Z, Y = x("clientX", P) || 0, te = x("clientY", P) || 0, me = L(A, Y, te), ge = Se(me, Y, te); ge && (X && Q.copySortSource || !X || ge !== K) ? nt(q, ge) : Q.removeOnSpill ? ot() : Ye(); } } function nt(P, q) { var Y = F(P); X && Q.copySortSource && q === K && Y.removeChild(Z), oe(q) ? h.emit("cancel", P, K) : h.emit("drop", P, q, K, ee), E(); } function ot() { if (h.dragging) { var P = X || Z, q = F(P); q && q.removeChild(P), h.emit(X ? "cancel" : "remove", P, q, K), E(); } } function Ye(P) { if (h.dragging) { var q = arguments.length > 0 ? P : Q.revertOnSpill, Y = X || Z, te = F(Y), me = oe(te); me === !1 && q && (X ? te && te.removeChild(X) : K.insertBefore(Y, U)), me || q ? h.emit("cancel", Y, K, K) : h.emit("drop", Y, te, K, ee), E(); } } function E() { var P = X || Z; Be(), Et(), kt(), P && s.rm(P, "gu-transit"), se && clearTimeout(se), h.dragging = !1, xe && h.emit("out", P, xe, K), h.emit("dragend", P, Pe), K = Z = X = U = ee = se = xe = null; } function oe(P, q) { var Y; return q !== void 0 ? Y = q : A ? Y = ee : Y = B(X || Z), P === K && Y === U; } function Se(P, q, Y) { for (var te = P; te && !me(); ) te = F(te); return te; function me() { var ge = c(te); if (ge === !1) return !1; var _e = gt(te, P), Le = ht(te, _e, q, Y), Ve = oe(te, Le); return Ve ? !0 : Q.accepts(Z, te, K, Le); } } function Te(P) { if (!A) return; P.preventDefault(); var q = x("clientX", P) || 0, Y = x("clientY", P) || 0; A.style.left = q - 2 + "px", A.style.top = Y - 2 + "px"; var te = X || Z, me = L(A, q, Y), ge = Se(me, q, Y), _e = ge !== null && ge !== xe; (_e || ge === null) && (He(), xe = ge, Ae()), Lt(me, Y); var Le = F(te); if (ge === K && X && !Q.copySortSource) { Le && Le.removeChild(te); return; } var Ve, $e = gt(ge, me); if (Ie = Ot($e, ge), $e !== null) Ve = ht(ge, $e, q, Y); else if (Q.revertOnSpill === !0 && !X) Ve = U, ge = K; else { X && Le && Le.removeChild(te), X && ae && (ae.style.display = "none"); return; } ae.style.display = "block", je(Ve, te, _e), Ve ? Dt($e, Ve) : jt(ge); function Me(De) { h.emit(De, te, xe, K); } function Ae() { _e && Me("over"); } function He() { xe && Me("out"); } } function je(P, q, Y) { (P === q || P === B(q)) && (ee = B(q)), (P === null && Y || P !== q && P !== B(q)) && (ee = P); } function It(P) { s.rm(P, "gu-hide"); } function Pt(P) { h.dragging && s.add(P, "gu-hide"); } function Rt() { A || (A = document.createElement("div"), A.style = "background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;", A.innerHTML = Q.getMirrorText && Q.getMirrorText(Z) || "控件", s.add(A, "gu-mirror"), Q.mirrorContainer.appendChild(A), v(p, "add", "mousemove", Te), s.add(Q.mirrorContainer, "gu-unselectable"), h.emit("cloned", A, Z, "mirror")); } function Bt() { if (ae = document.createElement("div"), s.add(ae, "gu-insertion"), Z) { var P = Z.getBoundingClientRect(); ae.style.left = P.left + "px", ae.style.top = P.top + "px"; } Ie = !1, Q.mirrorContainer.appendChild(ae); } function Et() { A && (s.rm(Q.mirrorContainer, "gu-unselectable"), v(p, "remove", "mousemove", Te), F(A).removeChild(A), A = null); } function kt() { ae && (F(ae).removeChild(ae), ae = null); } function gt(P, q) { for (var Y = q; Y !== P && F(Y) !== P; ) Y = F(Y); return Y === p ? null : Y; } function Ot(P, q) { if (!q) return Ie; var Y = P || q && q.lastElementChild; if (!Y) return !0; var te = getComputedStyle(P), me = /^inline/.test(te.getPropertyValue("display")) || /^(left|right)$/.test(te.getPropertyValue("float")); if (me) return !0; if (q) { var ge = getComputedStyle(q), _e = ge.getPropertyValue("display"); if (/flex$/.test(_e)) { var Le = ge.getPropertyValue("flex-direction") || "row"; if (Le === "row" || Le === "row-reverse") return !Mt(q); } return !1; } return !0; } function Mt(P) { if (!P.children || !P.children.length) return !1; for (const q of Array.from(P.children)) { const te = (q.className && q.className.split(" ") || []).filter((me) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(me)); if (!te.length) return !1; for (const me of te) { const ge = me.slice(me.lastIndexOf("-") + 1); if (parseInt(ge, 10) !== 12) return !1; } } return !0; } function Dt(P, q) { const Y = q.getBoundingClientRect(); if (ae.style.left = Y.left + "px", ae.style.top = Y.top + "px", Ie) { if (ae.style.height = Y.height + "px", ae.style.width = "4px", P) { const te = P.getBoundingClientRect(); te.top !== Y.top && (ae.style.left = te.right + "px", ae.style.top = te.top + "px", ae.style.height = te.height + "px"); } } else if (ae.style.height = "4px", ae.style.width = Y.width + "px", ve) { const te = ve.getBoundingClientRect(); Y.top < te.top && (ae.style.display = "none"); } q === Z && Z && (ae.style.display = "none"); } function jt(P) { ee = null; var q = P.lastElementChild; if (q) { var Y = q.getBoundingClientRect(); Ie ? (ae.style.left = Y.right + "px", ae.style.top = Y.top + "px", ae.style.height = Y.height + "px", ae.style.width = "4px") : (ae.style.left = Y.left + "px", ae.style.top = Y.bottom + "px", ae.style.height = "4px", ae.style.width = Y.width + "px"), q === Z && Z && (ae.style.display = "none"); } else ae.style.display = "none"; } function Lt(P, q) { if (!Q.mirrorContainer.contains(P) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (ve = f(P), !ve || !ve.contains(P))) return; const Y = document.querySelector(".dgComponentSelected"), te = ve.getBoundingClientRect(); if (q - 30 < te.top && ve.scrollTop > 0) { let me = ve.scrollTop < 10 ? ve.scrollTop : 10; ve.scrollBy(0, -1 * me), Y && ve.contains(Y) && (Pe = Pe + -1 * me); } if (q + 30 > te.bottom && ve.scrollTop < ve.scrollHeight - ve.clientHeight) { const me = ve.scrollHeight - ve.clientHeight - ve.scrollTop; let ge = me < 10 ? me : 10; ve.scrollBy(0, ge), Y && ve.contains(Y) && (Pe = Pe + ge); } } function ht(P, q, Y, te) { var me = Q.direction === "horizontal", ge = Q.direction === "mixed", _e = q !== P ? Ve() : Le(); return _e; function Le() { var Me = P.children.length, Ae, He, De; for (Ae = 0; Ae < Me; Ae++) if (He = P.children[Ae], De = He.getBoundingClientRect(), me && De.left + De.width / 2 > Y || !ge && !me && De.top + De.height / 2 > te || ge && De.left + De.width > Y && De.top + De.height > te) return He; return null; } function Ve() { var Me = q.getBoundingClientRect(); if (ge) { var Ae = te - Me.top, He = Y - Me.left, De = Me.bottom - te, ct = Me.right - Y, ut = Math.min(He, ct, Ae, De), it; return Ie ? it = ct < He : it = De === ut || ct === ut || He === ut, $e(it); } return $e(me ? Y > Me.left + k(Me) / 2 : te > Me.top + I(Me) / 2); } function $e(Me) { return Me ? B(q) : q; } } function $t(P, q) { return typeof Q.copy == "boolean" ? Q.copy : Q.copy(P, q); } } function f(T) { const j = Array.from(window.scrollContainerList); if (j.length === 1) { const A = Array.from(window.scrollContainerList)[0]; return document.getElementById(A); } const ne = m(j); for (const A of ne) if (A.contains(T)) return A; return null; } function m(T) { const j = []; return T.forEach((ne) => { const A = document.getElementById(ne); A && j.push(A); }), j.sort((ne, A) => ne.contains(A) ? 1 : A.contains(ne) ? -1 : 0), j; } function v(T, j, ne, A) { var K = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, Z = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, ie = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; l.navigator.pointerEnabled ? r[j](T, Z[ne], A) : l.navigator.msPointerEnabled ? r[j](T, ie[ne], A) : (r[j](T, K[ne], A), r[j](T, ne, A)); } function y(T) { if (T.touches !== void 0) return T.touches.length; if (T.which !== void 0 && T.which !== 0) return T.which; if (T.buttons !== void 0) return T.buttons; var j = T.button; if (j !== void 0) return j & 1 ? 1 : j & 2 ? 3 : j & 4 ? 2 : 0; } function L(T, j, ne) { T = T || {}; var A = T.className || "", K; return T.className += " gu-hide", K = u.elementFromPoint(j, ne), T.className = A, K; } function R() { return !1; } function S() { return !0; } function k(T) { return T.width || T.right - T.left; } function I(T) { return T.height || T.bottom - T.top; } function F(T) { return T.parentNode === u ? null : T.parentNode; } function N(T) { return T.tagName === "INPUT" || T.tagName === "TEXTAREA" || T.tagName === "SELECT" || O(T); } function O(T) { return !T || T.contentEditable === "false" ? !1 : T.contentEditable === "true" ? !0 : O(F(T)); } function B(T) { return T.nextElementSibling || j(); function j() { var ne = T; do ne = ne.nextSibling; while (ne && ne.nodeType !== 1); return ne; } } function M(T) { return T.targetTouches && T.targetTouches.length ? T.targetTouches[0] : T.changedTouches && T.changedTouches.length ? T.changedTouches[0] : T; } function x(T, j) { var ne = M(j), A = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return T in A && !(T in ne) && A[T] in ne && (T = A[T]), ne[T]; } o.exports = d; }).call(this, typeof Ze < "u" ? Ze : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }], 3: [function(n, o, a) { o.exports = function(i, r) { return Array.prototype.slice.call(i, r); }; }, {}], 4: [function(n, o, a) { var l = n("ticky"); o.exports = function(r, s, u) { r && l(function() { r.apply(u || null, s || []); }); }; }, { ticky: 10 }], 5: [function(n, o, a) { var l = n("atoa"), i = n("./debounce"); o.exports = function(s, u) { var p = u || {}, d = {}; return s === void 0 && (s = {}), s.on = function(f, m) { return d[f] ? d[f].push(m) : d[f] = [m], s; }, s.once = function(f, m) { return m._once = !0, s.on(f, m), s; }, s.off = function(f, m) { var v = arguments.length; if (v === 1) delete d[f]; else if (v === 0) d = {}; else { var y = d[f]; if (!y) return s; y.splice(y.indexOf(m), 1); } return s; }, s.emit = function() { var f = l(arguments); return s.emitterSnapshot(f.shift()).apply(this, f); }, s.emitterSnapshot = function(f) { var m = (d[f] || []).slice(0); return function() { var v = l(arguments), y = this || s; if (f === "error" && p.throws !== !1 && !m.length) throw v.length === 1 ? v[0] : v; return m.forEach(function(R) { p.async ? i(R, v, y) : R.apply(y, v), R._once && s.off(f, R); }), s; }; }, s; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(n, o, a) { (function(l) { var i = n("custom-event"), r = n("./eventmap"), s = l.document, u = f, p = v, d = []; l.addEventListener || (u = m, p = y), o.exports = { add: u, remove: p, fabricate: L }; function f(F, N, O, B) { return F.addEventListener(N, O, B); } function m(F, N, O) { return F.attachEvent("on" + N, S(F, N, O)); } function v(F, N, O, B) { return F.removeEventListener(N, O, B); } function y(F, N, O) { var B = k(F, N, O); if (B) return F.detachEvent("on" + N, B); } function L(F, N, O) { var B = r.indexOf(N) === -1 ? x() : M(); F.dispatchEvent ? F.dispatchEvent(B) : F.fireEvent("on" + N, B); function M() { var T; return s.createEvent ? (T = s.createEvent("Event"), T.initEvent(N, !0, !0)) : s.createEventObject && (T = s.createEventObject()), T; } function x() { return new i(N, { detail: O }); } } function R(F, N, O) { return function(M) { var x = M || l.event; x.target = x.target || x.srcElement, x.preventDefault = x.preventDefault || function() { x.returnValue = !1; }, x.stopPropagation = x.stopPropagation || function() { x.cancelBubble = !0; }, x.which = x.which || x.keyCode, O.call(F, x); }; } function S(F, N, O) { var B = k(F, N, O) || R(F, N, O); return d.push({ wrapper: B, element: F, type: N, fn: O }), B; } function k(F, N, O) { var B = I(F, N, O); if (B) { var M = d[B].wrapper; return d.splice(B, 1), M; } } function I(F, N, O) { var B, M; for (B = 0; B < d.length; B++) if (M = d[B], M.element === F && M.type === N && M.fn === O) return B; } }).call(this, typeof Ze < "u" ? Ze : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./eventmap": 7, "custom-event": 8 }], 7: [function(n, o, a) { (function(l) { var i = [], r = "", s = /^on/; for (r in l) s.test(r) && i.push(r.slice(2)); o.exports = i; }).call(this, typeof Ze < "u" ? Ze : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 8: [function(n, o, a) { (function(l) { var i = l.CustomEvent; function r() { try { var s = new i("cat", { detail: { foo: "bar" } }); return s.type === "cat" && s.detail.foo === "bar"; } catch { } return !1; } o.exports = r() ? i : ( // IE >= 9 typeof document < "u" && typeof document.createEvent == "function" ? function(u, p) { var d = document.createEvent("CustomEvent"); return p ? d.initCustomEvent(u, p.bubbles, p.cancelable, p.detail) : d.initCustomEvent(u, !1, !1, void 0), d; } : ( // IE <= 8 function(u, p) { var d = document.createEventObject(); return d.type = u, p ? (d.bubbles = !!p.bubbles, d.cancelable = !!p.cancelable, d.detail = p.detail) : (d.bubbles = !1, d.cancelable = !1, d.detail = void 0), d; } ) ); }).call(this, typeof Ze < "u" ? Ze : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 9: [function(n, o, a) { var l = o.exports = {}, i, r; function s() { throw new Error("setTimeout has not been defined"); } function u() { throw new Error("clearTimeout has not been defined"); } (function() { try { typeof setTimeout == "function" ? i = setTimeout : i = s; } catch { i = s; } try { typeof clearTimeout == "function" ? r = clearTimeout : r = u; } catch { r = u; } })(); function p(I) { if (i === setTimeout) return setTimeout(I, 0); if ((i === s || !i) && setTimeout) return i = setTimeout, setTimeout(I, 0); try { return i(I, 0); } catch { try { return i.call(null, I, 0); } catch { return i.call(this, I, 0); } } } function d(I) { if (r === clearTimeout) return clearTimeout(I); if ((r === u || !r) && clearTimeout) return r = clearTimeout, clearTimeout(I); try { return r(I); } catch { try { return r.call(null, I); } catch { return r.call(this, I); } } } var f = [], m = !1, v, y = -1; function L() { !m || !v || (m = !1, v.length ? f = v.concat(f) : y = -1, f.length && R()); } function R() { if (!m) { var I = p(L); m = !0; for (var F = f.length; F; ) { for (v = f, f =