@veeqo/transfigure 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +14 -48
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +12 -29
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +8 -14
- package/dist/index103.cjs +1 -12
- package/dist/index103.js +50 -16
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +28 -15
- package/dist/index105.cjs +1 -19
- package/dist/index105.js +21 -24
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +14 -20
- package/dist/index107.cjs +19 -1
- package/dist/index107.js +24 -24
- package/dist/index108.cjs +12 -1
- package/dist/index108.js +16 -12
- package/dist/index109.cjs +1 -80
- package/dist/index109.js +24 -98
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +80 -1
- package/dist/index110.js +97 -8
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +19 -2
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +7 -18
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +60 -7
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +26 -57
- package/dist/index115.cjs +13 -1
- package/dist/index115.js +17 -30
- package/dist/index116.cjs +1 -13
- package/dist/index116.js +2 -17
- package/dist/index120.cjs +7 -1
- package/dist/index120.js +10 -63
- package/dist/index121.cjs +1 -7
- package/dist/index121.js +63 -10
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +2 -2
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +1 -1
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +1 -1
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -2
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +1 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +1 -1
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +2 -2
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +7 -7
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +1 -1
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +1 -1
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +1 -1
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +5 -41
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +2 -9
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +39 -115
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +9 -2
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +116 -4
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +2 -2
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +2 -2
- package/package.json +1 -1
package/dist/index70.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=Object.defineProperty;var B=(b,t,s)=>t in b?V(b,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):b[t]=s;var h=(b,t,s)=>B(b,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mobx"),G=require("@veeqo/ui"),C=require("@internationalized/date"),q=require("lodash/isEqual"),z=require("lodash/get"),j=require("lodash/set"),K=require("qs"),m=require("./index50.cjs"),I=require("./index2.cjs"),A=require("./index72.cjs"),D=require("./index71.cjs"),L=require("./index110.cjs"),k=require("./index108.cjs"),N=require("./index79.cjs"),p=require("./index9.cjs"),_=b=>b&&b.__esModule?b:{default:b},O=_(q),H=_(z),E=_(j),T=_(K);class ${constructor(t){h(this,"defaultPageSize");h(this,"pageSize");h(this,"currentPage");h(this,"defaultFilters");h(this,"defaultArrayFilters");h(this,"defaultDateRangeFilters");h(this,"defaultNumberRangeFilters");h(this,"filters");h(this,"arrayFilters");h(this,"dateRangeFilters");h(this,"numberRangeFilters");h(this,"activeViewId");h(this,"defaultSortState");h(this,"tableStore");h(this,"isFiltersDropdownVisible");h(this,"initDefaultFilterMaps",()=>{this.defaultFilters=new Map(this.filters),this.defaultArrayFilters=new Map(this.arrayFilters),this.defaultDateRangeFilters=new Map(this.dateRangeFilters),this.defaultNumberRangeFilters=new Map(this.numberRangeFilters),this.defaultSortState={columnId:"",direction:"asc"}});h(this,"updateUrl",(t=!1)=>{try{const{SORT_FILTER_ID:s,SORTING_MODE:n}=p.BusinessLogicManager.getBusinessLogic(),e=T.default.parse(window.location.search,{ignoreQueryPrefix:!0}),u=e[s],f=e.sort_order,i=e.sort;let r="";switch(n){case I.SortingMode.CORAL:if(f&&i){const d={...this.queryParamsObject,sort:i,sort_order:f};r=`${window.location.pathname}?${T.default.stringify(d,{arrayFormat:"brackets"})}`}break;case I.SortingMode.MONOLITH:default:if(u){const d={...this.queryParamsObject,[s]:u};r=`${window.location.pathname}?${T.default.stringify(d,{arrayFormat:"brackets"})}`}}u||(r=`${window.location.pathname}?${this.queryParams}`),t?window.history.pushState({},"",r):window.history.replaceState({},"",r)}catch(s){console.log(s)}});h(this,"setCurrentPage",t=>{this.currentPage=t});h(this,"setPageSize",t=>{this.pageSize=t,this.updateUrl()});h(this,"setFilter",(t,s)=>{this.filters.set(t,s),this.setCurrentPage(1),this.updateUrl()});h(this,"clearFilter",t=>{this.filters.set(t,""),this.setCurrentPage(1),this.updateUrl()});h(this,"setArrayFilter",(t,s)=>{this.arrayFilters.set(t,s),this.setCurrentPage(1),this.updateUrl()});h(this,"clearArrayFilter",t=>{this.arrayFilters.set(t,[]),this.setCurrentPage(1),this.updateUrl()});h(this,"setRangeFilter",({key:t,range:s,dates:n})=>{s.setFilterType(t),s.setDates(n.start,n.end),this.setCurrentPage(1),this.updateUrl()});h(this,"clearRangeFilter",t=>{const s=this.dateRangeFilters.get(t);s&&(s.clear(),this.setCurrentPage(1),this.updateUrl())});h(this,"setNumberRangeFilter",({numberRange:t,gte:s,lte:n})=>{t.setGte(s),t.setLte(n),this.setCurrentPage(1),this.updateUrl()});h(this,"clearNumberRangeFilter",t=>{const s=this.numberRangeFilters.get(t);s&&(s.clear(),this.setCurrentPage(1),this.updateUrl())});h(this,"clearAllFilters",(t=!1)=>{const{SEARCH_FILTER_ID:s}=p.BusinessLogicManager.getBusinessLogic();this.filters.forEach((n,e)=>{e!==s&&this.filters.set(e,"")}),this.arrayFilters.forEach((n,e)=>this.arrayFilters.set(e,[])),this.dateRangeFilters.forEach(n=>n.clear()),this.numberRangeFilters.forEach(n=>n.clear()),this.setCurrentPage(1),t||this.updateUrl()});h(this,"clearFiltersForGroup",t=>{const{GROUP_MAP:s}=p.BusinessLogicManager.getBusinessLogic(),n=s.get(t);n&&n.fields.forEach(e=>{this.arrayFilters.has(e.id)?this.clearArrayFilter(e.id):this.dateRangeFilters.has(e.id)?this.clearRangeFilter(e.id):this.numberRangeFilters.has(e.id)?this.clearNumberRangeFilter(e.id):this.clearFilter(e.id)})});h(this,"setActiveViewId",t=>{this.activeViewId=t,this.updateUrl()});h(this,"toggleFiltersDropdownVisible",t=>{this.isFiltersDropdownVisible=t});h(this,"getFiltersForGroup",t=>{const{GROUP_MAP:s}=p.BusinessLogicManager.getBusinessLogic(),n=s.get(t);if(!n)return{};const e={};return n.fields.forEach(u=>{this.arrayFilters.has(u.id)?e[u.id]=this.arrayFilters.get(u.id):this.dateRangeFilters.has(u.id)?e[u.id]=this.dateRangeFilters.get(u.id):this.numberRangeFilters.has(u.id)?e[u.id]=this.numberRangeFilters.get(u.id):e[u.id]=this.filters.get(u.id)}),e});h(this,"initFiltersFromView",t=>{var e,u;const{PAGE_SIZE_OPTIONS:s}=p.BusinessLogicManager.getBusinessLogic();(e=t.page)!=null&&e.size&&s.includes(t.page.size)&&(this.defaultPageSize=t.page.size,this.pageSize=t.page.size),this.setCurrentPage(1),this.defaultFilters=new Map(t.filterMaps.filters),this.defaultArrayFilters=new Map(t.filterMaps.arrayFilters),this.defaultDateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([f,i])=>{const r=new A.RangeFilter(i.filterType);return i.gte&&i.lte&&r.setDates(i.gte,i.lte),[f,r]})),this.defaultNumberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([f,i])=>{const r=i.clone();return i.gte&&r.setGte(i.gte),i.lte&&r.setLte(i.lte),[f,r]})),this.filters=new Map(t.filterMaps.filters),this.arrayFilters=new Map(t.filterMaps.arrayFilters),this.dateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([f,i])=>{const r=new A.RangeFilter(i.filterType);return i.gte&&i.lte&&r.setDates(i.gte,i.lte),[f,r]})),this.numberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([f,i])=>{const r=i.clone();return i.gte&&r.setGte(i.gte),i.lte&&r.setLte(i.lte),[f,r]}));const n=L.parseSortString(t.sort);this.defaultSortState=n,(u=this.tableStore)==null||u.setSortState(n),this.activeViewId=t.id});h(this,"initFromUrl",(t=!0)=>{var S,w;const{GROUP_MAP:s,PAGE_SIZE_OPTIONS:n,PAGE_SIZE_FILTER_ID:e,SORT_FILTER_ID:u}=p.BusinessLogicManager.getBusinessLogic(),f=T.default.parse(window.location.search,{ignoreQueryPrefix:!0}),i=Array.from(s.values()).flatMap(F=>F.fields),r=new Map,d=new Map,M=new Map,v=new Map;t&&f.view&&(this.activeViewId=f.view),f[e]&&n.includes(Number(f[e]))&&(this.pageSize=Number(f[e]));const c=f.filter||{};i.forEach(F=>{const g=H.default(c,F.id);if(g!==void 0)switch(F.filterType){case m.FilterChoiceValue.CHECKBOX:Array.isArray(g)?d.set(F.id,g):g&&d.set(F.id,[g]);break;case m.FilterChoiceValue.DATE_RANGE:if(typeof g=="string"&&N.isValidDateRange(g))M.set(F.id,new A.RangeFilter(g));else if(typeof g=="object"&&g!==null){const y=g;if(y.relative&&N.isValidDateRange(y.relative))M.set(F.id,new A.RangeFilter(y.relative));else if(y.gte&&y.lte)try{const R=C.parseDate(y.gte),U=C.parseDate(y.lte),P=new A.RangeFilter("CUSTOM");P.setDates(R,U),M.set(F.id,P)}catch{M.set(F.id,new A.RangeFilter(G.DateRanges.TODAY))}}break;case m.FilterChoiceValue.NUMBER_RANGE:if(typeof g=="object"&&g!==null){const y=g,R=new D.NumberRangeFilter({filterId:F.id});y.gte!==void 0&&R.setGte(Number(y.gte)),y.lte!==void 0&&R.setLte(Number(y.lte)),v.set(F.id,R)}break;case m.FilterChoiceValue.TEXT:case m.FilterChoiceValue.NUMBER:case m.FilterChoiceValue.RADIO:(typeof g=="string"||typeof g=="number")&&r.set(F.id,String(g));break}}),this.filters=r,this.arrayFilters=d,this.dateRangeFilters=M,this.numberRangeFilters=v;const l=f[u]||f.sort,a=f.sort_order;if(a&&f.sort)(S=this.tableStore)==null||S.setSortState({columnId:f.sort,direction:a});else if(l){const F=L.parseSortString(l);F.columnId&&((w=this.tableStore)==null||w.setSortState(F))}this.updateUrl()});h(this,"discardChanges",(t=!1)=>{var e;this.pageSize=this.defaultPageSize;const{SEARCH_FILTER_ID:s}=p.BusinessLogicManager.getBusinessLogic(),n=new Map(this.defaultFilters);this.filters.has(s)&&n.set(s,this.filters.get(s)),this.filters=n,this.arrayFilters=new Map(this.defaultArrayFilters),this.dateRangeFilters.clear(),this.defaultDateRangeFilters.forEach((u,f)=>{const i=new A.RangeFilter(u.filterType);i.setDates(u.gte,u.lte),this.dateRangeFilters.set(f,i)}),this.numberRangeFilters.clear(),this.defaultNumberRangeFilters.forEach((u,f)=>{this.numberRangeFilters.set(f,u.clone())}),(e=this.tableStore)==null||e.setSortState(this.defaultSortState),this.updateUrl(t)});const{GROUP_MAP:s}=p.BusinessLogicManager.getBusinessLogic(),n=Array.from(s.values()).flatMap(e=>e.fields);this.filters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.TEXT||e.filterType===m.FilterChoiceValue.NUMBER||e.filterType===m.FilterChoiceValue.RADIO||e.filterType===m.FilterChoiceValue.DATE_RANGE).map(e=>[e.id,""])),this.arrayFilters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.CHECKBOX).map(e=>[e.id,[]])),this.dateRangeFilters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.DATE_RANGE).map(e=>[e.id,new A.RangeFilter])),this.numberRangeFilters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.NUMBER_RANGE).map(e=>{const u=new D.NumberRangeFilter({filterId:e.id});return[e.id,u]})),this.defaultArrayFilters=new Map,this.defaultFilters=new Map,this.defaultDateRangeFilters=new Map,this.defaultNumberRangeFilters=new Map,this.currentPage=1,this.pageSize=10,this.defaultPageSize=10,this.initDefaultFilterMaps(),this.isFiltersDropdownVisible=!1,this.activeViewId=void 0,this.defaultSortState={columnId:"",direction:"asc"},this.tableStore=t,o.makeObservable(this,{defaultPageSize:o.observable,pageSize:o.observable,currentPage:o.observable,defaultFilters:o.observable,defaultArrayFilters:o.observable,defaultDateRangeFilters:o.observable,defaultNumberRangeFilters:o.observable,filters:o.observable,arrayFilters:o.observable,numberRangeFilters:o.observable,dateRangeFilters:o.observable,isFiltersDropdownVisible:o.observable,activeViewId:o.observable,defaultSortState:o.observable,tableStore:o.observable.ref,setPageSize:o.action,setCurrentPage:o.action,toggleFiltersDropdownVisible:o.action,setActiveViewId:o.action,setFilter:o.action,setArrayFilter:o.action,setRangeFilter:o.action,setNumberRangeFilter:o.action,clearFilter:o.action,clearArrayFilter:o.action,clearRangeFilter:o.action,clearNumberRangeFilter:o.action,clearAllFilters:o.action,getFiltersForGroup:o.action,clearFiltersForGroup:o.action,initFromUrl:o.action,initFiltersFromView:o.action,initDefaultFilterMaps:o.action,discardChanges:o.action,updateUrl:o.action,hasActiveFilters:o.computed,activeFilterKeysList:o.computed,queryParamsObject:o.computed,queryParams:o.computed,hasUnsavedChanges:o.computed})}get hasActiveFilters(){const{GROUP_MAP:t}=p.BusinessLogicManager.getBusinessLogic(),s=Array.from(t.values()).flatMap(e=>e.fields),n=new Set(s.map(e=>e.id));return Array.from(this.filters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e!=="")||Array.from(this.arrayFilters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e.length>0)||Array.from(this.dateRangeFilters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e.filterType!==void 0)||Array.from(this.numberRangeFilters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e.isActive)}get activeFilterKeysList(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:s}=p.BusinessLogicManager.getBusinessLogic(),n=Array.from(this.filters.entries()).filter(([r,d])=>d!==""&&!t.includes(r)&&!s.includes(r)).map(([r])=>r),e=Array.from(this.arrayFilters.entries()).filter(([,r])=>r.length>0).map(([r])=>r),u=Array.from(this.dateRangeFilters.entries()).filter(([,r])=>r.filterType!==void 0).map(([r])=>r),f=Array.from(this.numberRangeFilters.entries()).filter(([,r])=>r.isActive).map(([r])=>r);return[...new Set([...n,...e,...u,...f])]}get queryParamsObject(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:s,PAGE_SIZE_FILTER_ID:n,PAGE_NUMBER_FILTER_ID:e}=p.BusinessLogicManager.getBusinessLogic(),u={};Array.from(this.filters.entries()).filter(([i,r])=>r!==""&&!t.includes(i)&&!s.includes(i)).forEach(([i,r])=>{E.default(u,i,r)}),Array.from(this.arrayFilters.entries()).filter(([,i])=>i.length>0).forEach(([i,r])=>{E.default(u,i,r)}),Array.from(this.dateRangeFilters.entries()).filter(([,i])=>i.filterType!==void 0).forEach(([i,r])=>{r.filterType==="CUSTOM"?E.default(u,i,{gte:r.gte.toString(),lte:r.lte.toString()}):E.default(u,i,{relative:r.filterType})}),Array.from(this.numberRangeFilters.entries()).filter(([,i])=>i.isActive).forEach(([i,r])=>{const d={};r.gte!==void 0&&(d.gte=r.gte),r.isValidLte&&(d.lte=r.lte),E.default(u,i,d)});const f={filter:u,[n]:String(this.pageSize),[e]:String(this.currentPage)};return this.activeViewId&&(f.view=this.activeViewId),f}get queryParams(){return T.default.stringify(this.queryParamsObject,{arrayFormat:"brackets"})}get hasUnsavedChanges(){if(this.activeViewId===k.ALL_VIEW_ID)return!1;if(this.defaultPageSize!==this.pageSize||this.tableStore&&(this.tableStore.sortState.columnId!==this.defaultSortState.columnId||this.tableStore.sortState.direction!==this.defaultSortState.direction))return!0;const{GROUP_MAP:t,SEARCH_FILTER_ID:s}=p.BusinessLogicManager.getBusinessLogic(),n=Array.from(t.values()).flatMap(c=>c.fields),e=new Set(n.map(c=>c.id));if(Array.from(this.filters.entries()).filter(([c])=>c!==s&&e.has(c)).some(([c,l])=>{const a=this.defaultFilters.get(c);return a===void 0&&l!==""||a!==void 0&&l!==a}))return!0;const f=Array.from(this.defaultArrayFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.defaultArrayFilters.get(c)||[];return l.length>0||a.length>0?l.length!==a.length||!O.default(l,a):!1}),i=Array.from(this.arrayFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.defaultArrayFilters.get(c)||[];return l.length>0||a.length>0?l.length!==a.length||!O.default(l,a):!1});if(f||i)return!0;const r=Array.from(this.numberRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.defaultNumberRangeFilters.get(c);return!l.isEqual(a)});if(Array.from(this.defaultNumberRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.numberRangeFilters.get(c);return!l.isEqual(a)})||r)return!0;const M=Array.from(this.defaultDateRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{var S,w,F,g;const a=this.dateRangeFilters.get(c);return l!=null&&l.filterType&&!(a!=null&&a.filterType)||a!=null&&a.filterType&&!(l!=null&&l.filterType)||(a==null?void 0:a.filterType)!==(l==null?void 0:l.filterType)?!0:(a==null?void 0:a.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((S=l.gte)==null?void 0:S.toString())!==((w=a.gte)==null?void 0:w.toString())||((F=l.lte)==null?void 0:F.toString())!==((g=a.lte)==null?void 0:g.toString()):!1});return Array.from(this.dateRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{var S,w,F,g;const a=this.defaultDateRangeFilters.get(c);return l!=null&&l.filterType&&!(a!=null&&a.filterType)||a!=null&&a.filterType&&!(l!=null&&l.filterType)||(a==null?void 0:a.filterType)!==(l==null?void 0:l.filterType)?!0:(a==null?void 0:a.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((S=l.gte)==null?void 0:S.toString())!==((w=a.gte)==null?void 0:w.toString())||((F=l.lte)==null?void 0:F.toString())!==((g=a.lte)==null?void 0:g.toString()):!1})||M}}exports.Filters=$;
|
|
1
|
+
"use strict";var V=Object.defineProperty;var B=(b,t,s)=>t in b?V(b,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):b[t]=s;var h=(b,t,s)=>B(b,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mobx"),G=require("@veeqo/ui"),C=require("@internationalized/date"),q=require("lodash/isEqual"),z=require("lodash/get"),j=require("lodash/set"),K=require("qs"),m=require("./index50.cjs"),I=require("./index2.cjs"),A=require("./index72.cjs"),D=require("./index71.cjs"),L=require("./index102.cjs"),k=require("./index101.cjs"),N=require("./index79.cjs"),p=require("./index9.cjs"),_=b=>b&&b.__esModule?b:{default:b},O=_(q),H=_(z),E=_(j),T=_(K);class ${constructor(t){h(this,"defaultPageSize");h(this,"pageSize");h(this,"currentPage");h(this,"defaultFilters");h(this,"defaultArrayFilters");h(this,"defaultDateRangeFilters");h(this,"defaultNumberRangeFilters");h(this,"filters");h(this,"arrayFilters");h(this,"dateRangeFilters");h(this,"numberRangeFilters");h(this,"activeViewId");h(this,"defaultSortState");h(this,"tableStore");h(this,"isFiltersDropdownVisible");h(this,"initDefaultFilterMaps",()=>{this.defaultFilters=new Map(this.filters),this.defaultArrayFilters=new Map(this.arrayFilters),this.defaultDateRangeFilters=new Map(this.dateRangeFilters),this.defaultNumberRangeFilters=new Map(this.numberRangeFilters),this.defaultSortState={columnId:"",direction:"asc"}});h(this,"updateUrl",(t=!1)=>{try{const{SORT_FILTER_ID:s,SORTING_MODE:n}=p.BusinessLogicManager.getBusinessLogic(),e=T.default.parse(window.location.search,{ignoreQueryPrefix:!0}),u=e[s],f=e.sort_order,i=e.sort;let r="";switch(n){case I.SortingMode.CORAL:if(f&&i){const d={...this.queryParamsObject,sort:i,sort_order:f};r=`${window.location.pathname}?${T.default.stringify(d,{arrayFormat:"brackets"})}`}break;case I.SortingMode.MONOLITH:default:if(u){const d={...this.queryParamsObject,[s]:u};r=`${window.location.pathname}?${T.default.stringify(d,{arrayFormat:"brackets"})}`}}u||(r=`${window.location.pathname}?${this.queryParams}`),t?window.history.pushState({},"",r):window.history.replaceState({},"",r)}catch(s){console.log(s)}});h(this,"setCurrentPage",t=>{this.currentPage=t});h(this,"setPageSize",t=>{this.pageSize=t,this.updateUrl()});h(this,"setFilter",(t,s)=>{this.filters.set(t,s),this.setCurrentPage(1),this.updateUrl()});h(this,"clearFilter",t=>{this.filters.set(t,""),this.setCurrentPage(1),this.updateUrl()});h(this,"setArrayFilter",(t,s)=>{this.arrayFilters.set(t,s),this.setCurrentPage(1),this.updateUrl()});h(this,"clearArrayFilter",t=>{this.arrayFilters.set(t,[]),this.setCurrentPage(1),this.updateUrl()});h(this,"setRangeFilter",({key:t,range:s,dates:n})=>{s.setFilterType(t),s.setDates(n.start,n.end),this.setCurrentPage(1),this.updateUrl()});h(this,"clearRangeFilter",t=>{const s=this.dateRangeFilters.get(t);s&&(s.clear(),this.setCurrentPage(1),this.updateUrl())});h(this,"setNumberRangeFilter",({numberRange:t,gte:s,lte:n})=>{t.setGte(s),t.setLte(n),this.setCurrentPage(1),this.updateUrl()});h(this,"clearNumberRangeFilter",t=>{const s=this.numberRangeFilters.get(t);s&&(s.clear(),this.setCurrentPage(1),this.updateUrl())});h(this,"clearAllFilters",(t=!1)=>{const{SEARCH_FILTER_ID:s}=p.BusinessLogicManager.getBusinessLogic();this.filters.forEach((n,e)=>{e!==s&&this.filters.set(e,"")}),this.arrayFilters.forEach((n,e)=>this.arrayFilters.set(e,[])),this.dateRangeFilters.forEach(n=>n.clear()),this.numberRangeFilters.forEach(n=>n.clear()),this.setCurrentPage(1),t||this.updateUrl()});h(this,"clearFiltersForGroup",t=>{const{GROUP_MAP:s}=p.BusinessLogicManager.getBusinessLogic(),n=s.get(t);n&&n.fields.forEach(e=>{this.arrayFilters.has(e.id)?this.clearArrayFilter(e.id):this.dateRangeFilters.has(e.id)?this.clearRangeFilter(e.id):this.numberRangeFilters.has(e.id)?this.clearNumberRangeFilter(e.id):this.clearFilter(e.id)})});h(this,"setActiveViewId",t=>{this.activeViewId=t,this.updateUrl()});h(this,"toggleFiltersDropdownVisible",t=>{this.isFiltersDropdownVisible=t});h(this,"getFiltersForGroup",t=>{const{GROUP_MAP:s}=p.BusinessLogicManager.getBusinessLogic(),n=s.get(t);if(!n)return{};const e={};return n.fields.forEach(u=>{this.arrayFilters.has(u.id)?e[u.id]=this.arrayFilters.get(u.id):this.dateRangeFilters.has(u.id)?e[u.id]=this.dateRangeFilters.get(u.id):this.numberRangeFilters.has(u.id)?e[u.id]=this.numberRangeFilters.get(u.id):e[u.id]=this.filters.get(u.id)}),e});h(this,"initFiltersFromView",t=>{var e,u;const{PAGE_SIZE_OPTIONS:s}=p.BusinessLogicManager.getBusinessLogic();(e=t.page)!=null&&e.size&&s.includes(t.page.size)&&(this.defaultPageSize=t.page.size,this.pageSize=t.page.size),this.setCurrentPage(1),this.defaultFilters=new Map(t.filterMaps.filters),this.defaultArrayFilters=new Map(t.filterMaps.arrayFilters),this.defaultDateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([f,i])=>{const r=new A.RangeFilter(i.filterType);return i.gte&&i.lte&&r.setDates(i.gte,i.lte),[f,r]})),this.defaultNumberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([f,i])=>{const r=i.clone();return i.gte&&r.setGte(i.gte),i.lte&&r.setLte(i.lte),[f,r]})),this.filters=new Map(t.filterMaps.filters),this.arrayFilters=new Map(t.filterMaps.arrayFilters),this.dateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([f,i])=>{const r=new A.RangeFilter(i.filterType);return i.gte&&i.lte&&r.setDates(i.gte,i.lte),[f,r]})),this.numberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([f,i])=>{const r=i.clone();return i.gte&&r.setGte(i.gte),i.lte&&r.setLte(i.lte),[f,r]}));const n=L.parseSortString(t.sort);this.defaultSortState=n,(u=this.tableStore)==null||u.setSortState(n),this.activeViewId=t.id});h(this,"initFromUrl",(t=!0)=>{var S,w;const{GROUP_MAP:s,PAGE_SIZE_OPTIONS:n,PAGE_SIZE_FILTER_ID:e,SORT_FILTER_ID:u}=p.BusinessLogicManager.getBusinessLogic(),f=T.default.parse(window.location.search,{ignoreQueryPrefix:!0}),i=Array.from(s.values()).flatMap(F=>F.fields),r=new Map,d=new Map,M=new Map,v=new Map;t&&f.view&&(this.activeViewId=f.view),f[e]&&n.includes(Number(f[e]))&&(this.pageSize=Number(f[e]));const c=f.filter||{};i.forEach(F=>{const g=H.default(c,F.id);if(g!==void 0)switch(F.filterType){case m.FilterChoiceValue.CHECKBOX:Array.isArray(g)?d.set(F.id,g):g&&d.set(F.id,[g]);break;case m.FilterChoiceValue.DATE_RANGE:if(typeof g=="string"&&N.isValidDateRange(g))M.set(F.id,new A.RangeFilter(g));else if(typeof g=="object"&&g!==null){const y=g;if(y.relative&&N.isValidDateRange(y.relative))M.set(F.id,new A.RangeFilter(y.relative));else if(y.gte&&y.lte)try{const R=C.parseDate(y.gte),U=C.parseDate(y.lte),P=new A.RangeFilter("CUSTOM");P.setDates(R,U),M.set(F.id,P)}catch{M.set(F.id,new A.RangeFilter(G.DateRanges.TODAY))}}break;case m.FilterChoiceValue.NUMBER_RANGE:if(typeof g=="object"&&g!==null){const y=g,R=new D.NumberRangeFilter({filterId:F.id});y.gte!==void 0&&R.setGte(Number(y.gte)),y.lte!==void 0&&R.setLte(Number(y.lte)),v.set(F.id,R)}break;case m.FilterChoiceValue.TEXT:case m.FilterChoiceValue.NUMBER:case m.FilterChoiceValue.RADIO:(typeof g=="string"||typeof g=="number")&&r.set(F.id,String(g));break}}),this.filters=r,this.arrayFilters=d,this.dateRangeFilters=M,this.numberRangeFilters=v;const l=f[u]||f.sort,a=f.sort_order;if(a&&f.sort)(S=this.tableStore)==null||S.setSortState({columnId:f.sort,direction:a});else if(l){const F=L.parseSortString(l);F.columnId&&((w=this.tableStore)==null||w.setSortState(F))}this.updateUrl()});h(this,"discardChanges",(t=!1)=>{var e;this.pageSize=this.defaultPageSize;const{SEARCH_FILTER_ID:s}=p.BusinessLogicManager.getBusinessLogic(),n=new Map(this.defaultFilters);this.filters.has(s)&&n.set(s,this.filters.get(s)),this.filters=n,this.arrayFilters=new Map(this.defaultArrayFilters),this.dateRangeFilters.clear(),this.defaultDateRangeFilters.forEach((u,f)=>{const i=new A.RangeFilter(u.filterType);i.setDates(u.gte,u.lte),this.dateRangeFilters.set(f,i)}),this.numberRangeFilters.clear(),this.defaultNumberRangeFilters.forEach((u,f)=>{this.numberRangeFilters.set(f,u.clone())}),(e=this.tableStore)==null||e.setSortState(this.defaultSortState),this.updateUrl(t)});const{GROUP_MAP:s}=p.BusinessLogicManager.getBusinessLogic(),n=Array.from(s.values()).flatMap(e=>e.fields);this.filters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.TEXT||e.filterType===m.FilterChoiceValue.NUMBER||e.filterType===m.FilterChoiceValue.RADIO||e.filterType===m.FilterChoiceValue.DATE_RANGE).map(e=>[e.id,""])),this.arrayFilters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.CHECKBOX).map(e=>[e.id,[]])),this.dateRangeFilters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.DATE_RANGE).map(e=>[e.id,new A.RangeFilter])),this.numberRangeFilters=new Map(n.filter(e=>e.filterType===m.FilterChoiceValue.NUMBER_RANGE).map(e=>{const u=new D.NumberRangeFilter({filterId:e.id});return[e.id,u]})),this.defaultArrayFilters=new Map,this.defaultFilters=new Map,this.defaultDateRangeFilters=new Map,this.defaultNumberRangeFilters=new Map,this.currentPage=1,this.pageSize=10,this.defaultPageSize=10,this.initDefaultFilterMaps(),this.isFiltersDropdownVisible=!1,this.activeViewId=void 0,this.defaultSortState={columnId:"",direction:"asc"},this.tableStore=t,o.makeObservable(this,{defaultPageSize:o.observable,pageSize:o.observable,currentPage:o.observable,defaultFilters:o.observable,defaultArrayFilters:o.observable,defaultDateRangeFilters:o.observable,defaultNumberRangeFilters:o.observable,filters:o.observable,arrayFilters:o.observable,numberRangeFilters:o.observable,dateRangeFilters:o.observable,isFiltersDropdownVisible:o.observable,activeViewId:o.observable,defaultSortState:o.observable,tableStore:o.observable.ref,setPageSize:o.action,setCurrentPage:o.action,toggleFiltersDropdownVisible:o.action,setActiveViewId:o.action,setFilter:o.action,setArrayFilter:o.action,setRangeFilter:o.action,setNumberRangeFilter:o.action,clearFilter:o.action,clearArrayFilter:o.action,clearRangeFilter:o.action,clearNumberRangeFilter:o.action,clearAllFilters:o.action,getFiltersForGroup:o.action,clearFiltersForGroup:o.action,initFromUrl:o.action,initFiltersFromView:o.action,initDefaultFilterMaps:o.action,discardChanges:o.action,updateUrl:o.action,hasActiveFilters:o.computed,activeFilterKeysList:o.computed,queryParamsObject:o.computed,queryParams:o.computed,hasUnsavedChanges:o.computed})}get hasActiveFilters(){const{GROUP_MAP:t}=p.BusinessLogicManager.getBusinessLogic(),s=Array.from(t.values()).flatMap(e=>e.fields),n=new Set(s.map(e=>e.id));return Array.from(this.filters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e!=="")||Array.from(this.arrayFilters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e.length>0)||Array.from(this.dateRangeFilters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e.filterType!==void 0)||Array.from(this.numberRangeFilters.entries()).filter(([e])=>n.has(e)).some(([,e])=>e.isActive)}get activeFilterKeysList(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:s}=p.BusinessLogicManager.getBusinessLogic(),n=Array.from(this.filters.entries()).filter(([r,d])=>d!==""&&!t.includes(r)&&!s.includes(r)).map(([r])=>r),e=Array.from(this.arrayFilters.entries()).filter(([,r])=>r.length>0).map(([r])=>r),u=Array.from(this.dateRangeFilters.entries()).filter(([,r])=>r.filterType!==void 0).map(([r])=>r),f=Array.from(this.numberRangeFilters.entries()).filter(([,r])=>r.isActive).map(([r])=>r);return[...new Set([...n,...e,...u,...f])]}get queryParamsObject(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:s,PAGE_SIZE_FILTER_ID:n,PAGE_NUMBER_FILTER_ID:e}=p.BusinessLogicManager.getBusinessLogic(),u={};Array.from(this.filters.entries()).filter(([i,r])=>r!==""&&!t.includes(i)&&!s.includes(i)).forEach(([i,r])=>{E.default(u,i,r)}),Array.from(this.arrayFilters.entries()).filter(([,i])=>i.length>0).forEach(([i,r])=>{E.default(u,i,r)}),Array.from(this.dateRangeFilters.entries()).filter(([,i])=>i.filterType!==void 0).forEach(([i,r])=>{r.filterType==="CUSTOM"?E.default(u,i,{gte:r.gte.toString(),lte:r.lte.toString()}):E.default(u,i,{relative:r.filterType})}),Array.from(this.numberRangeFilters.entries()).filter(([,i])=>i.isActive).forEach(([i,r])=>{const d={};r.gte!==void 0&&(d.gte=r.gte),r.isValidLte&&(d.lte=r.lte),E.default(u,i,d)});const f={filter:u,[n]:String(this.pageSize),[e]:String(this.currentPage)};return this.activeViewId&&(f.view=this.activeViewId),f}get queryParams(){return T.default.stringify(this.queryParamsObject,{arrayFormat:"brackets"})}get hasUnsavedChanges(){if(this.activeViewId===k.ALL_VIEW_ID)return!1;if(this.defaultPageSize!==this.pageSize||this.tableStore&&(this.tableStore.sortState.columnId!==this.defaultSortState.columnId||this.tableStore.sortState.direction!==this.defaultSortState.direction))return!0;const{GROUP_MAP:t,SEARCH_FILTER_ID:s}=p.BusinessLogicManager.getBusinessLogic(),n=Array.from(t.values()).flatMap(c=>c.fields),e=new Set(n.map(c=>c.id));if(Array.from(this.filters.entries()).filter(([c])=>c!==s&&e.has(c)).some(([c,l])=>{const a=this.defaultFilters.get(c);return a===void 0&&l!==""||a!==void 0&&l!==a}))return!0;const f=Array.from(this.defaultArrayFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.defaultArrayFilters.get(c)||[];return l.length>0||a.length>0?l.length!==a.length||!O.default(l,a):!1}),i=Array.from(this.arrayFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.defaultArrayFilters.get(c)||[];return l.length>0||a.length>0?l.length!==a.length||!O.default(l,a):!1});if(f||i)return!0;const r=Array.from(this.numberRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.defaultNumberRangeFilters.get(c);return!l.isEqual(a)});if(Array.from(this.defaultNumberRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{const a=this.numberRangeFilters.get(c);return!l.isEqual(a)})||r)return!0;const M=Array.from(this.defaultDateRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{var S,w,F,g;const a=this.dateRangeFilters.get(c);return l!=null&&l.filterType&&!(a!=null&&a.filterType)||a!=null&&a.filterType&&!(l!=null&&l.filterType)||(a==null?void 0:a.filterType)!==(l==null?void 0:l.filterType)?!0:(a==null?void 0:a.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((S=l.gte)==null?void 0:S.toString())!==((w=a.gte)==null?void 0:w.toString())||((F=l.lte)==null?void 0:F.toString())!==((g=a.lte)==null?void 0:g.toString()):!1});return Array.from(this.dateRangeFilters.entries()).filter(([c])=>e.has(c)).some(([c,l])=>{var S,w,F,g;const a=this.defaultDateRangeFilters.get(c);return l!=null&&l.filterType&&!(a!=null&&a.filterType)||a!=null&&a.filterType&&!(l!=null&&l.filterType)||(a==null?void 0:a.filterType)!==(l==null?void 0:l.filterType)?!0:(a==null?void 0:a.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((S=l.gte)==null?void 0:S.toString())!==((w=a.gte)==null?void 0:w.toString())||((F=l.lte)==null?void 0:F.toString())!==((g=a.lte)==null?void 0:g.toString()):!1})||M}}exports.Filters=$;
|
package/dist/index70.js
CHANGED
|
@@ -12,8 +12,8 @@ import { FilterChoiceValue as p } from "./index50.js";
|
|
|
12
12
|
import { SortingMode as C } from "./index2.js";
|
|
13
13
|
import { RangeFilter as b } from "./index72.js";
|
|
14
14
|
import { NumberRangeFilter as O } from "./index71.js";
|
|
15
|
-
import { parseSortString as U } from "./
|
|
16
|
-
import { ALL_VIEW_ID as K } from "./
|
|
15
|
+
import { parseSortString as U } from "./index102.js";
|
|
16
|
+
import { ALL_VIEW_ID as K } from "./index101.js";
|
|
17
17
|
import { isValidDateRange as L } from "./index79.js";
|
|
18
18
|
import { BusinessLogicManager as S } from "./index9.js";
|
|
19
19
|
class le {
|
package/dist/index73.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var f=(i,t,e)=>t in i?o(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var a=(i,t,e)=>f(i,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("mobx"),w=require("./index81.cjs");class V{constructor(){a(this,"draftCount");a(this,"draftViewsMap");a(this,"addDraftView",t=>{const e=t.originalView||t,s=`${e.id}-draft${this.draftCount}`,d=`${e.label} (
|
|
1
|
+
"use strict";var o=Object.defineProperty;var f=(i,t,e)=>t in i?o(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var a=(i,t,e)=>f(i,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("mobx"),w=require("./index81.cjs");class V{constructor(){a(this,"draftCount");a(this,"draftViewsMap");a(this,"addDraftView",t=>{const e=t.originalView||t,s=`${e.id}-draft${this.draftCount}`,d=`${e.label} (copy)`,n={...t,id:s,label:d,editable:!0,originalView:e};return this.draftViewsMap.set(s,n),this.incrementDraftViewCount(),n});a(this,"addEmptyDraftView",()=>{const t=`draft-${this.draftCount}`,e=w.createEmptyTransformedView({id:t,label:"draft",editable:!0});return this.draftViewsMap.set(t,e),this.incrementDraftViewCount(),e});a(this,"removeDraftViewById",t=>{this.draftViewsMap.has(t)&&this.draftViewsMap.delete(t)});a(this,"incrementDraftViewCount",()=>{this.draftCount+=1});r.makeObservable(this,{draftViewsList:r.computed,draftViewsMap:r.observable,draftCount:r.observable,addDraftView:r.action,addEmptyDraftView:r.action,removeDraftViewById:r.action,incrementDraftViewCount:r.action}),this.draftCount=0,this.draftViewsMap=new Map}get draftViewsList(){return Array.from(this.draftViewsMap.entries()).map(([,t])=>t)}}exports.Views=V;
|
package/dist/index73.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var o = Object.defineProperty;
|
|
2
2
|
var w = (a, t, e) => t in a ? o(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var r = (a, t, e) => w(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { makeObservable as V, action as i, observable as d, computed as
|
|
5
|
-
import { createEmptyTransformedView as
|
|
6
|
-
class
|
|
4
|
+
import { makeObservable as V, action as i, observable as d, computed as m } from "mobx";
|
|
5
|
+
import { createEmptyTransformedView as p } from "./index81.js";
|
|
6
|
+
class h {
|
|
7
7
|
constructor() {
|
|
8
8
|
r(this, "draftCount");
|
|
9
9
|
r(this, "draftViewsMap");
|
|
10
10
|
r(this, "addDraftView", (t) => {
|
|
11
|
-
const e = t.originalView || t, s = `${e.id}-draft${this.draftCount}`, f = `${e.label} (
|
|
11
|
+
const e = t.originalView || t, s = `${e.id}-draft${this.draftCount}`, f = `${e.label} (copy)`, n = {
|
|
12
12
|
...t,
|
|
13
13
|
id: s,
|
|
14
14
|
label: f,
|
|
@@ -18,7 +18,7 @@ class l {
|
|
|
18
18
|
return this.draftViewsMap.set(s, n), this.incrementDraftViewCount(), n;
|
|
19
19
|
});
|
|
20
20
|
r(this, "addEmptyDraftView", () => {
|
|
21
|
-
const t = `draft-${this.draftCount}`, e =
|
|
21
|
+
const t = `draft-${this.draftCount}`, e = p({
|
|
22
22
|
id: t,
|
|
23
23
|
label: "draft",
|
|
24
24
|
editable: !0
|
|
@@ -32,7 +32,7 @@ class l {
|
|
|
32
32
|
this.draftCount += 1;
|
|
33
33
|
});
|
|
34
34
|
V(this, {
|
|
35
|
-
draftViewsList:
|
|
35
|
+
draftViewsList: m,
|
|
36
36
|
draftViewsMap: d,
|
|
37
37
|
draftCount: d,
|
|
38
38
|
addDraftView: i,
|
|
@@ -46,5 +46,5 @@ class l {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
h as Views
|
|
50
50
|
};
|
package/dist/index80.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@internationalized/date"),f=require("./index72.cjs"),_=require("./index71.cjs"),F=require("lodash/get"),R=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@internationalized/date"),f=require("./index72.cjs"),_=require("./index71.cjs"),F=require("lodash/get"),R=require("./index100.cjs"),A=require("./index9.cjs"),T=r=>r&&r.__esModule?r:{default:r},n=T(F),w=({view:r,canUpdateCustomViews:g})=>{var o,c;const{DATE_RANGE_FILTERS:a,NUMBER_RANGE_FILTERS:u,GROUP_MAP:p}=A.BusinessLogicManager.getBusinessLogic(),l=Array.from(p.values()).flatMap(e=>e.fields),s=r.filters.filter||{},{colourPalette:b,customTextColour:m}=R.getViewTheme((o=r.view_attributes)==null?void 0:o.type);return{id:r.id,label:r.title,viewFilters:s,filterMaps:{filters:new Map(l.filter(e=>!a.includes(e.id)&&!u.includes(e.id)&&e.filterType!=="checkbox").map(e=>{const t=n.default(s,e.id);return[e.id,t!==void 0&&!Array.isArray(t)&&typeof t!="object"?String(t):""]}).filter(([,e])=>e!=="")),arrayFilters:new Map(l.filter(e=>e.filterType==="checkbox").map(e=>{const t=n.default(s,e.id);return[e.id,Array.isArray(t)?t:[]]}).filter(([,e])=>e.length>0)),rangeFilters:new Map(l.filter(e=>a.includes(e.id)).map(e=>{const t=n.default(s,e.id);if(!t)return null;let i;if(typeof t=="string")i=new f.RangeFilter(t);else if(typeof t=="object"&&t.gte&&t.lte){i=new f.RangeFilter("CUSTOM");const y=d.parseDate(t.gte),M=d.parseDate(t.lte);i.setDates(y,M)}else return null;return[e.id,i]}).filter(e=>e!==null)),numberRangeFilters:new Map(l.filter(e=>u.includes(e.id)).map(e=>{const t=n.default(s,e.id);if(!t||typeof t!="object")return null;const i=new _.NumberRangeFilter({filterId:e.id});return t.lte!==void 0&&i.setLte(Number(t.lte)),t.gte!==void 0&&i.setGte(Number(t.gte)),[e.id,i]}).filter(e=>e!==null))},page:r.filters.page,editable:r.editable&&g,isShared:r.shared,columns:r.columns,sort:(c=r.filters)==null?void 0:c.sort,colourPalette:b,customTextColour:m,view_attributes:r.view_attributes}};exports.viewsAdapter=w;
|
package/dist/index80.js
CHANGED
|
@@ -2,7 +2,7 @@ import { parseDate as c } from "@internationalized/date";
|
|
|
2
2
|
import { RangeFilter as p } from "./index72.js";
|
|
3
3
|
import { NumberRangeFilter as M } from "./index71.js";
|
|
4
4
|
import n from "lodash/get";
|
|
5
|
-
import { getViewTheme as F } from "./
|
|
5
|
+
import { getViewTheme as F } from "./index100.js";
|
|
6
6
|
import { BusinessLogicManager as R } from "./index9.js";
|
|
7
7
|
const S = ({ view: r, canUpdateCustomViews: m }) => {
|
|
8
8
|
var u, f;
|
package/dist/index82.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index101.cjs"),w=require("./index80.cjs"),V=({data:n,canUpdateCustomViews:l})=>{const o={fixedViews:[...i.INITIAL_VIEWS_STATE.fixedViews],customViews:[...i.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(i.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return o;let u=!1;const t=n.reduce((e,s)=>{const r=w.viewsAdapter({view:s,canUpdateCustomViews:l});return e.viewsMap.set(s.id,r),s.editable?e.customViews.push(r):e.fixedViews.push(r),s.title==="All"&&(u=!0),e},o);return u&&(t.viewsMap.delete(i.ALL_VIEW_ID),t.fixedViews.shift()),t};exports.organiseViews=V;
|
package/dist/index82.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INITIAL_VIEWS_STATE as r, ALL_VIEW_ID as u } from "./
|
|
1
|
+
import { INITIAL_VIEWS_STATE as r, ALL_VIEW_ID as u } from "./index101.js";
|
|
2
2
|
import { viewsAdapter as V } from "./index80.js";
|
|
3
3
|
const p = ({ data: o, canUpdateCustomViews: w }) => {
|
|
4
4
|
const f = {
|
package/dist/index86.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index116.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
|
|
2
2
|
`);if(t.length<=10)return e;const n=t==null?void 0:t[0],i=t==null?void 0:t.splice(9),r=[n,...i].join(`
|
|
3
3
|
`);e.stack=r}return e};exports.filterErrorStack=s;
|
package/dist/index86.js
CHANGED
package/dist/index87.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index116.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
|
package/dist/index87.js
CHANGED
package/dist/index88.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
|
package/dist/index88.js
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { useStores as L } from "./index63.js";
|
|
5
|
-
import { useUrlParams as v } from "./index69.js";
|
|
6
|
-
import { fetcherV2 as V } from "./index56.js";
|
|
7
|
-
function T() {
|
|
8
|
-
const { TABLE_DATA_URL: h } = S(), {
|
|
9
|
-
Filters: {
|
|
10
|
-
pageSize: n,
|
|
11
|
-
activeViewId: s
|
|
12
|
-
}
|
|
13
|
-
} = L(), { queryParams: m } = v();
|
|
14
|
-
async function r() {
|
|
15
|
-
const e = `${h}?${m}`, g = await V(e);
|
|
16
|
-
return JSON.stringify(g);
|
|
17
|
-
}
|
|
18
|
-
const [c, a] = t(null), [l, u] = t(!1), [f, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
|
|
19
|
-
return p(() => {
|
|
20
|
-
const e = () => {
|
|
21
|
-
document.hidden ? o(null) : o(i);
|
|
22
|
-
};
|
|
23
|
-
return document.addEventListener("visibilitychange", e), () => {
|
|
24
|
-
document.removeEventListener("visibilitychange", e);
|
|
25
|
-
};
|
|
26
|
-
}, []), P(
|
|
27
|
-
async () => {
|
|
28
|
-
const e = await r();
|
|
29
|
-
if (c === null || f !== s || w !== n) {
|
|
30
|
-
a(e), C(s), y(n);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const d = e !== c;
|
|
34
|
-
d && (a(e), u(d));
|
|
35
|
-
},
|
|
36
|
-
l ? null : D
|
|
37
|
-
), { hasChanges: l, acknowledgeButtonClick: async () => {
|
|
38
|
-
u(!1), o(i), a(await r());
|
|
39
|
-
} };
|
|
40
|
-
}
|
|
1
|
+
const e = "_actionsHeaderContainer_fgqms_1", a = {
|
|
2
|
+
actionsHeaderContainer: e
|
|
3
|
+
};
|
|
41
4
|
export {
|
|
42
|
-
|
|
5
|
+
e as actionsHeaderContainer,
|
|
6
|
+
a as default
|
|
43
7
|
};
|
package/dist/index89.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>t.trim().length>=3||t.trim().length===0;exports.isTextFilterValid=e;
|
package/dist/index89.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
refreshTooltip: e,
|
|
3
|
-
refreshButton: r,
|
|
4
|
-
refreshIndicator: t
|
|
5
|
-
};
|
|
1
|
+
const i = (t) => t.trim().length >= 3 || t.trim().length === 0;
|
|
6
2
|
export {
|
|
7
|
-
|
|
8
|
-
r as refreshButton,
|
|
9
|
-
t as refreshIndicator,
|
|
10
|
-
e as refreshTooltip
|
|
3
|
+
i as isTextFilterValid
|
|
11
4
|
};
|
package/dist/index90.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("react-use"),L=require("./index8.cjs"),m=require("./index63.cjs"),v=require("./index69.cjs"),q=require("./index56.cjs");function V(){const{TABLE_DATA_URL:h}=L.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=m.useStores(),{queryParams:S}=v.useUrlParams();async function c(){const e=`${h}?${S}`,g=await q.fetcherV2(e);return JSON.stringify(g)}const[u,a]=t.useState(null),[o,l]=t.useState(!1),[f,C]=t.useState(n),[y,P]=t.useState(s),i=3e5,[D,r]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?r(null):r(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),w.useInterval(async()=>{const e=await c();if(u===null||f!==n||y!==s){a(e),C(n),P(s);return}const d=e!==u;d&&(a(e),l(d))},o?null:D),{hasChanges:o,acknowledgeButtonClick:async()=>{l(!1),r(i),a(await c())}}}exports.usePollData=V;
|
package/dist/index90.js
CHANGED
|
@@ -1,119 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[n.Visible]: d
|
|
33
|
-
});
|
|
34
|
-
}, C = y(
|
|
35
|
-
(i) => {
|
|
36
|
-
if (b(i), !i) {
|
|
37
|
-
const r = /* @__PURE__ */ new Set([...c, ...d]);
|
|
38
|
-
u((S) => ({
|
|
39
|
-
[n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
|
|
40
|
-
[n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
|
|
41
|
-
}));
|
|
1
|
+
import { useState as t, useEffect as p } from "react";
|
|
2
|
+
import { useInterval as P } from "react-use";
|
|
3
|
+
import { useBusinessLogic as S } from "./index8.js";
|
|
4
|
+
import { useStores as L } from "./index63.js";
|
|
5
|
+
import { useUrlParams as v } from "./index69.js";
|
|
6
|
+
import { fetcherV2 as V } from "./index56.js";
|
|
7
|
+
function T() {
|
|
8
|
+
const { TABLE_DATA_URL: h } = S(), {
|
|
9
|
+
Filters: {
|
|
10
|
+
pageSize: n,
|
|
11
|
+
activeViewId: s
|
|
12
|
+
}
|
|
13
|
+
} = L(), { queryParams: m } = v();
|
|
14
|
+
async function r() {
|
|
15
|
+
const e = `${h}?${m}`, g = await V(e);
|
|
16
|
+
return JSON.stringify(g);
|
|
17
|
+
}
|
|
18
|
+
const [c, a] = t(null), [l, u] = t(!1), [f, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
|
|
19
|
+
return p(() => {
|
|
20
|
+
const e = () => {
|
|
21
|
+
document.hidden ? o(null) : o(i);
|
|
22
|
+
};
|
|
23
|
+
return document.addEventListener("visibilitychange", e), () => {
|
|
24
|
+
document.removeEventListener("visibilitychange", e);
|
|
25
|
+
};
|
|
26
|
+
}, []), P(
|
|
27
|
+
async () => {
|
|
28
|
+
const e = await r();
|
|
29
|
+
if (c === null || f !== s || w !== n) {
|
|
30
|
+
a(e), C(s), y(n);
|
|
31
|
+
return;
|
|
42
32
|
}
|
|
33
|
+
const d = e !== c;
|
|
34
|
+
d && (a(e), u(d));
|
|
43
35
|
},
|
|
44
|
-
|
|
45
|
-
),
|
|
46
|
-
(i)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
[a]
|
|
51
|
-
);
|
|
52
|
-
return /* @__PURE__ */ e(
|
|
53
|
-
O,
|
|
54
|
-
{
|
|
55
|
-
variant: "lg",
|
|
56
|
-
style: { overflowY: "hidden" },
|
|
57
|
-
shouldShow: !0,
|
|
58
|
-
onClose: () => l == null ? void 0 : l(),
|
|
59
|
-
headerSlot: /* @__PURE__ */ s(Y, { children: [
|
|
60
|
-
/* @__PURE__ */ s(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
|
|
61
|
-
/* @__PURE__ */ s(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
|
|
62
|
-
/* @__PURE__ */ e(_, { height: v.sizes.lg, width: v.sizes.lg }),
|
|
63
|
-
/* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
|
|
64
|
-
] }),
|
|
65
|
-
/* @__PURE__ */ e($, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(z, {}) })
|
|
66
|
-
] }),
|
|
67
|
-
/* @__PURE__ */ s(p, { variant: "subheadingMedium", children: [
|
|
68
|
-
"Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our",
|
|
69
|
-
" ",
|
|
70
|
-
/* @__PURE__ */ e(B, { href: P.ORDER_VIEWS_AND_TABLE_CUSTOMIZATION, target: "_blank", children: "help guide" }),
|
|
71
|
-
"."
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
|
|
74
|
-
/* @__PURE__ */ e(
|
|
75
|
-
j,
|
|
76
|
-
{
|
|
77
|
-
name: "column-search-query",
|
|
78
|
-
placeholder: "Search",
|
|
79
|
-
value: o,
|
|
80
|
-
onChange: C,
|
|
81
|
-
onClearClick: () => C(""),
|
|
82
|
-
fill: "100%"
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
] }),
|
|
86
|
-
leftActions: [
|
|
87
|
-
{
|
|
88
|
-
label: "Reset",
|
|
89
|
-
onClick: A,
|
|
90
|
-
variant: "default",
|
|
91
|
-
disabled: m
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
rightActions: [
|
|
95
|
-
{
|
|
96
|
-
label: "Cancel",
|
|
97
|
-
onClick: l,
|
|
98
|
-
variant: "default",
|
|
99
|
-
disabled: m
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: "Save",
|
|
103
|
-
onClick: () => x({ visibleColumns: t[n.Visible] }),
|
|
104
|
-
variant: "primary",
|
|
105
|
-
disabled: m,
|
|
106
|
-
loading: m
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(N, { items: t, setItems: u, renderDragOverlay: G, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ s(R, { columns: 2, spacing: "xl", children: [
|
|
110
|
-
/* @__PURE__ */ e(V, { id: n.Visible, title: "Shown columns:", columns: M }),
|
|
111
|
-
/* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { children: "Drag & Drop columns" }) }),
|
|
112
|
-
/* @__PURE__ */ e(V, { id: n.Hidden, title: "Hidden columns:", columns: T })
|
|
113
|
-
] }) }) }) }) })
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
};
|
|
36
|
+
l ? null : D
|
|
37
|
+
), { hasChanges: l, acknowledgeButtonClick: async () => {
|
|
38
|
+
u(!1), o(i), a(await r());
|
|
39
|
+
} };
|
|
40
|
+
}
|
|
117
41
|
export {
|
|
118
|
-
|
|
42
|
+
T as usePollData
|
|
119
43
|
};
|
package/dist/index91.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_refreshTooltip_v0eu8_1",r="_refreshButton_v0eu8_5",t="_refreshIndicator_v0eu8_9",o={refreshTooltip:e,refreshButton:r,refreshIndicator:t};exports.default=o;exports.refreshButton=r;exports.refreshIndicator=t;exports.refreshTooltip=e;
|
package/dist/index91.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
|
|
2
|
+
refreshTooltip: e,
|
|
3
|
+
refreshButton: r,
|
|
4
|
+
refreshIndicator: t
|
|
5
|
+
};
|
|
2
6
|
export {
|
|
3
|
-
|
|
7
|
+
o as default,
|
|
8
|
+
r as refreshButton,
|
|
9
|
+
t as refreshIndicator,
|
|
10
|
+
e as refreshTooltip
|
|
4
11
|
};
|
package/dist/index92.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@veeqo/ui"),t=require("react"),j=require("./index93.cjs"),o=require("./index94.cjs"),w=require("./index95.cjs"),T=require("./index96.cjs"),r=require("./index97.cjs"),D=require("./index98.cjs"),V=require("./index49.cjs"),b=require("./index99.cjs"),H=({onClose:u,columnDefinitions:I,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:G,pinnedRightColumnIds:f})=>{const[c,p]=t.useState(""),a=t.useMemo(()=>new Map(I.map(s=>[s.id,s])),[]),[i,C]=t.useState(()=>({[r.ColumnGroupIds.Hidden]:d,[r.ColumnGroupIds.Visible]:m})),y=t.useMemo(()=>{const s=i[r.ColumnGroupIds.Visible].map(l=>a.get(`${l}`));return b.filterColumnsBySearch(s,c)},[i,a,c]),v=t.useMemo(()=>{const s=i[r.ColumnGroupIds.Hidden].map(l=>a.get(`${l}`));return b.filterColumnsBySearch(s,c)},[i,a,c]),{isSavingColumns:h,saveColumns:M}=D.usePersistColumns({pinnedLeftColumnIds:G,pinnedRightColumnIds:f}),k=()=>{p(""),C({[r.ColumnGroupIds.Hidden]:d,[r.ColumnGroupIds.Visible]:m})},x=t.useCallback(s=>{if(p(s),!s){const l=new Set([...d,...m]);C(S=>({[r.ColumnGroupIds.Hidden]:S[r.ColumnGroupIds.Hidden].filter(g=>l.has(`${g}`)),[r.ColumnGroupIds.Visible]:S[r.ColumnGroupIds.Visible].filter(g=>l.has(`${g}`))}))}},[d,m]),q=t.useCallback(s=>{const l=a.get(`${s}`);return l?e.jsx(T.ColumnItem,{column:l,isDragOverlay:!0}):null},[a]);return e.jsx(n.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(o.HeaderContainer,{children:[e.jsxs(n.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(n.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(n.ListBoardIcon,{height:n.theme.sizes.lg,width:n.theme.sizes.lg}),e.jsx(n.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(n.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(n.CloseIcon,{})})]}),e.jsxs(n.Text,{variant:"subheadingMedium",children:["Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our"," ",e.jsx(n.Anchor,{href:V.helpGuideUrls.ORDER_VIEWS_AND_TABLE_CUSTOMIZATION,target:"_blank",children:"help guide"}),"."]}),e.jsx(n.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(o.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:k,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:i[r.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(n.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(n.Stack,{spacing:4,alignX:"stretch",children:e.jsx(w.DndContainer,{items:i,setItems:C,renderDragOverlay:q,children:e.jsx(o.Container,{children:e.jsxs(o.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(j.ColumnGroup,{id:r.ColumnGroupIds.Visible,title:"Shown columns:",columns:y}),e.jsx(o.VerticalSeparator,{children:e.jsx(o.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(j.ColumnGroup,{id:r.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=H;
|
package/dist/index92.js
CHANGED
|
@@ -1,7 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as O, Stack as h, ListBoardIcon as _, theme as v, Text as p, Button as $, CloseIcon as z, Anchor as B } from "@veeqo/ui";
|
|
3
|
+
import { useState as w, useMemo as f, useCallback as y } from "react";
|
|
4
|
+
import { ColumnGroup as V } from "./index93.js";
|
|
5
|
+
import { Container as L, ColumnGroupsGrid as R, VerticalSeparator as X, VerticalText as E, HeaderContainer as Y, ColumnSearch as j } from "./index94.js";
|
|
6
|
+
import { DndContainer as N } from "./index95.js";
|
|
7
|
+
import { ColumnItem as Q } from "./index96.js";
|
|
8
|
+
import { ColumnGroupIds as n } from "./index97.js";
|
|
9
|
+
import { usePersistColumns as U } from "./index98.js";
|
|
10
|
+
import { helpGuideUrls as P } from "./index49.js";
|
|
11
|
+
import { filterColumnsBySearch as D } from "./index99.js";
|
|
12
|
+
const te = ({
|
|
13
|
+
onClose: l,
|
|
14
|
+
columnDefinitions: k,
|
|
15
|
+
hiddenColumns: c,
|
|
16
|
+
visibleColumns: d,
|
|
17
|
+
pinnedLeftColumnIds: H,
|
|
18
|
+
pinnedRightColumnIds: I
|
|
19
|
+
}) => {
|
|
20
|
+
const [o, b] = w(""), a = f(() => new Map(k.map((i) => [i.id, i])), []), [t, u] = w(() => ({
|
|
21
|
+
[n.Hidden]: c,
|
|
22
|
+
[n.Visible]: d
|
|
23
|
+
})), M = f(() => {
|
|
24
|
+
const i = t[n.Visible].map((r) => a.get(`${r}`));
|
|
25
|
+
return D(i, o);
|
|
26
|
+
}, [t, a, o]), T = f(() => {
|
|
27
|
+
const i = t[n.Hidden].map((r) => a.get(`${r}`));
|
|
28
|
+
return D(i, o);
|
|
29
|
+
}, [t, a, o]), { isSavingColumns: m, saveColumns: x } = U({ pinnedLeftColumnIds: H, pinnedRightColumnIds: I }), A = () => {
|
|
30
|
+
b(""), u({
|
|
31
|
+
[n.Hidden]: c,
|
|
32
|
+
[n.Visible]: d
|
|
33
|
+
});
|
|
34
|
+
}, C = y(
|
|
35
|
+
(i) => {
|
|
36
|
+
if (b(i), !i) {
|
|
37
|
+
const r = /* @__PURE__ */ new Set([...c, ...d]);
|
|
38
|
+
u((S) => ({
|
|
39
|
+
[n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
|
|
40
|
+
[n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
[c, d]
|
|
45
|
+
), G = y(
|
|
46
|
+
(i) => {
|
|
47
|
+
const r = a.get(`${i}`);
|
|
48
|
+
return r ? /* @__PURE__ */ e(Q, { column: r, isDragOverlay: !0 }) : null;
|
|
49
|
+
},
|
|
50
|
+
[a]
|
|
51
|
+
);
|
|
52
|
+
return /* @__PURE__ */ e(
|
|
53
|
+
O,
|
|
54
|
+
{
|
|
55
|
+
variant: "lg",
|
|
56
|
+
style: { overflowY: "hidden" },
|
|
57
|
+
shouldShow: !0,
|
|
58
|
+
onClose: () => l == null ? void 0 : l(),
|
|
59
|
+
headerSlot: /* @__PURE__ */ s(Y, { children: [
|
|
60
|
+
/* @__PURE__ */ s(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
|
|
61
|
+
/* @__PURE__ */ s(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
|
|
62
|
+
/* @__PURE__ */ e(_, { height: v.sizes.lg, width: v.sizes.lg }),
|
|
63
|
+
/* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ e($, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(z, {}) })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ s(p, { variant: "subheadingMedium", children: [
|
|
68
|
+
"Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our",
|
|
69
|
+
" ",
|
|
70
|
+
/* @__PURE__ */ e(B, { href: P.ORDER_VIEWS_AND_TABLE_CUSTOMIZATION, target: "_blank", children: "help guide" }),
|
|
71
|
+
"."
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
j,
|
|
76
|
+
{
|
|
77
|
+
name: "column-search-query",
|
|
78
|
+
placeholder: "Search",
|
|
79
|
+
value: o,
|
|
80
|
+
onChange: C,
|
|
81
|
+
onClearClick: () => C(""),
|
|
82
|
+
fill: "100%"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
leftActions: [
|
|
87
|
+
{
|
|
88
|
+
label: "Reset",
|
|
89
|
+
onClick: A,
|
|
90
|
+
variant: "default",
|
|
91
|
+
disabled: m
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
rightActions: [
|
|
95
|
+
{
|
|
96
|
+
label: "Cancel",
|
|
97
|
+
onClick: l,
|
|
98
|
+
variant: "default",
|
|
99
|
+
disabled: m
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: "Save",
|
|
103
|
+
onClick: () => x({ visibleColumns: t[n.Visible] }),
|
|
104
|
+
variant: "primary",
|
|
105
|
+
disabled: m,
|
|
106
|
+
loading: m
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(N, { items: t, setItems: u, renderDragOverlay: G, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ s(R, { columns: 2, spacing: "xl", children: [
|
|
110
|
+
/* @__PURE__ */ e(V, { id: n.Visible, title: "Shown columns:", columns: M }),
|
|
111
|
+
/* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { children: "Drag & Drop columns" }) }),
|
|
112
|
+
/* @__PURE__ */ e(V, { id: n.Hidden, title: "Hidden columns:", columns: T })
|
|
113
|
+
] }) }) }) }) })
|
|
114
|
+
}
|
|
115
|
+
);
|
|
3
116
|
};
|
|
4
117
|
export {
|
|
5
|
-
|
|
6
|
-
a as default
|
|
118
|
+
te as TableManagementModal
|
|
7
119
|
};
|
package/dist/index93.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@veeqo/ui"),s=require("@dnd-kit/sortable"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@veeqo/ui"),s=require("@dnd-kit/sortable"),a=require("./index111.cjs"),l=require("./index112.cjs"),c=require("./index96.cjs"),u=require("./index97.cjs"),d=require("./index94.cjs"),m=({id:r,title:n,columns:i})=>e.jsxs(o.Stack,{spacing:"sm",alignX:"stretch",children:[e.jsx(d.StickyText,{variant:"bodyBold",children:n}),e.jsx(s.SortableContext,{id:r,items:i,strategy:s.verticalListSortingStrategy,children:e.jsx(l.DroppableArea,{id:r,spacing:"sm",alignX:"stretch",children:i.map(t=>e.jsx(a.SortableItem,{id:t.id,children:e.jsx(c.ColumnItem,{column:t,isHidden:r===u.ColumnGroupIds.Hidden})},t.id))})})]});exports.ColumnGroup=m;
|