Browse Source

Merge branch 'release' of github.com:DouyinFE/semi-design into release

pointhalo 3 years ago
parent
commit
fdc4ce4c4f

+ 1 - 1
lerna.json

@@ -1,5 +1,5 @@
 {
     "useWorkspaces": true,
     "npmClient": "yarn",
-    "version": "2.14.0"
+    "version": "2.15.0-beta.0"
 }

+ 2 - 2
packages/semi-animation-react/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@douyinfe/semi-animation-react",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "motion library for semi-ui-react",
   "keywords": [
     "motion",
@@ -27,7 +27,7 @@
   "dependencies": {
     "@babel/runtime-corejs3": "^7.15.4",
     "@douyinfe/semi-animation": "2.12.0",
-    "@douyinfe/semi-animation-styled": "2.14.0",
+    "@douyinfe/semi-animation-styled": "2.15.0-beta.0",
     "classnames": "^2.2.6"
   },
   "peerDependencies": {

+ 1 - 1
packages/semi-animation-styled/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@douyinfe/semi-animation-styled",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "semi styled animation",
   "keywords": [
     "semi",

+ 1 - 1
packages/semi-animation/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@douyinfe/semi-animation",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "animation base library for semi-ui",
   "keywords": [
     "animation",

+ 1 - 1
packages/semi-eslint-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "eslint-plugin-semi-design",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "semi ui eslint plugin",
   "keywords": [
     "semi",

+ 1 - 1
packages/semi-foundation/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@douyinfe/semi-foundation",
-    "version": "2.14.0",
+    "version": "2.15.0-beta.0",
     "description": "",
     "scripts": {
         "build:lib": "node ./scripts/compileLib.js",

+ 2 - 2
packages/semi-icons/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@douyinfe/semi-icons",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "semi icons",
   "keywords": [
     "semi",
@@ -38,7 +38,7 @@
     "@babel/plugin-transform-runtime": "^7.15.8",
     "@babel/preset-env": "^7.15.8",
     "@babel/preset-react": "^7.14.5",
-    "@douyinfe/semi-webpack-plugin": "2.14.0",
+    "@douyinfe/semi-webpack-plugin": "2.15.0-beta.0",
     "babel-loader": "^8.2.2",
     "css-loader": "4.3.0",
     "del": "^6.0.0",

+ 1 - 1
packages/semi-illustrations/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@douyinfe/semi-illustrations",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "semi illustrations",
   "keywords": [
     "semi",

+ 2 - 2
packages/semi-next/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@douyinfe/semi-next",
-    "version": "2.14.0",
+    "version": "2.15.0-beta.0",
     "description": "Plugin that support Semi Design in Next.js",
     "author": "伍浩威 <[email protected]>",
     "homepage": "",
@@ -23,7 +23,7 @@
         "typescript": "^4"
     },
     "dependencies": {
-        "@douyinfe/semi-webpack-plugin": "2.14.0"
+        "@douyinfe/semi-webpack-plugin": "2.15.0-beta.0"
     },
     "gitHead": "eb34a4f25f002bb4cbcfa51f3df93bed868c831a"
 }

+ 1 - 1
packages/semi-scss-compile/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@douyinfe/semi-scss-compile",
-  "version": "2.14.0",
+  "version": "2.15.0-beta.0",
   "description": "compile semi scss to css",
   "author": "[email protected]",
   "license": "MIT",

+ 1 - 1
packages/semi-theme-default/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@douyinfe/semi-theme-default",
-    "version": "2.14.0",
+    "version": "2.15.0-beta.0",
     "description": "semi-theme-default",
     "keywords": [
         "semi-theme",

+ 23 - 15
packages/semi-ui/form/_story/form.stories.tsx

@@ -1,6 +1,6 @@
 import React, { FunctionComponent } from 'react';
 import { storiesOf } from '@storybook/react';
-import { Form, useFormState, useFormApi, withField, Input, Button } from '../../index';
+import { Form, useFormState, useFormApi, withField, Input, Button, Upload } from '../../index';
 import { values } from 'lodash';
 const stories = storiesOf('Form', module);
 
@@ -64,40 +64,44 @@ const htmlInput = (props: any) => {
 const FieldB = withField(Input);
 const FieldA = withField(htmlInput, { valueKey: 'value', onKeyChangeFnName: 'onChange', valuePath: 'target.value' });
 
-const Fields: FunctionComponent<FormFCChild> = ({ formState, values, formApi }) => (
+const Fields: FunctionComponent<FormFCChild> = ({ formState, values, formApi }) => {
+    const ref = React.useRef();
+    return (
     <>
-        <Form.Rating field='test' className='fe' count={2} />
+        <Form.Rating field='test' className='fe' count={2} ref={ref}  />
 
-        <Form.Input field='test' />
+        <Form.Input field='test'  ref={ref}  />
         <Input size='default' showClear insetLabel />
         <FieldB insetLabel placeholder='fe' fieldClassName='fefe' field='custom' />
 
         <Button onClick={() => formApi.setValue('fieldA', 'fe')}>set</Button>
-        <Form.Select field='test'>
+        <Form.Select field='test' ref={ref}>
             <Form.Select.Option value="f1"></Form.Select.Option>
             <Form.Select.Option value="f2"></Form.Select.Option>
         </Form.Select>
-        <Form.Input field="UserName" label="用户名"/>
-        <Form.TextArea field="textarea" onKeyDown={(v: any) => console.log(v)} />
+        <Form.Input field="UserName" label="用户名" ref={ref} />
+        <Form.TextArea field="textarea" onKeyDown={(v: any) => console.log(v)}  ref={ref}  />
         <Form.Input field="Password" label="密码" />
-        <Form.InputNumber field="number" />
+        <Form.InputNumber field="number"  ref={ref} />
         <Form.Rating field="rating" />
-        <Form.Switch field="switch" checkedText="on" uncheckedText="off" />
+        <Form.Switch field="switch" checkedText="on" uncheckedText="off"  ref={ref} />
 
         <Form.Cascader
             placeholder="请选择所在地区"
             field="area"
+            ref={ref} 
             label={{ text: '123', required: true, extra: 123 }}
             treeData={treeData}
         ></Form.Cascader>
-        <Form.TimePicker field="time" minuteStep={2} />
+        <Form.TimePicker field="time" minuteStep={2} ref={ref} />
         <Form.AutoComplete field="fe" />
 
-        <Form.TreeSelect field="treeSelect" treeData={treeData} />
-        <Form.Slider field="slider" />
-        <Form.DatePicker field="datepicker" />
+        <Form.TreeSelect field="treeSelect" treeData={treeData} ref={ref} />
+        <Form.Slider field="slider" ref={ref}  />
+        <Form.DatePicker field="datepicker" ref={ref} />
         <Form.CheckboxGroup
             field="type"
+            ref={ref} 
             label="申请类型(CheckboxGroup)"
             initValue={['user', 'admin']}
             rules={[{ required: true }]}
@@ -109,6 +113,7 @@ const Fields: FunctionComponent<FormFCChild> = ({ formState, values, formApi })
         </Form.CheckboxGroup>
         <Form.RadioGroup
             field="radio"
+            ref={ref} 
             label="是否独占资源(Radio)"
             rules={[{ type: 'boolean' }, { required: true, message: '必须选择是否独占 ' }]}
         >
@@ -122,11 +127,13 @@ const Fields: FunctionComponent<FormFCChild> = ({ formState, values, formApi })
         <Form.ErrorMessage error="errorText" />
         <FieldB field="custom" />
         <FieldA field="cuB" />
-        <Form.Upload fileName='semi' action='https://test.com' field='file' />
+        <Form.TagInput field='tagInput' ref={ref} ></Form.TagInput>
+        <Form.Upload ref={ref} fileName='semi' action='https://test.com' field='file' />
         <Form.Slot />
         <code style={{ marginTop: 30 }}>{JSON.stringify(formState)}</code>
     </>
-);
+    )
+};
 
 stories.add('Form', () => <Form>{Fields}</Form>);
 
@@ -160,6 +167,7 @@ class Demo extends React.Component<IProps, IState> {
       return (
         <>
           <Form getFormApi={this.getFormApi}>
+
           </Form>
         </>
       );

+ 1 - 1
packages/semi-ui/form/hoc/withField.tsx

@@ -28,7 +28,7 @@ const prefix = cssClasses.PREFIX;
 
 function withField<
     C extends React.ElementType,
-    T extends Subtract<React.ComponentProps<C>, CommonexcludeType> & CommonFieldProps,
+    T extends Subtract<React.ComponentProps<C>, CommonexcludeType> & CommonFieldProps & React.RefAttributes<any>,
     R extends React.ComponentType<T>
 >(Component: C, opts?: WithFieldOption): R {
     let SemiField = (props: any, ref: React.MutableRefObject<any> | ((instance: any) => void)) => {

+ 1 - 1
packages/semi-ui/form/interface.ts

@@ -84,7 +84,7 @@ export interface SelectStatic {
     OptGroup: typeof OptGroup;
 }
 
-export class Field<P> extends React.Component<Subtract<P & CommonFieldProps, CommonexcludeType>> {}
+export class Field<P> extends React.Component<Subtract<P & CommonFieldProps, CommonexcludeType> & React.RefAttributes<any>> {}
 export let FormSelectType: React.ComponentType<Subtract<SelectProps & CommonFieldProps, CommonexcludeType>> & SelectStatic;
 export let FormCheckboxType: React.ComponentType<Subtract<CommonFieldProps, RadioCheckboxExcludeProps> & CheckboxProps & RCIncludeType>;
 export let FormRadioType: React.ComponentType<Subtract<CommonFieldProps, RadioCheckboxExcludeProps> & RadioProps & RCIncludeType>;

+ 7 - 7
packages/semi-ui/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@douyinfe/semi-ui",
-    "version": "2.14.0",
+    "version": "2.15.0-beta.0",
     "description": "",
     "main": "lib/cjs/index.js",
     "module": "lib/es/index.js",
@@ -15,11 +15,11 @@
     "dependencies": {
         "@babel/runtime-corejs3": "^7.15.4",
         "@douyinfe/semi-animation": "2.12.0",
-        "@douyinfe/semi-animation-react": "2.14.0",
-        "@douyinfe/semi-foundation": "2.14.0",
-        "@douyinfe/semi-icons": "2.14.0",
-        "@douyinfe/semi-illustrations": "2.14.0",
-        "@douyinfe/semi-theme-default": "2.14.0",
+        "@douyinfe/semi-animation-react": "2.15.0-beta.0",
+        "@douyinfe/semi-foundation": "2.15.0-beta.0",
+        "@douyinfe/semi-icons": "2.15.0-beta.0",
+        "@douyinfe/semi-illustrations": "2.15.0-beta.0",
+        "@douyinfe/semi-theme-default": "2.15.0-beta.0",
         "@types/react-window": "^1.8.2",
         "async-validator": "^3.5.0",
         "classnames": "^2.2.6",
@@ -75,7 +75,7 @@
         "@babel/plugin-transform-runtime": "^7.15.8",
         "@babel/preset-env": "^7.15.8",
         "@babel/preset-react": "^7.14.5",
-        "@douyinfe/semi-scss-compile": "2.14.0",
+        "@douyinfe/semi-scss-compile": "2.15.0-beta.0",
         "@storybook/addon-knobs": "^6.3.1",
         "@types/lodash": "^4.14.176",
         "babel-loader": "^8.2.2",

+ 9 - 6
packages/semi-ui/upload/_story/upload.stories.tsx

@@ -1,13 +1,16 @@
 
 /* argus-disable unPkgSensitiveInfo */
-import React from 'react';
+import React, { useRef } from 'react';
 import { storiesOf } from '@storybook/react';
 import Upload from '../index';
 
 const stories = storiesOf('Upload', module);
 
-stories.add('Upload', () => (
-    <>
-        <Upload action='//semi.design' />
-    </>
-));
+stories.add('Upload', () => {
+    const ref = useRef();
+    return (
+        <>
+            <Upload action='//semi.design' ref={ref} />
+        </>
+    );
+});

+ 1 - 1
packages/semi-webpack/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@douyinfe/semi-webpack-plugin",
-    "version": "2.14.0",
+    "version": "2.15.0-beta.0",
     "description": "",
     "author": "伍浩威 <[email protected]>",
     "homepage": "",

+ 0 - 88
yarn.lock

@@ -1460,16 +1460,6 @@
   resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
   integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
 
-"@douyinfe/[email protected]":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-animation-react/-/semi-animation-react-2.11.1.tgz#08814b8f16952b47397461983d4b934ecabf1b52"
-  integrity sha512-3SjRJqhv2L/+sT6hV93zA2L77oroFX32zZY7yu6XAX5EVseI2fvVl+xuszq838DR5dzqM77QP0ZUh017cIiv2w==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-    "@douyinfe/semi-animation" "2.11.1"
-    "@douyinfe/semi-animation-styled" "2.11.1"
-    classnames "^2.2.6"
-
 "@douyinfe/[email protected]":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-animation-react/-/semi-animation-react-2.9.1.tgz#f2e4c6ef7899729ee6145edf0579598ba195bfdd"
@@ -1480,13 +1470,6 @@
     "@douyinfe/semi-animation-styled" "2.9.1"
     classnames "^2.2.6"
 
-"@douyinfe/[email protected]":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-animation-styled/-/semi-animation-styled-2.11.1.tgz#648d2cc62e6328ce0cc5876211c7130c411a9b22"
-  integrity sha512-hDroIJA07S1szU6nomskVIt9lLe1ZC08Ww0Ias6QiEpFX/RW9VRsPr8QBQnzQC9aBOKQn1tq8cLeoPrYdPvqeA==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-
 "@douyinfe/[email protected]":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-animation-styled/-/semi-animation-styled-2.9.1.tgz#0a4a3c521626118b209604b2d6447fbcaa4839a4"
@@ -1510,21 +1493,6 @@
     "@babel/runtime-corejs3" "^7.15.4"
     bezier-easing "^2.1.0"
 
-"@douyinfe/[email protected]":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-foundation/-/semi-foundation-2.11.1.tgz#2c75f37686d90abddc65383a1bc47b7f8966a2ae"
-  integrity sha512-JZZh3snC65OrPLGN9mGbvexWtWyzWFEr/iRvYOAoxbxPd3farJFmbDyg9X6nEyfcc1ShEj1OEHKcIpJ3d3vztw==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-    "@douyinfe/semi-animation" "2.11.1"
-    async-validator "^3.5.0"
-    classnames "^2.2.6"
-    date-fns "^2.9.0"
-    date-fns-tz "^1.0.10"
-    lodash "^4.17.21"
-    memoize-one "^5.2.1"
-    scroll-into-view-if-needed "^2.2.24"
-
 "@douyinfe/[email protected]":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-foundation/-/semi-foundation-2.9.1.tgz#1300bb97d6ceb92274ca4c9e6c66c5c16dc284ea"
@@ -1540,14 +1508,6 @@
     memoize-one "^5.2.1"
     scroll-into-view-if-needed "^2.2.24"
 
-"@douyinfe/[email protected]":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-icons/-/semi-icons-2.11.1.tgz#8d8644f1bca329edf2842ab12aa91e1b38e7a3b4"
-  integrity sha512-bou4IPkgjIlUH9MzUvV8wgrA3k8Rf11nHAUTod8fKiJsFslZFSBoQDBUHtb8xmmJrIe+o2rJzNXYX71+23/N8g==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-    classnames "^2.2.6"
-
 "@douyinfe/[email protected]", "@douyinfe/semi-icons@latest":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-icons/-/semi-icons-2.9.1.tgz#7a04e1a77070220b04f63e6f65aac30155ed8ddd"
@@ -1556,21 +1516,6 @@
     "@babel/runtime-corejs3" "^7.15.4"
     classnames "^2.2.6"
 
-"@douyinfe/semi-icons@^2.0.0":
-  version "2.11.2"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-icons/-/semi-icons-2.11.2.tgz#ae7d06a5c573f1a38dd2293391182be268281c52"
-  integrity sha512-aKw/X/BTCLF+Vxpag8XSpLdUGkMy5ZtI8nY49nUtYXLfeLmWaR6PPpiOqsVThDzDmYnmNNwFuheJBzUF6wxpXA==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-    classnames "^2.2.6"
-
-"@douyinfe/[email protected]":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-illustrations/-/semi-illustrations-2.11.1.tgz#682c7ef43f31f872309e849fd8f487c0722943ce"
-  integrity sha512-QmFtbzV9pMz3r0UBsEmRSdBUMIhoEGNNMCRzbzA7+sgJNY+eAkABR21BlFAnPgN4dIH1fb4EyOmjvmGUxZ3lPA==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-
 "@douyinfe/[email protected]":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-illustrations/-/semi-illustrations-2.9.1.tgz#1a448d1854ee1beeba57ea612da052b549ea105f"
@@ -1634,13 +1579,6 @@
     monaco-themes "^0.3.3"
     react-live "^2.2.2"
 
-"@douyinfe/[email protected]":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-theme-default/-/semi-theme-default-2.11.1.tgz#7cc0dcfcc5d0a7936911fa0af7a7804d4e917f47"
-  integrity sha512-jvSydbkzgMi6JXEsaS0kCmY17q0iiPa6um08LZY6OSQ6gBnMyFf/R6ZQuhnm0kAZMjktfdfyuvTJA5qCYtgc1A==
-  dependencies:
-    glob "^7.1.6"
-
 "@douyinfe/[email protected]":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-theme-default/-/semi-theme-default-2.9.1.tgz#734113e9783ca58b69afe1769005e7e57e5a4da7"
@@ -1648,32 +1586,6 @@
   dependencies:
     glob "^7.1.6"
 
-"@douyinfe/semi-ui@^2.0.0":
-  version "2.11.1"
-  resolved "https://registry.yarnpkg.com/@douyinfe/semi-ui/-/semi-ui-2.11.1.tgz#c35e7581e6c199f4e91f2a184cf363dc6edce34a"
-  integrity sha512-6bHzXNsfpoj5OsRC/JNuPKvZ8NURPthHUyHZH+/FadP8eP2Cj+Rmj++WNY8T4xoVRoaZPKdfr1wk9GbsC8CqyQ==
-  dependencies:
-    "@babel/runtime-corejs3" "^7.15.4"
-    "@douyinfe/semi-animation" "2.11.1"
-    "@douyinfe/semi-animation-react" "2.11.1"
-    "@douyinfe/semi-foundation" "2.11.1"
-    "@douyinfe/semi-icons" "2.11.1"
-    "@douyinfe/semi-illustrations" "2.11.1"
-    "@douyinfe/semi-theme-default" "2.11.1"
-    "@types/react-window" "^1.8.2"
-    async-validator "^3.5.0"
-    classnames "^2.2.6"
-    copy-text-to-clipboard "^2.1.1"
-    date-fns "^2.9.0"
-    date-fns-tz "^1.0.10"
-    lodash "^4.17.21"
-    react-resizable "^1.8.0"
-    react-sortable-hoc "^2.0.0"
-    react-window "^1.8.2"
-    resize-observer-polyfill "^1.5.1"
-    scroll-into-view-if-needed "^2.2.24"
-    utility-types "^3.10.0"
-
 "@douyinfe/semi-ui@latest":
   version "2.9.1"
   resolved "https://registry.yarnpkg.com/@douyinfe/semi-ui/-/semi-ui-2.9.1.tgz#505d4783ea1fa73d307b75f62091030f1fee9332"