onekijs-ui 0.16.0 → 0.16.2
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/list/DropdownList.d.ts +0 -1
- package/dist/components/list/components/ArrayListComponent.d.ts +0 -1
- package/dist/components/list/components/CollectionListComponent.d.ts +0 -1
- package/dist/components/list/components/ListBodyComponent.d.ts +0 -1
- package/dist/components/list/components/ListComponent.d.ts +0 -1
- package/dist/components/list/components/VirtualListComponent.d.ts +0 -1
- package/dist/components/list/index.d.ts +0 -1
- package/dist/components/select/FormSelect.d.ts +0 -1
- package/dist/components/select/components/ArraySelectComponent.d.ts +0 -1
- package/dist/components/select/components/ArrayTreeSelectComponent.d.ts +0 -1
- package/dist/components/select/components/ControlledSelectComponent.d.ts +0 -1
- package/dist/components/select/components/SelectComponent.d.ts +0 -1
- package/dist/components/select/components/SelectOptionComponent.d.ts +0 -1
- package/dist/components/select/components/SelectTokenComponent.d.ts +0 -1
- package/dist/components/select/components/SelectTokensComponent.d.ts +0 -1
- package/dist/components/select/components/TreeSelectComponent.d.ts +0 -1
- package/dist/components/select/components/TreeSelectOptionContent.d.ts +0 -1
- package/dist/components/select/typings.d.ts +3 -1
- package/dist/components/table/typings.d.ts +5 -1
- package/dist/components/tree/components/ArrayTreeComponent.d.ts +0 -1
- package/dist/components/tree/components/ControllerTreeComponent.d.ts +0 -1
- package/dist/components/tree/components/TreeBodyComponent.d.ts +0 -1
- package/dist/components/tree/components/TreeComponent.d.ts +0 -1
- package/dist/components/tree/components/TreeItemComponent.d.ts +0 -1
- package/dist/components/tree/components/TreeListComponent.d.ts +0 -1
- package/dist/components/tree/components/VirtualTreeBodyComponent.d.ts +0 -1
- package/dist/components/tree/components/VirtualTreeListComponent.d.ts +0 -1
- package/dist/components/tree/index.d.ts +0 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +94 -40
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +94 -40
- package/dist/index.module.js.map +1 -1
- package/dist/styles/size.d.ts +6 -6
- package/dist/styles/typography.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/list/hooks/useListView.tsx +0 -1
- package/src/components/select/components/ControlledSelectComponent.tsx +73 -35
- package/src/components/select/components/SelectOptionComponent.tsx +18 -4
- package/src/components/select/typings.ts +7 -1
- package/src/components/table/components/cells/SelectCellComponent.tsx +3 -1
- package/src/components/table/typings.ts +15 -1
- package/src/components/wizard/style.ts +1 -0
- package/src/index.ts +3 -1
- package/src/vendor/reactVirtual.js +5 -1
package/dist/index.module.js
CHANGED
|
@@ -4192,7 +4192,11 @@ function useVirtual({
|
|
|
4192
4192
|
measurements: [],
|
|
4193
4193
|
});
|
|
4194
4194
|
|
|
4195
|
-
const {
|
|
4195
|
+
const {
|
|
4196
|
+
outerSize,
|
|
4197
|
+
scrollOffset,
|
|
4198
|
+
scrollToFn: defaultScrollToFn,
|
|
4199
|
+
} = useScroll({
|
|
4196
4200
|
windowRef,
|
|
4197
4201
|
parentRef,
|
|
4198
4202
|
horizontal,
|
|
@@ -6106,6 +6110,15 @@ const SelectOptionComponent = (props) => {
|
|
|
6106
6110
|
}
|
|
6107
6111
|
return classNames.join(' ');
|
|
6108
6112
|
}, [item, clickable, hoverable]);
|
|
6113
|
+
const fixClickRef = useRef({
|
|
6114
|
+
mouseDown: '',
|
|
6115
|
+
clicked: false,
|
|
6116
|
+
});
|
|
6117
|
+
const onItemClick = useCallback((item, index) => {
|
|
6118
|
+
if (!fixClickRef.current.clicked) {
|
|
6119
|
+
clickable && onClick && item && onClick(item, index);
|
|
6120
|
+
}
|
|
6121
|
+
}, [clickable, onClick]);
|
|
6109
6122
|
if (isItemLoading(item)) {
|
|
6110
6123
|
return React.createElement(OptionLoadingComponent, null);
|
|
6111
6124
|
}
|
|
@@ -6113,9 +6126,9 @@ const SelectOptionComponent = (props) => {
|
|
|
6113
6126
|
return null;
|
|
6114
6127
|
return (React.createElement(React.Fragment, null,
|
|
6115
6128
|
displayGroup && React.createElement(OptionGroupComponent, { ...props }),
|
|
6116
|
-
React.createElement("div", { className: classNames,
|
|
6117
|
-
service.config?.multiple && (React.createElement(Checkbox, { value: item?.selected ? true : false, onChange: () =>
|
|
6118
|
-
React.createElement(OptionContentComponent, { ...props }))));
|
|
6129
|
+
React.createElement("div", { className: classNames, onClick: () => onItemClick(item, index), onMouseEnter: () => hoverable && onMouseEnter && item && onMouseEnter(item, index), onMouseLeave: () => hoverable && onMouseLeave && item && onMouseLeave(item, index) },
|
|
6130
|
+
service.config?.multiple && (React.createElement(Checkbox, { value: item?.selected ? true : false, onChange: () => onItemClick(item, index), color: "currentColor", className: "o-select-option-multiple-checkbox" })),
|
|
6131
|
+
React.createElement(OptionContentComponent, { ...props, onClick: () => onItemClick(item, index) }))));
|
|
6119
6132
|
};
|
|
6120
6133
|
SelectOptionComponent.displayName = 'SelectOptionComponent';
|
|
6121
6134
|
var SelectOptionComponent$1 = React.memo(SelectOptionComponent);
|
|
@@ -6139,41 +6152,80 @@ const ControlledSelectComponent = ({ attachDropdownToBody = false, className = '
|
|
|
6139
6152
|
const [focus, setFocus] = useState(false);
|
|
6140
6153
|
const stateRef = useRef({});
|
|
6141
6154
|
const service = controller.asService();
|
|
6142
|
-
service.config
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6155
|
+
if (!service.config) {
|
|
6156
|
+
service.config = {
|
|
6157
|
+
attachDropdownToBody,
|
|
6158
|
+
className,
|
|
6159
|
+
placeholder,
|
|
6160
|
+
InputComponent,
|
|
6161
|
+
IconComponent,
|
|
6162
|
+
OptionContentComponent,
|
|
6163
|
+
OptionComponent,
|
|
6164
|
+
OptionLoadingComponent,
|
|
6165
|
+
MultiOptionsComponent,
|
|
6166
|
+
NotFoundComponent,
|
|
6167
|
+
autoFocus,
|
|
6168
|
+
value,
|
|
6169
|
+
onChange,
|
|
6170
|
+
onBlur: forwardBlur,
|
|
6171
|
+
onFocus: forwardFocus,
|
|
6172
|
+
height,
|
|
6173
|
+
multiple,
|
|
6174
|
+
status,
|
|
6175
|
+
size,
|
|
6176
|
+
nullable,
|
|
6177
|
+
minChars,
|
|
6178
|
+
openOnFocus,
|
|
6179
|
+
searchable,
|
|
6180
|
+
clickable,
|
|
6181
|
+
dropdownWidthModifier,
|
|
6182
|
+
preload,
|
|
6183
|
+
increment,
|
|
6184
|
+
animationMs,
|
|
6185
|
+
disabled,
|
|
6186
|
+
defaultValue,
|
|
6187
|
+
sameWidth,
|
|
6188
|
+
overscan,
|
|
6189
|
+
autoCompleteSearch,
|
|
6190
|
+
};
|
|
6191
|
+
}
|
|
6192
|
+
else {
|
|
6193
|
+
service.config = {
|
|
6194
|
+
attachDropdownToBody,
|
|
6195
|
+
className,
|
|
6196
|
+
placeholder,
|
|
6197
|
+
InputComponent: service.config.InputComponent,
|
|
6198
|
+
IconComponent: service.config.IconComponent,
|
|
6199
|
+
OptionContentComponent: service.config.OptionContentComponent,
|
|
6200
|
+
OptionComponent: service.config.OptionComponent,
|
|
6201
|
+
OptionLoadingComponent: service.config.OptionLoadingComponent,
|
|
6202
|
+
MultiOptionsComponent: service.config.MultiOptionsComponent,
|
|
6203
|
+
NotFoundComponent: service.config.NotFoundComponent,
|
|
6204
|
+
autoFocus,
|
|
6205
|
+
value,
|
|
6206
|
+
onChange,
|
|
6207
|
+
onBlur: forwardBlur,
|
|
6208
|
+
onFocus: forwardFocus,
|
|
6209
|
+
height,
|
|
6210
|
+
multiple,
|
|
6211
|
+
status,
|
|
6212
|
+
size,
|
|
6213
|
+
nullable,
|
|
6214
|
+
minChars,
|
|
6215
|
+
openOnFocus,
|
|
6216
|
+
searchable,
|
|
6217
|
+
clickable,
|
|
6218
|
+
dropdownWidthModifier,
|
|
6219
|
+
preload,
|
|
6220
|
+
increment,
|
|
6221
|
+
animationMs,
|
|
6222
|
+
disabled,
|
|
6223
|
+
defaultValue,
|
|
6224
|
+
sameWidth,
|
|
6225
|
+
overscan,
|
|
6226
|
+
autoCompleteSearch,
|
|
6227
|
+
};
|
|
6228
|
+
}
|
|
6177
6229
|
const id = useId();
|
|
6178
6230
|
const loading = isCollectionLoading(controller);
|
|
6179
6231
|
const fetching = isCollectionFetching(controller);
|
|
@@ -9859,13 +9911,14 @@ const SelectCellComponent = (options, broker) => {
|
|
|
9859
9911
|
// if the id is empty, it's a single table column and the value is the row itself
|
|
9860
9912
|
const name = column.id ? `${tableName}.${rowIndex}.${column.id}` : `${tableName}.${rowIndex}`;
|
|
9861
9913
|
const className = typeof options.className === 'function' ? options.className(item, column, rowIndex) : options.className;
|
|
9914
|
+
const Component = options.Component ?? FormSelect$1;
|
|
9862
9915
|
useEffect(() => {
|
|
9863
9916
|
broker.addSubscriber(name, service);
|
|
9864
9917
|
return () => {
|
|
9865
9918
|
broker.removeSubscriber(name);
|
|
9866
9919
|
};
|
|
9867
9920
|
}, [name, service]);
|
|
9868
|
-
return (React.createElement(
|
|
9921
|
+
return (React.createElement(Component, { size: "small", layout: "table", ...options, name: name, className: addClassname('o-table-select', className), controller: controller }));
|
|
9869
9922
|
};
|
|
9870
9923
|
SelectCellComponent.displayName = 'SelectCellComponent';
|
|
9871
9924
|
return SelectCellComponent;
|
|
@@ -10475,6 +10528,7 @@ const wizardStyle = ({ layout = 'vertical', theme, inModal }) => {
|
|
|
10475
10528
|
.o-wizard-content {
|
|
10476
10529
|
${flexGrow(1)}
|
|
10477
10530
|
${padding('lg')}
|
|
10531
|
+
${paddingBottom(0)}
|
|
10478
10532
|
${paddingRight('3xl')}
|
|
10479
10533
|
}
|
|
10480
10534
|
|