拿掉 build files

This commit is contained in:
2022-07-18 16:33:23 +08:00
parent 41e2287bcb
commit 3707f158a3
31953 changed files with 0 additions and 4411796 deletions
-526
View File
@@ -1,526 +0,0 @@
// Components
import VDatePickerTitle from './VDatePickerTitle';
import VDatePickerHeader from './VDatePickerHeader';
import VDatePickerDateTable from './VDatePickerDateTable';
import VDatePickerMonthTable from './VDatePickerMonthTable';
import VDatePickerYears from './VDatePickerYears'; // Mixins
import Localable from '../../mixins/localable';
import mixins from '../../util/mixins';
import Picker from '../../mixins/picker'; // Utils
import { createItemTypeListeners, createNativeLocaleFormatter, pad } from './util';
import isDateAllowed from './util/isDateAllowed';
import { consoleWarn } from '../../util/console';
import { daysInMonth } from '../VCalendar/util/timestamp'; // Adds leading zero to month/day if necessary, returns 'YYYY' if type = 'year',
// 'YYYY-MM' if 'month' and 'YYYY-MM-DD' if 'date'
function sanitizeDateString(dateString, type) {
const [year, month = 1, date = 1] = dateString.split('-');
return `${year}-${pad(month)}-${pad(date)}`.substr(0, {
date: 10,
month: 7,
year: 4
}[type]);
}
export default mixins(Localable, Picker
/* @vue/component */
).extend({
name: 'v-date-picker',
props: {
allowedDates: Function,
// Function formatting the day in date picker table
dayFormat: Function,
disabled: Boolean,
events: {
type: [Array, Function, Object],
default: () => null
},
eventColor: {
type: [Array, Function, Object, String],
default: () => 'warning'
},
firstDayOfWeek: {
type: [String, Number],
default: 0
},
// Function formatting the tableDate in the day/month table header
headerDateFormat: Function,
localeFirstDayOfYear: {
type: [String, Number],
default: 0
},
max: String,
min: String,
// Function formatting month in the months table
monthFormat: Function,
multiple: Boolean,
nextIcon: {
type: String,
default: '$next'
},
nextMonthAriaLabel: {
type: String,
default: '$vuetify.datePicker.nextMonthAriaLabel'
},
nextYearAriaLabel: {
type: String,
default: '$vuetify.datePicker.nextYearAriaLabel'
},
pickerDate: String,
prevIcon: {
type: String,
default: '$prev'
},
prevMonthAriaLabel: {
type: String,
default: '$vuetify.datePicker.prevMonthAriaLabel'
},
prevYearAriaLabel: {
type: String,
default: '$vuetify.datePicker.prevYearAriaLabel'
},
range: Boolean,
reactive: Boolean,
readonly: Boolean,
scrollable: Boolean,
showCurrent: {
type: [Boolean, String],
default: true
},
selectedItemsText: {
type: String,
default: '$vuetify.datePicker.itemsSelected'
},
showWeek: Boolean,
// Function formatting currently selected date in the picker title
titleDateFormat: Function,
type: {
type: String,
default: 'date',
validator: type => ['date', 'month'].includes(type)
},
value: [Array, String],
weekdayFormat: Function,
// Function formatting the year in table header and pickup title
yearFormat: Function,
yearIcon: String
},
data() {
const now = new Date();
return {
activePicker: this.type.toUpperCase(),
inputDay: null,
inputMonth: null,
inputYear: null,
isReversing: false,
now,
// tableDate is a string in 'YYYY' / 'YYYY-M' format (leading zero for month is not required)
tableDate: (() => {
if (this.pickerDate) {
return this.pickerDate;
}
const date = (this.multiple || this.range ? this.value[this.value.length - 1] : this.value) || (typeof this.showCurrent === 'string' ? this.showCurrent : `${now.getFullYear()}-${now.getMonth() + 1}`);
return sanitizeDateString(date, this.type === 'date' ? 'month' : 'year');
})()
};
},
computed: {
isMultiple() {
return this.multiple || this.range;
},
lastValue() {
return this.isMultiple ? this.value[this.value.length - 1] : this.value;
},
selectedMonths() {
if (!this.value || !this.value.length || this.type === 'month') {
return this.value;
} else if (this.isMultiple) {
return this.value.map(val => val.substr(0, 7));
} else {
return this.value.substr(0, 7);
}
},
current() {
if (this.showCurrent === true) {
return sanitizeDateString(`${this.now.getFullYear()}-${this.now.getMonth() + 1}-${this.now.getDate()}`, this.type);
}
return this.showCurrent || null;
},
inputDate() {
return this.type === 'date' ? `${this.inputYear}-${pad(this.inputMonth + 1)}-${pad(this.inputDay)}` : `${this.inputYear}-${pad(this.inputMonth + 1)}`;
},
tableMonth() {
return Number((this.pickerDate || this.tableDate).split('-')[1]) - 1;
},
tableYear() {
return Number((this.pickerDate || this.tableDate).split('-')[0]);
},
minMonth() {
return this.min ? sanitizeDateString(this.min, 'month') : null;
},
maxMonth() {
return this.max ? sanitizeDateString(this.max, 'month') : null;
},
minYear() {
return this.min ? sanitizeDateString(this.min, 'year') : null;
},
maxYear() {
return this.max ? sanitizeDateString(this.max, 'year') : null;
},
formatters() {
return {
year: this.yearFormat || createNativeLocaleFormatter(this.currentLocale, {
year: 'numeric',
timeZone: 'UTC'
}, {
length: 4
}),
titleDate: this.titleDateFormat || (this.isMultiple ? this.defaultTitleMultipleDateFormatter : this.defaultTitleDateFormatter)
};
},
defaultTitleMultipleDateFormatter() {
return dates => {
if (!dates.length) {
return '-';
}
if (dates.length === 1) {
return this.defaultTitleDateFormatter(dates[0]);
}
return this.$vuetify.lang.t(this.selectedItemsText, dates.length);
};
},
defaultTitleDateFormatter() {
const titleFormats = {
year: {
year: 'numeric',
timeZone: 'UTC'
},
month: {
month: 'long',
timeZone: 'UTC'
},
date: {
weekday: 'short',
month: 'short',
day: 'numeric',
timeZone: 'UTC'
}
};
const titleDateFormatter = createNativeLocaleFormatter(this.currentLocale, titleFormats[this.type], {
start: 0,
length: {
date: 10,
month: 7,
year: 4
}[this.type]
});
const landscapeFormatter = date => titleDateFormatter(date).replace(/([^\d\s])([\d])/g, (match, nonDigit, digit) => `${nonDigit} ${digit}`).replace(', ', ',<br>');
return this.landscape ? landscapeFormatter : titleDateFormatter;
}
},
watch: {
tableDate(val, prev) {
// Make a ISO 8601 strings from val and prev for comparision, otherwise it will incorrectly
// compare for example '2000-9' and '2000-10'
const sanitizeType = this.type === 'month' ? 'year' : 'month';
this.isReversing = sanitizeDateString(val, sanitizeType) < sanitizeDateString(prev, sanitizeType);
this.$emit('update:picker-date', val);
},
pickerDate(val) {
if (val) {
this.tableDate = val;
} else if (this.lastValue && this.type === 'date') {
this.tableDate = sanitizeDateString(this.lastValue, 'month');
} else if (this.lastValue && this.type === 'month') {
this.tableDate = sanitizeDateString(this.lastValue, 'year');
}
},
value(newValue, oldValue) {
this.checkMultipleProp();
this.setInputDate();
if (!this.isMultiple && this.value && !this.pickerDate) {
this.tableDate = sanitizeDateString(this.inputDate, this.type === 'month' ? 'year' : 'month');
} else if (this.isMultiple && this.value.length && !oldValue.length && !this.pickerDate) {
this.tableDate = sanitizeDateString(this.inputDate, this.type === 'month' ? 'year' : 'month');
}
},
type(type) {
this.activePicker = type.toUpperCase();
if (this.value && this.value.length) {
const output = (this.isMultiple ? this.value : [this.value]).map(val => sanitizeDateString(val, type)).filter(this.isDateAllowed);
this.$emit('input', this.isMultiple ? output : output[0]);
}
}
},
created() {
this.checkMultipleProp();
if (this.pickerDate !== this.tableDate) {
this.$emit('update:picker-date', this.tableDate);
}
this.setInputDate();
},
methods: {
emitInput(newInput) {
if (this.range && this.value) {
if (this.value.length !== 1) {
this.$emit('input', [newInput]);
} else {
const output = [...this.value, newInput];
this.$emit('input', output);
this.$emit('change', output);
}
return;
}
const output = this.multiple ? this.value.indexOf(newInput) === -1 ? this.value.concat([newInput]) : this.value.filter(x => x !== newInput) : newInput;
this.$emit('input', output);
this.multiple || this.$emit('change', newInput);
},
checkMultipleProp() {
if (this.value == null) return;
const valueType = this.value.constructor.name;
const expected = this.isMultiple ? 'Array' : 'String';
if (valueType !== expected) {
consoleWarn(`Value must be ${this.isMultiple ? 'an' : 'a'} ${expected}, got ${valueType}`, this);
}
},
isDateAllowed(value) {
return isDateAllowed(value, this.min, this.max, this.allowedDates);
},
yearClick(value) {
this.inputYear = value;
if (this.type === 'month') {
this.tableDate = `${value}`;
} else {
this.tableDate = `${value}-${pad((this.tableMonth || 0) + 1)}`;
}
this.activePicker = 'MONTH';
if (this.reactive && !this.readonly && !this.isMultiple && this.isDateAllowed(this.inputDate)) {
this.$emit('input', this.inputDate);
}
},
monthClick(value) {
this.inputYear = parseInt(value.split('-')[0], 10);
this.inputMonth = parseInt(value.split('-')[1], 10) - 1;
if (this.type === 'date') {
if (this.inputDay) {
this.inputDay = Math.min(this.inputDay, daysInMonth(this.inputYear, this.inputMonth + 1));
}
this.tableDate = value;
this.activePicker = 'DATE';
if (this.reactive && !this.readonly && !this.isMultiple && this.isDateAllowed(this.inputDate)) {
this.$emit('input', this.inputDate);
}
} else {
this.emitInput(this.inputDate);
}
},
dateClick(value) {
this.inputYear = parseInt(value.split('-')[0], 10);
this.inputMonth = parseInt(value.split('-')[1], 10) - 1;
this.inputDay = parseInt(value.split('-')[2], 10);
this.emitInput(this.inputDate);
},
genPickerTitle() {
return this.$createElement(VDatePickerTitle, {
props: {
date: this.value ? this.formatters.titleDate(this.value) : '',
disabled: this.disabled,
readonly: this.readonly,
selectingYear: this.activePicker === 'YEAR',
year: this.formatters.year(this.value ? `${this.inputYear}` : this.tableDate),
yearIcon: this.yearIcon,
value: this.isMultiple ? this.value[0] : this.value
},
slot: 'title',
on: {
'update:selecting-year': value => this.activePicker = value ? 'YEAR' : this.type.toUpperCase()
}
});
},
genTableHeader() {
return this.$createElement(VDatePickerHeader, {
props: {
nextIcon: this.nextIcon,
color: this.color,
dark: this.dark,
disabled: this.disabled,
format: this.headerDateFormat,
light: this.light,
locale: this.locale,
min: this.activePicker === 'DATE' ? this.minMonth : this.minYear,
max: this.activePicker === 'DATE' ? this.maxMonth : this.maxYear,
nextAriaLabel: this.activePicker === 'DATE' ? this.nextMonthAriaLabel : this.nextYearAriaLabel,
prevAriaLabel: this.activePicker === 'DATE' ? this.prevMonthAriaLabel : this.prevYearAriaLabel,
prevIcon: this.prevIcon,
readonly: this.readonly,
value: this.activePicker === 'DATE' ? `${pad(this.tableYear, 4)}-${pad(this.tableMonth + 1)}` : `${pad(this.tableYear, 4)}`
},
on: {
toggle: () => this.activePicker = this.activePicker === 'DATE' ? 'MONTH' : 'YEAR',
input: value => this.tableDate = value
}
});
},
genDateTable() {
return this.$createElement(VDatePickerDateTable, {
props: {
allowedDates: this.allowedDates,
color: this.color,
current: this.current,
dark: this.dark,
disabled: this.disabled,
events: this.events,
eventColor: this.eventColor,
firstDayOfWeek: this.firstDayOfWeek,
format: this.dayFormat,
light: this.light,
locale: this.locale,
localeFirstDayOfYear: this.localeFirstDayOfYear,
min: this.min,
max: this.max,
range: this.range,
readonly: this.readonly,
scrollable: this.scrollable,
showWeek: this.showWeek,
tableDate: `${pad(this.tableYear, 4)}-${pad(this.tableMonth + 1)}`,
value: this.value,
weekdayFormat: this.weekdayFormat
},
ref: 'table',
on: {
input: this.dateClick,
'update:table-date': value => this.tableDate = value,
...createItemTypeListeners(this, ':date')
}
});
},
genMonthTable() {
return this.$createElement(VDatePickerMonthTable, {
props: {
allowedDates: this.type === 'month' ? this.allowedDates : null,
color: this.color,
current: this.current ? sanitizeDateString(this.current, 'month') : null,
dark: this.dark,
disabled: this.disabled,
events: this.type === 'month' ? this.events : null,
eventColor: this.type === 'month' ? this.eventColor : null,
format: this.monthFormat,
light: this.light,
locale: this.locale,
min: this.minMonth,
max: this.maxMonth,
range: this.range,
readonly: this.readonly && this.type === 'month',
scrollable: this.scrollable,
value: this.selectedMonths,
tableDate: `${pad(this.tableYear, 4)}`
},
ref: 'table',
on: {
input: this.monthClick,
'update:table-date': value => this.tableDate = value,
...createItemTypeListeners(this, ':month')
}
});
},
genYears() {
return this.$createElement(VDatePickerYears, {
props: {
color: this.color,
format: this.yearFormat,
locale: this.locale,
min: this.minYear,
max: this.maxYear,
value: this.tableYear
},
on: {
input: this.yearClick,
...createItemTypeListeners(this, ':year')
}
});
},
genPickerBody() {
const children = this.activePicker === 'YEAR' ? [this.genYears()] : [this.genTableHeader(), this.activePicker === 'DATE' ? this.genDateTable() : this.genMonthTable()];
return this.$createElement('div', {
key: this.activePicker
}, children);
},
setInputDate() {
if (this.lastValue) {
const array = this.lastValue.split('-');
this.inputYear = parseInt(array[0], 10);
this.inputMonth = parseInt(array[1], 10) - 1;
if (this.type === 'date') {
this.inputDay = parseInt(array[2], 10);
}
} else {
this.inputYear = this.inputYear || this.now.getFullYear();
this.inputMonth = this.inputMonth == null ? this.inputMonth : this.now.getMonth();
this.inputDay = this.inputDay || this.now.getDate();
}
}
},
render() {
return this.genPicker('v-picker--date');
}
});
//# sourceMappingURL=VDatePicker.js.map
File diff suppressed because one or more lines are too long
-125
View File
@@ -1,125 +0,0 @@
// Mixins
import DatePickerTable from './mixins/date-picker-table'; // Utils
import { weekNumber } from '../../util/dateTimeUtils';
import { pad, createNativeLocaleFormatter, monthChange } from './util';
import { createRange } from '../../util/helpers';
import mixins from '../../util/mixins';
export default mixins(DatePickerTable
/* @vue/component */
).extend({
name: 'v-date-picker-date-table',
props: {
firstDayOfWeek: {
type: [String, Number],
default: 0
},
localeFirstDayOfYear: {
type: [String, Number],
default: 0
},
showWeek: Boolean,
weekdayFormat: Function
},
computed: {
formatter() {
return this.format || createNativeLocaleFormatter(this.currentLocale, {
day: 'numeric',
timeZone: 'UTC'
}, {
start: 8,
length: 2
});
},
weekdayFormatter() {
return this.weekdayFormat || createNativeLocaleFormatter(this.currentLocale, {
weekday: 'narrow',
timeZone: 'UTC'
});
},
weekDays() {
const first = parseInt(this.firstDayOfWeek, 10);
return this.weekdayFormatter ? createRange(7).map(i => this.weekdayFormatter(`2017-01-${first + i + 15}`)) // 2017-01-15 is Sunday
: createRange(7).map(i => ['S', 'M', 'T', 'W', 'T', 'F', 'S'][(i + first) % 7]);
}
},
methods: {
calculateTableDate(delta) {
return monthChange(this.tableDate, Math.sign(delta || 1));
},
genTHead() {
const days = this.weekDays.map(day => this.$createElement('th', day));
if (this.showWeek) {
days.unshift(this.$createElement('th'));
}
return this.$createElement('thead', this.genTR(days));
},
// Returns number of the days from the firstDayOfWeek to the first day of the current month
weekDaysBeforeFirstDayOfTheMonth() {
const firstDayOfTheMonth = new Date(`${this.displayedYear}-${pad(this.displayedMonth + 1)}-01T00:00:00+00:00`);
const weekDay = firstDayOfTheMonth.getUTCDay();
return (weekDay - parseInt(this.firstDayOfWeek) + 7) % 7;
},
getWeekNumber(dayInMonth) {
return weekNumber(this.displayedYear, this.displayedMonth, dayInMonth, parseInt(this.firstDayOfWeek), parseInt(this.localeFirstDayOfYear));
},
genWeekNumber(weekNumber) {
return this.$createElement('td', [this.$createElement('small', {
staticClass: 'v-date-picker-table--date__week'
}, String(weekNumber).padStart(2, '0'))]);
},
genTBody() {
const children = [];
const daysInMonth = new Date(this.displayedYear, this.displayedMonth + 1, 0).getDate();
let rows = [];
let day = this.weekDaysBeforeFirstDayOfTheMonth();
if (this.showWeek) {
rows.push(this.genWeekNumber(this.getWeekNumber(1)));
}
while (day--) rows.push(this.$createElement('td'));
for (day = 1; day <= daysInMonth; day++) {
const date = `${this.displayedYear}-${pad(this.displayedMonth + 1)}-${pad(day)}`;
rows.push(this.$createElement('td', [this.genButton(date, true, 'date', this.formatter)]));
if (rows.length % (this.showWeek ? 8 : 7) === 0) {
children.push(this.genTR(rows));
rows = [];
if (this.showWeek && day < daysInMonth) {
rows.push(this.genWeekNumber(this.getWeekNumber(day + 7)));
}
}
}
if (rows.length) {
children.push(this.genTR(rows));
}
return this.$createElement('tbody', children);
},
genTR(children) {
return [this.$createElement('tr', children)];
}
},
render() {
return this.genTable('v-date-picker-table v-date-picker-table--date', [this.genTHead(), this.genTBody()], this.calculateTableDate);
}
});
//# sourceMappingURL=VDatePickerDateTable.js.map
File diff suppressed because one or more lines are too long
-145
View File
@@ -1,145 +0,0 @@
import "../../../src/components/VDatePicker/VDatePickerHeader.sass"; // Components
import VBtn from '../VBtn';
import VIcon from '../VIcon'; // Mixins
import Colorable from '../../mixins/colorable';
import Localable from '../../mixins/localable';
import Themeable from '../../mixins/themeable'; // Utils
import { createNativeLocaleFormatter, monthChange } from './util';
import mixins from '../../util/mixins';
export default mixins(Colorable, Localable, Themeable
/* @vue/component */
).extend({
name: 'v-date-picker-header',
props: {
disabled: Boolean,
format: Function,
min: String,
max: String,
nextAriaLabel: String,
nextIcon: {
type: String,
default: '$next'
},
prevAriaLabel: String,
prevIcon: {
type: String,
default: '$prev'
},
readonly: Boolean,
value: {
type: [Number, String],
required: true
}
},
data() {
return {
isReversing: false
};
},
computed: {
formatter() {
if (this.format) {
return this.format;
} else if (String(this.value).split('-')[1]) {
return createNativeLocaleFormatter(this.currentLocale, {
month: 'long',
year: 'numeric',
timeZone: 'UTC'
}, {
length: 7
});
} else {
return createNativeLocaleFormatter(this.currentLocale, {
year: 'numeric',
timeZone: 'UTC'
}, {
length: 4
});
}
}
},
watch: {
value(newVal, oldVal) {
this.isReversing = newVal < oldVal;
}
},
methods: {
genBtn(change) {
const ariaLabelId = change > 0 ? this.nextAriaLabel : this.prevAriaLabel;
const ariaLabel = ariaLabelId ? this.$vuetify.lang.t(ariaLabelId) : undefined;
const disabled = this.disabled || change < 0 && this.min && this.calculateChange(change) < this.min || change > 0 && this.max && this.calculateChange(change) > this.max;
return this.$createElement(VBtn, {
attrs: {
'aria-label': ariaLabel
},
props: {
dark: this.dark,
disabled,
icon: true,
light: this.light
},
on: {
click: e => {
e.stopPropagation();
this.$emit('input', this.calculateChange(change));
}
}
}, [this.$createElement(VIcon, change < 0 === !this.$vuetify.rtl ? this.prevIcon : this.nextIcon)]);
},
calculateChange(sign) {
const [year, month] = String(this.value).split('-').map(Number);
if (month == null) {
return `${year + sign}`;
} else {
return monthChange(String(this.value), sign);
}
},
genHeader() {
const color = !this.disabled && (this.color || 'accent');
const header = this.$createElement('div', this.setTextColor(color, {
key: String(this.value)
}), [this.$createElement('button', {
attrs: {
type: 'button'
},
on: {
click: () => this.$emit('toggle')
}
}, [this.$slots.default || this.formatter(String(this.value))])]);
const transition = this.$createElement('transition', {
props: {
name: this.isReversing === !this.$vuetify.rtl ? 'tab-reverse-transition' : 'tab-transition'
}
}, [header]);
return this.$createElement('div', {
staticClass: 'v-date-picker-header__value',
class: {
'v-date-picker-header__value--disabled': this.disabled
}
}, [transition]);
}
},
render() {
return this.$createElement('div', {
staticClass: 'v-date-picker-header',
class: {
'v-date-picker-header--disabled': this.disabled,
...this.themeClasses
}
}, [this.genBtn(-1), this.genHeader(), this.genBtn(+1)]);
}
});
//# sourceMappingURL=VDatePickerHeader.js.map
File diff suppressed because one or more lines are too long
@@ -1,55 +0,0 @@
// Mixins
import DatePickerTable from './mixins/date-picker-table'; // Utils
import { pad, createNativeLocaleFormatter } from './util';
import mixins from '../../util/mixins';
export default mixins(DatePickerTable
/* @vue/component */
).extend({
name: 'v-date-picker-month-table',
computed: {
formatter() {
return this.format || createNativeLocaleFormatter(this.currentLocale, {
month: 'short',
timeZone: 'UTC'
}, {
start: 5,
length: 2
});
}
},
methods: {
calculateTableDate(delta) {
return `${parseInt(this.tableDate, 10) + Math.sign(delta || 1)}`;
},
genTBody() {
const children = [];
const cols = Array(3).fill(null);
const rows = 12 / cols.length;
for (let row = 0; row < rows; row++) {
const tds = cols.map((_, col) => {
const month = row * cols.length + col;
const date = `${this.displayedYear}-${pad(month + 1)}`;
return this.$createElement('td', {
key: month
}, [this.genButton(date, false, 'month', this.formatter)]);
});
children.push(this.$createElement('tr', {
key: row
}, tds));
}
return this.$createElement('tbody', children);
}
},
render() {
return this.genTable('v-date-picker-table v-date-picker-table--month', [this.genTBody()], this.calculateTableDate);
}
});
//# sourceMappingURL=VDatePickerMonthTable.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/components/VDatePicker/VDatePickerMonthTable.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,eAAP,MAA4B,4BAA5B,C,CAEA;;AACA,SAAS,GAAT,EAAc,2BAAd,QAAiD,QAAjD;AACA,OAAO,MAAP,MAAmB,mBAAnB;AAMA,eAAe,MAAM,CACnB;AACF;AAFqB,CAAN,CAGb,MAHa,CAGN;AACP,EAAA,IAAI,EAAE,2BADC;AAGP,EAAA,QAAQ,EAAE;AACR,IAAA,SAAS,GAAA;AACP,aAAO,KAAK,MAAL,IAAe,2BAA2B,CAAC,KAAK,aAAN,EAAqB;AAAE,QAAA,KAAK,EAAE,OAAT;AAAkB,QAAA,QAAQ,EAAE;AAA5B,OAArB,EAA0D;AAAE,QAAA,KAAK,EAAE,CAAT;AAAY,QAAA,MAAM,EAAE;AAApB,OAA1D,CAAjD;AACD;;AAHO,GAHH;AASP,EAAA,OAAO,EAAE;AACP,IAAA,kBAAkB,CAAE,KAAF,EAAe;AAC/B,aAAO,GAAG,QAAQ,CAAC,KAAK,SAAN,EAAiB,EAAjB,CAAR,GAA+B,IAAI,CAAC,IAAL,CAAU,KAAK,IAAI,CAAnB,CAAqB,EAA9D;AACD,KAHM;;AAIP,IAAA,QAAQ,GAAA;AACN,YAAM,QAAQ,GAAG,EAAjB;AACA,YAAM,IAAI,GAAG,KAAK,CAAC,CAAD,CAAL,CAAS,IAAT,CAAc,IAAd,CAAb;AACA,YAAM,IAAI,GAAG,KAAK,IAAI,CAAC,MAAvB;;AAEA,WAAK,IAAI,GAAG,GAAG,CAAf,EAAkB,GAAG,GAAG,IAAxB,EAA8B,GAAG,EAAjC,EAAqC;AACnC,cAAM,GAAG,GAAG,IAAI,CAAC,GAAL,CAAS,CAAC,CAAD,EAAI,GAAJ,KAAW;AAC9B,gBAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,MAAX,GAAoB,GAAlC;AACA,gBAAM,IAAI,GAAG,GAAG,KAAK,aAAa,IAAI,GAAG,CAAC,KAAK,GAAG,CAAT,CAAW,EAApD;AACA,iBAAO,KAAK,cAAL,CAAoB,IAApB,EAA0B;AAC/B,YAAA,GAAG,EAAE;AAD0B,WAA1B,EAEJ,CACD,KAAK,SAAL,CAAe,IAAf,EAAqB,KAArB,EAA4B,OAA5B,EAAqC,KAAK,SAA1C,CADC,CAFI,CAAP;AAKD,SARW,CAAZ;AAUA,QAAA,QAAQ,CAAC,IAAT,CAAc,KAAK,cAAL,CAAoB,IAApB,EAA0B;AACtC,UAAA,GAAG,EAAE;AADiC,SAA1B,EAEX,GAFW,CAAd;AAGD;;AAED,aAAO,KAAK,cAAL,CAAoB,OAApB,EAA6B,QAA7B,CAAP;AACD;;AA1BM,GATF;;AAsCP,EAAA,MAAM,GAAA;AACJ,WAAO,KAAK,QAAL,CAAc,gDAAd,EAAgE,CACrE,KAAK,QAAL,EADqE,CAAhE,EAEJ,KAAK,kBAFD,CAAP;AAGD;;AA1CM,CAHM,CAAf","sourcesContent":["// Mixins\nimport DatePickerTable from './mixins/date-picker-table'\n\n// Utils\nimport { pad, createNativeLocaleFormatter } from './util'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\nimport { DatePickerFormatter } from 'vuetify/types'\n\nexport default mixins(\n DatePickerTable\n/* @vue/component */\n).extend({\n name: 'v-date-picker-month-table',\n\n computed: {\n formatter (): DatePickerFormatter {\n return this.format || createNativeLocaleFormatter(this.currentLocale, { month: 'short', timeZone: 'UTC' }, { start: 5, length: 2 })\n },\n },\n\n methods: {\n calculateTableDate (delta: number) {\n return `${parseInt(this.tableDate, 10) + Math.sign(delta || 1)}`\n },\n genTBody () {\n const children = []\n const cols = Array(3).fill(null)\n const rows = 12 / cols.length\n\n for (let row = 0; row < rows; row++) {\n const tds = cols.map((_, col) => {\n const month = row * cols.length + col\n const date = `${this.displayedYear}-${pad(month + 1)}`\n return this.$createElement('td', {\n key: month,\n }, [\n this.genButton(date, false, 'month', this.formatter),\n ])\n })\n\n children.push(this.$createElement('tr', {\n key: row,\n }, tds))\n }\n\n return this.$createElement('tbody', children)\n },\n },\n\n render (): VNode {\n return this.genTable('v-date-picker-table v-date-picker-table--month', [\n this.genTBody(),\n ], this.calculateTableDate)\n },\n})\n"],"sourceRoot":"","file":"VDatePickerMonthTable.js"}
-88
View File
@@ -1,88 +0,0 @@
import "../../../src/components/VDatePicker/VDatePickerTitle.sass"; // Components
import VIcon from '../VIcon'; // Mixins
import PickerButton from '../../mixins/picker-button'; // Utils
import mixins from '../../util/mixins';
export default mixins(PickerButton
/* @vue/component */
).extend({
name: 'v-date-picker-title',
props: {
date: {
type: String,
default: ''
},
disabled: Boolean,
readonly: Boolean,
selectingYear: Boolean,
value: {
type: String
},
year: {
type: [Number, String],
default: ''
},
yearIcon: {
type: String
}
},
data: () => ({
isReversing: false
}),
computed: {
computedTransition() {
return this.isReversing ? 'picker-reverse-transition' : 'picker-transition';
}
},
watch: {
value(val, prev) {
this.isReversing = val < prev;
}
},
methods: {
genYearIcon() {
return this.$createElement(VIcon, {
props: {
dark: true
}
}, this.yearIcon);
},
getYearBtn() {
return this.genPickerButton('selectingYear', true, [String(this.year), this.yearIcon ? this.genYearIcon() : null], false, 'v-date-picker-title__year');
},
genTitleText() {
return this.$createElement('transition', {
props: {
name: this.computedTransition
}
}, [this.$createElement('div', {
domProps: {
innerHTML: this.date || '&nbsp;'
},
key: this.value
})]);
},
genTitleDate() {
return this.genPickerButton('selectingYear', false, [this.genTitleText()], false, 'v-date-picker-title__date');
}
},
render(h) {
return h('div', {
staticClass: 'v-date-picker-title',
class: {
'v-date-picker-title--disabled': this.disabled
}
}, [this.getYearBtn(), this.genTitleDate()]);
}
});
//# sourceMappingURL=VDatePickerTitle.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/components/VDatePicker/VDatePickerTitle.ts"],"names":[],"mappings":"AAAA,OAAO,2DAAP,C,CAEA;;AACA,OAAO,KAAP,MAAkB,UAAlB,C,CAEA;;AACA,OAAO,YAAP,MAAyB,4BAAzB,C,CAEA;;AACA,OAAO,MAAP,MAAmB,mBAAnB;AAKA,eAAe,MAAM,CACnB;AACF;AAFqB,CAAN,CAGb,MAHa,CAGN;AACP,EAAA,IAAI,EAAE,qBADC;AAGP,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,MADF;AAEJ,MAAA,OAAO,EAAE;AAFL,KADD;AAKL,IAAA,QAAQ,EAAE,OALL;AAML,IAAA,QAAQ,EAAE,OANL;AAOL,IAAA,aAAa,EAAE,OAPV;AAQL,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAE;AADD,KARF;AAWL,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADF;AAEJ,MAAA,OAAO,EAAE;AAFL,KAXD;AAeL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE;AADE;AAfL,GAHA;AAuBP,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,WAAW,EAAE;AADF,GAAP,CAvBC;AA2BP,EAAA,QAAQ,EAAE;AACR,IAAA,kBAAkB,GAAA;AAChB,aAAO,KAAK,WAAL,GAAmB,2BAAnB,GAAiD,mBAAxD;AACD;;AAHO,GA3BH;AAiCP,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,CAAE,GAAF,EAAe,IAAf,EAA2B;AAC9B,WAAK,WAAL,GAAmB,GAAG,GAAG,IAAzB;AACD;;AAHI,GAjCA;AAuCP,EAAA,OAAO,EAAE;AACP,IAAA,WAAW,GAAA;AACT,aAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,QAAA,KAAK,EAAE;AACL,UAAA,IAAI,EAAE;AADD;AADyB,OAA3B,EAIJ,KAAK,QAJD,CAAP;AAKD,KAPM;;AAQP,IAAA,UAAU,GAAA;AACR,aAAO,KAAK,eAAL,CAAqB,eAArB,EAAsC,IAAtC,EAA4C,CACjD,MAAM,CAAC,KAAK,IAAN,CAD2C,EAEjD,KAAK,QAAL,GAAgB,KAAK,WAAL,EAAhB,GAAqC,IAFY,CAA5C,EAGJ,KAHI,EAGG,2BAHH,CAAP;AAID,KAbM;;AAcP,IAAA,YAAY,GAAA;AACV,aAAO,KAAK,cAAL,CAAoB,YAApB,EAAkC;AACvC,QAAA,KAAK,EAAE;AACL,UAAA,IAAI,EAAE,KAAK;AADN;AADgC,OAAlC,EAIJ,CACD,KAAK,cAAL,CAAoB,KAApB,EAA2B;AACzB,QAAA,QAAQ,EAAE;AAAE,UAAA,SAAS,EAAE,KAAK,IAAL,IAAa;AAA1B,SADe;AAEzB,QAAA,GAAG,EAAE,KAAK;AAFe,OAA3B,CADC,CAJI,CAAP;AAUD,KAzBM;;AA0BP,IAAA,YAAY,GAAA;AACV,aAAO,KAAK,eAAL,CAAqB,eAArB,EAAsC,KAAtC,EAA6C,CAAC,KAAK,YAAL,EAAD,CAA7C,EAAoE,KAApE,EAA2E,2BAA3E,CAAP;AACD;;AA5BM,GAvCF;;AAsEP,EAAA,MAAM,CAAE,CAAF,EAAG;AACP,WAAO,CAAC,CAAC,KAAD,EAAQ;AACd,MAAA,WAAW,EAAE,qBADC;AAEd,MAAA,KAAK,EAAE;AACL,yCAAiC,KAAK;AADjC;AAFO,KAAR,EAKL,CACD,KAAK,UAAL,EADC,EAED,KAAK,YAAL,EAFC,CALK,CAAR;AASD;;AAhFM,CAHM,CAAf","sourcesContent":["import './VDatePickerTitle.sass'\n\n// Components\nimport VIcon from '../VIcon'\n\n// Mixins\nimport PickerButton from '../../mixins/picker-button'\n\n// Utils\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\nexport default mixins(\n PickerButton\n/* @vue/component */\n).extend({\n name: 'v-date-picker-title',\n\n props: {\n date: {\n type: String,\n default: '',\n },\n disabled: Boolean,\n readonly: Boolean,\n selectingYear: Boolean,\n value: {\n type: String,\n },\n year: {\n type: [Number, String],\n default: '',\n },\n yearIcon: {\n type: String,\n },\n },\n\n data: () => ({\n isReversing: false,\n }),\n\n computed: {\n computedTransition (): string {\n return this.isReversing ? 'picker-reverse-transition' : 'picker-transition'\n },\n },\n\n watch: {\n value (val: string, prev: string) {\n this.isReversing = val < prev\n },\n },\n\n methods: {\n genYearIcon (): VNode {\n return this.$createElement(VIcon, {\n props: {\n dark: true,\n },\n }, this.yearIcon)\n },\n getYearBtn (): VNode {\n return this.genPickerButton('selectingYear', true, [\n String(this.year),\n this.yearIcon ? this.genYearIcon() : null,\n ], false, 'v-date-picker-title__year')\n },\n genTitleText (): VNode {\n return this.$createElement('transition', {\n props: {\n name: this.computedTransition,\n },\n }, [\n this.$createElement('div', {\n domProps: { innerHTML: this.date || '&nbsp;' },\n key: this.value,\n }),\n ])\n },\n genTitleDate (): VNode {\n return this.genPickerButton('selectingYear', false, [this.genTitleText()], false, 'v-date-picker-title__date')\n },\n },\n\n render (h): VNode {\n return h('div', {\n staticClass: 'v-date-picker-title',\n class: {\n 'v-date-picker-title--disabled': this.disabled,\n },\n }, [\n this.getYearBtn(),\n this.genTitleDate(),\n ])\n },\n})\n"],"sourceRoot":"","file":"VDatePickerTitle.js"}
-94
View File
@@ -1,94 +0,0 @@
import "../../../src/components/VDatePicker/VDatePickerYears.sass"; // Mixins
import Colorable from '../../mixins/colorable';
import Localable from '../../mixins/localable'; // Utils
import { createItemTypeNativeListeners, createNativeLocaleFormatter } from './util';
import { mergeListeners } from '../../util/mergeData';
import mixins from '../../util/mixins';
export default mixins(Colorable, Localable
/* @vue/component */
).extend({
name: 'v-date-picker-years',
props: {
format: Function,
min: [Number, String],
max: [Number, String],
readonly: Boolean,
value: [Number, String]
},
data() {
return {
defaultColor: 'primary'
};
},
computed: {
formatter() {
return this.format || createNativeLocaleFormatter(this.currentLocale, {
year: 'numeric',
timeZone: 'UTC'
}, {
length: 4
});
}
},
mounted() {
setTimeout(() => {
const activeItem = this.$el.getElementsByClassName('active')[0];
if (activeItem) {
this.$el.scrollTop = activeItem.offsetTop - this.$el.offsetHeight / 2 + activeItem.offsetHeight / 2;
} else if (this.min && !this.max) {
this.$el.scrollTop = this.$el.scrollHeight;
} else if (!this.min && this.max) {
this.$el.scrollTop = 0;
} else {
this.$el.scrollTop = this.$el.scrollHeight / 2 - this.$el.offsetHeight / 2;
}
});
},
methods: {
genYearItem(year) {
const formatted = this.formatter(`${year}`);
const active = parseInt(this.value, 10) === year;
const color = active && (this.color || 'primary');
return this.$createElement('li', this.setTextColor(color, {
key: year,
class: {
active
},
on: mergeListeners({
click: () => this.$emit('input', year)
}, createItemTypeNativeListeners(this, ':year', year))
}), formatted);
},
genYearItems() {
const children = [];
const selectedYear = this.value ? parseInt(this.value, 10) : new Date().getFullYear();
const maxYear = this.max ? parseInt(this.max, 10) : selectedYear + 100;
const minYear = Math.min(maxYear, this.min ? parseInt(this.min, 10) : selectedYear - 100);
for (let year = maxYear; year >= minYear; year--) {
children.push(this.genYearItem(year));
}
return children;
}
},
render() {
return this.$createElement('ul', {
staticClass: 'v-date-picker-years',
ref: 'years'
}, this.genYearItems());
}
});
//# sourceMappingURL=VDatePickerYears.js.map
File diff suppressed because one or more lines are too long
-18
View File
@@ -1,18 +0,0 @@
import VDatePicker from './VDatePicker';
import VDatePickerTitle from './VDatePickerTitle';
import VDatePickerHeader from './VDatePickerHeader';
import VDatePickerDateTable from './VDatePickerDateTable';
import VDatePickerMonthTable from './VDatePickerMonthTable';
import VDatePickerYears from './VDatePickerYears';
export { VDatePicker, VDatePickerTitle, VDatePickerHeader, VDatePickerDateTable, VDatePickerMonthTable, VDatePickerYears };
export default {
$_vuetify_subcomponents: {
VDatePicker,
VDatePickerTitle,
VDatePickerHeader,
VDatePickerDateTable,
VDatePickerMonthTable,
VDatePickerYears
}
};
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/components/VDatePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAP,MAAwB,eAAxB;AACA,OAAO,gBAAP,MAA6B,oBAA7B;AACA,OAAO,iBAAP,MAA8B,qBAA9B;AACA,OAAO,oBAAP,MAAiC,wBAAjC;AACA,OAAO,qBAAP,MAAkC,yBAAlC;AACA,OAAO,gBAAP,MAA6B,oBAA7B;AAEA,SACE,WADF,EAEE,gBAFF,EAGE,iBAHF,EAIE,oBAJF,EAKE,qBALF,EAME,gBANF;AASA,eAAe;AACb,EAAA,uBAAuB,EAAE;AACvB,IAAA,WADuB;AAEvB,IAAA,gBAFuB;AAGvB,IAAA,iBAHuB;AAIvB,IAAA,oBAJuB;AAKvB,IAAA,qBALuB;AAMvB,IAAA;AANuB;AADZ,CAAf","sourcesContent":["import VDatePicker from './VDatePicker'\nimport VDatePickerTitle from './VDatePickerTitle'\nimport VDatePickerHeader from './VDatePickerHeader'\nimport VDatePickerDateTable from './VDatePickerDateTable'\nimport VDatePickerMonthTable from './VDatePickerMonthTable'\nimport VDatePickerYears from './VDatePickerYears'\n\nexport {\n VDatePicker,\n VDatePickerTitle,\n VDatePickerHeader,\n VDatePickerDateTable,\n VDatePickerMonthTable,\n VDatePickerYears,\n}\n\nexport default {\n $_vuetify_subcomponents: {\n VDatePicker,\n VDatePickerTitle,\n VDatePickerHeader,\n VDatePickerDateTable,\n VDatePickerMonthTable,\n VDatePickerYears,\n },\n}\n"],"sourceRoot":"","file":"index.js"}
@@ -1,212 +0,0 @@
import "../../../../src/components/VDatePicker/VDatePickerTable.sass"; // Directives
import Touch from '../../../directives/touch'; // Mixins
import Colorable from '../../../mixins/colorable';
import Localable from '../../../mixins/localable';
import Themeable from '../../../mixins/themeable'; // Utils
import { createItemTypeNativeListeners } from '../util';
import isDateAllowed from '../util/isDateAllowed';
import { mergeListeners } from '../../../util/mergeData';
import mixins from '../../../util/mixins';
import { throttle } from '../../../util/helpers';
export default mixins(Colorable, Localable, Themeable
/* @vue/component */
).extend({
directives: {
Touch
},
props: {
allowedDates: Function,
current: String,
disabled: Boolean,
format: Function,
events: {
type: [Array, Function, Object],
default: () => null
},
eventColor: {
type: [Array, Function, Object, String],
default: () => 'warning'
},
min: String,
max: String,
range: Boolean,
readonly: Boolean,
scrollable: Boolean,
tableDate: {
type: String,
required: true
},
value: [String, Array]
},
data: () => ({
isReversing: false,
wheelThrottle: null
}),
computed: {
computedTransition() {
return this.isReversing === !this.$vuetify.rtl ? 'tab-reverse-transition' : 'tab-transition';
},
displayedMonth() {
return Number(this.tableDate.split('-')[1]) - 1;
},
displayedYear() {
return Number(this.tableDate.split('-')[0]);
}
},
watch: {
tableDate(newVal, oldVal) {
this.isReversing = newVal < oldVal;
}
},
mounted() {
this.wheelThrottle = throttle(this.wheel, 250);
},
methods: {
genButtonClasses(isAllowed, isFloating, isSelected, isCurrent) {
return {
'v-size--default': !isFloating,
'v-date-picker-table__current': isCurrent,
'v-btn--active': isSelected,
'v-btn--flat': !isAllowed || this.disabled,
'v-btn--text': isSelected === isCurrent,
'v-btn--rounded': isFloating,
'v-btn--disabled': !isAllowed || this.disabled,
'v-btn--outlined': isCurrent && !isSelected,
...this.themeClasses
};
},
genButtonEvents(value, isAllowed, mouseEventType) {
if (this.disabled) return undefined;
return mergeListeners({
click: () => {
if (isAllowed && !this.readonly) this.$emit('input', value);
}
}, createItemTypeNativeListeners(this, `:${mouseEventType}`, value));
},
genButton(value, isFloating, mouseEventType, formatter) {
const isAllowed = isDateAllowed(value, this.min, this.max, this.allowedDates);
const isSelected = this.isSelected(value) && isAllowed;
const isCurrent = value === this.current;
const setColor = isSelected ? this.setBackgroundColor : this.setTextColor;
const color = (isSelected || isCurrent) && (this.color || 'accent');
return this.$createElement('button', setColor(color, {
staticClass: 'v-btn',
class: this.genButtonClasses(isAllowed, isFloating, isSelected, isCurrent),
attrs: {
type: 'button'
},
domProps: {
disabled: this.disabled || !isAllowed
},
on: this.genButtonEvents(value, isAllowed, mouseEventType)
}), [this.$createElement('div', {
staticClass: 'v-btn__content'
}, [formatter(value)]), this.genEvents(value)]);
},
getEventColors(date) {
const arrayize = v => Array.isArray(v) ? v : [v];
let eventData;
let eventColors = [];
if (Array.isArray(this.events)) {
eventData = this.events.includes(date);
} else if (this.events instanceof Function) {
eventData = this.events(date) || false;
} else if (this.events) {
eventData = this.events[date] || false;
} else {
eventData = false;
}
if (!eventData) {
return [];
} else if (eventData !== true) {
eventColors = arrayize(eventData);
} else if (typeof this.eventColor === 'string') {
eventColors = [this.eventColor];
} else if (typeof this.eventColor === 'function') {
eventColors = arrayize(this.eventColor(date));
} else if (Array.isArray(this.eventColor)) {
eventColors = this.eventColor;
} else {
eventColors = arrayize(this.eventColor[date]);
}
return eventColors.filter(v => v);
},
genEvents(date) {
const eventColors = this.getEventColors(date);
return eventColors.length ? this.$createElement('div', {
staticClass: 'v-date-picker-table__events'
}, eventColors.map(color => this.$createElement('div', this.setBackgroundColor(color)))) : null;
},
wheel(e, calculateTableDate) {
this.$emit('update:table-date', calculateTableDate(e.deltaY));
},
touch(value, calculateTableDate) {
this.$emit('update:table-date', calculateTableDate(value));
},
genTable(staticClass, children, calculateTableDate) {
const transition = this.$createElement('transition', {
props: {
name: this.computedTransition
}
}, [this.$createElement('table', {
key: this.tableDate
}, children)]);
const touchDirective = {
name: 'touch',
value: {
left: e => e.offsetX < -15 && this.touch(1, calculateTableDate),
right: e => e.offsetX > 15 && this.touch(-1, calculateTableDate)
}
};
return this.$createElement('div', {
staticClass,
class: {
'v-date-picker-table--disabled': this.disabled,
...this.themeClasses
},
on: !this.disabled && this.scrollable ? {
wheel: e => {
e.preventDefault();
this.wheelThrottle(e, calculateTableDate);
}
} : undefined,
directives: [touchDirective]
}, [transition]);
},
isSelected(value) {
if (Array.isArray(this.value)) {
if (this.range && this.value.length === 2) {
const [from, to] = [...this.value].sort();
return from <= value && value <= to;
} else {
return this.value.indexOf(value) !== -1;
}
}
return value === this.value;
}
}
});
//# sourceMappingURL=date-picker-table.js.map
File diff suppressed because one or more lines are too long
@@ -1,21 +0,0 @@
import pad from './pad';
function createNativeLocaleFormatter(locale, options, substrOptions = {
start: 0,
length: 0
}) {
const makeIsoString = dateString => {
const [year, month, date] = dateString.trim().split(' ')[0].split('-');
return [pad(year, 4), pad(month || 1), pad(date || 1)].join('-');
};
try {
const intlFormatter = new Intl.DateTimeFormat(locale || undefined, options);
return dateString => intlFormatter.format(new Date(`${makeIsoString(dateString)}T00:00:00+00:00`));
} catch (e) {
return substrOptions.start || substrOptions.length ? dateString => makeIsoString(dateString).substr(substrOptions.start || 0, substrOptions.length) : undefined;
}
}
export default createNativeLocaleFormatter;
//# sourceMappingURL=createNativeLocaleFormatter.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/components/VDatePicker/util/createNativeLocaleFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,OAAhB;;AAmBA,SAAS,2BAAT,CACE,MADF,EAEE,OAFF,EAGE,aAAA,GAA+B;AAAE,EAAA,KAAK,EAAE,CAAT;AAAY,EAAA,MAAM,EAAE;AAApB,CAHjC,EAGwD;AAEtD,QAAM,aAAa,GAAI,UAAD,IAAuB;AAC3C,UAAM,CAAC,IAAD,EAAO,KAAP,EAAc,IAAd,IAAsB,UAAU,CAAC,IAAX,GAAkB,KAAlB,CAAwB,GAAxB,EAA6B,CAA7B,EAAgC,KAAhC,CAAsC,GAAtC,CAA5B;AACA,WAAO,CAAC,GAAG,CAAC,IAAD,EAAO,CAAP,CAAJ,EAAe,GAAG,CAAC,KAAK,IAAI,CAAV,CAAlB,EAAgC,GAAG,CAAC,IAAI,IAAI,CAAT,CAAnC,EAAgD,IAAhD,CAAqD,GAArD,CAAP;AACD,GAHD;;AAKA,MAAI;AACF,UAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAT,CAAwB,MAAM,IAAI,SAAlC,EAA6C,OAA7C,CAAtB;AACA,WAAQ,UAAD,IAAwB,aAAa,CAAC,MAAd,CAAqB,IAAI,IAAJ,CAAS,GAAG,aAAa,CAAC,UAAD,CAAY,iBAArC,CAArB,CAA/B;AACD,GAHD,CAGE,OAAO,CAAP,EAAU;AACV,WAAQ,aAAa,CAAC,KAAd,IAAuB,aAAa,CAAC,MAAtC,GACF,UAAD,IAAwB,aAAa,CAAC,UAAD,CAAb,CAA0B,MAA1B,CAAiC,aAAa,CAAC,KAAd,IAAuB,CAAxD,EAA2D,aAAa,CAAC,MAAzE,CADrB,GAEH,SAFJ;AAGD;AACF;;AAED,eAAe,2BAAf","sourcesContent":["import pad from './pad'\nimport { DatePickerFormatter } from 'vuetify/types'\n\ninterface SubstrOptions {\n start?: number\n length: number\n}\n\nfunction createNativeLocaleFormatter (\n local: string | undefined,\n options: Intl.DateTimeFormatOptions\n): DatePickerFormatter | undefined\n\nfunction createNativeLocaleFormatter (\n local: string | undefined,\n options: Intl.DateTimeFormatOptions,\n substrOptions: SubstrOptions\n): DatePickerFormatter\n\nfunction createNativeLocaleFormatter (\n locale: string | undefined,\n options: Intl.DateTimeFormatOptions,\n substrOptions: SubstrOptions = { start: 0, length: 0 }\n): DatePickerFormatter | undefined {\n const makeIsoString = (dateString: string) => {\n const [year, month, date] = dateString.trim().split(' ')[0].split('-')\n return [pad(year, 4), pad(month || 1), pad(date || 1)].join('-')\n }\n\n try {\n const intlFormatter = new Intl.DateTimeFormat(locale || undefined, options)\n return (dateString: string) => intlFormatter.format(new Date(`${makeIsoString(dateString)}T00:00:00+00:00`))\n } catch (e) {\n return (substrOptions.start || substrOptions.length)\n ? (dateString: string) => makeIsoString(dateString).substr(substrOptions.start || 0, substrOptions.length)\n : undefined\n }\n}\n\nexport default createNativeLocaleFormatter\n"],"sourceRoot":"","file":"createNativeLocaleFormatter.js"}
-19
View File
@@ -1,19 +0,0 @@
export function createItemTypeNativeListeners(instance, itemTypeSuffix, value) {
return Object.keys(instance.$listeners).reduce((on, eventName) => {
if (eventName.endsWith(itemTypeSuffix)) {
on[eventName.slice(0, -itemTypeSuffix.length)] = event => instance.$emit(eventName, value, event);
}
return on;
}, {});
}
export function createItemTypeListeners(instance, itemTypeSuffix) {
return Object.keys(instance.$listeners).reduce((on, eventName) => {
if (eventName.endsWith(itemTypeSuffix)) {
on[eventName] = instance.$listeners[eventName];
}
return on;
}, {});
}
//# sourceMappingURL=eventHelpers.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/components/VDatePicker/util/eventHelpers.ts"],"names":[],"mappings":"AAEA,OAAM,SAAU,6BAAV,CAAyC,QAAzC,EAAwD,cAAxD,EAAgF,KAAhF,EAA0F;AAC9F,SAAO,MAAM,CAAC,IAAP,CAAY,QAAQ,CAAC,UAArB,EAAiC,MAAjC,CAAwC,CAAC,EAAD,EAAK,SAAL,KAAkB;AAC/D,QAAI,SAAS,CAAC,QAAV,CAAmB,cAAnB,CAAJ,EAAwC;AACtC,MAAA,EAAE,CAAC,SAAS,CAAC,KAAV,CAAgB,CAAhB,EAAmB,CAAC,cAAc,CAAC,MAAnC,CAAD,CAAF,GAAkD,KAAD,IAAkB,QAAQ,CAAC,KAAT,CAAe,SAAf,EAA0B,KAA1B,EAAiC,KAAjC,CAAnE;AACD;;AAED,WAAO,EAAP;AACD,GANM,EAMJ,EANI,CAAP;AAOD;AAED,OAAM,SAAU,uBAAV,CAAmC,QAAnC,EAAkD,cAAlD,EAAwE;AAC5E,SAAO,MAAM,CAAC,IAAP,CAAY,QAAQ,CAAC,UAArB,EAAiC,MAAjC,CAAwC,CAAC,EAAD,EAAK,SAAL,KAAkB;AAC/D,QAAI,SAAS,CAAC,QAAV,CAAmB,cAAnB,CAAJ,EAAwC;AACtC,MAAA,EAAE,CAAC,SAAD,CAAF,GAAgB,QAAQ,CAAC,UAAT,CAAoB,SAApB,CAAhB;AACD;;AAED,WAAO,EAAP;AACD,GANM,EAMJ,EANI,CAAP;AAOD","sourcesContent":["import Vue from 'vue'\n\nexport function createItemTypeNativeListeners (instance: Vue, itemTypeSuffix: string, value: any) {\n return Object.keys(instance.$listeners).reduce((on, eventName) => {\n if (eventName.endsWith(itemTypeSuffix)) {\n on[eventName.slice(0, -itemTypeSuffix.length)] = (event: Event) => instance.$emit(eventName, value, event)\n }\n\n return on\n }, {} as typeof instance.$listeners)\n}\n\nexport function createItemTypeListeners (instance: Vue, itemTypeSuffix: string) {\n return Object.keys(instance.$listeners).reduce((on, eventName) => {\n if (eventName.endsWith(itemTypeSuffix)) {\n on[eventName] = instance.$listeners[eventName]\n }\n\n return on\n }, {} as typeof instance.$listeners)\n}\n"],"sourceRoot":"","file":"eventHelpers.js"}
-6
View File
@@ -1,6 +0,0 @@
import { createItemTypeListeners, createItemTypeNativeListeners } from './eventHelpers';
import createNativeLocaleFormatter from './createNativeLocaleFormatter';
import monthChange from './monthChange';
import pad from './pad';
export { createItemTypeListeners, createItemTypeNativeListeners, createNativeLocaleFormatter, monthChange, pad };
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/components/VDatePicker/util/index.ts"],"names":[],"mappings":"AAAA,SACE,uBADF,EAEE,6BAFF,QAGO,gBAHP;AAIA,OAAO,2BAAP,MAAwC,+BAAxC;AACA,OAAO,WAAP,MAAwB,eAAxB;AACA,OAAO,GAAP,MAAgB,OAAhB;AAEA,SACE,uBADF,EAEE,6BAFF,EAGE,2BAHF,EAIE,WAJF,EAKE,GALF","sourcesContent":["import {\n createItemTypeListeners,\n createItemTypeNativeListeners,\n} from './eventHelpers'\nimport createNativeLocaleFormatter from './createNativeLocaleFormatter'\nimport monthChange from './monthChange'\nimport pad from './pad'\n\nexport {\n createItemTypeListeners,\n createItemTypeNativeListeners,\n createNativeLocaleFormatter,\n monthChange,\n pad,\n}\n"],"sourceRoot":"","file":"index.js"}
@@ -1,4 +0,0 @@
export default function isDateAllowed(date, min, max, allowedFn) {
return (!allowedFn || allowedFn(date)) && (!min || date >= min.substr(0, 10)) && (!max || date <= max);
}
//# sourceMappingURL=isDateAllowed.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/components/VDatePicker/util/isDateAllowed.ts"],"names":[],"mappings":"AAEA,eAAc,SAAU,aAAV,CAAyB,IAAzB,EAAuC,GAAvC,EAAoD,GAApD,EAAiE,SAAjE,EAAsH;AAClI,SAAO,CAAC,CAAC,SAAD,IAAc,SAAS,CAAC,IAAD,CAAxB,MACJ,CAAC,GAAD,IAAQ,IAAI,IAAI,GAAG,CAAC,MAAJ,CAAW,CAAX,EAAc,EAAd,CADZ,MAEJ,CAAC,GAAD,IAAQ,IAAI,IAAI,GAFZ,CAAP;AAGD","sourcesContent":["import { DatePickerAllowedDatesFunction } from 'vuetify/types'\n\nexport default function isDateAllowed (date: string, min: string, max: string, allowedFn: DatePickerAllowedDatesFunction | undefined) {\n return (!allowedFn || allowedFn(date)) &&\n (!min || date >= min.substr(0, 10)) &&\n (!max || date <= max)\n}\n"],"sourceRoot":"","file":"isDateAllowed.js"}
-18
View File
@@ -1,18 +0,0 @@
import pad from './pad';
/**
* @param {String} value YYYY-MM format
* @param {Number} sign -1 or +1
*/
export default ((value, sign) => {
const [year, month] = value.split('-').map(Number);
if (month + sign === 0) {
return `${year - 1}-12`;
} else if (month + sign === 13) {
return `${year + 1}-01`;
} else {
return `${year}-${pad(month + sign)}`;
}
});
//# sourceMappingURL=monthChange.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/components/VDatePicker/util/monthChange.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,OAAhB;AAEA;;;;;AAIA,gBAAe,CAAC,KAAD,EAAgB,IAAhB,KAAgC;AAC7C,QAAM,CAAC,IAAD,EAAO,KAAP,IAAgB,KAAK,CAAC,KAAN,CAAY,GAAZ,EAAiB,GAAjB,CAAqB,MAArB,CAAtB;;AAEA,MAAI,KAAK,GAAG,IAAR,KAAiB,CAArB,EAAwB;AACtB,WAAO,GAAG,IAAI,GAAG,CAAC,KAAlB;AACD,GAFD,MAEO,IAAI,KAAK,GAAG,IAAR,KAAiB,EAArB,EAAyB;AAC9B,WAAO,GAAG,IAAI,GAAG,CAAC,KAAlB;AACD,GAFM,MAEA;AACL,WAAO,GAAG,IAAI,IAAI,GAAG,CAAC,KAAK,GAAG,IAAT,CAAc,EAAnC;AACD;AACF,CAVD","sourcesContent":["import pad from './pad'\n\n/**\n * @param {String} value YYYY-MM format\n * @param {Number} sign -1 or +1\n */\nexport default (value: string, sign: number) => {\n const [year, month] = value.split('-').map(Number)\n\n if (month + sign === 0) {\n return `${year - 1}-12`\n } else if (month + sign === 13) {\n return `${year + 1}-01`\n } else {\n return `${year}-${pad(month + sign)}`\n }\n}\n"],"sourceRoot":"","file":"monthChange.js"}
-20
View File
@@ -1,20 +0,0 @@
const padStart = (string, targetLength, padString) => {
targetLength = targetLength >> 0;
string = String(string);
padString = String(padString);
if (string.length > targetLength) {
return String(string);
}
targetLength = targetLength - string.length;
if (targetLength > padString.length) {
padString += padString.repeat(targetLength / padString.length);
}
return padString.slice(0, targetLength) + String(string);
};
export default ((n, length = 2) => padStart(n, length, '0'));
//# sourceMappingURL=pad.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/components/VDatePicker/util/pad.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,CAAC,MAAD,EAA0B,YAA1B,EAAgD,SAAhD,KAAqE;AACpF,EAAA,YAAY,GAAG,YAAY,IAAI,CAA/B;AACA,EAAA,MAAM,GAAG,MAAM,CAAC,MAAD,CAAf;AACA,EAAA,SAAS,GAAG,MAAM,CAAC,SAAD,CAAlB;;AACA,MAAI,MAAM,CAAC,MAAP,GAAgB,YAApB,EAAkC;AAChC,WAAO,MAAM,CAAC,MAAD,CAAb;AACD;;AAED,EAAA,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC,MAArC;;AACA,MAAI,YAAY,GAAG,SAAS,CAAC,MAA7B,EAAqC;AACnC,IAAA,SAAS,IAAI,SAAS,CAAC,MAAV,CAAiB,YAAY,GAAG,SAAS,CAAC,MAA1C,CAAb;AACD;;AACD,SAAO,SAAS,CAAC,KAAV,CAAgB,CAAhB,EAAmB,YAAnB,IAAmC,MAAM,CAAC,MAAD,CAAhD;AACD,CAbD;;AAeA,gBAAe,CAAC,CAAD,EAAqB,MAAM,GAAG,CAA9B,KAAoC,QAAQ,CAAC,CAAD,EAAI,MAAJ,EAAY,GAAZ,CAA3D","sourcesContent":["const padStart = (string: number | string, targetLength: number, padString: string) => {\n targetLength = targetLength >> 0\n string = String(string)\n padString = String(padString)\n if (string.length > targetLength) {\n return String(string)\n }\n\n targetLength = targetLength - string.length\n if (targetLength > padString.length) {\n padString += padString.repeat(targetLength / padString.length)\n }\n return padString.slice(0, targetLength) + String(string)\n}\n\nexport default (n: string | number, length = 2) => padStart(n, length, '0')\n"],"sourceRoot":"","file":"pad.js"}