simple-table-core 1.7.2 → 1.7.3
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/{Animate-652be003.js → Animate-b0aa4700.js} +2 -2
- package/dist/Animate-b0aa4700.js.map +1 -0
- package/dist/{DatePicker-302960f9.js → DatePicker-4a94b0cc.js} +2 -2
- package/dist/DatePicker-4a94b0cc.js.map +1 -0
- package/dist/cjs/{Animate-ca0431cb.js → Animate-4e38eac4.js} +2 -2
- package/dist/cjs/Animate-4e38eac4.js.map +1 -0
- package/dist/cjs/{DatePicker-106e00e9.js → DatePicker-845e2188.js} +2 -2
- package/dist/cjs/DatePicker-845e2188.js.map +1 -0
- package/dist/cjs/{index-20423ac1.js → index-6295f627.js} +2 -2
- package/dist/cjs/index-6295f627.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/{index-4f66177b.js → index-78da65b3.js} +2 -2
- package/dist/index-78da65b3.js.map +1 -0
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
- package/dist/Animate-652be003.js.map +0 -1
- package/dist/DatePicker-302960f9.js.map +0 -1
- package/dist/cjs/Animate-ca0431cb.js.map +0 -1
- package/dist/cjs/DatePicker-106e00e9.js.map +0 -1
- package/dist/cjs/index-20423ac1.js.map +0 -1
- package/dist/index-4f66177b.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as n,u as i,a as t,b as o,A as e,c as a,f as r,B as l}from"./index-
|
|
2
|
-
//# sourceMappingURL=Animate-
|
|
1
|
+
import{_ as n,u as i,a as t,b as o,A as e,c as a,f as r,B as l}from"./index-78da65b3.js";import{jsx as d}from"react/jsx-runtime";import{useRef as u,useLayoutEffect as v}from"react";var f=function(f){var s=f.children,m=f.id,p=f.parentRef,h=f.tableRow,M=n(f,["children","id","parentRef","tableRow"]),Y=i(),c=Y.allowAnimations,C=Y.isResizing,g=Y.isScrolling,b=Y.rowHeight,x=u(null),B=u(null),j=t(g),A=t(C);return v(function(){var n,i,t,d;if(c&&x.current&&!C){var u=x.current.getBoundingClientRect(),v=B.current;if(!g)if(!j||g)if(!A||C){if(B.current=u,v){var f=u.x-v.x,s=u.y-v.y;if((Math.abs(f)>=50||Math.abs(s)>5)&&(Math.abs(f)>5||Math.abs(s)>5)){var m=o(o({},e.ROW_REORDER),{onComplete:function(){x.current&&(x.current.style.zIndex="",x.current.style.position="",x.current.style.top="")}}),M=null===(n=null==p?void 0:p.current)||void 0===n?void 0:n.scrollTop,Y=null===(i=null==p?void 0:p.current)||void 0===i?void 0:i.clientHeight,R=null===(t=null==p?void 0:p.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==M&&void 0!==Y&&void 0!==R){var w=l*b,_=M-w,k=M+Y+w,q=v.y>_&&k>v.y,y=u.y>_&&k>u.y,z=M>u.y,D=null!==(d=null==h?void 0:h.position)&&void 0!==d?d:0,E=.6*b,F=function(n,i,t){return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,Math.min(Math.abs(n-i),Math.abs(n-t))))))};if(q&&!y&&u.y>M+Y){var G=F(u.y,M,M+Y);return void a({element:x.current,options:{startY:v.y,endY:M+Y+G+D%15*E*2.5+D%7*.4*b,finalY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}if(q&&!y&&z)return G=F(u.y,M,M+Y),void a({element:x.current,options:{startY:v.y,endY:M-G-D%15*E*2.5-D%7*.4*b,finalY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!q&&y&&v.y>M+Y)return G=F(v.y,M,M+Y),void a({element:x.current,options:{startY:M+Y+G+D%10*E*1,endY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!q&&y&&M>v.y)return G=F(v.y,M,M+Y),void a({element:x.current,options:{startY:M-G-D%10*E*1,endY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}r({element:x.current,fromBounds:v,toBounds:u,finalConfig:m})}}}else B.current=u;else B.current=u}},[c,C,g,p,j,A,b,null==h?void 0:h.position,h]),d("div",o({ref:x,"data-animate-id":m,id:m+""},M,{children:s}))};f.displayName="Animate";export{f as Animate,f as default};
|
|
2
|
+
//# sourceMappingURL=Animate-b0aa4700.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-b0aa4700.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e,b as n}from"./index-
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
import{u as e,b as n}from"./index-78da65b3.js";import{jsxs as t,Fragment as a,jsx as r}from"react/jsx-runtime";import{useState as c}from"react";var i=function(i){var d,o,s=i.onChange,l=i.onClose,u=i.value,f=e(),h=f.nextIcon,m=f.prevIcon,v=c(u||new Date),k=v[0],p=v[1],w=c("days"),y=w[0],D=w[1],N=function(e,n){return new Date(e,n+1,0).getDate()};return t("div",n({className:"st-datepicker"},{children:[t("div",n({className:"st-datepicker-header"},{children:["days"===y&&t(a,{children:[r("button",n({onClick:function(){p(new Date(k.getFullYear(),k.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:m})),t("div",n({className:"st-datepicker-header-label",onClick:function(){return D("months")}},{children:[(o=k,o.toLocaleString("default",{month:"long"}))," ",k.getFullYear()]})),r("button",n({onClick:function(){p(new Date(k.getFullYear(),k.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:h}))]}),"months"===y&&r("div",n({className:"st-datepicker-header-label",onClick:function(){return D("years")}},{children:k.getFullYear()})),"years"===y&&r("div",n({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),t("div",n({className:"st-datepicker-grid st-datepicker-".concat(y,"-grid")},{children:["days"===y&&function(){var e=[],t=k.getFullYear(),a=k.getMonth(),c=N(t,a),i=function(e,n){return new Date(e,n,1).getDay()}(t,a),d=N(t,a-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,a){e.push(r("div",n({className:"st-datepicker-weekday"},{children:t}),"header-".concat(a)))});for(var o=function(t){var a=d-i+t+1;e.push(r("div",n({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(k.getFullYear(),k.getMonth()-1,e,12,0,0);p(n),s(n),null==l||l()}(a)}},{children:a}),"prev-".concat(a)))},f=0;i>f;f++)o(f);for(var h=function(c){var i=c===(new Date).getDate()&&a===(new Date).getMonth()&&t===(new Date).getFullYear(),d=new Date(u),o=c===d.getDate()&&a===d.getMonth()&&t===d.getFullYear();e.push(r("div",n({className:"st-datepicker-day ".concat(i?"today":""," ").concat(o?"selected":""),onClick:function(){return function(e){var n=k.getFullYear(),t=k.getMonth(),a=new Date(n,t,e,12,0,0);p(a),s(a),null==l||l()}(c)}},{children:c}),"day-".concat(c)))},m=1;c>=m;m++)h(m);var v=35-(i+c),w=function(t){e.push(r("div",n({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(k.getFullYear(),k.getMonth()+1,e,12,0,0);p(n),s(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;v>=m;m++)w(m);return e}(),"months"===y&&(d=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(e,t){var a=t===k.getMonth();d.push(r("div",n({className:"st-datepicker-month ".concat(a?"selected":""),onClick:function(){return function(e){p(new Date(k.getFullYear(),e,1)),D("days")}(t)}},{children:e}),"month-".concat(t)))}),d),"years"===y&&function(){for(var e=[],t=k.getFullYear(),a=t-6,c=function(a){e.push(r("div",n({className:"st-datepicker-year ".concat(a===t?"selected":""),onClick:function(){return function(e){p(new Date(e,k.getMonth(),1)),D("months")}(a)}},{children:a}),"year-".concat(a)))},i=a;a+12>i;i++)c(i);return e}()]})),r("div",n({className:"st-datepicker-footer"},{children:r("button",n({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);p(n),s(n),null==l||l()}},{children:"Today"}))}))]}))};export{i as default};
|
|
2
|
+
//# sourceMappingURL=DatePicker-4a94b0cc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-4a94b0cc.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
2
|
-
//# sourceMappingURL=Animate-
|
|
1
|
+
"use strict";var e=require("./index-6295f627.js"),i=require("react/jsx-runtime"),n=require("react"),t=function(t){var o=t.children,r=t.id,a=t.parentRef,l=t.tableRow,d=e.__rest(t,["children","id","parentRef","tableRow"]),u=e.useTableContext(),v=u.allowAnimations,f=u.isResizing,s=u.isScrolling,m=u.rowHeight,h=n.useRef(null),p=n.useRef(null),M=e.usePrevious(s),Y=e.usePrevious(f);return n.useLayoutEffect(function(){var i,n,t,o;if(v&&h.current&&!f){var r=h.current.getBoundingClientRect(),d=p.current;if(!s)if(!M||s)if(!Y||f){if(p.current=r,d){var u=r.x-d.x,c=r.y-d.y;if((Math.abs(u)>=50||Math.abs(c)>5)&&(Math.abs(u)>5||Math.abs(c)>5)){var C=e.__assign(e.__assign({},e.ANIMATION_CONFIGS.ROW_REORDER),{onComplete:function(){h.current&&(h.current.style.zIndex="",h.current.style.position="",h.current.style.top="")}}),g=null===(i=null==a?void 0:a.current)||void 0===i?void 0:i.scrollTop,x=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,q=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==g&&void 0!==x&&void 0!==q){var j=e.BUFFER_ROW_COUNT*m,B=g-j,R=g+x+j,b=d.y>B&&R>d.y,w=r.y>B&&R>r.y,A=g>r.y,k=null!==(o=null==l?void 0:l.position)&&void 0!==o?o:0,y=.6*m,z=function(e,i,n){return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,Math.min(Math.abs(e-i),Math.abs(e-n))))))};if(b&&!w&&r.y>g+x){var D=z(r.y,g,g+x);return void e.animateWithCustomCoordinates({element:h.current,options:{startY:d.y,endY:g+x+D+k%15*y*2.5+k%7*.4*m,finalY:r.y,duration:C.duration,easing:C.easing,onComplete:C.onComplete}})}if(b&&!w&&A)return D=z(r.y,g,g+x),void e.animateWithCustomCoordinates({element:h.current,options:{startY:d.y,endY:g-D-k%15*y*2.5-k%7*.4*m,finalY:r.y,duration:C.duration,easing:C.easing,onComplete:C.onComplete}});if(!b&&w&&d.y>g+x)return D=z(d.y,g,g+x),void e.animateWithCustomCoordinates({element:h.current,options:{startY:g+x+D+k%10*y*1,endY:r.y,duration:C.duration,easing:C.easing,onComplete:C.onComplete}});if(!b&&w&&g>d.y)return D=z(d.y,g,g+x),void e.animateWithCustomCoordinates({element:h.current,options:{startY:g-D-k%10*y*1,endY:r.y,duration:C.duration,easing:C.easing,onComplete:C.onComplete}})}e.flipElement({element:h.current,fromBounds:d,toBounds:r,finalConfig:C})}}}else p.current=r;else p.current=r}},[v,f,s,a,M,Y,m,null==l?void 0:l.position,l]),i.jsx("div",e.__assign({ref:h,"data-animate-id":r,id:r+""},d,{children:o}))};t.displayName="Animate",exports.Animate=t,exports.default=t;
|
|
2
|
+
//# sourceMappingURL=Animate-4e38eac4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-4e38eac4.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
"use strict";var e=require("./index-6295f627.js"),n=require("react/jsx-runtime"),t=require("react");exports.default=function(a){var r,c,i=a.onChange,d=a.onClose,s=a.value,l=e.useTableContext(),o=l.nextIcon,u=l.prevIcon,h=t.useState(s||new Date),f=h[0],v=h[1],k=t.useState("days"),m=k[0],p=k[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return n.jsxs("div",e.__assign({className:"st-datepicker"},{children:[n.jsxs("div",e.__assign({className:"st-datepicker-header"},{children:["days"===m&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:u})),n.jsxs("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return p("months")}},{children:[(c=f,c.toLocaleString("default",{month:"long"}))," ",f.getFullYear()]})),n.jsx("button",e.__assign({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:o}))]}),"months"===m&&n.jsx("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return p("years")}},{children:f.getFullYear()})),"years"===m&&n.jsx("div",e.__assign({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n.jsxs("div",e.__assign({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var t=[],a=f.getFullYear(),r=f.getMonth(),c=w(a,r),l=function(e,n){return new Date(e,n,1).getDay()}(a,r),o=w(a,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(a,r){t.push(n.jsx("div",e.__assign({className:"st-datepicker-weekday"},{children:a}),"header-".concat(r)))});for(var u=function(a){var r=o-l+a+1;t.push(n.jsx("div",e.__assign({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()-1,e,12,0,0);v(n),i(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},h=0;l>h;h++)u(h);for(var k=function(c){var l=c===(new Date).getDate()&&r===(new Date).getMonth()&&a===(new Date).getFullYear(),o=new Date(s),u=c===o.getDate()&&r===o.getMonth()&&a===o.getFullYear();t.push(n.jsx("div",e.__assign({className:"st-datepicker-day ".concat(l?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=f.getFullYear(),t=f.getMonth(),a=new Date(n,t,e,12,0,0);v(a),i(a),null==d||d()}(c)}},{children:c}),"day-".concat(c)))},m=1;c>=m;m++)k(m);var p=35-(l+c),y=function(a){t.push(n.jsx("div",e.__assign({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()+1,e,12,0,0);v(n),i(n),null==d||d()}(a)}},{children:a}),"next-".concat(a)))};for(m=1;p>=m;m++)y(m);return t}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(t,a){var c=a===f.getMonth();r.push(n.jsx("div",e.__assign({className:"st-datepicker-month ".concat(c?"selected":""),onClick:function(){return function(e){v(new Date(f.getFullYear(),e,1)),p("days")}(a)}},{children:t}),"month-".concat(a)))}),r),"years"===m&&function(){for(var t=[],a=f.getFullYear(),r=a-6,c=function(r){t.push(n.jsx("div",e.__assign({className:"st-datepicker-year ".concat(r===a?"selected":""),onClick:function(){return function(e){v(new Date(e,f.getMonth(),1)),p("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;r+12>i;i++)c(i);return t}()]})),n.jsx("div",e.__assign({className:"st-datepicker-footer"},{children:n.jsx("button",e.__assign({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);v(n),i(n),null==d||d()}},{children:"Today"}))}))]}))};
|
|
2
|
+
//# sourceMappingURL=DatePicker-845e2188.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-845e2188.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|