@simple-table/angular 3.0.2 → 3.0.5

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/README.md CHANGED
@@ -34,4 +34,4 @@ npm install @simple-table/angular
34
34
 
35
35
  ## License
36
36
 
37
- Dual licensed — MIT for individuals & startups, proprietary Pro tier for revenue-generating companies. See [LICENSE](LICENSE) and [EULA.txt](../../EULA.txt) for details.
37
+ Dual licensed — MIT for zero-revenue individuals and startups; Pro and Enterprise (commercial EULA) for revenue-generating companies. See [LICENSE](LICENSE), [EULA.txt](../../EULA.txt), and [pricing](https://www.simple-table.com/pricing).
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@angular/core"),t=require("simple-table-core");function o(e,t,o,n){var i,r=arguments.length,p=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(p=(r<3?i(p):r>3?i(t,o,p):i(t,o))||p);return r>3&&p&&Object.defineProperty(t,o,p),p}function n(t,o,i){const{defaultHeaders:r,rows:p,footerRenderer:l,emptyStateRenderer:s,errorStateRenderer:d,loadingStateRenderer:a,tableEmptyStateRenderer:m,headerDropdown:h,columnEditorConfig:u,icons:C,...c}=t,v=t=>function(t,o,n){return i=>{const r=document.createElement("div"),p=e.createComponent(t,{environmentInjector:n,hostElement:r});return Object.assign(p.instance,i),o.attachView(p.hostView),p.changeDetectorRef.detectChanges(),r}}(t,o,i),g={...c,rows:p,defaultHeaders:r.map(function e(t){const{cellRenderer:r,headerRenderer:p,children:l,nestedTable:s,...d}=t,a={...d};if(r&&(a.cellRenderer=r.ɵcmp?v(r):r),p&&(a.headerRenderer=p.ɵcmp?v(p):p),l&&(a.children=l.map(e)),s){const e={...s,rows:[]};a.nestedTable=n(e,o,i)}return a})};return void 0!==l&&(g.footerRenderer=l.ɵcmp?v(l):l),void 0!==s&&(g.emptyStateRenderer=s.ɵcmp?v(s):s),void 0!==d&&(g.errorStateRenderer=d.ɵcmp?v(d):d),void 0!==a&&(g.loadingStateRenderer=a.ɵcmp?v(a):a),void 0!==m&&(g.tableEmptyStateRenderer=m),void 0!==h&&(g.headerDropdown=v(h)),void 0!==u&&(g.columnEditorConfig=function(e){const{rowRenderer:t,customRenderer:o,...n}=e;return{...n,...t?{rowRenderer:v(t)}:{},...o?{customRenderer:v(o)}:{}}}(u)),void 0!==C&&(g.icons=function(e){const t={};for(const[o,n]of Object.entries(e))null!=n&&(t[o]="string"==typeof n||n instanceof HTMLElement||n instanceof SVGSVGElement?n:n.ɵcmp?v(n)({}):n);return t}(C)),g}"function"==typeof SuppressedError&&SuppressedError,exports.SimpleTableComponent=class{constructor(){this.tableReady=new e.EventEmitter,this.instance=null,this.hostEl=e.inject(e.ElementRef),this.appRef=e.inject(e.ApplicationRef),this.envInjector=e.inject(e.EnvironmentInjector)}ngOnInit(){const e=this.hostEl.nativeElement.querySelector("div");e&&(this.instance=new t.SimpleTableVanilla(e,n(this.getProps(),this.appRef,this.envInjector)),this.instance.mount(),this.tableReady.emit(this.instance.getAPI()))}ngOnChanges(){this.instance?.update(n(this.getProps(),this.appRef,this.envInjector))}ngOnDestroy(){this.instance?.destroy(),this.instance=null}getAPI(){return this.instance?.getAPI()??null}getProps(){const e={rows:this.rows,defaultHeaders:this.defaultHeaders};return void 0!==this.footerRenderer&&(e.footerRenderer=this.footerRenderer),void 0!==this.loadingStateRenderer&&(e.loadingStateRenderer=this.loadingStateRenderer),void 0!==this.errorStateRenderer&&(e.errorStateRenderer=this.errorStateRenderer),void 0!==this.emptyStateRenderer&&(e.emptyStateRenderer=this.emptyStateRenderer),void 0!==this.tableEmptyStateRenderer&&(e.tableEmptyStateRenderer=this.tableEmptyStateRenderer),void 0!==this.headerDropdown&&(e.headerDropdown=this.headerDropdown),void 0!==this.columnEditorConfig&&(e.columnEditorConfig=this.columnEditorConfig),void 0!==this.onCellClick&&(e.onCellClick=this.onCellClick),void 0!==this.onCellEdit&&(e.onCellEdit=this.onCellEdit),void 0!==this.onSortChange&&(e.onSortChange=this.onSortChange),void 0!==this.onFilterChange&&(e.onFilterChange=this.onFilterChange),void 0!==this.onRowSelectionChange&&(e.onRowSelectionChange=this.onRowSelectionChange),void 0!==this.onRowGroupExpand&&(e.onRowGroupExpand=this.onRowGroupExpand),void 0!==this.onColumnOrderChange&&(e.onColumnOrderChange=this.onColumnOrderChange),void 0!==this.onColumnVisibilityChange&&(e.onColumnVisibilityChange=this.onColumnVisibilityChange),void 0!==this.onColumnWidthChange&&(e.onColumnWidthChange=this.onColumnWidthChange),void 0!==this.onPageChange&&(e.onPageChange=this.onPageChange),void 0!==this.onLoadMore&&(e.onLoadMore=this.onLoadMore),void 0!==this.onGridReady&&(e.onGridReady=this.onGridReady),void 0!==this.rowGrouping&&(e.rowGrouping=this.rowGrouping),void 0!==this.enableRowSelection&&(e.enableRowSelection=this.enableRowSelection),void 0!==this.theme&&(e.theme=this.theme),void 0!==this.quickFilter&&(e.quickFilter=this.quickFilter),void 0!==this.isLoading&&(e.isLoading=this.isLoading),void 0!==this.getRowId&&(e.getRowId=this.getRowId),void 0!==this.shouldPaginate&&(e.shouldPaginate=this.shouldPaginate),void 0!==this.rowsPerPage&&(e.rowsPerPage=this.rowsPerPage),void 0!==this.serverSidePagination&&(e.serverSidePagination=this.serverSidePagination),void 0!==this.totalRowCount&&(e.totalRowCount=this.totalRowCount),void 0!==this.height&&(e.height=this.height),void 0!==this.maxHeight&&(e.maxHeight=this.maxHeight),void 0!==this.columnResizing&&(e.columnResizing=this.columnResizing),void 0!==this.columnReordering&&(e.columnReordering=this.columnReordering),void 0!==this.editColumns&&(e.editColumns=this.editColumns),void 0!==this.editColumnsInitOpen&&(e.editColumnsInitOpen=this.editColumnsInitOpen),void 0!==this.selectableCells&&(e.selectableCells=this.selectableCells),void 0!==this.selectableColumns&&(e.selectableColumns=this.selectableColumns),void 0!==this.enableHeaderEditing&&(e.enableHeaderEditing=this.enableHeaderEditing),void 0!==this.onHeaderEdit&&(e.onHeaderEdit=this.onHeaderEdit),void 0!==this.customTheme&&(e.customTheme=this.customTheme),void 0!==this.icons&&(e.icons=this.icons),void 0!==this.externalFilterHandling&&(e.externalFilterHandling=this.externalFilterHandling),void 0!==this.externalSortHandling&&(e.externalSortHandling=this.externalSortHandling),void 0!==this.columnBorders&&(e.columnBorders=this.columnBorders),void 0!==this.rowButtons&&(e.rowButtons=this.rowButtons),void 0!==this.hideFooter&&(e.hideFooter=this.hideFooter),void 0!==this.initialSortColumn&&(e.initialSortColumn=this.initialSortColumn),void 0!==this.initialSortDirection&&(e.initialSortDirection=this.initialSortDirection),void 0!==this.expandAll&&(e.expandAll=this.expandAll),void 0!==this.autoExpandColumns&&(e.autoExpandColumns=this.autoExpandColumns),e}},o([e.Input({required:!0})],exports.SimpleTableComponent.prototype,"rows",void 0),o([e.Input({required:!0})],exports.SimpleTableComponent.prototype,"defaultHeaders",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"footerRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"loadingStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"errorStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"emptyStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"tableEmptyStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"headerDropdown",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnEditorConfig",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onCellClick",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onCellEdit",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onSortChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onFilterChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onRowSelectionChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onRowGroupExpand",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onColumnOrderChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onColumnVisibilityChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onColumnWidthChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onPageChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onLoadMore",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onGridReady",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"rowGrouping",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"enableRowSelection",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"theme",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"quickFilter",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"isLoading",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"getRowId",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"shouldPaginate",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"rowsPerPage",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"serverSidePagination",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"totalRowCount",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"height",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"maxHeight",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnResizing",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnReordering",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"editColumns",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"editColumnsInitOpen",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"selectableCells",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"selectableColumns",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"enableHeaderEditing",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onHeaderEdit",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"customTheme",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"icons",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"externalFilterHandling",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"externalSortHandling",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnBorders",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"rowButtons",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"hideFooter",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"initialSortColumn",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"initialSortDirection",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"expandAll",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"autoExpandColumns",void 0),o([e.Output()],exports.SimpleTableComponent.prototype,"tableReady",void 0),exports.SimpleTableComponent=o([e.Component({selector:"simple-table",standalone:!0,template:"<div #host></div>",styles:[":host { display: block; }"]})],exports.SimpleTableComponent),Object.defineProperty(exports,"asRows",{enumerable:!0,get:function(){return t.asRows}}),exports.defaultHeaderFromCore=function(e){return e},exports.defaultHeadersFromCore=function(e){return e},exports.mapToAngularHeaderObjects=function(e){return e},exports.provideSimpleTable=function(){return e.makeEnvironmentProviders([])};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@angular/core"),t=require("simple-table-core");function o(e,t,o,n){var i,r=arguments.length,p=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(p=(r<3?i(p):r>3?i(t,o,p):i(t,o))||p);return r>3&&p&&Object.defineProperty(t,o,p),p}function n(t,o,n){return i=>{const r=document.createElement("div"),p=e.createComponent(t,{environmentInjector:n,hostElement:r});return Object.assign(p.instance,i),o.attachView(p.hostView),p.changeDetectorRef.detectChanges(),r}}function i(e,t,o){const{defaultHeaders:r,rows:p,footerRenderer:l,emptyStateRenderer:s,errorStateRenderer:d,loadingStateRenderer:a,tableEmptyStateRenderer:m,headerDropdown:h,columnEditorConfig:u,icons:C,onColumnOrderChange:c,onColumnWidthChange:v,onHeaderEdit:g,onColumnSelect:S,...b}=e,y=e=>n(e,t,o),R={...b,rows:p,defaultHeaders:r.map(function e(n){const{cellRenderer:r,headerRenderer:p,children:l,nestedTable:s,...d}=n,a={...d};if(r&&(a.cellRenderer=r.ɵcmp?y(r):r),p&&(a.headerRenderer=p.ɵcmp?y(p):p),l&&(a.children=l.map(e)),s){const e={...s,rows:[]};a.nestedTable=i(e,t,o)}return a}),...c?{onColumnOrderChange:e=>c(e)}:{},...v?{onColumnWidthChange:e=>v(e)}:{},...g?{onHeaderEdit:(e,t)=>g(e,t)}:{},...S?{onColumnSelect:e=>S(e)}:{}};return void 0!==l&&(R.footerRenderer=l.ɵcmp?y(l):l),void 0!==s&&(R.emptyStateRenderer=s.ɵcmp?y(s):s),void 0!==d&&(R.errorStateRenderer=d.ɵcmp?y(d):d),void 0!==a&&(R.loadingStateRenderer=a.ɵcmp?y(a):a),void 0!==m&&(R.tableEmptyStateRenderer=m),void 0!==h&&(R.headerDropdown=y(h)),void 0!==u&&(R.columnEditorConfig=function(e){const{rowRenderer:t,customRenderer:o,...n}=e;return{...n,...t?{rowRenderer:y(t)}:{},...o?{customRenderer:y(o)}:{}}}(u)),void 0!==C&&(R.icons=function(e){const t={};for(const[o,n]of Object.entries(e))null!=n&&(t[o]="string"==typeof n||n instanceof HTMLElement||n instanceof SVGSVGElement?n:n.ɵcmp?y(n)({}):n);return t}(C)),R}"function"==typeof SuppressedError&&SuppressedError,exports.SimpleTableComponent=class{constructor(){this.tableReady=new e.EventEmitter,this.instance=null,this.hostEl=e.inject(e.ElementRef),this.appRef=e.inject(e.ApplicationRef),this.envInjector=e.inject(e.EnvironmentInjector)}ngOnInit(){const e=this.hostEl.nativeElement.querySelector("div");e&&(this.instance=new t.SimpleTableVanilla(e,i(this.getProps(),this.appRef,this.envInjector)),this.instance.mount(),this.tableReady.emit(this.instance.getAPI()))}ngOnChanges(){this.instance?.update(i(this.getProps(),this.appRef,this.envInjector))}ngOnDestroy(){this.instance?.destroy(),this.instance=null}getAPI(){return this.instance?.getAPI()??null}getProps(){const e={rows:this.rows,defaultHeaders:this.defaultHeaders};return void 0!==this.footerRenderer&&(e.footerRenderer=this.footerRenderer),void 0!==this.loadingStateRenderer&&(e.loadingStateRenderer=this.loadingStateRenderer),void 0!==this.errorStateRenderer&&(e.errorStateRenderer=this.errorStateRenderer),void 0!==this.emptyStateRenderer&&(e.emptyStateRenderer=this.emptyStateRenderer),void 0!==this.tableEmptyStateRenderer&&(e.tableEmptyStateRenderer=this.tableEmptyStateRenderer),void 0!==this.headerDropdown&&(e.headerDropdown=this.headerDropdown),void 0!==this.columnEditorConfig&&(e.columnEditorConfig=this.columnEditorConfig),void 0!==this.onCellClick&&(e.onCellClick=this.onCellClick),void 0!==this.onCellEdit&&(e.onCellEdit=this.onCellEdit),void 0!==this.onSortChange&&(e.onSortChange=this.onSortChange),void 0!==this.onFilterChange&&(e.onFilterChange=this.onFilterChange),void 0!==this.onRowSelectionChange&&(e.onRowSelectionChange=this.onRowSelectionChange),void 0!==this.onRowGroupExpand&&(e.onRowGroupExpand=this.onRowGroupExpand),void 0!==this.onColumnOrderChange&&(e.onColumnOrderChange=this.onColumnOrderChange),void 0!==this.onColumnVisibilityChange&&(e.onColumnVisibilityChange=this.onColumnVisibilityChange),void 0!==this.onColumnWidthChange&&(e.onColumnWidthChange=this.onColumnWidthChange),void 0!==this.onPageChange&&(e.onPageChange=this.onPageChange),void 0!==this.onLoadMore&&(e.onLoadMore=this.onLoadMore),void 0!==this.onGridReady&&(e.onGridReady=this.onGridReady),void 0!==this.rowGrouping&&(e.rowGrouping=this.rowGrouping),void 0!==this.enableRowSelection&&(e.enableRowSelection=this.enableRowSelection),void 0!==this.theme&&(e.theme=this.theme),void 0!==this.quickFilter&&(e.quickFilter=this.quickFilter),void 0!==this.isLoading&&(e.isLoading=this.isLoading),void 0!==this.getRowId&&(e.getRowId=this.getRowId),void 0!==this.shouldPaginate&&(e.shouldPaginate=this.shouldPaginate),void 0!==this.rowsPerPage&&(e.rowsPerPage=this.rowsPerPage),void 0!==this.serverSidePagination&&(e.serverSidePagination=this.serverSidePagination),void 0!==this.totalRowCount&&(e.totalRowCount=this.totalRowCount),void 0!==this.height&&(e.height=this.height),void 0!==this.maxHeight&&(e.maxHeight=this.maxHeight),void 0!==this.columnResizing&&(e.columnResizing=this.columnResizing),void 0!==this.columnReordering&&(e.columnReordering=this.columnReordering),void 0!==this.editColumns&&(e.editColumns=this.editColumns),void 0!==this.editColumnsInitOpen&&(e.editColumnsInitOpen=this.editColumnsInitOpen),void 0!==this.selectableCells&&(e.selectableCells=this.selectableCells),void 0!==this.selectableColumns&&(e.selectableColumns=this.selectableColumns),void 0!==this.enableHeaderEditing&&(e.enableHeaderEditing=this.enableHeaderEditing),void 0!==this.onHeaderEdit&&(e.onHeaderEdit=this.onHeaderEdit),void 0!==this.customTheme&&(e.customTheme=this.customTheme),void 0!==this.icons&&(e.icons=this.icons),void 0!==this.externalFilterHandling&&(e.externalFilterHandling=this.externalFilterHandling),void 0!==this.externalSortHandling&&(e.externalSortHandling=this.externalSortHandling),void 0!==this.columnBorders&&(e.columnBorders=this.columnBorders),void 0!==this.rowButtons&&(e.rowButtons=this.rowButtons),void 0!==this.hideFooter&&(e.hideFooter=this.hideFooter),void 0!==this.initialSortColumn&&(e.initialSortColumn=this.initialSortColumn),void 0!==this.initialSortDirection&&(e.initialSortDirection=this.initialSortDirection),void 0!==this.expandAll&&(e.expandAll=this.expandAll),void 0!==this.autoExpandColumns&&(e.autoExpandColumns=this.autoExpandColumns),e}},o([e.Input({required:!0})],exports.SimpleTableComponent.prototype,"rows",void 0),o([e.Input({required:!0})],exports.SimpleTableComponent.prototype,"defaultHeaders",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"footerRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"loadingStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"errorStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"emptyStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"tableEmptyStateRenderer",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"headerDropdown",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnEditorConfig",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onCellClick",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onCellEdit",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onSortChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onFilterChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onRowSelectionChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onRowGroupExpand",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onColumnOrderChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onColumnVisibilityChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onColumnWidthChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onPageChange",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onLoadMore",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onGridReady",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"rowGrouping",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"enableRowSelection",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"theme",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"quickFilter",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"isLoading",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"getRowId",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"shouldPaginate",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"rowsPerPage",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"serverSidePagination",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"totalRowCount",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"height",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"maxHeight",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnResizing",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnReordering",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"editColumns",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"editColumnsInitOpen",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"selectableCells",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"selectableColumns",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"enableHeaderEditing",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"onHeaderEdit",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"customTheme",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"icons",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"externalFilterHandling",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"externalSortHandling",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"columnBorders",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"rowButtons",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"hideFooter",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"initialSortColumn",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"initialSortDirection",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"expandAll",void 0),o([e.Input()],exports.SimpleTableComponent.prototype,"autoExpandColumns",void 0),o([e.Output()],exports.SimpleTableComponent.prototype,"tableReady",void 0),exports.SimpleTableComponent=o([e.Component({selector:"simple-table",standalone:!0,template:"<div #host></div>",styles:[":host { display: block; }"]})],exports.SimpleTableComponent),Object.defineProperty(exports,"asRows",{enumerable:!0,get:function(){return t.asRows}}),exports.provideSimpleTable=function(){return e.makeEnvironmentProviders([])},exports.wrapAngularRenderer=n;
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{createComponent as e,Input as t,Output as o,Component as i,EventEmitter as n,inject as r,ElementRef as d,ApplicationRef as s,EnvironmentInjector as a,makeEnvironmentProviders as l}from"@angular/core";import{SimpleTableVanilla as h}from"simple-table-core";export{asRows}from"simple-table-core";function p(e,t,o,i){var n,r=arguments.length,d=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(d=(r<3?n(d):r>3?n(t,o,d):n(t,o))||d);return r>3&&d&&Object.defineProperty(t,o,d),d}function c(t,o,i){const{defaultHeaders:n,rows:r,footerRenderer:d,emptyStateRenderer:s,errorStateRenderer:a,loadingStateRenderer:l,tableEmptyStateRenderer:h,headerDropdown:p,columnEditorConfig:u,icons:v,...g}=t,m=t=>function(t,o,i){return n=>{const r=document.createElement("div"),d=e(t,{environmentInjector:i,hostElement:r});return Object.assign(d.instance,n),o.attachView(d.hostView),d.changeDetectorRef.detectChanges(),r}}(t,o,i),C={...g,rows:r,defaultHeaders:n.map(function e(t){const{cellRenderer:n,headerRenderer:r,children:d,nestedTable:s,...a}=t,l={...a};if(n&&(l.cellRenderer=n.ɵcmp?m(n):n),r&&(l.headerRenderer=r.ɵcmp?m(r):r),d&&(l.children=d.map(e)),s){const e={...s,rows:[]};l.nestedTable=c(e,o,i)}return l})};return void 0!==d&&(C.footerRenderer=d.ɵcmp?m(d):d),void 0!==s&&(C.emptyStateRenderer=s.ɵcmp?m(s):s),void 0!==a&&(C.errorStateRenderer=a.ɵcmp?m(a):a),void 0!==l&&(C.loadingStateRenderer=l.ɵcmp?m(l):l),void 0!==h&&(C.tableEmptyStateRenderer=h),void 0!==p&&(C.headerDropdown=m(p)),void 0!==u&&(C.columnEditorConfig=function(e){const{rowRenderer:t,customRenderer:o,...i}=e;return{...i,...t?{rowRenderer:m(t)}:{},...o?{customRenderer:m(o)}:{}}}(u)),void 0!==v&&(C.icons=function(e){const t={};for(const[o,i]of Object.entries(e))null!=i&&(t[o]="string"==typeof i||i instanceof HTMLElement||i instanceof SVGSVGElement?i:i.ɵcmp?m(i)({}):i);return t}(v)),C}"function"==typeof SuppressedError&&SuppressedError;let u=class{constructor(){this.tableReady=new n,this.instance=null,this.hostEl=r(d),this.appRef=r(s),this.envInjector=r(a)}ngOnInit(){const e=this.hostEl.nativeElement.querySelector("div");e&&(this.instance=new h(e,c(this.getProps(),this.appRef,this.envInjector)),this.instance.mount(),this.tableReady.emit(this.instance.getAPI()))}ngOnChanges(){this.instance?.update(c(this.getProps(),this.appRef,this.envInjector))}ngOnDestroy(){this.instance?.destroy(),this.instance=null}getAPI(){return this.instance?.getAPI()??null}getProps(){const e={rows:this.rows,defaultHeaders:this.defaultHeaders};return void 0!==this.footerRenderer&&(e.footerRenderer=this.footerRenderer),void 0!==this.loadingStateRenderer&&(e.loadingStateRenderer=this.loadingStateRenderer),void 0!==this.errorStateRenderer&&(e.errorStateRenderer=this.errorStateRenderer),void 0!==this.emptyStateRenderer&&(e.emptyStateRenderer=this.emptyStateRenderer),void 0!==this.tableEmptyStateRenderer&&(e.tableEmptyStateRenderer=this.tableEmptyStateRenderer),void 0!==this.headerDropdown&&(e.headerDropdown=this.headerDropdown),void 0!==this.columnEditorConfig&&(e.columnEditorConfig=this.columnEditorConfig),void 0!==this.onCellClick&&(e.onCellClick=this.onCellClick),void 0!==this.onCellEdit&&(e.onCellEdit=this.onCellEdit),void 0!==this.onSortChange&&(e.onSortChange=this.onSortChange),void 0!==this.onFilterChange&&(e.onFilterChange=this.onFilterChange),void 0!==this.onRowSelectionChange&&(e.onRowSelectionChange=this.onRowSelectionChange),void 0!==this.onRowGroupExpand&&(e.onRowGroupExpand=this.onRowGroupExpand),void 0!==this.onColumnOrderChange&&(e.onColumnOrderChange=this.onColumnOrderChange),void 0!==this.onColumnVisibilityChange&&(e.onColumnVisibilityChange=this.onColumnVisibilityChange),void 0!==this.onColumnWidthChange&&(e.onColumnWidthChange=this.onColumnWidthChange),void 0!==this.onPageChange&&(e.onPageChange=this.onPageChange),void 0!==this.onLoadMore&&(e.onLoadMore=this.onLoadMore),void 0!==this.onGridReady&&(e.onGridReady=this.onGridReady),void 0!==this.rowGrouping&&(e.rowGrouping=this.rowGrouping),void 0!==this.enableRowSelection&&(e.enableRowSelection=this.enableRowSelection),void 0!==this.theme&&(e.theme=this.theme),void 0!==this.quickFilter&&(e.quickFilter=this.quickFilter),void 0!==this.isLoading&&(e.isLoading=this.isLoading),void 0!==this.getRowId&&(e.getRowId=this.getRowId),void 0!==this.shouldPaginate&&(e.shouldPaginate=this.shouldPaginate),void 0!==this.rowsPerPage&&(e.rowsPerPage=this.rowsPerPage),void 0!==this.serverSidePagination&&(e.serverSidePagination=this.serverSidePagination),void 0!==this.totalRowCount&&(e.totalRowCount=this.totalRowCount),void 0!==this.height&&(e.height=this.height),void 0!==this.maxHeight&&(e.maxHeight=this.maxHeight),void 0!==this.columnResizing&&(e.columnResizing=this.columnResizing),void 0!==this.columnReordering&&(e.columnReordering=this.columnReordering),void 0!==this.editColumns&&(e.editColumns=this.editColumns),void 0!==this.editColumnsInitOpen&&(e.editColumnsInitOpen=this.editColumnsInitOpen),void 0!==this.selectableCells&&(e.selectableCells=this.selectableCells),void 0!==this.selectableColumns&&(e.selectableColumns=this.selectableColumns),void 0!==this.enableHeaderEditing&&(e.enableHeaderEditing=this.enableHeaderEditing),void 0!==this.onHeaderEdit&&(e.onHeaderEdit=this.onHeaderEdit),void 0!==this.customTheme&&(e.customTheme=this.customTheme),void 0!==this.icons&&(e.icons=this.icons),void 0!==this.externalFilterHandling&&(e.externalFilterHandling=this.externalFilterHandling),void 0!==this.externalSortHandling&&(e.externalSortHandling=this.externalSortHandling),void 0!==this.columnBorders&&(e.columnBorders=this.columnBorders),void 0!==this.rowButtons&&(e.rowButtons=this.rowButtons),void 0!==this.hideFooter&&(e.hideFooter=this.hideFooter),void 0!==this.initialSortColumn&&(e.initialSortColumn=this.initialSortColumn),void 0!==this.initialSortDirection&&(e.initialSortDirection=this.initialSortDirection),void 0!==this.expandAll&&(e.expandAll=this.expandAll),void 0!==this.autoExpandColumns&&(e.autoExpandColumns=this.autoExpandColumns),e}};function v(e){return e}function g(e){return e}function m(e){return e}function C(){return l([])}p([t({required:!0})],u.prototype,"rows",void 0),p([t({required:!0})],u.prototype,"defaultHeaders",void 0),p([t()],u.prototype,"footerRenderer",void 0),p([t()],u.prototype,"loadingStateRenderer",void 0),p([t()],u.prototype,"errorStateRenderer",void 0),p([t()],u.prototype,"emptyStateRenderer",void 0),p([t()],u.prototype,"tableEmptyStateRenderer",void 0),p([t()],u.prototype,"headerDropdown",void 0),p([t()],u.prototype,"columnEditorConfig",void 0),p([t()],u.prototype,"onCellClick",void 0),p([t()],u.prototype,"onCellEdit",void 0),p([t()],u.prototype,"onSortChange",void 0),p([t()],u.prototype,"onFilterChange",void 0),p([t()],u.prototype,"onRowSelectionChange",void 0),p([t()],u.prototype,"onRowGroupExpand",void 0),p([t()],u.prototype,"onColumnOrderChange",void 0),p([t()],u.prototype,"onColumnVisibilityChange",void 0),p([t()],u.prototype,"onColumnWidthChange",void 0),p([t()],u.prototype,"onPageChange",void 0),p([t()],u.prototype,"onLoadMore",void 0),p([t()],u.prototype,"onGridReady",void 0),p([t()],u.prototype,"rowGrouping",void 0),p([t()],u.prototype,"enableRowSelection",void 0),p([t()],u.prototype,"theme",void 0),p([t()],u.prototype,"quickFilter",void 0),p([t()],u.prototype,"isLoading",void 0),p([t()],u.prototype,"getRowId",void 0),p([t()],u.prototype,"shouldPaginate",void 0),p([t()],u.prototype,"rowsPerPage",void 0),p([t()],u.prototype,"serverSidePagination",void 0),p([t()],u.prototype,"totalRowCount",void 0),p([t()],u.prototype,"height",void 0),p([t()],u.prototype,"maxHeight",void 0),p([t()],u.prototype,"columnResizing",void 0),p([t()],u.prototype,"columnReordering",void 0),p([t()],u.prototype,"editColumns",void 0),p([t()],u.prototype,"editColumnsInitOpen",void 0),p([t()],u.prototype,"selectableCells",void 0),p([t()],u.prototype,"selectableColumns",void 0),p([t()],u.prototype,"enableHeaderEditing",void 0),p([t()],u.prototype,"onHeaderEdit",void 0),p([t()],u.prototype,"customTheme",void 0),p([t()],u.prototype,"icons",void 0),p([t()],u.prototype,"externalFilterHandling",void 0),p([t()],u.prototype,"externalSortHandling",void 0),p([t()],u.prototype,"columnBorders",void 0),p([t()],u.prototype,"rowButtons",void 0),p([t()],u.prototype,"hideFooter",void 0),p([t()],u.prototype,"initialSortColumn",void 0),p([t()],u.prototype,"initialSortDirection",void 0),p([t()],u.prototype,"expandAll",void 0),p([t()],u.prototype,"autoExpandColumns",void 0),p([o()],u.prototype,"tableReady",void 0),u=p([i({selector:"simple-table",standalone:!0,template:"<div #host></div>",styles:[":host { display: block; }"]})],u);export{u as SimpleTableComponent,v as defaultHeaderFromCore,g as defaultHeadersFromCore,m as mapToAngularHeaderObjects,C as provideSimpleTable};
1
+ import{createComponent as e,Input as o,Output as t,Component as i,EventEmitter as n,inject as r,ElementRef as d,ApplicationRef as s,EnvironmentInjector as a,makeEnvironmentProviders as l}from"@angular/core";import{SimpleTableVanilla as h}from"simple-table-core";export{asRows}from"simple-table-core";function p(e,o,t,i){var n,r=arguments.length,d=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,o,t,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(d=(r<3?n(d):r>3?n(o,t,d):n(o,t))||d);return r>3&&d&&Object.defineProperty(o,t,d),d}function c(o,t,i){return n=>{const r=document.createElement("div"),d=e(o,{environmentInjector:i,hostElement:r});return Object.assign(d.instance,n),t.attachView(d.hostView),d.changeDetectorRef.detectChanges(),r}}function u(e,o,t){const{defaultHeaders:i,rows:n,footerRenderer:r,emptyStateRenderer:d,errorStateRenderer:s,loadingStateRenderer:a,tableEmptyStateRenderer:l,headerDropdown:h,columnEditorConfig:p,icons:v,onColumnOrderChange:g,onColumnWidthChange:m,onHeaderEdit:C,onColumnSelect:y,...R}=e,S=e=>c(e,o,t),w={...R,rows:n,defaultHeaders:i.map(function e(i){const{cellRenderer:n,headerRenderer:r,children:d,nestedTable:s,...a}=i,l={...a};if(n&&(l.cellRenderer=n.ɵcmp?S(n):n),r&&(l.headerRenderer=r.ɵcmp?S(r):r),d&&(l.children=d.map(e)),s){const e={...s,rows:[]};l.nestedTable=u(e,o,t)}return l}),...g?{onColumnOrderChange:e=>g(e)}:{},...m?{onColumnWidthChange:e=>m(e)}:{},...C?{onHeaderEdit:(e,o)=>C(e,o)}:{},...y?{onColumnSelect:e=>y(e)}:{}};return void 0!==r&&(w.footerRenderer=r.ɵcmp?S(r):r),void 0!==d&&(w.emptyStateRenderer=d.ɵcmp?S(d):d),void 0!==s&&(w.errorStateRenderer=s.ɵcmp?S(s):s),void 0!==a&&(w.loadingStateRenderer=a.ɵcmp?S(a):a),void 0!==l&&(w.tableEmptyStateRenderer=l),void 0!==h&&(w.headerDropdown=S(h)),void 0!==p&&(w.columnEditorConfig=function(e){const{rowRenderer:o,customRenderer:t,...i}=e;return{...i,...o?{rowRenderer:S(o)}:{},...t?{customRenderer:S(t)}:{}}}(p)),void 0!==v&&(w.icons=function(e){const o={};for(const[t,i]of Object.entries(e))null!=i&&(o[t]="string"==typeof i||i instanceof HTMLElement||i instanceof SVGSVGElement?i:i.ɵcmp?S(i)({}):i);return o}(v)),w}"function"==typeof SuppressedError&&SuppressedError;let v=class{constructor(){this.tableReady=new n,this.instance=null,this.hostEl=r(d),this.appRef=r(s),this.envInjector=r(a)}ngOnInit(){const e=this.hostEl.nativeElement.querySelector("div");e&&(this.instance=new h(e,u(this.getProps(),this.appRef,this.envInjector)),this.instance.mount(),this.tableReady.emit(this.instance.getAPI()))}ngOnChanges(){this.instance?.update(u(this.getProps(),this.appRef,this.envInjector))}ngOnDestroy(){this.instance?.destroy(),this.instance=null}getAPI(){return this.instance?.getAPI()??null}getProps(){const e={rows:this.rows,defaultHeaders:this.defaultHeaders};return void 0!==this.footerRenderer&&(e.footerRenderer=this.footerRenderer),void 0!==this.loadingStateRenderer&&(e.loadingStateRenderer=this.loadingStateRenderer),void 0!==this.errorStateRenderer&&(e.errorStateRenderer=this.errorStateRenderer),void 0!==this.emptyStateRenderer&&(e.emptyStateRenderer=this.emptyStateRenderer),void 0!==this.tableEmptyStateRenderer&&(e.tableEmptyStateRenderer=this.tableEmptyStateRenderer),void 0!==this.headerDropdown&&(e.headerDropdown=this.headerDropdown),void 0!==this.columnEditorConfig&&(e.columnEditorConfig=this.columnEditorConfig),void 0!==this.onCellClick&&(e.onCellClick=this.onCellClick),void 0!==this.onCellEdit&&(e.onCellEdit=this.onCellEdit),void 0!==this.onSortChange&&(e.onSortChange=this.onSortChange),void 0!==this.onFilterChange&&(e.onFilterChange=this.onFilterChange),void 0!==this.onRowSelectionChange&&(e.onRowSelectionChange=this.onRowSelectionChange),void 0!==this.onRowGroupExpand&&(e.onRowGroupExpand=this.onRowGroupExpand),void 0!==this.onColumnOrderChange&&(e.onColumnOrderChange=this.onColumnOrderChange),void 0!==this.onColumnVisibilityChange&&(e.onColumnVisibilityChange=this.onColumnVisibilityChange),void 0!==this.onColumnWidthChange&&(e.onColumnWidthChange=this.onColumnWidthChange),void 0!==this.onPageChange&&(e.onPageChange=this.onPageChange),void 0!==this.onLoadMore&&(e.onLoadMore=this.onLoadMore),void 0!==this.onGridReady&&(e.onGridReady=this.onGridReady),void 0!==this.rowGrouping&&(e.rowGrouping=this.rowGrouping),void 0!==this.enableRowSelection&&(e.enableRowSelection=this.enableRowSelection),void 0!==this.theme&&(e.theme=this.theme),void 0!==this.quickFilter&&(e.quickFilter=this.quickFilter),void 0!==this.isLoading&&(e.isLoading=this.isLoading),void 0!==this.getRowId&&(e.getRowId=this.getRowId),void 0!==this.shouldPaginate&&(e.shouldPaginate=this.shouldPaginate),void 0!==this.rowsPerPage&&(e.rowsPerPage=this.rowsPerPage),void 0!==this.serverSidePagination&&(e.serverSidePagination=this.serverSidePagination),void 0!==this.totalRowCount&&(e.totalRowCount=this.totalRowCount),void 0!==this.height&&(e.height=this.height),void 0!==this.maxHeight&&(e.maxHeight=this.maxHeight),void 0!==this.columnResizing&&(e.columnResizing=this.columnResizing),void 0!==this.columnReordering&&(e.columnReordering=this.columnReordering),void 0!==this.editColumns&&(e.editColumns=this.editColumns),void 0!==this.editColumnsInitOpen&&(e.editColumnsInitOpen=this.editColumnsInitOpen),void 0!==this.selectableCells&&(e.selectableCells=this.selectableCells),void 0!==this.selectableColumns&&(e.selectableColumns=this.selectableColumns),void 0!==this.enableHeaderEditing&&(e.enableHeaderEditing=this.enableHeaderEditing),void 0!==this.onHeaderEdit&&(e.onHeaderEdit=this.onHeaderEdit),void 0!==this.customTheme&&(e.customTheme=this.customTheme),void 0!==this.icons&&(e.icons=this.icons),void 0!==this.externalFilterHandling&&(e.externalFilterHandling=this.externalFilterHandling),void 0!==this.externalSortHandling&&(e.externalSortHandling=this.externalSortHandling),void 0!==this.columnBorders&&(e.columnBorders=this.columnBorders),void 0!==this.rowButtons&&(e.rowButtons=this.rowButtons),void 0!==this.hideFooter&&(e.hideFooter=this.hideFooter),void 0!==this.initialSortColumn&&(e.initialSortColumn=this.initialSortColumn),void 0!==this.initialSortDirection&&(e.initialSortDirection=this.initialSortDirection),void 0!==this.expandAll&&(e.expandAll=this.expandAll),void 0!==this.autoExpandColumns&&(e.autoExpandColumns=this.autoExpandColumns),e}};function g(){return l([])}p([o({required:!0})],v.prototype,"rows",void 0),p([o({required:!0})],v.prototype,"defaultHeaders",void 0),p([o()],v.prototype,"footerRenderer",void 0),p([o()],v.prototype,"loadingStateRenderer",void 0),p([o()],v.prototype,"errorStateRenderer",void 0),p([o()],v.prototype,"emptyStateRenderer",void 0),p([o()],v.prototype,"tableEmptyStateRenderer",void 0),p([o()],v.prototype,"headerDropdown",void 0),p([o()],v.prototype,"columnEditorConfig",void 0),p([o()],v.prototype,"onCellClick",void 0),p([o()],v.prototype,"onCellEdit",void 0),p([o()],v.prototype,"onSortChange",void 0),p([o()],v.prototype,"onFilterChange",void 0),p([o()],v.prototype,"onRowSelectionChange",void 0),p([o()],v.prototype,"onRowGroupExpand",void 0),p([o()],v.prototype,"onColumnOrderChange",void 0),p([o()],v.prototype,"onColumnVisibilityChange",void 0),p([o()],v.prototype,"onColumnWidthChange",void 0),p([o()],v.prototype,"onPageChange",void 0),p([o()],v.prototype,"onLoadMore",void 0),p([o()],v.prototype,"onGridReady",void 0),p([o()],v.prototype,"rowGrouping",void 0),p([o()],v.prototype,"enableRowSelection",void 0),p([o()],v.prototype,"theme",void 0),p([o()],v.prototype,"quickFilter",void 0),p([o()],v.prototype,"isLoading",void 0),p([o()],v.prototype,"getRowId",void 0),p([o()],v.prototype,"shouldPaginate",void 0),p([o()],v.prototype,"rowsPerPage",void 0),p([o()],v.prototype,"serverSidePagination",void 0),p([o()],v.prototype,"totalRowCount",void 0),p([o()],v.prototype,"height",void 0),p([o()],v.prototype,"maxHeight",void 0),p([o()],v.prototype,"columnResizing",void 0),p([o()],v.prototype,"columnReordering",void 0),p([o()],v.prototype,"editColumns",void 0),p([o()],v.prototype,"editColumnsInitOpen",void 0),p([o()],v.prototype,"selectableCells",void 0),p([o()],v.prototype,"selectableColumns",void 0),p([o()],v.prototype,"enableHeaderEditing",void 0),p([o()],v.prototype,"onHeaderEdit",void 0),p([o()],v.prototype,"customTheme",void 0),p([o()],v.prototype,"icons",void 0),p([o()],v.prototype,"externalFilterHandling",void 0),p([o()],v.prototype,"externalSortHandling",void 0),p([o()],v.prototype,"columnBorders",void 0),p([o()],v.prototype,"rowButtons",void 0),p([o()],v.prototype,"hideFooter",void 0),p([o()],v.prototype,"initialSortColumn",void 0),p([o()],v.prototype,"initialSortDirection",void 0),p([o()],v.prototype,"expandAll",void 0),p([o()],v.prototype,"autoExpandColumns",void 0),p([t()],v.prototype,"tableReady",void 0),v=p([i({selector:"simple-table",standalone:!0,template:"<div #host></div>",styles:[":host { display: block; }"]})],v);export{v as SimpleTableComponent,g as provideSimpleTable,c as wrapAngularRenderer};
2
2
  //# sourceMappingURL=index.es.js.map
@@ -1,6 +1,7 @@
1
1
  export { SimpleTableComponent } from "./lib/SimpleTableComponent";
2
2
  export { asRows } from "simple-table-core";
3
- export { defaultHeaderFromCore, defaultHeadersFromCore, mapToAngularHeaderObjects, } from "./defaultHeadersFromCore";
4
3
  export { provideSimpleTable } from "./lib/provideSimpleTable";
4
+ /** Wrap a standalone component as an HTMLElement (e.g. for `tableEmptyStateRenderer`). */
5
+ export { wrapAngularRenderer } from "./utils/wrapAngularRenderer";
5
6
  export type { SimpleTableAngularProps, TableInstance, AngularHeaderObject, AngularIconsConfig, AngularIconSlot, AngularColumnEditorConfig, AngularCellRenderer, AngularHeaderRenderer, AngularFooterRenderer, AngularHeaderDropdown, AngularColumnEditorRowRenderer, AngularColumnEditorCustomRenderer, AngularLoadingStateRenderer, AngularErrorStateRenderer, AngularEmptyStateRenderer, } from "./types";
6
7
  export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, CustomThemeProps, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererComponents, HeaderRendererProps, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowId, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SimpleTableConfig, SimpleTableProps, SortColumn, TableAPI, TableFilterState, TableHeaderProps, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, } from "simple-table-core";
@@ -1,6 +1,6 @@
1
1
  import { OnChanges, OnDestroy, OnInit, EventEmitter } from "@angular/core";
2
2
  import type { TableAPI } from "simple-table-core";
3
- import type { SimpleTableAngularProps, AngularHeaderObject } from "../types";
3
+ import type { SimpleTableAngularProps } from "../types";
4
4
  /**
5
5
  * SimpleTable — Angular adapter for simple-table-core.
6
6
  *
@@ -15,7 +15,7 @@ import type { SimpleTableAngularProps, AngularHeaderObject } from "../types";
15
15
  */
16
16
  export declare class SimpleTableComponent implements OnInit, OnChanges, OnDestroy {
17
17
  rows: SimpleTableAngularProps["rows"];
18
- defaultHeaders: AngularHeaderObject[];
18
+ defaultHeaders: SimpleTableAngularProps["defaultHeaders"];
19
19
  footerRenderer?: SimpleTableAngularProps["footerRenderer"];
20
20
  loadingStateRenderer?: SimpleTableAngularProps["loadingStateRenderer"];
21
21
  errorStateRenderer?: SimpleTableAngularProps["errorStateRenderer"];
@@ -6,15 +6,23 @@ export interface TableInstance {
6
6
  destroy(): void;
7
7
  getAPI(): TableAPI;
8
8
  }
9
- export type AngularCellRenderer = Type<CellRendererProps>;
10
- export type AngularHeaderRenderer = Type<HeaderRendererProps>;
11
- export type AngularFooterRenderer = Type<FooterRendererProps>;
12
- export type AngularHeaderDropdown = Type<HeaderDropdownProps>;
13
- export type AngularColumnEditorRowRenderer = Type<ColumnEditorRowRendererProps>;
14
- export type AngularColumnEditorCustomRenderer = Type<ColumnEditorCustomRendererProps>;
15
- export type AngularLoadingStateRenderer = Type<LoadingStateRendererProps>;
16
- export type AngularErrorStateRenderer = Type<ErrorStateRendererProps>;
17
- export type AngularEmptyStateRenderer = Type<EmptyStateRendererProps>;
9
+ /**
10
+ * Angular table slots are component class refs (`Type<unknown>`), not `Type<SomeProps>`.
11
+ * `Type<CellRendererProps>` would mean `new () => CellRendererProps`, but cell components
12
+ * construct decorated classes whose instances are not structurally `CellRendererProps`
13
+ * even though the adapter binds those values via `@Input()` at runtime. The concrete
14
+ * input contract for each slot remains the matching `*RendererProps` type from
15
+ * `simple-table-core` (re-exported below).
16
+ */
17
+ export type AngularCellRenderer = Type<unknown>;
18
+ export type AngularHeaderRenderer = Type<unknown>;
19
+ export type AngularFooterRenderer = Type<unknown>;
20
+ export type AngularHeaderDropdown = Type<unknown>;
21
+ export type AngularColumnEditorRowRenderer = Type<unknown>;
22
+ export type AngularColumnEditorCustomRenderer = Type<unknown>;
23
+ export type AngularLoadingStateRenderer = Type<unknown>;
24
+ export type AngularErrorStateRenderer = Type<unknown>;
25
+ export type AngularEmptyStateRenderer = Type<unknown>;
18
26
  /** Per-slot icon: Angular component or vanilla element/string (pass-through). */
19
27
  export type AngularIconSlot = Type<unknown> | SVGSVGElement | HTMLElement | string;
20
28
  export interface AngularIconsConfig {
@@ -36,8 +44,7 @@ export interface AngularColumnEditorConfig extends Omit<ColumnEditorConfig, "row
36
44
  }
37
45
  /**
38
46
  * Column definition for `defaultHeaders`: core column metadata with Angular-only
39
- * renderer fields. For trees from `simple-table-core`, use `defaultHeadersFromCore` /
40
- * `mapToAngularHeaderObjects`.
47
+ * renderer fields. `defaultHeaders` also accepts plain `HeaderObject[]` from shared configs.
41
48
  */
42
49
  export interface AngularHeaderObject extends Omit<HeaderObject, "cellRenderer" | "headerRenderer" | "children" | "nestedTable"> {
43
50
  cellRenderer?: AngularCellRenderer;
@@ -45,10 +52,14 @@ export interface AngularHeaderObject extends Omit<HeaderObject, "cellRenderer" |
45
52
  children?: AngularHeaderObject[];
46
53
  nestedTable?: Omit<SimpleTableAngularProps, "rows" | "loadingStateRenderer" | "errorStateRenderer" | "emptyStateRenderer" | "tableEmptyStateRenderer">;
47
54
  }
48
- export interface SimpleTableAngularProps extends Omit<SimpleTableProps, "rows" | "defaultHeaders" | "footerRenderer" | "emptyStateRenderer" | "errorStateRenderer" | "loadingStateRenderer" | "tableEmptyStateRenderer" | "headerDropdown" | "columnEditorConfig" | "icons"> {
49
- defaultHeaders: AngularHeaderObject[];
55
+ export interface SimpleTableAngularProps extends Omit<SimpleTableProps, "rows" | "defaultHeaders" | "footerRenderer" | "emptyStateRenderer" | "errorStateRenderer" | "loadingStateRenderer" | "tableEmptyStateRenderer" | "headerDropdown" | "columnEditorConfig" | "icons" | "onColumnOrderChange" | "onColumnWidthChange" | "onHeaderEdit" | "onColumnSelect"> {
56
+ defaultHeaders: ReadonlyArray<HeaderObject | AngularHeaderObject>;
50
57
  /** Row data: domain objects or core `Row[]`; cast inside the adapter. */
51
58
  rows: ReadonlyArray<Row> | ReadonlyArray<object>;
59
+ onColumnOrderChange?: (newHeaders: AngularHeaderObject[]) => void;
60
+ onColumnWidthChange?: (headers: AngularHeaderObject[]) => void;
61
+ onHeaderEdit?: (header: AngularHeaderObject, newLabel: string) => void;
62
+ onColumnSelect?: (header: AngularHeaderObject) => void;
52
63
  footerRenderer?: AngularFooterRenderer;
53
64
  loadingStateRenderer?: AngularLoadingStateRenderer;
54
65
  errorStateRenderer?: AngularErrorStateRenderer;
@@ -92,6 +92,13 @@ export declare class RenderOrchestrator {
92
92
  private lastRowsRef;
93
93
  private flattenedRowsCache;
94
94
  private lastProcessedResult;
95
+ /** Fingerprint for skipping pagination + height-map work on vertical scroll frames. */
96
+ private processRowsScrollReuseKey;
97
+ private processRowsScrollReuseBase;
98
+ /** Last painted virtual row range on scroll-raf; when unchanged, DOM work is redundant (native scroll moves content). */
99
+ private lastScrollRafPaintedRange;
100
+ /** Reuse normalized headers across scroll frames when layout inputs are unchanged. */
101
+ private scrollRafHeadersMemo;
95
102
  constructor();
96
103
  getCachedFlattenResult(): FlattenRowsResult | null;
97
104
  getLastProcessedResult(): ProcessRowsResult | null;
@@ -19,10 +19,13 @@ export declare class ScrollManager {
19
19
  private subscribers;
20
20
  private lastScrollTop;
21
21
  private scrollTimeoutId;
22
+ /** Coalesce scroll-driven subscriber notifications to one rAF (avoids sync storms + reflow). */
23
+ private notifySubscribersRafId;
22
24
  constructor(config: ScrollManagerConfig);
23
25
  updateConfig(config: Partial<ScrollManagerConfig>): void;
24
26
  subscribe(callback: StateChangeCallback): () => void;
25
27
  private notifySubscribers;
28
+ private scheduleNotifySubscribersFromScroll;
26
29
  handleScroll(scrollTop: number, scrollLeft: number, containerHeight: number, contentHeight: number): void;
27
30
  setScrolling(isScrolling: boolean): void;
28
31
  getState(): ScrollManagerState;
@@ -34,3 +34,22 @@ export interface ProcessRowsResult {
34
34
  heightMap: CumulativeHeightMap | undefined;
35
35
  }
36
36
  export declare function processRows(config: ProcessRowsConfig): ProcessRowsResult;
37
+ /** Layout inputs that do not depend on scroll position (reuse across scroll-raf frames). */
38
+ export interface ProcessRowsScrollReuseBase {
39
+ currentTableRows: TableRow[];
40
+ paginatedHeightOffsets: HeightOffsets | undefined;
41
+ heightMap: CumulativeHeightMap | undefined;
42
+ }
43
+ /**
44
+ * Recomputes only viewport-dependent fields when pagination, height map, and row list
45
+ * are unchanged (vertical scroll only). Avoids re-running applyPagination and
46
+ * buildCumulativeHeightMap on every scroll frame.
47
+ */
48
+ export declare function recomputeProcessRowsViewport(base: ProcessRowsScrollReuseBase, config: {
49
+ contentHeight: number | undefined;
50
+ rowHeight: number;
51
+ scrollTop: number;
52
+ scrollDirection?: "up" | "down" | "none";
53
+ enableStickyParents: boolean;
54
+ rowGrouping?: Accessor[];
55
+ }): ProcessRowsResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-table/angular",
3
- "version": "3.0.2",
3
+ "version": "3.0.5",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/types/angular/src/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.8.1",
33
- "simple-table-core": "3.0.2"
33
+ "simple-table-core": "3.0.5"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@angular/common": "^20.0.0",
@@ -1,5 +0,0 @@
1
- import type { HeaderObject } from "simple-table-core";
2
- import type { AngularHeaderObject } from "./types";
3
- export declare function defaultHeaderFromCore(header: HeaderObject): AngularHeaderObject;
4
- export declare function defaultHeadersFromCore(headers: readonly HeaderObject[]): AngularHeaderObject[];
5
- export declare function mapToAngularHeaderObjects(columns: readonly object[]): AngularHeaderObject[];