@paperless/core 3.6.5 → 3.7.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/dist/build/p-30e187cd.entry.js +1 -0
- package/dist/build/{p-59830918.js → p-484e9f15.js} +1 -1
- package/dist/build/p-75918198.entry.js +1 -0
- package/dist/build/p-ad0caa7e.entry.js +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js +11 -11
- package/dist/cjs/p-calendar.cjs.entry.js +4 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +6 -3
- package/dist/collection/components/molecules/attachment/attachment.component.js +12 -12
- package/dist/collection/components/molecules/calendar/calendar.component.js +4 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +6 -3
- package/dist/components/{p-B6Eg4keN.js → p-CqInd6A4.js} +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-datepicker.js +1 -1
- package/dist/esm/p-attachment.entry.js +12 -12
- package/dist/esm/p-calendar.entry.js +4 -1
- package/dist/esm/p-datepicker.entry.js +6 -3
- package/dist/index.html +1 -1
- package/dist/paperless/p-30e187cd.entry.js +1 -0
- package/dist/paperless/p-75918198.entry.js +1 -0
- package/dist/paperless/p-ad0caa7e.entry.js +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/hydrate/index.js +21 -21
- package/hydrate/index.mjs +21 -21
- package/package.json +1 -1
- package/dist/build/p-62f87c18.entry.js +0 -1
- package/dist/build/p-8b38c26b.entry.js +0 -1
- package/dist/build/p-df709c40.entry.js +0 -1
- package/dist/paperless/p-62f87c18.entry.js +0 -1
- package/dist/paperless/p-8b38c26b.entry.js +0 -1
- package/dist/paperless/p-df709c40.entry.js +0 -1
package/hydrate/index.js
CHANGED
|
@@ -8710,18 +8710,12 @@ const getScreenSizeInPixels = (size) => {
|
|
|
8710
8710
|
const rem = getScreenSizeInRem(size);
|
|
8711
8711
|
return rem * 16;
|
|
8712
8712
|
};
|
|
8713
|
-
const isBiggerThanScreen = (size) => {
|
|
8714
|
-
const pixels = getScreenSizeInPixels(size);
|
|
8715
|
-
return window.innerWidth > pixels;
|
|
8716
|
-
};
|
|
8717
8713
|
const isSmallerThanScreen = (size) => {
|
|
8718
8714
|
const pixels = getScreenSizeInPixels(size);
|
|
8719
8715
|
return window.innerWidth < pixels;
|
|
8720
8716
|
};
|
|
8721
|
-
const isBetweenScreens = (smallSize, bigSize) => isBiggerThanScreen(smallSize) && isSmallerThanScreen(bigSize);
|
|
8722
8717
|
const isTouchDevice = () => !!globalThis.matchMedia('(pointer: coarse)').matches;
|
|
8723
8718
|
const isMobile = () => isTouchDevice() || isSmallerThanScreen('tablet');
|
|
8724
|
-
const isTablet = () => isBetweenScreens('tablet', 'desktop-xs');
|
|
8725
8719
|
|
|
8726
8720
|
// http://detectmobilebrowsers.com/
|
|
8727
8721
|
const browserRegex = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i;
|
|
@@ -11745,27 +11739,27 @@ class Attachment {
|
|
|
11745
11739
|
_fileRef;
|
|
11746
11740
|
_cameraFileRef;
|
|
11747
11741
|
render() {
|
|
11748
|
-
let prefix = (hAsync("p-icon", { key: '
|
|
11742
|
+
let prefix = (hAsync("p-icon", { key: 'dd6a4fddd6e60cafff196b0229b125bc4475837f', class: 'text-storm-300', variant: 'attachment' }));
|
|
11749
11743
|
if (this.error) {
|
|
11750
|
-
prefix = (hAsync("p-icon", { key: '
|
|
11744
|
+
prefix = (hAsync("p-icon", { key: '3afb112898ac70c5c07f36d1824f9ef982994185', class: 'text-negative-red-500', variant: 'warning' }));
|
|
11751
11745
|
}
|
|
11752
|
-
const
|
|
11746
|
+
const isTouch = isTouchDevice();
|
|
11753
11747
|
const baseText = 'min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm';
|
|
11754
|
-
return (hAsync(Fragment, { key: '
|
|
11748
|
+
return (hAsync(Fragment, { key: 'a60e9e326e5c70edb39e2c16353e30638ed04fbb' }, hAsync("p-field-container", { key: '95255c8b0648f11d336fb5bb74e230bc8a15499e', error: this.error, forceShowTooltip: !!this.error?.length, helper: this.helper, label: this.label, required: this.required, variant: 'write' }, hAsync("div", { key: 'c6bb34cd296d4159c5cc1941af8a80d46b5b387e', class: 'flex w-full items-start gap-2', slot: 'content' }, hAsync("div", { key: 'b208ca920c5ff5b240d8226551b791d239ebf2c6', class: attachment({
|
|
11755
11749
|
click: this.mode === 'write' && !this.value?.length,
|
|
11756
11750
|
error: !!this.error?.length,
|
|
11757
|
-
}), onClick: () => this._uploadClick() }, prefix, hAsync("span", { key: '
|
|
11751
|
+
}), onClick: () => this._uploadClick() }, prefix, hAsync("span", { key: '8235dce3bc34299e779d435749ee27f40360e1be', class: cn(baseText, `
|
|
11758
11752
|
peer
|
|
11759
11753
|
empty:hidden
|
|
11760
11754
|
dark:text-white
|
|
11761
|
-
`) }, this.value), hAsync("span", { key: '
|
|
11755
|
+
`) }, this.value), hAsync("span", { key: '9227af7beb22f08663854ad118269879f5dc28d2', class: cn(baseText, `
|
|
11762
11756
|
hidden
|
|
11763
11757
|
peer-empty:block
|
|
11764
|
-
`) }, this.placeholder)), hAsync("p-tooltip", { key: '
|
|
11758
|
+
`) }, this.placeholder)), hAsync("p-tooltip", { key: '461c9426b1068552248d9a99810157a5dc437d35', class: 'w-8', content: this.mode === 'read'
|
|
11765
11759
|
? this.downloadTooltip
|
|
11766
11760
|
: this.value?.length
|
|
11767
11761
|
? this.deleteTooltip
|
|
11768
|
-
: this.uploadTooltip }, hAsync("p-button", { key: '
|
|
11762
|
+
: this.uploadTooltip }, hAsync("p-button", { key: 'a61a19eca51f65b887cb5bc30c707903acdbed5e', disabled: this.loading, icon: this.mode === 'read'
|
|
11769
11763
|
? 'download'
|
|
11770
11764
|
: this.value?.length
|
|
11771
11765
|
? 'trash'
|
|
@@ -11775,8 +11769,8 @@ class Attachment {
|
|
|
11775
11769
|
? this.download
|
|
11776
11770
|
: this.delete).emit() })), this.enableCameraOnMobile &&
|
|
11777
11771
|
this.mode === 'write' &&
|
|
11778
|
-
|
|
11779
|
-
!this.value?.length && (hAsync("p-tooltip", { key: '
|
|
11772
|
+
isTouch &&
|
|
11773
|
+
!this.value?.length && (hAsync("p-tooltip", { key: '92eb29f63074268f3787fdd338bf52ab538652a4', class: '\n w-8\n desktop-xs:hidden\n ', content: this.cameraTooltip }, hAsync("p-button", { key: 'd16292a48b3b65b88d3102ae9fd2a0b88905b117', icon: 'camera', iconOnly: true, slot: 'trigger', variant: 'secondary', onOnClick: () => this._cameraClick() }))))), hAsync("input", { key: '8d4671d6374ff5c71a159113351fa2f8aabde9d7', accept: Array.isArray(this.accept) ? this.accept?.join(',') : this.accept, class: 'hidden', ref: el => (this._fileRef = el), type: 'file', onChange: ev => this._onFileChange(ev) }), hAsync("input", { key: 'd5d605e25ff006625eab9e3bd91c804f376f8945', accept: 'image/*', capture: 'true', class: 'hidden', ref: el => (this._cameraFileRef = el), type: 'file', onChange: ev => this._onFileChange(ev) })));
|
|
11780
11774
|
}
|
|
11781
11775
|
_uploadClick() {
|
|
11782
11776
|
if (!this._fileRef || this.mode !== 'write' || this.value?.length) {
|
|
@@ -11785,7 +11779,7 @@ class Attachment {
|
|
|
11785
11779
|
this._fileRef.click();
|
|
11786
11780
|
}
|
|
11787
11781
|
_cameraClick() {
|
|
11788
|
-
if (!this.enableCameraOnMobile ||
|
|
11782
|
+
if (!this.enableCameraOnMobile || !isTouchDevice()) {
|
|
11789
11783
|
return;
|
|
11790
11784
|
}
|
|
11791
11785
|
if (!this._cameraFileRef || this.mode !== 'write') {
|
|
@@ -88099,6 +88093,9 @@ class Calendar {
|
|
|
88099
88093
|
if (dateFnsExports.isValid(value) && !dateFnsExports.isSameDay(value, this._viewDate)) {
|
|
88100
88094
|
this._viewDate = value;
|
|
88101
88095
|
}
|
|
88096
|
+
if (value?.getTime() === this._value?.getTime()) {
|
|
88097
|
+
return;
|
|
88098
|
+
}
|
|
88102
88099
|
this._setValue(value);
|
|
88103
88100
|
}
|
|
88104
88101
|
_parseMinDate(minDate) {
|
|
@@ -88159,7 +88156,7 @@ class Calendar {
|
|
|
88159
88156
|
}
|
|
88160
88157
|
}
|
|
88161
88158
|
render() {
|
|
88162
|
-
return (hAsync(ThemedHost, { key: '
|
|
88159
|
+
return (hAsync(ThemedHost, { key: 'b14ca11713b5ee2c0a5775230987b1654a3c58cc' }, hAsync("div", { key: '467ce8181c5cbbec87de1ae4817ed47183dca8e8', class: calendar$1({ variant: this.variant }) }, this._getView())));
|
|
88163
88160
|
}
|
|
88164
88161
|
_checkTodayButton() {
|
|
88165
88162
|
if (this._maxDate && dateFnsExports.isAfter(this._today, this._maxDate)) {
|
|
@@ -92213,7 +92210,10 @@ class Datepicker {
|
|
|
92213
92210
|
if (typeof value === 'string') {
|
|
92214
92211
|
value = new Date(value);
|
|
92215
92212
|
}
|
|
92216
|
-
this.
|
|
92213
|
+
if (value?.getTime() === this._value?.getTime()) {
|
|
92214
|
+
return;
|
|
92215
|
+
}
|
|
92216
|
+
this._setValue(value, true);
|
|
92217
92217
|
}
|
|
92218
92218
|
parseMinDate(minDate) {
|
|
92219
92219
|
if (minDate === null || minDate === '') {
|
|
@@ -92291,7 +92291,7 @@ class Datepicker {
|
|
|
92291
92291
|
}
|
|
92292
92292
|
}
|
|
92293
92293
|
render() {
|
|
92294
|
-
return (hAsync("p-dropdown", { key: '
|
|
92294
|
+
return (hAsync("p-dropdown", { key: 'e329571548f7fc670ea27b9096e43179bf575f48', allowOverflow: true, applyFullWidth: false, applyMaxWidth: false, disableTriggerClick: true, insideClick: true, isDatepicker: true, placement: this.placement, show: this._showDropdown, strategy: this.strategy }, hAsync("p-field", { key: '5904684c137055d5b2eb25890363ee8b458ce9ff', autoShowError: false, disabled: asBoolean(this.disabled), error: this.error, focused: this._showDropdown, forceShowTooltip: !!this.error?.length && !this._showDropdown, helper: this.helper, icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', label: this.label, loading: this.loading, placeholder: this.placeholder, prefix: this.prefix, required: asBoolean(this.required), showOptional: asBoolean(this.showOptional), size: this.size, slot: 'trigger', value: this._getFormattedDate(), onBlur: (ev) => this._onBlur(ev), onFocus: () => this._onFocus(), onInputRefChange: ev => (this._inputRef = ev.detail), onValueChange: ev => this._onValueChange(ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (hAsync("input", { key: '18243b5177bf1ccafc938199d17303a13e9c0a2d', class: '\n pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden\n opacity-0\n ', max: this.maxDate &&
|
|
92295
92295
|
dateFnsExports.format(new Date(this.maxDate), 'yyyy-MM-dd', {
|
|
92296
92296
|
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
92297
92297
|
}), min: this._minDate &&
|
|
@@ -92300,7 +92300,7 @@ class Datepicker {
|
|
|
92300
92300
|
}), ref: ref => (this._dateInputRef = ref), slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', value: this._value &&
|
|
92301
92301
|
dateFnsExports.format(this._value, 'yyyy-MM-dd', {
|
|
92302
92302
|
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
92303
|
-
}), onInput: ev => this._onNativeInput(ev) })), hAsync("div", { key: '
|
|
92303
|
+
}), onInput: ev => this._onNativeInput(ev) })), hAsync("div", { key: '72072c39f6b9f4234c39474084e10625bb739ff4', slot: 'items', tabIndex: -1 }, hAsync("p-calendar", { key: '374b07930dfaa7f1c1cfdf528fd0b53158d482bc', disableWeekends: this.disableWeekends, disabledDates: this.disabledDates, enableToday: this.enableToday, maxDate: this.maxDate, minDate: this.minDate, mode: this.mode, preselectToday: this.preselectToday, todayText: this.todayText, value: this._value, variant: 'embedded', onValueChange: ({ detail }) => (this.value = detail) }))));
|
|
92304
92304
|
}
|
|
92305
92305
|
documentClickHandler({ target }) {
|
|
92306
92306
|
if (!this._showDropdown || childOf(target, this._el)) {
|
package/hydrate/index.mjs
CHANGED
|
@@ -8708,18 +8708,12 @@ const getScreenSizeInPixels = (size) => {
|
|
|
8708
8708
|
const rem = getScreenSizeInRem(size);
|
|
8709
8709
|
return rem * 16;
|
|
8710
8710
|
};
|
|
8711
|
-
const isBiggerThanScreen = (size) => {
|
|
8712
|
-
const pixels = getScreenSizeInPixels(size);
|
|
8713
|
-
return window.innerWidth > pixels;
|
|
8714
|
-
};
|
|
8715
8711
|
const isSmallerThanScreen = (size) => {
|
|
8716
8712
|
const pixels = getScreenSizeInPixels(size);
|
|
8717
8713
|
return window.innerWidth < pixels;
|
|
8718
8714
|
};
|
|
8719
|
-
const isBetweenScreens = (smallSize, bigSize) => isBiggerThanScreen(smallSize) && isSmallerThanScreen(bigSize);
|
|
8720
8715
|
const isTouchDevice = () => !!globalThis.matchMedia('(pointer: coarse)').matches;
|
|
8721
8716
|
const isMobile = () => isTouchDevice() || isSmallerThanScreen('tablet');
|
|
8722
|
-
const isTablet = () => isBetweenScreens('tablet', 'desktop-xs');
|
|
8723
8717
|
|
|
8724
8718
|
// http://detectmobilebrowsers.com/
|
|
8725
8719
|
const browserRegex = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i;
|
|
@@ -11743,27 +11737,27 @@ class Attachment {
|
|
|
11743
11737
|
_fileRef;
|
|
11744
11738
|
_cameraFileRef;
|
|
11745
11739
|
render() {
|
|
11746
|
-
let prefix = (hAsync("p-icon", { key: '
|
|
11740
|
+
let prefix = (hAsync("p-icon", { key: 'dd6a4fddd6e60cafff196b0229b125bc4475837f', class: 'text-storm-300', variant: 'attachment' }));
|
|
11747
11741
|
if (this.error) {
|
|
11748
|
-
prefix = (hAsync("p-icon", { key: '
|
|
11742
|
+
prefix = (hAsync("p-icon", { key: '3afb112898ac70c5c07f36d1824f9ef982994185', class: 'text-negative-red-500', variant: 'warning' }));
|
|
11749
11743
|
}
|
|
11750
|
-
const
|
|
11744
|
+
const isTouch = isTouchDevice();
|
|
11751
11745
|
const baseText = 'min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm';
|
|
11752
|
-
return (hAsync(Fragment, { key: '
|
|
11746
|
+
return (hAsync(Fragment, { key: 'a60e9e326e5c70edb39e2c16353e30638ed04fbb' }, hAsync("p-field-container", { key: '95255c8b0648f11d336fb5bb74e230bc8a15499e', error: this.error, forceShowTooltip: !!this.error?.length, helper: this.helper, label: this.label, required: this.required, variant: 'write' }, hAsync("div", { key: 'c6bb34cd296d4159c5cc1941af8a80d46b5b387e', class: 'flex w-full items-start gap-2', slot: 'content' }, hAsync("div", { key: 'b208ca920c5ff5b240d8226551b791d239ebf2c6', class: attachment({
|
|
11753
11747
|
click: this.mode === 'write' && !this.value?.length,
|
|
11754
11748
|
error: !!this.error?.length,
|
|
11755
|
-
}), onClick: () => this._uploadClick() }, prefix, hAsync("span", { key: '
|
|
11749
|
+
}), onClick: () => this._uploadClick() }, prefix, hAsync("span", { key: '8235dce3bc34299e779d435749ee27f40360e1be', class: cn(baseText, `
|
|
11756
11750
|
peer
|
|
11757
11751
|
empty:hidden
|
|
11758
11752
|
dark:text-white
|
|
11759
|
-
`) }, this.value), hAsync("span", { key: '
|
|
11753
|
+
`) }, this.value), hAsync("span", { key: '9227af7beb22f08663854ad118269879f5dc28d2', class: cn(baseText, `
|
|
11760
11754
|
hidden
|
|
11761
11755
|
peer-empty:block
|
|
11762
|
-
`) }, this.placeholder)), hAsync("p-tooltip", { key: '
|
|
11756
|
+
`) }, this.placeholder)), hAsync("p-tooltip", { key: '461c9426b1068552248d9a99810157a5dc437d35', class: 'w-8', content: this.mode === 'read'
|
|
11763
11757
|
? this.downloadTooltip
|
|
11764
11758
|
: this.value?.length
|
|
11765
11759
|
? this.deleteTooltip
|
|
11766
|
-
: this.uploadTooltip }, hAsync("p-button", { key: '
|
|
11760
|
+
: this.uploadTooltip }, hAsync("p-button", { key: 'a61a19eca51f65b887cb5bc30c707903acdbed5e', disabled: this.loading, icon: this.mode === 'read'
|
|
11767
11761
|
? 'download'
|
|
11768
11762
|
: this.value?.length
|
|
11769
11763
|
? 'trash'
|
|
@@ -11773,8 +11767,8 @@ class Attachment {
|
|
|
11773
11767
|
? this.download
|
|
11774
11768
|
: this.delete).emit() })), this.enableCameraOnMobile &&
|
|
11775
11769
|
this.mode === 'write' &&
|
|
11776
|
-
|
|
11777
|
-
!this.value?.length && (hAsync("p-tooltip", { key: '
|
|
11770
|
+
isTouch &&
|
|
11771
|
+
!this.value?.length && (hAsync("p-tooltip", { key: '92eb29f63074268f3787fdd338bf52ab538652a4', class: '\n w-8\n desktop-xs:hidden\n ', content: this.cameraTooltip }, hAsync("p-button", { key: 'd16292a48b3b65b88d3102ae9fd2a0b88905b117', icon: 'camera', iconOnly: true, slot: 'trigger', variant: 'secondary', onOnClick: () => this._cameraClick() }))))), hAsync("input", { key: '8d4671d6374ff5c71a159113351fa2f8aabde9d7', accept: Array.isArray(this.accept) ? this.accept?.join(',') : this.accept, class: 'hidden', ref: el => (this._fileRef = el), type: 'file', onChange: ev => this._onFileChange(ev) }), hAsync("input", { key: 'd5d605e25ff006625eab9e3bd91c804f376f8945', accept: 'image/*', capture: 'true', class: 'hidden', ref: el => (this._cameraFileRef = el), type: 'file', onChange: ev => this._onFileChange(ev) })));
|
|
11778
11772
|
}
|
|
11779
11773
|
_uploadClick() {
|
|
11780
11774
|
if (!this._fileRef || this.mode !== 'write' || this.value?.length) {
|
|
@@ -11783,7 +11777,7 @@ class Attachment {
|
|
|
11783
11777
|
this._fileRef.click();
|
|
11784
11778
|
}
|
|
11785
11779
|
_cameraClick() {
|
|
11786
|
-
if (!this.enableCameraOnMobile ||
|
|
11780
|
+
if (!this.enableCameraOnMobile || !isTouchDevice()) {
|
|
11787
11781
|
return;
|
|
11788
11782
|
}
|
|
11789
11783
|
if (!this._cameraFileRef || this.mode !== 'write') {
|
|
@@ -88097,6 +88091,9 @@ class Calendar {
|
|
|
88097
88091
|
if (dateFnsExports.isValid(value) && !dateFnsExports.isSameDay(value, this._viewDate)) {
|
|
88098
88092
|
this._viewDate = value;
|
|
88099
88093
|
}
|
|
88094
|
+
if (value?.getTime() === this._value?.getTime()) {
|
|
88095
|
+
return;
|
|
88096
|
+
}
|
|
88100
88097
|
this._setValue(value);
|
|
88101
88098
|
}
|
|
88102
88099
|
_parseMinDate(minDate) {
|
|
@@ -88157,7 +88154,7 @@ class Calendar {
|
|
|
88157
88154
|
}
|
|
88158
88155
|
}
|
|
88159
88156
|
render() {
|
|
88160
|
-
return (hAsync(ThemedHost, { key: '
|
|
88157
|
+
return (hAsync(ThemedHost, { key: 'b14ca11713b5ee2c0a5775230987b1654a3c58cc' }, hAsync("div", { key: '467ce8181c5cbbec87de1ae4817ed47183dca8e8', class: calendar$1({ variant: this.variant }) }, this._getView())));
|
|
88161
88158
|
}
|
|
88162
88159
|
_checkTodayButton() {
|
|
88163
88160
|
if (this._maxDate && dateFnsExports.isAfter(this._today, this._maxDate)) {
|
|
@@ -92211,7 +92208,10 @@ class Datepicker {
|
|
|
92211
92208
|
if (typeof value === 'string') {
|
|
92212
92209
|
value = new Date(value);
|
|
92213
92210
|
}
|
|
92214
|
-
this.
|
|
92211
|
+
if (value?.getTime() === this._value?.getTime()) {
|
|
92212
|
+
return;
|
|
92213
|
+
}
|
|
92214
|
+
this._setValue(value, true);
|
|
92215
92215
|
}
|
|
92216
92216
|
parseMinDate(minDate) {
|
|
92217
92217
|
if (minDate === null || minDate === '') {
|
|
@@ -92289,7 +92289,7 @@ class Datepicker {
|
|
|
92289
92289
|
}
|
|
92290
92290
|
}
|
|
92291
92291
|
render() {
|
|
92292
|
-
return (hAsync("p-dropdown", { key: '
|
|
92292
|
+
return (hAsync("p-dropdown", { key: 'e329571548f7fc670ea27b9096e43179bf575f48', allowOverflow: true, applyFullWidth: false, applyMaxWidth: false, disableTriggerClick: true, insideClick: true, isDatepicker: true, placement: this.placement, show: this._showDropdown, strategy: this.strategy }, hAsync("p-field", { key: '5904684c137055d5b2eb25890363ee8b458ce9ff', autoShowError: false, disabled: asBoolean(this.disabled), error: this.error, focused: this._showDropdown, forceShowTooltip: !!this.error?.length && !this._showDropdown, helper: this.helper, icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar-multi', iconPosition: 'start', label: this.label, loading: this.loading, placeholder: this.placeholder, prefix: this.prefix, required: asBoolean(this.required), showOptional: asBoolean(this.showOptional), size: this.size, slot: 'trigger', value: this._getFormattedDate(), onBlur: (ev) => this._onBlur(ev), onFocus: () => this._onFocus(), onInputRefChange: ev => (this._inputRef = ev.detail), onValueChange: ev => this._onValueChange(ev.detail) }), this.enableNativePicker && this._isMobileBrowser && (hAsync("input", { key: '18243b5177bf1ccafc938199d17303a13e9c0a2d', class: '\n pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden\n opacity-0\n ', max: this.maxDate &&
|
|
92293
92293
|
dateFnsExports.format(new Date(this.maxDate), 'yyyy-MM-dd', {
|
|
92294
92294
|
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
92295
92295
|
}), min: this._minDate &&
|
|
@@ -92298,7 +92298,7 @@ class Datepicker {
|
|
|
92298
92298
|
}), ref: ref => (this._dateInputRef = ref), slot: 'trigger', type: this.mode === 'day' ? 'date' : 'month', value: this._value &&
|
|
92299
92299
|
dateFnsExports.format(this._value, 'yyyy-MM-dd', {
|
|
92300
92300
|
locale: state.locale === 'nl' ? localeExports.nl : localeExports.enUS,
|
|
92301
|
-
}), onInput: ev => this._onNativeInput(ev) })), hAsync("div", { key: '
|
|
92301
|
+
}), onInput: ev => this._onNativeInput(ev) })), hAsync("div", { key: '72072c39f6b9f4234c39474084e10625bb739ff4', slot: 'items', tabIndex: -1 }, hAsync("p-calendar", { key: '374b07930dfaa7f1c1cfdf528fd0b53158d482bc', disableWeekends: this.disableWeekends, disabledDates: this.disabledDates, enableToday: this.enableToday, maxDate: this.maxDate, minDate: this.minDate, mode: this.mode, preselectToday: this.preselectToday, todayText: this.todayText, value: this._value, variant: 'embedded', onValueChange: ({ detail }) => (this.value = detail) }))));
|
|
92302
92302
|
}
|
|
92303
92303
|
documentClickHandler({ target }) {
|
|
92304
92304
|
if (!this._showDropdown || childOf(target, this._el)) {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,a as e,h as r}from"./p-yFtRjnrU.js";import{c as a}from"./p-CBWjHURv.js";import{d as i,l as s}from"./p-B_lDCj8j.js";import{T as o}from"./p-CSySY6aC.js";import{s as h}from"./p-6XOzWrsN.js";import{c as n}from"./p-xs4N_Y-0.js";import"./p-ChV9xqsO.js";const d=a(["flex w-[17.5rem] flex-col gap-4"],{variants:{variant:{default:["rounded-lg p-2 drop-shadow-2","border border-storm-100"],embedded:"p-1"}}}),c=a(["flex items-center gap-2","w-full rounded-lg p-2","\n bg-off-white-300\n dark:bg-white/15\n "],{variants:{type:{day:"justify-between",month:"justify-between",year:"justify-center"}}}),l=a(["flex flex-col gap-2","w-full"],{variants:{view:{day:"h-auto min-h-[12rem]",month:"min-h-[15rem]",year:"max-h-[15rem]"}}}),m=class{constructor(r){t(this,r),this.valueChange=e(this,"valueChange",3)}variant="default";value;preselectToday=!1;disabledDates;minDate=null;maxDate=null;disableWeekends=!1;enableToday=!0;todayText="today";mode="day";valueChange;_today=new Date;_view=this.mode;_viewDate=this._today;_value;_minDate;_maxDate;_disabledDates=[];_enableToday=!0;_weekDays=[...Array.from({length:7}).keys()];_yearItemsRef;componentWillLoad(){this.disabledDates&&this._parseDisabledDates(this.disabledDates),this._parseMinDate(this.minDate),this._parseMaxDate(this.maxDate),this._parseValue(this.value),this._value&&(this._viewDate=this._value),i.isBefore(this._viewDate,this._minDate)&&(this._viewDate=this._minDate),i.isAfter(this._viewDate,this._maxDate)&&(this._viewDate=this._maxDate),this._modeChange(this.mode)}componentWillRender(){this._enableToday=this.enableToday&&this._checkTodayButton()}componentDidRender(){"year"===this._view&&this._scrollYearIntoView()}_parseValue(t){!t&&this.preselectToday&&(t=new Date),"string"==typeof t&&(t=new Date(t)),i.isValid(t)&&!i.isSameDay(t,this._viewDate)&&(this._viewDate=t),this._setValue(t)}_parseMinDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),i.isValid(t)&&(this._minDate=t,i.isBefore(this._viewDate,this._minDate)&&(this._viewDate=this._minDate))):this.minDate=new Date(i.getYear(i.subYears(new Date,100)),0,1)}_parseMaxDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),i.isValid(t)&&(this._maxDate=t,i.isAfter(this._viewDate,this._maxDate)&&(this._viewDate=this._maxDate))):this.maxDate=this._getAutomaticMax()}_parseDisabledDates(t){"string"==typeof t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&(this._disabledDates=t.map((t=>"string"==typeof t?new Date(t):t)).filter((t=>i.isValid(t))))}_modeChange(t){"year"===t&&"year"!==this._view&&(this._view="year"),"month"===t&&"day"===this._view&&(this._view="month")}render(){return r(o,{key:"396e1c7059b24d8aec57317d839f448be1e37f26"},r("div",{key:"9030d30aa2fbd06919ec711c01f135ef35c5d7f6",class:d({variant:this.variant})},this._getView()))}_checkTodayButton(){return!(this._maxDate&&i.isAfter(this._today,this._maxDate)||this._minDate&&i.isBefore(this._today,this._minDate)||this.disableWeekends&&i.isWeekend(this._today)||"day"!==this.mode)}_getView(){return"year"===this._view?this._getYearView():"month"===this._view?this._getMonthView():this._getDayView()}_getDayView(){const t=this._generateDaysInMonth();return r("div",{class:l({view:"day"})},this._getHeader("day"),r("div",{class:"grid grid-cols-7 justify-between gap-1"},this._weekDays.map((t=>r("span",{class:"w-8 text-center text-xs text-storm-200"},i.format(i.addDays(new Date(2022,7,1),t),"nl"===h.locale?"EEEEEE":"eee",{locale:"nl"===h.locale?s.nl:s.enUS})))),t.map((t=>t.active?r("p-button",{class:n("w-8",`\n col-start-${t.offset}\n `),tabIndex:-1,variant:"primary",onClick:()=>this._setValue(t.date)},t.day):r("time",{class:n("normal flex items-center justify-center rounded-lg","h-8 w-8 text-sm font-semibold","text-storm-300","dark:bg-white/15",{"cursor-pointer hover:bg-white-600 hover:text-storm-500 dark:text-white dark:hover:bg-hurricane-300 dark:hover:text-white":!t.disabled,"dark:text-hurricane-200":t.disabled},`\n col-start-${t.offset}\n `,{"cursor-not-allowed opacity-60":t.disabled},{"border border-solid border-off-white-700 bg-off-white-300 text-storm-500 dark:border-none dark:bg-hurricane-200 dark:text-white":!t.disabled&&i.isSameDay(t.date,new Date)}),onClick:()=>this._setValue(t.date)},t.day)))))}_getMonthView(){const t=this._generateMonths();return r("div",{class:l({view:"month"})},this._getHeader("month"),r("div",{class:"flex flex-wrap items-start gap-2"},t.map((t=>r("p-button",{disabled:t.disabled,tabIndex:-1,variant:t.active?"primary":"secondary",onClick:()=>this._setMonth(t.month)},i.format(i.setMonth(new Date,t.month),"MMMM",{locale:"nl"===h.locale?s.nl:s.enUS}))))))}_getYearView(){const t=this._generateYears();return r("div",{class:l({view:"year"})},this._getHeader("year"),r("div",{class:"grid h-full grid-cols-4 gap-2 overflow-scroll",ref:t=>this._yearItemsRef=t},t.map((t=>r("p-button",{class:"w-full","data-active":t.active,"data-current":t.current,tabIndex:-1,variant:t.active?"primary":"secondary",onClick:()=>this._setYear(t.year)},t.year)))))}_getHeader(t="day"){let e=t=>this._changeMonth(t),a="month";return"month"!==t&&"year"!==t||(e=t=>this._changeYear(t),a="year"),r("div",{class:c({type:this.mode})},"year"!==this.mode&&r("p-button",{disabled:!this._canSetAmount(a,-1)||"year"===this._view,icon:"caret",iconRotate:90,size:"sm",tabIndex:-1,variant:"secondary",iconOnly:!0,onClick:()=>e(-1)}),r("div",{class:n("flex gap-2",{"flex-1":this._enableToday})},"year"!==this.mode&&r("p-button",{active:"month"===this._view&&"month"!==this.mode,disabled:!this._canChangeView("month"),size:"sm",tabIndex:-1,variant:"secondary",onClick:()=>this._changeView("month")},i.format(this._viewDate,"MMMM",{locale:"nl"===h.locale?s.nl:s.enUS})),r("p-button",{active:"year"===this._view&&"year"!==this.mode,disabled:!this._canChangeView("year"),size:"sm",tabIndex:-1,variant:"secondary",onClick:()=>this._changeView("year")},i.getYear(this._viewDate)),this._enableToday&&r("p-tooltip",{class:"ml-auto",content:this.todayText},r("p-button",{icon:"calendar",iconOnly:!0,size:"sm",slot:"trigger",tabIndex:-1,variant:"secondary",onClick:()=>this._setToday()}))),"year"!==this.mode&&r("p-button",{disabled:!this._canSetAmount(a,1)||"year"==this._view,icon:"caret",iconRotate:-90,size:"sm",tabIndex:-1,variant:"secondary",iconOnly:!0,onClick:()=>e(1)}))}_setYear(t){const e=i.setYear(this._viewDate,t);if("year"!==this.mode)return this._viewDate=e,void(this._view="month");this._viewDate=e,this._setValue(i.setMonth(i.setDate(e,1),0))}_setMonth(t){const e=i.setMonth(this._viewDate,t);if("day"===this.mode)return this._viewDate=e,void(this._view="day");this._viewDate=e,this._setValue(i.setDate(e,1))}_setToday(){this._viewDate=this._today,this._setValue(this._today),this._view="day"}_changeMonth(t=1){if(!this._canSetAmount("month",t))return;const e=i.addMonths(this._viewDate,t);this._viewDate=e}_changeYear(t=1){if(!this._canSetAmount("year",t))return;let e=i.addYears(this._viewDate,t);this._viewDate=e}_setValue(t){if(null===t)return this._value=null,void this.valueChange.emit(null);i.isValid(t)&&(this._isDisabledDay(t)||(t=i.startOfDay(t),i.isSameDay(t,this._value)||(this._value=t,this.valueChange.emit(t))))}_generateDaysInMonth(){return[...new Array(i.getDaysInMonth(this._viewDate)).keys()].map((t=>{const e=i.startOfDay(i.setDate(this._viewDate,t+=1)),r=i.getDay(e);return{day:t,date:e,offset:1===t&&(0===r?7:r),current:i.isSameDay(e,this._today),active:i.isSameDay(e,this._value),disabled:this._isDisabledDay(e)}}))}_isDisabledDay(t){return i.isBefore(t,this._minDate)&&!i.isSameDay(t,this._maxDate)||i.isAfter(t,this._maxDate)&&!i.isSameDay(t,this._maxDate)||(0===i.getDay(t)||6===i.getDay(t))&&this.disableWeekends||this._disabledDates.some((e=>i.isSameDay(e,t)))}_generateMonths(){const t=i.getYear(this._viewDate);return[...Array.from({length:12}).keys()].map((e=>{const r=new Date(t,e,1);return{month:e,current:i.isSameMonth(this._today,r),active:i.isSameMonth(this._value,r),disabled:i.isAfter(r,this._maxDate)||i.isBefore(i.endOfMonth(r),this._minDate)}}))}_generateYears(){const t=i.getYear(this._maxDate)+1,e=i.getYear(this._minDate);return[...new Array(t-e).keys()].map((t=>{const r=e+t;return{year:r,current:i.getYear(this._today)===r,active:i.getYear(this._value)===r}}))}_scrollYearIntoView(){const t=this._yearItemsRef;if(!t)return;const e=t.querySelector("p-button[data-active]");if(e)return t.scrollTo({top:e.offsetTop-100});const r=t.querySelector("p-button[data-current]");return r?t.scrollTo({top:r.offsetTop-100}):void 0}_changeView(t){this._canChangeView(t)&&(this._view=t)}_canChangeView(t){return"year"===t?!i.isSameYear(this._minDate,this._maxDate):!i.isSameMonth(this._minDate,this._maxDate)}_canSetAmount(t,e=1){if("month"===t){const t=i.addMonths(this._viewDate,e),r=i.startOfMonth(t);if(i.isBefore(r,i.startOfMonth(this._minDate))&&!i.isSameDay(r,this._minDate)||i.isAfter(r,i.endOfMonth(this._maxDate)))return!1}if("year"===t){let t=i.addYears(this._viewDate,e);const r=i.getYear(t);if(r<i.getYear(this._minDate)||r>i.getYear(this._maxDate))return!1}return!0}_getAutomaticMax(){const t=i.addYears(new Date,50);let e=i.getYear(t);return e=10*Math.ceil(e/10),i.setYear(t,e)}static get watchers(){return{value:[{_parseValue:0}],minDate:[{_parseMinDate:0}],maxDate:[{_parseMaxDate:0}],disabledDates:[{_parseDisabledDates:0}],mode:[{_modeChange:0}]}}};m.style="*{box-sizing:border-box}.static{position:static}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-5{grid-column-start:5}.col-start-6{grid-column-start:6}.col-start-7{grid-column-start:7}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.h-8{height:2rem}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[15rem\\]{max-height:15rem}.min-h-\\[12rem\\]{min-height:12rem}.min-h-\\[15rem\\]{min-height:15rem}.w-8{width:2rem}.w-\\[17\\.5rem\\]{width:17.5rem}.w-full{width:100%}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.overflow-scroll{overflow:scroll}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-off-white-700{--tw-border-opacity:1;border-color:rgb(222 219 213/var(--tw-border-opacity,1))}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-off-white-300{--tw-bg-opacity:1;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))}.p-1{padding:.25rem}.p-2{padding:.5rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-hurricane-200,.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-60{opacity:.6}.drop-shadow-2{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.04)) drop-shadow(0 2px 2px rgba(0,2,2,.04)) drop-shadow(0 4px 4px rgba(0,2,2,.04))}.drop-shadow-2,.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)}.hover\\:bg-white-600:hover{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:border-none:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-style:none}.dark\\:bg-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-hurricane-300:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))}.dark\\:hover\\:text-white:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-none:where([data-theme=dark],[data-theme=dark] *){border-style:none}.dark\\:bg-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-hurricane-300:hover:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))}.dark\\:hover\\:text-white:hover:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{m as p_calendar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,a as t,h as a,F as r}from"./p-yFtRjnrU.js";import{c as i}from"./p-CBWjHURv.js";import{f as d,h as o}from"./p-CWO2YJCh.js";import{c as s}from"./p-xs4N_Y-0.js";import"./p-ChV9xqsO.js";const h=i(["flex flex-1 items-center justify-start gap-2","h-8 min-w-0 rounded-lg px-2","border border-solid","bg-white-600 text-storm-200","dark:bg-white/15 dark:text-hurricane-200"],{variants:{click:{false:null,true:"cursor-pointer"},error:{false:"\n border-storm-100\n dark:border-white/15\n ",true:"\n border-negative-red-500\n dark:border-negative-red-alternative\n "}}}),c=class{constructor(a){e(this,a),this.upload=t(this,"upload",3),this.download=t(this,"download",3),this.delete=t(this,"delete",3)}enableCameraOnMobile=!1;value;fileId;accept=null;label;helper;required=!0;mode="read";placeholder="Upload a file...";cameraTooltip="Camera";downloadTooltip="Download";uploadTooltip="Upload";deleteTooltip="Delete";loading=!1;error;upload;download;delete;_fileRef;_cameraFileRef;render(){let e=a("p-icon",{key:"ff0d8b84e7b9a7dd184912d9689bcb8eca336c27",class:"text-storm-300",variant:"attachment"});this.error&&(e=a("p-icon",{key:"edafa66b2cd94083d4b14f3bb0c4cf1a956db04f",class:"text-negative-red-500",variant:"warning"}));const t=d()||o(),i="min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm";return a(r,{key:"c878d5f95e94c6a904bf51a63923ebfb29149279"},a("p-field-container",{key:"5c38ab29f7d89dc4baf70d95a7f54fb43ad9fd77",error:this.error,forceShowTooltip:!!this.error?.length,helper:this.helper,label:this.label,required:this.required,variant:"write"},a("div",{key:"d2b3ed159b77569568b86bee58598cfd3bc811e8",class:"flex w-full items-start gap-2",slot:"content"},a("div",{key:"217fbd58d7d081121a78ce755ef79ec94b108533",class:h({click:"write"===this.mode&&!this.value?.length,error:!!this.error?.length}),onClick:()=>this._uploadClick()},e,a("span",{key:"95ab133ba5db753795ab1f4ba9fe45bef7933af5",class:s(i,"\n peer\n empty:hidden\n dark:text-white\n ")},this.value),a("span",{key:"a50a20d896ab15606ab6d7fe6d05133b83e54c12",class:s(i,"\n hidden\n peer-empty:block\n ")},this.placeholder)),a("p-tooltip",{key:"92f97e12772a0ac65e2b790c70787590f6dccb21",class:"w-8",content:"read"===this.mode?this.downloadTooltip:this.value?.length?this.deleteTooltip:this.uploadTooltip},a("p-button",{key:"df4cf09aa1363950e8561a9cd5b628dd3d3c4410",disabled:this.loading,icon:"read"===this.mode?"download":this.value?.length?"trash":"upload",iconOnly:!0,loading:this.loading,slot:"trigger",variant:"secondary",onOnClick:()=>"write"!==this.mode||this.value?.length?("read"===this.mode?this.download:this.delete).emit():this._uploadClick()})),this.enableCameraOnMobile&&"write"===this.mode&&t&&!this.value?.length&&a("p-tooltip",{key:"4bfbbabd407d8fd1b0e71e18f279b25316e81cd7",class:"\n w-8\n desktop-xs:hidden\n ",content:this.cameraTooltip},a("p-button",{key:"5069ceeda4c540a80a616d5c61d96d06d379d28d",icon:"camera",iconOnly:!0,slot:"trigger",variant:"secondary",onOnClick:()=>this._cameraClick()})))),a("input",{key:"abca9a677b38953d1358e9947200a3dfc5f08ae4",accept:Array.isArray(this.accept)?this.accept?.join(","):this.accept,class:"hidden",ref:e=>this._fileRef=e,type:"file",onChange:e=>this._onFileChange(e)}),a("input",{key:"2f5a9f1a07c61c0e065ee4c01fb44464d1e2ca33",accept:"image/*",capture:"true",class:"hidden",ref:e=>this._cameraFileRef=e,type:"file",onChange:e=>this._onFileChange(e)}))}_uploadClick(){this._fileRef&&"write"===this.mode&&!this.value?.length&&this._fileRef.click()}_cameraClick(){this.enableCameraOnMobile&&!d()&&this._cameraFileRef&&"write"===this.mode&&this._cameraFileRef?.click()}_onFileChange(e){const t=e.target,a=t.files?.[0];if(a){this.loading=!0;const e=new FileReader;e.addEventListener("load",(e=>this._onLoad(a,e?.currentTarget?.result))),e.readAsDataURL(a)}}_onLoad(e,t){this.upload.emit({fileId:this.fileId,result:t,file:e}),this._fileRef&&(this._fileRef.value=""),this._cameraFileRef&&(this._cameraFileRef.value=""),this.loading=!1}};c.style=".block{display:block}*{box-sizing:border-box}:host{display:block;width:100%}.static{position:static}.flex{display:flex}.hidden{display:none}.h-8{height:2rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-negative-red-500{--tw-border-opacity:1;border-color:rgb(230 30 30/var(--tw-border-opacity,1))}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-white-600{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-negative-red-500{--tw-text-opacity:1;color:rgb(230 30 30/var(--tw-text-opacity,1))}.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.empty\\:hidden:empty{display:none}.peer:empty~.peer-empty\\:block{display:block}@media (min-width:64rem){.desktop-xs\\:hidden{display:none}}.dark\\:border-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(255 92 92/var(--tw-border-opacity,1))}.dark\\:border-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-color:hsla(0,0%,100%,.15)}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(255 92 92/var(--tw-border-opacity,1))}.dark\\:border-white\\/15:where([data-theme=dark],[data-theme=dark] *){border-color:hsla(0,0%,100%,.15)}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{c as p_attachment}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,a as e,d as i,h as s}from"./p-yFtRjnrU.js";import{d as a,l as h}from"./p-B_lDCj8j.js";import{s as l}from"./p-6XOzWrsN.js";import{c as n}from"./p-TyZ7uPES.js";import{i as r}from"./p-DPc49L2n.js";import{a as o}from"./p-C5CTp9IA.js";const d=class{constructor(i){t(this,i),this.valueChange=e(this,"valueChange",3),i.$hostElement$["s-ei"]?this._internals=i.$hostElement$["s-ei"]:(this._internals=i.$hostElement$.attachInternals(),i.$hostElement$["s-ei"]=this._internals)}placeholder;value;preselectToday=!1;enableNativePicker=!0;disabledDates;minDate=null;maxDate=null;disableWeekends=!1;enableToday=!0;todayText="today";mode="day";valueChange;format="dd-MM-yyyy";hideIconWhenFilled=!1;size="base";prefix;label;loading=!1;helper;required;showOptional=!0;error;disabled=!1;strategy="absolute";placement="bottom-start";get _el(){return i(this)}_showDropdown=!1;_value;_minDate;_maxDate;_disabledDates=[];_isMobileBrowser=!1;_internals;_onInputTimeout;_inputRef;_dateInputRef;_defaultFormats={year:"yyyy",month:"LLLL, yyyy",day:"dd-MM-yyyy",dayNoDashes:"ddMMyyyy"};parseValue(t){!t&&this.preselectToday&&(t=new Date),"string"==typeof t&&(t=new Date(t)),this._setValue(t)}parseMinDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),a.isValid(t)&&(this._minDate=t,a.isBefore(this._value,this._minDate)&&this._setValue(null))):this.minDate=new Date(a.getYear(a.subYears(new Date,100)),0,1)}parseMaxDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),a.isValid(t)&&(this._maxDate=t,a.isAfter(this._value,this._maxDate)&&this._setValue(null))):this.maxDate=this._getAutomaticMax()}parseDisabledDates(t){"string"==typeof t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&(this._disabledDates=t.map((t=>"string"==typeof t?new Date(t):t)).filter((t=>a.isValid(t))),this._isDisabledDay(this._value)&&this._setValue(null))}formResetCallback(){this._setValue(null)}formDisabledCallback(t){this._internals.form&&(this.disabled=t)}componentWillLoad(){this.disabledDates&&this.parseDisabledDates(this.disabledDates),this.parseMinDate(this.minDate),this.parseMaxDate(this.maxDate),this._isMobileBrowser=r(),this.parseValue(this.value)}componentWillRender(){"day"!==this.mode&&this.format===this._defaultFormats.day&&(this.format=this._defaultFormats[this.mode])}render(){return s("p-dropdown",{key:"9bd033bcc9c678b922d2708f0115359a10eda050",allowOverflow:!0,applyFullWidth:!1,applyMaxWidth:!1,disableTriggerClick:!0,insideClick:!0,isDatepicker:!0,placement:this.placement,show:this._showDropdown,strategy:this.strategy},s("p-field",{key:"9954ad569303d1c301e9e23c11ddc8667ed5885b",autoShowError:!1,disabled:o(this.disabled),error:this.error,focused:this._showDropdown,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,icon:this.hideIconWhenFilled&&this._value?null:"calendar-multi",iconPosition:"start",label:this.label,loading:this.loading,placeholder:this.placeholder,prefix:this.prefix,required:o(this.required),showOptional:o(this.showOptional),size:this.size,slot:"trigger",value:this._getFormattedDate(),onBlur:t=>this._onBlur(t),onFocus:()=>this._onFocus(),onInputRefChange:t=>this._inputRef=t.detail,onValueChange:t=>this._onValueChange(t.detail)}),this.enableNativePicker&&this._isMobileBrowser&&s("input",{key:"910da60dd3e8493be39af5153ec17fcaa712d547",class:"\n pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden\n opacity-0\n ",max:this.maxDate&&a.format(new Date(this.maxDate),"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}),min:this._minDate&&a.format(new Date(this._minDate),"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}),ref:t=>this._dateInputRef=t,slot:"trigger",type:"day"===this.mode?"date":"month",value:this._value&&a.format(this._value,"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}),onInput:t=>this._onNativeInput(t)}),s("div",{key:"dbc9708700e9da87b6eaed0074b2c0874af1273e",slot:"items",tabIndex:-1},s("p-calendar",{key:"f209ed8fb397826f9d17f1d635e815418335903c",disableWeekends:this.disableWeekends,disabledDates:this.disabledDates,enableToday:this.enableToday,maxDate:this.maxDate,minDate:this.minDate,mode:this.mode,preselectToday:this.preselectToday,todayText:this.todayText,value:this._value,variant:"embedded",onValueChange:({detail:t})=>this.value=t})))}documentClickHandler({target:t}){this._showDropdown&&!n(t,this._el)&&(this._showDropdown=!1)}_onFocus(){if(this._isMobileBrowser&&this._dateInputRef)return this._dateInputRef.focus(),this._dateInputRef.showPicker(),void this._inputRef.blur();this._showDropdown=!0}_onBlur(t,e){if(e=e||this.format,this._isMobileBrowser&&this._dateInputRef)return;t.relatedTarget&&!n(t.relatedTarget,this._el)&&(this._showDropdown=!1);const i=this._inputRef;if(null===i.value)return;const s=a.parse(i.value,e,new Date,{locale:"nl"===l.locale?h.nl:h.enUS});if(s===this._value)return;const r=a.isValid(s);if(!r&&e===this.format&&"day"===this.mode)return this._onBlur(t,this._defaultFormats.dayNoDashes);r&&!this._isDisabledDay(s)?this._setValue(s,!1):i.value=this._getFormattedDate()}_onValueChange(t,e=this.format){this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{if(0===t.length){if(null===this._value)return;return void this._setValue(null)}const i=a.parse(t,e,new Date);a.isValid(i)&&a.format(i,e,{locale:"nl"===l.locale?h.nl:h.enUS})===t?this._setValue(i,!1):"day"===this.mode&&this._onValueChange(t,this._defaultFormats.dayNoDashes)}),300)}_onNativeInput(t){t.target&&(this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{this._setValue(""===t.target.value?null:new Date(t.target.value),!1)})))}_setValue(t,e=!0){if(null===t)return this._value=null,void this.valueChange.emit(null);a.isValid(t)&&(this._isDisabledDay(t)?this._dateInputRef?.value&&(this._dateInputRef.value=this._value?a.format(this._value,"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}):null):(t="day"===this.mode?a.startOfDay(t):"month"===this.mode?a.startOfMonth(t):a.startOfYear(t),a.isSameDay(t,this._value)||(e&&(this._showDropdown=!1),this._value=t,this.valueChange.emit(t))))}_isDisabledDay(t){return this.disableWeekends&&a.isWeekend(t)||a.isBefore(t,this._minDate)&&!a.isSameDay(t,this._minDate)||a.isAfter(t,this._maxDate)&&!a.isSameDay(t,this._maxDate)||this._disabledDates.some((e=>a.isSameDay(e,t)))}_getFormattedDate(){return this._value?a.format(this._value,this.format,{locale:"nl"===l.locale?h.nl:h.enUS}):""}_getAutomaticMax(){const t=a.addYears(new Date,50);let e=a.getYear(t);return e=10*Math.ceil(e/10),a.setYear(t,e)}static get formAssociated(){return!0}static get watchers(){return{value:[{parseValue:0}],minDate:[{parseMinDate:0}],maxDate:[{parseMaxDate:0}],disabledDates:[{parseDisabledDates:0}]}}};d.style="*{box-sizing:border-box}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.left-0{left:0}.top-0{top:0}.z-\\[-10\\]{z-index:-10}.overflow-hidden{overflow:hidden}.opacity-0{opacity:0}.blur{--tw-blur:blur(8px)}.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)}";export{d as p_datepicker}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,a as e,h as r}from"./p-yFtRjnrU.js";import{c as a}from"./p-CBWjHURv.js";import{d as i,l as s}from"./p-B_lDCj8j.js";import{T as o}from"./p-CSySY6aC.js";import{s as h}from"./p-6XOzWrsN.js";import{c as n}from"./p-xs4N_Y-0.js";import"./p-ChV9xqsO.js";const d=a(["flex w-[17.5rem] flex-col gap-4"],{variants:{variant:{default:["rounded-lg p-2 drop-shadow-2","border border-storm-100"],embedded:"p-1"}}}),c=a(["flex items-center gap-2","w-full rounded-lg p-2","\n bg-off-white-300\n dark:bg-white/15\n "],{variants:{type:{day:"justify-between",month:"justify-between",year:"justify-center"}}}),l=a(["flex flex-col gap-2","w-full"],{variants:{view:{day:"h-auto min-h-[12rem]",month:"min-h-[15rem]",year:"max-h-[15rem]"}}}),m=class{constructor(r){t(this,r),this.valueChange=e(this,"valueChange",3)}variant="default";value;preselectToday=!1;disabledDates;minDate=null;maxDate=null;disableWeekends=!1;enableToday=!0;todayText="today";mode="day";valueChange;_today=new Date;_view=this.mode;_viewDate=this._today;_value;_minDate;_maxDate;_disabledDates=[];_enableToday=!0;_weekDays=[...Array.from({length:7}).keys()];_yearItemsRef;componentWillLoad(){this.disabledDates&&this._parseDisabledDates(this.disabledDates),this._parseMinDate(this.minDate),this._parseMaxDate(this.maxDate),this._parseValue(this.value),this._value&&(this._viewDate=this._value),i.isBefore(this._viewDate,this._minDate)&&(this._viewDate=this._minDate),i.isAfter(this._viewDate,this._maxDate)&&(this._viewDate=this._maxDate),this._modeChange(this.mode)}componentWillRender(){this._enableToday=this.enableToday&&this._checkTodayButton()}componentDidRender(){"year"===this._view&&this._scrollYearIntoView()}_parseValue(t){!t&&this.preselectToday&&(t=new Date),"string"==typeof t&&(t=new Date(t)),i.isValid(t)&&!i.isSameDay(t,this._viewDate)&&(this._viewDate=t),this._setValue(t)}_parseMinDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),i.isValid(t)&&(this._minDate=t,i.isBefore(this._viewDate,this._minDate)&&(this._viewDate=this._minDate))):this.minDate=new Date(i.getYear(i.subYears(new Date,100)),0,1)}_parseMaxDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),i.isValid(t)&&(this._maxDate=t,i.isAfter(this._viewDate,this._maxDate)&&(this._viewDate=this._maxDate))):this.maxDate=this._getAutomaticMax()}_parseDisabledDates(t){"string"==typeof t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&(this._disabledDates=t.map((t=>"string"==typeof t?new Date(t):t)).filter((t=>i.isValid(t))))}_modeChange(t){"year"===t&&"year"!==this._view&&(this._view="year"),"month"===t&&"day"===this._view&&(this._view="month")}render(){return r(o,{key:"396e1c7059b24d8aec57317d839f448be1e37f26"},r("div",{key:"9030d30aa2fbd06919ec711c01f135ef35c5d7f6",class:d({variant:this.variant})},this._getView()))}_checkTodayButton(){return!(this._maxDate&&i.isAfter(this._today,this._maxDate)||this._minDate&&i.isBefore(this._today,this._minDate)||this.disableWeekends&&i.isWeekend(this._today)||"day"!==this.mode)}_getView(){return"year"===this._view?this._getYearView():"month"===this._view?this._getMonthView():this._getDayView()}_getDayView(){const t=this._generateDaysInMonth();return r("div",{class:l({view:"day"})},this._getHeader("day"),r("div",{class:"grid grid-cols-7 justify-between gap-1"},this._weekDays.map((t=>r("span",{class:"w-8 text-center text-xs text-storm-200"},i.format(i.addDays(new Date(2022,7,1),t),"nl"===h.locale?"EEEEEE":"eee",{locale:"nl"===h.locale?s.nl:s.enUS})))),t.map((t=>t.active?r("p-button",{class:n("w-8",`\n col-start-${t.offset}\n `),tabIndex:-1,variant:"primary",onClick:()=>this._setValue(t.date)},t.day):r("time",{class:n("normal flex items-center justify-center rounded-lg","h-8 w-8 text-sm font-semibold","text-storm-300","dark:bg-white/15",{"cursor-pointer hover:bg-white-600 hover:text-storm-500 dark:text-white dark:hover:bg-hurricane-300 dark:hover:text-white":!t.disabled,"dark:text-hurricane-200":t.disabled},`\n col-start-${t.offset}\n `,{"cursor-not-allowed opacity-60":t.disabled},{"border border-solid border-off-white-700 bg-off-white-300 text-storm-500 dark:border-none dark:bg-hurricane-200 dark:text-white":!t.disabled&&i.isSameDay(t.date,new Date)}),onClick:()=>this._setValue(t.date)},t.day)))))}_getMonthView(){const t=this._generateMonths();return r("div",{class:l({view:"month"})},this._getHeader("month"),r("div",{class:"flex flex-wrap items-start gap-2"},t.map((t=>r("p-button",{disabled:t.disabled,tabIndex:-1,variant:t.active?"primary":"secondary",onClick:()=>this._setMonth(t.month)},i.format(i.setMonth(new Date,t.month),"MMMM",{locale:"nl"===h.locale?s.nl:s.enUS}))))))}_getYearView(){const t=this._generateYears();return r("div",{class:l({view:"year"})},this._getHeader("year"),r("div",{class:"grid h-full grid-cols-4 gap-2 overflow-scroll",ref:t=>this._yearItemsRef=t},t.map((t=>r("p-button",{class:"w-full","data-active":t.active,"data-current":t.current,tabIndex:-1,variant:t.active?"primary":"secondary",onClick:()=>this._setYear(t.year)},t.year)))))}_getHeader(t="day"){let e=t=>this._changeMonth(t),a="month";return"month"!==t&&"year"!==t||(e=t=>this._changeYear(t),a="year"),r("div",{class:c({type:this.mode})},"year"!==this.mode&&r("p-button",{disabled:!this._canSetAmount(a,-1)||"year"===this._view,icon:"caret",iconRotate:90,size:"sm",tabIndex:-1,variant:"secondary",iconOnly:!0,onClick:()=>e(-1)}),r("div",{class:n("flex gap-2",{"flex-1":this._enableToday})},"year"!==this.mode&&r("p-button",{active:"month"===this._view&&"month"!==this.mode,disabled:!this._canChangeView("month"),size:"sm",tabIndex:-1,variant:"secondary",onClick:()=>this._changeView("month")},i.format(this._viewDate,"MMMM",{locale:"nl"===h.locale?s.nl:s.enUS})),r("p-button",{active:"year"===this._view&&"year"!==this.mode,disabled:!this._canChangeView("year"),size:"sm",tabIndex:-1,variant:"secondary",onClick:()=>this._changeView("year")},i.getYear(this._viewDate)),this._enableToday&&r("p-tooltip",{class:"ml-auto",content:this.todayText},r("p-button",{icon:"calendar",iconOnly:!0,size:"sm",slot:"trigger",tabIndex:-1,variant:"secondary",onClick:()=>this._setToday()}))),"year"!==this.mode&&r("p-button",{disabled:!this._canSetAmount(a,1)||"year"==this._view,icon:"caret",iconRotate:-90,size:"sm",tabIndex:-1,variant:"secondary",iconOnly:!0,onClick:()=>e(1)}))}_setYear(t){const e=i.setYear(this._viewDate,t);if("year"!==this.mode)return this._viewDate=e,void(this._view="month");this._viewDate=e,this._setValue(i.setMonth(i.setDate(e,1),0))}_setMonth(t){const e=i.setMonth(this._viewDate,t);if("day"===this.mode)return this._viewDate=e,void(this._view="day");this._viewDate=e,this._setValue(i.setDate(e,1))}_setToday(){this._viewDate=this._today,this._setValue(this._today),this._view="day"}_changeMonth(t=1){if(!this._canSetAmount("month",t))return;const e=i.addMonths(this._viewDate,t);this._viewDate=e}_changeYear(t=1){if(!this._canSetAmount("year",t))return;let e=i.addYears(this._viewDate,t);this._viewDate=e}_setValue(t){if(null===t)return this._value=null,void this.valueChange.emit(null);i.isValid(t)&&(this._isDisabledDay(t)||(t=i.startOfDay(t),i.isSameDay(t,this._value)||(this._value=t,this.valueChange.emit(t))))}_generateDaysInMonth(){return[...new Array(i.getDaysInMonth(this._viewDate)).keys()].map((t=>{const e=i.startOfDay(i.setDate(this._viewDate,t+=1)),r=i.getDay(e);return{day:t,date:e,offset:1===t&&(0===r?7:r),current:i.isSameDay(e,this._today),active:i.isSameDay(e,this._value),disabled:this._isDisabledDay(e)}}))}_isDisabledDay(t){return i.isBefore(t,this._minDate)&&!i.isSameDay(t,this._maxDate)||i.isAfter(t,this._maxDate)&&!i.isSameDay(t,this._maxDate)||(0===i.getDay(t)||6===i.getDay(t))&&this.disableWeekends||this._disabledDates.some((e=>i.isSameDay(e,t)))}_generateMonths(){const t=i.getYear(this._viewDate);return[...Array.from({length:12}).keys()].map((e=>{const r=new Date(t,e,1);return{month:e,current:i.isSameMonth(this._today,r),active:i.isSameMonth(this._value,r),disabled:i.isAfter(r,this._maxDate)||i.isBefore(i.endOfMonth(r),this._minDate)}}))}_generateYears(){const t=i.getYear(this._maxDate)+1,e=i.getYear(this._minDate);return[...new Array(t-e).keys()].map((t=>{const r=e+t;return{year:r,current:i.getYear(this._today)===r,active:i.getYear(this._value)===r}}))}_scrollYearIntoView(){const t=this._yearItemsRef;if(!t)return;const e=t.querySelector("p-button[data-active]");if(e)return t.scrollTo({top:e.offsetTop-100});const r=t.querySelector("p-button[data-current]");return r?t.scrollTo({top:r.offsetTop-100}):void 0}_changeView(t){this._canChangeView(t)&&(this._view=t)}_canChangeView(t){return"year"===t?!i.isSameYear(this._minDate,this._maxDate):!i.isSameMonth(this._minDate,this._maxDate)}_canSetAmount(t,e=1){if("month"===t){const t=i.addMonths(this._viewDate,e),r=i.startOfMonth(t);if(i.isBefore(r,i.startOfMonth(this._minDate))&&!i.isSameDay(r,this._minDate)||i.isAfter(r,i.endOfMonth(this._maxDate)))return!1}if("year"===t){let t=i.addYears(this._viewDate,e);const r=i.getYear(t);if(r<i.getYear(this._minDate)||r>i.getYear(this._maxDate))return!1}return!0}_getAutomaticMax(){const t=i.addYears(new Date,50);let e=i.getYear(t);return e=10*Math.ceil(e/10),i.setYear(t,e)}static get watchers(){return{value:[{_parseValue:0}],minDate:[{_parseMinDate:0}],maxDate:[{_parseMaxDate:0}],disabledDates:[{_parseDisabledDates:0}],mode:[{_modeChange:0}]}}};m.style="*{box-sizing:border-box}.static{position:static}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-5{grid-column-start:5}.col-start-6{grid-column-start:6}.col-start-7{grid-column-start:7}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.h-8{height:2rem}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[15rem\\]{max-height:15rem}.min-h-\\[12rem\\]{min-height:12rem}.min-h-\\[15rem\\]{min-height:15rem}.w-8{width:2rem}.w-\\[17\\.5rem\\]{width:17.5rem}.w-full{width:100%}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.overflow-scroll{overflow:scroll}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-off-white-700{--tw-border-opacity:1;border-color:rgb(222 219 213/var(--tw-border-opacity,1))}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-off-white-300{--tw-bg-opacity:1;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))}.p-1{padding:.25rem}.p-2{padding:.5rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-hurricane-200,.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-60{opacity:.6}.drop-shadow-2{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.04)) drop-shadow(0 2px 2px rgba(0,2,2,.04)) drop-shadow(0 4px 4px rgba(0,2,2,.04))}.drop-shadow-2,.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)}.hover\\:bg-white-600:hover{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.dark\\:border-none:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-style:none}.dark\\:bg-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-hurricane-300:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))}.dark\\:hover\\:text-white:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-none:where([data-theme=dark],[data-theme=dark] *){border-style:none}.dark\\:bg-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-hurricane-300:hover:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))}.dark\\:hover\\:text-white:hover:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{m as p_calendar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,a as t,h as a,F as r}from"./p-yFtRjnrU.js";import{c as i}from"./p-CBWjHURv.js";import{f as d,h as o}from"./p-CWO2YJCh.js";import{c as s}from"./p-xs4N_Y-0.js";import"./p-ChV9xqsO.js";const h=i(["flex flex-1 items-center justify-start gap-2","h-8 min-w-0 rounded-lg px-2","border border-solid","bg-white-600 text-storm-200","dark:bg-white/15 dark:text-hurricane-200"],{variants:{click:{false:null,true:"cursor-pointer"},error:{false:"\n border-storm-100\n dark:border-white/15\n ",true:"\n border-negative-red-500\n dark:border-negative-red-alternative\n "}}}),c=class{constructor(a){e(this,a),this.upload=t(this,"upload",3),this.download=t(this,"download",3),this.delete=t(this,"delete",3)}enableCameraOnMobile=!1;value;fileId;accept=null;label;helper;required=!0;mode="read";placeholder="Upload a file...";cameraTooltip="Camera";downloadTooltip="Download";uploadTooltip="Upload";deleteTooltip="Delete";loading=!1;error;upload;download;delete;_fileRef;_cameraFileRef;render(){let e=a("p-icon",{key:"ff0d8b84e7b9a7dd184912d9689bcb8eca336c27",class:"text-storm-300",variant:"attachment"});this.error&&(e=a("p-icon",{key:"edafa66b2cd94083d4b14f3bb0c4cf1a956db04f",class:"text-negative-red-500",variant:"warning"}));const t=d()||o(),i="min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm";return a(r,{key:"c878d5f95e94c6a904bf51a63923ebfb29149279"},a("p-field-container",{key:"5c38ab29f7d89dc4baf70d95a7f54fb43ad9fd77",error:this.error,forceShowTooltip:!!this.error?.length,helper:this.helper,label:this.label,required:this.required,variant:"write"},a("div",{key:"d2b3ed159b77569568b86bee58598cfd3bc811e8",class:"flex w-full items-start gap-2",slot:"content"},a("div",{key:"217fbd58d7d081121a78ce755ef79ec94b108533",class:h({click:"write"===this.mode&&!this.value?.length,error:!!this.error?.length}),onClick:()=>this._uploadClick()},e,a("span",{key:"95ab133ba5db753795ab1f4ba9fe45bef7933af5",class:s(i,"\n peer\n empty:hidden\n dark:text-white\n ")},this.value),a("span",{key:"a50a20d896ab15606ab6d7fe6d05133b83e54c12",class:s(i,"\n hidden\n peer-empty:block\n ")},this.placeholder)),a("p-tooltip",{key:"92f97e12772a0ac65e2b790c70787590f6dccb21",class:"w-8",content:"read"===this.mode?this.downloadTooltip:this.value?.length?this.deleteTooltip:this.uploadTooltip},a("p-button",{key:"df4cf09aa1363950e8561a9cd5b628dd3d3c4410",disabled:this.loading,icon:"read"===this.mode?"download":this.value?.length?"trash":"upload",iconOnly:!0,loading:this.loading,slot:"trigger",variant:"secondary",onOnClick:()=>"write"!==this.mode||this.value?.length?("read"===this.mode?this.download:this.delete).emit():this._uploadClick()})),this.enableCameraOnMobile&&"write"===this.mode&&t&&!this.value?.length&&a("p-tooltip",{key:"4bfbbabd407d8fd1b0e71e18f279b25316e81cd7",class:"\n w-8\n desktop-xs:hidden\n ",content:this.cameraTooltip},a("p-button",{key:"5069ceeda4c540a80a616d5c61d96d06d379d28d",icon:"camera",iconOnly:!0,slot:"trigger",variant:"secondary",onOnClick:()=>this._cameraClick()})))),a("input",{key:"abca9a677b38953d1358e9947200a3dfc5f08ae4",accept:Array.isArray(this.accept)?this.accept?.join(","):this.accept,class:"hidden",ref:e=>this._fileRef=e,type:"file",onChange:e=>this._onFileChange(e)}),a("input",{key:"2f5a9f1a07c61c0e065ee4c01fb44464d1e2ca33",accept:"image/*",capture:"true",class:"hidden",ref:e=>this._cameraFileRef=e,type:"file",onChange:e=>this._onFileChange(e)}))}_uploadClick(){this._fileRef&&"write"===this.mode&&!this.value?.length&&this._fileRef.click()}_cameraClick(){this.enableCameraOnMobile&&!d()&&this._cameraFileRef&&"write"===this.mode&&this._cameraFileRef?.click()}_onFileChange(e){const t=e.target,a=t.files?.[0];if(a){this.loading=!0;const e=new FileReader;e.addEventListener("load",(e=>this._onLoad(a,e?.currentTarget?.result))),e.readAsDataURL(a)}}_onLoad(e,t){this.upload.emit({fileId:this.fileId,result:t,file:e}),this._fileRef&&(this._fileRef.value=""),this._cameraFileRef&&(this._cameraFileRef.value=""),this.loading=!1}};c.style=".block{display:block}*{box-sizing:border-box}:host{display:block;width:100%}.static{position:static}.flex{display:flex}.hidden{display:none}.h-8{height:2rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-negative-red-500{--tw-border-opacity:1;border-color:rgb(230 30 30/var(--tw-border-opacity,1))}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-white-600{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-negative-red-500{--tw-text-opacity:1;color:rgb(230 30 30/var(--tw-text-opacity,1))}.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.empty\\:hidden:empty{display:none}.peer:empty~.peer-empty\\:block{display:block}@media (min-width:64rem){.desktop-xs\\:hidden{display:none}}.dark\\:border-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(255 92 92/var(--tw-border-opacity,1))}.dark\\:border-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-color:hsla(0,0%,100%,.15)}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(255 92 92/var(--tw-border-opacity,1))}.dark\\:border-white\\/15:where([data-theme=dark],[data-theme=dark] *){border-color:hsla(0,0%,100%,.15)}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}";export{c as p_attachment}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,a as e,d as i,h as s}from"./p-yFtRjnrU.js";import{d as a,l as h}from"./p-B_lDCj8j.js";import{s as l}from"./p-6XOzWrsN.js";import{c as n}from"./p-TyZ7uPES.js";import{i as r}from"./p-DPc49L2n.js";import{a as o}from"./p-C5CTp9IA.js";const d=class{constructor(i){t(this,i),this.valueChange=e(this,"valueChange",3),i.$hostElement$["s-ei"]?this._internals=i.$hostElement$["s-ei"]:(this._internals=i.$hostElement$.attachInternals(),i.$hostElement$["s-ei"]=this._internals)}placeholder;value;preselectToday=!1;enableNativePicker=!0;disabledDates;minDate=null;maxDate=null;disableWeekends=!1;enableToday=!0;todayText="today";mode="day";valueChange;format="dd-MM-yyyy";hideIconWhenFilled=!1;size="base";prefix;label;loading=!1;helper;required;showOptional=!0;error;disabled=!1;strategy="absolute";placement="bottom-start";get _el(){return i(this)}_showDropdown=!1;_value;_minDate;_maxDate;_disabledDates=[];_isMobileBrowser=!1;_internals;_onInputTimeout;_inputRef;_dateInputRef;_defaultFormats={year:"yyyy",month:"LLLL, yyyy",day:"dd-MM-yyyy",dayNoDashes:"ddMMyyyy"};parseValue(t){!t&&this.preselectToday&&(t=new Date),"string"==typeof t&&(t=new Date(t)),this._setValue(t)}parseMinDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),a.isValid(t)&&(this._minDate=t,a.isBefore(this._value,this._minDate)&&this._setValue(null))):this.minDate=new Date(a.getYear(a.subYears(new Date,100)),0,1)}parseMaxDate(t){null!==t&&""!==t?("string"==typeof t&&(t=new Date(t)),a.isValid(t)&&(this._maxDate=t,a.isAfter(this._value,this._maxDate)&&this._setValue(null))):this.maxDate=this._getAutomaticMax()}parseDisabledDates(t){"string"==typeof t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&(this._disabledDates=t.map((t=>"string"==typeof t?new Date(t):t)).filter((t=>a.isValid(t))),this._isDisabledDay(this._value)&&this._setValue(null))}formResetCallback(){this._setValue(null)}formDisabledCallback(t){this._internals.form&&(this.disabled=t)}componentWillLoad(){this.disabledDates&&this.parseDisabledDates(this.disabledDates),this.parseMinDate(this.minDate),this.parseMaxDate(this.maxDate),this._isMobileBrowser=r(),this.parseValue(this.value)}componentWillRender(){"day"!==this.mode&&this.format===this._defaultFormats.day&&(this.format=this._defaultFormats[this.mode])}render(){return s("p-dropdown",{key:"9bd033bcc9c678b922d2708f0115359a10eda050",allowOverflow:!0,applyFullWidth:!1,applyMaxWidth:!1,disableTriggerClick:!0,insideClick:!0,isDatepicker:!0,placement:this.placement,show:this._showDropdown,strategy:this.strategy},s("p-field",{key:"9954ad569303d1c301e9e23c11ddc8667ed5885b",autoShowError:!1,disabled:o(this.disabled),error:this.error,focused:this._showDropdown,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,icon:this.hideIconWhenFilled&&this._value?null:"calendar-multi",iconPosition:"start",label:this.label,loading:this.loading,placeholder:this.placeholder,prefix:this.prefix,required:o(this.required),showOptional:o(this.showOptional),size:this.size,slot:"trigger",value:this._getFormattedDate(),onBlur:t=>this._onBlur(t),onFocus:()=>this._onFocus(),onInputRefChange:t=>this._inputRef=t.detail,onValueChange:t=>this._onValueChange(t.detail)}),this.enableNativePicker&&this._isMobileBrowser&&s("input",{key:"910da60dd3e8493be39af5153ec17fcaa712d547",class:"\n pointer-events-none absolute left-0 top-0 z-[-10] overflow-hidden\n opacity-0\n ",max:this.maxDate&&a.format(new Date(this.maxDate),"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}),min:this._minDate&&a.format(new Date(this._minDate),"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}),ref:t=>this._dateInputRef=t,slot:"trigger",type:"day"===this.mode?"date":"month",value:this._value&&a.format(this._value,"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}),onInput:t=>this._onNativeInput(t)}),s("div",{key:"dbc9708700e9da87b6eaed0074b2c0874af1273e",slot:"items",tabIndex:-1},s("p-calendar",{key:"f209ed8fb397826f9d17f1d635e815418335903c",disableWeekends:this.disableWeekends,disabledDates:this.disabledDates,enableToday:this.enableToday,maxDate:this.maxDate,minDate:this.minDate,mode:this.mode,preselectToday:this.preselectToday,todayText:this.todayText,value:this._value,variant:"embedded",onValueChange:({detail:t})=>this.value=t})))}documentClickHandler({target:t}){this._showDropdown&&!n(t,this._el)&&(this._showDropdown=!1)}_onFocus(){if(this._isMobileBrowser&&this._dateInputRef)return this._dateInputRef.focus(),this._dateInputRef.showPicker(),void this._inputRef.blur();this._showDropdown=!0}_onBlur(t,e){if(e=e||this.format,this._isMobileBrowser&&this._dateInputRef)return;t.relatedTarget&&!n(t.relatedTarget,this._el)&&(this._showDropdown=!1);const i=this._inputRef;if(null===i.value)return;const s=a.parse(i.value,e,new Date,{locale:"nl"===l.locale?h.nl:h.enUS});if(s===this._value)return;const r=a.isValid(s);if(!r&&e===this.format&&"day"===this.mode)return this._onBlur(t,this._defaultFormats.dayNoDashes);r&&!this._isDisabledDay(s)?this._setValue(s,!1):i.value=this._getFormattedDate()}_onValueChange(t,e=this.format){this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{if(0===t.length){if(null===this._value)return;return void this._setValue(null)}const i=a.parse(t,e,new Date);a.isValid(i)&&a.format(i,e,{locale:"nl"===l.locale?h.nl:h.enUS})===t?this._setValue(i,!1):"day"===this.mode&&this._onValueChange(t,this._defaultFormats.dayNoDashes)}),300)}_onNativeInput(t){t.target&&(this._onInputTimeout&&(clearTimeout(this._onInputTimeout),this._onInputTimeout=null),this._onInputTimeout=setTimeout((()=>{this._setValue(""===t.target.value?null:new Date(t.target.value),!1)})))}_setValue(t,e=!0){if(null===t)return this._value=null,void this.valueChange.emit(null);a.isValid(t)&&(this._isDisabledDay(t)?this._dateInputRef?.value&&(this._dateInputRef.value=this._value?a.format(this._value,"yyyy-MM-dd",{locale:"nl"===l.locale?h.nl:h.enUS}):null):(t="day"===this.mode?a.startOfDay(t):"month"===this.mode?a.startOfMonth(t):a.startOfYear(t),a.isSameDay(t,this._value)||(e&&(this._showDropdown=!1),this._value=t,this.valueChange.emit(t))))}_isDisabledDay(t){return this.disableWeekends&&a.isWeekend(t)||a.isBefore(t,this._minDate)&&!a.isSameDay(t,this._minDate)||a.isAfter(t,this._maxDate)&&!a.isSameDay(t,this._maxDate)||this._disabledDates.some((e=>a.isSameDay(e,t)))}_getFormattedDate(){return this._value?a.format(this._value,this.format,{locale:"nl"===l.locale?h.nl:h.enUS}):""}_getAutomaticMax(){const t=a.addYears(new Date,50);let e=a.getYear(t);return e=10*Math.ceil(e/10),a.setYear(t,e)}static get formAssociated(){return!0}static get watchers(){return{value:[{parseValue:0}],minDate:[{parseMinDate:0}],maxDate:[{parseMaxDate:0}],disabledDates:[{parseDisabledDates:0}]}}};d.style="*{box-sizing:border-box}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.left-0{left:0}.top-0{top:0}.z-\\[-10\\]{z-index:-10}.overflow-hidden{overflow:hidden}.opacity-0{opacity:0}.blur{--tw-blur:blur(8px)}.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)}";export{d as p_datepicker}
|