react-admin-base-bootstrap 0.9.15 → 0.9.17

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/bun.lockb CHANGED
Binary file
@@ -6,7 +6,7 @@ export declare function Relative({ children }: RelativeProps): React.FunctionCom
6
6
  export declare function Preview({ value }: {
7
7
  value: any;
8
8
  }): React.JSX.Element | null;
9
- export default function FilePickerCore({ disabled, index, move, className, accepts, value, onNotify, children, transform }: {
9
+ export default function FilePickerCore({ disabled, index, move, className, accepts, value, onNotify, isReplace, children, transform }: {
10
10
  disabled?: any;
11
11
  index?: number;
12
12
  move?: any;
@@ -14,6 +14,7 @@ export default function FilePickerCore({ disabled, index, move, className, accep
14
14
  accepts?: any;
15
15
  value?: any;
16
16
  onNotify?: any;
17
+ isReplace?: boolean;
17
18
  children?: any;
18
19
  transform?: any;
19
20
  }): React.JSX.Element | null;
@@ -35,7 +35,7 @@ export function Preview({ value }) {
35
35
  }
36
36
  return null;
37
37
  }
38
- export default function FilePickerCore({ disabled, index, move, className, accepts, value, onNotify, children, transform }) {
38
+ export default function FilePickerCore({ disabled, index, move, className, accepts, value, onNotify, isReplace = false, children, transform }) {
39
39
  const [uc, cancel, pick] = useFilePicker(value, onNotify);
40
40
  const CustomPreview = usePreviewComponent() || Preview;
41
41
  const chooseFile = useCallback(function (e) {
@@ -68,7 +68,7 @@ export default function FilePickerCore({ disabled, index, move, className, accep
68
68
  React.createElement("div", { className: className },
69
69
  React.createElement(DragAndDropArrow, { className: "me-1" }),
70
70
  !disabled && React.createElement(Button, { type: "button", color: "danger", outline: true, size: "sm", className: "me-1", onClick: cancel },
71
- React.createElement("i", { className: "fa fa-trash" })),
71
+ React.createElement("i", { className: isReplace ? "fa fa-rotate" : "fa fa-trash" })),
72
72
  "\u00A0",
73
73
  React.createElement(Relative, null,
74
74
  React.createElement("a", { href: uc.$src, target: "_blank", className: "btn btn-sm btn-outline-primary" },
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare function useIsMobile(): boolean;
3
2
  export declare function useMenuState(): [boolean, import("react").DispatchWithoutAction];
@@ -7,5 +7,6 @@ export interface SingleFilePickerProps {
7
7
  onChange: (value: any) => void;
8
8
  children?: (value: any) => React.ReactNode;
9
9
  transform?: any;
10
+ isReplace?: boolean;
10
11
  }
11
- export default function SingleFilePicker({ disabled, className, accepts, value, onChange, transform, children }: SingleFilePickerProps): React.JSX.Element;
12
+ export default function SingleFilePicker({ disabled, className, accepts, value, onChange, transform, isReplace, children }: SingleFilePickerProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useMemo } from 'react';
2
2
  import { useUploadController } from "react-admin-base";
3
3
  import FilePickerCore from "./FilePickerCore";
4
- export default function SingleFilePicker({ disabled, className, accepts, value, onChange, transform, children }) {
4
+ export default function SingleFilePicker({ disabled, className, accepts, value, onChange, transform, isReplace = false, children }) {
5
5
  const uploadController = useUploadController();
6
6
  const controller = useMemo(() => uploadController(value), [uploadController, value]);
7
7
  const _onChange = useCallback(function () {
@@ -16,5 +16,5 @@ export default function SingleFilePicker({ disabled, className, accepts, value,
16
16
  }
17
17
  }
18
18
  }, [value, controller, onChange]);
19
- return React.createElement(FilePickerCore, { disabled: !!disabled, className: className, accepts: accepts, value: controller, onNotify: _onChange, transform: transform }, children);
19
+ return React.createElement(FilePickerCore, { disabled: !!disabled, className: className, accepts: accepts, value: controller, onNotify: _onChange, transform: transform, isReplace: isReplace }, children);
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-admin-base-bootstrap",
3
- "version": "0.9.15",
3
+ "version": "0.9.17",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -31,28 +31,28 @@
31
31
  "react-router-dom": "^6.21.3"
32
32
  },
33
33
  "dependencies": {
34
- "@emotion/react": "^11.11.3",
35
- "@fortawesome/fontawesome-free": "^6.5.1",
36
- "bootstrap": "^5.3.2",
34
+ "@emotion/react": "^11.13.3",
35
+ "@fortawesome/fontawesome-free": "^6.6.0",
36
+ "bootstrap": "^5.3.3",
37
37
  "file-dialog": "^0.0.8",
38
38
  "modal-cropper": "^1.2.3",
39
39
  "nprogress": "^0.2.0",
40
40
  "prettysize": "^2.0.0",
41
- "react-admin-base": "^0.9.1",
41
+ "react-admin-base": "^0.9.3",
42
42
  "react-dnd": "^16.0.1",
43
43
  "react-dnd-html5-backend": "^16.0.1",
44
44
  "react-password-strength-bar": "^0.4.1",
45
- "react-responsive": "^9.0.2",
46
- "react-select": "^5.8.0",
47
- "reactstrap": "^9.2.2",
48
- "sweetalert2": "^11.10.5",
45
+ "react-responsive": "^10.0.0",
46
+ "react-select": "^5.8.2",
47
+ "reactstrap": "^9.2.3",
48
+ "sweetalert2": "^11.14.4",
49
49
  "@dnd-kit/core": "^6.1.0",
50
50
  "@dnd-kit/modifiers": "^7.0.0",
51
51
  "@dnd-kit/sortable": "^8.0.0",
52
52
  "@dnd-kit/utilities": "^3.2.2"
53
53
  },
54
54
  "devDependencies": {
55
- "nodemon": "^3.0.3",
56
- "typescript": "^5.3.3"
55
+ "nodemon": "^3.1.7",
56
+ "typescript": "^5.6.3"
57
57
  }
58
58
  }
@@ -54,7 +54,7 @@ export function Preview({ value }) {
54
54
  return null;
55
55
  }
56
56
 
57
- export default function FilePickerCore({ disabled, index, move, className, accepts, value, onNotify, children, transform } : { disabled?: any, index?: number, move?: any, className?: any, accepts?: any, value?:any, onNotify?:any, children?:any, transform?:any }) {
57
+ export default function FilePickerCore({ disabled, index, move, className, accepts, value, onNotify, isReplace = false, children, transform } : { disabled?: any, index?: number, move?: any, className?: any, accepts?: any, value?:any, onNotify?:any, isReplace?: boolean, children?:any, transform?:any }) {
58
58
  const [ uc, cancel, pick ] = useFilePicker(value, onNotify);
59
59
  const CustomPreview = usePreviewComponent() || Preview;
60
60
 
@@ -83,7 +83,7 @@ export default function FilePickerCore({ disabled, index, move, className, accep
83
83
  return <DragAndDropItem item={index}>
84
84
  <div className={className}>
85
85
  <DragAndDropArrow className="me-1" />
86
- { !disabled && <Button type="button" color="danger" outline size="sm" className="me-1" onClick={cancel}><i className="fa fa-trash" /></Button > }
86
+ {!disabled && <Button type="button" color="danger" outline size="sm" className="me-1" onClick={cancel}><i className={isReplace ? "fa fa-rotate" : "fa fa-trash" } /></Button > }
87
87
  &nbsp;<Relative><a href={uc.$src} target="_blank" className="btn btn-sm btn-outline-primary"><i className="fa fa-download" /> { uc.name }</a></Relative>
88
88
  <span>&nbsp;({ prettysize(uc.$size) })</span>
89
89
  { <CustomPreview value={uc} /> }
@@ -11,9 +11,10 @@ export interface SingleFilePickerProps {
11
11
  onChange: (value: any) => void;
12
12
  children?: (value: any) => React.ReactNode;
13
13
  transform?: any;
14
+ isReplace?: boolean;
14
15
  }
15
16
 
16
- export default function SingleFilePicker({ disabled, className, accepts, value, onChange, transform, children }: SingleFilePickerProps) {
17
+ export default function SingleFilePicker({ disabled, className, accepts, value, onChange, transform, isReplace = false, children }: SingleFilePickerProps) {
17
18
  const uploadController = useUploadController();
18
19
  const controller = useMemo(() => uploadController(value), [uploadController, value]);
19
20
 
@@ -28,7 +29,7 @@ export default function SingleFilePicker({ disabled, className, accepts, value,
28
29
  }
29
30
  }
30
31
  }, [ value, controller, onChange ]);
31
-
32
+
32
33
  return <FilePickerCore
33
34
  disabled={!!disabled}
34
35
  className={className}
@@ -36,5 +37,6 @@ export default function SingleFilePicker({ disabled, className, accepts, value,
36
37
  value={controller}
37
38
  onNotify={_onChange}
38
39
  transform={transform}
40
+ isReplace={isReplace}
39
41
  >{children}</FilePickerCore>;
40
42
  }