@dashadmin/dash-dialog 1.3.17 → 1.3.19
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/AppDialog.js +1 -0
- package/dist/DialogService.js +1 -0
- package/dist/IAppDialogProps.js +0 -0
- package/package.json +14 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as e,jsx as o,jsxs as f}from"react/jsx-runtime";import*as c from"react";import{Dialog as T,DialogTitle as x,DialogContent as k,DialogActions as y,Button as p,Paper as F}from"@mui/material";const I=t=>o(F,{...t}),_=t=>{const{onClose:l,onConfirm:i,onCancel:s,open:a,closeText:w=o(e,{}),confirmText:C=o(e,{}),cancelText:d=o(e,{}),title:u,variant:E,className:m,showCancelButton:g=!1,showConfirmButton:D=!0,dialogActions:h,content:P,children:O,...A}=t,[B,n]=c.useState(a);return c.useEffect(()=>{n(a)},[a]),f(T,{hideBackdrop:!0,disableEnforceFocus:!0,PaperComponent:I,onClose:r=>{n(!1),l&&l()},className:m,open:B,...A,children:[o(x,{id:"alert-dialog-title",children:u}),o(k,{children:O||P}),f(y,{children:[h||o(e,{}),g===!0?o(p,{onClick:r=>{n(!1),s&&s()},children:d}):o(e,{}),D===!0?o(p,{onClick:r=>{n(!1),i&&i()},children:C}):o(e,{})]})]})};var z=_;export{_ as AppDialog,z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as x,jsx as n,jsxs as h}from"react/jsx-runtime";import{AppDialog as P}from"./AppDialog";import{createContext as D,useContext as f,useState as u}from"react";import{Portal as S}from"@mui/material";const l=D(null),E=()=>f(l),v=i=>{const{component:r,componentProps:a={},children:p}=i,s=r||P,c={open:!1,variant:"default",content:"",title:"",children:null},[o,e]=u({...c,...a}),d=()=>{e(null),o.onCancel&&o.onCancel()},C=()=>{e(null),o.onClose&&o.onClose()},g=()=>{e(null),o.onConfirm&&o.onConfirm()},m=t=>{e({...o,...t,...t?{open:!0}:{open:!1}})};return h(x,{children:[n(S,{children:n(s,{sx:{zIndex:1e6},...o,onConfirm:()=>g(),onClose:()=>C(),onCancel:()=>d()})}),n(l.Provider,{value:m,children:p})]})};var H=v;export{l as DialogServiceContext,v as DialogServiceProvider,H as default,E as useDialog};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashadmin/dash-dialog",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lint:fix": "pnpm prettier --write .",
|
|
12
12
|
"check-updates": "pnpm npm-check-updates",
|
|
13
13
|
"updates-packages": "pnpm npm-check-updates -u",
|
|
14
|
-
"build": "vite build"
|
|
14
|
+
"build": "rm -rf dist && node ../dash-build/compile.mjs && vite build"
|
|
15
15
|
},
|
|
16
16
|
"browserslist": {
|
|
17
17
|
"production": [
|
|
@@ -112,10 +112,21 @@
|
|
|
112
112
|
"exports": {
|
|
113
113
|
".": {
|
|
114
114
|
"import": "./dist/index.js"
|
|
115
|
+
},
|
|
116
|
+
"./src/*": {
|
|
117
|
+
"import": "./dist/*.js"
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
},
|
|
118
121
|
"files": [
|
|
119
122
|
"dist"
|
|
120
|
-
]
|
|
123
|
+
],
|
|
124
|
+
"exports": {
|
|
125
|
+
".": {
|
|
126
|
+
"import": "./src/index.ts"
|
|
127
|
+
},
|
|
128
|
+
"./src/*": {
|
|
129
|
+
"import": "./src/*"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
121
132
|
}
|