@beweco/aurora-ui 0.6.54 → 0.6.56
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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +5 -286
- package/dist/index.esm.js +5 -286
- package/dist/types/components/drawer-filters/DrawerFilters.d.ts.map +1 -1
- package/dist/types/components/drawer-filters/_internal/DayMonthPicker.d.ts.map +1 -1
- package/dist/types/components/drawer-filters/index.d.ts +1 -1
- package/dist/types/components/drawer-filters/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4291,12 +4291,6 @@ function $14e0f24ef4ac5c92$export$dbc69fd56b53d5e(a, b) {
|
|
|
4291
4291
|
var _a_isEqual1, _ref;
|
|
4292
4292
|
return (_ref = (_a_isEqual1 = (_a_isEqual = a.isEqual) === null || _a_isEqual === void 0 ? void 0 : _a_isEqual.call(a, b)) !== null && _a_isEqual1 !== void 0 ? _a_isEqual1 : (_b_isEqual = b.isEqual) === null || _b_isEqual === void 0 ? void 0 : _b_isEqual.call(b, a)) !== null && _ref !== void 0 ? _ref : a.identifier === b.identifier;
|
|
4293
4293
|
}
|
|
4294
|
-
function $14e0f24ef4ac5c92$export$461939dd4422153(timeZone) {
|
|
4295
|
-
return ($11d87f3f76e88657$export$1b96692a1ba042ac)(Date.now(), timeZone);
|
|
4296
|
-
}
|
|
4297
|
-
function $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone) {
|
|
4298
|
-
return ($11d87f3f76e88657$export$93522d1a439f3617)($14e0f24ef4ac5c92$export$461939dd4422153(timeZone));
|
|
4299
|
-
}
|
|
4300
4294
|
function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a, b) {
|
|
4301
4295
|
return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
|
|
4302
4296
|
}
|
|
@@ -4438,21 +4432,6 @@ function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguatio
|
|
|
4438
4432
|
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
|
|
4439
4433
|
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
4440
4434
|
}
|
|
4441
|
-
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
|
|
4442
|
-
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
|
|
4443
|
-
let date = new Date(ms + offset);
|
|
4444
|
-
let year = date.getUTCFullYear();
|
|
4445
|
-
let month = date.getUTCMonth() + 1;
|
|
4446
|
-
let day = date.getUTCDate();
|
|
4447
|
-
let hour = date.getUTCHours();
|
|
4448
|
-
let minute = date.getUTCMinutes();
|
|
4449
|
-
let second = date.getUTCSeconds();
|
|
4450
|
-
let millisecond = date.getUTCMilliseconds();
|
|
4451
|
-
return new ($35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);
|
|
4452
|
-
}
|
|
4453
|
-
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
|
|
4454
|
-
return new ($35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
|
|
4455
|
-
}
|
|
4456
4435
|
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
|
|
4457
4436
|
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
4458
4437
|
if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
|
|
@@ -4472,36 +4451,7 @@ function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
|
|
|
4472
4451
|
($735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
|
|
4473
4452
|
return copy;
|
|
4474
4453
|
}
|
|
4475
|
-
function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
|
|
4476
|
-
if (date instanceof ($35ea8db9cb2ccb90$export$d3b7288e7994edea)) {
|
|
4477
|
-
if (date.timeZone === timeZone) return date;
|
|
4478
|
-
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
4479
|
-
}
|
|
4480
|
-
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
|
|
4481
|
-
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
|
|
4482
|
-
}
|
|
4483
|
-
function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
|
|
4484
|
-
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
4485
|
-
return new Date(ms);
|
|
4486
|
-
}
|
|
4487
|
-
function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
|
|
4488
|
-
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
4489
|
-
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
|
|
4490
|
-
}
|
|
4491
|
-
|
|
4492
|
-
/*
|
|
4493
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
4494
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4495
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
4496
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4497
|
-
*
|
|
4498
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
4499
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
4500
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
4501
|
-
* governing permissions and limitations under the License.
|
|
4502
|
-
*/
|
|
4503
4454
|
|
|
4504
|
-
const $735220c2d4774dd3$var$ONE_HOUR = 3600000;
|
|
4505
4455
|
function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
|
|
4506
4456
|
let mutableDate = date.copy();
|
|
4507
4457
|
let days = 'hour' in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
|
|
@@ -4726,106 +4676,6 @@ function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false
|
|
|
4726
4676
|
}
|
|
4727
4677
|
return value;
|
|
4728
4678
|
}
|
|
4729
|
-
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
|
|
4730
|
-
let ms;
|
|
4731
|
-
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
|
|
4732
|
-
let res = $735220c2d4774dd3$export$e16d8520af44a096(($11d87f3f76e88657$export$b21e0b124e224484)(dateTime), {
|
|
4733
|
-
years: duration.years,
|
|
4734
|
-
months: duration.months,
|
|
4735
|
-
weeks: duration.weeks,
|
|
4736
|
-
days: duration.days
|
|
4737
|
-
});
|
|
4738
|
-
// Changing the date may change the timezone offset, so we need to recompute
|
|
4739
|
-
// using the 'compatible' disambiguation.
|
|
4740
|
-
ms = ($11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
|
|
4741
|
-
} else // Otherwise, preserve the offset of the original date.
|
|
4742
|
-
ms = ($11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
|
|
4743
|
-
// Perform time manipulation in milliseconds rather than on the original time fields to account for DST.
|
|
4744
|
-
// For example, adding one hour during a DST transition may result in the hour field staying the same or
|
|
4745
|
-
// skipping an hour. This results in the offset field changing value instead of the specified field.
|
|
4746
|
-
ms += duration.milliseconds || 0;
|
|
4747
|
-
ms += (duration.seconds || 0) * 1000;
|
|
4748
|
-
ms += (duration.minutes || 0) * 60000;
|
|
4749
|
-
ms += (duration.hours || 0) * 3600000;
|
|
4750
|
-
let res = ($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone);
|
|
4751
|
-
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(res, dateTime.calendar);
|
|
4752
|
-
}
|
|
4753
|
-
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
|
|
4754
|
-
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
4755
|
-
}
|
|
4756
|
-
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
|
|
4757
|
-
// For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.
|
|
4758
|
-
// For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC
|
|
4759
|
-
// offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.
|
|
4760
|
-
switch(field){
|
|
4761
|
-
case 'hour':
|
|
4762
|
-
{
|
|
4763
|
-
let min = 0;
|
|
4764
|
-
let max = 23;
|
|
4765
|
-
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
4766
|
-
let isPM = dateTime.hour >= 12;
|
|
4767
|
-
min = isPM ? 12 : 0;
|
|
4768
|
-
max = isPM ? 23 : 11;
|
|
4769
|
-
}
|
|
4770
|
-
// The minimum and maximum hour may be affected by daylight saving time.
|
|
4771
|
-
// For example, it might jump forward at midnight, and skip 1am.
|
|
4772
|
-
// Or it might end at midnight and repeat the 11pm hour. To handle this, we get
|
|
4773
|
-
// the possible absolute times for the min and max, and find the maximum range
|
|
4774
|
-
// that is within the current day.
|
|
4775
|
-
let plainDateTime = ($11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
|
|
4776
|
-
let minDate = ($11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
4777
|
-
hour: min
|
|
4778
|
-
}), new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
|
|
4779
|
-
let minAbsolute = [
|
|
4780
|
-
($11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'earlier'),
|
|
4781
|
-
($11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'later')
|
|
4782
|
-
].filter((ms)=>($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === minDate.day)[0];
|
|
4783
|
-
let maxDate = ($11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
4784
|
-
hour: max
|
|
4785
|
-
}), new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
|
|
4786
|
-
let maxAbsolute = [
|
|
4787
|
-
($11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'earlier'),
|
|
4788
|
-
($11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'later')
|
|
4789
|
-
].filter((ms)=>($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === maxDate.day).pop();
|
|
4790
|
-
// Since hours may repeat, we need to operate on the absolute time in milliseconds.
|
|
4791
|
-
// This is done in hours from the Unix epoch so that cycleValue works correctly,
|
|
4792
|
-
// and then converted back to milliseconds.
|
|
4793
|
-
let ms = ($11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
|
|
4794
|
-
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
|
|
4795
|
-
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
|
|
4796
|
-
ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
|
|
4797
|
-
// Now compute the new timezone offset, and convert the absolute time back to local time.
|
|
4798
|
-
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
|
|
4799
|
-
}
|
|
4800
|
-
case 'minute':
|
|
4801
|
-
case 'second':
|
|
4802
|
-
case 'millisecond':
|
|
4803
|
-
// @ts-ignore
|
|
4804
|
-
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
|
|
4805
|
-
case 'era':
|
|
4806
|
-
case 'year':
|
|
4807
|
-
case 'month':
|
|
4808
|
-
case 'day':
|
|
4809
|
-
{
|
|
4810
|
-
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c(($11d87f3f76e88657$export$b21e0b124e224484)(dateTime), field, amount, options);
|
|
4811
|
-
let ms = ($11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);
|
|
4812
|
-
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
|
|
4813
|
-
}
|
|
4814
|
-
default:
|
|
4815
|
-
throw new Error('Unsupported field ' + field);
|
|
4816
|
-
}
|
|
4817
|
-
}
|
|
4818
|
-
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
|
|
4819
|
-
// Set the date/time fields, and recompute the UTC offset to account for DST changes.
|
|
4820
|
-
// We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.
|
|
4821
|
-
let plainDateTime = ($11d87f3f76e88657$export$b21e0b124e224484)(dateTime);
|
|
4822
|
-
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
|
|
4823
|
-
// If the resulting plain date time values are equal, return the original time.
|
|
4824
|
-
// We don't want to change the offset when setting the time to the same value.
|
|
4825
|
-
if (res.compare(plainDateTime) === 0) return dateTime;
|
|
4826
|
-
let ms = ($11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone, disambiguation);
|
|
4827
|
-
return ($11d87f3f76e88657$export$b4a036af3fc0b032)(($11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
|
|
4828
|
-
}
|
|
4829
4679
|
|
|
4830
4680
|
const $fae977aafc393c5c$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
|
|
4831
4681
|
function $fae977aafc393c5c$export$6b862160d295c8e(value) {
|
|
@@ -4854,16 +4704,6 @@ function $fae977aafc393c5c$export$4223de14708adc63(date) {
|
|
|
4854
4704
|
// @ts-ignore
|
|
4855
4705
|
return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date)}`;
|
|
4856
4706
|
}
|
|
4857
|
-
function $fae977aafc393c5c$var$offsetToString(offset) {
|
|
4858
|
-
let sign = Math.sign(offset) < 0 ? '-' : '+';
|
|
4859
|
-
offset = Math.abs(offset);
|
|
4860
|
-
let offsetHours = Math.floor(offset / 3600000);
|
|
4861
|
-
let offsetMinutes = offset % 3600000 / 60000;
|
|
4862
|
-
return `${sign}${String(offsetHours).padStart(2, '0')}:${String(offsetMinutes).padStart(2, '0')}`;
|
|
4863
|
-
}
|
|
4864
|
-
function $fae977aafc393c5c$export$bf79f1ebf4b18792(date) {
|
|
4865
|
-
return `${$fae977aafc393c5c$export$4223de14708adc63(date)}${$fae977aafc393c5c$var$offsetToString(date.offset)}[${date.timeZone}]`;
|
|
4866
|
-
}
|
|
4867
4707
|
|
|
4868
4708
|
function _check_private_redeclaration(obj, privateCollection) {
|
|
4869
4709
|
if (privateCollection.has(obj)) {
|
|
@@ -5059,64 +4899,6 @@ class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
|
|
|
5059
4899
|
($735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
|
|
5060
4900
|
}
|
|
5061
4901
|
}
|
|
5062
|
-
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
5063
|
-
// @ts-ignore
|
|
5064
|
-
$35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();
|
|
5065
|
-
class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
|
|
5066
|
-
/** Returns a copy of this date. */ copy() {
|
|
5067
|
-
if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
5068
|
-
else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
5069
|
-
}
|
|
5070
|
-
/** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
|
|
5071
|
-
return ($735220c2d4774dd3$export$96b1d28349274637)(this, duration);
|
|
5072
|
-
}
|
|
5073
|
-
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
|
|
5074
|
-
return ($735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);
|
|
5075
|
-
}
|
|
5076
|
-
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
|
|
5077
|
-
return ($735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);
|
|
5078
|
-
}
|
|
5079
|
-
/**
|
|
5080
|
-
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
5081
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
5082
|
-
*/ cycle(field, amount, options) {
|
|
5083
|
-
return ($735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);
|
|
5084
|
-
}
|
|
5085
|
-
/** Converts the date to a native JavaScript Date object. */ toDate() {
|
|
5086
|
-
return ($11d87f3f76e88657$export$83aac07b4c37b25)(this);
|
|
5087
|
-
}
|
|
5088
|
-
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
|
|
5089
|
-
return ($fae977aafc393c5c$export$bf79f1ebf4b18792)(this);
|
|
5090
|
-
}
|
|
5091
|
-
/** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
|
|
5092
|
-
return this.toDate().toISOString();
|
|
5093
|
-
}
|
|
5094
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
5095
|
-
// TODO: Is this a bad idea??
|
|
5096
|
-
return this.toDate().getTime() - ($11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();
|
|
5097
|
-
}
|
|
5098
|
-
constructor(...args){
|
|
5099
|
-
(_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type3, {
|
|
5100
|
-
writable: true,
|
|
5101
|
-
value: void 0
|
|
5102
|
-
});
|
|
5103
|
-
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
5104
|
-
let timeZone = args.shift();
|
|
5105
|
-
let offset = args.shift();
|
|
5106
|
-
this.calendar = calendar;
|
|
5107
|
-
this.era = era;
|
|
5108
|
-
this.year = year;
|
|
5109
|
-
this.month = month;
|
|
5110
|
-
this.day = day;
|
|
5111
|
-
this.timeZone = timeZone;
|
|
5112
|
-
this.offset = offset;
|
|
5113
|
-
this.hour = args.shift() || 0;
|
|
5114
|
-
this.minute = args.shift() || 0;
|
|
5115
|
-
this.second = args.shift() || 0;
|
|
5116
|
-
this.millisecond = args.shift() || 0;
|
|
5117
|
-
($735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
|
|
5118
|
-
}
|
|
5119
|
-
}
|
|
5120
4902
|
|
|
5121
4903
|
var Switch = function (_a) {
|
|
5122
4904
|
var id = _a.id, props = __rest(_a, ["id"]);
|
|
@@ -6983,7 +6765,7 @@ var DrawerFiltersHeader = function (_a) {
|
|
|
6983
6765
|
return (jsxRuntime.jsxs("div", { className: "px-6 pt-10", children: [jsxRuntime.jsx(H2, { className: "text-xl font-semibold text-foreground mb-2", children: title }), jsxRuntime.jsx(P, { className: "text-default-500", children: description })] }));
|
|
6984
6766
|
};
|
|
6985
6767
|
|
|
6986
|
-
var NO_YEAR_CLASS = "[&_[data-type='year']]:
|
|
6768
|
+
var NO_YEAR_CLASS = "[&_[data-type='year']]:hidden [&_[data-type='literal']:has(+[data-type='year'])]:hidden";
|
|
6987
6769
|
var DayMonthPicker = function (_a) {
|
|
6988
6770
|
var value = _a.value, onChange = _a.onChange, translations = _a.translations;
|
|
6989
6771
|
var t = __assign({ dayMonthAriaLabel: "Seleccionar mes y día", dayMonthRangeAriaLabel: "Seleccionar rango de mes y día", dayMonthSingleOption: "Día específico", dayMonthRangeOption: "Rango de fechas" }, translations);
|
|
@@ -7000,13 +6782,13 @@ var DayMonthPicker = function (_a) {
|
|
|
7000
6782
|
}
|
|
7001
6783
|
onChange({ type: "dayMonthRange", dayMonth: null, dayMonthRange: null });
|
|
7002
6784
|
};
|
|
7003
|
-
var handleSingleChange =
|
|
6785
|
+
var handleSingleChange = function (date) {
|
|
7004
6786
|
onChange({
|
|
7005
6787
|
type: "dayMonth",
|
|
7006
6788
|
dayMonth: date,
|
|
7007
6789
|
dayMonthRange: null,
|
|
7008
6790
|
});
|
|
7009
|
-
}
|
|
6791
|
+
};
|
|
7010
6792
|
var handleRangeChange = function (range) {
|
|
7011
6793
|
onChange({
|
|
7012
6794
|
type: "dayMonthRange",
|
|
@@ -7014,55 +6796,9 @@ var DayMonthPicker = function (_a) {
|
|
|
7014
6796
|
dayMonthRange: range,
|
|
7015
6797
|
});
|
|
7016
6798
|
};
|
|
7017
|
-
var currentYearDate = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
7018
6799
|
var pickerValue = (value === null || value === void 0 ? void 0 : value.type) === "dayMonth" ? value.dayMonth : null;
|
|
7019
6800
|
var rangeValue = (value === null || value === void 0 ? void 0 : value.type) === "dayMonthRange" ? value.dayMonthRange : null;
|
|
7020
|
-
|
|
7021
|
-
// When the user types day+month manually, React Aria auto-moves focus to the sr-only
|
|
7022
|
-
// year segment. We detect this via native focusin (which fires for every segment-to-segment
|
|
7023
|
-
// focus move, unlike React Aria's onFocus). Instead of dispatching synthetic KeyboardEvents
|
|
7024
|
-
// (fragile — depends on React Aria's internal "ready" state), we read aria-valuenow from
|
|
7025
|
-
// the day/month segments after a microtask tick (so React has flushed segment renders) and
|
|
7026
|
-
// call handleSingleChange directly with a CalendarDate using the current year.
|
|
7027
|
-
React.useEffect(function () {
|
|
7028
|
-
var container = containerRef.current;
|
|
7029
|
-
if (!container)
|
|
7030
|
-
return;
|
|
7031
|
-
var handleFocusIn = function (e) {
|
|
7032
|
-
var target = e.target;
|
|
7033
|
-
if ((target === null || target === void 0 ? void 0 : target.getAttribute("data-type")) !== "year")
|
|
7034
|
-
return;
|
|
7035
|
-
if (target.getAttribute("aria-valuenow"))
|
|
7036
|
-
return; // year already set, controlled picker
|
|
7037
|
-
// Defer one tick so React finishes rendering the segment values from the last keydown
|
|
7038
|
-
setTimeout(function () {
|
|
7039
|
-
var dayEl = container.querySelector('[data-type="day"]');
|
|
7040
|
-
var monthEl = container.querySelector('[data-type="month"]');
|
|
7041
|
-
var yearEl = container.querySelector('[data-type="year"]');
|
|
7042
|
-
var dayVal = dayEl === null || dayEl === void 0 ? void 0 : dayEl.getAttribute("aria-valuenow");
|
|
7043
|
-
var monthVal = monthEl === null || monthEl === void 0 ? void 0 : monthEl.getAttribute("aria-valuenow");
|
|
7044
|
-
// If year is now set (user typed it or calendar selection), don't override
|
|
7045
|
-
if (yearEl === null || yearEl === void 0 ? void 0 : yearEl.getAttribute("aria-valuenow"))
|
|
7046
|
-
return;
|
|
7047
|
-
if (!dayVal || !monthVal)
|
|
7048
|
-
return;
|
|
7049
|
-
var day = parseInt(dayVal, 10);
|
|
7050
|
-
var month = parseInt(monthVal, 10);
|
|
7051
|
-
var year = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()).year;
|
|
7052
|
-
if (isNaN(day) || isNaN(month))
|
|
7053
|
-
return;
|
|
7054
|
-
try {
|
|
7055
|
-
handleSingleChange(new $35ea8db9cb2ccb90$export$99faa760c7908e4f(year, month, day));
|
|
7056
|
-
}
|
|
7057
|
-
catch (_a) {
|
|
7058
|
-
// CalendarDate throws for invalid combos (e.g. Feb 30), ignore
|
|
7059
|
-
}
|
|
7060
|
-
}, 0);
|
|
7061
|
-
};
|
|
7062
|
-
container.addEventListener("focusin", handleFocusIn);
|
|
7063
|
-
return function () { return container.removeEventListener("focusin", handleFocusIn); };
|
|
7064
|
-
}, [handleSingleChange]);
|
|
7065
|
-
return (jsxRuntime.jsxs("div", { ref: containerRef, className: "w-full flex flex-wrap xs:gap-5 justify-between items-center", children: [jsxRuntime.jsxs(react.RadioGroup, { color: "primary", orientation: "horizontal", size: "sm", value: mode, onValueChange: handleModeChange, children: [jsxRuntime.jsx(react.Radio, { value: "single", children: t.dayMonthSingleOption }), jsxRuntime.jsx(react.Radio, { value: "range", children: t.dayMonthRangeOption })] }), mode === "single" ? (pickerValue ? (jsxRuntime.jsx(DatePicker, { value: pickerValue, onChange: handleSingleChange, "aria-label": t.dayMonthAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp-c")) : (jsxRuntime.jsx(DatePicker, { placeholderValue: currentYearDate, onChange: handleSingleChange, "aria-label": t.dayMonthAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp-u"))) : (rangeValue ? (jsxRuntime.jsx(DateRangePicker, { value: rangeValue, onChange: handleRangeChange, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr-c")) : (jsxRuntime.jsx(DateRangePicker, { placeholderValue: currentYearDate, onChange: handleRangeChange, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr-u")))] }));
|
|
6801
|
+
return (jsxRuntime.jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center", children: [jsxRuntime.jsxs(react.RadioGroup, { color: "primary", orientation: "horizontal", size: "sm", value: mode, onValueChange: handleModeChange, children: [jsxRuntime.jsx(react.Radio, { value: "single", children: t.dayMonthSingleOption }), jsxRuntime.jsx(react.Radio, { value: "range", children: t.dayMonthRangeOption })] }), mode === "single" ? (jsxRuntime.jsx(DatePicker, { value: pickerValue, onChange: handleSingleChange, "aria-label": t.dayMonthAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp")) : (jsxRuntime.jsx(DateRangePicker, { value: rangeValue, onChange: handleRangeChange, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr"))] }));
|
|
7066
6802
|
};
|
|
7067
6803
|
|
|
7068
6804
|
/**
|
|
@@ -7545,21 +7281,6 @@ var NumberFilter = function (_a) {
|
|
|
7545
7281
|
var DrawerFilters = function (_a) {
|
|
7546
7282
|
var isOpen = _a.isOpen, onOpenChange = _a.onOpenChange, config = _a.config, onApplyFilters = _a.onApplyFilters, onClearFilters = _a.onClearFilters, onCancel = _a.onCancel, className = _a.className, translations = _a.translations, initialValues = _a.initialValues;
|
|
7547
7283
|
var _b = React.useState(initialValues !== null && initialValues !== void 0 ? initialValues : {}), filterValues = _b[0], setFilterValues = _b[1];
|
|
7548
|
-
// Tracks the last confirmed (applied) state. When the drawer reopens we restore this
|
|
7549
|
-
// so the user sees what was last applied — not just the raw initialValues (which the
|
|
7550
|
-
// parent can't easily reconstruct from the processed-string output of onApplyFilters).
|
|
7551
|
-
var confirmedValuesRef = React.useRef(initialValues !== null && initialValues !== void 0 ? initialValues : {});
|
|
7552
|
-
// Sync when the parent changes initialValues externally (e.g., full reset from outside).
|
|
7553
|
-
React.useEffect(function () {
|
|
7554
|
-
confirmedValuesRef.current = initialValues !== null && initialValues !== void 0 ? initialValues : {};
|
|
7555
|
-
setFilterValues(initialValues !== null && initialValues !== void 0 ? initialValues : {});
|
|
7556
|
-
}, [initialValues]);
|
|
7557
|
-
// Restore last confirmed state each time the drawer opens.
|
|
7558
|
-
React.useEffect(function () {
|
|
7559
|
-
if (isOpen) {
|
|
7560
|
-
setFilterValues(confirmedValuesRef.current);
|
|
7561
|
-
}
|
|
7562
|
-
}, [isOpen]);
|
|
7563
7284
|
// Handle changes in individual filters
|
|
7564
7285
|
var handleFilterChange = React.useCallback(function (filterKey, value) {
|
|
7565
7286
|
setFilterValues(function (prev) {
|
|
@@ -7579,16 +7300,14 @@ var DrawerFilters = function (_a) {
|
|
|
7579
7300
|
onOpenChange(false);
|
|
7580
7301
|
}
|
|
7581
7302
|
}, [onOpenChange]);
|
|
7582
|
-
// Cancel and close drawer
|
|
7303
|
+
// Cancel and close drawer
|
|
7583
7304
|
var handleCancel = React.useCallback(function () {
|
|
7584
|
-
setFilterValues(confirmedValuesRef.current);
|
|
7585
7305
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
7586
7306
|
onOpenChange(false);
|
|
7587
7307
|
}, [onCancel, onOpenChange]);
|
|
7588
7308
|
// Apply filters and process values
|
|
7589
7309
|
var handleApplyFilters = React.useCallback(function () {
|
|
7590
7310
|
var _a, _b;
|
|
7591
|
-
confirmedValuesRef.current = filterValues;
|
|
7592
7311
|
var processedFilters = {};
|
|
7593
7312
|
var _loop_1 = function (key, value) {
|
|
7594
7313
|
if (value === undefined || value === null) {
|