@blueprintjs/datetime
Advanced tools
Comparing version 5.2.7 to 5.2.8
@@ -65,2 +65,3 @@ "use strict"; | ||
var popoverContentRef = React.useRef(null); | ||
var popoverId = core_1.Utils.uniqueId("date-picker"); | ||
// State | ||
@@ -197,3 +198,3 @@ // ------------------------------------------------------------------------ | ||
// event listeners ourselves. | ||
var popoverContent = (React.createElement("div", { ref: popoverContentRef }, | ||
var popoverContent = (React.createElement("div", { ref: popoverContentRef, role: "dialog", "aria-label": "date picker", id: popoverId }, | ||
React.createElement("div", { onFocus: handleStartFocusBoundaryFocusIn, tabIndex: 0 }), | ||
@@ -358,3 +359,3 @@ React.createElement(datePicker_1.DatePicker, tslib_1.__assign({}, datePickerProps, { dayPickerProps: dayPickerProps, maxDate: maxDate, minDate: minDate, onChange: handleDateChange, onShortcutChange: handleShortcutChange, selectedShortcutIndex: selectedShortcutIndex, timePrecision: timePrecision, | ||
props.rightElement, | ||
maybeTimezonePicker), tagName: popoverProps.targetTagName, type: "text" }, targetProps, inputProps, { "aria-expanded": targetIsOpen, disabled: props.disabled, fill: fill, inputRef: (0, core_1.mergeRefs)(ref, inputRef, (_c = (_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.inputRef) !== null && _c !== void 0 ? _c : null), onBlur: handleInputBlur, onChange: handleInputChange, onClick: handleInputClick, onFocus: handleInputFocus, onKeyDown: handleInputKeyDown, value: (_d = (isInputFocused ? inputValue : formattedDateString)) !== null && _d !== void 0 ? _d : "" }))); | ||
maybeTimezonePicker), tagName: popoverProps.targetTagName, type: "text", role: "combobox" }, targetProps, inputProps, { "aria-controls": popoverId, "aria-expanded": targetIsOpen, disabled: props.disabled, fill: fill, inputRef: (0, core_1.mergeRefs)(ref, inputRef, (_c = (_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.inputRef) !== null && _c !== void 0 ? _c : null), onBlur: handleInputBlur, onChange: handleInputChange, onClick: handleInputClick, onFocus: handleInputFocus, onKeyDown: handleInputKeyDown, value: (_d = (isInputFocused ? inputValue : formattedDateString)) !== null && _d !== void 0 ? _d : "" }))); | ||
}, [ | ||
@@ -361,0 +362,0 @@ fill, |
@@ -175,3 +175,3 @@ "use strict"; | ||
var isHour = unit === timeUnit_1.TimeUnit.HOUR_12 || unit === timeUnit_1.TimeUnit.HOUR_24; | ||
return (React.createElement("input", { "aria-label": (0, timeUnit_1.getTimeUnitPrintStr)(unit), "aria-valuemin": 0, "aria-valuenow": valueNumber, "aria-valuemax": (0, timeUnit_1.getTimeUnitMax)(unit), className: (0, classnames_1.default)(common_1.Classes.TIMEPICKER_INPUT, (_a = {}, _a[core_1.Classes.intentClass(core_1.Intent.DANGER)] = !isValid, _a), className), id: this.timeInputIds[unit], onBlur: this.getInputBlurHandler(unit), onChange: this.getInputChangeHandler(unit), onFocus: this.getInputFocusHandler(unit), onKeyDown: this.getInputKeyDownHandler(unit), onKeyUp: this.getInputKeyUpHandler(unit), role: this.props.showArrowButtons ? "spinbutton" : undefined, value: value, disabled: this.props.disabled, autoFocus: isHour && this.props.autoFocus })); | ||
return (React.createElement("input", { "aria-label": (0, timeUnit_1.getTimeUnitPrintStr)(unit), className: (0, classnames_1.default)(common_1.Classes.TIMEPICKER_INPUT, (_a = {}, _a[core_1.Classes.intentClass(core_1.Intent.DANGER)] = !isValid, _a), className), id: this.timeInputIds[unit], min: 0, max: (0, timeUnit_1.getTimeUnitMax)(unit), onBlur: this.getInputBlurHandler(unit), onChange: this.getInputChangeHandler(unit), onFocus: this.getInputFocusHandler(unit), onKeyDown: this.getInputKeyDownHandler(unit), onKeyUp: this.getInputKeyUpHandler(unit), role: this.props.showArrowButtons ? "spinbutton" : undefined, type: "number", value: value, disabled: this.props.disabled, autoFocus: isHour && this.props.autoFocus })); | ||
}; | ||
@@ -178,0 +178,0 @@ TimePicker.prototype.maybeRenderAmPm = function () { |
@@ -66,3 +66,3 @@ "use strict"; | ||
var query = this.state.query; | ||
return (React.createElement(select_1.Select, { className: (0, classnames_1.default)(common_1.Classes.TIMEZONE_SELECT, className), disabled: disabled, fill: fill, inputProps: tslib_1.__assign({ placeholder: "Search for timezones..." }, inputProps), itemListPredicate: this.filterItems, itemRenderer: this.renderItem, items: query ? this.timezoneItems : this.initialTimezoneItems, noResults: React.createElement(core_1.MenuItem, { disabled: true, text: "No matching timezones." }), onItemSelect: this.handleItemSelect, onQueryChange: this.handleQueryChange, popoverProps: tslib_1.__assign(tslib_1.__assign({}, popoverProps), { popoverClassName: (0, classnames_1.default)(common_1.Classes.TIMEZONE_SELECT_POPOVER, popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.popoverClassName) }), resetOnClose: true, resetOnSelect: true }, children !== null && children !== void 0 ? children : this.renderButton())); | ||
return (React.createElement(select_1.Select, { className: (0, classnames_1.default)(common_1.Classes.TIMEZONE_SELECT, className), disabled: disabled, fill: fill, inputProps: tslib_1.__assign({ placeholder: "Search for timezones..." }, inputProps), itemListPredicate: this.filterItems, itemRenderer: this.renderItem, items: query ? this.timezoneItems : this.initialTimezoneItems, noResults: React.createElement(core_1.MenuItem, { disabled: true, roleStructure: "listoption", text: "No matching timezones." }), onItemSelect: this.handleItemSelect, onQueryChange: this.handleQueryChange, popoverProps: tslib_1.__assign(tslib_1.__assign({}, popoverProps), { popoverClassName: (0, classnames_1.default)(common_1.Classes.TIMEZONE_SELECT_POPOVER, popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.popoverClassName) }), resetOnClose: true, resetOnSelect: true }, children !== null && children !== void 0 ? children : this.renderButton())); | ||
}; | ||
@@ -69,0 +69,0 @@ TimezoneSelect.prototype.componentDidUpdate = function (prevProps, prevState) { |
@@ -62,2 +62,3 @@ /* | ||
var popoverContentRef = React.useRef(null); | ||
var popoverId = Utils.uniqueId("date-picker"); | ||
// State | ||
@@ -194,3 +195,3 @@ // ------------------------------------------------------------------------ | ||
// event listeners ourselves. | ||
var popoverContent = (React.createElement("div", { ref: popoverContentRef }, | ||
var popoverContent = (React.createElement("div", { ref: popoverContentRef, role: "dialog", "aria-label": "date picker", id: popoverId }, | ||
React.createElement("div", { onFocus: handleStartFocusBoundaryFocusIn, tabIndex: 0 }), | ||
@@ -355,3 +356,3 @@ React.createElement(DatePicker, __assign({}, datePickerProps, { dayPickerProps: dayPickerProps, maxDate: maxDate, minDate: minDate, onChange: handleDateChange, onShortcutChange: handleShortcutChange, selectedShortcutIndex: selectedShortcutIndex, timePrecision: timePrecision, | ||
props.rightElement, | ||
maybeTimezonePicker), tagName: popoverProps.targetTagName, type: "text" }, targetProps, inputProps, { "aria-expanded": targetIsOpen, disabled: props.disabled, fill: fill, inputRef: mergeRefs(ref, inputRef, (_c = (_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.inputRef) !== null && _c !== void 0 ? _c : null), onBlur: handleInputBlur, onChange: handleInputChange, onClick: handleInputClick, onFocus: handleInputFocus, onKeyDown: handleInputKeyDown, value: (_d = (isInputFocused ? inputValue : formattedDateString)) !== null && _d !== void 0 ? _d : "" }))); | ||
maybeTimezonePicker), tagName: popoverProps.targetTagName, type: "text", role: "combobox" }, targetProps, inputProps, { "aria-controls": popoverId, "aria-expanded": targetIsOpen, disabled: props.disabled, fill: fill, inputRef: mergeRefs(ref, inputRef, (_c = (_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.inputRef) !== null && _c !== void 0 ? _c : null), onBlur: handleInputBlur, onChange: handleInputChange, onClick: handleInputClick, onFocus: handleInputFocus, onKeyDown: handleInputKeyDown, value: (_d = (isInputFocused ? inputValue : formattedDateString)) !== null && _d !== void 0 ? _d : "" }))); | ||
}, [ | ||
@@ -358,0 +359,0 @@ fill, |
@@ -172,3 +172,3 @@ /* | ||
var isHour = unit === TimeUnit.HOUR_12 || unit === TimeUnit.HOUR_24; | ||
return (React.createElement("input", { "aria-label": getTimeUnitPrintStr(unit), "aria-valuemin": 0, "aria-valuenow": valueNumber, "aria-valuemax": getTimeUnitMax(unit), className: classNames(Classes.TIMEPICKER_INPUT, (_a = {}, _a[CoreClasses.intentClass(Intent.DANGER)] = !isValid, _a), className), id: this.timeInputIds[unit], onBlur: this.getInputBlurHandler(unit), onChange: this.getInputChangeHandler(unit), onFocus: this.getInputFocusHandler(unit), onKeyDown: this.getInputKeyDownHandler(unit), onKeyUp: this.getInputKeyUpHandler(unit), role: this.props.showArrowButtons ? "spinbutton" : undefined, value: value, disabled: this.props.disabled, autoFocus: isHour && this.props.autoFocus })); | ||
return (React.createElement("input", { "aria-label": getTimeUnitPrintStr(unit), className: classNames(Classes.TIMEPICKER_INPUT, (_a = {}, _a[CoreClasses.intentClass(Intent.DANGER)] = !isValid, _a), className), id: this.timeInputIds[unit], min: 0, max: getTimeUnitMax(unit), onBlur: this.getInputBlurHandler(unit), onChange: this.getInputChangeHandler(unit), onFocus: this.getInputFocusHandler(unit), onKeyDown: this.getInputKeyDownHandler(unit), onKeyUp: this.getInputKeyUpHandler(unit), role: this.props.showArrowButtons ? "spinbutton" : undefined, type: "number", value: value, disabled: this.props.disabled, autoFocus: isHour && this.props.autoFocus })); | ||
}; | ||
@@ -175,0 +175,0 @@ TimePicker.prototype.maybeRenderAmPm = function () { |
@@ -63,3 +63,3 @@ /* | ||
var query = this.state.query; | ||
return (React.createElement(Select, { className: classNames(Classes.TIMEZONE_SELECT, className), disabled: disabled, fill: fill, inputProps: __assign({ placeholder: "Search for timezones..." }, inputProps), itemListPredicate: this.filterItems, itemRenderer: this.renderItem, items: query ? this.timezoneItems : this.initialTimezoneItems, noResults: React.createElement(MenuItem, { disabled: true, text: "No matching timezones." }), onItemSelect: this.handleItemSelect, onQueryChange: this.handleQueryChange, popoverProps: __assign(__assign({}, popoverProps), { popoverClassName: classNames(Classes.TIMEZONE_SELECT_POPOVER, popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.popoverClassName) }), resetOnClose: true, resetOnSelect: true }, children !== null && children !== void 0 ? children : this.renderButton())); | ||
return (React.createElement(Select, { className: classNames(Classes.TIMEZONE_SELECT, className), disabled: disabled, fill: fill, inputProps: __assign({ placeholder: "Search for timezones..." }, inputProps), itemListPredicate: this.filterItems, itemRenderer: this.renderItem, items: query ? this.timezoneItems : this.initialTimezoneItems, noResults: React.createElement(MenuItem, { disabled: true, roleStructure: "listoption", text: "No matching timezones." }), onItemSelect: this.handleItemSelect, onQueryChange: this.handleQueryChange, popoverProps: __assign(__assign({}, popoverProps), { popoverClassName: classNames(Classes.TIMEZONE_SELECT_POPOVER, popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.popoverClassName) }), resetOnClose: true, resetOnSelect: true }, children !== null && children !== void 0 ? children : this.renderButton())); | ||
}; | ||
@@ -66,0 +66,0 @@ TimezoneSelect.prototype.componentDidUpdate = function (prevProps, prevState) { |
@@ -58,2 +58,3 @@ /* | ||
const popoverContentRef = React.useRef(null); | ||
const popoverId = Utils.uniqueId("date-picker"); | ||
// State | ||
@@ -187,3 +188,3 @@ // ------------------------------------------------------------------------ | ||
// event listeners ourselves. | ||
const popoverContent = (React.createElement("div", { ref: popoverContentRef }, | ||
const popoverContent = (React.createElement("div", { ref: popoverContentRef, role: "dialog", "aria-label": "date picker", id: popoverId }, | ||
React.createElement("div", { onFocus: handleStartFocusBoundaryFocusIn, tabIndex: 0 }), | ||
@@ -338,3 +339,3 @@ React.createElement(DatePicker, { ...datePickerProps, dayPickerProps: dayPickerProps, maxDate: maxDate, minDate: minDate, onChange: handleDateChange, onShortcutChange: handleShortcutChange, selectedShortcutIndex: selectedShortcutIndex, timePrecision: timePrecision, | ||
props.rightElement, | ||
maybeTimezonePicker), tagName: popoverProps.targetTagName, type: "text", ...targetProps, ...inputProps, "aria-expanded": targetIsOpen, disabled: props.disabled, fill: fill, inputRef: mergeRefs(ref, inputRef, props.inputProps?.inputRef ?? null), onBlur: handleInputBlur, onChange: handleInputChange, onClick: handleInputClick, onFocus: handleInputFocus, onKeyDown: handleInputKeyDown, value: (isInputFocused ? inputValue : formattedDateString) ?? "" })); | ||
maybeTimezonePicker), tagName: popoverProps.targetTagName, type: "text", role: "combobox", ...targetProps, ...inputProps, "aria-controls": popoverId, "aria-expanded": targetIsOpen, disabled: props.disabled, fill: fill, inputRef: mergeRefs(ref, inputRef, props.inputProps?.inputRef ?? null), onBlur: handleInputBlur, onChange: handleInputChange, onClick: handleInputClick, onFocus: handleInputFocus, onKeyDown: handleInputKeyDown, value: (isInputFocused ? inputValue : formattedDateString) ?? "" })); | ||
}, [ | ||
@@ -341,0 +342,0 @@ fill, |
@@ -119,3 +119,3 @@ /* | ||
const isHour = unit === TimeUnit.HOUR_12 || unit === TimeUnit.HOUR_24; | ||
return (React.createElement("input", { "aria-label": getTimeUnitPrintStr(unit), "aria-valuemin": 0, "aria-valuenow": valueNumber, "aria-valuemax": getTimeUnitMax(unit), className: classNames(Classes.TIMEPICKER_INPUT, { [CoreClasses.intentClass(Intent.DANGER)]: !isValid }, className), id: this.timeInputIds[unit], onBlur: this.getInputBlurHandler(unit), onChange: this.getInputChangeHandler(unit), onFocus: this.getInputFocusHandler(unit), onKeyDown: this.getInputKeyDownHandler(unit), onKeyUp: this.getInputKeyUpHandler(unit), role: this.props.showArrowButtons ? "spinbutton" : undefined, value: value, disabled: this.props.disabled, autoFocus: isHour && this.props.autoFocus })); | ||
return (React.createElement("input", { "aria-label": getTimeUnitPrintStr(unit), className: classNames(Classes.TIMEPICKER_INPUT, { [CoreClasses.intentClass(Intent.DANGER)]: !isValid }, className), id: this.timeInputIds[unit], min: 0, max: getTimeUnitMax(unit), onBlur: this.getInputBlurHandler(unit), onChange: this.getInputChangeHandler(unit), onFocus: this.getInputFocusHandler(unit), onKeyDown: this.getInputKeyDownHandler(unit), onKeyUp: this.getInputKeyUpHandler(unit), role: this.props.showArrowButtons ? "spinbutton" : undefined, type: "number", value: value, disabled: this.props.disabled, autoFocus: isHour && this.props.autoFocus })); | ||
} | ||
@@ -122,0 +122,0 @@ maybeRenderAmPm() { |
@@ -55,3 +55,3 @@ /* | ||
...inputProps, | ||
}, itemListPredicate: this.filterItems, itemRenderer: this.renderItem, items: query ? this.timezoneItems : this.initialTimezoneItems, noResults: React.createElement(MenuItem, { disabled: true, text: "No matching timezones." }), onItemSelect: this.handleItemSelect, onQueryChange: this.handleQueryChange, popoverProps: { | ||
}, itemListPredicate: this.filterItems, itemRenderer: this.renderItem, items: query ? this.timezoneItems : this.initialTimezoneItems, noResults: React.createElement(MenuItem, { disabled: true, roleStructure: "listoption", text: "No matching timezones." }), onItemSelect: this.handleItemSelect, onQueryChange: this.handleQueryChange, popoverProps: { | ||
...popoverProps, | ||
@@ -58,0 +58,0 @@ popoverClassName: classNames(Classes.TIMEZONE_SELECT_POPOVER, popoverProps?.popoverClassName), |
{ | ||
"name": "@blueprintjs/datetime", | ||
"version": "5.2.7", | ||
"version": "5.2.8", | ||
"description": "Components for interacting with dates and times", | ||
@@ -43,5 +43,5 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"@blueprintjs/core": "^5.7.1", | ||
"@blueprintjs/icons": "^5.4.1", | ||
"@blueprintjs/select": "^5.0.19", | ||
"@blueprintjs/core": "^5.7.2", | ||
"@blueprintjs/icons": "^5.5.0", | ||
"@blueprintjs/select": "^5.0.20", | ||
"classnames": "^2.3.1", | ||
@@ -65,6 +65,6 @@ "date-fns": "^2.28.0", | ||
"devDependencies": { | ||
"@blueprintjs/colors": "^5.0.7", | ||
"@blueprintjs/karma-build-scripts": "^5.2.2", | ||
"@blueprintjs/node-build-scripts": "^9.0.1", | ||
"@blueprintjs/test-commons": "^2.2.1", | ||
"@blueprintjs/colors": "^5.0.8", | ||
"@blueprintjs/karma-build-scripts": "^5.2.3", | ||
"@blueprintjs/node-build-scripts": "^9.0.2", | ||
"@blueprintjs/test-commons": "^2.2.2", | ||
"@types/lodash": "~4.14.201", | ||
@@ -71,0 +71,0 @@ "enzyme": "^3.11.0", |
@@ -18,7 +18,7 @@ /* | ||
export const TimePrecision = { | ||
MILLISECOND: "millisecond" as "millisecond", | ||
MINUTE: "minute" as "minute", | ||
SECOND: "second" as "second", | ||
MILLISECOND: "millisecond" as const, | ||
MINUTE: "minute" as const, | ||
SECOND: "second" as const, | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/no-redeclare | ||
export type TimePrecision = (typeof TimePrecision)[keyof typeof TimePrecision]; |
@@ -26,3 +26,3 @@ /* | ||
*/ | ||
ABBREVIATION: "abbreviation" as "abbreviation", | ||
ABBREVIATION: "abbreviation" as const, | ||
@@ -32,3 +32,3 @@ /** | ||
*/ | ||
CODE: "code" as "code", | ||
CODE: "code" as const, | ||
@@ -39,3 +39,3 @@ /** | ||
*/ | ||
COMPOSITE: "composite" as "composite", | ||
COMPOSITE: "composite" as const, | ||
@@ -45,3 +45,3 @@ /** | ||
*/ | ||
LONG_NAME: "long-name" as "long-name", | ||
LONG_NAME: "long-name" as const, | ||
@@ -51,3 +51,3 @@ /** | ||
*/ | ||
OFFSET: "offset" as "offset", | ||
OFFSET: "offset" as const, | ||
}; | ||
@@ -54,0 +54,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1787428
23276
Updated@blueprintjs/core@^5.7.2
Updated@blueprintjs/icons@^5.5.0
Updated@blueprintjs/select@^5.0.20