time-range-picker 0.1.27 → 3.0.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/README.md +88 -96
- package/lib/style.css +1 -0
- package/lib/time-range-picker.es.js +15587 -0
- package/lib/time-range-picker.es.js.map +1 -0
- package/lib/time-range-picker.umd.js +10 -0
- package/lib/time-range-picker.umd.js.map +1 -0
- package/package.json +42 -38
- package/demo/index.vue +0 -106
- package/demo/main.js +0 -14
- package/dist/demo.html +0 -8
- package/dist/time-range-picker.common.js +0 -5661
- package/dist/time-range-picker.common.js.map +0 -1
- package/dist/time-range-picker.umd.js +0 -5661
- package/dist/time-range-picker.umd.js.map +0 -1
- package/dist/time-range-picker.umd.min.js +0 -2
- package/dist/time-range-picker.umd.min.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,38 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "time-range-picker",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
},
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"vue": "^2.
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "time-range-picker",
|
|
3
|
+
"uppercasename": "TimeRangePicker",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "3.0.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"starry"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite --force --host",
|
|
11
|
+
"build": "vite build",
|
|
12
|
+
"preview": "vite preview"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"lib"
|
|
16
|
+
],
|
|
17
|
+
"main": "./lib/time-range-picker.umd.js",
|
|
18
|
+
"module": "./lib/time-range-picker.mjs",
|
|
19
|
+
"unpkg": "./lib/time-range-picker.umd.js",
|
|
20
|
+
"#types": "./lib/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
"./lib/style.css": "./lib/style.css",
|
|
23
|
+
".": {
|
|
24
|
+
"#types": "./lib/index.d.ts",
|
|
25
|
+
"import": "./lib/time-range-picker.mjs",
|
|
26
|
+
"require": "./lib/time-range-picker.umd.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"element-plus": "^2.3.4",
|
|
31
|
+
"vue": "^3.2.25"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@element-plus/icons-vue": "^2.1.0",
|
|
35
|
+
"@vitejs/plugin-vue": "^2.3.3",
|
|
36
|
+
"dayjs": "^1.11.7",
|
|
37
|
+
"sass": "^1.62.1",
|
|
38
|
+
"unplugin-auto-import": "^0.15.3",
|
|
39
|
+
"unplugin-vue-components": "^0.24.1",
|
|
40
|
+
"vite": "^2.9.9"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/demo/index.vue
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Descripttion:
|
|
3
|
-
* @version:
|
|
4
|
-
* @Author: 韩应波
|
|
5
|
-
* @Date: 2021-01-20 10:21:21
|
|
6
|
-
* @LastEditors: 韩应波
|
|
7
|
-
* @LastEditTime: 2021-02-08 11:48:34
|
|
8
|
-
-->
|
|
9
|
-
<template>
|
|
10
|
-
<div id="App">
|
|
11
|
-
<div>
|
|
12
|
-
切换类型:
|
|
13
|
-
<el-button @click="type = 'time'">time</el-button>
|
|
14
|
-
<el-button @click="type = 'date-time'">date-time</el-button>
|
|
15
|
-
<el-button @click="type = 'date'">date</el-button>
|
|
16
|
-
<el-button @click="type = 'year-month'">year-month</el-button>
|
|
17
|
-
<el-button @click="type = 'month'">month</el-button>
|
|
18
|
-
<el-button @click="type = 'year'">year</el-button>
|
|
19
|
-
<el-button @click="type = 'time-select'">time-select</el-button>
|
|
20
|
-
</div>
|
|
21
|
-
<br />
|
|
22
|
-
设置defaultDate:
|
|
23
|
-
<el-button @click="defaultDate = ''">空</el-button>
|
|
24
|
-
<el-button @click="defaultDate = 'thisMonth'">thisMonth(本月第一天到今天)</el-button>
|
|
25
|
-
<el-button @click="defaultDate = 'thisYear'">thisYear(本年第一天今天)</el-button>
|
|
26
|
-
<el-button @click="defaultDate = 'pastOneYear'">pastOneYear(近一年)</el-button>
|
|
27
|
-
<el-button @click="defaultDate = 'pastOneMonth'">pastOneMonth(近一月)</el-button>
|
|
28
|
-
<br />
|
|
29
|
-
设置disabled:
|
|
30
|
-
<el-switch v-model="disabled" />
|
|
31
|
-
<br />
|
|
32
|
-
<br />
|
|
33
|
-
<el-form ref="rowForm" :model="time">
|
|
34
|
-
<el-form-item label="表单" prop="start" :rules="required">
|
|
35
|
-
<TimeRangePicker
|
|
36
|
-
:key="type + '123' + defaultDate"
|
|
37
|
-
:type="type"
|
|
38
|
-
:start.sync="time.start"
|
|
39
|
-
:end.sync="time.end"
|
|
40
|
-
:disabled="disabled"
|
|
41
|
-
:defaultDate="defaultDate"
|
|
42
|
-
:picker-options="{
|
|
43
|
-
step: '00:30'
|
|
44
|
-
}"
|
|
45
|
-
/>
|
|
46
|
-
</el-form-item>
|
|
47
|
-
<el-form-item label="重置">
|
|
48
|
-
<el-button @click="$refs.rowForm.resetFields()">重置</el-button>
|
|
49
|
-
</el-form-item>
|
|
50
|
-
</el-form>
|
|
51
|
-
<div>返回值 start: {{ time.start }} end: {{ time.end }}</div>
|
|
52
|
-
<el-button @click="submit">校验</el-button>
|
|
53
|
-
<br />
|
|
54
|
-
<br />
|
|
55
|
-
外部设置值:
|
|
56
|
-
<el-input v-model="start" style="width: 100px" />
|
|
57
|
-
-
|
|
58
|
-
<el-input v-model="end" style="width: 100px" />
|
|
59
|
-
<el-button @click="setTime">设置</el-button>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script>
|
|
64
|
-
import TimeRangePicker from '../src/index.vue'
|
|
65
|
-
// import { TimeRangePicker } from '../dist/time-range-picker.umd.js'
|
|
66
|
-
|
|
67
|
-
export default {
|
|
68
|
-
components: { TimeRangePicker },
|
|
69
|
-
data() {
|
|
70
|
-
return {
|
|
71
|
-
type: 'date',
|
|
72
|
-
disabled: false,
|
|
73
|
-
defaultDate: '',
|
|
74
|
-
time: {
|
|
75
|
-
start: TimeRangePicker.defaultDate.currentMonth[0],
|
|
76
|
-
end: TimeRangePicker.defaultDate.currentMonth[1]
|
|
77
|
-
},
|
|
78
|
-
start: '',
|
|
79
|
-
end: '',
|
|
80
|
-
required: { required: true, message: '必填' }
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
watch: {
|
|
84
|
-
time: {
|
|
85
|
-
handler(n) {
|
|
86
|
-
// 主动触发校验方法
|
|
87
|
-
this.$refs.rowForm.validateField('start')
|
|
88
|
-
},
|
|
89
|
-
deep: true
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
methods: {
|
|
93
|
-
submit() {
|
|
94
|
-
this.$refs.rowForm.validate((valid) => {
|
|
95
|
-
console.log(valid)
|
|
96
|
-
})
|
|
97
|
-
},
|
|
98
|
-
setTime() {
|
|
99
|
-
this.time = {
|
|
100
|
-
start: this.start,
|
|
101
|
-
end: this.end
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
</script>
|
package/demo/main.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import App from './index.vue'
|
|
3
|
-
|
|
4
|
-
import ElementUI from 'element-ui'
|
|
5
|
-
import 'element-ui/lib/theme-chalk/index.css'
|
|
6
|
-
|
|
7
|
-
Vue.config.productionTip = false
|
|
8
|
-
|
|
9
|
-
Vue.use(ElementUI, {
|
|
10
|
-
size: 'medium' // set element-ui default size
|
|
11
|
-
})
|
|
12
|
-
new Vue({
|
|
13
|
-
render: h => h(App)
|
|
14
|
-
}).$mount('#app')
|