@toclocoinc/lattice-grid 1.71.0 → 1.71.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/angular/package.json +1 -1
- package/docs/API.html +73 -15
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/charts.html +70 -12
- package/docs/api/data-router.html +1 -1
- package/docs/api/gantt.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +2 -2
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/tabs.html +1 -1
- package/docs/api/types.html +1 -1
- package/docs/api-detail.html +4 -4
- package/docs/warnings.json +13 -2
- package/lattice-grid.d.ts +53 -7
- package/lattice-grid.esm.min.js +3 -3
- package/lattice-grid.min.cjs +3 -3
- package/lattice-grid.min.js +3 -3
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +2 -2
- package/modules/ai.min.cjs +2 -2
- package/modules/ai.min.js +2 -2
- package/modules/alarms.d.ts +1 -1
- package/modules/alarms.esm.min.js +2 -2
- package/modules/alarms.min.cjs +2 -2
- package/modules/alarms.min.js +2 -2
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +141 -137
- package/modules/charts.esm.min.js.map +2 -2
- package/modules/charts.min.cjs +141 -137
- package/modules/charts.min.js +141 -137
- package/modules/charts.min.js.map +2 -2
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +2 -2
- package/modules/data-router.min.cjs +2 -2
- package/modules/data-router.min.js +2 -2
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +2 -2
- package/modules/dhtmlx-compat.min.cjs +2 -2
- package/modules/dhtmlx-compat.min.js +2 -2
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +2 -2
- package/modules/gantt.min.cjs +2 -2
- package/modules/gantt.min.js +2 -2
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-europe-nuts.min.cjs +8 -0
- package/modules/geo-europe-nuts.min.js +8 -0
- package/modules/geo-europe-nuts.min.js.map +6 -0
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +8 -0
- package/modules/geo-uk.min.js +8 -0
- package/modules/geo-uk.min.js.map +6 -0
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-us-states.min.cjs +8 -0
- package/modules/geo-us-states.min.js +8 -0
- package/modules/geo-us-states.min.js.map +6 -0
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-110m.min.cjs +8 -0
- package/modules/geo-world-110m.min.js +8 -0
- package/modules/geo-world-110m.min.js.map +6 -0
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/geo-world-50m.min.cjs +8 -0
- package/modules/geo-world-50m.min.js +8 -0
- package/modules/geo-world-50m.min.js.map +6 -0
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +3 -3
- package/modules/htmx.min.cjs +3 -3
- package/modules/htmx.min.js +3 -3
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +2 -2
- package/modules/kanban.min.cjs +2 -2
- package/modules/kanban.min.js +2 -2
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +2 -2
- package/modules/kpi.min.cjs +2 -2
- package/modules/kpi.min.js +2 -2
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +2 -2
- package/modules/layout.min.cjs +2 -2
- package/modules/layout.min.js +2 -2
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/react.d.ts +1 -1
- package/modules/react.esm.min.js +2 -2
- package/modules/react.min.cjs +2 -2
- package/modules/react.min.js +2 -2
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +2 -2
- package/modules/tabs.min.cjs +2 -2
- package/modules/tabs.min.js +2 -2
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +3 -3
- package/modules/webcomponent.min.cjs +3 -3
- package/modules/webcomponent.min.js +3 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.71.
|
|
2
|
+
* Lattice Grid 1.71.3, dhtmlx-compat module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
import*as pe from"@toclocoinc/lattice-grid";var J=Object.create(null),Z=Object.create(null);function T(s,g){J[s]=g}function Y(s){var g=Z[s];if(g)return g;var b=Object.create(null);Z[s]=b;var O=J[s];if(!O)throw new Error("[lattice] missing module: "+s);return O(b,Y),b}var _=Object.create(null);_["@toclocoinc/lattice-grid"]=pe;function Q(s){var g=_[s],b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(g)return g;if(s==="@toclocoinc/lattice-grid"&&b&&b.LatticeGrid)return b.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+s)}T("packages/core/src/internal/util.js",function(s,g){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return V}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return me}});const b="1.71.0";async function O(){return b}const p="1.71.0",h=new Set,P=2e3;function m(e){if(h.add(e),h.size>P){const t=h.values().next().value;t!==void 0&&h.delete(t)}}const u=[],a=500;function f(e,t,r){u.push({key:e,level:t,message:r.map(d=>typeof d=="string"?d:o(d)).join(" "),at:Date.now()}),u.length>a&&u.shift()}function o(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(){return u.map(e=>({...e}))}function l(e,...t){h.has(e)||(m(e),f(e,"warn",t),console.warn("[lattice]",...t))}function y(e,...t){h.has(e)||(m(e),f(e,"info",t),console.info("[lattice]",...t))}function n(){h.clear(),u.length=0}function c(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function w(e,t){e||c(t)}const N=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function R(e){return typeof e=="function"}function I(e){return e==null}function D(e){return e==null||e===""}function F(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const M=new Map;function L(e){let t=M.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),d=r.length;t=k=>{let A=k;for(let E=0;E<d;E++){if(A==null)return;A=A[r[E]]}return A}}return M.set(e,t),t}const H=new Map;function x(e){let t=H.get(e);if(t)return t;if(!e.includes("."))t=(r,d)=>{r!=null&&(r[e]=d)};else{const r=e.split("."),d=r.length-1;t=(k,A)=>{let E=k;for(let C=0;C<d;C++){if(E==null)return;const U=r[C];E[U]==null&&(E[U]={}),E=E[U]}E!=null&&(E[r[d]]=A)}}return H.set(e,t),t}function j(e,t){return L(t)(e)}function v(e,t,r){x(t)(e,r)}function z(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const $={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>$[r]):t}function te(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ne(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:S(e)?e:{[t]:e,enabled:!0}}function re(e){return e==null?[]:Array.isArray(e)?e:[e]}const oe=Object.freeze(new Set(["__proto__","constructor","prototype"]));function W(e,t){if(!S(e))return S(t)?{...t}:t;if(!S(t))return t===void 0?e:t;const r={...e};for(const d of Object.keys(t)){if(oe.has(d))continue;const k=t[d];k!==void 0&&(r[d]=S(k)&&S(r[d])?W(r[d],k):k)}return r}function ie(e,t){if(!S(e)||!S(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class ae{#e;#t=new Map;#n;constructor(t=256,r=null){this.#e=t,this.#n=r}get size(){return this.#t.size}get max(){return this.#e}set max(t){this.#e=t,this.#r()}has(t){return this.#t.has(t)}get(t){const r=this.#t;if(!r.has(t))return;const d=r.get(t);return r.delete(t),r.set(t,d),d}peek(t){return this.#t.get(t)}set(t,r){const d=this.#t;return d.has(t)&&d.delete(t),d.set(t,r),this.#r(),r}delete(t){const r=this.#t.get(t);return this.#t.delete(t)&&this.#n&&this.#n(r,t),r}clear(){if(this.#n)for(const[t,r]of this.#t)this.#n(r,t);this.#t.clear()}keys(){return this.#t.keys()}values(){return this.#t.values()}#r(){const t=this.#t;for(;t.size>this.#e;){const r=t.keys().next().value,d=t.get(r);t.delete(r),this.#n&&this.#n(d,r)}}}const G=new Map;function se(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let d=G.get(r);return d||(d=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),G.set(r,d)),d}function ue(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),d=String(t);return r<d?-1:r>d?1:0}function V(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const B=typeof requestAnimationFrame=="function";function q(e){return B?requestAnimationFrame(e):setTimeout(()=>e(V()),16)}function K(e){e!=null&&(B?cancelAnimationFrame(e):clearTimeout(e))}function ce(e){let t=null,r=null;const d=()=>{t=null;const A=r;r=null,e(...A||[])},k=(...A)=>{r=A,t===null&&(t=q(d))};return k.cancel=()=>{K(t),t=null,r=null},k.flush=()=>{t!==null&&(K(t),d())},k}function le(e,t){let r=null,d=null;const k=()=>{if(r=null,d===null)return;const C=d;d=null,e(...C),A()},A=()=>{r=setTimeout(k,t),typeof r?.unref=="function"&&r.unref()},E=(...C)=>{r===null?(e(...C),A()):(d=C,clearTimeout(r),A())};return E.flush=()=>{if(r!==null&&clearTimeout(r),r=null,d===null)return;const C=d;d=null,e(...C)},E.cancel=()=>{r!==null&&clearTimeout(r),r=null,d=null},E.pending=()=>r!==null||d!==null,E}function de(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let fe=0;function me(e="l"){return`${e}${(++fe).toString(36)}`}}),T("packages/modules/dhtmlx-compat/util.js",function(s,g){"use strict";Object.defineProperty(s,"reportUntranslated",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"indexOfKey",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"rowsFrom",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"rowShape",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"columnShape",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce;function p(a,f,o){if(!(!a||typeof a!="object"))for(const i of Object.keys(a))f.has(i)||O(`dhtmlx.${o}.dropped:${i}`,`dhtmlx-compat does not translate the ${o} key '${i}', so it has no effect. Nothing was applied for it.`)}function h(a,f){const o=a.rows.count();for(let i=0;i<o;i++){const l=a.rows.get(i);if(l&&l.key===f)return i}return-1}function P(a){return Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.data)?a.data:[]}function m(a,f){const o=a.rows.byKey(f);return{...o?o.data:void 0,id:f}}function u(a,f){return{id:f}}}),T("packages/modules/dhtmlx-compat/columns.js",function(s,g){"use strict";Object.defineProperty(s,"translateColumn",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"translateColumns",{enumerable:!0,get:function(){return y}});const O=g("packages/core/src/internal/util.js").warnOnce,h=Q("@toclocoinc/lattice-grid").sanitiseHtml;if(typeof h>"u")throw new Error("[lattice] dhtmlx-compat needs sanitiseHtml from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const m=g("packages/modules/dhtmlx-compat/util.js").reportUntranslated,u=new Set(["id","header","type","width","minWidth","maxWidth","resizable","hidden","draggable","align","tooltip","tooltipTemplate","template","htmlEnable","sortable","editable","editorType","editorConfig","options","summary"]),a=Object.freeze({input:"text",select:"select",combobox:"select",textarea:"textarea",multiselect:"multiSelect",datePicker:"date",checkbox:"checkbox"}),f=Object.freeze({number:"number",date:"date"});function o(n){if(typeof n=="string")return n;if(Array.isArray(n)&&n.length>0){n.length>1&&O("dhtmlx.header.multirow",`dhtmlx-compat collapsed a ${n.length}-row header to its first row. Lattice titles are a single string; the remaining rows were not applied.`);const c=n[0];if(typeof c=="string")return c;if(c&&typeof c=="object"&&typeof c.text=="string")return c.text}}function i(n,c){return(w,N)=>{const S={...N.data||{},id:N.row?N.row.key:void 0},R=n(N.value,S,{id:N.colId});c?w.innerHTML=h(String(R)):w.textContent=String(R)}}function l(n){if(!n||typeof n!="object"||!n.id)throw new TypeError("dhtmlx-compat: every column needs an id.");m(n,u,"column");const c={id:n.id,field:n.id},w=o(n.header);if(w!==void 0&&(c.title=w),n.type!==void 0){const R=f[n.type];R&&(c.type=R)}if((n.width!==void 0||n.minWidth!==void 0||n.maxWidth!==void 0||n.resizable!==void 0||n.hidden!==void 0||n.draggable!==void 0)&&(c.layout={},n.width!==void 0&&(c.layout.width=n.width),n.minWidth!==void 0&&(c.layout.min=n.minWidth),n.maxWidth!==void 0&&(c.layout.max=n.maxWidth),n.resizable!==void 0&&(c.layout.resizable=!!n.resizable),n.hidden!==void 0&&(c.layout.hidden=!!n.hidden),n.draggable!==void 0&&(c.layout.movable=!!n.draggable)),n.align!==void 0&&(c.cell={...c.cell||{},align:n.align}),(n.tooltipTemplate!==void 0||n.tooltip!==void 0)&&(c.cell={...c.cell||{},tooltip:n.tooltipTemplate||n.tooltip}),typeof n.template=="function"&&(c.cell={...c.cell||{},render:i(n.template,!!n.htmlEnable)}),n.sortable!==void 0&&(c.sort={enabled:!!n.sortable}),n.editable!==void 0||n.editorType!==void 0||n.editorConfig!==void 0||n.options!==void 0){if(c.edit={enabled:n.editable!==!1},n.editorType!==void 0){const R=a[n.editorType];R||O(`dhtmlx.editorType.unknown:${String(n.editorType)}`,`dhtmlx-compat does not recognise editorType '${String(n.editorType)}'; the default text editor was used instead.`),c.edit.editor=R||"text"}(n.editorConfig!==void 0||n.options!==void 0)&&(c.edit.props={...n.editorConfig||{}},n.options!==void 0&&(c.edit.props.options=n.options))}return n.summary!==void 0&&(c.total=n.summary),c}function y(n){return Array.isArray(n)?n.map(l):[]}}),T("packages/modules/dhtmlx-compat/data.js",function(s,g){"use strict";Object.defineProperty(s,"createData",{enumerable:!0,get:function(){return P}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowsFrom;function h(m){return m.get("rowKey")}function P(m){return{add(u,a){const f=a===void 0?{add:[u]}:{add:[u],at:a},o=m.rows.apply(f);if(o&&o.rejected&&o.rejected.length)throw new Error(`dhtmlx-compat: data.add() was rejected: ${JSON.stringify(o.rejected[0])}.`);return u[h(m)]},update(u,a){m.rows.apply({update:[{...a,[h(m)]:u}]})},remove(u){m.rows.apply({remove:Array.isArray(u)?u:[u]})},removeAll(){m.rows.load([])},parse(u){m.rows.load(p(u))},async load(u,a){const o=await(await fetch(u)).json();m.rows.load(p(o)),typeof a=="function"&&a()},find(u){const a=m.rows.byKey(u);return a?a.data:void 0},findAll(u){const a=[];return m.rows.forEachAll(f=>{u(f.data)&&a.push(f.data)}),a},exists(u){return m.rows.byKey(u)!==void 0&&m.rows.byKey(u)!==null},getItem(u){const a=m.rows.byKey(u);return a?a.data:void 0},serialize(){return m.rows.data()},getId(u){const a=m.rows.get(u);return a?a.key:void 0},getIndex(u){return O(m,u)},getLength(){return m.rows.count()},forEach(u){m.rows.forEach((a,f)=>u(a.data,f))},sort(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.sort(fn) is not supported: Lattice sorts by column, not a comparator. Pass a column id, or { by, dir }.");const a=Array.isArray(u)?u:[u];m.sort.set(a.map(f=>typeof f=="string"?{col:f,dir:"asc"}:{col:f.by,dir:f.dir||"asc"}))},filter(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.filter(fn) is not supported: Lattice filters are a declarative condition tree, not a predicate. Pass { col, op, value } instead.");m.filters.set(u)},resetFilter(){m.filters.clear()}}}}),T("packages/modules/dhtmlx-compat/selection.js",function(s,g){"use strict";Object.defineProperty(s,"createSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"createRangeSelection",{enumerable:!0,get:function(){return f}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowShape,h=b.columnShape;function P(o){return o&&typeof o=="object"&&"id"in o?o.id:o}function m(o){return{setCell(i,l,y,n){const c=O(o,P(i));if(c===-1)return;const w=P(l);if(n){o.selection.extendRange(c,w);return}o.selection.startRange(c,w,{additive:!!y})},getCell(){const i=o.selection.cells();if(i.length)return{row:p(o,i[0].key),column:h(o,i[0].colId)}},getCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},isSelectedCell(i,l){const y=O(o,P(i));return y===-1?!1:o.selection.inRange(y,P(l))},removeCell(){o.selection.clearRange()},enable(){},disable(){o.selection.clearRange()}}}function u(o,i){const l=Math.min(o.start.row,o.end.row),y=Math.max(o.start.row,o.end.row),n=i.columns.visible().map(I=>I.id),c=n.indexOf(o.start.column),w=n.indexOf(o.end.column),N=Math.min(c,w),S=Math.max(c,w),R=N===-1||S===-1?[o.start.column]:n.slice(N,S+1);return{startRow:l,endRow:y,columns:R}}function a(o){return{start:{row:o.startRow,column:o.columns[0]},end:{row:o.endRow,column:o.columns[o.columns.length-1]}}}function f(o){return{setRange(i){o.selection.setRange(u(i,o))},getRange(){const i=o.selection.ranges();if(i.length)return a(i[i.length-1])},getRangedCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},resetRange(){o.selection.clearRange()},isRanged(){return o.selection.ranges().length>0},enable(){},disable(){o.selection.clearRange()},isDisabled(){return!1}}}}),T("packages/modules/dhtmlx-compat/passthrough.js",function(s,g){"use strict";Object.defineProperty(s,"createHistory",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"createExport",{enumerable:!0,get:function(){return O}});function b(p){return{undo(){return p.history.undo()},redo(){return p.history.redo()},canUndo(){return p.history.canUndo()},canRedo(){return p.history.canRedo()},clear(){p.history.clear()},removeAll(){p.history.clear()},getHistory(){return p.history.list()}}}function O(p){return{csv(h){return p.export.csv(h)},xlsx(h){return p.export.excel(h)},pdf(){throw new Error("dhtmlx-compat: export.pdf() is not supported: Lattice has no PDF export. export.csv()/export.xlsx() work, or use the browser's own print-to-PDF via grid.export.print().")},png(){throw new Error("dhtmlx-compat: export.png() is not supported: Lattice has no raster export.")}}}}),T("packages/modules/dhtmlx-compat/events.js",function(s,g){"use strict";Object.defineProperty(s,"createEvents",{enumerable:!0,get:function(){return o}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.rowShape,p=b.columnShape;function h(i,l){return[O(l,i.key),p(l,i.colId),i.event]}function P(i,l){const y=i.column&&i.column.edit?i.column.edit.editor:void 0;return[O(l,i.key),p(l,i.colId),y]}function m(i,l){return[i.value,O(l,i.key),p(l,i.colId)]}function u(i,l){const y=i.sort&&i.sort[0];return y?[p(l,y.col),y.dir]:null}function a(i,l){let y,n;if(i.key!==void 0)y=[i.key],n=i.to;else{const w=l.get("rowKey");y=(Array.isArray(i.data)?i.data:[i.data]).map(S=>S&&S[w]),n=i.at}const c=n!==void 0?l.rows.get(n):void 0;return[{start:y[0],source:y,target:c?c.key:void 0},void 0]}const f=Object.freeze({cellClick:{latticeNames:["cell:clicked"],reshape:h},cellDblClick:{latticeNames:["cell:dblclicked"],reshape:h},cellRightClick:{latticeNames:["cell:contextmenu"],reshape:h},afterEditStart:{latticeNames:["cell:edit:start"],reshape:P},afterEditEnd:{latticeNames:["cell:changed"],reshape:m},afterSort:{latticeNames:["sort:changed"],reshape:u},filterChange:{latticeNames:["filter:changed"]},afterColumnDrop:{latticeNames:["column:moved"]},afterResizeEnd:{latticeNames:["column:resized"]},resize:{latticeNames:["column:resized"]},afterColumnHide:{latticeNames:["column:visible"]},afterColumnShow:{latticeNames:["column:visible"]},afterExpand:{latticeNames:["group:toggled"]},afterCollapse:{latticeNames:["group:toggled"]},afterSelect:{latticeNames:["range:changed"]},afterUnSelect:{latticeNames:["range:changed"]},afterSetRange:{latticeNames:["range:changed"]},afterResetRange:{latticeNames:["range:changed"]},afterAdd:{latticeNames:["history:changed"]},afterUndo:{latticeNames:["history:applied"]},afterRedo:{latticeNames:["history:applied"]},afterCopy:{latticeNames:["clipboard:copy"]},scroll:{latticeNames:["scroll"]},afterRowDrop:{latticeNames:["row:moved","row:received"],reshape:a}});function o(i){const l=new Set;return{on(y,n){const c=f[y];if(!c)return l.has(y)||(l.add(y),console.warn(`dhtmlx-compat: "${y}" has no Lattice equivalent and will never fire.`)),()=>{};const w=c.latticeNames.map(N=>i.on(N,S=>{if(!c.reshape){n(S);return}const R=c.reshape(S,i);R&&n(...R)}));return()=>{for(const N of w)N()}}}}}),T("packages/modules/dhtmlx-compat/rows.js",function(s,g){"use strict";Object.defineProperty(s,"createRowVisibility",{enumerable:!0,get:function(){return b}});function b(O){const p=new Set,h={active:()=>p.size>0,passes:u=>!(u&&p.has(String(u.key)))};let P=!1;function m(){P||(P=!0),O.set("hostFilter",h)}return{hideRow(u){const a=String(u);p.has(a)||(p.add(a),m())},showRow(u){const a=String(u);p.delete(a)&&m()},isRowHidden(u){return p.has(String(u))},hiddenRows(){return[...p]}}}}),T("packages/modules/dhtmlx-compat/spans.js",function(s,g){"use strict";Object.defineProperty(s,"createSpans",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce,p=new Set(["row","column","rowspan","colspan"]);function h(a,f){return`${String(a)}|${String(f)}`}function P(a,f,o,i){if(a&&typeof a=="object"){for(const l of Object.keys(a))p.has(l)||O(`dhtmlx.span.dropped:${l}`,`dhtmlx-compat does not translate the span key '${l}', so it has no effect. Lattice spans carry only geometry (rowspan/colspan); the cell's value, css and tooltip come from its own column, not the span.`);return{row:a.row,column:a.column,rows:Math.max(1,Math.floor(Number(a.rowspan)||1)),cols:Math.max(1,Math.floor(Number(a.colspan)||1))}}return{row:a,column:f,rows:Math.max(1,Math.floor(Number(o)||1)),cols:Math.max(1,Math.floor(Number(i)||1))}}function m(a,f){return a.map(o=>({...o,cell:{...o.cell||{},spanColumns:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.cols:1},spanRows:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.rows:1}}}))}function u(a){const f=new Map;let o=!1;function i(){const l=o?a.get("columns"):m(a.get("columns"),f);o=!0,a.set("columns",l)}return{addSpan(l,y,n,c){const w=P(l,y,n,c);if(w.row===void 0||w.column===void 0)throw new TypeError("dhtmlx-compat: addSpan needs a row and a column.");if(w.rows<=1&&w.cols<=1){this.removeSpan(w.row,w.column);return}f.set(h(w.row,w.column),{rows:w.rows,cols:w.cols}),i()},removeSpan(l,y){f.delete(h(l,y))&&i()},getSpan(l,y){const n=f.get(h(l,y));if(n)return{rowspan:n.rows,colspan:n.cols}},spanCount(){return f.size}}}}),T("packages/modules/dhtmlx-compat/index.js",function(s,g){"use strict";Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return H}});const O=Q("@toclocoinc/lattice-grid").createGrid;if(typeof O>"u")throw new Error("[lattice] dhtmlx-compat needs createGrid from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const h=g("packages/modules/dhtmlx-compat/columns.js").translateColumns,m=g("packages/modules/dhtmlx-compat/data.js").createData,u=g("packages/modules/dhtmlx-compat/selection.js"),a=u.createSelection,f=u.createRangeSelection,o=g("packages/modules/dhtmlx-compat/passthrough.js"),i=o.createHistory,l=o.createExport,n=g("packages/modules/dhtmlx-compat/events.js").createEvents,w=g("packages/modules/dhtmlx-compat/rows.js").createRowVisibility,S=g("packages/modules/dhtmlx-compat/spans.js").createSpans,R=g("packages/modules/dhtmlx-compat/util.js"),I=R.rowsFrom,D=R.reportUntranslated,F=new Set(["rowKey","columns","data","autoHeight","rowHeight","headerRowHeight","multiselection","dragItem","rowTransfer"]);function M(x){D(x,F,"config");const j={rowKey:x.rowKey||"id"};return x.columns!==void 0&&(j.columns=h(x.columns)),x.data!==void 0&&(j.rows=I(x.data)),x.autoHeight!==void 0&&(j.autoHeight=x.autoHeight),x.rowHeight!==void 0&&(j.rowHeight=x.rowHeight),x.headerRowHeight!==void 0&&(j.headerHeight=x.headerRowHeight),x.multiselection&&(j.selection="multiple"),x.dragItem==="row"&&(j.rowReorder=!0),x.rowTransfer!==void 0&&(j.rowTransfer=x.rowTransfer),j}class L{#e;#t;#n;constructor(j,v={}){this.#e=O(j,M(v)),this.data=m(this.#e),this.selection=a(this.#e),this.rangeSelection=f(this.#e),this.history=i(this.#e),this.export=l(this.#e),this.events=n(this.#e),this.#t=w(this.#e),this.#n=S(this.#e)}get lattice(){return this.#e}hideRow(j){this.#t.hideRow(j)}showRow(j){this.#t.showRow(j)}isRowHidden(j){return this.#t.isRowHidden(j)}addSpan(j,v,z,$){this.#n.addSpan(j,v,z,$)}removeSpan(j,v){this.#n.removeSpan(j,v)}getSpan(j,v){return this.#n.getSpan(j,v)}setColumns(j){if(j===void 0)return this.#e.get("columns");this.#e.set("columns",h(j))}destructor(){this.#e.destroy()}}const H=L});const X=Y("packages/modules/dhtmlx-compat/index.js"),he=X.Grid;var ye=X.default;export{he as Grid,ye as default};
|
|
6
|
+
import*as pe from"@toclocoinc/lattice-grid";var J=Object.create(null),Z=Object.create(null);function T(s,g){J[s]=g}function Y(s){var g=Z[s];if(g)return g;var b=Object.create(null);Z[s]=b;var O=J[s];if(!O)throw new Error("[lattice] missing module: "+s);return O(b,Y),b}var _=Object.create(null);_["@toclocoinc/lattice-grid"]=pe;function Q(s){var g=_[s],b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(g)return g;if(s==="@toclocoinc/lattice-grid"&&b&&b.LatticeGrid)return b.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+s)}T("packages/core/src/internal/util.js",function(s,g){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return F}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return z}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return se}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return V}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return q}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return me}});const b="1.71.3";async function O(){return b}const p="1.71.3",h=new Set,P=2e3;function m(e){if(h.add(e),h.size>P){const t=h.values().next().value;t!==void 0&&h.delete(t)}}const u=[],a=500;function f(e,t,r){u.push({key:e,level:t,message:r.map(d=>typeof d=="string"?d:o(d)).join(" "),at:Date.now()}),u.length>a&&u.shift()}function o(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(){return u.map(e=>({...e}))}function l(e,...t){h.has(e)||(m(e),f(e,"warn",t),console.warn("[lattice]",...t))}function y(e,...t){h.has(e)||(m(e),f(e,"info",t),console.info("[lattice]",...t))}function n(){h.clear(),u.length=0}function c(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function w(e,t){e||c(t)}const N=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function R(e){return typeof e=="function"}function I(e){return e==null}function D(e){return e==null||e===""}function F(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const M=new Map;function L(e){let t=M.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),d=r.length;t=k=>{let A=k;for(let E=0;E<d;E++){if(A==null)return;A=A[r[E]]}return A}}return M.set(e,t),t}const H=new Map;function x(e){let t=H.get(e);if(t)return t;if(!e.includes("."))t=(r,d)=>{r!=null&&(r[e]=d)};else{const r=e.split("."),d=r.length-1;t=(k,A)=>{let E=k;for(let C=0;C<d;C++){if(E==null)return;const U=r[C];E[U]==null&&(E[U]={}),E=E[U]}E!=null&&(E[r[d]]=A)}}return H.set(e,t),t}function j(e,t){return L(t)(e)}function v(e,t,r){x(t)(e,r)}function z(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const $={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>$[r]):t}function te(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ne(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:S(e)?e:{[t]:e,enabled:!0}}function re(e){return e==null?[]:Array.isArray(e)?e:[e]}const oe=Object.freeze(new Set(["__proto__","constructor","prototype"]));function W(e,t){if(!S(e))return S(t)?{...t}:t;if(!S(t))return t===void 0?e:t;const r={...e};for(const d of Object.keys(t)){if(oe.has(d))continue;const k=t[d];k!==void 0&&(r[d]=S(k)&&S(r[d])?W(r[d],k):k)}return r}function ie(e,t){if(!S(e)||!S(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class ae{#e;#t=new Map;#n;constructor(t=256,r=null){this.#e=t,this.#n=r}get size(){return this.#t.size}get max(){return this.#e}set max(t){this.#e=t,this.#r()}has(t){return this.#t.has(t)}get(t){const r=this.#t;if(!r.has(t))return;const d=r.get(t);return r.delete(t),r.set(t,d),d}peek(t){return this.#t.get(t)}set(t,r){const d=this.#t;return d.has(t)&&d.delete(t),d.set(t,r),this.#r(),r}delete(t){const r=this.#t.get(t);return this.#t.delete(t)&&this.#n&&this.#n(r,t),r}clear(){if(this.#n)for(const[t,r]of this.#t)this.#n(r,t);this.#t.clear()}keys(){return this.#t.keys()}values(){return this.#t.values()}#r(){const t=this.#t;for(;t.size>this.#e;){const r=t.keys().next().value,d=t.get(r);t.delete(r),this.#n&&this.#n(d,r)}}}const G=new Map;function se(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let d=G.get(r);return d||(d=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),G.set(r,d)),d}function ue(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),d=String(t);return r<d?-1:r>d?1:0}function V(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const B=typeof requestAnimationFrame=="function";function q(e){return B?requestAnimationFrame(e):setTimeout(()=>e(V()),16)}function K(e){e!=null&&(B?cancelAnimationFrame(e):clearTimeout(e))}function ce(e){let t=null,r=null;const d=()=>{t=null;const A=r;r=null,e(...A||[])},k=(...A)=>{r=A,t===null&&(t=q(d))};return k.cancel=()=>{K(t),t=null,r=null},k.flush=()=>{t!==null&&(K(t),d())},k}function le(e,t){let r=null,d=null;const k=()=>{if(r=null,d===null)return;const C=d;d=null,e(...C),A()},A=()=>{r=setTimeout(k,t),typeof r?.unref=="function"&&r.unref()},E=(...C)=>{r===null?(e(...C),A()):(d=C,clearTimeout(r),A())};return E.flush=()=>{if(r!==null&&clearTimeout(r),r=null,d===null)return;const C=d;d=null,e(...C)},E.cancel=()=>{r!==null&&clearTimeout(r),r=null,d=null},E.pending=()=>r!==null||d!==null,E}function de(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let fe=0;function me(e="l"){return`${e}${(++fe).toString(36)}`}}),T("packages/modules/dhtmlx-compat/util.js",function(s,g){"use strict";Object.defineProperty(s,"reportUntranslated",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"indexOfKey",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"rowsFrom",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"rowShape",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"columnShape",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce;function p(a,f,o){if(!(!a||typeof a!="object"))for(const i of Object.keys(a))f.has(i)||O(`dhtmlx.${o}.dropped:${i}`,`dhtmlx-compat does not translate the ${o} key '${i}', so it has no effect. Nothing was applied for it.`)}function h(a,f){const o=a.rows.count();for(let i=0;i<o;i++){const l=a.rows.get(i);if(l&&l.key===f)return i}return-1}function P(a){return Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.data)?a.data:[]}function m(a,f){const o=a.rows.byKey(f);return{...o?o.data:void 0,id:f}}function u(a,f){return{id:f}}}),T("packages/modules/dhtmlx-compat/columns.js",function(s,g){"use strict";Object.defineProperty(s,"translateColumn",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"translateColumns",{enumerable:!0,get:function(){return y}});const O=g("packages/core/src/internal/util.js").warnOnce,h=Q("@toclocoinc/lattice-grid").sanitiseHtml;if(typeof h>"u")throw new Error("[lattice] dhtmlx-compat needs sanitiseHtml from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const m=g("packages/modules/dhtmlx-compat/util.js").reportUntranslated,u=new Set(["id","header","type","width","minWidth","maxWidth","resizable","hidden","draggable","align","tooltip","tooltipTemplate","template","htmlEnable","sortable","editable","editorType","editorConfig","options","summary"]),a=Object.freeze({input:"text",select:"select",combobox:"select",textarea:"textarea",multiselect:"multiSelect",datePicker:"date",checkbox:"checkbox"}),f=Object.freeze({number:"number",date:"date"});function o(n){if(typeof n=="string")return n;if(Array.isArray(n)&&n.length>0){n.length>1&&O("dhtmlx.header.multirow",`dhtmlx-compat collapsed a ${n.length}-row header to its first row. Lattice titles are a single string; the remaining rows were not applied.`);const c=n[0];if(typeof c=="string")return c;if(c&&typeof c=="object"&&typeof c.text=="string")return c.text}}function i(n,c){return(w,N)=>{const S={...N.data||{},id:N.row?N.row.key:void 0},R=n(N.value,S,{id:N.colId});c?w.innerHTML=h(String(R)):w.textContent=String(R)}}function l(n){if(!n||typeof n!="object"||!n.id)throw new TypeError("dhtmlx-compat: every column needs an id.");m(n,u,"column");const c={id:n.id,field:n.id},w=o(n.header);if(w!==void 0&&(c.title=w),n.type!==void 0){const R=f[n.type];R&&(c.type=R)}if((n.width!==void 0||n.minWidth!==void 0||n.maxWidth!==void 0||n.resizable!==void 0||n.hidden!==void 0||n.draggable!==void 0)&&(c.layout={},n.width!==void 0&&(c.layout.width=n.width),n.minWidth!==void 0&&(c.layout.min=n.minWidth),n.maxWidth!==void 0&&(c.layout.max=n.maxWidth),n.resizable!==void 0&&(c.layout.resizable=!!n.resizable),n.hidden!==void 0&&(c.layout.hidden=!!n.hidden),n.draggable!==void 0&&(c.layout.movable=!!n.draggable)),n.align!==void 0&&(c.cell={...c.cell||{},align:n.align}),(n.tooltipTemplate!==void 0||n.tooltip!==void 0)&&(c.cell={...c.cell||{},tooltip:n.tooltipTemplate||n.tooltip}),typeof n.template=="function"&&(c.cell={...c.cell||{},render:i(n.template,!!n.htmlEnable)}),n.sortable!==void 0&&(c.sort={enabled:!!n.sortable}),n.editable!==void 0||n.editorType!==void 0||n.editorConfig!==void 0||n.options!==void 0){if(c.edit={enabled:n.editable!==!1},n.editorType!==void 0){const R=a[n.editorType];R||O(`dhtmlx.editorType.unknown:${String(n.editorType)}`,`dhtmlx-compat does not recognise editorType '${String(n.editorType)}'; the default text editor was used instead.`),c.edit.editor=R||"text"}(n.editorConfig!==void 0||n.options!==void 0)&&(c.edit.props={...n.editorConfig||{}},n.options!==void 0&&(c.edit.props.options=n.options))}return n.summary!==void 0&&(c.total=n.summary),c}function y(n){return Array.isArray(n)?n.map(l):[]}}),T("packages/modules/dhtmlx-compat/data.js",function(s,g){"use strict";Object.defineProperty(s,"createData",{enumerable:!0,get:function(){return P}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowsFrom;function h(m){return m.get("rowKey")}function P(m){return{add(u,a){const f=a===void 0?{add:[u]}:{add:[u],at:a},o=m.rows.apply(f);if(o&&o.rejected&&o.rejected.length)throw new Error(`dhtmlx-compat: data.add() was rejected: ${JSON.stringify(o.rejected[0])}.`);return u[h(m)]},update(u,a){m.rows.apply({update:[{...a,[h(m)]:u}]})},remove(u){m.rows.apply({remove:Array.isArray(u)?u:[u]})},removeAll(){m.rows.load([])},parse(u){m.rows.load(p(u))},async load(u,a){const o=await(await fetch(u)).json();m.rows.load(p(o)),typeof a=="function"&&a()},find(u){const a=m.rows.byKey(u);return a?a.data:void 0},findAll(u){const a=[];return m.rows.forEachAll(f=>{u(f.data)&&a.push(f.data)}),a},exists(u){return m.rows.byKey(u)!==void 0&&m.rows.byKey(u)!==null},getItem(u){const a=m.rows.byKey(u);return a?a.data:void 0},serialize(){return m.rows.data()},getId(u){const a=m.rows.get(u);return a?a.key:void 0},getIndex(u){return O(m,u)},getLength(){return m.rows.count()},forEach(u){m.rows.forEach((a,f)=>u(a.data,f))},sort(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.sort(fn) is not supported: Lattice sorts by column, not a comparator. Pass a column id, or { by, dir }.");const a=Array.isArray(u)?u:[u];m.sort.set(a.map(f=>typeof f=="string"?{col:f,dir:"asc"}:{col:f.by,dir:f.dir||"asc"}))},filter(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.filter(fn) is not supported: Lattice filters are a declarative condition tree, not a predicate. Pass { col, op, value } instead.");m.filters.set(u)},resetFilter(){m.filters.clear()}}}}),T("packages/modules/dhtmlx-compat/selection.js",function(s,g){"use strict";Object.defineProperty(s,"createSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"createRangeSelection",{enumerable:!0,get:function(){return f}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowShape,h=b.columnShape;function P(o){return o&&typeof o=="object"&&"id"in o?o.id:o}function m(o){return{setCell(i,l,y,n){const c=O(o,P(i));if(c===-1)return;const w=P(l);if(n){o.selection.extendRange(c,w);return}o.selection.startRange(c,w,{additive:!!y})},getCell(){const i=o.selection.cells();if(i.length)return{row:p(o,i[0].key),column:h(o,i[0].colId)}},getCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},isSelectedCell(i,l){const y=O(o,P(i));return y===-1?!1:o.selection.inRange(y,P(l))},removeCell(){o.selection.clearRange()},enable(){},disable(){o.selection.clearRange()}}}function u(o,i){const l=Math.min(o.start.row,o.end.row),y=Math.max(o.start.row,o.end.row),n=i.columns.visible().map(I=>I.id),c=n.indexOf(o.start.column),w=n.indexOf(o.end.column),N=Math.min(c,w),S=Math.max(c,w),R=N===-1||S===-1?[o.start.column]:n.slice(N,S+1);return{startRow:l,endRow:y,columns:R}}function a(o){return{start:{row:o.startRow,column:o.columns[0]},end:{row:o.endRow,column:o.columns[o.columns.length-1]}}}function f(o){return{setRange(i){o.selection.setRange(u(i,o))},getRange(){const i=o.selection.ranges();if(i.length)return a(i[i.length-1])},getRangedCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},resetRange(){o.selection.clearRange()},isRanged(){return o.selection.ranges().length>0},enable(){},disable(){o.selection.clearRange()},isDisabled(){return!1}}}}),T("packages/modules/dhtmlx-compat/passthrough.js",function(s,g){"use strict";Object.defineProperty(s,"createHistory",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"createExport",{enumerable:!0,get:function(){return O}});function b(p){return{undo(){return p.history.undo()},redo(){return p.history.redo()},canUndo(){return p.history.canUndo()},canRedo(){return p.history.canRedo()},clear(){p.history.clear()},removeAll(){p.history.clear()},getHistory(){return p.history.list()}}}function O(p){return{csv(h){return p.export.csv(h)},xlsx(h){return p.export.excel(h)},pdf(){throw new Error("dhtmlx-compat: export.pdf() is not supported: Lattice has no PDF export. export.csv()/export.xlsx() work, or use the browser's own print-to-PDF via grid.export.print().")},png(){throw new Error("dhtmlx-compat: export.png() is not supported: Lattice has no raster export.")}}}}),T("packages/modules/dhtmlx-compat/events.js",function(s,g){"use strict";Object.defineProperty(s,"createEvents",{enumerable:!0,get:function(){return o}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.rowShape,p=b.columnShape;function h(i,l){return[O(l,i.key),p(l,i.colId),i.event]}function P(i,l){const y=i.column&&i.column.edit?i.column.edit.editor:void 0;return[O(l,i.key),p(l,i.colId),y]}function m(i,l){return[i.value,O(l,i.key),p(l,i.colId)]}function u(i,l){const y=i.sort&&i.sort[0];return y?[p(l,y.col),y.dir]:null}function a(i,l){let y,n;if(i.key!==void 0)y=[i.key],n=i.to;else{const w=l.get("rowKey");y=(Array.isArray(i.data)?i.data:[i.data]).map(S=>S&&S[w]),n=i.at}const c=n!==void 0?l.rows.get(n):void 0;return[{start:y[0],source:y,target:c?c.key:void 0},void 0]}const f=Object.freeze({cellClick:{latticeNames:["cell:clicked"],reshape:h},cellDblClick:{latticeNames:["cell:dblclicked"],reshape:h},cellRightClick:{latticeNames:["cell:contextmenu"],reshape:h},afterEditStart:{latticeNames:["cell:edit:start"],reshape:P},afterEditEnd:{latticeNames:["cell:changed"],reshape:m},afterSort:{latticeNames:["sort:changed"],reshape:u},filterChange:{latticeNames:["filter:changed"]},afterColumnDrop:{latticeNames:["column:moved"]},afterResizeEnd:{latticeNames:["column:resized"]},resize:{latticeNames:["column:resized"]},afterColumnHide:{latticeNames:["column:visible"]},afterColumnShow:{latticeNames:["column:visible"]},afterExpand:{latticeNames:["group:toggled"]},afterCollapse:{latticeNames:["group:toggled"]},afterSelect:{latticeNames:["range:changed"]},afterUnSelect:{latticeNames:["range:changed"]},afterSetRange:{latticeNames:["range:changed"]},afterResetRange:{latticeNames:["range:changed"]},afterAdd:{latticeNames:["history:changed"]},afterUndo:{latticeNames:["history:applied"]},afterRedo:{latticeNames:["history:applied"]},afterCopy:{latticeNames:["clipboard:copy"]},scroll:{latticeNames:["scroll"]},afterRowDrop:{latticeNames:["row:moved","row:received"],reshape:a}});function o(i){const l=new Set;return{on(y,n){const c=f[y];if(!c)return l.has(y)||(l.add(y),console.warn(`dhtmlx-compat: "${y}" has no Lattice equivalent and will never fire.`)),()=>{};const w=c.latticeNames.map(N=>i.on(N,S=>{if(!c.reshape){n(S);return}const R=c.reshape(S,i);R&&n(...R)}));return()=>{for(const N of w)N()}}}}}),T("packages/modules/dhtmlx-compat/rows.js",function(s,g){"use strict";Object.defineProperty(s,"createRowVisibility",{enumerable:!0,get:function(){return b}});function b(O){const p=new Set,h={active:()=>p.size>0,passes:u=>!(u&&p.has(String(u.key)))};let P=!1;function m(){P||(P=!0),O.set("hostFilter",h)}return{hideRow(u){const a=String(u);p.has(a)||(p.add(a),m())},showRow(u){const a=String(u);p.delete(a)&&m()},isRowHidden(u){return p.has(String(u))},hiddenRows(){return[...p]}}}}),T("packages/modules/dhtmlx-compat/spans.js",function(s,g){"use strict";Object.defineProperty(s,"createSpans",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce,p=new Set(["row","column","rowspan","colspan"]);function h(a,f){return`${String(a)}|${String(f)}`}function P(a,f,o,i){if(a&&typeof a=="object"){for(const l of Object.keys(a))p.has(l)||O(`dhtmlx.span.dropped:${l}`,`dhtmlx-compat does not translate the span key '${l}', so it has no effect. Lattice spans carry only geometry (rowspan/colspan); the cell's value, css and tooltip come from its own column, not the span.`);return{row:a.row,column:a.column,rows:Math.max(1,Math.floor(Number(a.rowspan)||1)),cols:Math.max(1,Math.floor(Number(a.colspan)||1))}}return{row:a,column:f,rows:Math.max(1,Math.floor(Number(o)||1)),cols:Math.max(1,Math.floor(Number(i)||1))}}function m(a,f){return a.map(o=>({...o,cell:{...o.cell||{},spanColumns:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.cols:1},spanRows:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.rows:1}}}))}function u(a){const f=new Map;let o=!1;function i(){const l=o?a.get("columns"):m(a.get("columns"),f);o=!0,a.set("columns",l)}return{addSpan(l,y,n,c){const w=P(l,y,n,c);if(w.row===void 0||w.column===void 0)throw new TypeError("dhtmlx-compat: addSpan needs a row and a column.");if(w.rows<=1&&w.cols<=1){this.removeSpan(w.row,w.column);return}f.set(h(w.row,w.column),{rows:w.rows,cols:w.cols}),i()},removeSpan(l,y){f.delete(h(l,y))&&i()},getSpan(l,y){const n=f.get(h(l,y));if(n)return{rowspan:n.rows,colspan:n.cols}},spanCount(){return f.size}}}}),T("packages/modules/dhtmlx-compat/index.js",function(s,g){"use strict";Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return H}});const O=Q("@toclocoinc/lattice-grid").createGrid;if(typeof O>"u")throw new Error("[lattice] dhtmlx-compat needs createGrid from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const h=g("packages/modules/dhtmlx-compat/columns.js").translateColumns,m=g("packages/modules/dhtmlx-compat/data.js").createData,u=g("packages/modules/dhtmlx-compat/selection.js"),a=u.createSelection,f=u.createRangeSelection,o=g("packages/modules/dhtmlx-compat/passthrough.js"),i=o.createHistory,l=o.createExport,n=g("packages/modules/dhtmlx-compat/events.js").createEvents,w=g("packages/modules/dhtmlx-compat/rows.js").createRowVisibility,S=g("packages/modules/dhtmlx-compat/spans.js").createSpans,R=g("packages/modules/dhtmlx-compat/util.js"),I=R.rowsFrom,D=R.reportUntranslated,F=new Set(["rowKey","columns","data","autoHeight","rowHeight","headerRowHeight","multiselection","dragItem","rowTransfer"]);function M(x){D(x,F,"config");const j={rowKey:x.rowKey||"id"};return x.columns!==void 0&&(j.columns=h(x.columns)),x.data!==void 0&&(j.rows=I(x.data)),x.autoHeight!==void 0&&(j.autoHeight=x.autoHeight),x.rowHeight!==void 0&&(j.rowHeight=x.rowHeight),x.headerRowHeight!==void 0&&(j.headerHeight=x.headerRowHeight),x.multiselection&&(j.selection="multiple"),x.dragItem==="row"&&(j.rowReorder=!0),x.rowTransfer!==void 0&&(j.rowTransfer=x.rowTransfer),j}class L{#e;#t;#n;constructor(j,v={}){this.#e=O(j,M(v)),this.data=m(this.#e),this.selection=a(this.#e),this.rangeSelection=f(this.#e),this.history=i(this.#e),this.export=l(this.#e),this.events=n(this.#e),this.#t=w(this.#e),this.#n=S(this.#e)}get lattice(){return this.#e}hideRow(j){this.#t.hideRow(j)}showRow(j){this.#t.showRow(j)}isRowHidden(j){return this.#t.isRowHidden(j)}addSpan(j,v,z,$){this.#n.addSpan(j,v,z,$)}removeSpan(j,v){this.#n.removeSpan(j,v)}getSpan(j,v){return this.#n.getSpan(j,v)}setColumns(j){if(j===void 0)return this.#e.get("columns");this.#e.set("columns",h(j))}destructor(){this.#e.destroy()}}const H=L});const X=Y("packages/modules/dhtmlx-compat/index.js"),he=X.Grid;var ye=X.default;export{he as Grid,ye as default};
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=dhtmlx-compat.esm.min.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.71.
|
|
2
|
+
* Lattice Grid 1.71.3, dhtmlx-compat module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(F){"use strict";var B=Object.create(null),q=Object.create(null);function C(s,g){B[s]=g}function J(s){var g=q[s];if(g)return g;var b=Object.create(null);q[s]=b;var O=B[s];if(!O)throw new Error("[lattice] missing module: "+s);return O(b,J),b}var Z=Object.create(null);Z["@toclocoinc/lattice-grid"]=F.LatticeGrid||null;function Y(s){var g=Z[s],b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(g)return g;if(s==="@toclocoinc/lattice-grid"&&b&&b.LatticeGrid)return b.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+s)}C("packages/core/src/internal/util.js",function(s,g){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return ye}});const b="1.71.0";async function O(){return b}const p="1.71.0",h=new Set,P=2e3;function m(e){if(h.add(e),h.size>P){const t=h.values().next().value;t!==void 0&&h.delete(t)}}const u=[],a=500;function f(e,t,r){u.push({key:e,level:t,message:r.map(d=>typeof d=="string"?d:o(d)).join(" "),at:Date.now()}),u.length>a&&u.shift()}function o(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(){return u.map(e=>({...e}))}function l(e,...t){h.has(e)||(m(e),f(e,"warn",t),console.warn("[lattice]",...t))}function y(e,...t){h.has(e)||(m(e),f(e,"info",t),console.info("[lattice]",...t))}function n(){h.clear(),u.length=0}function c(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function w(e,t){e||c(t)}const N=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function R(e){return typeof e=="function"}function I(e){return e==null}function $(e){return e==null||e===""}function K(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const H=new Map;function L(e){let t=H.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),d=r.length;t=k=>{let A=k;for(let E=0;E<d;E++){if(A==null)return;A=A[r[E]]}return A}}return H.set(e,t),t}const D=new Map;function x(e){let t=D.get(e);if(t)return t;if(!e.includes("."))t=(r,d)=>{r!=null&&(r[e]=d)};else{const r=e.split("."),d=r.length-1;t=(k,A)=>{let E=k;for(let T=0;T<d;T++){if(E==null)return;const V=r[T];E[V]==null&&(E[V]={}),E=E[V]}E!=null&&(E[r[d]]=A)}}return D.set(e,t),t}function j(e,t){return L(t)(e)}function v(e,t,r){x(t)(e,r)}function G(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const U={"&":"&","<":"<",">":">",'"':""","'":"'"};function re(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>U[r]):t}function oe(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ie(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:S(e)?e:{[t]:e,enabled:!0}}function ae(e){return e==null?[]:Array.isArray(e)?e:[e]}const se=Object.freeze(new Set(["__proto__","constructor","prototype"]));function Q(e,t){if(!S(e))return S(t)?{...t}:t;if(!S(t))return t===void 0?e:t;const r={...e};for(const d of Object.keys(t)){if(se.has(d))continue;const k=t[d];k!==void 0&&(r[d]=S(k)&&S(r[d])?Q(r[d],k):k)}return r}function ue(e,t){if(!S(e)||!S(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class ce{#e;#t=new Map;#n;constructor(t=256,r=null){this.#e=t,this.#n=r}get size(){return this.#t.size}get max(){return this.#e}set max(t){this.#e=t,this.#r()}has(t){return this.#t.has(t)}get(t){const r=this.#t;if(!r.has(t))return;const d=r.get(t);return r.delete(t),r.set(t,d),d}peek(t){return this.#t.get(t)}set(t,r){const d=this.#t;return d.has(t)&&d.delete(t),d.set(t,r),this.#r(),r}delete(t){const r=this.#t.get(t);return this.#t.delete(t)&&this.#n&&this.#n(r,t),r}clear(){if(this.#n)for(const[t,r]of this.#t)this.#n(r,t);this.#t.clear()}keys(){return this.#t.keys()}values(){return this.#t.values()}#r(){const t=this.#t;for(;t.size>this.#e;){const r=t.keys().next().value,d=t.get(r);t.delete(r),this.#n&&this.#n(d,r)}}}const X=new Map;function le(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let d=X.get(r);return d||(d=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),X.set(r,d)),d}function de(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),d=String(t);return r<d?-1:r>d?1:0}function _(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ee=typeof requestAnimationFrame=="function";function te(e){return ee?requestAnimationFrame(e):setTimeout(()=>e(_()),16)}function W(e){e!=null&&(ee?cancelAnimationFrame(e):clearTimeout(e))}function fe(e){let t=null,r=null;const d=()=>{t=null;const A=r;r=null,e(...A||[])},k=(...A)=>{r=A,t===null&&(t=te(d))};return k.cancel=()=>{W(t),t=null,r=null},k.flush=()=>{t!==null&&(W(t),d())},k}function me(e,t){let r=null,d=null;const k=()=>{if(r=null,d===null)return;const T=d;d=null,e(...T),A()},A=()=>{r=setTimeout(k,t),typeof r?.unref=="function"&&r.unref()},E=(...T)=>{r===null?(e(...T),A()):(d=T,clearTimeout(r),A())};return E.flush=()=>{if(r!==null&&clearTimeout(r),r=null,d===null)return;const T=d;d=null,e(...T)},E.cancel=()=>{r!==null&&clearTimeout(r),r=null,d=null},E.pending=()=>r!==null||d!==null,E}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let he=0;function ye(e="l"){return`${e}${(++he).toString(36)}`}}),C("packages/modules/dhtmlx-compat/util.js",function(s,g){"use strict";Object.defineProperty(s,"reportUntranslated",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"indexOfKey",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"rowsFrom",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"rowShape",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"columnShape",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce;function p(a,f,o){if(!(!a||typeof a!="object"))for(const i of Object.keys(a))f.has(i)||O(`dhtmlx.${o}.dropped:${i}`,`dhtmlx-compat does not translate the ${o} key '${i}', so it has no effect. Nothing was applied for it.`)}function h(a,f){const o=a.rows.count();for(let i=0;i<o;i++){const l=a.rows.get(i);if(l&&l.key===f)return i}return-1}function P(a){return Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.data)?a.data:[]}function m(a,f){const o=a.rows.byKey(f);return{...o?o.data:void 0,id:f}}function u(a,f){return{id:f}}}),C("packages/modules/dhtmlx-compat/columns.js",function(s,g){"use strict";Object.defineProperty(s,"translateColumn",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"translateColumns",{enumerable:!0,get:function(){return y}});const O=g("packages/core/src/internal/util.js").warnOnce,h=Y("@toclocoinc/lattice-grid").sanitiseHtml;if(typeof h>"u")throw new Error("[lattice] dhtmlx-compat needs sanitiseHtml from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const m=g("packages/modules/dhtmlx-compat/util.js").reportUntranslated,u=new Set(["id","header","type","width","minWidth","maxWidth","resizable","hidden","draggable","align","tooltip","tooltipTemplate","template","htmlEnable","sortable","editable","editorType","editorConfig","options","summary"]),a=Object.freeze({input:"text",select:"select",combobox:"select",textarea:"textarea",multiselect:"multiSelect",datePicker:"date",checkbox:"checkbox"}),f=Object.freeze({number:"number",date:"date"});function o(n){if(typeof n=="string")return n;if(Array.isArray(n)&&n.length>0){n.length>1&&O("dhtmlx.header.multirow",`dhtmlx-compat collapsed a ${n.length}-row header to its first row. Lattice titles are a single string; the remaining rows were not applied.`);const c=n[0];if(typeof c=="string")return c;if(c&&typeof c=="object"&&typeof c.text=="string")return c.text}}function i(n,c){return(w,N)=>{const S={...N.data||{},id:N.row?N.row.key:void 0},R=n(N.value,S,{id:N.colId});c?w.innerHTML=h(String(R)):w.textContent=String(R)}}function l(n){if(!n||typeof n!="object"||!n.id)throw new TypeError("dhtmlx-compat: every column needs an id.");m(n,u,"column");const c={id:n.id,field:n.id},w=o(n.header);if(w!==void 0&&(c.title=w),n.type!==void 0){const R=f[n.type];R&&(c.type=R)}if((n.width!==void 0||n.minWidth!==void 0||n.maxWidth!==void 0||n.resizable!==void 0||n.hidden!==void 0||n.draggable!==void 0)&&(c.layout={},n.width!==void 0&&(c.layout.width=n.width),n.minWidth!==void 0&&(c.layout.min=n.minWidth),n.maxWidth!==void 0&&(c.layout.max=n.maxWidth),n.resizable!==void 0&&(c.layout.resizable=!!n.resizable),n.hidden!==void 0&&(c.layout.hidden=!!n.hidden),n.draggable!==void 0&&(c.layout.movable=!!n.draggable)),n.align!==void 0&&(c.cell={...c.cell||{},align:n.align}),(n.tooltipTemplate!==void 0||n.tooltip!==void 0)&&(c.cell={...c.cell||{},tooltip:n.tooltipTemplate||n.tooltip}),typeof n.template=="function"&&(c.cell={...c.cell||{},render:i(n.template,!!n.htmlEnable)}),n.sortable!==void 0&&(c.sort={enabled:!!n.sortable}),n.editable!==void 0||n.editorType!==void 0||n.editorConfig!==void 0||n.options!==void 0){if(c.edit={enabled:n.editable!==!1},n.editorType!==void 0){const R=a[n.editorType];R||O(`dhtmlx.editorType.unknown:${String(n.editorType)}`,`dhtmlx-compat does not recognise editorType '${String(n.editorType)}'; the default text editor was used instead.`),c.edit.editor=R||"text"}(n.editorConfig!==void 0||n.options!==void 0)&&(c.edit.props={...n.editorConfig||{}},n.options!==void 0&&(c.edit.props.options=n.options))}return n.summary!==void 0&&(c.total=n.summary),c}function y(n){return Array.isArray(n)?n.map(l):[]}}),C("packages/modules/dhtmlx-compat/data.js",function(s,g){"use strict";Object.defineProperty(s,"createData",{enumerable:!0,get:function(){return P}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowsFrom;function h(m){return m.get("rowKey")}function P(m){return{add(u,a){const f=a===void 0?{add:[u]}:{add:[u],at:a},o=m.rows.apply(f);if(o&&o.rejected&&o.rejected.length)throw new Error(`dhtmlx-compat: data.add() was rejected: ${JSON.stringify(o.rejected[0])}.`);return u[h(m)]},update(u,a){m.rows.apply({update:[{...a,[h(m)]:u}]})},remove(u){m.rows.apply({remove:Array.isArray(u)?u:[u]})},removeAll(){m.rows.load([])},parse(u){m.rows.load(p(u))},async load(u,a){const o=await(await fetch(u)).json();m.rows.load(p(o)),typeof a=="function"&&a()},find(u){const a=m.rows.byKey(u);return a?a.data:void 0},findAll(u){const a=[];return m.rows.forEachAll(f=>{u(f.data)&&a.push(f.data)}),a},exists(u){return m.rows.byKey(u)!==void 0&&m.rows.byKey(u)!==null},getItem(u){const a=m.rows.byKey(u);return a?a.data:void 0},serialize(){return m.rows.data()},getId(u){const a=m.rows.get(u);return a?a.key:void 0},getIndex(u){return O(m,u)},getLength(){return m.rows.count()},forEach(u){m.rows.forEach((a,f)=>u(a.data,f))},sort(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.sort(fn) is not supported: Lattice sorts by column, not a comparator. Pass a column id, or { by, dir }.");const a=Array.isArray(u)?u:[u];m.sort.set(a.map(f=>typeof f=="string"?{col:f,dir:"asc"}:{col:f.by,dir:f.dir||"asc"}))},filter(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.filter(fn) is not supported: Lattice filters are a declarative condition tree, not a predicate. Pass { col, op, value } instead.");m.filters.set(u)},resetFilter(){m.filters.clear()}}}}),C("packages/modules/dhtmlx-compat/selection.js",function(s,g){"use strict";Object.defineProperty(s,"createSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"createRangeSelection",{enumerable:!0,get:function(){return f}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowShape,h=b.columnShape;function P(o){return o&&typeof o=="object"&&"id"in o?o.id:o}function m(o){return{setCell(i,l,y,n){const c=O(o,P(i));if(c===-1)return;const w=P(l);if(n){o.selection.extendRange(c,w);return}o.selection.startRange(c,w,{additive:!!y})},getCell(){const i=o.selection.cells();if(i.length)return{row:p(o,i[0].key),column:h(o,i[0].colId)}},getCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},isSelectedCell(i,l){const y=O(o,P(i));return y===-1?!1:o.selection.inRange(y,P(l))},removeCell(){o.selection.clearRange()},enable(){},disable(){o.selection.clearRange()}}}function u(o,i){const l=Math.min(o.start.row,o.end.row),y=Math.max(o.start.row,o.end.row),n=i.columns.visible().map(I=>I.id),c=n.indexOf(o.start.column),w=n.indexOf(o.end.column),N=Math.min(c,w),S=Math.max(c,w),R=N===-1||S===-1?[o.start.column]:n.slice(N,S+1);return{startRow:l,endRow:y,columns:R}}function a(o){return{start:{row:o.startRow,column:o.columns[0]},end:{row:o.endRow,column:o.columns[o.columns.length-1]}}}function f(o){return{setRange(i){o.selection.setRange(u(i,o))},getRange(){const i=o.selection.ranges();if(i.length)return a(i[i.length-1])},getRangedCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},resetRange(){o.selection.clearRange()},isRanged(){return o.selection.ranges().length>0},enable(){},disable(){o.selection.clearRange()},isDisabled(){return!1}}}}),C("packages/modules/dhtmlx-compat/passthrough.js",function(s,g){"use strict";Object.defineProperty(s,"createHistory",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"createExport",{enumerable:!0,get:function(){return O}});function b(p){return{undo(){return p.history.undo()},redo(){return p.history.redo()},canUndo(){return p.history.canUndo()},canRedo(){return p.history.canRedo()},clear(){p.history.clear()},removeAll(){p.history.clear()},getHistory(){return p.history.list()}}}function O(p){return{csv(h){return p.export.csv(h)},xlsx(h){return p.export.excel(h)},pdf(){throw new Error("dhtmlx-compat: export.pdf() is not supported: Lattice has no PDF export. export.csv()/export.xlsx() work, or use the browser's own print-to-PDF via grid.export.print().")},png(){throw new Error("dhtmlx-compat: export.png() is not supported: Lattice has no raster export.")}}}}),C("packages/modules/dhtmlx-compat/events.js",function(s,g){"use strict";Object.defineProperty(s,"createEvents",{enumerable:!0,get:function(){return o}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.rowShape,p=b.columnShape;function h(i,l){return[O(l,i.key),p(l,i.colId),i.event]}function P(i,l){const y=i.column&&i.column.edit?i.column.edit.editor:void 0;return[O(l,i.key),p(l,i.colId),y]}function m(i,l){return[i.value,O(l,i.key),p(l,i.colId)]}function u(i,l){const y=i.sort&&i.sort[0];return y?[p(l,y.col),y.dir]:null}function a(i,l){let y,n;if(i.key!==void 0)y=[i.key],n=i.to;else{const w=l.get("rowKey");y=(Array.isArray(i.data)?i.data:[i.data]).map(S=>S&&S[w]),n=i.at}const c=n!==void 0?l.rows.get(n):void 0;return[{start:y[0],source:y,target:c?c.key:void 0},void 0]}const f=Object.freeze({cellClick:{latticeNames:["cell:clicked"],reshape:h},cellDblClick:{latticeNames:["cell:dblclicked"],reshape:h},cellRightClick:{latticeNames:["cell:contextmenu"],reshape:h},afterEditStart:{latticeNames:["cell:edit:start"],reshape:P},afterEditEnd:{latticeNames:["cell:changed"],reshape:m},afterSort:{latticeNames:["sort:changed"],reshape:u},filterChange:{latticeNames:["filter:changed"]},afterColumnDrop:{latticeNames:["column:moved"]},afterResizeEnd:{latticeNames:["column:resized"]},resize:{latticeNames:["column:resized"]},afterColumnHide:{latticeNames:["column:visible"]},afterColumnShow:{latticeNames:["column:visible"]},afterExpand:{latticeNames:["group:toggled"]},afterCollapse:{latticeNames:["group:toggled"]},afterSelect:{latticeNames:["range:changed"]},afterUnSelect:{latticeNames:["range:changed"]},afterSetRange:{latticeNames:["range:changed"]},afterResetRange:{latticeNames:["range:changed"]},afterAdd:{latticeNames:["history:changed"]},afterUndo:{latticeNames:["history:applied"]},afterRedo:{latticeNames:["history:applied"]},afterCopy:{latticeNames:["clipboard:copy"]},scroll:{latticeNames:["scroll"]},afterRowDrop:{latticeNames:["row:moved","row:received"],reshape:a}});function o(i){const l=new Set;return{on(y,n){const c=f[y];if(!c)return l.has(y)||(l.add(y),console.warn(`dhtmlx-compat: "${y}" has no Lattice equivalent and will never fire.`)),()=>{};const w=c.latticeNames.map(N=>i.on(N,S=>{if(!c.reshape){n(S);return}const R=c.reshape(S,i);R&&n(...R)}));return()=>{for(const N of w)N()}}}}}),C("packages/modules/dhtmlx-compat/rows.js",function(s,g){"use strict";Object.defineProperty(s,"createRowVisibility",{enumerable:!0,get:function(){return b}});function b(O){const p=new Set,h={active:()=>p.size>0,passes:u=>!(u&&p.has(String(u.key)))};let P=!1;function m(){P||(P=!0),O.set("hostFilter",h)}return{hideRow(u){const a=String(u);p.has(a)||(p.add(a),m())},showRow(u){const a=String(u);p.delete(a)&&m()},isRowHidden(u){return p.has(String(u))},hiddenRows(){return[...p]}}}}),C("packages/modules/dhtmlx-compat/spans.js",function(s,g){"use strict";Object.defineProperty(s,"createSpans",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce,p=new Set(["row","column","rowspan","colspan"]);function h(a,f){return`${String(a)}|${String(f)}`}function P(a,f,o,i){if(a&&typeof a=="object"){for(const l of Object.keys(a))p.has(l)||O(`dhtmlx.span.dropped:${l}`,`dhtmlx-compat does not translate the span key '${l}', so it has no effect. Lattice spans carry only geometry (rowspan/colspan); the cell's value, css and tooltip come from its own column, not the span.`);return{row:a.row,column:a.column,rows:Math.max(1,Math.floor(Number(a.rowspan)||1)),cols:Math.max(1,Math.floor(Number(a.colspan)||1))}}return{row:a,column:f,rows:Math.max(1,Math.floor(Number(o)||1)),cols:Math.max(1,Math.floor(Number(i)||1))}}function m(a,f){return a.map(o=>({...o,cell:{...o.cell||{},spanColumns:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.cols:1},spanRows:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.rows:1}}}))}function u(a){const f=new Map;let o=!1;function i(){const l=o?a.get("columns"):m(a.get("columns"),f);o=!0,a.set("columns",l)}return{addSpan(l,y,n,c){const w=P(l,y,n,c);if(w.row===void 0||w.column===void 0)throw new TypeError("dhtmlx-compat: addSpan needs a row and a column.");if(w.rows<=1&&w.cols<=1){this.removeSpan(w.row,w.column);return}f.set(h(w.row,w.column),{rows:w.rows,cols:w.cols}),i()},removeSpan(l,y){f.delete(h(l,y))&&i()},getSpan(l,y){const n=f.get(h(l,y));if(n)return{rowspan:n.rows,colspan:n.cols}},spanCount(){return f.size}}}}),C("packages/modules/dhtmlx-compat/index.js",function(s,g){"use strict";Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return D}});const O=Y("@toclocoinc/lattice-grid").createGrid;if(typeof O>"u")throw new Error("[lattice] dhtmlx-compat needs createGrid from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const h=g("packages/modules/dhtmlx-compat/columns.js").translateColumns,m=g("packages/modules/dhtmlx-compat/data.js").createData,u=g("packages/modules/dhtmlx-compat/selection.js"),a=u.createSelection,f=u.createRangeSelection,o=g("packages/modules/dhtmlx-compat/passthrough.js"),i=o.createHistory,l=o.createExport,n=g("packages/modules/dhtmlx-compat/events.js").createEvents,w=g("packages/modules/dhtmlx-compat/rows.js").createRowVisibility,S=g("packages/modules/dhtmlx-compat/spans.js").createSpans,R=g("packages/modules/dhtmlx-compat/util.js"),I=R.rowsFrom,$=R.reportUntranslated,K=new Set(["rowKey","columns","data","autoHeight","rowHeight","headerRowHeight","multiselection","dragItem","rowTransfer"]);function H(x){$(x,K,"config");const j={rowKey:x.rowKey||"id"};return x.columns!==void 0&&(j.columns=h(x.columns)),x.data!==void 0&&(j.rows=I(x.data)),x.autoHeight!==void 0&&(j.autoHeight=x.autoHeight),x.rowHeight!==void 0&&(j.rowHeight=x.rowHeight),x.headerRowHeight!==void 0&&(j.headerHeight=x.headerRowHeight),x.multiselection&&(j.selection="multiple"),x.dragItem==="row"&&(j.rowReorder=!0),x.rowTransfer!==void 0&&(j.rowTransfer=x.rowTransfer),j}class L{#e;#t;#n;constructor(j,v={}){this.#e=O(j,H(v)),this.data=m(this.#e),this.selection=a(this.#e),this.rangeSelection=f(this.#e),this.history=i(this.#e),this.export=l(this.#e),this.events=n(this.#e),this.#t=w(this.#e),this.#n=S(this.#e)}get lattice(){return this.#e}hideRow(j){this.#t.hideRow(j)}showRow(j){this.#t.showRow(j)}isRowHidden(j){return this.#t.isRowHidden(j)}addSpan(j,v,G,U){this.#n.addSpan(j,v,G,U)}removeSpan(j,v){this.#n.removeSpan(j,v)}getSpan(j,v){return this.#n.getSpan(j,v)}setColumns(j){if(j===void 0)return this.#e.get("columns");this.#e.set("columns",h(j))}destructor(){this.#e.destroy()}}const D=L});var M=J("packages/modules/dhtmlx-compat/index.js");if(typeof module=="object"&&module.exports)module.exports=M;else if(typeof define=="function"&&define.amd)define(function(){return M});else{var ne=F.LatticeGrid||(F.LatticeGrid={});for(var z in M)z!=="default"&&(ne[z]=M[z])}})(typeof globalThis<"u"?globalThis:this);
|
|
6
|
+
(function(F){"use strict";var B=Object.create(null),q=Object.create(null);function C(s,g){B[s]=g}function J(s){var g=q[s];if(g)return g;var b=Object.create(null);q[s]=b;var O=B[s];if(!O)throw new Error("[lattice] missing module: "+s);return O(b,J),b}var Z=Object.create(null);Z["@toclocoinc/lattice-grid"]=F.LatticeGrid||null;function Y(s){var g=Z[s],b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(g)return g;if(s==="@toclocoinc/lattice-grid"&&b&&b.LatticeGrid)return b.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+s)}C("packages/core/src/internal/util.js",function(s,g){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return ye}});const b="1.71.3";async function O(){return b}const p="1.71.3",h=new Set,P=2e3;function m(e){if(h.add(e),h.size>P){const t=h.values().next().value;t!==void 0&&h.delete(t)}}const u=[],a=500;function f(e,t,r){u.push({key:e,level:t,message:r.map(d=>typeof d=="string"?d:o(d)).join(" "),at:Date.now()}),u.length>a&&u.shift()}function o(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(){return u.map(e=>({...e}))}function l(e,...t){h.has(e)||(m(e),f(e,"warn",t),console.warn("[lattice]",...t))}function y(e,...t){h.has(e)||(m(e),f(e,"info",t),console.info("[lattice]",...t))}function n(){h.clear(),u.length=0}function c(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function w(e,t){e||c(t)}const N=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function R(e){return typeof e=="function"}function I(e){return e==null}function $(e){return e==null||e===""}function K(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const H=new Map;function L(e){let t=H.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),d=r.length;t=k=>{let A=k;for(let E=0;E<d;E++){if(A==null)return;A=A[r[E]]}return A}}return H.set(e,t),t}const D=new Map;function x(e){let t=D.get(e);if(t)return t;if(!e.includes("."))t=(r,d)=>{r!=null&&(r[e]=d)};else{const r=e.split("."),d=r.length-1;t=(k,A)=>{let E=k;for(let T=0;T<d;T++){if(E==null)return;const V=r[T];E[V]==null&&(E[V]={}),E=E[V]}E!=null&&(E[r[d]]=A)}}return D.set(e,t),t}function j(e,t){return L(t)(e)}function v(e,t,r){x(t)(e,r)}function G(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const U={"&":"&","<":"<",">":">",'"':""","'":"'"};function re(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>U[r]):t}function oe(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ie(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:S(e)?e:{[t]:e,enabled:!0}}function ae(e){return e==null?[]:Array.isArray(e)?e:[e]}const se=Object.freeze(new Set(["__proto__","constructor","prototype"]));function Q(e,t){if(!S(e))return S(t)?{...t}:t;if(!S(t))return t===void 0?e:t;const r={...e};for(const d of Object.keys(t)){if(se.has(d))continue;const k=t[d];k!==void 0&&(r[d]=S(k)&&S(r[d])?Q(r[d],k):k)}return r}function ue(e,t){if(!S(e)||!S(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class ce{#e;#t=new Map;#n;constructor(t=256,r=null){this.#e=t,this.#n=r}get size(){return this.#t.size}get max(){return this.#e}set max(t){this.#e=t,this.#r()}has(t){return this.#t.has(t)}get(t){const r=this.#t;if(!r.has(t))return;const d=r.get(t);return r.delete(t),r.set(t,d),d}peek(t){return this.#t.get(t)}set(t,r){const d=this.#t;return d.has(t)&&d.delete(t),d.set(t,r),this.#r(),r}delete(t){const r=this.#t.get(t);return this.#t.delete(t)&&this.#n&&this.#n(r,t),r}clear(){if(this.#n)for(const[t,r]of this.#t)this.#n(r,t);this.#t.clear()}keys(){return this.#t.keys()}values(){return this.#t.values()}#r(){const t=this.#t;for(;t.size>this.#e;){const r=t.keys().next().value,d=t.get(r);t.delete(r),this.#n&&this.#n(d,r)}}}const X=new Map;function le(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let d=X.get(r);return d||(d=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),X.set(r,d)),d}function de(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),d=String(t);return r<d?-1:r>d?1:0}function _(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ee=typeof requestAnimationFrame=="function";function te(e){return ee?requestAnimationFrame(e):setTimeout(()=>e(_()),16)}function W(e){e!=null&&(ee?cancelAnimationFrame(e):clearTimeout(e))}function fe(e){let t=null,r=null;const d=()=>{t=null;const A=r;r=null,e(...A||[])},k=(...A)=>{r=A,t===null&&(t=te(d))};return k.cancel=()=>{W(t),t=null,r=null},k.flush=()=>{t!==null&&(W(t),d())},k}function me(e,t){let r=null,d=null;const k=()=>{if(r=null,d===null)return;const T=d;d=null,e(...T),A()},A=()=>{r=setTimeout(k,t),typeof r?.unref=="function"&&r.unref()},E=(...T)=>{r===null?(e(...T),A()):(d=T,clearTimeout(r),A())};return E.flush=()=>{if(r!==null&&clearTimeout(r),r=null,d===null)return;const T=d;d=null,e(...T)},E.cancel=()=>{r!==null&&clearTimeout(r),r=null,d=null},E.pending=()=>r!==null||d!==null,E}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let he=0;function ye(e="l"){return`${e}${(++he).toString(36)}`}}),C("packages/modules/dhtmlx-compat/util.js",function(s,g){"use strict";Object.defineProperty(s,"reportUntranslated",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"indexOfKey",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"rowsFrom",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"rowShape",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"columnShape",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce;function p(a,f,o){if(!(!a||typeof a!="object"))for(const i of Object.keys(a))f.has(i)||O(`dhtmlx.${o}.dropped:${i}`,`dhtmlx-compat does not translate the ${o} key '${i}', so it has no effect. Nothing was applied for it.`)}function h(a,f){const o=a.rows.count();for(let i=0;i<o;i++){const l=a.rows.get(i);if(l&&l.key===f)return i}return-1}function P(a){return Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.data)?a.data:[]}function m(a,f){const o=a.rows.byKey(f);return{...o?o.data:void 0,id:f}}function u(a,f){return{id:f}}}),C("packages/modules/dhtmlx-compat/columns.js",function(s,g){"use strict";Object.defineProperty(s,"translateColumn",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"translateColumns",{enumerable:!0,get:function(){return y}});const O=g("packages/core/src/internal/util.js").warnOnce,h=Y("@toclocoinc/lattice-grid").sanitiseHtml;if(typeof h>"u")throw new Error("[lattice] dhtmlx-compat needs sanitiseHtml from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const m=g("packages/modules/dhtmlx-compat/util.js").reportUntranslated,u=new Set(["id","header","type","width","minWidth","maxWidth","resizable","hidden","draggable","align","tooltip","tooltipTemplate","template","htmlEnable","sortable","editable","editorType","editorConfig","options","summary"]),a=Object.freeze({input:"text",select:"select",combobox:"select",textarea:"textarea",multiselect:"multiSelect",datePicker:"date",checkbox:"checkbox"}),f=Object.freeze({number:"number",date:"date"});function o(n){if(typeof n=="string")return n;if(Array.isArray(n)&&n.length>0){n.length>1&&O("dhtmlx.header.multirow",`dhtmlx-compat collapsed a ${n.length}-row header to its first row. Lattice titles are a single string; the remaining rows were not applied.`);const c=n[0];if(typeof c=="string")return c;if(c&&typeof c=="object"&&typeof c.text=="string")return c.text}}function i(n,c){return(w,N)=>{const S={...N.data||{},id:N.row?N.row.key:void 0},R=n(N.value,S,{id:N.colId});c?w.innerHTML=h(String(R)):w.textContent=String(R)}}function l(n){if(!n||typeof n!="object"||!n.id)throw new TypeError("dhtmlx-compat: every column needs an id.");m(n,u,"column");const c={id:n.id,field:n.id},w=o(n.header);if(w!==void 0&&(c.title=w),n.type!==void 0){const R=f[n.type];R&&(c.type=R)}if((n.width!==void 0||n.minWidth!==void 0||n.maxWidth!==void 0||n.resizable!==void 0||n.hidden!==void 0||n.draggable!==void 0)&&(c.layout={},n.width!==void 0&&(c.layout.width=n.width),n.minWidth!==void 0&&(c.layout.min=n.minWidth),n.maxWidth!==void 0&&(c.layout.max=n.maxWidth),n.resizable!==void 0&&(c.layout.resizable=!!n.resizable),n.hidden!==void 0&&(c.layout.hidden=!!n.hidden),n.draggable!==void 0&&(c.layout.movable=!!n.draggable)),n.align!==void 0&&(c.cell={...c.cell||{},align:n.align}),(n.tooltipTemplate!==void 0||n.tooltip!==void 0)&&(c.cell={...c.cell||{},tooltip:n.tooltipTemplate||n.tooltip}),typeof n.template=="function"&&(c.cell={...c.cell||{},render:i(n.template,!!n.htmlEnable)}),n.sortable!==void 0&&(c.sort={enabled:!!n.sortable}),n.editable!==void 0||n.editorType!==void 0||n.editorConfig!==void 0||n.options!==void 0){if(c.edit={enabled:n.editable!==!1},n.editorType!==void 0){const R=a[n.editorType];R||O(`dhtmlx.editorType.unknown:${String(n.editorType)}`,`dhtmlx-compat does not recognise editorType '${String(n.editorType)}'; the default text editor was used instead.`),c.edit.editor=R||"text"}(n.editorConfig!==void 0||n.options!==void 0)&&(c.edit.props={...n.editorConfig||{}},n.options!==void 0&&(c.edit.props.options=n.options))}return n.summary!==void 0&&(c.total=n.summary),c}function y(n){return Array.isArray(n)?n.map(l):[]}}),C("packages/modules/dhtmlx-compat/data.js",function(s,g){"use strict";Object.defineProperty(s,"createData",{enumerable:!0,get:function(){return P}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowsFrom;function h(m){return m.get("rowKey")}function P(m){return{add(u,a){const f=a===void 0?{add:[u]}:{add:[u],at:a},o=m.rows.apply(f);if(o&&o.rejected&&o.rejected.length)throw new Error(`dhtmlx-compat: data.add() was rejected: ${JSON.stringify(o.rejected[0])}.`);return u[h(m)]},update(u,a){m.rows.apply({update:[{...a,[h(m)]:u}]})},remove(u){m.rows.apply({remove:Array.isArray(u)?u:[u]})},removeAll(){m.rows.load([])},parse(u){m.rows.load(p(u))},async load(u,a){const o=await(await fetch(u)).json();m.rows.load(p(o)),typeof a=="function"&&a()},find(u){const a=m.rows.byKey(u);return a?a.data:void 0},findAll(u){const a=[];return m.rows.forEachAll(f=>{u(f.data)&&a.push(f.data)}),a},exists(u){return m.rows.byKey(u)!==void 0&&m.rows.byKey(u)!==null},getItem(u){const a=m.rows.byKey(u);return a?a.data:void 0},serialize(){return m.rows.data()},getId(u){const a=m.rows.get(u);return a?a.key:void 0},getIndex(u){return O(m,u)},getLength(){return m.rows.count()},forEach(u){m.rows.forEach((a,f)=>u(a.data,f))},sort(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.sort(fn) is not supported: Lattice sorts by column, not a comparator. Pass a column id, or { by, dir }.");const a=Array.isArray(u)?u:[u];m.sort.set(a.map(f=>typeof f=="string"?{col:f,dir:"asc"}:{col:f.by,dir:f.dir||"asc"}))},filter(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.filter(fn) is not supported: Lattice filters are a declarative condition tree, not a predicate. Pass { col, op, value } instead.");m.filters.set(u)},resetFilter(){m.filters.clear()}}}}),C("packages/modules/dhtmlx-compat/selection.js",function(s,g){"use strict";Object.defineProperty(s,"createSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"createRangeSelection",{enumerable:!0,get:function(){return f}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowShape,h=b.columnShape;function P(o){return o&&typeof o=="object"&&"id"in o?o.id:o}function m(o){return{setCell(i,l,y,n){const c=O(o,P(i));if(c===-1)return;const w=P(l);if(n){o.selection.extendRange(c,w);return}o.selection.startRange(c,w,{additive:!!y})},getCell(){const i=o.selection.cells();if(i.length)return{row:p(o,i[0].key),column:h(o,i[0].colId)}},getCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},isSelectedCell(i,l){const y=O(o,P(i));return y===-1?!1:o.selection.inRange(y,P(l))},removeCell(){o.selection.clearRange()},enable(){},disable(){o.selection.clearRange()}}}function u(o,i){const l=Math.min(o.start.row,o.end.row),y=Math.max(o.start.row,o.end.row),n=i.columns.visible().map(I=>I.id),c=n.indexOf(o.start.column),w=n.indexOf(o.end.column),N=Math.min(c,w),S=Math.max(c,w),R=N===-1||S===-1?[o.start.column]:n.slice(N,S+1);return{startRow:l,endRow:y,columns:R}}function a(o){return{start:{row:o.startRow,column:o.columns[0]},end:{row:o.endRow,column:o.columns[o.columns.length-1]}}}function f(o){return{setRange(i){o.selection.setRange(u(i,o))},getRange(){const i=o.selection.ranges();if(i.length)return a(i[i.length-1])},getRangedCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},resetRange(){o.selection.clearRange()},isRanged(){return o.selection.ranges().length>0},enable(){},disable(){o.selection.clearRange()},isDisabled(){return!1}}}}),C("packages/modules/dhtmlx-compat/passthrough.js",function(s,g){"use strict";Object.defineProperty(s,"createHistory",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"createExport",{enumerable:!0,get:function(){return O}});function b(p){return{undo(){return p.history.undo()},redo(){return p.history.redo()},canUndo(){return p.history.canUndo()},canRedo(){return p.history.canRedo()},clear(){p.history.clear()},removeAll(){p.history.clear()},getHistory(){return p.history.list()}}}function O(p){return{csv(h){return p.export.csv(h)},xlsx(h){return p.export.excel(h)},pdf(){throw new Error("dhtmlx-compat: export.pdf() is not supported: Lattice has no PDF export. export.csv()/export.xlsx() work, or use the browser's own print-to-PDF via grid.export.print().")},png(){throw new Error("dhtmlx-compat: export.png() is not supported: Lattice has no raster export.")}}}}),C("packages/modules/dhtmlx-compat/events.js",function(s,g){"use strict";Object.defineProperty(s,"createEvents",{enumerable:!0,get:function(){return o}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.rowShape,p=b.columnShape;function h(i,l){return[O(l,i.key),p(l,i.colId),i.event]}function P(i,l){const y=i.column&&i.column.edit?i.column.edit.editor:void 0;return[O(l,i.key),p(l,i.colId),y]}function m(i,l){return[i.value,O(l,i.key),p(l,i.colId)]}function u(i,l){const y=i.sort&&i.sort[0];return y?[p(l,y.col),y.dir]:null}function a(i,l){let y,n;if(i.key!==void 0)y=[i.key],n=i.to;else{const w=l.get("rowKey");y=(Array.isArray(i.data)?i.data:[i.data]).map(S=>S&&S[w]),n=i.at}const c=n!==void 0?l.rows.get(n):void 0;return[{start:y[0],source:y,target:c?c.key:void 0},void 0]}const f=Object.freeze({cellClick:{latticeNames:["cell:clicked"],reshape:h},cellDblClick:{latticeNames:["cell:dblclicked"],reshape:h},cellRightClick:{latticeNames:["cell:contextmenu"],reshape:h},afterEditStart:{latticeNames:["cell:edit:start"],reshape:P},afterEditEnd:{latticeNames:["cell:changed"],reshape:m},afterSort:{latticeNames:["sort:changed"],reshape:u},filterChange:{latticeNames:["filter:changed"]},afterColumnDrop:{latticeNames:["column:moved"]},afterResizeEnd:{latticeNames:["column:resized"]},resize:{latticeNames:["column:resized"]},afterColumnHide:{latticeNames:["column:visible"]},afterColumnShow:{latticeNames:["column:visible"]},afterExpand:{latticeNames:["group:toggled"]},afterCollapse:{latticeNames:["group:toggled"]},afterSelect:{latticeNames:["range:changed"]},afterUnSelect:{latticeNames:["range:changed"]},afterSetRange:{latticeNames:["range:changed"]},afterResetRange:{latticeNames:["range:changed"]},afterAdd:{latticeNames:["history:changed"]},afterUndo:{latticeNames:["history:applied"]},afterRedo:{latticeNames:["history:applied"]},afterCopy:{latticeNames:["clipboard:copy"]},scroll:{latticeNames:["scroll"]},afterRowDrop:{latticeNames:["row:moved","row:received"],reshape:a}});function o(i){const l=new Set;return{on(y,n){const c=f[y];if(!c)return l.has(y)||(l.add(y),console.warn(`dhtmlx-compat: "${y}" has no Lattice equivalent and will never fire.`)),()=>{};const w=c.latticeNames.map(N=>i.on(N,S=>{if(!c.reshape){n(S);return}const R=c.reshape(S,i);R&&n(...R)}));return()=>{for(const N of w)N()}}}}}),C("packages/modules/dhtmlx-compat/rows.js",function(s,g){"use strict";Object.defineProperty(s,"createRowVisibility",{enumerable:!0,get:function(){return b}});function b(O){const p=new Set,h={active:()=>p.size>0,passes:u=>!(u&&p.has(String(u.key)))};let P=!1;function m(){P||(P=!0),O.set("hostFilter",h)}return{hideRow(u){const a=String(u);p.has(a)||(p.add(a),m())},showRow(u){const a=String(u);p.delete(a)&&m()},isRowHidden(u){return p.has(String(u))},hiddenRows(){return[...p]}}}}),C("packages/modules/dhtmlx-compat/spans.js",function(s,g){"use strict";Object.defineProperty(s,"createSpans",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce,p=new Set(["row","column","rowspan","colspan"]);function h(a,f){return`${String(a)}|${String(f)}`}function P(a,f,o,i){if(a&&typeof a=="object"){for(const l of Object.keys(a))p.has(l)||O(`dhtmlx.span.dropped:${l}`,`dhtmlx-compat does not translate the span key '${l}', so it has no effect. Lattice spans carry only geometry (rowspan/colspan); the cell's value, css and tooltip come from its own column, not the span.`);return{row:a.row,column:a.column,rows:Math.max(1,Math.floor(Number(a.rowspan)||1)),cols:Math.max(1,Math.floor(Number(a.colspan)||1))}}return{row:a,column:f,rows:Math.max(1,Math.floor(Number(o)||1)),cols:Math.max(1,Math.floor(Number(i)||1))}}function m(a,f){return a.map(o=>({...o,cell:{...o.cell||{},spanColumns:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.cols:1},spanRows:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.rows:1}}}))}function u(a){const f=new Map;let o=!1;function i(){const l=o?a.get("columns"):m(a.get("columns"),f);o=!0,a.set("columns",l)}return{addSpan(l,y,n,c){const w=P(l,y,n,c);if(w.row===void 0||w.column===void 0)throw new TypeError("dhtmlx-compat: addSpan needs a row and a column.");if(w.rows<=1&&w.cols<=1){this.removeSpan(w.row,w.column);return}f.set(h(w.row,w.column),{rows:w.rows,cols:w.cols}),i()},removeSpan(l,y){f.delete(h(l,y))&&i()},getSpan(l,y){const n=f.get(h(l,y));if(n)return{rowspan:n.rows,colspan:n.cols}},spanCount(){return f.size}}}}),C("packages/modules/dhtmlx-compat/index.js",function(s,g){"use strict";Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return D}});const O=Y("@toclocoinc/lattice-grid").createGrid;if(typeof O>"u")throw new Error("[lattice] dhtmlx-compat needs createGrid from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const h=g("packages/modules/dhtmlx-compat/columns.js").translateColumns,m=g("packages/modules/dhtmlx-compat/data.js").createData,u=g("packages/modules/dhtmlx-compat/selection.js"),a=u.createSelection,f=u.createRangeSelection,o=g("packages/modules/dhtmlx-compat/passthrough.js"),i=o.createHistory,l=o.createExport,n=g("packages/modules/dhtmlx-compat/events.js").createEvents,w=g("packages/modules/dhtmlx-compat/rows.js").createRowVisibility,S=g("packages/modules/dhtmlx-compat/spans.js").createSpans,R=g("packages/modules/dhtmlx-compat/util.js"),I=R.rowsFrom,$=R.reportUntranslated,K=new Set(["rowKey","columns","data","autoHeight","rowHeight","headerRowHeight","multiselection","dragItem","rowTransfer"]);function H(x){$(x,K,"config");const j={rowKey:x.rowKey||"id"};return x.columns!==void 0&&(j.columns=h(x.columns)),x.data!==void 0&&(j.rows=I(x.data)),x.autoHeight!==void 0&&(j.autoHeight=x.autoHeight),x.rowHeight!==void 0&&(j.rowHeight=x.rowHeight),x.headerRowHeight!==void 0&&(j.headerHeight=x.headerRowHeight),x.multiselection&&(j.selection="multiple"),x.dragItem==="row"&&(j.rowReorder=!0),x.rowTransfer!==void 0&&(j.rowTransfer=x.rowTransfer),j}class L{#e;#t;#n;constructor(j,v={}){this.#e=O(j,H(v)),this.data=m(this.#e),this.selection=a(this.#e),this.rangeSelection=f(this.#e),this.history=i(this.#e),this.export=l(this.#e),this.events=n(this.#e),this.#t=w(this.#e),this.#n=S(this.#e)}get lattice(){return this.#e}hideRow(j){this.#t.hideRow(j)}showRow(j){this.#t.showRow(j)}isRowHidden(j){return this.#t.isRowHidden(j)}addSpan(j,v,G,U){this.#n.addSpan(j,v,G,U)}removeSpan(j,v){this.#n.removeSpan(j,v)}getSpan(j,v){return this.#n.getSpan(j,v)}setColumns(j){if(j===void 0)return this.#e.get("columns");this.#e.set("columns",h(j))}destructor(){this.#e.destroy()}}const D=L});var M=J("packages/modules/dhtmlx-compat/index.js");if(typeof module=="object"&&module.exports)module.exports=M;else if(typeof define=="function"&&define.amd)define(function(){return M});else{var ne=F.LatticeGrid||(F.LatticeGrid={});for(var z in M)z!=="default"&&(ne[z]=M[z])}})(typeof globalThis<"u"?globalThis:this);
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=dhtmlx-compat.min.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.71.
|
|
2
|
+
* Lattice Grid 1.71.3, dhtmlx-compat module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(F){"use strict";var B=Object.create(null),q=Object.create(null);function C(s,g){B[s]=g}function J(s){var g=q[s];if(g)return g;var b=Object.create(null);q[s]=b;var O=B[s];if(!O)throw new Error("[lattice] missing module: "+s);return O(b,J),b}var Z=Object.create(null);Z["@toclocoinc/lattice-grid"]=F.LatticeGrid||null;function Y(s){var g=Z[s],b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(g)return g;if(s==="@toclocoinc/lattice-grid"&&b&&b.LatticeGrid)return b.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+s)}C("packages/core/src/internal/util.js",function(s,g){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return ye}});const b="1.71.0";async function O(){return b}const p="1.71.0",h=new Set,P=2e3;function m(e){if(h.add(e),h.size>P){const t=h.values().next().value;t!==void 0&&h.delete(t)}}const u=[],a=500;function f(e,t,r){u.push({key:e,level:t,message:r.map(d=>typeof d=="string"?d:o(d)).join(" "),at:Date.now()}),u.length>a&&u.shift()}function o(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(){return u.map(e=>({...e}))}function l(e,...t){h.has(e)||(m(e),f(e,"warn",t),console.warn("[lattice]",...t))}function y(e,...t){h.has(e)||(m(e),f(e,"info",t),console.info("[lattice]",...t))}function n(){h.clear(),u.length=0}function c(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function w(e,t){e||c(t)}const N=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function R(e){return typeof e=="function"}function I(e){return e==null}function $(e){return e==null||e===""}function K(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const H=new Map;function L(e){let t=H.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),d=r.length;t=k=>{let A=k;for(let E=0;E<d;E++){if(A==null)return;A=A[r[E]]}return A}}return H.set(e,t),t}const D=new Map;function x(e){let t=D.get(e);if(t)return t;if(!e.includes("."))t=(r,d)=>{r!=null&&(r[e]=d)};else{const r=e.split("."),d=r.length-1;t=(k,A)=>{let E=k;for(let T=0;T<d;T++){if(E==null)return;const V=r[T];E[V]==null&&(E[V]={}),E=E[V]}E!=null&&(E[r[d]]=A)}}return D.set(e,t),t}function j(e,t){return L(t)(e)}function v(e,t,r){x(t)(e,r)}function G(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const U={"&":"&","<":"<",">":">",'"':""","'":"'"};function re(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>U[r]):t}function oe(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ie(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:S(e)?e:{[t]:e,enabled:!0}}function ae(e){return e==null?[]:Array.isArray(e)?e:[e]}const se=Object.freeze(new Set(["__proto__","constructor","prototype"]));function Q(e,t){if(!S(e))return S(t)?{...t}:t;if(!S(t))return t===void 0?e:t;const r={...e};for(const d of Object.keys(t)){if(se.has(d))continue;const k=t[d];k!==void 0&&(r[d]=S(k)&&S(r[d])?Q(r[d],k):k)}return r}function ue(e,t){if(!S(e)||!S(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class ce{#e;#t=new Map;#n;constructor(t=256,r=null){this.#e=t,this.#n=r}get size(){return this.#t.size}get max(){return this.#e}set max(t){this.#e=t,this.#r()}has(t){return this.#t.has(t)}get(t){const r=this.#t;if(!r.has(t))return;const d=r.get(t);return r.delete(t),r.set(t,d),d}peek(t){return this.#t.get(t)}set(t,r){const d=this.#t;return d.has(t)&&d.delete(t),d.set(t,r),this.#r(),r}delete(t){const r=this.#t.get(t);return this.#t.delete(t)&&this.#n&&this.#n(r,t),r}clear(){if(this.#n)for(const[t,r]of this.#t)this.#n(r,t);this.#t.clear()}keys(){return this.#t.keys()}values(){return this.#t.values()}#r(){const t=this.#t;for(;t.size>this.#e;){const r=t.keys().next().value,d=t.get(r);t.delete(r),this.#n&&this.#n(d,r)}}}const X=new Map;function le(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let d=X.get(r);return d||(d=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),X.set(r,d)),d}function de(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),d=String(t);return r<d?-1:r>d?1:0}function _(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ee=typeof requestAnimationFrame=="function";function te(e){return ee?requestAnimationFrame(e):setTimeout(()=>e(_()),16)}function W(e){e!=null&&(ee?cancelAnimationFrame(e):clearTimeout(e))}function fe(e){let t=null,r=null;const d=()=>{t=null;const A=r;r=null,e(...A||[])},k=(...A)=>{r=A,t===null&&(t=te(d))};return k.cancel=()=>{W(t),t=null,r=null},k.flush=()=>{t!==null&&(W(t),d())},k}function me(e,t){let r=null,d=null;const k=()=>{if(r=null,d===null)return;const T=d;d=null,e(...T),A()},A=()=>{r=setTimeout(k,t),typeof r?.unref=="function"&&r.unref()},E=(...T)=>{r===null?(e(...T),A()):(d=T,clearTimeout(r),A())};return E.flush=()=>{if(r!==null&&clearTimeout(r),r=null,d===null)return;const T=d;d=null,e(...T)},E.cancel=()=>{r!==null&&clearTimeout(r),r=null,d=null},E.pending=()=>r!==null||d!==null,E}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let he=0;function ye(e="l"){return`${e}${(++he).toString(36)}`}}),C("packages/modules/dhtmlx-compat/util.js",function(s,g){"use strict";Object.defineProperty(s,"reportUntranslated",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"indexOfKey",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"rowsFrom",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"rowShape",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"columnShape",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce;function p(a,f,o){if(!(!a||typeof a!="object"))for(const i of Object.keys(a))f.has(i)||O(`dhtmlx.${o}.dropped:${i}`,`dhtmlx-compat does not translate the ${o} key '${i}', so it has no effect. Nothing was applied for it.`)}function h(a,f){const o=a.rows.count();for(let i=0;i<o;i++){const l=a.rows.get(i);if(l&&l.key===f)return i}return-1}function P(a){return Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.data)?a.data:[]}function m(a,f){const o=a.rows.byKey(f);return{...o?o.data:void 0,id:f}}function u(a,f){return{id:f}}}),C("packages/modules/dhtmlx-compat/columns.js",function(s,g){"use strict";Object.defineProperty(s,"translateColumn",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"translateColumns",{enumerable:!0,get:function(){return y}});const O=g("packages/core/src/internal/util.js").warnOnce,h=Y("@toclocoinc/lattice-grid").sanitiseHtml;if(typeof h>"u")throw new Error("[lattice] dhtmlx-compat needs sanitiseHtml from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const m=g("packages/modules/dhtmlx-compat/util.js").reportUntranslated,u=new Set(["id","header","type","width","minWidth","maxWidth","resizable","hidden","draggable","align","tooltip","tooltipTemplate","template","htmlEnable","sortable","editable","editorType","editorConfig","options","summary"]),a=Object.freeze({input:"text",select:"select",combobox:"select",textarea:"textarea",multiselect:"multiSelect",datePicker:"date",checkbox:"checkbox"}),f=Object.freeze({number:"number",date:"date"});function o(n){if(typeof n=="string")return n;if(Array.isArray(n)&&n.length>0){n.length>1&&O("dhtmlx.header.multirow",`dhtmlx-compat collapsed a ${n.length}-row header to its first row. Lattice titles are a single string; the remaining rows were not applied.`);const c=n[0];if(typeof c=="string")return c;if(c&&typeof c=="object"&&typeof c.text=="string")return c.text}}function i(n,c){return(w,N)=>{const S={...N.data||{},id:N.row?N.row.key:void 0},R=n(N.value,S,{id:N.colId});c?w.innerHTML=h(String(R)):w.textContent=String(R)}}function l(n){if(!n||typeof n!="object"||!n.id)throw new TypeError("dhtmlx-compat: every column needs an id.");m(n,u,"column");const c={id:n.id,field:n.id},w=o(n.header);if(w!==void 0&&(c.title=w),n.type!==void 0){const R=f[n.type];R&&(c.type=R)}if((n.width!==void 0||n.minWidth!==void 0||n.maxWidth!==void 0||n.resizable!==void 0||n.hidden!==void 0||n.draggable!==void 0)&&(c.layout={},n.width!==void 0&&(c.layout.width=n.width),n.minWidth!==void 0&&(c.layout.min=n.minWidth),n.maxWidth!==void 0&&(c.layout.max=n.maxWidth),n.resizable!==void 0&&(c.layout.resizable=!!n.resizable),n.hidden!==void 0&&(c.layout.hidden=!!n.hidden),n.draggable!==void 0&&(c.layout.movable=!!n.draggable)),n.align!==void 0&&(c.cell={...c.cell||{},align:n.align}),(n.tooltipTemplate!==void 0||n.tooltip!==void 0)&&(c.cell={...c.cell||{},tooltip:n.tooltipTemplate||n.tooltip}),typeof n.template=="function"&&(c.cell={...c.cell||{},render:i(n.template,!!n.htmlEnable)}),n.sortable!==void 0&&(c.sort={enabled:!!n.sortable}),n.editable!==void 0||n.editorType!==void 0||n.editorConfig!==void 0||n.options!==void 0){if(c.edit={enabled:n.editable!==!1},n.editorType!==void 0){const R=a[n.editorType];R||O(`dhtmlx.editorType.unknown:${String(n.editorType)}`,`dhtmlx-compat does not recognise editorType '${String(n.editorType)}'; the default text editor was used instead.`),c.edit.editor=R||"text"}(n.editorConfig!==void 0||n.options!==void 0)&&(c.edit.props={...n.editorConfig||{}},n.options!==void 0&&(c.edit.props.options=n.options))}return n.summary!==void 0&&(c.total=n.summary),c}function y(n){return Array.isArray(n)?n.map(l):[]}}),C("packages/modules/dhtmlx-compat/data.js",function(s,g){"use strict";Object.defineProperty(s,"createData",{enumerable:!0,get:function(){return P}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowsFrom;function h(m){return m.get("rowKey")}function P(m){return{add(u,a){const f=a===void 0?{add:[u]}:{add:[u],at:a},o=m.rows.apply(f);if(o&&o.rejected&&o.rejected.length)throw new Error(`dhtmlx-compat: data.add() was rejected: ${JSON.stringify(o.rejected[0])}.`);return u[h(m)]},update(u,a){m.rows.apply({update:[{...a,[h(m)]:u}]})},remove(u){m.rows.apply({remove:Array.isArray(u)?u:[u]})},removeAll(){m.rows.load([])},parse(u){m.rows.load(p(u))},async load(u,a){const o=await(await fetch(u)).json();m.rows.load(p(o)),typeof a=="function"&&a()},find(u){const a=m.rows.byKey(u);return a?a.data:void 0},findAll(u){const a=[];return m.rows.forEachAll(f=>{u(f.data)&&a.push(f.data)}),a},exists(u){return m.rows.byKey(u)!==void 0&&m.rows.byKey(u)!==null},getItem(u){const a=m.rows.byKey(u);return a?a.data:void 0},serialize(){return m.rows.data()},getId(u){const a=m.rows.get(u);return a?a.key:void 0},getIndex(u){return O(m,u)},getLength(){return m.rows.count()},forEach(u){m.rows.forEach((a,f)=>u(a.data,f))},sort(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.sort(fn) is not supported: Lattice sorts by column, not a comparator. Pass a column id, or { by, dir }.");const a=Array.isArray(u)?u:[u];m.sort.set(a.map(f=>typeof f=="string"?{col:f,dir:"asc"}:{col:f.by,dir:f.dir||"asc"}))},filter(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.filter(fn) is not supported: Lattice filters are a declarative condition tree, not a predicate. Pass { col, op, value } instead.");m.filters.set(u)},resetFilter(){m.filters.clear()}}}}),C("packages/modules/dhtmlx-compat/selection.js",function(s,g){"use strict";Object.defineProperty(s,"createSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"createRangeSelection",{enumerable:!0,get:function(){return f}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowShape,h=b.columnShape;function P(o){return o&&typeof o=="object"&&"id"in o?o.id:o}function m(o){return{setCell(i,l,y,n){const c=O(o,P(i));if(c===-1)return;const w=P(l);if(n){o.selection.extendRange(c,w);return}o.selection.startRange(c,w,{additive:!!y})},getCell(){const i=o.selection.cells();if(i.length)return{row:p(o,i[0].key),column:h(o,i[0].colId)}},getCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},isSelectedCell(i,l){const y=O(o,P(i));return y===-1?!1:o.selection.inRange(y,P(l))},removeCell(){o.selection.clearRange()},enable(){},disable(){o.selection.clearRange()}}}function u(o,i){const l=Math.min(o.start.row,o.end.row),y=Math.max(o.start.row,o.end.row),n=i.columns.visible().map(I=>I.id),c=n.indexOf(o.start.column),w=n.indexOf(o.end.column),N=Math.min(c,w),S=Math.max(c,w),R=N===-1||S===-1?[o.start.column]:n.slice(N,S+1);return{startRow:l,endRow:y,columns:R}}function a(o){return{start:{row:o.startRow,column:o.columns[0]},end:{row:o.endRow,column:o.columns[o.columns.length-1]}}}function f(o){return{setRange(i){o.selection.setRange(u(i,o))},getRange(){const i=o.selection.ranges();if(i.length)return a(i[i.length-1])},getRangedCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},resetRange(){o.selection.clearRange()},isRanged(){return o.selection.ranges().length>0},enable(){},disable(){o.selection.clearRange()},isDisabled(){return!1}}}}),C("packages/modules/dhtmlx-compat/passthrough.js",function(s,g){"use strict";Object.defineProperty(s,"createHistory",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"createExport",{enumerable:!0,get:function(){return O}});function b(p){return{undo(){return p.history.undo()},redo(){return p.history.redo()},canUndo(){return p.history.canUndo()},canRedo(){return p.history.canRedo()},clear(){p.history.clear()},removeAll(){p.history.clear()},getHistory(){return p.history.list()}}}function O(p){return{csv(h){return p.export.csv(h)},xlsx(h){return p.export.excel(h)},pdf(){throw new Error("dhtmlx-compat: export.pdf() is not supported: Lattice has no PDF export. export.csv()/export.xlsx() work, or use the browser's own print-to-PDF via grid.export.print().")},png(){throw new Error("dhtmlx-compat: export.png() is not supported: Lattice has no raster export.")}}}}),C("packages/modules/dhtmlx-compat/events.js",function(s,g){"use strict";Object.defineProperty(s,"createEvents",{enumerable:!0,get:function(){return o}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.rowShape,p=b.columnShape;function h(i,l){return[O(l,i.key),p(l,i.colId),i.event]}function P(i,l){const y=i.column&&i.column.edit?i.column.edit.editor:void 0;return[O(l,i.key),p(l,i.colId),y]}function m(i,l){return[i.value,O(l,i.key),p(l,i.colId)]}function u(i,l){const y=i.sort&&i.sort[0];return y?[p(l,y.col),y.dir]:null}function a(i,l){let y,n;if(i.key!==void 0)y=[i.key],n=i.to;else{const w=l.get("rowKey");y=(Array.isArray(i.data)?i.data:[i.data]).map(S=>S&&S[w]),n=i.at}const c=n!==void 0?l.rows.get(n):void 0;return[{start:y[0],source:y,target:c?c.key:void 0},void 0]}const f=Object.freeze({cellClick:{latticeNames:["cell:clicked"],reshape:h},cellDblClick:{latticeNames:["cell:dblclicked"],reshape:h},cellRightClick:{latticeNames:["cell:contextmenu"],reshape:h},afterEditStart:{latticeNames:["cell:edit:start"],reshape:P},afterEditEnd:{latticeNames:["cell:changed"],reshape:m},afterSort:{latticeNames:["sort:changed"],reshape:u},filterChange:{latticeNames:["filter:changed"]},afterColumnDrop:{latticeNames:["column:moved"]},afterResizeEnd:{latticeNames:["column:resized"]},resize:{latticeNames:["column:resized"]},afterColumnHide:{latticeNames:["column:visible"]},afterColumnShow:{latticeNames:["column:visible"]},afterExpand:{latticeNames:["group:toggled"]},afterCollapse:{latticeNames:["group:toggled"]},afterSelect:{latticeNames:["range:changed"]},afterUnSelect:{latticeNames:["range:changed"]},afterSetRange:{latticeNames:["range:changed"]},afterResetRange:{latticeNames:["range:changed"]},afterAdd:{latticeNames:["history:changed"]},afterUndo:{latticeNames:["history:applied"]},afterRedo:{latticeNames:["history:applied"]},afterCopy:{latticeNames:["clipboard:copy"]},scroll:{latticeNames:["scroll"]},afterRowDrop:{latticeNames:["row:moved","row:received"],reshape:a}});function o(i){const l=new Set;return{on(y,n){const c=f[y];if(!c)return l.has(y)||(l.add(y),console.warn(`dhtmlx-compat: "${y}" has no Lattice equivalent and will never fire.`)),()=>{};const w=c.latticeNames.map(N=>i.on(N,S=>{if(!c.reshape){n(S);return}const R=c.reshape(S,i);R&&n(...R)}));return()=>{for(const N of w)N()}}}}}),C("packages/modules/dhtmlx-compat/rows.js",function(s,g){"use strict";Object.defineProperty(s,"createRowVisibility",{enumerable:!0,get:function(){return b}});function b(O){const p=new Set,h={active:()=>p.size>0,passes:u=>!(u&&p.has(String(u.key)))};let P=!1;function m(){P||(P=!0),O.set("hostFilter",h)}return{hideRow(u){const a=String(u);p.has(a)||(p.add(a),m())},showRow(u){const a=String(u);p.delete(a)&&m()},isRowHidden(u){return p.has(String(u))},hiddenRows(){return[...p]}}}}),C("packages/modules/dhtmlx-compat/spans.js",function(s,g){"use strict";Object.defineProperty(s,"createSpans",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce,p=new Set(["row","column","rowspan","colspan"]);function h(a,f){return`${String(a)}|${String(f)}`}function P(a,f,o,i){if(a&&typeof a=="object"){for(const l of Object.keys(a))p.has(l)||O(`dhtmlx.span.dropped:${l}`,`dhtmlx-compat does not translate the span key '${l}', so it has no effect. Lattice spans carry only geometry (rowspan/colspan); the cell's value, css and tooltip come from its own column, not the span.`);return{row:a.row,column:a.column,rows:Math.max(1,Math.floor(Number(a.rowspan)||1)),cols:Math.max(1,Math.floor(Number(a.colspan)||1))}}return{row:a,column:f,rows:Math.max(1,Math.floor(Number(o)||1)),cols:Math.max(1,Math.floor(Number(i)||1))}}function m(a,f){return a.map(o=>({...o,cell:{...o.cell||{},spanColumns:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.cols:1},spanRows:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.rows:1}}}))}function u(a){const f=new Map;let o=!1;function i(){const l=o?a.get("columns"):m(a.get("columns"),f);o=!0,a.set("columns",l)}return{addSpan(l,y,n,c){const w=P(l,y,n,c);if(w.row===void 0||w.column===void 0)throw new TypeError("dhtmlx-compat: addSpan needs a row and a column.");if(w.rows<=1&&w.cols<=1){this.removeSpan(w.row,w.column);return}f.set(h(w.row,w.column),{rows:w.rows,cols:w.cols}),i()},removeSpan(l,y){f.delete(h(l,y))&&i()},getSpan(l,y){const n=f.get(h(l,y));if(n)return{rowspan:n.rows,colspan:n.cols}},spanCount(){return f.size}}}}),C("packages/modules/dhtmlx-compat/index.js",function(s,g){"use strict";Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return D}});const O=Y("@toclocoinc/lattice-grid").createGrid;if(typeof O>"u")throw new Error("[lattice] dhtmlx-compat needs createGrid from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const h=g("packages/modules/dhtmlx-compat/columns.js").translateColumns,m=g("packages/modules/dhtmlx-compat/data.js").createData,u=g("packages/modules/dhtmlx-compat/selection.js"),a=u.createSelection,f=u.createRangeSelection,o=g("packages/modules/dhtmlx-compat/passthrough.js"),i=o.createHistory,l=o.createExport,n=g("packages/modules/dhtmlx-compat/events.js").createEvents,w=g("packages/modules/dhtmlx-compat/rows.js").createRowVisibility,S=g("packages/modules/dhtmlx-compat/spans.js").createSpans,R=g("packages/modules/dhtmlx-compat/util.js"),I=R.rowsFrom,$=R.reportUntranslated,K=new Set(["rowKey","columns","data","autoHeight","rowHeight","headerRowHeight","multiselection","dragItem","rowTransfer"]);function H(x){$(x,K,"config");const j={rowKey:x.rowKey||"id"};return x.columns!==void 0&&(j.columns=h(x.columns)),x.data!==void 0&&(j.rows=I(x.data)),x.autoHeight!==void 0&&(j.autoHeight=x.autoHeight),x.rowHeight!==void 0&&(j.rowHeight=x.rowHeight),x.headerRowHeight!==void 0&&(j.headerHeight=x.headerRowHeight),x.multiselection&&(j.selection="multiple"),x.dragItem==="row"&&(j.rowReorder=!0),x.rowTransfer!==void 0&&(j.rowTransfer=x.rowTransfer),j}class L{#e;#t;#n;constructor(j,v={}){this.#e=O(j,H(v)),this.data=m(this.#e),this.selection=a(this.#e),this.rangeSelection=f(this.#e),this.history=i(this.#e),this.export=l(this.#e),this.events=n(this.#e),this.#t=w(this.#e),this.#n=S(this.#e)}get lattice(){return this.#e}hideRow(j){this.#t.hideRow(j)}showRow(j){this.#t.showRow(j)}isRowHidden(j){return this.#t.isRowHidden(j)}addSpan(j,v,G,U){this.#n.addSpan(j,v,G,U)}removeSpan(j,v){this.#n.removeSpan(j,v)}getSpan(j,v){return this.#n.getSpan(j,v)}setColumns(j){if(j===void 0)return this.#e.get("columns");this.#e.set("columns",h(j))}destructor(){this.#e.destroy()}}const D=L});var M=J("packages/modules/dhtmlx-compat/index.js");if(typeof module=="object"&&module.exports)module.exports=M;else if(typeof define=="function"&&define.amd)define(function(){return M});else{var ne=F.LatticeGrid||(F.LatticeGrid={});for(var z in M)z!=="default"&&(ne[z]=M[z])}})(typeof globalThis<"u"?globalThis:this);
|
|
6
|
+
(function(F){"use strict";var B=Object.create(null),q=Object.create(null);function C(s,g){B[s]=g}function J(s){var g=q[s];if(g)return g;var b=Object.create(null);q[s]=b;var O=B[s];if(!O)throw new Error("[lattice] missing module: "+s);return O(b,J),b}var Z=Object.create(null);Z["@toclocoinc/lattice-grid"]=F.LatticeGrid||null;function Y(s){var g=Z[s],b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(g)return g;if(s==="@toclocoinc/lattice-grid"&&b&&b.LatticeGrid)return b.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+s)}C("packages/core/src/internal/util.js",function(s,g){"use strict";Object.defineProperty(s,"VERSION",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"reportedWarnings",{enumerable:!0,get:function(){return i}}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"infoOnce",{enumerable:!0,get:function(){return y}}),Object.defineProperty(s,"resetWarnings",{enumerable:!0,get:function(){return n}}),Object.defineProperty(s,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(s,"invariant",{enumerable:!0,get:function(){return w}}),Object.defineProperty(s,"DEV",{enumerable:!0,get:function(){return N}}),Object.defineProperty(s,"isObject",{enumerable:!0,get:function(){return S}}),Object.defineProperty(s,"isFunction",{enumerable:!0,get:function(){return R}}),Object.defineProperty(s,"isNil",{enumerable:!0,get:function(){return I}}),Object.defineProperty(s,"isBlank",{enumerable:!0,get:function(){return $}}),Object.defineProperty(s,"isCtor",{enumerable:!0,get:function(){return K}}),Object.defineProperty(s,"pathGetter",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(s,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(s,"setPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(s,"humanise",{enumerable:!0,get:function(){return G}}),Object.defineProperty(s,"escapeHtml",{enumerable:!0,get:function(){return re}}),Object.defineProperty(s,"titleCase",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(s,"expand",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(s,"toArray",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(s,"merge",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(s,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(s,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(s,"collator",{enumerable:!0,get:function(){return le}}),Object.defineProperty(s,"defaultCompare",{enumerable:!0,get:function(){return de}}),Object.defineProperty(s,"now",{enumerable:!0,get:function(){return _}}),Object.defineProperty(s,"nextFrame",{enumerable:!0,get:function(){return te}}),Object.defineProperty(s,"cancelFrame",{enumerable:!0,get:function(){return W}}),Object.defineProperty(s,"frameBatched",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(s,"settleDebounce",{enumerable:!0,get:function(){return me}}),Object.defineProperty(s,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(s,"uid",{enumerable:!0,get:function(){return ye}});const b="1.71.3";async function O(){return b}const p="1.71.3",h=new Set,P=2e3;function m(e){if(h.add(e),h.size>P){const t=h.values().next().value;t!==void 0&&h.delete(t)}}const u=[],a=500;function f(e,t,r){u.push({key:e,level:t,message:r.map(d=>typeof d=="string"?d:o(d)).join(" "),at:Date.now()}),u.length>a&&u.shift()}function o(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(){return u.map(e=>({...e}))}function l(e,...t){h.has(e)||(m(e),f(e,"warn",t),console.warn("[lattice]",...t))}function y(e,...t){h.has(e)||(m(e),f(e,"info",t),console.info("[lattice]",...t))}function n(){h.clear(),u.length=0}function c(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function w(e,t){e||c(t)}const N=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function R(e){return typeof e=="function"}function I(e){return e==null}function $(e){return e==null||e===""}function K(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const H=new Map;function L(e){let t=H.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),d=r.length;t=k=>{let A=k;for(let E=0;E<d;E++){if(A==null)return;A=A[r[E]]}return A}}return H.set(e,t),t}const D=new Map;function x(e){let t=D.get(e);if(t)return t;if(!e.includes("."))t=(r,d)=>{r!=null&&(r[e]=d)};else{const r=e.split("."),d=r.length-1;t=(k,A)=>{let E=k;for(let T=0;T<d;T++){if(E==null)return;const V=r[T];E[V]==null&&(E[V]={}),E=E[V]}E!=null&&(E[r[d]]=A)}}return D.set(e,t),t}function j(e,t){return L(t)(e)}function v(e,t,r){x(t)(e,r)}function G(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const U={"&":"&","<":"<",">":">",'"':""","'":"'"};function re(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>U[r]):t}function oe(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ie(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:S(e)?e:{[t]:e,enabled:!0}}function ae(e){return e==null?[]:Array.isArray(e)?e:[e]}const se=Object.freeze(new Set(["__proto__","constructor","prototype"]));function Q(e,t){if(!S(e))return S(t)?{...t}:t;if(!S(t))return t===void 0?e:t;const r={...e};for(const d of Object.keys(t)){if(se.has(d))continue;const k=t[d];k!==void 0&&(r[d]=S(k)&&S(r[d])?Q(r[d],k):k)}return r}function ue(e,t){if(!S(e)||!S(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class ce{#e;#t=new Map;#n;constructor(t=256,r=null){this.#e=t,this.#n=r}get size(){return this.#t.size}get max(){return this.#e}set max(t){this.#e=t,this.#r()}has(t){return this.#t.has(t)}get(t){const r=this.#t;if(!r.has(t))return;const d=r.get(t);return r.delete(t),r.set(t,d),d}peek(t){return this.#t.get(t)}set(t,r){const d=this.#t;return d.has(t)&&d.delete(t),d.set(t,r),this.#r(),r}delete(t){const r=this.#t.get(t);return this.#t.delete(t)&&this.#n&&this.#n(r,t),r}clear(){if(this.#n)for(const[t,r]of this.#t)this.#n(r,t);this.#t.clear()}keys(){return this.#t.keys()}values(){return this.#t.values()}#r(){const t=this.#t;for(;t.size>this.#e;){const r=t.keys().next().value,d=t.get(r);t.delete(r),this.#n&&this.#n(d,r)}}}const X=new Map;function le(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let d=X.get(r);return d||(d=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),X.set(r,d)),d}function de(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),d=String(t);return r<d?-1:r>d?1:0}function _(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ee=typeof requestAnimationFrame=="function";function te(e){return ee?requestAnimationFrame(e):setTimeout(()=>e(_()),16)}function W(e){e!=null&&(ee?cancelAnimationFrame(e):clearTimeout(e))}function fe(e){let t=null,r=null;const d=()=>{t=null;const A=r;r=null,e(...A||[])},k=(...A)=>{r=A,t===null&&(t=te(d))};return k.cancel=()=>{W(t),t=null,r=null},k.flush=()=>{t!==null&&(W(t),d())},k}function me(e,t){let r=null,d=null;const k=()=>{if(r=null,d===null)return;const T=d;d=null,e(...T),A()},A=()=>{r=setTimeout(k,t),typeof r?.unref=="function"&&r.unref()},E=(...T)=>{r===null?(e(...T),A()):(d=T,clearTimeout(r),A())};return E.flush=()=>{if(r!==null&&clearTimeout(r),r=null,d===null)return;const T=d;d=null,e(...T)},E.cancel=()=>{r!==null&&clearTimeout(r),r=null,d=null},E.pending=()=>r!==null||d!==null,E}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let he=0;function ye(e="l"){return`${e}${(++he).toString(36)}`}}),C("packages/modules/dhtmlx-compat/util.js",function(s,g){"use strict";Object.defineProperty(s,"reportUntranslated",{enumerable:!0,get:function(){return p}}),Object.defineProperty(s,"indexOfKey",{enumerable:!0,get:function(){return h}}),Object.defineProperty(s,"rowsFrom",{enumerable:!0,get:function(){return P}}),Object.defineProperty(s,"rowShape",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"columnShape",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce;function p(a,f,o){if(!(!a||typeof a!="object"))for(const i of Object.keys(a))f.has(i)||O(`dhtmlx.${o}.dropped:${i}`,`dhtmlx-compat does not translate the ${o} key '${i}', so it has no effect. Nothing was applied for it.`)}function h(a,f){const o=a.rows.count();for(let i=0;i<o;i++){const l=a.rows.get(i);if(l&&l.key===f)return i}return-1}function P(a){return Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.data)?a.data:[]}function m(a,f){const o=a.rows.byKey(f);return{...o?o.data:void 0,id:f}}function u(a,f){return{id:f}}}),C("packages/modules/dhtmlx-compat/columns.js",function(s,g){"use strict";Object.defineProperty(s,"translateColumn",{enumerable:!0,get:function(){return l}}),Object.defineProperty(s,"translateColumns",{enumerable:!0,get:function(){return y}});const O=g("packages/core/src/internal/util.js").warnOnce,h=Y("@toclocoinc/lattice-grid").sanitiseHtml;if(typeof h>"u")throw new Error("[lattice] dhtmlx-compat needs sanitiseHtml from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const m=g("packages/modules/dhtmlx-compat/util.js").reportUntranslated,u=new Set(["id","header","type","width","minWidth","maxWidth","resizable","hidden","draggable","align","tooltip","tooltipTemplate","template","htmlEnable","sortable","editable","editorType","editorConfig","options","summary"]),a=Object.freeze({input:"text",select:"select",combobox:"select",textarea:"textarea",multiselect:"multiSelect",datePicker:"date",checkbox:"checkbox"}),f=Object.freeze({number:"number",date:"date"});function o(n){if(typeof n=="string")return n;if(Array.isArray(n)&&n.length>0){n.length>1&&O("dhtmlx.header.multirow",`dhtmlx-compat collapsed a ${n.length}-row header to its first row. Lattice titles are a single string; the remaining rows were not applied.`);const c=n[0];if(typeof c=="string")return c;if(c&&typeof c=="object"&&typeof c.text=="string")return c.text}}function i(n,c){return(w,N)=>{const S={...N.data||{},id:N.row?N.row.key:void 0},R=n(N.value,S,{id:N.colId});c?w.innerHTML=h(String(R)):w.textContent=String(R)}}function l(n){if(!n||typeof n!="object"||!n.id)throw new TypeError("dhtmlx-compat: every column needs an id.");m(n,u,"column");const c={id:n.id,field:n.id},w=o(n.header);if(w!==void 0&&(c.title=w),n.type!==void 0){const R=f[n.type];R&&(c.type=R)}if((n.width!==void 0||n.minWidth!==void 0||n.maxWidth!==void 0||n.resizable!==void 0||n.hidden!==void 0||n.draggable!==void 0)&&(c.layout={},n.width!==void 0&&(c.layout.width=n.width),n.minWidth!==void 0&&(c.layout.min=n.minWidth),n.maxWidth!==void 0&&(c.layout.max=n.maxWidth),n.resizable!==void 0&&(c.layout.resizable=!!n.resizable),n.hidden!==void 0&&(c.layout.hidden=!!n.hidden),n.draggable!==void 0&&(c.layout.movable=!!n.draggable)),n.align!==void 0&&(c.cell={...c.cell||{},align:n.align}),(n.tooltipTemplate!==void 0||n.tooltip!==void 0)&&(c.cell={...c.cell||{},tooltip:n.tooltipTemplate||n.tooltip}),typeof n.template=="function"&&(c.cell={...c.cell||{},render:i(n.template,!!n.htmlEnable)}),n.sortable!==void 0&&(c.sort={enabled:!!n.sortable}),n.editable!==void 0||n.editorType!==void 0||n.editorConfig!==void 0||n.options!==void 0){if(c.edit={enabled:n.editable!==!1},n.editorType!==void 0){const R=a[n.editorType];R||O(`dhtmlx.editorType.unknown:${String(n.editorType)}`,`dhtmlx-compat does not recognise editorType '${String(n.editorType)}'; the default text editor was used instead.`),c.edit.editor=R||"text"}(n.editorConfig!==void 0||n.options!==void 0)&&(c.edit.props={...n.editorConfig||{}},n.options!==void 0&&(c.edit.props.options=n.options))}return n.summary!==void 0&&(c.total=n.summary),c}function y(n){return Array.isArray(n)?n.map(l):[]}}),C("packages/modules/dhtmlx-compat/data.js",function(s,g){"use strict";Object.defineProperty(s,"createData",{enumerable:!0,get:function(){return P}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowsFrom;function h(m){return m.get("rowKey")}function P(m){return{add(u,a){const f=a===void 0?{add:[u]}:{add:[u],at:a},o=m.rows.apply(f);if(o&&o.rejected&&o.rejected.length)throw new Error(`dhtmlx-compat: data.add() was rejected: ${JSON.stringify(o.rejected[0])}.`);return u[h(m)]},update(u,a){m.rows.apply({update:[{...a,[h(m)]:u}]})},remove(u){m.rows.apply({remove:Array.isArray(u)?u:[u]})},removeAll(){m.rows.load([])},parse(u){m.rows.load(p(u))},async load(u,a){const o=await(await fetch(u)).json();m.rows.load(p(o)),typeof a=="function"&&a()},find(u){const a=m.rows.byKey(u);return a?a.data:void 0},findAll(u){const a=[];return m.rows.forEachAll(f=>{u(f.data)&&a.push(f.data)}),a},exists(u){return m.rows.byKey(u)!==void 0&&m.rows.byKey(u)!==null},getItem(u){const a=m.rows.byKey(u);return a?a.data:void 0},serialize(){return m.rows.data()},getId(u){const a=m.rows.get(u);return a?a.key:void 0},getIndex(u){return O(m,u)},getLength(){return m.rows.count()},forEach(u){m.rows.forEach((a,f)=>u(a.data,f))},sort(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.sort(fn) is not supported: Lattice sorts by column, not a comparator. Pass a column id, or { by, dir }.");const a=Array.isArray(u)?u:[u];m.sort.set(a.map(f=>typeof f=="string"?{col:f,dir:"asc"}:{col:f.by,dir:f.dir||"asc"}))},filter(u){if(typeof u=="function")throw new TypeError("dhtmlx-compat: data.filter(fn) is not supported: Lattice filters are a declarative condition tree, not a predicate. Pass { col, op, value } instead.");m.filters.set(u)},resetFilter(){m.filters.clear()}}}}),C("packages/modules/dhtmlx-compat/selection.js",function(s,g){"use strict";Object.defineProperty(s,"createSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(s,"createRangeSelection",{enumerable:!0,get:function(){return f}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.indexOfKey,p=b.rowShape,h=b.columnShape;function P(o){return o&&typeof o=="object"&&"id"in o?o.id:o}function m(o){return{setCell(i,l,y,n){const c=O(o,P(i));if(c===-1)return;const w=P(l);if(n){o.selection.extendRange(c,w);return}o.selection.startRange(c,w,{additive:!!y})},getCell(){const i=o.selection.cells();if(i.length)return{row:p(o,i[0].key),column:h(o,i[0].colId)}},getCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},isSelectedCell(i,l){const y=O(o,P(i));return y===-1?!1:o.selection.inRange(y,P(l))},removeCell(){o.selection.clearRange()},enable(){},disable(){o.selection.clearRange()}}}function u(o,i){const l=Math.min(o.start.row,o.end.row),y=Math.max(o.start.row,o.end.row),n=i.columns.visible().map(I=>I.id),c=n.indexOf(o.start.column),w=n.indexOf(o.end.column),N=Math.min(c,w),S=Math.max(c,w),R=N===-1||S===-1?[o.start.column]:n.slice(N,S+1);return{startRow:l,endRow:y,columns:R}}function a(o){return{start:{row:o.startRow,column:o.columns[0]},end:{row:o.endRow,column:o.columns[o.columns.length-1]}}}function f(o){return{setRange(i){o.selection.setRange(u(i,o))},getRange(){const i=o.selection.ranges();if(i.length)return a(i[i.length-1])},getRangedCells(){return o.selection.cells().map(i=>({row:p(o,i.key),column:h(o,i.colId)}))},resetRange(){o.selection.clearRange()},isRanged(){return o.selection.ranges().length>0},enable(){},disable(){o.selection.clearRange()},isDisabled(){return!1}}}}),C("packages/modules/dhtmlx-compat/passthrough.js",function(s,g){"use strict";Object.defineProperty(s,"createHistory",{enumerable:!0,get:function(){return b}}),Object.defineProperty(s,"createExport",{enumerable:!0,get:function(){return O}});function b(p){return{undo(){return p.history.undo()},redo(){return p.history.redo()},canUndo(){return p.history.canUndo()},canRedo(){return p.history.canRedo()},clear(){p.history.clear()},removeAll(){p.history.clear()},getHistory(){return p.history.list()}}}function O(p){return{csv(h){return p.export.csv(h)},xlsx(h){return p.export.excel(h)},pdf(){throw new Error("dhtmlx-compat: export.pdf() is not supported: Lattice has no PDF export. export.csv()/export.xlsx() work, or use the browser's own print-to-PDF via grid.export.print().")},png(){throw new Error("dhtmlx-compat: export.png() is not supported: Lattice has no raster export.")}}}}),C("packages/modules/dhtmlx-compat/events.js",function(s,g){"use strict";Object.defineProperty(s,"createEvents",{enumerable:!0,get:function(){return o}});const b=g("packages/modules/dhtmlx-compat/util.js"),O=b.rowShape,p=b.columnShape;function h(i,l){return[O(l,i.key),p(l,i.colId),i.event]}function P(i,l){const y=i.column&&i.column.edit?i.column.edit.editor:void 0;return[O(l,i.key),p(l,i.colId),y]}function m(i,l){return[i.value,O(l,i.key),p(l,i.colId)]}function u(i,l){const y=i.sort&&i.sort[0];return y?[p(l,y.col),y.dir]:null}function a(i,l){let y,n;if(i.key!==void 0)y=[i.key],n=i.to;else{const w=l.get("rowKey");y=(Array.isArray(i.data)?i.data:[i.data]).map(S=>S&&S[w]),n=i.at}const c=n!==void 0?l.rows.get(n):void 0;return[{start:y[0],source:y,target:c?c.key:void 0},void 0]}const f=Object.freeze({cellClick:{latticeNames:["cell:clicked"],reshape:h},cellDblClick:{latticeNames:["cell:dblclicked"],reshape:h},cellRightClick:{latticeNames:["cell:contextmenu"],reshape:h},afterEditStart:{latticeNames:["cell:edit:start"],reshape:P},afterEditEnd:{latticeNames:["cell:changed"],reshape:m},afterSort:{latticeNames:["sort:changed"],reshape:u},filterChange:{latticeNames:["filter:changed"]},afterColumnDrop:{latticeNames:["column:moved"]},afterResizeEnd:{latticeNames:["column:resized"]},resize:{latticeNames:["column:resized"]},afterColumnHide:{latticeNames:["column:visible"]},afterColumnShow:{latticeNames:["column:visible"]},afterExpand:{latticeNames:["group:toggled"]},afterCollapse:{latticeNames:["group:toggled"]},afterSelect:{latticeNames:["range:changed"]},afterUnSelect:{latticeNames:["range:changed"]},afterSetRange:{latticeNames:["range:changed"]},afterResetRange:{latticeNames:["range:changed"]},afterAdd:{latticeNames:["history:changed"]},afterUndo:{latticeNames:["history:applied"]},afterRedo:{latticeNames:["history:applied"]},afterCopy:{latticeNames:["clipboard:copy"]},scroll:{latticeNames:["scroll"]},afterRowDrop:{latticeNames:["row:moved","row:received"],reshape:a}});function o(i){const l=new Set;return{on(y,n){const c=f[y];if(!c)return l.has(y)||(l.add(y),console.warn(`dhtmlx-compat: "${y}" has no Lattice equivalent and will never fire.`)),()=>{};const w=c.latticeNames.map(N=>i.on(N,S=>{if(!c.reshape){n(S);return}const R=c.reshape(S,i);R&&n(...R)}));return()=>{for(const N of w)N()}}}}}),C("packages/modules/dhtmlx-compat/rows.js",function(s,g){"use strict";Object.defineProperty(s,"createRowVisibility",{enumerable:!0,get:function(){return b}});function b(O){const p=new Set,h={active:()=>p.size>0,passes:u=>!(u&&p.has(String(u.key)))};let P=!1;function m(){P||(P=!0),O.set("hostFilter",h)}return{hideRow(u){const a=String(u);p.has(a)||(p.add(a),m())},showRow(u){const a=String(u);p.delete(a)&&m()},isRowHidden(u){return p.has(String(u))},hiddenRows(){return[...p]}}}}),C("packages/modules/dhtmlx-compat/spans.js",function(s,g){"use strict";Object.defineProperty(s,"createSpans",{enumerable:!0,get:function(){return u}});const O=g("packages/core/src/internal/util.js").warnOnce,p=new Set(["row","column","rowspan","colspan"]);function h(a,f){return`${String(a)}|${String(f)}`}function P(a,f,o,i){if(a&&typeof a=="object"){for(const l of Object.keys(a))p.has(l)||O(`dhtmlx.span.dropped:${l}`,`dhtmlx-compat does not translate the span key '${l}', so it has no effect. Lattice spans carry only geometry (rowspan/colspan); the cell's value, css and tooltip come from its own column, not the span.`);return{row:a.row,column:a.column,rows:Math.max(1,Math.floor(Number(a.rowspan)||1)),cols:Math.max(1,Math.floor(Number(a.colspan)||1))}}return{row:a,column:f,rows:Math.max(1,Math.floor(Number(o)||1)),cols:Math.max(1,Math.floor(Number(i)||1))}}function m(a,f){return a.map(o=>({...o,cell:{...o.cell||{},spanColumns:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.cols:1},spanRows:i=>{const l=f.get(h(i.row.key,i.colId));return l?l.rows:1}}}))}function u(a){const f=new Map;let o=!1;function i(){const l=o?a.get("columns"):m(a.get("columns"),f);o=!0,a.set("columns",l)}return{addSpan(l,y,n,c){const w=P(l,y,n,c);if(w.row===void 0||w.column===void 0)throw new TypeError("dhtmlx-compat: addSpan needs a row and a column.");if(w.rows<=1&&w.cols<=1){this.removeSpan(w.row,w.column);return}f.set(h(w.row,w.column),{rows:w.rows,cols:w.cols}),i()},removeSpan(l,y){f.delete(h(l,y))&&i()},getSpan(l,y){const n=f.get(h(l,y));if(n)return{rowspan:n.rows,colspan:n.cols}},spanCount(){return f.size}}}}),C("packages/modules/dhtmlx-compat/index.js",function(s,g){"use strict";Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return D}});const O=Y("@toclocoinc/lattice-grid").createGrid;if(typeof O>"u")throw new Error("[lattice] dhtmlx-compat needs createGrid from the lattice-grid module. Load lattice-grid before dhtmlx-compat.");const h=g("packages/modules/dhtmlx-compat/columns.js").translateColumns,m=g("packages/modules/dhtmlx-compat/data.js").createData,u=g("packages/modules/dhtmlx-compat/selection.js"),a=u.createSelection,f=u.createRangeSelection,o=g("packages/modules/dhtmlx-compat/passthrough.js"),i=o.createHistory,l=o.createExport,n=g("packages/modules/dhtmlx-compat/events.js").createEvents,w=g("packages/modules/dhtmlx-compat/rows.js").createRowVisibility,S=g("packages/modules/dhtmlx-compat/spans.js").createSpans,R=g("packages/modules/dhtmlx-compat/util.js"),I=R.rowsFrom,$=R.reportUntranslated,K=new Set(["rowKey","columns","data","autoHeight","rowHeight","headerRowHeight","multiselection","dragItem","rowTransfer"]);function H(x){$(x,K,"config");const j={rowKey:x.rowKey||"id"};return x.columns!==void 0&&(j.columns=h(x.columns)),x.data!==void 0&&(j.rows=I(x.data)),x.autoHeight!==void 0&&(j.autoHeight=x.autoHeight),x.rowHeight!==void 0&&(j.rowHeight=x.rowHeight),x.headerRowHeight!==void 0&&(j.headerHeight=x.headerRowHeight),x.multiselection&&(j.selection="multiple"),x.dragItem==="row"&&(j.rowReorder=!0),x.rowTransfer!==void 0&&(j.rowTransfer=x.rowTransfer),j}class L{#e;#t;#n;constructor(j,v={}){this.#e=O(j,H(v)),this.data=m(this.#e),this.selection=a(this.#e),this.rangeSelection=f(this.#e),this.history=i(this.#e),this.export=l(this.#e),this.events=n(this.#e),this.#t=w(this.#e),this.#n=S(this.#e)}get lattice(){return this.#e}hideRow(j){this.#t.hideRow(j)}showRow(j){this.#t.showRow(j)}isRowHidden(j){return this.#t.isRowHidden(j)}addSpan(j,v,G,U){this.#n.addSpan(j,v,G,U)}removeSpan(j,v){this.#n.removeSpan(j,v)}getSpan(j,v){return this.#n.getSpan(j,v)}setColumns(j){if(j===void 0)return this.#e.get("columns");this.#e.set("columns",h(j))}destructor(){this.#e.destroy()}}const D=L});var M=J("packages/modules/dhtmlx-compat/index.js");if(typeof module=="object"&&module.exports)module.exports=M;else if(typeof define=="function"&&define.amd)define(function(){return M});else{var ne=F.LatticeGrid||(F.LatticeGrid={});for(var z in M)z!=="default"&&(ne[z]=M[z])}})(typeof globalThis<"u"?globalThis:this);
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=dhtmlx-compat.min.js.map
|
package/modules/gantt.d.ts
CHANGED