@rededor/cura 1.6.0-alpha.1 → 1.6.0-alpha.2
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/cjs/cura-accordion_18.cjs.entry.js +1 -1
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +6 -5
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.js +7 -6
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.css +26 -31
- package/dist/components/cura-calendar2.js +8 -7
- package/dist/components/cura-calendar2.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/{p-56ca01a1.entry.js → p-506747fb.entry.js} +2 -2
- package/dist/cura/{p-56ca01a1.entry.js.map → p-506747fb.entry.js.map} +1 -1
- package/dist/cura/p-823d0bb5.entry.js +2 -0
- package/dist/cura/p-823d0bb5.entry.js.map +1 -0
- package/dist/esm/cura-accordion_18.entry.js +1 -1
- package/dist/esm/cura-accordion_18.entry.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +6 -5
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +7 -7
- package/package.json +2 -2
- package/dist/cura/p-efce98a2.entry.js +0 -2
- package/dist/cura/p-efce98a2.entry.js.map +0 -1
|
@@ -3451,7 +3451,7 @@ var locale = {
|
|
|
3451
3451
|
};
|
|
3452
3452
|
const ptBR = locale;
|
|
3453
3453
|
|
|
3454
|
-
const curaCalendarCss = ":host{display:block;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);margin:0 auto}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);border-radius:4px;overflow:hidden;background:#fff;font-family:var(--font-family)}:host .calendar.embedded{border:2px solid var(--neutral-light);padding:0px 12px 12px 12px}:host .calendar.floating{box-shadow:0 4px 8px var(--neutral-light)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:7px 10px 0px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--primary-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .collapsed-container{text-align:center;position:relative;display:flex;align-items:center;justify-content:center;padding-top:10px}:host .collapsed-container::before{content:\"\";position:absolute;bottom:0;top:0;left:2px;right:2px;border-top:2px dotted var(--neutral-light)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected{color:var(--select-label) !important;background:var(--primary-base);border-radius:50%}:host .date.default-dates{color:var(--
|
|
3454
|
+
const curaCalendarCss = ":host{display:block;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);margin:0 auto}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);border-radius:4px;overflow:hidden;background:#fff;font-family:var(--font-family)}:host .calendar.embedded{border:2px solid var(--neutral-light);padding:0px 12px 12px 12px}:host .calendar.floating{box-shadow:0 4px 8px var(--neutral-light)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:7px 10px 0px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--primary-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .collapsed-container{text-align:center;position:relative;display:flex;align-items:center;justify-content:center;padding-top:10px}:host .collapsed-container::before{content:\"\";position:absolute;bottom:0;top:0;left:2px;right:2px;border-top:2px dotted var(--neutral-light)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected{color:var(--select-label) !important;background:var(--primary-base);border-radius:50%}:host .date.default-dates{color:var(--select-label) !important;background:var(--primary-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--select-label) !important;background:var(--primary-base)}:host .date.range.interval{border-radius:0;background:var(--primary-lighter);color:var(--neutral-black) !important}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--select-label) !important;background:var(--primary-base)}:host .date:hover{background:var(--primary-lighter);border-radius:50%;color:var(--neutral-white)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}";
|
|
3455
3455
|
const CuraCalendarStyle0 = curaCalendarCss;
|
|
3456
3456
|
|
|
3457
3457
|
const CuraCalendar = class {
|
|
@@ -3480,10 +3480,10 @@ const CuraCalendar = class {
|
|
|
3480
3480
|
this.floating = undefined;
|
|
3481
3481
|
this.embedded = undefined;
|
|
3482
3482
|
this.selectLabelColorMode = 'light';
|
|
3483
|
-
this.currentDate = new Date();
|
|
3484
3483
|
this.selectedDates = [];
|
|
3485
3484
|
this.rangeStart = null;
|
|
3486
3485
|
this.defaultDates = [];
|
|
3486
|
+
this.currentDate = new Date();
|
|
3487
3487
|
this.selectMonth = '';
|
|
3488
3488
|
this.selectYear = '';
|
|
3489
3489
|
this.styles = {};
|
|
@@ -3526,6 +3526,7 @@ const CuraCalendar = class {
|
|
|
3526
3526
|
}
|
|
3527
3527
|
}
|
|
3528
3528
|
this.defaultDates = this.expandDateRanges(this.defaultDate);
|
|
3529
|
+
this.currentDate = this.defaultDates[0] ? this.defaultDates[0] : this.currentDate;
|
|
3529
3530
|
}
|
|
3530
3531
|
/**
|
|
3531
3532
|
* Get the locale for the calendar.
|
|
@@ -3619,7 +3620,7 @@ const CuraCalendar = class {
|
|
|
3619
3620
|
* @param {string} direction - 'prev' | 'next'
|
|
3620
3621
|
*/
|
|
3621
3622
|
updateCurrentMonth(direction) {
|
|
3622
|
-
let newMonth =
|
|
3623
|
+
let newMonth = this.currentDate;
|
|
3623
3624
|
if (direction === 'prev')
|
|
3624
3625
|
newMonth = subMonths(this.currentDate, 1);
|
|
3625
3626
|
if (direction === 'next')
|
|
@@ -3757,7 +3758,7 @@ const CuraCalendar = class {
|
|
|
3757
3758
|
return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
|
|
3758
3759
|
}
|
|
3759
3760
|
updateCurrentWeek(direction) {
|
|
3760
|
-
let newWeek =
|
|
3761
|
+
let newWeek = this.currentDate;
|
|
3761
3762
|
if (direction === 'prev')
|
|
3762
3763
|
newWeek = subWeeks(this.currentDate, 1);
|
|
3763
3764
|
if (direction === 'next')
|
|
@@ -3910,7 +3911,7 @@ const CuraCalendar = class {
|
|
|
3910
3911
|
}
|
|
3911
3912
|
render() {
|
|
3912
3913
|
const { months } = this.fetchMonthNames();
|
|
3913
|
-
return (index$1.h(index$1.Host, { key: '
|
|
3914
|
+
return (index$1.h(index$1.Host, { key: 'a27b858fff12fe2d19898dbb0be8080a0175c465', style: this.getHostCSSProperties() }, index$1.h("div", { key: 'e2fe9991e3ef03d11b0e58b412d31020ead1b344', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''}`, style: this.styles }, index$1.h("header", { key: '8bf8a4f703043d907d8bc81ed22061380cd67ade', class: "header" }, index$1.h("div", { key: '66c2b27693f188929065972828c2ce4a672f1e74', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, index$1.h("cura-icon", { key: '0e6841eb77061f404e23fbfc28be40600255767a', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (index$1.h("div", { class: "select" }, index$1.h("cura-select", { size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (index$1.h("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), index$1.h("cura-select", { size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (index$1.h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (index$1.h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), index$1.h("cura-icon", { key: 'cdc62d8666dc7b890daadf63d2ffe0d0000ec545', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), index$1.h("span", { key: 'fa0d8c6ff291f343da594799b3ba366d3e020e74', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (index$1.h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: "bold", key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), index$1.h("div", { key: 'dc072663767251cc694d51612cacd94f1fe31a84', class: "dates" }, !this.collapsed
|
|
3914
3915
|
? this.fetchDaysOfMonth().map((day, index) => (index$1.h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
3915
3916
|
: this.fetchDaysOfWeek().map((day, index) => (index$1.h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (index$1.h("div", { class: "collapsed-container" }, index$1.h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (index$1.h("div", { class: "collapsed-container" }, index$1.h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null)));
|
|
3916
3917
|
}
|