UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

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