yootd 0.0.48 → 0.0.49

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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ISvgIconProps } from "../../utils/types";
3
+ export declare const ArrowDown: React.ForwardRefExoticComponent<Omit<ISvgIconProps, "ref"> & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,29 @@
1
+ var _excluded = ["style", "className"];
2
+ 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); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React, { forwardRef } from 'react';
6
+ export var ArrowDown = /*#__PURE__*/forwardRef(function (_ref, ref) {
7
+ var style = _ref.style,
8
+ className = _ref.className,
9
+ rest = _objectWithoutProperties(_ref, _excluded);
10
+ return /*#__PURE__*/React.createElement("svg", _extends({
11
+ ref: ref
12
+ }, rest, {
13
+ style: style,
14
+ className: className,
15
+ width: "16",
16
+ height: "16",
17
+ viewBox: "0 0 16 16",
18
+ fill: "none",
19
+ xmlns: "http://www.w3.org/2000/svg"
20
+ }), /*#__PURE__*/React.createElement("g", {
21
+ id: "chevron-left"
22
+ }, /*#__PURE__*/React.createElement("path", {
23
+ id: "union",
24
+ d: "M12.46 6.4603L11.5407 5.54106L8.00034 9.08144L4.45996 5.54106L3.54072 6.4603L8.00034 10.9199L12.46 6.4603Z",
25
+ fill: "black",
26
+ "fill-opacity": "0.45"
27
+ })));
28
+ });
29
+ ArrowDown.displayName = 'ArrowDown';
@@ -11,7 +11,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { Dropdown } from 'antd';
12
12
  import React, { useEffect, useState } from 'react';
13
13
  import { useBem } from "../hooks/useBem";
14
- import { ReactComponent as DownIcon } from "./assets/down-arrow.svg";
14
+ import { ArrowDown } from "./assets/ArrowDown";
15
15
  import "./index.scss";
16
16
  export var DropdownSelect = function DropdownSelect(_ref) {
17
17
  var _rest$overlayClassNam, _items$find$label, _items$find;
@@ -52,9 +52,8 @@ export var DropdownSelect = function DropdownSelect(_ref) {
52
52
  },
53
53
  arrow: arrow,
54
54
  overlayClassName: "".concat(mb, " ").concat((_rest$overlayClassNam = rest === null || rest === void 0 ? void 0 : rest.overlayClassName) !== null && _rest$overlayClassNam !== void 0 ? _rest$overlayClassNam : ''),
55
- children: (_items$find$label = items === null || items === void 0 || (_items$find = items.find(function (item) {
56
- return (item === null || item === void 0 ? void 0 : item.key) === selected;
57
- })) === null || _items$find === void 0 ? void 0 : _items$find.label) !== null && _items$find$label !== void 0 ? _items$find$label : '',
58
- icon: /*#__PURE__*/React.createElement(DownIcon, null)
59
- }, rest));
55
+ icon: /*#__PURE__*/React.createElement(ArrowDown, null)
56
+ }, rest), (_items$find$label = items === null || items === void 0 || (_items$find = items.find(function (item) {
57
+ return (item === null || item === void 0 ? void 0 : item.key) === selected;
58
+ })) === null || _items$find === void 0 ? void 0 : _items$find.label) !== null && _items$find$label !== void 0 ? _items$find$label : '');
60
59
  };
@@ -1,19 +1,18 @@
1
-
2
1
  export interface DropdownSelectProps {
3
2
  defaultValue?: string; // 默认选中的key值
4
- items: MenuItemType[] // 下拉菜单
3
+ items: MenuItemType[]; // 下拉菜单
5
4
  onChange?: (value: string) => void; // 选中值改变时触发
6
- arrow?:boolean // 下拉箭头是否显示
5
+ arrow?: boolean; // 下拉箭头是否显示
7
6
  overlayClassName?: string; // 下拉菜单的样式
8
7
  autoAdjustOverflow?: boolean; // 下拉框被遮挡时自动调整位置
9
8
  autoFocus?: boolean; // 打开后自动聚焦下拉框
10
9
  disabled?: boolean; // 菜单是否禁用
11
10
  destroyPopupOnHide?: boolean; // 关闭后是否销毁 Dropdown
12
- dropdownRender?: (menus: ReactNode) => ReactNode ; // 自定义下拉菜单
11
+ dropdownRender?: (menus: ReactNode) => ReactNode; // 自定义下拉菜单
13
12
  getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; // 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位
14
13
  overlayClassName?: string; // 下拉菜单的样式
15
14
  overlayStyle?: React.CSSProperties; // 下拉菜单的样式
16
15
  placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight'; // 菜单弹出位置
17
- trigger?: Array<click|hover|contextMenu> // 触发下拉的行为
16
+ trigger?: Array<click | hover | contextMenu>; // 触发下拉的行为
18
17
  open?: boolean; // 菜单是否显示
19
- };
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -1,5 +0,0 @@
1
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g id="chevron-left">
3
- <path id="union" d="M12.46 6.4603L11.5407 5.54106L8.00034 9.08144L4.45996 5.54106L3.54072 6.4603L8.00034 10.9199L12.46 6.4603Z" fill="black" fill-opacity="0.45"/>
4
- </g>
5
- </svg>