@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,779 lines • 448 kB
JavaScript
var yr = Object.defineProperty;
var br = (t, n, e) => n in t ? yr(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
var B = (t, n, e) => br(t, typeof n != "symbol" ? n + "" : n, e);
import { ref as S, computed as L, createVNode as F, Fragment as wt, watch as Te, withModifiers as wr, withDirectives as Jn, vModelText as Cr, defineComponent as Ge, onMounted as Ct, reactive as yt, createApp as Zn, onUnmounted as dn, Transition as eo, mergeProps as $t, createTextVNode as Lt, onBeforeUnmount as to, resolveDirective as Sr, nextTick as fn, onBeforeMount as xr, Teleport as _r, shallowRef as Tr, render as pn, h as Fr, cloneVNode as kr, inject as bt, provide as Mr, triggerRef as Ir, isVNode as Er } from "vue";
import { isPlainObject as Bn, cloneDeep as It, isUndefined as at, throttle as Or } from "lodash-es";
import { getCustomClass as Jt, useGuid as Vr, resolveField as rt, FormSchemaEntityFieldTypeName as Nn, useCommonUtils as Pr, useDateFormat as Dr, useNumberFormat as Br, setFieldValue as bn, withInstall as no, FormSchemaEntityField$Type as Rn, FormSchemaEntityFieldType$Type as oo } from "../common/index.esm.js";
import { useFilter as ro, useIdentify as io, useHierarchy as ao, useGroupData as so, useDataView as lo, useSelection as uo, useRow as co, useEdit as fo, useVisualDataBound as mo, useVisualDataCell as po, useVisualDataRow as ho, useVisualGroupRow as Nr, useVisualSummaryRow as Rr, useVisualData as vo, useLoading as $r, useSelectHierarchyItem as Lr, useDataViewContainerStyle as Hr, useCommandColumn as Wr, useColumn as jr, useSort as Ar, useGroupColumn as qr, useCellPosition as Gr, useSidebar as zr, useVirtualScroll as Yr, useFitColumn as Ur, useFilterHistory as Xr, useColumnFilter as Qr, useDragColumn as Kr, getColumnHeader as Jr, getSidebar as Zr, getDisableMask as ei, getHorizontalScrollbar as ti, getVerticalScrollbar as ni, getEmpty as oi } from "../data-view/index.esm.js";
import { FCheckbox as mn } from "../checkbox/index.esm.js";
import go from "../list-view/index.esm.js";
import ri from "../button-edit/index.esm.js";
import yo from "../../designer/button-edit/index.esm.js";
import { DgControl as $n, useDesignerComponent as ii } from "../designer-canvas/index.esm.js";
import { useResizeObserver as bo } from "@vueuse/core";
import "../modal/index.esm.js";
import ai from "../transfer/index.esm.js";
import si from "../tabs/index.esm.js";
import li from "../order/index.esm.js";
import "../condition/index.esm.js";
import ui from "../filter-bar/index.esm.js";
import Ln from "../tooltip/index.esm.js";
import ci from "../pagination/index.esm.js";
import di from "../button/index.esm.js";
import fi from "../search-box/index.esm.js";
import mi from "../tags/index.esm.js";
import pi, { FDynamicFormGroup as hi, FDynamicFormInput as vi } from "../dynamic-form/index.esm.js";
import { createPropsResolver as gi } from "../dynamic-resolver/index.esm.js";
import "../property-panel/index.esm.js";
import yi from "../accordion/index.esm.js";
import bi from "../avatar/index.esm.js";
import wi from "../button-group/index.esm.js";
import Ci from "../calendar/index.esm.js";
import Si from "../capsule/index.esm.js";
import Hn from "../../designer/checkbox/index.esm.js";
import Wn from "../../designer/checkbox-group/index.esm.js";
import wn from "../combo-list/index.esm.js";
import xi from "../combo-tree/index.esm.js";
import _i from "../component/index.esm.js";
import Ti from "../color-picker/index.esm.js";
import Fi from "../content-container/index.esm.js";
import ki from "../date-picker/index.esm.js";
import Mi from "../../designer/data-grid/index.esm.js";
import Ii from "../dropdown/index.esm.js";
import Ei from "../events-editor/index.esm.js";
import Oi from "../field-selector/index.esm.js";
import Vi from "../binding-selector/index.esm.js";
import Pi from "../image-cropper/index.esm.js";
import Di from "../../designer/input-group/index.esm.js";
import Bi from "../layout/index.esm.js";
import Ni from "../list-nav/index.esm.js";
import Ri from "../lookup/index.esm.js";
import $i from "../mapping-editor/index.esm.js";
import Li from "../nav/index.esm.js";
import Hi from "../number-range/index.esm.js";
import Wi from "../number-spinner/index.esm.js";
import ji from "../page-header/index.esm.js";
import Ai from "../page-footer/index.esm.js";
import qi from "../progress/index.esm.js";
import Gi from "../query-solution/index.esm.js";
import zi from "../../designer/radio-group/index.esm.js";
import Yi from "../rate/index.esm.js";
import Ui from "../response-toolbar/index.esm.js";
import Xi from "../response-layout/index.esm.js";
import Qi from "../response-layout-editor/index.esm.js";
import Ki from "../section/index.esm.js";
import Ji from "../smoke-detector/index.esm.js";
import Zi from "../splitter/index.esm.js";
import ea from "../step/index.esm.js";
import ta from "../switch/index.esm.js";
import na from "../text/index.esm.js";
import oa from "../time-picker/index.esm.js";
import ra from "../tree-view/index.esm.js";
import ia from "../uploader/index.esm.js";
import aa from "../verify-detail/index.esm.js";
import sa from "../video/index.esm.js";
import la from "../textarea/index.esm.js";
import ua from "../schema-selector/index.esm.js";
import ca from "../tree-grid/index.esm.js";
import da from "../event-parameter/index.esm.js";
import fa from "../filter-condition-editor/index.esm.js";
import ma from "../fieldset/index.esm.js";
import pa from "../sort-condition-editor/index.esm.js";
import ha from "../menu-lookup/index.esm.js";
import va from "../drawer/index.esm.js";
import ga from "../json-editor/index.esm.js";
import ya from "../property-editor/index.esm.js";
import ba from "../expression-editor/index.esm.js";
import wa from "../code-editor/index.esm.js";
import Ca from "../html-template/index.esm.js";
import "../external-container/index.esm.js";
import "../notify/index.esm.js";
const wo = {}, Co = {};
function Tn(t) {
const { properties: n, title: e, ignore: o } = t, r = o && Array.isArray(o), i = Object.keys(n).reduce((a, s) => ((!r || !o.find((u) => u === s)) && (a[s] = n[s].type === "object" && n[s].properties ? Tn(n[s]) : It(n[s].default)), a), {});
if (e && (!r || !o.find((a) => a === "id"))) {
const a = e.toLowerCase().replace(/-/g, "_");
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return i;
}
function Sa(t) {
const { properties: n, title: e, required: o } = t;
if (o && Array.isArray(o)) {
const r = o.reduce((i, a) => (i[a] = n[a].type === "object" && n[a].properties ? Tn(n[a]) : It(n[a].default), i), {});
if (e && o.find((i) => i === "id")) {
const i = e.toLowerCase().replace(/-/g, "_");
r.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: e
};
}
function So(t, n = {}, e) {
const o = wo[t];
if (o) {
let r = Sa(o);
const i = Co[t];
return r = i ? i({ getSchemaByType: So }, r, n, e) : r, r;
}
return null;
}
function xa(t, n) {
const e = Tn(n);
return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(t, r) && (o[r] && Bn(o[r]) && Bn(t[r] || !t[r]) ? Object.assign(o[r], t[r] || {}) : o[r] = t[r]), o), e), e;
}
function xo(t, n) {
return Object.keys(t).filter((o) => t[o] != null).reduce((o, r) => {
if (n.has(r)) {
const i = n.get(r);
if (typeof i == "string")
o[i] = t[r];
else {
const a = i(r, t[r], t);
Object.assign(o, a);
}
} else
o[r] = t[r];
return o;
}, {});
}
function _a(t, n, e = /* @__PURE__ */ new Map()) {
const o = xa(t, n);
return xo(o, e);
}
function Ta(t = {}) {
function n(c, d, l, f) {
if (typeof l == "number")
return f[c].length === l;
if (typeof l == "object") {
const m = Object.keys(l)[0], p = l[m];
if (m === "not")
return Number(f[c].length) !== Number(p);
if (m === "moreThan")
return Number(f[c].length) >= Number(p);
if (m === "lessThan")
return Number(f[c].length) <= Number(p);
}
return !1;
}
function e(c, d, l, f) {
return f[c] && f[c].propertyValue && String(f[c].propertyValue.value) === String(l);
}
const o = /* @__PURE__ */ new Map([
["length", n],
["getProperty", e]
]);
Object.keys(t).reduce((c, d) => (c.set(d, t[d]), c), o);
function r(c, d) {
const l = c;
return typeof d == "number" ? [{ target: l, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: l, operator: "getProperty", param: c, value: !!d }] : typeof d == "object" ? Object.keys(d).map((f) => {
if (f === "length")
return { target: l, operator: "length", param: null, value: d[f] };
const m = f, p = d[f];
return { target: l, operator: "getProperty", param: m, value: p };
}) : [];
}
function i(c) {
return Object.keys(c).reduce((l, f) => {
const m = r(f, c[f]);
return l.push(...m), l;
}, []);
}
function a(c, d) {
if (o.has(c.operator)) {
const l = o.get(c.operator);
return l && l(c.target, c.param, c.value, d) || !1;
}
return !1;
}
function s(c, d) {
return i(c).reduce((m, p) => m && a(p, d), !0);
}
function u(c, d) {
const l = Object.keys(c), f = l.includes("allOf"), m = l.includes("anyOf"), p = f || m, g = (p ? c[p ? f ? "allOf" : "anyOf" : "allOf"] : [c]).map((h) => s(h, d));
return f ? !g.includes(!1) : g.includes(!0);
}
return { parseValueSchema: u };
}
const de = {
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: "标签页工具栏按钮" },
"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: "标签页工具栏" },
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: "列表导航" },
"filter-bar": { type: "filter-bar", name: "筛选条" }
}, Fa = {}, ka = {};
Ta();
function St(t, n, e = /* @__PURE__ */ new Map(), o = (a, s, u, c) => s, r = {}, i = (a) => a) {
return wo[n.title] = n, Co[n.title] = o, Fa[n.title] = r, ka[n.title] = i, (a = {}, s = !0) => {
if (!s)
return xo(a, e);
const u = _a(a, n, e), c = Object.keys(t).reduce((d, l) => (d[l] = t[l].default, d), {});
return Object.assign(c, u);
};
}
function qt(t, n) {
return { customClass: n.class, customStyle: n.style };
}
function Ma() {
function t(n, e) {
const { dataSource: o } = n || {};
return o === void 0 ? {} : {};
}
return {
resolve: t
};
}
function Ia() {
function t(n, e) {
return n.selectItemById(e);
}
return {
selectItemById: t
};
}
function Ea() {
function t(n, e) {
const { columns: o } = e;
return n.updateColumns(o);
}
return {
updateColumns: t
};
}
const Oa = /* @__PURE__ */ new Map([
["appearance", qt]
]), Va = "https://json-schema.org/draft/2020-12/schema", Pa = "https://farris-design.gitee.io/order.schema.json", Da = "order", Ba = "A Farris Component", Na = "object", Ra = {
id: {
description: "The unique identifier for a order",
type: "string"
},
type: {
description: "The type string of order component",
type: "string",
default: "order"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
editable: {
description: "",
type: "boolean",
default: !0
},
enableLinkLabel: {
description: "",
type: "boolean",
default: !1
},
label: {
description: "",
type: "string",
default: ""
},
lableWidth: {
description: "",
type: "number"
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
required: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
textAlign: {
description: "",
type: "string",
enum: [
"left",
"middle",
"right"
],
default: "left"
},
visible: {
description: "",
type: "boolean",
default: !0
},
onBlur: {
description: "",
type: "string",
default: ""
},
onClickLinkLabel: {
description: "",
type: "sting",
default: ""
}
}, $a = [
"id",
"type"
], La = {
$schema: Va,
$id: Pa,
title: Da,
description: Ba,
type: Na,
properties: Ra,
required: $a
};
function Ha(t, n, e) {
return n;
}
const Wa = "order", ja = "A Farris Component", Aa = "object", qa = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
},
behavior: {
description: "Basic Infomation",
title: "行为",
properties: {
editable: {
description: "",
title: "允许编辑",
type: "boolean"
},
readonly: {
description: "",
title: "只读",
type: "string"
},
required: {
description: "",
title: "必填",
type: "boolean"
},
visible: {
description: "",
title: "可见",
type: "boolean"
},
placeholder: {
description: "",
title: "提示文本",
type: "string"
},
tabindex: {
description: "",
title: "tab索引",
type: "number"
},
textAlign: {
description: "",
title: "对齐方式",
type: "enum",
editor: {
type: "combo-list",
textField: "name",
valueField: "value",
data: [
{
value: "left",
name: "左对齐"
},
{
value: "center",
name: "居中"
},
{
value: "right",
name: "右对齐"
}
]
}
}
}
}
}, Ga = {
title: Wa,
description: ja,
type: Aa,
categories: qa
}, Fn = {
/** 排序列数据源 */
dataSource: { type: Array, default: [] },
/** 当前排序数组 */
items: { type: Array, default: [] }
}, jn = St(Fn, La, Oa, Ha, Ga), za = /* @__PURE__ */ new Map([
["appearance", qt]
]);
function Ya(t, n, e) {
return n;
}
const Ua = "https://json-schema.org/draft/2020-12/schema", Xa = "https://farris-design.gitee.io/list-view.schema.json", Qa = "list-view", Ka = "A Farris Component", Ja = "object", Za = {
id: {
description: "The unique identifier for list-view",
type: "string"
},
type: {
description: "The type string of list-view",
type: "string",
default: "list-view"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disable: {
type: "string",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !0
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
require: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
}
}, es = [
"id",
"type"
], ts = {
$schema: Ua,
$id: Xa,
title: Qa,
description: Ka,
type: Ja,
properties: Za,
required: es
}, ns = "list-view", os = "A Farris Component", rs = "object", is = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
}
}, as = {
title: ns,
description: os,
type: rs,
categories: is
}, _o = {
/** 列集合 */
columns: {
type: Array,
default: [
{ field: "name", title: "", dataType: "string" }
]
},
customClass: { type: String, default: "" },
data: { type: Array, default: [] },
draggable: { type: Boolean, default: !1 },
multiSelect: { Type: Boolean, default: !1 },
multiSelectMode: { Type: String, default: "OnCheck" },
idField: { Type: String, default: "id" },
valueField: { Type: String, default: "id" },
textField: { Type: String, default: "name" },
titleField: { Type: String, default: "name" },
view: { Type: String, default: "ContentView" },
size: { Type: String, default: "default" },
placeholder: { type: String, default: "" },
header: { Type: String, default: "ContentHeader" },
headerClass: { Type: String, default: "" },
itemClass: { Type: String, default: "" },
itemContentClass: { Type: String, default: "" },
selectionValues: { type: Array, default: [] },
/** 分组配置 */
group: { type: Object },
/** 选择配置 */
selection: {
type: Object,
default: {
enableSelectRow: !0,
multiSelect: !1,
multiSelectMode: "DependOnCheck",
showCheckbox: !1,
showSelectAll: !1,
showSelection: !0
}
},
keepOrder: { type: Boolean, default: !1 },
disableField: { type: String, default: "disabled" },
// 搜索启用高亮
enableHighlightSearch: { type: Boolean, default: !0 },
/** 虚拟化渲染数据 */
virtualized: { type: Boolean, default: !0 }
};
St(_o, ts, za, Ya, as);
function ss(t, n) {
function e(i) {
const a = [];
let s = i.nextNode();
for (; s; )
a.push(s), s = i.nextNode();
return a;
}
function o(i, a) {
const s = document.createTreeWalker(i, NodeFilter.SHOW_TEXT);
return e(s).map((l) => ({ textNode: l, text: (l.textContent || "").toLocaleLowerCase() })).map(({ textNode: l, text: f }) => {
const m = [];
let p = 0;
for (; p < f.length; ) {
const I = f.indexOf(a, p);
if (I === -1)
break;
m.push(I), p = I + a.length;
}
return m.map((I) => {
const w = new Range();
return w.setStart(l, I), w.setEnd(l, I + a.length), w;
});
}).flat();
}
function r(i) {
if (!CSS.highlights || (CSS.highlights.clear(), !i || !n))
return;
const a = o(n.value, i.toLocaleLowerCase()), s = new Highlight(...a);
CSS.highlights.set("search-result", s);
}
return { search: r };
}
function An(t, n, e, o, r, i, a, s, u, c) {
const d = S(t.size), l = S(t.textField), f = S(t.titleField), m = S(t.disableField), p = L(() => {
var _, C;
return ((_ = t.selection) == null ? void 0 : _.multiSelect) && ((C = t.selection) == null ? void 0 : C.showCheckbox);
}), {
onMouseenterItem: I,
onMouseoverItem: w,
onMouseoutItem: g
} = i, {
getKey: y,
listViewItemClass: h,
onCheckItem: x,
onClickItem: k
} = a, T = L(() => {
const _ = {
"text-overflow": "ellipsis",
overflow: "hidden",
"white-space": "nowrap"
};
return t.itemClass ? _ : {
margin: d.value === "small" ? "0.25rem 0" : "8px 0",
..._
};
});
function v(_, C, M) {
return _.checked = s.findIndexInSelectedItems(_) > -1, F("li", {
class: h(_, C),
id: y(_, C),
key: y(_, C),
onClick: (b) => k(b, _, C),
onMouseenter: (b) => I(b, _, C),
onMouseover: (b) => w(b, _, C),
onMouseout: (b) => g(b, _, C)
}, [p.value && F("div", {
class: "f-list-select",
onClick: (b) => b.stopPropagation()
}, [F(mn, {
id: "list-" + y(_, C),
customClass: "listview-checkbox",
disabled: _[m.value],
checked: _.checked,
"onUpdate:checked": (b) => _.checked = b,
onChange: (b) => {
x(_, C, !b.checked);
}
}, null)]), F("div", {
class: "f-list-content"
}, [F("div", {
class: t.itemContentClass,
style: T.value,
title: _.raw[f.value] || _.raw[l.value]
}, [_.raw[l.value]])])]);
}
return {
renderItem: v
};
}
function ls(t, n, e, o, r, i, a, s, u, c) {
const d = S(t.multiSelect), l = S(t.disableField), f = S(t.textField), {
onMouseenterItem: m,
onMouseoverItem: p,
onMouseoutItem: I
} = i, {
getKey: w,
listViewItemClass: g,
onCheckItem: y,
onClickItem: h
} = a;
function x(T, v, _) {
return n.slots.content ? F(wt, null, [n.slots.content && n.slots.content({
item: T.raw,
index: v,
selectedItem: _
})]) : F("div", {
style: "margin: 10px 0;"
}, [T.raw[f.value || "name"]]);
}
function k(T, v, _) {
return F("li", {
class: g(T, v),
id: w(T, v),
key: w(T, v),
onClick: (C) => h(C, T, v),
onMouseenter: (C) => m(C, T, v),
onMouseover: (C) => p(C, T, v),
onMouseout: (C) => I(C, T, v)
}, [d.value && F("div", {
class: "f-list-select",
onClick: (C) => C.stopPropagation()
}, [F(mn, {
id: "list-" + w(T, v),
customClass: "listview-checkbox",
disabled: T[l.value] || !T.checked,
checked: T.checked,
"onUpdate:checked": (C) => T.checked = C,
onChange: (C) => y(T, v, !C.checked)
}, null)]), F("div", {
class: "f-list-content"
}, [x(T, v, _)])]);
}
return {
renderItem: k
};
}
function us(t, n, e, o, r, i, a, s, u, c) {
const d = S(t.multiSelect), l = S(t.disableField), f = S(t.textField), {
onMouseenterItem: m,
onMouseoverItem: p,
onMouseoutItem: I
} = i, {
getKey: w,
listViewItemClass: g,
onCheckItem: y,
onClickItem: h
} = a, {
dragstart: x,
dragenter: k,
dragover: T,
dragend: v
} = o, {
removeItem: _
} = u, C = L(() => ({
margin: d.value ? "10px 0" : "10px 0px 10px 14px"
}));
function M(O, $ = "") {
const j = O.target;
j.title = j.scrollWidth > j.clientWidth ? $ : "";
}
function b(O) {
return F("div", {
style: C.value,
onMouseenter: ($) => M($, O.raw[f.value || "name"])
}, [O.raw[f.value || "name"]]);
}
function P() {
return n.slots.itemContent ? n.slots.itemContent : b;
}
const D = P();
function E(O, $, j) {
return F("li", {
class: g(O, $),
id: w(O, $),
key: w(O, $),
onClick: (V) => h(V, O, $),
onMouseenter: (V) => m(V, O, $),
onMouseover: (V) => p(V, O, $),
onMouseout: (V) => I(V, O, $),
draggable: "true",
onDragstart: (V) => x(V, O, $),
onDragenter: (V) => k(V, $),
onDragend: (V) => v(V, O),
onDragover: (V) => T(V)
}, [d.value && F("div", {
class: "f-list-select",
onClick: (V) => V.stopPropagation()
}, [F(mn, {
id: "list-" + w(O, $),
customClass: "listview-checkbox",
disabled: O[l.value] || !O.checked,
checked: O.checked,
"onUpdate:checked": (V) => O.checked = V,
onChange: (V) => y(O, $, !V.checked)
}, null)]), F("div", {
class: "f-list-content"
}, [D(O)]), F("div", {
class: "f-list-remove",
onClick: (V) => _($)
}, [F("div", {
class: "f-list-remove-icon"
}, [F("i", {
class: "f-icon f-icon-remove_face"
}, null)])]), F("div", {
class: "f-list-handle"
}, [F("div", null, [F("i", {
class: "f-icon f-icon-drag-vertical"
}, null)])])]);
}
return {
renderItem: E
};
}
function cs(t, n, e, o, r, i, a, s, u, c) {
var w;
const d = S(((w = t.group) == null ? void 0 : w.groupFields) || []), {
collpaseGroupIconClass: l
} = r, {
toggleGroupRow: f
} = c;
function m(g, y) {
y.collapse = !y.collapse, e.value = f(y.collapse ? "collapse" : "expand", y, e.value);
}
function p(g, y, h) {
return n.slots.group ? F(wt, null, [n.slots.content && n.slots.group({
item: g.raw,
index: y,
selectedItem: h
})]) : F("div", {
class: "f-navlookup-recentHeader",
onClick: (x) => m(x, g)
}, [F("div", {
class: "fv-grid-group-row-icon"
}, [F("span", {
class: l(g)
}, null)]), F("div", {
class: "f-navlookup-recommandLabel"
}, [g.raw[d.value[g.layer]]])]);
}
function I(g, y, h) {
return g.layer > -1 && p(g, y, h);
}
return {
renderItem: I
};
}
function ds(t, n, e, o) {
const { dataView: r } = e, { updateSelectedItems: i } = o;
function a(s) {
if (s > -1 && s < r.value.length) {
const u = r.value.splice(s, 1);
i(), n.emit("removeItem", u[0]);
}
}
return { removeItem: a };
}
function fs(t, n, e, o, r, i, a, s, u, c) {
const d = S(t.view), l = S(t.view === "CardView"), f = S({}), m = S("暂无数据"), p = ds(t, n, o, u), I = L(() => ({
"f-list-view-group": !0,
"f-list-view-group-multiselect": t.multiSelect,
"d-flex": l.value,
"flex-wrap": l.value
})), w = L(() => !!e.value && e.value.length > 0), g = L(() => e.value.length === 0);
L(() => g.value && !n.slots.empty);
function y() {
return d.value === "SingleView" ? An : d.value === "DraggableView" ? us : (d.value === "ContentView" || d.value === "CardView") && n.slots.content ? ls : An;
}
const h = y(), {
renderItem: x
} = h(t, n, e, c, r, i, u, a, p, s), {
renderItem: k
} = cs(t, n, e, c, r, i, u, a, p, s), T = [x, k];
function v() {
return e.value.filter((M) => M.visible !== !1).map((M, b) => T[M.type](M, b, f));
}
function _() {
return F("div", {
class: "f-list-view-emptydata",
style: "margin: 0 auto;"
}, [F("p", {
class: "f-empty-title"
}, [n.slots.empty ? n.slots.empty() : m.value])]);
}
function C() {
return F("ul", {
class: I.value,
style: "list-style: none;"
}, [w.value && v(), g.value && _()]);
}
return {
renderListArea: C
};
}
function ms(t, n, e) {
function o() {
return n.slots.header && F("div", {
class: "f-list-view-header"
}, [n.slots.header()]);
}
return {
renderHeader: o
};
}
function qn(t, n, e) {
const o = S(t.headerClass), r = S(t.placeholder), i = S(""), a = L(() => !i.value), s = L(() => !!i.value);
function u(f) {
i.value = "";
}
Te(i, (f) => {
t.enableHighlightSearch && e.search(f), n.emit("afterSearch", f);
});
const c = L(() => {
const f = {
"form-group": !0,
"farris-form-group": !0
};
return o.value && o.value.split(" ").reduce((p, I) => (p[I] = !0, p), f), f;
});
function d(f) {
}
function l() {
return F("div", {
class: "f-list-view-header",
onClick: wr(() => d, ["prevent", "stop"])
}, [F("div", {
class: c.value
}, [F("div", {
class: "farris-input-wrap"
}, [F("div", {
class: "f-cmp-inputgroup"
}, [F("div", {
class: "input-group f-state-editable"
}, [Jn(F("input", {
class: "form-control f-utils-fill text-left",
"onUpdate:modelValue": (f) => i.value = f,
name: "input-group-value",
type: "text",
placeholder: r.value,
autocomplete: "off"
}, null), [[Cr, i.value]]), F("div", {
class: "input-group-append"
}, [s.value && F("span", {
class: "input-group-text input-group-clear",
onClick: (f) => u()
}, [F("i", {
class: "f-icon f-icon-close-circle"
}, null)]), a.value && F("span", {
class: "input-group-text"
}, [F("span", {
class: "f-icon f-icon-search"
}, null)])])])])])])]);
}
return {
renderHeader: l
};
}
function ps() {
const t = S(""), n = S(-1), e = S(""), o = S(-1), r = S(!1);
function i(l, f, m) {
o.value = m;
}
function a(l, f, m) {
r.value || (o.value = m);
}
function s(l, f, m) {
o.value = -1;
}
function u() {
r.value = !0;
}
function c() {
r.value = !1;
}
function d() {
n.value = -1, t.value = "";
}
return {
activeIndex: n,
focusedItemId: e,
hoverIndex: o,
clearActiveItem: d,
onMouseenterItem: i,
onMouseoverItem: a,
onMouseoutItem: s,
resumeHover: c,
suspendHover: u
};
}
function hs(t, n, e, o) {
const r = S(t.idField), { dataView: i } = e, a = S(-1), s = S(!1), { activeIndex: u, focusedItemId: c, hoverIndex: d, resumeHover: l, suspendHover: f } = o;
let m, p = 0, I = 0;
function w(T, v) {
const _ = T - p, C = v - I;
m.style.left = parseInt(m.style.left) + _ + "px", m.style.top = parseInt(m.style.top) + C + "px", p = T, I = v;
}
function g(T) {
const { left: v, top: _ } = T.getBoundingClientRect(), C = T.cloneNode(!0);
return C.style.cssText = `
position:absolute;
left:${v}px;
top:${_}px;
z-index: 999999;
border: 1px solid #e2e3e5;
pointer-events: none;
background-color: #edf5ff;
border-radius: 10px;
margin: 4px 2px;
display: flex;
align-items: center;
float: none;
text-align: initial;
width:${getComputedStyle(T).width};
height:${getComputedStyle(T).height};
`, C.children[0].style.cssText = "overflow: hidden;flex: 1 1 auto;width: 100%;", C.children[0].children[0].style.cssText = `
margin: 10px 0px 10px 14px;
overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
`, C.children[1].style.cssText = "width: 30px;color: #f4625f;padding: 0 14px 0 0", C.children[2].style.cssText = "padding: 0 14px 0 0;", document.body.appendChild(C), C;
}
function y(T, v, _) {
if (T.stopPropagation(), f(), v) {
if (m = g(T.target), T.dataTransfer) {
const C = new Image();
C.src = "", T.dataTransfer.setDragImage(C, 0, 0);
}
p = T.pageX, I = T.pageY, setTimeout(() => {
a.value = _, s.value = !0, v.moving = !0;
});
}
}
function h(T, v) {
if (T.preventDefault(), a.value !== v) {
const _ = i.value[a.value], C = i.value;
C.splice(a.value, 1), C.splice(v, 0, _), a.value = v, w(T.pageX, T.pageY);
}
}
function x(T) {
T.preventDefault(), T.dataTransfer && (T.dataTransfer.dropEffect = "move"), w(T.pageX, T.pageY);
}
function k(T, v) {
v && (v.moving = !1, m && (document.body.removeChild(m), m = null)), i.value.forEach((_, C) => {
_.__fv_index__ = C;
}), s.value = !1, l(), d.value = v.raw.__fv_index__, u.value = v.raw.__fv_index__, c.value = v.raw[r.value], n.emit("change", i.value), n.emit("activeChange", [v.raw]);
}
return {
dragstart: y,
dragenter: h,
dragover: x,
dragend: k,
isDragging: s
};
}
function vs(t, n, e, o, r, i) {
const a = S(t.idField), s = S(t.disableField), u = S(t.draggable), c = S(t.itemClass), d = S(t.selection.multiSelect ?? !1), l = S(t.selection.multiSelectMode), { isDragging: f } = o, { activeIndex: m, focusedItemId: p, hoverIndex: I } = r, { clearSelection: w, getSelectedItems: g, toggleSelectItem: y, currentSelectedDataId: h } = i, x = S(g()), k = (E) => x.value.length === 0 ? !1 : x.value.some((O) => {
let $ = "";
return O.data ? $ = O.data[a.value] : $ = O[a.value], $ === E;
});
function T() {
x.value = g();
}
function v(E, O) {
return E.raw[a.value] != null ? E.raw[a.value] : "";
}
function _(E, O) {
const $ = {
"f-list-view-group-item": !0,
"f-list-view-draggable-item": u.value,
"f-un-click": !E.checked,
"f-un-select": !!E.raw[s.value],
"f-listview-active": (
// 多选
d.value && k(v(E)) || // 单选
E.raw[a.value] === h.value
),
"f-listview-hover": !f.value && O === I.value,
moving: !!E.moving
};
return c.value.split(" ").reduce((V, A) => (V[A] = !0, V), $), $;
}
const C = L(() => !d.value);
function M(E, O, $) {
E.checked = $, !E.raw[s.value] && (C.value && (p.value = E.raw[a.value]), y(E));
}
const b = L(() => d.value && l.value === "OnCheckClearByClick"), P = L(() => !d.value || d.value && (l.value === "OnCheckAndClick" || l.value === "OnClick"));
function D(E, O, $) {
if (O.raw[s.value]) {
E.preventDefault(), E.stopPropagation();
return;
}
p.value = O.raw[a.value], m.value = $, b.value && w(), P.value && (y(O), T()), n.emit("clickItem", { data: x.value, index: $ }), n.emit("activeChange", x.value);
}
return {
getKey: v,
selectedItems: x,
listViewItemClass: _,
updateSelectedItems: T,
onCheckItem: M,
onClickItem: D
};
}
const To = /* @__PURE__ */ Ge({
name: "FListView",
props: _o,
emits: ["afterSearch", "checkValuesChange", "clickItem", "selectionChange", "removeItem", "change", "activeChange"],
setup(t, n) {
const e = S(), o = S(!0), r = S(!1), i = S([]), a = 0, s = S(t.columns), u = ro(), c = io(t), d = ao(t), l = so(t, c), f = lo(t, /* @__PURE__ */ new Map(), u, d, c), m = uo(t, f, c, i, n), p = ss(t, e), I = L(() => f.dataView.value.length), w = co(t, n, m, c), g = fo(t, n, c, w, i), y = mo(t), h = po(t, {}, y), x = ho(t, f, g, d, c, y, h), k = Nr(t, c, h, x), T = Rr(t, c, h, x), v = vo(t, s, f, I, a, x, k, T), {
getVisualData: _
} = v;
i.value = _(0, I.value + a - 1);
const C = L(() => {
const U = {
"f-list-view": !0,
"f-list-view-multiple": t.multiSelect
};
return t.size !== "default" && (U[`${t.size}-item`] = !0), Jt(U, t.customClass);
}), M = L(() => !!n.slots.footer || o.value);
function b() {
return t.header === "SearchBar" ? qn : t.header === "ContentHeader" ? ms : qn;
}
const P = b(), {
renderHeader: D
} = P(t, n, p), E = ps(), O = hs(t, n, f, E), $ = vs(t, n, i, O, E, m), {
renderListArea: j
} = fs(t, n, i, f, l, E, m, v, $, O);
function V(U) {
p.search(U);
}
function A(U) {
U && (f.load(U), i.value = _(0, I.value + a - 1));
}
function K() {
m.clearSelection(), E.clearActiveItem();
}
function R() {
return $.selectedItems.value;
}
function N() {
return $.selectedItems.value.map((U) => U[c.idField.value]);
}
function Q(U) {
m.selectedValues.value = U, $.updateSelectedItems();
}
function q() {
return m.currentSelectedDataId.value;
}
function W(U) {
w.activeRowById(U);
}
n.expose({
search: V,
updateDataSource: A,
clearSelection: K,
getSelections: R,
updateSelectionByIds: Q,
getSelectionIds: N,
activeRowById: W,
getCurrentRowId: q
});
function z(U) {
t.multiSelect && (U.preventDefault(), U.stopPropagation());
}
return () => F("div", {
class: C.value,
onClick: z
}, [D(), F("div", {
ref: e,
class: "f-list-view-content",
onMouseover: () => {
r.value = !0;
},
onMouseleave: () => {
r.value = !1;
}
}, [j()]), M.value && F("div", {
class: "f-list-view-footer"
}, [n.slots.footer && n.slots.footer()])]);
}
}), gs = {
/**
* 组件标识
*/
id: String,
/**
* 设置按钮类型
*/
type: { type: String, default: "primary" },
/**
* 是否禁用
*/
disabled: { type: Boolean, default: !1 },
/**
* 按钮尺寸
*/
size: { type: String, default: "middle" },
/**
* 按钮图标
*/
icon: { type: String },
/**
* 自定义class
*/
customClass: { type: Object, default: {} }
};
function ys(t, n) {
function e(o) {
o.stopPropagation(), t.disabled || n.emit("click", o);
}
return {
onClickButton: e
};
}
function bs(t) {
const n = L(() => {
const o = {
"f-icon": !0
};
if (t.icon) {
const r = t.icon.trim().split(" ");
r && r.length && r.reduce((i, a) => (i[a] = !0, i), o);
}
return o;
}), e = L(() => !!(t.icon && t.icon.trim()));
return { iconClass: n, shouldShowIcon: e };
}
const Fo = /* @__PURE__ */ Ge({
name: "FButton",
props: gs,
emits: ["click"],
setup(t, n) {
const {
onClickButton: e
} = ys(t, n), {
iconClass: o,
shouldShowIcon: r
} = bs(t), i = L(() => {
const a = {
btn: !0,
"btn-lg": t.size === "large",
"btn-md": t.size !== "large" && t.size !== "small",
"btn-sm": t.size === "small",
"btn-icontext": r.value
};
return a[`btn-${t.type}`] = !0, t.customClass && Object.keys(t.customClass).reduce((s, u) => (s[u] = t.customClass[u], s), a), a;
});
return () => F("button", {
class: i.value,
disabled: t.disabled,
onClick: (a) => e(a)
}, [r.value && F("i", {
class: o.value
}, null), n.slots.default && n.slots.default()]);
}
}), ws = /* @__PURE__ */ new Map([
["appearance", qt]
]), Cs = "https://json-schema.org/draft/2020-12/schema", Ss = "https://farris-design.gitee.io/combo-list.schema.json", xs = "combo-list", _s = "A Farris Input Component", Ts = "object", Fs = {
id: {
description: "The unique identifier for a combo list",
type: "string"
},
type: {
description: "The type string of number combo list component",
type: "string",
default: "combo-list"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
description: "",
type: "boolean",
default: !1
},
enableClear: {
description: "",
type: "boolean",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !1
},
enableLinkLabel: {
description: "",
type: "boolean",
default: !1
},
label: {
description: "",
type: "string",
default: ""
},
lableWidth: {
description: "",
type: "number"
},
placeholder: {
description: "",
type: "string",
default: "请选择"
},
idField: {
description: "",
type: "string",
default: "id"
},
valueField: {
description: "",
type: "string",
default: "id"
},
titleField: {
description: "",
type: "string",
default: "name"
},
textField: {
description: "",
type: "string",
default: "name"
},
dataSourceType: {
description: "",
type: "string",
default: "static"
},
data: {
description: "",
type: "array"
},
remote: {
description: "",
type: "string"
},
readonly: {
description: "",
type: "boolean",
default: !1
},
required: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
textAlign: {
description: "",
type: "string",
enum: [
"left",
"middle",
"right"
],
default: "left"
},
multiSelect: {
description: "",
type: "boolean",
default: !1
},
maxLength: {
description: "",
type: "number",
default: null
},
visible: {
description: "",
type: "boolean",
default: !0
},
onBlur: {
description: "",
type: "string",
default: ""
},
onClickLinkLabel: {
description: "",
type: "sting",
default: ""
},
maxHeight: {
description: "",
type: "number",
default: 350
},
minPanelWidth: {
description: "",
type: "number",
default: 160
},
popupOnClick: {
description: "",
type: "boolean",
default: !0
},
separator: {
description: "",
type: "string",
default: ","
}
}, ks = [
"type"
], Ms = [
"id",
"appearance",
"binding",
"visible"
], Is = {
$schema: Cs,
$id: Ss,
title: xs,
description: _s,
type: Ts,
properties: Fs,
required: ks,
ignore: Ms
};
function Es(t, n, e) {
return n;
}
const kn = {
/**
* 组件标识
*/
id: { type: String },
/**
* 下拉数据源
*/
data: { type: Array, default: [] },
/**
* 可选,展示文本
* 默认为空字符串 -----内部需要根据value重新生成展示文本,此属性不生效
* displayText: { type: String, default: '' },
*/
/**
* 可选,是否禁用
* 默认为`false`
*/
disabled: { default: !1, type: Boolean },
/**
* 可选,下拉图标
* 默认为'<span class="f-icon f-icon-arrow-60-down"></span>'
*/
dropDownIcon: { type: String, default: '<span class="f-icon f-icon-arrow-60-down"></span>' },
/**
* 可选,是否可编辑
* 默认`false`
*/
editable: { default: !1, type: Boolean },
/**
* 可选,是否启用清空
* 默认启用
*/
enableClear: { default: !0, type: Boolean },
/**
* 可选,启用搜索
* 默认为`false`
*/
enableSearch: { type: Boolean, default: !1 },
/**
* 可选,鼠标悬停时是否显示控件值
* 默认显示
*/
enableTitle: { default: !0, type: Boolean },
fitEditor: { default: !1, type: Boolean },
/**
* 可选,强制显示占位符
* 默认`false`
*/
forcePlaceholder: { default: !1, type: Boolean },
/**
* 可选,清空值时隐藏面板
* 默认`true`
*/
hidePanelOnClear: { default: !0, type: Boolean },
/**
* 可选,数据源id字段
* 默认为`id`
*/
idField: { default: "id", type: String },
/**
* 可选,字段映射
*/
mapFields: { type: Object },
/**
* 可选,最大高度
* 默认`350`
*/
maxHeight: { default: 350, type: Number },
/**
* 最大输入长度
*/
maxLength: { type: Number },
/**
* 可选,是否支持多选
* 默认`false`
*/
multiSelect: { type: Boolean, default: !1 },
/**
* 绑定值
*/
modelValue: {},
/**
* 占位符
*/
placeholder: { type: String, default: "请选择" },
/**
* 可选,下拉面板展示位置
* 默认为`auto`
*/
placement: {
type: String,
default: "auto"
/* auto */
},
/**
* 可选,是否只读
* 默认为`false`
*/
readonly: { default: !1, type: Boolean },
/**
* 远端数据源信息
*/
remote: { default: null, type: Object },
/**
* 可选,是否支持远端过滤
* 默认`false`
*/
remoteSearch: { default: !1, type: Boolean },
/**
* 可选,分隔符
* 默认`,`
*/
separator: { default: ",", type: String },
/**
* tabIndex
*/
tabIndex: { type: Number, default: -1 },
/**
* 可选,数据源显示字段
* 默认为`name`
*/
textField: { default: "name", type: String },
/**
* 可选,数据源的title
* 默认为`name`
*/
titleField: { default: "name", type: String },
/**
* 可选,数据源值字段
* 默认为`id`
*/
valueField: { default: "id", type: String },
/**
* 可选,启用多选下,下拉列表值在输入框中的展示方式
* 支持text | tag
* 因为ButtonEdit内部处理类型只有在批量的情况下才会有展示类型区分
*/
viewType: { default: "tag", type: String },
/**
* 值变化事件
*/
change: { type: Function, default: () => {
} },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认选中文本
*/
selectOnCreated: { type: Boolean, default: !1 },
/**
* 此属性废弃
*/
autoHeight: { type: Boolean, default: !0 },
/**
* 打开前
*/
beforeOpen: { type: Function, default: null },
searchOption: {
type: [Boolean, Function],
default: !1
},
// 搜索启用高亮
enableHighlightSearch: { type: Boolean, default: !0 },
minPanelWidth: { type: Number, default: 160 },
popupOnClick: { type: Boolean, default: !0 }
}, Os = Object.assign({}, kn, {
readonly: {}
}), ko = St(kn, Is, ws, Es), Vs = {
dataSource: { type: Array, default: [] },
enableSearch: { type: Boolean, default: !1 },
idField: { type: String, default: "id" },
multiSelect: { type: Boolean, default: !1 },
selectedValues: { type: String, default: "" },
separator: { type: String, default: "," },
textField: { type: String, default: "name" },
titleField: { type: String, default: "name" },
width: { type: Number },
maxHeight: { type: Number },
valueField: { type: String, default: "id" },
/** 值变化事件 */
onSelectionChange: { type: Function, default: () => {
} },
searchOption: {
type: [Boolean, Function],
default: !1
},
// 搜索启用高亮
enableHighlightSearch: { type: Boolean, default: !0 }
}, Ps = /* @__PURE__ */ Ge({
name: "FComboListContainer",
props: Vs,
emits: ["selectionChange"],
setup(t, n) {
const e = S(), o = S(t.dataSource), r = S([]), i = S(t.separator), a = S(t.width), s = S(t.maxHeight), u = S(String(t.selectedValues).split(i.value)), c = L(() => t.multiSelect), d = L(() => ({
enableSelectRow: !0,
multiSelect: t.multiSelect,
multiSelectMode: "OnCheckAndClick",
showCheckbox: c.value,
showSelectAll: !1,
showSelection: !0
}));
Te(t.dataSource, () => {
o.value = t.dataSource;
}), L(() => t.enableSearch ? "SearchBar" : "ContentHeader");
const l = L(() => {
const w = {};
return a.value !== void 0 && (w.width = `${a.value}px`), s.value !== void 0 && s.value > 0 && (w.maxHeight = `${s.value}px`), w;
});
function f(w) {
e.value.search(w);
}
function m(w) {
r.value = w.map((g) => Object.assign({}, g)), u.value = w.map((g) => g[t.idField]), n.emit("selectionChange", r.value);
}
function p(w) {
if (t.enableHighlightSearch)
return;
let g = [];
const {
searchOption: y
} = t;
typeof y == "function" ? g = o.value.filter((h) => y(w, h)) : g = o.value.filter((h) => h[t.valueField].indexOf(w) > -1 || h[t.textField].indexOf(w) > -1), e.value.updateDataSource(g);
}
Te([() => t.selectedValues], ([w]) => {
t.multiSelect ? u.value = w.split(i.value) : u.value = [w];
});
function I(w) {
e.value.activeRowById(w);
}
return Ct(() => {
var w, g;
if (!t.multiSelect) {
const y = (w = u.value) == null ? void 0 : w[0];
let h = y;
if (!at(y)) {
const x = typeof y, k = typeof ((g = o.value[0]) == null ? void 0 : g[t.valueField || t.idField]);
k === "number" && x !== k && (h = Number(y)), k === "boolean" && x !== k && (h = y === "true" ? !0 : y === "false" ? !1 : y), I(h);
}
}
}), n.expose({
search: f,
activeRowById: I
}), () => F("div", {
class: "f-combo-list-container",
style: l.value
}, [F(go, {
ref: e,
size: "small",
itemClass: "f-combo-list-item",
itemContentClass: "text-truncate",
header: "ContentHeader",
headerClass: "f-combo-list-search-box",
data: o.value,
idField: t.idField,
textField: t.textField,
titleField: t.titleField,
multiSelect: t.multiSelect,
selection: d.value,
enableHighlightSearch: t.enableHighlightSearch,
selectionValues: u.value,
onSelectionChange: m,
onAfterSearch: p
}, null)]);
}
});
function Ds(t) {
const n = S(""), e = S(t.modelValue), o = S(t.data || []), r = S(t.editable);
function i(l) {
const f = t.multiSelect ? String(l).split(t.separator) : [String(l)], m = f.map((w) => [w, !0]), p = new Map(m);
return o.value.filter((w) => p.has(String(w[t.valueField]))).sort((w, g) => {
const y = f.indexOf(w[t.valueField]), h = f.indexOf(g[t.valueField]);
return y - h;
});
}
function a(l) {
const f = i(l).map((m) => m[t.textField]).join(t.separator);
n.value = r.value ? f || l : f;
}
function s(l) {
if (t.multiSelect) {
const f = l.split(t.separator).map((p) => [p, !0]), m = new Map(f);
return o.value.filter((p) => m.has(p[t.textField]));
}
return o.value.filter((f) => "" + f[t.textField] === l);
}
function u(l) {
const f = {};
return f[t.idField] = l, f[t.textField] = l, [f];
}
function c(l) {
let f = s(l);
const m = f && f.length > 0;
return r.value && !m && (f = u(l)), f;
}
function d() {
const { url: l, method: f = "GET", headers: m = {}, body: p = null } = t.remote, I = f.toLowerCase() === "get" ? { method: f, headers: m } : { method: f, headers: m, body: p };
let w = !1;
fetch(l, I).then((g) => {
var h, x;
if (g.