web-mojo 2.2.11 → 2.2.14

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.
Files changed (76) hide show
  1. package/dist/admin.cjs.js +1 -1
  2. package/dist/admin.cjs.js.map +1 -1
  3. package/dist/admin.es.js +473 -491
  4. package/dist/admin.es.js.map +1 -1
  5. package/dist/auth.cjs.js +1 -1
  6. package/dist/auth.es.js +1 -1
  7. package/dist/charts.cjs.js +1 -1
  8. package/dist/charts.es.js +4 -4
  9. package/dist/chunks/{ChatView-BxIeRwBQ.js → ChatView-DGulpthL.js} +2 -2
  10. package/dist/chunks/{ChatView-BxIeRwBQ.js.map → ChatView-DGulpthL.js.map} +1 -1
  11. package/dist/chunks/{ChatView-DIzLD6LF.js → ChatView-eFzjsHBL.js} +9 -9
  12. package/dist/chunks/{ChatView-DIzLD6LF.js.map → ChatView-eFzjsHBL.js.map} +1 -1
  13. package/dist/chunks/{Collection-BgX6OcUC.js → Collection-BlP54kxB.js} +2 -2
  14. package/dist/chunks/{Collection-BgX6OcUC.js.map → Collection-BlP54kxB.js.map} +1 -1
  15. package/dist/chunks/{Collection-BcCcol8p.js → Collection-CTkDG1NZ.js} +2 -2
  16. package/dist/chunks/{Collection-BcCcol8p.js.map → Collection-CTkDG1NZ.js.map} +1 -1
  17. package/dist/chunks/{ContextMenu-C4_MWleT.js → ContextMenu-BH5SaDXX.js} +2 -2
  18. package/dist/chunks/{ContextMenu-C4_MWleT.js.map → ContextMenu-BH5SaDXX.js.map} +1 -1
  19. package/dist/chunks/{ContextMenu-DYLw4o0S.js → ContextMenu-Capwv7d-.js} +3 -3
  20. package/dist/chunks/{ContextMenu-DYLw4o0S.js.map → ContextMenu-Capwv7d-.js.map} +1 -1
  21. package/dist/chunks/{DataView-i7kpJjVQ.js → DataView-BpXdthN2.js} +2 -2
  22. package/dist/chunks/{DataView-i7kpJjVQ.js.map → DataView-BpXdthN2.js.map} +1 -1
  23. package/dist/chunks/{DataView-BYNjIf--.js → DataView-R_LkYBAw.js} +2 -2
  24. package/dist/chunks/{DataView-BYNjIf--.js.map → DataView-R_LkYBAw.js.map} +1 -1
  25. package/dist/chunks/{Dialog-DX5h2QA9.js → Dialog--hl_Uh6X.js} +2 -2
  26. package/dist/chunks/{Dialog-DX5h2QA9.js.map → Dialog--hl_Uh6X.js.map} +1 -1
  27. package/dist/chunks/{Dialog-Cu_Dx46k.js → Dialog-RzLLLfJD.js} +5 -5
  28. package/dist/chunks/{Dialog-Cu_Dx46k.js.map → Dialog-RzLLLfJD.js.map} +1 -1
  29. package/dist/chunks/{FormView-B_90L1RY.js → FormView--WuITh01.js} +2 -2
  30. package/dist/chunks/{FormView-B_90L1RY.js.map → FormView--WuITh01.js.map} +1 -1
  31. package/dist/chunks/{FormView-Bwofbd8S.js → FormView-C1emfj3B.js} +2 -2
  32. package/dist/chunks/{FormView-Bwofbd8S.js.map → FormView-C1emfj3B.js.map} +1 -1
  33. package/dist/chunks/{ListView-PvjChHYI.js → ListView-CNkYumcc.js} +5 -5
  34. package/dist/chunks/ListView-CNkYumcc.js.map +1 -0
  35. package/dist/chunks/{ListView-OWwlcGGg.js → ListView-O9AO02Rf.js} +2 -2
  36. package/dist/chunks/ListView-O9AO02Rf.js.map +1 -0
  37. package/dist/chunks/{MetricsMiniChartWidget-vXr5pxpm.js → MetricsMiniChartWidget-DoxqoF1X.js} +2 -2
  38. package/dist/chunks/{MetricsMiniChartWidget-vXr5pxpm.js.map → MetricsMiniChartWidget-DoxqoF1X.js.map} +1 -1
  39. package/dist/chunks/{MetricsMiniChartWidget-DL5stA6A.js → MetricsMiniChartWidget-DyVs4Wt0.js} +4 -4
  40. package/dist/chunks/{MetricsMiniChartWidget-DL5stA6A.js.map → MetricsMiniChartWidget-DyVs4Wt0.js.map} +1 -1
  41. package/dist/chunks/{PDFViewer-DSmi78S6.js → PDFViewer-BxFcG82d.js} +2 -2
  42. package/dist/chunks/{PDFViewer-DSmi78S6.js.map → PDFViewer-BxFcG82d.js.map} +1 -1
  43. package/dist/chunks/{PDFViewer--jlqnuVw.js → PDFViewer-CHX2NLkG.js} +3 -3
  44. package/dist/chunks/{PDFViewer--jlqnuVw.js.map → PDFViewer-CHX2NLkG.js.map} +1 -1
  45. package/dist/chunks/{Rest-ChN4Ntac.js → Rest-0oRgqNjX.js} +16 -1
  46. package/dist/chunks/Rest-0oRgqNjX.js.map +1 -0
  47. package/dist/chunks/Rest-P-KCJpjB.js +2 -0
  48. package/dist/chunks/Rest-P-KCJpjB.js.map +1 -0
  49. package/dist/chunks/{TokenManager-DC1jXSK4.js → TokenManager-CBXqj6Iw.js} +5 -5
  50. package/dist/chunks/{TokenManager-DC1jXSK4.js.map → TokenManager-CBXqj6Iw.js.map} +1 -1
  51. package/dist/chunks/{TokenManager-CEOPgnsw.js → TokenManager-CCfcK4aA.js} +2 -2
  52. package/dist/chunks/{TokenManager-CEOPgnsw.js.map → TokenManager-CCfcK4aA.js.map} +1 -1
  53. package/dist/chunks/{WebSocketClient-JHjYcYbU.js → WebSocketClient-BbPsISrp.js} +2 -2
  54. package/dist/chunks/{WebSocketClient-JHjYcYbU.js.map → WebSocketClient-BbPsISrp.js.map} +1 -1
  55. package/dist/chunks/{WebSocketClient-bLYhu2Wv.js → WebSocketClient-D53hpvM8.js} +2 -2
  56. package/dist/chunks/{WebSocketClient-bLYhu2Wv.js.map → WebSocketClient-D53hpvM8.js.map} +1 -1
  57. package/dist/chunks/{version-CM7fRavU.js → version-DCTYSNWj.js} +4 -4
  58. package/dist/chunks/{version-CM7fRavU.js.map → version-DCTYSNWj.js.map} +1 -1
  59. package/dist/chunks/{version-CAOxcUyu.js → version-DnlcM3tJ.js} +2 -2
  60. package/dist/chunks/{version-CAOxcUyu.js.map → version-DnlcM3tJ.js.map} +1 -1
  61. package/dist/docit.cjs.js +1 -1
  62. package/dist/docit.es.js +6 -6
  63. package/dist/index.cjs.js +1 -1
  64. package/dist/index.es.js +15 -15
  65. package/dist/lightbox.cjs.js +1 -1
  66. package/dist/lightbox.es.js +5 -5
  67. package/dist/map.cjs.js +1 -1
  68. package/dist/map.es.js +2 -2
  69. package/dist/timeline.cjs.js +1 -1
  70. package/dist/timeline.es.js +4 -4
  71. package/package.json +1 -1
  72. package/dist/chunks/ListView-OWwlcGGg.js.map +0 -1
  73. package/dist/chunks/ListView-PvjChHYI.js.map +0 -1
  74. package/dist/chunks/Rest-ChN4Ntac.js.map +0 -1
  75. package/dist/chunks/Rest-DhD-U1vp.js +0 -2
  76. package/dist/chunks/Rest-DhD-U1vp.js.map +0 -1
package/dist/map.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/Rest-DhD-U1vp.js"),e=require("./chunks/Collection-BgX6OcUC.js");class MapView extends t.View{constructor(t={}){super({className:"map-view",...t}),this.markers=t.markers||[],this.center=t.center||null,this.zoom=t.zoom||13,this.height=t.height||400,this.showZoomControl=!1!==t.showZoomControl,this.tileLayer=t.tileLayer||"osm",this.showLeafletBranding=!0===t.showLeafletBranding,this.showLayerControl=!0===t.showLayerControl,this.layerOptions=t.layerOptions||{osm:"OSM",satellite:"Satellite",terrain:"Terrain",dark:"Dark",light:"Light",watercolor:"Watercolor",bw:"B/W",streets:"Streets"},this.map=null,this.leafletMarkers=[],this._tileLayer=null,this.template='\n <div class="map-container">\n <div id="map-{{id}}" style="height: {{height}}px; width: 100%; border-radius: 0.375rem; border: 1px solid #dee2e6;"></div>\n </div>\n '}async onAfterRender(){await this.loadLeaflet(),await this.initializeMap()}async loadLeaflet(){if(window.L)return;const t=new Promise(t=>{const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.onload=t,e.onerror=t,document.head.appendChild(e)}),e=new Promise((t,e)=>{const i=document.createElement("script");i.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",i.onload=t,i.onerror=e,document.head.appendChild(i)});await Promise.all([t,e])}getTileLayerUrl(){const t={osm:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"© OpenStreetMap contributors",maxZoom:19},satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"© Esri",maxZoom:19},terrain:{url:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"© OpenTopoMap contributors",maxZoom:17},dark:{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20},light:{url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20},watercolor:{url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"© Stadia Maps © Stamen Design © OpenStreetMap contributors",maxZoom:16},bw:{url:"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20},streets:{url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20}};return t[this.tileLayer]||t.osm}async initializeMap(){const t=this.element.querySelector(`#map-${this.id}`);if(!t||!window.L)return;let e=this.center;if(!e&&this.markers.length>0&&(e=[this.markers[0].lat,this.markers[0].lng]),e||(e=[0,0]),this.map=window.L.map(t,{center:e,zoom:this.zoom,zoomControl:this.showZoomControl}),this.map&&this.map.attributionControl&&!1===this.showLeafletBranding)try{this.map.attributionControl.setPrefix("")}catch(s){}const i=this.getTileLayerUrl();if(this._tileLayer=window.L.tileLayer(i.url,{attribution:i.attribution,maxZoom:i.maxZoom}).addTo(this.map),this.showLayerControl){const e=t.parentElement||this.element.querySelector(".map-container");if(e){e.style.position=e.style.position||"relative";const t=document.createElement("select");t.className="form-select form-select-sm",t.style.position="absolute",t.style.top="8px",t.style.right="8px",t.style.zIndex="1000",t.style.maxWidth="180px",t.setAttribute("aria-label","Map tile layer"),Object.entries(this.layerOptions||{}).forEach(([e,i])=>{const s=document.createElement("option");s.value=e,s.textContent=i,e===this.tileLayer&&(s.selected=!0),t.appendChild(s)}),t.addEventListener("change",()=>this.setTileLayer(t.value)),e.appendChild(t)}}this.addMarkers(this.markers),this.markers.length>1&&this.fitBounds(),setTimeout(()=>{this.map&&this.map.invalidateSize()},300)}addMarkers(t){this.map&&Array.isArray(t)&&t.forEach(t=>{const{lat:e,lng:i,popup:s,icon:r}=t;if(!e||!i)return;const a={};r&&(a.icon=window.L.icon(r));const o=window.L.marker([e,i],a).addTo(this.map);s&&o.bindPopup(s),this.leafletMarkers.push(o)})}fitBounds(){if(!this.map||0===this.leafletMarkers.length)return;const t=new window.L.featureGroup(this.leafletMarkers);this.map.fitBounds(t.getBounds().pad(.1))}updateMarkers(t){this.clearMarkers(),this.markers=t,this.addMarkers(t),t.length>1?this.fitBounds():1===t.length&&this.map.setView([t[0].lat,t[0].lng],this.zoom)}clearMarkers(){this.leafletMarkers.forEach(t=>{this.map.removeLayer(t)}),this.leafletMarkers=[]}setView(t,e,i=null){this.map&&this.map.setView([t,e],i||this.zoom)}setZoom(t){this.map&&this.map.setZoom(t)}setTileLayer(t){if(!this.map)return;const e=this.tileLayer;this.tileLayer=t||this.tileLayer;const i=this.getTileLayerUrl();try{this._tileLayer&&this.map.removeLayer(this._tileLayer)}catch(s){}this._tileLayer=window.L.tileLayer(i.url,{attribution:i.attribution,maxZoom:i.maxZoom}).addTo(this.map),this.tileLayer=t||e,setTimeout(()=>{try{this.map.invalidateSize()}catch(s){}},150)}async onBeforeDestroy(){this.map&&(this.map.remove(),this.map=null),await super.onBeforeDestroy()}static async showAsDialog(t={}){const e=new MapView(t),i={title:"Map View",header:!0,body:e,size:"lg",centered:!1,...t.dialogOptions||{}};await e.init(),await e.getApp().showDialog(i)}}exports.View=t.View,exports.Collection=e.Collection,exports.Model=e.Model,exports.MapView=MapView;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/Rest-P-KCJpjB.js"),e=require("./chunks/Collection-BlP54kxB.js");class MapView extends t.View{constructor(t={}){super({className:"map-view",...t}),this.markers=t.markers||[],this.center=t.center||null,this.zoom=t.zoom||13,this.height=t.height||400,this.showZoomControl=!1!==t.showZoomControl,this.tileLayer=t.tileLayer||"osm",this.showLeafletBranding=!0===t.showLeafletBranding,this.showLayerControl=!0===t.showLayerControl,this.layerOptions=t.layerOptions||{osm:"OSM",satellite:"Satellite",terrain:"Terrain",dark:"Dark",light:"Light",watercolor:"Watercolor",bw:"B/W",streets:"Streets"},this.map=null,this.leafletMarkers=[],this._tileLayer=null,this.template='\n <div class="map-container">\n <div id="map-{{id}}" style="height: {{height}}px; width: 100%; border-radius: 0.375rem; border: 1px solid #dee2e6;"></div>\n </div>\n '}async onAfterRender(){await this.loadLeaflet(),await this.initializeMap()}async loadLeaflet(){if(window.L)return;const t=new Promise(t=>{const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.onload=t,e.onerror=t,document.head.appendChild(e)}),e=new Promise((t,e)=>{const i=document.createElement("script");i.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",i.onload=t,i.onerror=e,document.head.appendChild(i)});await Promise.all([t,e])}getTileLayerUrl(){const t={osm:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"© OpenStreetMap contributors",maxZoom:19},satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"© Esri",maxZoom:19},terrain:{url:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"© OpenTopoMap contributors",maxZoom:17},dark:{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20},light:{url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20},watercolor:{url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"© Stadia Maps © Stamen Design © OpenStreetMap contributors",maxZoom:16},bw:{url:"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20},streets:{url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",attribution:"© OpenStreetMap contributors © CARTO",maxZoom:20}};return t[this.tileLayer]||t.osm}async initializeMap(){const t=this.element.querySelector(`#map-${this.id}`);if(!t||!window.L)return;let e=this.center;if(!e&&this.markers.length>0&&(e=[this.markers[0].lat,this.markers[0].lng]),e||(e=[0,0]),this.map=window.L.map(t,{center:e,zoom:this.zoom,zoomControl:this.showZoomControl}),this.map&&this.map.attributionControl&&!1===this.showLeafletBranding)try{this.map.attributionControl.setPrefix("")}catch(s){}const i=this.getTileLayerUrl();if(this._tileLayer=window.L.tileLayer(i.url,{attribution:i.attribution,maxZoom:i.maxZoom}).addTo(this.map),this.showLayerControl){const e=t.parentElement||this.element.querySelector(".map-container");if(e){e.style.position=e.style.position||"relative";const t=document.createElement("select");t.className="form-select form-select-sm",t.style.position="absolute",t.style.top="8px",t.style.right="8px",t.style.zIndex="1000",t.style.maxWidth="180px",t.setAttribute("aria-label","Map tile layer"),Object.entries(this.layerOptions||{}).forEach(([e,i])=>{const s=document.createElement("option");s.value=e,s.textContent=i,e===this.tileLayer&&(s.selected=!0),t.appendChild(s)}),t.addEventListener("change",()=>this.setTileLayer(t.value)),e.appendChild(t)}}this.addMarkers(this.markers),this.markers.length>1&&this.fitBounds(),setTimeout(()=>{this.map&&this.map.invalidateSize()},300)}addMarkers(t){this.map&&Array.isArray(t)&&t.forEach(t=>{const{lat:e,lng:i,popup:s,icon:r}=t;if(!e||!i)return;const a={};r&&(a.icon=window.L.icon(r));const o=window.L.marker([e,i],a).addTo(this.map);s&&o.bindPopup(s),this.leafletMarkers.push(o)})}fitBounds(){if(!this.map||0===this.leafletMarkers.length)return;const t=new window.L.featureGroup(this.leafletMarkers);this.map.fitBounds(t.getBounds().pad(.1))}updateMarkers(t){this.clearMarkers(),this.markers=t,this.addMarkers(t),t.length>1?this.fitBounds():1===t.length&&this.map.setView([t[0].lat,t[0].lng],this.zoom)}clearMarkers(){this.leafletMarkers.forEach(t=>{this.map.removeLayer(t)}),this.leafletMarkers=[]}setView(t,e,i=null){this.map&&this.map.setView([t,e],i||this.zoom)}setZoom(t){this.map&&this.map.setZoom(t)}setTileLayer(t){if(!this.map)return;const e=this.tileLayer;this.tileLayer=t||this.tileLayer;const i=this.getTileLayerUrl();try{this._tileLayer&&this.map.removeLayer(this._tileLayer)}catch(s){}this._tileLayer=window.L.tileLayer(i.url,{attribution:i.attribution,maxZoom:i.maxZoom}).addTo(this.map),this.tileLayer=t||e,setTimeout(()=>{try{this.map.invalidateSize()}catch(s){}},150)}async onBeforeDestroy(){this.map&&(this.map.remove(),this.map=null),await super.onBeforeDestroy()}static async showAsDialog(t={}){const e=new MapView(t),i={title:"Map View",header:!0,body:e,size:"lg",centered:!1,...t.dialogOptions||{}};await e.init(),await e.getApp().showDialog(i)}}exports.View=t.View,exports.Collection=e.Collection,exports.Model=e.Model,exports.MapView=MapView;
2
2
  //# sourceMappingURL=map.cjs.js.map
package/dist/map.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { V as View } from "./chunks/Rest-ChN4Ntac.js";
2
- import { C, M } from "./chunks/Collection-BcCcol8p.js";
1
+ import { V as View } from "./chunks/Rest-0oRgqNjX.js";
2
+ import { C, M } from "./chunks/Collection-CTkDG1NZ.js";
3
3
  class MapView extends View {
4
4
  constructor(options = {}) {
5
5
  super({
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/ListView-OWwlcGGg.js"),e=require("./chunks/Rest-DhD-U1vp.js"),i=require("./chunks/Collection-BgX6OcUC.js");class TimelineViewItem extends t.ListViewItem{constructor(t={}){super({className:"timeline-item",...t}),this.dateFormat=t.dateFormat||"date",this.dotStyle=t.dotStyle||"solid",this.showDate=!1!==t.showDate,this.theme=t.theme||"primary",this.template||(this.template='\n <div class="timeline-marker timeline-marker-{{markerType}}">\n {{#hasIcon}}\n <i class="bi {{model.icon}} text-{{displayColor}}"></i>\n {{/hasIcon}}\n {{^hasIcon}}\n <div class="timeline-dot bg-{{displayColor}}"></div>\n {{/hasIcon}}\n </div>\n \n <div class="timeline-content">\n {{#showDate}}\n <div class="timeline-date text-muted small">\n {{formattedDate}}\n </div>\n {{/showDate}}\n \n <div class="timeline-card">\n {{#model.title}}\n <h6 class="timeline-title mb-1">{{model.title}}</h6>\n {{/model.title}}\n \n {{#model.description}}\n <p class="timeline-description mb-0">{{model.description}}</p>\n {{/model.description}}\n \n {{#model.meta}}\n <div class="timeline-meta mt-2 text-muted small">\n {{model.meta}}\n </div>\n {{/model.meta}}\n </div>\n </div>\n ')}async onInit(){await super.onInit(),this.processItemData()}processItemData(){this.displayColor=this.model?.get?.("color")||this.model?.color||this.theme;const t=!(!this.model?.get?.("icon")&&!this.model?.icon)&&"icon"===this.dotStyle;this.hasIcon=t,this.markerType=t?"icon":this.dotStyle;const e=this.model?.get?.("date")||this.model?.date;this.formattedDate=this.formatDate(e)}formatDate(t){if(!t)return"";switch(this.dateFormat){case"datetime":return e.dataFormatter.pipe(t,"datetime");case"relative":return e.dataFormatter.pipe(t,"timeago");default:return e.dataFormatter.pipe(t,"date")}}async onActionSelect(t,e){t.stopPropagation(),this.emit("item:click",{item:this,model:this.model,index:this.index,data:this.model?.toJSON?this.model.toJSON():this.model}),this.listView&&this.listView.emit("item:click",{item:this,model:this.model,index:this.index,data:this.model?.toJSON?this.model.toJSON():this.model})}}class TimelineView extends t.ListView{constructor(t={}){super({className:"timeline-view",itemClass:t.itemClass||TimelineViewItem,selectionMode:"none",emptyMessage:t.emptyMessage||"No timeline events to display",template:'\n <div class="timeline-container timeline-{{position}}">\n {{#loading}}\n <div class="timeline-loading text-center py-4">\n <div class="spinner-border spinner-border-sm" role="status">\n <span class="visually-hidden">Loading...</span>\n </div>\n <span class="ms-2 text-muted">Loading timeline...</span>\n </div>\n {{/loading}}\n {{^loading}}\n {{#isEmpty}}\n <div class="timeline-empty text-center text-muted py-4">\n <i class="bi bi-clock-history fs-1 d-block mb-2"></i>\n <p>{{emptyMessage}}</p>\n </div>\n {{/isEmpty}}\n {{^isEmpty}}\n <div class="timeline" data-container="items"></div>\n {{/isEmpty}}\n {{/loading}}\n </div>\n ',...t}),this.position=t.position||"left",this.dateFormat=t.dateFormat||"date",this.dotStyle=t.dotStyle||"solid",this.showDate=!1!==t.showDate,this.theme=t.theme||"primary",this.groupBy=t.groupBy||"none"}_createItemView(t,e){if(this.itemViews.has(t.id))return;const i=new this.itemClass({model:t,index:e,listView:this,template:this.itemTemplate,dateFormat:this.dateFormat,dotStyle:this.dotStyle,showDate:this.showDate,theme:this.theme});return this.itemViews.set(t.id,i),i.on("item:click",this._onItemClick.bind(this)),i}_onItemClick(t){this.emit("item:click",t)}setPosition(t){return"left"!==t&&"center"!==t?(console.warn('Invalid position. Use "left" or "center"'),this):(this.position=t,this.isMounted()&&this.render(),this)}setDateFormat(t){return this.dateFormat=t,this.forEachItem(e=>{e.dateFormat=t,e.processItemData(),e.isMounted()&&e.render()}),this}setDotStyle(t){return this.dotStyle=t,this.forEachItem(e=>{e.dotStyle=t,e.processItemData(),e.isMounted()&&e.render()}),this}toggleDates(t=null){return this.showDate=null!==t?t:!this.showDate,this.forEachItem(t=>{t.showDate=this.showDate,t.isMounted()&&t.render()}),this}}exports.ListView=t.ListView,exports.ListViewItem=t.ListViewItem,exports.View=e.View,exports.Collection=i.Collection,exports.Model=i.Model,exports.TimelineView=TimelineView,exports.TimelineViewItem=TimelineViewItem;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/ListView-O9AO02Rf.js"),e=require("./chunks/Rest-P-KCJpjB.js"),i=require("./chunks/Collection-BlP54kxB.js");class TimelineViewItem extends t.ListViewItem{constructor(t={}){super({className:"timeline-item",...t}),this.dateFormat=t.dateFormat||"date",this.dotStyle=t.dotStyle||"solid",this.showDate=!1!==t.showDate,this.theme=t.theme||"primary",this.template||(this.template='\n <div class="timeline-marker timeline-marker-{{markerType}}">\n {{#hasIcon}}\n <i class="bi {{model.icon}} text-{{displayColor}}"></i>\n {{/hasIcon}}\n {{^hasIcon}}\n <div class="timeline-dot bg-{{displayColor}}"></div>\n {{/hasIcon}}\n </div>\n \n <div class="timeline-content">\n {{#showDate}}\n <div class="timeline-date text-muted small">\n {{formattedDate}}\n </div>\n {{/showDate}}\n \n <div class="timeline-card">\n {{#model.title}}\n <h6 class="timeline-title mb-1">{{model.title}}</h6>\n {{/model.title}}\n \n {{#model.description}}\n <p class="timeline-description mb-0">{{model.description}}</p>\n {{/model.description}}\n \n {{#model.meta}}\n <div class="timeline-meta mt-2 text-muted small">\n {{model.meta}}\n </div>\n {{/model.meta}}\n </div>\n </div>\n ')}async onInit(){await super.onInit(),this.processItemData()}processItemData(){this.displayColor=this.model?.get?.("color")||this.model?.color||this.theme;const t=!(!this.model?.get?.("icon")&&!this.model?.icon)&&"icon"===this.dotStyle;this.hasIcon=t,this.markerType=t?"icon":this.dotStyle;const e=this.model?.get?.("date")||this.model?.date;this.formattedDate=this.formatDate(e)}formatDate(t){if(!t)return"";switch(this.dateFormat){case"datetime":return e.dataFormatter.pipe(t,"datetime");case"relative":return e.dataFormatter.pipe(t,"timeago");default:return e.dataFormatter.pipe(t,"date")}}async onActionSelect(t,e){t.stopPropagation(),this.emit("item:click",{item:this,model:this.model,index:this.index,data:this.model?.toJSON?this.model.toJSON():this.model}),this.listView&&this.listView.emit("item:click",{item:this,model:this.model,index:this.index,data:this.model?.toJSON?this.model.toJSON():this.model})}}class TimelineView extends t.ListView{constructor(t={}){super({className:"timeline-view",itemClass:t.itemClass||TimelineViewItem,selectionMode:"none",emptyMessage:t.emptyMessage||"No timeline events to display",template:'\n <div class="timeline-container timeline-{{position}}">\n {{#loading}}\n <div class="timeline-loading text-center py-4">\n <div class="spinner-border spinner-border-sm" role="status">\n <span class="visually-hidden">Loading...</span>\n </div>\n <span class="ms-2 text-muted">Loading timeline...</span>\n </div>\n {{/loading}}\n {{^loading}}\n {{#isEmpty}}\n <div class="timeline-empty text-center text-muted py-4">\n <i class="bi bi-clock-history fs-1 d-block mb-2"></i>\n <p>{{emptyMessage}}</p>\n </div>\n {{/isEmpty}}\n {{^isEmpty}}\n <div class="timeline" data-container="items"></div>\n {{/isEmpty}}\n {{/loading}}\n </div>\n ',...t}),this.position=t.position||"left",this.dateFormat=t.dateFormat||"date",this.dotStyle=t.dotStyle||"solid",this.showDate=!1!==t.showDate,this.theme=t.theme||"primary",this.groupBy=t.groupBy||"none"}_createItemView(t,e){if(this.itemViews.has(t.id))return;const i=new this.itemClass({model:t,index:e,listView:this,template:this.itemTemplate,dateFormat:this.dateFormat,dotStyle:this.dotStyle,showDate:this.showDate,theme:this.theme});return this.itemViews.set(t.id,i),i.on("item:click",this._onItemClick.bind(this)),i}_onItemClick(t){this.emit("item:click",t)}setPosition(t){return"left"!==t&&"center"!==t?(console.warn('Invalid position. Use "left" or "center"'),this):(this.position=t,this.isMounted()&&this.render(),this)}setDateFormat(t){return this.dateFormat=t,this.forEachItem(e=>{e.dateFormat=t,e.processItemData(),e.isMounted()&&e.render()}),this}setDotStyle(t){return this.dotStyle=t,this.forEachItem(e=>{e.dotStyle=t,e.processItemData(),e.isMounted()&&e.render()}),this}toggleDates(t=null){return this.showDate=null!==t?t:!this.showDate,this.forEachItem(t=>{t.showDate=this.showDate,t.isMounted()&&t.render()}),this}}exports.ListView=t.ListView,exports.ListViewItem=t.ListViewItem,exports.View=e.View,exports.Collection=i.Collection,exports.Model=i.Model,exports.TimelineView=TimelineView,exports.TimelineViewItem=TimelineViewItem;
2
2
  //# sourceMappingURL=timeline.cjs.js.map
@@ -1,7 +1,7 @@
1
- import { L as ListViewItem, a as ListView } from "./chunks/ListView-PvjChHYI.js";
2
- import { d as dataFormatter } from "./chunks/Rest-ChN4Ntac.js";
3
- import { V } from "./chunks/Rest-ChN4Ntac.js";
4
- import { C, M } from "./chunks/Collection-BcCcol8p.js";
1
+ import { L as ListViewItem, a as ListView } from "./chunks/ListView-CNkYumcc.js";
2
+ import { d as dataFormatter } from "./chunks/Rest-0oRgqNjX.js";
3
+ import { V } from "./chunks/Rest-0oRgqNjX.js";
4
+ import { C, M } from "./chunks/Collection-CTkDG1NZ.js";
5
5
  class TimelineViewItem extends ListViewItem {
6
6
  constructor(options = {}) {
7
7
  super({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-mojo",
3
- "version": "2.2.11",
3
+ "version": "2.2.14",
4
4
  "description": "WEB-MOJO - A lightweight JavaScript framework for building data-driven web applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListView-OWwlcGGg.js","sources":["../../src/core/views/list/ListViewItem.js","../../src/core/views/list/ListView.js"],"sourcesContent":["/**\n * ListViewItem - Individual item view for ListView\n *\n * Each item is its own View with its own model, allowing for\n * independent re-rendering when the model changes.\n *\n * Events:\n * - 'item:click' - Emitted when item is clicked\n * - 'item:select' - Emitted when item is selected\n * - 'item:deselect' - Emitted when item is deselected\n *\n * @example\n * const item = new ListViewItem({\n * model: userModel,\n * template: '<div class=\"user-item\">{{name}} - {{email}}</div>'\n * });\n */\n\nimport View from '@core/View.js';\n\nclass ListViewItem extends View {\n constructor(options = {}) {\n super({\n className: 'list-view-item',\n ...options\n });\n\n // Item-specific properties\n this.selected = false;\n this.index = options.index ?? 0;\n this.listView = options.listView ?? null;\n\n // Default template if none provided\n if (!this.template) {\n this.template = `\n <div class=\"list-item-content\" data-action=\"select\">\n {{#model}}\n {{#id}}<span class=\"item-id\">{{id}}</span>{{/id}}\n {{#name}}<span class=\"item-name\">{{name}}</span>{{/name}}\n {{#title}}<span class=\"item-title\">{{title}}</span>{{/title}}\n {{#label}}<span class=\"item-label\">{{label}}</span>{{/label}}\n {{#description}}<p class=\"item-description\">{{description}}</p>{{/description}}\n {{/model}}\n {{^model}}\n <span class=\"item-empty\">No data</span>\n {{/model}}\n </div>\n `;\n }\n }\n\n /**\n * Handle item selection action\n */\n async onActionSelect(event, _element) {\n event.stopPropagation();\n\n if (this.selected) {\n this.deselect();\n } else {\n this.select();\n }\n }\n\n /**\n * Select this item\n */\n select() {\n if (this.selected) return;\n\n this.selected = true;\n this.addClass('selected');\n\n // Emit selection event with item data\n this.emit('item:select', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n\n // Notify parent ListView if available\n if (this.listView) {\n this.listView.emit('item:select', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n }\n }\n\n /**\n * Deselect this item\n */\n deselect() {\n if (!this.selected) return;\n\n this.selected = false;\n this.removeClass('selected');\n\n // Emit deselection event\n this.emit('item:deselect', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n\n // Notify parent ListView if available\n if (this.listView) {\n this.listView.emit('item:deselect', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n }\n }\n\n /**\n * Handle click events on the item\n */\n async onActionDefault(action, _event, _element) {\n // Emit click event for any action not specifically handled\n this.emit('item:click', {\n item: this,\n model: this.model,\n index: this.index,\n action: action,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n\n // Notify parent ListView if available\n if (this.listView) {\n this.listView.emit('item:click', {\n item: this,\n model: this.model,\n index: this.index,\n action: action,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n }\n }\n\n /**\n * Set the item's index in the list\n */\n setIndex(index) {\n this.index = index;\n this.element.setAttribute('data-index', index);\n return this;\n }\n\n /**\n * Update the item's selection state\n */\n setSelected(selected) {\n if (selected) {\n this.select();\n } else {\n this.deselect();\n }\n return this;\n }\n\n /**\n * Override destroy to clean up references\n */\n async destroy() {\n // Remove reference to parent ListView\n this.listView = null;\n\n // Call parent destroy\n await super.destroy();\n }\n}\n\nexport default ListViewItem;\n","/**\n * ListView - Visual list component for Collections\n *\n * Manages a collection of ListViewItem views, each with its own model.\n * When a model changes, only its corresponding ListViewItem re-renders.\n *\n * Events:\n * - 'item:click' - Emitted when any item is clicked\n * - 'item:select' - Emitted when an item is selected\n * - 'item:deselect' - Emitted when an item is deselected\n * - 'selection:change' - Emitted when selection changes\n * - 'list:empty' - Emitted when list becomes empty\n * - 'list:loaded' - Emitted when list is populated\n *\n * @example\n * // Basic usage with custom item template\n * const listView = new ListView({\n * collection: userCollection,\n * itemTemplate: '<div class=\"user-item\">{{name}} - {{email}}</div>',\n * selectionMode: 'single'\n * });\n *\n * // Custom template with model fields\n * const productList = new ListView({\n * collection: productCollection,\n * itemTemplate: `\n * <div class=\"product-card\" data-action=\"select\">\n * <h4>{{name}}</h4>\n * <p class=\"price\">{{price|currency}}</p>\n * <p>{{description|truncate(100)}}</p>\n * </div>\n * `,\n * selectionMode: 'multiple'\n * });\n *\n * // Using custom item class with template\n * const customList = new ListView({\n * collection: myCollection,\n * itemClass: CustomListItem, // Your custom ListViewItem subclass\n * itemTemplate: '<div>{{title}}</div>', // Passed as 'template' to itemClass constructor\n * selectionMode: 'none'\n * });\n *\n * // Dynamic template update\n * listView.setItemTemplate('<div class=\"compact\">{{name}}</div>', true);\n */\n\nimport View from '@core/View.js';\nimport Collection from '@core/Collection.js';\nimport ListViewItem from './ListViewItem.js';\n\nclass ListView extends View {\n constructor(options = {}) {\n super({\n className: 'list-view',\n template: `\n <div class=\"list-view-container\">\n {{#loading}}\n <div class=\"list-loading\">\n <div class=\"spinner-border spinner-border-sm\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n Loading...\n </div>\n {{/loading}}\n {{^loading}}\n {{#isEmpty}}\n <div class=\"list-empty\">\n {{emptyMessage}}\n </div>\n {{/isEmpty}}\n {{^isEmpty}}\n <div class=\"list-items\" data-container=\"items\"></div>\n {{/isEmpty}}\n {{/loading}}\n </div>\n `,\n ...options\n });\n\n // ListView specific properties\n this.collection = null;\n this.itemViews = new Map(); // Map of model.id -> ListViewItem\n this.selectedItems = new Set(); // Set of selected item IDs\n\n // Configuration\n this.itemTemplate = options.itemTemplate || null; // Template passed to each item's view\n this.itemClass = options.itemClass || ListViewItem; // Class for creating item views\n this.selectionMode = options.selectionMode || 'none'; // none, single, multiple\n this.emptyMessage = options.emptyMessage || 'No items to display';\n this.loading = false;\n this.isEmpty = true;\n\n }\n\n /**\n * Override onInit to set up initial state\n */\n async onInit() {\n // Initial render will happen automatically\n this._initCollection(this.options.collection || this.options.Collection);\n }\n\n\n /**\n * Initialize the collection\n */\n _initCollection(collectionOrClass) {\n if (!collectionOrClass) {\n console.log('Collection not provided');\n return;\n };\n\n // Check if it's already a Collection instance\n if (collectionOrClass instanceof Collection) {\n this.setCollection(collectionOrClass);\n }\n // Check if it's a Collection class\n else if (typeof collectionOrClass === 'function') {\n const collection = new collectionOrClass();\n this.setCollection(collection);\n }\n // Check if it's an array of data\n else if (Array.isArray(collectionOrClass)) {\n const collection = new Collection(null, {}, collectionOrClass);\n this.setCollection(collection);\n }\n }\n\n /**\n * Set the collection for this list view\n */\n setCollection(collection) {\n if (this.collection === collection) return this;\n\n // Clean up old collection listeners\n if (this.collection) {\n this.collection.off('add', this._onModelsAdded, this);\n this.collection.off('remove', this._onModelsRemoved, this);\n this.collection.off('reset', this._onCollectionReset, this);\n this.collection.off('fetch:start', this._onFetchStart, this);\n this.collection.off('fetch:end', this._onFetchEnd, this);\n }\n\n this.collection = collection;\n\n if (this.options.defaultQuery && !this.options.collectionParams) {\n this.collection.params = {...this.options.defaultQuery, ...this.collection.params};\n }\n\n if (this.options.collectionParams) {\n this.collection.params = {...this.options.collectionParams, ...this.collection.params};\n }\n\n // Set up new collection listeners\n if (this.collection) {\n this.collection.on('add', this._onModelsAdded, this);\n this.collection.on('remove', this._onModelsRemoved, this);\n this.collection.on('reset', this._onCollectionReset, this);\n this.collection.on('fetch:start', this._onFetchStart, this);\n this.collection.on('fetch:end', this._onFetchEnd, this);\n\n // Build items for existing models\n this._buildItems();\n }\n\n return this;\n }\n\n async _renderChildren() {\n await super._renderChildren();\n const itemsContainer = this.getChildElement(\"items\");\n if (!itemsContainer) {\n // console.warn('ListView: items container not found');\n return;\n }\n this.forEachItem((item, index) => {\n itemsContainer.appendChild(item.element);\n item.render(false);\n });\n }\n\n /**\n * Build item views for all models in collection\n */\n _buildItems() {\n // Clear existing items\n this._clearItems();\n\n if (!this.collection || this.collection.isEmpty()) {\n this.isEmpty = true;\n this.emit('list:empty');\n return;\n }\n\n this.isEmpty = false;\n\n // Create item views for each model\n this.collection.forEach((model, index) => {\n this._createItemView(model, index);\n });\n\n this.emit('list:loaded', { count: this.collection.length() });\n\n // Render if already mounted\n if (this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Create an item view for a model\n * The itemTemplate is passed as the template option to the itemClass constructor\n */\n _createItemView(model, index) {\n // Don't create duplicate views\n if (this.itemViews.has(model.id)) return;\n\n const itemView = new this.itemClass({\n model: model,\n index: index,\n listView: this,\n template: this.itemTemplate, // Pass the itemTemplate to the item view\n });\n\n // Store the item view\n this.itemViews.set(model.id, itemView);\n\n // Set up item event listeners\n itemView.on('item:select', this._onItemSelect.bind(this));\n itemView.on('item:deselect', this._onItemDeselect.bind(this));\n\n return itemView;\n }\n\n /**\n * Clear all item views\n */\n _clearItems() {\n this.forEachItem(itemView => {\n this.removeChild(itemView.id);\n });\n this.itemViews.clear();\n this.selectedItems.clear();\n }\n\n /**\n * Handle models added to collection\n */\n _onModelsAdded(event) {\n const { models } = event;\n\n models.forEach(model => {\n const index = this.collection.models.indexOf(model);\n this._createItemView(model, index);\n });\n\n this.isEmpty = this.collection.isEmpty();\n\n // Re-render to show new items\n if (!this.loading && this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Handle models removed from collection\n */\n _onModelsRemoved(event) {\n const { models } = event;\n\n models.forEach(model => {\n const itemView = this.itemViews.get(model.id);\n if (itemView) {\n this.removeChild(itemView.id);\n this.itemViews.delete(model.id);\n this.selectedItems.delete(model.id);\n }\n });\n\n this.isEmpty = this.collection.isEmpty();\n\n // Re-render to update display\n if (!this.loading && this.isMounted()) {\n this.render();\n }\n\n if (this.isEmpty) {\n this.emit('list:empty');\n }\n }\n\n /**\n * Handle collection reset\n */\n _onCollectionReset(_event) {\n this._buildItems();\n }\n\n /**\n * Handle fetch start\n */\n _onFetchStart() {\n this.loading = true;\n if (this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Handle fetch end\n */\n _onFetchEnd() {\n this.loading = false;\n if (this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Handle item selection\n */\n _onItemSelect(event) {\n const { model, item } = event;\n\n if (this.selectionMode === 'none') {\n item.deselect();\n return;\n }\n\n if (this.selectionMode === 'single') {\n // Deselect all other items\n this.itemViews.forEach((view, id) => {\n if (id !== model.id && view.selected) {\n view.deselect();\n }\n });\n this.selectedItems.clear();\n }\n\n this.selectedItems.add(model.id);\n\n this.emit('selection:change', {\n selected: Array.from(this.selectedItems),\n item: item,\n model: model\n });\n }\n\n /**\n * Handle item deselection\n */\n _onItemDeselect(event) {\n const { model } = event;\n\n this.selectedItems.delete(model.id);\n\n this.emit('selection:change', {\n selected: Array.from(this.selectedItems),\n item: event.item,\n model: model\n });\n }\n\n /**\n * Get selected items\n */\n getSelectedItems() {\n const selected = [];\n this.selectedItems.forEach(id => {\n const itemView = this.itemViews.get(id);\n if (itemView) {\n selected.push({\n view: itemView,\n model: itemView.model,\n data: itemView.model?.toJSON ? itemView.model.toJSON() : itemView.model\n });\n }\n });\n return selected;\n }\n\n /**\n * Iterate over each item view in the list\n * @param {function} callback - Function to execute for each item (itemView, model, index)\n * @param {object} thisArg - Optional value to use as this when executing callback\n * @returns {ListView} Returns the ListView for chaining\n */\n forEachItem(callback, thisArg) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback must be a function');\n }\n\n let index = 0;\n this.itemViews.forEach((itemView, modelId) => {\n callback.call(thisArg, itemView, itemView.model, index++);\n });\n\n return this;\n }\n\n /**\n * Clear selection\n */\n clearSelection() {\n this.forEachItem(itemView => {\n if (itemView.selected) {\n itemView.deselect();\n }\n });\n this.selectedItems.clear();\n\n this.emit('selection:change', {\n selected: []\n });\n }\n\n /**\n * Select item by model ID\n */\n selectItem(modelId) {\n const itemView = this.itemViews.get(modelId);\n if (itemView) {\n itemView.select();\n }\n return this;\n }\n\n /**\n * Deselect item by model ID\n */\n deselectItem(modelId) {\n const itemView = this.itemViews.get(modelId);\n if (itemView) {\n itemView.deselect();\n }\n return this;\n }\n\n /**\n * Set or update the item template\n * @param {string} template - New template string for items\n * @param {boolean} rerender - Whether to re-render existing items with new template\n * @returns {ListView} Returns the ListView for chaining\n */\n setItemTemplate(template, rerender = false) {\n this.itemTemplate = template;\n\n if (rerender && this.itemViews.size > 0) {\n // Update template for all existing item views\n this.forEachItem((itemView) => {\n itemView.setTemplate(template);\n if (itemView.isMounted()) {\n itemView.render();\n }\n });\n }\n\n return this;\n }\n\n async onAfterMount() {\n await super.onAfterMount();\n if (this.collection && (this.options.fetchOnMount || !this.collection.lastFetchTime)) {\n this.collection.fetch();\n }\n }\n\n /**\n * Refresh the list (re-fetch if collection supports it)\n */\n async refresh() {\n if (this.collection && this.collection.restEnabled) {\n return await this.collection.fetch();\n }\n this._buildItems();\n }\n\n /**\n * Override destroy to clean up\n */\n async destroy() {\n // Clean up collection listeners\n if (this.collection) {\n this.collection.off('add', this._onModelsAdded, this);\n this.collection.off('remove', this._onModelsRemoved, this);\n this.collection.off('reset', this._onCollectionReset, this);\n this.collection.off('fetch:start', this._onFetchStart, this);\n this.collection.off('fetch:end', this._onFetchEnd, this);\n }\n\n // Clear items\n this._clearItems();\n\n // Call parent destroy\n await super.destroy();\n }\n}\n\nexport default ListView;\n"],"names":["ListViewItem","View","constructor","options","super","className","this","selected","index","listView","template","onActionSelect","event","_element","stopPropagation","deselect","select","addClass","emit","item","model","data","toJSON","removeClass","onActionDefault","action","_event","setIndex","element","setAttribute","setSelected","destroy","ListView","collection","itemViews","Map","selectedItems","Set","itemTemplate","itemClass","selectionMode","emptyMessage","loading","isEmpty","onInit","_initCollection","Collection","collectionOrClass","setCollection","Array","isArray","off","_onModelsAdded","_onModelsRemoved","_onCollectionReset","_onFetchStart","_onFetchEnd","defaultQuery","collectionParams","params","on","_buildItems","_renderChildren","itemsContainer","getChildElement","forEachItem","appendChild","render","_clearItems","forEach","_createItemView","count","length","isMounted","has","id","itemView","set","_onItemSelect","bind","_onItemDeselect","removeChild","clear","models","indexOf","get","delete","view","add","from","getSelectedItems","push","callback","thisArg","TypeError","modelId","call","clearSelection","selectItem","deselectItem","setItemTemplate","rerender","size","setTemplate","onAfterMount","fetchOnMount","lastFetchTime","fetch","refresh","restEnabled"],"mappings":"yFAoBA,MAAMA,qBAAqBC,EAAAA,KACzB,WAAAC,CAAYC,EAAU,IACpBC,MAAM,CACJC,UAAW,oBACRF,IAILG,KAAKC,UAAW,EAChBD,KAAKE,MAAQL,EAAQK,OAAS,EAC9BF,KAAKG,SAAWN,EAAQM,UAAY,KAG/BH,KAAKI,WACRJ,KAAKI,SAAW,+lBAepB,CAKA,oBAAMC,CAAeC,EAAOC,GAC1BD,EAAME,kBAEFR,KAAKC,SACPD,KAAKS,WAELT,KAAKU,QAET,CAKA,MAAAA,GACMV,KAAKC,WAETD,KAAKC,UAAW,EAChBD,KAAKW,SAAS,YAGdX,KAAKY,KAAK,cAAe,CACvBC,KAAMb,KACNc,MAAOd,KAAKc,MACZZ,MAAOF,KAAKE,MACZa,KAAMf,KAAKc,OAAO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AAK4B,UAAUmD,IAAIU,GAIpC,OAHInB,GACFA,EAAS7D,WAEJT,IACT,CAQA,eAAA8F,CAAgB1F,EAAU2F,GAAW,GAanC,OAZA/F,KAAKgC,aAAe5B,EAEhB2F,GAAY/F,KAAK4B,UAAUoE,KAAO,GAEpChG,KAAK2D,YAAaW,IAChBA,EAAS2B,YAAY7F,GACjBkE,EAASH,aACXG,EAAST,WAKR7D,IACT,CAEA,kBAAMkG,SACIpG,MAAMoG,gBACRlG,KAAK2B,aAAe3B,KAAKH,QAAQsG,cAAiBnG,KAAK2B,WAAWyE,eAClEpG,KAAK2B,WAAW0E,OAExB,CAKA,aAAMC,GACJ,GAAItG,KAAK2B,YAAc3B,KAAK2B,WAAW4E,YACrC,aAAavG,KAAK2B,WAAW0E,QAE/BrG,KAAKuD,aACP,CAKA,aAAM9B,GAEAzB,KAAK2B,aACP3B,KAAK2B,WAAWkB,IAAI,MAAO7C,KAAK8C,eAAgB9C,MAChDA,KAAK2B,WAAWkB,IAAI,SAAU7C,KAAK+C,iBAAkB/C,MACrDA,KAAK2B,WAAWkB,IAAI,QAAS7C,KAAKgD,mBAAoBhD,MACtDA,KAAK2B,WAAWkB,IAAI,cAAe7C,KAAKiD,cAAejD,MACvDA,KAAK2B,WAAWkB,IAAI,YAAa7C,KAAKkD,YAAalD,OAIrDA,KAAK8D,oBAGChE,MAAM2B,SACd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListView-PvjChHYI.js","sources":["../../src/core/views/list/ListViewItem.js","../../src/core/views/list/ListView.js"],"sourcesContent":["/**\n * ListViewItem - Individual item view for ListView\n *\n * Each item is its own View with its own model, allowing for\n * independent re-rendering when the model changes.\n *\n * Events:\n * - 'item:click' - Emitted when item is clicked\n * - 'item:select' - Emitted when item is selected\n * - 'item:deselect' - Emitted when item is deselected\n *\n * @example\n * const item = new ListViewItem({\n * model: userModel,\n * template: '<div class=\"user-item\">{{name}} - {{email}}</div>'\n * });\n */\n\nimport View from '@core/View.js';\n\nclass ListViewItem extends View {\n constructor(options = {}) {\n super({\n className: 'list-view-item',\n ...options\n });\n\n // Item-specific properties\n this.selected = false;\n this.index = options.index ?? 0;\n this.listView = options.listView ?? null;\n\n // Default template if none provided\n if (!this.template) {\n this.template = `\n <div class=\"list-item-content\" data-action=\"select\">\n {{#model}}\n {{#id}}<span class=\"item-id\">{{id}}</span>{{/id}}\n {{#name}}<span class=\"item-name\">{{name}}</span>{{/name}}\n {{#title}}<span class=\"item-title\">{{title}}</span>{{/title}}\n {{#label}}<span class=\"item-label\">{{label}}</span>{{/label}}\n {{#description}}<p class=\"item-description\">{{description}}</p>{{/description}}\n {{/model}}\n {{^model}}\n <span class=\"item-empty\">No data</span>\n {{/model}}\n </div>\n `;\n }\n }\n\n /**\n * Handle item selection action\n */\n async onActionSelect(event, _element) {\n event.stopPropagation();\n\n if (this.selected) {\n this.deselect();\n } else {\n this.select();\n }\n }\n\n /**\n * Select this item\n */\n select() {\n if (this.selected) return;\n\n this.selected = true;\n this.addClass('selected');\n\n // Emit selection event with item data\n this.emit('item:select', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n\n // Notify parent ListView if available\n if (this.listView) {\n this.listView.emit('item:select', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n }\n }\n\n /**\n * Deselect this item\n */\n deselect() {\n if (!this.selected) return;\n\n this.selected = false;\n this.removeClass('selected');\n\n // Emit deselection event\n this.emit('item:deselect', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n\n // Notify parent ListView if available\n if (this.listView) {\n this.listView.emit('item:deselect', {\n item: this,\n model: this.model,\n index: this.index,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n }\n }\n\n /**\n * Handle click events on the item\n */\n async onActionDefault(action, _event, _element) {\n // Emit click event for any action not specifically handled\n this.emit('item:click', {\n item: this,\n model: this.model,\n index: this.index,\n action: action,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n\n // Notify parent ListView if available\n if (this.listView) {\n this.listView.emit('item:click', {\n item: this,\n model: this.model,\n index: this.index,\n action: action,\n data: this.model?.toJSON ? this.model.toJSON() : this.model\n });\n }\n }\n\n /**\n * Set the item's index in the list\n */\n setIndex(index) {\n this.index = index;\n this.element.setAttribute('data-index', index);\n return this;\n }\n\n /**\n * Update the item's selection state\n */\n setSelected(selected) {\n if (selected) {\n this.select();\n } else {\n this.deselect();\n }\n return this;\n }\n\n /**\n * Override destroy to clean up references\n */\n async destroy() {\n // Remove reference to parent ListView\n this.listView = null;\n\n // Call parent destroy\n await super.destroy();\n }\n}\n\nexport default ListViewItem;\n","/**\n * ListView - Visual list component for Collections\n *\n * Manages a collection of ListViewItem views, each with its own model.\n * When a model changes, only its corresponding ListViewItem re-renders.\n *\n * Events:\n * - 'item:click' - Emitted when any item is clicked\n * - 'item:select' - Emitted when an item is selected\n * - 'item:deselect' - Emitted when an item is deselected\n * - 'selection:change' - Emitted when selection changes\n * - 'list:empty' - Emitted when list becomes empty\n * - 'list:loaded' - Emitted when list is populated\n *\n * @example\n * // Basic usage with custom item template\n * const listView = new ListView({\n * collection: userCollection,\n * itemTemplate: '<div class=\"user-item\">{{name}} - {{email}}</div>',\n * selectionMode: 'single'\n * });\n *\n * // Custom template with model fields\n * const productList = new ListView({\n * collection: productCollection,\n * itemTemplate: `\n * <div class=\"product-card\" data-action=\"select\">\n * <h4>{{name}}</h4>\n * <p class=\"price\">{{price|currency}}</p>\n * <p>{{description|truncate(100)}}</p>\n * </div>\n * `,\n * selectionMode: 'multiple'\n * });\n *\n * // Using custom item class with template\n * const customList = new ListView({\n * collection: myCollection,\n * itemClass: CustomListItem, // Your custom ListViewItem subclass\n * itemTemplate: '<div>{{title}}</div>', // Passed as 'template' to itemClass constructor\n * selectionMode: 'none'\n * });\n *\n * // Dynamic template update\n * listView.setItemTemplate('<div class=\"compact\">{{name}}</div>', true);\n */\n\nimport View from '@core/View.js';\nimport Collection from '@core/Collection.js';\nimport ListViewItem from './ListViewItem.js';\n\nclass ListView extends View {\n constructor(options = {}) {\n super({\n className: 'list-view',\n template: `\n <div class=\"list-view-container\">\n {{#loading}}\n <div class=\"list-loading\">\n <div class=\"spinner-border spinner-border-sm\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n Loading...\n </div>\n {{/loading}}\n {{^loading}}\n {{#isEmpty}}\n <div class=\"list-empty\">\n {{emptyMessage}}\n </div>\n {{/isEmpty}}\n {{^isEmpty}}\n <div class=\"list-items\" data-container=\"items\"></div>\n {{/isEmpty}}\n {{/loading}}\n </div>\n `,\n ...options\n });\n\n // ListView specific properties\n this.collection = null;\n this.itemViews = new Map(); // Map of model.id -> ListViewItem\n this.selectedItems = new Set(); // Set of selected item IDs\n\n // Configuration\n this.itemTemplate = options.itemTemplate || null; // Template passed to each item's view\n this.itemClass = options.itemClass || ListViewItem; // Class for creating item views\n this.selectionMode = options.selectionMode || 'none'; // none, single, multiple\n this.emptyMessage = options.emptyMessage || 'No items to display';\n this.loading = false;\n this.isEmpty = true;\n\n }\n\n /**\n * Override onInit to set up initial state\n */\n async onInit() {\n // Initial render will happen automatically\n this._initCollection(this.options.collection || this.options.Collection);\n }\n\n\n /**\n * Initialize the collection\n */\n _initCollection(collectionOrClass) {\n if (!collectionOrClass) {\n console.log('Collection not provided');\n return;\n };\n\n // Check if it's already a Collection instance\n if (collectionOrClass instanceof Collection) {\n this.setCollection(collectionOrClass);\n }\n // Check if it's a Collection class\n else if (typeof collectionOrClass === 'function') {\n const collection = new collectionOrClass();\n this.setCollection(collection);\n }\n // Check if it's an array of data\n else if (Array.isArray(collectionOrClass)) {\n const collection = new Collection(null, {}, collectionOrClass);\n this.setCollection(collection);\n }\n }\n\n /**\n * Set the collection for this list view\n */\n setCollection(collection) {\n if (this.collection === collection) return this;\n\n // Clean up old collection listeners\n if (this.collection) {\n this.collection.off('add', this._onModelsAdded, this);\n this.collection.off('remove', this._onModelsRemoved, this);\n this.collection.off('reset', this._onCollectionReset, this);\n this.collection.off('fetch:start', this._onFetchStart, this);\n this.collection.off('fetch:end', this._onFetchEnd, this);\n }\n\n this.collection = collection;\n\n if (this.options.defaultQuery && !this.options.collectionParams) {\n this.collection.params = {...this.options.defaultQuery, ...this.collection.params};\n }\n\n if (this.options.collectionParams) {\n this.collection.params = {...this.options.collectionParams, ...this.collection.params};\n }\n\n // Set up new collection listeners\n if (this.collection) {\n this.collection.on('add', this._onModelsAdded, this);\n this.collection.on('remove', this._onModelsRemoved, this);\n this.collection.on('reset', this._onCollectionReset, this);\n this.collection.on('fetch:start', this._onFetchStart, this);\n this.collection.on('fetch:end', this._onFetchEnd, this);\n\n // Build items for existing models\n this._buildItems();\n }\n\n return this;\n }\n\n async _renderChildren() {\n await super._renderChildren();\n const itemsContainer = this.getChildElement(\"items\");\n if (!itemsContainer) {\n // console.warn('ListView: items container not found');\n return;\n }\n this.forEachItem((item, index) => {\n itemsContainer.appendChild(item.element);\n item.render(false);\n });\n }\n\n /**\n * Build item views for all models in collection\n */\n _buildItems() {\n // Clear existing items\n this._clearItems();\n\n if (!this.collection || this.collection.isEmpty()) {\n this.isEmpty = true;\n this.emit('list:empty');\n return;\n }\n\n this.isEmpty = false;\n\n // Create item views for each model\n this.collection.forEach((model, index) => {\n this._createItemView(model, index);\n });\n\n this.emit('list:loaded', { count: this.collection.length() });\n\n // Render if already mounted\n if (this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Create an item view for a model\n * The itemTemplate is passed as the template option to the itemClass constructor\n */\n _createItemView(model, index) {\n // Don't create duplicate views\n if (this.itemViews.has(model.id)) return;\n\n const itemView = new this.itemClass({\n model: model,\n index: index,\n listView: this,\n template: this.itemTemplate, // Pass the itemTemplate to the item view\n });\n\n // Store the item view\n this.itemViews.set(model.id, itemView);\n\n // Set up item event listeners\n itemView.on('item:select', this._onItemSelect.bind(this));\n itemView.on('item:deselect', this._onItemDeselect.bind(this));\n\n return itemView;\n }\n\n /**\n * Clear all item views\n */\n _clearItems() {\n this.forEachItem(itemView => {\n this.removeChild(itemView.id);\n });\n this.itemViews.clear();\n this.selectedItems.clear();\n }\n\n /**\n * Handle models added to collection\n */\n _onModelsAdded(event) {\n const { models } = event;\n\n models.forEach(model => {\n const index = this.collection.models.indexOf(model);\n this._createItemView(model, index);\n });\n\n this.isEmpty = this.collection.isEmpty();\n\n // Re-render to show new items\n if (!this.loading && this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Handle models removed from collection\n */\n _onModelsRemoved(event) {\n const { models } = event;\n\n models.forEach(model => {\n const itemView = this.itemViews.get(model.id);\n if (itemView) {\n this.removeChild(itemView.id);\n this.itemViews.delete(model.id);\n this.selectedItems.delete(model.id);\n }\n });\n\n this.isEmpty = this.collection.isEmpty();\n\n // Re-render to update display\n if (!this.loading && this.isMounted()) {\n this.render();\n }\n\n if (this.isEmpty) {\n this.emit('list:empty');\n }\n }\n\n /**\n * Handle collection reset\n */\n _onCollectionReset(_event) {\n this._buildItems();\n }\n\n /**\n * Handle fetch start\n */\n _onFetchStart() {\n this.loading = true;\n if (this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Handle fetch end\n */\n _onFetchEnd() {\n this.loading = false;\n if (this.isMounted()) {\n this.render();\n }\n }\n\n /**\n * Handle item selection\n */\n _onItemSelect(event) {\n const { model, item } = event;\n\n if (this.selectionMode === 'none') {\n item.deselect();\n return;\n }\n\n if (this.selectionMode === 'single') {\n // Deselect all other items\n this.itemViews.forEach((view, id) => {\n if (id !== model.id && view.selected) {\n view.deselect();\n }\n });\n this.selectedItems.clear();\n }\n\n this.selectedItems.add(model.id);\n\n this.emit('selection:change', {\n selected: Array.from(this.selectedItems),\n item: item,\n model: model\n });\n }\n\n /**\n * Handle item deselection\n */\n _onItemDeselect(event) {\n const { model } = event;\n\n this.selectedItems.delete(model.id);\n\n this.emit('selection:change', {\n selected: Array.from(this.selectedItems),\n item: event.item,\n model: model\n });\n }\n\n /**\n * Get selected items\n */\n getSelectedItems() {\n const selected = [];\n this.selectedItems.forEach(id => {\n const itemView = this.itemViews.get(id);\n if (itemView) {\n selected.push({\n view: itemView,\n model: itemView.model,\n data: itemView.model?.toJSON ? itemView.model.toJSON() : itemView.model\n });\n }\n });\n return selected;\n }\n\n /**\n * Iterate over each item view in the list\n * @param {function} callback - Function to execute for each item (itemView, model, index)\n * @param {object} thisArg - Optional value to use as this when executing callback\n * @returns {ListView} Returns the ListView for chaining\n */\n forEachItem(callback, thisArg) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback must be a function');\n }\n\n let index = 0;\n this.itemViews.forEach((itemView, modelId) => {\n callback.call(thisArg, itemView, itemView.model, index++);\n });\n\n return this;\n }\n\n /**\n * Clear selection\n */\n clearSelection() {\n this.forEachItem(itemView => {\n if (itemView.selected) {\n itemView.deselect();\n }\n });\n this.selectedItems.clear();\n\n this.emit('selection:change', {\n selected: []\n });\n }\n\n /**\n * Select item by model ID\n */\n selectItem(modelId) {\n const itemView = this.itemViews.get(modelId);\n if (itemView) {\n itemView.select();\n }\n return this;\n }\n\n /**\n * Deselect item by model ID\n */\n deselectItem(modelId) {\n const itemView = this.itemViews.get(modelId);\n if (itemView) {\n itemView.deselect();\n }\n return this;\n }\n\n /**\n * Set or update the item template\n * @param {string} template - New template string for items\n * @param {boolean} rerender - Whether to re-render existing items with new template\n * @returns {ListView} Returns the ListView for chaining\n */\n setItemTemplate(template, rerender = false) {\n this.itemTemplate = template;\n\n if (rerender && this.itemViews.size > 0) {\n // Update template for all existing item views\n this.forEachItem((itemView) => {\n itemView.setTemplate(template);\n if (itemView.isMounted()) {\n itemView.render();\n }\n });\n }\n\n return this;\n }\n\n async onAfterMount() {\n await super.onAfterMount();\n if (this.collection && (this.options.fetchOnMount || !this.collection.lastFetchTime)) {\n this.collection.fetch();\n }\n }\n\n /**\n * Refresh the list (re-fetch if collection supports it)\n */\n async refresh() {\n if (this.collection && this.collection.restEnabled) {\n return await this.collection.fetch();\n }\n this._buildItems();\n }\n\n /**\n * Override destroy to clean up\n */\n async destroy() {\n // Clean up collection listeners\n if (this.collection) {\n this.collection.off('add', this._onModelsAdded, this);\n this.collection.off('remove', this._onModelsRemoved, this);\n this.collection.off('reset', this._onCollectionReset, this);\n this.collection.off('fetch:start', this._onFetchStart, this);\n this.collection.off('fetch:end', this._onFetchEnd, this);\n }\n\n // Clear items\n this._clearItems();\n\n // Call parent destroy\n await super.destroy();\n }\n}\n\nexport default ListView;\n"],"names":[],"mappings":";;AAoBA,MAAM,qBAAqB,KAAK;AAAA,EAC9B,YAAY,UAAU,IAAI;AACxB,UAAM;AAAA,MACJ,WAAW;AAAA,MACX,GAAG;AAAA,IACT,CAAK;AAGD,SAAK,WAAW;AAChB,SAAK,QAAQ,QAAQ,SAAS;AAC9B,SAAK,WAAW,QAAQ,YAAY;AAGpC,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAclB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,eAAe,OAAO,UAAU;AACpC,UAAM,gBAAe;AAErB,QAAI,KAAK,UAAU;AACjB,WAAK,SAAQ;AAAA,IACf,OAAO;AACL,WAAK,OAAM;AAAA,IACb;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACP,QAAI,KAAK,SAAU;AAEnB,SAAK,WAAW;AAChB,SAAK,SAAS,UAAU;AAGxB,SAAK,KAAK,eAAe;AAAA,MACvB,MAAM;AAAA,MACN,OAAO,KAAK;AAAA,MACZ,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,OAAO,SAAS,KAAK,MAAM,OAAM,IAAK,KAAK;AAAA,IAC5D,CAAK;AAGD,QAAI,KAAK,UAAU;AACjB,WAAK,SAAS,KAAK,eAAe;AAAA,QAChC,MAAM;AAAA,QACN,OAAO,KAAK;AAA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