import { D as e, S as i, v as t, u as r, C as l } from "./dnd-kit-56a2f36f.js";
import { f as a, ah as o, e3 as s, ez as n, ai as d, eA as p, eB as h, av as c, w as m, a6 as u, c_ as g, cv as b, ey as w, a4 as y, ds as V, dt as f, cG as x, eC as j, eD as v, eE as k, eF as I, eG as E, eH as C, eI as D, eJ as F, eK as A, eL as R } from "./index-f50c05c4.js";
import { _ as G } from "./lodash-f1e42446.js";
import { lR as q, lS as P, lA as T } from "./ant-design-icons-b1480d8d.js";
import "./loglevel-6fb66d22.js";
import { useState as W } from "react";
import { d as S } from "./styled-components-1e696d6b.js";
import "react-dom";
import "./axios-84bb1c75.js";
import "./redux-devtools-d38e5b33.js";
import "./alasql-0ff6dabf.js";
import "./react-router-a1807b5b.js";
import "./antd-04a23d13.js";
import "./dayjs-844325ae.js";
import "./fontawesome-2445f580.js";
import "./numbro-c1edb412.js";
import "./papaparse-1bac8e5f.js";
import "./uuid-82f303b2.js";
import "./supabase-c27c62e3.js";
import "./fetch-a3c8ad94.js";
import "./react-draggable-60f59f09.js";
import "./remark-gfm-f2973785.js";
import "./buffer-d3713d77.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-e1b123a3.js";
import "./react-best-gradient-color-picker-4dd60dac.js";
import "./ua-parser-js-094f59ba.js";
import "./clsx-469c2c43.js";
import "./crypto-js-d5eac8ba.js";
import "./codemirror-73d8c217.js";
import "./really-relaxed-json-49b6a70d.js";
import "./immer-c0428a8d.js";
import "./redux-saga-5514e228.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-5678e6bc.js";
import "./react-documents-eb6de859.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-5125aafe.js";
import "./react-json-view-9403d8a1.js";
import "./qrcode-react-cb73d2b6.js";
import "./katex-a34f0265.js";
import "./ecogis-maps-bb0d63f9.js";
import "./devextreme-2fa5bb9a.js";
const $ = I, B = E, M = [{ label: T(C, {}), value: "left" }, { label: T(D, {}), value: "center" }, { label: T(F, {}), value: "right" }], L = [{ label: T(C, {}), value: "left" }, { label: T(A, {}), value: "sticky" }, { label: T(F, {}), value: "right" }], N = { label: m(u, "Column"), dataField: u, dataType: g(B, "string"), autoWidth: g($, "auto"), width: b, formatType: g(w, ""), editable: m(y, true), exportable: m(y, true), filterable: m(y, true), headFilterable: m(y, true), searchable: m(y, true), sortable: m(y, true), fixedPosition: g(L, "sticky"), align: g(M, "left"), visible: m(y, true), hidden: y, isGroup: y, groupIndex: b, autoExpandGroup: y, lookup: y, lookupData: V(f), lookupDataFilter: u, valueExpr: u, displayExpr: u, customRender: u, calculateCellValue: u, required: y, msgRequired: u, pattern: u, msgPattern: u, emailValidation: y, msgEmail: u, rangeValidation: y, msgRange: u, rangeValidationMin: b, rangeValidationMax: b };
class H extends a(N) {
}
class z extends H {
  getView() {
    const e2 = G.mapValues(this.children, (e3) => e3.getView());
    return e2.caption = e2.label, "auto" === e2.autoWidth && delete e2.width, delete e2.autoWidth, e2;
  }
  getPropertyView() {
    return q(P, { children: [q("div", { style: { display: "flex", flexDirection: "column", gap: 4, maxWidth: 285 }, children: [this.children.label.propertyView({ label: "Title" }), this.children.dataField.propertyView({ label: "Data Field" }), this.children.dataType.propertyView({ label: "Data Type" }), this.children.formatType.propertyView({ label: "Format" }), this.children.autoWidth.propertyView({ label: "Auto Width", radioButton: true }), "fixed" === this.children.autoWidth.getView() && this.children.width.propertyView({ label: "Width(px)", tooltip: "Pixel" })] }), q("div", { style: { marginLeft: "-12px" }, children: [q(o, { name: "Behaviour", children: [this.children.editable.propertyView({ label: "Allow Editing" }), this.children.exportable.propertyView({ label: "Allow Export" }), this.children.filterable.propertyView({ label: "Allow Filter" }), this.children.headFilterable.propertyView({ label: "Allow HeadFilter" }), this.children.searchable.propertyView({ label: "Allow Search" }), this.children.sortable.propertyView({ label: "Sortable" })] }), q(o, { name: "Layout", children: [this.children.fixedPosition.propertyView({ label: "Fixed Column", radioButton: true }), this.children.align.propertyView({ label: "Alignment", radioButton: true }), this.children.visible.propertyView({ label: "Visible" }), this.children.hidden.propertyView({ label: "Hidden" })] }), q(o, { name: "Grouping", children: [this.children.isGroup.propertyView({ label: "Is Group" }), this.children.isGroup.getView() && this.children.groupIndex.propertyView({ label: "Index" }), this.children.isGroup.getView() && this.children.autoExpandGroup.propertyView({ label: "Expand Group" })] }), q(o, { name: "Lookup", children: [this.children.lookup.propertyView({ label: "Lookup" }), this.children.lookup.getView() && this.children.lookupData.propertyView({ label: "Data" }), this.children.lookup.getView() && this.children.lookupDataFilter.propertyView({ label: "Filter Column" }), this.children.lookup.getView() && this.children.valueExpr.propertyView({ label: "Value Expr" }), this.children.lookup.getView() && this.children.displayExpr.propertyView({ label: "Display Expr" })] }), q(o, { name: "Validation", children: [this.children.required.propertyView({ label: "Required" }), this.children.required.getView() && this.children.msgRequired.propertyView({ label: "msgRequired" }), this.children.pattern.propertyView({ label: "Pattern" }), this.children.pattern.getView() && this.children.msgPattern.propertyView({ label: "msgPattern" }), this.children.emailValidation.propertyView({ label: "Email" }), this.children.emailValidation.getView() && this.children.msgEmail.propertyView({ label: "msgEmail" }), this.children.rangeValidation.propertyView({ label: "Range" }), this.children.rangeValidation.getView() && this.children.msgRange.propertyView({ label: "msgRange" }), this.children.rangeValidation.getView() && this.children.rangeValidationMin.propertyView({ label: "Min" }), this.children.rangeValidation.getView() && this.children.rangeValidationMax.propertyView({ label: "Max" })] }), q(o, { name: "Advanced", children: [this.children.customRender.propertyView({ label: "Custom Render" }), this.children.calculateCellValue.propertyView({ label: "Calculate Value" })] })] })] });
  }
  exposingNode() {
    return this.node();
  }
}
const J = S.div`
  .menu-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .menu-list {
    margin-top: 8px;
    position: relative;
  }
`, K = x(z);
class O extends K {
  addItem(e2) {
    const i2 = this.getView();
    this.dispatch(this.pushAction(e2 ?? { label: `Column ${i2.length + 1}`, dataField: `field${i2.length + 1}`, dataType: "string", autoWidth: "auto", editable: true, filterable: true, sortable: true, visible: true }));
  }
  deleteItem(e2) {
    this.dispatch(this.deleteAction(e2));
  }
  moveItem(e2, i2) {
    this.dispatch(this.arrayMoveAction(e2, i2));
  }
}
const Q = S(R)`
  color: ${s};
  &:hover {
    color: ${n};
  }
`;
function X(e2) {
  const { item: i2, index: t2, onDelete: a2 } = e2, o2 = r({ id: `${t2}` }), { attributes: s2, listeners: n2, setNodeRef: d2, transform: p2, transition: h2, isDragging: m2 } = o2, u2 = { transform: l.Transform.toString(p2), transition: h2, opacity: m2 ? 0.5 : 1 }, [g2, b2] = W(false), w2 = T("div", { style: { width: 300, maxHeight: "calc(100vh - 140px)", overflowY: "auto", overflowX: "hidden", scrollbarWidth: "none", msOverflowStyle: "none" }, className: "tl-popover-scroll", children: i2.getPropertyView() });
  return T(j, { title: c("edit"), content: w2, visible: g2, setVisible: b2, children: q("div", { onClick: () => b2(true), style: { border: "1px solid #d7d9e0", borderRadius: 4, padding: "0 8px", marginBottom: 4, height: 30, display: "flex", justifyContent: "space-between", alignItems: "center", background: "#fff", fontSize: 13, cursor: "pointer", ...u2 }, ref: d2, children: [q("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [T("div", { ...s2, ...n2, style: { display: "flex", alignItems: "center", height: 30, cursor: "grab" }, onClick: (e3) => e3.stopPropagation(), children: T(v, { style: { width: 16, height: 16 } }) }), T("div", { style: { flex: 1, display: "flex", alignItems: "center", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", height: 30, marginTop: 1 }, children: i2.children.label.getView() })] }), T(k, { del: () => a2(t2), children: T(Q, { style: { width: 15, height: 15 }, onClick: (e3) => e3.stopPropagation() }) })] }) });
}
function Y(r2) {
  const l2 = r2.getView();
  return d({ filterText: c("treelist.columns") }, q(J, { children: [T("div", { className: "menu-title", children: T(p, { onClick: () => {
    r2.addItem({ label: `Column ${l2.length + 1}`, dataField: `field${l2.length + 1}`, dataType: "string", editable: true, filterable: true, sortable: true, visible: true });
  }, icon: T(h, {}), children: c("newItem") }) }), T(e, { onDragEnd: (e2) => {
    const { active: i2, over: t2 } = e2;
    if (!t2 || i2.id === t2.id)
      return;
    const l3 = parseInt(i2.id, 10), a2 = parseInt(t2.id, 10);
    r2.moveItem(l3, a2);
  }, children: T(i, { items: l2.map((e2, i2) => `${i2}`), strategy: t, children: T("div", { className: "menu-list", children: l2.map((e2, i2) => T(X, { item: e2, index: i2, onDelete: () => r2.deleteItem(i2) }, i2)) }) }) })] }));
}
export {
  z as TreeListColumnItemComp,
  O as TreeListColumnList,
  Y as treeListColumnPropertyView
};
