@douyinfe/semi-ui 2.17.0 → 2.19.0-alpha.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.
- package/anchor/index.tsx +1 -1
- package/anchor/link.tsx +3 -4
- package/autoComplete/__test__/autoComplete.test.js +6 -6
- package/autoComplete/index.tsx +3 -1
- package/autoComplete/option.tsx +164 -0
- package/calendar/__test__/calendar.test.js +21 -2
- package/calendar/_story/calendar.stories.js +31 -0
- package/calendar/index.tsx +3 -1
- package/calendar/interface.ts +2 -1
- package/carousel/index.tsx +5 -5
- package/checkbox/checkbox.tsx +10 -2
- package/dist/css/semi.css +174 -29
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +4190 -5430
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/form/_story/FieldProps/labelOptional.jsx +30 -0
- package/form/_story/form.stories.js +7 -0
- package/form/hoc/withField.tsx +1 -0
- package/form/label.tsx +21 -7
- package/gulpfile.js +3 -1
- package/lib/cjs/_base/base.css +35 -0
- package/lib/cjs/anchor/index.js +2 -1
- package/lib/cjs/anchor/link.d.ts +1 -1
- package/lib/cjs/anchor/link.js +9 -5
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.js +6 -3
- package/lib/cjs/autoComplete/option.d.ts +50 -0
- package/lib/cjs/autoComplete/option.js +218 -0
- package/lib/cjs/calendar/index.d.ts +2 -0
- package/lib/cjs/calendar/index.js +3 -1
- package/lib/cjs/calendar/interface.d.ts +2 -1
- package/lib/cjs/carousel/index.js +2 -2
- package/lib/cjs/checkbox/checkbox.d.ts +4 -0
- package/lib/cjs/checkbox/checkbox.js +9 -3
- package/lib/cjs/form/hoc/withField.js +2 -1
- package/lib/cjs/form/label.d.ts +8 -5
- package/lib/cjs/form/label.js +15 -4
- package/lib/cjs/locale/interface.d.ts +3 -0
- package/lib/cjs/locale/source/ar.js +3 -0
- package/lib/cjs/locale/source/de.js +3 -0
- package/lib/cjs/locale/source/en_GB.js +3 -0
- package/lib/cjs/locale/source/en_US.js +3 -0
- package/lib/cjs/locale/source/es.js +3 -0
- package/lib/cjs/locale/source/fr.js +3 -0
- package/lib/cjs/locale/source/id_ID.js +3 -0
- package/lib/cjs/locale/source/it.js +3 -0
- package/lib/cjs/locale/source/ja_JP.js +3 -0
- package/lib/cjs/locale/source/ko_KR.js +3 -0
- package/lib/cjs/locale/source/ms_MY.js +3 -0
- package/lib/cjs/locale/source/pt_BR.js +3 -0
- package/lib/cjs/locale/source/ru_RU.js +3 -0
- package/lib/cjs/locale/source/th_TH.js +3 -0
- package/lib/cjs/locale/source/tr_TR.js +3 -0
- package/lib/cjs/locale/source/vi_VN.js +3 -0
- package/lib/cjs/locale/source/zh_CN.js +3 -0
- package/lib/cjs/locale/source/zh_TW.js +3 -0
- package/lib/cjs/modal/Modal.js +0 -8
- package/lib/cjs/modal/ModalContent.js +4 -1
- package/lib/cjs/radio/radio.d.ts +2 -0
- package/lib/cjs/radio/radio.js +33 -8
- package/lib/cjs/table/ColumnFilter.js +4 -2
- package/lib/cjs/table/ColumnSorter.d.ts +1 -0
- package/lib/cjs/table/ColumnSorter.js +9 -6
- package/lib/cjs/table/Table.js +11 -4
- package/lib/cjs/tag/group.d.ts +3 -0
- package/lib/cjs/tag/group.js +24 -6
- package/lib/cjs/tag/index.d.ts +2 -1
- package/lib/cjs/tag/index.js +7 -5
- package/lib/cjs/tag/interface.d.ts +2 -1
- package/lib/cjs/tree/index.d.ts +3 -1
- package/lib/cjs/tree/index.js +23 -0
- package/lib/cjs/tree/interface.d.ts +4 -0
- package/lib/cjs/tree/treeNode.d.ts +4 -1
- package/lib/cjs/tree/treeNode.js +13 -4
- package/lib/es/_base/base.css +35 -0
- package/lib/es/anchor/index.js +2 -1
- package/lib/es/anchor/link.d.ts +1 -1
- package/lib/es/anchor/link.js +9 -5
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/autoComplete/index.js +6 -3
- package/lib/es/autoComplete/option.d.ts +50 -0
- package/lib/es/autoComplete/option.js +188 -0
- package/lib/es/calendar/index.d.ts +2 -0
- package/lib/es/calendar/index.js +3 -1
- package/lib/es/calendar/interface.d.ts +2 -1
- package/lib/es/carousel/index.js +2 -2
- package/lib/es/checkbox/checkbox.d.ts +4 -0
- package/lib/es/checkbox/checkbox.js +10 -4
- package/lib/es/form/hoc/withField.js +2 -1
- package/lib/es/form/label.d.ts +8 -5
- package/lib/es/form/label.js +13 -4
- package/lib/es/locale/interface.d.ts +3 -0
- package/lib/es/locale/source/ar.js +3 -0
- package/lib/es/locale/source/de.js +3 -0
- package/lib/es/locale/source/en_GB.js +3 -0
- package/lib/es/locale/source/en_US.js +3 -0
- package/lib/es/locale/source/es.js +3 -0
- package/lib/es/locale/source/fr.js +3 -0
- package/lib/es/locale/source/id_ID.js +3 -0
- package/lib/es/locale/source/it.js +3 -0
- package/lib/es/locale/source/ja_JP.js +3 -0
- package/lib/es/locale/source/ko_KR.js +3 -0
- package/lib/es/locale/source/ms_MY.js +3 -0
- package/lib/es/locale/source/pt_BR.js +3 -0
- package/lib/es/locale/source/ru_RU.js +3 -0
- package/lib/es/locale/source/th_TH.js +3 -0
- package/lib/es/locale/source/tr_TR.js +3 -0
- package/lib/es/locale/source/vi_VN.js +3 -0
- package/lib/es/locale/source/zh_CN.js +3 -0
- package/lib/es/locale/source/zh_TW.js +3 -0
- package/lib/es/modal/Modal.js +0 -8
- package/lib/es/modal/ModalContent.js +4 -1
- package/lib/es/radio/radio.d.ts +2 -0
- package/lib/es/radio/radio.js +31 -8
- package/lib/es/table/ColumnFilter.js +4 -2
- package/lib/es/table/ColumnSorter.d.ts +1 -0
- package/lib/es/table/ColumnSorter.js +9 -6
- package/lib/es/table/Table.js +10 -4
- package/lib/es/tag/group.d.ts +3 -0
- package/lib/es/tag/group.js +24 -6
- package/lib/es/tag/index.d.ts +2 -1
- package/lib/es/tag/index.js +7 -5
- package/lib/es/tag/interface.d.ts +2 -1
- package/lib/es/tree/index.d.ts +3 -1
- package/lib/es/tree/index.js +22 -0
- package/lib/es/tree/interface.d.ts +4 -0
- package/lib/es/tree/treeNode.d.ts +4 -1
- package/lib/es/tree/treeNode.js +13 -4
- package/locale/interface.ts +3 -0
- package/locale/source/ar.ts +3 -0
- package/locale/source/de.ts +3 -0
- package/locale/source/en_GB.ts +3 -0
- package/locale/source/en_US.ts +3 -0
- package/locale/source/es.ts +3 -0
- package/locale/source/fr.ts +3 -0
- package/locale/source/id_ID.ts +3 -0
- package/locale/source/it.ts +3 -0
- package/locale/source/ja_JP.ts +3 -0
- package/locale/source/ko_KR.ts +3 -0
- package/locale/source/ms_MY.ts +3 -0
- package/locale/source/pt_BR.ts +3 -0
- package/locale/source/ru_RU.ts +3 -0
- package/locale/source/th_TH.ts +3 -0
- package/locale/source/tr_TR.ts +4 -1
- package/locale/source/vi_VN.ts +3 -0
- package/locale/source/zh_CN.ts +3 -0
- package/locale/source/zh_TW.ts +3 -0
- package/modal/Modal.tsx +0 -6
- package/modal/ModalContent.tsx +4 -1
- package/modal/__test__/modal.test.js +1 -1
- package/modal/_story/__snapshots__/modal.stories.tsx.snap +203 -0
- package/package.json +7 -7
- package/radio/_story/radio.stories.js +2 -2
- package/radio/radio.tsx +27 -5
- package/rating/__test__/rating.test.js +1 -1
- package/select/__test__/select.test.js +11 -17
- package/select/_story/select.stories.js +6 -6
- package/steps/_story/steps.stories.js +3 -3
- package/switch/_story/switch.stories.js +4 -4
- package/switch/_story/switch.stories.tsx +4 -4
- package/table/ColumnFilter.tsx +2 -1
- package/table/ColumnSorter.tsx +16 -10
- package/table/Table.tsx +7 -4
- package/table/_story/v2/FixedFilter/index.tsx +106 -0
- package/table/_story/v2/FixedSorter/index.tsx +102 -0
- package/table/_story/v2/index.js +4 -2
- package/tag/_story/tag.stories.js +57 -1
- package/tag/group.tsx +20 -3
- package/tag/index.tsx +6 -5
- package/tag/interface.ts +2 -1
- package/transfer/_story/transfer.stories.js +2 -2
- package/tree/_story/tree.stories.js +152 -3
- package/tree/index.tsx +16 -1
- package/tree/interface.ts +6 -0
- package/tree/treeNode.tsx +11 -5
- package/upload/_story/upload.stories.js +2 -2
- package/webpack.config.js +13 -3
package/tree/interface.ts
CHANGED
|
@@ -140,3 +140,9 @@ export interface NodeListState {
|
|
|
140
140
|
cachedMotionKeys?: Set<string>;
|
|
141
141
|
cachedData?: FlattenNode[];
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
export interface ScrollData {
|
|
145
|
+
key: string;
|
|
146
|
+
// The align parameter is consistent with react-window
|
|
147
|
+
align?: 'center' | 'start' | 'end' | 'smart' | 'auto';
|
|
148
|
+
}
|
package/tree/treeNode.tsx
CHANGED
|
@@ -220,7 +220,8 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
renderCheckbox() {
|
|
223
|
+
renderCheckbox(options: { label: React.ReactNode; icon: React.ReactNode }) {
|
|
224
|
+
const { label, icon } = options;
|
|
224
225
|
const { checked, halfChecked, eventKey } = this.props;
|
|
225
226
|
const disabled = this.isDisabled();
|
|
226
227
|
return (
|
|
@@ -235,7 +236,10 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
235
236
|
indeterminate={halfChecked}
|
|
236
237
|
checked={checked}
|
|
237
238
|
disabled={Boolean(disabled)}
|
|
238
|
-
|
|
239
|
+
>
|
|
240
|
+
{icon}
|
|
241
|
+
{label}
|
|
242
|
+
</Checkbox>
|
|
239
243
|
</div>
|
|
240
244
|
);
|
|
241
245
|
}
|
|
@@ -409,6 +413,8 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
409
413
|
});
|
|
410
414
|
const setsize = get(rest, ['data', 'children', 'length']);
|
|
411
415
|
const posinset = isString(rest.pos) ? Number(rest.pos.split('-')[level+1]) + 1 : 1;
|
|
416
|
+
const label = this.renderRealLabel();
|
|
417
|
+
const icon = this.renderIcon();
|
|
412
418
|
return (
|
|
413
419
|
<li
|
|
414
420
|
className={nodeCls}
|
|
@@ -433,9 +439,9 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
433
439
|
<span
|
|
434
440
|
className={labelCls}
|
|
435
441
|
>
|
|
436
|
-
{multiple ? this.renderCheckbox() : null}
|
|
437
|
-
{
|
|
438
|
-
<span className={`${prefixcls}-label-text`}>{
|
|
442
|
+
{multiple ? this.renderCheckbox({ label, icon }) : null}
|
|
443
|
+
{!multiple && icon}
|
|
444
|
+
{!multiple && <span className={`${prefixcls}-label-text`}>{label}</span> }
|
|
439
445
|
</span>
|
|
440
446
|
</li>
|
|
441
447
|
);
|
|
@@ -311,7 +311,7 @@ DefaultFileList.story = {
|
|
|
311
311
|
name: 'defaultFileList',
|
|
312
312
|
};
|
|
313
313
|
|
|
314
|
-
class
|
|
314
|
+
class ControlledUpload extends React.Component {
|
|
315
315
|
constructor(props) {
|
|
316
316
|
super(props);
|
|
317
317
|
this.state = {
|
|
@@ -344,7 +344,7 @@ class ControledUpload extends React.Component {
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
export const ControlledFileList = () => <
|
|
347
|
+
export const ControlledFileList = () => <ControlledUpload></ControlledUpload>;
|
|
348
348
|
|
|
349
349
|
ControlledFileList.story = {
|
|
350
350
|
name: 'controlled fileList',
|
package/webpack.config.js
CHANGED
|
@@ -22,13 +22,16 @@ module.exports = function ({ minimize }) {
|
|
|
22
22
|
library: 'SemiUI',
|
|
23
23
|
libraryTarget: 'umd'
|
|
24
24
|
},
|
|
25
|
+
|
|
25
26
|
module: {
|
|
26
27
|
rules: [
|
|
27
28
|
{
|
|
28
29
|
test: /\.tsx?$/,
|
|
29
30
|
include: [
|
|
30
31
|
path.join(rootPath, 'packages/semi-ui'),
|
|
31
|
-
path.join(rootPath, 'packages/semi-foundation')
|
|
32
|
+
path.join(rootPath, 'packages/semi-foundation'),
|
|
33
|
+
path.join(rootPath, 'packages/semi-animation'),
|
|
34
|
+
path.join(rootPath, 'packages/semi-animation-react')
|
|
32
35
|
],
|
|
33
36
|
use: [
|
|
34
37
|
{
|
|
@@ -45,7 +48,7 @@ module.exports = function ({ minimize }) {
|
|
|
45
48
|
}
|
|
46
49
|
]
|
|
47
50
|
},
|
|
48
|
-
{
|
|
51
|
+
{
|
|
49
52
|
test: /semi-icons\/.+\.css$/,
|
|
50
53
|
loaders: 'null-loader'
|
|
51
54
|
},
|
|
@@ -66,7 +69,14 @@ module.exports = function ({ minimize }) {
|
|
|
66
69
|
new HashedModuleIdsPlugin()
|
|
67
70
|
],
|
|
68
71
|
resolve: {
|
|
69
|
-
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json']
|
|
72
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
|
73
|
+
alias: {
|
|
74
|
+
"@douyinfe/semi-foundation": path.resolve(__dirname, "../semi-foundation"),
|
|
75
|
+
"@douyinfe/semi-icons": path.resolve(__dirname, "../semi-icons"),
|
|
76
|
+
"@douyinfe/semi-illustrations":path.resolve(__dirname, "../semi-illustrations"),
|
|
77
|
+
"@douyinfe/semi-animation":path.resolve(__dirname, "../semi-animation"),
|
|
78
|
+
"@douyinfe/semi-animation-react":path.resolve(__dirname, "../semi-animation-react")
|
|
79
|
+
},
|
|
70
80
|
},
|
|
71
81
|
externals: {
|
|
72
82
|
react: {
|