@nutui/nutui-react 2.0.0-beta.2 → 2.0.0-beta.3

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 (37) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/esm/Avatar.js +2 -0
  3. package/dist/esm/Cell/style/index.js +1 -1
  4. package/dist/esm/Cell/style/style.css +1 -1
  5. package/dist/esm/Cell.js +2 -0
  6. package/dist/esm/CellGroup.js +47 -4
  7. package/dist/esm/Form.js +1 -2
  8. package/dist/esm/Menu.js +6 -0
  9. package/dist/esm/MenuItem.js +8 -153
  10. package/dist/esm/Swiper.js +4 -1
  11. package/dist/esm/menuitem2.js +156 -0
  12. package/dist/esm/types/src/packages/avatar/avatar.d.ts +4 -1
  13. package/dist/esm/types/src/packages/avatar/avatar.taro.d.ts +4 -1
  14. package/dist/esm/types/src/packages/cell/cell.d.ts +4 -1
  15. package/dist/esm/types/src/packages/cell/cell.taro.d.ts +4 -1
  16. package/dist/esm/types/src/packages/menu/menu.d.ts +4 -1
  17. package/dist/esm/types/src/packages/menu/menu.taro.d.ts +4 -1
  18. package/dist/esm/types/src/packages/swiper/index.d.ts +8 -2
  19. package/dist/esm/types/src/packages/swiper/index.taro.d.ts +8 -2
  20. package/dist/locales/base.js +1 -1
  21. package/dist/locales/en-US.js +1 -1
  22. package/dist/locales/id-ID.js +1 -1
  23. package/dist/locales/tr-TR.js +1 -1
  24. package/dist/locales/zh-CN.js +1 -1
  25. package/dist/locales/zh-TW.js +1 -1
  26. package/dist/locales/zh-UG.js +1 -1
  27. package/dist/nutui.react.es.js +236 -231
  28. package/dist/nutui.react.umd.js +236 -231
  29. package/dist/packages/cell/cell.scss +2 -0
  30. package/dist/style.mjs +1 -1
  31. package/dist/types/packages/avatar/avatar.d.ts +4 -1
  32. package/dist/types/packages/cell/cell.d.ts +4 -1
  33. package/dist/types/packages/menu/menu.d.ts +4 -1
  34. package/dist/types/packages/swiper/index.d.ts +8 -2
  35. package/dist/types/packages/virtuallist/utils.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/dist/esm/cellgroup2.js +0 -50
@@ -1,3 +1,4 @@
1
+
1
2
  .nut-cell {
2
3
  position: relative;
3
4
  display: flex;
@@ -11,6 +12,7 @@
11
12
  color: $cell-title-color;
12
13
  margin: 10px 0;
13
14
  box-sizing: border-box;
15
+
14
16
  &__left {
15
17
  display: flex;
16
18
  flex-direction: column;
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.0-beta.2 Wed Jun 28 2023 16:06:27 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.0-beta.3 Fri Jun 30 2023 14:21:03 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,6 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
+ import AvatarGroup from '../../packages/avatargroup';
3
4
  export interface AvatarProps extends BasicComponent {
4
5
  /**
5
6
  * 设置头像的大小
@@ -53,4 +54,6 @@ export interface AvatarProps extends BasicComponent {
53
54
  onError: () => void
54
55
  }
55
56
  export type AvatarShape = 'round' | 'square';
56
- export declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
57
+ export declare const Avatar: FunctionComponent<Partial<AvatarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>> & {
58
+ Group: typeof AvatarGroup;
59
+ };
@@ -1,5 +1,6 @@
1
1
  import React, { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
+ import CellGroup from '../../packages/cellgroup';
3
4
  export interface CellProps extends BasicComponent {
4
5
  /**
5
6
  * 标题
@@ -32,4 +33,6 @@ export interface CellProps extends BasicComponent {
32
33
  */
33
34
  onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void
34
35
  }
35
- export declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>>;
36
+ export declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>> & {
37
+ Group: typeof CellGroup;
38
+ };
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import { MenuItem } from '../../packages/menuitem/menuitem';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export interface MenuProps extends BasicComponent {
4
5
  /**
@@ -28,4 +29,6 @@ export interface MenuProps extends BasicComponent {
28
29
  icon: React.ReactNode
29
30
  children: React.ReactNode;
30
31
  }
31
- export declare const Menu: FunctionComponent<Partial<MenuProps>>;
32
+ export declare const Menu: FunctionComponent<Partial<MenuProps>> & {
33
+ Item: typeof MenuItem;
34
+ };
@@ -1,3 +1,9 @@
1
- import { Swiper } from './swiper';
1
+ import React from 'react';
2
+ import { SwiperProps, SwiperRef } from './swiper';
3
+ import SwiperItem from '../../packages/swiperitem';
2
4
  export type { SwiperProps, SwiperRef } from './swiper';
3
- export default Swiper;
5
+ type CompoundedComponent = React.ForwardRefExoticComponent<Partial<SwiperProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<SwiperRef>> & {
6
+ Item: typeof SwiperItem;
7
+ };
8
+ declare const InnerSwiper: CompoundedComponent;
9
+ export default InnerSwiper;
@@ -10,7 +10,7 @@ declare const getEndIndex: ({ list, startIndex, visibleCount, itemEqual, positio
10
10
  positions: PositionType[];
11
11
  offSetSize: number;
12
12
  overscan: number;
13
- sizeKey?: "width" | "height" | undefined;
13
+ sizeKey?: "height" | "width" | undefined;
14
14
  }) => number;
15
15
  declare const updateItemSize: (positions: PositionType[], items: HTMLCollection, sizeKey: 'width' | 'height') => void;
16
16
  export { initPositinoCache, getListTotalSize, binarySearch, getEndIndex, updateItemSize, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",
@@ -1,50 +0,0 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- var _excluded = ["children", "className", "style", "title", "description", "divider"];
4
- function ownKeys(object, enumerableOnly) {
5
- var keys = Object.keys(object);
6
- if (Object.getOwnPropertySymbols) {
7
- var symbols = Object.getOwnPropertySymbols(object);
8
- enumerableOnly && (symbols = symbols.filter(function(sym) {
9
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10
- })), keys.push.apply(keys, symbols);
11
- }
12
- return keys;
13
- }
14
- function _objectSpread(target) {
15
- for (var i = 1; i < arguments.length; i++) {
16
- var source = null != arguments[i] ? arguments[i] : {};
17
- i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
18
- _defineProperty(target, key, source[key]);
19
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
20
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21
- });
22
- }
23
- return target;
24
- }
25
- import React__default from "react";
26
- import classNames from "classnames";
27
- import { C as ComponentDefaults } from "./typings.js";
28
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
29
- title: "",
30
- description: "",
31
- divider: true
32
- });
33
- var classPrefix = "nut-cell-group";
34
- var CellGroup = function CellGroup2(props) {
35
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), children = _defaultProps$props.children, className = _defaultProps$props.className, style = _defaultProps$props.style, title = _defaultProps$props.title, description = _defaultProps$props.description, divider = _defaultProps$props.divider, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
36
- return React__default.createElement("div", _objectSpread({
37
- className: classNames(classPrefix, className)
38
- }, rest), title ? React__default.createElement("div", {
39
- className: "".concat(classPrefix, "__title")
40
- }, title) : null, description ? React__default.createElement("div", {
41
- className: "".concat(classPrefix, "__description")
42
- }, description) : null, React__default.createElement("div", {
43
- className: "".concat(classPrefix, "__wrap ").concat(divider ? "".concat(classPrefix, "__wrap--divider") : "")
44
- }, children));
45
- };
46
- CellGroup.defaultProps = defaultProps;
47
- CellGroup.displayName = "NutCellGroup";
48
- export {
49
- CellGroup as C
50
- };