@schedule-x/date-picker
Advanced tools
Comparing version 1.28.0 to 1.29.0
@@ -148,3 +148,3 @@ 'use strict'; | ||
}; | ||
return (u(preact.Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
return (u(preact.Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.config.label || $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
} | ||
@@ -828,3 +828,3 @@ | ||
class ConfigImpl { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo) { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo, label) { | ||
Object.defineProperty(this, "locale", { | ||
@@ -878,2 +878,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: label | ||
}); | ||
} | ||
@@ -932,5 +938,11 @@ } | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
build() { | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo); | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo, this.label); | ||
} | ||
@@ -969,2 +981,6 @@ withLocale(locale) { | ||
} | ||
withLabel(label) { | ||
this.label = label; | ||
return this; | ||
} | ||
} | ||
@@ -1494,2 +1510,3 @@ | ||
.withTeleportTo(config.teleportTo) | ||
.withLabel(config.label) | ||
.build(); | ||
@@ -1496,0 +1513,0 @@ const timeUnitsImpl = new TimeUnitsBuilder() |
@@ -38,2 +38,3 @@ import { Signal } from "@preact/signals"; | ||
teleportTo?: HTMLElement; | ||
label?: string; | ||
} | ||
@@ -40,0 +41,0 @@ interface DatePickerConfigExternal extends Partial<Omit<DatePickerConfigInternal, "placement">> { |
@@ -148,3 +148,3 @@ 'use strict'; | ||
}; | ||
return (u(preact.Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
return (u(preact.Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.config.label || $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
} | ||
@@ -828,3 +828,3 @@ | ||
class ConfigImpl { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo) { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo, label) { | ||
Object.defineProperty(this, "locale", { | ||
@@ -878,2 +878,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: label | ||
}); | ||
} | ||
@@ -932,5 +938,11 @@ } | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
build() { | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo); | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo, this.label); | ||
} | ||
@@ -969,2 +981,6 @@ withLocale(locale) { | ||
} | ||
withLabel(label) { | ||
this.label = label; | ||
return this; | ||
} | ||
} | ||
@@ -1494,2 +1510,3 @@ | ||
.withTeleportTo(config.teleportTo) | ||
.withLabel(config.label) | ||
.build(); | ||
@@ -1496,0 +1513,0 @@ const timeUnitsImpl = new TimeUnitsBuilder() |
@@ -38,2 +38,3 @@ import { Signal } from "@preact/signals"; | ||
teleportTo?: HTMLElement; | ||
label?: string; | ||
} | ||
@@ -40,0 +41,0 @@ interface DatePickerConfigExternal extends Partial<Omit<DatePickerConfigInternal, "placement">> { |
@@ -146,3 +146,3 @@ import { options, createContext, Fragment, Component, createElement, toChildArray, render } from 'preact'; | ||
}; | ||
return (u(Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
return (u(Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.config.label || $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
} | ||
@@ -826,3 +826,3 @@ | ||
class ConfigImpl { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo) { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo, label) { | ||
Object.defineProperty(this, "locale", { | ||
@@ -876,2 +876,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: label | ||
}); | ||
} | ||
@@ -930,5 +936,11 @@ } | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
build() { | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo); | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo, this.label); | ||
} | ||
@@ -967,2 +979,6 @@ withLocale(locale) { | ||
} | ||
withLabel(label) { | ||
this.label = label; | ||
return this; | ||
} | ||
} | ||
@@ -1492,2 +1508,3 @@ | ||
.withTeleportTo(config.teleportTo) | ||
.withLabel(config.label) | ||
.build(); | ||
@@ -1494,0 +1511,0 @@ const timeUnitsImpl = new TimeUnitsBuilder() |
@@ -38,2 +38,3 @@ import { Signal } from "@preact/signals"; | ||
teleportTo?: HTMLElement; | ||
label?: string; | ||
} | ||
@@ -40,0 +41,0 @@ interface DatePickerConfigExternal extends Partial<Omit<DatePickerConfigInternal, "placement">> { |
@@ -148,3 +148,3 @@ (function (global, factory) { | ||
}; | ||
return (u(preact.Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
return (u(preact.Fragment, { children: u("div", { className: wrapperClasses.join(' '), id: inputWrapperId, children: [u("label", { for: datePickerInputId, id: datePickerLabelId, className: "sx__date-input-label", children: $app.config.label || $app.translate('Date') }), u("input", { id: datePickerInputId, "aria-describedby": datePickerLabelId, value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", className: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), u("button", { "aria-label": $app.translate('Choose Date'), onKeyDown: handleButtonKeyDown, className: "sx__date-input-chevron-wrapper", children: u("img", { className: "sx__date-input-chevron", src: img, alt: "" }) })] }) })); | ||
} | ||
@@ -828,3 +828,3 @@ | ||
class ConfigImpl { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo) { | ||
constructor(locale = DEFAULT_LOCALE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, min = toDateString$1(new Date(1970, 0, 1)), max = toDateString$1(new Date(new Date().getFullYear() + 1, 11, 31)), placement = Placement.BOTTOM_START, listeners = {}, style = {}, teleportTo, label) { | ||
Object.defineProperty(this, "locale", { | ||
@@ -878,2 +878,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: label | ||
}); | ||
} | ||
@@ -932,5 +938,11 @@ } | ||
}); | ||
Object.defineProperty(this, "label", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
} | ||
build() { | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo); | ||
return new ConfigImpl(this.locale, this.firstDayOfWeek, this.min, this.max, this.placement, this.listeners, this.style, this.teleportTo, this.label); | ||
} | ||
@@ -969,2 +981,6 @@ withLocale(locale) { | ||
} | ||
withLabel(label) { | ||
this.label = label; | ||
return this; | ||
} | ||
} | ||
@@ -1494,2 +1510,3 @@ | ||
.withTeleportTo(config.teleportTo) | ||
.withLabel(config.label) | ||
.build(); | ||
@@ -1496,0 +1513,0 @@ const timeUnitsImpl = new TimeUnitsBuilder() |
{ | ||
"name": "@schedule-x/date-picker", | ||
"version": "1.28.0", | ||
"version": "1.29.0", | ||
"description": "Schedule-X date picker component", | ||
@@ -34,3 +34,3 @@ "author": { | ||
"homepage": "https://schedule-x.dev", | ||
"gitHead": "b124272cfecc47a08e13fce9e20560f4f01ba4f8" | ||
"gitHead": "bc6158f71b92cb6a7deab101a8824de29129cff5" | ||
} |
250417
6146