blip-ds 1.136.0 → 1.136.1
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/blip-ds/bds-datepicker-period.entry.js +15 -5
- package/dist/blip-ds/bds-datepicker-period.system.entry.js +1 -1
- package/dist/blip-ds/bds-datepicker-single.entry.js +16 -6
- package/dist/blip-ds/bds-datepicker-single.system.entry.js +1 -1
- package/dist/blip-ds/bds-datepicker.entry.js +7 -5
- package/dist/blip-ds/bds-datepicker.system.entry.js +1 -1
- package/dist/blip-ds/blip-ds.esm.js +1 -1
- package/dist/blip-ds/blip-ds.system.js +1 -1
- package/dist/blip-ds/{p-45457ad8.system.entry.js → p-22db0aa2.system.entry.js} +1 -1
- package/dist/blip-ds/p-25817016.system.js +1 -1
- package/dist/blip-ds/p-5be4a08b.entry.js +1 -0
- package/dist/blip-ds/p-862d0619.entry.js +1 -0
- package/dist/blip-ds/p-a5d3995d.system.entry.js +1 -0
- package/dist/cjs/bds-datepicker-period.cjs.entry.js +14 -4
- package/dist/cjs/bds-datepicker-period_2.cjs.entry.js +29 -9
- package/dist/cjs/bds-datepicker-single.cjs.entry.js +15 -5
- package/dist/cjs/bds-datepicker.cjs.entry.js +7 -5
- package/dist/cjs/blip-ds.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/datepicker/datepicker-period/datepicker-period.js +18 -4
- package/dist/collection/components/datepicker/datepicker-single/datepicker-single.js +19 -5
- package/dist/collection/components/datepicker/datepicker.js +7 -7
- package/dist/esm/bds-datepicker-period.entry.js +15 -5
- package/dist/esm/bds-datepicker-period_2.entry.js +30 -10
- package/dist/esm/bds-datepicker-single.entry.js +16 -6
- package/dist/esm/bds-datepicker.entry.js +7 -5
- package/dist/esm/blip-ds.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/bds-datepicker-period_2.entry.js +1 -1
- package/dist/esm-es5/bds-datepicker.entry.js +1 -1
- package/dist/esm-es5/blip-ds.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/components/datepicker/datepicker-period/datepicker-period.d.ts +3 -2
- package/dist/types/components/datepicker/datepicker-single/datepicker-single.d.ts +2 -1
- package/dist/types/components/datepicker/datepicker.d.ts +2 -2
- package/package.json +1 -1
- package/dist/blip-ds/p-215fff60.entry.js +0 -1
- package/dist/blip-ds/p-3c130655.system.entry.js +0 -1
- package/dist/blip-ds/p-cae011f0.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -30,7 +30,7 @@ const defineCustomElements = (win, options) => {
|
|
|
30
30
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
31
31
|
return patchEsm().then(() => {
|
|
32
32
|
appGlobals.globalScripts();
|
|
33
|
-
return index.bootstrapLazy([["bds-typo.cjs",[[1,"bds-typo",{"variant":[1],"lineHeight":[1,"line-height"],"bold":[1],"italic":[4],"noWrap":[4,"no-wrap"],"paragraph":[4],"margin":[4],"tag":[1]}]]],["bds-datepicker.cjs",[[0,"bds-datepicker",{"typeOfDate":[1,"type-of-date"],"startDateLimit":[1537,"start-date-limit"],"endDateLimit":[1537,"end-date-limit"],"message":[1],"endDateLimitDaysList":[32],"open":[32],"dateSelected":[32],"endDateSelected":[32],"valueDateSelected":[32],"valueEndDateSelected":[32],"
|
|
33
|
+
return index.bootstrapLazy([["bds-typo.cjs",[[1,"bds-typo",{"variant":[1],"lineHeight":[1,"line-height"],"bold":[1],"italic":[4],"noWrap":[4,"no-wrap"],"paragraph":[4],"margin":[4],"tag":[1]}]]],["bds-datepicker.cjs",[[0,"bds-datepicker",{"typeOfDate":[1,"type-of-date"],"startDateLimit":[1537,"start-date-limit"],"endDateLimit":[1537,"end-date-limit"],"message":[1],"endDateLimitDaysList":[32],"open":[32],"dateSelected":[32],"endDateSelected":[32],"valueDateSelected":[32],"valueEndDateSelected":[32],"errorMsgDate":[32],"errorMsgEndDate":[32]}]]],["bds-select-chips.cjs",[[6,"bds-select-chips",{"options":[1025],"chips":[1025],"newPrefix":[513,"new-prefix"],"value":[1025],"danger":[1540],"maxlength":[2],"errorMessage":[1025,"error-message"],"disabled":[516],"label":[1],"icon":[513],"duplicated":[4],"canAddNew":[4,"can-add-new"],"notFoundMessage":[1,"not-found-message"],"internalOptions":[32],"isOpen":[32],"isValid":[64],"getChips":[64]},[[9,"mousedown","handleWindow"]]]]],["bds-toast.cjs",[[1,"bds-toast",{"icon":[513],"actionType":[1,"action-type"],"variant":[1],"toastTitle":[1,"toast-title"],"toastText":[1,"toast-text"],"buttonText":[1,"button-text"],"duration":[2],"buttonAction":[1,"button-action"],"show":[4],"hide":[4],"position":[1],"create":[64],"close":[64]}]]],["bds-autocomplete.cjs",[[1,"bds-autocomplete",{"options":[1],"value":[1025],"selected":[1040],"danger":[516],"disabled":[516],"searchOnlyTitle":[516,"search-only-title"],"label":[1],"icon":[513],"placeholder":[1],"optionsPosition":[1,"options-position"],"clearIconOnFocus":[4,"clear-icon-on-focus"],"isOpen":[32],"text":[32],"internalOptions":[32],"isFocused":[32]},[[9,"mousedown","handleWindow"]]]]],["bds-input-phone-number.cjs",[[2,"bds-input-phone-number",{"options":[16],"text":[1],"value":[1032],"danger":[516],"disabled":[516],"required":[4],"requiredErrorMessage":[1,"required-error-message"],"numberErrorMessage":[1,"number-error-message"],"label":[1],"icon":[513],"isOpen":[32],"selectedCountry":[32],"isPressed":[32]},[[9,"mousedown","handleWindow"]]]]],["bds-select.cjs",[[1,"bds-select",{"options":[1],"value":[1032],"danger":[516],"disabled":[516],"label":[1],"icon":[513],"placeholder":[1],"optionsPosition":[1,"options-position"],"isOpen":[32],"text":[32],"internalOptions":[32]},[[9,"mousedown","handleWindow"]]]]],["bds-input-editable.cjs",[[1,"bds-input-editable",{"size":[1],"expand":[4],"inputName":[1,"input-name"],"value":[1537],"requiredErrorMessage":[1,"required-error-message"],"minlength":[2],"minlengthErrorMessage":[1,"minlength-error-message"],"maxlength":[2],"errorMessage":[1,"error-message"],"helperMessage":[1,"helper-message"],"danger":[1540],"isEditing":[32],"isValid":[32]}]]],["bds-input-password.cjs",[[2,"bds-input-password",{"openEyes":[4,"open-eyes"],"value":[1537],"label":[1],"inputName":[1,"input-name"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"readonly":[4],"helperMessage":[1,"helper-message"],"errorMessage":[1,"error-message"],"danger":[516],"icon":[513],"disabled":[4],"autoCapitalize":[1,"auto-capitalize"],"autoComplete":[1,"auto-complete"],"placeholder":[1]}]]],["bds-avatar-group.cjs",[[4,"bds-avatar-group",{"size":[1],"users":[1],"internalUsers":[32],"leftoversUsers":[32]}]]],["bds-menu-exibition.cjs",[[1,"bds-menu-exibition",{"avatarName":[1,"avatar-name"],"avatarThumbnail":[1,"avatar-thumbnail"],"avatarSize":[1,"avatar-size"],"value":[1],"subtitle":[1]}]]],["bds-alert-header.cjs",[[1,"bds-alert-header",{"variant":[1],"icon":[513]}]]],["bds-banner.cjs",[[1,"bds-banner",{"bannerAlign":[1,"banner-align"],"buttonClose":[1,"button-close"],"context":[1],"variant":[1],"visible":[32],"toggle":[64]}]]],["bds-checkbox.cjs",[[1,"bds-checkbox",{"refer":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[4],"checkBoxId":[32],"getInputElement":[64],"getValue":[64]}]]],["bds-menu-action.cjs",[[1,"bds-menu-action",{"buttonText":[1,"button-text"],"subMenu":[4,"sub-menu"],"iconLeft":[1,"icon-left"],"lipstick":[4],"openSubMenu":[32],"stateSubMenu":[32],"delaySubMenu":[32],"zIndex":[32],"delay":[32]}]]],["bds-menu-list-item.cjs",[[1,"bds-menu-list-item",{"color":[1],"icon":[513]}]]],["bds-step.cjs",[[1,"bds-step",{"last":[4],"completed":[4],"active":[4],"disabled":[4],"index":[2],"pointer":[4]}]]],["bds-tabs.cjs",[[4,"bds-tabs",{"align":[1]},[[0,"scrollButtonClick","onScrollButtonClick"],[0,"bdsSelect","onSelectedTab"]]]]],["bds-warning.cjs",[[1,"bds-warning"]]],["bds-alert-body.cjs",[[1,"bds-alert-body"]]],["bds-card-color.cjs",[[1,"bds-card-color",{"name":[1],"hex":[1],"gradient":[4],"variable":[1],"lightText":[4,"light-text"]}]]],["bds-expansion-panel-header.cjs",[[1,"bds-expansion-panel-header",{"text":[1]}]]],["bds-menu-separation.cjs",[[1,"bds-menu-separation",{"value":[1],"size":[1]}]]],["bds-modal.cjs",[[1,"bds-modal",{"open":[1540],"closeButton":[1540,"close-button"],"toggle":[64]}]]],["bds-modal-close-button.cjs",[[1,"bds-modal-close-button",{"active":[1540]}]]],["bds-radio.cjs",[[1,"bds-radio",{"refer":[1],"label":[1],"value":[1],"name":[1],"checked":[1540],"disabled":[4],"radioId":[32],"getInputElement":[64],"getValue":[64]}]]],["bds-tab.cjs",[[0,"bds-tab",{"group":[1],"label":[1],"active":[4],"getChild":[64]}]]],["bds-tab-panel.cjs",[[4,"bds-tab-panel",{"group":[1],"active":[4],"getChild":[64]}]]],["bds-tooltip.cjs",[[1,"bds-tooltip",{"tooltipText":[1,"tooltip-text"],"disabled":[516],"position":[1],"isMouseOver":[32]}]]],["bds-alert.cjs",[[1,"bds-alert",{"open":[1540],"toggle":[64]}]]],["bds-alert-actions.cjs",[[1,"bds-alert-actions"]]],["bds-banner-link.cjs",[[1,"bds-banner-link"]]],["bds-expansion-panel.cjs",[[1,"bds-expansion-panel"]]],["bds-expansion-panel-body.cjs",[[1,"bds-expansion-panel-body",{"open":[4],"text":[1]}]]],["bds-menu.cjs",[[1,"bds-menu",{"menu":[1],"position":[1],"open":[1540],"menuPositionTopToBottom":[32],"menuPositionLeftToBottom":[32],"menuPositionTopToRight":[32],"menuPositionLeftToRight":[32],"toggle":[64]}]]],["bds-menu-list.cjs",[[1,"bds-menu-list"]]],["bds-modal-action.cjs",[[1,"bds-modal-action"]]],["bds-paper.cjs",[[1,"bds-paper",{"elevation":[1]}]]],["bds-radio-group.cjs",[[6,"bds-radio-group",{"value":[1]}]]],["bds-stepper.cjs",[[4,"bds-stepper",{"setActiveStep":[64],"setCompletedStep":[64],"getActiveStep":[64],"resetActiveSteps":[64],"resetCompletedSteps":[64]}]]],["bds-switch.cjs",[[1,"bds-switch",{"refer":[1],"size":[1],"name":[1],"checked":[1540],"disabled":[4],"switchId":[32],"getInputElement":[64],"getValue":[64]}]]],["bds-input-chips.cjs",[[6,"bds-input-chips",{"chips":[1025],"type":[1],"label":[1],"maxlength":[2],"icon":[513],"delimiters":[16],"errorMessage":[1025,"error-message"],"danger":[1540],"value":[1537],"duplicated":[4],"disableSubmit":[4,"disable-submit"],"disabled":[516],"internalChips":[32],"isValid":[64],"get":[64],"clear":[64],"add":[64],"setFocus":[64],"removeFocus":[64]}]]],["bds-datepicker-period.cjs",[[1,"bds-datepicker-period",{"startDate":[16],"endDate":[16],"startDateSelect":[1040],"endDateSelect":[1040],"week":[32],"months":[32],"years":[32],"monthActivated":[32],"yearActivated":[32],"animatePrev":[32],"animateNext":[32],"activeSelectYear":[32],"openSelectMonth":[32],"openSelectYear":[32],"monthsSlide":[32],"clear":[64]}]]],["bds-datepicker-single.cjs",[[1,"bds-datepicker-single",{"endDate":[16],"startDate":[16],"dateSelect":[1040],"week":[32],"months":[32],"years":[32],"monthActivated":[32],"yearActivated":[32],"animatePrev":[32],"animateNext":[32],"openSelectMonth":[32],"openSelectYear":[32],"monthsSlide":[32],"clear":[64]}]]],["bds-toast-container.cjs",[[6,"bds-toast-container"]]],["bds-icon.cjs",[[1,"bds-icon",{"color":[1],"ariaLabel":[1537,"aria-label"],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"theme":[513],"type":[1],"svgContent":[32],"isVisible":[32]}]]],["bds-button.cjs",[[1,"bds-button",{"disabled":[4],"size":[1],"variant":[1],"icon":[513],"arrow":[4],"type":[1],"typeIcon":[513,"type-icon"],"bdsLoading":[4,"bds-loading"],"bdsLoadingVariant":[1,"bds-loading-variant"]}]]],["bds-avatar.cjs",[[0,"bds-avatar",{"name":[1],"thumbnail":[1],"size":[1],"upload":[4],"ellipsis":[2]}]]],["bds-chip.cjs",[[1,"bds-chip",{"icon":[1],"size":[1],"variant":[1],"danger":[516],"filter":[4],"clickable":[4],"deletable":[4],"disabled":[4]}]]],["bds-button-icon.cjs",[[1,"bds-button-icon",{"disabled":[4],"size":[1],"variant":[1],"icon":[513]}]]],["bds-loading-spinner.cjs",[[0,"bds-loading-spinner",{"variant":[1]}]]],["bds-select-option.cjs",[[6,"bds-select-option",{"value":[8],"selected":[4],"disabled":[4],"invisible":[1540],"danger":[1540],"bulkOption":[1,"bulk-option"],"slotAlign":[1,"slot-align"],"titleText":[1,"title-text"],"status":[1]}]]],["bds-counter-text.cjs",[[0,"bds-counter-text",{"length":[1026],"max":[2],"active":[1028],"warning":[1040],"delete":[1040]}]]],["bds-input.cjs",[[1,"bds-input",{"inputName":[1,"input-name"],"type":[513],"label":[1],"placeholder":[1],"autoCapitalize":[1,"auto-capitalize"],"autoComplete":[1,"auto-complete"],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"readonly":[4],"required":[4],"pattern":[1],"helperMessage":[1,"helper-message"],"errorMessage":[1025,"error-message"],"icon":[513],"disabled":[1540],"danger":[1540],"value":[1025],"counterLength":[4,"counter-length"],"counterLengthRule":[16],"isSubmit":[4,"is-submit"],"isTextarea":[4,"is-textarea"],"rows":[2],"cols":[2],"requiredErrorMessage":[1,"required-error-message"],"minlengthErrorMessage":[1,"minlength-error-message"],"minErrorMessage":[1,"min-error-message"],"maxErrorMessage":[1,"max-error-message"],"emailErrorMessage":[1,"email-error-message"],"numberErrorMessage":[1,"number-error-message"],"chips":[4],"dataCypress":[1,"data-cypress"],"isPressed":[32],"isPassword":[32],"validationMesage":[32],"validationDanger":[32],"setFocus":[64],"removeFocus":[64],"getInputElement":[64],"isValid":[64],"clear":[64]}]]]], options);
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -58,13 +58,13 @@ export class BdsdatepickerPeriod {
|
|
|
58
58
|
this.startDateSelect = null;
|
|
59
59
|
this.endDateSelect = null;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
startDateSelectChanged() {
|
|
62
62
|
var _a;
|
|
63
63
|
this.bdsStartDate.emit({ value: this.startDateSelect });
|
|
64
64
|
this.monthActivated = this.startDateSelect ? (_a = this.startDateSelect) === null || _a === void 0 ? void 0 : _a.getMonth() : this.startDate.month;
|
|
65
65
|
this.yearActivated = this.startDateSelect ? this.startDateSelect.getFullYear() : this.startDate.year;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
endDateSelectChanged() {
|
|
68
68
|
this.bdsEndDate.emit({ value: this.endDateSelect });
|
|
69
69
|
this.monthActivated = this.endDateSelect
|
|
70
70
|
? this.startDateSelect.getMonth() == this.endDateSelect.getMonth() &&
|
|
@@ -78,6 +78,14 @@ export class BdsdatepickerPeriod {
|
|
|
78
78
|
this.yearActivated = this.yearActivated - 1;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
periodToSelectChanged(newValue, _oldValue) {
|
|
82
|
+
const oldDate = fillDayList(_oldValue);
|
|
83
|
+
const newDate = fillDayList(newValue);
|
|
84
|
+
if (newDate != oldDate) {
|
|
85
|
+
this.monthActivated = this.startDate.month;
|
|
86
|
+
this.yearActivated = this.startDate.year;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
81
89
|
componentWillLoad() {
|
|
82
90
|
if (this.startDate) {
|
|
83
91
|
this.monthActivated = this.startDate.month;
|
|
@@ -421,9 +429,15 @@ export class BdsdatepickerPeriod {
|
|
|
421
429
|
}; }
|
|
422
430
|
static get watchers() { return [{
|
|
423
431
|
"propName": "startDateSelect",
|
|
424
|
-
"methodName": "
|
|
432
|
+
"methodName": "startDateSelectChanged"
|
|
425
433
|
}, {
|
|
426
434
|
"propName": "endDateSelect",
|
|
427
|
-
"methodName": "
|
|
435
|
+
"methodName": "endDateSelectChanged"
|
|
436
|
+
}, {
|
|
437
|
+
"propName": "endDate",
|
|
438
|
+
"methodName": "periodToSelectChanged"
|
|
439
|
+
}, {
|
|
440
|
+
"propName": "startDate",
|
|
441
|
+
"methodName": "periodToSelectChanged"
|
|
428
442
|
}]; }
|
|
429
443
|
}
|
|
@@ -52,12 +52,19 @@ export class BdsdatepickerSingle {
|
|
|
52
52
|
async clear() {
|
|
53
53
|
this.dateSelect = null;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
dateSelectChanged() {
|
|
56
56
|
var _a;
|
|
57
|
-
this.bdsDateSelected.emit({ value: this.dateSelect });
|
|
58
57
|
this.monthActivated = this.dateSelect ? (_a = this.dateSelect) === null || _a === void 0 ? void 0 : _a.getMonth() : this.startDate.month;
|
|
59
58
|
this.yearActivated = this.dateSelect ? this.dateSelect.getFullYear() : this.startDate.year;
|
|
60
59
|
}
|
|
60
|
+
periodToSelectChanged(newValue, _oldValue) {
|
|
61
|
+
const oldDate = fillDayList(_oldValue);
|
|
62
|
+
const newDate = fillDayList(newValue);
|
|
63
|
+
if (newDate != oldDate) {
|
|
64
|
+
this.monthActivated = this.startDate.month;
|
|
65
|
+
this.yearActivated = this.startDate.year;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
61
68
|
componentWillLoad() {
|
|
62
69
|
if (this.startDate) {
|
|
63
70
|
this.monthActivated = this.startDate.month;
|
|
@@ -79,7 +86,7 @@ export class BdsdatepickerSingle {
|
|
|
79
86
|
}
|
|
80
87
|
selectDate(value) {
|
|
81
88
|
const changeSelected = new Date(value.year, value.month, value.date);
|
|
82
|
-
this.
|
|
89
|
+
this.bdsDateSelected.emit({ value: changeSelected });
|
|
83
90
|
}
|
|
84
91
|
prevMonth() {
|
|
85
92
|
this.animatePrev = true;
|
|
@@ -128,6 +135,7 @@ export class BdsdatepickerSingle {
|
|
|
128
135
|
return false;
|
|
129
136
|
}
|
|
130
137
|
renderSelectData(data, selected, ref) {
|
|
138
|
+
var _a;
|
|
131
139
|
const openSelect = ref == 'months' ? this.openSelectMonth : this.openSelectYear;
|
|
132
140
|
const labelSelect = data.filter((obj) => obj.value === selected);
|
|
133
141
|
const iconArrow = openSelect ? 'arrow-up' : 'arrow-down';
|
|
@@ -140,7 +148,7 @@ export class BdsdatepickerSingle {
|
|
|
140
148
|
datepicker__calendar__selectDate__select__input__disable: data.length <= 1,
|
|
141
149
|
[`input--pressed`]: openSelect,
|
|
142
150
|
} },
|
|
143
|
-
h("bds-typo", { variant: "fs-14" }, labelSelect[0].label),
|
|
151
|
+
h("bds-typo", { variant: "fs-14" }, (_a = labelSelect[0]) === null || _a === void 0 ? void 0 : _a.label),
|
|
144
152
|
h("div", { class: "datepicker__calendar__selectDate__select__input__icon" },
|
|
145
153
|
h("bds-icon", { size: "small", name: iconArrow, color: "inherit" }))),
|
|
146
154
|
h("div", { class: {
|
|
@@ -327,6 +335,12 @@ export class BdsdatepickerSingle {
|
|
|
327
335
|
}; }
|
|
328
336
|
static get watchers() { return [{
|
|
329
337
|
"propName": "dateSelect",
|
|
330
|
-
"methodName": "
|
|
338
|
+
"methodName": "dateSelectChanged"
|
|
339
|
+
}, {
|
|
340
|
+
"propName": "endDate",
|
|
341
|
+
"methodName": "periodToSelectChanged"
|
|
342
|
+
}, {
|
|
343
|
+
"propName": "startDate",
|
|
344
|
+
"methodName": "periodToSelectChanged"
|
|
331
345
|
}]; }
|
|
332
346
|
}
|
|
@@ -66,9 +66,9 @@ export class DatePicker {
|
|
|
66
66
|
this.maskEndDateSelected = (ev) => {
|
|
67
67
|
const input = ev.target;
|
|
68
68
|
this.valueEndDateSelected = maskDate(input.value);
|
|
69
|
-
const valueSelected = dateToDayList(this.valueEndDateSelected);
|
|
70
|
-
const start = dateToDayList(this.startDateLimit);
|
|
71
|
-
const end = dateToDayList(this.endDateLimit);
|
|
69
|
+
const valueSelected = this.valueEndDateSelected && dateToDayList(this.valueEndDateSelected);
|
|
70
|
+
const start = this.startDateLimit && dateToDayList(this.startDateLimit);
|
|
71
|
+
const end = this.endDateLimit && dateToDayList(this.endDateLimit);
|
|
72
72
|
if (!dateValidation(this.valueEndDateSelected)) {
|
|
73
73
|
this.errorMsgEndDate = `Formato da data esta incorreto!`;
|
|
74
74
|
}
|
|
@@ -95,7 +95,9 @@ export class DatePicker {
|
|
|
95
95
|
this.endDateLimit = defaultEndDate;
|
|
96
96
|
}
|
|
97
97
|
if (fillDayList(dlEndDate) < fillDayList(dlStartDate)) {
|
|
98
|
-
this.endDateLimit =
|
|
98
|
+
this.endDateLimit = `${dlEndDate.date.toString().padStart(2, '0')}/${(dlEndDate.month + 1)
|
|
99
|
+
.toString()
|
|
100
|
+
.padStart(2, '0')}/${dlStartDate.year + 1}`;
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
componentWillLoad() {
|
|
@@ -126,7 +128,7 @@ export class DatePicker {
|
|
|
126
128
|
this.message && (h("div", { class: "datepicker__menu__message" },
|
|
127
129
|
h("bds-icon", { name: "warning", theme: "outline", "aria-label": "\u00CDcone de aten\u00E7\u00E3o" }),
|
|
128
130
|
h("bds-typo", { variant: "fs-16" }, this.message))),
|
|
129
|
-
this.typeOfDate == 'single' ? (h("bds-datepicker-single", { ref: this.refDatepickerSingle, startDate: dateToDayList(this.startDateLimit), endDate: dateToDayList(this.endDateLimit), dateSelect: this.dateSelected, onBdsDateSelected: (event) => this.selectDate(event) })) : (h("bds-datepicker-period", { ref: this.refDatepickerPeriod, startDate: dateToDayList(this.startDateLimit), endDate: dateToDayList(this.endDateLimit), startDateSelect: this.dateSelected, endDateSelect: this.endDateSelected, onBdsStartDate: (event) => this.selectDate(event), onBdsEndDate: (event) => this.selectEndDate(event) })),
|
|
131
|
+
this.typeOfDate == 'single' ? (h("bds-datepicker-single", { ref: this.refDatepickerSingle, startDate: this.startDateLimit && dateToDayList(this.startDateLimit), endDate: this.endDateLimit && dateToDayList(this.endDateLimit), dateSelect: this.dateSelected, onBdsDateSelected: (event) => this.selectDate(event) })) : (h("bds-datepicker-period", { ref: this.refDatepickerPeriod, startDate: this.startDateLimit && dateToDayList(this.startDateLimit), endDate: this.endDateLimit && dateToDayList(this.endDateLimit), startDateSelect: this.dateSelected, endDateSelect: this.endDateSelected, onBdsStartDate: (event) => this.selectDate(event), onBdsEndDate: (event) => this.selectEndDate(event) })),
|
|
130
132
|
h("div", { class: { datepicker__menu__footer: true } },
|
|
131
133
|
this.typeOfDate == 'single' ? (h("bds-button", { variant: "secondary", onClick: () => this.clearDateSingle() }, "Redefinir")) : (h("bds-button", { variant: "secondary", onClick: () => this.clearDatePeriod() }, "Redefinir")),
|
|
132
134
|
h("bds-button", { onClick: () => (this.open = false) }, "Concluir")))));
|
|
@@ -223,8 +225,6 @@ export class DatePicker {
|
|
|
223
225
|
"endDateSelected": {},
|
|
224
226
|
"valueDateSelected": {},
|
|
225
227
|
"valueEndDateSelected": {},
|
|
226
|
-
"datepickerPeriod": {},
|
|
227
|
-
"datepickerSingle": {},
|
|
228
228
|
"errorMsgDate": {},
|
|
229
229
|
"errorMsgEndDate": {}
|
|
230
230
|
}; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, e as createEvent, h } from './index-d446bcfd.js';
|
|
2
|
-
import { T as THIS_DAY, b as dateToDayList, d as defaultStartDate, a as defaultEndDate, W as WEEK_DAYS, g as getMonthsSlide, e as getYears, h as getMonths,
|
|
2
|
+
import { T as THIS_DAY, b as dateToDayList, d as defaultStartDate, a as defaultEndDate, f as fillDayList, W as WEEK_DAYS, g as getMonthsSlide, e as getYears, h as getMonths, i as fillDate, M as MONTHS } from './calendar-b2732eee.js';
|
|
3
3
|
|
|
4
4
|
const datepickerCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}:host input,:host textarea{-webkit-box-shadow:inherit;box-shadow:inherit}:host input::-webkit-input-placeholder,:host textarea::-webkit-input-placeholder{color:#b9cbd3;opacity:1}:host input::-moz-placeholder,:host textarea::-moz-placeholder{color:#b9cbd3;opacity:1}:host input:-ms-input-placeholder,:host textarea:-ms-input-placeholder{color:#b9cbd3;opacity:1}:host input::-ms-input-placeholder,:host textarea::-ms-input-placeholder{color:#b9cbd3;opacity:1}:host input::placeholder,:host textarea::placeholder{color:#b9cbd3;opacity:1}:host input::-webkit-input-placeholder,:host textarea::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary .input__icon{color:#3f7de8;background-color:#e8f2ff}.input--state-primary .input__container__label{color:#8ca0b3}.input--state-primary .input__container__label--pressed{color:#3f7de8}.input--state-primary .input__container__text{caret-color:#3f7de8;color:#202c44}.input--state-danger{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger .input__icon{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger .input__container__label{color:#8ca0b3}.input--state-danger .input__container__label--pressed{color:#ff4c4c}.input--state-danger .input__container__text{caret-color:#ff4c4c;color:#202c44}.input--state-disabled{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled .input__icon{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled .input__container__label{color:#b9cbd3}.input--state-disabled .input__container__label--pressed{color:#b9cbd3}.input--state-disabled .input__container__text{caret-color:#b9cbd3;color:#b9cbd3}.input--label{padding:7px 4px 8px 12px}.input__icon{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large{padding:4px}.input__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text:focus{outline:0}.input__container__text::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text:focus{outline:0}.input__container__text[type=checkbox],.input__container__text[type=radio]{width:13px;height:13px}.input__container__text[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box}::-webkit-search-decoration{display:none}.input__container__text[type=reset],.input__container__text[type=button],.input__container__text[type=submit]{overflow:visible}.input__container__text::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message bds-typo{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger{color:#ff4c4c}.input__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.input__container__text{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif;font-size:0.875rem;line-height:150%;width:100%;resize:none;cursor:inherit}.input__container__text:focus{outline:0}.input__container__text::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text:focus{outline:0}.input__container__text[type=checkbox],.input__container__text[type=radio]{width:13px;height:13px}.input__container__text[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box}::-webkit-search-decoration{display:none}.input__container__text[type=reset],.input__container__text[type=button],.input__container__text[type=submit]{overflow:visible}.input__container__text__chips{width:auto;min-width:216px;max-width:216px}.datepicker{position:relative;max-width:608px}.datepicker__menu{position:absolute;pointer-events:none;top:calc(100% + 16px);left:0;background-color:#ffffff;-webkit-box-shadow:0px 4px 10px rgba(51, 51, 51, 0.3);box-shadow:0px 4px 10px rgba(51, 51, 51, 0.3);border-radius:8px;padding:16px;opacity:0;-webkit-transition:all 0.5s;-moz-transition:all 0.5s;transition:all 0.5s;z-index:80000}.datepicker__menu__open{pointer-events:auto;opacity:1}.datepicker__menu__message{padding:8px 16px;border-radius:8px;background-color:#fff6a8;color:#212a3c;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:24px}.datepicker__menu__message bds-icon{margin-right:8px}.datepicker__menu__footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding-top:16px;margin-top:16px;border-top:1px solid #d2dfe6}.datepicker__menu__footer bds-button{margin-left:16px}.datepicker__inputs{width:100%;display:grid}.datepicker__inputs__single{grid-template-columns:1fr}.datepicker__inputs__period{grid-template-columns:1fr 1fr;gap:16px}.datepicker__inputs bds-input{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%}.datepicker__inputs bds-input::part(input-container){position:relative}.datepicker__inputs__icon{cursor:pointer;color:#8ca0b3;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:space-evenly;justify-content:space-evenly;padding-right:16px}.datepicker__inputs__icon bds-icon:first-child{margin-right:8px}.datepicker__inputs__icon:hover bds-icon:first-child{color:#3f7de8}.datepicker__calendar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.datepicker__calendar__selectDate{width:100%;display:grid;grid-template-columns:28px 1fr 80px 28px;grid-gap:8px;-ms-flex-align:center;align-items:center;margin-bottom:16px;padding:0 8px}.datepicker__calendar__selectDate__select{position:relative;width:100%}.datepicker__calendar__selectDate__select__input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff;border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input.input--pressed{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.datepicker__calendar__selectDate__select__input .input__icon{color:#3f7de8;background-color:#e8f2ff}.datepicker__calendar__selectDate__select__input .input__container__label{color:#8ca0b3}.datepicker__calendar__selectDate__select__input .input__container__label--pressed{color:#3f7de8}.datepicker__calendar__selectDate__select__input .input__container__text{caret-color:#3f7de8;color:#202c44}.datepicker__calendar__selectDate__select__input__disable{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.datepicker__calendar__selectDate__select__input__disable:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input__disable.input--pressed{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.datepicker__calendar__selectDate__select__input__disable .input__icon{color:#b9cbd3;background-color:#f8fbfb}.datepicker__calendar__selectDate__select__input__disable .input__container__label{color:#b9cbd3}.datepicker__calendar__selectDate__select__input__disable .input__container__label--pressed{color:#b9cbd3}.datepicker__calendar__selectDate__select__input__disable .input__container__text{caret-color:#b9cbd3;color:#b9cbd3}.datepicker__calendar__selectDate__select__input__icon{color:#8ca0b3;display:-ms-flexbox;display:flex}.datepicker__calendar__selectDate__select__options{background:#f8fbfb;width:100%;max-height:250px;position:absolute;top:99%;left:0;border-radius:8px;-webkit-box-shadow:0 2px 8px rgba(96, 123, 153, 0.4);box-shadow:0 2px 8px rgba(96, 123, 153, 0.4);overflow-y:auto;z-index:2;margin-top:4px;-webkit-transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:scaleY(0);transform:scaleY(0);opacity:0}.datepicker__calendar__selectDate__select__options::-webkit-scrollbar{width:16px;background-color:transparent}.datepicker__calendar__selectDate__select__options::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.datepicker__calendar__selectDate__select__options--open{visibility:visible;-webkit-transform:scale(1);transform:scale(1);opacity:1}.datepicker__calendar__selectDate__icon{cursor:pointer;color:#505f79}.datepicker__calendar__selectDate .arrow-left{padding-left:8px}.datepicker__calendar__selectDate .arrow-left__disable{opacity:0;pointer-events:none}.datepicker__calendar__selectDate .arrow-right{padding-right:8px}.datepicker__calendar__selectDate .arrow-right__disable{opacity:0;pointer-events:none}.datepicker__calendar__week{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.datepicker__calendar__week__day{width:40px;height:40px;text-align:center;color:#b9cbd3;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.datepicker__calendar__car{height:240px;width:280px;overflow:hidden;position:relative}.datepicker__calendar__car__slide{display:-ms-flexbox;display:flex;position:absolute;left:-100%}.datepicker__calendar__car__slide__box{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.datepicker__calendar__car__slide__box__day{width:40px;height:40px;position:relative}.datepicker__calendar__car__slide__box__day__period:before{content:\"\";position:absolute;inset:4px 0px;background-color:#e8f2ff}.datepicker__calendar__car__slide__box__day__start:before{inset:4px 0px 4px 4px;border-top-left-radius:16px;border-bottom-left-radius:16px}.datepicker__calendar__car__slide__box__day__end:before{inset:4px 4px 4px 0px;border-top-right-radius:16px;border-bottom-right-radius:16px}.datepicker__calendar__car__slide__box__day__typo{position:relative;width:calc(100% - 2px);height:calc(100% - 2px);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:100%;color:#505f79;border:1px solid transparent;cursor:pointer}.datepicker__calendar__car__slide__box__day__typo:hover{background-color:#ffffff;color:#3f7de8;border-color:#3f7de8}.datepicker__calendar__car__slide__box__day__current{background-color:#ffffff;color:#3f7de8;border-color:#3f7de8}.datepicker__calendar__car__slide__box__day__selected{background-color:#125ad5;color:#ffffff;border-color:#125ad5}.datepicker__calendar__car__slide__box__day__selected:hover{background-color:#125ad5;color:#ffffff;border-color:#125ad5}.datepicker__calendar__car__slide__box__day__disable{pointer-events:none;background-color:transparent;color:#8ca0b3}.datepicker__calendar__car .animate__prev{-webkit-animation-name:animationPrev;animation-name:animationPrev;-webkit-animation-duration:0.31s;animation-duration:0.31s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.datepicker__calendar__car .animate__next{-webkit-animation-name:animationNext;animation-name:animationNext;-webkit-animation-duration:0.31s;animation-duration:0.31s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.period .datepicker__calendar__selectDate{grid-template-columns:28px 120px 80px 1fr 28px}.period .datepicker__calendar__selectDate__futureMonth{padding-left:80px;text-align:center;color:#b9cbd3}.period .datepicker__calendar__week{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.period .datepicker__calendar__week__present,.period .datepicker__calendar__week__future{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.period .datepicker__calendar__car{height:240px;width:600px}.period .datepicker__calendar__car__slide{left:calc(-50% - 60px)}.period .datepicker__calendar__car__slide__box{margin-left:40px}.period .datepicker__calendar__car .animate__prev{-webkit-animation-name:animationPeriodPrev;animation-name:animationPeriodPrev}.period .datepicker__calendar__car .animate__next{-webkit-animation-name:animationPeriodNext;animation-name:animationPeriodNext}@-webkit-keyframes animationPrev{0%{left:-100%}100%{left:0}}@keyframes animationPrev{0%{left:-100%}100%{left:0}}@-webkit-keyframes animationNext{0%{left:-100%}100%{left:-200%}}@keyframes animationNext{0%{left:-100%}100%{left:-200%}}@-webkit-keyframes animationPeriodPrev{0%{left:calc(-50% - 60px)}100%{left:-40px}}@keyframes animationPeriodPrev{0%{left:calc(-50% - 60px)}100%{left:-40px}}@-webkit-keyframes animationPeriodNext{0%{left:calc(-50% - 60px)}100%{left:calc(-100% - 80px)}}@keyframes animationPeriodNext{0%{left:calc(-50% - 60px)}100%{left:calc(-100% - 80px)}}";
|
|
5
5
|
|
|
@@ -64,13 +64,13 @@ let BdsdatepickerPeriod = class {
|
|
|
64
64
|
this.startDateSelect = null;
|
|
65
65
|
this.endDateSelect = null;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
startDateSelectChanged() {
|
|
68
68
|
var _a;
|
|
69
69
|
this.bdsStartDate.emit({ value: this.startDateSelect });
|
|
70
70
|
this.monthActivated = this.startDateSelect ? (_a = this.startDateSelect) === null || _a === void 0 ? void 0 : _a.getMonth() : this.startDate.month;
|
|
71
71
|
this.yearActivated = this.startDateSelect ? this.startDateSelect.getFullYear() : this.startDate.year;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
endDateSelectChanged() {
|
|
74
74
|
this.bdsEndDate.emit({ value: this.endDateSelect });
|
|
75
75
|
this.monthActivated = this.endDateSelect
|
|
76
76
|
? this.startDateSelect.getMonth() == this.endDateSelect.getMonth() &&
|
|
@@ -84,6 +84,14 @@ let BdsdatepickerPeriod = class {
|
|
|
84
84
|
this.yearActivated = this.yearActivated - 1;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
periodToSelectChanged(newValue, _oldValue) {
|
|
88
|
+
const oldDate = fillDayList(_oldValue);
|
|
89
|
+
const newDate = fillDayList(newValue);
|
|
90
|
+
if (newDate != oldDate) {
|
|
91
|
+
this.monthActivated = this.startDate.month;
|
|
92
|
+
this.yearActivated = this.startDate.year;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
87
95
|
componentWillLoad() {
|
|
88
96
|
if (this.startDate) {
|
|
89
97
|
this.monthActivated = this.startDate.month;
|
|
@@ -253,8 +261,10 @@ let BdsdatepickerPeriod = class {
|
|
|
253
261
|
])))));
|
|
254
262
|
}
|
|
255
263
|
static get watchers() { return {
|
|
256
|
-
"startDateSelect": ["
|
|
257
|
-
"endDateSelect": ["
|
|
264
|
+
"startDateSelect": ["startDateSelectChanged"],
|
|
265
|
+
"endDateSelect": ["endDateSelectChanged"],
|
|
266
|
+
"endDate": ["periodToSelectChanged"],
|
|
267
|
+
"startDate": ["periodToSelectChanged"]
|
|
258
268
|
}; }
|
|
259
269
|
};
|
|
260
270
|
BdsdatepickerPeriod.style = datepickerCss;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-541ebde5.js';
|
|
2
|
-
import { T as THIS_DAY, b as dateToDayList, W as WEEK_DAYS, g as getMonthsSlide, e as getYears, h as getMonths,
|
|
2
|
+
import { T as THIS_DAY, b as dateToDayList, f as fillDayList, W as WEEK_DAYS, g as getMonthsSlide, e as getYears, h as getMonths, i as fillDate, d as defaultStartDate, a as defaultEndDate, M as MONTHS } from './calendar-b2732eee.js';
|
|
3
3
|
|
|
4
4
|
const datepickerCss$1 = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}:host input,:host textarea{-webkit-box-shadow:inherit;box-shadow:inherit}:host input::-webkit-input-placeholder,:host textarea::-webkit-input-placeholder{color:#b9cbd3;opacity:1}:host input::-moz-placeholder,:host textarea::-moz-placeholder{color:#b9cbd3;opacity:1}:host input:-ms-input-placeholder,:host textarea:-ms-input-placeholder{color:#b9cbd3;opacity:1}:host input::-ms-input-placeholder,:host textarea::-ms-input-placeholder{color:#b9cbd3;opacity:1}:host input::placeholder,:host textarea::placeholder{color:#b9cbd3;opacity:1}:host input::-webkit-input-placeholder,:host textarea::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary .input__icon{color:#3f7de8;background-color:#e8f2ff}.input--state-primary .input__container__label{color:#8ca0b3}.input--state-primary .input__container__label--pressed{color:#3f7de8}.input--state-primary .input__container__text{caret-color:#3f7de8;color:#202c44}.input--state-danger{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger .input__icon{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger .input__container__label{color:#8ca0b3}.input--state-danger .input__container__label--pressed{color:#ff4c4c}.input--state-danger .input__container__text{caret-color:#ff4c4c;color:#202c44}.input--state-disabled{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled .input__icon{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled .input__container__label{color:#b9cbd3}.input--state-disabled .input__container__label--pressed{color:#b9cbd3}.input--state-disabled .input__container__text{caret-color:#b9cbd3;color:#b9cbd3}.input--label{padding:7px 4px 8px 12px}.input__icon{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large{padding:4px}.input__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text:focus{outline:0}.input__container__text::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text:focus{outline:0}.input__container__text[type=checkbox],.input__container__text[type=radio]{width:13px;height:13px}.input__container__text[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box}::-webkit-search-decoration{display:none}.input__container__text[type=reset],.input__container__text[type=button],.input__container__text[type=submit]{overflow:visible}.input__container__text::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message bds-typo{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger{color:#ff4c4c}.input__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.input__container__text{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif;font-size:0.875rem;line-height:150%;width:100%;resize:none;cursor:inherit}.input__container__text:focus{outline:0}.input__container__text::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text:focus{outline:0}.input__container__text[type=checkbox],.input__container__text[type=radio]{width:13px;height:13px}.input__container__text[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box}::-webkit-search-decoration{display:none}.input__container__text[type=reset],.input__container__text[type=button],.input__container__text[type=submit]{overflow:visible}.input__container__text__chips{width:auto;min-width:216px;max-width:216px}.datepicker{position:relative;max-width:608px}.datepicker__menu{position:absolute;pointer-events:none;top:calc(100% + 16px);left:0;background-color:#ffffff;-webkit-box-shadow:0px 4px 10px rgba(51, 51, 51, 0.3);box-shadow:0px 4px 10px rgba(51, 51, 51, 0.3);border-radius:8px;padding:16px;opacity:0;-webkit-transition:all 0.5s;-moz-transition:all 0.5s;transition:all 0.5s;z-index:80000}.datepicker__menu__open{pointer-events:auto;opacity:1}.datepicker__menu__message{padding:8px 16px;border-radius:8px;background-color:#fff6a8;color:#212a3c;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:24px}.datepicker__menu__message bds-icon{margin-right:8px}.datepicker__menu__footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding-top:16px;margin-top:16px;border-top:1px solid #d2dfe6}.datepicker__menu__footer bds-button{margin-left:16px}.datepicker__inputs{width:100%;display:grid}.datepicker__inputs__single{grid-template-columns:1fr}.datepicker__inputs__period{grid-template-columns:1fr 1fr;gap:16px}.datepicker__inputs bds-input{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%}.datepicker__inputs bds-input::part(input-container){position:relative}.datepicker__inputs__icon{cursor:pointer;color:#8ca0b3;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:space-evenly;justify-content:space-evenly;padding-right:16px}.datepicker__inputs__icon bds-icon:first-child{margin-right:8px}.datepicker__inputs__icon:hover bds-icon:first-child{color:#3f7de8}.datepicker__calendar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.datepicker__calendar__selectDate{width:100%;display:grid;grid-template-columns:28px 1fr 80px 28px;grid-gap:8px;-ms-flex-align:center;align-items:center;margin-bottom:16px;padding:0 8px}.datepicker__calendar__selectDate__select{position:relative;width:100%}.datepicker__calendar__selectDate__select__input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff;border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input.input--pressed{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.datepicker__calendar__selectDate__select__input .input__icon{color:#3f7de8;background-color:#e8f2ff}.datepicker__calendar__selectDate__select__input .input__container__label{color:#8ca0b3}.datepicker__calendar__selectDate__select__input .input__container__label--pressed{color:#3f7de8}.datepicker__calendar__selectDate__select__input .input__container__text{caret-color:#3f7de8;color:#202c44}.datepicker__calendar__selectDate__select__input__disable{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.datepicker__calendar__selectDate__select__input__disable:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input__disable.input--pressed{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.datepicker__calendar__selectDate__select__input__disable .input__icon{color:#b9cbd3;background-color:#f8fbfb}.datepicker__calendar__selectDate__select__input__disable .input__container__label{color:#b9cbd3}.datepicker__calendar__selectDate__select__input__disable .input__container__label--pressed{color:#b9cbd3}.datepicker__calendar__selectDate__select__input__disable .input__container__text{caret-color:#b9cbd3;color:#b9cbd3}.datepicker__calendar__selectDate__select__input__icon{color:#8ca0b3;display:-ms-flexbox;display:flex}.datepicker__calendar__selectDate__select__options{background:#f8fbfb;width:100%;max-height:250px;position:absolute;top:99%;left:0;border-radius:8px;-webkit-box-shadow:0 2px 8px rgba(96, 123, 153, 0.4);box-shadow:0 2px 8px rgba(96, 123, 153, 0.4);overflow-y:auto;z-index:2;margin-top:4px;-webkit-transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:scaleY(0);transform:scaleY(0);opacity:0}.datepicker__calendar__selectDate__select__options::-webkit-scrollbar{width:16px;background-color:transparent}.datepicker__calendar__selectDate__select__options::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.datepicker__calendar__selectDate__select__options--open{visibility:visible;-webkit-transform:scale(1);transform:scale(1);opacity:1}.datepicker__calendar__selectDate__icon{cursor:pointer;color:#505f79}.datepicker__calendar__selectDate .arrow-left{padding-left:8px}.datepicker__calendar__selectDate .arrow-left__disable{opacity:0;pointer-events:none}.datepicker__calendar__selectDate .arrow-right{padding-right:8px}.datepicker__calendar__selectDate .arrow-right__disable{opacity:0;pointer-events:none}.datepicker__calendar__week{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.datepicker__calendar__week__day{width:40px;height:40px;text-align:center;color:#b9cbd3;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.datepicker__calendar__car{height:240px;width:280px;overflow:hidden;position:relative}.datepicker__calendar__car__slide{display:-ms-flexbox;display:flex;position:absolute;left:-100%}.datepicker__calendar__car__slide__box{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.datepicker__calendar__car__slide__box__day{width:40px;height:40px;position:relative}.datepicker__calendar__car__slide__box__day__period:before{content:\"\";position:absolute;inset:4px 0px;background-color:#e8f2ff}.datepicker__calendar__car__slide__box__day__start:before{inset:4px 0px 4px 4px;border-top-left-radius:16px;border-bottom-left-radius:16px}.datepicker__calendar__car__slide__box__day__end:before{inset:4px 4px 4px 0px;border-top-right-radius:16px;border-bottom-right-radius:16px}.datepicker__calendar__car__slide__box__day__typo{position:relative;width:calc(100% - 2px);height:calc(100% - 2px);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:100%;color:#505f79;border:1px solid transparent;cursor:pointer}.datepicker__calendar__car__slide__box__day__typo:hover{background-color:#ffffff;color:#3f7de8;border-color:#3f7de8}.datepicker__calendar__car__slide__box__day__current{background-color:#ffffff;color:#3f7de8;border-color:#3f7de8}.datepicker__calendar__car__slide__box__day__selected{background-color:#125ad5;color:#ffffff;border-color:#125ad5}.datepicker__calendar__car__slide__box__day__selected:hover{background-color:#125ad5;color:#ffffff;border-color:#125ad5}.datepicker__calendar__car__slide__box__day__disable{pointer-events:none;background-color:transparent;color:#8ca0b3}.datepicker__calendar__car .animate__prev{-webkit-animation-name:animationPrev;animation-name:animationPrev;-webkit-animation-duration:0.31s;animation-duration:0.31s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.datepicker__calendar__car .animate__next{-webkit-animation-name:animationNext;animation-name:animationNext;-webkit-animation-duration:0.31s;animation-duration:0.31s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.period .datepicker__calendar__selectDate{grid-template-columns:28px 120px 80px 1fr 28px}.period .datepicker__calendar__selectDate__futureMonth{padding-left:80px;text-align:center;color:#b9cbd3}.period .datepicker__calendar__week{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.period .datepicker__calendar__week__present,.period .datepicker__calendar__week__future{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.period .datepicker__calendar__car{height:240px;width:600px}.period .datepicker__calendar__car__slide{left:calc(-50% - 60px)}.period .datepicker__calendar__car__slide__box{margin-left:40px}.period .datepicker__calendar__car .animate__prev{-webkit-animation-name:animationPeriodPrev;animation-name:animationPeriodPrev}.period .datepicker__calendar__car .animate__next{-webkit-animation-name:animationPeriodNext;animation-name:animationPeriodNext}@-webkit-keyframes animationPrev{0%{left:-100%}100%{left:0}}@keyframes animationPrev{0%{left:-100%}100%{left:0}}@-webkit-keyframes animationNext{0%{left:-100%}100%{left:-200%}}@keyframes animationNext{0%{left:-100%}100%{left:-200%}}@-webkit-keyframes animationPeriodPrev{0%{left:calc(-50% - 60px)}100%{left:-40px}}@keyframes animationPeriodPrev{0%{left:calc(-50% - 60px)}100%{left:-40px}}@-webkit-keyframes animationPeriodNext{0%{left:calc(-50% - 60px)}100%{left:calc(-100% - 80px)}}@keyframes animationPeriodNext{0%{left:calc(-50% - 60px)}100%{left:calc(-100% - 80px)}}";
|
|
5
5
|
|
|
@@ -64,13 +64,13 @@ let BdsdatepickerPeriod = class {
|
|
|
64
64
|
this.startDateSelect = null;
|
|
65
65
|
this.endDateSelect = null;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
startDateSelectChanged() {
|
|
68
68
|
var _a;
|
|
69
69
|
this.bdsStartDate.emit({ value: this.startDateSelect });
|
|
70
70
|
this.monthActivated = this.startDateSelect ? (_a = this.startDateSelect) === null || _a === void 0 ? void 0 : _a.getMonth() : this.startDate.month;
|
|
71
71
|
this.yearActivated = this.startDateSelect ? this.startDateSelect.getFullYear() : this.startDate.year;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
endDateSelectChanged() {
|
|
74
74
|
this.bdsEndDate.emit({ value: this.endDateSelect });
|
|
75
75
|
this.monthActivated = this.endDateSelect
|
|
76
76
|
? this.startDateSelect.getMonth() == this.endDateSelect.getMonth() &&
|
|
@@ -84,6 +84,14 @@ let BdsdatepickerPeriod = class {
|
|
|
84
84
|
this.yearActivated = this.yearActivated - 1;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
periodToSelectChanged(newValue, _oldValue) {
|
|
88
|
+
const oldDate = fillDayList(_oldValue);
|
|
89
|
+
const newDate = fillDayList(newValue);
|
|
90
|
+
if (newDate != oldDate) {
|
|
91
|
+
this.monthActivated = this.startDate.month;
|
|
92
|
+
this.yearActivated = this.startDate.year;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
87
95
|
componentWillLoad() {
|
|
88
96
|
if (this.startDate) {
|
|
89
97
|
this.monthActivated = this.startDate.month;
|
|
@@ -253,8 +261,10 @@ let BdsdatepickerPeriod = class {
|
|
|
253
261
|
])))));
|
|
254
262
|
}
|
|
255
263
|
static get watchers() { return {
|
|
256
|
-
"startDateSelect": ["
|
|
257
|
-
"endDateSelect": ["
|
|
264
|
+
"startDateSelect": ["startDateSelectChanged"],
|
|
265
|
+
"endDateSelect": ["endDateSelectChanged"],
|
|
266
|
+
"endDate": ["periodToSelectChanged"],
|
|
267
|
+
"startDate": ["periodToSelectChanged"]
|
|
258
268
|
}; }
|
|
259
269
|
};
|
|
260
270
|
BdsdatepickerPeriod.style = datepickerCss$1;
|
|
@@ -316,12 +326,19 @@ let BdsdatepickerSingle = class {
|
|
|
316
326
|
async clear() {
|
|
317
327
|
this.dateSelect = null;
|
|
318
328
|
}
|
|
319
|
-
|
|
329
|
+
dateSelectChanged() {
|
|
320
330
|
var _a;
|
|
321
|
-
this.bdsDateSelected.emit({ value: this.dateSelect });
|
|
322
331
|
this.monthActivated = this.dateSelect ? (_a = this.dateSelect) === null || _a === void 0 ? void 0 : _a.getMonth() : this.startDate.month;
|
|
323
332
|
this.yearActivated = this.dateSelect ? this.dateSelect.getFullYear() : this.startDate.year;
|
|
324
333
|
}
|
|
334
|
+
periodToSelectChanged(newValue, _oldValue) {
|
|
335
|
+
const oldDate = fillDayList(_oldValue);
|
|
336
|
+
const newDate = fillDayList(newValue);
|
|
337
|
+
if (newDate != oldDate) {
|
|
338
|
+
this.monthActivated = this.startDate.month;
|
|
339
|
+
this.yearActivated = this.startDate.year;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
325
342
|
componentWillLoad() {
|
|
326
343
|
if (this.startDate) {
|
|
327
344
|
this.monthActivated = this.startDate.month;
|
|
@@ -343,7 +360,7 @@ let BdsdatepickerSingle = class {
|
|
|
343
360
|
}
|
|
344
361
|
selectDate(value) {
|
|
345
362
|
const changeSelected = new Date(value.year, value.month, value.date);
|
|
346
|
-
this.
|
|
363
|
+
this.bdsDateSelected.emit({ value: changeSelected });
|
|
347
364
|
}
|
|
348
365
|
prevMonth() {
|
|
349
366
|
this.animatePrev = true;
|
|
@@ -392,6 +409,7 @@ let BdsdatepickerSingle = class {
|
|
|
392
409
|
return false;
|
|
393
410
|
}
|
|
394
411
|
renderSelectData(data, selected, ref) {
|
|
412
|
+
var _a;
|
|
395
413
|
const openSelect = ref == 'months' ? this.openSelectMonth : this.openSelectYear;
|
|
396
414
|
const labelSelect = data.filter((obj) => obj.value === selected);
|
|
397
415
|
const iconArrow = openSelect ? 'arrow-up' : 'arrow-down';
|
|
@@ -402,7 +420,7 @@ let BdsdatepickerSingle = class {
|
|
|
402
420
|
datepicker__calendar__selectDate__select__input: true,
|
|
403
421
|
datepicker__calendar__selectDate__select__input__disable: data.length <= 1,
|
|
404
422
|
[`input--pressed`]: openSelect,
|
|
405
|
-
} }, h("bds-typo", { variant: "fs-14" }, labelSelect[0].label), h("div", { class: "datepicker__calendar__selectDate__select__input__icon" }, h("bds-icon", { size: "small", name: iconArrow, color: "inherit" }))), h("div", { class: {
|
|
423
|
+
} }, h("bds-typo", { variant: "fs-14" }, (_a = labelSelect[0]) === null || _a === void 0 ? void 0 : _a.label), h("div", { class: "datepicker__calendar__selectDate__select__input__icon" }, h("bds-icon", { size: "small", name: iconArrow, color: "inherit" }))), h("div", { class: {
|
|
406
424
|
datepicker__calendar__selectDate__select__options: true,
|
|
407
425
|
'datepicker__calendar__selectDate__select__options--open': openSelect,
|
|
408
426
|
} }, data.map((option) => (h("bds-select-option", { value: option.value, key: option.value, onOptionSelected: (event) => this.handler(event, ref), selected: option.value == selected, onClick: () => this.openDateSelect(false, ref) }, option.label))))));
|
|
@@ -441,7 +459,9 @@ let BdsdatepickerSingle = class {
|
|
|
441
459
|
])))));
|
|
442
460
|
}
|
|
443
461
|
static get watchers() { return {
|
|
444
|
-
"dateSelect": ["
|
|
462
|
+
"dateSelect": ["dateSelectChanged"],
|
|
463
|
+
"endDate": ["periodToSelectChanged"],
|
|
464
|
+
"startDate": ["periodToSelectChanged"]
|
|
445
465
|
}; }
|
|
446
466
|
};
|
|
447
467
|
BdsdatepickerSingle.style = datepickerCss;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, e as createEvent, h } from './index-d446bcfd.js';
|
|
2
|
-
import { T as THIS_DAY, b as dateToDayList, a as defaultEndDate, d as defaultStartDate, W as WEEK_DAYS, g as getMonthsSlide, e as getYears, h as getMonths, i as fillDate
|
|
2
|
+
import { T as THIS_DAY, b as dateToDayList, a as defaultEndDate, d as defaultStartDate, f as fillDayList, W as WEEK_DAYS, g as getMonthsSlide, e as getYears, h as getMonths, i as fillDate } from './calendar-b2732eee.js';
|
|
3
3
|
|
|
4
4
|
const datepickerCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%}:host input,:host textarea{-webkit-box-shadow:inherit;box-shadow:inherit}:host input::-webkit-input-placeholder,:host textarea::-webkit-input-placeholder{color:#b9cbd3;opacity:1}:host input::-moz-placeholder,:host textarea::-moz-placeholder{color:#b9cbd3;opacity:1}:host input:-ms-input-placeholder,:host textarea:-ms-input-placeholder{color:#b9cbd3;opacity:1}:host input::-ms-input-placeholder,:host textarea::-ms-input-placeholder{color:#b9cbd3;opacity:1}:host input::placeholder,:host textarea::placeholder{color:#b9cbd3;opacity:1}:host input::-webkit-input-placeholder,:host textarea::-webkit-input-placeholder{color:#b9cbd3;opacity:1}.input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff}.input--state-primary{border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-primary.input--pressed{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.input--state-primary .input__icon{color:#3f7de8;background-color:#e8f2ff}.input--state-primary .input__container__label{color:#8ca0b3}.input--state-primary .input__container__label--pressed{color:#3f7de8}.input--state-primary .input__container__text{caret-color:#3f7de8;color:#202c44}.input--state-danger{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger:hover{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.input--state-danger.input--pressed{border:1px solid #ff4c4c;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #ffa5a5;box-shadow:0 0 0 2px #ffa5a5}.input--state-danger .input__icon{color:#ff4c4c;background-color:#ffa5a5}.input--state-danger .input__container__label{color:#8ca0b3}.input--state-danger .input__container__label--pressed{color:#ff4c4c}.input--state-danger .input__container__text{caret-color:#ff4c4c;color:#202c44}.input--state-disabled{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.input--state-disabled:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.input--state-disabled.input--pressed{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.input--state-disabled .input__icon{color:#b9cbd3;background-color:#f8fbfb}.input--state-disabled .input__container__label{color:#b9cbd3}.input--state-disabled .input__container__label--pressed{color:#b9cbd3}.input--state-disabled .input__container__text{caret-color:#b9cbd3;color:#b9cbd3}.input--label{padding:7px 4px 8px 12px}.input__icon{cursor:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;margin-right:8px;padding:2.5px}.input__icon--large{padding:4px}.input__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.input__container__wrapper__chips{display:inline;max-height:100px;overflow:auto}.input__container__wrapper__chips::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__wrapper__chips::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__container__label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__text{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif;font-size:0.875rem;line-height:150%;resize:none;cursor:inherit}.input__container__text:focus{outline:0}.input__container__text::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text:focus{outline:0}.input__container__text[type=checkbox],.input__container__text[type=radio]{width:13px;height:13px}.input__container__text[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box}::-webkit-search-decoration{display:none}.input__container__text[type=reset],.input__container__text[type=button],.input__container__text[type=submit]{overflow:visible}.input__container__text::-webkit-scrollbar{width:16px;background-color:transparent}.input__container__text::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.input__message{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;height:20px;margin:3.7px 2.5px;-webkit-transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:0.3s cubic-bezier(0.4, 0, 0.2, 1);color:#8ca0b3;word-break:break-word;height:auto;min-height:20px}.input__message bds-typo{margin-top:0px;-ms-flex-item-align:self-start;align-self:self-start}.input__message__icon{display:-ms-flexbox;display:flex;padding-right:4px;margin-top:0px;padding-top:2px}.input__message--danger{color:#ff4c4c}.input__container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;width:100%}.input__container__label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input__container__wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.input__container__text{display:inline-block;margin:0;border:0;padding:0;width:auto;vertical-align:middle;white-space:normal;line-height:inherit;background:none;color:inherit;font-size:inherit;font-family:inherit;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif;font-size:0.875rem;line-height:150%;width:100%;resize:none;cursor:inherit}.input__container__text:focus{outline:0}.input__container__text::-webkit-file-upload-button{padding:0;border:0;background:none}.input__container__text:focus{outline:0}.input__container__text[type=checkbox],.input__container__text[type=radio]{width:13px;height:13px}.input__container__text[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box}::-webkit-search-decoration{display:none}.input__container__text[type=reset],.input__container__text[type=button],.input__container__text[type=submit]{overflow:visible}.input__container__text__chips{width:auto;min-width:216px;max-width:216px}.datepicker{position:relative;max-width:608px}.datepicker__menu{position:absolute;pointer-events:none;top:calc(100% + 16px);left:0;background-color:#ffffff;-webkit-box-shadow:0px 4px 10px rgba(51, 51, 51, 0.3);box-shadow:0px 4px 10px rgba(51, 51, 51, 0.3);border-radius:8px;padding:16px;opacity:0;-webkit-transition:all 0.5s;-moz-transition:all 0.5s;transition:all 0.5s;z-index:80000}.datepicker__menu__open{pointer-events:auto;opacity:1}.datepicker__menu__message{padding:8px 16px;border-radius:8px;background-color:#fff6a8;color:#212a3c;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:24px}.datepicker__menu__message bds-icon{margin-right:8px}.datepicker__menu__footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding-top:16px;margin-top:16px;border-top:1px solid #d2dfe6}.datepicker__menu__footer bds-button{margin-left:16px}.datepicker__inputs{width:100%;display:grid}.datepicker__inputs__single{grid-template-columns:1fr}.datepicker__inputs__period{grid-template-columns:1fr 1fr;gap:16px}.datepicker__inputs bds-input{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%}.datepicker__inputs bds-input::part(input-container){position:relative}.datepicker__inputs__icon{cursor:pointer;color:#8ca0b3;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:space-evenly;justify-content:space-evenly;padding-right:16px}.datepicker__inputs__icon bds-icon:first-child{margin-right:8px}.datepicker__inputs__icon:hover bds-icon:first-child{color:#3f7de8}.datepicker__calendar{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.datepicker__calendar__selectDate{width:100%;display:grid;grid-template-columns:28px 1fr 80px 28px;grid-gap:8px;-ms-flex-align:center;align-items:center;margin-bottom:16px;padding:0 8px}.datepicker__calendar__selectDate__select{position:relative;width:100%}.datepicker__calendar__selectDate__select__input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:8px 4px 9px 12px;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;background:#ffffff;border:1px solid #d2dfe6;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input:hover{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input.input--pressed{border:1px solid #3f7de8;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4);box-shadow:0 0 0 2px rgba(63, 125, 232, 0.4)}.datepicker__calendar__selectDate__select__input .input__icon{color:#3f7de8;background-color:#e8f2ff}.datepicker__calendar__selectDate__select__input .input__container__label{color:#8ca0b3}.datepicker__calendar__selectDate__select__input .input__container__label--pressed{color:#3f7de8}.datepicker__calendar__selectDate__select__input .input__container__text{caret-color:#3f7de8;color:#202c44}.datepicker__calendar__selectDate__select__input__disable{cursor:not-allowed;border:1px solid #e7edf4;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;background:#f3f6fa}.datepicker__calendar__selectDate__select__input__disable:hover{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;border:1px solid #e7edf4;box-sizing:border-box;border-radius:8px}.datepicker__calendar__selectDate__select__input__disable.input--pressed{border:1px solid #b9cbd3;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:8px;-webkit-box-shadow:0 0 0 2px #e7edf4;box-shadow:0 0 0 2px #e7edf4}.datepicker__calendar__selectDate__select__input__disable .input__icon{color:#b9cbd3;background-color:#f8fbfb}.datepicker__calendar__selectDate__select__input__disable .input__container__label{color:#b9cbd3}.datepicker__calendar__selectDate__select__input__disable .input__container__label--pressed{color:#b9cbd3}.datepicker__calendar__selectDate__select__input__disable .input__container__text{caret-color:#b9cbd3;color:#b9cbd3}.datepicker__calendar__selectDate__select__input__icon{color:#8ca0b3;display:-ms-flexbox;display:flex}.datepicker__calendar__selectDate__select__options{background:#f8fbfb;width:100%;max-height:250px;position:absolute;top:99%;left:0;border-radius:8px;-webkit-box-shadow:0 2px 8px rgba(96, 123, 153, 0.4);box-shadow:0 2px 8px rgba(96, 123, 153, 0.4);overflow-y:auto;z-index:2;margin-top:4px;-webkit-transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s;transition:transform 0.25s, opacity 0.75s, visibility 0.75s, -webkit-transform 0.25s;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:scaleY(0);transform:scaleY(0);opacity:0}.datepicker__calendar__selectDate__select__options::-webkit-scrollbar{width:16px;background-color:transparent}.datepicker__calendar__selectDate__select__options::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid transparent;border-radius:10px;background-clip:content-box;background-color:#b9cbd3}.datepicker__calendar__selectDate__select__options--open{visibility:visible;-webkit-transform:scale(1);transform:scale(1);opacity:1}.datepicker__calendar__selectDate__icon{cursor:pointer;color:#505f79}.datepicker__calendar__selectDate .arrow-left{padding-left:8px}.datepicker__calendar__selectDate .arrow-left__disable{opacity:0;pointer-events:none}.datepicker__calendar__selectDate .arrow-right{padding-right:8px}.datepicker__calendar__selectDate .arrow-right__disable{opacity:0;pointer-events:none}.datepicker__calendar__week{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.datepicker__calendar__week__day{width:40px;height:40px;text-align:center;color:#b9cbd3;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.datepicker__calendar__car{height:240px;width:280px;overflow:hidden;position:relative}.datepicker__calendar__car__slide{display:-ms-flexbox;display:flex;position:absolute;left:-100%}.datepicker__calendar__car__slide__box{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.datepicker__calendar__car__slide__box__day{width:40px;height:40px;position:relative}.datepicker__calendar__car__slide__box__day__period:before{content:\"\";position:absolute;inset:4px 0px;background-color:#e8f2ff}.datepicker__calendar__car__slide__box__day__start:before{inset:4px 0px 4px 4px;border-top-left-radius:16px;border-bottom-left-radius:16px}.datepicker__calendar__car__slide__box__day__end:before{inset:4px 4px 4px 0px;border-top-right-radius:16px;border-bottom-right-radius:16px}.datepicker__calendar__car__slide__box__day__typo{position:relative;width:calc(100% - 2px);height:calc(100% - 2px);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:100%;color:#505f79;border:1px solid transparent;cursor:pointer}.datepicker__calendar__car__slide__box__day__typo:hover{background-color:#ffffff;color:#3f7de8;border-color:#3f7de8}.datepicker__calendar__car__slide__box__day__current{background-color:#ffffff;color:#3f7de8;border-color:#3f7de8}.datepicker__calendar__car__slide__box__day__selected{background-color:#125ad5;color:#ffffff;border-color:#125ad5}.datepicker__calendar__car__slide__box__day__selected:hover{background-color:#125ad5;color:#ffffff;border-color:#125ad5}.datepicker__calendar__car__slide__box__day__disable{pointer-events:none;background-color:transparent;color:#8ca0b3}.datepicker__calendar__car .animate__prev{-webkit-animation-name:animationPrev;animation-name:animationPrev;-webkit-animation-duration:0.31s;animation-duration:0.31s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.datepicker__calendar__car .animate__next{-webkit-animation-name:animationNext;animation-name:animationNext;-webkit-animation-duration:0.31s;animation-duration:0.31s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.period .datepicker__calendar__selectDate{grid-template-columns:28px 120px 80px 1fr 28px}.period .datepicker__calendar__selectDate__futureMonth{padding-left:80px;text-align:center;color:#b9cbd3}.period .datepicker__calendar__week{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.period .datepicker__calendar__week__present,.period .datepicker__calendar__week__future{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:grid;grid-template-columns:repeat(7, 1fr)}.period .datepicker__calendar__car{height:240px;width:600px}.period .datepicker__calendar__car__slide{left:calc(-50% - 60px)}.period .datepicker__calendar__car__slide__box{margin-left:40px}.period .datepicker__calendar__car .animate__prev{-webkit-animation-name:animationPeriodPrev;animation-name:animationPeriodPrev}.period .datepicker__calendar__car .animate__next{-webkit-animation-name:animationPeriodNext;animation-name:animationPeriodNext}@-webkit-keyframes animationPrev{0%{left:-100%}100%{left:0}}@keyframes animationPrev{0%{left:-100%}100%{left:0}}@-webkit-keyframes animationNext{0%{left:-100%}100%{left:-200%}}@keyframes animationNext{0%{left:-100%}100%{left:-200%}}@-webkit-keyframes animationPeriodPrev{0%{left:calc(-50% - 60px)}100%{left:-40px}}@keyframes animationPeriodPrev{0%{left:calc(-50% - 60px)}100%{left:-40px}}@-webkit-keyframes animationPeriodNext{0%{left:calc(-50% - 60px)}100%{left:calc(-100% - 80px)}}@keyframes animationPeriodNext{0%{left:calc(-50% - 60px)}100%{left:calc(-100% - 80px)}}";
|
|
5
5
|
|
|
@@ -58,12 +58,19 @@ let BdsdatepickerSingle = class {
|
|
|
58
58
|
async clear() {
|
|
59
59
|
this.dateSelect = null;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
dateSelectChanged() {
|
|
62
62
|
var _a;
|
|
63
|
-
this.bdsDateSelected.emit({ value: this.dateSelect });
|
|
64
63
|
this.monthActivated = this.dateSelect ? (_a = this.dateSelect) === null || _a === void 0 ? void 0 : _a.getMonth() : this.startDate.month;
|
|
65
64
|
this.yearActivated = this.dateSelect ? this.dateSelect.getFullYear() : this.startDate.year;
|
|
66
65
|
}
|
|
66
|
+
periodToSelectChanged(newValue, _oldValue) {
|
|
67
|
+
const oldDate = fillDayList(_oldValue);
|
|
68
|
+
const newDate = fillDayList(newValue);
|
|
69
|
+
if (newDate != oldDate) {
|
|
70
|
+
this.monthActivated = this.startDate.month;
|
|
71
|
+
this.yearActivated = this.startDate.year;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
67
74
|
componentWillLoad() {
|
|
68
75
|
if (this.startDate) {
|
|
69
76
|
this.monthActivated = this.startDate.month;
|
|
@@ -85,7 +92,7 @@ let BdsdatepickerSingle = class {
|
|
|
85
92
|
}
|
|
86
93
|
selectDate(value) {
|
|
87
94
|
const changeSelected = new Date(value.year, value.month, value.date);
|
|
88
|
-
this.
|
|
95
|
+
this.bdsDateSelected.emit({ value: changeSelected });
|
|
89
96
|
}
|
|
90
97
|
prevMonth() {
|
|
91
98
|
this.animatePrev = true;
|
|
@@ -134,6 +141,7 @@ let BdsdatepickerSingle = class {
|
|
|
134
141
|
return false;
|
|
135
142
|
}
|
|
136
143
|
renderSelectData(data, selected, ref) {
|
|
144
|
+
var _a;
|
|
137
145
|
const openSelect = ref == 'months' ? this.openSelectMonth : this.openSelectYear;
|
|
138
146
|
const labelSelect = data.filter((obj) => obj.value === selected);
|
|
139
147
|
const iconArrow = openSelect ? 'arrow-up' : 'arrow-down';
|
|
@@ -144,7 +152,7 @@ let BdsdatepickerSingle = class {
|
|
|
144
152
|
datepicker__calendar__selectDate__select__input: true,
|
|
145
153
|
datepicker__calendar__selectDate__select__input__disable: data.length <= 1,
|
|
146
154
|
[`input--pressed`]: openSelect,
|
|
147
|
-
} }, h("bds-typo", { variant: "fs-14" }, labelSelect[0].label), h("div", { class: "datepicker__calendar__selectDate__select__input__icon" }, h("bds-icon", { size: "small", name: iconArrow, color: "inherit" }))), h("div", { class: {
|
|
155
|
+
} }, h("bds-typo", { variant: "fs-14" }, (_a = labelSelect[0]) === null || _a === void 0 ? void 0 : _a.label), h("div", { class: "datepicker__calendar__selectDate__select__input__icon" }, h("bds-icon", { size: "small", name: iconArrow, color: "inherit" }))), h("div", { class: {
|
|
148
156
|
datepicker__calendar__selectDate__select__options: true,
|
|
149
157
|
'datepicker__calendar__selectDate__select__options--open': openSelect,
|
|
150
158
|
} }, data.map((option) => (h("bds-select-option", { value: option.value, key: option.value, onOptionSelected: (event) => this.handler(event, ref), selected: option.value == selected, onClick: () => this.openDateSelect(false, ref) }, option.label))))));
|
|
@@ -183,7 +191,9 @@ let BdsdatepickerSingle = class {
|
|
|
183
191
|
])))));
|
|
184
192
|
}
|
|
185
193
|
static get watchers() { return {
|
|
186
|
-
"dateSelect": ["
|
|
194
|
+
"dateSelect": ["dateSelectChanged"],
|
|
195
|
+
"endDate": ["periodToSelectChanged"],
|
|
196
|
+
"startDate": ["periodToSelectChanged"]
|
|
187
197
|
}; }
|
|
188
198
|
};
|
|
189
199
|
BdsdatepickerSingle.style = datepickerCss;
|
|
@@ -72,9 +72,9 @@ let DatePicker = class {
|
|
|
72
72
|
this.maskEndDateSelected = (ev) => {
|
|
73
73
|
const input = ev.target;
|
|
74
74
|
this.valueEndDateSelected = maskDate(input.value);
|
|
75
|
-
const valueSelected = dateToDayList(this.valueEndDateSelected);
|
|
76
|
-
const start = dateToDayList(this.startDateLimit);
|
|
77
|
-
const end = dateToDayList(this.endDateLimit);
|
|
75
|
+
const valueSelected = this.valueEndDateSelected && dateToDayList(this.valueEndDateSelected);
|
|
76
|
+
const start = this.startDateLimit && dateToDayList(this.startDateLimit);
|
|
77
|
+
const end = this.endDateLimit && dateToDayList(this.endDateLimit);
|
|
78
78
|
if (!dateValidation(this.valueEndDateSelected)) {
|
|
79
79
|
this.errorMsgEndDate = `Formato da data esta incorreto!`;
|
|
80
80
|
}
|
|
@@ -101,7 +101,9 @@ let DatePicker = class {
|
|
|
101
101
|
this.endDateLimit = defaultEndDate;
|
|
102
102
|
}
|
|
103
103
|
if (fillDayList(dlEndDate) < fillDayList(dlStartDate)) {
|
|
104
|
-
this.endDateLimit =
|
|
104
|
+
this.endDateLimit = `${dlEndDate.date.toString().padStart(2, '0')}/${(dlEndDate.month + 1)
|
|
105
|
+
.toString()
|
|
106
|
+
.padStart(2, '0')}/${dlStartDate.year + 1}`;
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
componentWillLoad() {
|
|
@@ -123,7 +125,7 @@ let DatePicker = class {
|
|
|
123
125
|
this.errorMsgEndDate = null;
|
|
124
126
|
}
|
|
125
127
|
render() {
|
|
126
|
-
return (h("div", { class: { datepicker: true } }, this.typeOfDate == 'single' ? (h("div", { class: { datepicker__inputs: true, [`datepicker__inputs__${this.typeOfDate}`]: true } }, h("bds-input", { label: "Definir a data", value: this.valueDateSelected, placeholder: "__/__/____", maxlength: 10, icon: "calendar", onClick: () => (this.open = true), onBdsInput: (ev) => this.maskDateSelected(ev), danger: this.errorMsgDate ? true : false, errorMessage: this.errorMsgDate }))) : (h("div", { class: { datepicker__inputs: true, [`datepicker__inputs__${this.typeOfDate}`]: true } }, h("bds-input", { label: "De", value: this.valueDateSelected, placeholder: "__/__/____", maxlength: 10, icon: "calendar", onClick: () => (this.open = true), onBdsInput: (ev) => this.maskDateSelected(ev), danger: this.errorMsgDate ? true : false, errorMessage: this.errorMsgDate }), h("bds-input", { label: "At\u00E9", value: this.valueEndDateSelected, disabled: !this.dateSelected, placeholder: "__/__/____", maxlength: 10, icon: "calendar", onClick: () => (this.open = true), onBdsInput: (ev) => this.maskEndDateSelected(ev), danger: this.errorMsgEndDate ? true : false, errorMessage: this.errorMsgEndDate }))), h("div", { class: { datepicker__menu: true, datepicker__menu__open: this.open } }, this.message && (h("div", { class: "datepicker__menu__message" }, h("bds-icon", { name: "warning", theme: "outline", "aria-label": "\u00CDcone de aten\u00E7\u00E3o" }), h("bds-typo", { variant: "fs-16" }, this.message))), this.typeOfDate == 'single' ? (h("bds-datepicker-single", { ref: this.refDatepickerSingle, startDate: dateToDayList(this.startDateLimit), endDate: dateToDayList(this.endDateLimit), dateSelect: this.dateSelected, onBdsDateSelected: (event) => this.selectDate(event) })) : (h("bds-datepicker-period", { ref: this.refDatepickerPeriod, startDate: dateToDayList(this.startDateLimit), endDate: dateToDayList(this.endDateLimit), startDateSelect: this.dateSelected, endDateSelect: this.endDateSelected, onBdsStartDate: (event) => this.selectDate(event), onBdsEndDate: (event) => this.selectEndDate(event) })), h("div", { class: { datepicker__menu__footer: true } }, this.typeOfDate == 'single' ? (h("bds-button", { variant: "secondary", onClick: () => this.clearDateSingle() }, "Redefinir")) : (h("bds-button", { variant: "secondary", onClick: () => this.clearDatePeriod() }, "Redefinir")), h("bds-button", { onClick: () => (this.open = false) }, "Concluir")))));
|
|
128
|
+
return (h("div", { class: { datepicker: true } }, this.typeOfDate == 'single' ? (h("div", { class: { datepicker__inputs: true, [`datepicker__inputs__${this.typeOfDate}`]: true } }, h("bds-input", { label: "Definir a data", value: this.valueDateSelected, placeholder: "__/__/____", maxlength: 10, icon: "calendar", onClick: () => (this.open = true), onBdsInput: (ev) => this.maskDateSelected(ev), danger: this.errorMsgDate ? true : false, errorMessage: this.errorMsgDate }))) : (h("div", { class: { datepicker__inputs: true, [`datepicker__inputs__${this.typeOfDate}`]: true } }, h("bds-input", { label: "De", value: this.valueDateSelected, placeholder: "__/__/____", maxlength: 10, icon: "calendar", onClick: () => (this.open = true), onBdsInput: (ev) => this.maskDateSelected(ev), danger: this.errorMsgDate ? true : false, errorMessage: this.errorMsgDate }), h("bds-input", { label: "At\u00E9", value: this.valueEndDateSelected, disabled: !this.dateSelected, placeholder: "__/__/____", maxlength: 10, icon: "calendar", onClick: () => (this.open = true), onBdsInput: (ev) => this.maskEndDateSelected(ev), danger: this.errorMsgEndDate ? true : false, errorMessage: this.errorMsgEndDate }))), h("div", { class: { datepicker__menu: true, datepicker__menu__open: this.open } }, this.message && (h("div", { class: "datepicker__menu__message" }, h("bds-icon", { name: "warning", theme: "outline", "aria-label": "\u00CDcone de aten\u00E7\u00E3o" }), h("bds-typo", { variant: "fs-16" }, this.message))), this.typeOfDate == 'single' ? (h("bds-datepicker-single", { ref: this.refDatepickerSingle, startDate: this.startDateLimit && dateToDayList(this.startDateLimit), endDate: this.endDateLimit && dateToDayList(this.endDateLimit), dateSelect: this.dateSelected, onBdsDateSelected: (event) => this.selectDate(event) })) : (h("bds-datepicker-period", { ref: this.refDatepickerPeriod, startDate: this.startDateLimit && dateToDayList(this.startDateLimit), endDate: this.endDateLimit && dateToDayList(this.endDateLimit), startDateSelect: this.dateSelected, endDateSelect: this.endDateSelected, onBdsStartDate: (event) => this.selectDate(event), onBdsEndDate: (event) => this.selectEndDate(event) })), h("div", { class: { datepicker__menu__footer: true } }, this.typeOfDate == 'single' ? (h("bds-button", { variant: "secondary", onClick: () => this.clearDateSingle() }, "Redefinir")) : (h("bds-button", { variant: "secondary", onClick: () => this.clearDatePeriod() }, "Redefinir")), h("bds-button", { onClick: () => (this.open = false) }, "Concluir")))));
|
|
127
129
|
}
|
|
128
130
|
static get watchers() { return {
|
|
129
131
|
"startDateLimit": ["startDateLimitChanged"],
|