mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 13:24:52 +00:00
fix: detail editor (#6566)
* fix: detail editor * feat: update code --------- Co-authored-by: 杨国璇 <ygx@192.168.1.4>
This commit is contained in:
257
frontend/package-lock.json
generated
257
frontend/package-lock.json
generated
@@ -19,7 +19,7 @@
|
||||
"@seafile/sdoc-editor": "1.0.50",
|
||||
"@seafile/seafile-calendar": "0.0.12",
|
||||
"@seafile/seafile-editor": "1.0.109",
|
||||
"@seafile/sf-metadata-ui-component": "0.0.20",
|
||||
"@seafile/sf-metadata-ui-component": "0.0.21",
|
||||
"@uiw/codemirror-extensions-langs": "^4.19.4",
|
||||
"@uiw/react-codemirror": "^4.19.4",
|
||||
"axios": "^1.7.3",
|
||||
@@ -2214,9 +2214,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@codemirror/autocomplete": {
|
||||
"version": "6.17.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.17.0.tgz",
|
||||
"integrity": "sha512-fdfj6e6ZxZf8yrkMHUSJJir7OJkHkZKaOZGzLWIYp2PZ3jd+d+UjG8zVPqJF6d3bKxkhvXTPan/UZ1t7Bqm0gA==",
|
||||
"version": "6.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.0.tgz",
|
||||
"integrity": "sha512-5DbOvBbY4qW5l57cjDsmmpDh3/TeK1vXfTHa+BUMrRzdWdcxKZ4U4V7vQaTtOpApNU4kLS4FQ6cINtLg245LXA==",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
@@ -2242,9 +2242,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/commands/node_modules/@codemirror/view": {
|
||||
"version": "6.29.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.29.1.tgz",
|
||||
"integrity": "sha512-7r+DlO/QFwPqKp73uq5mmrS4TuLPUVotbNOKYzN3OLP5ScrOVXcm4g13/48b6ZXGhdmzMinzFYqH0vo+qihIkQ==",
|
||||
"version": "6.32.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.32.0.tgz",
|
||||
"integrity": "sha512-AgVNvED2QTsZp5e3syoHLsrWtwJFYWdx1Vr/m3f4h1ATQz0ax60CfXF3Htdmk69k2MlYZw8gXesnQdHtzyVmAw==",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.4.0",
|
||||
"style-mod": "^4.1.0",
|
||||
@@ -2520,9 +2520,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/language/node_modules/@codemirror/view": {
|
||||
"version": "6.29.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.29.1.tgz",
|
||||
"integrity": "sha512-7r+DlO/QFwPqKp73uq5mmrS4TuLPUVotbNOKYzN3OLP5ScrOVXcm4g13/48b6ZXGhdmzMinzFYqH0vo+qihIkQ==",
|
||||
"version": "6.32.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.32.0.tgz",
|
||||
"integrity": "sha512-AgVNvED2QTsZp5e3syoHLsrWtwJFYWdx1Vr/m3f4h1ATQz0ax60CfXF3Htdmk69k2MlYZw8gXesnQdHtzyVmAw==",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.4.0",
|
||||
"style-mod": "^4.1.0",
|
||||
@@ -3137,26 +3137,26 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@floating-ui/core": {
|
||||
"version": "1.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.5.tgz",
|
||||
"integrity": "sha512-8GrTWmoFhm5BsMZOTHeGD2/0FLKLQQHvO/ZmQga4tKempYRLz8aqJGqXVuQgisnMObq2YZ2SgkwctN1LOOxcqA==",
|
||||
"version": "1.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.7.tgz",
|
||||
"integrity": "sha512-yDzVT/Lm101nQ5TCVeK65LtdN7Tj4Qpr9RTXJ2vPFLqtLxwOrpoxAHAJI8J3yYWUc40J0BDBheaitK5SJmno2g==",
|
||||
"dependencies": {
|
||||
"@floating-ui/utils": "^0.2.5"
|
||||
"@floating-ui/utils": "^0.2.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@floating-ui/dom": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.8.tgz",
|
||||
"integrity": "sha512-kx62rP19VZ767Q653wsP1XZCGIirkE09E0QUGNYTM/ttbbQHqcGPdSfWFxUyyNLc/W6aoJRBajOSXhP6GXjC0Q==",
|
||||
"version": "1.6.10",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.10.tgz",
|
||||
"integrity": "sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A==",
|
||||
"dependencies": {
|
||||
"@floating-ui/core": "^1.6.0",
|
||||
"@floating-ui/utils": "^0.2.5"
|
||||
"@floating-ui/utils": "^0.2.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@floating-ui/utils": {
|
||||
"version": "0.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.5.tgz",
|
||||
"integrity": "sha512-sTcG+QZ6fdEUObICavU+aB3Mp8HY4n14wYHdxK4fXjPmv3PXZZeY5RaguJmGyeH/CJQhX3fqKUtS4qc1LoHwhQ=="
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.7.tgz",
|
||||
"integrity": "sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA=="
|
||||
},
|
||||
"node_modules/@formatjs/intl-unified-numberformat": {
|
||||
"version": "3.3.7",
|
||||
@@ -4353,9 +4353,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@lezer/highlight": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz",
|
||||
"integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz",
|
||||
"integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.0.0"
|
||||
}
|
||||
@@ -4986,7 +4986,6 @@
|
||||
"version": "1.0.109",
|
||||
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-1.0.109.tgz",
|
||||
"integrity": "sha512-zj5WiflAgiOpW6fXYigFSDB1XHYPHFxET7Gr3Dc0s3UA5S4Vexl9Yjf/oqX0HHu2jHX+fbtYkFoh/F29AGz39A==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@seafile/react-image-lightbox": "2.0.5",
|
||||
"classnames": "2.3.2",
|
||||
@@ -5094,9 +5093,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@seafile/sf-metadata-ui-component": {
|
||||
"version": "0.0.20",
|
||||
"resolved": "https://registry.npmjs.org/@seafile/sf-metadata-ui-component/-/sf-metadata-ui-component-0.0.20.tgz",
|
||||
"integrity": "sha512-nCeqHgwAkd05GKd3YROf3k7XEQuh6FicOeYVXcbCXjzH1pki8XxLcv1NW4D85LvWh2eS6m+utegcAlXfS1EsJQ==",
|
||||
"version": "0.0.21",
|
||||
"resolved": "https://registry.npmjs.org/@seafile/sf-metadata-ui-component/-/sf-metadata-ui-component-0.0.21.tgz",
|
||||
"integrity": "sha512-bskuoVgMXDY5sD++MlMx9864+J3BdJ69pXZKifu40op4ebpC6qtJLAdZQV/j/ZqadyzGp1r0T340ClzhUfBQWw==",
|
||||
"dependencies": {
|
||||
"@seafile/seafile-calendar": "0.0.24",
|
||||
"@seafile/seafile-editor": "~1.0.102",
|
||||
@@ -6004,9 +6003,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/http-proxy": {
|
||||
"version": "1.17.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz",
|
||||
"integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==",
|
||||
"version": "1.17.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz",
|
||||
"integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
@@ -6130,11 +6129,11 @@
|
||||
"integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g=="
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.0.2.tgz",
|
||||
"integrity": "sha512-yPL6DyFwY5PiMVEwymNeqUTKsDczQBJ/5T7W/46RwLU/VH+AA8aT5TZkvBviLKLbbm0hlfftEkGrNzfRk/fofQ==",
|
||||
"version": "22.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.3.0.tgz",
|
||||
"integrity": "sha512-nrWpWVaDZuaVc5X84xJ0vNrLvomM205oQyLsRt7OHNZbSHslcWsvgFR7O7hire2ZonjLrWBbedmotmIlJDVd6g==",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.11.1"
|
||||
"undici-types": "~6.18.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node-forge": {
|
||||
@@ -6195,9 +6194,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-transition-group": {
|
||||
"version": "4.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz",
|
||||
"integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==",
|
||||
"version": "4.4.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.11.tgz",
|
||||
"integrity": "sha512-RM05tAniPZ5DZPzzNFP+DmrcOdD0efDUxMy3145oljWSl3x9ZV5vhme98gTxFrj2lhXvmGNnUiuDyJgY9IKkNA==",
|
||||
"dependencies": {
|
||||
"@types/react": "*"
|
||||
}
|
||||
@@ -6284,9 +6283,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/unist": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz",
|
||||
"integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ=="
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
|
||||
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="
|
||||
},
|
||||
"node_modules/@types/vfile": {
|
||||
"version": "3.0.2",
|
||||
@@ -7569,9 +7568,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/autoprefixer": {
|
||||
"version": "10.4.19",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz",
|
||||
"integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==",
|
||||
"version": "10.4.20",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz",
|
||||
"integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -7588,11 +7587,11 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"browserslist": "^4.23.0",
|
||||
"caniuse-lite": "^1.0.30001599",
|
||||
"browserslist": "^4.23.3",
|
||||
"caniuse-lite": "^1.0.30001646",
|
||||
"fraction.js": "^4.3.7",
|
||||
"normalize-range": "^0.1.2",
|
||||
"picocolors": "^1.0.0",
|
||||
"picocolors": "^1.0.1",
|
||||
"postcss-value-parser": "^4.2.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -7629,9 +7628,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.7.3",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz",
|
||||
"integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==",
|
||||
"version": "1.7.4",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz",
|
||||
"integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
@@ -7869,13 +7868,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-polyfill-corejs3": {
|
||||
"version": "0.10.4",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz",
|
||||
"integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==",
|
||||
"version": "0.10.6",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz",
|
||||
"integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-define-polyfill-provider": "^0.6.1",
|
||||
"core-js-compat": "^3.36.1"
|
||||
"@babel/helper-define-polyfill-provider": "^0.6.2",
|
||||
"core-js-compat": "^3.38.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
|
||||
@@ -7900,23 +7899,26 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/babel-preset-current-node-syntax": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz",
|
||||
"integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz",
|
||||
"integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-async-generators": "^7.8.4",
|
||||
"@babel/plugin-syntax-bigint": "^7.8.3",
|
||||
"@babel/plugin-syntax-class-properties": "^7.8.3",
|
||||
"@babel/plugin-syntax-import-meta": "^7.8.3",
|
||||
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
||||
"@babel/plugin-syntax-class-static-block": "^7.14.5",
|
||||
"@babel/plugin-syntax-import-attributes": "^7.24.7",
|
||||
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
||||
"@babel/plugin-syntax-json-strings": "^7.8.3",
|
||||
"@babel/plugin-syntax-logical-assignment-operators": "^7.8.3",
|
||||
"@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
|
||||
"@babel/plugin-syntax-numeric-separator": "^7.8.3",
|
||||
"@babel/plugin-syntax-numeric-separator": "^7.10.4",
|
||||
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
|
||||
"@babel/plugin-syntax-optional-chaining": "^7.8.3",
|
||||
"@babel/plugin-syntax-top-level-await": "^7.8.3"
|
||||
"@babel/plugin-syntax-private-property-in-object": "^7.14.5",
|
||||
"@babel/plugin-syntax-top-level-await": "^7.14.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
@@ -8540,9 +8542,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001646",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001646.tgz",
|
||||
"integrity": "sha512-dRg00gudiBDDTmUhClSdv3hqRfpbOnU28IpI1T6PBTLWa+kOj0681C8uML3PifYfREuBrVjDGhL3adYpBT6spw==",
|
||||
"version": "1.0.30001651",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz",
|
||||
"integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -9148,12 +9150,12 @@
|
||||
"hasInstallScript": true
|
||||
},
|
||||
"node_modules/core-js-compat": {
|
||||
"version": "3.37.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz",
|
||||
"integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==",
|
||||
"version": "3.38.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.0.tgz",
|
||||
"integrity": "sha512-75LAicdLa4OJVwFxFbQR3NdnZjNgX6ILpVcVzcC4T2smerB5lELMrJQQQoWV6TiuC/vlaFqgU2tKQx9w5s0e0A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"browserslist": "^4.23.0"
|
||||
"browserslist": "^4.23.3"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -9161,9 +9163,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/core-js-pure": {
|
||||
"version": "3.37.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.37.1.tgz",
|
||||
"integrity": "sha512-J/r5JTHSmzTxbiYYrzXg9w1VpqrYt+gexenBE9pugeyhwPZTAEJddyiReJWsLO6uNQ8xJZFbod6XC7KKwatCiA==",
|
||||
"version": "3.38.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.38.0.tgz",
|
||||
"integrity": "sha512-8balb/HAXo06aHP58mZMtXgD8vcnXz9tUDePgqBgJgKdmTlMt+jw3ujqniuBDQXMvTzxnMpxHFeuSM3g1jWQuQ==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"funding": {
|
||||
@@ -10442,15 +10444,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz",
|
||||
"integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==",
|
||||
"version": "1.5.7",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.7.tgz",
|
||||
"integrity": "sha512-6FTNWIWMxMy/ZY6799nBlPtF1DFDQ6VQJ7yyDP27SJNt5lwtQ5ufqVvHylb3fdQefvRcgA3fKcFMJi9OLwBRNw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/elliptic": {
|
||||
"version": "6.5.6",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.6.tgz",
|
||||
"integrity": "sha512-mpzdtpeCLuS3BmE3pO3Cpp5bbjlOPY2Q0PgoF+Od1XZrHLYI28Xe3ossCmYCQt11FQKEYd9+PF8jymTvtWJSHQ==",
|
||||
"version": "6.5.7",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz",
|
||||
"integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"bn.js": "^4.11.9",
|
||||
@@ -11731,9 +11733,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/expect/node_modules/@types/yargs": {
|
||||
"version": "17.0.32",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz",
|
||||
"integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==",
|
||||
"version": "17.0.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",
|
||||
"integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
@@ -12271,9 +12273,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz",
|
||||
"integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==",
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
|
||||
"integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.0",
|
||||
@@ -13305,9 +13307,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-to-html/node_modules/@types/unist": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
|
||||
"integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
|
||||
"integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="
|
||||
},
|
||||
"node_modules/hast-util-to-html/node_modules/hast-util-from-parse5": {
|
||||
"version": "7.1.2",
|
||||
@@ -14010,9 +14012,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
|
||||
"integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
|
||||
"integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
@@ -16097,9 +16099,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jest-message-util/node_modules/@types/yargs": {
|
||||
"version": "17.0.32",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz",
|
||||
"integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==",
|
||||
"version": "17.0.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",
|
||||
"integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
@@ -17046,9 +17048,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jest-watch-typeahead/node_modules/@types/yargs": {
|
||||
"version": "17.0.32",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz",
|
||||
"integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==",
|
||||
"version": "17.0.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",
|
||||
"integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
@@ -17723,9 +17725,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/launch-editor": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.8.0.tgz",
|
||||
"integrity": "sha512-vJranOAJrI/llyWGRQqiDM+adrw+k83fvmmx3+nV47g3+36xM15jE+zyZ6Ffel02+xSvuM0b2GDRosXZkbb6wA==",
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.8.1.tgz",
|
||||
"integrity": "sha512-elBx2l/tp9z99X5H/qev8uyDywVh0VXAwEbjk8kJhnc5grOFkGh7aW6q55me9xnYbss261XtnUrysZ+XvGbhQA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"picocolors": "^1.0.0",
|
||||
@@ -20183,9 +20185,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.40",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz",
|
||||
"integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==",
|
||||
"version": "8.4.41",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz",
|
||||
"integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -21377,9 +21379,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss-selector-parser": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.1.tgz",
|
||||
"integrity": "sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==",
|
||||
"version": "6.1.2",
|
||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",
|
||||
"integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cssesc": "^3.0.0",
|
||||
@@ -22130,9 +22132,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-app-polyfill/node_modules/core-js": {
|
||||
"version": "3.37.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz",
|
||||
"integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==",
|
||||
"version": "3.38.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.38.0.tgz",
|
||||
"integrity": "sha512-XPpwqEodRljce9KswjZShh95qJ1URisBeKCjUdq27YdenkslVe7OO0ZJhlYXAChW7OhXaRLl8AAba7IBfoIHug==",
|
||||
"hasInstallScript": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -23269,9 +23271,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-stringify/node_modules/@types/unist": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
|
||||
"integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
|
||||
"integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="
|
||||
},
|
||||
"node_modules/rehype-stringify/node_modules/bail": {
|
||||
"version": "2.0.2",
|
||||
@@ -24465,7 +24467,6 @@
|
||||
"version": "0.2.234",
|
||||
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.234.tgz",
|
||||
"integrity": "sha512-lYYJvOAkYaQsx7Bv03F9m16JTBWUIdt8DXKi7YoZipn/0q4zbJmoOG55FS2NzbvYq/8yUUkQyueDez9XMAtfZA==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "^1.7.3",
|
||||
"form-data": "4.0.0"
|
||||
@@ -26435,9 +26436,9 @@
|
||||
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
"version": "3.4.7",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.7.tgz",
|
||||
"integrity": "sha512-rxWZbe87YJb4OcSopb7up2Ba4U82BoiSGUdoDr3Ydrg9ckxFS/YWsvhN323GMcddgU65QRy7JndC7ahhInhvlQ==",
|
||||
"version": "3.4.10",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.10.tgz",
|
||||
"integrity": "sha512-KWZkVPm7yJRhdu4SRSl9d4AK2wM3a50UsvgHZO7xY77NQr2V+fIrEuoDGQcbvswWvFGbS2f6e+jC/6WJm1Dl0w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@alloc/quick-lru": "^5.2.0",
|
||||
@@ -26536,9 +26537,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.31.3",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz",
|
||||
"integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==",
|
||||
"version": "5.31.6",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz",
|
||||
"integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/source-map": "^0.3.3",
|
||||
@@ -27203,9 +27204,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "6.11.1",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.11.1.tgz",
|
||||
"integrity": "sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ=="
|
||||
"version": "6.18.2",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.18.2.tgz",
|
||||
"integrity": "sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ=="
|
||||
},
|
||||
"node_modules/unicode-canonical-property-names-ecmascript": {
|
||||
"version": "2.0.0",
|
||||
@@ -27271,9 +27272,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/unified/node_modules/@types/unist": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
|
||||
"integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
|
||||
"integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="
|
||||
},
|
||||
"node_modules/unified/node_modules/unist-util-stringify-position": {
|
||||
"version": "1.1.2",
|
||||
@@ -27875,9 +27876,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz",
|
||||
"integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==",
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz",
|
||||
"integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
|
@@ -14,7 +14,7 @@
|
||||
"@seafile/sdoc-editor": "1.0.50",
|
||||
"@seafile/seafile-calendar": "0.0.12",
|
||||
"@seafile/seafile-editor": "1.0.109",
|
||||
"@seafile/sf-metadata-ui-component": "0.0.20",
|
||||
"@seafile/sf-metadata-ui-component": "0.0.21",
|
||||
"@uiw/codemirror-extensions-langs": "^4.19.4",
|
||||
"@uiw/react-codemirror": "^4.19.4",
|
||||
"axios": "^1.7.3",
|
||||
|
@@ -80,9 +80,9 @@ class MetadataManagerAPI {
|
||||
return this.req.get(url, { params: params });
|
||||
}
|
||||
|
||||
modifyRecord = (repoID, recordID, update) => {
|
||||
modifyRecord = (repoID, recordID, update, objID) => {
|
||||
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/records/';
|
||||
const data = { records_data: [{ record_id: recordID, record: update }] };
|
||||
const data = { records_data: [{ record_id: recordID, record: update, obj_id: objID }] };
|
||||
return this.req.put(url, data);
|
||||
};
|
||||
|
||||
|
@@ -15,6 +15,9 @@ export const NOT_DISPLAY_COLUMN_KEYS = [
|
||||
PRIVATE_COLUMN_KEY.IS_DIR,
|
||||
PRIVATE_COLUMN_KEY.FILE_TYPE,
|
||||
PRIVATE_COLUMN_KEY.LOCATION,
|
||||
PRIVATE_COLUMN_KEY.OBJ_ID,
|
||||
PRIVATE_COLUMN_KEY.SIZE,
|
||||
PRIVATE_COLUMN_KEY.SUFFIX,
|
||||
];
|
||||
|
||||
export {
|
||||
|
@@ -48,7 +48,7 @@ const MetadataDetails = ({ repoID, filePath, repoInfo, direntType, emptyTip }) =
|
||||
const options = getColumnOptions(field);
|
||||
update = { [fileName]: getOptionName(options, newValue) };
|
||||
}
|
||||
metadataAPI.modifyRecord(repoID, record._id, update).then(res => {
|
||||
metadataAPI.modifyRecord(repoID, record._id, update, record._obj_id).then(res => {
|
||||
const newMetadata = { ...metadata, record: { ...record, ...update } };
|
||||
setMetadata(newMetadata);
|
||||
}).catch(error => {
|
||||
@@ -74,7 +74,7 @@ const MetadataDetails = ({ repoID, filePath, repoInfo, direntType, emptyTip }) =
|
||||
if (!PREDEFINED_COLUMN_KEYS.includes(fieldKey) && newField.type === CellType.SINGLE_SELECT) {
|
||||
update = { [fileName]: getOptionName(options, newOption.id) };
|
||||
}
|
||||
return metadataAPI.modifyRecord(repoID, record._id, update);
|
||||
return metadataAPI.modifyRecord(repoID, record._id, update, record._obj_id);
|
||||
}).then(res => {
|
||||
const newMetadata = { ...metadata, record: { ...record, ...update }, fields: newFields };
|
||||
setMetadata(newMetadata);
|
||||
|
@@ -6,6 +6,8 @@ export const NOT_DISPLAY_COLUMN_KEYS = [
|
||||
PRIVATE_COLUMN_KEY.MTIME,
|
||||
PRIVATE_COLUMN_KEY.CREATOR,
|
||||
PRIVATE_COLUMN_KEY.LAST_MODIFIER,
|
||||
PRIVATE_COLUMN_KEY.OBJ_ID,
|
||||
PRIVATE_COLUMN_KEY.SUFFIX,
|
||||
];
|
||||
|
||||
export const VIEW_NOT_DISPLAY_COLUMN_KEYS = [
|
||||
|
@@ -22,6 +22,10 @@ export const PRIVATE_COLUMN_KEY = {
|
||||
FILE_EXPIRED: '_expired',
|
||||
FILE_STATUS: '_status',
|
||||
LOCATION: '_location',
|
||||
OBJ_ID: '_obj_id',
|
||||
SIZE: '_size',
|
||||
SUFFIX: '_suffix',
|
||||
FILE_DETAILS: '_file_details',
|
||||
};
|
||||
|
||||
export const PRIVATE_COLUMN_KEYS = [
|
||||
@@ -45,6 +49,10 @@ export const PRIVATE_COLUMN_KEYS = [
|
||||
PRIVATE_COLUMN_KEY.FILE_EXPIRED,
|
||||
PRIVATE_COLUMN_KEY.FILE_STATUS,
|
||||
PRIVATE_COLUMN_KEY.LOCATION,
|
||||
PRIVATE_COLUMN_KEY.OBJ_ID,
|
||||
PRIVATE_COLUMN_KEY.SIZE,
|
||||
PRIVATE_COLUMN_KEY.SUFFIX,
|
||||
PRIVATE_COLUMN_KEY.FILE_DETAILS,
|
||||
];
|
||||
|
||||
export const EDITABLE_PRIVATE_COLUMN_KEYS = [
|
||||
|
@@ -152,4 +152,6 @@ export {
|
||||
getGeolocationByGranularity,
|
||||
getFloatNumber,
|
||||
isNumber,
|
||||
getCellValueDisplayString,
|
||||
getCellValueStringResult,
|
||||
} from './utils';
|
||||
|
@@ -3,6 +3,8 @@ import { round } from '../../number';
|
||||
import { DEFAULT_NUMBER_FORMAT } from '../../../constants/column';
|
||||
import { DISPLAY_INTERNAL_ERRORS } from '../../../constants';
|
||||
|
||||
const SIZES = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
||||
|
||||
const separatorMap = {
|
||||
comma: ',',
|
||||
dot: '.',
|
||||
@@ -168,6 +170,13 @@ const getNumberDisplayString = (number, formats) => {
|
||||
}
|
||||
return `${formats.currency_symbol || ''}${toThousands(number, { formats })}`;
|
||||
}
|
||||
case 'byte': {
|
||||
if (number < 0) return '--';
|
||||
if (number === 0) return number + ' ' + SIZES[0];
|
||||
const i = parseInt(Math.floor(Math.log(number) / Math.log(1000)), 10);
|
||||
if (i === 0) return number + ' ' + SIZES[i];
|
||||
return (number / (1000 ** i)).toFixed(1) + ' ' + SIZES[i];
|
||||
}
|
||||
default: {
|
||||
return String(number);
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import { DateUtils, CellType, DEFAULT_DATE_FORMAT, getCollaboratorsName, getOptionName, getDateDisplayString, getLongtextDisplayString, getNumberDisplayString } from '../../_basic';
|
||||
import { CellType, DEFAULT_DATE_FORMAT } from '../../constants';
|
||||
import { getCollaboratorsName, getOptionName, getDateDisplayString, getLongtextDisplayString, getNumberDisplayString } from './column';
|
||||
import DateUtils from '../date';
|
||||
|
||||
const getCellValueDisplayString = (row, type, key, { data, collaborators = [] } = {}) => {
|
||||
export const getCellValueDisplayString = (row, type, key, { data, collaborators = [] } = {}) => {
|
||||
if (!row) return '';
|
||||
const cellValue = row[key];
|
||||
switch (type) {
|
||||
@@ -39,7 +41,7 @@ const getCellValueDisplayString = (row, type, key, { data, collaborators = [] }
|
||||
}
|
||||
};
|
||||
|
||||
const getCellValueStringResult = (row, column, { collaborators = [] } = {}) => {
|
||||
export const getCellValueStringResult = (row, column, { collaborators = [] } = {}) => {
|
||||
if (!row || !column) return '';
|
||||
const { key, type, data } = column;
|
||||
let cellValue = row[key];
|
||||
@@ -91,8 +93,3 @@ const getCellValueStringResult = (row, column, { collaborators = [] } = {}) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
getCellValueDisplayString,
|
||||
getCellValueStringResult,
|
||||
};
|
@@ -3,6 +3,11 @@ export {
|
||||
getCellValueByColumn,
|
||||
} from './core';
|
||||
|
||||
export {
|
||||
getCellValueDisplayString,
|
||||
getCellValueStringResult,
|
||||
} from './common';
|
||||
|
||||
export {
|
||||
getDateDisplayString,
|
||||
getPrecisionNumber,
|
||||
|
@@ -204,4 +204,5 @@ class DateUtils {
|
||||
}
|
||||
}
|
||||
|
||||
export default DateUtils;
|
||||
export { DateUtils };
|
||||
|
@@ -23,6 +23,8 @@ export {
|
||||
getGeolocationByGranularity,
|
||||
getFloatNumber,
|
||||
isNumber,
|
||||
getCellValueDisplayString,
|
||||
getCellValueStringResult,
|
||||
} from './cell';
|
||||
export {
|
||||
getColumnType,
|
||||
|
@@ -34,3 +34,11 @@
|
||||
.sf-metadata-collaborator-property-editor-popover .sf-metadata-delete-collaborator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sf-metadata-collaborator-property-detail-editor:empty::before {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
padding: 6.5px 6px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
@@ -5,12 +5,14 @@ import { KeyCodes } from '../../../_basic';
|
||||
import { getEventClassName, gettext } from '../../../utils';
|
||||
import Editor from '../../cell-editor/collaborator-editor';
|
||||
import DeleteCollaborator from '../../cell-editor/collaborator-editor/delete-collaborator';
|
||||
import { useCollaborators } from '../../../../hooks';
|
||||
|
||||
import './index.css';
|
||||
|
||||
const CollaboratorEditor = ({ field, value, onChange }) => {
|
||||
const ref = useRef(null);
|
||||
const [showEditor, setShowEditor] = useState(false);
|
||||
const { getCollaborator } = useCollaborators();
|
||||
|
||||
const onClick = useCallback((event) => {
|
||||
if (!showEditor) return;
|
||||
@@ -79,6 +81,7 @@ const CollaboratorEditor = ({ field, value, onChange }) => {
|
||||
);
|
||||
}, [showEditor, onCommit, value, field]);
|
||||
|
||||
const validValue = Array.isArray(value) ? value.filter(email => getCollaborator(email)) : [];
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -87,7 +90,7 @@ const CollaboratorEditor = ({ field, value, onChange }) => {
|
||||
ref={ref}
|
||||
onClick={openEditor}
|
||||
>
|
||||
{<DeleteCollaborator value={value} onDelete={deleteCollaborator} />}
|
||||
{validValue.length > 0 && (<DeleteCollaborator value={value} onDelete={deleteCollaborator} />)}
|
||||
{renderEditor()}
|
||||
</div>
|
||||
);
|
||||
|
@@ -18,12 +18,13 @@ const TextEditor = React.memo(({ value: oldValue, onChange: onChangeAPI }) => {
|
||||
}, [oldValue]);
|
||||
|
||||
const closeEditor = useCallback(() => {
|
||||
if (!showEditor) return;
|
||||
const value = ref.current.innerText;
|
||||
if (value !== oldValue) {
|
||||
onChangeAPI(getTrimmedString(value) || null);
|
||||
onChangeAPI(getTrimmedString(value) || '');
|
||||
}
|
||||
setShowEditor(false);
|
||||
}, [oldValue, onChangeAPI]);
|
||||
}, [showEditor, oldValue, onChangeAPI]);
|
||||
|
||||
const onPaste = useCallback((event) => {
|
||||
event.stopPropagation();
|
||||
|
@@ -400,6 +400,7 @@ class FilterItem extends React.Component {
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case CellType.NUMBER:
|
||||
case CellType.FILE_NAME:
|
||||
case CellType.TEXT:
|
||||
case CellType.URL: { // The data in the formula column is a date type that has been excluded
|
||||
|
@@ -164,8 +164,8 @@ class Context {
|
||||
};
|
||||
|
||||
// record
|
||||
modifyRecord = (repoId, recordId, columnName, value) => {
|
||||
return this.metadataAPI.modifyRecord(repoId, recordId, columnName, value);
|
||||
modifyRecord = (repoId, recordId, objID, update) => {
|
||||
return this.metadataAPI.modifyRecord(repoId, recordId, objID, update);
|
||||
};
|
||||
|
||||
modifyRecords = (repoId, recordsData, isCopyPaste) => {
|
||||
|
@@ -1,9 +0,0 @@
|
||||
export {
|
||||
getPrecisionNumber,
|
||||
getNumberDisplayString,
|
||||
replaceNumberNotAllowInput,
|
||||
} from './number';
|
||||
export {
|
||||
getCellValueDisplayString,
|
||||
getCellValueStringResult,
|
||||
} from './cell-value';
|
@@ -1,189 +0,0 @@
|
||||
import { DEFAULT_NUMBER_FORMAT } from '../../_basic';
|
||||
import { DISPLAY_INTERNAL_ERRORS } from '../../_basic/constants';
|
||||
import { round } from '../../_basic/utils/number';
|
||||
import { NPminus } from '../../_basic/utils/helper/number-precision';
|
||||
|
||||
const separatorMap = {
|
||||
comma: ',',
|
||||
dot: '.',
|
||||
no: '',
|
||||
space: ' ',
|
||||
};
|
||||
|
||||
const _getDecimalDigits = (number) => {
|
||||
if (Number.isInteger(number)) {
|
||||
return 0;
|
||||
}
|
||||
const valueArr = String(number).split('.');
|
||||
const digitsLength = valueArr[1] ? valueArr[1].length : 8;
|
||||
return digitsLength > 8 ? 8 : digitsLength;
|
||||
};
|
||||
|
||||
const getPrecisionNumber = (number, formats) => {
|
||||
const { precision = 2, enable_precision = false } = formats || {};
|
||||
const type = Object.prototype.toString.call(number);
|
||||
if (type !== '[object Number]') {
|
||||
if (type === '[object String]' && DISPLAY_INTERNAL_ERRORS.includes(number)) {
|
||||
return number;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
const decimalDigits = enable_precision ? precision : _getDecimalDigits(number);
|
||||
return number.toFixed(decimalDigits);
|
||||
};
|
||||
|
||||
const removeZerosFromEnd = (sNumber) => {
|
||||
if (typeof sNumber !== 'string') return '';
|
||||
if (sNumber.endsWith('0')) {
|
||||
return sNumber.replace(/(?:\.0*|(\.\d+?)0+)$/, '$1');
|
||||
}
|
||||
return sNumber;
|
||||
};
|
||||
|
||||
const getDecimalDigitsFromNumber = (number) => {
|
||||
if (Number.isInteger(number)) {
|
||||
return 0;
|
||||
}
|
||||
const decimalPart = String(number).split('.')[1];
|
||||
const digitsLength = decimalPart ? decimalPart.length : 8;
|
||||
return digitsLength > 8 ? 8 : digitsLength;
|
||||
};
|
||||
|
||||
const toThousands = (number, { formats, isCurrency = true }) => {
|
||||
const {
|
||||
decimal = 'dot', thousands = 'no', precision = 2, enable_precision = false,
|
||||
} = formats || {};
|
||||
|
||||
// handle numbers in scientific notation
|
||||
if (String(number).includes('e')) {
|
||||
if (number < 1 && number > -1) {
|
||||
// 1.convert to non-scientific number
|
||||
let numericString = number.toFixed(enable_precision ? precision : 8);
|
||||
|
||||
// 2.remove 0 from end of the number which not set precision. e.g. 0.100000
|
||||
if (!enable_precision) {
|
||||
numericString = removeZerosFromEnd(numericString);
|
||||
}
|
||||
|
||||
// 3.remove minus from number which equal to 0. e.g. '-0.00'
|
||||
if (parseFloat(numericString) === 0) {
|
||||
return numericString.startsWith('-') ? numericString.substring(1) : numericString;
|
||||
}
|
||||
return numericString;
|
||||
}
|
||||
return String(number);
|
||||
}
|
||||
|
||||
const decimalString = separatorMap[decimal];
|
||||
const thousandsString = separatorMap[thousands];
|
||||
const decimalDigits = enable_precision ? precision : getDecimalDigitsFromNumber(number);
|
||||
const floatNumber = parseFloat(round(number, decimalDigits).toFixed(decimalDigits));
|
||||
const isMinus = floatNumber < 0;
|
||||
let integer = Math.trunc(floatNumber);
|
||||
|
||||
// format decimal part
|
||||
let decimalPart = String(Math.abs(NPminus(floatNumber, integer)).toFixed(decimalDigits)).slice(1);
|
||||
if (!enable_precision) {
|
||||
decimalPart = removeZerosFromEnd(decimalPart);
|
||||
}
|
||||
|
||||
if (isCurrency) {
|
||||
if (!enable_precision) {
|
||||
decimalPart = decimalPart.length === 2
|
||||
? decimalPart = decimalPart.padEnd(3, '0')
|
||||
: (decimalPart.substring(0, 3) || '.').padEnd(3, '0');
|
||||
}
|
||||
}
|
||||
decimalPart = decimalPart.replace(/./, decimalString);
|
||||
|
||||
// format integer part
|
||||
const integerNumbers = [];
|
||||
let counter = 0;
|
||||
integer = Math.abs(integer).toString();
|
||||
for (let i = integer.length - 1; i > -1; i--) {
|
||||
counter += 1;
|
||||
integerNumbers.unshift(integer[i]);
|
||||
if (!(counter % 3) && i !== 0) {
|
||||
integerNumbers.unshift(thousandsString);
|
||||
}
|
||||
}
|
||||
|
||||
return `${isMinus ? '-' : ''}${integerNumbers.join('')}${decimalPart}`;
|
||||
};
|
||||
|
||||
const getNumberDisplayString = (number, formats) => {
|
||||
const type = Object.prototype.toString.call(number);
|
||||
if (type !== '[object Number]') {
|
||||
// return formula internal errors directly.
|
||||
if (type === '[object String]' && number.startsWith('#')) {
|
||||
return number;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
if (isNaN(number) || number === Infinity || number === -Infinity) return String(number);
|
||||
|
||||
// formats: old version maybe 'null'
|
||||
const { format = DEFAULT_NUMBER_FORMAT } = formats || {};
|
||||
switch (format) {
|
||||
case 'number': {
|
||||
return toThousands(number, { formats, isCurrency: false });
|
||||
}
|
||||
case 'percent': {
|
||||
return `${toThousands(Number.parseFloat((number * 100).toFixed(8)), { formats, isCurrency: false })}%`;
|
||||
}
|
||||
case 'yuan': {
|
||||
return `¥${toThousands(number, { formats })}`;
|
||||
}
|
||||
case 'dollar': {
|
||||
return `$${toThousands(number, { formats })}`;
|
||||
}
|
||||
case 'euro': {
|
||||
return `€${toThousands(number, { formats })}`;
|
||||
}
|
||||
case 'custom_currency': {
|
||||
if (formats.currency_symbol_position === 'after') {
|
||||
return `${toThousands(number, { formats })}${formats.currency_symbol || ''}`;
|
||||
}
|
||||
return `${formats.currency_symbol || ''}${toThousands(number, { formats })}`;
|
||||
}
|
||||
default: {
|
||||
return String(number);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const replaceNumberNotAllowInput = (sNum, format, currencySymbol) => {
|
||||
if (!sNum) {
|
||||
return '';
|
||||
}
|
||||
const fixedSNum = sNum.replace(/。/g, '.');
|
||||
switch (format) {
|
||||
case 'percent': {
|
||||
return fixedSNum.replace(/[^.-\d,%]/g, '');
|
||||
}
|
||||
case 'yuan': {
|
||||
return fixedSNum.replace(/[^.-\d¥¥,]/g, '');
|
||||
}
|
||||
case 'dollar': {
|
||||
return fixedSNum.replace(/[^.-\d$,]/g, '');
|
||||
}
|
||||
case 'euro': {
|
||||
return fixedSNum.replace(/[^.-\d€,]/g, '');
|
||||
}
|
||||
case 'custom_currency': {
|
||||
const reg = new RegExp('[^.-\\d' + currencySymbol + ',]', 'g');
|
||||
return fixedSNum.replace(reg, '');
|
||||
}
|
||||
default: {
|
||||
// default as number format
|
||||
return fixedSNum.replace(/[^.-\d,]/g, '');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
getPrecisionNumber,
|
||||
getNumberDisplayString,
|
||||
replaceNumberNotAllowInput,
|
||||
};
|
@@ -195,6 +195,10 @@ export const getColumnDisplayName = (key, name) => {
|
||||
return gettext('File status');
|
||||
case PRIVATE_COLUMN_KEY.LOCATION:
|
||||
return gettext('Image location');
|
||||
case PRIVATE_COLUMN_KEY.SIZE:
|
||||
return gettext('Size');
|
||||
case PRIVATE_COLUMN_KEY.FILE_DETAILS:
|
||||
return gettext('File details');
|
||||
default:
|
||||
return name;
|
||||
}
|
||||
@@ -281,11 +285,19 @@ const getFileStatusColumnData = (column) => {
|
||||
return newData;
|
||||
};
|
||||
|
||||
const getFileSizeColumnData = (column) => {
|
||||
return {
|
||||
...column.data,
|
||||
format: 'byte'
|
||||
};
|
||||
};
|
||||
|
||||
export const normalizeColumnData = (column) => {
|
||||
const { key, data } = column;
|
||||
if (PRIVATE_COLUMN_KEYS.includes(key)) {
|
||||
if (key === PRIVATE_COLUMN_KEY.FILE_TYPE) return getFileTypeColumnData(column);
|
||||
if (key === PRIVATE_COLUMN_KEY.FILE_STATUS) return getFileStatusColumnData(column);
|
||||
if (key === PRIVATE_COLUMN_KEY.SIZE) return getFileSizeColumnData(column);
|
||||
}
|
||||
if (column.type === CellType.SINGLE_SELECT) {
|
||||
return { ...data, options: data?.options || [] };
|
||||
|
Reference in New Issue
Block a user