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.
Files changed (45) hide show
  1. package/dist/components/list/DropdownList.d.ts +0 -1
  2. package/dist/components/list/components/ArrayListComponent.d.ts +0 -1
  3. package/dist/components/list/components/CollectionListComponent.d.ts +0 -1
  4. package/dist/components/list/components/ListBodyComponent.d.ts +0 -1
  5. package/dist/components/list/components/ListComponent.d.ts +0 -1
  6. package/dist/components/list/components/VirtualListComponent.d.ts +0 -1
  7. package/dist/components/list/index.d.ts +0 -1
  8. package/dist/components/select/FormSelect.d.ts +0 -1
  9. package/dist/components/select/components/ArraySelectComponent.d.ts +0 -1
  10. package/dist/components/select/components/ArrayTreeSelectComponent.d.ts +0 -1
  11. package/dist/components/select/components/ControlledSelectComponent.d.ts +0 -1
  12. package/dist/components/select/components/SelectComponent.d.ts +0 -1
  13. package/dist/components/select/components/SelectOptionComponent.d.ts +0 -1
  14. package/dist/components/select/components/SelectTokenComponent.d.ts +0 -1
  15. package/dist/components/select/components/SelectTokensComponent.d.ts +0 -1
  16. package/dist/components/select/components/TreeSelectComponent.d.ts +0 -1
  17. package/dist/components/select/components/TreeSelectOptionContent.d.ts +0 -1
  18. package/dist/components/select/typings.d.ts +3 -1
  19. package/dist/components/table/typings.d.ts +5 -1
  20. package/dist/components/tree/components/ArrayTreeComponent.d.ts +0 -1
  21. package/dist/components/tree/components/ControllerTreeComponent.d.ts +0 -1
  22. package/dist/components/tree/components/TreeBodyComponent.d.ts +0 -1
  23. package/dist/components/tree/components/TreeComponent.d.ts +0 -1
  24. package/dist/components/tree/components/TreeItemComponent.d.ts +0 -1
  25. package/dist/components/tree/components/TreeListComponent.d.ts +0 -1
  26. package/dist/components/tree/components/VirtualTreeBodyComponent.d.ts +0 -1
  27. package/dist/components/tree/components/VirtualTreeListComponent.d.ts +0 -1
  28. package/dist/components/tree/index.d.ts +0 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.js +94 -40
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.module.js +94 -40
  33. package/dist/index.module.js.map +1 -1
  34. package/dist/styles/size.d.ts +6 -6
  35. package/dist/styles/typography.d.ts +1 -1
  36. package/package.json +5 -5
  37. package/src/components/list/hooks/useListView.tsx +0 -1
  38. package/src/components/select/components/ControlledSelectComponent.tsx +73 -35
  39. package/src/components/select/components/SelectOptionComponent.tsx +18 -4
  40. package/src/components/select/typings.ts +7 -1
  41. package/src/components/table/components/cells/SelectCellComponent.tsx +3 -1
  42. package/src/components/table/typings.ts +15 -1
  43. package/src/components/wizard/style.ts +1 -0
  44. package/src/index.ts +3 -1
  45. package/src/vendor/reactVirtual.js +5 -1
@@ -4192,7 +4192,11 @@ function useVirtual({
4192
4192
  measurements: [],
4193
4193
  });
4194
4194
 
4195
- const { outerSize, scrollOffset, scrollToFn: defaultScrollToFn } = useScroll({
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, onMouseEnter: () => hoverable && onMouseEnter && item && onMouseEnter(item, index), onMouseLeave: () => hoverable && onMouseLeave && item && onMouseLeave(item, index), onClick: () => clickable && onClick && item && onClick(item, index) },
6117
- service.config?.multiple && (React.createElement(Checkbox, { value: item?.selected ? true : false, onChange: () => clickable && onClick && item && onClick(item, index), color: "currentColor", className: "o-select-option-multiple-checkbox" })),
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
- attachDropdownToBody,
6144
- className,
6145
- placeholder,
6146
- InputComponent,
6147
- IconComponent,
6148
- OptionContentComponent,
6149
- OptionComponent,
6150
- OptionLoadingComponent,
6151
- MultiOptionsComponent,
6152
- NotFoundComponent,
6153
- autoFocus,
6154
- value,
6155
- onChange,
6156
- onBlur: forwardBlur,
6157
- onFocus: forwardFocus,
6158
- height,
6159
- multiple,
6160
- status,
6161
- size,
6162
- nullable,
6163
- minChars,
6164
- openOnFocus,
6165
- searchable,
6166
- clickable,
6167
- dropdownWidthModifier,
6168
- preload,
6169
- increment,
6170
- animationMs,
6171
- disabled,
6172
- defaultValue,
6173
- sameWidth,
6174
- overscan,
6175
- autoCompleteSearch,
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(FormSelect$1, { size: "small", layout: "table", ...options, name: name, className: addClassname('o-table-select', className), controller: controller }));
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