uiw 4.10.4 → 4.10.5

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/uiw.css CHANGED
@@ -2286,29 +2286,30 @@ sup.w-badge-count {
2286
2286
  .w-fileinput-card {
2287
2287
  margin-right: -8px;
2288
2288
  }
2289
- .w-fileinput-card_box {
2290
- width: 104px;
2291
- height: 104px;
2289
+ .w-fileinput-card-box {
2292
2290
  margin-right: 8px;
2293
2291
  margin-bottom: 8px;
2294
2292
  text-align: center;
2295
2293
  vertical-align: top;
2296
2294
  background-color: #fafafa;
2297
2295
  border: 1px dashed #d9d9d9;
2296
+ overflow: hidden;
2298
2297
  border-radius: 2px;
2299
2298
  cursor: pointer;
2300
2299
  transition: border-color 0.3s;
2301
2300
  display: inline-flex;
2302
2301
  position: relative;
2303
2302
  }
2304
- .w-fileinput-card_box_info {
2305
- padding: 5px;
2303
+ .w-fileinput-card-box-info {
2304
+ box-sizing: border-box;
2305
+ width: 100%;
2306
+ height: 100%;
2306
2307
  }
2307
- .w-fileinput-card_box_info img {
2308
+ .w-fileinput-card-box-info img {
2308
2309
  width: 100%;
2309
2310
  height: 100%;
2310
2311
  }
2311
- .w-fileinput-card_actions {
2312
+ .w-fileinput-card-actions {
2312
2313
  position: absolute;
2313
2314
  left: 0;
2314
2315
  top: 0;
@@ -2322,7 +2323,7 @@ sup.w-badge-count {
2322
2323
  background: rgba(0, 0, 0, 0.6);
2323
2324
  border-radius: 2px;
2324
2325
  }
2325
- .w-fileinput-card_actions_remove {
2326
+ .w-fileinput-card-actions-remove {
2326
2327
  width: 24px;
2327
2328
  height: 20px;
2328
2329
  display: flex;
@@ -2330,17 +2331,36 @@ sup.w-badge-count {
2330
2331
  justify-content: center;
2331
2332
  cursor: pointer;
2332
2333
  }
2333
- .w-fileinput-card_btn {
2334
+ .w-fileinput-card-btn {
2334
2335
  align-items: center;
2335
2336
  justify-content: center;
2336
2337
  }
2337
- .w-fileinput-card_box:hover .w-fileinput-card_actions {
2338
+ .w-fileinput-card-box:hover .w-fileinput-card-actions {
2338
2339
  opacity: 1;
2339
2340
  }
2341
+ .w-fileinput-card-size-large .w-fileinput-card-box {
2342
+ width: 110px;
2343
+ height: 110px;
2344
+ }
2345
+ .w-fileinput-card-size-middle .w-fileinput-card-box {
2346
+ width: 80px;
2347
+ height: 80px;
2348
+ }
2349
+ .w-fileinput-card-size-small .w-fileinput-card-box {
2350
+ width: 50px;
2351
+ height: 50px;
2352
+ }
2353
+ .w-fileinput-card-shape-round .w-fileinput-card-box {
2354
+ border-radius: 2px;
2355
+ }
2356
+ .w-fileinput-card-shape-circle .w-fileinput-card-box {
2357
+ border-radius: 50%;
2358
+ }
2340
2359
  .w-fileinput-list {
2341
2360
  padding-bottom: 8px;
2361
+ width: 100%;
2342
2362
  }
2343
- .w-fileinput-list_actions {
2363
+ .w-fileinput-list-actions {
2344
2364
  position: absolute;
2345
2365
  left: 0;
2346
2366
  top: 0;
@@ -2354,7 +2374,7 @@ sup.w-badge-count {
2354
2374
  background: rgba(0, 0, 0, 0.6);
2355
2375
  border-radius: 2px;
2356
2376
  }
2357
- .w-fileinput-list_actions_search {
2377
+ .w-fileinput-list-actions-search {
2358
2378
  width: 24px;
2359
2379
  height: 20px;
2360
2380
  display: flex;
@@ -2362,49 +2382,68 @@ sup.w-badge-count {
2362
2382
  justify-content: center;
2363
2383
  cursor: pointer;
2364
2384
  }
2365
- .w-fileinput-list_info:hover .w-fileinput-list_actions {
2385
+ .w-fileinput-list-info:hover .w-fileinput-list-actions {
2366
2386
  opacity: 1;
2367
2387
  }
2368
- .w-fileinput-list_picture {
2388
+ .w-fileinput-list-picture {
2369
2389
  border: 1px solid #d9d9d9;
2370
2390
  display: flex;
2371
2391
  align-items: center;
2372
2392
  padding: 5px;
2373
2393
  margin-top: 8px;
2374
2394
  }
2375
- .w-fileinput-list_picture_info {
2395
+ .w-fileinput-list-picture-info {
2376
2396
  margin-right: 10px;
2377
2397
  position: relative;
2398
+ overflow: hidden;
2378
2399
  }
2379
- .w-fileinput-list_picture_info img {
2400
+ .w-fileinput-list-picture-info img {
2380
2401
  width: 48px;
2381
2402
  height: 48px;
2382
2403
  display: block;
2383
2404
  }
2384
- .w-fileinput-list_picture_text {
2405
+ .w-fileinput-list-picture-text {
2385
2406
  flex: 1 1;
2386
2407
  }
2387
- .w-fileinput-list_picture_icon {
2408
+ .w-fileinput-list-picture-icon {
2388
2409
  padding: 5px;
2389
2410
  cursor: pointer;
2390
2411
  }
2391
- .w-fileinput-list_text {
2412
+ .w-fileinput-list-size-large .w-fileinput-list-picture-info img {
2413
+ width: 70px;
2414
+ height: 70px;
2415
+ }
2416
+ .w-fileinput-list-size-middle .w-fileinput-list-picture-info img {
2417
+ width: 50px;
2418
+ height: 50px;
2419
+ }
2420
+ .w-fileinput-list-size-small .w-fileinput-list-picture-info img {
2421
+ width: 30px;
2422
+ height: 30px;
2423
+ }
2424
+ .w-fileinput-list-shape-round .w-fileinput-list-picture-info {
2425
+ border-radius: 2px;
2426
+ }
2427
+ .w-fileinput-list-shape-circle .w-fileinput-list-box-info {
2428
+ border-radius: 50px;
2429
+ }
2430
+ .w-fileinput-list-text {
2392
2431
  border: 1px solid transparent;
2393
2432
  display: flex;
2394
2433
  align-items: center;
2395
2434
  padding: 5px;
2396
2435
  transition: all 0.5s;
2397
2436
  }
2398
- .w-fileinput-list_text:hover {
2437
+ .w-fileinput-list-text:hover {
2399
2438
  background: #f5f5f5;
2400
2439
  }
2401
- .w-fileinput-list_text:first-child {
2440
+ .w-fileinput-list-text:first-child {
2402
2441
  margin-top: 8px;
2403
2442
  }
2404
- .w-fileinput-list_text_text {
2443
+ .w-fileinput-list-text-text {
2405
2444
  flex: 1 1;
2406
2445
  }
2407
- .w-fileinput-list_text_icon {
2446
+ .w-fileinput-list-text-icon {
2408
2447
  padding: 0 5px;
2409
2448
  cursor: pointer;
2410
2449
  }
package/dist/uiw.js CHANGED
@@ -6221,12 +6221,14 @@ function Dropdown(props) {
6221
6221
  ;// CONCATENATED MODULE: ../react-file-input/esm/Input.js
6222
6222
 
6223
6223
 
6224
- var Input_excluded = ["className", "prefixCls"];
6224
+ var Input_excluded = ["className", "dataLabel", "prefixCls"];
6225
6225
 
6226
6226
 
6227
6227
 
6228
6228
  /* harmony default export */ var Input = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (props, ref) {
6229
6229
  var className = props.className,
6230
+ _props$dataLabel = props.dataLabel,
6231
+ dataLabel = _props$dataLabel === void 0 ? 'Browse' : _props$dataLabel,
6230
6232
  _props$prefixCls = props.prefixCls,
6231
6233
  prefixCls = _props$prefixCls === void 0 ? 'w-fileinput' : _props$prefixCls,
6232
6234
  other = _objectWithoutPropertiesLoose(props, Input_excluded);
@@ -6234,7 +6236,7 @@ var Input_excluded = ["className", "prefixCls"];
6234
6236
  var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
6235
6237
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, _extends({
6236
6238
  ref: ref,
6237
- "data-label": "Browse",
6239
+ "data-label": dataLabel,
6238
6240
  className: cls
6239
6241
  }, other, {
6240
6242
  type: "file"
@@ -6257,30 +6259,40 @@ var Picture = function Picture(props) {
6257
6259
  _props$dataList = props.dataList,
6258
6260
  dataList = _props$dataList === void 0 ? [] : _props$dataList,
6259
6261
  uploadType = props.uploadType,
6262
+ _props$size = props.size,
6263
+ size = _props$size === void 0 ? 'middle' : _props$size,
6264
+ _props$shape = props.shape,
6265
+ shape = _props$shape === void 0 ? 'round' : _props$shape,
6266
+ readonly = props.readonly,
6260
6267
  children = props.children,
6268
+ _props$showFileIcon = props.showFileIcon,
6269
+ showFileIcon = _props$showFileIcon === void 0 ? {
6270
+ showPreviewIcon: true,
6271
+ showRemoveIcon: true
6272
+ } : _props$showFileIcon,
6261
6273
  onPreview = props.onPreview,
6262
6274
  onAdd = props.onAdd,
6263
6275
  onRemove = props.onRemove;
6264
- var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
6276
+ var cls = [prefixCls, prefixCls + "-size-" + size, prefixCls + "-shape-" + shape, className].filter(Boolean).join(' ').trim();
6265
6277
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6266
6278
  className: cls,
6267
- children: [children && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(children) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, {
6279
+ children: [children && !readonly && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(children) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, {
6268
6280
  onClick: onAdd
6269
6281
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6270
6282
  children: dataList.map(function (item, index) {
6271
6283
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6272
- className: cls + "_" + uploadType,
6284
+ className: prefixCls + "-" + uploadType,
6273
6285
  children: [uploadType === 'picture' && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6274
- className: cls + "_info " + cls + "_" + uploadType + "_info",
6286
+ className: prefixCls + "-info " + prefixCls + "-" + uploadType + "-info",
6275
6287
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
6276
6288
  src: item['dataURL'],
6277
6289
  alt: ""
6278
- }), onPreview && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6279
- className: cls + "_actions",
6290
+ }), (showFileIcon == null ? void 0 : showFileIcon.showPreviewIcon) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6291
+ className: prefixCls + "-actions",
6280
6292
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
6281
- className: cls + "_actions_search",
6293
+ className: prefixCls + "-actions-search",
6282
6294
  onClick: function onClick() {
6283
- return onPreview(item);
6295
+ return onPreview == null ? void 0 : onPreview(item);
6284
6296
  },
6285
6297
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
6286
6298
  type: "search",
@@ -6292,12 +6304,12 @@ var Picture = function Picture(props) {
6292
6304
  })
6293
6305
  })]
6294
6306
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6295
- className: cls + "_" + uploadType + "_text",
6307
+ className: prefixCls + "-" + uploadType + "-text",
6296
6308
  children: item.name
6297
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6298
- className: cls + "_" + uploadType + "_icon",
6309
+ }), (showFileIcon == null ? void 0 : showFileIcon.showRemoveIcon) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6310
+ className: prefixCls + "-" + uploadType + "-icon",
6299
6311
  onClick: function onClick() {
6300
- return onRemove(index);
6312
+ return onRemove == null ? void 0 : onRemove(index);
6301
6313
  },
6302
6314
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
6303
6315
  type: "delete",
@@ -6328,29 +6340,39 @@ var Card = function Card(props) {
6328
6340
  dataList = _props$dataList === void 0 ? [] : _props$dataList,
6329
6341
  _props$maxNumber = props.maxNumber,
6330
6342
  maxNumber = _props$maxNumber === void 0 ? 3 : _props$maxNumber,
6343
+ _props$shape = props.shape,
6344
+ shape = _props$shape === void 0 ? 'round' : _props$shape,
6345
+ _props$size = props.size,
6346
+ size = _props$size === void 0 ? 'middle' : _props$size,
6331
6347
  readonly = props.readonly,
6332
6348
  children = props.children,
6349
+ _props$showFileIcon = props.showFileIcon,
6350
+ showFileIcon = _props$showFileIcon === void 0 ? {
6351
+ showPreviewIcon: true,
6352
+ showRemoveIcon: true
6353
+ } : _props$showFileIcon,
6333
6354
  onAdd = props.onAdd,
6334
6355
  onPreview = props.onPreview,
6335
6356
  onRemove = props.onRemove;
6336
- var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
6357
+ var cls = [prefixCls, prefixCls + "-size-" + size, prefixCls + "-shape-" + shape, className].filter(Boolean).join(' ').trim();
6358
+ var isAction = showFileIcon.showPreviewIcon || showFileIcon.showRemoveIcon ? true : false;
6337
6359
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6338
6360
  className: cls,
6339
6361
  children: [dataList.map(function (item, index) {
6340
6362
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6341
- className: cls + "_box",
6363
+ className: prefixCls + "-box",
6342
6364
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6343
- className: cls + "_box_info",
6365
+ className: prefixCls + "-box-info",
6344
6366
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
6345
6367
  src: item['dataURL'],
6346
6368
  alt: ""
6347
6369
  })
6348
6370
  }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6349
- className: cls + "_actions",
6350
- children: [onPreview && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
6351
- className: cls + "_actions_remove",
6371
+ className: isAction ? prefixCls + "-actions" : '',
6372
+ children: [(showFileIcon == null ? void 0 : showFileIcon.showPreviewIcon) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
6373
+ className: prefixCls + "-actions-remove",
6352
6374
  onClick: function onClick() {
6353
- return onPreview(item);
6375
+ return onPreview == null ? void 0 : onPreview(item);
6354
6376
  },
6355
6377
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
6356
6378
  type: "search",
@@ -6359,10 +6381,10 @@ var Card = function Card(props) {
6359
6381
  fontSize: 16
6360
6382
  }
6361
6383
  })
6362
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
6363
- className: cls + "_actions_remove",
6384
+ }), (showFileIcon == null ? void 0 : showFileIcon.showRemoveIcon) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
6385
+ className: prefixCls + "-actions-remove",
6364
6386
  onClick: function onClick() {
6365
- return onRemove(index);
6387
+ return onRemove == null ? void 0 : onRemove(index);
6366
6388
  },
6367
6389
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
6368
6390
  type: "delete",
@@ -6375,7 +6397,7 @@ var Card = function Card(props) {
6375
6397
  })]
6376
6398
  }, index);
6377
6399
  }), maxNumber > dataList.length && !readonly && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
6378
- className: cls + "_box " + cls + "_btn",
6400
+ className: prefixCls + "-box " + prefixCls + "-btn",
6379
6401
  onClick: onAdd,
6380
6402
  children: children
6381
6403
  })]
@@ -6457,6 +6479,7 @@ var FileList = function FileList(props) {
6457
6479
  return openFileDialog(inputRef);
6458
6480
  }, [inputRef]);
6459
6481
  var onFileUpload = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function () {
6482
+ if (inputRef.current) inputRef.current.value = '';
6460
6483
  handleClickInput();
6461
6484
  }, [handleClickInput]);
6462
6485
 
@@ -6509,7 +6532,7 @@ var FileList = function FileList(props) {
6509
6532
 
6510
6533
  updatedList.splice(index, 1);
6511
6534
  setFileList(updatedList);
6512
- onChange == null ? void 0 : onChange(fileList);
6535
+ onChange == null ? void 0 : onChange(updatedList);
6513
6536
  };
6514
6537
 
6515
6538
  var Comp;
@@ -6816,6 +6839,15 @@ function Form(_ref, ref) {
6816
6839
  data = _useState2[0],
6817
6840
  setData = _useState2[1];
6818
6841
 
6842
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
6843
+ return {
6844
+ onSubmit: handleSubmit,
6845
+ resetForm: handleReset,
6846
+ getFieldValues: function getFieldValues() {
6847
+ return data.current;
6848
+ }
6849
+ };
6850
+ }, [data]);
6819
6851
  var formUnits = {};
6820
6852
 
6821
6853
  for (var name in fields) {