zartui 2.0.89 → 2.0.91-beta.1
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/calendar/style/index.js +1 -0
- package/es/calendar/style/less.js +1 -0
- package/es/datetime-picker/index.css +1 -0
- package/es/datetime-picker/index.js +302 -1
- package/es/datetime-picker/index.less +81 -0
- package/es/datetime-picker/shared.js +18 -5
- package/es/datetime-picker/style/index.js +3 -1
- package/es/datetime-picker/style/less.js +3 -1
- package/es/index.js +1 -1
- package/es/picker/index.js +43 -20
- package/es/tabs/Title.js +25 -0
- package/es/tabs/index.js +4 -3
- package/lib/calendar/style/index.js +1 -0
- package/lib/calendar/style/less.js +1 -0
- package/lib/datetime-picker/index.css +1 -0
- package/lib/datetime-picker/index.js +308 -4
- package/lib/datetime-picker/index.less +81 -0
- package/lib/datetime-picker/shared.js +17 -4
- package/lib/datetime-picker/style/index.js +3 -1
- package/lib/datetime-picker/style/less.js +3 -1
- package/lib/index.css +1 -1
- package/lib/index.js +1 -1
- package/lib/index.less +2 -1
- package/lib/picker/index.js +43 -20
- package/lib/tabs/Title.js +25 -0
- package/lib/tabs/index.js +4 -3
- package/lib/zart.js +590 -227
- package/lib/zart.min.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[class*=zt2-hairline]::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid rgba(0,0,0,.1);-webkit-transform:scale(.5);transform:scale(.5)}.zt2-hairline,.zt2-hairline--bottom,.zt2-hairline--left,.zt2-hairline--right,.zt2-hairline--surround,.zt2-hairline--top,.zt2-hairline--top-bottom{position:relative}.zt2-hairline--top::after{border-top-width:1px}.zt2-hairline--left::after{border-left-width:1px}.zt2-hairline--right::after{border-right-width:1px}.zt2-hairline--bottom::after{border-bottom-width:1px}.zt2-hairline--top-bottom::after,.zt2-hairline-unset--top-bottom::after{border-width:1px 0}.zt2-hairline--surround::after{border-width:1px}.zt2-datetime-picker__title-tab-bar{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt2-datetime-picker__title-bar{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:12px;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#2d4b73}.zt2-datetime-picker__title-bar--unselected{color:rgba(45,75,115,.4)}.zt2-datetime-picker__title{font-weight:700;font-size:14px;line-height:20px;height:20px}.zt2-datetime-picker__title--selected{color:#0091fa}.zt2-datetime-picker__title--unselected{font-weight:400}.zt2-datetime-picker__value{font-size:14px;line-height:20px;height:20px;margin-top:4px}.zt2-datetime-picker__toolbar{box-sizing:content-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;height:44px;padding:8px 16px 8px 16px;border-top:1px solid rgba(45,75,115,.1);position:relative}.zt2-datetime-picker__cancel,.zt2-datetime-picker__confirm{height:100%;padding:0 16px;font-size:14px;background-color:transparent;border:none;cursor:pointer}.zt2-datetime-picker__cancel:active,.zt2-datetime-picker__confirm:active{opacity:.7}.zt2-datetime-picker__confirm{color:#0091fa;font-weight:700}.zt2-datetime-picker__cancel{color:#000;font-weight:400}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.RANGE_END_PICKER = exports.RANGE_START_PICKER = void 0;
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
@@ -13,21 +13,325 @@ var _TimePicker = _interopRequireDefault(require("./TimePicker"));
|
|
|
13
13
|
|
|
14
14
|
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
|
15
15
|
|
|
16
|
+
var _date = require("../utils/validate/date");
|
|
17
|
+
|
|
18
|
+
var _popup = _interopRequireDefault(require("../popup"));
|
|
19
|
+
|
|
20
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
21
|
+
|
|
22
|
+
var _toast = _interopRequireDefault(require("../toast"));
|
|
23
|
+
|
|
24
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
25
|
+
|
|
16
26
|
var _createNamespace = (0, _utils.createNamespace)('datetime-picker'),
|
|
17
27
|
createComponent = _createNamespace[0],
|
|
18
28
|
bem = _createNamespace[1];
|
|
19
29
|
|
|
20
|
-
var
|
|
21
|
-
|
|
30
|
+
var RANGE_START_PICKER = 0;
|
|
31
|
+
exports.RANGE_START_PICKER = RANGE_START_PICKER;
|
|
32
|
+
var RANGE_END_PICKER = 1;
|
|
33
|
+
exports.RANGE_END_PICKER = RANGE_END_PICKER;
|
|
34
|
+
|
|
35
|
+
var _default2 = createComponent({
|
|
36
|
+
props: (0, _extends2.default)({}, _TimePicker.default.props, _DatePicker.default.props, {
|
|
37
|
+
// 是否开启时间范围选择
|
|
38
|
+
range: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
startValue: {
|
|
43
|
+
type: Date,
|
|
44
|
+
default: function _default() {
|
|
45
|
+
return new Date();
|
|
46
|
+
},
|
|
47
|
+
validator: _date.isDate
|
|
48
|
+
},
|
|
49
|
+
endValue: {
|
|
50
|
+
type: Date,
|
|
51
|
+
default: function _default() {
|
|
52
|
+
return new Date();
|
|
53
|
+
},
|
|
54
|
+
validator: _date.isDate
|
|
55
|
+
},
|
|
56
|
+
rangeHeaderStartText: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: '开始时间'
|
|
59
|
+
},
|
|
60
|
+
rangeHeaderEndText: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '结束时间'
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
data: function data() {
|
|
66
|
+
return {
|
|
67
|
+
rangeSelectedIndex: RANGE_START_PICKER,
|
|
68
|
+
refreshComputedKey: new Date().getTime(),
|
|
69
|
+
innerStartValue: this.startValue,
|
|
70
|
+
innerEndValue: this.endValue,
|
|
71
|
+
confirmedPopupPickerIndex: false
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
computed: {
|
|
75
|
+
currentStartText: function currentStartText() {
|
|
76
|
+
return this.genOriginValueText(this.innerStartValue);
|
|
77
|
+
},
|
|
78
|
+
currentEndText: function currentEndText() {
|
|
79
|
+
return this.genOriginValueText(this.innerEndValue);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
showPicker: function showPicker(val) {
|
|
84
|
+
var _this = this;
|
|
85
|
+
|
|
86
|
+
// 在第一次打开popup时,需要初始化内部picker存储的时间列index,避免初次打开直接关闭,导致picker内部index丢失
|
|
87
|
+
if (val && !this.confirmedPopupPickerIndex) {
|
|
88
|
+
// 注意这里实际上是双层nextTick,为了解决picker组件setConfirmIndex也在nextTick中执行,导致无法正确设置index的问题
|
|
89
|
+
this.$nextTick(function () {
|
|
90
|
+
_this.updatePickerConfirm();
|
|
91
|
+
|
|
92
|
+
_this.confirmedPopupPickerIndex = true;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
22
97
|
methods: {
|
|
23
98
|
// @exposed-api
|
|
24
99
|
getPicker: function getPicker() {
|
|
100
|
+
if (this.range) {
|
|
101
|
+
return [this.$refs.rangeStart.getProxiedPicker(), this.$refs.rangeEnd.getProxiedPicker()];
|
|
102
|
+
}
|
|
103
|
+
|
|
25
104
|
return this.$refs.root.getProxiedPicker();
|
|
105
|
+
},
|
|
106
|
+
genValueText: function genValueText(dateValue, timeValue) {
|
|
107
|
+
var text = '';
|
|
108
|
+
|
|
109
|
+
if (dateValue.length > 0) {
|
|
110
|
+
text += dateValue.join('/');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (timeValue.length > 0) {
|
|
114
|
+
text = text + ' ' + timeValue.join(':');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return text;
|
|
118
|
+
},
|
|
119
|
+
genOriginValueText: function genOriginValueText(values) {
|
|
120
|
+
if (!values) return '-';
|
|
121
|
+
var dateTime = (0, _dayjs.default)(values).format('YYYY-MM-DDTHH:mm:ss');
|
|
122
|
+
var dateTimeArr = dateTime.split(/[-T:]/);
|
|
123
|
+
var dateValues = [];
|
|
124
|
+
var timeValues = [];
|
|
125
|
+
|
|
126
|
+
if (this.$refs.rangeStart && this.$refs.rangeStart.originColumns) {
|
|
127
|
+
this.$refs.rangeStart.originColumns.forEach(function (_ref, index) {
|
|
128
|
+
var type = _ref.type;
|
|
129
|
+
|
|
130
|
+
if (index < dateTimeArr.length) {
|
|
131
|
+
if (['year', 'month', 'day'].includes(type)) {
|
|
132
|
+
dateValues.push(dateTimeArr[index]);
|
|
133
|
+
} else if (['hour', 'minute', 'second'].includes(type)) {
|
|
134
|
+
timeValues.push(dateTimeArr[index]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return this.genValueText(dateValues, timeValues);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
genRangeHeader: function genRangeHeader() {
|
|
142
|
+
var _this2 = this;
|
|
143
|
+
|
|
144
|
+
var h = this.$createElement;
|
|
145
|
+
return h("div", {
|
|
146
|
+
"class": bem('title-tab-bar')
|
|
147
|
+
}, [h("div", {
|
|
148
|
+
"class": [bem('title-bar', {
|
|
149
|
+
selected: this.rangeSelectedIndex === RANGE_START_PICKER,
|
|
150
|
+
unselected: this.rangeSelectedIndex === RANGE_END_PICKER
|
|
151
|
+
})],
|
|
152
|
+
"on": {
|
|
153
|
+
"click": function click() {
|
|
154
|
+
_this2.rangeSelectedIndex = RANGE_START_PICKER;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}, [h("div", {
|
|
158
|
+
"class": ['zt2-ellipsis', bem('title', {
|
|
159
|
+
selected: this.rangeSelectedIndex === RANGE_START_PICKER,
|
|
160
|
+
unselected: this.rangeSelectedIndex === RANGE_END_PICKER
|
|
161
|
+
})]
|
|
162
|
+
}, [this.rangeHeaderStartText]), h("div", {
|
|
163
|
+
"class": ['zt2-ellipsis', bem('value')]
|
|
164
|
+
}, [this.currentStartText])]), h("span", {
|
|
165
|
+
"class": bem('title-separator')
|
|
166
|
+
}), h("div", {
|
|
167
|
+
"class": [bem('title-bar', {
|
|
168
|
+
selected: this.rangeSelectedIndex === RANGE_END_PICKER,
|
|
169
|
+
unselected: this.rangeSelectedIndex === RANGE_START_PICKER
|
|
170
|
+
})],
|
|
171
|
+
"on": {
|
|
172
|
+
"click": function click() {
|
|
173
|
+
_this2.rangeSelectedIndex = RANGE_END_PICKER;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, [h("div", {
|
|
177
|
+
"class": ['zt2-ellipsis', bem('title', {
|
|
178
|
+
selected: this.rangeSelectedIndex === RANGE_END_PICKER,
|
|
179
|
+
unselected: this.rangeSelectedIndex === RANGE_START_PICKER
|
|
180
|
+
})]
|
|
181
|
+
}, [this.rangeHeaderEndText]), h("div", {
|
|
182
|
+
"class": ['zt2-ellipsis', bem('value')]
|
|
183
|
+
}, [this.currentEndText])])]);
|
|
184
|
+
},
|
|
185
|
+
genCancel: function genCancel() {
|
|
186
|
+
var h = this.$createElement;
|
|
187
|
+
return h(_button.default, {
|
|
188
|
+
"attrs": {
|
|
189
|
+
"size": "normal",
|
|
190
|
+
"block": true
|
|
191
|
+
},
|
|
192
|
+
"style": {
|
|
193
|
+
marginRigth: '4px',
|
|
194
|
+
backgroundColor: 'white'
|
|
195
|
+
},
|
|
196
|
+
"on": {
|
|
197
|
+
"click": this.onCancel
|
|
198
|
+
}
|
|
199
|
+
}, [this.cancelButtonText || '取消']);
|
|
200
|
+
},
|
|
201
|
+
genConfirm: function genConfirm() {
|
|
202
|
+
var h = this.$createElement;
|
|
203
|
+
return h(_button.default, {
|
|
204
|
+
"attrs": {
|
|
205
|
+
"type": "primary",
|
|
206
|
+
"size": "normal",
|
|
207
|
+
"block": true
|
|
208
|
+
},
|
|
209
|
+
"style": {
|
|
210
|
+
marginLeft: '8px'
|
|
211
|
+
},
|
|
212
|
+
"on": {
|
|
213
|
+
"click": this.onConfirm
|
|
214
|
+
}
|
|
215
|
+
}, [this.confirmButtonText || '确认']);
|
|
216
|
+
},
|
|
217
|
+
genToolbar: function genToolbar() {
|
|
218
|
+
var h = this.$createElement;
|
|
219
|
+
|
|
220
|
+
if (this.showToolbar) {
|
|
221
|
+
return h("div", {
|
|
222
|
+
"class": bem('toolbar')
|
|
223
|
+
}, [[this.genCancel(), this.genConfirm()]]);
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* 这里必须手动调用一次picker组件内部pureRecordConfirmIndex,保证picker组件内部confirmIndex是当前选中的时间项index
|
|
229
|
+
*/
|
|
230
|
+
updatePickerConfirm: function updatePickerConfirm() {
|
|
231
|
+
var _this3 = this;
|
|
232
|
+
|
|
233
|
+
this.$nextTick(function () {
|
|
234
|
+
var pickers = _this3.getPicker();
|
|
235
|
+
|
|
236
|
+
if (Array.isArray(pickers)) {
|
|
237
|
+
pickers.forEach(function (p) {
|
|
238
|
+
return p.pureRecordConfirmIndex();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
checkRangeValid: function checkRangeValid() {
|
|
244
|
+
return (0, _dayjs.default)(this.innerEndValue).isAfter(this.innerStartValue);
|
|
245
|
+
},
|
|
246
|
+
onConfirm: function onConfirm() {
|
|
247
|
+
if (!this.checkRangeValid()) {
|
|
248
|
+
(0, _toast.default)('结束日期不能早于开始日期');
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
this.updatePickerConfirm();
|
|
253
|
+
this.$emit('update:startValue', this.innerStartValue);
|
|
254
|
+
this.$emit('update:endValue', this.innerEndValue);
|
|
255
|
+
this.$emit('confirm', [this.innerStartValue, this.innerEndValue]);
|
|
256
|
+
},
|
|
257
|
+
onCancel: function onCancel() {
|
|
258
|
+
this.$emit('update:showPicker', false);
|
|
259
|
+
this.$emit('cancel');
|
|
26
260
|
}
|
|
27
261
|
},
|
|
28
262
|
render: function render() {
|
|
263
|
+
var _this4 = this;
|
|
264
|
+
|
|
29
265
|
var h = arguments[0];
|
|
30
266
|
var Component = this.type === 'time' ? _TimePicker.default : _DatePicker.default;
|
|
267
|
+
|
|
268
|
+
if (this.range) {
|
|
269
|
+
var props = (0, _extends2.default)({}, this.$props, {
|
|
270
|
+
bem: bem,
|
|
271
|
+
showRange: true
|
|
272
|
+
});
|
|
273
|
+
var startRangeProps = (0, _extends2.default)({}, props, {
|
|
274
|
+
value: this.startValue
|
|
275
|
+
});
|
|
276
|
+
var startListener = (0, _extends2.default)({}, this.$listeners, {
|
|
277
|
+
input: function input(val) {
|
|
278
|
+
_this4.innerStartValue = val;
|
|
279
|
+
},
|
|
280
|
+
change: function change(pickerRef) {
|
|
281
|
+
_this4.$emit('startChange', pickerRef);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
var endRangeProps = (0, _extends2.default)({}, props, {
|
|
285
|
+
value: this.endValue
|
|
286
|
+
});
|
|
287
|
+
var endListener = (0, _extends2.default)({}, this.$listeners, {
|
|
288
|
+
input: function input(val) {
|
|
289
|
+
_this4.innerEndValue = val;
|
|
290
|
+
},
|
|
291
|
+
change: function change(pickerRef) {
|
|
292
|
+
_this4.$emit('endChange', pickerRef);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return h(_popup.default, {
|
|
296
|
+
"attrs": {
|
|
297
|
+
"value": this.showPicker,
|
|
298
|
+
"round": true,
|
|
299
|
+
"position": "bottom"
|
|
300
|
+
},
|
|
301
|
+
"on": {
|
|
302
|
+
"input": function input(val) {
|
|
303
|
+
if (val) {
|
|
304
|
+
_this4.$emit('update:showPicker', true);
|
|
305
|
+
} else {
|
|
306
|
+
_this4.$emit('update:showPicker', false);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}, [this.genRangeHeader(), h("div", {
|
|
311
|
+
"class": bem('range')
|
|
312
|
+
}, [h(Component, {
|
|
313
|
+
"ref": "rangeStart",
|
|
314
|
+
"directives": [{
|
|
315
|
+
name: "show",
|
|
316
|
+
value: this.rangeSelectedIndex === RANGE_START_PICKER
|
|
317
|
+
}],
|
|
318
|
+
"class": bem(),
|
|
319
|
+
"scopedSlots": this.$scopedSlots,
|
|
320
|
+
"props": (0, _extends2.default)({}, startRangeProps),
|
|
321
|
+
"on": (0, _extends2.default)({}, startListener)
|
|
322
|
+
}), h(Component, {
|
|
323
|
+
"ref": "rangeEnd",
|
|
324
|
+
"directives": [{
|
|
325
|
+
name: "show",
|
|
326
|
+
value: this.rangeSelectedIndex === RANGE_END_PICKER
|
|
327
|
+
}],
|
|
328
|
+
"class": bem(),
|
|
329
|
+
"scopedSlots": this.$scopedSlots,
|
|
330
|
+
"props": (0, _extends2.default)({}, endRangeProps),
|
|
331
|
+
"on": (0, _extends2.default)({}, endListener)
|
|
332
|
+
})]), this.genToolbar()]);
|
|
333
|
+
}
|
|
334
|
+
|
|
31
335
|
return h(Component, {
|
|
32
336
|
"ref": "root",
|
|
33
337
|
"class": bem(),
|
|
@@ -38,4 +342,4 @@ var _default = createComponent({
|
|
|
38
342
|
}
|
|
39
343
|
});
|
|
40
344
|
|
|
41
|
-
exports.default =
|
|
345
|
+
exports.default = _default2;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@import '../style/var';
|
|
2
|
+
@import '../style/hairline';
|
|
3
|
+
|
|
4
|
+
.@{base-prefix}-datetime-picker {
|
|
5
|
+
@date-time-picker-title-bar-selected-color: @blue;
|
|
6
|
+
|
|
7
|
+
&__title-tab-bar {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__title-bar {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
padding: 12px;
|
|
17
|
+
flex: 1;
|
|
18
|
+
color: @text-color-default;
|
|
19
|
+
|
|
20
|
+
&--unselected {
|
|
21
|
+
color: @text-color-4;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__title {
|
|
26
|
+
font-weight: bold;
|
|
27
|
+
font-size: @font-size-md;
|
|
28
|
+
line-height: @line-height-md;
|
|
29
|
+
height: @line-height-md;
|
|
30
|
+
|
|
31
|
+
&--selected {
|
|
32
|
+
color: @date-time-picker-title-bar-selected-color;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--unselected {
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__value {
|
|
41
|
+
font-size: @font-size-md;
|
|
42
|
+
line-height: @line-height-md;
|
|
43
|
+
height: @line-height-md;
|
|
44
|
+
margin-top: 4px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__toolbar {
|
|
48
|
+
box-sizing: content-box;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
height: @picker-toolbar-height;
|
|
53
|
+
padding: 8px 16px 8px 16px;
|
|
54
|
+
border-top: 1px solid rgba(45, 75, 115, 0.1);
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__cancel,
|
|
59
|
+
&__confirm {
|
|
60
|
+
height: 100%;
|
|
61
|
+
padding: @picker-action-padding;
|
|
62
|
+
font-size: @picker-action-font-size;
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
border: none;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
|
|
67
|
+
&:active {
|
|
68
|
+
opacity: @active-opacity;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__confirm {
|
|
73
|
+
color: @picker-confirm-action-color;
|
|
74
|
+
font-weight: @picker-confirm-action-font-weight;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&__cancel {
|
|
78
|
+
color: @picker-cancel-action-color;
|
|
79
|
+
font-weight: @picker-cancel-action-font-weight;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -32,6 +32,10 @@ var sharedProps = (0, _extends2.default)({}, _shared.pickerProps, {
|
|
|
32
32
|
default: function _default(type, value) {
|
|
33
33
|
return value;
|
|
34
34
|
}
|
|
35
|
+
},
|
|
36
|
+
showRange: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
41
|
exports.sharedProps = sharedProps;
|
|
@@ -87,12 +91,12 @@ var TimePickerMixin = {
|
|
|
87
91
|
var hour = t('hour');
|
|
88
92
|
var minute = t('minute');
|
|
89
93
|
var presetHeaders = {
|
|
90
|
-
|
|
94
|
+
date: [year, month, day],
|
|
91
95
|
'year-month': [year, month],
|
|
92
96
|
'month-day': [month, day],
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
time: [hour, minute],
|
|
98
|
+
datetime: [year, month, day, hour, minute],
|
|
99
|
+
datehour: [year, month, day, hour]
|
|
96
100
|
}; // console.log('type ' + this.type + ' ' + JSON.stringify(presetHeaders[this.type]))
|
|
97
101
|
|
|
98
102
|
return presetHeaders[this.type] || [];
|
|
@@ -180,6 +184,15 @@ var TimePickerMixin = {
|
|
|
180
184
|
Object.keys(_shared.pickerProps).forEach(function (key) {
|
|
181
185
|
props[key] = _this6[key];
|
|
182
186
|
});
|
|
187
|
+
|
|
188
|
+
if (this.showRange) {
|
|
189
|
+
(0, _extends2.default)(props, {
|
|
190
|
+
popup: false,
|
|
191
|
+
showToolbar: false,
|
|
192
|
+
title: ''
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
183
196
|
return h(_picker.default, {
|
|
184
197
|
"attrs": {
|
|
185
198
|
"show-picker": this.showPicker,
|
|
@@ -4,5 +4,7 @@ require('../../info/index.css');
|
|
|
4
4
|
require('../../icon/index.css');
|
|
5
5
|
require('../../popup/index.css');
|
|
6
6
|
require('../../loading/index.css');
|
|
7
|
+
require('../../toast/index.css');
|
|
7
8
|
require('../../button/index.css');
|
|
8
|
-
require('../../picker/index.css');
|
|
9
|
+
require('../../picker/index.css');
|
|
10
|
+
require('../index.css');
|
|
@@ -4,5 +4,7 @@ require('../../info/index.less');
|
|
|
4
4
|
require('../../icon/index.less');
|
|
5
5
|
require('../../popup/index.less');
|
|
6
6
|
require('../../loading/index.less');
|
|
7
|
+
require('../../toast/index.less');
|
|
7
8
|
require('../../button/index.less');
|
|
8
|
-
require('../../picker/index.less');
|
|
9
|
+
require('../../picker/index.less');
|
|
10
|
+
require('../index.less');
|