@qn-pandora/pandora-component 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +20 -0
- package/CHANGELOG.md +9 -1
- package/es/components/CheckTransformList/Item/index.js +7 -3
- package/es/components/Collapse/Panel/index.d.ts +8 -40
- package/es/components/Collapse/Panel/index.js +34 -45
- package/es/components/Collapse/index.d.ts +15 -20
- package/es/components/Collapse/index.js +44 -18
- package/es/components/Collapse/style.css +210 -0
- package/es/components/Collapse/style.less +57 -0
- package/es/components/DateTimePicker/Base/index.d.ts +1 -0
- package/es/components/DateTimePicker/Base/index.js +29 -13
- package/es/components/DateTimePicker/Base/relativeTimePicker.d.ts +1 -0
- package/es/components/DateTimePicker/Base/relativeTimePicker.js +16 -3
- package/es/components/DateTimePicker/BaseMobile/Absolute/index.d.ts +1 -0
- package/es/components/DateTimePicker/BaseMobile/Absolute/index.js +8 -3
- package/es/components/DateTimePicker/BaseMobile/index.d.ts +2 -0
- package/es/components/DateTimePicker/BaseMobile/index.js +7 -2
- package/es/components/DateTimePicker/Collapse/Panel/index.d.ts +41 -0
- package/es/components/DateTimePicker/Collapse/Panel/index.js +51 -0
- package/es/components/{Collapse → DateTimePicker/Collapse}/Panel/style.css +0 -0
- package/es/components/{Collapse → DateTimePicker/Collapse}/Panel/style.less +1 -1
- package/es/components/DateTimePicker/Collapse/index.d.ts +24 -0
- package/es/components/DateTimePicker/Collapse/index.js +42 -0
- package/es/components/DateTimePicker/DisplayInput/index.d.ts +1 -0
- package/es/components/DateTimePicker/DisplayInput/index.js +4 -1
- package/es/components/DateTimePicker/constants.d.ts +4 -5
- package/es/components/DateTimePicker/constants.js +39 -44
- package/es/components/DateTimePicker/time.d.ts +2 -2
- package/es/components/DateTimePicker/time.js +17 -11
- package/es/components/RadioGroup/index.d.ts +53 -0
- package/es/components/RadioGroup/index.js +31 -0
- package/es/components/{SolidRadioGroup → RadioGroup}/style.css +43 -49
- package/es/components/RadioGroup/style.less +32 -0
- package/es/components/RangeInput/index.js +13 -7
- package/es/components/Selector/index.js +2 -2
- package/es/components/SolidRadioGroup/index.d.ts +3 -45
- package/es/components/SolidRadioGroup/index.js +13 -25
- package/es/components/Steps/ControlButton/index.js +8 -2
- package/es/components/Steps/style.css +0 -5
- package/es/components/Steps/style.less +0 -5
- package/es/components/Table/index.d.ts +1 -0
- package/es/components/Table/index.js +14 -5
- package/es/components/Table/style.css +10 -2
- package/es/components/Table/style.less +10 -3
- package/es/components/Timeline/TimelineItem/index.js +6 -4
- package/es/components/Timeline/TimelineItem/style.css +1 -2
- package/es/components/Timeline/TimelineItem/style.less +1 -2
- package/es/components/Transfer/List/index.js +9 -4
- package/es/constants/language/check_transform_list/en.d.ts +2 -0
- package/es/constants/language/check_transform_list/en.js +5 -0
- package/es/constants/language/check_transform_list/type.d.ts +6 -0
- package/es/constants/language/check_transform_list/type.js +3 -0
- package/es/constants/language/check_transform_list/zh.d.ts +2 -0
- package/es/constants/language/check_transform_list/zh.js +5 -0
- package/es/constants/language/datetime/en.d.ts +2 -0
- package/es/constants/language/datetime/en.js +79 -0
- package/es/constants/language/datetime/type.d.ts +80 -0
- package/es/constants/language/datetime/type.js +3 -0
- package/es/constants/language/datetime/zh.d.ts +2 -0
- package/es/constants/language/datetime/zh.js +79 -0
- package/es/constants/language/en.d.ts +2 -0
- package/es/constants/language/en.js +14 -0
- package/es/constants/language/range_input/en.d.ts +2 -0
- package/es/constants/language/range_input/en.js +7 -0
- package/es/constants/language/range_input/type.d.ts +8 -0
- package/es/constants/language/range_input/type.js +3 -0
- package/es/constants/language/range_input/zh.d.ts +2 -0
- package/es/constants/language/range_input/zh.js +7 -0
- package/es/constants/language/steps/en.d.ts +2 -0
- package/es/constants/language/steps/en.js +4 -0
- package/es/constants/language/steps/type.d.ts +5 -0
- package/es/constants/language/steps/type.js +3 -0
- package/es/constants/language/steps/zh.d.ts +2 -0
- package/es/constants/language/steps/zh.js +4 -0
- package/es/constants/language/table/en.d.ts +2 -0
- package/es/constants/language/table/en.js +4 -0
- package/es/constants/language/table/type.d.ts +5 -0
- package/es/constants/language/table/type.js +3 -0
- package/es/constants/language/table/zh.d.ts +2 -0
- package/es/constants/language/table/zh.js +4 -0
- package/es/constants/language/transfer/en.d.ts +2 -0
- package/es/constants/language/transfer/en.js +4 -0
- package/es/constants/language/transfer/type.d.ts +5 -0
- package/es/constants/language/transfer/type.js +3 -0
- package/es/constants/language/transfer/zh.d.ts +2 -0
- package/es/constants/language/transfer/zh.js +4 -0
- package/es/constants/language/type.d.ts +15 -0
- package/es/constants/language/type.js +3 -0
- package/es/constants/language/zh.d.ts +2 -0
- package/es/constants/language/zh.js +14 -0
- package/es/index.css +1236 -1046
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/index.less +4 -4
- package/es/style/theme.less +7 -0
- package/es/utils/language.d.ts +1 -0
- package/es/utils/language.js +15 -0
- package/es/utils/languageLocale.d.ts +1 -0
- package/es/utils/languageLocale.js +9 -0
- package/lib/components/CheckTransformList/Item/index.js +7 -3
- package/lib/components/Collapse/Panel/index.d.ts +8 -40
- package/lib/components/Collapse/Panel/index.js +35 -46
- package/lib/components/Collapse/index.d.ts +15 -20
- package/lib/components/Collapse/index.js +47 -20
- package/lib/components/Collapse/style.css +210 -0
- package/lib/components/Collapse/style.less +57 -0
- package/lib/components/DateTimePicker/Base/index.d.ts +1 -0
- package/lib/components/DateTimePicker/Base/index.js +29 -13
- package/lib/components/DateTimePicker/Base/relativeTimePicker.d.ts +1 -0
- package/lib/components/DateTimePicker/Base/relativeTimePicker.js +16 -3
- package/lib/components/DateTimePicker/BaseMobile/Absolute/index.d.ts +1 -0
- package/lib/components/DateTimePicker/BaseMobile/Absolute/index.js +8 -3
- package/lib/components/DateTimePicker/BaseMobile/index.d.ts +2 -0
- package/lib/components/DateTimePicker/BaseMobile/index.js +7 -2
- package/lib/components/DateTimePicker/Collapse/Panel/index.d.ts +41 -0
- package/lib/components/DateTimePicker/Collapse/Panel/index.js +64 -0
- package/lib/components/{Collapse → DateTimePicker/Collapse}/Panel/style.css +0 -0
- package/lib/components/{Collapse → DateTimePicker/Collapse}/Panel/style.less +1 -1
- package/lib/components/DateTimePicker/Collapse/index.d.ts +24 -0
- package/lib/components/DateTimePicker/Collapse/index.js +54 -0
- package/lib/components/DateTimePicker/DisplayInput/index.d.ts +1 -0
- package/lib/components/DateTimePicker/DisplayInput/index.js +4 -1
- package/lib/components/DateTimePicker/constants.d.ts +4 -5
- package/lib/components/DateTimePicker/constants.js +39 -44
- package/lib/components/DateTimePicker/time.d.ts +2 -2
- package/lib/components/DateTimePicker/time.js +16 -10
- package/lib/components/RadioGroup/index.d.ts +53 -0
- package/lib/components/RadioGroup/index.js +44 -0
- package/lib/components/{SolidRadioGroup → RadioGroup}/style.css +43 -49
- package/lib/components/RadioGroup/style.less +32 -0
- package/lib/components/RangeInput/index.js +13 -7
- package/lib/components/Selector/index.js +1 -1
- package/lib/components/SolidRadioGroup/index.d.ts +3 -45
- package/lib/components/SolidRadioGroup/index.js +13 -25
- package/lib/components/Steps/ControlButton/index.js +8 -2
- package/lib/components/Steps/style.css +0 -5
- package/lib/components/Steps/style.less +0 -5
- package/lib/components/Table/index.d.ts +1 -0
- package/lib/components/Table/index.js +14 -5
- package/lib/components/Table/style.css +10 -2
- package/lib/components/Table/style.less +10 -3
- package/lib/components/Timeline/TimelineItem/index.js +6 -4
- package/lib/components/Timeline/TimelineItem/style.css +1 -2
- package/lib/components/Timeline/TimelineItem/style.less +1 -2
- package/lib/components/Transfer/List/index.js +8 -3
- package/lib/constants/language/check_transform_list/en.d.ts +2 -0
- package/lib/constants/language/check_transform_list/en.js +7 -0
- package/lib/constants/language/check_transform_list/type.d.ts +6 -0
- package/lib/constants/language/check_transform_list/type.js +5 -0
- package/lib/constants/language/check_transform_list/zh.d.ts +2 -0
- package/lib/constants/language/check_transform_list/zh.js +7 -0
- package/lib/constants/language/datetime/en.d.ts +2 -0
- package/lib/constants/language/datetime/en.js +81 -0
- package/lib/constants/language/datetime/type.d.ts +80 -0
- package/lib/constants/language/datetime/type.js +5 -0
- package/lib/constants/language/datetime/zh.d.ts +2 -0
- package/lib/constants/language/datetime/zh.js +81 -0
- package/lib/constants/language/en.d.ts +2 -0
- package/lib/constants/language/en.js +16 -0
- package/lib/constants/language/range_input/en.d.ts +2 -0
- package/lib/constants/language/range_input/en.js +9 -0
- package/lib/constants/language/range_input/type.d.ts +8 -0
- package/lib/constants/language/range_input/type.js +5 -0
- package/lib/constants/language/range_input/zh.d.ts +2 -0
- package/lib/constants/language/range_input/zh.js +9 -0
- package/lib/constants/language/steps/en.d.ts +2 -0
- package/lib/constants/language/steps/en.js +6 -0
- package/lib/constants/language/steps/type.d.ts +5 -0
- package/lib/constants/language/steps/type.js +5 -0
- package/lib/constants/language/steps/zh.d.ts +2 -0
- package/lib/constants/language/steps/zh.js +6 -0
- package/lib/constants/language/table/en.d.ts +2 -0
- package/lib/constants/language/table/en.js +6 -0
- package/lib/constants/language/table/type.d.ts +5 -0
- package/lib/constants/language/table/type.js +5 -0
- package/lib/constants/language/table/zh.d.ts +2 -0
- package/lib/constants/language/table/zh.js +6 -0
- package/lib/constants/language/transfer/en.d.ts +2 -0
- package/lib/constants/language/transfer/en.js +6 -0
- package/lib/constants/language/transfer/type.d.ts +5 -0
- package/lib/constants/language/transfer/type.js +5 -0
- package/lib/constants/language/transfer/zh.d.ts +2 -0
- package/lib/constants/language/transfer/zh.js +6 -0
- package/lib/constants/language/type.d.ts +15 -0
- package/lib/constants/language/type.js +5 -0
- package/lib/constants/language/zh.d.ts +2 -0
- package/lib/constants/language/zh.js +16 -0
- package/lib/index.css +3658 -3468
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -0
- package/lib/index.less +8 -8
- package/lib/style/theme.less +7 -0
- package/lib/utils/language.d.ts +1 -0
- package/lib/utils/language.js +21 -0
- package/lib/utils/languageLocale.d.ts +1 -0
- package/lib/utils/languageLocale.js +12 -0
- package/package.json +11 -8
- package/es/components/Collapse/stories/style.stories.css +0 -12
- package/es/components/Collapse/stories/style.stories.less +0 -7
- package/es/components/SolidRadioGroup/style.less +0 -39
- package/lib/components/Collapse/stories/style.stories.css +0 -12
- package/lib/components/Collapse/stories/style.stories.less +0 -7
- package/lib/components/SolidRadioGroup/style.less +0 -39
@@ -13,9 +13,9 @@ var __assign = (this && this.__assign) || function () {
|
|
13
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
15
|
};
|
16
|
-
var _a;
|
17
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
17
|
var moment_1 = __importDefault(require("moment"));
|
18
|
+
var type_1 = require("../../constants/language/datetime/type");
|
19
19
|
var TimeType;
|
20
20
|
(function (TimeType) {
|
21
21
|
TimeType["Preset"] = "1";
|
@@ -34,28 +34,23 @@ var RangePreset;
|
|
34
34
|
RangePreset["AfterTime"] = "afterTime";
|
35
35
|
RangePreset["BetweenTime"] = "betweenTime";
|
36
36
|
})(RangePreset = exports.RangePreset || (exports.RangePreset = {}));
|
37
|
-
exports.rangePresetMapping = (_a = {},
|
38
|
-
_a[RangePreset.BeforeTime] = '在此之前',
|
39
|
-
_a[RangePreset.AfterTime] = '在此之后',
|
40
|
-
_a[RangePreset.BetweenTime] = '介于',
|
41
|
-
_a);
|
42
37
|
exports.rangePresetOptions = [
|
43
38
|
{
|
44
39
|
value: RangePreset.BeforeTime,
|
45
|
-
text:
|
40
|
+
text: type_1.DateTimeLocale.range.beforeTime
|
46
41
|
},
|
47
42
|
{
|
48
43
|
value: RangePreset.BetweenTime,
|
49
|
-
text:
|
44
|
+
text: type_1.DateTimeLocale.range.betweenTime
|
50
45
|
},
|
51
46
|
{
|
52
47
|
value: RangePreset.AfterTime,
|
53
|
-
text:
|
48
|
+
text: type_1.DateTimeLocale.range.afterTime
|
54
49
|
}
|
55
50
|
];
|
56
51
|
exports.defaultPresets = [
|
57
52
|
{
|
58
|
-
text:
|
53
|
+
text: type_1.DateTimeLocale.preset.m5,
|
59
54
|
value: 'm5',
|
60
55
|
time: function () { return ({
|
61
56
|
start: moment_1.default().subtract(5, 'minutes'),
|
@@ -63,7 +58,7 @@ exports.defaultPresets = [
|
|
63
58
|
}); }
|
64
59
|
},
|
65
60
|
{
|
66
|
-
text:
|
61
|
+
text: type_1.DateTimeLocale.preset.m15,
|
67
62
|
value: 'm15',
|
68
63
|
time: function () { return ({
|
69
64
|
start: moment_1.default().subtract(15, 'minutes'),
|
@@ -71,7 +66,7 @@ exports.defaultPresets = [
|
|
71
66
|
}); }
|
72
67
|
},
|
73
68
|
{
|
74
|
-
text:
|
69
|
+
text: type_1.DateTimeLocale.preset.m30,
|
75
70
|
value: 'm30',
|
76
71
|
time: function () { return ({
|
77
72
|
start: moment_1.default().subtract(30, 'minutes'),
|
@@ -79,7 +74,7 @@ exports.defaultPresets = [
|
|
79
74
|
}); }
|
80
75
|
},
|
81
76
|
{
|
82
|
-
text:
|
77
|
+
text: type_1.DateTimeLocale.preset.m60,
|
83
78
|
value: 'm60',
|
84
79
|
time: function () { return ({
|
85
80
|
start: moment_1.default().subtract(60, 'minutes'),
|
@@ -87,7 +82,7 @@ exports.defaultPresets = [
|
|
87
82
|
}); }
|
88
83
|
},
|
89
84
|
{
|
90
|
-
text:
|
85
|
+
text: type_1.DateTimeLocale.preset.h3,
|
91
86
|
value: 'h3',
|
92
87
|
time: function () { return ({
|
93
88
|
start: moment_1.default().subtract(3, 'hours'),
|
@@ -95,7 +90,7 @@ exports.defaultPresets = [
|
|
95
90
|
}); }
|
96
91
|
},
|
97
92
|
{
|
98
|
-
text:
|
93
|
+
text: type_1.DateTimeLocale.preset.h4,
|
99
94
|
value: 'h4',
|
100
95
|
time: function () { return ({
|
101
96
|
start: moment_1.default().subtract(4, 'hours'),
|
@@ -103,7 +98,7 @@ exports.defaultPresets = [
|
|
103
98
|
}); }
|
104
99
|
},
|
105
100
|
{
|
106
|
-
text:
|
101
|
+
text: type_1.DateTimeLocale.preset.h6,
|
107
102
|
value: 'h6',
|
108
103
|
time: function () { return ({
|
109
104
|
start: moment_1.default().subtract(6, 'hours'),
|
@@ -111,7 +106,7 @@ exports.defaultPresets = [
|
|
111
106
|
}); }
|
112
107
|
},
|
113
108
|
{
|
114
|
-
text:
|
109
|
+
text: type_1.DateTimeLocale.preset.h12,
|
115
110
|
value: 'h12',
|
116
111
|
time: function () { return ({
|
117
112
|
start: moment_1.default().subtract(12, 'hours'),
|
@@ -119,7 +114,7 @@ exports.defaultPresets = [
|
|
119
114
|
}); }
|
120
115
|
},
|
121
116
|
{
|
122
|
-
text:
|
117
|
+
text: type_1.DateTimeLocale.preset.h24,
|
123
118
|
value: 'h24',
|
124
119
|
time: function () { return ({
|
125
120
|
start: moment_1.default().subtract(24, 'hours'),
|
@@ -127,7 +122,7 @@ exports.defaultPresets = [
|
|
127
122
|
}); }
|
128
123
|
},
|
129
124
|
{
|
130
|
-
text:
|
125
|
+
text: type_1.DateTimeLocale.preset.d3,
|
131
126
|
value: 'd3',
|
132
127
|
time: function () { return ({
|
133
128
|
start: moment_1.default().subtract(3, 'days'),
|
@@ -135,7 +130,7 @@ exports.defaultPresets = [
|
|
135
130
|
}); }
|
136
131
|
},
|
137
132
|
{
|
138
|
-
text:
|
133
|
+
text: type_1.DateTimeLocale.preset.d7,
|
139
134
|
value: 'd7',
|
140
135
|
time: function () { return ({
|
141
136
|
start: moment_1.default().subtract(7, 'days'),
|
@@ -143,7 +138,7 @@ exports.defaultPresets = [
|
|
143
138
|
}); }
|
144
139
|
},
|
145
140
|
{
|
146
|
-
text:
|
141
|
+
text: type_1.DateTimeLocale.preset.d30,
|
147
142
|
value: 'd30',
|
148
143
|
time: function () { return ({
|
149
144
|
start: moment_1.default().subtract(30, 'days'),
|
@@ -151,32 +146,32 @@ exports.defaultPresets = [
|
|
151
146
|
}); }
|
152
147
|
},
|
153
148
|
{
|
154
|
-
text:
|
149
|
+
text: type_1.DateTimeLocale.preset.today,
|
155
150
|
value: 'today',
|
156
151
|
time: function () { return ({ start: moment_1.default().startOf('day'), end: moment_1.default() }); }
|
157
152
|
},
|
158
153
|
{
|
159
|
-
text:
|
154
|
+
text: type_1.DateTimeLocale.preset.week,
|
160
155
|
value: 'week',
|
161
156
|
time: function () { return ({ start: moment_1.default().startOf('week'), end: moment_1.default() }); }
|
162
157
|
},
|
163
158
|
{
|
164
|
-
text:
|
159
|
+
text: type_1.DateTimeLocale.preset.month,
|
165
160
|
value: 'month',
|
166
161
|
time: function () { return ({ start: moment_1.default().startOf('month'), end: moment_1.default() }); }
|
167
162
|
},
|
168
163
|
{
|
169
|
-
text:
|
164
|
+
text: type_1.DateTimeLocale.preset.quarter,
|
170
165
|
value: 'quarter',
|
171
166
|
time: function () { return ({ start: moment_1.default().startOf('quarter'), end: moment_1.default() }); }
|
172
167
|
},
|
173
168
|
{
|
174
|
-
text:
|
169
|
+
text: type_1.DateTimeLocale.preset.year,
|
175
170
|
value: 'year',
|
176
171
|
time: function () { return ({ start: moment_1.default().startOf('year'), end: moment_1.default() }); }
|
177
172
|
},
|
178
173
|
{
|
179
|
-
text:
|
174
|
+
text: type_1.DateTimeLocale.preset.yesterDay,
|
180
175
|
value: 'yesterDay',
|
181
176
|
time: function () { return ({
|
182
177
|
start: moment_1.default().subtract(1, 'days').startOf('day'),
|
@@ -184,7 +179,7 @@ exports.defaultPresets = [
|
|
184
179
|
}); }
|
185
180
|
},
|
186
181
|
{
|
187
|
-
text:
|
182
|
+
text: type_1.DateTimeLocale.preset.theDayBeforYesterDay,
|
188
183
|
value: 'theDayBeforYesterDay',
|
189
184
|
time: function () { return ({
|
190
185
|
start: moment_1.default().subtract(2, 'days').startOf('day'),
|
@@ -192,7 +187,7 @@ exports.defaultPresets = [
|
|
192
187
|
}); }
|
193
188
|
},
|
194
189
|
{
|
195
|
-
text:
|
190
|
+
text: type_1.DateTimeLocale.preset.previousWeek,
|
196
191
|
value: 'previousWeek',
|
197
192
|
time: function () { return ({
|
198
193
|
start: moment_1.default().subtract(1, 'weeks').startOf('weeks'),
|
@@ -200,7 +195,7 @@ exports.defaultPresets = [
|
|
200
195
|
}); }
|
201
196
|
},
|
202
197
|
{
|
203
|
-
text:
|
198
|
+
text: type_1.DateTimeLocale.preset.previousMonth,
|
204
199
|
value: 'previousMonth',
|
205
200
|
time: function () { return ({
|
206
201
|
start: moment_1.default().subtract(1, 'months').startOf('months'),
|
@@ -208,7 +203,7 @@ exports.defaultPresets = [
|
|
208
203
|
}); }
|
209
204
|
},
|
210
205
|
{
|
211
|
-
text:
|
206
|
+
text: type_1.DateTimeLocale.preset.previousQuarter,
|
212
207
|
value: 'previousQuarter',
|
213
208
|
time: function () { return ({
|
214
209
|
start: moment_1.default().subtract(1, 'quarters').startOf('quarters'),
|
@@ -216,7 +211,7 @@ exports.defaultPresets = [
|
|
216
211
|
}); }
|
217
212
|
},
|
218
213
|
{
|
219
|
-
text:
|
214
|
+
text: type_1.DateTimeLocale.preset.previousYear,
|
220
215
|
value: 'previousYear',
|
221
216
|
time: function () { return ({
|
222
217
|
start: moment_1.default().subtract(1, 'years').startOf('years'),
|
@@ -224,7 +219,7 @@ exports.defaultPresets = [
|
|
224
219
|
}); }
|
225
220
|
},
|
226
221
|
{
|
227
|
-
text:
|
222
|
+
text: type_1.DateTimeLocale.preset.AllTime,
|
228
223
|
value: 'AllTime',
|
229
224
|
time: function () { return ({
|
230
225
|
start: moment_1.default(0),
|
@@ -254,52 +249,52 @@ var RelativeUnitValue;
|
|
254
249
|
})(RelativeUnitValue = exports.RelativeUnitValue || (exports.RelativeUnitValue = {}));
|
255
250
|
exports.relativeTimeUnits = [
|
256
251
|
{
|
257
|
-
text:
|
252
|
+
text: type_1.DateTimeLocale.relative.now,
|
258
253
|
value: RelativeUnitValue.Now,
|
259
254
|
time: function (_) { return moment_1.default(); }
|
260
255
|
},
|
261
256
|
{
|
262
|
-
text: '
|
257
|
+
text: type_1.DateTimeLocale.relative['now-static'],
|
263
258
|
value: RelativeUnitValue.NowStatic,
|
264
259
|
time: function (_) { return moment_1.default(); }
|
265
260
|
},
|
266
261
|
{
|
267
|
-
text:
|
262
|
+
text: type_1.DateTimeLocale.relative.s,
|
268
263
|
value: RelativeUnitValue.Second,
|
269
264
|
time: function (num) { return moment_1.default().subtract(num, 'seconds'); }
|
270
265
|
},
|
271
266
|
{
|
272
|
-
text:
|
267
|
+
text: type_1.DateTimeLocale.relative.m,
|
273
268
|
value: RelativeUnitValue.Minute,
|
274
269
|
time: function (num) { return moment_1.default().subtract(num, 'minutes'); }
|
275
270
|
},
|
276
271
|
{
|
277
|
-
text:
|
272
|
+
text: type_1.DateTimeLocale.relative.h,
|
278
273
|
value: RelativeUnitValue.Hour,
|
279
274
|
time: function (num) { return moment_1.default().subtract(num, 'hours'); }
|
280
275
|
},
|
281
276
|
{
|
282
|
-
text:
|
277
|
+
text: type_1.DateTimeLocale.relative.d,
|
283
278
|
value: RelativeUnitValue.Day,
|
284
279
|
time: function (num) { return moment_1.default().subtract(num, 'days'); }
|
285
280
|
},
|
286
281
|
{
|
287
|
-
text:
|
282
|
+
text: type_1.DateTimeLocale.relative.w,
|
288
283
|
value: RelativeUnitValue.Week,
|
289
284
|
time: function (num) { return moment_1.default().subtract(num, 'weeks'); }
|
290
285
|
},
|
291
286
|
{
|
292
|
-
text:
|
287
|
+
text: type_1.DateTimeLocale.relative.M,
|
293
288
|
value: RelativeUnitValue.Month,
|
294
289
|
time: function (num) { return moment_1.default().subtract(num, 'months'); }
|
295
290
|
},
|
296
291
|
{
|
297
|
-
text:
|
292
|
+
text: type_1.DateTimeLocale.relative.Q,
|
298
293
|
value: RelativeUnitValue.Quarter,
|
299
294
|
time: function (num) { return moment_1.default().subtract(num, 'quarters'); }
|
300
295
|
},
|
301
296
|
{
|
302
|
-
text:
|
297
|
+
text: type_1.DateTimeLocale.relative.y,
|
303
298
|
value: RelativeUnitValue.Year,
|
304
299
|
time: function (num) { return moment_1.default().subtract(num, 'years'); }
|
305
300
|
}
|
@@ -308,7 +303,7 @@ exports.relativeTimeUnitsWithoutNowStatic = exports.relativeTimeUnits
|
|
308
303
|
.filter(function (item) { return item.value !== RelativeUnitValue.NowStatic; })
|
309
304
|
.map(function (item) {
|
310
305
|
return item.value === RelativeUnitValue.Now
|
311
|
-
? __assign(__assign({}, item), { text:
|
306
|
+
? __assign(__assign({}, item), { text: type_1.DateTimeLocale.relative.now_text }) : __assign({}, item);
|
312
307
|
});
|
313
308
|
exports.relativeMap = (function () {
|
314
309
|
var res = {};
|
@@ -65,8 +65,8 @@ export default class Time implements ITime {
|
|
65
65
|
start: moment.Moment | undefined;
|
66
66
|
end: moment.Moment | undefined;
|
67
67
|
};
|
68
|
-
getSingleTimeText(time: ICompositedTime):
|
69
|
-
getDisplayText(timeFormat?: string):
|
68
|
+
getSingleTimeText(time: ICompositedTime, locale?: import("antd/es/locale-provider").Locale): any;
|
69
|
+
getDisplayText(timeFormat?: string, locale?: import("antd/es/locale-provider").Locale): any;
|
70
70
|
getInitRangePreset: (time: ITime) => RangePreset | undefined;
|
71
71
|
isEmpty(): boolean;
|
72
72
|
isEqual(timeToCompare: ITime): boolean;
|
@@ -5,8 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
var moment_1 = __importDefault(require("moment"));
|
7
7
|
var lodash_1 = require("lodash");
|
8
|
+
var zh_CN_1 = __importDefault(require("antd/es/locale-provider/zh_CN"));
|
8
9
|
var time_1 = require("../../utils/time");
|
9
10
|
var constants_1 = require("./constants");
|
11
|
+
var language_1 = require("../../utils/language");
|
12
|
+
var type_1 = require("../../constants/language/datetime/type");
|
10
13
|
var Time = /** @class */ (function () {
|
11
14
|
function Time(time, options) {
|
12
15
|
if (options === void 0) { options = {}; }
|
@@ -108,29 +111,32 @@ var Time = /** @class */ (function () {
|
|
108
111
|
};
|
109
112
|
}
|
110
113
|
};
|
111
|
-
Time.prototype.getSingleTimeText = function (time) {
|
114
|
+
Time.prototype.getSingleTimeText = function (time, locale) {
|
115
|
+
if (locale === void 0) { locale = zh_CN_1.default; }
|
116
|
+
var text = language_1.formatString(type_1.DateTimeLocale.relative[time.unit], locale);
|
112
117
|
return time.unit === constants_1.RelativeUnitValue.Now
|
113
|
-
?
|
118
|
+
? text
|
114
119
|
: time.unit === constants_1.RelativeUnitValue.NowStatic
|
115
120
|
? time_1.toFormatTime(time.num)
|
116
|
-
: "" + time.num +
|
121
|
+
: "" + time.num + text;
|
117
122
|
};
|
118
|
-
Time.prototype.getDisplayText = function (timeFormat) {
|
123
|
+
Time.prototype.getDisplayText = function (timeFormat, locale) {
|
124
|
+
if (locale === void 0) { locale = zh_CN_1.default; }
|
119
125
|
if (this.preset) {
|
120
|
-
return
|
126
|
+
return language_1.formatString(type_1.DateTimeLocale.preset[this.preset], locale);
|
121
127
|
}
|
122
128
|
if (this.relative) {
|
123
129
|
var _a = this.relative, from = _a.from, to = _a.to;
|
124
|
-
var toText = this.getSingleTimeText(to);
|
125
|
-
var fromText = this.getSingleTimeText(from);
|
130
|
+
var toText = this.getSingleTimeText(to, locale);
|
131
|
+
var fromText = this.getSingleTimeText(from, locale);
|
126
132
|
return fromText + " ~ " + toText;
|
127
133
|
}
|
128
134
|
if (this.rangePreset) {
|
129
135
|
if (this.rangePreset === constants_1.RangePreset.BeforeTime && this.end) {
|
130
|
-
return
|
136
|
+
return language_1.formatString(type_1.DateTimeLocale.range.beforeTime, locale) + " ~ " + this.end.format(timeFormat);
|
131
137
|
}
|
132
138
|
if (this.rangePreset === constants_1.RangePreset.AfterTime && this.start) {
|
133
|
-
return this.start.format(timeFormat) + " ~ " +
|
139
|
+
return this.start.format(timeFormat) + " ~ " + language_1.formatString(type_1.DateTimeLocale.range.afterTime, locale);
|
134
140
|
}
|
135
141
|
if (this.start && this.end) {
|
136
142
|
return (this.start.format(timeFormat) + ' ~ ' + this.end.format(timeFormat));
|
@@ -138,7 +144,7 @@ var Time = /** @class */ (function () {
|
|
138
144
|
}
|
139
145
|
if (this.quarterTime) {
|
140
146
|
var _b = this.quarterTime, year = _b.year, quarter = _b.quarter;
|
141
|
-
return year +
|
147
|
+
return "" + year + language_1.formatString(type_1.DateTimeLocale.quarter.title, locale) + quarter;
|
142
148
|
}
|
143
149
|
return '';
|
144
150
|
};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
declare type BasicType = string | number | boolean;
|
3
|
+
export interface IOption<T = BasicType> {
|
4
|
+
/**
|
5
|
+
* 选项的值
|
6
|
+
*/
|
7
|
+
value: T;
|
8
|
+
/**
|
9
|
+
* 选项的展示形式:string类型或者React组件
|
10
|
+
*/
|
11
|
+
item: string | React.ReactNode;
|
12
|
+
/**
|
13
|
+
* 禁用选项
|
14
|
+
*/
|
15
|
+
disabled?: boolean;
|
16
|
+
}
|
17
|
+
export interface IRadioGroupProps<T = BasicType> {
|
18
|
+
/**
|
19
|
+
* 当前值
|
20
|
+
*/
|
21
|
+
value?: T;
|
22
|
+
/**
|
23
|
+
* 选中变化回调
|
24
|
+
*/
|
25
|
+
onChange?: (value: any) => void;
|
26
|
+
/**
|
27
|
+
* 容器样式
|
28
|
+
*/
|
29
|
+
className?: string;
|
30
|
+
/**
|
31
|
+
* 按钮样式
|
32
|
+
*/
|
33
|
+
buttonClassName?: string;
|
34
|
+
/**
|
35
|
+
* 按钮大小
|
36
|
+
*/
|
37
|
+
size?: 'small' | 'middle' | 'large';
|
38
|
+
/**
|
39
|
+
* 禁用
|
40
|
+
*/
|
41
|
+
disabled?: boolean;
|
42
|
+
/**
|
43
|
+
* 可选线列表
|
44
|
+
*/
|
45
|
+
options?: Array<IOption<T>> | IKeyValues<string | React.ReactNode>;
|
46
|
+
/**
|
47
|
+
* 用于设置 Radio options 类型
|
48
|
+
*/
|
49
|
+
optionType?: 'button' | 'default';
|
50
|
+
children?: any;
|
51
|
+
}
|
52
|
+
export default function RadioGroup(props: IRadioGroupProps): JSX.Element;
|
53
|
+
export {};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
3
|
+
if (mod && mod.__esModule) return mod;
|
4
|
+
var result = {};
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
6
|
+
result["default"] = mod;
|
7
|
+
return result;
|
8
|
+
};
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
var React = __importStar(require("react"));
|
14
|
+
var lodash_1 = require("lodash");
|
15
|
+
var radio_1 = __importDefault(require("antd/es/radio"));
|
16
|
+
var classnames_1 = __importDefault(require("classnames"));
|
17
|
+
var style_1 = require("../../constants/style");
|
18
|
+
var useCallback = React.useCallback, useMemo = React.useMemo;
|
19
|
+
function RadioGroup(props) {
|
20
|
+
var className = props.className, buttonClassName = props.buttonClassName, value = props.value, size = props.size, onChange = props.onChange, children = props.children, disabled = props.disabled, _a = props.options, options = _a === void 0 ? {} : _a, _b = props.optionType, optionType = _b === void 0 ? 'default' : _b;
|
21
|
+
var handleChange = useCallback(function (e) {
|
22
|
+
if (onChange) {
|
23
|
+
onChange(e.target.value);
|
24
|
+
}
|
25
|
+
}, [onChange]);
|
26
|
+
var radioOptions = useMemo(function () {
|
27
|
+
return lodash_1.isArray(options)
|
28
|
+
? options
|
29
|
+
: Object.keys(options).map(function (key) { return ({ value: key, item: options[key] }); });
|
30
|
+
}, [options]);
|
31
|
+
var Component = useMemo(function () {
|
32
|
+
return optionType === 'default' ? radio_1.default : radio_1.default.Button;
|
33
|
+
}, [optionType]);
|
34
|
+
return (React.createElement(radio_1.default.Group, { className: classnames_1.default(style_1.SDK_PREFIX + "-solid-radio-group", className), value: value, onChange: handleChange, size: size, disabled: disabled },
|
35
|
+
radioOptions.map(function (option) {
|
36
|
+
var _a;
|
37
|
+
var value = option.value, item = option.item;
|
38
|
+
return (React.createElement(Component, { key: value.toString(), value: value, disabled: option.disabled, className: classnames_1.default((_a = {},
|
39
|
+
_a["" + buttonClassName] = optionType === 'button' && buttonClassName,
|
40
|
+
_a)) }, item));
|
41
|
+
}),
|
42
|
+
children));
|
43
|
+
}
|
44
|
+
exports.default = RadioGroup;
|
@@ -72,11 +72,11 @@
|
|
72
72
|
.ant-radio-wrapper:hover .ant-radio,
|
73
73
|
.ant-radio:hover .ant-radio-inner,
|
74
74
|
.ant-radio-input:focus + .ant-radio-inner {
|
75
|
-
border-color: #
|
75
|
+
border-color: #2c6dd2;
|
76
76
|
}
|
77
77
|
.ant-radio-input:focus + .ant-radio-inner {
|
78
|
-
-webkit-box-shadow: 0 0 0 3px rgba(
|
79
|
-
box-shadow: 0 0 0 3px rgba(
|
78
|
+
-webkit-box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
79
|
+
box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
80
80
|
}
|
81
81
|
.ant-radio-checked::after {
|
82
82
|
position: absolute;
|
@@ -84,7 +84,7 @@
|
|
84
84
|
left: 0;
|
85
85
|
width: 100%;
|
86
86
|
height: 100%;
|
87
|
-
border: 1px solid #
|
87
|
+
border: 1px solid #2c6dd2;
|
88
88
|
border-radius: 50%;
|
89
89
|
visibility: hidden;
|
90
90
|
-webkit-animation: antRadioEffect 0.36s ease-in-out;
|
@@ -119,7 +119,7 @@
|
|
119
119
|
display: block;
|
120
120
|
width: 8px;
|
121
121
|
height: 8px;
|
122
|
-
background-color: #
|
122
|
+
background-color: #2c6dd2;
|
123
123
|
border-top: 0;
|
124
124
|
border-left: 0;
|
125
125
|
border-radius: 8px;
|
@@ -141,7 +141,7 @@
|
|
141
141
|
opacity: 0;
|
142
142
|
}
|
143
143
|
.ant-radio-checked .ant-radio-inner {
|
144
|
-
border-color: #
|
144
|
+
border-color: #2c6dd2;
|
145
145
|
}
|
146
146
|
.ant-radio-checked .ant-radio-inner::after {
|
147
147
|
-webkit-transform: scale(1);
|
@@ -178,7 +178,7 @@ span.ant-radio + * {
|
|
178
178
|
height: 32px;
|
179
179
|
margin: 0;
|
180
180
|
padding: 0 15px;
|
181
|
-
color:
|
181
|
+
color: #333;
|
182
182
|
font-size: 14px;
|
183
183
|
line-height: 30px;
|
184
184
|
background: #ffffff;
|
@@ -192,7 +192,7 @@ span.ant-radio + * {
|
|
192
192
|
transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s, -webkit-box-shadow 0.3s;
|
193
193
|
}
|
194
194
|
.ant-radio-button-wrapper a {
|
195
|
-
color:
|
195
|
+
color: #333;
|
196
196
|
}
|
197
197
|
.ant-radio-button-wrapper > .ant-radio-button {
|
198
198
|
position: absolute;
|
@@ -239,11 +239,11 @@ span.ant-radio + * {
|
|
239
239
|
}
|
240
240
|
.ant-radio-button-wrapper:hover {
|
241
241
|
position: relative;
|
242
|
-
color: #
|
242
|
+
color: #2c6dd2;
|
243
243
|
}
|
244
244
|
.ant-radio-button-wrapper:focus-within {
|
245
|
-
-webkit-box-shadow: 0 0 0 3px rgba(
|
246
|
-
box-shadow: 0 0 0 3px rgba(
|
245
|
+
-webkit-box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
246
|
+
box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
247
247
|
}
|
248
248
|
.ant-radio-button-wrapper .ant-radio-inner,
|
249
249
|
.ant-radio-button-wrapper input[type='checkbox'],
|
@@ -255,52 +255,52 @@ span.ant-radio + * {
|
|
255
255
|
}
|
256
256
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
|
257
257
|
z-index: 1;
|
258
|
-
color: #
|
258
|
+
color: #2c6dd2;
|
259
259
|
background: #ffffff;
|
260
|
-
border-color: #
|
260
|
+
border-color: #2c6dd2;
|
261
261
|
}
|
262
262
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before {
|
263
|
-
background-color: #
|
263
|
+
background-color: #2c6dd2;
|
264
264
|
}
|
265
265
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child {
|
266
|
-
border-color: #
|
266
|
+
border-color: #2c6dd2;
|
267
267
|
}
|
268
268
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {
|
269
|
-
color: #
|
270
|
-
border-color: #
|
269
|
+
color: #2c6dd2;
|
270
|
+
border-color: #2c6dd2;
|
271
271
|
}
|
272
272
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover::before {
|
273
|
-
background-color: #
|
273
|
+
background-color: #2c6dd2;
|
274
274
|
}
|
275
275
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {
|
276
|
-
color: #
|
277
|
-
border-color: #
|
276
|
+
color: #2c6dd2;
|
277
|
+
border-color: #2c6dd2;
|
278
278
|
}
|
279
279
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active::before {
|
280
|
-
background-color: #
|
280
|
+
background-color: #2c6dd2;
|
281
281
|
}
|
282
282
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
|
283
|
-
-webkit-box-shadow: 0 0 0 3px rgba(
|
284
|
-
box-shadow: 0 0 0 3px rgba(
|
283
|
+
-webkit-box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
284
|
+
box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
285
285
|
}
|
286
286
|
.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
|
287
287
|
color: #ffffff;
|
288
|
-
background: #
|
289
|
-
border-color: #
|
288
|
+
background: #2c6dd2;
|
289
|
+
border-color: #2c6dd2;
|
290
290
|
}
|
291
291
|
.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {
|
292
292
|
color: #ffffff;
|
293
|
-
background: #
|
294
|
-
border-color: #
|
293
|
+
background: #2c6dd2;
|
294
|
+
border-color: #2c6dd2;
|
295
295
|
}
|
296
296
|
.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {
|
297
297
|
color: #ffffff;
|
298
|
-
background: #
|
299
|
-
border-color: #
|
298
|
+
background: #2c6dd2;
|
299
|
+
border-color: #2c6dd2;
|
300
300
|
}
|
301
301
|
.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
|
302
|
-
-webkit-box-shadow: 0 0 0 3px rgba(
|
303
|
-
box-shadow: 0 0 0 3px rgba(
|
302
|
+
-webkit-box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
303
|
+
box-shadow: 0 0 0 3px rgba(44, 109, 210, 0.08);
|
304
304
|
}
|
305
305
|
.ant-radio-button-wrapper-disabled {
|
306
306
|
color: rgba(0, 0, 0, 0.25);
|
@@ -369,7 +369,7 @@ span.ant-radio + * {
|
|
369
369
|
border-radius: 0 2px 2px 0;
|
370
370
|
}
|
371
371
|
.ant-radio-button-wrapper-checked:not([class*=' ant-radio-button-wrapper-disabled']).ant-radio-button-wrapper:first-child {
|
372
|
-
border-right-color: #
|
372
|
+
border-right-color: #2c6dd2;
|
373
373
|
}
|
374
374
|
.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:last-child {
|
375
375
|
border-radius: 2px 0 0 2px;
|
@@ -383,28 +383,22 @@ span.ant-radio + * {
|
|
383
383
|
.ant-btn-sm {
|
384
384
|
padding: 0 7px;
|
385
385
|
}
|
386
|
-
.pandora-sdk-solid-radio-group .
|
386
|
+
.pandora-sdk-solid-radio-group .ant-radio-button-wrapper {
|
387
387
|
padding: 0 12px;
|
388
|
-
border-color: #bfbfbf !important;
|
389
|
-
color: #333;
|
390
|
-
text-align: center;
|
391
388
|
}
|
392
|
-
.pandora-sdk-solid-radio-group .pandora-sdk-solid-radio-
|
393
|
-
background: #fafafa;
|
389
|
+
.pandora-sdk-solid-radio-group .ant-radio-button-wrapper:not(.pandora-sdk-solid-radio-group .ant-radio-button-wrapper-checked) {
|
394
390
|
border-color: #bfbfbf;
|
395
391
|
}
|
396
|
-
.pandora-sdk-solid-radio-group .ant-radio-
|
397
|
-
|
398
|
-
border-color: #2c6dd2 !important;
|
399
|
-
color: #2c6dd2 !important;
|
392
|
+
.pandora-sdk-solid-radio-group .ant-radio:not(.pandora-sdk-solid-radio-group .ant-radio-checked) .ant-radio-inner {
|
393
|
+
border-color: #bfbfbf;
|
400
394
|
}
|
401
|
-
.pandora-sdk-solid-radio-group .ant-radio
|
402
|
-
|
403
|
-
|
395
|
+
.pandora-sdk-solid-radio-group .ant-radio .ant-radio-inner {
|
396
|
+
-webkit-box-sizing: border-box;
|
397
|
+
box-sizing: border-box;
|
404
398
|
}
|
405
|
-
.pandora-sdk-solid-radio-group .ant-radio-
|
406
|
-
|
399
|
+
.pandora-sdk-solid-radio-group .ant-radio .ant-radio-checked .ant-radio-inner {
|
400
|
+
border-color: #2c6dd2;
|
407
401
|
}
|
408
|
-
.ant-radio-
|
409
|
-
background-color: #2c6dd2
|
402
|
+
.pandora-sdk-solid-radio-group .ant-radio .ant-radio-checked .ant-radio-inner::after {
|
403
|
+
background-color: #2c6dd2;
|
410
404
|
}
|