diff --git a/src/components/datepicker/bl-datepicker.test.ts b/src/components/datepicker/bl-datepicker.test.ts index 902a1216..e0a713b6 100644 --- a/src/components/datepicker/bl-datepicker.test.ts +++ b/src/components/datepicker/bl-datepicker.test.ts @@ -117,7 +117,7 @@ describe("BlDatepicker", () => { it("should use custom value formatter when provided", async () => { const testDate = new Date(2023, 1, 1); - element.inputValueFormatter = (dates: Date[]) => `Custom format: ${dates[0].toDateString()}`; + element.valueFormatter = (dates: Date[]) => `Custom format: ${dates[0].toDateString()}`; element.setDatePickerInput([testDate]); await element.updateComplete; diff --git a/src/components/datepicker/bl-datepicker.ts b/src/components/datepicker/bl-datepicker.ts index dcfe562f..8a006265 100644 --- a/src/components/datepicker/bl-datepicker.ts +++ b/src/components/datepicker/bl-datepicker.ts @@ -30,13 +30,13 @@ export default class BlDatepicker extends DatepickerCalendarMixin { * Sets input size. */ @property({ type: String, reflect: true }) - inputSize?: InputSize = "medium"; + size?: InputSize = "medium"; /** * Makes datepicker input label as fixed positioned */ - @property({ type: Boolean, attribute: "input-label-fixed", reflect: true }) - inputLabelFixed = false; + @property({ type: Boolean, attribute: "label-fixed", reflect: true }) + labelFixed = false; /** * Defines the datepicker input label */ @@ -45,8 +45,8 @@ export default class BlDatepicker extends DatepickerCalendarMixin { /** * Defines the custom formatter function */ - @property({ type: Function, attribute: "input-value-formatter" }) - inputValueFormatter: ((dates: Date[]) => string) | null = null; + @property({ type: Function, attribute: "value-formatter" }) + valueFormatter: ((dates: Date[]) => string) | null = null; /** * Sets datepicker to disabled */ @@ -132,8 +132,8 @@ export default class BlDatepicker extends DatepickerCalendarMixin { this._inputValue = ""; } else { this._selectedDates = dates; - if (this.inputValueFormatter) { - this._inputValue = this.inputValueFormatter(this._selectedDates); + if (this.valueFormatter) { + this._inputValue = this.valueFormatter(this._selectedDates); } else { this.defaultInputValueFormatter(); } @@ -264,8 +264,8 @@ export default class BlDatepicker extends DatepickerCalendarMixin { @click=${this._togglePopover} help-text=${this.helpText} ?disabled=${this.disabled} - .size=${this.inputSize} - .labelFixed=${this.inputLabelFixed} + .size=${this.size} + .labelFixed=${this.labelFixed} readonly >