@itwin/itwinui-react 2.12.6 → 2.12.8
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/CHANGELOG.md +15 -0
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -0
- package/cjs/core/ComboBox/ComboBoxDropdown.js +1 -0
- package/cjs/core/DatePicker/DatePicker.d.ts +5 -8
- package/cjs/core/DropdownMenu/DropdownMenu.js +5 -1
- package/cjs/core/Menu/MenuItem.js +2 -2
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +5 -0
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -2
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -2
- package/cjs/styles.js +15 -10
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -0
- package/esm/core/ComboBox/ComboBoxDropdown.js +1 -0
- package/esm/core/DatePicker/DatePicker.d.ts +5 -8
- package/esm/core/DropdownMenu/DropdownMenu.js +2 -1
- package/esm/core/Menu/MenuItem.js +2 -2
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +5 -0
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -2
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -2
- package/esm/styles.js +15 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1576](https://github.com/iTwin/iTwinUI/pull/1576): Dropdown menus will now automatically become scrollable if there are too many menu items. Also added delay to submenu.
|
|
8
|
+
- [#1578](https://github.com/iTwin/iTwinUI/pull/1578): Fixed missing animation in ComboBox.
|
|
9
|
+
- [#1572](https://github.com/iTwin/iTwinUI/pull/1572): Adjusted borders and shadow values to be more prominent in dark theme.
|
|
10
|
+
- [#1575](https://github.com/iTwin/iTwinUI/pull/1575): ProgressRadial now stays inside container when using size="x-small".
|
|
11
|
+
|
|
12
|
+
## 2.12.7
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#1545](https://github.com/iTwin/iTwinUI/pull/1545): `tableFilters.DateRangeFilter` now supports localizing the date picker using `translatedLabels.datePicker`.
|
|
17
|
+
|
|
3
18
|
## 2.12.6
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -31,6 +31,7 @@ exports.ComboBoxDropdown = void 0;
|
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
32
|
const index_js_1 = require("../utils/index.js");
|
|
33
33
|
const helpers_js_1 = require("./helpers.js");
|
|
34
|
+
require("tippy.js/animations/shift-away.css");
|
|
34
35
|
exports.ComboBoxDropdown = React.forwardRef((props, forwardedRef) => {
|
|
35
36
|
const { children, ...rest } = props;
|
|
36
37
|
const { isOpen } = (0, index_js_1.useSafeContext)(helpers_js_1.ComboBoxStateContext);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { TimePickerProps } from '../TimePicker/index.js';
|
|
3
|
+
export declare type DatePickerLocalizedNames = {
|
|
4
|
+
[key in 'months' | 'shortDays' | 'days']: string[];
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* Generate localized months and days strings using `Intl.DateTimeFormat` for passed locale to use in DatePicker component.
|
|
5
8
|
* If locale is not passed, browser locale will be used.
|
|
6
9
|
*/
|
|
7
|
-
export declare const generateLocalizedStrings: (locale?: string) =>
|
|
8
|
-
months: string[];
|
|
9
|
-
shortDays: string[];
|
|
10
|
-
days: string[];
|
|
11
|
-
};
|
|
10
|
+
export declare const generateLocalizedStrings: (locale?: string) => DatePickerLocalizedNames;
|
|
12
11
|
export declare type DateRangePickerProps = {
|
|
13
12
|
/**
|
|
14
13
|
* Enable date range support.
|
|
@@ -42,9 +41,7 @@ export declare type DatePickerProps = {
|
|
|
42
41
|
* Pass localized week days (start from sunday) and months.
|
|
43
42
|
* Use helper function `generateLocalizedStrings` to generate strings using `Intl.DateTimeFormat`.
|
|
44
43
|
*/
|
|
45
|
-
localizedNames?:
|
|
46
|
-
[key in 'months' | 'shortDays' | 'days']: string[];
|
|
47
|
-
};
|
|
44
|
+
localizedNames?: DatePickerLocalizedNames;
|
|
48
45
|
/**
|
|
49
46
|
* Set focus on selected day or today.
|
|
50
47
|
* @default false
|
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.DropdownMenu = void 0;
|
|
27
30
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -29,6 +32,7 @@ exports.DropdownMenu = void 0;
|
|
|
29
32
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
33
|
*--------------------------------------------------------------------------------------------*/
|
|
31
34
|
const React = __importStar(require("react"));
|
|
35
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
32
36
|
const index_js_1 = require("../utils/index.js");
|
|
33
37
|
const index_js_2 = require("../Menu/index.js");
|
|
34
38
|
/**
|
|
@@ -70,7 +74,7 @@ const DropdownMenu = (props) => {
|
|
|
70
74
|
onHide === null || onHide === void 0 ? void 0 : onHide(instance);
|
|
71
75
|
}, [onHide]);
|
|
72
76
|
(0, index_js_1.useTheme)();
|
|
73
|
-
return (React.createElement(index_js_1.Popover, { content: React.createElement(index_js_2.Menu, { className: className, style: style, role: role, id: id }, React.useMemo(() => menuItems(close), [menuItems, close])), visible: trigger === undefined ? isVisible : undefined, onClickOutside: close, placement: placement, onShow: onShowHandler, onHide: onHideHandler, trigger: visible === undefined ? trigger : undefined, ...rest }, React.cloneElement(children, {
|
|
77
|
+
return (React.createElement(index_js_1.Popover, { content: React.createElement(index_js_2.Menu, { className: (0, classnames_1.default)('iui-scroll', className), style: style, role: role, id: id }, React.useMemo(() => menuItems(close), [menuItems, close])), visible: trigger === undefined ? isVisible : undefined, onClickOutside: close, placement: placement, onShow: onShowHandler, onHide: onHideHandler, trigger: visible === undefined ? trigger : undefined, ...rest }, React.cloneElement(children, {
|
|
74
78
|
ref: (0, index_js_1.mergeRefs)(targetRef, props.children.ref),
|
|
75
79
|
onClick: (args) => {
|
|
76
80
|
var _a, _b;
|
|
@@ -105,13 +105,13 @@ exports.MenuItem = React.forwardRef((props, ref) => {
|
|
|
105
105
|
className: (0, classnames_1.default)(badge.props.className, 'iui-icon'),
|
|
106
106
|
})));
|
|
107
107
|
return subMenuItems.length === 0 ? (listItem) : (React.createElement(MenuItemContext.Provider, { value: { ref: menuItemRef } },
|
|
108
|
-
React.createElement(index_js_1.Popover, { placement: 'right-start', visible: isSubmenuVisible, appendTo: 'parent', content: React.createElement("div", { onMouseLeave: () => setIsSubmenuVisible(false), onBlur: (e) => {
|
|
108
|
+
React.createElement(index_js_1.Popover, { placement: 'right-start', visible: isSubmenuVisible, appendTo: 'parent', delay: 100, content: React.createElement("div", { onMouseLeave: () => setIsSubmenuVisible(false), onBlur: (e) => {
|
|
109
109
|
var _a, _b;
|
|
110
110
|
!!(e.relatedTarget instanceof Node) &&
|
|
111
111
|
!((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget)) &&
|
|
112
112
|
!((_b = subMenuRef.current) === null || _b === void 0 ? void 0 : _b.isEqualNode(e.relatedTarget)) &&
|
|
113
113
|
setIsSubmenuVisible(false);
|
|
114
114
|
} },
|
|
115
|
-
React.createElement(Menu_js_1.Menu, { ref: subMenuRef }, subMenuItems)) }, listItem)));
|
|
115
|
+
React.createElement(Menu_js_1.Menu, { ref: subMenuRef, className: 'iui-scroll' }, subMenuItems)) }, listItem)));
|
|
116
116
|
});
|
|
117
117
|
exports.default = exports.MenuItem;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { LabeledInputProps } from '../../../LabeledInput/index.js';
|
|
3
|
+
import type { DatePickerLocalizedNames } from '../../../DatePicker/DatePicker.js';
|
|
3
4
|
export declare type DatePickerInputProps = {
|
|
4
5
|
date?: Date;
|
|
5
6
|
onChange: (date?: Date) => void;
|
|
@@ -13,6 +14,10 @@ export declare type DatePickerInputProps = {
|
|
|
13
14
|
* The 'to' date for the 'from' DatePickerInput or the 'from' date for the 'to' DatePickerInput
|
|
14
15
|
*/
|
|
15
16
|
selectedDate?: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Months, short days and days localized names for DatePicker
|
|
19
|
+
*/
|
|
20
|
+
localizedNames?: DatePickerLocalizedNames;
|
|
16
21
|
} & Omit<LabeledInputProps, 'value' | 'onChange' | 'svgIcon' | 'displayStyle'>;
|
|
17
22
|
declare const DatePickerInput: (props: DatePickerInputProps) => JSX.Element;
|
|
18
23
|
export default DatePickerInput;
|
|
@@ -33,7 +33,7 @@ const index_js_2 = require("../../../LabeledInput/index.js");
|
|
|
33
33
|
const index_js_3 = require("../../../DatePicker/index.js");
|
|
34
34
|
const index_js_4 = require("../../../Buttons/index.js");
|
|
35
35
|
const DatePickerInput = (props) => {
|
|
36
|
-
const { onChange, date, parseInput, formatDate, isFromOrTo, selectedDate, ...rest } = props;
|
|
36
|
+
const { onChange, date, parseInput, formatDate, isFromOrTo, selectedDate, localizedNames, ...rest } = props;
|
|
37
37
|
const isDateDisabled = (date) => {
|
|
38
38
|
if (isFromOrTo === 'to') {
|
|
39
39
|
return (0, index_js_1.isBefore)(date, selectedDate);
|
|
@@ -68,7 +68,7 @@ const DatePickerInput = (props) => {
|
|
|
68
68
|
onChange(parsedDate);
|
|
69
69
|
}
|
|
70
70
|
}, [onChange, parseInput]);
|
|
71
|
-
return (React.createElement(index_js_1.Popover, { content: React.createElement(index_js_3.DatePicker, { date: date, onChange: onDateSelected, setFocus: true, isDateDisabled: isDateDisabled }), placement: 'bottom', visible: isVisible, onClickOutside: (_, e) => {
|
|
71
|
+
return (React.createElement(index_js_1.Popover, { content: React.createElement(index_js_3.DatePicker, { date: date, onChange: onDateSelected, setFocus: true, isDateDisabled: isDateDisabled, localizedNames: localizedNames }), placement: 'bottom', visible: isVisible, onClickOutside: (_, e) => {
|
|
72
72
|
var _a;
|
|
73
73
|
if (!((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
74
74
|
close();
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FilterButtonBarTranslation } from '../FilterButtonBar.js';
|
|
3
3
|
import type { TableFilterProps } from '../types.js';
|
|
4
|
+
import type { DatePickerLocalizedNames } from '../../../DatePicker/DatePicker.js';
|
|
4
5
|
export declare type DateRangeTranslation = {
|
|
5
6
|
from: string;
|
|
6
7
|
to: string;
|
|
8
|
+
datePicker?: DatePickerLocalizedNames;
|
|
7
9
|
};
|
|
8
10
|
export declare type DateRangeFilterProps<T extends Record<string, unknown>> = TableFilterProps<T> & {
|
|
9
11
|
formatDate?: (date: Date) => string;
|
|
@@ -87,8 +87,8 @@ const DateRangeFilter = (props) => {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
return (React.createElement(BaseFilter_js_1.BaseFilter, null,
|
|
90
|
-
React.createElement(DatePickerInput_js_1.default, { label: translatedStrings.from, date: from, onChange: onFromChange, formatDate: formatDate, parseInput: parseInput, onKeyDown: onKeyDown, placeholder: placeholder, selectedDate: to, isFromOrTo: 'from', setFocus: true }),
|
|
91
|
-
React.createElement(DatePickerInput_js_1.default, { label: translatedStrings.to, date: to, onChange: onToChange, formatDate: formatDate, parseInput: parseInput, onKeyDown: onKeyDown, placeholder: placeholder, selectedDate: from, isFromOrTo: 'to' }),
|
|
90
|
+
React.createElement(DatePickerInput_js_1.default, { label: translatedStrings.from, date: from, onChange: onFromChange, formatDate: formatDate, parseInput: parseInput, onKeyDown: onKeyDown, placeholder: placeholder, selectedDate: to, isFromOrTo: 'from', localizedNames: translatedStrings.datePicker, setFocus: true }),
|
|
91
|
+
React.createElement(DatePickerInput_js_1.default, { label: translatedStrings.to, date: to, onChange: onToChange, formatDate: formatDate, parseInput: parseInput, onKeyDown: onKeyDown, placeholder: placeholder, selectedDate: from, isFromOrTo: 'to', localizedNames: translatedStrings.datePicker }),
|
|
92
92
|
React.createElement(FilterButtonBar_js_1.FilterButtonBar, { setFilter: () => setFilter([from, to]), clearFilter: clearFilter, translatedLabels: translatedLabels })));
|
|
93
93
|
};
|
|
94
94
|
exports.DateRangeFilter = DateRangeFilter;
|