@paperless/core 2.0.1-beta.26 → 2.0.1-beta.28
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/CHANGELOG.md +23 -0
- package/dist/build/index.esm.js +1 -1
- package/dist/build/index.esm.js.map +1 -1
- package/dist/build/{p-54f7740e.entry.js → p-04f4b015.entry.js} +2 -2
- package/dist/build/{p-ccbd2de0.entry.js → p-3fec2247.entry.js} +2 -2
- package/dist/build/{p-d82e4315.entry.js → p-45d789f5.entry.js} +2 -2
- package/dist/build/{p-f56de35e.entry.js → p-610eb0ff.entry.js} +2 -2
- package/dist/build/{p-401ff01b.entry.js → p-68647b9e.entry.js} +2 -2
- package/dist/build/p-859c4fb1.entry.js +2 -0
- package/dist/build/{p-7929ec90.entry.js → p-886c060f.entry.js} +2 -2
- package/dist/build/p-8f3c711b.entry.js +2 -0
- package/dist/build/p-8f3c711b.entry.js.map +1 -0
- package/dist/build/{p-9406a32e.entry.js → p-963f037a.entry.js} +2 -2
- package/dist/build/{p-e5a54d05.entry.js → p-971aac89.entry.js} +2 -2
- package/dist/{paperless/p-dc06602f.entry.js → build/p-9a0262b1.entry.js} +2 -2
- package/dist/{paperless/p-fde8b75b.entry.js → build/p-a0fad3d8.entry.js} +2 -2
- package/dist/build/{p-a38a330d.entry.js → p-a93ce615.entry.js} +2 -2
- package/dist/build/p-b4dbe1b7.js +2 -0
- package/dist/build/p-b51dcf11.js +2 -0
- package/dist/build/p-b51dcf11.js.map +1 -0
- package/dist/build/p-e839a672.entry.js +2 -0
- package/dist/build/p-efbc122f.js +2 -0
- package/dist/build/p-efbc122f.js.map +1 -0
- package/dist/build/{p-8b1a485b.entry.js → p-f173bb97.entry.js} +2 -2
- package/dist/build/p-f4545481.entry.js +2 -0
- package/dist/build/p-f4545481.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/build/paperless.esm.js.map +1 -1
- package/dist/cjs/{index-08db8a87.js → index-64168fc4.js} +28 -1
- package/dist/cjs/index-64168fc4.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/is-mobile-browser-0e393879.js +19 -0
- package/dist/cjs/is-mobile-browser-0e393879.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-calendar.cjs.entry.js +3 -29
- package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/p-checkbox_3.cjs.entry.js +3 -3
- package/dist/cjs/p-datepicker.cjs.entry.js +94 -5
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/p-field_2.cjs.entry.js +3 -3
- package/dist/cjs/p-floating-menu-container_8.cjs.entry.js +4 -4
- package/dist/cjs/p-input-error.cjs.entry.js +1 -1
- package/dist/cjs/p-input-group.cjs.entry.js +3 -3
- package/dist/cjs/p-label.cjs.entry.js +3 -3
- package/dist/cjs/p-navbar.cjs.entry.js +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/p-navigation-section.cjs.entry.js +1 -1
- package/dist/cjs/p-page-size-select_3.cjs.entry.js +1 -1
- package/dist/cjs/p-profile.cjs.entry.js +1 -1
- package/dist/cjs/p-select.cjs.entry.js +1 -1
- package/dist/cjs/p-stepper.cjs.entry.js +1 -1
- package/dist/cjs/p-toast.cjs.entry.js +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.css +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +64 -6
- package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +3 -3
- package/dist/collection/components/molecules/field/field.component.js +3 -3
- package/dist/collection/components/molecules/input-error/input-error.component.js +1 -1
- package/dist/collection/components/molecules/input-group/input-group.component.js +3 -3
- package/dist/collection/components/molecules/label/label.component.js +3 -3
- package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +2 -2
- package/dist/collection/components/molecules/navigation-section/navigation-section.component.js +1 -1
- package/dist/collection/components/molecules/pagination/pagination.component.js +1 -1
- package/dist/collection/components/molecules/profile/profile.component.js +1 -1
- package/dist/collection/components/molecules/select/select.component.js +1 -1
- package/dist/collection/components/molecules/stepper/stepper.component.js +1 -1
- package/dist/collection/components/molecules/table-cell/table-cell.component.js +1 -1
- package/dist/collection/components/molecules/table-footer/table-footer.component.js +1 -1
- package/dist/collection/components/molecules/table-row/table-row.component.js +2 -2
- package/dist/collection/components/molecules/toast/toast.component.js +1 -1
- package/dist/collection/components/organisms/navbar/navbar.component.js +1 -1
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/utils/is-mobile-browser.js +14 -0
- package/dist/collection/utils/is-mobile-browser.js.map +1 -0
- package/dist/components/calendar.component.js +1 -1
- package/dist/components/dropdown.component.js +3 -3
- package/dist/components/field.component.js +3 -3
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input-error.component.js +1 -1
- package/dist/components/is-mobile-browser.js +17 -0
- package/dist/components/is-mobile-browser.js.map +1 -0
- package/dist/components/p-datepicker.js +97 -6
- package/dist/components/p-datepicker.js.map +1 -1
- package/dist/components/p-input-group.js +3 -3
- package/dist/components/p-label.js +3 -3
- package/dist/components/p-navbar.js +1 -1
- package/dist/components/p-navigation-item.js +2 -2
- package/dist/components/p-navigation-section.js +1 -1
- package/dist/components/p-profile.js +1 -1
- package/dist/components/p-select.js +1 -1
- package/dist/components/p-stepper.js +1 -1
- package/dist/components/p-toast.js +1 -1
- package/dist/components/pagination.component.js +1 -1
- package/dist/components/table-cell.component.js +1 -1
- package/dist/components/table-footer.component.js +1 -1
- package/dist/components/table-row.component.js +2 -2
- package/dist/esm/{index-538f1fd8.js → index-27408d5b.js} +28 -2
- package/dist/esm/index-27408d5b.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/is-mobile-browser-0f0bfd54.js +17 -0
- package/dist/esm/is-mobile-browser-0f0bfd54.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-calendar.entry.js +1 -27
- package/dist/esm/p-calendar.entry.js.map +1 -1
- package/dist/esm/p-checkbox_3.entry.js +3 -3
- package/dist/esm/p-datepicker.entry.js +94 -5
- package/dist/esm/p-datepicker.entry.js.map +1 -1
- package/dist/esm/p-field_2.entry.js +3 -3
- package/dist/esm/p-floating-menu-container_8.entry.js +4 -4
- package/dist/esm/p-input-error.entry.js +1 -1
- package/dist/esm/p-input-group.entry.js +3 -3
- package/dist/esm/p-label.entry.js +3 -3
- package/dist/esm/p-navbar.entry.js +1 -1
- package/dist/esm/p-navigation-item.entry.js +2 -2
- package/dist/esm/p-navigation-section.entry.js +1 -1
- package/dist/esm/p-page-size-select_3.entry.js +1 -1
- package/dist/esm/p-profile.entry.js +1 -1
- package/dist/esm/p-select.entry.js +1 -1
- package/dist/esm/p-stepper.entry.js +1 -1
- package/dist/esm/p-toast.entry.js +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/index.esm.js +1 -1
- package/dist/paperless/index.esm.js.map +1 -1
- package/dist/paperless/{p-54f7740e.entry.js → p-04f4b015.entry.js} +2 -2
- package/dist/paperless/{p-ccbd2de0.entry.js → p-3fec2247.entry.js} +2 -2
- package/dist/paperless/{p-d82e4315.entry.js → p-45d789f5.entry.js} +2 -2
- package/dist/paperless/{p-f56de35e.entry.js → p-610eb0ff.entry.js} +2 -2
- package/dist/paperless/{p-401ff01b.entry.js → p-68647b9e.entry.js} +2 -2
- package/dist/paperless/p-859c4fb1.entry.js +2 -0
- package/dist/paperless/{p-7929ec90.entry.js → p-886c060f.entry.js} +2 -2
- package/dist/paperless/p-8f3c711b.entry.js +2 -0
- package/dist/paperless/p-8f3c711b.entry.js.map +1 -0
- package/dist/paperless/{p-9406a32e.entry.js → p-963f037a.entry.js} +2 -2
- package/dist/paperless/{p-e5a54d05.entry.js → p-971aac89.entry.js} +2 -2
- package/dist/{build/p-dc06602f.entry.js → paperless/p-9a0262b1.entry.js} +2 -2
- package/dist/{build/p-fde8b75b.entry.js → paperless/p-a0fad3d8.entry.js} +2 -2
- package/dist/paperless/{p-a38a330d.entry.js → p-a93ce615.entry.js} +2 -2
- package/dist/paperless/p-b51dcf11.js +2 -0
- package/dist/paperless/p-b51dcf11.js.map +1 -0
- package/dist/paperless/p-e839a672.entry.js +2 -0
- package/dist/paperless/p-efbc122f.js +2 -0
- package/dist/paperless/p-efbc122f.js.map +1 -0
- package/dist/paperless/{p-8b1a485b.entry.js → p-f173bb97.entry.js} +2 -2
- package/dist/paperless/p-f4545481.entry.js +2 -0
- package/dist/paperless/p-f4545481.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/paperless/paperless.esm.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/molecules/datepicker/datepicker.component.d.ts +7 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/is-mobile-browser.d.ts +1 -0
- package/hydrate/index.js +135 -31
- package/hydrate/index.mjs +135 -31
- package/package.json +1 -1
- package/dist/build/p-23ccc7b6.entry.js +0 -2
- package/dist/build/p-23ccc7b6.entry.js.map +0 -1
- package/dist/build/p-2f613a2a.entry.js +0 -2
- package/dist/build/p-9cac28b6.js +0 -2
- package/dist/build/p-9cac28b6.js.map +0 -1
- package/dist/build/p-cd3c25ac.entry.js +0 -2
- package/dist/build/p-cd3c25ac.entry.js.map +0 -1
- package/dist/build/p-e078f787.entry.js +0 -2
- package/dist/build/p-faf3a10b.js +0 -2
- package/dist/cjs/index-08db8a87.js.map +0 -1
- package/dist/esm/index-538f1fd8.js.map +0 -1
- package/dist/paperless/p-23ccc7b6.entry.js +0 -2
- package/dist/paperless/p-23ccc7b6.entry.js.map +0 -1
- package/dist/paperless/p-2f613a2a.entry.js +0 -2
- package/dist/paperless/p-9cac28b6.js +0 -2
- package/dist/paperless/p-9cac28b6.js.map +0 -1
- package/dist/paperless/p-cd3c25ac.entry.js +0 -2
- package/dist/paperless/p-cd3c25ac.entry.js.map +0 -1
- package/dist/paperless/p-e078f787.entry.js +0 -2
- /package/dist/build/{p-54f7740e.entry.js.map → p-04f4b015.entry.js.map} +0 -0
- /package/dist/build/{p-ccbd2de0.entry.js.map → p-3fec2247.entry.js.map} +0 -0
- /package/dist/build/{p-d82e4315.entry.js.map → p-45d789f5.entry.js.map} +0 -0
- /package/dist/build/{p-f56de35e.entry.js.map → p-610eb0ff.entry.js.map} +0 -0
- /package/dist/build/{p-401ff01b.entry.js.map → p-68647b9e.entry.js.map} +0 -0
- /package/dist/build/{p-2f613a2a.entry.js.map → p-859c4fb1.entry.js.map} +0 -0
- /package/dist/build/{p-7929ec90.entry.js.map → p-886c060f.entry.js.map} +0 -0
- /package/dist/build/{p-9406a32e.entry.js.map → p-963f037a.entry.js.map} +0 -0
- /package/dist/build/{p-e5a54d05.entry.js.map → p-971aac89.entry.js.map} +0 -0
- /package/dist/build/{p-dc06602f.entry.js.map → p-9a0262b1.entry.js.map} +0 -0
- /package/dist/build/{p-fde8b75b.entry.js.map → p-a0fad3d8.entry.js.map} +0 -0
- /package/dist/build/{p-a38a330d.entry.js.map → p-a93ce615.entry.js.map} +0 -0
- /package/dist/build/{p-e078f787.entry.js.map → p-e839a672.entry.js.map} +0 -0
- /package/dist/build/{p-8b1a485b.entry.js.map → p-f173bb97.entry.js.map} +0 -0
- /package/dist/paperless/{p-54f7740e.entry.js.map → p-04f4b015.entry.js.map} +0 -0
- /package/dist/paperless/{p-ccbd2de0.entry.js.map → p-3fec2247.entry.js.map} +0 -0
- /package/dist/paperless/{p-d82e4315.entry.js.map → p-45d789f5.entry.js.map} +0 -0
- /package/dist/paperless/{p-f56de35e.entry.js.map → p-610eb0ff.entry.js.map} +0 -0
- /package/dist/paperless/{p-401ff01b.entry.js.map → p-68647b9e.entry.js.map} +0 -0
- /package/dist/paperless/{p-2f613a2a.entry.js.map → p-859c4fb1.entry.js.map} +0 -0
- /package/dist/paperless/{p-7929ec90.entry.js.map → p-886c060f.entry.js.map} +0 -0
- /package/dist/paperless/{p-9406a32e.entry.js.map → p-963f037a.entry.js.map} +0 -0
- /package/dist/paperless/{p-e5a54d05.entry.js.map → p-971aac89.entry.js.map} +0 -0
- /package/dist/paperless/{p-dc06602f.entry.js.map → p-9a0262b1.entry.js.map} +0 -0
- /package/dist/paperless/{p-fde8b75b.entry.js.map → p-a0fad3d8.entry.js.map} +0 -0
- /package/dist/paperless/{p-a38a330d.entry.js.map → p-a93ce615.entry.js.map} +0 -0
- /package/dist/paperless/{p-e078f787.entry.js.map → p-e839a672.entry.js.map} +0 -0
- /package/dist/paperless/{p-8b1a485b.entry.js.map → p-f173bb97.entry.js.map} +0 -0
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-2ef94580.js';
|
|
2
2
|
import { c as childOf } from './child-of-2e1cac22.js';
|
|
3
|
-
import {
|
|
3
|
+
import { i as isMobileBrowser } from './is-mobile-browser-0f0bfd54.js';
|
|
4
|
+
import { r as requiredArgs, t as toDate, _ as _typeof, g as getUTCWeekYear, s as startOfUTCWeek, a as startOfUTCISOWeek, b as getUTCWeek, c as toInteger, d as getUTCISOWeek, e as getDefaultOptions, l as longFormatters, f as subMilliseconds, h as getTimezoneOffsetInMilliseconds, i as defaultLocale, j as isProtectedWeekYearToken, k as throwProtectedError, m as isProtectedDayOfYearToken, n as isValid, o as isBefore, p as isAfter, q as format, u as startOfDay, v as startOfMonth, w as isSameDay } from './index-27408d5b.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @name isWeekend
|
|
8
|
+
* @category Weekday Helpers
|
|
9
|
+
* @summary Does the given date fall on a weekend?
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* Does the given date fall on a weekend?
|
|
13
|
+
*
|
|
14
|
+
* @param {Date|Number} date - the date to check
|
|
15
|
+
* @returns {Boolean} the date falls on a weekend
|
|
16
|
+
* @throws {TypeError} 1 argument required
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Does 5 October 2014 fall on a weekend?
|
|
20
|
+
* const result = isWeekend(new Date(2014, 9, 5))
|
|
21
|
+
* //=> true
|
|
22
|
+
*/
|
|
23
|
+
function isWeekend(dirtyDate) {
|
|
24
|
+
requiredArgs(1, arguments);
|
|
25
|
+
var date = toDate(dirtyDate);
|
|
26
|
+
var day = date.getDay();
|
|
27
|
+
return day === 0 || day === 6;
|
|
28
|
+
}
|
|
4
29
|
|
|
5
30
|
/**
|
|
6
31
|
* Days in 1 week.
|
|
@@ -41,6 +66,33 @@ var millisecondsInHour = 3600000;
|
|
|
41
66
|
*/
|
|
42
67
|
var millisecondsInSecond = 1000;
|
|
43
68
|
|
|
69
|
+
/**
|
|
70
|
+
* @name startOfYear
|
|
71
|
+
* @category Year Helpers
|
|
72
|
+
* @summary Return the start of a year for the given date.
|
|
73
|
+
*
|
|
74
|
+
* @description
|
|
75
|
+
* Return the start of a year for the given date.
|
|
76
|
+
* The result will be in the local timezone.
|
|
77
|
+
*
|
|
78
|
+
* @param {Date|Number} date - the original date
|
|
79
|
+
* @returns {Date} the start of a year
|
|
80
|
+
* @throws {TypeError} 1 argument required
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* // The start of a year for 2 September 2014 11:55:00:
|
|
84
|
+
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
|
|
85
|
+
* //=> Wed Jan 01 2014 00:00:00
|
|
86
|
+
*/
|
|
87
|
+
function startOfYear(dirtyDate) {
|
|
88
|
+
requiredArgs(1, arguments);
|
|
89
|
+
var cleanDate = toDate(dirtyDate);
|
|
90
|
+
var date = new Date(0);
|
|
91
|
+
date.setFullYear(cleanDate.getFullYear(), 0, 1);
|
|
92
|
+
date.setHours(0, 0, 0, 0);
|
|
93
|
+
return date;
|
|
94
|
+
}
|
|
95
|
+
|
|
44
96
|
function assign(target, object) {
|
|
45
97
|
if (target == null) {
|
|
46
98
|
throw new TypeError('assign requires that input parameter not be null or undefined');
|
|
@@ -2825,7 +2877,7 @@ function cleanEscapedString(input) {
|
|
|
2825
2877
|
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
2826
2878
|
}
|
|
2827
2879
|
|
|
2828
|
-
const datepickerComponentCss = "*{box-sizing:border-box}.static{position:static!important}.absolute{position:absolute!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
|
|
2880
|
+
const datepickerComponentCss = "*{box-sizing:border-box}.static{position:static!important}.absolute{position:absolute!important}.h-0{height:0!important}.overflow-hidden{overflow:hidden!important}.blur{--tw-blur:blur(8px)!important}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
|
|
2829
2881
|
const PDatepickerStyle0 = datepickerComponentCss;
|
|
2830
2882
|
|
|
2831
2883
|
const Datepicker = class {
|
|
@@ -2835,6 +2887,7 @@ const Datepicker = class {
|
|
|
2835
2887
|
this.placeholder = undefined;
|
|
2836
2888
|
this.value = undefined;
|
|
2837
2889
|
this.preselectToday = false;
|
|
2890
|
+
this.enableNativePicker = true;
|
|
2838
2891
|
this.disabledDates = undefined;
|
|
2839
2892
|
this.minDate = undefined;
|
|
2840
2893
|
this.maxDate = undefined;
|
|
@@ -2856,6 +2909,7 @@ const Datepicker = class {
|
|
|
2856
2909
|
this._minDate = undefined;
|
|
2857
2910
|
this._maxDate = undefined;
|
|
2858
2911
|
this._disabledDates = [];
|
|
2912
|
+
this._isMobileBrowser = false;
|
|
2859
2913
|
}
|
|
2860
2914
|
/**
|
|
2861
2915
|
* Event when the value changes
|
|
@@ -2864,6 +2918,7 @@ const Datepicker = class {
|
|
|
2864
2918
|
get _el() { return getElement(this); }
|
|
2865
2919
|
_onInputTimeout;
|
|
2866
2920
|
_inputRef;
|
|
2921
|
+
_dateInputRef;
|
|
2867
2922
|
_defaultFormats = {
|
|
2868
2923
|
year: 'yyyy',
|
|
2869
2924
|
month: 'LLLL, yyyy',
|
|
@@ -2935,10 +2990,13 @@ const Datepicker = class {
|
|
|
2935
2990
|
if (this.mode !== 'day' && this.format === this._defaultFormats['day']) {
|
|
2936
2991
|
this.format = this._defaultFormats[this.mode];
|
|
2937
2992
|
}
|
|
2993
|
+
this._isMobileBrowser = isMobileBrowser() || true;
|
|
2938
2994
|
this.parseValue(this.value);
|
|
2939
2995
|
}
|
|
2940
2996
|
render() {
|
|
2941
|
-
return (h(Host, { key: '
|
|
2997
|
+
return (h(Host, { key: 'e48d3c9b517c3323fcc9c430a78721e1bad966a4', class: 'p-datepicker' }, h("p-dropdown", { key: 'c051904eae94288177f646bd200dab88cacc0895', strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown }, h("p-field", { key: '7f5e16b89475a8ee35119116b592944830f6eb4f', slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, disabled: this.disabled, focused: this._showDropdown, value: this._getFormattedDate(), placeholder: this.placeholder, onFocus: () => this._onFocus(), onBlur: () => this._onBlur(), onValueChange: ev => this._onValueChange(ev.detail), onInputRefChange: ev => (this._inputRef = ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (h("input", { key: '1ff2cb32a56ec717126d7659813900f8fd7efb47', slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', class: 'h-0 overflow-hidden' // we use h-0 here so location dependent pickers can correctly place itself
|
|
2998
|
+
,
|
|
2999
|
+
onInput: ev => this._onNativeInput(ev), ref: ref => (this._dateInputRef = ref), value: this._value && format(this._value, 'yyyy-MM-dd'), min: this.minDate && format(new Date(this.minDate), 'yyyy-MM-dd'), max: this.maxDate && format(new Date(this.maxDate), 'yyyy-MM-dd') })), h("div", { key: 'a935816c14866b2fc6375f1f85ba0dc26c243087', slot: 'items' }, h("p-calendar", { key: '3af01a1b9f52fad9b03ea5652a287e6673cbfe88', variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, mode: this.mode })))));
|
|
2942
3000
|
}
|
|
2943
3001
|
documentClickHandler({ target }) {
|
|
2944
3002
|
if (!this._showDropdown || childOf(target, this._el)) {
|
|
@@ -2947,9 +3005,17 @@ const Datepicker = class {
|
|
|
2947
3005
|
this._showDropdown = false;
|
|
2948
3006
|
}
|
|
2949
3007
|
_onFocus() {
|
|
3008
|
+
if (this._isMobileBrowser && this._dateInputRef) {
|
|
3009
|
+
this._dateInputRef.showPicker();
|
|
3010
|
+
this._inputRef.blur();
|
|
3011
|
+
return;
|
|
3012
|
+
}
|
|
2950
3013
|
this._showDropdown = true;
|
|
2951
3014
|
}
|
|
2952
3015
|
_onBlur() {
|
|
3016
|
+
if (this._isMobileBrowser && this._dateInputRef) {
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
2953
3019
|
const target = this._inputRef;
|
|
2954
3020
|
if (target.value === null) {
|
|
2955
3021
|
return;
|
|
@@ -2977,6 +3043,18 @@ const Datepicker = class {
|
|
|
2977
3043
|
this._setValue(parsedValue, false);
|
|
2978
3044
|
}, 300);
|
|
2979
3045
|
}
|
|
3046
|
+
_onNativeInput(ev) {
|
|
3047
|
+
if (!ev.target) {
|
|
3048
|
+
return;
|
|
3049
|
+
}
|
|
3050
|
+
if (this._onInputTimeout) {
|
|
3051
|
+
clearTimeout(this._onInputTimeout);
|
|
3052
|
+
this._onInputTimeout = null;
|
|
3053
|
+
}
|
|
3054
|
+
this._onInputTimeout = setTimeout(() => {
|
|
3055
|
+
this._setValue(ev.target.value === '' ? null : new Date(ev.target.value), false);
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
2980
3058
|
_setValue(value, hideDropdown = true) {
|
|
2981
3059
|
if (value === null) {
|
|
2982
3060
|
this._value = null;
|
|
@@ -2987,9 +3065,19 @@ const Datepicker = class {
|
|
|
2987
3065
|
return;
|
|
2988
3066
|
}
|
|
2989
3067
|
if (this._isDisabledDay(value)) {
|
|
3068
|
+
if (!!this._dateInputRef?.value) {
|
|
3069
|
+
this._dateInputRef.value = this._value
|
|
3070
|
+
? format(this._value, 'yyyy-MM-dd')
|
|
3071
|
+
: null;
|
|
3072
|
+
}
|
|
2990
3073
|
return;
|
|
2991
3074
|
}
|
|
2992
|
-
value =
|
|
3075
|
+
value =
|
|
3076
|
+
this.mode === 'day'
|
|
3077
|
+
? startOfDay(value)
|
|
3078
|
+
: this.mode === 'month'
|
|
3079
|
+
? startOfMonth(value)
|
|
3080
|
+
: startOfYear(value);
|
|
2993
3081
|
const isSameValue = isSameDay(value, this._value);
|
|
2994
3082
|
if (isSameValue) {
|
|
2995
3083
|
return;
|
|
@@ -3001,7 +3089,8 @@ const Datepicker = class {
|
|
|
3001
3089
|
this.valueChange.emit(value);
|
|
3002
3090
|
}
|
|
3003
3091
|
_isDisabledDay(day) {
|
|
3004
|
-
return ((
|
|
3092
|
+
return ((this.disableWeekends && isWeekend(day)) ||
|
|
3093
|
+
(isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||
|
|
3005
3094
|
(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||
|
|
3006
3095
|
this._disabledDates.findIndex(date => isSameDay(date, day)) >= 0);
|
|
3007
3096
|
}
|