UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,348 lines 1.89 MB
var Jv = Object.defineProperty; var Xv = (e, t, n) => t in e ? Jv(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var q = (e, t, n) => Xv(e, typeof t != "symbol" ? t + "" : t, n); import { getCustomClass as st, isMobilePhone as Lt, withInstall as Ct, isImageUrl as Zv, urlPrependBasePath as po, isBase64ImageUrl as eg, getCustomStyle as on, FormSchemaEntityField$Type as Po, FormSchemaEntityFieldType$Type as il, EVENT_PROPERTY_TAB_IDS as ma, getMaxZIndex as hl, useGuid as wn, resolveField as Zt, useDateFormat as Wn, useResizeObserver as Xr, CHECKBOX_CONTEXT as Rs, useCheck as $s, radioCheckboxCommonProps as Ad, useTouchMomentum as tg, useTouch as ng, useCommonUtils as Fa, useBem as gn, useFarrisConfig as ag, useThirdComponent as Vd, FormSchemaEntityFieldTypeName as dl, formatTime as og, getDateObject as ba, isLeapYear as lg, compareDate as Pi, getDaysInMonth as ig, useTextBox as Ld, useClear as Nd, encrypt as rg, useNumberFormat as Rd, useDelayedRef as sg, RADIOGROUP_CONTEXT as $d, useReqAnimationFrame as ug, getTimeObject as Dr, formatObjecTime as cg } from "../common/index.esm.js"; import { computed as V, defineComponent as ce, createVNode as r, provide as Gt, ref as C, inject as Fe, onMounted as Ve, watch as _, Fragment as at, createTextVNode as we, nextTick as it, Teleport as Ja, createApp as Do, onUnmounted as Ht, onBeforeMount as Oo, watchEffect as ir, Transition as Mi, shallowRef as si, render as Or, h as dg, cloneVNode as fg, mergeProps as Qt, withDirectives as Ot, vShow as Sa, onUpdated as pg, onBeforeUnmount as jd, withModifiers as qt, vModelText as Pa, toRef as mg, reactive as ot, resolveDirective as zn, isVNode as qn, Comment as Hd, getCurrentInstance as rr, resolveComponent as Zn, toRefs as Sl, toRaw as hg, vModelCheckbox as js, vModelSelect as vg } from "vue"; import { resolveAppearance as ht, createPropsResolver as Ke, getPropsResolverGenerator as Sn, getSchemaByTypeForDesigner as gg, schemaResolverMap as yg, propertyEffectMap as bg, propertyConfigSchemaMap as Cg, schemaMap as wg, getSchemaByType as vl, resolveToolbar as zd, createPageHeaderEventHandlerResolver as Wd, createEventsResolver as qd, createFormBindingResolver as Sg } from "../dynamic-resolver/index.esm.js"; import { useDesignerComponent as Xt, DgControl as Ee, canvasChanged as ui, refreshCanvas as xg, useDragulaCommonRule as Ud, UseTemplateDragAndDropRules as Yd, setPositionOfButtonGroup as Gd } from "../designer-canvas/index.esm.js"; import { LocaleService as ze } from "../locale/index.esm.js"; import { FNotifyService as Ma, F_NOTIFY_SERVICE_TOKEN as xl } from "../notify/index.esm.js"; import { isPlainObject as yc, cloneDeep as ft, debounce as Ia, isFunction as Ar, isUndefined as $n, mergeWith as Ii, merge as gl, isNil as Tg, isNaN as kg, flatten as Qd, get as ja, isEmpty as Fg } from "lodash-es"; import _d from "../color-picker/index.esm.js"; import Ei, { FTouchComboListContainer as Kd, useDataSource as Pg, FComboListContainer as Mg, FComboList as Ao } from "../combo-list/index.esm.js"; import Jd, { useNumber as Ig, useFormat as Eg, useSpinner as Bg, useTextBox as Dg, getSpinnerRender as Og, getNumberTextBoxRender as Ag, FNumberSpinner as ci, useNumberLocales as Vg } from "../number-spinner/index.esm.js"; import { FMessageBoxService as Lg } from "../message-box/index.esm.js"; import Xd, { FButton as Bi } from "../button/index.esm.js"; import Xa from "../popover/index.esm.js"; import { BaseControlProperty as Zd, InputBaseProperty as Hs, ExpressionProperty as Ng, FormBindingType as Zo, SchemaDOMMapping as Rg } from "../property-panel/index.esm.js"; import $g, { FieldSelectorRepositoryToken as di } from "../field-selector/index.esm.js"; import "../collection-property-editor/index.esm.js/src/use-button-items.designer"; import jg from "../tags/index.esm.js"; import { useInputExpand as zs } from "../common/index.esm.js/text-box/use-input-expand"; import Ws from "../drawer/index.esm.js"; import { useFilter as Tl, useIdentify as kl, useHierarchy as Fl, useGroupData as qs, useDataView as Pl, useSelection as Ml, usePagination as Us, useRow as Il, useEdit as El, useVisualDataBound as Bl, useVisualDataCell as Dl, useVisualDataRow as Ol, useVisualGroupRow as ef, useVisualSummaryRow as tf, useVisualData as Al, useSidebar as sr, useColumn as Vl, useVirtualScroll as Ll, getHierarchyRow as nf, useLoading as af, useSelectHierarchyItem as Ys, useDataViewContainerStyle as ur, useCommandColumn as of, useSettingColumn as lf, useSort as rf, useGroupColumn as Gs, useCellPosition as cr, useFitColumn as Qs, useFilterHistory as sf, useColumnFilter as uf, useDragColumn as cf, getColumnHeader as df, getSidebar as _s, getDisableMask as ff, getHorizontalScrollbar as Ks, getVerticalScrollbar as Js, getEmpty as Xs, getPagination as pf, getSummary as mf, ColumnSettingSolution as hf, COMMAND_COLUMN_DATA_TYPE as da, SETTING_COLUMN_DATA_TYPE as fa, SETTING_COLUMN_FIELD as Hg, COMMAND_COLUMN_FIELD as zg, CellMode as vf, useScreen as gf, useCellContentStyle as Wg, getFilterPanel as qg, getGroupPanel as Ug, useAdapt as Yg, useNavigation as Gg } from "../data-view/index.esm.js"; import yf, { FCheckbox as Zs } from "../checkbox/index.esm.js"; import Ea, { FButtonEdit as Nl } from "../button-edit/index.esm.js"; import bf from "../list-view/index.esm.js"; import Dt from "bignumber.js"; import eu from "../../designer/button-edit/index.esm.js"; import Wa from "../tree-view/index.esm.js"; import Cf, { FInputGroup as Di } from "../input-group/index.esm.js"; import { useResizeObserver as tu } from "@vueuse/core"; import Qg from "../binding-selector/index.esm.js"; import _g from "../accordion/index.esm.js"; import Kg from "../../designer/avatar/index.esm.js"; import Jg from "../../designer/approval-logs/index.esm.js"; import Xg from "../button-group/index.esm.js"; import Zg from "../calendar/index.esm.js"; import ey from "../../designer/capsule/index.esm.js"; import bc from "../../designer/checkbox/index.esm.js"; import Cc from "../../designer/checkbox-group/index.esm.js"; import ty from "../content-container/index.esm.js"; import ny from "../../designer/data-grid/index.esm.js"; import ay from "../../designer/date-picker/index.esm.js"; import oy from "../dropdown/index.esm.js"; import ly from "../../designer/dynamic-form/index.esm.js"; import iy from "../external-container/index.esm.js"; import ry from "../filter-bar/index.esm.js"; import sy from "../image-cropper/index.esm.js"; import uy from "../../designer/input-group/index.esm.js"; import nu, { FLayout as cy, FLayoutPane as Mo } from "../layout/index.esm.js"; import dy from "../list-nav/index.esm.js"; import fy from "../../designer/list-view/index.esm.js"; import wf from "../lookup/index.esm.js"; import py from "../language-textbox/index.esm.js"; import my from "../../designer/nav/index.esm.js"; import hy from "../../designer/number-spinner/index.esm.js"; import vy from "../number-range/index.esm.js"; import gy from "../order/index.esm.js"; import yy from "../page-header/index.esm.js"; import by from "../page-footer/index.esm.js"; import Sf from "../pagination/index.esm.js"; import Cy from "../progress/index.esm.js"; import wy, { useCondition as Sy, useSolutionUtils as xf } from "../query-solution/index.esm.js"; import xy from "../../designer/radio-group/index.esm.js"; import Ty from "../../designer/rate/index.esm.js"; import ky, { commonToolbarItemDesignProps as Fy } from "../../designer/response-toolbar/index.esm.js"; import Py from "../response-layout/index.esm.js"; import My from "../../designer/response-layout-editor/index.esm.js"; import Iy from "../search-box/index.esm.js"; import Ey from "../../designer/section/index.esm.js"; import By from "../smoke-detector/index.esm.js"; import Dy from "../splitter/index.esm.js"; import Tf from "../step/index.esm.js"; import Oy from "../../designer/switch/index.esm.js"; import Ay from "../../designer/tabs/index.esm.js"; import Vy from "../../designer/tags/index.esm.js"; import Ly from "../text/index.esm.js"; import Ny from "../../designer/time-picker/index.esm.js"; import Ry from "../transfer/index.esm.js"; import $y from "../uploader/index.esm.js"; import jy from "../verify-detail/index.esm.js"; import Hy from "../component/index.esm.js"; import zy from "../video/index.esm.js"; import Wy from "../../designer/textarea/index.esm.js"; import qy from "../../designer/tree-grid/index.esm.js"; import Uy from "../fieldset/index.esm.js"; import Yy from "../../designer/drawer/index.esm.js"; import Gy from "../html-template/index.esm.js"; import Qy from "../image/index.esm.js"; import _y from "../comment/index.esm.js"; import Ky from "../../designer/wizard/index.esm.js"; import { loadRegister as Jy, useComponentManager as Xy, useEntityState as Zy, useDynamicViewUtils as eb, componentMap as Vr, resolverMap as tb, componentPropsConverter as nb } from "../dynamic-view/index.esm.js"; import Zr from "../section/index.esm.js"; import ab from "../combo-tree/index.esm.js"; import ob from "../events-editor/index.esm.js"; import lb from "../mapping-editor/index.esm.js"; import ib from "../schema-selector/index.esm.js"; import kf, { EditorType as rb } from "../event-parameter/index.esm.js"; import sb from "../filter-condition-editor/index.esm.js"; import ub from "../sort-condition-editor/index.esm.js"; import cb from "../menu-lookup/index.esm.js"; import db from "../json-editor/index.esm.js"; import fb from "../property-editor/index.esm.js"; import pb, { FExpressionTextbox as mb } from "../expression-editor/index.esm.js"; import hb from "../code-editor/index.esm.js"; import vb from "../collection-property-editor/index.esm.js"; import gb from "../../designer/modal/index.esm.js"; import yb from "../tooltip/index.esm.js"; import bb, { FTreeGrid as au } from "../tree-grid/index.esm.js"; import Cb, { FDynamicForm as wb, FDynamicFormLabel as Sb, FDynamicFormGroup as Oi, useTypeResolver as Ff } from "../dynamic-form/index.esm.js"; import xb, { FTimePickerTimeView as wc, convertToDate as Tb, FTouchTimePickerTimeView as kb } from "../time-picker/index.esm.js"; import es from "../date-picker/index.esm.js"; import ou from "../capsule/index.esm.js"; import { createI18n as Fb, useI18n as Pb } from "vue-i18n"; import { useConditionValue as Mb, useConditionUtils as lu, FConditionFields as Sc, FConditionFieldsDesign as xc, CompareType as tt } from "../condition/index.esm.js"; import Ib, { radioGroupProps as Eb, FRadioGroup as Bb } from "../radio-group/index.esm.js"; import { DgControl as Db } from "../designer-canvas/index.esm.js/"; import { F_MODAL_SERVICE_TOKEN as iu } from "../modal/index.esm.js"; import Ob, { FDataGrid as Rl } from "../data-grid/index.esm.js"; import { FSwitch as Ab } from "../switch/index.esm.js"; import { FDatePicker as Tc } from "../components/index.esm.js"; import { FCheckboxGroup as Vb } from "../checkbox-group/index.esm.js"; import { SearchRelation as Lb, SearchComparisonOperator as Nb } from "../field-search-box/index.esm.js"; import Vo from "../scroll-list/index.esm.js"; import ru from "../response-toolbar/index.esm.js"; import Rb, { FLoadingService as $b } from "../loading/index.esm.js"; import jb, { FTabPage as Hb } from "../tabs/index.esm.js"; import zb from "../textarea/index.esm.js"; const Wb = "https://json-schema.org/draft/2020-12/schema", qb = "https://farris-design.gitee.io/component.schema.json", Ub = "button", Yb = "A Farris Visual Button", Gb = "object", Qb = { id: { description: "The unique identifier for a component", type: "string" }, type: { description: "The type string of component", type: "string", default: "button" }, text: { description: "The text string of component", type: "string" }, disabled: { description: "", type: "boolean", default: !1 }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, visible: { description: "", type: "boolean", default: !0 }, size: { description: "大小", type: "string", default: "middle" }, icon: { description: "图标", type: "string", default: "" }, onClick: { description: "点击事件", type: "string", default: "" } }, _b = [ "id", "type", "text" ], Kb = { onClick: "点击事件" }, Jb = { $schema: Wb, $id: qb, title: Ub, description: Yb, type: Gb, properties: Qb, required: _b, events: Kb }, Xb = /* @__PURE__ */ new Map([ ["appearance", ht] ]); function Zb(e, t, n) { return Object.assign(t, { text: "按钮", appearance: { class: "btn btn-secondary" } }), t; } const su = { /** * 组件标识 */ id: String, /** * 设置按钮类型 */ type: { type: String, default: "primary" }, /** * 是否禁用 */ disabled: { type: Boolean, default: !1 }, /** * 按钮尺寸 */ size: { type: String, default: "middle" }, /** * 按钮图标 */ icon: { type: String, default: "" }, /** * 按钮文本 */ text: { type: String, default: "" }, /** * 自定义class */ customClass: { type: String, default: "" }, customStyle: { type: String, default: "" }, /** 控制是否可见 */ visible: { type: Boolean, default: !0 } }, Pf = Ke(su, Jb, Xb, Zb); function eC(e, t) { function n(a) { a.stopPropagation(), e.disabled || t.emit("click", a); } return { onClickButton: n }; } function Mf(e) { const t = V(() => { const a = { "f-icon": !0 }; if (e.icon) { const o = e.icon.trim().split(" "); o && o.length && o.reduce((l, i) => (l[i] = !0, l), a); } return a; }), n = V(() => !!(e.icon && e.icon.trim())); return { iconClass: t, shouldShowIcon: n }; } const Ai = /* @__PURE__ */ ce({ name: "FButton", props: su, emits: ["click"], setup(e, t) { const { onClickButton: n } = eC(e, t), { iconClass: a, shouldShowIcon: o } = Mf(e), l = V(() => { const i = { btn: !0, "btn-lg": e.size === "large", "btn-md": e.size !== "large" && e.size !== "small", "btn-sm": e.size === "small", "btn-icontext": o.value }; return i[`btn-${e.type}`] = !0, e.customClass && (typeof e.customClass == "string" ? st(i, e.customClass) : Object.keys(e.customClass).reduce((s, d) => (s[d] = e.customClass[d], s), i)), i; }); return () => e.visible ? r("button", { class: l.value, disabled: e.disabled, style: e.customStyle, onClick: (i) => n(i) }, [o.value && r("i", { class: a.value }, null), e.text ? e.text : "", t.slots.default && t.slots.default()]) : null; } }), If = /* @__PURE__ */ new Map([ ["appearance", ht], ["size", (e, t) => { const n = {}; return t.width && (n.width = Number(t.width)), t.height && (n.height = Number(t.height)), n; }] ]), tC = "https://json-schema.org/draft/2020-12/schema", nC = "https://farris-design.gitee.io/accordion.schema.json", aC = "accordion", oC = "A Farris Container Component", lC = "object", iC = { id: { description: "The unique identifier for a Accordion", type: "string" }, type: { description: "The type string of Accordion component", type: "string", default: "accordion" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, contents: { description: "", type: "array", default: [] }, customClass: { description: "", type: "string", default: "" }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, enableFold: { description: "", type: "boolean", default: !0 }, expanded: { description: "", type: "boolean", default: !1 } }, rC = [ "id", "type", "contents" ], sC = { $schema: tC, $id: nC, title: aC, description: oC, type: lC, properties: iC, required: rC }; function uC(e, t, n) { return t; } const cC = "accordion", dC = "A Farris Component", fC = "object", pC = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, mC = { title: cC, description: dC, type: fC, categories: pC }, uu = { customClass: { type: String, default: "" }, enableFold: { type: Boolean, default: !0 }, expanded: { type: Boolean, default: !1 }, height: { type: Number }, width: { type: Number } }, Ef = Ke(uu, sC, If, uC, mC), yo = /* @__PURE__ */ ce({ name: "FAccordion", props: uu, emits: [], setup(e, t) { const n = V(() => ({ height: e.height ? `${e.height}px` : "", width: e.width ? `${e.width}px` : "" })); Gt("accordionContext", { parentProps: e }); const a = V(() => st({ "farris-panel": !0, accordion: !0 }, e.customClass)); return () => r("div", { class: a.value, style: n.value }, [t.slots.default && t.slots.default()]); } }), hC = "https://json-schema.org/draft/2020-12/schema", vC = "https://farris-design.gitee.io/accordion-item.schema.json", gC = "AccordionItem", yC = "A Farris Container Component", bC = "object", CC = { id: { description: "The unique identifier for a Accordion Item", type: "string" }, type: { description: "The type string of Accordion Item component", type: "string" }, contents: { description: "", type: "array", default: [] }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, title: { description: "", type: "string", default: "" }, disable: { description: "", type: "boolean", default: !1 } }, wC = [ "id", "type", "contents" ], SC = { $schema: hC, $id: vC, title: gC, description: yC, type: bC, properties: CC, required: wC }, cu = { active: { type: Boolean, default: !1 }, customClass: { type: String, default: "" }, disabled: { type: Boolean, default: !1 }, enableFold: { type: Boolean, default: !0 }, height: { type: Number }, iconUri: { type: String, default: "" }, maxHeight: { type: Number }, title: { type: String, default: "" }, width: { type: Number } }, Bf = Ke(cu, SC, If), ts = /* @__PURE__ */ ce({ name: "FAccordionItem", props: cu, emits: ["ClickHeader"], setup(e, t) { const n = C(), a = Fe("accordionContext"), o = C(e.title), l = C(e.active), i = V(() => { var m; return !!((m = a == null ? void 0 : a.parentProps) != null && m.enableFold) && e.enableFold; }); function s() { e.disabled || !i.value || (l.value = !l.value); } function d(m) { t.emit("ClickHeader"), s(); } const f = V(() => { const m = { card: !0, "farris-panel-item": !0, "f-state-disabled": e.disabled, "f-state-selected": l.value }; return st(m, e.customClass); }), c = V(() => !0), u = V(() => ({ "f-icon": !0, "f-accordion-collapse": !l.value, "f-accordion-expand": l.value })); function p() { return n.value ? n.value.getBoundingClientRect().height : 0; } const h = V(() => { const m = e.maxHeight ? { transition: "maxHeight 0.36s ease 0s", "max-height": l.value ? `${e.maxHeight}px` : 0 } : { transition: "height 0.36s ease 0s", height: l.value ? `${p()}px` : 0 }; return l.value || (m.overflow = "hidden"), m; }); return Ve(() => { var m; (m = a == null ? void 0 : a.parentProps) != null && m.expanded && (l.value = !0); }), () => r("div", { class: f.value }, [r("div", { class: "card-header", onClick: d }, [r("div", { class: "panel-item-title" }, [e.iconUri && r("img", { class: "panel-item-title-image", src: e.iconUri, title: "title-icon" }, null), c.value && r("span", null, [o.value]), t.slots.head && t.slots.head(), i.value && r("i", { class: u.value }, null)]), r("div", { class: "panel-item-tool" }, [t.slots.toolbar && t.slots.toolbar()]), r("div", { class: "panel-item-clear" }, null)]), r("div", { style: h.value }, [r("div", { class: "card-body", ref: n }, [t.slots.default && t.slots.default()])])]); } }), xC = /* @__PURE__ */ ce({ name: "FAccordionDesign", props: uu, emits: [], setup(e, t) { const n = V(() => ({ height: e.height ? `${e.height}px` : "", width: e.width ? `${e.width}px` : "" })), a = V(() => { const s = e.customClass.split(" "), d = { "farris-panel": !0, accordion: !0 }; return s.reduce((f, c) => (f[c] = !0, f), d), d; }), o = C(), l = Fe("design-item-context"), i = Xt(o, l); return Ve(() => { o.value.componentInstance = i; }), t.expose(i.value), () => r("div", { ref: o, class: a.value, style: n.value }, [t.slots.default && t.slots.default()]); } }), TC = /* @__PURE__ */ ce({ name: "FAccordionItemDesign", props: cu, emits: [], setup(e, t) { const n = C(e.title), a = C(!1), o = C(!1); function l() { a.value = !a.value; } function i(v) { l(); } const s = V(() => ({ "f-state-disabled": o.value, card: !0, "farris-panel-item": !0, "f-state-selected": a.value })), d = V(() => !0), f = V(() => !1), c = V(() => ({ "f-icon": !0, "f-accordion-collapse": !a.value, "f-accordion-expand": a.value })), u = V(() => { const v = e.maxHeight ? { transition: "maxHeight 0.36s ease 0s", "max-height": a.value ? `${e.maxHeight}px` : 0 } : { transition: "height 0.36s ease 0s", height: a.value ? `${e.height}px` : 0 }; return a.value || (v.overflow = "hidden"), v; }); function p() { return !0; } function h() { return !1; } function m() { return !0; } return t.expose({ canMove: p(), canSelectParent: h(), canDelete: m(), canNested: !0 }), () => r("div", { class: s.value }, [r("div", { class: "card-header", onClick: i }, [r("div", { class: "panel-item-title" }, [d.value && r("span", null, [n.value]), f.value && t.slots.head && t.slots.head(), r("span", { class: c.value }, null)]), r("div", { class: "panel-item-tool" }, [t.slots.toolbar && t.slots.toolbar()]), r("div", { class: "panel-item-clear" }, null)]), r("div", { style: u.value }, [r("div", { class: "card-body drag-container" }, [t.slots.default && t.slots.default()])])]); } }); yo.install = (e) => { e.component(yo.name, yo), e.component(ts.name, ts); }; yo.register = (e, t, n, a) => { e.accordion = yo, e["accordion-item"] = ts, t.accordion = Ef, t["accordion-item"] = Bf; }; yo.registerDesigner = (e, t, n) => { e.accordion = xC, e["accordion-item"] = TC, t.accordion = Ef, t["accordion-item"] = Bf; }; const kC = "https://json-schema.org/draft/2020-12/schema", FC = "https://farris-design.gitee.io/approval-logs.schema.json", PC = "approval-logs", MC = "A Farris Business Component", IC = "object", EC = { id: { description: "The unique identifier for a component", type: "string" }, type: { description: "The type string of a component", type: "string", default: "approval-logs" }, dataId: { type: "string", default: "" }, displayType: { type: "string", default: "card" }, showForecastLogs: { type: "boolean", default: !1 }, showHistoryLogs: { type: "boolean", default: !1 }, workflowScriptUrl: { type: "string", default: "/platform/runtime/wf/webapp/mobiletaskcenter/taskComment.js" } }, BC = [ "id", "type", "displayType", "showForecastLogs", "showHistoryLogs" ], DC = { $schema: kC, $id: FC, title: PC, description: MC, type: IC, properties: EC, required: BC }, OC = /* @__PURE__ */ new Map([]); function AC(e, t, n) { var f, c; const a = t, o = (f = n.bindingSourceContext) == null ? void 0 : f.entityFieldNode; o && (a.binding = { type: "Form", path: o.bindingField, field: o.id, fullPath: o.path }); const l = n.parentComponentInstance, i = (c = l == null ? void 0 : l.schema) == null ? void 0 : c.type; if (!i || i === Ee.section.type) return a; const s = e.getSchemaByType("section"), d = Math.random().toString().slice(2, 6); return Object.assign(s, { id: `section-${d}`, appearance: { class: "f-section-in-mainsubcard" }, mainTitle: "审批记录", contents: [a] }), s; } const Df = { /** 单据ID */ dataId: { type: String, default: "" }, /** 展示类型 */ displayType: { type: String, default: "card" }, /** 是否展示预测日志 */ showForecastLogs: { type: Boolean, default: !1 }, /** 是否展示历史日志 */ showHistoryLogs: { type: Boolean, default: !1 }, /** 审批流脚本地址 */ workflowScriptUrl: { type: String, default: "" } }; Sn( Df, DC, OC, AC ); const ni = {}; function VC() { function e(n = 1) { const a = n * 60 * 60 * 1e3, o = Date.now(); return o - o % a; } function t(n) { if (!n) return Promise.resolve(); if (ni[n]) return ni[n]; const a = new Promise((o, l) => { const i = document.createElement("script"); i.src = n + `?v=${e()}`, i.type = "text/javascript", i.async = !0; function s() { i.removeEventListener("load", d), i.removeEventListener("error", f); } function d() { s(), o(); } function f(c) { s(), delete ni[n], l(c); } i.addEventListener("load", d), i.addEventListener("error", f), document.head.appendChild(i); }); return ni[n] = a, a; } return { loadJsScript: t }; } const LC = /* @__PURE__ */ ce({ name: "FApprovalLogs", props: Df, emits: [], setup(e, t) { const { loadJsScript: n } = VC(), a = Lt(), o = C(); function l() { return !!window.gspTaskCenterBizLog; } function i() { return window.gspTaskCenterBizLog.ApprovalLogUtil; } function s() { return e.displayType === "data-grid" && !a ? "datagrid" : "card"; } function d() { o.value && (o.value.innerHTML = ""); } function f() { if (s() === "datagrid") { const h = { bizInstId: e.dataId, container: o.value, showHeader: !1, showViewProcess: !1, ifForecast: !!e.showForecastLogs, isIncludeHistory: !!e.showHistoryLogs }; i().getWebHtml(h); } else { const h = { bizInstId: e.dataId, container: o.value, terminal: a ? "mobile" : "web", typeId: "wf", showHeader: !1, showForecastBtn: a, ifForecast: !!e.showForecastLogs, isIncludeHistory: !!e.showHistoryLogs }; i().getWebLogsHtml(h); } } async function c() { if (!e.dataId || !o.value) { d(); return; } l() || await n(e.workflowScriptUrl).catch((p) => { console.error(p); }), l() && f(); } Ve(c), _([() => e.dataId, () => e.displayType, () => e.showForecastLogs, () => e.showHistoryLogs], () => { d(), c(); }); function u() { c(); } return t.expose({ refreshData: u }), () => r("div", { ref: o, class: "fv-approval-logs" }, null); } }); Ct(LC); function NC(e, t, n) { return t; } function RC(e, t) { return t ? typeof t == "string" ? { imageType: t.split(",") } : { imageType: t } : { imageType: [] }; } const $C = /* @__PURE__ */ new Map([ ["appearance", ht], ["imageType", RC] ]), jC = "https://json-schema.org/draft/2020-12/schema", HC = "https://farris-design.gitee.io/avatar.schema.json", zC = "avatar", WC = "A Farris Component", qC = "object", UC = { id: { description: "The unique identifier for avatar", type: "string" }, type: { description: "The type string of avatar", type: "string", default: "avatar" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, binding: { description: "", type: "object", default: {} }, disabled: { type: "boolean", default: !1 }, avatarWidth: { description: "", type: "number", default: 100 }, title: { description: "", type: "string" }, avatarHeight: { description: "", type: "number", default: 100 }, readonly: { description: "", type: "boolean", default: !1 }, cover: { description: "", type: "string" }, visible: { description: "", type: "boolean", default: !0 }, required: { description: "", type: "boolean", default: !1 }, shape: { description: "", type: "string", default: "circle" }, maxSize: { description: "允许头像上传的大小,单位MB", type: "number", default: 2 }, imageType: { description: "支持的头像类型", type: "array", default: [] }, onImageChange: { description: "", type: "string" } }, YC = [ "id", "type" ], GC = [ "id", "appearance", "binding", "visible" ], QC = { onImageChange: "头像变化后事件" }, _C = { $schema: jC, $id: HC, title: zC, description: WC, type: qC, properties: UC, required: YC, ignore: GC, events: QC }, Of = { /** 组件自定义样式 */ customClass: { type: String, default: "" }, customStyle: { type: String, default: "" }, /** * 头像宽度 */ avatarWidth: { type: Number, default: 100 }, /** * 头像高度 */ avatarHeight: { type: Number, default: 100 }, /** * 组件标识 */ cover: { type: String }, /** * 只读 */ readonly: { type: Boolean, default: !1 }, visible: { type: Boolean, default: !0 }, required: { type: Boolean, default: !1 }, /** * 头像形状 */ shape: { type: String, default: "circle" }, /** * 允许头像上传大小, 单位MB */ maxSize: { type: Number, default: 2 }, /** * 组件值 */ modelValue: { type: String, default: "" }, /** * 头像标题 */ title: { type: String, default: "" }, /** * 支持的头像类型 */ imageType: { type: Array, default: [] } }; Ke(Of, _C, $C, NC); function KC(e, t, n, a) { const o = ["webp", "png", "svg", "gif", "jpg", "jpeg", "bmp"]; function l(c) { return c ? "data:image/jpeg;base64," + c : ""; } const i = V(() => { var u; if (!e.imageType || !e.imageType.length) return o.map((p) => `.${p}`).join(","); const c = (u = e.imageType) == null ? void 0 : u.map((p) => `.${p}`); return !c || !c.length ? "image/*" : c.join(","); }), s = V(() => { const c = a.value; return c ? Zv(c) ? po(c) : eg(c) ? c : l(c) : ""; }), d = V(() => e.readonly ? "" : e.title); function f() { e.readonly || n && n.value && n.value.click(); } return { acceptTypes: i, imageSource: s, imageTitle: d, onClickImage: f }; } function JC(e, t, n, a, o) { const l = new Ma(); function i(c) { a.value = c; } function s(c) { return new Promise((p, h) => { const m = new FileReader(); m.readAsDataURL(c), m.onload = () => { p({ state: "done", content: m.result }); }, m.onerror = function() { h({ state: "error", content: m.result }); }; }); } function d(c) { const u = { size: c.size, name: c.name, type: c.type, lastModified: String(c.lastModified) }; s(c).then((p) => { p.state === "done" && (i(p.content), u.state = p.state, u.base64 = p.content, t.emit("update:modelValue", u.base64), t.emit("imageChange", u)), o.value = !1; }).catch((p) => { o.value = !1; const h = ze.getLocaleValue("avatar.uploadError"); l.error({ message: h, position: "top-center" }); }); } function f(c) { if (e.readonly) return; const u = c.target, p = u.files; if (!p || !p[0]) return; const h = e.maxSize <= 0 ? 2 : e.maxSize, m = p[0].name || "", v = m.lastIndexOf("."), b = v > 0 ? m.substring(v).toLowerCase() : "", g = p[0].size / 1024 / 1024 < h; if (n.value && n.value.split(",").indexOf(b) < 0) { const y = ze.getLocaleValue("avatar.typeError"); l.error({ message: y, position: "top-center" }), u.value = ""; return; } if (!g) { const y = ze.getLocaleValue("avatar.sizeError") + h + "MB!"; l.error({ message: y, position: "top-center" }), u.value = ""; return; } o.value = !0, d(p[0]), u.value = ""; } return { onFileChange: f }; } const XC = /* @__PURE__ */ ce({ name: "FAvatar", props: Of, emits: ["imageChange", "update:modelValue"], setup(e, t) { const n = C(), a = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQEAAAAAAAAAAAAAAAAAEQEh/9oADAMBAAIRAxEAPwD9BBYqCiyAGhougIqyGgEhIui6AyuixdATQ0WQA0BdA4houhoCaGgugMrouhoCaJoum80BNDRdDQGTRbEBNCxdDQGTRUBE0asQGRTQGTT71WxNPP5AugqyACyAC6dpIsgGgshoBISKAiroQDQ0OSyAgoBoaABoaABomigJTRQGV0XRATRGizUGRSwGdEsaqAljLQDOiNWJQZNJ4KffEFIRYAsFkAkFkAJFFkAkNCLIAAAC6AguhoCCl3TW2TzugIHx4S788Z6wmWN4ZY3ysoA1pu+qAgpYCAAaIoDIoCaJZvVAQ03LUBlGqWAzYmimn3vAaRYA1IkWASKKACgirIgAsgBoBdJNbZNN9t3aeIHNw2vSccbZhPxLN27dJ68/Rx222u1/LjbNn8vi/ieHPm58N03SKN5bfa58c7jOzHd78XOyXfd98bqoCaScp8jSdk+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471y5aeLwpph2zXe0O54AVjgDPv39uKAOB8ceJxrN0NPsDiztzhcdGI43fQdB/9euCr0iX4XeIk5jkgf6MR/NazJfh94ri5FsHH+y6/wBSKAOKr1zxB/o/w20+L++yfqGauFl8JeJYfv2Up/3V3fyzXeeOka18I6TZSAqyhMg8EFY8HP50AeQ0UUUAFFFFAH//0/7MKKKKACvffG8viWSOyk8PGYiRWL+SD/skZI6dTXgVd3D8RfEkFsltG0eI1ChiuTgcc84oAoX+n+MYVXVdUS4IgIYPIS205GDyTjmvRfFehXfjCysdc0ZVMjR/MCQODyBk+hyK831Lxn4i1a1ayvJ8xP8AeVVUZx7gZrMste1rToxBY3UsaDooY7R+HSgDrP7A+Itj/qvtCgf3Jgf0DUv2/wCJNl1F1x3MZcfmQay4vHniyH7t2T/vKh/mK0oviZ4mj++YpP8AeT/AigB//CdeNbP/AI+ucf8APSID+QFbvxUlcw6dG/3iHY/XC1Ri+KurL/r7aFv93cv8ya5XxT4om8T3EU0sQiESkAA569TnigDlqKKKACiiigD/1P7MKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/V/swooooAKKKKACiiigAooooAKKKKACiiigAooooA/9k=", l = V(() => { const m = { "f-avatar": !0, "f-avatar-readonly": e.readonly, "f-avatar-circle": e.shape === "circle", "f-avatar-square": e.shape === "square" }; return st(m, e.customClass); }), i = V(() => { const m = { width: (e.avatarWidth > 0 ? e.avatarWidth : 100) + "px", height: (e.avatarHeight > 0 ? e.avatarHeight : 100) + "px" }; return on(m, e.customStyle); }), s = C(!1), d = C(e.modelValue || e.cover || a), { acceptTypes: f, imageSource: c, onClickImage: u } = KC(e, t, n, d), { onFileChange: p } = JC(e, t, f, d, s); _(() => e.modelValue, (m) => { d.value = m || e.cover || a; }); function h() { d.value = o; } return () => e.visible ? r("div", { class: l.value, style: i.value, onClick: u }, [s.value && r("div", { class: "f-avatar-upload-loading" }, [r("div", { class: "loading-inner" }, [ze.getLocaleValue("avatar.loading")])]), r("img", { title: e.title, class: "f-avatar-image", src: c.value, onError: h }, null), !e.readonly && r("div", { class: "f-avatar-icon" }, [r("span", { class: "f-icon f-icon-camera" }, null)]), !e.readonly && r("input", { ref: n, name: "file-input", type: "file", class: "f-avatar-upload", accept: f.value, onChange: p, style: "display: none;" }, null)]) : null; } }); Ct(XC); function Af(e, t) { let n; function a(u) { const { properties: p, title: h, ignore: m } = u, v = m && Array.isArray(m), b = Object.keys(p).reduce((g, y) => ((!v || !m.find((w) => w === y)) && (g[y] = p[y].type === "object" && p[y].properties ? a(p[y]) : ft(p[y].default)), g), {}); if (h && (!v || !m.find((g) => g === "id"))) { const g = h.toLowerCase().replace(/-/g, "_"); b.id = `${g}_${Math.random().toString().slice(2, 6)}`; } return b; } function o(u) { const { properties: p, title: h, required: m } = u; if (m && Array.isArray(m)) { const v = m.reduce((b, g) => (b[g] = p[g].type === "object" && p[g].properties ? a(p[g]) : ft(p[g].default), b), {}); if (h && m.find((b) => b === "id")) { const b = h.toLowerCase().replace(/-/g, "_"); v.id = `${b}_${Math.random().toString().slice(2, 6)}`; } return v; } return { type: h }; } function l(u, p = {}, h) { const m = e[u]; if (m) { let v = o(m); const b = t[u]; return v = b ? b({ getSchemaByType: l }, v, p, h) : v, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(v), v; } return null; } function i(u, p) { const h = a(p); return Object.keys(h).reduce((m, v) => (Object.prototype.hasOwnProperty.call(u, v) && (m[v] && yc(m[v]) && yc(u[v] || !u[v]) ? Object.assign(m[v], u[v] || {}) : m[v] = u[v]), m), h), h; } function s(u, p) { return Object.keys(u).filter((m) => u[m] != null).reduce((m, v) => { if (p.has(v)) { const b = p.get(v); if (typeof b == "string") m[b] = u[v]; else { const g = b(v, u[v], u); Object.assign(m, g); } } else m[v] = u[v]; return m; }, {}); } function d(u, p, h = /* @__PURE__ */ new Map()) { const m = i(u, p); return s(m, h); } function f(u) { var h; const p = u.type; if (p) { const m = e[p]; if (!m) return u; const v = i(u, m), b = ((h = u.editor) == null ? void 0 : h.type) || ""; if (b) { const g = e[b], y = i(u.editor, g); v.editor = y; } return v; } return u; } function c(u) { n = u; } return { getSchemaByType: l, resolveSchemaWithDefaultValue: f, resolveSchemaToProps: d, mappingSchemaToProps: s, setDesignerContext: c }; } const Vf = {}, Lf = {}, { resolveSchemaWithDefaultValue: ZC, resolveSchemaToProps: ew, mappingSchemaToProps: tw } = Af(Vf, Lf); function nw(e = {}) { function t(f, c, u, p) { if (typeof u == "number") return p[f].length === u; if (typeof u == "object") { const h = Object.keys(u)[0], m = u[h]; if (h === "not") return Number(p[f].length) !== Number(m); if (h === "moreThan") return Number(p[f].length) >= Number(m); if (h === "lessThan") return Number(p[f].length) <= Number(m); } return !1; } function n(f, c, u, p) { return p[f] && p[f].propertyValue && String(p[f].propertyValue.value) === String(u); } const a = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", n] ]); Object.keys(e).reduce((f, c) => (f.set(c, e[c]), f), a); function o(f, c) { const u = f; return typeof c == "number" ? [{ target: u, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: u, operator: "getProperty", param: f, value: !!c }] : typeof c == "object" ? Object.keys(c).map((p) => { if (p === "length") return { target: u, operator: "length", param: null, value: c[p] }; const h = p, m = c[p]; return { target: u, operator: "getProperty", param: h, value: m }; }) : []; } function l(f) { return Object.keys(f).reduce((u, p) => { const h = o(p, f[p]); return u.push(...h), u; }, []); } function i(f, c) { if (a.has(f.operator)) { const u = a.get(f.operator); return u && u(f.target, f.param, f.value, c) || !1; } return !1; } function s(f, c) { return l(f).reduce((h, m) => h && i(m, c), !0); } function d(f, c) { const u = Object.keys(f), p = u.includes("allOf"), h = u.includes("anyOf"), m = p || h, g = (m ? f[m ? p ? "allOf" : "anyOf" : "allOf"] : [f]).map((w) => s(w, c)); return p ? !g.includes(!1) : g.includes(!0); } return { parseValueSchema: d }; } const aw = { convertTo: (e, t, n, a) => { e.appearance || (e.appearance = {}), e.appearance[t] = n; }, convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t] }, ow = { convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无" }, lw = { convertTo: (e, t, n, a) => { e.editor && (e.editor[t] = n); }, convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t] }, xa = { button: { type: "button", name: "按钮" }, "response-toolbar": { type: "response-toolbar", name: "工具栏" }, "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" }, "content-container": { type: "content-container", name: "容器" }, "input-group": { type: "input-group", name: "文本" }, textarea: { type: "textarea", name: "多行文本" }, lookup: { type: "lookup", name: "帮助" }, "number-spinner": { type: "number-spinner", name: "数值" }, "date-picker": { type: "date-picker", name: "日期" }, switch: { type: "switch", name: "开关" }, "radio-group": { type: "radio-group", name: "单选组" }, "check-box": { type: "check-box", name: "复选框" }, "check-group": { type: "check-group", name: "复选框组" }, "combo-list": { type: "combo-list", name: "下拉列表" }, "response-form": { type: "response-form", name: "卡片面板" }, "response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" }, "response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" }, "tree-grid": { type: "tree-grid", name: "树表格" }, "tree-grid-column": { type: "tree-grid-column", name: "树表格列" }, "data-grid": { type: "data-grid", name: "表格" }, "data-grid-column": { type: "data-grid-column", name: "表格列" }, module: { type: "Module", name: "模块" }, component: { type: "component", name: "组件" }, tabs: { type: "tabs", name: "标签页" }, "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" }, "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" }, "drawer-toolbar-item": { type: "drawer-toolbar-item", name: "抽屉工具栏按钮" }, "html-template": { type: "html-template", name: "模板容器" }, "time-picker": { type: "time-picker", name: "时间选择" }, section: { type: "section", name: "分组面板" }, "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" }, "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" }, splitter: { type: "splitter", name: "分栏面板" }, "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" }, "component-ref": { type: "component-ref", name: "组件引用节点" }, uploader: { type: "uploader", name: "附件上传" }, "page-header": { type: "page-header", name: "页头" }, "page-footer": { type: "page-footer", name: "页脚" }, "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" }, "drawer-toolbar": { type: "drawer-toolbar", name: "抽屉工具栏" }, fieldset: { type: "fieldset", name: "分组" }, "query-solution": { type: "query-solution", name: "筛选方案" }, drawer: { type: "drawer", name: "抽屉" }, "external-container": { type: "external-container", name: "外部容器", icon: "content-container" }, "list-nav": { type: "list-nav", name: "列表导航" }, nav: { type: "nav", name: "标签类导航" }, "list-view": { type: "list-view", name: "列表" }, "filter-bar": { type: "filter-bar", name: "筛选条" }, "language-textbox": { type: "language-textbox", name: "多语输入框" }, image: { type: "image", name: "图像" }, avatar: { type: "avatar", name: "头像" }, "discussion-editor": { type: "discussion-editor", name: "评论编辑区" }, "discussion-list": { type: "discussion-list", name: "评论列表" }, comment: { type: "comment", name: "评论区" }, "approval-logs": { type: "approval-logs", name: "审批记录" }, "rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" }, calendar: { type: "calendar", name: "日历", icon: "date-picker" }, wizard: { type: "wizard", name: "向导", icon: "wizard" }, "wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" }, "wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" }, step: { type: "step", name: "步骤条", icon: "step" }, "dynamic-form": { type: "dynamic-form", name: "动态表单" } }, iw = { convertFrom: (e, t, n) => { var o; const a = e.editor && e.editor[t] ? e.editor[t] : e[t]; return ((o = xa[a]) == null ? void 0 : o.name) || a; } }, rw = { convertTo: (e, t, n, a) => { e[t] = e[t]; }, convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : "" }, sw = { convertTo: (e, t, n, a) => { (e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = { [t]: n }); }, convertFrom: (e, t, n) => { if (e.formatter) { if (t === "trueText") return e.formatter.trueText; if (t === "falseText"