@opentinyvue/vue-date-panel 2.21.0 → 2.22.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/lib/index.js +38 -2
- package/lib/mobile-first.js +10 -5
- package/lib/pc.js +50 -13
- package/package.json +17 -16
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ function _extends() {
|
|
|
7
7
|
return n;
|
|
8
8
|
}, _extends.apply(null, arguments);
|
|
9
9
|
}
|
|
10
|
-
import { defineComponent, $
|
|
10
|
+
import { defineComponent, $props, $setup, $prefix } from "@opentinyvue/vue-common";
|
|
11
11
|
import PcTemplate from "./pc.js";
|
|
12
12
|
import MobileFirstTemplate from "./mobile-first.js";
|
|
13
13
|
import "@opentinyvue/vue-theme/date-panel/index.css";
|
|
@@ -42,8 +42,44 @@ var DatePanel = defineComponent({
|
|
|
42
42
|
default: false
|
|
43
43
|
},
|
|
44
44
|
formatWeeks: Function,
|
|
45
|
+
type: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
firstDayOfWeek: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 7
|
|
52
|
+
},
|
|
45
53
|
nowClick: {
|
|
46
54
|
type: Function
|
|
55
|
+
},
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: [Date, String, Number],
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
format: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: ""
|
|
63
|
+
},
|
|
64
|
+
readonly: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
shortcuts: {
|
|
69
|
+
type: Array,
|
|
70
|
+
default: function _default2() {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
disabledDate: {
|
|
75
|
+
type: Function,
|
|
76
|
+
default: function _default3() {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
popperClass: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: ""
|
|
47
83
|
}
|
|
48
84
|
}),
|
|
49
85
|
setup: function setup(props, context) {
|
|
@@ -54,7 +90,7 @@ var DatePanel = defineComponent({
|
|
|
54
90
|
});
|
|
55
91
|
}
|
|
56
92
|
});
|
|
57
|
-
var version = "2.
|
|
93
|
+
var version = "2.22.0";
|
|
58
94
|
DatePanel.install = function(Vue) {
|
|
59
95
|
Vue.component(DatePanel.name, DatePanel);
|
|
60
96
|
};
|
package/lib/mobile-first.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { renderless, api } from '@opentinyvue/vue-renderless/date-panel/vue';
|
|
2
2
|
import { directive, setup, props } from '@opentinyvue/vue-common';
|
|
3
3
|
import { language } from '@opentinyvue/vue-locale';
|
|
4
|
-
import Clickoutside from '@opentinyvue/vue-
|
|
4
|
+
import { Clickoutside } from '@opentinyvue/vue-directive';
|
|
5
5
|
import Time from '@opentinyvue/vue-time';
|
|
6
6
|
import DateTable from '@opentinyvue/vue-date-table';
|
|
7
7
|
import YearTable from '@opentinyvue/vue-year-table';
|
|
@@ -69,6 +69,7 @@ var classes = {
|
|
|
69
69
|
"sidebar-btn": "block w-24 my-0 mx-auto rounded border-0 bg-transparent leading-8 text-xs text-color-text-primary pl-4 text-left outline-0 cursor-pointer truncate hover:bg-color-bg-2"
|
|
70
70
|
};
|
|
71
71
|
var render = function render2() {
|
|
72
|
+
var _vm$state$shortcuts, _vm$state$shortcuts2;
|
|
72
73
|
var _vm = this;
|
|
73
74
|
var _h = _vm.$createElement;
|
|
74
75
|
var _c = _vm._self._c || _h;
|
|
@@ -97,7 +98,7 @@ var render = function render2() {
|
|
|
97
98
|
}
|
|
98
99
|
}, [_vm._t("sidebar", null, {
|
|
99
100
|
"dataTag": "tiny-picker-panel__sidebar"
|
|
100
|
-
}), _vm.state.shortcuts ? _c("div", {
|
|
101
|
+
}), (_vm$state$shortcuts = _vm.state.shortcuts) !== null && _vm$state$shortcuts !== void 0 && _vm$state$shortcuts.length ? _c("div", {
|
|
101
102
|
class: _vm.gcls("sidebar"),
|
|
102
103
|
attrs: {
|
|
103
104
|
"data-tag": "tiny-picker-panel__sidebar"
|
|
@@ -118,7 +119,7 @@ var render = function render2() {
|
|
|
118
119
|
}, [_vm._v(" " + _vm._s(shortcut.text) + " ")]);
|
|
119
120
|
}), 0) : _vm._e(), _c("div", {
|
|
120
121
|
class: [_vm.gcls("picker-panel-body"), {
|
|
121
|
-
"ml-28": _vm.slots.sidebar || _vm.state.shortcuts
|
|
122
|
+
"ml-28": _vm.slots.sidebar || ((_vm$state$shortcuts2 = _vm.state.shortcuts) === null || _vm$state$shortcuts2 === void 0 ? void 0 : _vm$state$shortcuts2.length)
|
|
122
123
|
}],
|
|
123
124
|
attrs: {
|
|
124
125
|
"data-tag": "tiny-picker-panel__body"
|
|
@@ -227,7 +228,9 @@ var render = function render2() {
|
|
|
227
228
|
"data-tag": "tiny-date-picker__header-label"
|
|
228
229
|
},
|
|
229
230
|
on: {
|
|
230
|
-
"click":
|
|
231
|
+
"click": function click($event) {
|
|
232
|
+
return _vm.showHeaderPicker("Year");
|
|
233
|
+
}
|
|
231
234
|
}
|
|
232
235
|
}, [_vm._v(_vm._s(_vm.state.yearLabel))]), _c("span", {
|
|
233
236
|
directives: [{
|
|
@@ -244,7 +247,9 @@ var render = function render2() {
|
|
|
244
247
|
"data-tag": "tiny-date-picker__header-label"
|
|
245
248
|
},
|
|
246
249
|
on: {
|
|
247
|
-
"click":
|
|
250
|
+
"click": function click($event) {
|
|
251
|
+
return _vm.showHeaderPicker("Month");
|
|
252
|
+
}
|
|
248
253
|
}
|
|
249
254
|
}, [_vm._v(_vm._s(_vm.t("ui.datepicker.month" + (_vm.state.month + 1))))]), _c("button", {
|
|
250
255
|
class: [_vm.gcls("icon-btn"), "float-right"],
|
package/lib/pc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { renderless, api } from '@opentinyvue/vue-renderless/date-panel/vue';
|
|
2
2
|
import { defineComponent, $prefix, directive, setup, $props } from '@opentinyvue/vue-common';
|
|
3
3
|
import { language } from '@opentinyvue/vue-locale';
|
|
4
|
-
import Clickoutside from '@opentinyvue/vue-
|
|
4
|
+
import { Clickoutside } from '@opentinyvue/vue-directive';
|
|
5
5
|
import Time from '@opentinyvue/vue-time';
|
|
6
6
|
import DateTable from '@opentinyvue/vue-date-table';
|
|
7
7
|
import YearTable from '@opentinyvue/vue-year-table';
|
|
@@ -87,15 +87,51 @@ var __vue2_script = defineComponent({
|
|
|
87
87
|
default: false
|
|
88
88
|
},
|
|
89
89
|
formatWeeks: Function,
|
|
90
|
+
type: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: ""
|
|
93
|
+
},
|
|
94
|
+
firstDayOfWeek: {
|
|
95
|
+
type: Number,
|
|
96
|
+
default: 7
|
|
97
|
+
},
|
|
90
98
|
timeEditable: {
|
|
91
99
|
type: Boolean,
|
|
92
100
|
default: true
|
|
93
101
|
},
|
|
94
102
|
nowClick: {
|
|
95
103
|
type: Function
|
|
104
|
+
},
|
|
105
|
+
modelValue: {
|
|
106
|
+
type: [Date, String, Number],
|
|
107
|
+
default: ""
|
|
108
|
+
},
|
|
109
|
+
format: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: ""
|
|
112
|
+
},
|
|
113
|
+
readonly: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false
|
|
116
|
+
},
|
|
117
|
+
shortcuts: {
|
|
118
|
+
type: Array,
|
|
119
|
+
default: function _default2() {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
disabledDate: {
|
|
124
|
+
type: Function,
|
|
125
|
+
default: function _default3() {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
popperClass: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: ""
|
|
96
132
|
}
|
|
97
133
|
}),
|
|
98
|
-
emits: ["pick", "select-change", "dodestroy"],
|
|
134
|
+
emits: ["pick", "select-change", "update:modelValue", "dodestroy"],
|
|
99
135
|
setup: function setup$1(props, context) {
|
|
100
136
|
return setup({
|
|
101
137
|
props,
|
|
@@ -109,6 +145,7 @@ var __vue2_script = defineComponent({
|
|
|
109
145
|
}
|
|
110
146
|
});
|
|
111
147
|
var render = function render2() {
|
|
148
|
+
var _vm$state$shortcuts;
|
|
112
149
|
var _vm = this;
|
|
113
150
|
var _h = _vm.$createElement;
|
|
114
151
|
var _c = _vm._self._c || _h;
|
|
@@ -121,12 +158,6 @@ var render = function render2() {
|
|
|
121
158
|
"after-leave": _vm.handleLeave
|
|
122
159
|
}
|
|
123
160
|
}, [_c("div", {
|
|
124
|
-
directives: [{
|
|
125
|
-
name: "show",
|
|
126
|
-
rawName: "v-show",
|
|
127
|
-
value: _vm.state.visible,
|
|
128
|
-
expression: "state.visible"
|
|
129
|
-
}],
|
|
130
161
|
staticClass: "tiny-picker-panel tiny-date-picker tiny-popper",
|
|
131
162
|
class: [{
|
|
132
163
|
"has-sidebar": _vm.slots.sidebar || _vm.state.shortcuts,
|
|
@@ -134,7 +165,7 @@ var render = function render2() {
|
|
|
134
165
|
}, _vm.state.popperClass]
|
|
135
166
|
}, [_c("div", {
|
|
136
167
|
staticClass: "tiny-picker-panel__body-wrapper"
|
|
137
|
-
}, [_vm._t("sidebar"), _vm.state.shortcuts ? _c("div", {
|
|
168
|
+
}, [_vm._t("sidebar"), (_vm$state$shortcuts = _vm.state.shortcuts) !== null && _vm$state$shortcuts !== void 0 && _vm$state$shortcuts.length ? _c("div", {
|
|
138
169
|
staticClass: "tiny-picker-panel__sidebar"
|
|
139
170
|
}, _vm._l(_vm.state.shortcuts, function(shortcut, key) {
|
|
140
171
|
return _c("button", {
|
|
@@ -245,7 +276,9 @@ var render = function render2() {
|
|
|
245
276
|
"role": "button"
|
|
246
277
|
},
|
|
247
278
|
on: {
|
|
248
|
-
"click":
|
|
279
|
+
"click": function click($event) {
|
|
280
|
+
return _vm.showHeaderPicker("Year");
|
|
281
|
+
}
|
|
249
282
|
}
|
|
250
283
|
}, [_vm._v(" " + _vm._s(_vm.state.yearLabel) + " ")]), _c("span", {
|
|
251
284
|
directives: [{
|
|
@@ -262,7 +295,9 @@ var render = function render2() {
|
|
|
262
295
|
"role": "button"
|
|
263
296
|
},
|
|
264
297
|
on: {
|
|
265
|
-
"click":
|
|
298
|
+
"click": function click($event) {
|
|
299
|
+
return _vm.showHeaderPicker("Month");
|
|
300
|
+
}
|
|
266
301
|
}
|
|
267
302
|
}, [_vm._v(_vm._s(_vm.t("ui.datepicker.month" + (_vm.state.month + 1))))]), _c("button", {
|
|
268
303
|
staticClass: "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-d-arrow-right",
|
|
@@ -303,7 +338,8 @@ var render = function render2() {
|
|
|
303
338
|
"cell-class-name": _vm.state.cellClassName,
|
|
304
339
|
"disabled-date": _vm.state.disabledDate,
|
|
305
340
|
"show-week-number": _vm.showWeekNumber,
|
|
306
|
-
"format-weeks": _vm.formatWeeks
|
|
341
|
+
"format-weeks": _vm.formatWeeks,
|
|
342
|
+
"readonly": _vm.readonly
|
|
307
343
|
},
|
|
308
344
|
on: {
|
|
309
345
|
"pick": _vm.handleDatePick
|
|
@@ -316,7 +352,8 @@ var render = function render2() {
|
|
|
316
352
|
"date": _vm.state.date,
|
|
317
353
|
"disabled-date": _vm.state.disabledDate,
|
|
318
354
|
"selection-mode": _vm.state.selectionMode,
|
|
319
|
-
"start-year": _vm.state.startYear
|
|
355
|
+
"start-year": _vm.state.startYear,
|
|
356
|
+
"readonly": _vm.readonly
|
|
320
357
|
},
|
|
321
358
|
on: {
|
|
322
359
|
"pick": _vm.handleYearPick
|
package/package.json
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-date-panel",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.22.0",
|
|
4
5
|
"description": "",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
5
8
|
"main": "./lib/index.js",
|
|
6
9
|
"module": "./lib/index.js",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"type": "module",
|
|
9
10
|
"dependencies": {
|
|
10
|
-
"@opentinyvue/vue-
|
|
11
|
-
"@opentinyvue/vue-
|
|
12
|
-
"@opentinyvue/vue-
|
|
13
|
-
"@opentinyvue/vue-
|
|
14
|
-
"@opentinyvue/vue-
|
|
15
|
-
"@opentinyvue/vue-
|
|
16
|
-
"@opentinyvue/vue-
|
|
17
|
-
"@opentinyvue/vue-
|
|
18
|
-
"@opentinyvue/vue-
|
|
19
|
-
"@opentinyvue/vue-
|
|
20
|
-
"@opentinyvue/vue-
|
|
21
|
-
"@opentinyvue/vue-
|
|
11
|
+
"@opentinyvue/vue-button": "~2.22.0",
|
|
12
|
+
"@opentinyvue/vue-common": "~2.22.0",
|
|
13
|
+
"@opentinyvue/vue-date-table": "~2.22.0",
|
|
14
|
+
"@opentinyvue/vue-directive": "~2.22.0",
|
|
15
|
+
"@opentinyvue/vue-icon": "~2.22.0",
|
|
16
|
+
"@opentinyvue/vue-input": "~2.22.0",
|
|
17
|
+
"@opentinyvue/vue-locale": "~2.22.0",
|
|
18
|
+
"@opentinyvue/vue-month-table": "~2.22.0",
|
|
19
|
+
"@opentinyvue/vue-popup": "~2.22.0",
|
|
20
|
+
"@opentinyvue/vue-renderless": "~3.22.0",
|
|
21
|
+
"@opentinyvue/vue-theme": "~3.22.0",
|
|
22
|
+
"@opentinyvue/vue-time": "~2.22.0",
|
|
23
|
+
"@opentinyvue/vue-year-table": "~2.22.0"
|
|
22
24
|
},
|
|
23
|
-
"license": "MIT",
|
|
24
25
|
"types": "index.d.ts",
|
|
25
26
|
"scripts": {
|
|
26
27
|
"build": "pnpm -w build:ui $npm_package_name",
|