tntd 2.8.0-beta.3 → 2.8.0-beta.4
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/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/tabs/tabs.less +114 -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/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/tabs/tabs.less +114 -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
|
@@ -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:
|
|
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;
|
|
@@ -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,9 @@
|
|
|
1
|
+
import type { Context } from 'react';
|
|
2
|
+
export interface RowContextState {
|
|
3
|
+
gutter?: [number, number];
|
|
4
|
+
wrap?: boolean;
|
|
5
|
+
supportFlexGap?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const RowContext: Context<RowContextState>;
|
|
8
|
+
export default RowContext;
|
|
9
|
+
//# sourceMappingURL=RowContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowContext.d.ts","sourceRoot":"","sources":["../../src/grid/RowContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAGpC,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,QAAA,MAAM,UAAU,EAAE,OAAO,CAAC,eAAe,CAAqB,CAAA;AAE9D,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowContext.js","sourceRoot":"","sources":["../../src/grid/RowContext.tsx"],"names":[],"mappings":";;AACA,iCAAqC;AAQrC,MAAM,UAAU,GAA6B,IAAA,qBAAa,EAAC,EAAE,CAAC,CAAA;AAE9D,kBAAe,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"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type ColSpanType = number | string;
|
|
3
|
+
declare type FlexType = number | 'none' | 'auto' | string;
|
|
4
|
+
export interface ColSize {
|
|
5
|
+
flex?: FlexType;
|
|
6
|
+
span?: ColSpanType;
|
|
7
|
+
order?: ColSpanType;
|
|
8
|
+
offset?: ColSpanType;
|
|
9
|
+
push?: ColSpanType;
|
|
10
|
+
pull?: ColSpanType;
|
|
11
|
+
}
|
|
12
|
+
export interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
flex?: FlexType;
|
|
14
|
+
span?: ColSpanType;
|
|
15
|
+
order?: ColSpanType;
|
|
16
|
+
offset?: ColSpanType;
|
|
17
|
+
push?: ColSpanType;
|
|
18
|
+
pull?: ColSpanType;
|
|
19
|
+
xs?: ColSpanType | ColSize;
|
|
20
|
+
sm?: ColSpanType | ColSize;
|
|
21
|
+
md?: ColSpanType | ColSize;
|
|
22
|
+
lg?: ColSpanType | ColSize;
|
|
23
|
+
xl?: ColSpanType | ColSize;
|
|
24
|
+
xxl?: ColSpanType | ColSize;
|
|
25
|
+
prefixCls?: string;
|
|
26
|
+
}
|
|
27
|
+
declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export default Col;
|
|
29
|
+
//# sourceMappingURL=col.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"col.d.ts","sourceRoot":"","sources":["../../src/grid/col.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,aAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AAElC,aAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAEjD,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB;AAED,MAAM,WAAW,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC1B,GAAG,CAAC,EAAE,WAAW,GAAG,OAAO,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAcD,QAAA,MAAM,GAAG,iFAuFP,CAAA;AAMF,eAAe,GAAG,CAAA"}
|
package/lib/grid/col.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _context = require("../_util/context");
|
|
10
|
+
var _RowContext = _interopRequireDefault(require("./RowContext"));
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
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); }
|
|
17
|
+
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); }
|
|
18
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
function parseFlex(flex) {
|
|
27
|
+
if (typeof flex === 'number') {
|
|
28
|
+
return "".concat(flex, " ").concat(flex, " auto");
|
|
29
|
+
}
|
|
30
|
+
if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
|
|
31
|
+
return "0 0 ".concat(flex);
|
|
32
|
+
}
|
|
33
|
+
return flex;
|
|
34
|
+
}
|
|
35
|
+
var sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
|
36
|
+
var Col = React.forwardRef(function (props, ref) {
|
|
37
|
+
var _React$useContext = React.useContext(_context.ConfigContext),
|
|
38
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
39
|
+
direction = _React$useContext.direction;
|
|
40
|
+
var _React$useContext2 = React.useContext(_RowContext["default"]),
|
|
41
|
+
gutter = _React$useContext2.gutter,
|
|
42
|
+
wrap = _React$useContext2.wrap,
|
|
43
|
+
supportFlexGap = _React$useContext2.supportFlexGap;
|
|
44
|
+
var _props$prefixCls = props.prefixCls,
|
|
45
|
+
customizePrefixCls = _props$prefixCls === void 0 ? 'tnt-col' : _props$prefixCls,
|
|
46
|
+
span = props.span,
|
|
47
|
+
order = props.order,
|
|
48
|
+
offset = props.offset,
|
|
49
|
+
push = props.push,
|
|
50
|
+
pull = props.pull,
|
|
51
|
+
className = props.className,
|
|
52
|
+
children = props.children,
|
|
53
|
+
flex = props.flex,
|
|
54
|
+
style = props.style,
|
|
55
|
+
others = __rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]);
|
|
56
|
+
var prefixCls = getPrefixCls('col', customizePrefixCls);
|
|
57
|
+
var sizeClassObj = {};
|
|
58
|
+
sizes.forEach(function (size) {
|
|
59
|
+
var sizeProps = {};
|
|
60
|
+
var propSize = props[size];
|
|
61
|
+
if (typeof propSize === 'number') {
|
|
62
|
+
sizeProps.span = propSize;
|
|
63
|
+
} else if (_typeof(propSize) === 'object') {
|
|
64
|
+
sizeProps = propSize || {};
|
|
65
|
+
}
|
|
66
|
+
delete others[size];
|
|
67
|
+
sizeClassObj = Object.assign(Object.assign({}, sizeClassObj), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(size, "-").concat(sizeProps.span), sizeProps.span !== undefined), "".concat(prefixCls, "-").concat(size, "-order-").concat(sizeProps.order), sizeProps.order || sizeProps.order === 0), "".concat(prefixCls, "-").concat(size, "-offset-").concat(sizeProps.offset), sizeProps.offset || sizeProps.offset === 0), "".concat(prefixCls, "-").concat(size, "-push-").concat(sizeProps.push), sizeProps.push || sizeProps.push === 0), "".concat(prefixCls, "-").concat(size, "-pull-").concat(sizeProps.pull), sizeProps.pull || sizeProps.pull === 0), "".concat(prefixCls, "-rtl"), direction === 'rtl'));
|
|
68
|
+
});
|
|
69
|
+
var classes = (0, _classnames["default"])(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(span), span !== undefined), "".concat(prefixCls, "-order-").concat(order), order), "".concat(prefixCls, "-offset-").concat(offset), offset), "".concat(prefixCls, "-push-").concat(push), push), "".concat(prefixCls, "-pull-").concat(pull), pull), className, sizeClassObj);
|
|
70
|
+
var mergedStyle = {};
|
|
71
|
+
// Horizontal gutter use padding
|
|
72
|
+
if (gutter && gutter[0] > 0) {
|
|
73
|
+
var horizontalGutter = gutter[0] / 2;
|
|
74
|
+
mergedStyle.paddingLeft = horizontalGutter;
|
|
75
|
+
mergedStyle.paddingRight = horizontalGutter;
|
|
76
|
+
}
|
|
77
|
+
// Vertical gutter use padding when gap not support
|
|
78
|
+
if (gutter && gutter[1] > 0 && !supportFlexGap) {
|
|
79
|
+
var verticalGutter = gutter[1] / 2;
|
|
80
|
+
mergedStyle.paddingTop = verticalGutter;
|
|
81
|
+
mergedStyle.paddingBottom = verticalGutter;
|
|
82
|
+
}
|
|
83
|
+
if (flex) {
|
|
84
|
+
mergedStyle.flex = parseFlex(flex);
|
|
85
|
+
// Hack for Firefox to avoid size issue
|
|
86
|
+
// https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
|
|
87
|
+
if (wrap === false && !mergedStyle.minWidth) {
|
|
88
|
+
mergedStyle.minWidth = 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return React.createElement("div", Object.assign({}, others, {
|
|
92
|
+
style: Object.assign(Object.assign({}, mergedStyle), style),
|
|
93
|
+
className: classes,
|
|
94
|
+
ref: ref
|
|
95
|
+
}), children);
|
|
96
|
+
});
|
|
97
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
98
|
+
Col.displayName = 'Col';
|
|
99
|
+
}
|
|
100
|
+
var _default = exports["default"] = Col;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"col.js","sourceRoot":"","sources":["../../src/grid/col.tsx"],"names":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Ae,GAAG,CAAA","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 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../src/grid/hooks/useBreakpoint.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAG9D,iBAAS,aAAa,CAAC,eAAe,GAAE,OAAc,GAAG,SAAS,CAgBjE;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useForceUpdate = _interopRequireDefault(require("../../_util/hooks/useForceUpdate"));
|
|
9
|
+
var _responsiveObserve = _interopRequireDefault(require("../../_util/responsiveObserve"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function useBreakpoint() {
|
|
12
|
+
var refreshOnChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
13
|
+
var screensRef = (0, _react.useRef)({});
|
|
14
|
+
var forceUpdate = (0, _useForceUpdate["default"])();
|
|
15
|
+
(0, _react.useEffect)(function () {
|
|
16
|
+
var token = _responsiveObserve["default"].subscribe(function (supportScreens) {
|
|
17
|
+
screensRef.current = supportScreens;
|
|
18
|
+
if (refreshOnChange) {
|
|
19
|
+
forceUpdate();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return function () {
|
|
23
|
+
return _responsiveObserve["default"].unsubscribe(token);
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return screensRef.current;
|
|
27
|
+
}
|
|
28
|
+
var _default = exports["default"] = useBreakpoint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../../src/grid/hooks/useBreakpoint.tsx"],"names":[],"mappings":";;;;;AAAA,iCAAyC;AACzC,sFAA6D;AAE7D,sFAA6D;AAE7D,SAAS,aAAa,CAAC,kBAA2B,IAAI;IACpD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAY,EAAE,CAAC,CAAA;IACxC,MAAM,WAAW,GAAG,IAAA,wBAAc,GAAE,CAAA;IAEpC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,2BAAiB,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,2BAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IACnD,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,UAAU,CAAC,OAAO,CAAA;AAC3B,CAAC;AAED,kBAAe,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"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Breakpoint } from '../_util/responsiveObserve';
|
|
3
|
+
declare const RowAligns: ["top", "middle", "bottom", "stretch"];
|
|
4
|
+
declare const RowJustify: ["start", "end", "center", "space-around", "space-between", "space-evenly"];
|
|
5
|
+
declare type Responsive = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
6
|
+
declare type ResponsiveLike<T> = {
|
|
7
|
+
[key in Responsive]?: T;
|
|
8
|
+
};
|
|
9
|
+
export declare type Gutter = number | undefined | Partial<Record<Breakpoint, number>>;
|
|
10
|
+
declare type ResponsiveAligns = ResponsiveLike<typeof RowAligns[number]>;
|
|
11
|
+
declare type ResponsiveJustify = ResponsiveLike<typeof RowJustify[number]>;
|
|
12
|
+
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
gutter?: Gutter | [Gutter, Gutter];
|
|
14
|
+
align?: typeof RowAligns[number] | ResponsiveAligns;
|
|
15
|
+
justify?: typeof RowJustify[number] | ResponsiveJustify;
|
|
16
|
+
prefixCls?: string;
|
|
17
|
+
wrap?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export default Row;
|
|
21
|
+
//# sourceMappingURL=row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../src/grid/row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,4BAA4B,CAAA;AAKvE,QAAA,MAAM,SAAS,wCAA8C,CAAA;AAC7D,QAAA,MAAM,UAAU,6EAAmF,CAAA;AAEnG,aAAK,UAAU,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAC1D,aAAK,cAAc,CAAC,CAAC,IAAI;KACtB,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC;CACxB,CAAA;AAGD,oBAAY,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;AAE7E,aAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;AAChE,aAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC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