@gingkoo/pandora-explorer 0.0.1-alpha.75 → 0.0.1-alpha.76

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/lib/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @gingkoo/pandora-explorer v0.0.1-alpha.75
2
+ * @gingkoo/pandora-explorer v0.0.1-alpha.76
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import cx$1 from 'classnames';
@@ -7000,6 +7000,21 @@ const SelectBox = props => {
7000
7000
  setSelect(ids);
7001
7001
  onChange(ids);
7002
7002
  }
7003
+ /*************** control 选中 ******************* */
7004
+ function controlSelectColumns(key) {
7005
+ if (store?.menutype != 'column') return false;
7006
+ if (!store?.dataMap) return false;
7007
+ let _start = store.dataMap?.[key]?.level || '';
7008
+ let num = _start.split('-').length;
7009
+ let is = checks.some(v => {
7010
+ let curlevel = store.dataMap?.[v]?.level || '';
7011
+ let curnum = curlevel.split('-').length;
7012
+ if (num != curnum) {
7013
+ return v;
7014
+ }
7015
+ });
7016
+ return is;
7017
+ }
7003
7018
  return jsxs("div", {
7004
7019
  ref: ref,
7005
7020
  className: cx$1(`file-select-box ${className}`),
@@ -7024,12 +7039,16 @@ const SelectBox = props => {
7024
7039
  onChange(arr);
7025
7040
  } else {
7026
7041
  let arr = [];
7027
- if (!checks.includes(type?.[0])) {
7028
- arr = [...selects, ...type];
7029
- setSelect(arr);
7030
- onChange(arr);
7042
+ let is = controlSelectColumns(type[0]);
7043
+ if (is) {
7044
+ setSelect(type);
7045
+ onChange(type);
7031
7046
  return;
7032
7047
  }
7048
+ arr = [...selects, ...type];
7049
+ setSelect(arr);
7050
+ onChange(arr);
7051
+ return;
7033
7052
  }
7034
7053
  return;
7035
7054
  }
@@ -7124,7 +7143,7 @@ const SelectBox = props => {
7124
7143
  });
7125
7144
  };
7126
7145
 
7127
- var css_248z$2 = ".explorer-columns {\n width: 100%;\n height: 100%;\n display: flex;\n position: relative;\n overflow: auto;\n}\n.explorer-columns .layer {\n position: relative;\n flex: 1 0 0;\n border-right: 1px solid #f5f5f5;\n}\n.explorer-columns .layer.select_col {\n box-shadow: 0 0 20px #e9f5ff inset;\n}\n.explorer-columns .layer.select_col::after {\n content: '';\n position: absolute;\n height: 4px;\n bottom: 0px;\n background: #50afff;\n left: 0;\n right: 0;\n}\n.explorer-columns .layer.list {\n min-width: 200px;\n}\n.explorer-columns .layer.list::before {\n position: absolute;\n content: '';\n top: 50%;\n right: 1px;\n width: 1px;\n height: 18px;\n margin-left: -1px;\n margin-top: -9px;\n border: 1px solid #ddd;\n border-top: none;\n border-bottom: none;\n backdrop-filter: none;\n border-radius: 0;\n background: transparent;\n box-sizing: content-box;\n -webkit-backdrop-filter: blur(10px);\n}\n.explorer-columns .layer.list .list-main {\n width: 100%;\n height: 100%;\n transition: 0.3s;\n padding-top: 5px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar {\n width: 6px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar-thumb {\n background-color: transparent;\n border-radius: 6px;\n transition: 0.3s;\n}\n.explorer-columns .layer.list .list-main:hover .list-scroll::-webkit-scrollbar-thumb {\n background-color: #00000030;\n}\n.explorer-columns .layer.list .drag {\n position: absolute;\n width: 8px;\n border-right: 1px solid #f5f5f5;\n right: -3px;\n top: 0;\n bottom: 0;\n cursor: col-resize;\n z-index: 10;\n}\n.explorer-columns .layer.list .drag:hover {\n background: #40a9ff4d;\n}\n.explorer-columns .layer.empty {\n display: flex;\n justify-content: center;\n padding-top: 100px;\n}\n.explorer-columns .layer.empty .empty-is-null {\n width: 200px;\n}\n.explorer-columns .layer.empty .empty-icon {\n height: 140px;\n}\n.explorer-columns .layer.empty .empty-desc {\n display: flex;\n justify-content: center;\n}\n.explorer-columns .layer.empty .empty-desc > span {\n display: inline-block;\n padding: 3px 10px;\n border-radius: 10px;\n line-height: 1;\n background: #a0a0a01a;\n color: #bbb;\n font-size: 0.9em;\n}\n.explorer-columns-list {\n padding-left: 10px;\n display: flex;\n height: 30px;\n margin-bottom: 2px;\n margin: 0 5px 3px 5px;\n align-items: center;\n border: 1px solid transparent;\n user-select: none;\n overflow: hidden;\n}\n.explorer-columns-list .columns-list-icon {\n display: flex;\n width: 18px;\n height: 18px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.explorer-columns-list .columns-list-title {\n width: 100%;\n display: inline-block;\n width: calc(100% - 30px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.explorer-columns-list .columns-list-tool {\n min-width: 30px;\n}\n.explorer-columns-list .columns-list-input {\n flex: 1;\n height: 100%;\n outline: 0;\n border: 0;\n margin-right: 10px;\n background: #fff;\n}\n.explorer-columns-list.acitve {\n background: #e3f0ff;\n}\n.explorer-columns-list.last {\n margin-bottom: 100px;\n}\n.explorer-columns-list.checks {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list.isedit {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list:hover {\n background: #e3f0ff;\n border-color: #c9e2ff;\n}\n.explorer-columns-list:hover .edit {\n opacity: 1;\n}\n.explorer-columns-loading {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.explorer-columns-loading .loading-content {\n width: 100px;\n height: 106px;\n border-radius: 6px;\n background: rgba(255, 255, 255, 0.7);\n box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.07);\n color: #888;\n}\n.explorer-columns-loading .loading-content-icon {\n display: flex;\n justify-content: center;\n margin: 25px auto 6px auto;\n font-size: 30px;\n}\n.explorer-columns-loading .loading-content-icon > i {\n animation: rotate 1.5s linear infinite;\n}\n.explorer-columns-loading .loading-content-title {\n padding-top: 15px;\n text-align: center;\n}\n.explorer-columns.notdata .explorer-notdata {\n width: 100%;\n}\n@keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
7146
+ var css_248z$2 = ".explorer-columns {\n width: 100%;\n height: 100%;\n display: flex;\n position: relative;\n overflow: auto;\n}\n.explorer-columns .layer {\n position: relative;\n flex: 1 0 0;\n border-right: 1px solid #f5f5f5;\n}\n.explorer-columns .layer.select_col {\n box-shadow: 0 0 20px #e9f5ff inset;\n}\n.explorer-columns .layer.select_col::after {\n content: '';\n position: absolute;\n height: 4px;\n bottom: 0px;\n background: #50afff;\n left: 0;\n right: 0;\n}\n.explorer-columns .layer.list {\n min-width: 200px;\n}\n.explorer-columns .layer.list::before {\n position: absolute;\n content: '';\n top: 50%;\n right: 1px;\n width: 1px;\n height: 18px;\n margin-left: -1px;\n margin-top: -9px;\n border: 1px solid #ddd;\n border-top: none;\n border-bottom: none;\n backdrop-filter: none;\n border-radius: 0;\n background: transparent;\n box-sizing: content-box;\n -webkit-backdrop-filter: blur(10px);\n}\n.explorer-columns .layer.list .list-main {\n width: 100%;\n height: 100%;\n transition: 0.3s;\n padding-top: 5px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar {\n width: 6px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar-thumb {\n background-color: transparent;\n border-radius: 6px;\n transition: 0.3s;\n}\n.explorer-columns .layer.list .list-main:hover .list-scroll::-webkit-scrollbar-thumb {\n background-color: #00000030;\n}\n.explorer-columns .layer.list .drag {\n position: absolute;\n width: 8px;\n border-right: 1px solid #f5f5f5;\n right: -3px;\n top: 0;\n bottom: 0;\n cursor: col-resize;\n z-index: 10;\n}\n.explorer-columns .layer.list .drag:hover {\n background: #40a9ff4d;\n}\n.explorer-columns .layer.empty {\n display: flex;\n justify-content: center;\n padding-top: 100px;\n}\n.explorer-columns .layer.empty .empty-is-null {\n width: 200px;\n}\n.explorer-columns .layer.empty .empty-icon {\n height: 140px;\n}\n.explorer-columns .layer.empty .empty-desc {\n display: flex;\n justify-content: center;\n}\n.explorer-columns .layer.empty .empty-desc > span {\n display: inline-block;\n padding: 3px 10px;\n border-radius: 10px;\n line-height: 1;\n background: #a0a0a01a;\n color: #bbb;\n font-size: 0.9em;\n}\n.explorer-columns-list {\n padding-left: 10px;\n display: flex;\n height: 30px;\n margin-bottom: 2px;\n margin: 0 5px 3px 5px;\n align-items: center;\n border: 1px solid transparent;\n user-select: none;\n overflow: hidden;\n}\n.explorer-columns-list .columns-list-icon {\n display: flex;\n width: 18px;\n height: 18px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.explorer-columns-list .columns-list-title {\n width: 100%;\n display: inline-block;\n width: calc(100% - 30px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.explorer-columns-list .columns-list-tool {\n min-width: 30px;\n}\n.explorer-columns-list .columns-list-input {\n flex: 1;\n height: 100%;\n outline: 0;\n border: 0;\n margin-right: 10px;\n background: #fff;\n}\n.explorer-columns-list.acitve {\n background: #e3f0ff;\n}\n.explorer-columns-list.last {\n margin-bottom: 100px;\n}\n.explorer-columns-list.checks {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list.isedit {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list.disable {\n opacity: 0.4;\n}\n.explorer-columns-list:hover {\n background: #e3f0ff;\n border-color: #c9e2ff;\n}\n.explorer-columns-list:hover .edit {\n opacity: 1;\n}\n.explorer-columns-loading {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.explorer-columns-loading .loading-content {\n width: 100px;\n height: 106px;\n border-radius: 6px;\n background: rgba(255, 255, 255, 0.7);\n box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.07);\n color: #888;\n}\n.explorer-columns-loading .loading-content-icon {\n display: flex;\n justify-content: center;\n margin: 25px auto 6px auto;\n font-size: 30px;\n}\n.explorer-columns-loading .loading-content-icon > i {\n animation: rotate 1.5s linear infinite;\n}\n.explorer-columns-loading .loading-content-title {\n padding-top: 15px;\n text-align: center;\n}\n.explorer-columns.notdata .explorer-notdata {\n width: 100%;\n}\n@keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
7128
7147
  styleInject(css_248z$2);
7129
7148
 
7130
7149
  function Item(props) {
@@ -7141,15 +7160,20 @@ function Item(props) {
7141
7160
  useEffect(() => {
7142
7161
  setValue(props?.title);
7143
7162
  }, [props?.title]);
7163
+ let disable = false;
7164
+ if (Array.isArray(props.selectedSuffix)) {
7165
+ disable = !props.selectedSuffix.includes(props.suffix) && !props.selectedSuffix?.includes(props?.type);
7166
+ }
7144
7167
  return jsxs("div", {
7145
7168
  className: cx$1('explorer-columns-list', {
7146
7169
  last: props?.end,
7147
7170
  acitve: acitve,
7148
7171
  checks: checks,
7149
- isedit: isedit
7172
+ isedit: isedit,
7173
+ disable
7150
7174
  }),
7151
- "data-id": props.id,
7152
- "data-type": props.type,
7175
+ "data-id": !disable ? props.id : null,
7176
+ "data-type": !disable ? props.type : null,
7153
7177
  onClick: onClick,
7154
7178
  onContextMenu: e => {
7155
7179
  e.preventDefault();
@@ -7406,6 +7430,9 @@ function Columns(props) {
7406
7430
  }),
7407
7431
  onClick: e => {
7408
7432
  setSelectCol(level);
7433
+ if (store.expandkey[level - 1]) {
7434
+ store.setCurSelect(store.expandkey[level - 1]);
7435
+ }
7409
7436
  },
7410
7437
  children: jsxs("div", {
7411
7438
  className: 'empty-is-null',
@@ -7424,7 +7451,11 @@ function Columns(props) {
7424
7451
  }
7425
7452
  if (!Array.isArray(list) || !list.length) {
7426
7453
  return jsx("div", {
7427
- className: cx$1('layer', {})
7454
+ className: cx$1('layer', {}),
7455
+ style: {
7456
+ flex: ` 0 0 ${width[level]}px`,
7457
+ width: level + 'px'
7458
+ }
7428
7459
  });
7429
7460
  }
7430
7461
  return jsxs("div", {
@@ -7433,6 +7464,11 @@ function Columns(props) {
7433
7464
  }),
7434
7465
  onClick: e => {
7435
7466
  setSelectCol(level);
7467
+ if (store.expandkey[level - 1]) {
7468
+ store.setCurSelect(store.expandkey[level - 1]);
7469
+ } else {
7470
+ store.setCurSelect(null);
7471
+ }
7436
7472
  },
7437
7473
  style: {
7438
7474
  flex: ` 0 0 ${width[level]}px`,
@@ -7449,10 +7485,11 @@ function Columns(props) {
7449
7485
  ...v,
7450
7486
  key: level + '-' + i,
7451
7487
  icon: icons,
7452
- acitve: store.expandkey[level] == v.key || select_info == v.key,
7488
+ acitve: store.expandkey[level] == v.key,
7453
7489
  id: v.key,
7454
7490
  end: end,
7455
7491
  checks: checks?.includes(v.key),
7492
+ selectedSuffix: store.selectedSuffix,
7456
7493
  isedit: store.reamekey == v.key || v.create_file,
7457
7494
  store: store,
7458
7495
  openMenu: store.openMenu,
@@ -7460,9 +7497,13 @@ function Columns(props) {
7460
7497
  await props?.onRename?.(key, value, info);
7461
7498
  },
7462
7499
  onMenuClick: props?.onMenuClick,
7463
- onClick: async () => {
7500
+ onClick: async e => {
7464
7501
  //shift 键按下 进行展开
7465
7502
  if (store.shift) return;
7503
+ e.stopPropagation();
7504
+ store.closeMenu();
7505
+ store.setCurSelect(v.key);
7506
+ setSelectCol(level);
7466
7507
  setSelectInfo(v.key);
7467
7508
  if (v.type == 'folder') {
7468
7509
  let select = setlevel(v.key, level);
@@ -7617,8 +7658,8 @@ const Layout$1 = props => {
7617
7658
  return jsxs("div", {
7618
7659
  className: 'file-continer-main',
7619
7660
  onClick: () => {
7620
- store.setCurSelect(null);
7621
7661
  if (store?.menutype !== 'column') {
7662
+ store.setCurSelect(null);
7622
7663
  store.setCurSelectFile(null);
7623
7664
  }
7624
7665
  },
@@ -8093,6 +8134,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
8093
8134
  isUpload = true,
8094
8135
  isEdit = true,
8095
8136
  isDownload = true,
8137
+ isOpenMenu = true,
8096
8138
  isNavtab = true,
8097
8139
  checks,
8098
8140
  accept,
@@ -8369,6 +8411,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
8369
8411
  if (!curInfo) return;
8370
8412
  let input = document.createElement('input');
8371
8413
  input.type = 'file';
8414
+ input.accept = accept || '';
8372
8415
  input.multiple = true;
8373
8416
  input?.click();
8374
8417
  input.onchange = async e => {
@@ -8451,6 +8494,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
8451
8494
  setCurList(list);
8452
8495
  }
8453
8496
  function openMenu(props, param) {
8497
+ if (!isOpenMenu) return;
8454
8498
  closeMenu();
8455
8499
  let {
8456
8500
  x = 0,
@@ -8505,7 +8549,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
8505
8549
  `;
8506
8550
  }, 100);
8507
8551
  }
8508
- /* *********** 拦截进行特殊处理 *********** */
8552
+ /* *********** 拦截进行特殊处理 *********** */
8509
8553
  async function onMenuClick(key, param, type) {
8510
8554
  if (key == 'remove') {
8511
8555
  if (type == 'menu') {