@dgshahr/ui-kit 0.0.71 → 0.0.72
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/Accordion/AccordionGroup.d.ts +2 -1
- package/dist/Accordion/AccordionGroup.d.ts.map +1 -1
- package/dist/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/Accordion/context.d.ts +1 -1
- package/dist/Accordion/context.d.ts.map +1 -1
- package/dist/Accordion/index.cjs +1 -1
- package/dist/Accordion/index.js +1 -1
- package/dist/AccordionItem-249c_E9c.js +85 -0
- package/dist/AccordionItem-U3jVG5e6.cjs +1 -0
- package/dist/Form/Select/Options.d.ts +1 -5
- package/dist/Form/Select/Options.d.ts.map +1 -1
- package/dist/Form/Select/index.cjs +1 -1
- package/dist/Form/Select/index.d.ts.map +1 -1
- package/dist/Form/Select/index.js +218 -203
- package/dist/Form/Select/types.d.ts +2 -23
- package/dist/Form/Select/types.d.ts.map +1 -1
- package/dist/Form/Wrappers/PickerWrapper/PickerWrapper.d.ts +5 -0
- package/dist/Form/Wrappers/PickerWrapper/PickerWrapper.d.ts.map +1 -0
- package/dist/Form/Wrappers/PickerWrapper/contexts.d.ts +7 -0
- package/dist/Form/Wrappers/PickerWrapper/contexts.d.ts.map +1 -0
- package/dist/Form/Wrappers/PickerWrapper/type.d.ts +30 -0
- package/dist/Form/Wrappers/PickerWrapper/type.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/AccordionItem-D6fa9S1H.cjs +0 -1
- package/dist/AccordionItem-DVi9UM43.js +0 -76
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
interface AccordionGroupProps {
|
|
3
|
-
defaultActiveKey?: string;
|
|
3
|
+
defaultActiveKey?: string | string[];
|
|
4
4
|
className?: string;
|
|
5
|
+
disableAccordion?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const AccordionGroup: FC<PropsWithChildren<AccordionGroupProps>>;
|
|
7
8
|
export default AccordionGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionGroup.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/AccordionGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,UAAU,mBAAmB;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AccordionGroup.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/AccordionGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,UAAU,mBAAmB;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAcD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAkB9D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/AccordionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9D,UAAU,kBAAkB;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/AccordionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9D,UAAU,kBAAkB;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CA0D5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/context.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/context.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED,eAAO,MAAM,gBAAgB,4CAG3B,CAAC;AAEH,eAAO,MAAM,gBAAgB,yBAAqC,CAAC"}
|
package/dist/Accordion/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const o=require("../AccordionItem-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const o=require("../AccordionItem-U3jVG5e6.cjs");exports.AccordionGroup=o.AccordionGroup;exports.AccordionItem=o.AccordionItem;
|
package/dist/Accordion/index.js
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s, jsxs as k } from "react/jsx-runtime";
|
|
3
|
+
import { c as d } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
import { createContext as p, useContext as x, useState as v, useId as w } from "react";
|
|
5
|
+
import { A } from "./ArrowDown2-CMeKw_vj.js";
|
|
6
|
+
import N from "./Divider/index.js";
|
|
7
|
+
const m = p({
|
|
8
|
+
activeKey: null,
|
|
9
|
+
setActiveKey: () => {
|
|
10
|
+
}
|
|
11
|
+
}), I = () => x(m);
|
|
12
|
+
function b(i, e = !1) {
|
|
13
|
+
if (!i) return e ? [] : null;
|
|
14
|
+
const o = Array.isArray(i);
|
|
15
|
+
return e ? o ? i : [i] : o ? i[0] : i;
|
|
16
|
+
}
|
|
17
|
+
const S = (i) => {
|
|
18
|
+
const { defaultActiveKey: e, className: o, children: a, disableAccordion: u } = i, [l, t] = v(
|
|
19
|
+
b(e, u)
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ s("div", { className: d("dgs-ui-kit-flex dgs-ui-kit-flex-col", o), children: /* @__PURE__ */ s(
|
|
22
|
+
m.Provider,
|
|
23
|
+
{
|
|
24
|
+
value: {
|
|
25
|
+
activeKey: l,
|
|
26
|
+
setActiveKey: t
|
|
27
|
+
},
|
|
28
|
+
children: a
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
}, G = (i) => {
|
|
32
|
+
const { children: e, title: o, accordionKey: a, className: u, contentClassName: l } = i, { activeKey: t, setActiveKey: c } = I(), f = w(), r = a ?? f, g = Array.isArray(t), n = g ? t.includes(r) : r === t;
|
|
33
|
+
function h() {
|
|
34
|
+
c(n ? g ? t.filter((y) => y !== r) : null : g ? [...t, r] : r);
|
|
35
|
+
}
|
|
36
|
+
return /* @__PURE__ */ k("div", { className: d("dgs-ui-kit-bg-white dgs-ui-kit-px-4 dgs-ui-kit-pt-4", u), children: [
|
|
37
|
+
/* @__PURE__ */ k(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
className: d(
|
|
41
|
+
"dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center dgs-ui-kit-w-full",
|
|
42
|
+
n ? "dgs-ui-kit-text-primary-500" : "dgs-ui-kit-text-gray-600"
|
|
43
|
+
),
|
|
44
|
+
onClick: h,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ s("div", { className: n ? "dgs-ui-kit-font-h5-bold" : "dgs-ui-kit-font-p1-medium", children: o }),
|
|
47
|
+
/* @__PURE__ */ s(
|
|
48
|
+
A,
|
|
49
|
+
{
|
|
50
|
+
className: d(
|
|
51
|
+
"dgs-ui-kit-transition dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out dgs-ui-kit-shrink-0 dgs-ui-kit-w-auto dgs-ui-kit-h-auto",
|
|
52
|
+
n && "dgs-ui-kit-rotate-180"
|
|
53
|
+
),
|
|
54
|
+
width: 20,
|
|
55
|
+
height: 20
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ s(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: d(
|
|
65
|
+
"dgs-ui-kit-grid dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-600 dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out",
|
|
66
|
+
n ? "dgs-ui-kit-grid-rows-[1fr] dgs-ui-kit-opacity-100 dgs-ui-kit-mt-3" : "dgs-ui-kit-grid-rows-[0fr] dgs-ui-kit-opacity-0",
|
|
67
|
+
l
|
|
68
|
+
),
|
|
69
|
+
children: /* @__PURE__ */ s("div", { className: "dgs-ui-kit-overflow-hidden", children: e })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ s(
|
|
73
|
+
N,
|
|
74
|
+
{
|
|
75
|
+
type: "horizontal",
|
|
76
|
+
color: "white",
|
|
77
|
+
className: "dgs-ui-kit-mt-4"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
S as A,
|
|
84
|
+
G as a
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./clsx-C11secjj.cjs"),u=require("react"),y=require("./ArrowDown2-O11Hxz6e.cjs"),w=require("./Divider/index.cjs"),x=u.createContext({activeKey:null,setActiveKey:()=>{}}),v=()=>u.useContext(x);function A(i,e=!1){if(!i)return e?[]:null;const r=Array.isArray(i);return e?r?i:[i]:r?i[0]:i}const j=i=>{const{defaultActiveKey:e,className:r,children:a,disableAccordion:l}=i,[g,s]=u.useState(A(e,l));return t.jsx("div",{className:n.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-col",r),children:t.jsx(x.Provider,{value:{activeKey:g,setActiveKey:s},children:a})})},N=i=>{const{children:e,title:r,accordionKey:a,className:l,contentClassName:g}=i,{activeKey:s,setActiveKey:d}=v(),m=u.useId(),o=a??m,k=Array.isArray(s),c=k?s.includes(o):o===s;function f(){d(c?k?s.filter(h=>h!==o):null:k?[...s,o]:o)}return t.jsxs("div",{className:n.clsx("dgs-ui-kit-bg-white dgs-ui-kit-px-4 dgs-ui-kit-pt-4",l),children:[t.jsxs("button",{className:n.clsx("dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center dgs-ui-kit-w-full",c?"dgs-ui-kit-text-primary-500":"dgs-ui-kit-text-gray-600"),onClick:f,children:[t.jsx("div",{className:c?"dgs-ui-kit-font-h5-bold":"dgs-ui-kit-font-p1-medium",children:r}),t.jsx(y.ArrowDown2Icon,{className:n.clsx("dgs-ui-kit-transition dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out dgs-ui-kit-shrink-0 dgs-ui-kit-w-auto dgs-ui-kit-h-auto",c&&"dgs-ui-kit-rotate-180"),width:20,height:20})]}),t.jsx("div",{className:n.clsx("dgs-ui-kit-grid dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-600 dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out",c?"dgs-ui-kit-grid-rows-[1fr] dgs-ui-kit-opacity-100 dgs-ui-kit-mt-3":"dgs-ui-kit-grid-rows-[0fr] dgs-ui-kit-opacity-0",g),children:t.jsx("div",{className:"dgs-ui-kit-overflow-hidden",children:e})}),t.jsx(w,{type:"horizontal",color:"white",className:"dgs-ui-kit-mt-4"})]})};exports.AccordionGroup=j;exports.AccordionItem=N;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
1
|
import { SelectProps } from './types';
|
|
3
|
-
|
|
4
|
-
setIsShowOptions: Dispatch<SetStateAction<boolean>>;
|
|
5
|
-
};
|
|
6
|
-
declare const Options: <T>(props: OptionsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Options: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
7
3
|
export default Options;
|
|
8
4
|
//# sourceMappingURL=Options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/Options.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/Options.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AAOzF,QAAA,MAAM,OAAO,GAAI,CAAC,SAAU,WAAW,CAAC,CAAC,CAAC,4CAuLzC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";require('../../assets/styles.css');const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";require('../../assets/styles.css');const t=require("react/jsx-runtime"),u=require("../../clsx-C11secjj.cjs"),l=require("react"),B=require("../Checkbox/index.cjs"),F=require("../../Button/index.cjs"),D=require("../Input/index.cjs"),V=require("../../Drawer/index.cjs"),z=require("../../ArrowDown2-O11Hxz6e.cjs");;/* empty css */const H=r=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...r,children:t.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.767 20.755a8.989 8.989 0 1 0 0-17.977 8.989 8.989 0 0 0 0 17.977M18.018 18.485 21.542 22"})});function U(r,i=100){if(!r)return;const e=document.createElement("input");e.style.position="absolute",e.style.top=`${r.offsetTop+7}px`,e.style.left=`${r.offsetLeft}px`,e.style.height="0px",e.style.opacity="0px",document.body.appendChild(e),e.focus(),setTimeout(()=>{r.focus(),r.click(),document.body.removeChild(e)},i)}function K({label:r,isMultiple:i,isActive:e,disabled:o}){return i?t.jsx(B,{checked:e,label:r,readOnly:!0,disabled:o}):r}const G=r=>{const{option:i,onClick:e,value:o,mode:n,optionCellClassName:k,optionCell:a}=r;function c(){return Array.isArray(o)?o.includes(i.value):i.value===o}return t.jsx("button",{onClick:e,className:u.clsx("dgs-ui-kit-w-full dgs-ui-kit-text-start dgs-ui-kit-px-3 disabled:dgs-ui-kit-cursor-not-allowed dgs-ui-kit-py-3 dgs-ui-kit-font-p1-regular disabled:dgs-ui-kit-bg-gray-50 dgs-ui-kit-transition",c()?"dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-500":"dgs-ui-kit-text-gray-700 disabled:dgs-ui-kit-text-gray-400",k),disabled:i.disabled,children:a?a(i,c()):K({label:i.label,isMultiple:n==="multiple",isActive:c(),disabled:i.disabled??!1})})},W=l.memo(G),_=l.createContext({toggleWrapperVisibility:()=>{}}),J=()=>l.useContext(_),Q=20,X=r=>{const{options:i,mode:e="single",afterOptions:o,beforOptions:n,onChange:k,searchable:a=!0,separateSelectedOptions:c=!0,optionsTitle:y="عنوانها",value:m,optionCellClassName:x,emptyContent:h="نتیجهای یافت نشد !",showClearButtonOnEmpty:v=!0}=r,[f,p]=l.useState(""),[b,C]=l.useState(0),g=l.useRef(null),{toggleWrapperVisibility:N}=J(),A=u.clsx("dgs-ui-kit-border-t dgs-ui-kit-border-solid dgs-ui-kit-border-gray-100",(!a&&!n||e==="multiple"&&c)&&"first-of-type:dgs-ui-kit-border-t-0",!!o&&"last-of-type:dgs-ui-kit-border-b");let w;const I=a;typeof a=="boolean"?w=a:w=Object.keys(a).length>0;const O=l.useMemo(()=>f?i?.filter(s=>s.label.includes(f)):i,[f,i]),T=l.useMemo(()=>e==="multiple"&&c?i?.filter(s=>m.includes(s.value))??[]:[],[i,m]),L=l.useMemo(()=>{let s=O;e==="multiple"&&c&&(s=s?.filter(S=>!m.includes(S.value)));const d=Math.min(b+Q,s?.length??0);return s?.slice(b,d)},[O,b,m]),j=g?.current?.children[0]?.clientHeight??50,$=(O?.length??0)*j,E=l.useCallback(()=>{const s=g?.current?.parentElement;if(!s)return;const d=s.scrollTop,S=g.current.offsetTop,P=Math.floor((d-S)/j);C(P>=0?P:0)},[j]);l.useEffect(()=>{const s=g.current?.parentElement;if(s)return s.addEventListener("scroll",E),()=>s.removeEventListener("scroll",E)},[E]),l.useEffect(()=>{w&&U(document.getElementById("search-input"),400)},[]);const M=l.useCallback(s=>{if(typeof k=="function")if(e==="multiple"){const d=[...m??[]];d.includes(s)?d.splice(d.indexOf(s),1):d.push(s),k(d)}else k(s),N()},[m]);return t.jsxs(t.Fragment,{children:[w&&t.jsx(D,{id:"search-input",wrapperClassName:u.clsx("dgs-ui-kit-sticky dgs-ui-kit-top-0 dgs-ui-kit-pt-3 dgs-ui-kit-right-0 dgs-ui-kit-bg-white dgs-ui-kit-z-10 dgs-ui-kit-px-3",n?"dgs-ui-kit-pb-2":"dgs-ui-kit-pb-3",I?.wrapperClassName),placeholder:I?.placeholder??"جستجوی عنوان",value:f,onChange:s=>p(s.currentTarget.value),rightIcon:I?.rightIcon??t.jsx(H,{width:20,height:20}),...typeof a=="object"?a:{}}),n,e==="multiple"&&c&&T.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-400 dgs-ui-kit-px-3 dgs-ui-kit-py-2",children:`${y}ی انتخاب شده`}),T.map(s=>t.jsx(W,{onClick:()=>M(s.value),option:s,optionCellClassName:u.clsx(A,x),...r},s.value))]}),t.jsxs(t.Fragment,{children:[e==="multiple"&&c&&t.jsx("p",{className:"dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-400 dgs-ui-kit-px-3 dgs-ui-kit-py-2",children:y}),t.jsx("div",{ref:g,className:"dgs-ui-kit-relative",style:{height:$},children:L?.map((s,d)=>t.jsx("div",{className:u.clsx("dgs-ui-kit-absolute dgs-ui-kit-w-full",A),style:{top:`${(b+d)*j}px`},children:t.jsx(W,{onClick:()=>M(s.value),option:s,...r})},s.value))}),!L?.length&&!T.length&&t.jsxs("div",{className:"dgs-ui-kit-text-center dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-items-center dgs-ui-kit-mt-2",children:[t.jsx("p",{className:"dgs-ui-kit-text-gray-500 dgs-ui-kit-font-p3-medium",children:h}),v&&t.jsx(F,{className:"dgs-ui-kit-mt-1",variant:"text",size:"small",onClick:()=>p(""),children:"پاک کردن"})]})]}),o]})},Y=r=>{const i=l.useRef(null);return l.useEffect(()=>{const e=o=>{i.current&&!i.current.contains(o.target)&&r()};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[i,r]),i},q="dgs-ui-kit-duration-300",R=400,Z=r=>{const{dropdownType:i="popover",disabled:e,isLoading:o,wrapperClassName:n,customInput:k,children:a,drawerProps:c,inputProps:y,popoverClassName:m}=r,[x,h]=l.useState(!1),[v,f]=l.useState(!1);let p;const b=Y(()=>{i==="popover"&&x&&(h(!1),p&&clearTimeout(p),p=setTimeout(()=>{f(!1)},R))});function C(){if(e||o)return;const N=!v;p&&clearTimeout(p),N?(f(!0),p=setTimeout(()=>{h(!0)},0)):(h(!1),p=setTimeout(()=>{f(!1)},R))}const g=u.clsx({"!dgs-ui-kit-cursor-not-allowed":e,"!dgs-ui-kit-cursor-wait":o,"!dgs-ui-kit-cursor-pointer":!o&&!e});return t.jsxs("div",{ref:b,className:u.clsx("dgs-ui-kit-relative",n),children:[t.jsx("button",{className:u.clsx("dgs-ui-kit-w-full",g),onClick:C,children:k?k(x):t.jsx(D,{leftIcon:o?t.jsx("div",{className:"dot-flashing dgs-ui-kit-mr-2"}):t.jsx(z.ArrowDown2Icon,{width:20,height:20,className:u.clsx("dgs-ui-kit-transition",q,{"dgs-ui-kit-rotate-180":x})}),containerClassName:u.clsx(g,{"dgs-ui-kit-items-baseline":o}),className:u.clsx("dgs-ui-kit-caret-transparent",g),disabled:e,...y})}),t.jsx(_.Provider,{value:{toggleWrapperVisibility:C},children:v&&t.jsx(t.Fragment,{children:i==="popover"?t.jsx("div",{className:u.clsx("dgs-ui-kit-absolute dgs-ui-kit-min-w-[300px] dgs-ui-kit-bottom-0 dgs-ui-kit-right-0 dgs-ui-kit-translate-y-[calc(100%+8px)] dgs-ui-kit-overflow-y-auto dgs-ui-kit-overflow-x-hidden dgs-ui-kit-shadow-lg dgs-ui-kit-w-full dgs-ui-kit-max-h-[360px] dgs-ui-kit-transition-all dgs-ui-kit-bg-white dgs-ui-kit-z-50 dgs-ui-kit-rounded-lg dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200 dgs-ui-kit-pb-3",q,x?"dgs-ui-kit-opacity-100":"dgs-ui-kit-opacity-0 dgs-ui-kit-max-h-0 dgs-ui-kit-overflow-y-hidden",m),children:a}):t.jsx(V,{...c,open:x,onClose:()=>h(!1),containerClassName:u.clsx("!dgs-ui-kit-pb-3 !dgs-ui-kit-px-0",c?.containerClassName),children:a})})})]})};function ee(r,i){return Array.isArray(r)?i.filter(e=>r.includes(e.value)).map(e=>e.label).join(", "):i.find(e=>e.value===r)?.label??""}const te=r=>{const{searchable:i=!0,value:e,options:o}=r,n={...r};return n.dropdownType==="popover"&&!i&&(n.popoverClassName=u.clsx("dgs-ui-kit-pt-3",n.popoverClassName)),n.dropdownType==="drawer"&&(n.drawerProps={...n.drawerProps,containerClassName:u.clsx(i?"!dgs-ui-kit-pt-0":"!dgs-ui-kit-pt-3",n.drawerProps?.containerClassName)}),n.customInput||(n.inputProps={...n.inputProps,value:ee(e,o)}),t.jsx(Z,{...n,children:t.jsx(X,{...r})})};module.exports=te;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,kBAAkB,CAAC;AAa1B,QAAA,MAAM,MAAM,GAAI,CAAC,SAAU,WAAW,CAAC,CAAC,CAAC,4CAsBxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
2
|
+
import { jsx as r, jsxs as y, Fragment as I } from "react/jsx-runtime";
|
|
3
|
+
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { memo as q, createContext as G, useContext as J, useState as O, useRef as H, useMemo as W, useCallback as R, useEffect as M } from "react";
|
|
5
|
+
import Q from "../Checkbox/index.js";
|
|
6
|
+
import X from "../../Button/index.js";
|
|
7
|
+
import U from "../Input/index.js";
|
|
8
|
+
import Y from "../../Drawer/index.js";
|
|
9
|
+
import { A as Z } from "../../ArrowDown2-CMeKw_vj.js";
|
|
10
10
|
import '../../assets/styles.css';/* empty css */
|
|
11
|
-
const
|
|
12
|
-
const s = K(null);
|
|
13
|
-
return B(() => {
|
|
14
|
-
const t = (o) => {
|
|
15
|
-
s.current && !s.current.contains(o.target) && i();
|
|
16
|
-
};
|
|
17
|
-
return document.addEventListener("click", t, !0), () => {
|
|
18
|
-
document.removeEventListener("click", t, !0);
|
|
19
|
-
};
|
|
20
|
-
}, [s, i]), s;
|
|
21
|
-
}, Z = (i) => /* @__PURE__ */ n(
|
|
11
|
+
const tt = (s) => /* @__PURE__ */ r(
|
|
22
12
|
"svg",
|
|
23
13
|
{
|
|
24
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -26,8 +16,8 @@ const Y = (i) => {
|
|
|
26
16
|
height: "1em",
|
|
27
17
|
fill: "none",
|
|
28
18
|
viewBox: "0 0 24 24",
|
|
29
|
-
...
|
|
30
|
-
children: /* @__PURE__ */
|
|
19
|
+
...s,
|
|
20
|
+
children: /* @__PURE__ */ r(
|
|
31
21
|
"path",
|
|
32
22
|
{
|
|
33
23
|
stroke: "currentColor",
|
|
@@ -39,176 +29,178 @@ const Y = (i) => {
|
|
|
39
29
|
)
|
|
40
30
|
}
|
|
41
31
|
);
|
|
42
|
-
function
|
|
43
|
-
if (!
|
|
32
|
+
function et(s, e = 100) {
|
|
33
|
+
if (!s) return;
|
|
44
34
|
const t = document.createElement("input");
|
|
45
|
-
t.style.position = "absolute", t.style.top = `${
|
|
46
|
-
|
|
47
|
-
},
|
|
35
|
+
t.style.position = "absolute", t.style.top = `${s.offsetTop + 7}px`, t.style.left = `${s.offsetLeft}px`, t.style.height = "0px", t.style.opacity = "0px", document.body.appendChild(t), t.focus(), setTimeout(() => {
|
|
36
|
+
s.focus(), s.click(), document.body.removeChild(t);
|
|
37
|
+
}, e);
|
|
48
38
|
}
|
|
49
|
-
function
|
|
50
|
-
label:
|
|
51
|
-
isMultiple:
|
|
39
|
+
function it({
|
|
40
|
+
label: s,
|
|
41
|
+
isMultiple: e,
|
|
52
42
|
isActive: t,
|
|
53
43
|
disabled: o
|
|
54
44
|
}) {
|
|
55
|
-
return
|
|
56
|
-
|
|
45
|
+
return e ? /* @__PURE__ */ r(
|
|
46
|
+
Q,
|
|
57
47
|
{
|
|
58
48
|
checked: t,
|
|
59
|
-
label:
|
|
49
|
+
label: s,
|
|
60
50
|
readOnly: !0,
|
|
61
51
|
disabled: o
|
|
62
52
|
}
|
|
63
|
-
) :
|
|
53
|
+
) : s;
|
|
64
54
|
}
|
|
65
|
-
const
|
|
66
|
-
const { option:
|
|
67
|
-
function
|
|
68
|
-
return Array.isArray(o) ? o.includes(
|
|
55
|
+
const st = (s) => {
|
|
56
|
+
const { option: e, onClick: t, value: o, mode: n, optionCellClassName: g, optionCell: a } = s;
|
|
57
|
+
function u() {
|
|
58
|
+
return Array.isArray(o) ? o.includes(e.value) : e.value === o;
|
|
69
59
|
}
|
|
70
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ r(
|
|
71
61
|
"button",
|
|
72
62
|
{
|
|
73
63
|
onClick: t,
|
|
74
|
-
className:
|
|
64
|
+
className: l(
|
|
75
65
|
"dgs-ui-kit-w-full dgs-ui-kit-text-start dgs-ui-kit-px-3 disabled:dgs-ui-kit-cursor-not-allowed dgs-ui-kit-py-3 dgs-ui-kit-font-p1-regular disabled:dgs-ui-kit-bg-gray-50 dgs-ui-kit-transition",
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
u() ? "dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-500" : "dgs-ui-kit-text-gray-700 disabled:dgs-ui-kit-text-gray-400",
|
|
67
|
+
g
|
|
78
68
|
),
|
|
79
|
-
disabled:
|
|
80
|
-
children:
|
|
81
|
-
label:
|
|
82
|
-
isMultiple:
|
|
83
|
-
isActive:
|
|
84
|
-
disabled:
|
|
69
|
+
disabled: e.disabled,
|
|
70
|
+
children: a ? a(e, u()) : it({
|
|
71
|
+
label: e.label,
|
|
72
|
+
isMultiple: n === "multiple",
|
|
73
|
+
isActive: u(),
|
|
74
|
+
disabled: e.disabled ?? !1
|
|
85
75
|
})
|
|
86
76
|
}
|
|
87
77
|
);
|
|
88
|
-
},
|
|
78
|
+
}, _ = q(st), F = G({
|
|
79
|
+
toggleWrapperVisibility: () => {
|
|
80
|
+
}
|
|
81
|
+
}), rt = () => J(F), nt = 20, ot = (s) => {
|
|
89
82
|
const {
|
|
90
|
-
options:
|
|
83
|
+
options: e,
|
|
91
84
|
mode: t = "single",
|
|
92
85
|
afterOptions: o,
|
|
93
|
-
beforOptions:
|
|
94
|
-
onChange:
|
|
95
|
-
searchable:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
} = i, [v, y] = S(""), [x, E] = S(0), p = K(null), C = r(
|
|
86
|
+
beforOptions: n,
|
|
87
|
+
onChange: g,
|
|
88
|
+
searchable: a = !0,
|
|
89
|
+
separateSelectedOptions: u = !0,
|
|
90
|
+
optionsTitle: v = "عنوانها",
|
|
91
|
+
value: m,
|
|
92
|
+
optionCellClassName: f,
|
|
93
|
+
emptyContent: h = "نتیجهای یافت نشد !",
|
|
94
|
+
showClearButtonOnEmpty: C = !0
|
|
95
|
+
} = s, [k, c] = O(""), [b, w] = O(0), p = H(null), { toggleWrapperVisibility: T } = rt(), $ = l(
|
|
104
96
|
"dgs-ui-kit-border-t dgs-ui-kit-border-solid dgs-ui-kit-border-gray-100",
|
|
105
|
-
(!
|
|
97
|
+
(!a && !n || t === "multiple" && u) && "first-of-type:dgs-ui-kit-border-t-0",
|
|
106
98
|
!!o && "last-of-type:dgs-ui-kit-border-b"
|
|
107
99
|
);
|
|
108
|
-
let
|
|
109
|
-
const
|
|
110
|
-
typeof
|
|
111
|
-
const
|
|
112
|
-
let
|
|
113
|
-
t === "multiple" &&
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
}, [
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
return
|
|
126
|
-
}, [
|
|
127
|
-
|
|
100
|
+
let x;
|
|
101
|
+
const E = a;
|
|
102
|
+
typeof a == "boolean" ? x = a : x = Object.keys(a).length > 0;
|
|
103
|
+
const S = W(() => k ? e?.filter((i) => i.label.includes(k)) : e, [k, e]), A = W(() => t === "multiple" && u ? e?.filter((i) => m.includes(i.value)) ?? [] : [], [e, m]), j = W(() => {
|
|
104
|
+
let i = S;
|
|
105
|
+
t === "multiple" && u && (i = i?.filter((P) => !m.includes(P.value)));
|
|
106
|
+
const d = Math.min(b + nt, i?.length ?? 0);
|
|
107
|
+
return i?.slice(b, d);
|
|
108
|
+
}, [S, b, m]), N = p?.current?.children[0]?.clientHeight ?? 50, K = (S?.length ?? 0) * N, L = R(() => {
|
|
109
|
+
const i = p?.current?.parentElement;
|
|
110
|
+
if (!i) return;
|
|
111
|
+
const d = i.scrollTop, P = p.current.offsetTop, D = Math.floor((d - P) / N);
|
|
112
|
+
w(D >= 0 ? D : 0);
|
|
113
|
+
}, [N]);
|
|
114
|
+
M(() => {
|
|
115
|
+
const i = p.current?.parentElement;
|
|
116
|
+
if (i)
|
|
117
|
+
return i.addEventListener("scroll", L), () => i.removeEventListener("scroll", L);
|
|
118
|
+
}, [L]), M(() => {
|
|
119
|
+
x && et(document.getElementById("search-input"), 400);
|
|
128
120
|
}, []);
|
|
129
|
-
const
|
|
130
|
-
(
|
|
131
|
-
if (typeof
|
|
121
|
+
const B = R(
|
|
122
|
+
(i) => {
|
|
123
|
+
if (typeof g == "function")
|
|
132
124
|
if (t === "multiple") {
|
|
133
|
-
const
|
|
134
|
-
|
|
125
|
+
const d = [...m ?? []];
|
|
126
|
+
d.includes(i) ? d.splice(d.indexOf(i), 1) : d.push(i), g(d);
|
|
135
127
|
} else
|
|
136
|
-
|
|
128
|
+
g(i), T();
|
|
137
129
|
},
|
|
138
|
-
[
|
|
130
|
+
[m]
|
|
139
131
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
|
|
132
|
+
return /* @__PURE__ */ y(I, { children: [
|
|
133
|
+
x && /* @__PURE__ */ r(
|
|
134
|
+
U,
|
|
143
135
|
{
|
|
144
136
|
id: "search-input",
|
|
145
|
-
wrapperClassName:
|
|
137
|
+
wrapperClassName: l(
|
|
146
138
|
"dgs-ui-kit-sticky dgs-ui-kit-top-0 dgs-ui-kit-pt-3 dgs-ui-kit-right-0 dgs-ui-kit-bg-white dgs-ui-kit-z-10 dgs-ui-kit-px-3",
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
n ? "dgs-ui-kit-pb-2" : "dgs-ui-kit-pb-3",
|
|
140
|
+
E?.wrapperClassName
|
|
149
141
|
),
|
|
150
|
-
placeholder:
|
|
151
|
-
value:
|
|
152
|
-
onChange: (
|
|
153
|
-
rightIcon:
|
|
154
|
-
|
|
142
|
+
placeholder: E?.placeholder ?? "جستجوی عنوان",
|
|
143
|
+
value: k,
|
|
144
|
+
onChange: (i) => c(i.currentTarget.value),
|
|
145
|
+
rightIcon: E?.rightIcon ?? /* @__PURE__ */ r(
|
|
146
|
+
tt,
|
|
155
147
|
{
|
|
156
148
|
width: 20,
|
|
157
149
|
height: 20
|
|
158
150
|
}
|
|
159
151
|
),
|
|
160
|
-
...typeof
|
|
152
|
+
...typeof a == "object" ? a : {}
|
|
161
153
|
}
|
|
162
154
|
),
|
|
163
|
-
|
|
164
|
-
t === "multiple" &&
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
167
|
-
|
|
155
|
+
n,
|
|
156
|
+
t === "multiple" && u && A.length > 0 && /* @__PURE__ */ y(I, { children: [
|
|
157
|
+
/* @__PURE__ */ r("p", { className: "dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-400 dgs-ui-kit-px-3 dgs-ui-kit-py-2", children: `${v}ی انتخاب شده` }),
|
|
158
|
+
A.map((i) => /* @__PURE__ */ r(
|
|
159
|
+
_,
|
|
168
160
|
{
|
|
169
|
-
onClick: () =>
|
|
170
|
-
option:
|
|
171
|
-
optionCellClassName:
|
|
172
|
-
...
|
|
161
|
+
onClick: () => B(i.value),
|
|
162
|
+
option: i,
|
|
163
|
+
optionCellClassName: l($, f),
|
|
164
|
+
...s
|
|
173
165
|
},
|
|
174
|
-
|
|
166
|
+
i.value
|
|
175
167
|
))
|
|
176
168
|
] }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
t === "multiple" &&
|
|
179
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ y(I, { children: [
|
|
170
|
+
t === "multiple" && u && /* @__PURE__ */ r("p", { className: "dgs-ui-kit-font-p2-regular dgs-ui-kit-text-gray-400 dgs-ui-kit-px-3 dgs-ui-kit-py-2", children: v }),
|
|
171
|
+
/* @__PURE__ */ r(
|
|
180
172
|
"div",
|
|
181
173
|
{
|
|
182
174
|
ref: p,
|
|
183
175
|
className: "dgs-ui-kit-relative",
|
|
184
|
-
style: { height:
|
|
185
|
-
children:
|
|
176
|
+
style: { height: K },
|
|
177
|
+
children: j?.map((i, d) => /* @__PURE__ */ r(
|
|
186
178
|
"div",
|
|
187
179
|
{
|
|
188
|
-
className:
|
|
189
|
-
style: { top: `${(
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
-
|
|
180
|
+
className: l("dgs-ui-kit-absolute dgs-ui-kit-w-full", $),
|
|
181
|
+
style: { top: `${(b + d) * N}px` },
|
|
182
|
+
children: /* @__PURE__ */ r(
|
|
183
|
+
_,
|
|
192
184
|
{
|
|
193
|
-
onClick: () =>
|
|
194
|
-
option:
|
|
195
|
-
...
|
|
185
|
+
onClick: () => B(i.value),
|
|
186
|
+
option: i,
|
|
187
|
+
...s
|
|
196
188
|
}
|
|
197
189
|
)
|
|
198
190
|
},
|
|
199
|
-
|
|
191
|
+
i.value
|
|
200
192
|
))
|
|
201
193
|
}
|
|
202
194
|
),
|
|
203
|
-
!
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
206
|
-
|
|
195
|
+
!j?.length && !A.length && /* @__PURE__ */ y("div", { className: "dgs-ui-kit-text-center dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-items-center dgs-ui-kit-mt-2", children: [
|
|
196
|
+
/* @__PURE__ */ r("p", { className: "dgs-ui-kit-text-gray-500 dgs-ui-kit-font-p3-medium", children: h }),
|
|
197
|
+
C && /* @__PURE__ */ r(
|
|
198
|
+
X,
|
|
207
199
|
{
|
|
208
200
|
className: "dgs-ui-kit-mt-1",
|
|
209
201
|
variant: "text",
|
|
210
202
|
size: "small",
|
|
211
|
-
onClick: () =>
|
|
203
|
+
onClick: () => c(""),
|
|
212
204
|
children: "پاک کردن"
|
|
213
205
|
}
|
|
214
206
|
)
|
|
@@ -216,108 +208,131 @@ const it = (i) => {
|
|
|
216
208
|
] }),
|
|
217
209
|
o
|
|
218
210
|
] });
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
return
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
}, lt = (s) => {
|
|
212
|
+
const e = H(null);
|
|
213
|
+
return M(() => {
|
|
214
|
+
const t = (o) => {
|
|
215
|
+
e.current && !e.current.contains(o.target) && s();
|
|
216
|
+
};
|
|
217
|
+
return document.addEventListener("click", t, !0), () => {
|
|
218
|
+
document.removeEventListener("click", t, !0);
|
|
219
|
+
};
|
|
220
|
+
}, [e, s]), e;
|
|
221
|
+
}, V = "dgs-ui-kit-duration-300", z = 400, at = (s) => {
|
|
224
222
|
const {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
},
|
|
223
|
+
dropdownType: e = "popover",
|
|
224
|
+
disabled: t,
|
|
225
|
+
isLoading: o,
|
|
226
|
+
wrapperClassName: n,
|
|
227
|
+
customInput: g,
|
|
228
|
+
children: a,
|
|
229
|
+
drawerProps: u,
|
|
230
|
+
inputProps: v,
|
|
231
|
+
popoverClassName: m
|
|
232
|
+
} = s, [f, h] = O(!1), [C, k] = O(!1);
|
|
233
|
+
let c;
|
|
234
|
+
const b = lt(() => {
|
|
235
|
+
e === "popover" && f && (h(!1), c && clearTimeout(c), c = setTimeout(() => {
|
|
236
|
+
k(!1);
|
|
237
|
+
}, z));
|
|
240
238
|
});
|
|
241
|
-
function
|
|
242
|
-
if (
|
|
243
|
-
|
|
239
|
+
function w() {
|
|
240
|
+
if (t || o) return;
|
|
241
|
+
const T = !C;
|
|
242
|
+
c && clearTimeout(c), T ? (k(!0), c = setTimeout(() => {
|
|
244
243
|
h(!0);
|
|
245
|
-
}, 0)) : (h(!1), setTimeout(() => {
|
|
246
|
-
|
|
247
|
-
},
|
|
244
|
+
}, 0)) : (h(!1), c = setTimeout(() => {
|
|
245
|
+
k(!1);
|
|
246
|
+
}, z));
|
|
248
247
|
}
|
|
249
|
-
const p = {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
"!dgs-ui-kit-cursor-not-allowed": b,
|
|
254
|
-
"!dgs-ui-kit-cursor-wait": a,
|
|
255
|
-
"!dgs-ui-kit-cursor-pointer": !a && !b
|
|
248
|
+
const p = l({
|
|
249
|
+
"!dgs-ui-kit-cursor-not-allowed": t,
|
|
250
|
+
"!dgs-ui-kit-cursor-wait": o,
|
|
251
|
+
"!dgs-ui-kit-cursor-pointer": !o && !t
|
|
256
252
|
});
|
|
257
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ y(
|
|
258
254
|
"div",
|
|
259
255
|
{
|
|
260
|
-
ref:
|
|
261
|
-
className:
|
|
256
|
+
ref: b,
|
|
257
|
+
className: l("dgs-ui-kit-relative", n),
|
|
262
258
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ r(
|
|
264
260
|
"button",
|
|
265
261
|
{
|
|
266
|
-
className:
|
|
267
|
-
onClick:
|
|
268
|
-
children:
|
|
269
|
-
|
|
262
|
+
className: l("dgs-ui-kit-w-full", p),
|
|
263
|
+
onClick: w,
|
|
264
|
+
children: g ? g(f) : /* @__PURE__ */ r(
|
|
265
|
+
U,
|
|
270
266
|
{
|
|
271
|
-
leftIcon:
|
|
272
|
-
|
|
267
|
+
leftIcon: o ? /* @__PURE__ */ r("div", { className: "dot-flashing dgs-ui-kit-mr-2" }) : /* @__PURE__ */ r(
|
|
268
|
+
Z,
|
|
273
269
|
{
|
|
274
270
|
width: 20,
|
|
275
271
|
height: 20,
|
|
276
|
-
className:
|
|
277
|
-
"dgs-ui-kit-rotate-180":
|
|
272
|
+
className: l("dgs-ui-kit-transition", V, {
|
|
273
|
+
"dgs-ui-kit-rotate-180": f
|
|
278
274
|
})
|
|
279
275
|
}
|
|
280
276
|
),
|
|
281
|
-
containerClassName:
|
|
282
|
-
"dgs-ui-kit-items-baseline":
|
|
277
|
+
containerClassName: l(p, {
|
|
278
|
+
"dgs-ui-kit-items-baseline": o
|
|
283
279
|
}),
|
|
284
|
-
className:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
...m
|
|
280
|
+
className: l("dgs-ui-kit-caret-transparent", p),
|
|
281
|
+
disabled: t,
|
|
282
|
+
...v
|
|
288
283
|
}
|
|
289
284
|
)
|
|
290
285
|
}
|
|
291
286
|
),
|
|
292
|
-
|
|
293
|
-
|
|
287
|
+
/* @__PURE__ */ r(
|
|
288
|
+
F.Provider,
|
|
294
289
|
{
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
290
|
+
value: {
|
|
291
|
+
toggleWrapperVisibility: w
|
|
292
|
+
},
|
|
293
|
+
children: C && /* @__PURE__ */ r(I, { children: e === "popover" ? /* @__PURE__ */ r(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: l(
|
|
297
|
+
"dgs-ui-kit-absolute dgs-ui-kit-min-w-[300px] dgs-ui-kit-bottom-0 dgs-ui-kit-right-0 dgs-ui-kit-translate-y-[calc(100%+8px)] dgs-ui-kit-overflow-y-auto dgs-ui-kit-overflow-x-hidden dgs-ui-kit-shadow-lg dgs-ui-kit-w-full dgs-ui-kit-max-h-[360px] dgs-ui-kit-transition-all dgs-ui-kit-bg-white dgs-ui-kit-z-50 dgs-ui-kit-rounded-lg dgs-ui-kit-border dgs-ui-kit-border-solid dgs-ui-kit-border-gray-200 dgs-ui-kit-pb-3",
|
|
298
|
+
V,
|
|
299
|
+
f ? "dgs-ui-kit-opacity-100" : "dgs-ui-kit-opacity-0 dgs-ui-kit-max-h-0 dgs-ui-kit-overflow-y-hidden",
|
|
300
|
+
m
|
|
301
|
+
),
|
|
302
|
+
children: a
|
|
303
|
+
}
|
|
304
|
+
) : /* @__PURE__ */ r(
|
|
305
|
+
Y,
|
|
306
|
+
{
|
|
307
|
+
...u,
|
|
308
|
+
open: f,
|
|
309
|
+
onClose: () => h(!1),
|
|
310
|
+
containerClassName: l(
|
|
311
|
+
"!dgs-ui-kit-pb-3 !dgs-ui-kit-px-0",
|
|
312
|
+
u?.containerClassName
|
|
313
|
+
),
|
|
314
|
+
children: a
|
|
315
|
+
}
|
|
316
|
+
) })
|
|
315
317
|
}
|
|
316
|
-
)
|
|
318
|
+
)
|
|
317
319
|
]
|
|
318
320
|
}
|
|
319
321
|
);
|
|
320
322
|
};
|
|
323
|
+
function ut(s, e) {
|
|
324
|
+
return Array.isArray(s) ? e.filter((t) => s.includes(t.value)).map((t) => t.label).join(", ") : e.find((t) => t.value === s)?.label ?? "";
|
|
325
|
+
}
|
|
326
|
+
const yt = (s) => {
|
|
327
|
+
const { searchable: e = !0, value: t, options: o } = s, n = { ...s };
|
|
328
|
+
return n.dropdownType === "popover" && !e && (n.popoverClassName = l("dgs-ui-kit-pt-3", n.popoverClassName)), n.dropdownType === "drawer" && (n.drawerProps = {
|
|
329
|
+
...n.drawerProps,
|
|
330
|
+
containerClassName: l(
|
|
331
|
+
e ? "!dgs-ui-kit-pt-0" : "!dgs-ui-kit-pt-3",
|
|
332
|
+
n.drawerProps?.containerClassName
|
|
333
|
+
)
|
|
334
|
+
}), n.customInput || (n.inputProps = { ...n.inputProps, value: ut(t, o) }), /* @__PURE__ */ r(at, { ...n, children: /* @__PURE__ */ r(ot, { ...s }) });
|
|
335
|
+
};
|
|
321
336
|
export {
|
|
322
|
-
|
|
337
|
+
yt as default
|
|
323
338
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { DrawerProps } from '../../Drawer';
|
|
3
2
|
import { InputProps } from '../Input';
|
|
3
|
+
import { PickerWrapperProps } from '../Wrappers/PickerWrapper/type';
|
|
4
4
|
export type Option<T> = {
|
|
5
5
|
value: T;
|
|
6
6
|
label: string;
|
|
@@ -10,11 +10,8 @@ type SelectPropsBase<T> = {
|
|
|
10
10
|
options: Option<T>[];
|
|
11
11
|
optionsContainer?: 'drawer' | 'popover';
|
|
12
12
|
searchable?: boolean | Omit<InputProps, 'onChange'>;
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
13
|
optionCell?: (option: Option<T>, isActive: boolean) => ReactNode;
|
|
16
14
|
optionCellClassName?: string;
|
|
17
|
-
className?: string;
|
|
18
15
|
beforOptions?: ReactNode;
|
|
19
16
|
afterOptions?: ReactNode;
|
|
20
17
|
emptyContent?: ReactNode;
|
|
@@ -34,24 +31,6 @@ export type SelectWithMultipleMode<T> = {
|
|
|
34
31
|
optionsTitle?: string;
|
|
35
32
|
separateSelectedOptions?: boolean;
|
|
36
33
|
};
|
|
37
|
-
type
|
|
38
|
-
customInput?: (isShowOptions: boolean) => ReactNode;
|
|
39
|
-
inputProps?: never;
|
|
40
|
-
};
|
|
41
|
-
type SelectWithoutCustomInput = {
|
|
42
|
-
inputProps?: Omit<InputProps, 'leftIcon' | 'id'>;
|
|
43
|
-
customInput?: never;
|
|
44
|
-
};
|
|
45
|
-
type SelectWithDrawerContainer = {
|
|
46
|
-
optionsContainer: 'drawer';
|
|
47
|
-
drawerProps?: Omit<DrawerProps, 'children' | 'onClose' | 'open'>;
|
|
48
|
-
popoverClassName?: never;
|
|
49
|
-
};
|
|
50
|
-
type SelectWithPopoverContainer = {
|
|
51
|
-
optionsContainer?: 'popover';
|
|
52
|
-
popoverClassName?: string;
|
|
53
|
-
drawerProps?: never;
|
|
54
|
-
};
|
|
55
|
-
export type SelectProps<T> = SelectPropsBase<T> & (SelectWithSingleMode<T> | SelectWithMultipleMode<T>) & (SelectWithoutCustomInput | SelectWithCustomInput) & (SelectWithDrawerContainer | SelectWithPopoverContainer);
|
|
34
|
+
export type SelectProps<T> = SelectPropsBase<T> & Omit<PickerWrapperProps, 'children'> & (SelectWithSingleMode<T> | SelectWithMultipleMode<T>);
|
|
56
35
|
export {};
|
|
57
36
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IACtB,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAC;IACjE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,uBAAuB,CAAC,EAAE,KAAK,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAC7C,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GACpC,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PickerWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/PickerWrapper/PickerWrapper.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,kBAAkB,CAAC;AAM1B,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA4HzC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface IPickerWrapperContext {
|
|
2
|
+
toggleWrapperVisibility: () => void;
|
|
3
|
+
}
|
|
4
|
+
export declare const pickerWrapperContext: import('react').Context<IPickerWrapperContext>;
|
|
5
|
+
export declare const usePickerWrapper: () => IPickerWrapperContext;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/PickerWrapper/contexts.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,uBAAuB,EAAE,MAAM,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,oBAAoB,gDAE/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,6BAAyC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DrawerProps } from '../../../Drawer';
|
|
3
|
+
import { InputProps } from '../../Input';
|
|
4
|
+
interface PickerWrapperPropsBase {
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
interface PickerWrapperWithCustomInput {
|
|
11
|
+
customInput?: (isOpen: boolean) => ReactNode;
|
|
12
|
+
inputProps?: never;
|
|
13
|
+
}
|
|
14
|
+
interface PickerWrapperWithoutCustomInput {
|
|
15
|
+
inputProps?: Omit<InputProps, 'leftIcon'>;
|
|
16
|
+
customInput?: never;
|
|
17
|
+
}
|
|
18
|
+
interface PickerWrapperWithDrawerContainer {
|
|
19
|
+
dropdownType: 'drawer';
|
|
20
|
+
drawerProps?: Omit<DrawerProps, 'children' | 'onClose' | 'open'>;
|
|
21
|
+
popoverClassName?: never;
|
|
22
|
+
}
|
|
23
|
+
interface PickerWrapperWithPopoverContainer {
|
|
24
|
+
dropdownType?: 'popover';
|
|
25
|
+
popoverClassName?: string;
|
|
26
|
+
drawerProps?: never;
|
|
27
|
+
}
|
|
28
|
+
export type PickerWrapperProps = PickerWrapperPropsBase & (PickerWrapperWithCustomInput | PickerWrapperWithoutCustomInput) & (PickerWrapperWithDrawerContainer | PickerWrapperWithPopoverContainer);
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Wrappers/PickerWrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,UAAU,sBAAsB;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,4BAA4B;IACpC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC;IAC7C,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,UAAU,+BAA+B;IACvC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED,UAAU,gCAAgC;IACxC,YAAY,EAAE,QAAQ,CAAC;IACvB,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC;IACjE,gBAAgB,CAAC,EAAE,KAAK,CAAC;CAC1B;AAED,UAAU,iCAAiC;IACzC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GACrD,CAAC,4BAA4B,GAAG,+BAA+B,CAAC,GAChE,CAAC,gCAAgC,GAAG,iCAAiC,CAAC,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const r=require("./AccordionItem-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const r=require("./AccordionItem-U3jVG5e6.cjs"),o=require("./Alert/index.cjs"),t=require("./Badge/index.cjs"),i=require("./Breadcrumb/index.cjs"),n=require("./Button/index.cjs"),c=require("./Divider/index.cjs"),u=require("./Drawer/index.cjs"),s=require("./Form/Checkbox/index.cjs"),a=require("./Form/Input/index.cjs"),d=require("./Form/OtpInput/index.cjs"),q=require("./Form/RadioButton/index.cjs"),l=require("./Form/Select/index.cjs"),m=require("./Form/Textarea/index.cjs"),B=require("./Pagination/index.cjs"),p=require("./Progress/Bar/index.cjs"),e=require("./Slide-aMCvZQnM.cjs"),S=require("./Tabs/index.cjs");exports.AccordionGroup=r.AccordionGroup;exports.AccordionItem=r.AccordionItem;exports.Alert=o;exports.Badge=t;exports.Breadcrumb=i;exports.Button=n;exports.Divider=c;exports.Drawer=u;exports.Checkbox=s;exports.Input=a;exports.OtpInput=d;exports.RadioButton=q;exports.Select=l;exports.Textarea=m;exports.Pagination=B;exports.ProgressBar=p;exports.Slide=e.Slide;exports.Slider=e.Slider;exports.Tabs=S;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './assets/styles.css';/* empty css */
|
|
2
|
-
import { A as o, a as t } from "./AccordionItem-
|
|
2
|
+
import { A as o, a as t } from "./AccordionItem-249c_E9c.js";
|
|
3
3
|
import { default as d } from "./Alert/index.js";
|
|
4
4
|
import { default as s } from "./Badge/index.js";
|
|
5
5
|
import { default as m } from "./Breadcrumb/index.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const i=require("react/jsx-runtime"),s=require("./clsx-C11secjj.cjs"),e=require("react"),m=require("./ArrowDown2-O11Hxz6e.cjs"),h=require("./Divider/index.cjs"),g=e.createContext({activeKey:null,setActiveKey:()=>{}}),v=()=>e.useContext(g),y=c=>{const{defaultActiveKey:o=null,className:d,children:u}=c,[n,r]=e.useState(o);return i.jsx("div",{className:s.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-col",d),children:i.jsx(g.Provider,{value:{activeKey:n,setActiveKey:r},children:u})})},f=c=>{const{children:o,title:d,accordionKey:u,className:n,contentClassName:r}=c,{activeKey:k,setActiveKey:a}=v(),x=e.useId(),l=u??x,t=l===k;return i.jsxs("div",{className:s.clsx("dgs-ui-kit-bg-white dgs-ui-kit-px-4 dgs-ui-kit-pt-4",n),children:[i.jsxs("button",{className:s.clsx("dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center dgs-ui-kit-w-full",t?"dgs-ui-kit-text-primary-500":"dgs-ui-kit-text-gray-600"),onClick:()=>{a(t?null:l)},children:[i.jsx("div",{className:t?"dgs-ui-kit-font-h5-bold":"dgs-ui-kit-font-p1-medium",children:d}),i.jsx(m.ArrowDown2Icon,{className:s.clsx("dgs-ui-kit-transition dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out dgs-ui-kit-shrink-0 dgs-ui-kit-w-auto dgs-ui-kit-h-auto",t&&"dgs-ui-kit-rotate-180"),width:20,height:20})]}),i.jsx("div",{className:s.clsx("dgs-ui-kit-grid dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-600 dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out",t?"dgs-ui-kit-grid-rows-[1fr] dgs-ui-kit-opacity-100 dgs-ui-kit-mt-3":"dgs-ui-kit-grid-rows-[0fr] dgs-ui-kit-opacity-0",r),children:i.jsx("div",{className:"dgs-ui-kit-overflow-hidden",children:o})}),i.jsx(h,{type:"horizontal",color:"white",className:"dgs-ui-kit-mt-4"})]})};exports.AccordionGroup=y;exports.AccordionItem=f;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
3
|
-
import { c as s } from "./clsx-OuTLNxxd.js";
|
|
4
|
-
import { createContext as f, useContext as h, useState as v, useId as y } from "react";
|
|
5
|
-
import { A as p } from "./ArrowDown2-CMeKw_vj.js";
|
|
6
|
-
import x from "./Divider/index.js";
|
|
7
|
-
const g = f({
|
|
8
|
-
activeKey: null,
|
|
9
|
-
setActiveKey: () => {
|
|
10
|
-
}
|
|
11
|
-
}), w = () => h(g), b = (e) => {
|
|
12
|
-
const { defaultActiveKey: o = null, className: d, children: c } = e, [r, u] = v(o);
|
|
13
|
-
return /* @__PURE__ */ i("div", { className: s("dgs-ui-kit-flex dgs-ui-kit-flex-col", d), children: /* @__PURE__ */ i(
|
|
14
|
-
g.Provider,
|
|
15
|
-
{
|
|
16
|
-
value: {
|
|
17
|
-
activeKey: r,
|
|
18
|
-
setActiveKey: u
|
|
19
|
-
},
|
|
20
|
-
children: c
|
|
21
|
-
}
|
|
22
|
-
) });
|
|
23
|
-
}, j = (e) => {
|
|
24
|
-
const { children: o, title: d, accordionKey: c, className: r, contentClassName: u } = e, { activeKey: k, setActiveKey: a } = w(), m = y(), n = c ?? m, t = n === k;
|
|
25
|
-
return /* @__PURE__ */ l("div", { className: s("dgs-ui-kit-bg-white dgs-ui-kit-px-4 dgs-ui-kit-pt-4", r), children: [
|
|
26
|
-
/* @__PURE__ */ l(
|
|
27
|
-
"button",
|
|
28
|
-
{
|
|
29
|
-
className: s(
|
|
30
|
-
"dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center dgs-ui-kit-w-full",
|
|
31
|
-
t ? "dgs-ui-kit-text-primary-500" : "dgs-ui-kit-text-gray-600"
|
|
32
|
-
),
|
|
33
|
-
onClick: () => {
|
|
34
|
-
a(t ? null : n);
|
|
35
|
-
},
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ i("div", { className: t ? "dgs-ui-kit-font-h5-bold" : "dgs-ui-kit-font-p1-medium", children: d }),
|
|
38
|
-
/* @__PURE__ */ i(
|
|
39
|
-
p,
|
|
40
|
-
{
|
|
41
|
-
className: s(
|
|
42
|
-
"dgs-ui-kit-transition dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out dgs-ui-kit-shrink-0 dgs-ui-kit-w-auto dgs-ui-kit-h-auto",
|
|
43
|
-
t && "dgs-ui-kit-rotate-180"
|
|
44
|
-
),
|
|
45
|
-
width: 20,
|
|
46
|
-
height: 20
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
/* @__PURE__ */ i(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: s(
|
|
56
|
-
"dgs-ui-kit-grid dgs-ui-kit-font-p1-regular dgs-ui-kit-text-gray-600 dgs-ui-kit-overflow-hidden dgs-ui-kit-transition-all dgs-ui-kit-duration-300 dgs-ui-kit-ease-in-out",
|
|
57
|
-
t ? "dgs-ui-kit-grid-rows-[1fr] dgs-ui-kit-opacity-100 dgs-ui-kit-mt-3" : "dgs-ui-kit-grid-rows-[0fr] dgs-ui-kit-opacity-0",
|
|
58
|
-
u
|
|
59
|
-
),
|
|
60
|
-
children: /* @__PURE__ */ i("div", { className: "dgs-ui-kit-overflow-hidden", children: o })
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
/* @__PURE__ */ i(
|
|
64
|
-
x,
|
|
65
|
-
{
|
|
66
|
-
type: "horizontal",
|
|
67
|
-
color: "white",
|
|
68
|
-
className: "dgs-ui-kit-mt-4"
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] });
|
|
72
|
-
};
|
|
73
|
-
export {
|
|
74
|
-
b as A,
|
|
75
|
-
j as a
|
|
76
|
-
};
|