jc-react-datatable 1.0.0
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 +198 -0
- package/dist/jc-react-datatable.es.js +1651 -0
- package/dist/jc-react-datatable.umd.js +51 -0
- package/dist/style.css +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
(function(oe,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],H):(oe=typeof globalThis<"u"?globalThis:oe||self,H(oe.JCReactDatatable={},oe.React))})(this,function(oe,H){"use strict";function mr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xe={exports:{}},ge={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Le;function Er(){if(Le)return ge;Le=1;var r=H,h=Symbol.for("react.element"),b=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,v=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function y(i,d,f){var p,g={},k=null,j=null;f!==void 0&&(k=""+f),d.key!==void 0&&(k=""+d.key),d.ref!==void 0&&(j=d.ref);for(p in d)a.call(d,p)&&!u.hasOwnProperty(p)&&(g[p]=d[p]);if(i&&i.defaultProps)for(p in d=i.defaultProps,d)g[p]===void 0&&(g[p]=d[p]);return{$$typeof:h,type:i,key:k,ref:j,props:g,_owner:v.current}}return ge.Fragment=b,ge.jsx=y,ge.jsxs=y,ge}var me={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ve;function Tr(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){var r=H,h=Symbol.for("react.element"),b=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),i=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),q=Symbol.iterator,$="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var t=q&&e[q]||e[$];return typeof t=="function"?t:null}var V=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function W(e){{for(var t=arguments.length,o=new Array(t>1?t-1:0),m=1;m<t;m++)o[m-1]=arguments[m];U("error",e,o)}}function U(e,t,o){{var m=V.ReactDebugCurrentFrame,F=m.getStackAddendum();F!==""&&(t+="%s",o=o.concat([F]));var Y=o.map(function(I){return String(I)});Y.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,Y)}}var L=!1,c=!1,ne=!1,se=!1,Ee=!1,le;le=Symbol.for("react.module.reference");function Te(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||Ee||e===v||e===f||e===p||se||e===j||L||c||ne||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===g||e.$$typeof===y||e.$$typeof===i||e.$$typeof===d||e.$$typeof===le||e.getModuleId!==void 0))}function de(e,t,o){var m=e.displayName;if(m)return m;var F=t.displayName||t.name||"";return F!==""?o+"("+F+")":o}function pe(e){return e.displayName||"Context"}function X(e){if(e==null)return null;if(typeof e.tag=="number"&&W("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case b:return"Portal";case u:return"Profiler";case v:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case i:var t=e;return pe(t)+".Consumer";case y:var o=e;return pe(o._context)+".Provider";case d:return de(e,e.render,"ForwardRef");case g:var m=e.displayName||null;return m!==null?m:X(e.type)||"Memo";case k:{var F=e,Y=F._payload,I=F._init;try{return X(I(Y))}catch{return null}}}return null}var Z=Object.assign,ie=0,ee,ae,ue,ve,n,l,x;function P(){}P.__reactDisabledLog=!0;function T(){{if(ie===0){ee=console.log,ae=console.info,ue=console.warn,ve=console.error,n=console.group,l=console.groupCollapsed,x=console.groupEnd;var e={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ie++}}function A(){{if(ie--,ie===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Z({},e,{value:ee}),info:Z({},e,{value:ae}),warn:Z({},e,{value:ue}),error:Z({},e,{value:ve}),group:Z({},e,{value:n}),groupCollapsed:Z({},e,{value:l}),groupEnd:Z({},e,{value:x})})}ie<0&&W("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var R=V.ReactCurrentDispatcher,S;function O(e,t,o){{if(S===void 0)try{throw Error()}catch(F){var m=F.stack.trim().match(/\n( *(at )?)/);S=m&&m[1]||""}return`
|
|
18
|
+
`+S+e}}var D=!1,C;{var K=typeof WeakMap=="function"?WeakMap:Map;C=new K}function s(e,t){if(!e||D)return"";{var o=C.get(e);if(o!==void 0)return o}var m;D=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=R.current,R.current=null,T();try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(Q){m=Q}Reflect.construct(e,[],I)}else{try{I.call()}catch(Q){m=Q}e.call(I.prototype)}}else{try{throw Error()}catch(Q){m=Q}e()}}catch(Q){if(Q&&m&&typeof Q.stack=="string"){for(var w=Q.stack.split(`
|
|
19
|
+
`),G=m.stack.split(`
|
|
20
|
+
`),z=w.length-1,J=G.length-1;z>=1&&J>=0&&w[z]!==G[J];)J--;for(;z>=1&&J>=0;z--,J--)if(w[z]!==G[J]){if(z!==1||J!==1)do if(z--,J--,J<0||w[z]!==G[J]){var te=`
|
|
21
|
+
`+w[z].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),typeof e=="function"&&C.set(e,te),te}while(z>=1&&J>=0);break}}}finally{D=!1,R.current=Y,A(),Error.prepareStackTrace=F}var he=e?e.displayName||e.name:"",fe=he?O(he):"";return typeof e=="function"&&C.set(e,fe),fe}function re(e,t,o){return s(e,!1)}function ye(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function ce(e,t,o){if(e==null)return"";if(typeof e=="function")return s(e,ye(e));if(typeof e=="string")return O(e);switch(e){case f:return O("Suspense");case p:return O("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return re(e.render);case g:return ce(e.type,t,o);case k:{var m=e,F=m._payload,Y=m._init;try{return ce(Y(F),t,o)}catch{}}}return""}var Re=Object.prototype.hasOwnProperty,or={},sr=V.ReactDebugCurrentFrame;function Pe(e){if(e){var t=e._owner,o=ce(e.type,e._source,t?t.type:null);sr.setExtraStackFrame(o)}else sr.setExtraStackFrame(null)}function Dr(e,t,o,m,F){{var Y=Function.call.bind(Re);for(var I in e)if(Y(e,I)){var w=void 0;try{if(typeof e[I]!="function"){var G=Error((m||"React class")+": "+o+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw G.name="Invariant Violation",G}w=e[I](t,I,m,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(z){w=z}w&&!(w instanceof Error)&&(Pe(F),W("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",m||"React class",o,I,typeof w),Pe(null)),w instanceof Error&&!(w.message in or)&&(or[w.message]=!0,Pe(F),W("Failed %s type: %s",o,w.message),Pe(null))}}}var Fr=Array.isArray;function Me(e){return Fr(e)}function Mr(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,o=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function Nr(e){try{return ur(e),!1}catch{return!0}}function ur(e){return""+e}function cr(e){if(Nr(e))return W("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Mr(e)),ur(e)}var _e=V.ReactCurrentOwner,Yr={key:!0,ref:!0,__self:!0,__source:!0},fr,lr,Ne;Ne={};function $r(e){if(Re.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function qr(e){if(Re.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Wr(e,t){if(typeof e.ref=="string"&&_e.current&&t&&_e.current.stateNode!==t){var o=X(_e.current.type);Ne[o]||(W('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',X(_e.current.type),e.ref),Ne[o]=!0)}}function Lr(e,t){{var o=function(){fr||(fr=!0,W("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function Vr(e,t){{var o=function(){lr||(lr=!0,W("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var Ur=function(e,t,o,m,F,Y,I){var w={$$typeof:h,type:e,key:t,ref:o,props:I,_owner:Y};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function zr(e,t,o,m,F){{var Y,I={},w=null,G=null;o!==void 0&&(cr(o),w=""+o),qr(t)&&(cr(t.key),w=""+t.key),$r(t)&&(G=t.ref,Wr(t,F));for(Y in t)Re.call(t,Y)&&!Yr.hasOwnProperty(Y)&&(I[Y]=t[Y]);if(e&&e.defaultProps){var z=e.defaultProps;for(Y in z)I[Y]===void 0&&(I[Y]=z[Y])}if(w||G){var J=typeof e=="function"?e.displayName||e.name||"Unknown":e;w&&Lr(I,J),G&&Vr(I,J)}return Ur(e,w,G,F,m,_e.current,I)}}var Ye=V.ReactCurrentOwner,dr=V.ReactDebugCurrentFrame;function be(e){if(e){var t=e._owner,o=ce(e.type,e._source,t?t.type:null);dr.setExtraStackFrame(o)}else dr.setExtraStackFrame(null)}var $e;$e=!1;function qe(e){return typeof e=="object"&&e!==null&&e.$$typeof===h}function pr(){{if(Ye.current){var e=X(Ye.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Br(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),o=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+t+":"+o+"."}return""}}var vr={};function Jr(e){{var t=pr();if(!t){var o=typeof e=="string"?e:e.displayName||e.name;o&&(t=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+o+">.")}return t}}function yr(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Jr(t);if(vr[o])return;vr[o]=!0;var m="";e&&e._owner&&e._owner!==Ye.current&&(m=" It was passed a child from "+X(e._owner.type)+"."),be(e),W('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,m),be(null)}}function br(e,t){{if(typeof e!="object")return;if(Me(e))for(var o=0;o<e.length;o++){var m=e[o];qe(m)&&yr(m,t)}else if(qe(e))e._store&&(e._store.validated=!0);else if(e){var F=B(e);if(typeof F=="function"&&F!==e.entries)for(var Y=F.call(e),I;!(I=Y.next()).done;)qe(I.value)&&yr(I.value,t)}}}function Hr(e){{var t=e.type;if(t==null||typeof t=="string")return;var o;if(typeof t=="function")o=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===d||t.$$typeof===g))o=t.propTypes;else return;if(o){var m=X(t);Dr(o,e.props,"prop",m,e)}else if(t.PropTypes!==void 0&&!$e){$e=!0;var F=X(t);W("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&W("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Kr(e){{for(var t=Object.keys(e.props),o=0;o<t.length;o++){var m=t[o];if(m!=="children"&&m!=="key"){be(e),W("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",m),be(null);break}}e.ref!==null&&(be(e),W("Invalid attribute `ref` supplied to `React.Fragment`."),be(null))}}var hr={};function gr(e,t,o,m,F,Y){{var I=Te(e);if(!I){var w="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var G=Br(F);G?w+=G:w+=pr();var z;e===null?z="null":Me(e)?z="array":e!==void 0&&e.$$typeof===h?(z="<"+(X(e.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):z=typeof e,W("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",z,w)}var J=zr(e,t,o,F,Y);if(J==null)return J;if(I){var te=t.children;if(te!==void 0)if(m)if(Me(te)){for(var he=0;he<te.length;he++)br(te[he],e);Object.freeze&&Object.freeze(te)}else W("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else br(te,e)}if(Re.call(t,"key")){var fe=X(e),Q=Object.keys(t).filter(function(rt){return rt!=="key"}),We=Q.length>0?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}";if(!hr[fe+We]){var et=Q.length>0?"{"+Q.join(": ..., ")+": ...}":"{}";W(`A props object containing a "key" prop is being spread into JSX:
|
|
28
|
+
let props = %s;
|
|
29
|
+
<%s {...props} />
|
|
30
|
+
React keys must be passed directly to JSX without using spread:
|
|
31
|
+
let props = %s;
|
|
32
|
+
<%s key={someKey} {...props} />`,We,fe,et,fe),hr[fe+We]=!0}}return e===a?Kr(J):Hr(J),J}}function Gr(e,t,o){return gr(e,t,o,!0)}function Xr(e,t,o){return gr(e,t,o,!1)}var Zr=Xr,Qr=Gr;me.Fragment=a,me.jsx=Zr,me.jsxs=Qr}()),me}process.env.NODE_ENV==="production"?xe.exports=Er():xe.exports=Tr();var _=xe.exports,Oe={exports:{}},Se={exports:{}},M={};/** @license React v16.13.1
|
|
33
|
+
* react-is.production.min.js
|
|
34
|
+
*
|
|
35
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/var Ue;function Rr(){if(Ue)return M;Ue=1;var r=typeof Symbol=="function"&&Symbol.for,h=r?Symbol.for("react.element"):60103,b=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,v=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,y=r?Symbol.for("react.provider"):60109,i=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,k=r?Symbol.for("react.suspense_list"):60120,j=r?Symbol.for("react.memo"):60115,q=r?Symbol.for("react.lazy"):60116,$=r?Symbol.for("react.block"):60121,B=r?Symbol.for("react.fundamental"):60117,V=r?Symbol.for("react.responder"):60118,W=r?Symbol.for("react.scope"):60119;function U(c){if(typeof c=="object"&&c!==null){var ne=c.$$typeof;switch(ne){case h:switch(c=c.type,c){case d:case f:case a:case u:case v:case g:return c;default:switch(c=c&&c.$$typeof,c){case i:case p:case q:case j:case y:return c;default:return ne}}case b:return ne}}}function L(c){return U(c)===f}return M.AsyncMode=d,M.ConcurrentMode=f,M.ContextConsumer=i,M.ContextProvider=y,M.Element=h,M.ForwardRef=p,M.Fragment=a,M.Lazy=q,M.Memo=j,M.Portal=b,M.Profiler=u,M.StrictMode=v,M.Suspense=g,M.isAsyncMode=function(c){return L(c)||U(c)===d},M.isConcurrentMode=L,M.isContextConsumer=function(c){return U(c)===i},M.isContextProvider=function(c){return U(c)===y},M.isElement=function(c){return typeof c=="object"&&c!==null&&c.$$typeof===h},M.isForwardRef=function(c){return U(c)===p},M.isFragment=function(c){return U(c)===a},M.isLazy=function(c){return U(c)===q},M.isMemo=function(c){return U(c)===j},M.isPortal=function(c){return U(c)===b},M.isProfiler=function(c){return U(c)===u},M.isStrictMode=function(c){return U(c)===v},M.isSuspense=function(c){return U(c)===g},M.isValidElementType=function(c){return typeof c=="string"||typeof c=="function"||c===a||c===f||c===u||c===v||c===g||c===k||typeof c=="object"&&c!==null&&(c.$$typeof===q||c.$$typeof===j||c.$$typeof===y||c.$$typeof===i||c.$$typeof===p||c.$$typeof===B||c.$$typeof===V||c.$$typeof===W||c.$$typeof===$)},M.typeOf=U,M}var N={};/** @license React v16.13.1
|
|
40
|
+
* react-is.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/var ze;function _r(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,h=r?Symbol.for("react.element"):60103,b=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,v=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,y=r?Symbol.for("react.provider"):60109,i=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,k=r?Symbol.for("react.suspense_list"):60120,j=r?Symbol.for("react.memo"):60115,q=r?Symbol.for("react.lazy"):60116,$=r?Symbol.for("react.block"):60121,B=r?Symbol.for("react.fundamental"):60117,V=r?Symbol.for("react.responder"):60118,W=r?Symbol.for("react.scope"):60119;function U(s){return typeof s=="string"||typeof s=="function"||s===a||s===f||s===u||s===v||s===g||s===k||typeof s=="object"&&s!==null&&(s.$$typeof===q||s.$$typeof===j||s.$$typeof===y||s.$$typeof===i||s.$$typeof===p||s.$$typeof===B||s.$$typeof===V||s.$$typeof===W||s.$$typeof===$)}function L(s){if(typeof s=="object"&&s!==null){var re=s.$$typeof;switch(re){case h:var ye=s.type;switch(ye){case d:case f:case a:case u:case v:case g:return ye;default:var ce=ye&&ye.$$typeof;switch(ce){case i:case p:case q:case j:case y:return ce;default:return re}}case b:return re}}}var c=d,ne=f,se=i,Ee=y,le=h,Te=p,de=a,pe=q,X=j,Z=b,ie=u,ee=v,ae=g,ue=!1;function ve(s){return ue||(ue=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),n(s)||L(s)===d}function n(s){return L(s)===f}function l(s){return L(s)===i}function x(s){return L(s)===y}function P(s){return typeof s=="object"&&s!==null&&s.$$typeof===h}function T(s){return L(s)===p}function A(s){return L(s)===a}function R(s){return L(s)===q}function S(s){return L(s)===j}function O(s){return L(s)===b}function D(s){return L(s)===u}function C(s){return L(s)===v}function K(s){return L(s)===g}N.AsyncMode=c,N.ConcurrentMode=ne,N.ContextConsumer=se,N.ContextProvider=Ee,N.Element=le,N.ForwardRef=Te,N.Fragment=de,N.Lazy=pe,N.Memo=X,N.Portal=Z,N.Profiler=ie,N.StrictMode=ee,N.Suspense=ae,N.isAsyncMode=ve,N.isConcurrentMode=n,N.isContextConsumer=l,N.isContextProvider=x,N.isElement=P,N.isForwardRef=T,N.isFragment=A,N.isLazy=R,N.isMemo=S,N.isPortal=O,N.isProfiler=D,N.isStrictMode=C,N.isSuspense=K,N.isValidElementType=U,N.typeOf=L}()),N}var Be;function Je(){return Be||(Be=1,process.env.NODE_ENV==="production"?Se.exports=Rr():Se.exports=_r()),Se.exports}/*
|
|
47
|
+
object-assign
|
|
48
|
+
(c) Sindre Sorhus
|
|
49
|
+
@license MIT
|
|
50
|
+
*/var Ce,He;function Sr(){if(He)return Ce;He=1;var r=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;function a(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function v(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var y={},i=0;i<10;i++)y["_"+String.fromCharCode(i)]=i;var d=Object.getOwnPropertyNames(y).map(function(p){return y[p]});if(d.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(p){f[p]=p}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ce=v()?Object.assign:function(u,y){for(var i,d=a(u),f,p=1;p<arguments.length;p++){i=Object(arguments[p]);for(var g in i)h.call(i,g)&&(d[g]=i[g]);if(r){f=r(i);for(var k=0;k<f.length;k++)b.call(i,f[k])&&(d[f[k]]=i[f[k]])}}return d},Ce}var we,Ke;function ke(){if(Ke)return we;Ke=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return we=r,we}var Ae,Ge;function Xe(){return Ge||(Ge=1,Ae=Function.call.bind(Object.prototype.hasOwnProperty)),Ae}var Ie,Ze;function jr(){if(Ze)return Ie;Ze=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var h=ke(),b={},a=Xe();r=function(u){var y="Warning: "+u;typeof console<"u"&&console.error(y);try{throw new Error(y)}catch{}}}function v(u,y,i,d,f){if(process.env.NODE_ENV!=="production"){for(var p in u)if(a(u,p)){var g;try{if(typeof u[p]!="function"){var k=Error((d||"React class")+": "+i+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k.name="Invariant Violation",k}g=u[p](y,p,d,i,null,h)}catch(q){g=q}if(g&&!(g instanceof Error)&&r((d||"React class")+": type specification of "+i+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in b)){b[g.message]=!0;var j=f?f():"";r("Failed "+i+" type: "+g.message+(j??""))}}}}return v.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(b={})},Ie=v,Ie}var De,Qe;function Pr(){if(Qe)return De;Qe=1;var r=Je(),h=Sr(),b=ke(),a=Xe(),v=jr(),u=function(){};process.env.NODE_ENV!=="production"&&(u=function(i){var d="Warning: "+i;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function y(){return null}return De=function(i,d){var f=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function g(n){var l=n&&(f&&n[f]||n[p]);if(typeof l=="function")return l}var k="<<anonymous>>",j={array:V("array"),bigint:V("bigint"),bool:V("boolean"),func:V("function"),number:V("number"),object:V("object"),string:V("string"),symbol:V("symbol"),any:W(),arrayOf:U,element:L(),elementType:c(),instanceOf:ne,node:Te(),objectOf:Ee,oneOf:se,oneOfType:le,shape:pe,exact:X};function q(n,l){return n===l?n!==0||1/n===1/l:n!==n&&l!==l}function $(n,l){this.message=n,this.data=l&&typeof l=="object"?l:{},this.stack=""}$.prototype=Error.prototype;function B(n){if(process.env.NODE_ENV!=="production")var l={},x=0;function P(A,R,S,O,D,C,K){if(O=O||k,C=C||S,K!==b){if(d){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var re=O+":"+S;!l[re]&&x<3&&(u("You are manually calling a React.PropTypes validation function for the `"+C+"` prop on `"+O+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),l[re]=!0,x++)}}return R[S]==null?A?R[S]===null?new $("The "+D+" `"+C+"` is marked as required "+("in `"+O+"`, but its value is `null`.")):new $("The "+D+" `"+C+"` is marked as required in "+("`"+O+"`, but its value is `undefined`.")):null:n(R,S,O,D,C)}var T=P.bind(null,!1);return T.isRequired=P.bind(null,!0),T}function V(n){function l(x,P,T,A,R,S){var O=x[P],D=ee(O);if(D!==n){var C=ae(O);return new $("Invalid "+A+" `"+R+"` of type "+("`"+C+"` supplied to `"+T+"`, expected ")+("`"+n+"`."),{expectedType:n})}return null}return B(l)}function W(){return B(y)}function U(n){function l(x,P,T,A,R){if(typeof n!="function")return new $("Property `"+R+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var S=x[P];if(!Array.isArray(S)){var O=ee(S);return new $("Invalid "+A+" `"+R+"` of type "+("`"+O+"` supplied to `"+T+"`, expected an array."))}for(var D=0;D<S.length;D++){var C=n(S,D,T,A,R+"["+D+"]",b);if(C instanceof Error)return C}return null}return B(l)}function L(){function n(l,x,P,T,A){var R=l[x];if(!i(R)){var S=ee(R);return new $("Invalid "+T+" `"+A+"` of type "+("`"+S+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return B(n)}function c(){function n(l,x,P,T,A){var R=l[x];if(!r.isValidElementType(R)){var S=ee(R);return new $("Invalid "+T+" `"+A+"` of type "+("`"+S+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return B(n)}function ne(n){function l(x,P,T,A,R){if(!(x[P]instanceof n)){var S=n.name||k,O=ve(x[P]);return new $("Invalid "+A+" `"+R+"` of type "+("`"+O+"` supplied to `"+T+"`, expected ")+("instance of `"+S+"`."))}return null}return B(l)}function se(n){if(!Array.isArray(n))return process.env.NODE_ENV!=="production"&&(arguments.length>1?u("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):u("Invalid argument supplied to oneOf, expected an array.")),y;function l(x,P,T,A,R){for(var S=x[P],O=0;O<n.length;O++)if(q(S,n[O]))return null;var D=JSON.stringify(n,function(K,s){var re=ae(s);return re==="symbol"?String(s):s});return new $("Invalid "+A+" `"+R+"` of value `"+String(S)+"` "+("supplied to `"+T+"`, expected one of "+D+"."))}return B(l)}function Ee(n){function l(x,P,T,A,R){if(typeof n!="function")return new $("Property `"+R+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var S=x[P],O=ee(S);if(O!=="object")return new $("Invalid "+A+" `"+R+"` of type "+("`"+O+"` supplied to `"+T+"`, expected an object."));for(var D in S)if(a(S,D)){var C=n(S,D,T,A,R+"."+D,b);if(C instanceof Error)return C}return null}return B(l)}function le(n){if(!Array.isArray(n))return process.env.NODE_ENV!=="production"&&u("Invalid argument supplied to oneOfType, expected an instance of array."),y;for(var l=0;l<n.length;l++){var x=n[l];if(typeof x!="function")return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ue(x)+" at index "+l+"."),y}function P(T,A,R,S,O){for(var D=[],C=0;C<n.length;C++){var K=n[C],s=K(T,A,R,S,O,b);if(s==null)return null;s.data&&a(s.data,"expectedType")&&D.push(s.data.expectedType)}var re=D.length>0?", expected one of type ["+D.join(", ")+"]":"";return new $("Invalid "+S+" `"+O+"` supplied to "+("`"+R+"`"+re+"."))}return B(P)}function Te(){function n(l,x,P,T,A){return Z(l[x])?null:new $("Invalid "+T+" `"+A+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return B(n)}function de(n,l,x,P,T){return new $((n||"React class")+": "+l+" type `"+x+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function pe(n){function l(x,P,T,A,R){var S=x[P],O=ee(S);if(O!=="object")return new $("Invalid "+A+" `"+R+"` of type `"+O+"` "+("supplied to `"+T+"`, expected `object`."));for(var D in n){var C=n[D];if(typeof C!="function")return de(T,A,R,D,ae(C));var K=C(S,D,T,A,R+"."+D,b);if(K)return K}return null}return B(l)}function X(n){function l(x,P,T,A,R){var S=x[P],O=ee(S);if(O!=="object")return new $("Invalid "+A+" `"+R+"` of type `"+O+"` "+("supplied to `"+T+"`, expected `object`."));var D=h({},x[P],n);for(var C in D){var K=n[C];if(a(n,C)&&typeof K!="function")return de(T,A,R,C,ae(K));if(!K)return new $("Invalid "+A+" `"+R+"` key `"+C+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(x[P],null," ")+`
|
|
51
|
+
Valid keys: `+JSON.stringify(Object.keys(n),null," "));var s=K(S,C,T,A,R+"."+C,b);if(s)return s}return null}return B(l)}function Z(n){switch(typeof n){case"number":case"string":case"undefined":return!0;case"boolean":return!n;case"object":if(Array.isArray(n))return n.every(Z);if(n===null||i(n))return!0;var l=g(n);if(l){var x=l.call(n),P;if(l!==n.entries){for(;!(P=x.next()).done;)if(!Z(P.value))return!1}else for(;!(P=x.next()).done;){var T=P.value;if(T&&!Z(T[1]))return!1}}else return!1;return!0;default:return!1}}function ie(n,l){return n==="symbol"?!0:l?l["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&l instanceof Symbol:!1}function ee(n){var l=typeof n;return Array.isArray(n)?"array":n instanceof RegExp?"object":ie(l,n)?"symbol":l}function ae(n){if(typeof n>"u"||n===null)return""+n;var l=ee(n);if(l==="object"){if(n instanceof Date)return"date";if(n instanceof RegExp)return"regexp"}return l}function ue(n){var l=ae(n);switch(l){case"array":case"object":return"an "+l;case"boolean":case"date":case"regexp":return"a "+l;default:return l}}function ve(n){return!n.constructor||!n.constructor.name?k:n.constructor.name}return j.checkPropTypes=v,j.resetWarningCache=v.resetWarningCache,j.PropTypes=j,j},De}var Fe,er;function xr(){if(er)return Fe;er=1;var r=ke();function h(){}function b(){}return b.resetWarningCache=h,Fe=function(){function a(y,i,d,f,p,g){if(g!==r){var k=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw k.name="Invariant Violation",k}}a.isRequired=a;function v(){return a}var u={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:v,element:a,elementType:a,instanceOf:v,node:a,objectOf:v,oneOf:v,oneOfType:v,shape:v,exact:v,checkPropTypes:b,resetWarningCache:h};return u.PropTypes=u,u},Fe}if(process.env.NODE_ENV!=="production"){var Or=Je(),Cr=!0;Oe.exports=Pr()(Or.isElement,Cr)}else Oe.exports=xr()();var wr=Oe.exports;const E=mr(wr),tt="",rr=({column:r,filterValue:h,setFilter:b,onClose:a})=>{const[v,u]=H.useState(h||"");return H.useEffect(()=>{const y=setTimeout(()=>{b(r.key,v)},300);return()=>{clearTimeout(y)}},[v,r.key,b]),r.searchable?_.jsxs("div",{className:"jc-datatable-filter",children:[_.jsx("input",{autoFocus:!0,type:"text",placeholder:`Search ${r.header}...`,value:v,onChange:y=>u(y.target.value),className:"jc-datatable-filter-input","aria-label":`Filter by ${r.header}`}),_.jsx("button",{className:"jc-datatable-filter-close",onClick:a,"aria-label":"Close filter",children:"×"})]}):null};rr.propTypes={column:E.object.isRequired,filterValue:E.any,setFilter:E.func.isRequired,onClose:E.func.isRequired};const tr=({columns:r,sortConfig:h,requestSort:b,filters:a,setFilter:v})=>{const[u,y]=H.useState(null),i=(f,p)=>{f.stopPropagation(),y(u===p?null:p)},d=f=>!h||h.key!==f.key?_.jsx("span",{className:"jc-datatable-sort-icon",children:"↕"}):h.direction==="asc"?_.jsx("span",{className:"jc-datatable-sort-icon active",children:"↑"}):_.jsx("span",{className:"jc-datatable-sort-icon active",children:"↓"});return _.jsx("thead",{className:"jc-datatable-thead",children:_.jsx("tr",{children:r.map((f,p)=>{const g=p===r.length-1,k=p===0;let j="jc-datatable-filter-popover";return g&&(j+=" right-aligned"),k&&(j+=" left-aligned"),_.jsxs("th",{className:`jc-datatable-th ${f.sortable?"sortable":""}`,style:{width:f.width},onClick:()=>f.sortable&&b(f.key),children:[_.jsxs("div",{className:"jc-datatable-th-content",children:[_.jsx("span",{children:f.header}),f.sortable&&d(f),f.searchable&&_.jsx("button",{className:`jc-datatable-filter-trigger ${a[f.key]?"active":""}`,onClick:q=>i(q,f.key),"aria-label":`Filter ${f.header}`,children:_.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",children:_.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})})})]}),u===f.key&&_.jsx("div",{className:j,onClick:q=>q.stopPropagation(),children:_.jsx(rr,{column:f,filterValue:a[f.key],setFilter:v,onClose:()=>y(null)})})]},f.key)})})})};tr.propTypes={columns:E.array.isRequired,sortConfig:E.shape({key:E.string,direction:E.oneOf(["asc","desc"])}),requestSort:E.func.isRequired,filters:E.object.isRequired,setFilter:E.func.isRequired};function je(r,h,b=void 0){if(!h||!r)return b;const a=h.split(".").reduce((v,u)=>v&&v[u]!==void 0?v[u]:void 0,r);return a!==void 0?a:b}const nr=({data:r,columns:h,loading:b,onRowClick:a,noDataText:v})=>b?_.jsx("tbody",{className:"jc-datatable-tbody",children:_.jsx("tr",{children:_.jsxs("td",{colSpan:h.length,className:"jc-datatable-loading-cell",children:[_.jsx("div",{className:"jc-datatable-spinner"}),"Loading..."]})})}):!r||r.length===0?_.jsx("tbody",{className:"jc-datatable-tbody",children:_.jsx("tr",{children:_.jsx("td",{colSpan:h.length,className:"jc-datatable-empty-cell",children:v||"No records found"})})}):_.jsx("tbody",{className:"jc-datatable-tbody",children:r.map((u,y)=>_.jsx("tr",{className:`jc-datatable-tr ${a?"clickable":""}`,onClick:()=>a&&a(u),children:h.map(i=>_.jsx("td",{className:"jc-datatable-td","data-label":i.header,children:i.render?i.render(u,y):je(u,i.key)},`${u.id||y}-${i.key}`))},u.id||y))});nr.propTypes={data:E.array.isRequired,columns:E.array.isRequired,loading:E.bool,onRowClick:E.func,noDataText:E.string};const ar=({currentPage:r,totalPages:h,pageSize:b,setPageSize:a,nextPage:v,prevPage:u,totalItems:y,pageSizeOptions:i=[5,10,20,50]})=>_.jsxs("div",{className:"jc-datatable-pagination",children:[_.jsxs("div",{className:"jc-datatable-pagination-info",children:["Showing ",(r-1)*b+1," to ",Math.min(r*b,y)," of ",y," entries"]}),_.jsxs("div",{className:"jc-datatable-pagination-controls",children:[_.jsx("select",{value:b,onChange:d=>a(Number(d.target.value)),className:"jc-datatable-page-size-select","aria-label":"Select page size",children:i.map(d=>_.jsxs("option",{value:d,children:[d," / page"]},d))}),_.jsx("button",{onClick:u,disabled:r===1,className:"jc-datatable-pagination-btn","aria-label":"Previous page",children:"Previous"}),_.jsxs("span",{className:"jc-datatable-pagination-pages",children:["Page ",r," of ",h]}),_.jsx("button",{onClick:v,disabled:r===h,className:"jc-datatable-pagination-btn","aria-label":"Next page",children:"Next"})]})]});ar.propTypes={currentPage:E.number.isRequired,totalPages:E.number.isRequired,pageSize:E.number.isRequired,setPageSize:E.func.isRequired,nextPage:E.func.isRequired,prevPage:E.func.isRequired,totalItems:E.number.isRequired,pageSizeOptions:E.arrayOf(E.number)};const kr=(r,h,b=null)=>{const[a,v]=H.useState(b),u=i=>{let d="asc";a&&a.key===i&&a.direction==="asc"&&(d="desc"),v({key:i,direction:d})};return{sortedData:H.useMemo(()=>{if(!a)return r;const i=h.find(f=>f.key===a.key);return i?[...r].sort((f,p)=>{if(i.sortFn)return a.direction==="asc"?i.sortFn(f,p):i.sortFn(p,f);const g=je(f,i.key),k=je(p,i.key);return g<k?a.direction==="asc"?-1:1:g>k?a.direction==="asc"?1:-1:0}):r},[r,a,h]),sortConfig:a,requestSort:u}},Ar=(r,h)=>{const[b,a]=H.useState({}),v=(y,i)=>{a(d=>({...d,[y]:i}))};return{filteredData:H.useMemo(()=>r.filter(y=>Object.keys(b).every(i=>{const d=b[i];if(!d)return!0;const f=h.find(g=>g.key===i);if(!f)return!0;const p=je(y,i);return f.filterFn?f.filterFn(p,d,y):String(p||"").toLowerCase().includes(String(d).toLowerCase())})),[r,b,h]),filters:b,setFilter:v}},Ir=(r,h=!0,b=10)=>{const[a,v]=H.useState(1),[u,y]=H.useState(b);H.useEffect(()=>{v(1)},[r.length,u]);const i=r.length,d=h?Math.ceil(i/u):1;return{paginatedData:H.useMemo(()=>{if(!h)return r;const j=(a-1)*u;return r.slice(j,j+u)},[r,a,u,h]),currentPage:a,totalPages:d,pageSize:u,totalItems:i,setPage:j=>{const q=Math.max(1,Math.min(j,d));v(q)},setPageSize:y,nextPage:()=>{a<d&&v(j=>j+1)},prevPage:()=>{a>1&&v(j=>j-1)}}},ir=({columns:r,data:h,loading:b=!1,pagination:a=!0,pageSizeOptions:v=[5,10,20,50],defaultPageSize:u=10,onRowClick:y,noDataText:i="No records found",className:d="",maxHeight:f})=>{const{filteredData:p,filters:g,setFilter:k}=Ar(h,r),{sortedData:j,sortConfig:q,requestSort:$}=kr(p,r),{paginatedData:B,currentPage:V,totalPages:W,pageSize:U,setPageSize:L,nextPage:c,prevPage:ne,totalItems:se}=Ir(j,a,u);return _.jsxs("div",{className:`jc-datatable-wrapper ${d||""}`,children:[_.jsx("div",{className:"jc-datatable-container",style:f?{maxHeight:f,overflowY:"auto"}:{},children:_.jsxs("table",{className:"jc-datatable-table",children:[_.jsx(tr,{columns:r,sortConfig:q,requestSort:$,filters:g,setFilter:k}),_.jsx(nr,{data:a?B:j,columns:r,loading:b,onRowClick:y,noDataText:i})]})}),a&&!b&&h.length>0&&_.jsx(ar,{currentPage:V,totalPages:W,pageSize:U,setPageSize:L,nextPage:c,prevPage:ne,totalItems:se,pageSizeOptions:v})]})};ir.propTypes={columns:E.arrayOf(E.shape({key:E.string.isRequired,header:E.string.isRequired,width:E.string,sortable:E.bool,searchable:E.bool,render:E.func,sortFn:E.func,filterFn:E.func})).isRequired,data:E.array.isRequired,loading:E.bool,pagination:E.bool,pageSizeOptions:E.arrayOf(E.number),defaultPageSize:E.number,onRowClick:E.func,noDataText:E.string,className:E.string,maxHeight:E.string},oe.DataTable=ir,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.jc-datatable-wrapper{width:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#333;box-shadow:0 4px 12px #0000000d;border-radius:8px;background-color:#fff;overflow:hidden}.jc-datatable-container{overflow-x:auto;min-height:200px}.jc-datatable-table{width:100%;border-collapse:collapse;border-spacing:0}.jc-datatable-thead{background-color:#f8fafc}.jc-datatable-th{padding:16px;text-align:left;font-weight:600;font-size:14px;color:#64748b;border-bottom:2px solid #e2e8f0;vertical-align:top;position:relative;white-space:nowrap;position:sticky;top:0;z-index:5;background-color:#f8fafc}.jc-datatable-th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .2s}.jc-datatable-th.sortable:hover{background-color:#f1f5f9}.jc-datatable-th-content{display:flex;align-items:center;gap:8px}.jc-datatable-sort-icon{font-size:12px;color:#cbd5e1}.jc-datatable-sort-icon.active{color:#3b82f6;font-weight:700}.jc-datatable-filter-trigger{background:none;border:none;cursor:pointer;color:#cbd5e1;padding:4px;border-radius:4px;display:flex;align-items:center;transition:all .2s}.jc-datatable-filter-trigger:hover,.jc-datatable-filter-trigger.active{color:#3b82f6;background-color:#e0f2fe}.jc-datatable-filter-popover{position:absolute;top:100%;left:0;z-index:10;background:white;padding:8px;border-radius:6px;box-shadow:0 4px 14px #0000001a;border:1px solid #e2e8f0;width:220px;margin-top:4px}.jc-datatable-filter-popover.right-aligned{left:auto;right:0}.jc-datatable-filter{display:flex;gap:4px;align-items:center}.jc-datatable-filter-input{width:100%;padding:8px 10px;border:1px solid #e2e8f0;border-radius:4px;font-size:13px;transition:border-color .2s}.jc-datatable-filter-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f61a}.jc-datatable-filter-close{background:none;border:none;font-size:18px;color:#94a3b8;cursor:pointer}.jc-datatable-filter-close:hover{color:#ef4444}.jc-datatable-tbody{background-color:#fff}.jc-datatable-tr{border-bottom:1px solid #f1f5f9;transition:background-color .2s}.jc-datatable-tr:last-child{border-bottom:none}.jc-datatable-tr:hover{background-color:#f8fafc}.jc-datatable-tr.clickable{cursor:pointer}.jc-datatable-tr.clickable:hover{background-color:#eff6ff}.jc-datatable-td{padding:14px 16px;font-size:14px;color:#334155;vertical-align:middle}.jc-datatable-loading-cell,.jc-datatable-empty-cell{text-align:center;padding:48px;color:#64748b}.jc-datatable-spinner{border:3px solid #f1f5f9;border-radius:50%;border-top:3px solid #3b82f6;width:28px;height:28px;animation:spin .8s linear infinite;margin:0 auto 16px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.jc-datatable-pagination{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-top:1px solid #e2e8f0;background-color:#f8fafc;flex-wrap:wrap;gap:16px}.jc-datatable-pagination-info{font-size:13px;color:#64748b;font-weight:500}.jc-datatable-pagination-controls{display:flex;align-items:center;gap:12px}.jc-datatable-page-size-select{padding:6px 10px;border:1px solid #cbd5e1;border-radius:4px;font-size:13px;color:#475569;cursor:pointer}.jc-datatable-pagination-btn{padding:6px 14px;border:1px solid #cbd5e1;background-color:#fff;border-radius:4px;font-size:13px;cursor:pointer;transition:all .2s;color:#475569;font-weight:500}.jc-datatable-pagination-btn:disabled{opacity:.5;cursor:not-allowed;background-color:#f1f5f9}.jc-datatable-pagination-btn:not(:disabled):hover{background-color:#fff;border-color:#3b82f6;color:#3b82f6}.jc-datatable-pagination-pages{font-size:13px;color:#475569}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jc-react-datatable",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/jc-react-datatable.umd.js",
|
|
7
|
+
"module": "./dist/jc-react-datatable.es.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/jc-react-datatable.es.js",
|
|
11
|
+
"require": "./dist/jc-react-datatable.umd.js"
|
|
12
|
+
},
|
|
13
|
+
"./style.css": "./dist/style.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "vite build",
|
|
21
|
+
"preview": "vite preview"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": ">=17",
|
|
25
|
+
"react-dom": ">=17"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
29
|
+
"prop-types": "^15.8.1",
|
|
30
|
+
"react": "^18.0.0",
|
|
31
|
+
"react-dom": "^18.0.0",
|
|
32
|
+
"vite": "^4.3.0"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"react",
|
|
36
|
+
"datatable",
|
|
37
|
+
"table",
|
|
38
|
+
"grid",
|
|
39
|
+
"data-grid",
|
|
40
|
+
"sort",
|
|
41
|
+
"filter",
|
|
42
|
+
"pagination"
|
|
43
|
+
],
|
|
44
|
+
"author": "",
|
|
45
|
+
"license": "MIT"
|
|
46
|
+
}
|