naria-ui 0.1.39 → 0.1.41
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/naria-ui.cjs.js +7 -7
- package/dist/naria-ui.es.js +32 -32
- package/package.json +1 -1
package/dist/naria-ui.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var K;function ce(){if(K)return U;K=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function o(d,c,
|
|
9
|
+
*/var K;function ce(){if(K)return U;K=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function o(d,c,u){var p=null;if(u!==void 0&&(p=""+u),c.key!==void 0&&(p=""+c.key),"key"in c){u={};for(var g in c)g!=="key"&&(u[g]=c[g])}else u=c;return c=u.ref,{$$typeof:t,type:d,key:p,ref:c!==void 0?c:null,props:u}}return U.Fragment=a,U.jsx=o,U.jsxs=o,U}var H={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ee;function ie(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===b?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case A:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case _:return"SuspenseList";case C:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case y:return"Portal";case W:return(e.displayName||"Context")+".Provider";case G:return(e._context.displayName||"Context")+".Consumer";case
|
|
17
|
+
*/var ee;function ie(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===b?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case A:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case _:return"SuspenseList";case C:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case y:return"Portal";case W:return(e.displayName||"Context")+".Provider";case G:return(e._context.displayName||"Context")+".Consumer";case f:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case Y:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function a(e){return""+e}function o(e){try{a(e);var n=!1}catch{n=!0}if(n){n=console;var r=n.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),a(e)}}function d(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===Y)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function c(){var e=P.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function p(e){if(x.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function g(e,n){function r(){D||(D=!0,console.error("%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://react.dev/link/special-props)",n))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}function E(){var e=t(this.type);return $[e]||($[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function h(e,n,r,l,w,j,X,Z){return r=j.ref,e={$$typeof:L,type:e,key:n,props:j,_owner:w},(r!==void 0?r:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:E}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,n,r,l,w,j,X,Z){var m=n.children;if(m!==void 0)if(l)if(q(m)){for(l=0;l<m.length;l++)v(m[l]);Object.freeze&&Object.freeze(m)}else console.error("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 v(m);if(x.call(n,"key")){m=t(e);var I=Object.keys(n).filter(function(ae){return ae!=="key"});l=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",J[m+l]||(I=0<I.length?"{"+I.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,l,m,I,m),J[m+l]=!0)}if(m=null,r!==void 0&&(o(r),m=""+r),p(n)&&(o(n.key),m=""+n.key),"key"in n){r={};for(var Q in n)Q!=="key"&&(r[Q]=n[Q])}else r=n;return m&&g(r,typeof e=="function"?e.displayName||e.name||"Unknown":e),h(e,m,j,w,c(),r,X,Z)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===L&&e._store&&(e._store.validated=1)}var R=i,L=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),W=Symbol.for("react.context"),
|
|
23
|
-
${o&&"!text-danger-100"}`,children:[s.jsx("span",{className:"",children:d}),v?s.jsxs("div",{className:"nariaSearchInput",children:[s.jsx("input",{ref:k,placeholder:g?.length?g:"Select",className:`${
|
|
24
|
-
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,value:Y,disabled:E,type:"text",onClick:$,onChange:n}),S?s.jsx(ne,{className:"nariaSearchIcon"}):s.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]}):s.jsxs("button",{type:"button",ref:k,disabled:E,className:`nariaHandler ${
|
|
25
|
-
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,onClick:$,children:[
|
|
26
|
-
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,value:Y,disabled:E,type:"text",onChange:n}),s.jsx(ne,{className:"nariaSearchIcon"})]}):void 0,s.jsx("div",{className:`nariaList ${y<768?"nariaList-mobile":"nariaList-desktop"}`,onScroll:e,children:
|
|
22
|
+
<%s key={someKey} {...props} />`,l,m,I,m),J[m+l]=!0)}if(m=null,r!==void 0&&(o(r),m=""+r),p(n)&&(o(n.key),m=""+n.key),"key"in n){r={};for(var Q in n)Q!=="key"&&(r[Q]=n[Q])}else r=n;return m&&g(r,typeof e=="function"?e.displayName||e.name||"Unknown":e),h(e,m,j,w,c(),r,X,Z)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===L&&e._store&&(e._store.validated=1)}var R=i,L=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),W=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),b=Symbol.for("react.client.reference"),P=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.prototype.hasOwnProperty,q=Array.isArray,k=console.createTask?console.createTask:function(){return null};R={"react-stack-bottom-frame":function(e){return e()}};var D,$={},F=R["react-stack-bottom-frame"].bind(R,u)(),B=k(d(u)),J={};H.Fragment=O,H.jsx=function(e,n,r,l,w){var j=1e4>P.recentlyCreatedOwnerStacks++;return N(e,n,r,!1,l,w,j?Error("react-stack-top-frame"):F,j?k(d(e)):B)},H.jsxs=function(e,n,r,l,w){var j=1e4>P.recentlyCreatedOwnerStacks++;return N(e,n,r,!0,l,w,j?Error("react-stack-top-frame"):F,j?k(d(e)):B)}}()),H}var re;function le(){return re||(re=1,process.env.NODE_ENV==="production"?V.exports=ce():V.exports=ie()),V.exports}var s=le();const ue=({type:t="button",value:a})=>s.jsx("button",{type:t,children:a}),fe=({type:t="text",placeholder:a,wrapperClass:o="",labelClass:d="",inputClass:c="",errorClass:u="",label:p,hasError:g,register:E,name:h,isDisabled:N=!1,autocomplete:v=!1,...R})=>s.jsxs("div",{className:o,children:[s.jsxs("label",{htmlFor:h,className:`${d} ${g&&"error"}`,children:[p,s.jsx("input",{disabled:N,autoComplete:v?"on":"off",id:h,...E,...R,type:t,name:h,className:`${c} ${g&&"error"} ${u}`,placeholder:a})]}),g&&s.jsx("p",{className:u,children:g})]}),te=t=>z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},z.createElement("path",{fill:"currentColor",d:"M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z"})),de=t=>z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},z.createElement("path",{fill:"currentColor",d:"M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z"})),ne=t=>z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",...t},z.createElement("path",{fill:"currentColor",d:"M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})),ge=()=>{const[t,a]=i.useState(typeof window<"u"?window.innerWidth:0),o=()=>a(typeof window<"u"?window.innerWidth:0);return i.useEffect(()=>(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[t]),t},se=({classNames:t={wrapper:"",color:""}})=>s.jsxs("svg",{className:`nariaLoading ${t.wrapper}`,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round",className:t.color})]}),me=()=>{const t=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",t)},he=t=>{window.location.hash=t},pe=t=>{const[a,o]=i.useState(!1);return i.useEffect(()=>{const d=c=>{window.location.hash!==t?o(!0):o(!1)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d)}},[]),a},we=(t,a,o)=>{i.useEffect(()=>{function d(c){a.current&&!a.current.contains(c.target)&&t?.current&&!t?.current.contains(c.target)&&o()}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[t,o])},ve=({options:t,label:a,hasError:o,title:d,value:c,api:u,selected:p,placeholder:g,disabled:E=!1,pagination:h,optionFilterLabel:N,hasSearch:v=!1,onSelectChange:R})=>{let L=!0;const y=ge(),O=pe("#select"),[S,A]=i.useState(!1),[G,W]=i.useState(!0),[f,M]=i.useState(null),[_,T]=i.useState(null),[Y,C]=i.useState(""),[b,P]=i.useState({page:1,pageLabel:"page",size:20,sizeLabel:"size",isLoading:!1}),x=i.useRef(void 0),q=i.useRef(void 0),k=i.useRef(void 0),D=async()=>{if(x?.current)try{const r=await fetch(x?.current);if(!r.ok)throw new Error(`Response status: ${r.status}`);return await r.json()}catch(r){console.error(r.message)}};i.useEffect(()=>()=>{L=!1},[]),i.useEffect(()=>{if(u?.length){if(x.current=u,x.current.includes(h?.pageLabel||"page")){const r=new URL(u);r.searchParams.set(h?.pageLabel||"page",(h?.page||b.page).toString()),r.searchParams.set(h?.sizeLabel||"size",(h?.size||b.size).toString()),x.current=r.href}W(!0),D().then(r=>{L&&(W(!1),T(r))})}},[u,h]),i.useEffect(()=>{if(b.isLoading){if(x.current.includes(h?.pageLabel||"page")){const r=new URL(x.current);r.searchParams.set(h?.pageLabel||"page",b.page.toString()),x.current=r.href}D().then(r=>{L&&(W(!1),P({...b,isLoading:!1}),T([..._,...r]))})}},[b]),i.useEffect(()=>{y<768&&(S?(he("select"),document.body.style.overflow="hidden",k.current?.focus()):(window.location.hash&&!document.referrer.includes("#")&&me(),document.body.style.overflow="auto"))},[S]),i.useEffect(()=>{p&&t?.length&&(t?.find(r=>r[a]===p)?M(t?.find(r=>r[a]===p)):M(p))},[p]),i.useEffect(()=>{f&&v&&(c?.length&&_?.find(r=>r[a]===f[a])?C(_?.find(r=>r[a]===f[a])[c]||""):C(f))},[f]),i.useEffect(()=>{O&&A(!1)},[O]),i.useEffect(()=>{t?.length&&T(t)},[t]);const $=()=>{v&&T(t),A(r=>!r)},F=()=>{v&&(T(t),C(typeof f=="string"?f:f?f[c]:"")),A(!1)},B=r=>{v&&(c?.length?C(r[c]):C(r)),M(r),$(),R&&R(r)},J=r=>{if(!f)return"";if(a?.length&&r[a]===f[a]||r===f)return"bg-grey-100"},e=r=>{u?.length&&_?.length&&!b.isLoading&&r.target.offsetHeight+r.target.scrollTop>=r.target.scrollHeight-100&&P({page:b.page+1,isLoading:!0})},n=r=>{const l=r?.target?.value?.length?t.filter(w=>typeof w=="object"?w[N?.length?N:c].includes(r?.target?.value):w.includes(r?.target?.value)):t;T(l),C(r?.target?.value),S||A(!0)};return we(q,k,F),s.jsxs("div",{className:`nariaSelect ${E?"nariaSelect-disabled":""}`,children:[s.jsxs("label",{className:`cursor-pointer
|
|
23
|
+
${o&&"!text-danger-100"}`,children:[s.jsx("span",{className:"",children:d}),v?s.jsxs("div",{className:"nariaSearchInput",children:[s.jsx("input",{ref:k,placeholder:g?.length?g:"Select",className:`${f?"text-dark-100":"text-grey-300"}
|
|
24
|
+
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,value:Y,disabled:E,type:"text",onClick:$,onChange:n}),S?s.jsx(ne,{className:"nariaSearchIcon"}):s.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]}):s.jsxs("button",{type:"button",ref:k,disabled:E,className:`nariaHandler ${f?"text-dark-100":"text-grey-300"}
|
|
25
|
+
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,onClick:$,children:[f?c?.length?f[c]:f:g?.length?g:"Select"," ",s.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]})]}),S?s.jsxs("div",{className:`nariaListWrapper ${y<768?"nariaListWrapper-mobile":""}`,ref:q,children:[v&&y<768?s.jsxs("div",{className:"nariaSearchInput",children:[s.jsx("input",{ref:k,placeholder:g?.length?g:"Select",className:`${f?"text-dark-100":"text-grey-300"}
|
|
26
|
+
${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"}`,value:Y,disabled:E,type:"text",onChange:n}),s.jsx(ne,{className:"nariaSearchIcon"})]}):void 0,s.jsx("div",{className:`nariaList ${y<768?"nariaList-mobile":"nariaList-desktop"}`,onScroll:e,children:u&&G?s.jsx("div",{className:"nariaLoadingWrapper",children:s.jsx(se,{})}):s.jsxs(s.Fragment,{children:[y<768?s.jsx("div",{className:"sticky top-0 text-left",children:s.jsx("button",{className:"p-3",onClick:F,disabled:E,children:s.jsx(de,{className:"w-6"})})}):void 0,_?.length?s.jsx(s.Fragment,{children:_?.map((r,l)=>s.jsx("button",{type:"button",onClick:()=>B(r),disabled:E,className:`text-right py-2.5 px-4 text-base hover:bg-grey-100 rounded-lg ${J(r)}`,children:c?.length?r[c]:r},l.toString()))}):s.jsx("div",{children:"No Data"}),b.isLoading?s.jsx("div",{className:"nariaLoadingMoreWrapper",children:s.jsx(se,{})}):void 0]})})]}):void 0,o&&s.jsx("p",{className:"text-xs mt-1 text-danger-100",children:o})]})};function be(t){return t.charAt(0).toUpperCase()+t.slice(1)}exports.Button=ue;exports.Input=fe;exports.Select=ve;exports.capitalize=be;
|
package/dist/naria-ui.es.js
CHANGED
|
@@ -15,19 +15,19 @@ function le() {
|
|
|
15
15
|
if (re) return H;
|
|
16
16
|
re = 1;
|
|
17
17
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
18
|
-
function c(g, o,
|
|
18
|
+
function c(g, o, l) {
|
|
19
19
|
var h = null;
|
|
20
|
-
if (
|
|
21
|
-
|
|
20
|
+
if (l !== void 0 && (h = "" + l), o.key !== void 0 && (h = "" + o.key), "key" in o) {
|
|
21
|
+
l = {};
|
|
22
22
|
for (var d in o)
|
|
23
|
-
d !== "key" && (
|
|
24
|
-
} else
|
|
25
|
-
return o =
|
|
23
|
+
d !== "key" && (l[d] = o[d]);
|
|
24
|
+
} else l = o;
|
|
25
|
+
return o = l.ref, {
|
|
26
26
|
$$typeof: t,
|
|
27
27
|
type: g,
|
|
28
28
|
key: h,
|
|
29
29
|
ref: o !== void 0 ? o : null,
|
|
30
|
-
props:
|
|
30
|
+
props: l
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
return H.Fragment = s, H.jsx = c, H.jsxs = c, H;
|
|
@@ -74,7 +74,7 @@ function ue() {
|
|
|
74
74
|
return (e.displayName || "Context") + ".Provider";
|
|
75
75
|
case X:
|
|
76
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
-
case
|
|
77
|
+
case u:
|
|
78
78
|
var n = e.render;
|
|
79
79
|
return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
80
|
case T:
|
|
@@ -123,7 +123,7 @@ function ue() {
|
|
|
123
123
|
var e = $.A;
|
|
124
124
|
return e === null ? null : e.getOwner();
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function l() {
|
|
127
127
|
return Error("react-stack-top-frame");
|
|
128
128
|
}
|
|
129
129
|
function h(e) {
|
|
@@ -236,7 +236,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
236
|
function w(e) {
|
|
237
237
|
typeof e == "object" && e !== null && e.$$typeof === A && e._store && (e._store.validated = 1);
|
|
238
238
|
}
|
|
239
|
-
var j = ie, A = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), Y = Symbol.for("react.context"),
|
|
239
|
+
var j = ie, A = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), Y = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), k = Symbol.for("react.activity"), v = Symbol.for("react.client.reference"), $ = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, q = Array.isArray, _ = console.createTask ? console.createTask : function() {
|
|
240
240
|
return null;
|
|
241
241
|
};
|
|
242
242
|
j = {
|
|
@@ -246,8 +246,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
};
|
|
247
247
|
var F, I = {}, U = j["react-stack-bottom-frame"].bind(
|
|
248
248
|
j,
|
|
249
|
-
|
|
250
|
-
)(), B = _(g(
|
|
249
|
+
l
|
|
250
|
+
)(), B = _(g(l)), V = {};
|
|
251
251
|
J.Fragment = O, J.jsx = function(e, n, r, i, p) {
|
|
252
252
|
var R = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
253
253
|
return L(
|
|
@@ -286,7 +286,7 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
286
286
|
wrapperClass: c = "",
|
|
287
287
|
labelClass: g = "",
|
|
288
288
|
inputClass: o = "",
|
|
289
|
-
errorClass:
|
|
289
|
+
errorClass: l = "",
|
|
290
290
|
label: h,
|
|
291
291
|
hasError: d,
|
|
292
292
|
register: E,
|
|
@@ -312,14 +312,14 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
312
312
|
...j,
|
|
313
313
|
type: t,
|
|
314
314
|
name: m,
|
|
315
|
-
className: `${o} ${d && "error"} ${
|
|
315
|
+
className: `${o} ${d && "error"} ${l}`,
|
|
316
316
|
placeholder: s
|
|
317
317
|
}
|
|
318
318
|
)
|
|
319
319
|
]
|
|
320
320
|
}
|
|
321
321
|
),
|
|
322
|
-
d && /* @__PURE__ */ a.jsx("p", { className:
|
|
322
|
+
d && /* @__PURE__ */ a.jsx("p", { className: l, children: d })
|
|
323
323
|
] }), ae = (t) => /* @__PURE__ */ W.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ W.createElement("path", { fill: "currentColor", d: "M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z" })), fe = (t) => /* @__PURE__ */ W.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ W.createElement("path", { fill: "currentColor", d: "M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z" })), oe = (t) => /* @__PURE__ */ W.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", fill: "currentColor", ...t }, /* @__PURE__ */ W.createElement("path", { fill: "currentColor", d: "M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z" })), ge = () => {
|
|
324
324
|
const [t, s] = N(typeof window < "u" ? window.innerWidth : 0), c = () => s(typeof window < "u" ? window.innerWidth : 0);
|
|
325
325
|
return b(() => (window.addEventListener("resize", c), () => window.removeEventListener("resize", c)), [t]), t;
|
|
@@ -389,7 +389,7 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
389
389
|
hasError: c,
|
|
390
390
|
title: g,
|
|
391
391
|
value: o,
|
|
392
|
-
api:
|
|
392
|
+
api: l,
|
|
393
393
|
selected: h,
|
|
394
394
|
placeholder: d,
|
|
395
395
|
disabled: E = !1,
|
|
@@ -399,7 +399,7 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
399
399
|
onSelectChange: j
|
|
400
400
|
}) => {
|
|
401
401
|
let A = !0;
|
|
402
|
-
const y = ge(), O = pe("#select"), [C, P] = N(!1), [X, Y] = N(!0), [
|
|
402
|
+
const y = ge(), O = pe("#select"), [C, P] = N(!1), [X, Y] = N(!0), [u, M] = N(null), [S, T] = N(null), [D, k] = N(""), [v, $] = N({
|
|
403
403
|
page: 1,
|
|
404
404
|
pageLabel: "page",
|
|
405
405
|
size: 20,
|
|
@@ -419,16 +419,16 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
419
419
|
b(() => () => {
|
|
420
420
|
A = !1;
|
|
421
421
|
}, []), b(() => {
|
|
422
|
-
if (
|
|
423
|
-
if (x.current =
|
|
424
|
-
const r = new URL(
|
|
422
|
+
if (l?.length) {
|
|
423
|
+
if (x.current = l, x.current.includes(m?.pageLabel || "page")) {
|
|
424
|
+
const r = new URL(l);
|
|
425
425
|
r.searchParams.set(m?.pageLabel || "page", (m?.page || v.page).toString()), r.searchParams.set(m?.sizeLabel || "size", (m?.size || v.size).toString()), x.current = r.href;
|
|
426
426
|
}
|
|
427
427
|
Y(!0), F().then((r) => {
|
|
428
428
|
A && (Y(!1), T(r));
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
|
-
}, [
|
|
431
|
+
}, [l, m]), b(() => {
|
|
432
432
|
if (v.isLoading) {
|
|
433
433
|
if (x.current.includes(m?.pageLabel || "page")) {
|
|
434
434
|
const r = new URL(x.current);
|
|
@@ -449,8 +449,8 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
449
449
|
}, [C]), b(() => {
|
|
450
450
|
h && t?.length && (t?.find((r) => r[s] === h) ? M(t?.find((r) => r[s] === h)) : M(h));
|
|
451
451
|
}, [h]), b(() => {
|
|
452
|
-
|
|
453
|
-
}, [
|
|
452
|
+
u && w && (o?.length && S?.find((r) => r[s] === u[s]) ? k(S?.find((r) => r[s] === u[s])[o] || "") : k(u));
|
|
453
|
+
}, [u]), b(() => {
|
|
454
454
|
O && P(!1);
|
|
455
455
|
}, [O]), b(() => {
|
|
456
456
|
t?.length && T(t);
|
|
@@ -458,16 +458,16 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
458
458
|
const I = () => {
|
|
459
459
|
w && T(t), P((r) => !r);
|
|
460
460
|
}, U = () => {
|
|
461
|
-
w && (T(t), k(typeof
|
|
461
|
+
w && (T(t), k(typeof u == "string" ? u : u ? u[o] : "")), P(!1);
|
|
462
462
|
}, B = (r) => {
|
|
463
463
|
w && (o?.length ? k(r[o]) : k(r)), M(r), I(), j && j(r);
|
|
464
464
|
}, V = (r) => {
|
|
465
|
-
if (!
|
|
465
|
+
if (!u)
|
|
466
466
|
return "";
|
|
467
|
-
if (s?.length && r[s] ===
|
|
467
|
+
if (s?.length && r[s] === u[s] || r === u)
|
|
468
468
|
return "bg-grey-100";
|
|
469
469
|
}, e = (r) => {
|
|
470
|
-
S?.length && !v.isLoading && r.target.offsetHeight + r.target.scrollTop >= r.target.scrollHeight - 100 && $({
|
|
470
|
+
l?.length && S?.length && !v.isLoading && r.target.offsetHeight + r.target.scrollTop >= r.target.scrollHeight - 100 && $({
|
|
471
471
|
page: v.page + 1,
|
|
472
472
|
isLoading: !0
|
|
473
473
|
});
|
|
@@ -489,7 +489,7 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
489
489
|
{
|
|
490
490
|
ref: _,
|
|
491
491
|
placeholder: d?.length ? d : "Select",
|
|
492
|
-
className: `${
|
|
492
|
+
className: `${u ? "text-dark-100" : "text-grey-300"}
|
|
493
493
|
${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
|
|
494
494
|
value: D,
|
|
495
495
|
disabled: E,
|
|
@@ -515,11 +515,11 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
515
515
|
type: "button",
|
|
516
516
|
ref: _,
|
|
517
517
|
disabled: E,
|
|
518
|
-
className: `nariaHandler ${
|
|
518
|
+
className: `nariaHandler ${u ? "text-dark-100" : "text-grey-300"}
|
|
519
519
|
${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
|
|
520
520
|
onClick: I,
|
|
521
521
|
children: [
|
|
522
|
-
|
|
522
|
+
u ? o?.length ? u[o] : u : d?.length ? d : "Select",
|
|
523
523
|
" ",
|
|
524
524
|
/* @__PURE__ */ a.jsx(
|
|
525
525
|
ae,
|
|
@@ -545,7 +545,7 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
545
545
|
{
|
|
546
546
|
ref: _,
|
|
547
547
|
placeholder: d?.length ? d : "Select",
|
|
548
|
-
className: `${
|
|
548
|
+
className: `${u ? "text-dark-100" : "text-grey-300"}
|
|
549
549
|
${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
|
|
550
550
|
value: D,
|
|
551
551
|
disabled: E,
|
|
@@ -565,7 +565,7 @@ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button",
|
|
|
565
565
|
{
|
|
566
566
|
className: `nariaList ${y < 768 ? "nariaList-mobile" : "nariaList-desktop"}`,
|
|
567
567
|
onScroll: e,
|
|
568
|
-
children:
|
|
568
|
+
children: l && X ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingWrapper", children: /* @__PURE__ */ a.jsx(se, {}) }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
569
569
|
y < 768 ? /* @__PURE__ */ a.jsx("div", { className: "sticky top-0 text-left", children: /* @__PURE__ */ a.jsx("button", { className: "p-3", onClick: U, disabled: E, children: /* @__PURE__ */ a.jsx(fe, { className: "w-6" }) }) }) : void 0,
|
|
570
570
|
S?.length ? /* @__PURE__ */ a.jsx(a.Fragment, { children: S?.map((r, i) => /* @__PURE__ */ a.jsx(
|
|
571
571
|
"button",
|