tntd 2.8.0-beta.3 → 2.8.0-beta.5
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/alert/alert.js +70 -0
- package/es/alert/alert.js.map +1 -0
- package/es/alert/alert.less +128 -0
- package/es/breadcrumb/style/index.less +2 -1
- package/es/button/button.less +72 -0
- package/es/cascader/style/index.less +2 -2
- package/es/checkbox/check.png +0 -0
- package/es/checkbox/checkbox.js +48 -0
- package/es/checkbox/checkbox.js.map +1 -0
- package/es/checkbox/checkbox.less +69 -0
- package/es/collapse/style/index.less +2 -1
- package/es/color-picker/index.less +4 -1
- package/es/date-picker/DatePicker.js +101 -0
- package/es/date-picker/DatePicker.js.map +1 -0
- package/es/date-picker/index.less +294 -0
- package/es/date-picker/style/Picker.less +2 -1
- package/es/drawer/index.less +154 -0
- package/es/drawer/style/drawer.less +4 -2
- package/es/dropdown/style/index.less +2 -1
- package/es/form/form.less +36 -0
- package/es/grid/RowContext.js +3 -0
- package/es/grid/RowContext.js.map +1 -0
- package/es/grid/col.js +103 -0
- package/es/grid/col.js.map +1 -0
- package/es/grid/hooks/useBreakpoint.js +18 -0
- package/es/grid/hooks/useBreakpoint.js.map +1 -0
- package/es/grid/row.js +154 -0
- package/es/grid/row.js.map +1 -0
- package/es/grid/style/rtl.less +69 -0
- package/es/icon/index.js +2 -1
- package/es/icon/index.js.map +1 -1
- package/es/icon/style/index.js +2 -1
- package/es/icon/style/index.js.map +1 -1
- package/es/icon/style/style.less +6 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/es/input/style/mixin.less +1 -1
- package/es/input-number/inputNumber.js +29 -0
- package/es/input-number/inputNumber.js.map +1 -0
- package/es/input-number/inputNumber.less +12 -0
- package/es/modal/index.less +36 -0
- package/es/modal/style/confirm.less +1 -1
- package/es/modal/style/modal.less +5 -1
- package/es/notification/assets/index.js +2 -0
- package/es/notification/assets/index.js.map +1 -0
- package/es/notification/assets/svg-error-tip.js +145 -0
- package/es/notification/assets/svg-error-tip.js.map +1 -0
- package/es/notification/assets/svg-success-tip.js +162 -0
- package/es/notification/assets/svg-success-tip.js.map +1 -0
- package/es/notification/notification.js +80 -0
- package/es/notification/notification.js.map +1 -0
- package/es/notification/notification.less +59 -0
- package/es/notification/style/index.less +4 -2
- package/es/popconfirm/index.less +32 -0
- package/es/popconfirm/popconfirm.js +43 -0
- package/es/popconfirm/popconfirm.js.map +1 -0
- package/es/popover/index.less +57 -0
- package/es/popover/popover.js +34 -0
- package/es/popover/popover.js.map +1 -0
- package/es/popover/style/index.less +2 -1
- package/es/progress/progress.js +132 -0
- package/es/progress/progress.js.map +1 -0
- package/es/progress/progress.less +82 -0
- package/es/query-form/Field/Composition/FieldPopover.js +284 -0
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form/Field/Composition/Select.js +108 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +275 -0
- package/es/query-form/Field/Composition/index.js.map +1 -0
- package/es/query-form/Field/Composition/index.less +106 -0
- package/es/query-form/Field/Composition/utils.js +19 -0
- package/es/query-form/Field/Composition/utils.js.map +1 -0
- package/es/radio/radio.js +57 -0
- package/es/radio/radio.js.map +1 -0
- package/es/radio/radio.less +43 -0
- package/es/select/style/index.less +2 -1
- package/es/steps/assets/background_left.svg +12 -0
- package/es/steps/assets/background_right.svg +12 -0
- package/es/steps/assets/horizontal_line.svg +3 -0
- package/es/steps/assets/vertical_line.svg +3 -0
- package/es/steps/stepStyle/icon.less +51 -0
- package/es/steps/stepStyle/progress-dot.less +10 -0
- package/es/steps/stepStyle/variables.less +8 -0
- package/es/steps/stepStyle/vertical.less +41 -0
- package/es/style/mixins/iconfont.less +3 -2
- package/es/style/themes/default.less +3 -2
- package/es/switch/index.less +46 -0
- package/es/table-container/index.js +12 -0
- package/es/table-container/index.js.map +1 -0
- package/es/table-container/index.less +12 -0
- package/es/tabs/tabs.less +116 -0
- package/es/tabs-container/index.js +12 -0
- package/es/tabs-container/index.js.map +1 -0
- package/es/tabs-container/index.less +51 -0
- package/es/tag/color.less +43 -0
- package/es/tag/tag.js +171 -0
- package/es/tag/tag.js.map +1 -0
- package/es/tag/tag.less +193 -0
- package/es/time-picker/TimePicker.js +36 -0
- package/es/time-picker/TimePicker.js.map +1 -0
- package/es/time-picker/index.less +38 -0
- package/es/time-picker/style/index.less +2 -1
- package/es/timeline/style/index.less +1 -1
- package/es/tntd-action/Action.js +66 -0
- package/es/tntd-action/Action.js.map +1 -0
- package/es/tntd-action/index.less +53 -0
- package/es/tooltip/index.less +29 -0
- package/es/tooltip/tooltip.js +33 -0
- package/es/tooltip/tooltip.js.map +1 -0
- package/lib/alert/alert.d.ts +12 -0
- package/lib/alert/alert.d.ts.map +1 -0
- package/lib/alert/alert.js +92 -0
- package/lib/alert/alert.js.map +1 -0
- package/lib/alert/alert.less +128 -0
- package/lib/breadcrumb/style/index.less +2 -1
- package/lib/button/button.less +72 -0
- package/lib/cascader/style/index.less +2 -2
- package/lib/checkbox/check.png +0 -0
- package/lib/checkbox/checkbox.d.ts +16 -0
- package/lib/checkbox/checkbox.d.ts.map +1 -0
- package/lib/checkbox/checkbox.js +65 -0
- package/lib/checkbox/checkbox.js.map +1 -0
- package/lib/checkbox/checkbox.less +69 -0
- package/lib/collapse/style/index.less +2 -1
- package/lib/color-picker/index.less +4 -1
- package/lib/date-picker/DatePicker.d.ts +21 -0
- package/lib/date-picker/DatePicker.d.ts.map +1 -0
- package/lib/date-picker/DatePicker.js +128 -0
- package/lib/date-picker/DatePicker.js.map +1 -0
- package/lib/date-picker/index.less +294 -0
- package/lib/date-picker/style/Picker.less +2 -1
- package/lib/drawer/index.less +154 -0
- package/lib/drawer/style/drawer.less +4 -2
- package/lib/dropdown/style/index.less +2 -1
- package/lib/form/form.less +36 -0
- package/lib/grid/RowContext.d.ts +9 -0
- package/lib/grid/RowContext.d.ts.map +1 -0
- package/lib/grid/RowContext.js +9 -0
- package/lib/grid/RowContext.js.map +1 -0
- package/lib/grid/col.d.ts +29 -0
- package/lib/grid/col.d.ts.map +1 -0
- package/lib/grid/col.js +100 -0
- package/lib/grid/col.js.map +1 -0
- package/lib/grid/hooks/useBreakpoint.d.ts +4 -0
- package/lib/grid/hooks/useBreakpoint.d.ts.map +1 -0
- package/lib/grid/hooks/useBreakpoint.js +28 -0
- package/lib/grid/hooks/useBreakpoint.js.map +1 -0
- package/lib/grid/row.d.ts +21 -0
- package/lib/grid/row.d.ts.map +1 -0
- package/lib/grid/row.js +183 -0
- package/lib/grid/row.js.map +1 -0
- package/lib/grid/style/rtl.less +69 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.d.ts.map +1 -1
- package/lib/icon/index.js +2 -1
- package/lib/icon/index.js.map +1 -1
- package/lib/icon/style/index.d.ts +1 -0
- package/lib/icon/style/index.d.ts.map +1 -1
- package/lib/icon/style/index.js +2 -1
- package/lib/icon/style/index.js.map +1 -1
- package/lib/icon/style/style.less +6 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -1
- package/lib/input/style/mixin.less +1 -1
- package/lib/input-number/inputNumber.d.ts +10 -0
- package/lib/input-number/inputNumber.d.ts.map +1 -0
- package/lib/input-number/inputNumber.js +48 -0
- package/lib/input-number/inputNumber.js.map +1 -0
- package/lib/input-number/inputNumber.less +12 -0
- package/lib/modal/index.less +36 -0
- package/lib/modal/style/confirm.less +1 -1
- package/lib/modal/style/modal.less +5 -1
- package/lib/notification/assets/index.d.ts +3 -0
- package/lib/notification/assets/index.d.ts.map +1 -0
- package/lib/notification/assets/index.js +20 -0
- package/lib/notification/assets/index.js.map +1 -0
- package/lib/notification/assets/svg-error-tip.d.ts +4 -0
- package/lib/notification/assets/svg-error-tip.d.ts.map +1 -0
- package/lib/notification/assets/svg-error-tip.js +154 -0
- package/lib/notification/assets/svg-error-tip.js.map +1 -0
- package/lib/notification/assets/svg-success-tip.d.ts +4 -0
- package/lib/notification/assets/svg-success-tip.d.ts.map +1 -0
- package/lib/notification/assets/svg-success-tip.js +171 -0
- package/lib/notification/assets/svg-success-tip.js.map +1 -0
- package/lib/notification/notification.d.ts +9 -0
- package/lib/notification/notification.d.ts.map +1 -0
- package/lib/notification/notification.js +105 -0
- package/lib/notification/notification.js.map +1 -0
- package/lib/notification/notification.less +59 -0
- package/lib/notification/style/index.less +4 -2
- package/lib/popconfirm/index.less +32 -0
- package/lib/popconfirm/popconfirm.d.ts +8 -0
- package/lib/popconfirm/popconfirm.d.ts.map +1 -0
- package/lib/popconfirm/popconfirm.js +61 -0
- package/lib/popconfirm/popconfirm.js.map +1 -0
- package/lib/popover/index.less +57 -0
- package/lib/popover/popover.d.ts +14 -0
- package/lib/popover/popover.d.ts.map +1 -0
- package/lib/popover/popover.js +55 -0
- package/lib/popover/popover.js.map +1 -0
- package/lib/popover/style/index.less +2 -1
- package/lib/progress/progress.d.ts +12 -0
- package/lib/progress/progress.d.ts.map +1 -0
- package/lib/progress/progress.js +148 -0
- package/lib/progress/progress.js.map +1 -0
- package/lib/progress/progress.less +82 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +17 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +319 -0
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.less +35 -0
- package/lib/query-form/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/Select.js +132 -0
- package/lib/query-form/Field/Composition/Select.js.map +1 -0
- package/lib/query-form/Field/Composition/index.d.ts +14 -0
- package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/index.js +330 -0
- package/lib/query-form/Field/Composition/index.js.map +1 -0
- package/lib/query-form/Field/Composition/index.less +106 -0
- package/lib/query-form/Field/Composition/utils.d.ts +6 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/utils.js +27 -0
- package/lib/query-form/Field/Composition/utils.js.map +1 -0
- package/lib/radio/radio.d.ts +17 -0
- package/lib/radio/radio.d.ts.map +1 -0
- package/lib/radio/radio.js +75 -0
- package/lib/radio/radio.js.map +1 -0
- package/lib/radio/radio.less +43 -0
- package/lib/select/style/index.less +2 -1
- package/lib/steps/assets/background_left.svg +12 -0
- package/lib/steps/assets/background_right.svg +12 -0
- package/lib/steps/assets/horizontal_line.svg +3 -0
- package/lib/steps/assets/vertical_line.svg +3 -0
- package/lib/steps/stepStyle/icon.less +51 -0
- package/lib/steps/stepStyle/progress-dot.less +10 -0
- package/lib/steps/stepStyle/variables.less +8 -0
- package/lib/steps/stepStyle/vertical.less +41 -0
- package/lib/style/mixins/iconfont.less +3 -2
- package/lib/style/themes/default.less +3 -2
- package/lib/switch/index.less +46 -0
- package/lib/table-container/index.d.ts +3 -0
- package/lib/table-container/index.d.ts.map +1 -0
- package/lib/table-container/index.js +21 -0
- package/lib/table-container/index.js.map +1 -0
- package/lib/table-container/index.less +12 -0
- package/lib/tabs/tabs.less +116 -0
- package/lib/tabs-container/index.d.ts +3 -0
- package/lib/tabs-container/index.d.ts.map +1 -0
- package/lib/tabs-container/index.js +21 -0
- package/lib/tabs-container/index.js.map +1 -0
- package/lib/tabs-container/index.less +51 -0
- package/lib/tag/color.less +43 -0
- package/lib/tag/tag.d.ts +41 -0
- package/lib/tag/tag.d.ts.map +1 -0
- package/lib/tag/tag.js +183 -0
- package/lib/tag/tag.js.map +1 -0
- package/lib/tag/tag.less +193 -0
- package/lib/time-picker/TimePicker.d.ts +9 -0
- package/lib/time-picker/TimePicker.d.ts.map +1 -0
- package/lib/time-picker/TimePicker.js +55 -0
- package/lib/time-picker/TimePicker.js.map +1 -0
- package/lib/time-picker/index.less +38 -0
- package/lib/time-picker/style/index.less +2 -1
- package/lib/timeline/style/index.less +1 -1
- package/lib/tntd-action/Action.d.ts +6 -0
- package/lib/tntd-action/Action.d.ts.map +1 -0
- package/lib/tntd-action/Action.js +86 -0
- package/lib/tntd-action/Action.js.map +1 -0
- package/lib/tntd-action/index.less +53 -0
- package/lib/tooltip/index.less +29 -0
- package/lib/tooltip/tooltip.d.ts +9 -0
- package/lib/tooltip/tooltip.d.ts.map +1 -0
- package/lib/tooltip/tooltip.js +53 -0
- package/lib/tooltip/tooltip.js.map +1 -0
- package/package.json +3 -3
- package/themes/default/variables.less +2 -0
- package/themes/default/variablesVar.less +2 -0
package/es/tag/tag.less
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
@import '../style/mixins/index';
|
|
2
|
+
@import './color.less';
|
|
3
|
+
@tag-prefix-cls: ~'@{ant-prefix}-tag';
|
|
4
|
+
// 默认
|
|
5
|
+
@tag-height: 20px;
|
|
6
|
+
@tag-small-size: 0 8px;
|
|
7
|
+
@tag-middle-size: 1px 10px;
|
|
8
|
+
@tag-large-size: 3px 12px;
|
|
9
|
+
|
|
10
|
+
// img tag
|
|
11
|
+
@tag-img-small-size: 1px 5px 1px 3px;
|
|
12
|
+
@tag-img-middle-size: 2px 6px 2px 3px;
|
|
13
|
+
@tag-img-large-size: 3px 12px 3px 4px;
|
|
14
|
+
|
|
15
|
+
// 只有icon的尺寸
|
|
16
|
+
@tag-only-icon-small-size: 5px;
|
|
17
|
+
@tag-only-icon-middle-size: 6px;
|
|
18
|
+
@tag-only-icon-large-size: 7px;
|
|
19
|
+
|
|
20
|
+
.tnt-tag.@{tag-prefix-cls} {
|
|
21
|
+
line-height: @tag-height;
|
|
22
|
+
|
|
23
|
+
.@{iconfont-css-prefix}-close {
|
|
24
|
+
.iconfont-size-under-12px(12px);
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.anticon{
|
|
30
|
+
font-size: @font-size-sm;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 头像插件 可以为icon 图片
|
|
34
|
+
.@{tag-prefix-cls}-addon-wrap{
|
|
35
|
+
display: inline-block;
|
|
36
|
+
vertical-align: middle;
|
|
37
|
+
margin-top: -1px;
|
|
38
|
+
.@{tag-prefix-cls}-addon{
|
|
39
|
+
.iconfont-size-under-12px(12px);
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tntd-ellipsis,.tnt-ellipsis{
|
|
46
|
+
align-items: center;
|
|
47
|
+
.@{tag-prefix-cls}-addon{
|
|
48
|
+
>*{
|
|
49
|
+
border-radius: 100%;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
+*{
|
|
54
|
+
margin-left: 4px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-small{
|
|
61
|
+
padding: @tag-small-size;
|
|
62
|
+
}
|
|
63
|
+
&-middle{
|
|
64
|
+
padding: @tag-middle-size;
|
|
65
|
+
}
|
|
66
|
+
&-large{
|
|
67
|
+
padding: @tag-large-size;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 不带边框
|
|
72
|
+
&.@{tag-prefix-cls}-no-border{
|
|
73
|
+
border-color:transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 只有一个icon
|
|
77
|
+
&.@{tag-prefix-cls}-only-child{
|
|
78
|
+
line-height: @font-size-sm;
|
|
79
|
+
&.@{tag-prefix-cls}-small{
|
|
80
|
+
padding: @tag-only-icon-small-size;
|
|
81
|
+
}
|
|
82
|
+
&.@{tag-prefix-cls}-middle{
|
|
83
|
+
padding: @tag-only-icon-middle-size;
|
|
84
|
+
}
|
|
85
|
+
&.@{tag-prefix-cls}-large{
|
|
86
|
+
padding: @tag-only-icon-large-size;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 带图片
|
|
91
|
+
&.@{tag-prefix-cls}-addon-img{
|
|
92
|
+
&.@{tag-prefix-cls}-small{
|
|
93
|
+
padding: @tag-img-small-size;
|
|
94
|
+
.@{tag-prefix-cls}-addon{
|
|
95
|
+
width: 16px;
|
|
96
|
+
height: 16px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
&.@{tag-prefix-cls}-middle{
|
|
100
|
+
padding: @tag-img-middle-size;
|
|
101
|
+
.@{tag-prefix-cls}-addon{
|
|
102
|
+
width: 18px;
|
|
103
|
+
height: 18px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
&.@{tag-prefix-cls}-large{
|
|
107
|
+
padding: @tag-img-large-size;
|
|
108
|
+
.@{tag-prefix-cls}-addon{
|
|
109
|
+
width: 20px;
|
|
110
|
+
height: 20px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// mixin to iterate over colors and create CSS class for each one
|
|
116
|
+
.make-color-classes(@i: length(@preset-colors-custom)) when (@i > 0) {
|
|
117
|
+
.make-color-classes(@i - 1);
|
|
118
|
+
@color: extract(@preset-colors-custom, @i);
|
|
119
|
+
@lightColor: '@{color}-1';
|
|
120
|
+
@lightBorderColor: '@{color}-4';
|
|
121
|
+
@darkColor: '@{color}-7';
|
|
122
|
+
&.@{tag-prefix-cls}-@{color} {
|
|
123
|
+
color: @@darkColor;
|
|
124
|
+
background: @@lightColor;
|
|
125
|
+
border-color: @@lightBorderColor;
|
|
126
|
+
>.@{iconfont-css-prefix}-close {
|
|
127
|
+
color: @@darkColor;//fade(@@darkColor,80%);
|
|
128
|
+
opacity: .8;
|
|
129
|
+
}
|
|
130
|
+
&.@{tag-prefix-cls}-no-border{
|
|
131
|
+
border-color:transparent;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
&.@{tag-prefix-cls}-@{color}-inverse {
|
|
135
|
+
color: @text-color-inverse;
|
|
136
|
+
background: @@darkColor;
|
|
137
|
+
border-color: @@darkColor;
|
|
138
|
+
|
|
139
|
+
&.@{tag-prefix-cls}-no-border{
|
|
140
|
+
border-color:transparent;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.make-color-classes();
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
// 可选
|
|
150
|
+
&.@{tag-prefix-cls}-checkable {
|
|
151
|
+
background-color: @tag-default-bg;
|
|
152
|
+
border-color: transparent;
|
|
153
|
+
padding: 2px 12px;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
&-border{
|
|
156
|
+
border-color: @border-color-base;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:active,
|
|
160
|
+
&-checked {
|
|
161
|
+
color: @primary-7;
|
|
162
|
+
background-color: @primary-1;
|
|
163
|
+
&.@{tag-prefix-cls}-checkable-border{
|
|
164
|
+
border-color: @primary-3;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&-checked {
|
|
169
|
+
&.@{tag-prefix-cls}-checkable-disabled:hover {
|
|
170
|
+
color: @primary-color;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:not(&-checked){
|
|
175
|
+
&.@{tag-prefix-cls}-checkable-disabled:hover {
|
|
176
|
+
color: inherit;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&-disabled{
|
|
181
|
+
opacity: 0.5;
|
|
182
|
+
cursor: not-allowed;
|
|
183
|
+
&:hover{
|
|
184
|
+
opacity: 0.5;
|
|
185
|
+
color: inherit;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import Icon from '../icon';
|
|
11
|
+
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
12
|
+
import AntTimePicker from 'antd/es/time-picker';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
export * from 'antd/es/time-picker';
|
|
15
|
+
const TimePicker = props => {
|
|
16
|
+
//theme样式类型 outline | fill 默认 outline
|
|
17
|
+
const {
|
|
18
|
+
theme = 'outline',
|
|
19
|
+
className,
|
|
20
|
+
suffixIcon
|
|
21
|
+
} = props,
|
|
22
|
+
restProps = __rest(props, ["theme", "className", "suffixIcon"]);
|
|
23
|
+
const defaultIcon = React.createElement(Icon, {
|
|
24
|
+
type: "clock-circle"
|
|
25
|
+
});
|
|
26
|
+
return React.createElement(ConfigConsumer, null, ({
|
|
27
|
+
getPrefixCls
|
|
28
|
+
}) => {
|
|
29
|
+
const prefixCls = getPrefixCls('time-picker');
|
|
30
|
+
return React.createElement(AntTimePicker, Object.assign({
|
|
31
|
+
suffixIcon: suffixIcon || defaultIcon,
|
|
32
|
+
className: classNames(className, `${prefixCls}-${theme}`)
|
|
33
|
+
}, restProps));
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
export default TimePicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AACvC,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,MAAM,UAAU,GAA2E,CACzF,KAAK,EACL,EAAE;IACF,sCAAsC;IACtC,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,SAAS,EAAE,UAAU,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAAlE,oCAA0D,CAAQ,CAAA;IACxE,MAAM,WAAW,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,GAAG,CAAA;IAEhD,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;QAC7C,OAAO,CACL,oBAAC,aAAa,kBACZ,UAAU,EAAE,UAAU,IAAI,WAAW,EACrC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,IACrD,SAAS,EACb,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport Icon from '../icon'\nimport type { TimePickerProps as AntdTimePickerProps } from 'antd/es/time-picker'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport AntTimePicker from 'antd/es/time-picker'\nimport classNames from 'classnames'\nexport * from 'antd/es/time-picker'\nconst TimePicker: React.FC<AntdTimePickerProps & { theme?: string; readonly?: boolean }> = (\n props\n) => {\n //theme样式类型 outline | fill 默认 outline\n const { theme = 'outline', className, suffixIcon, ...restProps } = props\n const defaultIcon = <Icon type=\"clock-circle\" />\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('time-picker')\n return (\n <AntTimePicker\n suffixIcon={suffixIcon || defaultIcon}\n className={classNames(className, `${prefixCls}-${theme}`)}\n {...restProps}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nexport default TimePicker\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@import '../style/themes/index';
|
|
2
|
+
|
|
3
|
+
@timepicker-prefix-cls: ~'@{ant-prefix}-time-picker';
|
|
4
|
+
.@{timepicker-prefix-cls} {
|
|
5
|
+
input{
|
|
6
|
+
border-color: @border-color-secondary;
|
|
7
|
+
}
|
|
8
|
+
&:has(input:not([value=''])),&:hover {
|
|
9
|
+
.@{timepicker-prefix-cls}-icon{
|
|
10
|
+
i{
|
|
11
|
+
color: @text-color-secondary;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
&:has(input[disabled]){
|
|
16
|
+
.@{timepicker-prefix-cls}-icon{
|
|
17
|
+
i{
|
|
18
|
+
color: @disabled-color;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
&-fill{
|
|
23
|
+
input {
|
|
24
|
+
background-color: @fill-color-quaternary;
|
|
25
|
+
border-color: @fill-color-quaternary;
|
|
26
|
+
&[disabled] {
|
|
27
|
+
border: none;
|
|
28
|
+
}
|
|
29
|
+
&:focus{
|
|
30
|
+
background-color: @white;
|
|
31
|
+
}
|
|
32
|
+
&:not([value='']):hover {
|
|
33
|
+
background-color: @white;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
10
|
+
import ReactDOM from 'react-dom';
|
|
11
|
+
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
12
|
+
import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { Button } from '../button';
|
|
15
|
+
const defaultGetContainer = () => document.body;
|
|
16
|
+
export default function WarpAction(_a) {
|
|
17
|
+
var {
|
|
18
|
+
getContainer = defaultGetContainer
|
|
19
|
+
} = _a,
|
|
20
|
+
other = __rest(_a, ["getContainer"]);
|
|
21
|
+
return React.createElement(ConfigConsumer, null, ({
|
|
22
|
+
getPrefixCls,
|
|
23
|
+
getPopupContainer: getContextPopupContainer
|
|
24
|
+
}) => {
|
|
25
|
+
const _getContainer = getContainer === undefined ? getContextPopupContainer : getContainer;
|
|
26
|
+
return React.createElement(LocaleReceiver, {
|
|
27
|
+
componentName: "TntdAction"
|
|
28
|
+
}, locale => {
|
|
29
|
+
return React.createElement(Action, Object.assign({}, other, {
|
|
30
|
+
locale: locale,
|
|
31
|
+
getContainer: _getContainer
|
|
32
|
+
}));
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function Action({
|
|
37
|
+
title,
|
|
38
|
+
data,
|
|
39
|
+
locale,
|
|
40
|
+
className,
|
|
41
|
+
getContainer
|
|
42
|
+
}) {
|
|
43
|
+
const [visible, setVisible] = useState(false);
|
|
44
|
+
const ref = useRef();
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
ref.current = getContainer();
|
|
47
|
+
}, [getContainer]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
setVisible(data.length > 0);
|
|
50
|
+
}, [data]);
|
|
51
|
+
if (ref.current && visible) {
|
|
52
|
+
return ReactDOM.createPortal(React.createElement("div", {
|
|
53
|
+
className: classNames('tnt-action', className)
|
|
54
|
+
}, React.createElement("div", {
|
|
55
|
+
className: "fr"
|
|
56
|
+
}, data), React.createElement(Button, {
|
|
57
|
+
shape: "circle",
|
|
58
|
+
icon: "close",
|
|
59
|
+
type: "tertiary",
|
|
60
|
+
onClick: () => setVisible(false)
|
|
61
|
+
}), React.createElement("span", {
|
|
62
|
+
className: "tnt-action-text"
|
|
63
|
+
}, title)), ref.current);
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../src/tntd-action/Action.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,cAAc,MAAM,wCAAwC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAA;AAE/C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAgD;QAAhD,EAAE,YAAY,GAAG,mBAAmB,OAAY,EAAP,KAAK,cAA9C,gBAAgD,CAAF;IAC/E,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,EAAE,EAAE;QACjE,MAAM,aAAa,GAAG,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,YAAY,CAAA;QAE1F,OAAO,CACL,oBAAC,cAAc,IAAC,aAAa,EAAC,YAAY,IACvC,CAAC,MAAM,EAAE,EAAE;YACV,OAAO,oBAAC,MAAM,oBAAK,KAAK,IAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,IAAI,CAAA;QAC3E,CAAC,CACc,CAClB,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE;IAC9D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,GAAG,GAAG,MAAM,EAAE,CAAA;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,GAAG,CAAC,OAAO,GAAG,YAAY,EAAE,CAAA;IAC9B,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAElB,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC7B,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,IAAI,GAAG,CAAC,OAAO,IAAI,OAAO,EAAE;QAC1B,OAAO,QAAQ,CAAC,YAAY,CAC1B,6BAAK,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC;YACjD,6BAAK,SAAS,EAAC,IAAI,IAAE,IAAI,CAAO;YAChC,oBAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAI;YACxF,8BAAM,SAAS,EAAC,iBAAiB,IAAE,KAAK,CAAQ,CAC5C,EACN,GAAG,CAAC,OAAO,CACZ,CAAA;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\nimport ReactDOM from 'react-dom'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\nimport classNames from 'classnames'\nimport { Button } from '../button'\n\nconst defaultGetContainer = () => document.body\n\nexport default function WarpAction({ getContainer = defaultGetContainer, ...other }) {\n return (\n <ConfigConsumer>\n {({ getPrefixCls, getPopupContainer: getContextPopupContainer }) => {\n const _getContainer = getContainer === undefined ? getContextPopupContainer : getContainer\n\n return (\n <LocaleReceiver componentName=\"TntdAction\">\n {(locale) => {\n return <Action {...other} locale={locale} getContainer={_getContainer} />\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n )\n}\n\nfunction Action({ title, data, locale, className, getContainer }) {\n const [visible, setVisible] = useState(false)\n const ref = useRef()\n\n useEffect(() => {\n ref.current = getContainer()\n }, [getContainer])\n\n useEffect(() => {\n setVisible(data.length > 0)\n }, [data])\n\n if (ref.current && visible) {\n return ReactDOM.createPortal(\n <div className={classNames('tnt-action', className)}>\n <div className=\"fr\">{data}</div>\n <Button shape=\"circle\" icon=\"close\" type=\"tertiary\" onClick={() => setVisible(false)} />\n <span className=\"tnt-action-text\">{title}</span>\n </div>,\n ref.current\n )\n }\n return null\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.tnt-action {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 100px;
|
|
4
|
+
width: @tnt-action-width;
|
|
5
|
+
left: calc(50vw - @tnt-action-width / 2);
|
|
6
|
+
padding: 10px 16px;
|
|
7
|
+
background-color: @text-color;
|
|
8
|
+
border-radius: @border-radius-base;
|
|
9
|
+
z-index: 200;
|
|
10
|
+
&-text {
|
|
11
|
+
color: @white;
|
|
12
|
+
margin-left: 20px;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
.num {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
width: 16px;
|
|
17
|
+
height: 16px;
|
|
18
|
+
background: #454f64;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
font-size: 10px;
|
|
21
|
+
margin-right: 4px;
|
|
22
|
+
vertical-align: text-bottom;
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
> .tnt-btn-tertiary {
|
|
27
|
+
opacity: 0.5;
|
|
28
|
+
background: #454f64;
|
|
29
|
+
color: @white;
|
|
30
|
+
border-width: 0;
|
|
31
|
+
width: @tnt-action-close-width;
|
|
32
|
+
height: @tnt-action-close-width;
|
|
33
|
+
min-width: @tnt-action-close-width;
|
|
34
|
+
line-height: @tnt-action-close-width;
|
|
35
|
+
margin-top: 4px;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
&:hover {
|
|
38
|
+
opacity: 0.8;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.fr {
|
|
42
|
+
float: right;
|
|
43
|
+
.ant-btn {
|
|
44
|
+
margin-left: 10px;
|
|
45
|
+
background: rgba(69, 79, 100, 0.5);
|
|
46
|
+
color: @white;
|
|
47
|
+
border-width: 0;
|
|
48
|
+
&:hover {
|
|
49
|
+
background: rgba(69, 79, 100, 0.8);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@tooltip-prefix-cls: ~'@{ant-prefix}-tooltip';
|
|
2
|
+
|
|
3
|
+
// Base class
|
|
4
|
+
.tnt-tooltip.@{tooltip-prefix-cls} {
|
|
5
|
+
|
|
6
|
+
&-light {
|
|
7
|
+
.@{tooltip-prefix-cls}-inner {
|
|
8
|
+
background-color: @tooltip-bg-light;
|
|
9
|
+
color: @tooltip-color-light;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.@{tooltip-prefix-cls}-arrow {
|
|
13
|
+
&::before {
|
|
14
|
+
background-color: @tooltip-bg-light;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Arrows
|
|
20
|
+
&-arrow {
|
|
21
|
+
border-radius: 1px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.@{tooltip-prefix-cls}-arrow-hidden {
|
|
26
|
+
.@{tooltip-prefix-cls}-arrow {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
11
|
+
import AntdTooltip from 'antd/es/tooltip';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
export * from 'antd/es/tooltip';
|
|
14
|
+
const themeMap = (prefixCls, themeColor) => {
|
|
15
|
+
return `${prefixCls}-${themeColor}`;
|
|
16
|
+
};
|
|
17
|
+
const Tooltip = props => {
|
|
18
|
+
const {
|
|
19
|
+
overlayClassName,
|
|
20
|
+
theme = '',
|
|
21
|
+
hiddenArrow = false
|
|
22
|
+
} = props,
|
|
23
|
+
restProps = __rest(props, ["overlayClassName", "theme", "hiddenArrow"]);
|
|
24
|
+
return React.createElement(ConfigConsumer, null, ({
|
|
25
|
+
getPrefixCls
|
|
26
|
+
}) => {
|
|
27
|
+
const prefixCls = getPrefixCls('tooltip');
|
|
28
|
+
return React.createElement(AntdTooltip, Object.assign({
|
|
29
|
+
overlayClassName: classNames(prefixCls, 'tnt-tooltip', themeMap(prefixCls, theme), hiddenArrow ? prefixCls + '-arrow-hidden' : '', overlayClassName)
|
|
30
|
+
}, restProps));
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export default Tooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,WAAW,MAAM,iBAAiB,CAAA;AACzC,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,cAAc,iBAAiB,CAAA;AAC/B,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,UAAkB,EAAE,EAAE;IACzD,OAAO,GAAG,SAAS,IAAI,UAAU,EAAE,CAAA;AACrC,CAAC,CAAA;AAED,MAAM,OAAO,GAAuE,CAAC,KAAK,EAAE,EAAE;IAC5F,MAAM,EAAE,gBAAgB,EAAE,KAAK,GAAG,EAAE,EAAE,WAAW,GAAG,KAAK,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAA3E,4CAAmE,CAAQ,CAAA;IAEjF,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;QAEzC,OAAO,CACL,oBAAC,WAAW,kBACV,gBAAgB,EAAE,UAAU,CAC1B,SAAS,EACT,aAAa,EACb,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,EAC1B,WAAW,CAAC,CAAC,CAAC,SAAS,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,EAC9C,gBAAgB,CACjB,IACG,SAAS,EACb,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,OAAO,CAAA","sourcesContent":["import React from 'react'\nimport type { TooltipProps } from 'antd/es/tooltip'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport AntdTooltip from 'antd/es/tooltip'\nimport classNames from 'classnames'\n\nexport * from 'antd/es/tooltip'\nconst themeMap = (prefixCls: string, themeColor: string) => {\n return `${prefixCls}-${themeColor}`\n}\n\nconst Tooltip: React.FC<TooltipProps & { theme?: string; hiddenArrow?: boolean }> = (props) => {\n const { overlayClassName, theme = '', hiddenArrow = false, ...restProps } = props\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tooltip')\n\n return (\n <AntdTooltip\n overlayClassName={classNames(\n prefixCls,\n 'tnt-tooltip',\n themeMap(prefixCls, theme),\n hiddenArrow ? prefixCls + '-arrow-hidden' : '',\n overlayClassName\n )}\n {...restProps}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nexport default Tooltip\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AlertProps as AntdAlertProps } from 'antd/lib/alert';
|
|
3
|
+
import { default as AntdAlert } from 'antd/lib/alert';
|
|
4
|
+
export * from 'antd/lib/alert';
|
|
5
|
+
export interface AlertProps extends AntdAlertProps {
|
|
6
|
+
action: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
interface AlertComponent extends React.ForwardRefExoticComponent<AntdAlertProps & React.RefAttributes<AntdAlert>> {
|
|
9
|
+
}
|
|
10
|
+
export declare const Alert: AlertComponent;
|
|
11
|
+
export default Alert;
|
|
12
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/alert/alert.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAIjE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,eAAe,CAAA;AAEpD,cAAc,eAAe,CAAA;AAE7B,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;CACxB;AAED,UAAU,cACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;CAAG;AAI7F,eAAO,MAAM,KAAK,gBAiDE,CAAA;AAEpB,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Alert: true
|
|
8
|
+
};
|
|
9
|
+
exports["default"] = exports.Alert = void 0;
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _icon = _interopRequireDefault(require("antd/lib/icon"));
|
|
12
|
+
var _configProvider = require("antd/lib/config-provider");
|
|
13
|
+
var _alert = _interopRequireWildcard(require("antd/lib/alert"));
|
|
14
|
+
Object.keys(_alert).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
+
if (key in exports && exports[key] === _alert[key]) return;
|
|
18
|
+
Object.defineProperty(exports, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _alert[key];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
29
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
30
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
32
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
34
|
+
var t = {};
|
|
35
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
};
|
|
41
|
+
/*
|
|
42
|
+
* @Author: 周泽飞 zefei.zhou@tongdun.net
|
|
43
|
+
* @Date: 2024-03-21 19:43:36
|
|
44
|
+
* @LastEditors: 周泽飞 zefei.zhou@tongdun.net
|
|
45
|
+
* @LastEditTime: 2024-03-21 19:46:23
|
|
46
|
+
* @FilePath: /tntd/packages/tntd/src/alert/alert.tsx
|
|
47
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
var prefix = 'tnt-alert';
|
|
51
|
+
var Alert = exports.Alert = (0, _react.forwardRef)(function (_a, ref) {
|
|
52
|
+
var action = _a.action,
|
|
53
|
+
message = _a.message,
|
|
54
|
+
rest = __rest(_a, ["action", "message"]);
|
|
55
|
+
var fragment = _react["default"].createElement(_react["default"].Fragment, null, message, !!action && _react["default"].createElement("span", {
|
|
56
|
+
className: "action-btn"
|
|
57
|
+
}, action));
|
|
58
|
+
var iconTheme = 'filled';
|
|
59
|
+
var iconType = 'default';
|
|
60
|
+
switch (rest === null || rest === void 0 ? void 0 : rest.type) {
|
|
61
|
+
case 'success':
|
|
62
|
+
iconType = 'check-circle';
|
|
63
|
+
break;
|
|
64
|
+
case 'info':
|
|
65
|
+
iconType = 'info-circle';
|
|
66
|
+
break;
|
|
67
|
+
case 'error':
|
|
68
|
+
iconType = 'close-circle';
|
|
69
|
+
break;
|
|
70
|
+
case 'warning':
|
|
71
|
+
iconType = 'exclamation-circle';
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
iconType = 'default';
|
|
75
|
+
}
|
|
76
|
+
var iconNode = rest.type ? _react["default"].createElement(_icon["default"], {
|
|
77
|
+
className: "".concat(prefix, "-icon"),
|
|
78
|
+
type: iconType,
|
|
79
|
+
theme: iconTheme
|
|
80
|
+
}) : null;
|
|
81
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref) {
|
|
82
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
83
|
+
return _react["default"].createElement(_alert["default"], Object.assign({
|
|
84
|
+
ref: ref
|
|
85
|
+
}, rest, {
|
|
86
|
+
message: fragment,
|
|
87
|
+
icon: iconNode,
|
|
88
|
+
className: (0, _classnames["default"])(rest === null || rest === void 0 ? void 0 : rest.className, 'tnt-alert', _defineProperty({}, "".concat(prefix, "-with-action"), action))
|
|
89
|
+
}));
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
var _default = exports["default"] = Alert;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../src/alert/alert.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAyC;AAGzC,wDAA+B;AAC/B,6DAAwD;AACxD,0DAAoD;AACpD,4DAAkC;AAClC,gDAA6B;AAS7B,MAAM,MAAM,GAAG,WAAW,CAAA;AAEb,QAAA,KAAK,GAAG,IAAA,kBAAU,EAAwB,CAAC,EAA4B,EAAE,GAAG,EAAE,EAAE;QAArC,EAAE,MAAM,EAAE,OAAO,OAAW,EAAN,IAAI,cAA1B,qBAA4B,CAAF;IAChF,MAAM,QAAQ,GAAG,CACf;QACG,OAAO;QACP,CAAC,CAAC,MAAM,IAAI,wCAAM,SAAS,EAAC,YAAY,IAAE,MAAM,CAAQ,CACxD,CACJ,CAAA;IAED,MAAM,SAAS,GAAc,QAAQ,CAAA;IACrC,IAAI,QAAQ,GAAG,SAAS,CAAA;IAExB,QAAQ,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,EAAE;QAClB,KAAK,SAAS;YACZ,QAAQ,GAAG,cAAc,CAAA;YACzB,MAAK;QACP,KAAK,MAAM;YACT,QAAQ,GAAG,aAAa,CAAA;YACxB,MAAK;QACP,KAAK,OAAO;YACV,QAAQ,GAAG,cAAc,CAAA;YACzB,MAAK;QACP,KAAK,SAAS;YACZ,QAAQ,GAAG,oBAAoB,CAAA;YAC/B,MAAK;QACP;YACE,QAAQ,GAAG,SAAS,CAAA;KACvB;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3B,8BAAC,cAAI,IAAC,SAAS,EAAE,GAAG,MAAM,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAI,CACxE,CAAC,CAAC,CAAC,IAAI,CAAA;IAER,OAAO,CACL,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,OAAO,CACL,8BAAC,eAAS,kBACR,GAAG,EAAE,GAAG,IACJ,IAAI,IACR,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,IAAA,oBAAS,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,EAAE,WAAW,EAAE;gBACjD,CAAC,GAAG,MAAM,cAAc,CAAC,EAAE,MAAM;aAClC,CAAC,IACF,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAmB,CAAA;AAEpB,kBAAe,aAAK,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-03-21 19:43:36\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-03-21 19:46:23\n * @FilePath: /tntd/packages/tntd/src/alert/alert.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { forwardRef } from 'react'\nimport type { AlertProps as AntdAlertProps } from 'antd/lib/alert'\nimport type { ThemeType } from 'antd/lib/icon'\nimport Icon from 'antd/lib/icon'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport { default as AntdAlert } from 'antd/lib/alert'\nimport classname from 'classnames'\nexport * from 'antd/lib/alert'\n\nexport interface AlertProps extends AntdAlertProps {\n action: React.ReactNode\n}\n\ninterface AlertComponent\n extends React.ForwardRefExoticComponent<AntdAlertProps & React.RefAttributes<AntdAlert>> {}\n\nconst prefix = 'tnt-alert'\n\nexport const Alert = forwardRef<AntdAlert, AlertProps>(({ action, message, ...rest }, ref) => {\n const fragment = (\n <>\n {message}\n {!!action && <span className=\"action-btn\">{action}</span>}\n </>\n )\n\n const iconTheme: ThemeType = 'filled'\n let iconType = 'default'\n\n switch (rest?.type) {\n case 'success':\n iconType = 'check-circle'\n break\n case 'info':\n iconType = 'info-circle'\n break\n case 'error':\n iconType = 'close-circle'\n break\n case 'warning':\n iconType = 'exclamation-circle'\n break\n default:\n iconType = 'default'\n }\n\n const iconNode = rest.type ? (\n <Icon className={`${prefix}-icon`} type={iconType} theme={iconTheme} />\n ) : null\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n return (\n <AntdAlert\n ref={ref}\n {...rest}\n message={fragment}\n icon={iconNode}\n className={classname(rest?.className, 'tnt-alert', {\n [`${prefix}-with-action`]: action,\n })}\n />\n )\n }}\n </ConfigConsumer>\n )\n}) as AlertComponent\n\nexport default Alert\n"]}
|