@frui.ts/data
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-rc.1
@@ -1,44 +0,44 @@ | ||
function u(n, g, s, o) { | ||
s && (s.offset = n, s.limit = g), o && o(n, g); | ||
function c(n, i, o, s) { | ||
o && (o.offset = n, o.limit = i), s && s(n, i); | ||
} | ||
function t(n, g, s) { | ||
const o = (g == null ? void 0 : g.limit) || 25, d = (n - 1) * o; | ||
u(d, o, g, s); | ||
function t(n, i, o) { | ||
const s = (i == null ? void 0 : i.limit) || 25, d = (n - 1) * s; | ||
c(d, s, i, o); | ||
} | ||
function a(n, g, s) { | ||
return () => t(n, g, s); | ||
function u(n, i, o) { | ||
return () => t(n, i, o); | ||
} | ||
function i(n, g, s) { | ||
u(0, n, g, s); | ||
function r(n, i, o) { | ||
c(0, n, i, o); | ||
} | ||
var e = /* @__PURE__ */ ((n) => (n[n.Ascending = 1] = "Ascending", n[n.Descending = -1] = "Descending", n))(e || {}); | ||
function h(n, g) { | ||
var o, d; | ||
const s = (o = n.sorting) == null ? void 0 : o.findIndex((c) => c.column === g); | ||
if (!(s === void 0 || s < 0)) | ||
return (d = n.sorting) == null ? void 0 : d[s].direction; | ||
var g = /* @__PURE__ */ ((n) => (n[n.Ascending = 1] = "Ascending", n[n.Descending = -1] = "Descending", n))(g || {}); | ||
function a(n, i) { | ||
var s, d; | ||
const o = (s = n.sorting) == null ? void 0 : s.findIndex((e) => e.column === i); | ||
if (!(o === void 0 || o < 0)) | ||
return (d = n.sorting) == null ? void 0 : d[o].direction; | ||
} | ||
function A(n, g, s) { | ||
var c; | ||
const o = (c = n.sorting) != null && c.length ? n.sorting[0] : void 0, d = s != null ? s : (o == null ? void 0 : o.column) === g && o.direction === e.Ascending ? e.Descending : e.Ascending; | ||
n.sorting ? (n.sorting[0] = { column: g, direction: d }, n.sorting.length = 1) : n.sorting = [{ column: g, direction: d }]; | ||
function h(n, i, o) { | ||
var e; | ||
const s = (e = n.sorting) != null && e.length ? n.sorting[0] : void 0, d = o ?? ((s == null ? void 0 : s.column) === i && s.direction === g.Ascending ? g.Descending : g.Ascending); | ||
n.sorting ? (n.sorting[0] = { column: i, direction: d }, n.sorting.length = 1) : n.sorting = [{ column: i, direction: d }]; | ||
} | ||
function x(n, g, s) { | ||
function A(n, i, o) { | ||
if (!n.sorting) { | ||
n.sorting = [{ column: g, direction: s != null ? s : e.Ascending }]; | ||
n.sorting = [{ column: i, direction: o ?? g.Ascending }]; | ||
return; | ||
} | ||
const o = n.sorting.findIndex((d) => d.column === g); | ||
o === -1 ? n.sorting.push({ column: g, direction: s != null ? s : e.Ascending }) : n.sorting[o].direction = s != null ? s : n.sorting[o].direction === e.Ascending ? e.Descending : e.Ascending; | ||
const s = n.sorting.findIndex((d) => d.column === i); | ||
s === -1 ? n.sorting.push({ column: i, direction: o ?? g.Ascending }) : n.sorting[s].direction = o ?? (n.sorting[s].direction === g.Ascending ? g.Descending : g.Ascending); | ||
} | ||
export { | ||
e as SortingDirection, | ||
x as addSort, | ||
h as getSortingDirection, | ||
g as SortingDirection, | ||
A as addSort, | ||
a as getSortingDirection, | ||
t as handlePageChanged, | ||
i as handlePageSizeChanged, | ||
u as handlePagingChanged, | ||
a as pageChangedHandler, | ||
A as setSort | ||
r as handlePageSizeChanged, | ||
c as handlePagingChanged, | ||
u as pageChangedHandler, | ||
h as setSort | ||
}; | ||
//# sourceMappingURL=fruits-data.es.js.map |
@@ -1,2 +0,2 @@ | ||
(function(s,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(s=typeof globalThis<"u"?globalThis:s||self,t(s["fruits-data"]={}))})(this,function(s){"use strict";function a(n,g,e,d){e&&(e.offset=n,e.limit=g),d&&d(n,g)}function c(n,g,e){const d=(g==null?void 0:g.limit)||25,i=(n-1)*d;a(i,d,g,e)}function h(n,g,e){return()=>c(n,g,e)}function f(n,g,e){a(0,n,g,e)}var o=(n=>(n[n.Ascending=1]="Ascending",n[n.Descending=-1]="Descending",n))(o||{});function S(n,g){var d,i;const e=(d=n.sorting)==null?void 0:d.findIndex(u=>u.column===g);if(!(e===void 0||e<0))return(i=n.sorting)==null?void 0:i[e].direction}function A(n,g,e){var u;const d=(u=n.sorting)!=null&&u.length?n.sorting[0]:void 0,i=e!=null?e:(d==null?void 0:d.column)===g&&d.direction===o.Ascending?o.Descending:o.Ascending;n.sorting?(n.sorting[0]={column:g,direction:i},n.sorting.length=1):n.sorting=[{column:g,direction:i}]}function P(n,g,e){if(!n.sorting){n.sorting=[{column:g,direction:e!=null?e:o.Ascending}];return}const d=n.sorting.findIndex(i=>i.column===g);d===-1?n.sorting.push({column:g,direction:e!=null?e:o.Ascending}):n.sorting[d].direction=e!=null?e:n.sorting[d].direction===o.Ascending?o.Descending:o.Ascending}s.SortingDirection=o,s.addSort=P,s.getSortingDirection=S,s.handlePageChanged=c,s.handlePageSizeChanged=f,s.handlePagingChanged=a,s.pageChangedHandler=h,s.setSort=A,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(g,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(g=typeof globalThis<"u"?globalThis:g||self,s(g["fruits-data"]={}))})(this,function(g){"use strict";function a(n,e,i,d){i&&(i.offset=n,i.limit=e),d&&d(n,e)}function u(n,e,i){const d=(e==null?void 0:e.limit)||25,t=(n-1)*d;a(t,d,e,i)}function h(n,e,i){return()=>u(n,e,i)}function r(n,e,i){a(0,n,e,i)}var o=(n=>(n[n.Ascending=1]="Ascending",n[n.Descending=-1]="Descending",n))(o||{});function f(n,e){var d,t;const i=(d=n.sorting)==null?void 0:d.findIndex(c=>c.column===e);if(!(i===void 0||i<0))return(t=n.sorting)==null?void 0:t[i].direction}function S(n,e,i){var c;const d=(c=n.sorting)!=null&&c.length?n.sorting[0]:void 0,t=i??((d==null?void 0:d.column)===e&&d.direction===o.Ascending?o.Descending:o.Ascending);n.sorting?(n.sorting[0]={column:e,direction:t},n.sorting.length=1):n.sorting=[{column:e,direction:t}]}function A(n,e,i){if(!n.sorting){n.sorting=[{column:e,direction:i??o.Ascending}];return}const d=n.sorting.findIndex(t=>t.column===e);d===-1?n.sorting.push({column:e,direction:i??o.Ascending}):n.sorting[d].direction=i??(n.sorting[d].direction===o.Ascending?o.Descending:o.Ascending)}g.SortingDirection=o,g.addSort=A,g.getSortingDirection=f,g.handlePageChanged=u,g.handlePageSizeChanged=r,g.handlePagingChanged=a,g.pageChangedHandler=h,g.setSort=S,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}); | ||
//# sourceMappingURL=fruits-data.umd.js.map |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-rc.1", | ||
"description": "Helpers and interfaces for handling paged and sorted data sets", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "adf52b1d60660fc686182547cca34af079bdecf4" | ||
"gitHead": "c17e77c7246207827d09d34cadbb54b07ebbd82e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
18191