@veritree/ui 0.76.1-5 → 0.76.1-7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veritree/ui",
|
|
3
|
-
"version": "0.76.1-
|
|
3
|
+
"version": "0.76.1-7",
|
|
4
4
|
"description": "veritree ui library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"@floating-ui/dom": "^1.6.5",
|
|
19
19
|
"@linusborg/vue-simple-portal": "^0.1.5",
|
|
20
20
|
"@sum.cumo/vue-datepicker": "^4.0.0",
|
|
21
|
-
"@veritree/icons": "^0.62.0"
|
|
21
|
+
"@veritree/icons": "^0.62.0",
|
|
22
|
+
"dayjs": "^1.11.11"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@babel/eslint-parser": "^7.23.10",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:minimum-view="minimumView"
|
|
22
22
|
:maximum-view="maximumView"
|
|
23
23
|
:show-edge-dates="showEdgeDates"
|
|
24
|
-
:disabled-dates="
|
|
24
|
+
:disabled-dates="disabledDatesComputed"
|
|
25
25
|
@input="onInput"
|
|
26
26
|
>
|
|
27
27
|
<template #prevIntervalBtn>
|
|
@@ -45,7 +45,7 @@ import VTPopoverTrigger from './../Popover/VTPopoverTrigger.vue';
|
|
|
45
45
|
import VTPopoverContent from './../Popover/VTPopoverContent.vue';
|
|
46
46
|
import Datepicker from '@sum.cumo/vue-datepicker';
|
|
47
47
|
import { IconChevronLeft, IconChevronRight } from '@veritree/icons';
|
|
48
|
-
import
|
|
48
|
+
import dayjs from 'dayjs';
|
|
49
49
|
|
|
50
50
|
export default {
|
|
51
51
|
name: 'VTInputDate',
|
|
@@ -62,6 +62,10 @@ export default {
|
|
|
62
62
|
},
|
|
63
63
|
|
|
64
64
|
props: {
|
|
65
|
+
disabledDates: {
|
|
66
|
+
type: [Function, Object],
|
|
67
|
+
default: null,
|
|
68
|
+
},
|
|
65
69
|
format: {
|
|
66
70
|
type: String,
|
|
67
71
|
default: 'YYYY-MM-DD',
|
|
@@ -107,19 +111,15 @@ export default {
|
|
|
107
111
|
},
|
|
108
112
|
},
|
|
109
113
|
|
|
110
|
-
// The date-fns library uses 'yyyy' for year and 'dd' for day, instead of 'YYYY' and 'DD' respectively,
|
|
111
|
-
// following the Unicode Technical Standard #35 for date format patterns.
|
|
112
|
-
// This is different from the format patterns used in the JavaScript Date object, which uses 'YYYY' and 'DD'.
|
|
113
|
-
// For more information, refer to the date-fns documentation: https://date-fns.org/v3.6.0/docs/Unicode-Tokens
|
|
114
|
-
// Using useAdditionalDayOfYearTokens and useAdditionalWeekYearTokens allows the date-fns library to use 'YYYY' and 'DD'.
|
|
115
114
|
valueModelFormatted() {
|
|
116
|
-
return
|
|
117
|
-
useAdditionalDayOfYearTokens: true,
|
|
118
|
-
useAdditionalWeekYearTokens: true,
|
|
119
|
-
});
|
|
115
|
+
return dayjs(this.value).format(this.format);
|
|
120
116
|
},
|
|
121
117
|
|
|
122
|
-
|
|
118
|
+
disabledDatesComputed() {
|
|
119
|
+
if (this.disabledDates) {
|
|
120
|
+
return this.disabledDates;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
123
|
return {
|
|
124
124
|
to: this.min,
|
|
125
125
|
from: this.max,
|