onekijs-ui 0.20.6 → 0.20.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/dist/components/icon/util.d.ts +3 -3
- package/dist/components/list/components/ListItemComponent.d.ts +2 -2
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +24 -10
- package/dist/index.module.js.map +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/size.d.ts +6 -6
- package/dist/styles/typography.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/button/components/ButtonComponent.tsx +15 -3
- package/src/components/list/components/ListItemComponent.tsx +2 -2
- package/src/components/list/components/VirtualListComponent.tsx +2 -2
- package/src/components/select/SelectService.ts +11 -5
- package/src/components/select/components/ControlledSelectComponent.tsx +1 -1
- package/src/components/select/components/SelectOptionComponent.tsx +1 -1
- package/src/theme/base.tsx +1 -1
|
@@ -80,11 +80,11 @@ export declare const getIconDivProps: (props: IconProps) => {
|
|
|
80
80
|
results?: number | undefined;
|
|
81
81
|
security?: string | undefined;
|
|
82
82
|
unselectable?: "on" | "off" | undefined;
|
|
83
|
-
inputMode?: "search" | "text" | "
|
|
83
|
+
inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
|
|
84
84
|
is?: string | undefined;
|
|
85
85
|
'aria-activedescendant'?: string | undefined;
|
|
86
86
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
87
|
-
'aria-autocomplete'?: "
|
|
87
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
88
88
|
'aria-braillelabel'?: string | undefined;
|
|
89
89
|
'aria-brailleroledescription'?: string | undefined;
|
|
90
90
|
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
@@ -104,7 +104,7 @@ export declare const getIconDivProps: (props: IconProps) => {
|
|
|
104
104
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
105
105
|
'aria-flowto'?: string | undefined;
|
|
106
106
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
107
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
107
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
108
108
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
109
109
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
110
110
|
'aria-keyshortcuts'?: string | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ListItem, ListItemProps } from '../typings';
|
|
3
|
-
export declare const ListItemContent: <T = any, I extends ListItem<T> = ListItem<T>>({ item }: ListItemProps<T, I>) => React.JSX.Element;
|
|
3
|
+
export declare const ListItemContent: <T extends unknown = any, I extends ListItem<T> = ListItem<T>>({ item }: ListItemProps<T, I>) => React.JSX.Element;
|
|
4
4
|
declare const _default: {
|
|
5
|
-
<T = any, I extends ListItem<T> = ListItem<T>>(props: ListItemProps<T, I>): React.JSX.Element;
|
|
5
|
+
<T extends unknown = any, I extends ListItem<T> = ListItem<T>>(props: ListItemProps<T, I>): React.JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -937,6 +937,7 @@ const AccordionPanel = ({ title, initialActive, initialExpand, children, Compone
|
|
|
937
937
|
|
|
938
938
|
const ButtonComponent = React.forwardRef((props, ref) => {
|
|
939
939
|
const { kind, pattern, className, loading, IconComponent, onClick, type = 'button', ...buttonProps } = props;
|
|
940
|
+
const buttonRef = React.useRef(null);
|
|
940
941
|
let classNames = addClassname('o-button', className);
|
|
941
942
|
if (loading) {
|
|
942
943
|
classNames = addClassname('o-button-loading', classNames);
|
|
@@ -944,10 +945,20 @@ const ButtonComponent = React.forwardRef((props, ref) => {
|
|
|
944
945
|
if (props.disabled) {
|
|
945
946
|
classNames = addClassname('o-button-disabled', classNames);
|
|
946
947
|
}
|
|
947
|
-
|
|
948
|
+
const handleClick = (e) => {
|
|
949
|
+
if (!onClick) {
|
|
950
|
+
if (buttonRef.current) {
|
|
951
|
+
buttonRef.current.click();
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
else {
|
|
955
|
+
onClick(e);
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
return (React.createElement("span", { className: classNames, onClick: handleClick, ref: ref },
|
|
948
959
|
loading && React.createElement(LoadingIcon, { onClick: undefined, color: "currentColor" }),
|
|
949
960
|
!loading && IconComponent && React.createElement(IconComponent, { ...props, onClick: undefined, className: "o-button-icon" }),
|
|
950
|
-
React.createElement("button", { ...buttonProps, type: type, className: "o-button-content" })));
|
|
961
|
+
React.createElement("button", { ref: buttonRef, ...buttonProps, type: type, className: "o-button-content" })));
|
|
951
962
|
});
|
|
952
963
|
ButtonComponent.displayName = 'Button';
|
|
953
964
|
|
|
@@ -5275,7 +5286,7 @@ const VirtualItemWrapper = ({ virtualItem, listItem, ItemComponent = ListItemCom
|
|
|
5275
5286
|
} },
|
|
5276
5287
|
React.createElement("div", { ref: ref },
|
|
5277
5288
|
listItem?.loadingStatus === onekijsFramework.LoadingStatus.Loading && React.createElement(ItemLoadingComponent, null),
|
|
5278
|
-
listItem?.loadingStatus !== onekijsFramework.LoadingStatus.Loading && listItem && listItem.data && (React.createElement(ItemComponent, { key: `item-${listItem
|
|
5289
|
+
listItem?.loadingStatus !== onekijsFramework.LoadingStatus.Loading && listItem && listItem.data !== undefined && (React.createElement(ItemComponent, { key: `item-${listItem.uid || index}`, index: index, item: listItem, data: listItem.data, onClick: onItemClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ItemContentComponent: ItemContentComponent })))));
|
|
5279
5290
|
};
|
|
5280
5291
|
const VirtualListComponent = ({ items, ItemComponent = ListItemComponent$1, ItemLoadingComponent = LoadingItem$1, ItemContentComponent = ListItemContent, onItemClick, onItemMouseEnter, onItemMouseLeave, virtualItems, }) => {
|
|
5281
5292
|
return (React.createElement(React.Fragment, null, virtualItems.map((virtualItem) => {
|
|
@@ -6404,7 +6415,7 @@ let SelectService = class SelectService extends onekijsFramework.CollectionServi
|
|
|
6404
6415
|
this._clearOffset(query);
|
|
6405
6416
|
this.lastCheckQuery = query;
|
|
6406
6417
|
const filterDefaultItems = yield all(defaultItems.map((i) => call([this, this._filterItem], i, query, true)));
|
|
6407
|
-
const validDefaultValue = filterDefaultItems.filter((i) => i !== undefined && i.data).map((i) => i.data);
|
|
6418
|
+
const validDefaultValue = filterDefaultItems.filter((i) => i !== undefined && i.data !== undefined).map((i) => i.data);
|
|
6408
6419
|
const multiple = this.config && this.config.multiple ? this.config.multiple : false;
|
|
6409
6420
|
if (multiple) {
|
|
6410
6421
|
yield this._setValidDefaultValue(validDefaultValue);
|
|
@@ -6418,7 +6429,9 @@ let SelectService = class SelectService extends onekijsFramework.CollectionServi
|
|
|
6418
6429
|
: this.config.defaultValue === undefined ||
|
|
6419
6430
|
this.config.defaultValue === null ||
|
|
6420
6431
|
this.state.defaultValue === null
|
|
6421
|
-
? this.state.items[0]?.data
|
|
6432
|
+
? this.state.items[0]?.data === undefined
|
|
6433
|
+
? null
|
|
6434
|
+
: this.state.items[0].data
|
|
6422
6435
|
: null);
|
|
6423
6436
|
}
|
|
6424
6437
|
if (this.state.selected !== undefined) {
|
|
@@ -6445,7 +6458,8 @@ let SelectService = class SelectService extends onekijsFramework.CollectionServi
|
|
|
6445
6458
|
this.state.defaultValueLoading = loading;
|
|
6446
6459
|
}
|
|
6447
6460
|
setItemWidth(_item, value) {
|
|
6448
|
-
if (this.config?.dropdownWidthModifier === 'min' &&
|
|
6461
|
+
if (this.config?.dropdownWidthModifier === 'min' &&
|
|
6462
|
+
(this.state.width === undefined || value + 30 > this.state.width)) {
|
|
6449
6463
|
this.state.width = value + 30;
|
|
6450
6464
|
}
|
|
6451
6465
|
}
|
|
@@ -6904,7 +6918,7 @@ const SelectOptionComponent = (props) => {
|
|
|
6904
6918
|
if (onekijsFramework.isItemLoading(item)) {
|
|
6905
6919
|
return React.createElement(OptionLoadingComponent, null);
|
|
6906
6920
|
}
|
|
6907
|
-
if (!item ||
|
|
6921
|
+
if (!item || item.data === undefined)
|
|
6908
6922
|
return null;
|
|
6909
6923
|
return (React.createElement(React.Fragment, null,
|
|
6910
6924
|
displayGroup && React.createElement(OptionGroupComponent, { ...props, key: "group" }),
|
|
@@ -7202,7 +7216,7 @@ const ControlledSelectComponent = ({ attachDropdownToBody = false, className = '
|
|
|
7202
7216
|
}
|
|
7203
7217
|
}
|
|
7204
7218
|
}
|
|
7205
|
-
else if (!search && !nullable &&
|
|
7219
|
+
else if (!search && !nullable && (value === null || value === undefined) && service.state.validDefaultValue) {
|
|
7206
7220
|
onChange && onChange(service.state.validDefaultValue);
|
|
7207
7221
|
}
|
|
7208
7222
|
}
|
|
@@ -12163,7 +12177,7 @@ const baseTheme = (customTheme = {}) => {
|
|
|
12163
12177
|
'4xl': '2.25rem',
|
|
12164
12178
|
'5xl': '3rem',
|
|
12165
12179
|
'6xl': '4rem',
|
|
12166
|
-
default: '.
|
|
12180
|
+
default: '.875rem',
|
|
12167
12181
|
},
|
|
12168
12182
|
spacings: {
|
|
12169
12183
|
xs: '-0.05em',
|