@canlooks/can-ui 0.0.68 → 0.0.69

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.
Files changed (101) hide show
  1. package/dist/cjs/components/accordion/accordion.js +2 -2
  2. package/dist/cjs/components/alert/alert.js +4 -3
  3. package/dist/cjs/components/boundary/errorBoundary.js +2 -2
  4. package/dist/cjs/components/bubbleConfirm/bubbleConfirm.js +2 -2
  5. package/dist/cjs/components/calendar/panelYear.js +2 -2
  6. package/dist/cjs/components/cascade/cascade.js +3 -3
  7. package/dist/cjs/components/cascade/cascadePanel.js +2 -2
  8. package/dist/cjs/components/checkboxBase/checkboxBase.js +2 -2
  9. package/dist/cjs/components/counter/counter.js +3 -3
  10. package/dist/cjs/components/curd/curd.js +5 -5
  11. package/dist/cjs/components/curd/curd.style.js +5 -0
  12. package/dist/cjs/components/curd/curdColumnConfig.js +2 -2
  13. package/dist/cjs/components/curd/curdDialog.js +2 -2
  14. package/dist/cjs/components/curd/curdFilter.js +3 -3
  15. package/dist/cjs/components/curd/curdResizable.js +2 -2
  16. package/dist/cjs/components/dataGrid/dataGridHead.js +2 -2
  17. package/dist/cjs/components/dataGrid/dataGridRows.js +3 -3
  18. package/dist/cjs/components/dateTimePicker/dateTimePicker.js +3 -3
  19. package/dist/cjs/components/dialog/dialog.js +2 -2
  20. package/dist/cjs/components/drawer/drawer.js +2 -2
  21. package/dist/cjs/components/gallery/gallery.js +5 -5
  22. package/dist/cjs/components/image/image.d.ts +1 -1
  23. package/dist/cjs/components/image/image.js +5 -4
  24. package/dist/cjs/components/inputBase/inputBase.js +2 -2
  25. package/dist/cjs/components/menuItem/menuItem.js +2 -2
  26. package/dist/cjs/components/pagination/pager.js +3 -3
  27. package/dist/cjs/components/palette/palette.js +2 -2
  28. package/dist/cjs/components/pickerDialog/pickerDialog.js +2 -2
  29. package/dist/cjs/components/pinchable/pinchable.js +7 -0
  30. package/dist/cjs/components/progress/progress.js +3 -3
  31. package/dist/cjs/components/rating/rating.js +2 -2
  32. package/dist/cjs/components/select/select.js +3 -3
  33. package/dist/cjs/components/snackbarBase/snackbarBase.js +3 -3
  34. package/dist/cjs/components/stepper/step.js +5 -5
  35. package/dist/cjs/components/tabs/tabsEllipsis.js +2 -2
  36. package/dist/cjs/components/tag/tag.js +2 -2
  37. package/dist/cjs/components/transfer/transfer.js +3 -3
  38. package/dist/cjs/components/tree/tree.js +2 -2
  39. package/dist/cjs/components/tree/treeNode.js +2 -2
  40. package/dist/cjs/components/treeSelect/treeSelect.js +2 -2
  41. package/dist/cjs/components/typography/typography.js +4 -4
  42. package/dist/cjs/components/upload/dropArea.js +2 -2
  43. package/dist/cjs/components/upload/fileItem.js +5 -5
  44. package/dist/cjs/components/upload/imageItem.js +3 -3
  45. package/dist/cjs/components/upload/upload.js +3 -3
  46. package/dist/cjs/extensions/documentViewer/documentViewer.js +4 -3
  47. package/dist/cjs/extensions/documentViewer/documentViewer.style.js +2 -1
  48. package/dist/cjs/extensions/documentViewer/svgViewer.d.ts +2 -2
  49. package/dist/cjs/extensions/documentViewer/svgViewer.js +13 -9
  50. package/dist/esm/components/accordion/accordion.js +1 -1
  51. package/dist/esm/components/alert/alert.js +2 -1
  52. package/dist/esm/components/boundary/errorBoundary.js +1 -1
  53. package/dist/esm/components/bubbleConfirm/bubbleConfirm.js +1 -1
  54. package/dist/esm/components/calendar/panelYear.js +1 -1
  55. package/dist/esm/components/cascade/cascade.js +1 -1
  56. package/dist/esm/components/cascade/cascadePanel.js +1 -1
  57. package/dist/esm/components/checkboxBase/checkboxBase.js +1 -1
  58. package/dist/esm/components/counter/counter.js +1 -1
  59. package/dist/esm/components/curd/curd.js +1 -1
  60. package/dist/esm/components/curd/curd.style.js +5 -0
  61. package/dist/esm/components/curd/curdColumnConfig.js +1 -1
  62. package/dist/esm/components/curd/curdDialog.js +1 -1
  63. package/dist/esm/components/curd/curdFilter.js +1 -1
  64. package/dist/esm/components/curd/curdResizable.js +1 -1
  65. package/dist/esm/components/dataGrid/dataGridHead.js +1 -1
  66. package/dist/esm/components/dataGrid/dataGridRows.js +1 -1
  67. package/dist/esm/components/dateTimePicker/dateTimePicker.js +1 -1
  68. package/dist/esm/components/dialog/dialog.js +1 -1
  69. package/dist/esm/components/drawer/drawer.js +1 -1
  70. package/dist/esm/components/gallery/gallery.js +1 -1
  71. package/dist/esm/components/image/image.d.ts +1 -1
  72. package/dist/esm/components/image/image.js +3 -2
  73. package/dist/esm/components/inputBase/inputBase.js +1 -1
  74. package/dist/esm/components/menuItem/menuItem.js +1 -1
  75. package/dist/esm/components/pagination/pager.js +1 -1
  76. package/dist/esm/components/palette/palette.js +1 -1
  77. package/dist/esm/components/pickerDialog/pickerDialog.js +1 -1
  78. package/dist/esm/components/pinchable/pinchable.js +7 -0
  79. package/dist/esm/components/progress/progress.js +1 -1
  80. package/dist/esm/components/rating/rating.js +1 -1
  81. package/dist/esm/components/select/select.js +1 -1
  82. package/dist/esm/components/snackbarBase/snackbarBase.js +1 -1
  83. package/dist/esm/components/stepper/step.js +1 -1
  84. package/dist/esm/components/tabs/tabsEllipsis.js +1 -1
  85. package/dist/esm/components/tag/tag.js +1 -1
  86. package/dist/esm/components/transfer/transfer.js +1 -1
  87. package/dist/esm/components/tree/tree.js +1 -1
  88. package/dist/esm/components/tree/treeNode.js +1 -1
  89. package/dist/esm/components/treeSelect/treeSelect.js +1 -1
  90. package/dist/esm/components/typography/typography.js +1 -1
  91. package/dist/esm/components/upload/dropArea.js +1 -1
  92. package/dist/esm/components/upload/fileItem.js +1 -1
  93. package/dist/esm/components/upload/imageItem.js +1 -1
  94. package/dist/esm/components/upload/upload.js +1 -1
  95. package/dist/esm/extensions/documentViewer/documentViewer.js +2 -1
  96. package/dist/esm/extensions/documentViewer/documentViewer.style.js +2 -1
  97. package/dist/esm/extensions/documentViewer/svgViewer.d.ts +2 -2
  98. package/dist/esm/extensions/documentViewer/svgViewer.js +12 -8
  99. package/documentation/dist/assets/{index-GiFWv3kZ.js → index-DvrKS6Tv.js} +2978 -2957
  100. package/documentation/dist/index.html +1 -1
  101. package/package.json +1 -2
@@ -11,7 +11,7 @@ const slider_1 = require("../slider");
11
11
  const color_1 = tslib_1.__importDefault(require("color"));
12
12
  const button_1 = require("../button");
13
13
  const colorValueInput_1 = require("./colorValueInput");
14
- const __1 = require("../..");
14
+ const icon_1 = require("../icon");
15
15
  const faChevronDown_1 = require("@fortawesome/free-solid-svg-icons/faChevronDown");
16
16
  const sliderProps = {
17
17
  railSize: 9,
@@ -114,5 +114,5 @@ exports.Palette = (0, react_1.memo)(({ defaultValue, value, onChange, gestureOpt
114
114
  }, ...draggableHandles })] }), (0, jsx_runtime_1.jsxs)("div", { className: palette_style_1.classes.slidersRow, children: [(0, jsx_runtime_1.jsxs)("div", { className: palette_style_1.classes.sliders, children: [(0, jsx_runtime_1.jsx)(slider_1.Slider, { ...sliderProps, className: palette_style_1.classes.hue, value: colorObject.hue / 359 * 100, onChange: hueChangeHandler }), (0, jsx_runtime_1.jsx)(slider_1.Slider, { ...sliderProps, className: palette_style_1.classes.alpha, renderRail: (_, railProps) => (0, jsx_runtime_1.jsxs)("div", { ...railProps, children: [railProps.children, (0, jsx_runtime_1.jsx)("div", { className: palette_style_1.classes.alphaMask, style: { backgroundImage: `linear-gradient(90deg, transparent, ${colorObject.saturated})` } })] }), value: colorObject.alpha * 100, onChange: alphaChangeHandler })] }), (0, jsx_runtime_1.jsx)("div", { className: palette_style_1.classes.preview, children: (0, jsx_runtime_1.jsx)("div", { className: palette_style_1.classes.previewColor, style: {
115
115
  backgroundColor: colorObject.hex,
116
116
  opacity: colorObject.alpha
117
- } }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: palette_style_1.classes.inputRow, children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "plain", color: "text.secondary", suffix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faChevronDown_1.faChevronDown }), onClick: formatChangeHandler, children: availableFormat[activeFormat] }), renderInputs()] })] }));
117
+ } }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: palette_style_1.classes.inputRow, children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "plain", color: "text.secondary", suffix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faChevronDown_1.faChevronDown }), onClick: formatChangeHandler, children: availableFormat[activeFormat] }), renderInputs()] })] }));
118
118
  });
@@ -10,7 +10,7 @@ const selectionContext_1 = require("../selectionContext");
10
10
  const divider_1 = require("../divider");
11
11
  const selectedList_1 = require("../selectedList");
12
12
  const button_1 = require("../button");
13
- const __1 = require("../..");
13
+ const icon_1 = require("../icon");
14
14
  const faTrashCan_1 = require("@fortawesome/free-regular-svg-icons/faTrashCan");
15
15
  exports.PickerDialog = (({ ref, dialogRef, multiple, children, showSelectedList = !!multiple, selectedListPlacement = 'right', selectedListProps, selectedItemProps, onConfirm, rows, nodes,
16
16
  // 以下属性从SelectionContextBaseProps继承
@@ -70,6 +70,6 @@ options = rows ?? nodes, primaryKey = 'id', childrenKey = 'children', relation =
70
70
  ...props.modalProps
71
71
  }, ...showSelectedList && {
72
72
  [selectedListPlacement === 'left' ? 'prefix' : 'suffix']: ((0, jsx_runtime_1.jsxs)("div", { className: pickerDialog_style_1.classes.selectedArea, children: [(0, jsx_runtime_1.jsxs)(divider_1.Divider, { className: pickerDialog_style_1.classes.count, textAlign: "start", children: [(0, jsx_runtime_1.jsxs)("div", { children: ["\u5DF2\u9009\u62E9", (0, jsx_runtime_1.jsx)("b", { children: selectedCount }), "\u9879"] }), clearable &&
73
- (0, jsx_runtime_1.jsx)(button_1.Button, { prefix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faTrashCan_1.faTrashCan }), variant: "plain", color: "text.secondary", onClick: () => setInnerValue(multiple ? [] : null), children: "\u6E05\u7A7A" })] }), (0, jsx_runtime_1.jsx)(selectedList_1.SelectedList, { itemProps: selectedItemProps, ...selectedListProps, className: (0, utils_1.clsx)(pickerDialog_style_1.classes.list, selectedListProps?.className) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: pickerDialog_style_1.classes.confirm, disabled: selectedCount === 0, onClick: () => confirmHandler(), children: "\u786E\u5B9A" })] }))
73
+ (0, jsx_runtime_1.jsx)(button_1.Button, { prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faTrashCan_1.faTrashCan }), variant: "plain", color: "text.secondary", onClick: () => setInnerValue(multiple ? [] : null), children: "\u6E05\u7A7A" })] }), (0, jsx_runtime_1.jsx)(selectedList_1.SelectedList, { itemProps: selectedItemProps, ...selectedListProps, className: (0, utils_1.clsx)(pickerDialog_style_1.classes.list, selectedListProps?.className) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: pickerDialog_style_1.classes.confirm, disabled: selectedCount === 0, onClick: () => confirmHandler(), children: "\u786E\u5B9A" })] }))
74
74
  }, children: renderChildren() }) }));
75
75
  });
@@ -143,6 +143,12 @@ exports.Pinchable = (({ component: Component = 'div', ref, gestureOptions, defau
143
143
  resetZoom();
144
144
  }
145
145
  };
146
+ const wheelHandler = (e) => {
147
+ childrenProps.onMouseWheel?.(e);
148
+ e.deltaY > 0
149
+ ? zoomFn(innerScale.current * .8, e.clientX, e.clientY)
150
+ : zoomFn(innerScale.current * 1.2, e.clientX, e.clientY);
151
+ };
146
152
  return ((0, jsx_runtime_1.jsx)(Component, { ...props, ref: wrapperRef, css: pinchable_style_1.style, className: (0, utils_1.clsx)(pinchable_style_1.classes.root, props.className), ...pinchableHandles, children: (0, react_1.cloneElement)(children, {
147
153
  ref: (0, utils_1.cloneRef)(contentRef, childrenProps.ref),
148
154
  className: (0, utils_1.clsx)(pinchable_style_1.classes.content, childrenProps.className),
@@ -155,6 +161,7 @@ exports.Pinchable = (({ component: Component = 'div', ref, gestureOptions, defau
155
161
  },
156
162
  ...draggableHandles,
157
163
  onDoubleClick: doubleClickHandler,
164
+ onWheel: wheelHandler,
158
165
  onTransitionEnd: e => e.currentTarget.dataset.transition = 'false'
159
166
  }) }));
160
167
  });
@@ -7,7 +7,7 @@ const progress_style_1 = require("./progress.style");
7
7
  const utils_1 = require("../../utils");
8
8
  const theme_1 = require("../theme");
9
9
  const react_2 = require("@emotion/react");
10
- const __1 = require("../..");
10
+ const icon_1 = require("../icon");
11
11
  const faCircleCheck_1 = require("@fortawesome/free-solid-svg-icons/faCircleCheck");
12
12
  const faCircleXmark_1 = require("@fortawesome/free-solid-svg-icons/faCircleXmark");
13
13
  exports.Progress = (0, react_1.memo)(({ showInfo = true, renderInfo, color, status = 'default', variant = 'linear', gapDegree = 90, size = 60, indeterminate = false, barWidth = 4, strokeLinecap = variant === 'gauge' ? 'butt' : 'round', value = 0, ...props }) => {
@@ -20,10 +20,10 @@ exports.Progress = (0, react_1.memo)(({ showInfo = true, renderInfo, color, stat
20
20
  return renderInfo(value);
21
21
  }
22
22
  if (isSucceed) {
23
- return (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCircleCheck_1.faCircleCheck, className: progress_style_1.classes.icon, style: { color: success.main } });
23
+ return (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCircleCheck_1.faCircleCheck, className: progress_style_1.classes.icon, style: { color: success.main } });
24
24
  }
25
25
  if (status === 'error') {
26
- return (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCircleXmark_1.faCircleXmark, className: progress_style_1.classes.icon, style: { color: error.main } });
26
+ return (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCircleXmark_1.faCircleXmark, className: progress_style_1.classes.icon, style: { color: error.main } });
27
27
  }
28
28
  return value + '%';
29
29
  };
@@ -6,9 +6,9 @@ const react_1 = require("react");
6
6
  const utils_1 = require("../../utils");
7
7
  const rating_style_1 = require("./rating.style");
8
8
  const theme_1 = require("../theme");
9
- const __1 = require("../..");
9
+ const icon_1 = require("../icon");
10
10
  const faStar_1 = require("@fortawesome/free-solid-svg-icons/faStar");
11
- exports.Rating = (0, react_1.memo)(({ color = '#FFCC00', size, count = 5, renderStar = (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faStar_1.faStar }), allowHalf, highlightSelectedOnly = false, defaultValue = 0, value, onChange, readOnly, disabled, ...props }) => {
11
+ exports.Rating = (0, react_1.memo)(({ color = '#FFCC00', size, count = 5, renderStar = (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faStar_1.faStar }), allowHalf, highlightSelectedOnly = false, defaultValue = 0, value, onChange, readOnly, disabled, ...props }) => {
12
12
  const theme = (0, theme_1.useTheme)();
13
13
  size ??= theme.size;
14
14
  const [innerValue, setInnerValue] = (0, utils_1.useControlled)(defaultValue, value, onChange);
@@ -14,7 +14,7 @@ const input_1 = require("../input");
14
14
  const loadingIndicator_1 = require("../loadingIndicator");
15
15
  const popper_style_1 = require("../popper/popper.style");
16
16
  const selectionContext_1 = require("../selectionContext");
17
- const __1 = require("../..");
17
+ const icon_1 = require("../icon");
18
18
  const faChevronDown_1 = require("@fortawesome/free-solid-svg-icons/faChevronDown");
19
19
  const faMagnifyingGlass_1 = require("@fortawesome/free-solid-svg-icons/faMagnifyingGlass");
20
20
  exports.Select = (0, react_1.memo)(({ inputProps, popperProps, popperRef, defaultOpen = false, open, onOpenChange, sizeAdaptable = true, children, multiple, defaultValue, value, onChange, renderBackfill, searchable, defaultSearchValue = '', searchValue, onSearchChange, searchInputProps,
@@ -82,7 +82,7 @@ showCheckbox = !!multiple, loading, options, labelKey = 'label', primaryKey = 'v
82
82
  return ((0, jsx_runtime_1.jsx)("div", { className: select_style_1.classes.backfillWrap, children: optionsMap.get(innerValue)?.[labelKey] ?? innerValue }));
83
83
  };
84
84
  return ((0, jsx_runtime_1.jsx)(popper_1.Popper, { css: popper_style_1.popperStyle, open: innerOpen.current, onOpenChange: openChangeHandler, onOpenChangeEnd: openChangeEnd, placement: "bottom", variant: "collapse", trigger: ['click', 'enter'], disabled: props.disabled || props.readOnly, sizeAdaptable: sizeAdaptable, content: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [searchable &&
85
- (0, jsx_runtime_1.jsx)(input_1.Input, { inputProps: { ref: searchInputRef }, prefix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faMagnifyingGlass_1.faMagnifyingGlass }), placeholder: "\u641C\u7D22", value: innerSearchValue.current, ...searchInputProps, onChange: e => {
85
+ (0, jsx_runtime_1.jsx)(input_1.Input, { inputProps: { ref: searchInputRef }, prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faMagnifyingGlass_1.faMagnifyingGlass }), placeholder: "\u641C\u7D22", value: innerSearchValue.current, ...searchInputProps, onChange: e => {
86
86
  searchInputProps?.onChange?.(e);
87
87
  setInnerSearchValue?.(e.target.value);
88
88
  }, onBlur: e => {
@@ -95,6 +95,6 @@ showCheckbox = !!multiple, loading, options, labelKey = 'label', primaryKey = 'v
95
95
  ? (0, jsx_runtime_1.jsx)("div", { className: select_style_1.classes.placeholder, children: props.placeholder ?? '请选择' })
96
96
  : (0, jsx_runtime_1.jsx)("div", { className: select_style_1.classes.backfill, children: renderBackfillFn() }), (0, jsx_runtime_1.jsx)("input", { size: 1, ...inputBaseProps, ...inputProps, "data-hidden": "true" }), (0, jsx_runtime_1.jsx)("div", { className: select_style_1.classes.arrow, "data-open": innerOpen.current, children: loading
97
97
  ? (0, jsx_runtime_1.jsx)(loadingIndicator_1.LoadingIndicator, {})
98
- : (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faChevronDown_1.faChevronDown }) })] }) }) }));
98
+ : (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faChevronDown_1.faChevronDown }) })] }) }) }));
99
99
  });
100
100
  exports.Option = exports.Select.Option = menuItem_1.MenuItem;
@@ -11,7 +11,7 @@ const react_transition_group_1 = require("react-transition-group");
11
11
  const status_1 = require("../status");
12
12
  const button_1 = require("../button");
13
13
  const react_dom_1 = require("react-dom");
14
- const __1 = require("../..");
14
+ const icon_1 = require("../icon");
15
15
  const faXmark_1 = require("@fortawesome/free-solid-svg-icons/faXmark");
16
16
  class SnackbarBaseMethods {
17
17
  async info(_) {
@@ -115,7 +115,7 @@ exports.SnackbarBaseItem = (0, react_2.memo)(({ id, type, useTo, resolve, varian
115
115
  const colorValue = (0, utils_1.useColor)(color);
116
116
  const renderedIcon = icon ?? (variant === 'outlined'
117
117
  ? (0, jsx_runtime_1.jsx)(status_1.StatusIcon, { status: type })
118
- : (0, jsx_runtime_1.jsx)(__1.Icon, { icon: status_1.statusMapToIconDefinition[type] }));
118
+ : (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: status_1.statusMapToIconDefinition[type] }));
119
119
  const closeHandler = (e) => {
120
120
  e.stopPropagation();
121
121
  onCloseButtonClick?.(e);
@@ -128,5 +128,5 @@ exports.SnackbarBaseItem = (0, react_2.memo)(({ id, type, useTo, resolve, varian
128
128
  (0, jsx_runtime_1.jsxs)("div", { className: snackbarBase_style_1.classes.text, children: [!!title &&
129
129
  (0, jsx_runtime_1.jsx)("div", { className: snackbarBase_style_1.classes.title, children: title }), !!content &&
130
130
  (0, jsx_runtime_1.jsx)("div", { className: snackbarBase_style_1.classes.content, children: content })] }), showClose &&
131
- (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "text", shape: "circular", color: "text.disabled", size: "small", className: snackbarBase_style_1.classes.close, onClick: closeHandler, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faXmark_1.faXmark }) })] }) }));
131
+ (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "text", shape: "circular", color: "text.disabled", size: "small", className: snackbarBase_style_1.classes.close, onClick: closeHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faXmark_1.faXmark }) })] }) }));
132
132
  });
@@ -7,7 +7,7 @@ const utils_1 = require("../../utils");
7
7
  const step_style_1 = require("./step.style");
8
8
  const stepper_1 = require("./stepper");
9
9
  const theme_1 = require("../theme");
10
- const __1 = require("../..");
10
+ const icon_1 = require("../icon");
11
11
  const faCheck_1 = require("@fortawesome/free-solid-svg-icons/faCheck");
12
12
  const faCircleInfo_1 = require("@fortawesome/free-solid-svg-icons/faCircleInfo");
13
13
  const faXmark_1 = require("@fortawesome/free-solid-svg-icons/faXmark");
@@ -37,13 +37,13 @@ size, gap, color, variant, labelPlacement, clickable, status = 'waiting', ...pro
37
37
  case 'processing':
38
38
  return step + 1;
39
39
  case 'finished':
40
- return (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCheck_1.faCheck });
40
+ return (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCheck_1.faCheck });
41
41
  case 'warning':
42
- return (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCircleInfo_1.faCircleInfo });
42
+ return (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCircleInfo_1.faCircleInfo });
43
43
  case 'error':
44
- return (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faXmark_1.faXmark });
44
+ return (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faXmark_1.faXmark });
45
45
  case 'skipped':
46
- return (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faMinus_1.faMinus });
46
+ return (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faMinus_1.faMinus });
47
47
  }
48
48
  })() }) }), (0, jsx_runtime_1.jsxs)("div", { className: step_style_1.classes.label, children: [(0, jsx_runtime_1.jsx)("div", { className: step_style_1.classes.title, children: (0, jsx_runtime_1.jsx)("div", { className: step_style_1.classes.titleText, children: renderInner(title) }) }), (0, jsx_runtime_1.jsx)("div", { className: step_style_1.classes.description, children: renderInner(description) })] })] }));
49
49
  });
@@ -7,7 +7,7 @@ const tabs_style_1 = require("./tabs.style");
7
7
  const popper_1 = require("../popper");
8
8
  const tabsEllipsis_style_1 = require("./tabsEllipsis.style");
9
9
  const optionsBase_1 = require("../optionsBase");
10
- const __1 = require("../..");
10
+ const icon_1 = require("../icon");
11
11
  const faEllipsis_1 = require("@fortawesome/free-solid-svg-icons/faEllipsis");
12
12
  exports.TabsEllipsis = (0, react_1.memo)(({ tabs, children, labelKey = 'label', primaryKey = 'value', value, onToggleSelected }) => {
13
13
  const [open, setOpen] = (0, react_1.useState)(false);
@@ -26,5 +26,5 @@ exports.TabsEllipsis = (0, react_1.memo)(({ tabs, children, labelKey = 'label',
26
26
  onToggleSelected(value);
27
27
  setOpen(false);
28
28
  };
29
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(popper_1.Popper, { css: tabsEllipsis_style_1.tabsEllipsisPopperStyle, placement: "bottomRight", trigger: "hover", open: open, onOpenChange: setOpen, content: (0, jsx_runtime_1.jsx)(optionsBase_1.OptionsBase, { options: getOptions(), selectedValue: value, onToggleSelected: _onToggleSelected }), children: (0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.ellipsis, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faEllipsis_1.faEllipsis }) }) }) }));
29
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(popper_1.Popper, { css: tabsEllipsis_style_1.tabsEllipsisPopperStyle, placement: "bottomRight", trigger: "hover", open: open, onOpenChange: setOpen, content: (0, jsx_runtime_1.jsx)(optionsBase_1.OptionsBase, { options: getOptions(), selectedValue: value, onToggleSelected: _onToggleSelected }), children: (0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.ellipsis, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faEllipsis_1.faEllipsis }) }) }) }));
30
30
  });
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const tag_style_1 = require("./tag.style");
7
7
  const utils_1 = require("../../utils");
8
- const __1 = require("../..");
8
+ const icon_1 = require("../icon");
9
9
  const faXmark_1 = require("@fortawesome/free-solid-svg-icons/faXmark");
10
10
  exports.Tag = (0, react_1.memo)(({ variant = 'outlined', color = 'text.secondary', shape = 'square', size = 'small', prefix, suffix, clickable, closable, onClose, ...props }) => {
11
11
  const closeHandler = (e) => {
@@ -16,5 +16,5 @@ exports.Tag = (0, react_1.memo)(({ variant = 'outlined', color = 'text.secondary
16
16
  return ((0, jsx_runtime_1.jsxs)("div", { ...props, css: (0, tag_style_1.useStyle)({ color: color || 'text.secondary' }), className: (0, utils_1.clsx)(tag_style_1.classes.root, props.className), "data-variant": variant, "data-size": size, "data-shape": shape, "data-clickable": clickable, children: [!!prefix &&
17
17
  (0, jsx_runtime_1.jsx)("div", { className: tag_style_1.classes.prefix, children: prefix }), (0, jsx_runtime_1.jsx)("div", { className: tag_style_1.classes.content, children: props.children }), !!suffix &&
18
18
  (0, jsx_runtime_1.jsx)("div", { className: tag_style_1.classes.suffix, children: suffix }), closable &&
19
- (0, jsx_runtime_1.jsx)("div", { className: tag_style_1.classes.close, onClick: closeHandler, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faXmark_1.faXmark }) })] }));
19
+ (0, jsx_runtime_1.jsx)("div", { className: tag_style_1.classes.close, onClick: closeHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faXmark_1.faXmark }) })] }));
20
20
  });
@@ -8,7 +8,7 @@ const transfer_style_1 = require("./transfer.style");
8
8
  const utils_1 = require("../../utils");
9
9
  const button_1 = require("../button");
10
10
  const transferPanel_1 = require("./transferPanel");
11
- const __1 = require("../..");
11
+ const icon_1 = require("../icon");
12
12
  const faAngleLeft_1 = require("@fortawesome/free-solid-svg-icons/faAngleLeft");
13
13
  const faAngleRight_1 = require("@fortawesome/free-solid-svg-icons/faAngleRight");
14
14
  const TransferContext = (0, react_1.createContext)({});
@@ -34,12 +34,12 @@ exports.Transfer = (0, react_1.memo)(({ options, primaryKey = 'value', fullWidth
34
34
  {
35
35
  disabled: !leftSelected.length,
36
36
  onClick: toRight,
37
- children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faAngleRight_1.faAngleRight })
37
+ children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faAngleRight_1.faAngleRight })
38
38
  },
39
39
  {
40
40
  disabled: !rightSelected.length,
41
41
  onClick: toLeft,
42
- children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faAngleLeft_1.faAngleLeft })
42
+ children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faAngleLeft_1.faAngleLeft })
43
43
  }
44
44
  ];
45
45
  if (renderButtons) {
@@ -12,7 +12,7 @@ const utils_1 = require("../../utils");
12
12
  const highlight_1 = require("../highlight");
13
13
  const placeholder_1 = require("../placeholder");
14
14
  const treeNode_1 = require("./treeNode");
15
- const __1 = require("../..");
15
+ const icon_1 = require("../icon");
16
16
  const faMagnifyingGlass_1 = require("@fortawesome/free-solid-svg-icons/faMagnifyingGlass");
17
17
  const TreeContext = (0, react_2.createContext)({});
18
18
  function useTreeContext() {
@@ -57,7 +57,7 @@ primaryKey = 'value', childrenKey = 'children', relation = 'dependent', integrat
57
57
  defaultSearchValue, searchValue, onSearchChange
58
58
  });
59
59
  return ((0, jsx_runtime_1.jsxs)("div", { ...props, css: tree_style_1.style, className: (0, utils_1.clsx)(tree_style_1.classes.root, props.className), "data-show-line": showLine, children: [searchable &&
60
- (0, jsx_runtime_1.jsx)(input_1.Input, { className: tree_style_1.classes.search, prefix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faMagnifyingGlass_1.faMagnifyingGlass }), placeholder: "\u641C\u7D22", value: innerSearchValue.current, ...searchInputProps, onChange: e => {
60
+ (0, jsx_runtime_1.jsx)(input_1.Input, { className: tree_style_1.classes.search, prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faMagnifyingGlass_1.faMagnifyingGlass }), placeholder: "\u641C\u7D22", value: innerSearchValue.current, ...searchInputProps, onChange: e => {
61
61
  searchInputProps?.onChange?.(e);
62
62
  setInnerSearchValue(e.target.value);
63
63
  } }), (0, jsx_runtime_1.jsx)(selectionContext_1.SelectionContext, { ...selectionContextProps, children: (0, jsx_runtime_1.jsx)(TreeContext, { value: (0, react_2.useMemo)(() => ({
@@ -10,7 +10,7 @@ const button_1 = require("../button");
10
10
  const checkbox_1 = require("../checkbox");
11
11
  const tree_1 = require("./tree");
12
12
  const selectionContext_1 = require("../selectionContext");
13
- const __1 = require("../..");
13
+ const icon_1 = require("../icon");
14
14
  const faChevronRight_1 = require("@fortawesome/free-solid-svg-icons/faChevronRight");
15
15
  exports.TreeNode = (0, react_1.memo)(({ value, label, prefix, suffix, disabled, _level = 0, ...props }) => {
16
16
  const { expandedSet = new Set(), toggleExpanded, indent, renderExpandIcon, showCheckbox, readOnly, clickLabelToExpand, ...context } = (0, tree_1.useTreeContext)();
@@ -29,7 +29,7 @@ exports.TreeNode = (0, react_1.memo)(({ value, label, prefix, suffix, disabled,
29
29
  }, children: renderExpandIcon
30
30
  ? renderExpandIcon(value, !!currentExpanded, [...expandedSet])
31
31
  : hasChildren &&
32
- (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faChevronRight_1.faChevronRight, className: tree_style_1.classes.icon, style: {
32
+ (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faChevronRight_1.faChevronRight, className: tree_style_1.classes.icon, style: {
33
33
  rotate: currentExpanded ? '90deg' : '0deg'
34
34
  } }) }), showCheckbox &&
35
35
  (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { className: tree_style_1.classes.checkbox, checked: status === 2, indeterminate: status === 1, onClick: e => {
@@ -12,7 +12,7 @@ const popper_style_1 = require("../popper/popper.style");
12
12
  const tag_1 = require("../tag");
13
13
  const treeSelect_style_1 = require("./treeSelect.style");
14
14
  const selectionContext_1 = require("../selectionContext");
15
- const __1 = require("../..");
15
+ const icon_1 = require("../icon");
16
16
  const faChevronDown_1 = require("@fortawesome/free-solid-svg-icons/faChevronDown");
17
17
  exports.TreeSelect = (0, react_1.memo)(({ inputProps, popperProps, popperRef, nodes, options, defaultValue, value, onChange, sizeAdaptable, loading, defaultOpen, open, onOpenChange, renderBackfill,
18
18
  // 以下属性转发至<InputBase/>
@@ -78,6 +78,6 @@ placeholder = '请选择', autoFocus, clearable, onClear, ...props }) => {
78
78
  ? (0, jsx_runtime_1.jsx)("div", { className: treeSelect_style_1.classes.placeholder, children: placeholder })
79
79
  : (0, jsx_runtime_1.jsx)("div", { className: treeSelect_style_1.classes.backfill, children: renderBackfillFn() }), (0, jsx_runtime_1.jsx)("input", { size: 1, ...rest, ...inputProps, ref: (0, utils_1.cloneRef)(ref, inputProps?.ref), "data-hidden": "true" }), (0, jsx_runtime_1.jsx)("div", { className: treeSelect_style_1.classes.arrow, "data-open": open, children: loading
80
80
  ? (0, jsx_runtime_1.jsx)(loadingIndicator_1.LoadingIndicator, {})
81
- : (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faChevronDown_1.faChevronDown }) })] }) }) }));
81
+ : (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faChevronDown_1.faChevronDown }) })] }) }) }));
82
82
  });
83
83
  exports.TreeSelect.Option = exports.TreeSelect.Node = tree_1.TreeNode;
@@ -9,7 +9,7 @@ const button_1 = require("../button");
9
9
  const tooltip_1 = require("../tooltip");
10
10
  const input_1 = require("../input");
11
11
  const textarea_1 = require("../textarea");
12
- const __1 = require("../..");
12
+ const icon_1 = require("../icon");
13
13
  const faCheck_1 = require("@fortawesome/free-solid-svg-icons/faCheck");
14
14
  const faCopy_1 = require("@fortawesome/free-regular-svg-icons/faCopy");
15
15
  const faPenToSquare_1 = require("@fortawesome/free-regular-svg-icons/faPenToSquare");
@@ -76,9 +76,9 @@ exports.Typography = (0, react_1.memo)(({ component: Component = 'p', color = 't
76
76
  }, children: props.children })
77
77
  : props.children, !expanded && expandable && ellipsisRows > 0 &&
78
78
  (0, jsx_runtime_1.jsx)(button_1.Button, { ...expandButtonProps, className: (0, utils_1.clsx)(typography_style_1.classes.expand, typography_style_1.classes.action, expandButtonProps?.className), variant: "plain", onClick: () => setExpanded(true), children: "\u5C55\u5F00" }), editable &&
79
- (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u7F16\u8F91", children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: typography_style_1.classes.action, variant: "plain", onClick: editHandler, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faPenToSquare_1.faPenToSquare }) }) }), copyable && (copied
80
- ? (0, jsx_runtime_1.jsx)("div", { className: typography_style_1.classes.copied, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCheck_1.faCheck }) })
81
- : (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u590D\u5236", children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: typography_style_1.classes.action, variant: "plain", onClick: copyHandler, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCopy_1.faCopy }) }) }))] });
79
+ (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u7F16\u8F91", children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: typography_style_1.classes.action, variant: "plain", onClick: editHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faPenToSquare_1.faPenToSquare }) }) }), copyable && (copied
80
+ ? (0, jsx_runtime_1.jsx)("div", { className: typography_style_1.classes.copied, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCheck_1.faCheck }) })
81
+ : (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u590D\u5236", children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: typography_style_1.classes.action, variant: "plain", onClick: copyHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCopy_1.faCopy }) }) }))] });
82
82
  });
83
83
  exports.Typography.div = (0, react_1.memo)((props) => (0, jsx_runtime_1.jsx)(exports.Typography, { ...props, component: "div" }));
84
84
  exports.Typography.h1 = (0, react_1.memo)((props) => (0, jsx_runtime_1.jsx)(exports.Typography, { ...props, component: "h1" }));
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const dropArea_style_1 = require("./dropArea.style");
7
7
  const utils_1 = require("../../utils");
8
- const __1 = require("../..");
8
+ const icon_1 = require("../icon");
9
9
  const faInbox_1 = require("@fortawesome/free-solid-svg-icons/faInbox");
10
10
  exports.DropArea = (0, react_1.memo)(({ description = '点击选择文件,或将文件拖拽到这里', onDrop, ...props }) => {
11
11
  const [draggingOver, setDraggingOver] = (0, react_1.useState)(false);
@@ -33,5 +33,5 @@ exports.DropArea = (0, react_1.memo)(({ description = '点击选择文件,或
33
33
  }, onDragLeave: e => {
34
34
  props.onDragLeave?.(e);
35
35
  setDraggingOver(false);
36
- }, onDrop: dropHandler, children: [(0, jsx_runtime_1.jsx)(__1.Icon, { icon: faInbox_1.faInbox, className: dropArea_style_1.classes.icon }), (0, jsx_runtime_1.jsx)("div", { className: dropArea_style_1.classes.description, children: description })] }));
36
+ }, onDrop: dropHandler, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faInbox_1.faInbox, className: dropArea_style_1.classes.icon }), (0, jsx_runtime_1.jsx)("div", { className: dropArea_style_1.classes.description, children: description })] }));
37
37
  });
@@ -9,7 +9,7 @@ const button_1 = require("../button");
9
9
  const progress_1 = require("../progress");
10
10
  const theme_1 = require("../theme");
11
11
  const itemStatus_1 = require("./itemStatus");
12
- const __1 = require("../..");
12
+ const icon_1 = require("../icon");
13
13
  const faCircleCheck_1 = require("@fortawesome/free-solid-svg-icons/faCircleCheck");
14
14
  const faCircleXmark_1 = require("@fortawesome/free-solid-svg-icons/faCircleXmark");
15
15
  const faXmark_1 = require("@fortawesome/free-solid-svg-icons/faXmark");
@@ -18,11 +18,11 @@ exports.FileItem = (0, react_1.memo)((props) => {
18
18
  const { status, progress } = (0, itemStatus_1.useItemStatus)(props);
19
19
  const { colors } = (0, theme_1.useTheme)();
20
20
  const statusToIcon = {
21
- 'default': (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faPaperclip_1.faPaperclip }),
21
+ 'default': (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faPaperclip_1.faPaperclip }),
22
22
  uploading: (0, jsx_runtime_1.jsx)(loadingIndicator_1.LoadingIndicator, {}),
23
- success: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCircleCheck_1.faCircleCheck, style: { color: colors.success.main } }),
24
- error: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faCircleXmark_1.faCircleXmark, style: { color: colors.error.main } })
23
+ success: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCircleCheck_1.faCircleCheck, style: { color: colors.success.main } }),
24
+ error: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faCircleXmark_1.faCircleXmark, style: { color: colors.error.main } })
25
25
  };
26
26
  return ((0, jsx_runtime_1.jsxs)("div", { className: upload_style_1.classes.file, "data-status": status, children: [(0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.icon, children: statusToIcon[status] }), (0, jsx_runtime_1.jsxs)("div", { className: upload_style_1.classes.info, children: [(0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.name, children: props.file.name }), status !== 'default' &&
27
- (0, jsx_runtime_1.jsx)(progress_1.Progress, { className: upload_style_1.classes.progress, barWidth: 2, showInfo: false, value: progress, status: status === 'uploading' ? 'processing' : status })] }), (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.control, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "plain", color: "error", onClick: props.onRemove, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faXmark_1.faXmark }) }) })] }));
27
+ (0, jsx_runtime_1.jsx)(progress_1.Progress, { className: upload_style_1.classes.progress, barWidth: 2, showInfo: false, value: progress, status: status === 'uploading' ? 'processing' : status })] }), (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.control, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "plain", color: "error", onClick: props.onRemove, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faXmark_1.faXmark }) }) })] }));
28
28
  });
@@ -9,7 +9,7 @@ const image_1 = require("../image");
9
9
  const button_1 = require("../button");
10
10
  const progress_1 = require("../progress");
11
11
  const utils_1 = require("../../utils");
12
- const __1 = require("../..");
12
+ const icon_1 = require("../icon");
13
13
  const faTrashCan_1 = require("@fortawesome/free-regular-svg-icons/faTrashCan");
14
14
  const faEye_1 = require("@fortawesome/free-regular-svg-icons/faEye");
15
15
  exports.ImageItem = (0, react_1.memo)((props) => {
@@ -19,8 +19,8 @@ exports.ImageItem = (0, react_1.memo)((props) => {
19
19
  open: previewOpen,
20
20
  onOpenChange: setPreviewOpen
21
21
  }, actions: [
22
- (0, jsx_runtime_1.jsx)(button_1.Button, { size: "small", variant: "text", shape: "circular", color: "text.secondary", onClick: () => setPreviewOpen(true), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faEye_1.faEye }) }, "preview"),
23
- (0, jsx_runtime_1.jsx)(button_1.Button, { size: "small", variant: "text", shape: "circular", color: "error", onClick: props.onRemove, children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faTrashCan_1.faTrashCan }) }, "delete")
22
+ (0, jsx_runtime_1.jsx)(button_1.Button, { size: "small", variant: "text", shape: "circular", color: "text.secondary", onClick: () => setPreviewOpen(true), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faEye_1.faEye }) }, "preview"),
23
+ (0, jsx_runtime_1.jsx)(button_1.Button, { size: "small", variant: "text", shape: "circular", color: "error", onClick: props.onRemove, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faTrashCan_1.faTrashCan }) }, "delete")
24
24
  ], children: status !== 'default' &&
25
25
  (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.clsx)(upload_style_1.classes.progress), children: (0, jsx_runtime_1.jsx)(progress_1.Progress, { variant: "circular", showInfo: status !== 'uploading', value: progress, status: status === 'uploading' ? 'processing' : status }) }) }) }));
26
26
  });
@@ -14,7 +14,7 @@ const core_1 = require("@dnd-kit/core");
14
14
  const sortable_1 = require("@dnd-kit/sortable");
15
15
  const sortableItem_1 = require("../sortableItem");
16
16
  const dropArea_1 = require("./dropArea");
17
- const __1 = require("../..");
17
+ const icon_1 = require("../icon");
18
18
  const faPlus_1 = require("@fortawesome/free-solid-svg-icons/faPlus");
19
19
  const faUpload_1 = require("@fortawesome/free-solid-svg-icons/faUpload");
20
20
  const markFileId = (files) => {
@@ -99,12 +99,12 @@ exports.Upload = (0, react_1.memo)(({ inputProps, type = 'file', accept = type =
99
99
  ? (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [droppable
100
100
  ? (0, jsx_runtime_1.jsx)(dropArea_1.DropArea, { onClick: () => innerInputRef.current.click(), onDrop: changeFn })
101
101
  : showButton &&
102
- (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outlined", prefix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faUpload_1.faUpload }), ...buttonProps, onClick: buttonClick, children: buttonText }), (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.files, children: innerValue.current.map(file => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortable, id: file.id, children: (0, jsx_runtime_1.jsx)(fileItem_1.FileItem, { ref: r => {
102
+ (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outlined", prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faUpload_1.faUpload }), ...buttonProps, onClick: buttonClick, children: buttonText }), (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.files, children: innerValue.current.map(file => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortable, id: file.id, children: (0, jsx_runtime_1.jsx)(fileItem_1.FileItem, { ref: r => {
103
103
  r
104
104
  ? itemRefs.current.set(file.id, r)
105
105
  : itemRefs.current.delete(file.id);
106
106
  }, file: file, onRemove: () => removeHandler(file.id), onUpload: onUpload }) }, file.id)) })] })
107
- : (0, jsx_runtime_1.jsxs)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.images, children: [(0, jsx_runtime_1.jsx)(transitionBase_1.Grow, { children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.imageWrap, "data-clickable": "true", children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.image, onClick: () => innerInputRef.current.click(), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faPlus_1.faPlus }) }) }) }), innerValue.current.map(file => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortable, id: file.id, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(imageItem_1.ImageItem, { ref: r => {
107
+ : (0, jsx_runtime_1.jsxs)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.images, children: [(0, jsx_runtime_1.jsx)(transitionBase_1.Grow, { children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.imageWrap, "data-clickable": "true", children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.image, onClick: () => innerInputRef.current.click(), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faPlus_1.faPlus }) }) }) }), innerValue.current.map(file => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortable, id: file.id, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(imageItem_1.ImageItem, { ref: r => {
108
108
  r
109
109
  ? itemRefs.current.set(file.id, r)
110
110
  : itemRefs.current.delete(file.id);
@@ -13,7 +13,8 @@ const button_1 = require("../../components/button");
13
13
  const documentViewer_style_1 = require("./documentViewer.style");
14
14
  const utils_1 = require("../../utils");
15
15
  const pdfViewer_1 = require("./pdfViewer");
16
- const __1 = require("../..");
16
+ const icon_1 = require("../../components/icon");
17
+ const gallery_1 = require("../../components/gallery");
17
18
  const faDownload_1 = require("@fortawesome/free-solid-svg-icons/faDownload");
18
19
  exports.DocumentViewer = (0, react_1.memo)(({ src, filename, onError, type, extension, setDocumentTitle = true }) => {
19
20
  const mimeType = (0, react_1.useMemo)(() => {
@@ -40,7 +41,7 @@ exports.DocumentViewer = (0, react_1.memo)(({ src, filename, onError, type, exte
40
41
  a.click();
41
42
  }
42
43
  };
43
- const empty = ((0, jsx_runtime_1.jsx)(placeholder_1.Placeholder, { description: "\u8BE5\u6587\u4EF6\u6682\u4E0D\u652F\u6301\u9884\u89C8", extra: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outlined", prefix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faDownload_1.faDownload }), onClick: downloadHandler, children: "\u4E0B\u8F7D" }) }));
44
+ const empty = ((0, jsx_runtime_1.jsx)(placeholder_1.Placeholder, { description: "\u8BE5\u6587\u4EF6\u6682\u4E0D\u652F\u6301\u9884\u89C8", extra: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outlined", prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faDownload_1.faDownload }), onClick: downloadHandler, children: "\u4E0B\u8F7D" }) }));
44
45
  if (!mimeType) {
45
46
  return empty;
46
47
  }
@@ -64,7 +65,7 @@ exports.DocumentViewer = (0, react_1.memo)(({ src, filename, onError, type, exte
64
65
  }
65
66
  // image
66
67
  if (mimeType.includes('image/')) {
67
- return (0, jsx_runtime_1.jsx)(__1.Gallery, { src: src, open: true, showClose: false });
68
+ return (0, jsx_runtime_1.jsx)(gallery_1.Gallery, { src: src, open: true, showClose: false });
68
69
  }
69
70
  return empty;
70
71
  });
@@ -64,7 +64,7 @@ exports.svgStyle = (0, utils_1.defineCss)(({ spacing, background, divider, text,
64
64
  background-color: ${background.body};
65
65
  overflow: hidden;
66
66
  }
67
-
67
+
68
68
  .${exports.classes.svgContent}, .${exports.classes.object} {
69
69
  width: 100%;
70
70
  height: 100%;
@@ -72,6 +72,7 @@ exports.svgStyle = (0, utils_1.defineCss)(({ spacing, background, divider, text,
72
72
 
73
73
  .${exports.classes.object} {
74
74
  pointer-events: none;
75
+ user-select: none;
75
76
  transition: rotate .4s ${easing.easeOut};
76
77
  }
77
78
  `);
@@ -1,13 +1,13 @@
1
- import { ReactZoomPanPinchProps } from 'react-zoom-pan-pinch';
2
1
  import { Theme } from '../../components/theme';
3
2
  import { LoadingProps } from '../../components/loading';
4
3
  import { DocumentViewerBaseProps } from './documentViewer';
4
+ import { PinchableProps } from '../../components/pinchable';
5
5
  export interface SvgViewerProps extends DocumentViewerBaseProps, Omit<LoadingProps, 'onError'> {
6
6
  /** 是否显示下载按钮,默认为true */
7
7
  showDownload?: boolean;
8
8
  /** 是否可切换主题,默认为true */
9
9
  themeSwitchable?: boolean;
10
10
  onThemeChange?(mode: Theme['mode']): void;
11
- transformWrapperProps?: ReactZoomPanPinchProps;
11
+ pinchableProps?: PinchableProps;
12
12
  }
13
13
  export declare const SvgViewer: import("react").MemoExoticComponent<(props: SvgViewerProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
@@ -4,7 +4,6 @@ exports.SvgViewer = void 0;
4
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const documentViewer_style_1 = require("./documentViewer.style");
7
- const react_zoom_pan_pinch_1 = require("react-zoom-pan-pinch");
8
7
  const utils_1 = require("../../utils");
9
8
  const button_1 = require("../../components/button");
10
9
  const tooltip_1 = require("../../components/tooltip");
@@ -13,7 +12,7 @@ const switch_1 = require("../../components/switch");
13
12
  const theme_1 = require("../../components/theme");
14
13
  const loading_1 = require("../../components/loading");
15
14
  const documentViewer_1 = require("./documentViewer");
16
- const __1 = require("../..");
15
+ const icon_1 = require("../../components/icon");
17
16
  const faDiagramProject_1 = require("@fortawesome/free-solid-svg-icons/faDiagramProject");
18
17
  const faDownload_1 = require("@fortawesome/free-solid-svg-icons/faDownload");
19
18
  const faExpand_1 = require("@fortawesome/free-solid-svg-icons/faExpand");
@@ -23,6 +22,7 @@ const faRotateLeft_1 = require("@fortawesome/free-solid-svg-icons/faRotateLeft")
23
22
  const faRotateRight_1 = require("@fortawesome/free-solid-svg-icons/faRotateRight");
24
23
  const faMagnifyingGlassMinus_1 = require("@fortawesome/free-solid-svg-icons/faMagnifyingGlassMinus");
25
24
  const faMagnifyingGlassPlus_1 = require("@fortawesome/free-solid-svg-icons/faMagnifyingGlassPlus");
25
+ const pinchable_1 = require("../../components/pinchable");
26
26
  const commonButtonProps = {
27
27
  variant: 'text',
28
28
  shape: 'circular'
@@ -30,7 +30,7 @@ const commonButtonProps = {
30
30
  exports.SvgViewer = (0, react_1.memo)((props) => {
31
31
  return ((0, jsx_runtime_1.jsx)(theme_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(SvgViewerContent, { ...props }) }));
32
32
  });
33
- function SvgViewerContent({ showDownload = true, themeSwitchable = true, onThemeChange, transformWrapperProps,
33
+ function SvgViewerContent({ showDownload = true, themeSwitchable = true, onThemeChange, pinchableProps,
34
34
  // 从DocumentViewerBaseProps继承来的属性
35
35
  src, filename, onError, setDocumentTitle, ...props }) {
36
36
  /**
@@ -60,13 +60,17 @@ src, filename, onError, setDocumentTitle, ...props }) {
60
60
  return URL.createObjectURL(file);
61
61
  }
62
62
  return;
63
- }, [blob]);
63
+ }, [blob, filename]);
64
64
  /**
65
65
  * ---------------------------------------------------------------
66
66
  * 工具栏
67
67
  */
68
- const transformWrapperRef = (0, react_1.useRef)(null);
68
+ const pinchableRef = (0, react_1.useRef)(null);
69
69
  const [rotate, setRotate] = (0, react_1.useState)(0);
70
+ const resetHandler = () => {
71
+ pinchableRef.current.reset();
72
+ setRotate(0);
73
+ };
70
74
  const downloadHandler = () => {
71
75
  if (src) {
72
76
  const a = document.createElement('a');
@@ -76,9 +80,9 @@ src, filename, onError, setDocumentTitle, ...props }) {
76
80
  }
77
81
  };
78
82
  const objectOnLoad = () => {
79
- transformWrapperRef.current.centerView();
83
+ // transformWrapperRef.current!.centerView()
80
84
  };
81
- return ((0, jsx_runtime_1.jsxs)(loading_1.Loading, { ...props, css: documentViewer_style_1.svgStyle, className: (0, utils_1.clsx)(documentViewer_style_1.classes.svgViewer, props.className), open: loading, children: [(0, jsx_runtime_1.jsxs)("div", { className: documentViewer_style_1.classes.svgToolbar, children: [(0, jsx_runtime_1.jsxs)("div", { className: documentViewer_style_1.classes.svgTitle, children: [(0, jsx_runtime_1.jsx)(__1.Icon, { icon: faDiagramProject_1.faDiagramProject, className: documentViewer_style_1.classes.svgIcon }), (0, jsx_runtime_1.jsx)("div", { children: filename })] }), (0, jsx_runtime_1.jsxs)("div", { className: documentViewer_style_1.classes.svgToolbarRight, children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u65CB\u8F6C-90\u00B0", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => setRotate(rotate - 90), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faRotateLeft_1.faRotateLeft }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u65CB\u8F6C90\u00B0", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => setRotate(rotate + 90), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faRotateRight_1.faRotateRight }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u7F29\u5C0F", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => transformWrapperRef.current.zoomOut(), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faMagnifyingGlassMinus_1.faMagnifyingGlassMinus }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u653E\u5927", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => transformWrapperRef.current.zoomIn(), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faMagnifyingGlassPlus_1.faMagnifyingGlassPlus }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u9002\u5E94\u5C4F\u5E55", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => transformWrapperRef.current.resetTransform(), children: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faExpand_1.faExpand }) }) }), themeSwitchable &&
82
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { className: documentViewer_style_1.classes.svgDivider, orientation: "vertical" }), (0, jsx_runtime_1.jsx)(switch_1.Switch, { checkedLabel: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faSun_1.faSun }), unCheckedLabel: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faMoon_1.faMoon }), checked: mode === 'light', onChange: themeChangeHandler })] }), showDownload &&
83
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { className: documentViewer_style_1.classes.svgDivider, orientation: "vertical" }), (0, jsx_runtime_1.jsx)(button_1.Button, { prefix: (0, jsx_runtime_1.jsx)(__1.Icon, { icon: faDownload_1.faDownload }), onClick: downloadHandler, children: "\u4E0B\u8F7D" })] })] })] }), (0, jsx_runtime_1.jsx)(react_zoom_pan_pinch_1.TransformWrapper, { smooth: false, ...transformWrapperProps, ref: transformWrapperRef, minScale: .2, children: (0, jsx_runtime_1.jsx)(react_zoom_pan_pinch_1.TransformComponent, { wrapperClass: documentViewer_style_1.classes.svgContainer, contentClass: documentViewer_style_1.classes.svgContent, children: (0, jsx_runtime_1.jsx)("object", { className: documentViewer_style_1.classes.object, data: data, style: { rotate: `${rotate}deg` }, onLoad: objectOnLoad, onError: onError }) }) })] }));
85
+ return ((0, jsx_runtime_1.jsxs)(loading_1.Loading, { ...props, css: documentViewer_style_1.svgStyle, className: (0, utils_1.clsx)(documentViewer_style_1.classes.svgViewer, props.className), open: loading, children: [(0, jsx_runtime_1.jsxs)("div", { className: documentViewer_style_1.classes.svgToolbar, children: [(0, jsx_runtime_1.jsxs)("div", { className: documentViewer_style_1.classes.svgTitle, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faDiagramProject_1.faDiagramProject, className: documentViewer_style_1.classes.svgIcon }), (0, jsx_runtime_1.jsx)("div", { children: filename })] }), (0, jsx_runtime_1.jsxs)("div", { className: documentViewer_style_1.classes.svgToolbarRight, children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u65CB\u8F6C-90\u00B0", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => setRotate(rotate - 90), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faRotateLeft_1.faRotateLeft }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u65CB\u8F6C90\u00B0", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => setRotate(rotate + 90), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faRotateRight_1.faRotateRight }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u7F29\u5C0F", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => pinchableRef.current.zoomOut(), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faMagnifyingGlassMinus_1.faMagnifyingGlassMinus }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u653E\u5927", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: () => pinchableRef.current.zoomIn(), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faMagnifyingGlassPlus_1.faMagnifyingGlassPlus }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u9002\u5E94\u5C4F\u5E55", children: (0, jsx_runtime_1.jsx)(button_1.Button, { ...commonButtonProps, onClick: resetHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faExpand_1.faExpand }) }) }), themeSwitchable &&
86
+ (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { className: documentViewer_style_1.classes.svgDivider, orientation: "vertical" }), (0, jsx_runtime_1.jsx)(switch_1.Switch, { checkedLabel: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faSun_1.faSun }), unCheckedLabel: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faMoon_1.faMoon }), checked: mode === 'light', onChange: themeChangeHandler })] }), showDownload &&
87
+ (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { className: documentViewer_style_1.classes.svgDivider, orientation: "vertical" }), (0, jsx_runtime_1.jsx)(button_1.Button, { prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faDownload_1.faDownload }), onClick: downloadHandler, children: "\u4E0B\u8F7D" })] })] })] }), (0, jsx_runtime_1.jsx)(pinchable_1.Pinchable, { ...pinchableProps, ref: pinchableRef, className: (0, utils_1.clsx)(documentViewer_style_1.classes.svgContainer, pinchableProps?.className), children: (0, jsx_runtime_1.jsx)("div", { className: documentViewer_style_1.classes.svgContent, children: (0, jsx_runtime_1.jsx)("object", { className: documentViewer_style_1.classes.object, data: data, style: { rotate: `${rotate}deg` }, onLoad: objectOnLoad, onError: onError }) }) })] }));
84
88
  }
@@ -3,7 +3,7 @@ import { classes, style } from './accordion.style';
3
3
  import { clsx, useControlled } from '../../utils';
4
4
  import { useTheme } from '../theme';
5
5
  import { Collapse } from '../transitionBase';
6
- import { Icon } from '../..';
6
+ import { Icon } from '../icon';
7
7
  import { faCaretRight } from '@fortawesome/free-solid-svg-icons/faCaretRight';
8
8
  export function Accordion({ size, title, prefix, suffix, expandIcon, defaultExpanded = false, expanded, onExpandedChange, readOnly, disabled, ...props }) {
9
9
  const theme = useTheme();
@@ -5,7 +5,8 @@ import { classes, useStyle } from './alert.style';
5
5
  import { Button } from '../button';
6
6
  import { Skeleton } from '../skeleton';
7
7
  import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
8
- import { Icon, statusMapToIconDefinition } from '../..';
8
+ import { Icon } from '../icon';
9
+ import { statusMapToIconDefinition } from '../status';
9
10
  export const Alert = memo(({ variant = 'standard', status = 'error', color = status, showIcon = true, icon, title, description, prefix, suffix, closable, onClose, loading, ...props }) => {
10
11
  return (_jsxs("div", { ...props, css: useStyle({ color: color || 'error' }), className: clsx(classes.root, props.className), "data-variant": variant, children: [showIcon &&
11
12
  _jsx("div", { className: classes.icon, children: loading
@@ -4,7 +4,7 @@ import { clsx } from '../../utils';
4
4
  import { classes, style } from './errorBoundary.style';
5
5
  import { Placeholder } from '../placeholder';
6
6
  import { Button } from '../button';
7
- import { Icon } from '../..';
7
+ import { Icon } from '../icon';
8
8
  import { faRotateRight } from '@fortawesome/free-solid-svg-icons/faRotateRight';
9
9
  const placeholderSlots = {
10
10
  description: 'pre'