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.
Files changed (281) hide show
  1. package/es/alert/alert.js +70 -0
  2. package/es/alert/alert.js.map +1 -0
  3. package/es/alert/alert.less +128 -0
  4. package/es/breadcrumb/style/index.less +2 -1
  5. package/es/button/button.less +72 -0
  6. package/es/cascader/style/index.less +2 -2
  7. package/es/checkbox/check.png +0 -0
  8. package/es/checkbox/checkbox.js +48 -0
  9. package/es/checkbox/checkbox.js.map +1 -0
  10. package/es/checkbox/checkbox.less +69 -0
  11. package/es/collapse/style/index.less +2 -1
  12. package/es/color-picker/index.less +4 -1
  13. package/es/date-picker/DatePicker.js +101 -0
  14. package/es/date-picker/DatePicker.js.map +1 -0
  15. package/es/date-picker/index.less +294 -0
  16. package/es/date-picker/style/Picker.less +2 -1
  17. package/es/drawer/index.less +154 -0
  18. package/es/drawer/style/drawer.less +4 -2
  19. package/es/dropdown/style/index.less +2 -1
  20. package/es/form/form.less +36 -0
  21. package/es/grid/RowContext.js +3 -0
  22. package/es/grid/RowContext.js.map +1 -0
  23. package/es/grid/col.js +103 -0
  24. package/es/grid/col.js.map +1 -0
  25. package/es/grid/hooks/useBreakpoint.js +18 -0
  26. package/es/grid/hooks/useBreakpoint.js.map +1 -0
  27. package/es/grid/row.js +154 -0
  28. package/es/grid/row.js.map +1 -0
  29. package/es/grid/style/rtl.less +69 -0
  30. package/es/icon/index.js +2 -1
  31. package/es/icon/index.js.map +1 -1
  32. package/es/icon/style/index.js +2 -1
  33. package/es/icon/style/index.js.map +1 -1
  34. package/es/icon/style/style.less +6 -0
  35. package/es/index.js +2 -0
  36. package/es/index.js.map +1 -1
  37. package/es/input/style/mixin.less +1 -1
  38. package/es/input-number/inputNumber.js +29 -0
  39. package/es/input-number/inputNumber.js.map +1 -0
  40. package/es/input-number/inputNumber.less +12 -0
  41. package/es/modal/index.less +36 -0
  42. package/es/modal/style/confirm.less +1 -1
  43. package/es/modal/style/modal.less +5 -1
  44. package/es/notification/assets/index.js +2 -0
  45. package/es/notification/assets/index.js.map +1 -0
  46. package/es/notification/assets/svg-error-tip.js +145 -0
  47. package/es/notification/assets/svg-error-tip.js.map +1 -0
  48. package/es/notification/assets/svg-success-tip.js +162 -0
  49. package/es/notification/assets/svg-success-tip.js.map +1 -0
  50. package/es/notification/notification.js +80 -0
  51. package/es/notification/notification.js.map +1 -0
  52. package/es/notification/notification.less +59 -0
  53. package/es/notification/style/index.less +4 -2
  54. package/es/popconfirm/index.less +32 -0
  55. package/es/popconfirm/popconfirm.js +43 -0
  56. package/es/popconfirm/popconfirm.js.map +1 -0
  57. package/es/popover/index.less +57 -0
  58. package/es/popover/popover.js +34 -0
  59. package/es/popover/popover.js.map +1 -0
  60. package/es/popover/style/index.less +2 -1
  61. package/es/progress/progress.js +132 -0
  62. package/es/progress/progress.js.map +1 -0
  63. package/es/progress/progress.less +82 -0
  64. package/es/query-form/Field/Composition/FieldPopover.js +284 -0
  65. package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
  66. package/es/query-form/Field/Composition/FieldPopover.less +35 -0
  67. package/es/query-form/Field/Composition/Select.js +108 -0
  68. package/es/query-form/Field/Composition/Select.js.map +1 -0
  69. package/es/query-form/Field/Composition/index.js +275 -0
  70. package/es/query-form/Field/Composition/index.js.map +1 -0
  71. package/es/query-form/Field/Composition/index.less +106 -0
  72. package/es/query-form/Field/Composition/utils.js +19 -0
  73. package/es/query-form/Field/Composition/utils.js.map +1 -0
  74. package/es/radio/radio.js +57 -0
  75. package/es/radio/radio.js.map +1 -0
  76. package/es/radio/radio.less +43 -0
  77. package/es/select/style/index.less +2 -1
  78. package/es/steps/assets/background_left.svg +12 -0
  79. package/es/steps/assets/background_right.svg +12 -0
  80. package/es/steps/assets/horizontal_line.svg +3 -0
  81. package/es/steps/assets/vertical_line.svg +3 -0
  82. package/es/steps/stepStyle/icon.less +51 -0
  83. package/es/steps/stepStyle/progress-dot.less +10 -0
  84. package/es/steps/stepStyle/variables.less +8 -0
  85. package/es/steps/stepStyle/vertical.less +41 -0
  86. package/es/style/mixins/iconfont.less +3 -2
  87. package/es/style/themes/default.less +3 -2
  88. package/es/switch/index.less +46 -0
  89. package/es/table-container/index.js +12 -0
  90. package/es/table-container/index.js.map +1 -0
  91. package/es/table-container/index.less +12 -0
  92. package/es/tabs/tabs.less +116 -0
  93. package/es/tabs-container/index.js +12 -0
  94. package/es/tabs-container/index.js.map +1 -0
  95. package/es/tabs-container/index.less +51 -0
  96. package/es/tag/color.less +43 -0
  97. package/es/tag/tag.js +171 -0
  98. package/es/tag/tag.js.map +1 -0
  99. package/es/tag/tag.less +193 -0
  100. package/es/time-picker/TimePicker.js +36 -0
  101. package/es/time-picker/TimePicker.js.map +1 -0
  102. package/es/time-picker/index.less +38 -0
  103. package/es/time-picker/style/index.less +2 -1
  104. package/es/timeline/style/index.less +1 -1
  105. package/es/tntd-action/Action.js +66 -0
  106. package/es/tntd-action/Action.js.map +1 -0
  107. package/es/tntd-action/index.less +53 -0
  108. package/es/tooltip/index.less +29 -0
  109. package/es/tooltip/tooltip.js +33 -0
  110. package/es/tooltip/tooltip.js.map +1 -0
  111. package/lib/alert/alert.d.ts +12 -0
  112. package/lib/alert/alert.d.ts.map +1 -0
  113. package/lib/alert/alert.js +92 -0
  114. package/lib/alert/alert.js.map +1 -0
  115. package/lib/alert/alert.less +128 -0
  116. package/lib/breadcrumb/style/index.less +2 -1
  117. package/lib/button/button.less +72 -0
  118. package/lib/cascader/style/index.less +2 -2
  119. package/lib/checkbox/check.png +0 -0
  120. package/lib/checkbox/checkbox.d.ts +16 -0
  121. package/lib/checkbox/checkbox.d.ts.map +1 -0
  122. package/lib/checkbox/checkbox.js +65 -0
  123. package/lib/checkbox/checkbox.js.map +1 -0
  124. package/lib/checkbox/checkbox.less +69 -0
  125. package/lib/collapse/style/index.less +2 -1
  126. package/lib/color-picker/index.less +4 -1
  127. package/lib/date-picker/DatePicker.d.ts +21 -0
  128. package/lib/date-picker/DatePicker.d.ts.map +1 -0
  129. package/lib/date-picker/DatePicker.js +128 -0
  130. package/lib/date-picker/DatePicker.js.map +1 -0
  131. package/lib/date-picker/index.less +294 -0
  132. package/lib/date-picker/style/Picker.less +2 -1
  133. package/lib/drawer/index.less +154 -0
  134. package/lib/drawer/style/drawer.less +4 -2
  135. package/lib/dropdown/style/index.less +2 -1
  136. package/lib/form/form.less +36 -0
  137. package/lib/grid/RowContext.d.ts +9 -0
  138. package/lib/grid/RowContext.d.ts.map +1 -0
  139. package/lib/grid/RowContext.js +9 -0
  140. package/lib/grid/RowContext.js.map +1 -0
  141. package/lib/grid/col.d.ts +29 -0
  142. package/lib/grid/col.d.ts.map +1 -0
  143. package/lib/grid/col.js +100 -0
  144. package/lib/grid/col.js.map +1 -0
  145. package/lib/grid/hooks/useBreakpoint.d.ts +4 -0
  146. package/lib/grid/hooks/useBreakpoint.d.ts.map +1 -0
  147. package/lib/grid/hooks/useBreakpoint.js +28 -0
  148. package/lib/grid/hooks/useBreakpoint.js.map +1 -0
  149. package/lib/grid/row.d.ts +21 -0
  150. package/lib/grid/row.d.ts.map +1 -0
  151. package/lib/grid/row.js +183 -0
  152. package/lib/grid/row.js.map +1 -0
  153. package/lib/grid/style/rtl.less +69 -0
  154. package/lib/icon/index.d.ts +1 -0
  155. package/lib/icon/index.d.ts.map +1 -1
  156. package/lib/icon/index.js +2 -1
  157. package/lib/icon/index.js.map +1 -1
  158. package/lib/icon/style/index.d.ts +1 -0
  159. package/lib/icon/style/index.d.ts.map +1 -1
  160. package/lib/icon/style/index.js +2 -1
  161. package/lib/icon/style/index.js.map +1 -1
  162. package/lib/icon/style/style.less +6 -0
  163. package/lib/index.d.ts +2 -0
  164. package/lib/index.d.ts.map +1 -1
  165. package/lib/index.js +14 -0
  166. package/lib/index.js.map +1 -1
  167. package/lib/input/style/mixin.less +1 -1
  168. package/lib/input-number/inputNumber.d.ts +10 -0
  169. package/lib/input-number/inputNumber.d.ts.map +1 -0
  170. package/lib/input-number/inputNumber.js +48 -0
  171. package/lib/input-number/inputNumber.js.map +1 -0
  172. package/lib/input-number/inputNumber.less +12 -0
  173. package/lib/modal/index.less +36 -0
  174. package/lib/modal/style/confirm.less +1 -1
  175. package/lib/modal/style/modal.less +5 -1
  176. package/lib/notification/assets/index.d.ts +3 -0
  177. package/lib/notification/assets/index.d.ts.map +1 -0
  178. package/lib/notification/assets/index.js +20 -0
  179. package/lib/notification/assets/index.js.map +1 -0
  180. package/lib/notification/assets/svg-error-tip.d.ts +4 -0
  181. package/lib/notification/assets/svg-error-tip.d.ts.map +1 -0
  182. package/lib/notification/assets/svg-error-tip.js +154 -0
  183. package/lib/notification/assets/svg-error-tip.js.map +1 -0
  184. package/lib/notification/assets/svg-success-tip.d.ts +4 -0
  185. package/lib/notification/assets/svg-success-tip.d.ts.map +1 -0
  186. package/lib/notification/assets/svg-success-tip.js +171 -0
  187. package/lib/notification/assets/svg-success-tip.js.map +1 -0
  188. package/lib/notification/notification.d.ts +9 -0
  189. package/lib/notification/notification.d.ts.map +1 -0
  190. package/lib/notification/notification.js +105 -0
  191. package/lib/notification/notification.js.map +1 -0
  192. package/lib/notification/notification.less +59 -0
  193. package/lib/notification/style/index.less +4 -2
  194. package/lib/popconfirm/index.less +32 -0
  195. package/lib/popconfirm/popconfirm.d.ts +8 -0
  196. package/lib/popconfirm/popconfirm.d.ts.map +1 -0
  197. package/lib/popconfirm/popconfirm.js +61 -0
  198. package/lib/popconfirm/popconfirm.js.map +1 -0
  199. package/lib/popover/index.less +57 -0
  200. package/lib/popover/popover.d.ts +14 -0
  201. package/lib/popover/popover.d.ts.map +1 -0
  202. package/lib/popover/popover.js +55 -0
  203. package/lib/popover/popover.js.map +1 -0
  204. package/lib/popover/style/index.less +2 -1
  205. package/lib/progress/progress.d.ts +12 -0
  206. package/lib/progress/progress.d.ts.map +1 -0
  207. package/lib/progress/progress.js +148 -0
  208. package/lib/progress/progress.js.map +1 -0
  209. package/lib/progress/progress.less +82 -0
  210. package/lib/query-form/Field/Composition/FieldPopover.d.ts +17 -0
  211. package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
  212. package/lib/query-form/Field/Composition/FieldPopover.js +319 -0
  213. package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
  214. package/lib/query-form/Field/Composition/FieldPopover.less +35 -0
  215. package/lib/query-form/Field/Composition/Select.d.ts +4 -0
  216. package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
  217. package/lib/query-form/Field/Composition/Select.js +132 -0
  218. package/lib/query-form/Field/Composition/Select.js.map +1 -0
  219. package/lib/query-form/Field/Composition/index.d.ts +14 -0
  220. package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
  221. package/lib/query-form/Field/Composition/index.js +330 -0
  222. package/lib/query-form/Field/Composition/index.js.map +1 -0
  223. package/lib/query-form/Field/Composition/index.less +106 -0
  224. package/lib/query-form/Field/Composition/utils.d.ts +6 -0
  225. package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
  226. package/lib/query-form/Field/Composition/utils.js +27 -0
  227. package/lib/query-form/Field/Composition/utils.js.map +1 -0
  228. package/lib/radio/radio.d.ts +17 -0
  229. package/lib/radio/radio.d.ts.map +1 -0
  230. package/lib/radio/radio.js +75 -0
  231. package/lib/radio/radio.js.map +1 -0
  232. package/lib/radio/radio.less +43 -0
  233. package/lib/select/style/index.less +2 -1
  234. package/lib/steps/assets/background_left.svg +12 -0
  235. package/lib/steps/assets/background_right.svg +12 -0
  236. package/lib/steps/assets/horizontal_line.svg +3 -0
  237. package/lib/steps/assets/vertical_line.svg +3 -0
  238. package/lib/steps/stepStyle/icon.less +51 -0
  239. package/lib/steps/stepStyle/progress-dot.less +10 -0
  240. package/lib/steps/stepStyle/variables.less +8 -0
  241. package/lib/steps/stepStyle/vertical.less +41 -0
  242. package/lib/style/mixins/iconfont.less +3 -2
  243. package/lib/style/themes/default.less +3 -2
  244. package/lib/switch/index.less +46 -0
  245. package/lib/table-container/index.d.ts +3 -0
  246. package/lib/table-container/index.d.ts.map +1 -0
  247. package/lib/table-container/index.js +21 -0
  248. package/lib/table-container/index.js.map +1 -0
  249. package/lib/table-container/index.less +12 -0
  250. package/lib/tabs/tabs.less +116 -0
  251. package/lib/tabs-container/index.d.ts +3 -0
  252. package/lib/tabs-container/index.d.ts.map +1 -0
  253. package/lib/tabs-container/index.js +21 -0
  254. package/lib/tabs-container/index.js.map +1 -0
  255. package/lib/tabs-container/index.less +51 -0
  256. package/lib/tag/color.less +43 -0
  257. package/lib/tag/tag.d.ts +41 -0
  258. package/lib/tag/tag.d.ts.map +1 -0
  259. package/lib/tag/tag.js +183 -0
  260. package/lib/tag/tag.js.map +1 -0
  261. package/lib/tag/tag.less +193 -0
  262. package/lib/time-picker/TimePicker.d.ts +9 -0
  263. package/lib/time-picker/TimePicker.d.ts.map +1 -0
  264. package/lib/time-picker/TimePicker.js +55 -0
  265. package/lib/time-picker/TimePicker.js.map +1 -0
  266. package/lib/time-picker/index.less +38 -0
  267. package/lib/time-picker/style/index.less +2 -1
  268. package/lib/timeline/style/index.less +1 -1
  269. package/lib/tntd-action/Action.d.ts +6 -0
  270. package/lib/tntd-action/Action.d.ts.map +1 -0
  271. package/lib/tntd-action/Action.js +86 -0
  272. package/lib/tntd-action/Action.js.map +1 -0
  273. package/lib/tntd-action/index.less +53 -0
  274. package/lib/tooltip/index.less +29 -0
  275. package/lib/tooltip/tooltip.d.ts +9 -0
  276. package/lib/tooltip/tooltip.d.ts.map +1 -0
  277. package/lib/tooltip/tooltip.js +53 -0
  278. package/lib/tooltip/tooltip.js.map +1 -0
  279. package/package.json +3 -3
  280. package/themes/default/variables.less +2 -0
  281. package/themes/default/variablesVar.less +2 -0
@@ -0,0 +1,294 @@
1
+ @import '../style/themes/index';
2
+
3
+ @datepicker-prefix-cls: ~'@{ant-prefix}-date-picker';
4
+ @calendar-prefix-cls: ~'@{ant-prefix}-calendar';
5
+ @calendar-timepicker-prefix-cls: ~'@{ant-prefix}-calendar-time-picker';
6
+
7
+ .@{calendar-prefix-cls}-picker-container{
8
+ .@{calendar-prefix-cls}{
9
+ margin-top: 42px;
10
+ .@{calendar-prefix-cls}-input-wrap{
11
+ display: none;
12
+ }
13
+ }
14
+ .@{calendar-prefix-cls}-range{
15
+ margin-top: 42px;
16
+ .@{calendar-prefix-cls}-input-wrap,.@{calendar-prefix-cls}-range-middle{
17
+ display: none;
18
+ }
19
+ .@{calendar-prefix-cls}-decade-panel,.@{calendar-prefix-cls}-year-panel,.@{calendar-prefix-cls}-month-panel{
20
+ top: 0
21
+ }
22
+ }
23
+ .@{calendar-prefix-cls}-month-calendar,.@{calendar-prefix-cls}-week-number{
24
+ margin-top: 42px;
25
+ }
26
+ //.@{calendar-prefix-cls}-today .@{calendar-prefix-cls}-date{
27
+ // background-color: @white;
28
+ //}
29
+ .@{calendar-prefix-cls}:not(.@{calendar-prefix-cls}-range){
30
+ .@{calendar-prefix-cls}-selected-date .@{calendar-prefix-cls}-date{
31
+ background-color: @blue-6;
32
+ color: @white;
33
+ }
34
+ }
35
+
36
+ }
37
+ //Picker
38
+ .@{calendar-prefix-cls}-picker{
39
+ input,.@{calendar-prefix-cls}-picker-input{
40
+ border-color: @border-color-secondary;
41
+ color: @text-color;
42
+ &:focus{
43
+ border-color: @blue-5;
44
+ }
45
+ }
46
+ &:has(input:not([value=''])),&:hover {
47
+ .@{calendar-prefix-cls}-picker-icon{
48
+ color: @text-color-secondary;
49
+ }
50
+ }
51
+ &:has(input[disabled]){
52
+ .@{calendar-prefix-cls}-picker-icon{
53
+ color: @disabled-color;
54
+ }
55
+ }
56
+ .@{calendar-prefix-cls}-picker-icon{
57
+ width: auto;
58
+ height: @font-size-lg;
59
+ font-size: @font-size-lg;
60
+ }
61
+ .@{calendar-prefix-cls}-picker-clear{
62
+ color: tint(@bg-color-spotilight, 50%);
63
+ }
64
+ }
65
+ .@{datepicker-prefix-cls}{
66
+ &-fill{
67
+ .@{calendar-prefix-cls}-picker{
68
+ &-input {
69
+ &.@{ant-prefix}-input {
70
+ background-color: @fill-color-quaternary;
71
+ border-color: @fill-color-quaternary;
72
+ &-disabled {
73
+ border: none;
74
+ pointer-events: none;
75
+ background: @disabled-bg;
76
+ }
77
+ &:focus{
78
+ background-color: @white;
79
+ border-color: @blue-5;
80
+ }
81
+ }
82
+ &:not([value='']):hover {
83
+ background-color: @white;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ //Calender
91
+ .@{calendar-prefix-cls}{
92
+ &-footer {
93
+ &-extra {
94
+ .@{ant-prefix}-tag{
95
+ color: @text-color;
96
+ border: none;
97
+ background-color: @white;
98
+ &:hover{
99
+ color: @blue-6;
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ thead tr{
106
+ border-bottom: none;
107
+ }
108
+ table th{
109
+ background-color: @white;
110
+ }
111
+ }
112
+
113
+ //RangePicker
114
+ .@{calendar-prefix-cls}-range{
115
+ .@{calendar-prefix-cls}-in-range-cell,
116
+ .@{calendar-prefix-cls}-selected-start-date,
117
+ .@{calendar-prefix-cls}-selected-end-date {
118
+ position: relative;
119
+ border-radius: 0;
120
+ > div {
121
+ position: relative;
122
+ z-index: 1;
123
+ }
124
+ &::before {
125
+ position: absolute;
126
+ top: 3px;
127
+ right: 0;
128
+ bottom: 3px;
129
+ left: 0;
130
+ display: block;
131
+ background: @item-active-bg;
132
+ border: 0;
133
+ border-radius: 0;
134
+ content: '';
135
+ }
136
+ }
137
+ .@{calendar-prefix-cls}-selected-start-date{
138
+ &::before{
139
+ border-radius: @border-radius-base 0 0 @border-radius-base;
140
+ }
141
+ &::after {
142
+ position: absolute;
143
+ bottom: -2px;
144
+ left: 16px;
145
+ display: block;
146
+ background: @blue-6;
147
+ border: 0;
148
+ border-radius: 50%;
149
+ width: 4px;
150
+ height: 4px;
151
+ content: '';
152
+ }
153
+ }
154
+ //ant-calendar-last-day-of-month
155
+ //ant-calendar-last-month-cell ant-calendar-last-day-of-month
156
+ .@{calendar-prefix-cls}-selected-end-date{
157
+ &::before{
158
+ border-radius: 0 @border-radius-base @border-radius-base 0;
159
+ }
160
+ }
161
+ .@{calendar-prefix-cls}-selected-start-date.@{calendar-prefix-cls}-selected-end-date{
162
+ &::before{
163
+ border-radius: @border-radius-base @border-radius-base @border-radius-base @border-radius-base;
164
+ }
165
+ }
166
+ tr .@{calendar-prefix-cls}-in-range-cell:first-child{
167
+ &::before{
168
+ border-radius: @border-radius-base 0 0 @border-radius-base;
169
+ }
170
+ }
171
+ tr .@{calendar-prefix-cls}-selected-end-date:first-child,
172
+ tr .@{calendar-prefix-cls}-selected-start-date:last-child{
173
+ &::before{
174
+ border-radius: @border-radius-base @border-radius-base @border-radius-base @border-radius-base;
175
+ }
176
+ }
177
+ tr .@{calendar-prefix-cls}-in-range-cell:last-child{
178
+ &::before{
179
+ border-radius: 0 @border-radius-base @border-radius-base 0;
180
+ }
181
+ }
182
+ .@{calendar-prefix-cls}-cell{
183
+ height: 38px;
184
+ }
185
+ }
186
+
187
+ //MonthPanel
188
+ .@{calendar-prefix-cls}-month-panel-month {
189
+ border-radius: @border-radius-base;
190
+ }
191
+
192
+ //WeekPicker
193
+ .@{calendar-prefix-cls}-week-number {
194
+ &-cell {
195
+ opacity: 1;
196
+ font-weight: normal;
197
+ color: @text-color-tertiary !important;
198
+ }
199
+ .@{calendar-prefix-cls}-body tr {
200
+ cursor: pointer;
201
+ transition: all 0.3s;
202
+ background: @white;
203
+ .@{calendar-prefix-cls}-date{
204
+ width: auto;
205
+ border-radius: 0;
206
+ font-weight: 500;
207
+ }
208
+ &:hover {
209
+ background: @white;
210
+ td:nth-child(2){
211
+ .@{calendar-prefix-cls}-date{
212
+ border-radius: @border-radius-base 0 0 @border-radius-base;
213
+ }
214
+ }
215
+ td:last-child{
216
+ .@{calendar-prefix-cls}-date{
217
+ border-radius: 0 @border-radius-base @border-radius-base 0;
218
+ }
219
+ }
220
+ .@{calendar-prefix-cls}-cell{
221
+ &::before{
222
+ top: 8px;
223
+ bottom: 8px;
224
+ }
225
+ .@{calendar-prefix-cls}-date{
226
+ background: @background-color-base;
227
+ &:hover{
228
+ background: @background-color-base;
229
+ }
230
+ }
231
+ .@{calendar-prefix-cls}-selected-day{
232
+ background: @background-color-base;
233
+ }
234
+ }
235
+ .@{calendar-prefix-cls}-week-number-cell{
236
+ background: @white;
237
+ }
238
+ }
239
+ .@{calendar-prefix-cls}-selected-day .@{calendar-prefix-cls}-date,
240
+ .@{calendar-prefix-cls}-selected-day:hover .@{calendar-prefix-cls}-date {
241
+ color: @text-color;
242
+ background: transparent;
243
+ }
244
+ &.@{calendar-prefix-cls}-active-week {
245
+ background: transparent;
246
+ td:nth-child(2){
247
+ .@{calendar-prefix-cls}-selected-day,.@{calendar-prefix-cls}-date{
248
+ border-radius: @border-radius-base 0 0 @border-radius-base;
249
+ }
250
+ }
251
+ td:last-child{
252
+ .@{calendar-prefix-cls}-selected-day,.@{calendar-prefix-cls}-date{
253
+ border-radius: 0 @border-radius-base @border-radius-base 0;
254
+ }
255
+ }
256
+ .@{calendar-prefix-cls}-cell{
257
+ font-weight: bold;
258
+ //background: @primary-color;
259
+ .@{calendar-prefix-cls}-date{
260
+ color: @text-color-inverse;
261
+ background: @primary-color;
262
+ &:hover{
263
+ color: @text-color-inverse;
264
+ background: @primary-color;
265
+ }
266
+ }
267
+ .@{calendar-prefix-cls}-selected-day{
268
+ background: @primary-color;
269
+ }
270
+ }
271
+ }
272
+ .@{calendar-prefix-cls}-today .@{calendar-prefix-cls}-date{
273
+ //color: @text-color;
274
+ //font-weight: normal;
275
+ border-color: transparent;
276
+ }
277
+ }
278
+ .@{calendar-prefix-cls}-cell{
279
+ height: 38px;
280
+ position: relative;
281
+ &::before {
282
+ position: absolute;
283
+ top: 3px;
284
+ right: 0;
285
+ bottom: 3px;
286
+ left: 0;
287
+ display: block;
288
+ border: 0;
289
+ border-radius: 0;
290
+ content: '';
291
+ }
292
+ }
293
+ }
294
+
@@ -98,8 +98,9 @@
98
98
  &-icon {
99
99
  display: inline-block;
100
100
  color: @disabled-color;
101
- font-size: @font-size-base;
101
+ font-size: calc(@font-size-base + 2px);
102
102
  line-height: 1;
103
+ margin-top: -8px;
103
104
  }
104
105
 
105
106
  .@{ant-prefix}-input-disabled + &-icon {
@@ -0,0 +1,154 @@
1
+ @drawer-prefix-cls: ~'@{ant-prefix}-drawer';
2
+
3
+
4
+ .tnt-drawer.@{drawer-prefix-cls} {
5
+ &-top {
6
+ .@{drawer-prefix-cls}-wrapper-body {
7
+ margin-top: 48px;
8
+ }
9
+
10
+ .@{drawer-prefix-cls}-content-wrapper {
11
+ height: 480px !important;
12
+ }
13
+ }
14
+
15
+ &-bottom {
16
+ .@{drawer-prefix-cls}-content-wrapper {
17
+ height: 480px !important;
18
+ }
19
+ }
20
+
21
+ .@{drawer-prefix-cls}-wrapper-body {
22
+ margin-top: 48px;
23
+ max-height: ~'calc(100vh - 50px)';
24
+ }
25
+
26
+ &-footer {
27
+ .@{drawer-prefix-cls}-header {
28
+ border-bottom: none;
29
+ position: absolute;
30
+ right: 0;
31
+ top: 0;
32
+ background: #fff;
33
+ width: 100%;
34
+ }
35
+
36
+ .@{drawer-prefix-cls}-wrapper-body {
37
+ max-height: ~'calc(100vh - 98px)' !important;
38
+ margin-top: 48px !important;
39
+ margin-bottom: 48px !important;
40
+ }
41
+
42
+ }
43
+
44
+ .@{drawer-prefix-cls}-title {
45
+ font-size: 14px;
46
+ font-weight: 600;
47
+ }
48
+
49
+ .@{drawer-prefix-cls}-close {
50
+ color: fade(@text-color, 50%);
51
+ width: 62px;
52
+ top: -4px;
53
+
54
+
55
+ position: absolute;
56
+ top: -2px;
57
+ right: 0;
58
+ z-index: 10;
59
+ display: block;
60
+ width: 48px;
61
+ height: 48px;
62
+ padding: 0;
63
+ color: rgba(23, 35, 61, 0.8);
64
+ font-weight: 700;
65
+ font-size: 20px;
66
+ font-style: normal;
67
+ line-height: 56px;
68
+ text-align: center;
69
+ text-transform: none;
70
+ text-decoration: none;
71
+ background: transparent;
72
+ border: 0;
73
+ outline: 0;
74
+ cursor: pointer;
75
+ transition: color 0.3s;
76
+ text-rendering: auto;
77
+ }
78
+
79
+
80
+ .@{drawer-prefix-cls}-contain-closable {
81
+ .@{drawer-prefix-cls}-header {
82
+ padding: 12px 36px 12px 20px;
83
+ }
84
+ }
85
+
86
+ &-right {
87
+ .@{drawer-prefix-cls}-content {
88
+ border-radius: @border-radius-base 0px 0px @border-radius-base;
89
+ background: #F8F9FB;
90
+ }
91
+ }
92
+
93
+ &-left {
94
+ .@{drawer-prefix-cls}-content {
95
+ border-radius: 0px @border-radius-base @border-radius-base 0px;
96
+ background: #F8F9FB;
97
+ }
98
+ }
99
+
100
+ &-top {
101
+ .@{drawer-prefix-cls}-content {
102
+ border-radius: 0px 0px @border-radius-base @border-radius-base;
103
+ background: #F8F9FB;
104
+ padding-top: 48px;
105
+ }
106
+
107
+ .@{drawer-prefix-cls}-wrapper-body {
108
+ margin-top: 0px !important;
109
+ }
110
+ }
111
+
112
+ &-bottom {
113
+ .@{drawer-prefix-cls}-content {
114
+ border-radius: @border-radius-base @border-radius-base 0px 0px;
115
+ background: #F8F9FB;
116
+ padding-top: 48px;
117
+ }
118
+
119
+ .@{drawer-prefix-cls}-wrapper-body {
120
+ margin-top: 0px !important;
121
+ }
122
+ }
123
+
124
+
125
+ .@{drawer-prefix-cls}-header {
126
+ padding: 13px 24px;
127
+ border-bottom: none;
128
+ position: absolute;
129
+ right: 0;
130
+ top: 0;
131
+ width: 100%;
132
+ background: #fff;
133
+ }
134
+
135
+ .@{drawer-prefix-cls}-body {
136
+ padding: @padding-lg !important;
137
+
138
+ }
139
+
140
+
141
+ .@{drawer-prefix-cls}-wrapper-body {
142
+
143
+ .@{drawer-prefix-cls}-footer-style {
144
+ position: absolute;
145
+ right: 0;
146
+ bottom: 0;
147
+ width: 100%;
148
+ padding: 8px 24px;
149
+ background: #fff;
150
+ text-align: right;
151
+ }
152
+
153
+ }
154
+ }
@@ -157,7 +157,7 @@
157
157
  padding: 0;
158
158
  color: @text-color-secondary;
159
159
  font-weight: 700;
160
- font-size: @font-size-lg;
160
+ font-size: 20px;
161
161
  font-style: normal;
162
162
  line-height: 56px;
163
163
  text-align: center;
@@ -169,7 +169,9 @@
169
169
  cursor: pointer;
170
170
  transition: color @animation-duration-slow;
171
171
  text-rendering: auto;
172
-
172
+ .tntd-anticon {
173
+ font-size: 20px;
174
+ }
173
175
  &:focus,
174
176
  &:hover {
175
177
  color: @icon-color-hover;
@@ -102,7 +102,8 @@
102
102
  > span > .anticon:first-child {
103
103
  min-width: 12px;
104
104
  margin-right: 8px;
105
- font-size: @font-size-sm;
105
+ // font-size: @font-size-sm;
106
+ font-size: 16px;
106
107
  }
107
108
 
108
109
  > a {
@@ -0,0 +1,36 @@
1
+ @form-prefix-cls: ~'@{ant-prefix}-form';
2
+
3
+ .tnt-form{
4
+ .@{form-prefix-cls}-item{
5
+ min-height: @input-height-base;
6
+
7
+ .@{form-prefix-cls}-item-required::before {
8
+ top: 2px;
9
+ position: relative;
10
+ }
11
+
12
+ &-with-help {
13
+ margin-bottom: @form-item-margin-bottom;
14
+ }
15
+
16
+ &-control {
17
+ line-height: 1;
18
+ min-height: @input-height-base;
19
+ }
20
+
21
+ &-label {
22
+ line-height: @input-height-base;
23
+ }
24
+
25
+ &-children{
26
+ line-height: calc(@input-height-base - 2px);
27
+ }
28
+ }
29
+
30
+ .@{form-prefix-cls}-explain,
31
+ .@{form-prefix-cls}-extra {
32
+ margin-top: 4px;
33
+ }
34
+ }
35
+
36
+
@@ -0,0 +1,3 @@
1
+ import { createContext } from 'react';
2
+ const RowContext = createContext({});
3
+ export default RowContext;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RowContext.js","sourceRoot":"","sources":["../../src/grid/RowContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAQrC,MAAM,UAAU,GAA6B,aAAa,CAAC,EAAE,CAAC,CAAA;AAE9D,eAAe,UAAU,CAAA","sourcesContent":["import type { Context } from 'react'\nimport { createContext } from 'react'\n\nexport interface RowContextState {\n gutter?: [number, number]\n wrap?: boolean\n supportFlexGap?: boolean\n}\n\nconst RowContext: Context<RowContextState> = createContext({})\n\nexport default RowContext\n"]}
package/es/grid/col.js ADDED
@@ -0,0 +1,103 @@
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 classNames from 'classnames';
10
+ import * as React from 'react';
11
+ import { ConfigContext } from '../_util/context';
12
+ import RowContext from './RowContext';
13
+ function parseFlex(flex) {
14
+ if (typeof flex === 'number') {
15
+ return `${flex} ${flex} auto`;
16
+ }
17
+ if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
18
+ return `0 0 ${flex}`;
19
+ }
20
+ return flex;
21
+ }
22
+ const sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
23
+ const Col = React.forwardRef((props, ref) => {
24
+ const {
25
+ getPrefixCls,
26
+ direction
27
+ } = React.useContext(ConfigContext);
28
+ const {
29
+ gutter,
30
+ wrap,
31
+ supportFlexGap
32
+ } = React.useContext(RowContext);
33
+ const {
34
+ prefixCls: customizePrefixCls = 'tnt-col',
35
+ span,
36
+ order,
37
+ offset,
38
+ push,
39
+ pull,
40
+ className,
41
+ children,
42
+ flex,
43
+ style
44
+ } = props,
45
+ others = __rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]);
46
+ const prefixCls = getPrefixCls('col', customizePrefixCls);
47
+ let sizeClassObj = {};
48
+ sizes.forEach(size => {
49
+ let sizeProps = {};
50
+ const propSize = props[size];
51
+ if (typeof propSize === 'number') {
52
+ sizeProps.span = propSize;
53
+ } else if (typeof propSize === 'object') {
54
+ sizeProps = propSize || {};
55
+ }
56
+ delete others[size];
57
+ sizeClassObj = Object.assign(Object.assign({}, sizeClassObj), {
58
+ [`${prefixCls}-${size}-${sizeProps.span}`]: sizeProps.span !== undefined,
59
+ [`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
60
+ [`${prefixCls}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
61
+ [`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
62
+ [`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
63
+ [`${prefixCls}-rtl`]: direction === 'rtl'
64
+ });
65
+ });
66
+ const classes = classNames(prefixCls, {
67
+ [`${prefixCls}-${span}`]: span !== undefined,
68
+ [`${prefixCls}-order-${order}`]: order,
69
+ [`${prefixCls}-offset-${offset}`]: offset,
70
+ [`${prefixCls}-push-${push}`]: push,
71
+ [`${prefixCls}-pull-${pull}`]: pull
72
+ }, className, sizeClassObj);
73
+ const mergedStyle = {};
74
+ // Horizontal gutter use padding
75
+ if (gutter && gutter[0] > 0) {
76
+ const horizontalGutter = gutter[0] / 2;
77
+ mergedStyle.paddingLeft = horizontalGutter;
78
+ mergedStyle.paddingRight = horizontalGutter;
79
+ }
80
+ // Vertical gutter use padding when gap not support
81
+ if (gutter && gutter[1] > 0 && !supportFlexGap) {
82
+ const verticalGutter = gutter[1] / 2;
83
+ mergedStyle.paddingTop = verticalGutter;
84
+ mergedStyle.paddingBottom = verticalGutter;
85
+ }
86
+ if (flex) {
87
+ mergedStyle.flex = parseFlex(flex);
88
+ // Hack for Firefox to avoid size issue
89
+ // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
90
+ if (wrap === false && !mergedStyle.minWidth) {
91
+ mergedStyle.minWidth = 0;
92
+ }
93
+ }
94
+ return React.createElement("div", Object.assign({}, others, {
95
+ style: Object.assign(Object.assign({}, mergedStyle), style),
96
+ className: classes,
97
+ ref: ref
98
+ }), children);
99
+ });
100
+ if (process.env.NODE_ENV !== 'production') {
101
+ Col.displayName = 'Col';
102
+ }
103
+ export default Col;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"col.js","sourceRoot":"","sources":["../../src/grid/col.tsx"],"names":[],"mappings":"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","sourcesContent":["import classNames from 'classnames'\nimport * as React from 'react'\nimport { ConfigContext } from '../_util/context'\nimport RowContext from './RowContext'\n\n// https://github.com/ant-design/ant-design/issues/14324\ntype ColSpanType = number | string\n\ntype FlexType = number | 'none' | 'auto' | string\n\nexport interface ColSize {\n flex?: FlexType\n span?: ColSpanType\n order?: ColSpanType\n offset?: ColSpanType\n push?: ColSpanType\n pull?: ColSpanType\n}\n\nexport interface ColProps extends React.HTMLAttributes<HTMLDivElement> {\n flex?: FlexType\n span?: ColSpanType\n order?: ColSpanType\n offset?: ColSpanType\n push?: ColSpanType\n pull?: ColSpanType\n xs?: ColSpanType | ColSize\n sm?: ColSpanType | ColSize\n md?: ColSpanType | ColSize\n lg?: ColSpanType | ColSize\n xl?: ColSpanType | ColSize\n xxl?: ColSpanType | ColSize\n prefixCls?: string\n}\n\nfunction parseFlex(flex: FlexType): string {\n if (typeof flex === 'number') {\n return `${flex} ${flex} auto`\n }\n\n if (/^\\d+(\\.\\d+)?(px|em|rem|%)$/.test(flex)) {\n return `0 0 ${flex}`\n }\n\n return flex\n}\nconst sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'] as const\nconst Col = React.forwardRef<HTMLDivElement, ColProps>((props, ref) => {\n const { getPrefixCls, direction } = React.useContext(ConfigContext)\n const { gutter, wrap, supportFlexGap } = React.useContext(RowContext)\n\n const {\n prefixCls: customizePrefixCls = 'tnt-col',\n span,\n order,\n offset,\n push,\n pull,\n className,\n children,\n flex,\n style,\n ...others\n } = props\n\n const prefixCls = getPrefixCls('col', customizePrefixCls)\n\n let sizeClassObj = {}\n sizes.forEach((size) => {\n let sizeProps: ColSize = {}\n const propSize = props[size]\n if (typeof propSize === 'number') {\n sizeProps.span = propSize\n } else if (typeof propSize === 'object') {\n sizeProps = propSize || {}\n }\n\n delete others[size]\n\n sizeClassObj = {\n ...sizeClassObj,\n [`${prefixCls}-${size}-${sizeProps.span}`]: sizeProps.span !== undefined,\n [`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,\n [`${prefixCls}-${size}-offset-${sizeProps.offset}`]:\n sizeProps.offset || sizeProps.offset === 0,\n [`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,\n [`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,\n [`${prefixCls}-rtl`]: direction === 'rtl',\n }\n })\n\n const classes = classNames(\n prefixCls,\n {\n [`${prefixCls}-${span}`]: span !== undefined,\n [`${prefixCls}-order-${order}`]: order,\n [`${prefixCls}-offset-${offset}`]: offset,\n [`${prefixCls}-push-${push}`]: push,\n [`${prefixCls}-pull-${pull}`]: pull,\n },\n className,\n sizeClassObj\n )\n\n const mergedStyle: React.CSSProperties = {}\n // Horizontal gutter use padding\n if (gutter && gutter[0] > 0) {\n const horizontalGutter = gutter[0] / 2\n mergedStyle.paddingLeft = horizontalGutter\n mergedStyle.paddingRight = horizontalGutter\n }\n\n // Vertical gutter use padding when gap not support\n if (gutter && gutter[1] > 0 && !supportFlexGap) {\n const verticalGutter = gutter[1] / 2\n mergedStyle.paddingTop = verticalGutter\n mergedStyle.paddingBottom = verticalGutter\n }\n\n if (flex) {\n mergedStyle.flex = parseFlex(flex)\n\n // Hack for Firefox to avoid size issue\n // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553\n if (wrap === false && !mergedStyle.minWidth) {\n mergedStyle.minWidth = 0\n }\n }\n\n return (\n <div {...others} style={{ ...mergedStyle, ...style }} className={classes} ref={ref}>\n {children}\n </div>\n )\n})\n\nif (process.env.NODE_ENV !== 'production') {\n Col.displayName = 'Col'\n}\n\nexport default Col\n"]}
@@ -0,0 +1,18 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import useForceUpdate from '../../_util/hooks/useForceUpdate';
3
+ import ResponsiveObserve from '../../_util/responsiveObserve';
4
+ function useBreakpoint(refreshOnChange = true) {
5
+ const screensRef = useRef({});
6
+ const forceUpdate = useForceUpdate();
7
+ useEffect(() => {
8
+ const token = ResponsiveObserve.subscribe(supportScreens => {
9
+ screensRef.current = supportScreens;
10
+ if (refreshOnChange) {
11
+ forceUpdate();
12
+ }
13
+ });
14
+ return () => ResponsiveObserve.unsubscribe(token);
15
+ }, []);
16
+ return screensRef.current;
17
+ }
18
+ export default useBreakpoint;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../../src/grid/hooks/useBreakpoint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,cAAc,MAAM,kCAAkC,CAAA;AAE7D,OAAO,iBAAiB,MAAM,+BAA+B,CAAA;AAE7D,SAAS,aAAa,CAAC,kBAA2B,IAAI;IACpD,MAAM,UAAU,GAAG,MAAM,CAAY,EAAE,CAAC,CAAA;IACxC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;YAC3D,UAAU,CAAC,OAAO,GAAG,cAAc,CAAA;YACnC,IAAI,eAAe,EAAE;gBACnB,WAAW,EAAE,CAAA;aACd;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IACnD,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,UAAU,CAAC,OAAO,CAAA;AAC3B,CAAC;AAED,eAAe,aAAa,CAAA","sourcesContent":["import { useEffect, useRef } from 'react'\nimport useForceUpdate from '../../_util/hooks/useForceUpdate'\nimport type { ScreenMap } from '../../_util/responsiveObserve'\nimport ResponsiveObserve from '../../_util/responsiveObserve'\n\nfunction useBreakpoint(refreshOnChange: boolean = true): ScreenMap {\n const screensRef = useRef<ScreenMap>({})\n const forceUpdate = useForceUpdate()\n\n useEffect(() => {\n const token = ResponsiveObserve.subscribe((supportScreens) => {\n screensRef.current = supportScreens\n if (refreshOnChange) {\n forceUpdate()\n }\n })\n\n return () => ResponsiveObserve.unsubscribe(token)\n }, [])\n\n return screensRef.current\n}\n\nexport default useBreakpoint\n"]}