react-luminus-components 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 +3 -0
- package/dist/.vite/manifest.json +133 -0
- package/dist/Modal-JLnYbEat.js +1 -0
- package/dist/Modal-_FnSEPRk.mjs +623 -0
- package/dist/SimpleTooltip-BjlbHsKC.mjs +1767 -0
- package/dist/SimpleTooltip-D9shMl1R.js +1 -0
- package/dist/components/EmployeePicker/EmployeeSearch/EmployeeSearch.d.ts +7 -0
- package/dist/components/EmployeePicker/EmployeeSearchModal/EmployeeSearchModal.d.ts +9 -0
- package/dist/components/EmployeePicker/comps/EmployeeSearchItem/EmployeeSearchItem.d.ts +7 -0
- package/dist/components/EmployeePicker/comps/index.d.ts +1 -0
- package/dist/components/EmployeePicker/index.d.ts +2 -0
- package/dist/components/Form/CheckInput/CheckInput.d.ts +11 -0
- package/dist/components/Form/Container/InputContainer.d.ts +8 -0
- package/dist/components/Form/EmployeePicker/EmployeePicker.d.ts +12 -0
- package/dist/components/Form/SelectInput/SelectInput.d.ts +17 -0
- package/dist/components/Form/TextInput/TextInput.d.ts +16 -0
- package/dist/components/Form/index.d.ts +4 -0
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +9 -0
- package/dist/components/HookForm/EmployeePicker/HookFormEmployeePicker.d.ts +9 -0
- package/dist/components/HookForm/FloatingSubmit/FloatingFormSubmit.d.ts +6 -0
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +9 -0
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +9 -0
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +9 -0
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +9 -0
- package/dist/components/HookForm/index.d.ts +7 -0
- package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +10 -0
- package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +8 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +8 -0
- package/dist/components/UserAvatar/UserAvatarDropdown/UserAvatarDropdown.d.ts +7 -0
- package/dist/components/UserAvatar/UserAvatarToggle/UserAvatarToggle.d.ts +8 -0
- package/dist/components/UserAvatar/index.d.ts +2 -0
- package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +9 -0
- package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +3 -0
- package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +9 -0
- package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +6 -0
- package/dist/components/common/HomeDashboard/comps/index.d.ts +1 -0
- package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +6 -0
- package/dist/components/common/Loading/Loading.d.ts +3 -0
- package/dist/components/common/MonthPicker/MonthPicker.d.ts +9 -0
- package/dist/components/common/Typography/Typography.d.ts +9 -0
- package/dist/components/common/index.d.ts +6 -0
- package/dist/constants-CT2hnPeO.js +1 -0
- package/dist/constants-CzNy5yO3.mjs +7 -0
- package/dist/contexts/confirm/ConfirmContext.d.ts +9 -0
- package/dist/contexts/confirm/ConfirmProvider.d.ts +6 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/loading/LoadingContext.d.ts +8 -0
- package/dist/contexts/loading/LoadingProvider.d.ts +6 -0
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +15 -0
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +16 -0
- package/dist/contexts/user/UserContext.d.ts +9 -0
- package/dist/contexts/user/UserProvider.d.ts +6 -0
- package/dist/contexts.cjs.js +1 -0
- package/dist/contexts.d.ts +1 -0
- package/dist/contexts.es.js +86 -0
- package/dist/hasClass-3JW9Qluf.mjs +1482 -0
- package/dist/hasClass-6m1Qq_DA.js +20 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useAuth/useAuth.d.ts +7 -0
- package/dist/hooks/useAxios/useAxios.d.ts +3 -0
- package/dist/hooks/useConfirm/useConfirm.d.ts +8 -0
- package/dist/hooks/useNotifications/useNotifications.d.ts +4 -0
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +44 -0
- package/dist/hooks.cjs.js +1 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.es.js +2781 -0
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +4 -0
- package/dist/layout/MainContainer/MainContainer.d.ts +4 -0
- package/dist/layout/SideContentBar/SideContentBar.d.ts +7 -0
- package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +10 -0
- package/dist/layout/SideMenu/SideMenu.d.ts +10 -0
- package/dist/layout/TopBar/TopBar.d.ts +7 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout.cjs.js +1 -0
- package/dist/layout.d.ts +1 -0
- package/dist/layout.es.js +164 -0
- package/dist/main.cjs.js +1 -0
- package/dist/main.d.ts +11 -0
- package/dist/main.es.js +2788 -0
- package/dist/models/index.d.ts +23 -0
- package/dist/models/prop-types/ContainerProps.d.ts +6 -0
- package/dist/models/prop-types/HookFormCheckInputProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormEmployeePickerProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormInputProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormRadioInputProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormSelectInputProps.d.ts +12 -0
- package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormTextInputProps.d.ts +11 -0
- package/dist/models/texts/AxiosTexts.d.ts +6 -0
- package/dist/models/texts/ConfirmTexts.d.ts +5 -0
- package/dist/models/texts/EmployeeSearchModalTexts.d.ts +6 -0
- package/dist/models/texts/FormValidationTexts.d.ts +5 -0
- package/dist/models/texts/HomeDashboardTexts.d.ts +5 -0
- package/dist/models/types/ApiErrorResult.d.ts +7 -0
- package/dist/models/types/DashboardConfig.d.ts +5 -0
- package/dist/models/types/DashboardWidget.d.ts +7 -0
- package/dist/models/types/DashboardWidgetConfig.d.ts +5 -0
- package/dist/models/types/EmployeeIndexModel.d.ts +14 -0
- package/dist/models/types/ErrorField.d.ts +5 -0
- package/dist/models/types/FormSelectOption.d.ts +5 -0
- package/dist/models/types/HookFormInputProps.d.ts +9 -0
- package/dist/models/types/MenuItemType.d.ts +9 -0
- package/dist/models/types/NameIdIntModel.d.ts +5 -0
- package/dist/models/types/NameIdStringModel.d.ts +5 -0
- package/dist/models/types/UserModel.d.ts +13 -0
- package/dist/style.css +1 -0
- package/dist/textUtils-9KFqOvA8.mjs +27 -0
- package/dist/textUtils-C0nqWp3S.js +1 -0
- package/dist/useAxios-BU-BqYrK.mjs +2663 -0
- package/dist/useAxios-ZEhq7C_H.js +212 -0
- package/dist/useConfirm-BazFQNRI.js +1 -0
- package/dist/useConfirm-DH9Pmz_w.mjs +18 -0
- package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +4 -0
- package/dist/utils/date/dateUtils.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/object/objectUtils.d.ts +2 -0
- package/dist/utils/text/textUtils.d.ts +1 -0
- package/dist/utils.cjs.js +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.es.js +137 -0
- package/package.json +94 -0
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_Modal-JLnYbEat.js": {
|
|
3
|
+
"file": "Modal-JLnYbEat.js",
|
|
4
|
+
"imports": [
|
|
5
|
+
"_useAxios-ZEhq7C_H.js",
|
|
6
|
+
"_hasClass-6m1Qq_DA.js"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"_Modal-_FnSEPRk.mjs": {
|
|
10
|
+
"file": "Modal-_FnSEPRk.mjs",
|
|
11
|
+
"imports": [
|
|
12
|
+
"_useAxios-BU-BqYrK.mjs",
|
|
13
|
+
"_hasClass-3JW9Qluf.mjs"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"_SimpleTooltip-BjlbHsKC.mjs": {
|
|
17
|
+
"file": "SimpleTooltip-BjlbHsKC.mjs",
|
|
18
|
+
"imports": [
|
|
19
|
+
"_useAxios-BU-BqYrK.mjs",
|
|
20
|
+
"_hasClass-3JW9Qluf.mjs"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"_SimpleTooltip-D9shMl1R.js": {
|
|
24
|
+
"file": "SimpleTooltip-D9shMl1R.js",
|
|
25
|
+
"imports": [
|
|
26
|
+
"_useAxios-ZEhq7C_H.js",
|
|
27
|
+
"_hasClass-6m1Qq_DA.js"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"_constants-CT2hnPeO.js": {
|
|
31
|
+
"file": "constants-CT2hnPeO.js"
|
|
32
|
+
},
|
|
33
|
+
"_constants-CzNy5yO3.mjs": {
|
|
34
|
+
"file": "constants-CzNy5yO3.mjs"
|
|
35
|
+
},
|
|
36
|
+
"_hasClass-3JW9Qluf.mjs": {
|
|
37
|
+
"file": "hasClass-3JW9Qluf.mjs",
|
|
38
|
+
"imports": [
|
|
39
|
+
"_useAxios-BU-BqYrK.mjs"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"_hasClass-6m1Qq_DA.js": {
|
|
43
|
+
"file": "hasClass-6m1Qq_DA.js",
|
|
44
|
+
"imports": [
|
|
45
|
+
"_useAxios-ZEhq7C_H.js"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"_textUtils-9KFqOvA8.mjs": {
|
|
49
|
+
"file": "textUtils-9KFqOvA8.mjs"
|
|
50
|
+
},
|
|
51
|
+
"_textUtils-C0nqWp3S.js": {
|
|
52
|
+
"file": "textUtils-C0nqWp3S.js"
|
|
53
|
+
},
|
|
54
|
+
"_useAxios-BU-BqYrK.mjs": {
|
|
55
|
+
"file": "useAxios-BU-BqYrK.mjs",
|
|
56
|
+
"imports": [
|
|
57
|
+
"_textUtils-9KFqOvA8.mjs"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"_useAxios-ZEhq7C_H.js": {
|
|
61
|
+
"file": "useAxios-ZEhq7C_H.js",
|
|
62
|
+
"imports": [
|
|
63
|
+
"_textUtils-C0nqWp3S.js"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"_useConfirm-BazFQNRI.js": {
|
|
67
|
+
"file": "useConfirm-BazFQNRI.js",
|
|
68
|
+
"imports": [
|
|
69
|
+
"_useAxios-ZEhq7C_H.js"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"_useConfirm-DH9Pmz_w.mjs": {
|
|
73
|
+
"file": "useConfirm-DH9Pmz_w.mjs",
|
|
74
|
+
"imports": [
|
|
75
|
+
"_useAxios-BU-BqYrK.mjs"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"src/contexts/index.ts": {
|
|
79
|
+
"file": "contexts.cjs.js",
|
|
80
|
+
"src": "src/contexts/index.ts",
|
|
81
|
+
"isEntry": true,
|
|
82
|
+
"imports": [
|
|
83
|
+
"_useAxios-ZEhq7C_H.js",
|
|
84
|
+
"_Modal-JLnYbEat.js",
|
|
85
|
+
"_useConfirm-BazFQNRI.js"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"src/hooks/index.ts": {
|
|
89
|
+
"file": "hooks.cjs.js",
|
|
90
|
+
"src": "src/hooks/index.ts",
|
|
91
|
+
"isEntry": true,
|
|
92
|
+
"imports": [
|
|
93
|
+
"_useAxios-ZEhq7C_H.js",
|
|
94
|
+
"_useConfirm-BazFQNRI.js",
|
|
95
|
+
"src/utils/index.ts"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"src/layout/index.ts": {
|
|
99
|
+
"file": "layout.cjs.js",
|
|
100
|
+
"src": "src/layout/index.ts",
|
|
101
|
+
"isEntry": true,
|
|
102
|
+
"imports": [
|
|
103
|
+
"_useAxios-ZEhq7C_H.js",
|
|
104
|
+
"_SimpleTooltip-D9shMl1R.js",
|
|
105
|
+
"_hasClass-6m1Qq_DA.js"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"src/main.ts": {
|
|
109
|
+
"file": "main.cjs.js",
|
|
110
|
+
"src": "src/main.ts",
|
|
111
|
+
"isEntry": true,
|
|
112
|
+
"imports": [
|
|
113
|
+
"_useAxios-ZEhq7C_H.js",
|
|
114
|
+
"_Modal-JLnYbEat.js",
|
|
115
|
+
"_SimpleTooltip-D9shMl1R.js",
|
|
116
|
+
"_constants-CT2hnPeO.js",
|
|
117
|
+
"_hasClass-6m1Qq_DA.js"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"src/utils/index.ts": {
|
|
121
|
+
"file": "utils.cjs.js",
|
|
122
|
+
"src": "src/utils/index.ts",
|
|
123
|
+
"isEntry": true,
|
|
124
|
+
"imports": [
|
|
125
|
+
"_textUtils-C0nqWp3S.js",
|
|
126
|
+
"_constants-CT2hnPeO.js"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"style.css": {
|
|
130
|
+
"file": "style.css",
|
|
131
|
+
"src": "style.css"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./useAxios-ZEhq7C_H.js"),o=require("./hasClass-6m1Qq_DA.js"),d=require("react"),Le=require("react-dom");function We(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const m=We(d),Ie=()=>n.jsxRuntimeExports.jsxs("div",{className:n.classNames("luminus-loading",n.classes.loading),children:[n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",n.classes.spinnerGrow,"text-primary"),role:"status"}),n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",n.classes.spinnerGrow,"text-primary",n.classes.second),role:"status"}),n.jsxRuntimeExports.jsx("div",{className:n.classNames("spinner-grow",n.classes.spinnerGrow,"text-primary",n.classes.third),role:"status"})]}),_e=({variant:t,className:e,children:s})=>{switch(t){case"h1":return n.jsxRuntimeExports.jsx("h1",{className:n.classNames("luminus-text-primary",n.classes$1.h1,e),children:s});case"h3":return n.jsxRuntimeExports.jsx("h3",{className:n.classNames("luminus-text",n.classes$1.h3,e),children:s});case"h6":return n.jsxRuntimeExports.jsx("h6",{className:n.classNames("luminus-text",n.classes$1.h6,e),children:s});case"subtitle":return n.jsxRuntimeExports.jsx("div",{className:n.classNames("luminus-text",n.classes$1.subtitle,e),children:s});case"body":return n.jsxRuntimeExports.jsx("div",{className:n.classNames("luminus-text",n.classes$1.body,e),children:s});case"body2":return n.jsxRuntimeExports.jsx("div",{className:n.classNames("luminus-text",n.classes$1.body2,e),children:s});case"caption":return n.jsxRuntimeExports.jsx("div",{className:n.classNames("luminus-text-muted",n.classes$1.caption,e),children:s});default:return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:s})}},He=({variant:t,className:e,children:s})=>n.jsxRuntimeExports.jsx(_e,{variant:t,className:e,children:s}),Ue=t=>m.forwardRef((e,s)=>n.jsxRuntimeExports.jsx("div",{...e,ref:s,className:n.classNames(e.className,t)}));function ye(t){const e=d.useRef(null);return d.useEffect(()=>{e.current=t}),e.current}const Ke={"aria-label":o.PropTypes.string,onClick:o.PropTypes.func,variant:o.PropTypes.oneOf(["white"])},me=m.forwardRef(({className:t,variant:e,"aria-label":s="Close",...a},r)=>n.jsxRuntimeExports.jsx("button",{ref:r,type:"button",className:n.classNames("btn-close",e&&`btn-close-${e}`,t),"aria-label":s,...a}));me.displayName="CloseButton";me.propTypes=Ke;const Ge=me;var qe=Function.prototype.bind.call(Function.prototype.call,[].slice);function j(t,e){return qe(t.querySelectorAll(e))}const Pe="data-rr-ui-";function Re(t){return`${Pe}${t}`}var J;function ge(t){if((!J&&J!==0||t)&&o.canUseDOM){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),J=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return J}function ce(t){t===void 0&&(t=o.ownerDocument());try{var e=t.activeElement;return!e||!e.nodeName?null:e}catch{return t.body}}function ze(t=document){const e=t.defaultView;return Math.abs(e.innerWidth-t.documentElement.clientWidth)}const xe=Re("modal-open");class Ve{constructor({ownerDocument:e,handleContainerOverflow:s=!0,isRTL:a=!1}={}){this.handleContainerOverflow=s,this.isRTL=a,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return ze(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const s={overflow:"hidden"},a=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[a]:r.style[a]},e.scrollBarWidth&&(s[a]=`${parseInt(o.style(r,a)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(xe,""),o.style(r,s)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){const s=this.getElement();s.removeAttribute(xe),Object.assign(s.style,e.style)}add(e){let s=this.modals.indexOf(e);return s!==-1||(s=this.modals.length,this.modals.push(e),this.setModalAttributes(e),s!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),s}remove(e){const s=this.modals.indexOf(e);s!==-1&&(this.modals.splice(s,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}const fe=Ve,Xe=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Ye(t,e){if(t==null)return{};var s={},a=Object.keys(t),r,l;for(l=0;l<a.length;l++)r=a[l],!(e.indexOf(r)>=0)&&(s[r]=t[r]);return s}let de;function Je(t){return de||(de=new fe({ownerDocument:t==null?void 0:t.document})),de}function Qe(t){const e=o.useWindow(),s=t||Je(e),a=d.useRef({dialog:null,backdrop:null});return Object.assign(a.current,{add:()=>s.add(a.current),remove:()=>s.remove(a.current),isTopModal:()=>s.isTopModal(a.current),setDialogRef:d.useCallback(r=>{a.current.dialog=r},[]),setBackdropRef:d.useCallback(r=>{a.current.backdrop=r},[])})}const ve=d.forwardRef((t,e)=>{let{show:s=!1,role:a="dialog",className:r,style:l,children:E,backdrop:p=!0,keyboard:y=!0,onBackdropClick:N,onEscapeKeyDown:h,transition:S,runTransition:R,backdropTransition:b,runBackdropTransition:Q,autoFocus:_=!0,enforceFocus:Z=!0,restoreFocus:T=!0,restoreFocusOptions:ee,renderDialog:H,renderBackdrop:te=c=>n.jsxRuntimeExports.jsx("div",Object.assign({},c)),manager:se,container:ne,onShow:U,onHide:D=()=>{},onExit:oe,onExited:$,onExiting:K,onEnter:G,onEntering:q,onEntered:P}=t,ae=Ye(t,Xe);const g=o.useWindow(),M=o.useWaitForDOMRef(ne),u=Qe(se),re=o.useMounted(),z=ye(s),[v,w]=d.useState(!s),f=d.useRef(null);d.useImperativeHandle(e,()=>u,[u]),o.canUseDOM&&!z&&s&&(f.current=ce(g==null?void 0:g.document)),s&&v&&w(!1);const x=o.useEventCallback(()=>{if(u.add(),C.current=o.listen(document,"keydown",le),L.current=o.listen(document,"focus",()=>setTimeout(ie),!0),U&&U(),_){var c,Y;const I=ce((c=(Y=u.dialog)==null?void 0:Y.ownerDocument)!=null?c:g==null?void 0:g.document);u.dialog&&I&&!o.contains(u.dialog,I)&&(f.current=I,u.dialog.focus())}}),F=o.useEventCallback(()=>{if(u.remove(),C.current==null||C.current(),L.current==null||L.current(),T){var c;(c=f.current)==null||c.focus==null||c.focus(ee),f.current=null}});d.useEffect(()=>{!s||!M||x()},[s,M,x]),d.useEffect(()=>{v&&F()},[v,F]),o.useWillUnmount(()=>{F()});const ie=o.useEventCallback(()=>{if(!Z||!re()||!u.isTopModal())return;const c=ce(g==null?void 0:g.document);u.dialog&&c&&!o.contains(u.dialog,c)&&u.dialog.focus()}),V=o.useEventCallback(c=>{c.target===c.currentTarget&&(N==null||N(c),p===!0&&D())}),le=o.useEventCallback(c=>{y&&o.isEscKey(c)&&u.isTopModal()&&(h==null||h(c),c.defaultPrevented||D())}),L=d.useRef(),C=d.useRef(),X=(...c)=>{w(!0),$==null||$(...c)};if(!M)return null;const k=Object.assign({role:a,ref:u.setDialogRef,"aria-modal":a==="dialog"?!0:void 0},ae,{style:l,className:r,tabIndex:-1});let W=H?H(k):n.jsxRuntimeExports.jsx("div",Object.assign({},k,{children:m.cloneElement(E,{role:"document"})}));W=o.renderTransition(S,R,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!s,onExit:oe,onExiting:K,onExited:X,onEnter:G,onEntering:q,onEntered:P,children:W});let O=null;return p&&(O=te({ref:u.setBackdropRef,onClick:V}),O=o.renderTransition(b,Q,{in:!!s,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:O})),n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:Le.createPortal(n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[O,W]}),M)})});ve.displayName="Modal";const Ze=Object.assign(ve,{Manager:fe});function et(t,e){t.classList?t.classList.add(e):o.hasClass(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Ee(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function tt(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Ee(t.className,e):t.setAttribute("class",Ee(t.className&&t.className.baseVal||"",e))}const A={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class st extends fe{adjustAndStore(e,s,a){const r=s.style[e];s.dataset[e]=r,o.style(s,{[e]:`${parseFloat(o.style(s,e))+a}px`})}restore(e,s){const a=s.dataset[e];a!==void 0&&(delete s.dataset[e],o.style(s,{[e]:a}))}setContainerStyle(e){super.setContainerStyle(e);const s=this.getElement();if(et(s,"modal-open"),!e.scrollBarWidth)return;const a=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";j(s,A.FIXED_CONTENT).forEach(l=>this.adjustAndStore(a,l,e.scrollBarWidth)),j(s,A.STICKY_CONTENT).forEach(l=>this.adjustAndStore(r,l,-e.scrollBarWidth)),j(s,A.NAVBAR_TOGGLER).forEach(l=>this.adjustAndStore(r,l,e.scrollBarWidth))}removeContainerStyle(e){super.removeContainerStyle(e);const s=this.getElement();tt(s,"modal-open");const a=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";j(s,A.FIXED_CONTENT).forEach(l=>this.restore(a,l)),j(s,A.STICKY_CONTENT).forEach(l=>this.restore(r,l)),j(s,A.NAVBAR_TOGGLER).forEach(l=>this.restore(r,l))}}let ue;function nt(t){return ue||(ue=new st(t)),ue}const je=m.forwardRef(({className:t,bsPrefix:e,as:s="div",...a},r)=>(e=o.useBootstrapPrefix(e,"modal-body"),n.jsxRuntimeExports.jsx(s,{ref:r,className:n.classNames(t,e),...a})));je.displayName="ModalBody";const ot=je,at=m.createContext({onHide(){}}),Ne=at,be=m.forwardRef(({bsPrefix:t,className:e,contentClassName:s,centered:a,size:r,fullscreen:l,children:E,scrollable:p,...y},N)=>{t=o.useBootstrapPrefix(t,"modal");const h=`${t}-dialog`,S=typeof l=="string"?`${t}-fullscreen-${l}`:`${t}-fullscreen`;return n.jsxRuntimeExports.jsx("div",{...y,ref:N,className:n.classNames(h,e,r&&`${t}-${r}`,a&&`${h}-centered`,p&&`${h}-scrollable`,l&&S),children:n.jsxRuntimeExports.jsx("div",{className:n.classNames(`${t}-content`,s),children:E})})});be.displayName="ModalDialog";const Te=be,Me=m.forwardRef(({className:t,bsPrefix:e,as:s="div",...a},r)=>(e=o.useBootstrapPrefix(e,"modal-footer"),n.jsxRuntimeExports.jsx(s,{ref:r,className:n.classNames(t,e),...a})));Me.displayName="ModalFooter";const rt=Me,it=m.forwardRef(({closeLabel:t="Close",closeVariant:e,closeButton:s=!1,onHide:a,children:r,...l},E)=>{const p=d.useContext(Ne),y=o.useEventCallback(()=>{p==null||p.onHide(),a==null||a()});return n.jsxRuntimeExports.jsxs("div",{ref:E,...l,children:[r,s&&n.jsxRuntimeExports.jsx(Ge,{"aria-label":t,variant:e,onClick:y})]})}),lt=it,we=m.forwardRef(({bsPrefix:t,className:e,closeLabel:s="Close",closeButton:a=!1,...r},l)=>(t=o.useBootstrapPrefix(t,"modal-header"),n.jsxRuntimeExports.jsx(lt,{ref:l,...r,className:n.classNames(e,t),closeLabel:s,closeButton:a})));we.displayName="ModalHeader";const ct=we,dt=Ue("h4"),Ce=m.forwardRef(({className:t,bsPrefix:e,as:s=dt,...a},r)=>(e=o.useBootstrapPrefix(e,"modal-title"),n.jsxRuntimeExports.jsx(s,{ref:r,className:n.classNames(t,e),...a})));Ce.displayName="ModalTitle";const ut=Ce;function mt(t){return n.jsxRuntimeExports.jsx(o.Fade,{...t,timeout:null})}function ft(t){return n.jsxRuntimeExports.jsx(o.Fade,{...t,timeout:null})}const ke=m.forwardRef(({bsPrefix:t,className:e,style:s,dialogClassName:a,contentClassName:r,children:l,dialogAs:E=Te,"data-bs-theme":p,"aria-labelledby":y,"aria-describedby":N,"aria-label":h,show:S=!1,animation:R=!0,backdrop:b=!0,keyboard:Q=!0,onEscapeKeyDown:_,onShow:Z,onHide:T,container:ee,autoFocus:H=!0,enforceFocus:te=!0,restoreFocus:se=!0,restoreFocusOptions:ne,onEntered:U,onExit:D,onExiting:oe,onEnter:$,onEntering:K,onExited:G,backdropClassName:q,manager:P,...ae},g)=>{const[M,u]=d.useState({}),[re,z]=d.useState(!1),v=d.useRef(!1),w=d.useRef(!1),f=d.useRef(null),[x,F]=o.useCallbackRef(),ie=o.useMergedRefs(g,F),V=o.useEventCallback(T),le=o.useIsRTL();t=o.useBootstrapPrefix(t,"modal");const L=d.useMemo(()=>({onHide:V}),[V]);function C(){return P||nt({isRTL:le})}function X(i){if(!o.canUseDOM)return;const B=C().getScrollbarWidth()>0,he=i.scrollHeight>o.ownerDocument(i).documentElement.clientHeight;u({paddingRight:B&&!he?ge():void 0,paddingLeft:!B&&he?ge():void 0})}const k=o.useEventCallback(()=>{x&&X(x.dialog)});o.useWillUnmount(()=>{o.removeEventListener(window,"resize",k),f.current==null||f.current()});const W=()=>{v.current=!0},O=i=>{v.current&&x&&i.target===x.dialog&&(w.current=!0),v.current=!1},c=()=>{z(!0),f.current=o.transitionEnd(x.dialog,()=>{z(!1)})},Y=i=>{i.target===i.currentTarget&&c()},I=i=>{if(b==="static"){Y(i);return}if(w.current||i.target!==i.currentTarget){w.current=!1;return}T==null||T()},Oe=i=>{Q?_==null||_(i):(i.preventDefault(),b==="static"&&c())},Be=(i,B)=>{i&&X(i),$==null||$(i,B)},Ae=i=>{f.current==null||f.current(),D==null||D(i)},Se=(i,B)=>{K==null||K(i,B),o.addEventListener(window,"resize",k)},De=i=>{i&&(i.style.display=""),G==null||G(i),o.removeEventListener(window,"resize",k)},$e=d.useCallback(i=>n.jsxRuntimeExports.jsx("div",{...i,className:n.classNames(`${t}-backdrop`,q,!R&&"show")}),[R,q,t]),pe={...s,...M};pe.display="block";const Fe=i=>n.jsxRuntimeExports.jsx("div",{role:"dialog",...i,style:pe,className:n.classNames(e,t,re&&`${t}-static`,!R&&"show"),onClick:b?I:void 0,onMouseUp:O,"data-bs-theme":p,"aria-label":h,"aria-labelledby":y,"aria-describedby":N,children:n.jsxRuntimeExports.jsx(E,{...ae,onMouseDown:W,className:a,contentClassName:r,children:l})});return n.jsxRuntimeExports.jsx(Ne.Provider,{value:L,children:n.jsxRuntimeExports.jsx(Ze,{show:S,ref:ie,backdrop:b,container:ee,keyboard:!0,autoFocus:H,enforceFocus:te,restoreFocus:se,restoreFocusOptions:ne,onEscapeKeyDown:Oe,onShow:Z,onHide:T,onEnter:Be,onEntering:Se,onEntered:U,onExit:Ae,onExiting:oe,onExited:De,manager:C(),transition:R?mt:void 0,backdropTransition:R?ft:void 0,renderBackdrop:$e,renderDialog:Fe})})});ke.displayName="Modal";const pt=Object.assign(ke,{Body:ot,Header:ct,Title:ut,Footer:rt,Dialog:Te,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150});exports.Loading=Ie;exports.Modal=pt;exports.Typography=He;exports.dataAttr=Re;exports.qsa=j;exports.usePrevious=ye;
|