UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

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