@alifd/chat 0.3.40-beta.0 → 0.3.40-beta.2
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/es/ai-loading/types.d.ts +1 -0
- package/es/button/button.d.ts +1 -2
- package/es/button/button.js +13 -19
- package/es/button/group.js +5 -42
- package/es/button/main.scss +36 -77
- package/es/card/main.scss +1 -1
- package/es/checkbox-group/main.scss +6 -7
- package/es/checkbox-group/types.d.ts +6 -0
- package/es/code-view/index.d.ts +11 -0
- package/es/code-view/index.js +63 -0
- package/es/code-view/main.scss +54 -0
- package/es/code-view/style.d.ts +4 -0
- package/es/code-view/style.js +4 -0
- package/es/code-view/types.d.ts +27 -0
- package/es/code-view/types.js +1 -0
- package/es/collapse/index.d.ts +157 -0
- package/es/collapse/index.js +20 -0
- package/es/collapse/main.scss +97 -0
- package/es/collapse/style.d.ts +2 -0
- package/es/collapse/style.js +2 -0
- package/es/collapse/types.d.ts +82 -0
- package/es/collapse/types.js +2 -0
- package/es/core/variables.scss +27 -12
- package/es/date-picker/DatePicker.d.ts +5 -0
- package/es/date-picker/DatePicker.js +15 -0
- package/es/date-picker/MonthPicker.d.ts +4 -0
- package/es/date-picker/MonthPicker.js +15 -0
- package/es/date-picker/RangePicker.d.ts +4 -0
- package/es/date-picker/RangePicker.js +17 -0
- package/es/date-picker/YearPicker.d.ts +4 -0
- package/es/date-picker/YearPicker.js +15 -0
- package/es/date-picker/index.d.ts +5 -23
- package/es/date-picker/index.js +11 -29
- package/es/date-picker/main.scss +23 -1
- package/es/date-picker/style.d.ts +1 -0
- package/es/date-picker/style.js +1 -0
- package/es/date-picker/types.d.ts +161 -81
- package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
- package/es/form/style.d.ts +0 -1
- package/es/form/style.js +2 -1
- package/es/form/types.d.ts +3 -517
- package/es/form/types.js +5 -1
- package/es/html-render/index.d.ts +1 -1
- package/es/html-render/index.js +118 -106
- package/es/html-render/main.scss +27 -8
- package/es/html-render/style.d.ts +1 -0
- package/es/html-render/style.js +1 -0
- package/es/icon/index.d.ts +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/input/index.d.ts +1 -1
- package/es/input/index.js +16 -6
- package/es/input/main.scss +25 -0
- package/es/input/style.d.ts +1 -0
- package/es/input/style.js +1 -0
- package/es/input/types.d.ts +58 -15
- package/es/markdown/index.d.ts +1 -2
- package/es/markdown/index.js +26 -15
- package/es/markdown/main.scss +4 -3
- package/es/markdown/style.d.ts +2 -1
- package/es/markdown/style.js +2 -1
- package/es/markdown/types.d.ts +20 -9
- package/es/message/index.d.ts +4 -4
- package/es/person-picker/index.d.ts +3 -190
- package/es/person-picker/index.js +23 -21
- package/es/person-picker/main.scss +15 -1
- package/es/person-picker/types.d.ts +53 -11
- package/es/radio-group/index.d.ts +1 -1
- package/es/radio-group/index.js +9 -3
- package/es/radio-group/main.scss +13 -5
- package/es/radio-group/types.d.ts +5 -3
- package/es/reference/index.d.ts +1 -1
- package/es/reference/index.js +14 -15
- package/es/reference/main.scss +1 -1
- package/es/reference/types.d.ts +1 -0
- package/es/select/button.d.ts +3 -0
- package/es/select/button.js +70 -0
- package/es/select/index.d.ts +79 -79
- package/es/select/index.js +13 -57
- package/es/select/main.scss +22 -4
- package/es/select/types.d.ts +108 -1
- package/es/step/index.js +2 -2
- package/es/step/main.scss +115 -66
- package/es/step/types.d.ts +13 -2
- package/es/table/index.d.ts +12 -0
- package/es/table/index.js +23 -0
- package/es/table/main.scss +30 -0
- package/es/table/style.d.ts +2 -0
- package/es/table/style.js +2 -0
- package/es/table/types.d.ts +98 -0
- package/es/table/types.js +1 -0
- package/es/tag/index.d.ts +5 -3
- package/es/tag/index.js +18 -2
- package/es/tag/main.scss +20 -4
- package/es/tag/types.d.ts +55 -0
- package/es/text/index.js +1 -1
- package/es/text/main.scss +4 -1
- package/es/text/types.d.ts +8 -0
- package/es/time-picker/index.d.ts +6 -15
- package/es/time-picker/index.js +71 -24
- package/es/time-picker/main.scss +19 -1
- package/es/time-picker/style.d.ts +1 -0
- package/es/time-picker/style.js +1 -0
- package/es/time-picker/types.d.ts +133 -8
- package/es/tool-status/index.d.ts +1 -1
- package/es/tool-status/index.js +1 -1
- package/es/tool-status/main.scss +2 -1
- package/es/tool-status/types.d.ts +7 -2
- package/es/utils/func.d.ts +1 -0
- package/es/utils/func.js +13 -0
- package/es/utils/github-dark.scss +137 -0
- package/es/utils/github.scss +137 -0
- package/es/utils/hoc/main.scss +166 -0
- package/es/utils/hoc/withLabel.d.ts +94 -0
- package/es/utils/hoc/withLabel.js +57 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/lib/ai-loading/types.d.ts +1 -0
- package/lib/button/button.d.ts +1 -2
- package/lib/button/button.js +13 -19
- package/lib/button/group.js +4 -41
- package/lib/button/main.scss +36 -77
- package/lib/card/main.scss +1 -1
- package/lib/checkbox-group/main.scss +6 -7
- package/lib/checkbox-group/types.d.ts +6 -0
- package/lib/code-view/index.d.ts +11 -0
- package/lib/code-view/index.js +66 -0
- package/lib/code-view/main.scss +54 -0
- package/lib/code-view/style.d.ts +4 -0
- package/lib/code-view/style.js +6 -0
- package/lib/code-view/types.d.ts +27 -0
- package/lib/code-view/types.js +2 -0
- package/lib/collapse/index.d.ts +157 -0
- package/lib/collapse/index.js +22 -0
- package/lib/collapse/main.scss +97 -0
- package/lib/collapse/style.d.ts +2 -0
- package/lib/collapse/style.js +4 -0
- package/lib/collapse/types.d.ts +82 -0
- package/lib/collapse/types.js +3 -0
- package/lib/core/variables.scss +27 -12
- package/lib/date-picker/DatePicker.d.ts +5 -0
- package/lib/date-picker/DatePicker.js +17 -0
- package/lib/date-picker/MonthPicker.d.ts +4 -0
- package/lib/date-picker/MonthPicker.js +17 -0
- package/lib/date-picker/RangePicker.d.ts +4 -0
- package/lib/date-picker/RangePicker.js +19 -0
- package/lib/date-picker/YearPicker.d.ts +4 -0
- package/lib/date-picker/YearPicker.js +17 -0
- package/lib/date-picker/index.d.ts +5 -23
- package/lib/date-picker/index.js +10 -27
- package/lib/date-picker/main.scss +23 -1
- package/lib/date-picker/style.d.ts +1 -0
- package/lib/date-picker/style.js +1 -0
- package/lib/date-picker/types.d.ts +161 -81
- package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
- package/lib/form/style.d.ts +0 -1
- package/lib/form/style.js +1 -2
- package/lib/form/types.d.ts +3 -517
- package/lib/form/types.js +4 -1
- package/lib/html-render/index.d.ts +1 -1
- package/lib/html-render/index.js +118 -106
- package/lib/html-render/main.scss +27 -8
- package/lib/html-render/style.d.ts +1 -0
- package/lib/html-render/style.js +1 -0
- package/lib/icon/index.d.ts +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +8 -2
- package/lib/input/index.d.ts +1 -1
- package/lib/input/index.js +16 -6
- package/lib/input/main.scss +25 -0
- package/lib/input/style.d.ts +1 -0
- package/lib/input/style.js +1 -0
- package/lib/input/types.d.ts +58 -15
- package/lib/markdown/index.d.ts +1 -2
- package/lib/markdown/index.js +26 -15
- package/lib/markdown/main.scss +4 -3
- package/lib/markdown/style.d.ts +2 -1
- package/lib/markdown/style.js +2 -1
- package/lib/markdown/types.d.ts +20 -9
- package/lib/message/index.d.ts +4 -4
- package/lib/person-picker/index.d.ts +3 -190
- package/lib/person-picker/index.js +22 -20
- package/lib/person-picker/main.scss +15 -1
- package/lib/person-picker/types.d.ts +53 -11
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-group/index.js +8 -2
- package/lib/radio-group/main.scss +13 -5
- package/lib/radio-group/types.d.ts +5 -3
- package/lib/reference/index.d.ts +1 -1
- package/lib/reference/index.js +17 -18
- package/lib/reference/main.scss +1 -1
- package/lib/reference/types.d.ts +1 -0
- package/lib/select/button.d.ts +3 -0
- package/lib/select/button.js +74 -0
- package/lib/select/index.d.ts +79 -79
- package/lib/select/index.js +11 -55
- package/lib/select/main.scss +22 -4
- package/lib/select/types.d.ts +108 -1
- package/lib/step/index.js +2 -2
- package/lib/step/main.scss +115 -66
- package/lib/step/types.d.ts +13 -2
- package/lib/table/index.d.ts +12 -0
- package/lib/table/index.js +25 -0
- package/lib/table/main.scss +30 -0
- package/lib/table/style.d.ts +2 -0
- package/lib/table/style.js +4 -0
- package/lib/table/types.d.ts +98 -0
- package/lib/table/types.js +2 -0
- package/lib/tag/index.d.ts +5 -3
- package/lib/tag/index.js +17 -1
- package/lib/tag/main.scss +20 -4
- package/lib/tag/types.d.ts +55 -0
- package/lib/text/index.js +1 -1
- package/lib/text/main.scss +4 -1
- package/lib/text/types.d.ts +8 -0
- package/lib/time-picker/index.d.ts +6 -15
- package/lib/time-picker/index.js +71 -23
- package/lib/time-picker/main.scss +19 -1
- package/lib/time-picker/style.d.ts +1 -0
- package/lib/time-picker/style.js +1 -0
- package/lib/time-picker/types.d.ts +133 -8
- package/lib/tool-status/index.d.ts +1 -1
- package/lib/tool-status/index.js +1 -1
- package/lib/tool-status/main.scss +2 -1
- package/lib/tool-status/types.d.ts +7 -2
- package/lib/utils/func.d.ts +1 -0
- package/lib/utils/func.js +15 -0
- package/lib/utils/github-dark.scss +137 -0
- package/lib/utils/github.scss +137 -0
- package/lib/utils/hoc/main.scss +166 -0
- package/lib/utils/hoc/withLabel.d.ts +94 -0
- package/lib/utils/hoc/withLabel.js +60 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +49 -4
- package/es/form/index.d.ts +0 -23
- package/es/form/index.js +0 -33
- package/es/form/main.scss +0 -5
- package/lib/form/index.d.ts +0 -23
- package/lib/form/index.js +0 -35
- package/lib/form/main.scss +0 -5
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@import '../core/variables.scss';
|
|
2
|
+
|
|
3
|
+
.#{$prefix}collapse.next-collapse {
|
|
4
|
+
border: none;
|
|
5
|
+
|
|
6
|
+
&.next-collapse {
|
|
7
|
+
.next-collapse-panel-icon {
|
|
8
|
+
width: 18px;
|
|
9
|
+
height: auto;
|
|
10
|
+
transform: none;
|
|
11
|
+
margin-right: var(--s-2, 8px);
|
|
12
|
+
left: 2px;
|
|
13
|
+
top: 1px;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
line-height: 24px;
|
|
16
|
+
|
|
17
|
+
&:before {
|
|
18
|
+
content: "";
|
|
19
|
+
display: inline-block;
|
|
20
|
+
width: 18px;
|
|
21
|
+
height: 18px;
|
|
22
|
+
background-image: url('https://img.alicdn.com/imgextra/i2/O1CN01NIpvEr1Hw4EsvCARb_!!6000000000821-2-tps-36-36.png');
|
|
23
|
+
background-size: contain;
|
|
24
|
+
background-repeat: no-repeat;
|
|
25
|
+
background-position: center;
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.next-collapse-panel {
|
|
31
|
+
border: none;
|
|
32
|
+
|
|
33
|
+
&:first-child {
|
|
34
|
+
.next-collapse-panel-title {
|
|
35
|
+
padding-top: 0;
|
|
36
|
+
margin-top: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:last-child {
|
|
41
|
+
.next-collapse-panel-content {
|
|
42
|
+
padding-bottom: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.next-collapse-panel-expanded .next-collapse-panel-icon {
|
|
48
|
+
|
|
49
|
+
&:before {
|
|
50
|
+
transform: rotate(90deg);
|
|
51
|
+
transform-origin: 50% 50%;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.next-collapse-panel-hidden {
|
|
56
|
+
.next-collapse-panel-content {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.next-collapse-panel-content,
|
|
62
|
+
.next-collapse-panel-title {
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
padding-top: 0px;
|
|
65
|
+
padding-bottom: 0;
|
|
66
|
+
padding-left: 24px;
|
|
67
|
+
padding-right: 0;
|
|
68
|
+
margin-top: var(--s-2, 8px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.next-collapse-panel-content {
|
|
72
|
+
padding-top: 0px;
|
|
73
|
+
margin-top: var(--s-2, 8px);
|
|
74
|
+
padding-bottom: var(--s-1, 4px);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.next-collapse-panel-title {
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
position: relative;
|
|
80
|
+
|
|
81
|
+
h1,
|
|
82
|
+
h2,
|
|
83
|
+
h3,
|
|
84
|
+
h4,
|
|
85
|
+
h5,
|
|
86
|
+
h6,
|
|
87
|
+
p {
|
|
88
|
+
line-height: 24px;
|
|
89
|
+
margin-bottom: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:hover {
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { CommonProps } from '@alifd/next';
|
|
3
|
+
/**
|
|
4
|
+
* @api
|
|
5
|
+
*/
|
|
6
|
+
export type KeyType = string | number;
|
|
7
|
+
/**
|
|
8
|
+
* @api
|
|
9
|
+
*/
|
|
10
|
+
export interface DataItem {
|
|
11
|
+
id?: string;
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
content?: React.ReactNode;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
key?: KeyType;
|
|
16
|
+
onClick?: (key: KeyType) => void;
|
|
17
|
+
[propName: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @api Collapse
|
|
21
|
+
*/
|
|
22
|
+
export interface CollapseProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
|
23
|
+
/**
|
|
24
|
+
* 使用数据模型构建
|
|
25
|
+
* @en Use data model to build
|
|
26
|
+
*/
|
|
27
|
+
dataSource?: Array<DataItem>;
|
|
28
|
+
/**
|
|
29
|
+
* 默认展开 keys
|
|
30
|
+
* @en Default expanded keys
|
|
31
|
+
*/
|
|
32
|
+
defaultExpandedKeys?: KeyType[];
|
|
33
|
+
/**
|
|
34
|
+
* 受控展开 keys
|
|
35
|
+
* @en Controlled expanded keys
|
|
36
|
+
* @skip
|
|
37
|
+
*/
|
|
38
|
+
expandedKeys?: KeyType[];
|
|
39
|
+
/**
|
|
40
|
+
* 展开状态发升变化时候的回调
|
|
41
|
+
* @en Callback when the expanded state changes
|
|
42
|
+
* @skip
|
|
43
|
+
*/
|
|
44
|
+
onExpand?: (expandedKeys: KeyType | KeyType[]) => void;
|
|
45
|
+
/**
|
|
46
|
+
* 所有禁用
|
|
47
|
+
* @en All disabled
|
|
48
|
+
*/
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* 手风琴模式,一次只能打开一个
|
|
52
|
+
* @en Accordion mode, only one can be opened at a time
|
|
53
|
+
* @defaultValue false
|
|
54
|
+
*/
|
|
55
|
+
accordion?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @api Collapse.Panel
|
|
59
|
+
*/
|
|
60
|
+
export interface PanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onClick'>, CommonProps {
|
|
61
|
+
/**
|
|
62
|
+
* 是否禁止用户操作
|
|
63
|
+
* @en Whether to disable user actions
|
|
64
|
+
*/
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 标题
|
|
68
|
+
* @en Title
|
|
69
|
+
*/
|
|
70
|
+
title?: React.ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* 是否展开
|
|
73
|
+
* @en Whether to expand
|
|
74
|
+
* @defaultValue false
|
|
75
|
+
*/
|
|
76
|
+
isExpanded?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* 点击回调函数
|
|
79
|
+
* @en Click callback function
|
|
80
|
+
*/
|
|
81
|
+
onClick?: ((e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void) | null;
|
|
82
|
+
}
|
package/lib/core/variables.scss
CHANGED
|
@@ -19,18 +19,18 @@ $shadow-2: 2px 4px 16px 0px rgba(0, 0, 0, 0.12) !default;
|
|
|
19
19
|
|
|
20
20
|
$font-size-display-3: var(--font-size-display-3, 56px) !default;
|
|
21
21
|
$font-size-display-2: var(--font-size-display-2, 48px) !default;
|
|
22
|
-
$s-1: var(
|
|
23
|
-
$s-2: var(
|
|
24
|
-
$s-3: var(
|
|
25
|
-
$s-4: var(
|
|
26
|
-
$s-5: var(
|
|
27
|
-
$s-6: var(
|
|
28
|
-
$s-7: var(
|
|
29
|
-
$s-8: var(
|
|
30
|
-
$s-9: var(
|
|
31
|
-
$s-10: var(
|
|
32
|
-
$s-12: var(
|
|
33
|
-
$s-15: var(
|
|
22
|
+
$s-1: var(--s-1, 4px) !default;
|
|
23
|
+
$s-2: var(--s-2, 8px) !default;
|
|
24
|
+
$s-3: var(--s-3, 12px) !default;
|
|
25
|
+
$s-4: var(--s-4, 16px) !default;
|
|
26
|
+
$s-5: var(--s-5, 20px) !default;
|
|
27
|
+
$s-6: var(--s-6, 24px) !default;
|
|
28
|
+
$s-7: var(--s-7, 28px) !default;
|
|
29
|
+
$s-8: var(--s-8, 32px) !default;
|
|
30
|
+
$s-9: var(--s-9, 36px) !default;
|
|
31
|
+
$s-10: var(--s-10, 40px) !default;
|
|
32
|
+
$s-12: var(--s-12, 48px) !default;
|
|
33
|
+
$s-15: var(--s-15, 60px) !default;
|
|
34
34
|
|
|
35
35
|
$font-size-headline: var(--font-size-headline, 24px) !default;
|
|
36
36
|
$font-size-title: var(--font-size-title, 20px) !default;
|
|
@@ -99,3 +99,18 @@ $color-bg-1: var(--color-bg-1, #ffffff) !default; // ?
|
|
|
99
99
|
$color-error-3: var(--color-error-3, rgb(255, 82, 25)) !default;
|
|
100
100
|
|
|
101
101
|
$color-success-3: var(--color-success-3, #00b042) !default;
|
|
102
|
+
|
|
103
|
+
:root {
|
|
104
|
+
--form-element-medium-height: 34px;
|
|
105
|
+
--form-element-medium-line-height: 18px;
|
|
106
|
+
|
|
107
|
+
--common-text-font-size: 14px;
|
|
108
|
+
--common-text-line-height: 20px;
|
|
109
|
+
|
|
110
|
+
--btn-size-xs-padding: 8px;
|
|
111
|
+
|
|
112
|
+
// Input control positioning variables
|
|
113
|
+
--input-control-right: 0px;
|
|
114
|
+
--input-control-top: 10px;
|
|
115
|
+
--input-control-padding-right: 20px;
|
|
116
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DatePicker2 as NextDatePicker2 } from '@alifd/next';
|
|
3
|
+
import type { DatePickerProps } from './types';
|
|
4
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Pick<DatePickerProps & React.RefAttributes<NextDatePicker2> & import("../utils").WithLabelProps, "defaultValue" | "className" | "placeholder" | "style" | "onFocus" | "onBlur" | "onChange" | "size" | "key" | "state" | "label" | "labelLayout" | "disabled" | "required" | "readOnly" | "labelWidth" | "value" | "format" | "showTime" | "timePanelProps"> & React.RefAttributes<any>>;
|
|
5
|
+
export default DatePicker;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const next_1 = require("@alifd/next");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const withLabel_1 = require("../utils/hoc/withLabel");
|
|
9
|
+
// 基础DatePicker组件
|
|
10
|
+
const BaseDatePicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
11
|
+
var { className, size = 'medium', format = 'YYYY-MM-DD', showTime, timePanelProps } = _a, props = tslib_1.__rest(_a, ["className", "size", "format", "showTime", "timePanelProps"]);
|
|
12
|
+
return (react_1.default.createElement(next_1.DatePicker2, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}date-picker2`, className), size: size, format: format, hasBorder: false, showTime: showTime, timePanelProps: timePanelProps, ref: ref })));
|
|
13
|
+
});
|
|
14
|
+
BaseDatePicker.displayName = 'BaseDatePicker';
|
|
15
|
+
// 带Label的DatePicker组件
|
|
16
|
+
const DatePicker = (0, withLabel_1.withLabel)(BaseDatePicker);
|
|
17
|
+
exports.default = DatePicker;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MonthPickerProps } from './types';
|
|
3
|
+
declare const MonthPicker: React.ForwardRefExoticComponent<Pick<MonthPickerProps & React.RefAttributes<import("@alifd/next/types/date-picker2").MonthPicker> & import("../utils").WithLabelProps, "defaultValue" | "className" | "placeholder" | "style" | "onFocus" | "onBlur" | "onChange" | "size" | "key" | "state" | "label" | "labelLayout" | "disabled" | "required" | "readOnly" | "labelWidth" | "value" | "format"> & React.RefAttributes<any>>;
|
|
4
|
+
export default MonthPicker;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const next_1 = require("@alifd/next");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const withLabel_1 = require("../utils/hoc/withLabel");
|
|
9
|
+
// 基础MonthPicker组件
|
|
10
|
+
const BaseMonthPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
11
|
+
var { className, size = 'medium', format = 'YYYY-MM' } = _a, props = tslib_1.__rest(_a, ["className", "size", "format"]);
|
|
12
|
+
return (react_1.default.createElement(next_1.DatePicker2.MonthPicker, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}date-picker2`, className), size: size, format: format, hasBorder: false, ref: ref })));
|
|
13
|
+
});
|
|
14
|
+
BaseMonthPicker.displayName = 'BaseMonthPicker';
|
|
15
|
+
// 带Label的MonthPicker组件
|
|
16
|
+
const MonthPicker = (0, withLabel_1.withLabel)(BaseMonthPicker);
|
|
17
|
+
exports.default = MonthPicker;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RangePickerProps } from './types';
|
|
3
|
+
declare const RangePicker: React.ForwardRefExoticComponent<Pick<RangePickerProps & React.RefAttributes<import("@alifd/next/types/date-picker2").RangePicker> & import("../utils").WithLabelProps, "defaultValue" | "className" | "placeholder" | "style" | "onFocus" | "onBlur" | "onChange" | "size" | "key" | "state" | "label" | "labelLayout" | "disabled" | "required" | "readOnly" | "labelWidth" | "value" | "format" | "mode" | "showTime" | "timePanelProps"> & React.RefAttributes<any>>;
|
|
4
|
+
export default RangePicker;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const next_1 = require("@alifd/next");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const withLabel_1 = require("../utils/hoc/withLabel");
|
|
9
|
+
// 基础RangePicker组件
|
|
10
|
+
const BaseRangePicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
11
|
+
var { className, size = 'medium', format = 'YYYY-MM-DD', mode = 'date', showTime, timePanelProps } = _a, props = tslib_1.__rest(_a, ["className", "size", "format", "mode", "showTime", "timePanelProps"]);
|
|
12
|
+
return (react_1.default.createElement(next_1.DatePicker2.RangePicker
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}date-picker2`, className), size: size, format: format, mode: mode, hasBorder: false, showTime: showTime, timePanelProps: timePanelProps, ref: ref })));
|
|
15
|
+
});
|
|
16
|
+
BaseRangePicker.displayName = 'BaseRangePicker';
|
|
17
|
+
// 带Label的RangePicker组件
|
|
18
|
+
const RangePicker = (0, withLabel_1.withLabel)(BaseRangePicker);
|
|
19
|
+
exports.default = RangePicker;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { YearPickerProps } from './types';
|
|
3
|
+
declare const YearPicker: React.ForwardRefExoticComponent<Pick<YearPickerProps & React.RefAttributes<import("@alifd/next/types/date-picker2").YearPicker> & import("../utils").WithLabelProps, "defaultValue" | "className" | "placeholder" | "style" | "onFocus" | "onBlur" | "onChange" | "size" | "key" | "state" | "label" | "labelLayout" | "disabled" | "required" | "readOnly" | "labelWidth" | "value" | "format"> & React.RefAttributes<any>>;
|
|
4
|
+
export default YearPicker;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const next_1 = require("@alifd/next");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const withLabel_1 = require("../utils/hoc/withLabel");
|
|
9
|
+
// 基础YearPicker组件
|
|
10
|
+
const BaseYearPicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
11
|
+
var { className, size = 'medium', format = 'YYYY' } = _a, props = tslib_1.__rest(_a, ["className", "size", "format"]);
|
|
12
|
+
return (react_1.default.createElement(next_1.DatePicker2.YearPicker, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}date-picker2`, className), size: size, format: format, hasBorder: false, ref: ref })));
|
|
13
|
+
});
|
|
14
|
+
BaseYearPicker.displayName = 'BaseYearPicker';
|
|
15
|
+
// 带Label的YearPicker组件
|
|
16
|
+
const YearPicker = (0, withLabel_1.withLabel)(BaseYearPicker);
|
|
17
|
+
exports.default = YearPicker;
|
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Buttons are used for emphasizing important functions on your page.
|
|
7
|
-
* @others
|
|
8
|
-
* ## 无障碍键盘操作指南
|
|
9
|
-
* | 按键 | 说明 |
|
|
10
|
-
* | :---- | :---------- |
|
|
11
|
-
* | Enter | 触发 onClick 事件 |
|
|
12
|
-
* | SPACE | 触发 onClick 事件 |
|
|
13
|
-
* @othersEn
|
|
14
|
-
* ## ARIA and KeyBoard
|
|
15
|
-
* | KeyBoard | Description |
|
|
16
|
-
* | :---------- | :------------------------------ |
|
|
17
|
-
* | Enter | Trigger the onClick event |
|
|
18
|
-
* | SPACE | Trigger the onClick event |
|
|
19
|
-
*/
|
|
20
|
-
import React from 'react';
|
|
21
|
-
import { DatePicker2 as NextDatePicker2 } from '@alifd/next';
|
|
22
|
-
export * from './types';
|
|
23
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<any, string | number | symbol> & React.RefAttributes<NextDatePicker2>, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, NextDatePicker2, {}>;
|
|
1
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<any, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, unknown, {}> & {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
[x: number]: any;
|
|
4
|
+
[x: symbol]: any;
|
|
5
|
+
};
|
|
24
6
|
export default _default;
|
package/lib/date-picker/index.js
CHANGED
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @component 日期选择器
|
|
4
|
-
* @en DatePicker
|
|
5
|
-
* @type 通用 - General
|
|
6
|
-
* @remarks 同 Next DatePicker,按钮用于开始一个即时操作。- Same as Next.Button, Button used to trigger an action.
|
|
7
|
-
* @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Buttons are used for emphasizing important functions on your page.
|
|
8
|
-
* @others
|
|
9
|
-
* ## 无障碍键盘操作指南
|
|
10
|
-
* | 按键 | 说明 |
|
|
11
|
-
* | :---- | :---------- |
|
|
12
|
-
* | Enter | 触发 onClick 事件 |
|
|
13
|
-
* | SPACE | 触发 onClick 事件 |
|
|
14
|
-
* @othersEn
|
|
15
|
-
* ## ARIA and KeyBoard
|
|
16
|
-
* | KeyBoard | Description |
|
|
17
|
-
* | :---------- | :------------------------------ |
|
|
18
|
-
* | Enter | Trigger the onClick event |
|
|
19
|
-
* | SPACE | Trigger the onClick event |
|
|
20
|
-
*/
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
3
|
const tslib_1 = require("tslib");
|
|
23
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
24
4
|
const next_1 = require("@alifd/next");
|
|
25
|
-
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
26
5
|
const utils_1 = require("../utils");
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
6
|
+
const DatePicker_1 = tslib_1.__importDefault(require("./DatePicker"));
|
|
7
|
+
const RangePicker_1 = tslib_1.__importDefault(require("./RangePicker"));
|
|
8
|
+
const YearPicker_1 = tslib_1.__importDefault(require("./YearPicker"));
|
|
9
|
+
const MonthPicker_1 = tslib_1.__importDefault(require("./MonthPicker"));
|
|
10
|
+
// 组装组件
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
const DatePickerWithSub = (0, utils_1.assignSubComponent)(DatePicker_1.default, {
|
|
32
13
|
displayName: 'DatePicker',
|
|
14
|
+
RangePicker: RangePicker_1.default,
|
|
15
|
+
YearPicker: YearPicker_1.default,
|
|
16
|
+
MonthPicker: MonthPicker_1.default,
|
|
33
17
|
});
|
|
34
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
35
18
|
exports.default = next_1.ConfigProvider.config(DatePickerWithSub);
|
|
@@ -2,5 +2,27 @@
|
|
|
2
2
|
@import "../core/variables.scss";
|
|
3
3
|
|
|
4
4
|
.#{$prefix}date-picker2 {
|
|
5
|
-
|
|
5
|
+
&.next-date-picker2 {
|
|
6
|
+
width: 100%;
|
|
7
|
+
position: relative;
|
|
8
|
+
padding-right: var(--input-control-padding-right, 22px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.next-input-control {
|
|
12
|
+
position: absolute;
|
|
13
|
+
right: var(--input-control-right, 2px);
|
|
14
|
+
top: var(--input-control-top, 10px);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.next-date-picker2-input-separator {
|
|
18
|
+
color: var(--color-text1-2, #A0A3A8);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.next-date-picker2-input {
|
|
22
|
+
background-color: transparent;
|
|
23
|
+
|
|
24
|
+
input {
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
6
28
|
}
|
package/lib/date-picker/style.js
CHANGED