@toclocoinc/lattice-grid 1.89.0 → 1.89.1
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 +15 -0
- package/README.md +1 -1
- package/angular/package.json +1 -1
- package/docs/API.html +5 -5
- package/docs/THEMING.md +27 -0
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/calendar.html +1 -1
- package/docs/api/charts.html +1 -1
- package/docs/api/dashboard.html +1 -1
- package/docs/api/data-router.html +1 -1
- package/docs/api/deckgl.html +1 -1
- package/docs/api/designer.html +2 -2
- package/docs/api/gantt.html +1 -1
- package/docs/api/geometry.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +1 -1
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/leaflet.html +1 -1
- package/docs/api/list.html +1 -1
- package/docs/api/mapview.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/presets.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 +1 -1
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +3 -3
- package/lattice-grid.min.cjs +3 -3
- package/lattice-grid.min.css +1 -1
- 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/calendar.d.ts +1 -1
- package/modules/calendar.esm.min.js +2 -2
- package/modules/calendar.min.cjs +2 -2
- package/modules/calendar.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-barrace.d.ts +1 -1
- package/modules/chart-barrace.esm.min.js +1 -1
- package/modules/chart-barrace.min.cjs +1 -1
- package/modules/chart-barrace.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-choropleth.d.ts +1 -1
- package/modules/chart-choropleth.esm.min.js +1 -1
- package/modules/chart-choropleth.min.cjs +1 -1
- package/modules/chart-choropleth.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-forcetree.d.ts +1 -1
- package/modules/chart-forcetree.esm.min.js +1 -1
- package/modules/chart-forcetree.min.cjs +1 -1
- package/modules/chart-forcetree.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-motion.d.ts +1 -1
- package/modules/chart-motion.esm.min.js +1 -1
- package/modules/chart-motion.min.cjs +1 -1
- package/modules/chart-motion.min.js +1 -1
- package/modules/chart-pack.d.ts +1 -1
- package/modules/chart-pack.esm.min.js +1 -1
- package/modules/chart-pack.min.cjs +1 -1
- package/modules/chart-pack.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-pictorial.d.ts +1 -1
- package/modules/chart-pictorial.esm.min.js +1 -1
- package/modules/chart-pictorial.min.cjs +1 -1
- package/modules/chart-pictorial.min.js +1 -1
- package/modules/chart-polararea.d.ts +1 -1
- package/modules/chart-polararea.esm.min.js +1 -1
- package/modules/chart-polararea.min.cjs +1 -1
- package/modules/chart-polararea.min.js +1 -1
- package/modules/chart-polarscatter.d.ts +1 -1
- package/modules/chart-polarscatter.esm.min.js +1 -1
- package/modules/chart-polarscatter.min.cjs +1 -1
- package/modules/chart-polarscatter.min.js +1 -1
- package/modules/chart-pyramid.d.ts +1 -1
- package/modules/chart-pyramid.esm.min.js +1 -1
- package/modules/chart-pyramid.min.cjs +1 -1
- package/modules/chart-pyramid.min.js +1 -1
- package/modules/chart-radialbar.d.ts +1 -1
- package/modules/chart-radialbar.esm.min.js +1 -1
- package/modules/chart-radialbar.min.cjs +1 -1
- package/modules/chart-radialbar.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-serpentine.d.ts +1 -1
- package/modules/chart-serpentine.esm.min.js +1 -1
- package/modules/chart-serpentine.min.cjs +1 -1
- package/modules/chart-serpentine.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-spiral.d.ts +1 -1
- package/modules/chart-spiral.esm.min.js +1 -1
- package/modules/chart-spiral.min.cjs +1 -1
- package/modules/chart-spiral.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-tree.d.ts +1 -1
- package/modules/chart-tree.esm.min.js +1 -1
- package/modules/chart-tree.min.cjs +1 -1
- package/modules/chart-tree.min.js +1 -1
- package/modules/chart-venn.d.ts +1 -1
- package/modules/chart-venn.esm.min.js +1 -1
- package/modules/chart-venn.min.cjs +1 -1
- package/modules/chart-venn.min.js +1 -1
- package/modules/chart-voronoi.d.ts +1 -1
- package/modules/chart-voronoi.esm.min.js +1 -1
- package/modules/chart-voronoi.min.cjs +1 -1
- package/modules/chart-voronoi.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/chart-wordcloud.d.ts +1 -1
- package/modules/chart-wordcloud.esm.min.js +1 -1
- package/modules/chart-wordcloud.min.cjs +1 -1
- package/modules/chart-wordcloud.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +2 -2
- package/modules/charts.min.cjs +2 -2
- package/modules/charts.min.js +2 -2
- package/modules/dashboard.d.ts +1 -1
- package/modules/dashboard.esm.min.js +2 -2
- package/modules/dashboard.min.cjs +2 -2
- package/modules/dashboard.min.js +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/deckgl.d.ts +1 -1
- package/modules/deckgl.esm.min.js +2 -2
- package/modules/deckgl.min.cjs +2 -2
- package/modules/deckgl.min.js +2 -2
- package/modules/designer.d.ts +1 -1
- package/modules/designer.esm.min.js +187 -73
- package/modules/designer.esm.min.js.map +2 -2
- package/modules/designer.min.cjs +187 -73
- package/modules/designer.min.js +187 -73
- package/modules/designer.min.js.map +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 +1 -1
- package/modules/geo-europe-nuts.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +1 -1
- package/modules/geo-uk.min.js +1 -1
- 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 +1 -1
- package/modules/geo-us-states.min.js +1 -1
- 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 +1 -1
- package/modules/geo-world-110m.min.js +1 -1
- 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 +1 -1
- package/modules/geo-world-50m.min.js +1 -1
- package/modules/geometry.d.ts +1 -1
- package/modules/geometry.esm.min.js +2 -2
- package/modules/geometry.min.cjs +2 -2
- package/modules/geometry.min.js +2 -2
- 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/leaflet.d.ts +1 -1
- package/modules/leaflet.esm.min.js +2 -2
- package/modules/leaflet.min.cjs +2 -2
- package/modules/leaflet.min.js +2 -2
- package/modules/list.d.ts +1 -1
- package/modules/list.esm.min.js +2 -2
- package/modules/list.min.cjs +2 -2
- package/modules/list.min.js +2 -2
- package/modules/mapview.d.ts +1 -1
- package/modules/mapview.esm.min.js +2 -2
- package/modules/mapview.min.cjs +2 -2
- package/modules/mapview.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/presets/antd5.css +9 -0
- package/modules/presets/bootstrap5.css +9 -0
- package/modules/presets/fluent2.css +9 -0
- package/modules/presets/material3.css +9 -0
- package/modules/presets.d.ts +1 -1
- package/modules/presets.esm.min.js +2 -2
- package/modules/presets.min.cjs +2 -2
- package/modules/presets.min.js +2 -2
- 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
package/modules/list.esm.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, list 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 ne=Object.create(null),re=Object.create(null);function U(o,P){ne[o]=P}function ie(o){var P=re[o];if(P)return P;var E=Object.create(null);re[o]=E;var y=ne[o];if(!y)throw new Error("[lattice] missing module: "+o);return y(E,ie),E}var se=Object.create(null);se["@toclocoinc/lattice-grid"]=pe;function Z(o){var P=se[o],E=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(P)return P;if(o==="@toclocoinc/lattice-grid"&&E&&E.LatticeGrid)return E.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: "+o)}U("packages/core/src/internal/util.js",function(o,P){"use strict";Object.defineProperty(o,"VERSION",{enumerable:!0,get:function(){return w}}),Object.defineProperty(o,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"warnOnce",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"infoOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"resetWarnings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"invariant",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"DEV",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"isFunction",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"isNil",{enumerable:!0,get:function(){return b}}),Object.defineProperty(o,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"isCtor",{enumerable:!0,get:function(){return T}}),Object.defineProperty(o,"pathGetter",{enumerable:!0,get:function(){return W}}),Object.defineProperty(o,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"getPath",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"setPath",{enumerable:!0,get:function(){return H}}),Object.defineProperty(o,"humanise",{enumerable:!0,get:function(){return n}}),Object.defineProperty(o,"escapeHtml",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"titleCase",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"expand",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"toArray",{enumerable:!0,get:function(){return k}}),Object.defineProperty(o,"merge",{enumerable:!0,get:function(){return V}}),Object.defineProperty(o,"mergeRow",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"Lru",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(o,"collator",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"defaultCompare",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(o,"now",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"nextFrame",{enumerable:!0,get:function(){return te}}),Object.defineProperty(o,"cancelFrame",{enumerable:!0,get:function(){return K}}),Object.defineProperty(o,"frameBatched",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(o,"settleDebounce",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(o,"whenIdle",{enumerable:!0,get:function(){return me}}),Object.defineProperty(o,"uid",{enumerable:!0,get:function(){return he}});const E="1.89.0";async function y(){return E}const w="1.89.0",O=new Set,C=2e3;function N(e){if(O.add(e),O.size>C){const t=O.values().next().value;t!==void 0&&O.delete(t)}}const L=[],S=500;function B(e,t,i){L.push({key:e,level:t,message:i.map(a=>typeof a=="string"?a:R(a)).join(" "),at:Date.now()}),L.length>S&&L.shift()}function R(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function v(){return L.map(e=>({...e}))}function F(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function p(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"warn",i),console.warn("[lattice]",...i)}function c(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"info",i),console.info("[lattice]",...i)}function h(){O.clear(),L.length=0}function f(e,t){const i=new Error(`[lattice] ${e}`);throw t!==void 0&&(i.cause=t),i}function j(e,t){e||f(t)}const s=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function d(e){return typeof e=="function"}function b(e){return e==null}function A(e){return e==null||e===""}function T(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function W(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=i=>i?.[e];else{const i=e.split("."),a=i.length;t=M=>{let z=M;for(let q=0;q<a;q++){if(z==null)return;z=z[i[q]]}return z}}return I.set(e,t),t}const G=new Map;function x(e){let t=G.get(e);if(t)return t;if(!e.includes("."))t=(i,a)=>{i!=null&&(i[e]=a)};else{const i=e.split("."),a=i.length-1;t=(M,z)=>{let q=M;for(let $=0;$<a;$++){if(q==null)return;const _=i[$];q[_]==null&&(q[_]={}),q=q[_]}q!=null&&(q[i[a]]=z)}}return G.set(e,t),t}function Y(e,t){return W(t)(e)}function H(e,t,i){x(t)(e,i)}function n(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(/^./,i=>i.toUpperCase()):""}const r={"&":"&","<":"<",">":">",'"':""","'":"'"};function l(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,i=>r[i]):t}function m(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function g(e,t,i){if(e!==void 0)return e===!0?{enabled:!0,...i}:e===!1?{enabled:!1}:u(e)?e:{[t]:e,enabled:!0}}function k(e){return e==null?[]:Array.isArray(e)?e:[e]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function V(e,t){if(!u(e))return u(t)?{...t}:t;if(!u(t))return t===void 0?e:t;const i={...e};for(const a of Object.keys(t)){if(D.has(a))continue;const M=t[a];M!==void 0&&(i[a]=u(M)&&u(i[a])?V(i[a],M):M)}return i}function J(e,t){if(!u(e)||!u(t)||e===t)return t;const i=Object.create(Object.getPrototypeOf(e));return Object.assign(i,e,t),i}class ue{#n;#e=new Map;#t;constructor(t=256,i=null){this.#n=t,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const i=this.#e;if(!i.has(t))return;const a=i.get(t);return i.delete(t),i.set(t,a),a}peek(t){return this.#e.get(t)}set(t,i){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,i),this.#r(),i}delete(t){const i=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(i,t),i}clear(){if(this.#t)for(const[t,i]of this.#e)this.#t(i,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const i=t.keys().next().value,a=t.get(i);t.delete(i),this.#t&&this.#t(a,i)}}}const X=new Map;function le(e,t){const i=`${e||""}|${t?JSON.stringify(t):""}`;let a=X.get(i);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),X.set(i,a)),a}function ae(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 i=String(e),a=String(t);return i<a?-1:i>a?1:0}function Q(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ee=typeof requestAnimationFrame=="function";function te(e){return ee?requestAnimationFrame(e):setTimeout(()=>e(Q()),16)}function K(e){e!=null&&(ee?cancelAnimationFrame(e):clearTimeout(e))}function ce(e){let t=null,i=null;const a=()=>{t=null;const z=i;i=null,e(...z||[])},M=(...z)=>{i=z,t===null&&(t=te(a))};return M.cancel=()=>{K(t),t=null,i=null},M.flush=()=>{t!==null&&(K(t),a())},M}function fe(e,t){let i=null,a=null;const M=()=>{if(i=null,a===null)return;const $=a;a=null,e(...$),z()},z=()=>{i=setTimeout(M,t),typeof i?.unref=="function"&&i.unref()},q=(...$)=>{i===null?(e(...$),z()):(a=$,clearTimeout(i),z())};return q.flush=()=>{if(i!==null&&clearTimeout(i),i=null,a===null)return;const $=a;a=null,e(...$)},q.cancel=()=>{i!==null&&clearTimeout(i),i=null,a=null},q.pending=()=>i!==null||a!==null,q}function me(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let de=0;function he(e="l"){return`${e}${(++de).toString(36)}`}}),U("packages/modules/list/type.js",function(o,P){"use strict";Object.defineProperty(o,"LIST_OPERATORS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(o,"COUNT_COMPARISONS",{enumerable:!0,get:function(){return N}}),Object.defineProperty(o,"DEFAULT_JOINER",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"itemsOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(o,"joinerOf",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"storeList",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"itemText",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"formatList",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"listText",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"parseList",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"splitItems",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"parseItem",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"compareListFor",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"LIST_OPERATOR_SPECS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"createListType",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"familyOf",{enumerable:!0,get:function(){return H}});const E=P("packages/core/src/internal/util.js"),y=E.isNil,w=E.isFunction,O=E.warnOnce,C=Object.freeze(["hasAny","hasAll","hasNone","listCount"]),N=Object.freeze(["gt","gte","lt","lte","eq"]),L=", ";function S(n){if(y(n))return[];if(Array.isArray(n))return n;if(typeof n=="object"&&!ArrayBuffer.isView(n)){const r=n;if(w(r.toArray))return Array.from(r.toArray());if(w(r[Symbol.iterator]))return Array.from(r)}return[n]}function B(n){if(Array.isArray(n))return!0;if(!n||typeof n!="object"||ArrayBuffer.isView(n))return!1;const r=n;return w(r.toArray)||w(r[Symbol.iterator])}function R(n){const r=n&&n.typeOptions,l=r&&r.joiner;return typeof l=="string"&&l!==""?l:L}function v(n,r,l){if(y(n))return null;let m=n;if(typeof n=="bigint"&&(m=n<=BigInt(Number.MAX_SAFE_INTEGER)&&n>=BigInt(Number.MIN_SAFE_INTEGER)?Number(n):String(n)),!r)return m;if(w(r.toStorage)?m=r.toStorage(m,l):r.base==="number"&&typeof m=="string"?m=w(r.parse)?r.parse({text:m,column:null}):Number(m):r.base==="boolean"&&typeof m=="string"&&w(r.parse)&&(m=r.parse({text:m,column:null})),!(typeof m=="number"&&Number.isNaN(m)))return y(m)?void 0:m}function F(n,r){if(y(n))return null;const l=r&&r.colId||"?",m=r&&r.itemType;B(n)||O(`list:scalar:${l}`,`column "${l}" is a list column and received a single value (${typeof n}) where a list was expected; it is read as a one-item list. The row itself is not changed: pass an array to say so.`);const g=[];for(const k of S(n)){const D=v(k,m,r);if(D===void 0){O(`list:item:${l}`,`column "${l}" refused the item ${JSON.stringify(String(k))}: it is not a value of the item type "${m&&m.name||"text"}". The item is left out of the stored list rather than kept.`);continue}g.push(D)}return g.length?g:null}function p(n,r){if(y(n))return"";const l=r&&r.column,m=l&&l.itemType;return m&&w(m.format)?String(m.format({...r,value:n})??""):String(n)}function c(n,r){if(y(n))return"";const l=r&&r.itemType;return l&&w(l.toClipboard)?String(l.toClipboard(n)??""):String(n)}function h(n){const r=n&&n.value;return y(r)?"":typeof r=="string"?r:S(r).map(l=>p(l,n)).join(", ")}function f(n,r){return y(n)?"":typeof n=="string"?n:S(n).map(l=>c(l,r)).join(R(r))}function j(n){const r=String((n&&n.text)??"").trim();if(r==="")return[];const l=n&&n.column,m=R(l).trim(),g=s(r,m),k=[];for(const D of g){const V=u(D,n);if(V===void 0){const J=l&&l.id||"?";return O(`list:parse:${J}`,`column "${J}" refused the item ${JSON.stringify(D)}: it is not a value of the item type "${l&&l.itemType&&l.itemType.name||"text"}". Nothing was stored.`),null}k.push(V)}return k}function s(n,r){const l=new Set([","]);r&&l.add(r);let m=[String(n)];for(const g of l)m=m.flatMap(k=>k.split(g));return m.map(g=>g.trim()).filter(g=>g!=="")}function u(n,r){const l=r&&r.column,m=l&&l.itemType;if(!m||!w(m.parse))return n;const g=m.parse({...r,text:n});if(!(y(g)||typeof g=="number"&&Number.isNaN(g)))return g}function d(n){const r=n&&w(n.itemCompare)?n.itemCompare:b;return(l,m)=>{const g=S(l),k=S(m);return g.length!==k.length?g.length<k.length?-1:1:g.length?r(g[0],k[0]):0}}function b(n,r){return y(n)?y(r)?0:1:y(r)||n<r?-1:n>r?1:0}function A(n){return n instanceof Date?n.getTime():typeof n=="number"?n:typeof n=="string"&&n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n}function T(n){return Array.isArray(n)?null:"it needs an array of items"}function I(n){const r=n;return!r||typeof r!="object"||Array.isArray(r)?"it needs { op, value }":N.includes(r.op)?typeof r.value!="number"||!Number.isFinite(r.value)?"its value must be a finite number":null:`its op must be one of ${N.join(", ")}`}function W(n,r){const l=Array.isArray(r)?r.map(A):[],m=new Set(l),g=k=>S(k).some(D=>m.has(A(D)));return n==="hasAny"?g:n==="hasNone"?k=>!g(k):k=>{if(!l.length)return!0;const D=new Set(S(k).map(A));return l.every(V=>D.has(V))}}function G(n){if(I(n))return()=>!1;const{op:r,value:l}=n;return m=>{const g=S(m).length;switch(r){case"gt":return g>l;case"gte":return g>=l;case"lt":return g<l;case"lte":return g<=l;default:return g===l}}}const x=Object.freeze({hasAny:Object.freeze({compile:n=>W("hasAny",n),check:T}),hasAll:Object.freeze({compile:n=>W("hasAll",n),check:T}),hasNone:Object.freeze({compile:n=>W("hasNone",n),check:T}),listCount:Object.freeze({compile:G,check:I})});function Y(n){return Object.freeze({base:"object",storage:"object",format:h,parse:j,items:S,compareFor:d,compare:d(null),groupProjector:r=>l=>y(l)?l:f(l,r),operators:x,memberOperator:"hasAny",defaults:{filter:n.filterFor("text"),editor:n.editor,align:"start",render:n.render},defaultsFor:r=>({filter:n.filterFor(H(r))}),totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:f,toStorage:F,fromClipboard:(r,l)=>j({...l||{},text:r})})}function H(n){const r=n&&n.base;return r==="number"||r==="boolean"?r:r==="date"||r==="dateString"?"date":"text"}}),U("packages/modules/list/messages.js",function(o,P){"use strict";Object.defineProperty(o,"withFallback",{enumerable:!0,get:function(){return w}});const E=Object.freeze({"filter.op.hasAny":"Has any of","filter.op.hasAll":"Has all of","filter.op.hasNone":"Has none of","filter.op.countGreaterThan":"More items than","filter.op.countLessThan":"Fewer items than","filter.op.countEquals":"Number of items is","filter.list.items":"Items, separated by commas","filter.list.count":"A number of items","list.more":"+{count}","list.moreLabel":"{count} more","list.add":"Add an item","list.remove":"Remove {item}","list.refused":'"{item}" is not a {type}, so it was not added'});function y(O,C){const N=E[O];return N===void 0?O:N.replace(/\{(\w+)\}/g,(L,S)=>C[S]===void 0?L:String(C[S]))}function w(O){return{t(C,N={}){const L=O&&typeof O.t=="function"?O.t(C,N):C;return L===C?y(C,N):L}}}}),U("packages/modules/list/filter.js",function(o,P){"use strict";Object.defineProperty(o,"ListFilter",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"listFilterFor",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return f}});const E=Z("@toclocoinc/lattice-grid"),y=E.ConditionFilter;if(typeof y>"u")throw new Error("[lattice] list needs ConditionFilter from the lattice-grid module. Load lattice-grid before list.");const w=E.createMessages;if(typeof w>"u")throw new Error("[lattice] list needs createMessages from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js"),C=O.splitItems,N=O.parseItem,L=O.joinerOf,B=P("packages/modules/list/messages.js").withFallback,R=Object.freeze(["hasAny","hasAll","hasNone","countGreaterThan","countLessThan","countEquals"]),v=Object.freeze({countGreaterThan:"gt",countLessThan:"lt",countEquals:"eq"}),F=Object.freeze({text:{operators:["contains","notContains","equals","notEqual","startsWith","endsWith"],wire:{contains:"contains",notContains:"notContains",equals:"eq",notEqual:"ne",startsWith:"startsWith",endsWith:"endsWith"},defaultOperator:"contains"},number:{operators:["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",lessThan:"lt",lessThanOrEqual:"lte",greaterThan:"gt",greaterThanOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},date:{operators:["equals","notEqual","before","beforeOrEqual","after","afterOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",before:"lt",beforeOrEqual:"lte",after:"gt",afterOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},boolean:{operators:["equals","notEqual"],wire:{equals:"eq",notEqual:"ne"},defaultOperator:"equals"}});class p extends y{static operators=Object.freeze([...F.text.operators,...R,"blank","notBlank"]);static wire=Object.freeze({...F.text.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static type="list";static defaultOperator="contains";init(s){const u=s||{},d=u.messages||u.grid&&u.grid.messages||w();super.init({...u,messages:B(d)})}parseInput(s){const u=String(s??"").trim();return u===""?null:u}formatInput(s){if(s==null)return"";if(Array.isArray(s))return s.join(", ");if(typeof s=="object"){const u=s.value;return u==null?"":String(u)}return String(s)}nodes(){const s=this.conditions,u=[];try{for(const d of s){this.conditions=[d];for(const b of super.nodes()){const A=this.#n(d.op,b);A&&u.push(A)}}}finally{this.conditions=s}return u}#n(s,u){const d={column:this.params.column,locale:this.params.locale},b=u.op;if(b==="blank"||b==="notBlank")return u;if(v[s]){const T=Number(String(u.value).trim());return!Number.isInteger(T)||T<0?null:{...u,value:{op:v[s],value:T}}}if(b==="hasAny"||b==="hasAll"||b==="hasNone"){const T=C(String(u.value),L(this.params.column).trim()),I=[];for(const W of T){const G=N(W,d);if(G===void 0)return null;I.push(G)}return I.length?{...u,value:I}:null}if(Array.isArray(u.value)){const T=u.value.map(I=>typeof I=="string"?N(I,d):I);return T.some(I=>I===void 0)?null:{...u,value:T}}const A=typeof u.value=="string"?N(u.value,d):u.value;return A===void 0?null:{...u,value:A}}slotFrom(s){if(s&&s.op==="listCount"&&s.value&&typeof s.value=="object"){const{op:u,value:d}=s.value,b=u==="gt"||u==="gte"?"countGreaterThan":u==="lt"||u==="lte"?"countLessThan":"countEquals",A=u==="gte"?d-1:u==="lte"?d+1:d;return{op:b,value:String(A),value2:null,values:[]}}return super.slotFrom(s)}hintFor(s){return v[s]?this.messages.t("filter.list.count"):s==="hasAny"||s==="hasAll"||s==="hasNone"?this.messages.t("filter.list.items"):null}}const c=new Map([["text",p]]);function h(j){const s=c.get(j);if(s)return s;const u=F[j]||F.text;class d extends p{static operators=Object.freeze([...u.operators,...R,"blank","notBlank"]);static wire=Object.freeze({...u.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static defaultOperator=u.defaultOperator}return c.set(j,d),d}const f=p}),U("packages/modules/list/editor.js",function(o,P){"use strict";Object.defineProperty(o,"ListEditor",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return F}});const y=Z("@toclocoinc/lattice-grid").BaseEditor;if(typeof y>"u")throw new Error("[lattice] list needs BaseEditor from the lattice-grid module. Load lattice-grid before list.");const w=P("packages/modules/list/type.js"),O=w.itemsOf,C=w.itemText,N=w.splitItems,L=w.parseItem,S=w.joinerOf,R=P("packages/modules/list/messages.js").withFallback;class v extends y{static popup=!0;items=[];input=null;#n=null;#e=null;#t=null;#r=[];#s(){const c=this.params&&this.params.grid;return R(c&&c.messages)}build(){const c=this.doc,h=this.#s(),f=c.createElement("div");f.className="lat-list-editor";const j=c.createElement("span");j.className="lat-list-editor__tokens";const s=c.createElement("input");s.type="text",s.className="lat-list-editor__input",s.setAttribute("aria-label",h.t("list.add"));const u=c.createElement("span");u.className="lat-list-editor__error",u.setAttribute("role","alert"),u.hidden=!0,f.append(j,s,u),this.#n=j,this.#e=u,this.input=s,this.items=O(this.params.value).slice(),this.params.key&&this.params.key.length===1&&(s.value=this.params.key),this.#i();const d=A=>{A.key==="Enter"&&s.value.trim()!==""?(A.preventDefault(),A.stopPropagation(),this.#o(s.value)):A.key==="Backspace"&&s.value===""&&this.items.length&&(A.preventDefault(),this.items.pop(),this.#i())},b=A=>{const T=A.clipboardData?A.clipboardData.getData("text"):"";!T||!/[,\n\t]/.test(T)||(A.preventDefault(),this.#o(T.replace(/[\n\t]/g,",")))};return s.addEventListener("keydown",d),s.addEventListener("paste",b),this.#r.push(()=>s.removeEventListener("keydown",d)),this.#r.push(()=>s.removeEventListener("paste",b)),f}focusTarget(){return this.input}#o(c){const h=this.params.column,f=N(c,S(h).trim()),j={column:h,locale:this.params.locale};for(let s=0;s<f.length;s++){const u=L(f[s],j);if(u===void 0)return this.#t=f[s],this.input&&(this.input.value=f.slice(s).join(", ")),this.#i(),!1;this.items.push(u)}return this.#t=null,this.input&&(this.input.value=""),this.#i(),!0}#i(){const c=this.doc,h=this.#n;if(!h)return;const f=this.#s();h.replaceChildren();const j={column:this.params.column,locale:this.params.locale,grid:this.params.grid};this.items.forEach((u,d)=>{const b=c.createElement("span");b.className="lat-pill lat-v-neutral lat-list-editor__token";const A=C(u,j);b.append(c.createTextNode(A));const T=c.createElement("button");T.type="button",T.className="lat-list-editor__remove",T.setAttribute("aria-label",f.t("list.remove",{item:A})),T.textContent="×",T.addEventListener("click",I=>{I.preventDefault(),this.items.splice(d,1),this.#i(),this.input&&this.input.focus()}),b.append(T),h.append(b)});const s=this.#e;s&&(s.hidden=this.#t===null,s.textContent=this.#t===null?"":this.#u(this.#t)),this.input&&(this.#t===null?this.input.removeAttribute("aria-invalid"):this.input.setAttribute("aria-invalid","true"))}#u(c){const h=this.params.column,f=h&&h.itemType&&h.itemType.name||"text";return this.#s().t("list.refused",{item:c,type:f})}readValue(){const c=this.input?this.input.value.trim():"";if(!c)return this.items.slice();const h=N(c,S(this.params.column).trim()),f={column:this.params.column,locale:this.params.locale},j=this.items.slice();for(const s of h){const u=L(s,f);if(u===void 0)return j;j.push(u)}return j}checkValue(c){const h=this.input?this.input.value.trim():"";if(!h)return!0;const f=N(h,S(this.params.column).trim()),j={column:this.params.column,locale:this.params.locale},s=f.find(u=>L(u,j)===void 0);return s===void 0?!0:(this.#t=s,this.#i(),this.#u(s))}destroy(){for(const c of this.#r)c();this.#r.length=0,this.input=null,this.#n=null,this.#e=null,super.destroy()}}const F=v}),U("packages/modules/list/render.js",function(o,P){"use strict";Object.defineProperty(o,"ListChips",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return v}});const E=P("packages/modules/list/type.js"),y=E.itemsOf,w=E.itemText,O=E.formatList,N=P("packages/modules/list/messages.js").withFallback,L="lat-list",S="lat-pill lat-v-neutral lat-list__item",B="lat-pill lat-pill--more lat-list__more";class R{#n=null;#e=[];#t=null;#r=null;#s=[];#o=-1;#i=null;init(p){const c=p&&p.grid&&p.grid.document||globalThis.document,h=c.createElement("span");h.className=L;const f=c.createElement("span");f.className=B,f.hidden=!0,h.appendChild(f),this.#n=h,this.#t=f,this.#u(p)}element(){return this.#n}refresh(p){return this.#n?(this.#u(p),!0):!1}attached(){this.#l();const p=globalThis.ResizeObserver;typeof p=="function"&&this.#n&&!this.#i&&(this.#i=new p(()=>this.#l()),this.#i.observe(this.#n))}#u(p){this.#r=p;const c=this.#n,h=c.ownerDocument,f=p?p.value:null,s=(typeof f=="string"?[f]:y(f)).map(d=>typeof f=="string"?f:w(d,p));for(let d=this.#e.length;d<s.length;d++){const b=h.createElement("span");b.className=S,c.insertBefore(b,this.#t),this.#e.push(b)}for(let d=0;d<this.#e.length;d++){const b=this.#e[d];d<s.length?(b.textContent!==s[d]&&(b.textContent=s[d]),b.hidden=!1):b.hidden=!0}this.#s=s;const u=typeof f=="string"?f:O(p);u?c.setAttribute("title",u):c.removeAttribute("title"),this.#o=-1,this.#l()}#l(){const p=this.#n,c=this.#t;if(!p||!c||!p.isConnected)return;const h=p.clientWidth;if(h===this.#o)return;this.#o=h;const f=this.#s.length;for(let u=0;u<f;u++)this.#e[u].hidden=!1;if(c.hidden=!0,!f||p.scrollWidth<=h)return;const j=N(this.#r&&this.#r.grid&&this.#r.grid.messages);let s=f;for(;s>0&&(s--,this.#e[s].hidden=!0,c.hidden=!1,c.textContent=j.t("list.more",{count:f-s}),c.setAttribute("aria-label",j.t("list.moreLabel",{count:f-s})),!(p.scrollWidth<=h)););}destroy(){this.#i&&(this.#i.disconnect(),this.#i=null),this.#n=null,this.#t=null,this.#e=[],this.#r=null}}const v=R}),U("packages/modules/list/index.js",function(o,P){"use strict";Object.defineProperty(o,"listModule",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return p}});const y=Z("@toclocoinc/lattice-grid").registerModules;if(typeof y>"u")throw new Error("[lattice] list needs registerModules from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js").createListType,N=P("packages/modules/list/filter.js").listFilterFor,S=P("packages/modules/list/editor.js").ListEditor,R=P("packages/modules/list/render.js").ListChips,v=O({filterFor:N,editor:S,render:R}),F=Object.freeze({name:"list",capabilities:["dataType:list"],install(c){c.registry.register("dataType","list",v)}});y(F);const p=F});const oe=ie("packages/modules/list/index.js"),ge=oe.listModule;var be=oe.default;export{be as default,ge as listModule};
|
|
6
|
+
import*as pe from"@toclocoinc/lattice-grid";var ne=Object.create(null),re=Object.create(null);function U(o,P){ne[o]=P}function ie(o){var P=re[o];if(P)return P;var E=Object.create(null);re[o]=E;var y=ne[o];if(!y)throw new Error("[lattice] missing module: "+o);return y(E,ie),E}var se=Object.create(null);se["@toclocoinc/lattice-grid"]=pe;function Z(o){var P=se[o],E=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(P)return P;if(o==="@toclocoinc/lattice-grid"&&E&&E.LatticeGrid)return E.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: "+o)}U("packages/core/src/internal/util.js",function(o,P){"use strict";Object.defineProperty(o,"VERSION",{enumerable:!0,get:function(){return w}}),Object.defineProperty(o,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"warnOnce",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"infoOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"resetWarnings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"invariant",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"DEV",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"isFunction",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"isNil",{enumerable:!0,get:function(){return b}}),Object.defineProperty(o,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"isCtor",{enumerable:!0,get:function(){return T}}),Object.defineProperty(o,"pathGetter",{enumerable:!0,get:function(){return W}}),Object.defineProperty(o,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"getPath",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"setPath",{enumerable:!0,get:function(){return H}}),Object.defineProperty(o,"humanise",{enumerable:!0,get:function(){return n}}),Object.defineProperty(o,"escapeHtml",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"titleCase",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"expand",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"toArray",{enumerable:!0,get:function(){return k}}),Object.defineProperty(o,"merge",{enumerable:!0,get:function(){return V}}),Object.defineProperty(o,"mergeRow",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"Lru",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(o,"collator",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"defaultCompare",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(o,"now",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"nextFrame",{enumerable:!0,get:function(){return te}}),Object.defineProperty(o,"cancelFrame",{enumerable:!0,get:function(){return K}}),Object.defineProperty(o,"frameBatched",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(o,"settleDebounce",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(o,"whenIdle",{enumerable:!0,get:function(){return me}}),Object.defineProperty(o,"uid",{enumerable:!0,get:function(){return he}});const E="1.89.1";async function y(){return E}const w="1.89.1",O=new Set,C=2e3;function N(e){if(O.add(e),O.size>C){const t=O.values().next().value;t!==void 0&&O.delete(t)}}const L=[],S=500;function B(e,t,i){L.push({key:e,level:t,message:i.map(a=>typeof a=="string"?a:R(a)).join(" "),at:Date.now()}),L.length>S&&L.shift()}function R(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function v(){return L.map(e=>({...e}))}function F(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function p(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"warn",i),console.warn("[lattice]",...i)}function c(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"info",i),console.info("[lattice]",...i)}function h(){O.clear(),L.length=0}function f(e,t){const i=new Error(`[lattice] ${e}`);throw t!==void 0&&(i.cause=t),i}function j(e,t){e||f(t)}const s=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function d(e){return typeof e=="function"}function b(e){return e==null}function A(e){return e==null||e===""}function T(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function W(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=i=>i?.[e];else{const i=e.split("."),a=i.length;t=M=>{let z=M;for(let q=0;q<a;q++){if(z==null)return;z=z[i[q]]}return z}}return I.set(e,t),t}const G=new Map;function x(e){let t=G.get(e);if(t)return t;if(!e.includes("."))t=(i,a)=>{i!=null&&(i[e]=a)};else{const i=e.split("."),a=i.length-1;t=(M,z)=>{let q=M;for(let $=0;$<a;$++){if(q==null)return;const _=i[$];q[_]==null&&(q[_]={}),q=q[_]}q!=null&&(q[i[a]]=z)}}return G.set(e,t),t}function Y(e,t){return W(t)(e)}function H(e,t,i){x(t)(e,i)}function n(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(/^./,i=>i.toUpperCase()):""}const r={"&":"&","<":"<",">":">",'"':""","'":"'"};function l(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,i=>r[i]):t}function m(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function g(e,t,i){if(e!==void 0)return e===!0?{enabled:!0,...i}:e===!1?{enabled:!1}:u(e)?e:{[t]:e,enabled:!0}}function k(e){return e==null?[]:Array.isArray(e)?e:[e]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function V(e,t){if(!u(e))return u(t)?{...t}:t;if(!u(t))return t===void 0?e:t;const i={...e};for(const a of Object.keys(t)){if(D.has(a))continue;const M=t[a];M!==void 0&&(i[a]=u(M)&&u(i[a])?V(i[a],M):M)}return i}function J(e,t){if(!u(e)||!u(t)||e===t)return t;const i=Object.create(Object.getPrototypeOf(e));return Object.assign(i,e,t),i}class ue{#n;#e=new Map;#t;constructor(t=256,i=null){this.#n=t,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const i=this.#e;if(!i.has(t))return;const a=i.get(t);return i.delete(t),i.set(t,a),a}peek(t){return this.#e.get(t)}set(t,i){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,i),this.#r(),i}delete(t){const i=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(i,t),i}clear(){if(this.#t)for(const[t,i]of this.#e)this.#t(i,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const i=t.keys().next().value,a=t.get(i);t.delete(i),this.#t&&this.#t(a,i)}}}const X=new Map;function le(e,t){const i=`${e||""}|${t?JSON.stringify(t):""}`;let a=X.get(i);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),X.set(i,a)),a}function ae(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 i=String(e),a=String(t);return i<a?-1:i>a?1:0}function Q(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ee=typeof requestAnimationFrame=="function";function te(e){return ee?requestAnimationFrame(e):setTimeout(()=>e(Q()),16)}function K(e){e!=null&&(ee?cancelAnimationFrame(e):clearTimeout(e))}function ce(e){let t=null,i=null;const a=()=>{t=null;const z=i;i=null,e(...z||[])},M=(...z)=>{i=z,t===null&&(t=te(a))};return M.cancel=()=>{K(t),t=null,i=null},M.flush=()=>{t!==null&&(K(t),a())},M}function fe(e,t){let i=null,a=null;const M=()=>{if(i=null,a===null)return;const $=a;a=null,e(...$),z()},z=()=>{i=setTimeout(M,t),typeof i?.unref=="function"&&i.unref()},q=(...$)=>{i===null?(e(...$),z()):(a=$,clearTimeout(i),z())};return q.flush=()=>{if(i!==null&&clearTimeout(i),i=null,a===null)return;const $=a;a=null,e(...$)},q.cancel=()=>{i!==null&&clearTimeout(i),i=null,a=null},q.pending=()=>i!==null||a!==null,q}function me(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let de=0;function he(e="l"){return`${e}${(++de).toString(36)}`}}),U("packages/modules/list/type.js",function(o,P){"use strict";Object.defineProperty(o,"LIST_OPERATORS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(o,"COUNT_COMPARISONS",{enumerable:!0,get:function(){return N}}),Object.defineProperty(o,"DEFAULT_JOINER",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"itemsOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(o,"joinerOf",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"storeList",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"itemText",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"formatList",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"listText",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"parseList",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"splitItems",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"parseItem",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"compareListFor",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"LIST_OPERATOR_SPECS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"createListType",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"familyOf",{enumerable:!0,get:function(){return H}});const E=P("packages/core/src/internal/util.js"),y=E.isNil,w=E.isFunction,O=E.warnOnce,C=Object.freeze(["hasAny","hasAll","hasNone","listCount"]),N=Object.freeze(["gt","gte","lt","lte","eq"]),L=", ";function S(n){if(y(n))return[];if(Array.isArray(n))return n;if(typeof n=="object"&&!ArrayBuffer.isView(n)){const r=n;if(w(r.toArray))return Array.from(r.toArray());if(w(r[Symbol.iterator]))return Array.from(r)}return[n]}function B(n){if(Array.isArray(n))return!0;if(!n||typeof n!="object"||ArrayBuffer.isView(n))return!1;const r=n;return w(r.toArray)||w(r[Symbol.iterator])}function R(n){const r=n&&n.typeOptions,l=r&&r.joiner;return typeof l=="string"&&l!==""?l:L}function v(n,r,l){if(y(n))return null;let m=n;if(typeof n=="bigint"&&(m=n<=BigInt(Number.MAX_SAFE_INTEGER)&&n>=BigInt(Number.MIN_SAFE_INTEGER)?Number(n):String(n)),!r)return m;if(w(r.toStorage)?m=r.toStorage(m,l):r.base==="number"&&typeof m=="string"?m=w(r.parse)?r.parse({text:m,column:null}):Number(m):r.base==="boolean"&&typeof m=="string"&&w(r.parse)&&(m=r.parse({text:m,column:null})),!(typeof m=="number"&&Number.isNaN(m)))return y(m)?void 0:m}function F(n,r){if(y(n))return null;const l=r&&r.colId||"?",m=r&&r.itemType;B(n)||O(`list:scalar:${l}`,`column "${l}" is a list column and received a single value (${typeof n}) where a list was expected; it is read as a one-item list. The row itself is not changed: pass an array to say so.`);const g=[];for(const k of S(n)){const D=v(k,m,r);if(D===void 0){O(`list:item:${l}`,`column "${l}" refused the item ${JSON.stringify(String(k))}: it is not a value of the item type "${m&&m.name||"text"}". The item is left out of the stored list rather than kept.`);continue}g.push(D)}return g.length?g:null}function p(n,r){if(y(n))return"";const l=r&&r.column,m=l&&l.itemType;return m&&w(m.format)?String(m.format({...r,value:n})??""):String(n)}function c(n,r){if(y(n))return"";const l=r&&r.itemType;return l&&w(l.toClipboard)?String(l.toClipboard(n)??""):String(n)}function h(n){const r=n&&n.value;return y(r)?"":typeof r=="string"?r:S(r).map(l=>p(l,n)).join(", ")}function f(n,r){return y(n)?"":typeof n=="string"?n:S(n).map(l=>c(l,r)).join(R(r))}function j(n){const r=String((n&&n.text)??"").trim();if(r==="")return[];const l=n&&n.column,m=R(l).trim(),g=s(r,m),k=[];for(const D of g){const V=u(D,n);if(V===void 0){const J=l&&l.id||"?";return O(`list:parse:${J}`,`column "${J}" refused the item ${JSON.stringify(D)}: it is not a value of the item type "${l&&l.itemType&&l.itemType.name||"text"}". Nothing was stored.`),null}k.push(V)}return k}function s(n,r){const l=new Set([","]);r&&l.add(r);let m=[String(n)];for(const g of l)m=m.flatMap(k=>k.split(g));return m.map(g=>g.trim()).filter(g=>g!=="")}function u(n,r){const l=r&&r.column,m=l&&l.itemType;if(!m||!w(m.parse))return n;const g=m.parse({...r,text:n});if(!(y(g)||typeof g=="number"&&Number.isNaN(g)))return g}function d(n){const r=n&&w(n.itemCompare)?n.itemCompare:b;return(l,m)=>{const g=S(l),k=S(m);return g.length!==k.length?g.length<k.length?-1:1:g.length?r(g[0],k[0]):0}}function b(n,r){return y(n)?y(r)?0:1:y(r)||n<r?-1:n>r?1:0}function A(n){return n instanceof Date?n.getTime():typeof n=="number"?n:typeof n=="string"&&n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n}function T(n){return Array.isArray(n)?null:"it needs an array of items"}function I(n){const r=n;return!r||typeof r!="object"||Array.isArray(r)?"it needs { op, value }":N.includes(r.op)?typeof r.value!="number"||!Number.isFinite(r.value)?"its value must be a finite number":null:`its op must be one of ${N.join(", ")}`}function W(n,r){const l=Array.isArray(r)?r.map(A):[],m=new Set(l),g=k=>S(k).some(D=>m.has(A(D)));return n==="hasAny"?g:n==="hasNone"?k=>!g(k):k=>{if(!l.length)return!0;const D=new Set(S(k).map(A));return l.every(V=>D.has(V))}}function G(n){if(I(n))return()=>!1;const{op:r,value:l}=n;return m=>{const g=S(m).length;switch(r){case"gt":return g>l;case"gte":return g>=l;case"lt":return g<l;case"lte":return g<=l;default:return g===l}}}const x=Object.freeze({hasAny:Object.freeze({compile:n=>W("hasAny",n),check:T}),hasAll:Object.freeze({compile:n=>W("hasAll",n),check:T}),hasNone:Object.freeze({compile:n=>W("hasNone",n),check:T}),listCount:Object.freeze({compile:G,check:I})});function Y(n){return Object.freeze({base:"object",storage:"object",format:h,parse:j,items:S,compareFor:d,compare:d(null),groupProjector:r=>l=>y(l)?l:f(l,r),operators:x,memberOperator:"hasAny",defaults:{filter:n.filterFor("text"),editor:n.editor,align:"start",render:n.render},defaultsFor:r=>({filter:n.filterFor(H(r))}),totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:f,toStorage:F,fromClipboard:(r,l)=>j({...l||{},text:r})})}function H(n){const r=n&&n.base;return r==="number"||r==="boolean"?r:r==="date"||r==="dateString"?"date":"text"}}),U("packages/modules/list/messages.js",function(o,P){"use strict";Object.defineProperty(o,"withFallback",{enumerable:!0,get:function(){return w}});const E=Object.freeze({"filter.op.hasAny":"Has any of","filter.op.hasAll":"Has all of","filter.op.hasNone":"Has none of","filter.op.countGreaterThan":"More items than","filter.op.countLessThan":"Fewer items than","filter.op.countEquals":"Number of items is","filter.list.items":"Items, separated by commas","filter.list.count":"A number of items","list.more":"+{count}","list.moreLabel":"{count} more","list.add":"Add an item","list.remove":"Remove {item}","list.refused":'"{item}" is not a {type}, so it was not added'});function y(O,C){const N=E[O];return N===void 0?O:N.replace(/\{(\w+)\}/g,(L,S)=>C[S]===void 0?L:String(C[S]))}function w(O){return{t(C,N={}){const L=O&&typeof O.t=="function"?O.t(C,N):C;return L===C?y(C,N):L}}}}),U("packages/modules/list/filter.js",function(o,P){"use strict";Object.defineProperty(o,"ListFilter",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"listFilterFor",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return f}});const E=Z("@toclocoinc/lattice-grid"),y=E.ConditionFilter;if(typeof y>"u")throw new Error("[lattice] list needs ConditionFilter from the lattice-grid module. Load lattice-grid before list.");const w=E.createMessages;if(typeof w>"u")throw new Error("[lattice] list needs createMessages from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js"),C=O.splitItems,N=O.parseItem,L=O.joinerOf,B=P("packages/modules/list/messages.js").withFallback,R=Object.freeze(["hasAny","hasAll","hasNone","countGreaterThan","countLessThan","countEquals"]),v=Object.freeze({countGreaterThan:"gt",countLessThan:"lt",countEquals:"eq"}),F=Object.freeze({text:{operators:["contains","notContains","equals","notEqual","startsWith","endsWith"],wire:{contains:"contains",notContains:"notContains",equals:"eq",notEqual:"ne",startsWith:"startsWith",endsWith:"endsWith"},defaultOperator:"contains"},number:{operators:["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",lessThan:"lt",lessThanOrEqual:"lte",greaterThan:"gt",greaterThanOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},date:{operators:["equals","notEqual","before","beforeOrEqual","after","afterOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",before:"lt",beforeOrEqual:"lte",after:"gt",afterOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},boolean:{operators:["equals","notEqual"],wire:{equals:"eq",notEqual:"ne"},defaultOperator:"equals"}});class p extends y{static operators=Object.freeze([...F.text.operators,...R,"blank","notBlank"]);static wire=Object.freeze({...F.text.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static type="list";static defaultOperator="contains";init(s){const u=s||{},d=u.messages||u.grid&&u.grid.messages||w();super.init({...u,messages:B(d)})}parseInput(s){const u=String(s??"").trim();return u===""?null:u}formatInput(s){if(s==null)return"";if(Array.isArray(s))return s.join(", ");if(typeof s=="object"){const u=s.value;return u==null?"":String(u)}return String(s)}nodes(){const s=this.conditions,u=[];try{for(const d of s){this.conditions=[d];for(const b of super.nodes()){const A=this.#n(d.op,b);A&&u.push(A)}}}finally{this.conditions=s}return u}#n(s,u){const d={column:this.params.column,locale:this.params.locale},b=u.op;if(b==="blank"||b==="notBlank")return u;if(v[s]){const T=Number(String(u.value).trim());return!Number.isInteger(T)||T<0?null:{...u,value:{op:v[s],value:T}}}if(b==="hasAny"||b==="hasAll"||b==="hasNone"){const T=C(String(u.value),L(this.params.column).trim()),I=[];for(const W of T){const G=N(W,d);if(G===void 0)return null;I.push(G)}return I.length?{...u,value:I}:null}if(Array.isArray(u.value)){const T=u.value.map(I=>typeof I=="string"?N(I,d):I);return T.some(I=>I===void 0)?null:{...u,value:T}}const A=typeof u.value=="string"?N(u.value,d):u.value;return A===void 0?null:{...u,value:A}}slotFrom(s){if(s&&s.op==="listCount"&&s.value&&typeof s.value=="object"){const{op:u,value:d}=s.value,b=u==="gt"||u==="gte"?"countGreaterThan":u==="lt"||u==="lte"?"countLessThan":"countEquals",A=u==="gte"?d-1:u==="lte"?d+1:d;return{op:b,value:String(A),value2:null,values:[]}}return super.slotFrom(s)}hintFor(s){return v[s]?this.messages.t("filter.list.count"):s==="hasAny"||s==="hasAll"||s==="hasNone"?this.messages.t("filter.list.items"):null}}const c=new Map([["text",p]]);function h(j){const s=c.get(j);if(s)return s;const u=F[j]||F.text;class d extends p{static operators=Object.freeze([...u.operators,...R,"blank","notBlank"]);static wire=Object.freeze({...u.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static defaultOperator=u.defaultOperator}return c.set(j,d),d}const f=p}),U("packages/modules/list/editor.js",function(o,P){"use strict";Object.defineProperty(o,"ListEditor",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return F}});const y=Z("@toclocoinc/lattice-grid").BaseEditor;if(typeof y>"u")throw new Error("[lattice] list needs BaseEditor from the lattice-grid module. Load lattice-grid before list.");const w=P("packages/modules/list/type.js"),O=w.itemsOf,C=w.itemText,N=w.splitItems,L=w.parseItem,S=w.joinerOf,R=P("packages/modules/list/messages.js").withFallback;class v extends y{static popup=!0;items=[];input=null;#n=null;#e=null;#t=null;#r=[];#s(){const c=this.params&&this.params.grid;return R(c&&c.messages)}build(){const c=this.doc,h=this.#s(),f=c.createElement("div");f.className="lat-list-editor";const j=c.createElement("span");j.className="lat-list-editor__tokens";const s=c.createElement("input");s.type="text",s.className="lat-list-editor__input",s.setAttribute("aria-label",h.t("list.add"));const u=c.createElement("span");u.className="lat-list-editor__error",u.setAttribute("role","alert"),u.hidden=!0,f.append(j,s,u),this.#n=j,this.#e=u,this.input=s,this.items=O(this.params.value).slice(),this.params.key&&this.params.key.length===1&&(s.value=this.params.key),this.#i();const d=A=>{A.key==="Enter"&&s.value.trim()!==""?(A.preventDefault(),A.stopPropagation(),this.#o(s.value)):A.key==="Backspace"&&s.value===""&&this.items.length&&(A.preventDefault(),this.items.pop(),this.#i())},b=A=>{const T=A.clipboardData?A.clipboardData.getData("text"):"";!T||!/[,\n\t]/.test(T)||(A.preventDefault(),this.#o(T.replace(/[\n\t]/g,",")))};return s.addEventListener("keydown",d),s.addEventListener("paste",b),this.#r.push(()=>s.removeEventListener("keydown",d)),this.#r.push(()=>s.removeEventListener("paste",b)),f}focusTarget(){return this.input}#o(c){const h=this.params.column,f=N(c,S(h).trim()),j={column:h,locale:this.params.locale};for(let s=0;s<f.length;s++){const u=L(f[s],j);if(u===void 0)return this.#t=f[s],this.input&&(this.input.value=f.slice(s).join(", ")),this.#i(),!1;this.items.push(u)}return this.#t=null,this.input&&(this.input.value=""),this.#i(),!0}#i(){const c=this.doc,h=this.#n;if(!h)return;const f=this.#s();h.replaceChildren();const j={column:this.params.column,locale:this.params.locale,grid:this.params.grid};this.items.forEach((u,d)=>{const b=c.createElement("span");b.className="lat-pill lat-v-neutral lat-list-editor__token";const A=C(u,j);b.append(c.createTextNode(A));const T=c.createElement("button");T.type="button",T.className="lat-list-editor__remove",T.setAttribute("aria-label",f.t("list.remove",{item:A})),T.textContent="×",T.addEventListener("click",I=>{I.preventDefault(),this.items.splice(d,1),this.#i(),this.input&&this.input.focus()}),b.append(T),h.append(b)});const s=this.#e;s&&(s.hidden=this.#t===null,s.textContent=this.#t===null?"":this.#u(this.#t)),this.input&&(this.#t===null?this.input.removeAttribute("aria-invalid"):this.input.setAttribute("aria-invalid","true"))}#u(c){const h=this.params.column,f=h&&h.itemType&&h.itemType.name||"text";return this.#s().t("list.refused",{item:c,type:f})}readValue(){const c=this.input?this.input.value.trim():"";if(!c)return this.items.slice();const h=N(c,S(this.params.column).trim()),f={column:this.params.column,locale:this.params.locale},j=this.items.slice();for(const s of h){const u=L(s,f);if(u===void 0)return j;j.push(u)}return j}checkValue(c){const h=this.input?this.input.value.trim():"";if(!h)return!0;const f=N(h,S(this.params.column).trim()),j={column:this.params.column,locale:this.params.locale},s=f.find(u=>L(u,j)===void 0);return s===void 0?!0:(this.#t=s,this.#i(),this.#u(s))}destroy(){for(const c of this.#r)c();this.#r.length=0,this.input=null,this.#n=null,this.#e=null,super.destroy()}}const F=v}),U("packages/modules/list/render.js",function(o,P){"use strict";Object.defineProperty(o,"ListChips",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return v}});const E=P("packages/modules/list/type.js"),y=E.itemsOf,w=E.itemText,O=E.formatList,N=P("packages/modules/list/messages.js").withFallback,L="lat-list",S="lat-pill lat-v-neutral lat-list__item",B="lat-pill lat-pill--more lat-list__more";class R{#n=null;#e=[];#t=null;#r=null;#s=[];#o=-1;#i=null;init(p){const c=p&&p.grid&&p.grid.document||globalThis.document,h=c.createElement("span");h.className=L;const f=c.createElement("span");f.className=B,f.hidden=!0,h.appendChild(f),this.#n=h,this.#t=f,this.#u(p)}element(){return this.#n}refresh(p){return this.#n?(this.#u(p),!0):!1}attached(){this.#l();const p=globalThis.ResizeObserver;typeof p=="function"&&this.#n&&!this.#i&&(this.#i=new p(()=>this.#l()),this.#i.observe(this.#n))}#u(p){this.#r=p;const c=this.#n,h=c.ownerDocument,f=p?p.value:null,s=(typeof f=="string"?[f]:y(f)).map(d=>typeof f=="string"?f:w(d,p));for(let d=this.#e.length;d<s.length;d++){const b=h.createElement("span");b.className=S,c.insertBefore(b,this.#t),this.#e.push(b)}for(let d=0;d<this.#e.length;d++){const b=this.#e[d];d<s.length?(b.textContent!==s[d]&&(b.textContent=s[d]),b.hidden=!1):b.hidden=!0}this.#s=s;const u=typeof f=="string"?f:O(p);u?c.setAttribute("title",u):c.removeAttribute("title"),this.#o=-1,this.#l()}#l(){const p=this.#n,c=this.#t;if(!p||!c||!p.isConnected)return;const h=p.clientWidth;if(h===this.#o)return;this.#o=h;const f=this.#s.length;for(let u=0;u<f;u++)this.#e[u].hidden=!1;if(c.hidden=!0,!f||p.scrollWidth<=h)return;const j=N(this.#r&&this.#r.grid&&this.#r.grid.messages);let s=f;for(;s>0&&(s--,this.#e[s].hidden=!0,c.hidden=!1,c.textContent=j.t("list.more",{count:f-s}),c.setAttribute("aria-label",j.t("list.moreLabel",{count:f-s})),!(p.scrollWidth<=h)););}destroy(){this.#i&&(this.#i.disconnect(),this.#i=null),this.#n=null,this.#t=null,this.#e=[],this.#r=null}}const v=R}),U("packages/modules/list/index.js",function(o,P){"use strict";Object.defineProperty(o,"listModule",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return p}});const y=Z("@toclocoinc/lattice-grid").registerModules;if(typeof y>"u")throw new Error("[lattice] list needs registerModules from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js").createListType,N=P("packages/modules/list/filter.js").listFilterFor,S=P("packages/modules/list/editor.js").ListEditor,R=P("packages/modules/list/render.js").ListChips,v=O({filterFor:N,editor:S,render:R}),F=Object.freeze({name:"list",capabilities:["dataType:list"],install(c){c.registry.register("dataType","list",v)}});y(F);const p=F});const oe=ie("packages/modules/list/index.js"),ge=oe.listModule;var be=oe.default;export{be as default,ge as listModule};
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=list.esm.min.js.map
|
package/modules/list.min.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, list module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(K){"use strict";var te=Object.create(null),ne=Object.create(null);function G(o,P){te[o]=P}function re(o){var P=ne[o];if(P)return P;var E=Object.create(null);ne[o]=E;var y=te[o];if(!y)throw new Error("[lattice] missing module: "+o);return y(E,re),E}var ie=Object.create(null);ie["@toclocoinc/lattice-grid"]=K.LatticeGrid||null;function Z(o){var P=ie[o],E=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(P)return P;if(o==="@toclocoinc/lattice-grid"&&E&&E.LatticeGrid)return E.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: "+o)}G("packages/core/src/internal/util.js",function(o,P){"use strict";Object.defineProperty(o,"VERSION",{enumerable:!0,get:function(){return w}}),Object.defineProperty(o,"reportedWarnings",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"warnOnce",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"infoOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"resetWarnings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"invariant",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"DEV",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"isFunction",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"isNil",{enumerable:!0,get:function(){return b}}),Object.defineProperty(o,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"isCtor",{enumerable:!0,get:function(){return T}}),Object.defineProperty(o,"pathGetter",{enumerable:!0,get:function(){return W}}),Object.defineProperty(o,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"setPath",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"humanise",{enumerable:!0,get:function(){return n}}),Object.defineProperty(o,"escapeHtml",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"titleCase",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"expand",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"toArray",{enumerable:!0,get:function(){return k}}),Object.defineProperty(o,"merge",{enumerable:!0,get:function(){return U}}),Object.defineProperty(o,"mergeRow",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(o,"collator",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(o,"defaultCompare",{enumerable:!0,get:function(){return me}}),Object.defineProperty(o,"now",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(o,"nextFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"cancelFrame",{enumerable:!0,get:function(){return _}}),Object.defineProperty(o,"frameBatched",{enumerable:!0,get:function(){return de}}),Object.defineProperty(o,"settleDebounce",{enumerable:!0,get:function(){return he}}),Object.defineProperty(o,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(o,"uid",{enumerable:!0,get:function(){return be}});const E="1.89.0";async function y(){return E}const w="1.89.0",O=new Set,C=2e3;function N(e){if(O.add(e),O.size>C){const t=O.values().next().value;t!==void 0&&O.delete(t)}}const L=[],S=500;function B(e,t,i){L.push({key:e,level:t,message:i.map(a=>typeof a=="string"?a:v(a)).join(" "),at:Date.now()}),L.length>S&&L.shift()}function v(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function R(){return L.map(e=>({...e}))}function F(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function p(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"warn",i),console.warn("[lattice]",...i)}function c(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"info",i),console.info("[lattice]",...i)}function h(){O.clear(),L.length=0}function f(e,t){const i=new Error(`[lattice] ${e}`);throw t!==void 0&&(i.cause=t),i}function j(e,t){e||f(t)}const s=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function d(e){return typeof e=="function"}function b(e){return e==null}function A(e){return e==null||e===""}function T(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function W(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=i=>i?.[e];else{const i=e.split("."),a=i.length;t=M=>{let z=M;for(let q=0;q<a;q++){if(z==null)return;z=z[i[q]]}return z}}return I.set(e,t),t}const V=new Map;function x(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=(i,a)=>{i!=null&&(i[e]=a)};else{const i=e.split("."),a=i.length-1;t=(M,z)=>{let q=M;for(let $=0;$<a;$++){if(q==null)return;const ee=i[$];q[ee]==null&&(q[ee]={}),q=q[ee]}q!=null&&(q[i[a]]=z)}}return V.set(e,t),t}function Q(e,t){return W(t)(e)}function J(e,t,i){x(t)(e,i)}function n(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(/^./,i=>i.toUpperCase()):""}const r={"&":"&","<":"<",">":">",'"':""","'":"'"};function l(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,i=>r[i]):t}function m(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function g(e,t,i){if(e!==void 0)return e===!0?{enabled:!0,...i}:e===!1?{enabled:!1}:u(e)?e:{[t]:e,enabled:!0}}function k(e){return e==null?[]:Array.isArray(e)?e:[e]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function U(e,t){if(!u(e))return u(t)?{...t}:t;if(!u(t))return t===void 0?e:t;const i={...e};for(const a of Object.keys(t)){if(D.has(a))continue;const M=t[a];M!==void 0&&(i[a]=u(M)&&u(i[a])?U(i[a],M):M)}return i}function Y(e,t){if(!u(e)||!u(t)||e===t)return t;const i=Object.create(Object.getPrototypeOf(e));return Object.assign(i,e,t),i}class ce{#n;#e=new Map;#t;constructor(t=256,i=null){this.#n=t,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const i=this.#e;if(!i.has(t))return;const a=i.get(t);return i.delete(t),i.set(t,a),a}peek(t){return this.#e.get(t)}set(t,i){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,i),this.#r(),i}delete(t){const i=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(i,t),i}clear(){if(this.#t)for(const[t,i]of this.#e)this.#t(i,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const i=t.keys().next().value,a=t.get(i);t.delete(i),this.#t&&this.#t(a,i)}}}const se=new Map;function fe(e,t){const i=`${e||""}|${t?JSON.stringify(t):""}`;let a=se.get(i);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),se.set(i,a)),a}function me(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 i=String(e),a=String(t);return i<a?-1:i>a?1:0}function oe(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ue=typeof requestAnimationFrame=="function";function le(e){return ue?requestAnimationFrame(e):setTimeout(()=>e(oe()),16)}function _(e){e!=null&&(ue?cancelAnimationFrame(e):clearTimeout(e))}function de(e){let t=null,i=null;const a=()=>{t=null;const z=i;i=null,e(...z||[])},M=(...z)=>{i=z,t===null&&(t=le(a))};return M.cancel=()=>{_(t),t=null,i=null},M.flush=()=>{t!==null&&(_(t),a())},M}function he(e,t){let i=null,a=null;const M=()=>{if(i=null,a===null)return;const $=a;a=null,e(...$),z()},z=()=>{i=setTimeout(M,t),typeof i?.unref=="function"&&i.unref()},q=(...$)=>{i===null?(e(...$),z()):(a=$,clearTimeout(i),z())};return q.flush=()=>{if(i!==null&&clearTimeout(i),i=null,a===null)return;const $=a;a=null,e(...$)},q.cancel=()=>{i!==null&&clearTimeout(i),i=null,a=null},q.pending=()=>i!==null||a!==null,q}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let ge=0;function be(e="l"){return`${e}${(++ge).toString(36)}`}}),G("packages/modules/list/type.js",function(o,P){"use strict";Object.defineProperty(o,"LIST_OPERATORS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(o,"COUNT_COMPARISONS",{enumerable:!0,get:function(){return N}}),Object.defineProperty(o,"DEFAULT_JOINER",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"itemsOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(o,"joinerOf",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"storeList",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"itemText",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"formatList",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"listText",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"parseList",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"splitItems",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"parseItem",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"compareListFor",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"LIST_OPERATOR_SPECS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"createListType",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"familyOf",{enumerable:!0,get:function(){return J}});const E=P("packages/core/src/internal/util.js"),y=E.isNil,w=E.isFunction,O=E.warnOnce,C=Object.freeze(["hasAny","hasAll","hasNone","listCount"]),N=Object.freeze(["gt","gte","lt","lte","eq"]),L=", ";function S(n){if(y(n))return[];if(Array.isArray(n))return n;if(typeof n=="object"&&!ArrayBuffer.isView(n)){const r=n;if(w(r.toArray))return Array.from(r.toArray());if(w(r[Symbol.iterator]))return Array.from(r)}return[n]}function B(n){if(Array.isArray(n))return!0;if(!n||typeof n!="object"||ArrayBuffer.isView(n))return!1;const r=n;return w(r.toArray)||w(r[Symbol.iterator])}function v(n){const r=n&&n.typeOptions,l=r&&r.joiner;return typeof l=="string"&&l!==""?l:L}function R(n,r,l){if(y(n))return null;let m=n;if(typeof n=="bigint"&&(m=n<=BigInt(Number.MAX_SAFE_INTEGER)&&n>=BigInt(Number.MIN_SAFE_INTEGER)?Number(n):String(n)),!r)return m;if(w(r.toStorage)?m=r.toStorage(m,l):r.base==="number"&&typeof m=="string"?m=w(r.parse)?r.parse({text:m,column:null}):Number(m):r.base==="boolean"&&typeof m=="string"&&w(r.parse)&&(m=r.parse({text:m,column:null})),!(typeof m=="number"&&Number.isNaN(m)))return y(m)?void 0:m}function F(n,r){if(y(n))return null;const l=r&&r.colId||"?",m=r&&r.itemType;B(n)||O(`list:scalar:${l}`,`column "${l}" is a list column and received a single value (${typeof n}) where a list was expected; it is read as a one-item list. The row itself is not changed: pass an array to say so.`);const g=[];for(const k of S(n)){const D=R(k,m,r);if(D===void 0){O(`list:item:${l}`,`column "${l}" refused the item ${JSON.stringify(String(k))}: it is not a value of the item type "${m&&m.name||"text"}". The item is left out of the stored list rather than kept.`);continue}g.push(D)}return g.length?g:null}function p(n,r){if(y(n))return"";const l=r&&r.column,m=l&&l.itemType;return m&&w(m.format)?String(m.format({...r,value:n})??""):String(n)}function c(n,r){if(y(n))return"";const l=r&&r.itemType;return l&&w(l.toClipboard)?String(l.toClipboard(n)??""):String(n)}function h(n){const r=n&&n.value;return y(r)?"":typeof r=="string"?r:S(r).map(l=>p(l,n)).join(", ")}function f(n,r){return y(n)?"":typeof n=="string"?n:S(n).map(l=>c(l,r)).join(v(r))}function j(n){const r=String((n&&n.text)??"").trim();if(r==="")return[];const l=n&&n.column,m=v(l).trim(),g=s(r,m),k=[];for(const D of g){const U=u(D,n);if(U===void 0){const Y=l&&l.id||"?";return O(`list:parse:${Y}`,`column "${Y}" refused the item ${JSON.stringify(D)}: it is not a value of the item type "${l&&l.itemType&&l.itemType.name||"text"}". Nothing was stored.`),null}k.push(U)}return k}function s(n,r){const l=new Set([","]);r&&l.add(r);let m=[String(n)];for(const g of l)m=m.flatMap(k=>k.split(g));return m.map(g=>g.trim()).filter(g=>g!=="")}function u(n,r){const l=r&&r.column,m=l&&l.itemType;if(!m||!w(m.parse))return n;const g=m.parse({...r,text:n});if(!(y(g)||typeof g=="number"&&Number.isNaN(g)))return g}function d(n){const r=n&&w(n.itemCompare)?n.itemCompare:b;return(l,m)=>{const g=S(l),k=S(m);return g.length!==k.length?g.length<k.length?-1:1:g.length?r(g[0],k[0]):0}}function b(n,r){return y(n)?y(r)?0:1:y(r)||n<r?-1:n>r?1:0}function A(n){return n instanceof Date?n.getTime():typeof n=="number"?n:typeof n=="string"&&n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n}function T(n){return Array.isArray(n)?null:"it needs an array of items"}function I(n){const r=n;return!r||typeof r!="object"||Array.isArray(r)?"it needs { op, value }":N.includes(r.op)?typeof r.value!="number"||!Number.isFinite(r.value)?"its value must be a finite number":null:`its op must be one of ${N.join(", ")}`}function W(n,r){const l=Array.isArray(r)?r.map(A):[],m=new Set(l),g=k=>S(k).some(D=>m.has(A(D)));return n==="hasAny"?g:n==="hasNone"?k=>!g(k):k=>{if(!l.length)return!0;const D=new Set(S(k).map(A));return l.every(U=>D.has(U))}}function V(n){if(I(n))return()=>!1;const{op:r,value:l}=n;return m=>{const g=S(m).length;switch(r){case"gt":return g>l;case"gte":return g>=l;case"lt":return g<l;case"lte":return g<=l;default:return g===l}}}const x=Object.freeze({hasAny:Object.freeze({compile:n=>W("hasAny",n),check:T}),hasAll:Object.freeze({compile:n=>W("hasAll",n),check:T}),hasNone:Object.freeze({compile:n=>W("hasNone",n),check:T}),listCount:Object.freeze({compile:V,check:I})});function Q(n){return Object.freeze({base:"object",storage:"object",format:h,parse:j,items:S,compareFor:d,compare:d(null),groupProjector:r=>l=>y(l)?l:f(l,r),operators:x,memberOperator:"hasAny",defaults:{filter:n.filterFor("text"),editor:n.editor,align:"start",render:n.render},defaultsFor:r=>({filter:n.filterFor(J(r))}),totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:f,toStorage:F,fromClipboard:(r,l)=>j({...l||{},text:r})})}function J(n){const r=n&&n.base;return r==="number"||r==="boolean"?r:r==="date"||r==="dateString"?"date":"text"}}),G("packages/modules/list/messages.js",function(o,P){"use strict";Object.defineProperty(o,"withFallback",{enumerable:!0,get:function(){return w}});const E=Object.freeze({"filter.op.hasAny":"Has any of","filter.op.hasAll":"Has all of","filter.op.hasNone":"Has none of","filter.op.countGreaterThan":"More items than","filter.op.countLessThan":"Fewer items than","filter.op.countEquals":"Number of items is","filter.list.items":"Items, separated by commas","filter.list.count":"A number of items","list.more":"+{count}","list.moreLabel":"{count} more","list.add":"Add an item","list.remove":"Remove {item}","list.refused":'"{item}" is not a {type}, so it was not added'});function y(O,C){const N=E[O];return N===void 0?O:N.replace(/\{(\w+)\}/g,(L,S)=>C[S]===void 0?L:String(C[S]))}function w(O){return{t(C,N={}){const L=O&&typeof O.t=="function"?O.t(C,N):C;return L===C?y(C,N):L}}}}),G("packages/modules/list/filter.js",function(o,P){"use strict";Object.defineProperty(o,"ListFilter",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"listFilterFor",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return f}});const E=Z("@toclocoinc/lattice-grid"),y=E.ConditionFilter;if(typeof y>"u")throw new Error("[lattice] list needs ConditionFilter from the lattice-grid module. Load lattice-grid before list.");const w=E.createMessages;if(typeof w>"u")throw new Error("[lattice] list needs createMessages from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js"),C=O.splitItems,N=O.parseItem,L=O.joinerOf,B=P("packages/modules/list/messages.js").withFallback,v=Object.freeze(["hasAny","hasAll","hasNone","countGreaterThan","countLessThan","countEquals"]),R=Object.freeze({countGreaterThan:"gt",countLessThan:"lt",countEquals:"eq"}),F=Object.freeze({text:{operators:["contains","notContains","equals","notEqual","startsWith","endsWith"],wire:{contains:"contains",notContains:"notContains",equals:"eq",notEqual:"ne",startsWith:"startsWith",endsWith:"endsWith"},defaultOperator:"contains"},number:{operators:["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",lessThan:"lt",lessThanOrEqual:"lte",greaterThan:"gt",greaterThanOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},date:{operators:["equals","notEqual","before","beforeOrEqual","after","afterOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",before:"lt",beforeOrEqual:"lte",after:"gt",afterOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},boolean:{operators:["equals","notEqual"],wire:{equals:"eq",notEqual:"ne"},defaultOperator:"equals"}});class p extends y{static operators=Object.freeze([...F.text.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...F.text.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static type="list";static defaultOperator="contains";init(s){const u=s||{},d=u.messages||u.grid&&u.grid.messages||w();super.init({...u,messages:B(d)})}parseInput(s){const u=String(s??"").trim();return u===""?null:u}formatInput(s){if(s==null)return"";if(Array.isArray(s))return s.join(", ");if(typeof s=="object"){const u=s.value;return u==null?"":String(u)}return String(s)}nodes(){const s=this.conditions,u=[];try{for(const d of s){this.conditions=[d];for(const b of super.nodes()){const A=this.#n(d.op,b);A&&u.push(A)}}}finally{this.conditions=s}return u}#n(s,u){const d={column:this.params.column,locale:this.params.locale},b=u.op;if(b==="blank"||b==="notBlank")return u;if(R[s]){const T=Number(String(u.value).trim());return!Number.isInteger(T)||T<0?null:{...u,value:{op:R[s],value:T}}}if(b==="hasAny"||b==="hasAll"||b==="hasNone"){const T=C(String(u.value),L(this.params.column).trim()),I=[];for(const W of T){const V=N(W,d);if(V===void 0)return null;I.push(V)}return I.length?{...u,value:I}:null}if(Array.isArray(u.value)){const T=u.value.map(I=>typeof I=="string"?N(I,d):I);return T.some(I=>I===void 0)?null:{...u,value:T}}const A=typeof u.value=="string"?N(u.value,d):u.value;return A===void 0?null:{...u,value:A}}slotFrom(s){if(s&&s.op==="listCount"&&s.value&&typeof s.value=="object"){const{op:u,value:d}=s.value,b=u==="gt"||u==="gte"?"countGreaterThan":u==="lt"||u==="lte"?"countLessThan":"countEquals",A=u==="gte"?d-1:u==="lte"?d+1:d;return{op:b,value:String(A),value2:null,values:[]}}return super.slotFrom(s)}hintFor(s){return R[s]?this.messages.t("filter.list.count"):s==="hasAny"||s==="hasAll"||s==="hasNone"?this.messages.t("filter.list.items"):null}}const c=new Map([["text",p]]);function h(j){const s=c.get(j);if(s)return s;const u=F[j]||F.text;class d extends p{static operators=Object.freeze([...u.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...u.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static defaultOperator=u.defaultOperator}return c.set(j,d),d}const f=p}),G("packages/modules/list/editor.js",function(o,P){"use strict";Object.defineProperty(o,"ListEditor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return F}});const y=Z("@toclocoinc/lattice-grid").BaseEditor;if(typeof y>"u")throw new Error("[lattice] list needs BaseEditor from the lattice-grid module. Load lattice-grid before list.");const w=P("packages/modules/list/type.js"),O=w.itemsOf,C=w.itemText,N=w.splitItems,L=w.parseItem,S=w.joinerOf,v=P("packages/modules/list/messages.js").withFallback;class R extends y{static popup=!0;items=[];input=null;#n=null;#e=null;#t=null;#r=[];#s(){const c=this.params&&this.params.grid;return v(c&&c.messages)}build(){const c=this.doc,h=this.#s(),f=c.createElement("div");f.className="lat-list-editor";const j=c.createElement("span");j.className="lat-list-editor__tokens";const s=c.createElement("input");s.type="text",s.className="lat-list-editor__input",s.setAttribute("aria-label",h.t("list.add"));const u=c.createElement("span");u.className="lat-list-editor__error",u.setAttribute("role","alert"),u.hidden=!0,f.append(j,s,u),this.#n=j,this.#e=u,this.input=s,this.items=O(this.params.value).slice(),this.params.key&&this.params.key.length===1&&(s.value=this.params.key),this.#i();const d=A=>{A.key==="Enter"&&s.value.trim()!==""?(A.preventDefault(),A.stopPropagation(),this.#o(s.value)):A.key==="Backspace"&&s.value===""&&this.items.length&&(A.preventDefault(),this.items.pop(),this.#i())},b=A=>{const T=A.clipboardData?A.clipboardData.getData("text"):"";!T||!/[,\n\t]/.test(T)||(A.preventDefault(),this.#o(T.replace(/[\n\t]/g,",")))};return s.addEventListener("keydown",d),s.addEventListener("paste",b),this.#r.push(()=>s.removeEventListener("keydown",d)),this.#r.push(()=>s.removeEventListener("paste",b)),f}focusTarget(){return this.input}#o(c){const h=this.params.column,f=N(c,S(h).trim()),j={column:h,locale:this.params.locale};for(let s=0;s<f.length;s++){const u=L(f[s],j);if(u===void 0)return this.#t=f[s],this.input&&(this.input.value=f.slice(s).join(", ")),this.#i(),!1;this.items.push(u)}return this.#t=null,this.input&&(this.input.value=""),this.#i(),!0}#i(){const c=this.doc,h=this.#n;if(!h)return;const f=this.#s();h.replaceChildren();const j={column:this.params.column,locale:this.params.locale,grid:this.params.grid};this.items.forEach((u,d)=>{const b=c.createElement("span");b.className="lat-pill lat-v-neutral lat-list-editor__token";const A=C(u,j);b.append(c.createTextNode(A));const T=c.createElement("button");T.type="button",T.className="lat-list-editor__remove",T.setAttribute("aria-label",f.t("list.remove",{item:A})),T.textContent="×",T.addEventListener("click",I=>{I.preventDefault(),this.items.splice(d,1),this.#i(),this.input&&this.input.focus()}),b.append(T),h.append(b)});const s=this.#e;s&&(s.hidden=this.#t===null,s.textContent=this.#t===null?"":this.#u(this.#t)),this.input&&(this.#t===null?this.input.removeAttribute("aria-invalid"):this.input.setAttribute("aria-invalid","true"))}#u(c){const h=this.params.column,f=h&&h.itemType&&h.itemType.name||"text";return this.#s().t("list.refused",{item:c,type:f})}readValue(){const c=this.input?this.input.value.trim():"";if(!c)return this.items.slice();const h=N(c,S(this.params.column).trim()),f={column:this.params.column,locale:this.params.locale},j=this.items.slice();for(const s of h){const u=L(s,f);if(u===void 0)return j;j.push(u)}return j}checkValue(c){const h=this.input?this.input.value.trim():"";if(!h)return!0;const f=N(h,S(this.params.column).trim()),j={column:this.params.column,locale:this.params.locale},s=f.find(u=>L(u,j)===void 0);return s===void 0?!0:(this.#t=s,this.#i(),this.#u(s))}destroy(){for(const c of this.#r)c();this.#r.length=0,this.input=null,this.#n=null,this.#e=null,super.destroy()}}const F=R}),G("packages/modules/list/render.js",function(o,P){"use strict";Object.defineProperty(o,"ListChips",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return R}});const E=P("packages/modules/list/type.js"),y=E.itemsOf,w=E.itemText,O=E.formatList,N=P("packages/modules/list/messages.js").withFallback,L="lat-list",S="lat-pill lat-v-neutral lat-list__item",B="lat-pill lat-pill--more lat-list__more";class v{#n=null;#e=[];#t=null;#r=null;#s=[];#o=-1;#i=null;init(p){const c=p&&p.grid&&p.grid.document||globalThis.document,h=c.createElement("span");h.className=L;const f=c.createElement("span");f.className=B,f.hidden=!0,h.appendChild(f),this.#n=h,this.#t=f,this.#u(p)}element(){return this.#n}refresh(p){return this.#n?(this.#u(p),!0):!1}attached(){this.#l();const p=globalThis.ResizeObserver;typeof p=="function"&&this.#n&&!this.#i&&(this.#i=new p(()=>this.#l()),this.#i.observe(this.#n))}#u(p){this.#r=p;const c=this.#n,h=c.ownerDocument,f=p?p.value:null,s=(typeof f=="string"?[f]:y(f)).map(d=>typeof f=="string"?f:w(d,p));for(let d=this.#e.length;d<s.length;d++){const b=h.createElement("span");b.className=S,c.insertBefore(b,this.#t),this.#e.push(b)}for(let d=0;d<this.#e.length;d++){const b=this.#e[d];d<s.length?(b.textContent!==s[d]&&(b.textContent=s[d]),b.hidden=!1):b.hidden=!0}this.#s=s;const u=typeof f=="string"?f:O(p);u?c.setAttribute("title",u):c.removeAttribute("title"),this.#o=-1,this.#l()}#l(){const p=this.#n,c=this.#t;if(!p||!c||!p.isConnected)return;const h=p.clientWidth;if(h===this.#o)return;this.#o=h;const f=this.#s.length;for(let u=0;u<f;u++)this.#e[u].hidden=!1;if(c.hidden=!0,!f||p.scrollWidth<=h)return;const j=N(this.#r&&this.#r.grid&&this.#r.grid.messages);let s=f;for(;s>0&&(s--,this.#e[s].hidden=!0,c.hidden=!1,c.textContent=j.t("list.more",{count:f-s}),c.setAttribute("aria-label",j.t("list.moreLabel",{count:f-s})),!(p.scrollWidth<=h)););}destroy(){this.#i&&(this.#i.disconnect(),this.#i=null),this.#n=null,this.#t=null,this.#e=[],this.#r=null}}const R=v}),G("packages/modules/list/index.js",function(o,P){"use strict";Object.defineProperty(o,"listModule",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return p}});const y=Z("@toclocoinc/lattice-grid").registerModules;if(typeof y>"u")throw new Error("[lattice] list needs registerModules from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js").createListType,N=P("packages/modules/list/filter.js").listFilterFor,S=P("packages/modules/list/editor.js").ListEditor,v=P("packages/modules/list/render.js").ListChips,R=O({filterFor:N,editor:S,render:v}),F=Object.freeze({name:"list",capabilities:["dataType:list"],install(c){c.registry.register("dataType","list",R)}});y(F);const p=F});var H=re("packages/modules/list/index.js");if(typeof module=="object"&&module.exports)module.exports=H;else if(typeof define=="function"&&define.amd)define(function(){return H});else{var ae=K.LatticeGrid||(K.LatticeGrid={});for(var X in H)X!=="default"&&(ae[X]=H[X])}})(typeof globalThis<"u"?globalThis:this);
|
|
6
|
+
(function(K){"use strict";var te=Object.create(null),ne=Object.create(null);function G(o,P){te[o]=P}function re(o){var P=ne[o];if(P)return P;var E=Object.create(null);ne[o]=E;var y=te[o];if(!y)throw new Error("[lattice] missing module: "+o);return y(E,re),E}var ie=Object.create(null);ie["@toclocoinc/lattice-grid"]=K.LatticeGrid||null;function Z(o){var P=ie[o],E=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(P)return P;if(o==="@toclocoinc/lattice-grid"&&E&&E.LatticeGrid)return E.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: "+o)}G("packages/core/src/internal/util.js",function(o,P){"use strict";Object.defineProperty(o,"VERSION",{enumerable:!0,get:function(){return w}}),Object.defineProperty(o,"reportedWarnings",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"warnOnce",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"infoOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"resetWarnings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"invariant",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"DEV",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"isFunction",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"isNil",{enumerable:!0,get:function(){return b}}),Object.defineProperty(o,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"isCtor",{enumerable:!0,get:function(){return T}}),Object.defineProperty(o,"pathGetter",{enumerable:!0,get:function(){return W}}),Object.defineProperty(o,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"setPath",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"humanise",{enumerable:!0,get:function(){return n}}),Object.defineProperty(o,"escapeHtml",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"titleCase",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"expand",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"toArray",{enumerable:!0,get:function(){return k}}),Object.defineProperty(o,"merge",{enumerable:!0,get:function(){return U}}),Object.defineProperty(o,"mergeRow",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(o,"collator",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(o,"defaultCompare",{enumerable:!0,get:function(){return me}}),Object.defineProperty(o,"now",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(o,"nextFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"cancelFrame",{enumerable:!0,get:function(){return _}}),Object.defineProperty(o,"frameBatched",{enumerable:!0,get:function(){return de}}),Object.defineProperty(o,"settleDebounce",{enumerable:!0,get:function(){return he}}),Object.defineProperty(o,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(o,"uid",{enumerable:!0,get:function(){return be}});const E="1.89.1";async function y(){return E}const w="1.89.1",O=new Set,C=2e3;function N(e){if(O.add(e),O.size>C){const t=O.values().next().value;t!==void 0&&O.delete(t)}}const L=[],S=500;function B(e,t,i){L.push({key:e,level:t,message:i.map(a=>typeof a=="string"?a:v(a)).join(" "),at:Date.now()}),L.length>S&&L.shift()}function v(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function R(){return L.map(e=>({...e}))}function F(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function p(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"warn",i),console.warn("[lattice]",...i)}function c(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"info",i),console.info("[lattice]",...i)}function h(){O.clear(),L.length=0}function f(e,t){const i=new Error(`[lattice] ${e}`);throw t!==void 0&&(i.cause=t),i}function j(e,t){e||f(t)}const s=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function d(e){return typeof e=="function"}function b(e){return e==null}function A(e){return e==null||e===""}function T(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function W(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=i=>i?.[e];else{const i=e.split("."),a=i.length;t=M=>{let z=M;for(let q=0;q<a;q++){if(z==null)return;z=z[i[q]]}return z}}return I.set(e,t),t}const V=new Map;function x(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=(i,a)=>{i!=null&&(i[e]=a)};else{const i=e.split("."),a=i.length-1;t=(M,z)=>{let q=M;for(let $=0;$<a;$++){if(q==null)return;const ee=i[$];q[ee]==null&&(q[ee]={}),q=q[ee]}q!=null&&(q[i[a]]=z)}}return V.set(e,t),t}function Q(e,t){return W(t)(e)}function J(e,t,i){x(t)(e,i)}function n(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(/^./,i=>i.toUpperCase()):""}const r={"&":"&","<":"<",">":">",'"':""","'":"'"};function l(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,i=>r[i]):t}function m(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function g(e,t,i){if(e!==void 0)return e===!0?{enabled:!0,...i}:e===!1?{enabled:!1}:u(e)?e:{[t]:e,enabled:!0}}function k(e){return e==null?[]:Array.isArray(e)?e:[e]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function U(e,t){if(!u(e))return u(t)?{...t}:t;if(!u(t))return t===void 0?e:t;const i={...e};for(const a of Object.keys(t)){if(D.has(a))continue;const M=t[a];M!==void 0&&(i[a]=u(M)&&u(i[a])?U(i[a],M):M)}return i}function Y(e,t){if(!u(e)||!u(t)||e===t)return t;const i=Object.create(Object.getPrototypeOf(e));return Object.assign(i,e,t),i}class ce{#n;#e=new Map;#t;constructor(t=256,i=null){this.#n=t,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const i=this.#e;if(!i.has(t))return;const a=i.get(t);return i.delete(t),i.set(t,a),a}peek(t){return this.#e.get(t)}set(t,i){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,i),this.#r(),i}delete(t){const i=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(i,t),i}clear(){if(this.#t)for(const[t,i]of this.#e)this.#t(i,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const i=t.keys().next().value,a=t.get(i);t.delete(i),this.#t&&this.#t(a,i)}}}const se=new Map;function fe(e,t){const i=`${e||""}|${t?JSON.stringify(t):""}`;let a=se.get(i);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),se.set(i,a)),a}function me(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 i=String(e),a=String(t);return i<a?-1:i>a?1:0}function oe(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ue=typeof requestAnimationFrame=="function";function le(e){return ue?requestAnimationFrame(e):setTimeout(()=>e(oe()),16)}function _(e){e!=null&&(ue?cancelAnimationFrame(e):clearTimeout(e))}function de(e){let t=null,i=null;const a=()=>{t=null;const z=i;i=null,e(...z||[])},M=(...z)=>{i=z,t===null&&(t=le(a))};return M.cancel=()=>{_(t),t=null,i=null},M.flush=()=>{t!==null&&(_(t),a())},M}function he(e,t){let i=null,a=null;const M=()=>{if(i=null,a===null)return;const $=a;a=null,e(...$),z()},z=()=>{i=setTimeout(M,t),typeof i?.unref=="function"&&i.unref()},q=(...$)=>{i===null?(e(...$),z()):(a=$,clearTimeout(i),z())};return q.flush=()=>{if(i!==null&&clearTimeout(i),i=null,a===null)return;const $=a;a=null,e(...$)},q.cancel=()=>{i!==null&&clearTimeout(i),i=null,a=null},q.pending=()=>i!==null||a!==null,q}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let ge=0;function be(e="l"){return`${e}${(++ge).toString(36)}`}}),G("packages/modules/list/type.js",function(o,P){"use strict";Object.defineProperty(o,"LIST_OPERATORS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(o,"COUNT_COMPARISONS",{enumerable:!0,get:function(){return N}}),Object.defineProperty(o,"DEFAULT_JOINER",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"itemsOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(o,"joinerOf",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"storeList",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"itemText",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"formatList",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"listText",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"parseList",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"splitItems",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"parseItem",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"compareListFor",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"LIST_OPERATOR_SPECS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"createListType",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"familyOf",{enumerable:!0,get:function(){return J}});const E=P("packages/core/src/internal/util.js"),y=E.isNil,w=E.isFunction,O=E.warnOnce,C=Object.freeze(["hasAny","hasAll","hasNone","listCount"]),N=Object.freeze(["gt","gte","lt","lte","eq"]),L=", ";function S(n){if(y(n))return[];if(Array.isArray(n))return n;if(typeof n=="object"&&!ArrayBuffer.isView(n)){const r=n;if(w(r.toArray))return Array.from(r.toArray());if(w(r[Symbol.iterator]))return Array.from(r)}return[n]}function B(n){if(Array.isArray(n))return!0;if(!n||typeof n!="object"||ArrayBuffer.isView(n))return!1;const r=n;return w(r.toArray)||w(r[Symbol.iterator])}function v(n){const r=n&&n.typeOptions,l=r&&r.joiner;return typeof l=="string"&&l!==""?l:L}function R(n,r,l){if(y(n))return null;let m=n;if(typeof n=="bigint"&&(m=n<=BigInt(Number.MAX_SAFE_INTEGER)&&n>=BigInt(Number.MIN_SAFE_INTEGER)?Number(n):String(n)),!r)return m;if(w(r.toStorage)?m=r.toStorage(m,l):r.base==="number"&&typeof m=="string"?m=w(r.parse)?r.parse({text:m,column:null}):Number(m):r.base==="boolean"&&typeof m=="string"&&w(r.parse)&&(m=r.parse({text:m,column:null})),!(typeof m=="number"&&Number.isNaN(m)))return y(m)?void 0:m}function F(n,r){if(y(n))return null;const l=r&&r.colId||"?",m=r&&r.itemType;B(n)||O(`list:scalar:${l}`,`column "${l}" is a list column and received a single value (${typeof n}) where a list was expected; it is read as a one-item list. The row itself is not changed: pass an array to say so.`);const g=[];for(const k of S(n)){const D=R(k,m,r);if(D===void 0){O(`list:item:${l}`,`column "${l}" refused the item ${JSON.stringify(String(k))}: it is not a value of the item type "${m&&m.name||"text"}". The item is left out of the stored list rather than kept.`);continue}g.push(D)}return g.length?g:null}function p(n,r){if(y(n))return"";const l=r&&r.column,m=l&&l.itemType;return m&&w(m.format)?String(m.format({...r,value:n})??""):String(n)}function c(n,r){if(y(n))return"";const l=r&&r.itemType;return l&&w(l.toClipboard)?String(l.toClipboard(n)??""):String(n)}function h(n){const r=n&&n.value;return y(r)?"":typeof r=="string"?r:S(r).map(l=>p(l,n)).join(", ")}function f(n,r){return y(n)?"":typeof n=="string"?n:S(n).map(l=>c(l,r)).join(v(r))}function j(n){const r=String((n&&n.text)??"").trim();if(r==="")return[];const l=n&&n.column,m=v(l).trim(),g=s(r,m),k=[];for(const D of g){const U=u(D,n);if(U===void 0){const Y=l&&l.id||"?";return O(`list:parse:${Y}`,`column "${Y}" refused the item ${JSON.stringify(D)}: it is not a value of the item type "${l&&l.itemType&&l.itemType.name||"text"}". Nothing was stored.`),null}k.push(U)}return k}function s(n,r){const l=new Set([","]);r&&l.add(r);let m=[String(n)];for(const g of l)m=m.flatMap(k=>k.split(g));return m.map(g=>g.trim()).filter(g=>g!=="")}function u(n,r){const l=r&&r.column,m=l&&l.itemType;if(!m||!w(m.parse))return n;const g=m.parse({...r,text:n});if(!(y(g)||typeof g=="number"&&Number.isNaN(g)))return g}function d(n){const r=n&&w(n.itemCompare)?n.itemCompare:b;return(l,m)=>{const g=S(l),k=S(m);return g.length!==k.length?g.length<k.length?-1:1:g.length?r(g[0],k[0]):0}}function b(n,r){return y(n)?y(r)?0:1:y(r)||n<r?-1:n>r?1:0}function A(n){return n instanceof Date?n.getTime():typeof n=="number"?n:typeof n=="string"&&n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n}function T(n){return Array.isArray(n)?null:"it needs an array of items"}function I(n){const r=n;return!r||typeof r!="object"||Array.isArray(r)?"it needs { op, value }":N.includes(r.op)?typeof r.value!="number"||!Number.isFinite(r.value)?"its value must be a finite number":null:`its op must be one of ${N.join(", ")}`}function W(n,r){const l=Array.isArray(r)?r.map(A):[],m=new Set(l),g=k=>S(k).some(D=>m.has(A(D)));return n==="hasAny"?g:n==="hasNone"?k=>!g(k):k=>{if(!l.length)return!0;const D=new Set(S(k).map(A));return l.every(U=>D.has(U))}}function V(n){if(I(n))return()=>!1;const{op:r,value:l}=n;return m=>{const g=S(m).length;switch(r){case"gt":return g>l;case"gte":return g>=l;case"lt":return g<l;case"lte":return g<=l;default:return g===l}}}const x=Object.freeze({hasAny:Object.freeze({compile:n=>W("hasAny",n),check:T}),hasAll:Object.freeze({compile:n=>W("hasAll",n),check:T}),hasNone:Object.freeze({compile:n=>W("hasNone",n),check:T}),listCount:Object.freeze({compile:V,check:I})});function Q(n){return Object.freeze({base:"object",storage:"object",format:h,parse:j,items:S,compareFor:d,compare:d(null),groupProjector:r=>l=>y(l)?l:f(l,r),operators:x,memberOperator:"hasAny",defaults:{filter:n.filterFor("text"),editor:n.editor,align:"start",render:n.render},defaultsFor:r=>({filter:n.filterFor(J(r))}),totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:f,toStorage:F,fromClipboard:(r,l)=>j({...l||{},text:r})})}function J(n){const r=n&&n.base;return r==="number"||r==="boolean"?r:r==="date"||r==="dateString"?"date":"text"}}),G("packages/modules/list/messages.js",function(o,P){"use strict";Object.defineProperty(o,"withFallback",{enumerable:!0,get:function(){return w}});const E=Object.freeze({"filter.op.hasAny":"Has any of","filter.op.hasAll":"Has all of","filter.op.hasNone":"Has none of","filter.op.countGreaterThan":"More items than","filter.op.countLessThan":"Fewer items than","filter.op.countEquals":"Number of items is","filter.list.items":"Items, separated by commas","filter.list.count":"A number of items","list.more":"+{count}","list.moreLabel":"{count} more","list.add":"Add an item","list.remove":"Remove {item}","list.refused":'"{item}" is not a {type}, so it was not added'});function y(O,C){const N=E[O];return N===void 0?O:N.replace(/\{(\w+)\}/g,(L,S)=>C[S]===void 0?L:String(C[S]))}function w(O){return{t(C,N={}){const L=O&&typeof O.t=="function"?O.t(C,N):C;return L===C?y(C,N):L}}}}),G("packages/modules/list/filter.js",function(o,P){"use strict";Object.defineProperty(o,"ListFilter",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"listFilterFor",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return f}});const E=Z("@toclocoinc/lattice-grid"),y=E.ConditionFilter;if(typeof y>"u")throw new Error("[lattice] list needs ConditionFilter from the lattice-grid module. Load lattice-grid before list.");const w=E.createMessages;if(typeof w>"u")throw new Error("[lattice] list needs createMessages from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js"),C=O.splitItems,N=O.parseItem,L=O.joinerOf,B=P("packages/modules/list/messages.js").withFallback,v=Object.freeze(["hasAny","hasAll","hasNone","countGreaterThan","countLessThan","countEquals"]),R=Object.freeze({countGreaterThan:"gt",countLessThan:"lt",countEquals:"eq"}),F=Object.freeze({text:{operators:["contains","notContains","equals","notEqual","startsWith","endsWith"],wire:{contains:"contains",notContains:"notContains",equals:"eq",notEqual:"ne",startsWith:"startsWith",endsWith:"endsWith"},defaultOperator:"contains"},number:{operators:["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",lessThan:"lt",lessThanOrEqual:"lte",greaterThan:"gt",greaterThanOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},date:{operators:["equals","notEqual","before","beforeOrEqual","after","afterOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",before:"lt",beforeOrEqual:"lte",after:"gt",afterOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},boolean:{operators:["equals","notEqual"],wire:{equals:"eq",notEqual:"ne"},defaultOperator:"equals"}});class p extends y{static operators=Object.freeze([...F.text.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...F.text.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static type="list";static defaultOperator="contains";init(s){const u=s||{},d=u.messages||u.grid&&u.grid.messages||w();super.init({...u,messages:B(d)})}parseInput(s){const u=String(s??"").trim();return u===""?null:u}formatInput(s){if(s==null)return"";if(Array.isArray(s))return s.join(", ");if(typeof s=="object"){const u=s.value;return u==null?"":String(u)}return String(s)}nodes(){const s=this.conditions,u=[];try{for(const d of s){this.conditions=[d];for(const b of super.nodes()){const A=this.#n(d.op,b);A&&u.push(A)}}}finally{this.conditions=s}return u}#n(s,u){const d={column:this.params.column,locale:this.params.locale},b=u.op;if(b==="blank"||b==="notBlank")return u;if(R[s]){const T=Number(String(u.value).trim());return!Number.isInteger(T)||T<0?null:{...u,value:{op:R[s],value:T}}}if(b==="hasAny"||b==="hasAll"||b==="hasNone"){const T=C(String(u.value),L(this.params.column).trim()),I=[];for(const W of T){const V=N(W,d);if(V===void 0)return null;I.push(V)}return I.length?{...u,value:I}:null}if(Array.isArray(u.value)){const T=u.value.map(I=>typeof I=="string"?N(I,d):I);return T.some(I=>I===void 0)?null:{...u,value:T}}const A=typeof u.value=="string"?N(u.value,d):u.value;return A===void 0?null:{...u,value:A}}slotFrom(s){if(s&&s.op==="listCount"&&s.value&&typeof s.value=="object"){const{op:u,value:d}=s.value,b=u==="gt"||u==="gte"?"countGreaterThan":u==="lt"||u==="lte"?"countLessThan":"countEquals",A=u==="gte"?d-1:u==="lte"?d+1:d;return{op:b,value:String(A),value2:null,values:[]}}return super.slotFrom(s)}hintFor(s){return R[s]?this.messages.t("filter.list.count"):s==="hasAny"||s==="hasAll"||s==="hasNone"?this.messages.t("filter.list.items"):null}}const c=new Map([["text",p]]);function h(j){const s=c.get(j);if(s)return s;const u=F[j]||F.text;class d extends p{static operators=Object.freeze([...u.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...u.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static defaultOperator=u.defaultOperator}return c.set(j,d),d}const f=p}),G("packages/modules/list/editor.js",function(o,P){"use strict";Object.defineProperty(o,"ListEditor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return F}});const y=Z("@toclocoinc/lattice-grid").BaseEditor;if(typeof y>"u")throw new Error("[lattice] list needs BaseEditor from the lattice-grid module. Load lattice-grid before list.");const w=P("packages/modules/list/type.js"),O=w.itemsOf,C=w.itemText,N=w.splitItems,L=w.parseItem,S=w.joinerOf,v=P("packages/modules/list/messages.js").withFallback;class R extends y{static popup=!0;items=[];input=null;#n=null;#e=null;#t=null;#r=[];#s(){const c=this.params&&this.params.grid;return v(c&&c.messages)}build(){const c=this.doc,h=this.#s(),f=c.createElement("div");f.className="lat-list-editor";const j=c.createElement("span");j.className="lat-list-editor__tokens";const s=c.createElement("input");s.type="text",s.className="lat-list-editor__input",s.setAttribute("aria-label",h.t("list.add"));const u=c.createElement("span");u.className="lat-list-editor__error",u.setAttribute("role","alert"),u.hidden=!0,f.append(j,s,u),this.#n=j,this.#e=u,this.input=s,this.items=O(this.params.value).slice(),this.params.key&&this.params.key.length===1&&(s.value=this.params.key),this.#i();const d=A=>{A.key==="Enter"&&s.value.trim()!==""?(A.preventDefault(),A.stopPropagation(),this.#o(s.value)):A.key==="Backspace"&&s.value===""&&this.items.length&&(A.preventDefault(),this.items.pop(),this.#i())},b=A=>{const T=A.clipboardData?A.clipboardData.getData("text"):"";!T||!/[,\n\t]/.test(T)||(A.preventDefault(),this.#o(T.replace(/[\n\t]/g,",")))};return s.addEventListener("keydown",d),s.addEventListener("paste",b),this.#r.push(()=>s.removeEventListener("keydown",d)),this.#r.push(()=>s.removeEventListener("paste",b)),f}focusTarget(){return this.input}#o(c){const h=this.params.column,f=N(c,S(h).trim()),j={column:h,locale:this.params.locale};for(let s=0;s<f.length;s++){const u=L(f[s],j);if(u===void 0)return this.#t=f[s],this.input&&(this.input.value=f.slice(s).join(", ")),this.#i(),!1;this.items.push(u)}return this.#t=null,this.input&&(this.input.value=""),this.#i(),!0}#i(){const c=this.doc,h=this.#n;if(!h)return;const f=this.#s();h.replaceChildren();const j={column:this.params.column,locale:this.params.locale,grid:this.params.grid};this.items.forEach((u,d)=>{const b=c.createElement("span");b.className="lat-pill lat-v-neutral lat-list-editor__token";const A=C(u,j);b.append(c.createTextNode(A));const T=c.createElement("button");T.type="button",T.className="lat-list-editor__remove",T.setAttribute("aria-label",f.t("list.remove",{item:A})),T.textContent="×",T.addEventListener("click",I=>{I.preventDefault(),this.items.splice(d,1),this.#i(),this.input&&this.input.focus()}),b.append(T),h.append(b)});const s=this.#e;s&&(s.hidden=this.#t===null,s.textContent=this.#t===null?"":this.#u(this.#t)),this.input&&(this.#t===null?this.input.removeAttribute("aria-invalid"):this.input.setAttribute("aria-invalid","true"))}#u(c){const h=this.params.column,f=h&&h.itemType&&h.itemType.name||"text";return this.#s().t("list.refused",{item:c,type:f})}readValue(){const c=this.input?this.input.value.trim():"";if(!c)return this.items.slice();const h=N(c,S(this.params.column).trim()),f={column:this.params.column,locale:this.params.locale},j=this.items.slice();for(const s of h){const u=L(s,f);if(u===void 0)return j;j.push(u)}return j}checkValue(c){const h=this.input?this.input.value.trim():"";if(!h)return!0;const f=N(h,S(this.params.column).trim()),j={column:this.params.column,locale:this.params.locale},s=f.find(u=>L(u,j)===void 0);return s===void 0?!0:(this.#t=s,this.#i(),this.#u(s))}destroy(){for(const c of this.#r)c();this.#r.length=0,this.input=null,this.#n=null,this.#e=null,super.destroy()}}const F=R}),G("packages/modules/list/render.js",function(o,P){"use strict";Object.defineProperty(o,"ListChips",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return R}});const E=P("packages/modules/list/type.js"),y=E.itemsOf,w=E.itemText,O=E.formatList,N=P("packages/modules/list/messages.js").withFallback,L="lat-list",S="lat-pill lat-v-neutral lat-list__item",B="lat-pill lat-pill--more lat-list__more";class v{#n=null;#e=[];#t=null;#r=null;#s=[];#o=-1;#i=null;init(p){const c=p&&p.grid&&p.grid.document||globalThis.document,h=c.createElement("span");h.className=L;const f=c.createElement("span");f.className=B,f.hidden=!0,h.appendChild(f),this.#n=h,this.#t=f,this.#u(p)}element(){return this.#n}refresh(p){return this.#n?(this.#u(p),!0):!1}attached(){this.#l();const p=globalThis.ResizeObserver;typeof p=="function"&&this.#n&&!this.#i&&(this.#i=new p(()=>this.#l()),this.#i.observe(this.#n))}#u(p){this.#r=p;const c=this.#n,h=c.ownerDocument,f=p?p.value:null,s=(typeof f=="string"?[f]:y(f)).map(d=>typeof f=="string"?f:w(d,p));for(let d=this.#e.length;d<s.length;d++){const b=h.createElement("span");b.className=S,c.insertBefore(b,this.#t),this.#e.push(b)}for(let d=0;d<this.#e.length;d++){const b=this.#e[d];d<s.length?(b.textContent!==s[d]&&(b.textContent=s[d]),b.hidden=!1):b.hidden=!0}this.#s=s;const u=typeof f=="string"?f:O(p);u?c.setAttribute("title",u):c.removeAttribute("title"),this.#o=-1,this.#l()}#l(){const p=this.#n,c=this.#t;if(!p||!c||!p.isConnected)return;const h=p.clientWidth;if(h===this.#o)return;this.#o=h;const f=this.#s.length;for(let u=0;u<f;u++)this.#e[u].hidden=!1;if(c.hidden=!0,!f||p.scrollWidth<=h)return;const j=N(this.#r&&this.#r.grid&&this.#r.grid.messages);let s=f;for(;s>0&&(s--,this.#e[s].hidden=!0,c.hidden=!1,c.textContent=j.t("list.more",{count:f-s}),c.setAttribute("aria-label",j.t("list.moreLabel",{count:f-s})),!(p.scrollWidth<=h)););}destroy(){this.#i&&(this.#i.disconnect(),this.#i=null),this.#n=null,this.#t=null,this.#e=[],this.#r=null}}const R=v}),G("packages/modules/list/index.js",function(o,P){"use strict";Object.defineProperty(o,"listModule",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return p}});const y=Z("@toclocoinc/lattice-grid").registerModules;if(typeof y>"u")throw new Error("[lattice] list needs registerModules from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js").createListType,N=P("packages/modules/list/filter.js").listFilterFor,S=P("packages/modules/list/editor.js").ListEditor,v=P("packages/modules/list/render.js").ListChips,R=O({filterFor:N,editor:S,render:v}),F=Object.freeze({name:"list",capabilities:["dataType:list"],install(c){c.registry.register("dataType","list",R)}});y(F);const p=F});var H=re("packages/modules/list/index.js");if(typeof module=="object"&&module.exports)module.exports=H;else if(typeof define=="function"&&define.amd)define(function(){return H});else{var ae=K.LatticeGrid||(K.LatticeGrid={});for(var X in H)X!=="default"&&(ae[X]=H[X])}})(typeof globalThis<"u"?globalThis:this);
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=list.min.js.map
|
package/modules/list.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, list module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(K){"use strict";var te=Object.create(null),ne=Object.create(null);function G(o,P){te[o]=P}function re(o){var P=ne[o];if(P)return P;var E=Object.create(null);ne[o]=E;var y=te[o];if(!y)throw new Error("[lattice] missing module: "+o);return y(E,re),E}var ie=Object.create(null);ie["@toclocoinc/lattice-grid"]=K.LatticeGrid||null;function Z(o){var P=ie[o],E=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(P)return P;if(o==="@toclocoinc/lattice-grid"&&E&&E.LatticeGrid)return E.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: "+o)}G("packages/core/src/internal/util.js",function(o,P){"use strict";Object.defineProperty(o,"VERSION",{enumerable:!0,get:function(){return w}}),Object.defineProperty(o,"reportedWarnings",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"warnOnce",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"infoOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"resetWarnings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"invariant",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"DEV",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"isFunction",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"isNil",{enumerable:!0,get:function(){return b}}),Object.defineProperty(o,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"isCtor",{enumerable:!0,get:function(){return T}}),Object.defineProperty(o,"pathGetter",{enumerable:!0,get:function(){return W}}),Object.defineProperty(o,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"setPath",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"humanise",{enumerable:!0,get:function(){return n}}),Object.defineProperty(o,"escapeHtml",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"titleCase",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"expand",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"toArray",{enumerable:!0,get:function(){return k}}),Object.defineProperty(o,"merge",{enumerable:!0,get:function(){return U}}),Object.defineProperty(o,"mergeRow",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(o,"collator",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(o,"defaultCompare",{enumerable:!0,get:function(){return me}}),Object.defineProperty(o,"now",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(o,"nextFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"cancelFrame",{enumerable:!0,get:function(){return _}}),Object.defineProperty(o,"frameBatched",{enumerable:!0,get:function(){return de}}),Object.defineProperty(o,"settleDebounce",{enumerable:!0,get:function(){return he}}),Object.defineProperty(o,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(o,"uid",{enumerable:!0,get:function(){return be}});const E="1.89.0";async function y(){return E}const w="1.89.0",O=new Set,C=2e3;function N(e){if(O.add(e),O.size>C){const t=O.values().next().value;t!==void 0&&O.delete(t)}}const L=[],S=500;function B(e,t,i){L.push({key:e,level:t,message:i.map(a=>typeof a=="string"?a:v(a)).join(" "),at:Date.now()}),L.length>S&&L.shift()}function v(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function R(){return L.map(e=>({...e}))}function F(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function p(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"warn",i),console.warn("[lattice]",...i)}function c(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"info",i),console.info("[lattice]",...i)}function h(){O.clear(),L.length=0}function f(e,t){const i=new Error(`[lattice] ${e}`);throw t!==void 0&&(i.cause=t),i}function j(e,t){e||f(t)}const s=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function d(e){return typeof e=="function"}function b(e){return e==null}function A(e){return e==null||e===""}function T(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function W(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=i=>i?.[e];else{const i=e.split("."),a=i.length;t=M=>{let z=M;for(let q=0;q<a;q++){if(z==null)return;z=z[i[q]]}return z}}return I.set(e,t),t}const V=new Map;function x(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=(i,a)=>{i!=null&&(i[e]=a)};else{const i=e.split("."),a=i.length-1;t=(M,z)=>{let q=M;for(let $=0;$<a;$++){if(q==null)return;const ee=i[$];q[ee]==null&&(q[ee]={}),q=q[ee]}q!=null&&(q[i[a]]=z)}}return V.set(e,t),t}function Q(e,t){return W(t)(e)}function J(e,t,i){x(t)(e,i)}function n(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(/^./,i=>i.toUpperCase()):""}const r={"&":"&","<":"<",">":">",'"':""","'":"'"};function l(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,i=>r[i]):t}function m(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function g(e,t,i){if(e!==void 0)return e===!0?{enabled:!0,...i}:e===!1?{enabled:!1}:u(e)?e:{[t]:e,enabled:!0}}function k(e){return e==null?[]:Array.isArray(e)?e:[e]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function U(e,t){if(!u(e))return u(t)?{...t}:t;if(!u(t))return t===void 0?e:t;const i={...e};for(const a of Object.keys(t)){if(D.has(a))continue;const M=t[a];M!==void 0&&(i[a]=u(M)&&u(i[a])?U(i[a],M):M)}return i}function Y(e,t){if(!u(e)||!u(t)||e===t)return t;const i=Object.create(Object.getPrototypeOf(e));return Object.assign(i,e,t),i}class ce{#n;#e=new Map;#t;constructor(t=256,i=null){this.#n=t,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const i=this.#e;if(!i.has(t))return;const a=i.get(t);return i.delete(t),i.set(t,a),a}peek(t){return this.#e.get(t)}set(t,i){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,i),this.#r(),i}delete(t){const i=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(i,t),i}clear(){if(this.#t)for(const[t,i]of this.#e)this.#t(i,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const i=t.keys().next().value,a=t.get(i);t.delete(i),this.#t&&this.#t(a,i)}}}const se=new Map;function fe(e,t){const i=`${e||""}|${t?JSON.stringify(t):""}`;let a=se.get(i);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),se.set(i,a)),a}function me(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 i=String(e),a=String(t);return i<a?-1:i>a?1:0}function oe(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ue=typeof requestAnimationFrame=="function";function le(e){return ue?requestAnimationFrame(e):setTimeout(()=>e(oe()),16)}function _(e){e!=null&&(ue?cancelAnimationFrame(e):clearTimeout(e))}function de(e){let t=null,i=null;const a=()=>{t=null;const z=i;i=null,e(...z||[])},M=(...z)=>{i=z,t===null&&(t=le(a))};return M.cancel=()=>{_(t),t=null,i=null},M.flush=()=>{t!==null&&(_(t),a())},M}function he(e,t){let i=null,a=null;const M=()=>{if(i=null,a===null)return;const $=a;a=null,e(...$),z()},z=()=>{i=setTimeout(M,t),typeof i?.unref=="function"&&i.unref()},q=(...$)=>{i===null?(e(...$),z()):(a=$,clearTimeout(i),z())};return q.flush=()=>{if(i!==null&&clearTimeout(i),i=null,a===null)return;const $=a;a=null,e(...$)},q.cancel=()=>{i!==null&&clearTimeout(i),i=null,a=null},q.pending=()=>i!==null||a!==null,q}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let ge=0;function be(e="l"){return`${e}${(++ge).toString(36)}`}}),G("packages/modules/list/type.js",function(o,P){"use strict";Object.defineProperty(o,"LIST_OPERATORS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(o,"COUNT_COMPARISONS",{enumerable:!0,get:function(){return N}}),Object.defineProperty(o,"DEFAULT_JOINER",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"itemsOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(o,"joinerOf",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"storeList",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"itemText",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"formatList",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"listText",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"parseList",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"splitItems",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"parseItem",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"compareListFor",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"LIST_OPERATOR_SPECS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"createListType",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"familyOf",{enumerable:!0,get:function(){return J}});const E=P("packages/core/src/internal/util.js"),y=E.isNil,w=E.isFunction,O=E.warnOnce,C=Object.freeze(["hasAny","hasAll","hasNone","listCount"]),N=Object.freeze(["gt","gte","lt","lte","eq"]),L=", ";function S(n){if(y(n))return[];if(Array.isArray(n))return n;if(typeof n=="object"&&!ArrayBuffer.isView(n)){const r=n;if(w(r.toArray))return Array.from(r.toArray());if(w(r[Symbol.iterator]))return Array.from(r)}return[n]}function B(n){if(Array.isArray(n))return!0;if(!n||typeof n!="object"||ArrayBuffer.isView(n))return!1;const r=n;return w(r.toArray)||w(r[Symbol.iterator])}function v(n){const r=n&&n.typeOptions,l=r&&r.joiner;return typeof l=="string"&&l!==""?l:L}function R(n,r,l){if(y(n))return null;let m=n;if(typeof n=="bigint"&&(m=n<=BigInt(Number.MAX_SAFE_INTEGER)&&n>=BigInt(Number.MIN_SAFE_INTEGER)?Number(n):String(n)),!r)return m;if(w(r.toStorage)?m=r.toStorage(m,l):r.base==="number"&&typeof m=="string"?m=w(r.parse)?r.parse({text:m,column:null}):Number(m):r.base==="boolean"&&typeof m=="string"&&w(r.parse)&&(m=r.parse({text:m,column:null})),!(typeof m=="number"&&Number.isNaN(m)))return y(m)?void 0:m}function F(n,r){if(y(n))return null;const l=r&&r.colId||"?",m=r&&r.itemType;B(n)||O(`list:scalar:${l}`,`column "${l}" is a list column and received a single value (${typeof n}) where a list was expected; it is read as a one-item list. The row itself is not changed: pass an array to say so.`);const g=[];for(const k of S(n)){const D=R(k,m,r);if(D===void 0){O(`list:item:${l}`,`column "${l}" refused the item ${JSON.stringify(String(k))}: it is not a value of the item type "${m&&m.name||"text"}". The item is left out of the stored list rather than kept.`);continue}g.push(D)}return g.length?g:null}function p(n,r){if(y(n))return"";const l=r&&r.column,m=l&&l.itemType;return m&&w(m.format)?String(m.format({...r,value:n})??""):String(n)}function c(n,r){if(y(n))return"";const l=r&&r.itemType;return l&&w(l.toClipboard)?String(l.toClipboard(n)??""):String(n)}function h(n){const r=n&&n.value;return y(r)?"":typeof r=="string"?r:S(r).map(l=>p(l,n)).join(", ")}function f(n,r){return y(n)?"":typeof n=="string"?n:S(n).map(l=>c(l,r)).join(v(r))}function j(n){const r=String((n&&n.text)??"").trim();if(r==="")return[];const l=n&&n.column,m=v(l).trim(),g=s(r,m),k=[];for(const D of g){const U=u(D,n);if(U===void 0){const Y=l&&l.id||"?";return O(`list:parse:${Y}`,`column "${Y}" refused the item ${JSON.stringify(D)}: it is not a value of the item type "${l&&l.itemType&&l.itemType.name||"text"}". Nothing was stored.`),null}k.push(U)}return k}function s(n,r){const l=new Set([","]);r&&l.add(r);let m=[String(n)];for(const g of l)m=m.flatMap(k=>k.split(g));return m.map(g=>g.trim()).filter(g=>g!=="")}function u(n,r){const l=r&&r.column,m=l&&l.itemType;if(!m||!w(m.parse))return n;const g=m.parse({...r,text:n});if(!(y(g)||typeof g=="number"&&Number.isNaN(g)))return g}function d(n){const r=n&&w(n.itemCompare)?n.itemCompare:b;return(l,m)=>{const g=S(l),k=S(m);return g.length!==k.length?g.length<k.length?-1:1:g.length?r(g[0],k[0]):0}}function b(n,r){return y(n)?y(r)?0:1:y(r)||n<r?-1:n>r?1:0}function A(n){return n instanceof Date?n.getTime():typeof n=="number"?n:typeof n=="string"&&n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n}function T(n){return Array.isArray(n)?null:"it needs an array of items"}function I(n){const r=n;return!r||typeof r!="object"||Array.isArray(r)?"it needs { op, value }":N.includes(r.op)?typeof r.value!="number"||!Number.isFinite(r.value)?"its value must be a finite number":null:`its op must be one of ${N.join(", ")}`}function W(n,r){const l=Array.isArray(r)?r.map(A):[],m=new Set(l),g=k=>S(k).some(D=>m.has(A(D)));return n==="hasAny"?g:n==="hasNone"?k=>!g(k):k=>{if(!l.length)return!0;const D=new Set(S(k).map(A));return l.every(U=>D.has(U))}}function V(n){if(I(n))return()=>!1;const{op:r,value:l}=n;return m=>{const g=S(m).length;switch(r){case"gt":return g>l;case"gte":return g>=l;case"lt":return g<l;case"lte":return g<=l;default:return g===l}}}const x=Object.freeze({hasAny:Object.freeze({compile:n=>W("hasAny",n),check:T}),hasAll:Object.freeze({compile:n=>W("hasAll",n),check:T}),hasNone:Object.freeze({compile:n=>W("hasNone",n),check:T}),listCount:Object.freeze({compile:V,check:I})});function Q(n){return Object.freeze({base:"object",storage:"object",format:h,parse:j,items:S,compareFor:d,compare:d(null),groupProjector:r=>l=>y(l)?l:f(l,r),operators:x,memberOperator:"hasAny",defaults:{filter:n.filterFor("text"),editor:n.editor,align:"start",render:n.render},defaultsFor:r=>({filter:n.filterFor(J(r))}),totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:f,toStorage:F,fromClipboard:(r,l)=>j({...l||{},text:r})})}function J(n){const r=n&&n.base;return r==="number"||r==="boolean"?r:r==="date"||r==="dateString"?"date":"text"}}),G("packages/modules/list/messages.js",function(o,P){"use strict";Object.defineProperty(o,"withFallback",{enumerable:!0,get:function(){return w}});const E=Object.freeze({"filter.op.hasAny":"Has any of","filter.op.hasAll":"Has all of","filter.op.hasNone":"Has none of","filter.op.countGreaterThan":"More items than","filter.op.countLessThan":"Fewer items than","filter.op.countEquals":"Number of items is","filter.list.items":"Items, separated by commas","filter.list.count":"A number of items","list.more":"+{count}","list.moreLabel":"{count} more","list.add":"Add an item","list.remove":"Remove {item}","list.refused":'"{item}" is not a {type}, so it was not added'});function y(O,C){const N=E[O];return N===void 0?O:N.replace(/\{(\w+)\}/g,(L,S)=>C[S]===void 0?L:String(C[S]))}function w(O){return{t(C,N={}){const L=O&&typeof O.t=="function"?O.t(C,N):C;return L===C?y(C,N):L}}}}),G("packages/modules/list/filter.js",function(o,P){"use strict";Object.defineProperty(o,"ListFilter",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"listFilterFor",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return f}});const E=Z("@toclocoinc/lattice-grid"),y=E.ConditionFilter;if(typeof y>"u")throw new Error("[lattice] list needs ConditionFilter from the lattice-grid module. Load lattice-grid before list.");const w=E.createMessages;if(typeof w>"u")throw new Error("[lattice] list needs createMessages from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js"),C=O.splitItems,N=O.parseItem,L=O.joinerOf,B=P("packages/modules/list/messages.js").withFallback,v=Object.freeze(["hasAny","hasAll","hasNone","countGreaterThan","countLessThan","countEquals"]),R=Object.freeze({countGreaterThan:"gt",countLessThan:"lt",countEquals:"eq"}),F=Object.freeze({text:{operators:["contains","notContains","equals","notEqual","startsWith","endsWith"],wire:{contains:"contains",notContains:"notContains",equals:"eq",notEqual:"ne",startsWith:"startsWith",endsWith:"endsWith"},defaultOperator:"contains"},number:{operators:["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",lessThan:"lt",lessThanOrEqual:"lte",greaterThan:"gt",greaterThanOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},date:{operators:["equals","notEqual","before","beforeOrEqual","after","afterOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",before:"lt",beforeOrEqual:"lte",after:"gt",afterOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},boolean:{operators:["equals","notEqual"],wire:{equals:"eq",notEqual:"ne"},defaultOperator:"equals"}});class p extends y{static operators=Object.freeze([...F.text.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...F.text.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static type="list";static defaultOperator="contains";init(s){const u=s||{},d=u.messages||u.grid&&u.grid.messages||w();super.init({...u,messages:B(d)})}parseInput(s){const u=String(s??"").trim();return u===""?null:u}formatInput(s){if(s==null)return"";if(Array.isArray(s))return s.join(", ");if(typeof s=="object"){const u=s.value;return u==null?"":String(u)}return String(s)}nodes(){const s=this.conditions,u=[];try{for(const d of s){this.conditions=[d];for(const b of super.nodes()){const A=this.#n(d.op,b);A&&u.push(A)}}}finally{this.conditions=s}return u}#n(s,u){const d={column:this.params.column,locale:this.params.locale},b=u.op;if(b==="blank"||b==="notBlank")return u;if(R[s]){const T=Number(String(u.value).trim());return!Number.isInteger(T)||T<0?null:{...u,value:{op:R[s],value:T}}}if(b==="hasAny"||b==="hasAll"||b==="hasNone"){const T=C(String(u.value),L(this.params.column).trim()),I=[];for(const W of T){const V=N(W,d);if(V===void 0)return null;I.push(V)}return I.length?{...u,value:I}:null}if(Array.isArray(u.value)){const T=u.value.map(I=>typeof I=="string"?N(I,d):I);return T.some(I=>I===void 0)?null:{...u,value:T}}const A=typeof u.value=="string"?N(u.value,d):u.value;return A===void 0?null:{...u,value:A}}slotFrom(s){if(s&&s.op==="listCount"&&s.value&&typeof s.value=="object"){const{op:u,value:d}=s.value,b=u==="gt"||u==="gte"?"countGreaterThan":u==="lt"||u==="lte"?"countLessThan":"countEquals",A=u==="gte"?d-1:u==="lte"?d+1:d;return{op:b,value:String(A),value2:null,values:[]}}return super.slotFrom(s)}hintFor(s){return R[s]?this.messages.t("filter.list.count"):s==="hasAny"||s==="hasAll"||s==="hasNone"?this.messages.t("filter.list.items"):null}}const c=new Map([["text",p]]);function h(j){const s=c.get(j);if(s)return s;const u=F[j]||F.text;class d extends p{static operators=Object.freeze([...u.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...u.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static defaultOperator=u.defaultOperator}return c.set(j,d),d}const f=p}),G("packages/modules/list/editor.js",function(o,P){"use strict";Object.defineProperty(o,"ListEditor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return F}});const y=Z("@toclocoinc/lattice-grid").BaseEditor;if(typeof y>"u")throw new Error("[lattice] list needs BaseEditor from the lattice-grid module. Load lattice-grid before list.");const w=P("packages/modules/list/type.js"),O=w.itemsOf,C=w.itemText,N=w.splitItems,L=w.parseItem,S=w.joinerOf,v=P("packages/modules/list/messages.js").withFallback;class R extends y{static popup=!0;items=[];input=null;#n=null;#e=null;#t=null;#r=[];#s(){const c=this.params&&this.params.grid;return v(c&&c.messages)}build(){const c=this.doc,h=this.#s(),f=c.createElement("div");f.className="lat-list-editor";const j=c.createElement("span");j.className="lat-list-editor__tokens";const s=c.createElement("input");s.type="text",s.className="lat-list-editor__input",s.setAttribute("aria-label",h.t("list.add"));const u=c.createElement("span");u.className="lat-list-editor__error",u.setAttribute("role","alert"),u.hidden=!0,f.append(j,s,u),this.#n=j,this.#e=u,this.input=s,this.items=O(this.params.value).slice(),this.params.key&&this.params.key.length===1&&(s.value=this.params.key),this.#i();const d=A=>{A.key==="Enter"&&s.value.trim()!==""?(A.preventDefault(),A.stopPropagation(),this.#o(s.value)):A.key==="Backspace"&&s.value===""&&this.items.length&&(A.preventDefault(),this.items.pop(),this.#i())},b=A=>{const T=A.clipboardData?A.clipboardData.getData("text"):"";!T||!/[,\n\t]/.test(T)||(A.preventDefault(),this.#o(T.replace(/[\n\t]/g,",")))};return s.addEventListener("keydown",d),s.addEventListener("paste",b),this.#r.push(()=>s.removeEventListener("keydown",d)),this.#r.push(()=>s.removeEventListener("paste",b)),f}focusTarget(){return this.input}#o(c){const h=this.params.column,f=N(c,S(h).trim()),j={column:h,locale:this.params.locale};for(let s=0;s<f.length;s++){const u=L(f[s],j);if(u===void 0)return this.#t=f[s],this.input&&(this.input.value=f.slice(s).join(", ")),this.#i(),!1;this.items.push(u)}return this.#t=null,this.input&&(this.input.value=""),this.#i(),!0}#i(){const c=this.doc,h=this.#n;if(!h)return;const f=this.#s();h.replaceChildren();const j={column:this.params.column,locale:this.params.locale,grid:this.params.grid};this.items.forEach((u,d)=>{const b=c.createElement("span");b.className="lat-pill lat-v-neutral lat-list-editor__token";const A=C(u,j);b.append(c.createTextNode(A));const T=c.createElement("button");T.type="button",T.className="lat-list-editor__remove",T.setAttribute("aria-label",f.t("list.remove",{item:A})),T.textContent="×",T.addEventListener("click",I=>{I.preventDefault(),this.items.splice(d,1),this.#i(),this.input&&this.input.focus()}),b.append(T),h.append(b)});const s=this.#e;s&&(s.hidden=this.#t===null,s.textContent=this.#t===null?"":this.#u(this.#t)),this.input&&(this.#t===null?this.input.removeAttribute("aria-invalid"):this.input.setAttribute("aria-invalid","true"))}#u(c){const h=this.params.column,f=h&&h.itemType&&h.itemType.name||"text";return this.#s().t("list.refused",{item:c,type:f})}readValue(){const c=this.input?this.input.value.trim():"";if(!c)return this.items.slice();const h=N(c,S(this.params.column).trim()),f={column:this.params.column,locale:this.params.locale},j=this.items.slice();for(const s of h){const u=L(s,f);if(u===void 0)return j;j.push(u)}return j}checkValue(c){const h=this.input?this.input.value.trim():"";if(!h)return!0;const f=N(h,S(this.params.column).trim()),j={column:this.params.column,locale:this.params.locale},s=f.find(u=>L(u,j)===void 0);return s===void 0?!0:(this.#t=s,this.#i(),this.#u(s))}destroy(){for(const c of this.#r)c();this.#r.length=0,this.input=null,this.#n=null,this.#e=null,super.destroy()}}const F=R}),G("packages/modules/list/render.js",function(o,P){"use strict";Object.defineProperty(o,"ListChips",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return R}});const E=P("packages/modules/list/type.js"),y=E.itemsOf,w=E.itemText,O=E.formatList,N=P("packages/modules/list/messages.js").withFallback,L="lat-list",S="lat-pill lat-v-neutral lat-list__item",B="lat-pill lat-pill--more lat-list__more";class v{#n=null;#e=[];#t=null;#r=null;#s=[];#o=-1;#i=null;init(p){const c=p&&p.grid&&p.grid.document||globalThis.document,h=c.createElement("span");h.className=L;const f=c.createElement("span");f.className=B,f.hidden=!0,h.appendChild(f),this.#n=h,this.#t=f,this.#u(p)}element(){return this.#n}refresh(p){return this.#n?(this.#u(p),!0):!1}attached(){this.#l();const p=globalThis.ResizeObserver;typeof p=="function"&&this.#n&&!this.#i&&(this.#i=new p(()=>this.#l()),this.#i.observe(this.#n))}#u(p){this.#r=p;const c=this.#n,h=c.ownerDocument,f=p?p.value:null,s=(typeof f=="string"?[f]:y(f)).map(d=>typeof f=="string"?f:w(d,p));for(let d=this.#e.length;d<s.length;d++){const b=h.createElement("span");b.className=S,c.insertBefore(b,this.#t),this.#e.push(b)}for(let d=0;d<this.#e.length;d++){const b=this.#e[d];d<s.length?(b.textContent!==s[d]&&(b.textContent=s[d]),b.hidden=!1):b.hidden=!0}this.#s=s;const u=typeof f=="string"?f:O(p);u?c.setAttribute("title",u):c.removeAttribute("title"),this.#o=-1,this.#l()}#l(){const p=this.#n,c=this.#t;if(!p||!c||!p.isConnected)return;const h=p.clientWidth;if(h===this.#o)return;this.#o=h;const f=this.#s.length;for(let u=0;u<f;u++)this.#e[u].hidden=!1;if(c.hidden=!0,!f||p.scrollWidth<=h)return;const j=N(this.#r&&this.#r.grid&&this.#r.grid.messages);let s=f;for(;s>0&&(s--,this.#e[s].hidden=!0,c.hidden=!1,c.textContent=j.t("list.more",{count:f-s}),c.setAttribute("aria-label",j.t("list.moreLabel",{count:f-s})),!(p.scrollWidth<=h)););}destroy(){this.#i&&(this.#i.disconnect(),this.#i=null),this.#n=null,this.#t=null,this.#e=[],this.#r=null}}const R=v}),G("packages/modules/list/index.js",function(o,P){"use strict";Object.defineProperty(o,"listModule",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return p}});const y=Z("@toclocoinc/lattice-grid").registerModules;if(typeof y>"u")throw new Error("[lattice] list needs registerModules from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js").createListType,N=P("packages/modules/list/filter.js").listFilterFor,S=P("packages/modules/list/editor.js").ListEditor,v=P("packages/modules/list/render.js").ListChips,R=O({filterFor:N,editor:S,render:v}),F=Object.freeze({name:"list",capabilities:["dataType:list"],install(c){c.registry.register("dataType","list",R)}});y(F);const p=F});var H=re("packages/modules/list/index.js");if(typeof module=="object"&&module.exports)module.exports=H;else if(typeof define=="function"&&define.amd)define(function(){return H});else{var ae=K.LatticeGrid||(K.LatticeGrid={});for(var X in H)X!=="default"&&(ae[X]=H[X])}})(typeof globalThis<"u"?globalThis:this);
|
|
6
|
+
(function(K){"use strict";var te=Object.create(null),ne=Object.create(null);function G(o,P){te[o]=P}function re(o){var P=ne[o];if(P)return P;var E=Object.create(null);ne[o]=E;var y=te[o];if(!y)throw new Error("[lattice] missing module: "+o);return y(E,re),E}var ie=Object.create(null);ie["@toclocoinc/lattice-grid"]=K.LatticeGrid||null;function Z(o){var P=ie[o],E=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(P)return P;if(o==="@toclocoinc/lattice-grid"&&E&&E.LatticeGrid)return E.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: "+o)}G("packages/core/src/internal/util.js",function(o,P){"use strict";Object.defineProperty(o,"VERSION",{enumerable:!0,get:function(){return w}}),Object.defineProperty(o,"reportedWarnings",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"warnOnce",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"infoOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"resetWarnings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"invariant",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"DEV",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"isFunction",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"isNil",{enumerable:!0,get:function(){return b}}),Object.defineProperty(o,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"isCtor",{enumerable:!0,get:function(){return T}}),Object.defineProperty(o,"pathGetter",{enumerable:!0,get:function(){return W}}),Object.defineProperty(o,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"setPath",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"humanise",{enumerable:!0,get:function(){return n}}),Object.defineProperty(o,"escapeHtml",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"titleCase",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"expand",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"toArray",{enumerable:!0,get:function(){return k}}),Object.defineProperty(o,"merge",{enumerable:!0,get:function(){return U}}),Object.defineProperty(o,"mergeRow",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(o,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(o,"collator",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(o,"defaultCompare",{enumerable:!0,get:function(){return me}}),Object.defineProperty(o,"now",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(o,"nextFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"cancelFrame",{enumerable:!0,get:function(){return _}}),Object.defineProperty(o,"frameBatched",{enumerable:!0,get:function(){return de}}),Object.defineProperty(o,"settleDebounce",{enumerable:!0,get:function(){return he}}),Object.defineProperty(o,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(o,"uid",{enumerable:!0,get:function(){return be}});const E="1.89.1";async function y(){return E}const w="1.89.1",O=new Set,C=2e3;function N(e){if(O.add(e),O.size>C){const t=O.values().next().value;t!==void 0&&O.delete(t)}}const L=[],S=500;function B(e,t,i){L.push({key:e,level:t,message:i.map(a=>typeof a=="string"?a:v(a)).join(" "),at:Date.now()}),L.length>S&&L.shift()}function v(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function R(){return L.map(e=>({...e}))}function F(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function p(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"warn",i),console.warn("[lattice]",...i)}function c(e,...t){if(O.has(e))return;N(e);const i=F(t);B(e,"info",i),console.info("[lattice]",...i)}function h(){O.clear(),L.length=0}function f(e,t){const i=new Error(`[lattice] ${e}`);throw t!==void 0&&(i.cause=t),i}function j(e,t){e||f(t)}const s=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function u(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function d(e){return typeof e=="function"}function b(e){return e==null}function A(e){return e==null||e===""}function T(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function W(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=i=>i?.[e];else{const i=e.split("."),a=i.length;t=M=>{let z=M;for(let q=0;q<a;q++){if(z==null)return;z=z[i[q]]}return z}}return I.set(e,t),t}const V=new Map;function x(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=(i,a)=>{i!=null&&(i[e]=a)};else{const i=e.split("."),a=i.length-1;t=(M,z)=>{let q=M;for(let $=0;$<a;$++){if(q==null)return;const ee=i[$];q[ee]==null&&(q[ee]={}),q=q[ee]}q!=null&&(q[i[a]]=z)}}return V.set(e,t),t}function Q(e,t){return W(t)(e)}function J(e,t,i){x(t)(e,i)}function n(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(/^./,i=>i.toUpperCase()):""}const r={"&":"&","<":"<",">":">",'"':""","'":"'"};function l(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,i=>r[i]):t}function m(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function g(e,t,i){if(e!==void 0)return e===!0?{enabled:!0,...i}:e===!1?{enabled:!1}:u(e)?e:{[t]:e,enabled:!0}}function k(e){return e==null?[]:Array.isArray(e)?e:[e]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function U(e,t){if(!u(e))return u(t)?{...t}:t;if(!u(t))return t===void 0?e:t;const i={...e};for(const a of Object.keys(t)){if(D.has(a))continue;const M=t[a];M!==void 0&&(i[a]=u(M)&&u(i[a])?U(i[a],M):M)}return i}function Y(e,t){if(!u(e)||!u(t)||e===t)return t;const i=Object.create(Object.getPrototypeOf(e));return Object.assign(i,e,t),i}class ce{#n;#e=new Map;#t;constructor(t=256,i=null){this.#n=t,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const i=this.#e;if(!i.has(t))return;const a=i.get(t);return i.delete(t),i.set(t,a),a}peek(t){return this.#e.get(t)}set(t,i){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,i),this.#r(),i}delete(t){const i=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(i,t),i}clear(){if(this.#t)for(const[t,i]of this.#e)this.#t(i,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const i=t.keys().next().value,a=t.get(i);t.delete(i),this.#t&&this.#t(a,i)}}}const se=new Map;function fe(e,t){const i=`${e||""}|${t?JSON.stringify(t):""}`;let a=se.get(i);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),se.set(i,a)),a}function me(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 i=String(e),a=String(t);return i<a?-1:i>a?1:0}function oe(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const ue=typeof requestAnimationFrame=="function";function le(e){return ue?requestAnimationFrame(e):setTimeout(()=>e(oe()),16)}function _(e){e!=null&&(ue?cancelAnimationFrame(e):clearTimeout(e))}function de(e){let t=null,i=null;const a=()=>{t=null;const z=i;i=null,e(...z||[])},M=(...z)=>{i=z,t===null&&(t=le(a))};return M.cancel=()=>{_(t),t=null,i=null},M.flush=()=>{t!==null&&(_(t),a())},M}function he(e,t){let i=null,a=null;const M=()=>{if(i=null,a===null)return;const $=a;a=null,e(...$),z()},z=()=>{i=setTimeout(M,t),typeof i?.unref=="function"&&i.unref()},q=(...$)=>{i===null?(e(...$),z()):(a=$,clearTimeout(i),z())};return q.flush=()=>{if(i!==null&&clearTimeout(i),i=null,a===null)return;const $=a;a=null,e(...$)},q.cancel=()=>{i!==null&&clearTimeout(i),i=null,a=null},q.pending=()=>i!==null||a!==null,q}function pe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let ge=0;function be(e="l"){return`${e}${(++ge).toString(36)}`}}),G("packages/modules/list/type.js",function(o,P){"use strict";Object.defineProperty(o,"LIST_OPERATORS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(o,"COUNT_COMPARISONS",{enumerable:!0,get:function(){return N}}),Object.defineProperty(o,"DEFAULT_JOINER",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"itemsOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(o,"joinerOf",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"storeList",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"itemText",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"formatList",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"listText",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"parseList",{enumerable:!0,get:function(){return j}}),Object.defineProperty(o,"splitItems",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"parseItem",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"compareListFor",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"LIST_OPERATOR_SPECS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"createListType",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"familyOf",{enumerable:!0,get:function(){return J}});const E=P("packages/core/src/internal/util.js"),y=E.isNil,w=E.isFunction,O=E.warnOnce,C=Object.freeze(["hasAny","hasAll","hasNone","listCount"]),N=Object.freeze(["gt","gte","lt","lte","eq"]),L=", ";function S(n){if(y(n))return[];if(Array.isArray(n))return n;if(typeof n=="object"&&!ArrayBuffer.isView(n)){const r=n;if(w(r.toArray))return Array.from(r.toArray());if(w(r[Symbol.iterator]))return Array.from(r)}return[n]}function B(n){if(Array.isArray(n))return!0;if(!n||typeof n!="object"||ArrayBuffer.isView(n))return!1;const r=n;return w(r.toArray)||w(r[Symbol.iterator])}function v(n){const r=n&&n.typeOptions,l=r&&r.joiner;return typeof l=="string"&&l!==""?l:L}function R(n,r,l){if(y(n))return null;let m=n;if(typeof n=="bigint"&&(m=n<=BigInt(Number.MAX_SAFE_INTEGER)&&n>=BigInt(Number.MIN_SAFE_INTEGER)?Number(n):String(n)),!r)return m;if(w(r.toStorage)?m=r.toStorage(m,l):r.base==="number"&&typeof m=="string"?m=w(r.parse)?r.parse({text:m,column:null}):Number(m):r.base==="boolean"&&typeof m=="string"&&w(r.parse)&&(m=r.parse({text:m,column:null})),!(typeof m=="number"&&Number.isNaN(m)))return y(m)?void 0:m}function F(n,r){if(y(n))return null;const l=r&&r.colId||"?",m=r&&r.itemType;B(n)||O(`list:scalar:${l}`,`column "${l}" is a list column and received a single value (${typeof n}) where a list was expected; it is read as a one-item list. The row itself is not changed: pass an array to say so.`);const g=[];for(const k of S(n)){const D=R(k,m,r);if(D===void 0){O(`list:item:${l}`,`column "${l}" refused the item ${JSON.stringify(String(k))}: it is not a value of the item type "${m&&m.name||"text"}". The item is left out of the stored list rather than kept.`);continue}g.push(D)}return g.length?g:null}function p(n,r){if(y(n))return"";const l=r&&r.column,m=l&&l.itemType;return m&&w(m.format)?String(m.format({...r,value:n})??""):String(n)}function c(n,r){if(y(n))return"";const l=r&&r.itemType;return l&&w(l.toClipboard)?String(l.toClipboard(n)??""):String(n)}function h(n){const r=n&&n.value;return y(r)?"":typeof r=="string"?r:S(r).map(l=>p(l,n)).join(", ")}function f(n,r){return y(n)?"":typeof n=="string"?n:S(n).map(l=>c(l,r)).join(v(r))}function j(n){const r=String((n&&n.text)??"").trim();if(r==="")return[];const l=n&&n.column,m=v(l).trim(),g=s(r,m),k=[];for(const D of g){const U=u(D,n);if(U===void 0){const Y=l&&l.id||"?";return O(`list:parse:${Y}`,`column "${Y}" refused the item ${JSON.stringify(D)}: it is not a value of the item type "${l&&l.itemType&&l.itemType.name||"text"}". Nothing was stored.`),null}k.push(U)}return k}function s(n,r){const l=new Set([","]);r&&l.add(r);let m=[String(n)];for(const g of l)m=m.flatMap(k=>k.split(g));return m.map(g=>g.trim()).filter(g=>g!=="")}function u(n,r){const l=r&&r.column,m=l&&l.itemType;if(!m||!w(m.parse))return n;const g=m.parse({...r,text:n});if(!(y(g)||typeof g=="number"&&Number.isNaN(g)))return g}function d(n){const r=n&&w(n.itemCompare)?n.itemCompare:b;return(l,m)=>{const g=S(l),k=S(m);return g.length!==k.length?g.length<k.length?-1:1:g.length?r(g[0],k[0]):0}}function b(n,r){return y(n)?y(r)?0:1:y(r)||n<r?-1:n>r?1:0}function A(n){return n instanceof Date?n.getTime():typeof n=="number"?n:typeof n=="string"&&n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n}function T(n){return Array.isArray(n)?null:"it needs an array of items"}function I(n){const r=n;return!r||typeof r!="object"||Array.isArray(r)?"it needs { op, value }":N.includes(r.op)?typeof r.value!="number"||!Number.isFinite(r.value)?"its value must be a finite number":null:`its op must be one of ${N.join(", ")}`}function W(n,r){const l=Array.isArray(r)?r.map(A):[],m=new Set(l),g=k=>S(k).some(D=>m.has(A(D)));return n==="hasAny"?g:n==="hasNone"?k=>!g(k):k=>{if(!l.length)return!0;const D=new Set(S(k).map(A));return l.every(U=>D.has(U))}}function V(n){if(I(n))return()=>!1;const{op:r,value:l}=n;return m=>{const g=S(m).length;switch(r){case"gt":return g>l;case"gte":return g>=l;case"lt":return g<l;case"lte":return g<=l;default:return g===l}}}const x=Object.freeze({hasAny:Object.freeze({compile:n=>W("hasAny",n),check:T}),hasAll:Object.freeze({compile:n=>W("hasAll",n),check:T}),hasNone:Object.freeze({compile:n=>W("hasNone",n),check:T}),listCount:Object.freeze({compile:V,check:I})});function Q(n){return Object.freeze({base:"object",storage:"object",format:h,parse:j,items:S,compareFor:d,compare:d(null),groupProjector:r=>l=>y(l)?l:f(l,r),operators:x,memberOperator:"hasAny",defaults:{filter:n.filterFor("text"),editor:n.editor,align:"start",render:n.render},defaultsFor:r=>({filter:n.filterFor(J(r))}),totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:f,toStorage:F,fromClipboard:(r,l)=>j({...l||{},text:r})})}function J(n){const r=n&&n.base;return r==="number"||r==="boolean"?r:r==="date"||r==="dateString"?"date":"text"}}),G("packages/modules/list/messages.js",function(o,P){"use strict";Object.defineProperty(o,"withFallback",{enumerable:!0,get:function(){return w}});const E=Object.freeze({"filter.op.hasAny":"Has any of","filter.op.hasAll":"Has all of","filter.op.hasNone":"Has none of","filter.op.countGreaterThan":"More items than","filter.op.countLessThan":"Fewer items than","filter.op.countEquals":"Number of items is","filter.list.items":"Items, separated by commas","filter.list.count":"A number of items","list.more":"+{count}","list.moreLabel":"{count} more","list.add":"Add an item","list.remove":"Remove {item}","list.refused":'"{item}" is not a {type}, so it was not added'});function y(O,C){const N=E[O];return N===void 0?O:N.replace(/\{(\w+)\}/g,(L,S)=>C[S]===void 0?L:String(C[S]))}function w(O){return{t(C,N={}){const L=O&&typeof O.t=="function"?O.t(C,N):C;return L===C?y(C,N):L}}}}),G("packages/modules/list/filter.js",function(o,P){"use strict";Object.defineProperty(o,"ListFilter",{enumerable:!0,get:function(){return p}}),Object.defineProperty(o,"listFilterFor",{enumerable:!0,get:function(){return h}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return f}});const E=Z("@toclocoinc/lattice-grid"),y=E.ConditionFilter;if(typeof y>"u")throw new Error("[lattice] list needs ConditionFilter from the lattice-grid module. Load lattice-grid before list.");const w=E.createMessages;if(typeof w>"u")throw new Error("[lattice] list needs createMessages from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js"),C=O.splitItems,N=O.parseItem,L=O.joinerOf,B=P("packages/modules/list/messages.js").withFallback,v=Object.freeze(["hasAny","hasAll","hasNone","countGreaterThan","countLessThan","countEquals"]),R=Object.freeze({countGreaterThan:"gt",countLessThan:"lt",countEquals:"eq"}),F=Object.freeze({text:{operators:["contains","notContains","equals","notEqual","startsWith","endsWith"],wire:{contains:"contains",notContains:"notContains",equals:"eq",notEqual:"ne",startsWith:"startsWith",endsWith:"endsWith"},defaultOperator:"contains"},number:{operators:["equals","notEqual","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",lessThan:"lt",lessThanOrEqual:"lte",greaterThan:"gt",greaterThanOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},date:{operators:["equals","notEqual","before","beforeOrEqual","after","afterOrEqual","inRange"],wire:{equals:"eq",notEqual:"ne",before:"lt",beforeOrEqual:"lte",after:"gt",afterOrEqual:"gte",inRange:"between"},defaultOperator:"equals"},boolean:{operators:["equals","notEqual"],wire:{equals:"eq",notEqual:"ne"},defaultOperator:"equals"}});class p extends y{static operators=Object.freeze([...F.text.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...F.text.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static type="list";static defaultOperator="contains";init(s){const u=s||{},d=u.messages||u.grid&&u.grid.messages||w();super.init({...u,messages:B(d)})}parseInput(s){const u=String(s??"").trim();return u===""?null:u}formatInput(s){if(s==null)return"";if(Array.isArray(s))return s.join(", ");if(typeof s=="object"){const u=s.value;return u==null?"":String(u)}return String(s)}nodes(){const s=this.conditions,u=[];try{for(const d of s){this.conditions=[d];for(const b of super.nodes()){const A=this.#n(d.op,b);A&&u.push(A)}}}finally{this.conditions=s}return u}#n(s,u){const d={column:this.params.column,locale:this.params.locale},b=u.op;if(b==="blank"||b==="notBlank")return u;if(R[s]){const T=Number(String(u.value).trim());return!Number.isInteger(T)||T<0?null:{...u,value:{op:R[s],value:T}}}if(b==="hasAny"||b==="hasAll"||b==="hasNone"){const T=C(String(u.value),L(this.params.column).trim()),I=[];for(const W of T){const V=N(W,d);if(V===void 0)return null;I.push(V)}return I.length?{...u,value:I}:null}if(Array.isArray(u.value)){const T=u.value.map(I=>typeof I=="string"?N(I,d):I);return T.some(I=>I===void 0)?null:{...u,value:T}}const A=typeof u.value=="string"?N(u.value,d):u.value;return A===void 0?null:{...u,value:A}}slotFrom(s){if(s&&s.op==="listCount"&&s.value&&typeof s.value=="object"){const{op:u,value:d}=s.value,b=u==="gt"||u==="gte"?"countGreaterThan":u==="lt"||u==="lte"?"countLessThan":"countEquals",A=u==="gte"?d-1:u==="lte"?d+1:d;return{op:b,value:String(A),value2:null,values:[]}}return super.slotFrom(s)}hintFor(s){return R[s]?this.messages.t("filter.list.count"):s==="hasAny"||s==="hasAll"||s==="hasNone"?this.messages.t("filter.list.items"):null}}const c=new Map([["text",p]]);function h(j){const s=c.get(j);if(s)return s;const u=F[j]||F.text;class d extends p{static operators=Object.freeze([...u.operators,...v,"blank","notBlank"]);static wire=Object.freeze({...u.wire,hasAny:"hasAny",hasAll:"hasAll",hasNone:"hasNone",countGreaterThan:"listCount",countLessThan:"listCount",countEquals:"listCount",blank:"blank",notBlank:"notBlank"});static defaultOperator=u.defaultOperator}return c.set(j,d),d}const f=p}),G("packages/modules/list/editor.js",function(o,P){"use strict";Object.defineProperty(o,"ListEditor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return F}});const y=Z("@toclocoinc/lattice-grid").BaseEditor;if(typeof y>"u")throw new Error("[lattice] list needs BaseEditor from the lattice-grid module. Load lattice-grid before list.");const w=P("packages/modules/list/type.js"),O=w.itemsOf,C=w.itemText,N=w.splitItems,L=w.parseItem,S=w.joinerOf,v=P("packages/modules/list/messages.js").withFallback;class R extends y{static popup=!0;items=[];input=null;#n=null;#e=null;#t=null;#r=[];#s(){const c=this.params&&this.params.grid;return v(c&&c.messages)}build(){const c=this.doc,h=this.#s(),f=c.createElement("div");f.className="lat-list-editor";const j=c.createElement("span");j.className="lat-list-editor__tokens";const s=c.createElement("input");s.type="text",s.className="lat-list-editor__input",s.setAttribute("aria-label",h.t("list.add"));const u=c.createElement("span");u.className="lat-list-editor__error",u.setAttribute("role","alert"),u.hidden=!0,f.append(j,s,u),this.#n=j,this.#e=u,this.input=s,this.items=O(this.params.value).slice(),this.params.key&&this.params.key.length===1&&(s.value=this.params.key),this.#i();const d=A=>{A.key==="Enter"&&s.value.trim()!==""?(A.preventDefault(),A.stopPropagation(),this.#o(s.value)):A.key==="Backspace"&&s.value===""&&this.items.length&&(A.preventDefault(),this.items.pop(),this.#i())},b=A=>{const T=A.clipboardData?A.clipboardData.getData("text"):"";!T||!/[,\n\t]/.test(T)||(A.preventDefault(),this.#o(T.replace(/[\n\t]/g,",")))};return s.addEventListener("keydown",d),s.addEventListener("paste",b),this.#r.push(()=>s.removeEventListener("keydown",d)),this.#r.push(()=>s.removeEventListener("paste",b)),f}focusTarget(){return this.input}#o(c){const h=this.params.column,f=N(c,S(h).trim()),j={column:h,locale:this.params.locale};for(let s=0;s<f.length;s++){const u=L(f[s],j);if(u===void 0)return this.#t=f[s],this.input&&(this.input.value=f.slice(s).join(", ")),this.#i(),!1;this.items.push(u)}return this.#t=null,this.input&&(this.input.value=""),this.#i(),!0}#i(){const c=this.doc,h=this.#n;if(!h)return;const f=this.#s();h.replaceChildren();const j={column:this.params.column,locale:this.params.locale,grid:this.params.grid};this.items.forEach((u,d)=>{const b=c.createElement("span");b.className="lat-pill lat-v-neutral lat-list-editor__token";const A=C(u,j);b.append(c.createTextNode(A));const T=c.createElement("button");T.type="button",T.className="lat-list-editor__remove",T.setAttribute("aria-label",f.t("list.remove",{item:A})),T.textContent="×",T.addEventListener("click",I=>{I.preventDefault(),this.items.splice(d,1),this.#i(),this.input&&this.input.focus()}),b.append(T),h.append(b)});const s=this.#e;s&&(s.hidden=this.#t===null,s.textContent=this.#t===null?"":this.#u(this.#t)),this.input&&(this.#t===null?this.input.removeAttribute("aria-invalid"):this.input.setAttribute("aria-invalid","true"))}#u(c){const h=this.params.column,f=h&&h.itemType&&h.itemType.name||"text";return this.#s().t("list.refused",{item:c,type:f})}readValue(){const c=this.input?this.input.value.trim():"";if(!c)return this.items.slice();const h=N(c,S(this.params.column).trim()),f={column:this.params.column,locale:this.params.locale},j=this.items.slice();for(const s of h){const u=L(s,f);if(u===void 0)return j;j.push(u)}return j}checkValue(c){const h=this.input?this.input.value.trim():"";if(!h)return!0;const f=N(h,S(this.params.column).trim()),j={column:this.params.column,locale:this.params.locale},s=f.find(u=>L(u,j)===void 0);return s===void 0?!0:(this.#t=s,this.#i(),this.#u(s))}destroy(){for(const c of this.#r)c();this.#r.length=0,this.input=null,this.#n=null,this.#e=null,super.destroy()}}const F=R}),G("packages/modules/list/render.js",function(o,P){"use strict";Object.defineProperty(o,"ListChips",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return R}});const E=P("packages/modules/list/type.js"),y=E.itemsOf,w=E.itemText,O=E.formatList,N=P("packages/modules/list/messages.js").withFallback,L="lat-list",S="lat-pill lat-v-neutral lat-list__item",B="lat-pill lat-pill--more lat-list__more";class v{#n=null;#e=[];#t=null;#r=null;#s=[];#o=-1;#i=null;init(p){const c=p&&p.grid&&p.grid.document||globalThis.document,h=c.createElement("span");h.className=L;const f=c.createElement("span");f.className=B,f.hidden=!0,h.appendChild(f),this.#n=h,this.#t=f,this.#u(p)}element(){return this.#n}refresh(p){return this.#n?(this.#u(p),!0):!1}attached(){this.#l();const p=globalThis.ResizeObserver;typeof p=="function"&&this.#n&&!this.#i&&(this.#i=new p(()=>this.#l()),this.#i.observe(this.#n))}#u(p){this.#r=p;const c=this.#n,h=c.ownerDocument,f=p?p.value:null,s=(typeof f=="string"?[f]:y(f)).map(d=>typeof f=="string"?f:w(d,p));for(let d=this.#e.length;d<s.length;d++){const b=h.createElement("span");b.className=S,c.insertBefore(b,this.#t),this.#e.push(b)}for(let d=0;d<this.#e.length;d++){const b=this.#e[d];d<s.length?(b.textContent!==s[d]&&(b.textContent=s[d]),b.hidden=!1):b.hidden=!0}this.#s=s;const u=typeof f=="string"?f:O(p);u?c.setAttribute("title",u):c.removeAttribute("title"),this.#o=-1,this.#l()}#l(){const p=this.#n,c=this.#t;if(!p||!c||!p.isConnected)return;const h=p.clientWidth;if(h===this.#o)return;this.#o=h;const f=this.#s.length;for(let u=0;u<f;u++)this.#e[u].hidden=!1;if(c.hidden=!0,!f||p.scrollWidth<=h)return;const j=N(this.#r&&this.#r.grid&&this.#r.grid.messages);let s=f;for(;s>0&&(s--,this.#e[s].hidden=!0,c.hidden=!1,c.textContent=j.t("list.more",{count:f-s}),c.setAttribute("aria-label",j.t("list.moreLabel",{count:f-s})),!(p.scrollWidth<=h)););}destroy(){this.#i&&(this.#i.disconnect(),this.#i=null),this.#n=null,this.#t=null,this.#e=[],this.#r=null}}const R=v}),G("packages/modules/list/index.js",function(o,P){"use strict";Object.defineProperty(o,"listModule",{enumerable:!0,get:function(){return F}}),Object.defineProperty(o,"default",{enumerable:!0,get:function(){return p}});const y=Z("@toclocoinc/lattice-grid").registerModules;if(typeof y>"u")throw new Error("[lattice] list needs registerModules from the lattice-grid module. Load lattice-grid before list.");const O=P("packages/modules/list/type.js").createListType,N=P("packages/modules/list/filter.js").listFilterFor,S=P("packages/modules/list/editor.js").ListEditor,v=P("packages/modules/list/render.js").ListChips,R=O({filterFor:N,editor:S,render:v}),F=Object.freeze({name:"list",capabilities:["dataType:list"],install(c){c.registry.register("dataType","list",R)}});y(F);const p=F});var H=re("packages/modules/list/index.js");if(typeof module=="object"&&module.exports)module.exports=H;else if(typeof define=="function"&&define.amd)define(function(){return H});else{var ae=K.LatticeGrid||(K.LatticeGrid={});for(var X in H)X!=="default"&&(ae[X]=H[X])}})(typeof globalThis<"u"?globalThis:this);
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=list.min.js.map
|
package/modules/mapview.d.ts
CHANGED