@rededor/cura-hydrate 2.0.0-alpha.22 → 2.0.0-alpha.23
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/index.js +10 -3
- package/index.mjs +10 -3
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -14218,6 +14218,12 @@ class CuraCalendar {
|
|
|
14218
14218
|
'--color-neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`)
|
|
14219
14219
|
};
|
|
14220
14220
|
}
|
|
14221
|
+
scheduleTestId(suffix) {
|
|
14222
|
+
const testId = this.host.getAttribute('data-testid');
|
|
14223
|
+
if (!testId)
|
|
14224
|
+
return undefined;
|
|
14225
|
+
return `${testId}${suffix}`;
|
|
14226
|
+
}
|
|
14221
14227
|
sendEventChangeDateInView(isCollapsed, currentDate) {
|
|
14222
14228
|
const eventData = {
|
|
14223
14229
|
datesInView: isCollapsed ? this.fetchDaysOfWeek(currentDate) : this.fetchDaysOfMonth(currentDate),
|
|
@@ -14246,10 +14252,11 @@ class CuraCalendar {
|
|
|
14246
14252
|
}
|
|
14247
14253
|
render() {
|
|
14248
14254
|
const { months } = this.fetchMonthNames();
|
|
14249
|
-
return (hAsync(Host, { key: '
|
|
14250
|
-
? this.fetchDaysOfMonth().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
14251
|
-
: this.fetchDaysOfWeek().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { disabled: this.isDisabled, onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null, this.isLoading && (hAsync("div", { key: '
|
|
14255
|
+
return (hAsync(Host, { key: '5c83dd32692ace825079aa71d18093c6b9edae5b', style: this.getHostCSSProperties() }, hAsync("div", { key: '3ec182542dfecedd1cfbf0436e2d9ba3f36ace49', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''} ${this.getDisabledClassModifier()}`, style: this.styles }, hAsync("header", { key: '6df7a501370f6d6f79bdcc7bf0e443a26718fdd8', class: "header" }, hAsync("div", { key: 'ca722312da6bd97672096d979d874debf6e4b431', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, hAsync("cura-icon", { key: '08d5960fed8bdca401e4f34bbb7efa967ad6418d', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", disabled: this.isDisabled, color: this.determinePrevButtonColor(), "data-testid": this.scheduleTestId('-prev-button'), onClick: this.handlePrevMonth }), this.type === 'dropdown' ? (hAsync("div", { class: "select" }, hAsync("cura-select", { disabled: this.isDisabled, size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (hAsync("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), hAsync("cura-select", { disabled: this.isDisabled, size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (hAsync("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (hAsync("cura-label", { color: !this.isDisabled ? 'neutral-black' : 'neutral-dark', size: "small" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), hAsync("cura-icon", { key: 'fbc01dcb8fd07f7cb38275bf4fe57a5fd2dbffd2', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", disabled: this.isDisabled, color: "primary-base", "data-testid": this.scheduleTestId('-next-button'), onClick: this.handleNextMonth }))), hAsync("span", { key: '66074f44b487cf588f1d85740c0dea5eaf7adcf3', class: "days-of-week" }, this.fetchWeekDays().map(this.renderItemWeekDays)), hAsync("div", { key: 'd92d9a0304878ea8cc2365229a507d8fa6c07bf8', class: "dates" }, !this.collapsed
|
|
14256
|
+
? this.fetchDaysOfMonth().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), "data-testid": day ? this.scheduleTestId(`-day-${format(day, 'yyyy-MM-dd')}`) : undefined, onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
14257
|
+
: this.fetchDaysOfWeek().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), "data-testid": day ? this.scheduleTestId(`-day-${format(day, 'yyyy-MM-dd')}`) : undefined, onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { disabled: this.isDisabled, onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle", "data-testid": this.scheduleTestId('-expand-button') }, "Veja mais datas"))) : (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null, this.isLoading && (hAsync("div", { key: '3b77f34b607c023db960b2ec0910caa7dcd8cea7', class: "loading-container" }, hAsync("cura-loader-circle", { key: '0085a53a5ca40cfafb78078b1cbb49a37fac1535', color: "primary", size: "large" }), hAsync("slot", { key: '5752006357f1799d2bf04c86add8a4abdb413c50', name: "loadingMessage" }))))));
|
|
14252
14258
|
}
|
|
14259
|
+
get host() { return getElement(this); }
|
|
14253
14260
|
static get watchers() { return {
|
|
14254
14261
|
"defaultDate": [{
|
|
14255
14262
|
"initializeDefaultDates": 0
|
package/index.mjs
CHANGED
|
@@ -14216,6 +14216,12 @@ class CuraCalendar {
|
|
|
14216
14216
|
'--color-neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`)
|
|
14217
14217
|
};
|
|
14218
14218
|
}
|
|
14219
|
+
scheduleTestId(suffix) {
|
|
14220
|
+
const testId = this.host.getAttribute('data-testid');
|
|
14221
|
+
if (!testId)
|
|
14222
|
+
return undefined;
|
|
14223
|
+
return `${testId}${suffix}`;
|
|
14224
|
+
}
|
|
14219
14225
|
sendEventChangeDateInView(isCollapsed, currentDate) {
|
|
14220
14226
|
const eventData = {
|
|
14221
14227
|
datesInView: isCollapsed ? this.fetchDaysOfWeek(currentDate) : this.fetchDaysOfMonth(currentDate),
|
|
@@ -14244,10 +14250,11 @@ class CuraCalendar {
|
|
|
14244
14250
|
}
|
|
14245
14251
|
render() {
|
|
14246
14252
|
const { months } = this.fetchMonthNames();
|
|
14247
|
-
return (hAsync(Host, { key: '
|
|
14248
|
-
? this.fetchDaysOfMonth().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
14249
|
-
: this.fetchDaysOfWeek().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { disabled: this.isDisabled, onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null, this.isLoading && (hAsync("div", { key: '
|
|
14253
|
+
return (hAsync(Host, { key: '5c83dd32692ace825079aa71d18093c6b9edae5b', style: this.getHostCSSProperties() }, hAsync("div", { key: '3ec182542dfecedd1cfbf0436e2d9ba3f36ace49', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''} ${this.getDisabledClassModifier()}`, style: this.styles }, hAsync("header", { key: '6df7a501370f6d6f79bdcc7bf0e443a26718fdd8', class: "header" }, hAsync("div", { key: 'ca722312da6bd97672096d979d874debf6e4b431', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, hAsync("cura-icon", { key: '08d5960fed8bdca401e4f34bbb7efa967ad6418d', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", disabled: this.isDisabled, color: this.determinePrevButtonColor(), "data-testid": this.scheduleTestId('-prev-button'), onClick: this.handlePrevMonth }), this.type === 'dropdown' ? (hAsync("div", { class: "select" }, hAsync("cura-select", { disabled: this.isDisabled, size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (hAsync("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), hAsync("cura-select", { disabled: this.isDisabled, size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (hAsync("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (hAsync("cura-label", { color: !this.isDisabled ? 'neutral-black' : 'neutral-dark', size: "small" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), hAsync("cura-icon", { key: 'fbc01dcb8fd07f7cb38275bf4fe57a5fd2dbffd2', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", disabled: this.isDisabled, color: "primary-base", "data-testid": this.scheduleTestId('-next-button'), onClick: this.handleNextMonth }))), hAsync("span", { key: '66074f44b487cf588f1d85740c0dea5eaf7adcf3', class: "days-of-week" }, this.fetchWeekDays().map(this.renderItemWeekDays)), hAsync("div", { key: 'd92d9a0304878ea8cc2365229a507d8fa6c07bf8', class: "dates" }, !this.collapsed
|
|
14254
|
+
? this.fetchDaysOfMonth().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), "data-testid": day ? this.scheduleTestId(`-day-${format(day, 'yyyy-MM-dd')}`) : undefined, onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
14255
|
+
: this.fetchDaysOfWeek().map((day, index) => (hAsync("div", { key: index, class: this.getClasses(day), "data-testid": day ? this.scheduleTestId(`-day-${format(day, 'yyyy-MM-dd')}`) : undefined, onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { disabled: this.isDisabled, onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle", "data-testid": this.scheduleTestId('-expand-button') }, "Veja mais datas"))) : (hAsync("div", { class: "collapsed-container" }, hAsync("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null, this.isLoading && (hAsync("div", { key: '3b77f34b607c023db960b2ec0910caa7dcd8cea7', class: "loading-container" }, hAsync("cura-loader-circle", { key: '0085a53a5ca40cfafb78078b1cbb49a37fac1535', color: "primary", size: "large" }), hAsync("slot", { key: '5752006357f1799d2bf04c86add8a4abdb413c50', name: "loadingMessage" }))))));
|
|
14250
14256
|
}
|
|
14257
|
+
get host() { return getElement(this); }
|
|
14251
14258
|
static get watchers() { return {
|
|
14252
14259
|
"defaultDate": [{
|
|
14253
14260
|
"initializeDefaultDates": 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rededor/cura-hydrate",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.23",
|
|
4
4
|
"description": "cura component hydration app.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
"import": "./index.mjs"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
}
|
|
13
|
+
}
|