Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] add Type-Icon map of common MIME Type
Browse files Browse the repository at this point in the history
[optimize] update Upstream packages
TechQuery committed Oct 30, 2023
1 parent 44e9017 commit 9933e22
Showing 3 changed files with 581 additions and 582 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx-restful-table",
"version": "1.2.0",
"version": "1.2.1",
"license": "LGPL-3.0",
"author": "shiy2008@gmail.com",
"description": "A Pagination Table & Scroll List component suite for CRUD operation, which is based on MobX RESTful & React.",
@@ -25,11 +25,11 @@
"types": "dist/index.d.ts",
"main": "dist/index.js",
"dependencies": {
"@swc/helpers": "^0.5.2",
"@swc/helpers": "^0.5.3",
"classnames": "^2.3.2",
"lodash": "^4.17.21",
"mobx-react-helper": "^0.2.7",
"react-bootstrap": "^2.9.0",
"react-bootstrap": "^2.9.1",
"regenerator-runtime": "^0.14.0",
"web-utility": "^4.1.3"
},
@@ -41,20 +41,20 @@
"react": ">=16.8"
},
"devDependencies": {
"@parcel/packager-ts": "~2.9.3",
"@parcel/transformer-typescript-types": "~2.9.3",
"@parcel/packager-ts": "~2.10.1",
"@parcel/transformer-typescript-types": "~2.10.1",
"@types/lodash": "^4.14.199",
"@types/react": "^18.2.24",
"@types/react": "^18.2.33",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"lint-staged": "^15.0.2",
"mobx": "^6.10.2",
"mobx-i18n": "^0.4.1",
"mobx-react": "^9.0.1",
"mobx-restful": "^0.6.12",
"parcel": "~2.9.3",
"parcel": "~2.10.1",
"prettier": "^3.0.3",
"react": "^18.2.0",
"typedoc": "^0.25.1",
"typedoc": "^0.25.3",
"typedoc-plugin-mdn-links": "^3.1.0",
"typescript": "~5.2.2"
},
1,132 changes: 560 additions & 572 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion source/FilePreview.tsx
Original file line number Diff line number Diff line change
@@ -11,6 +11,17 @@ export type FilePreviewProps = ImageProps &
path: string;
};

export const FileTypeMap = {
stream: 'binary',
compressed: 'zip',
msword: 'doc',
document: 'docx',
powerpoint: 'ppt',
presentation: 'pptx',
excel: 'xls',
sheet: 'xlsx',
};

export const FilePreview: FC<FilePreviewProps> = ({
type = '*/*',
path,
@@ -23,7 +34,7 @@ export const FilePreview: FC<FilePreviewProps> = ({
.split('/')
.at(-1)
?.split('.')
.at(-1) || kind.at(-1);
.at(-1) || FileTypeMap[kind.at(-1)];

return category === 'image' ? (
<ImagePreview fluid loading="lazy" src={path} {...props} />

0 comments on commit 9933e22

Please sign in to comment.