@aloudata/aloudata-design 1.8.1 → 1.9.0

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.
@@ -2,6 +2,7 @@ import { RefSelectProps, SelectProps } from 'antd';
2
2
  import React from 'react';
3
3
  export interface ISelectProps extends Omit<SelectProps, 'mode'> {
4
4
  prefix?: React.ReactNode;
5
+ prefixWidth?: number;
5
6
  mode?: 'multiple';
6
7
  showAllOption?: boolean;
7
8
  }
@@ -1,4 +1,4 @@
1
- var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "className", "popupClassName", "listHeight", "listItemHeight", "notFoundContent", "value", "tagRender", "style", "autoFocus", "showSearch", "showAllOption", "size", "status", "disabled", "prefixCls"];
1
+ var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "prefixWidth", "className", "popupClassName", "listHeight", "listItemHeight", "notFoundContent", "value", "tagRender", "style", "autoFocus", "showSearch", "showAllOption", "size", "status", "disabled", "prefixCls"];
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -104,6 +104,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
104
104
  _open = props.open,
105
105
  defaultOpen = props.defaultOpen,
106
106
  prefix = props.prefix,
107
+ prefixWidth = props.prefixWidth,
107
108
  className = props.className,
108
109
  popupClassName = props.popupClassName,
109
110
  listHeight = props.listHeight,
@@ -185,12 +186,26 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
185
186
  setIsFocus = _React$useState6[1];
186
187
 
187
188
  var prefixRef = React.useRef(null);
189
+ var sizeInPrefix = useMemo(function () {
190
+ var isJSX = /*#__PURE__*/React.isValidElement(prefix);
188
191
 
189
- var _React$useState7 = React.useState(0),
192
+ if (isJSX) {
193
+ var _prefix$props$style;
194
+
195
+ var _size = prefix.props.size;
196
+ var width = (_prefix$props$style = prefix.props.style) === null || _prefix$props$style === void 0 ? void 0 : _prefix$props$style.width;
197
+ return width || _size;
198
+ } else {
199
+ return 0;
200
+ }
201
+ }, [prefix]);
202
+
203
+ var _React$useState7 = React.useState(sizeInPrefix),
190
204
  _React$useState8 = _slicedToArray(_React$useState7, 2),
191
- prefixWidth = _React$useState8[0],
205
+ prefixW = _React$useState8[0],
192
206
  setPrefixWidth = _React$useState8[1];
193
207
 
208
+ var mergedPrefixWidth = prefixWidth || prefixW;
194
209
  var updatedRef = useRef(false);
195
210
  var selectRef = useRef(null); // 处理 ref 方法
196
211
 
@@ -397,7 +412,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
397
412
  }
398
413
  }, [size, prefix]);
399
414
  var styleVar = {
400
- '--ald-select-prefix-width': "".concat(prefixWidth, "px")
415
+ '--ald-select-prefix-width': "".concat(mergedPrefixWidth, "px")
401
416
  };
402
417
 
403
418
  var defaultTagRender = function defaultTagRender(props) {
package/dist/index.d.ts CHANGED
@@ -66,6 +66,7 @@ export { default as Progress } from './Progress';
66
66
  export type { IProgressRef, IProps as ProgressProps } from './Progress';
67
67
  export { default as Radio } from './Radio';
68
68
  export type { RadioGroupProps, RadioProps } from './Radio';
69
+ export { default as Result } from './Result';
69
70
  export { default as Row } from './Row';
70
71
  export type { RowProps } from './Row';
71
72
  export { default as ScrollArea } from './ScrollArea';
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ export { default as Popconfirm } from "./Popconfirm";
38
38
  export { default as Popover } from "./Popover";
39
39
  export { default as Progress } from "./Progress";
40
40
  export { default as Radio } from "./Radio";
41
+ export { default as Result } from "./Result";
41
42
  export { default as Row } from "./Row";
42
43
  export { default as ScrollArea } from "./ScrollArea";
43
44
  export { default as Select } from "./Select";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -9,13 +9,14 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "build": "father build",
12
+ "build": "npm run gen:icon && father build",
13
13
  "build:watch": "father dev",
14
14
  "changelog": "conventional-changelog -p custom-config -i CHANGELOG.md -s -r 0 -n ./changelog-option.js && git add CHANGELOG.md",
15
15
  "cmt": "zx ./scripts/createComponentTemplate.mjs",
16
- "dev": "dumi dev",
17
- "docs:build": "dumi build",
16
+ "dev": "npm run gen:icon && dumi dev",
17
+ "docs:build": " npm run gen:icon && dumi build",
18
18
  "doctor": "father doctor",
19
+ "gen:icon": "node ./scripts/genIcon.mjs",
19
20
  "jest": "jest",
20
21
  "jest:watch": "jest --watch",
21
22
  "linkToLocal": "npm run build && node ./scripts/linkToLocal.mjs",
@@ -77,6 +78,10 @@
77
78
  "@babel/preset-react": "^7.18.6",
78
79
  "@commitlint/cli": "^17.5.1",
79
80
  "@commitlint/config-conventional": "^17.4.4",
81
+ "@svgr/core": "^8.0.0",
82
+ "@svgr/plugin-jsx": "^8.0.1",
83
+ "@svgr/plugin-prettier": "^8.0.1",
84
+ "@svgr/plugin-svgo": "^8.0.1",
80
85
  "@testing-library/jest-dom": "^5.16.5",
81
86
  "@testing-library/react": "^13.4.0",
82
87
  "@types/jest": "^29.4.0",
@@ -1,3 +0,0 @@
1
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M9.16252 6.5876C9.39033 6.81541 9.39033 7.18475 9.16252 7.41256L5.66252 10.9126C5.43471 11.1404 5.06537 11.1404 4.83756 10.9126C4.60976 10.6848 4.60976 10.3154 4.83756 10.0876L7.92508 7.00008L4.83756 3.91256C4.60976 3.68475 4.60976 3.31541 4.83756 3.0876C5.06537 2.8598 5.43471 2.8598 5.66252 3.0876L9.16252 6.5876Z" fill="#001A33" fill-opacity="0.5"/>
3
- </svg>