onekijs-ui 0.18.2 → 0.19.1

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 (58) hide show
  1. package/dist/components/accordion/AccordionService.d.ts +2 -1
  2. package/dist/components/accordion/components/AccordionComponent.d.ts +1 -1
  3. package/dist/components/accordion/hooks/useAccordionPanel.d.ts +1 -1
  4. package/dist/components/accordion/index.d.ts +1 -1
  5. package/dist/components/accordion/typings.d.ts +5 -3
  6. package/dist/components/button/typings.d.ts +1 -0
  7. package/dist/components/icon/RefreshIcon.d.ts +4 -0
  8. package/dist/components/list/components/CollectionListComponent.d.ts +1 -1
  9. package/dist/components/list/components/ListBodyComponent.d.ts +1 -1
  10. package/dist/components/list/components/LoadingItem.d.ts +1 -0
  11. package/dist/components/list/components/VirtualListComponent.d.ts +1 -1
  12. package/dist/components/table/components/TableActionComponent.d.ts +3 -0
  13. package/dist/components/table/components/TableLoadingComponent.d.ts +1 -1
  14. package/dist/components/table/components/TableLoadingRowComponent.d.ts +2 -1
  15. package/dist/components/table/typings.d.ts +5 -0
  16. package/dist/index.js +193 -63
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.module.js +193 -63
  19. package/dist/index.module.js.map +1 -1
  20. package/dist/styles/border.d.ts +1 -1
  21. package/dist/styles/size.d.ts +6 -6
  22. package/dist/styles/typings.d.ts +21 -7
  23. package/dist/styles/typography.d.ts +2 -2
  24. package/package.json +3 -3
  25. package/src/components/accordion/AccordionService.ts +21 -6
  26. package/src/components/accordion/components/AccordionComponent.tsx +2 -2
  27. package/src/components/accordion/components/AccordionPanel.tsx +6 -3
  28. package/src/components/accordion/hooks/useAccordionPanel.ts +2 -2
  29. package/src/components/accordion/index.ts +1 -1
  30. package/src/components/accordion/style.ts +2 -2
  31. package/src/components/accordion/typings.ts +5 -3
  32. package/src/components/button/style.ts +16 -7
  33. package/src/components/button/typings.ts +1 -0
  34. package/src/components/card/components/CardTitle.tsx +1 -1
  35. package/src/components/card/style.ts +2 -0
  36. package/src/components/card/typings.ts +2 -2
  37. package/src/components/icon/RefreshIcon.tsx +41 -0
  38. package/src/components/list/components/CollectionListComponent.tsx +1 -1
  39. package/src/components/list/components/ListBodyComponent.tsx +18 -5
  40. package/src/components/list/components/LoadingItem.tsx +4 -2
  41. package/src/components/list/components/VirtualListComponent.tsx +2 -2
  42. package/src/components/list/hooks/useListView.tsx +4 -1
  43. package/src/components/notifications/components/NotificationsComponent.tsx +7 -1
  44. package/src/components/notifications/style.ts +13 -2
  45. package/src/components/properties/style.ts +2 -0
  46. package/src/components/select/components/SelectOptionComponent.tsx +4 -2
  47. package/src/components/table/components/ControllerTableComponent.tsx +38 -19
  48. package/src/components/table/components/FormTableComponent.tsx +3 -3
  49. package/src/components/table/components/TableActionComponent.tsx +22 -0
  50. package/src/components/table/components/TableBodyComponent.tsx +12 -4
  51. package/src/components/table/components/TableBodyRowComponent.tsx +15 -14
  52. package/src/components/table/components/TableLoadingComponent.tsx +1 -1
  53. package/src/components/table/components/TableLoadingRowComponent.tsx +7 -3
  54. package/src/components/table/style.ts +16 -1
  55. package/src/components/table/typings.ts +5 -0
  56. package/src/index.ts +2 -0
  57. package/src/styles/typings.ts +21 -7
  58. package/src/theme/base.tsx +21 -7
@@ -1,7 +1,8 @@
1
1
  import { DefaultService } from 'onekijs-framework';
2
2
  import { AccordionState } from './typings';
3
3
  export declare class AccordionService extends DefaultService<AccordionState> {
4
- initPanel(uid: string, initialActive?: boolean): void;
4
+ initPanel(uid: string, initialActive?: boolean, initialExpand?: boolean): void;
5
+ activate(uid: string): void;
5
6
  collapse(uid: string): void;
6
7
  expand(uid: string): void;
7
8
  }
@@ -5,7 +5,7 @@ import { AccordionProps } from '../typings';
5
5
  *
6
6
  * @example
7
7
  * ```tsx
8
- * <AccordionComponent multiActive="true" />
8
+ * <AccordionComponent multiExpand="true" />
9
9
  * ```
10
10
  *
11
11
  * @group Accordion
@@ -1,3 +1,3 @@
1
1
  import { AccordionPanelState } from '../typings';
2
- declare const useAccordionPanel: (initialActive?: boolean) => AccordionPanelState | undefined;
2
+ declare const useAccordionPanel: (initialActive?: boolean, initialExpand?: boolean) => AccordionPanelState | undefined;
3
3
  export default useAccordionPanel;
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @example
8
8
  * ```tsx
9
- * <Accordion multiActive="false" />
9
+ * <Accordion multiExpand="false" />
10
10
  * ```
11
11
  *
12
12
  * @see AccordionComponent
@@ -1,6 +1,7 @@
1
1
  import { AnonymousObject, AnyFunction, FCC } from 'onekijs-framework';
2
2
  export type AccordionPanelProps<T = string> = {
3
3
  initialActive?: boolean;
4
+ initialExpand?: boolean;
4
5
  title: T;
5
6
  Component?: FCC<AccordionPanelTitleProps<T>>;
6
7
  link?: string;
@@ -16,6 +17,7 @@ export type AccordionPanelState = {
16
17
  uid: string;
17
18
  collapsing?: boolean;
18
19
  expanding?: boolean;
20
+ expanded?: boolean;
19
21
  };
20
22
  /**
21
23
  * @group Accordion
@@ -34,14 +36,14 @@ export type AccordionProps = {
34
36
  /**
35
37
  * @defaultValue false
36
38
  */
37
- multiActive?: boolean;
39
+ multiExpand?: boolean;
38
40
  /**
39
41
  * @defaultValue 150
40
42
  */
41
43
  animate?: number;
42
44
  /**
43
45
  * push means that the height of the accordion panel is derived from the height of its content
44
- * pushToBottom means that the height of the accordion panel is the remaining space given by the accordion's container after removing the space taken by the other accordion panel titles (do not work if multiActive is true)
46
+ * pushToBottom means that the height of the accordion panel is the remaining space given by the accordion's container after removing the space taken by the other accordion panel titles (do not work if multiExpand is true)
45
47
  *
46
48
  * @defaultValue push
47
49
  */
@@ -49,7 +51,7 @@ export type AccordionProps = {
49
51
  };
50
52
  export type AccordionState = {
51
53
  panels: AnonymousObject<AccordionPanelState>;
52
- multiActive?: boolean;
54
+ multiExpand?: boolean;
53
55
  animate: number;
54
56
  mode?: 'push' | 'pushToBottom';
55
57
  };
@@ -7,6 +7,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
7
7
  pattern?: 'solid' | 'outline' | 'flat';
8
8
  IconComponent?: React.FC<ButtonProps>;
9
9
  loading?: boolean;
10
+ size?: 'small' | 'medium' | 'large';
10
11
  }
11
12
  export interface SubmitButtonProps extends ButtonProps {
12
13
  showErrors?: boolean;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IconProps } from './typings';
3
+ declare const _default: import("styled-components").StyledComponent<React.FC<IconProps>, import("styled-components").DefaultTheme, {}, never>;
4
+ export default _default;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { CollectionListProps, ListItem } from '../typings';
3
- declare const CollectionListComponent: <T = any, I extends ListItem<T> = ListItem<T>>({ autoRefresh, className, controller, follow, height, ItemComponent, ItemLoadingComponent, ItemContentComponent, NotFoundComponent, itemHeight, preload, keyboardNavigable, increment, multiSelect, onItemActivate, onItemHighlight, onItemSelect, onItemDeactivate, onItemUnhighlight, onItemUnselect, paddingEnd, paddingStart, virtual, style, tail, }: CollectionListProps<T, I>) => React.JSX.Element;
3
+ declare const CollectionListComponent: <T extends unknown = any, I extends ListItem<T> = ListItem<T>>({ autoRefresh, className, controller, follow, height, ItemComponent, ItemLoadingComponent, ItemContentComponent, NotFoundComponent, itemHeight, preload, keyboardNavigable, increment, multiSelect, onItemActivate, onItemHighlight, onItemSelect, onItemDeactivate, onItemUnhighlight, onItemUnselect, paddingEnd, paddingStart, virtual, style, tail, }: CollectionListProps<T, I>) => React.JSX.Element;
4
4
  export default CollectionListComponent;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ListBodyProps, ListItem } from '../typings';
3
- declare const ListBodyComponent: <T = any, I extends ListItem<T> = ListItem<T>>({ autoRefresh, bodyRef, className, follow, height, items, ItemComponent, ItemLoadingComponent, ItemContentComponent, NotFoundComponent, keyboardNavigable, ListComponent, multiSelect, onItemActivate, onItemDeactivate, onItemSelect, onItemUnselect, onItemHighlight, onItemUnhighlight, parentRef, scrollToIndex, service, state, style, tail, totalSize, virtualItems, VirtualListComponent, LoadingComponent, }: ListBodyProps<T, I>) => React.JSX.Element | null;
3
+ declare const ListBodyComponent: <T extends unknown = any, I extends ListItem<T> = ListItem<T>>({ autoRefresh, bodyRef, className, follow, height, items, ItemComponent, ItemLoadingComponent, ItemContentComponent, NotFoundComponent, keyboardNavigable, ListComponent, multiSelect, onItemActivate, onItemDeactivate, onItemSelect, onItemUnselect, onItemHighlight, onItemUnhighlight, parentRef, scrollToIndex, service, state, style, tail, totalSize, virtualItems, VirtualListComponent, LoadingComponent, }: ListBodyProps<T, I>) => React.JSX.Element | null;
4
4
  export default ListBodyComponent;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  declare const _default: import("styled-components").StyledComponent<React.FC<{
3
3
  className?: string | undefined;
4
+ minHeight?: number | undefined;
4
5
  }>, import("styled-components").DefaultTheme, {}, never>;
5
6
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ListItem, VirtualListProps } from '../typings';
3
- declare const VirtualListComponent: <T = any, I extends ListItem<T> = ListItem<T>>({ items, ItemComponent, ItemLoadingComponent, ItemContentComponent, onItemClick, onItemMouseEnter, onItemMouseLeave, virtualItems, }: VirtualListProps<T, I>) => React.JSX.Element;
3
+ declare const VirtualListComponent: <T extends unknown = any, I extends ListItem<T> = ListItem<T>>({ items, ItemComponent, ItemLoadingComponent, ItemContentComponent, onItemClick, onItemMouseEnter, onItemMouseLeave, virtualItems, }: VirtualListProps<T, I>) => React.JSX.Element;
4
4
  export default VirtualListComponent;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const TableActionComponent: React.FC;
3
+ export default TableActionComponent;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: import("styled-components").StyledComponent<React.FC<React.InputHTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
2
+ declare const _default: import("styled-components").StyledComponent<React.FC<{}>, import("styled-components").DefaultTheme, {}, never>;
3
3
  export default _default;
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- declare const _default: import("styled-components").StyledComponent<React.FC<React.InputHTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
2
+ import { TableBodyRowProps } from '../typings';
3
+ declare const _default: import("styled-components").StyledComponent<React.FC<TableBodyRowProps>, import("styled-components").DefaultTheme, {}, never>;
3
4
  export default _default;
@@ -8,6 +8,7 @@ import { ListItemProps, ListItems, ListNotFoundProps, ListState, UseListOptions
8
8
  import { FormSelectProps, SelectBroker, SelectItem, SelectProps } from '../select/typings';
9
9
  import { TextareaProps } from '../textarea/typings';
10
10
  import TableService from './TableService';
11
+ import { ButtonProps } from '../button/typings';
11
12
  export type ArrayTableProps<T = any, I extends TableItem<T> = TableItem<T>> = TableConfig<T, I> & {
12
13
  adapter?: TableItemAdapter<T>;
13
14
  columns?: TableColumn<T, I>[];
@@ -68,6 +69,7 @@ export type TableBodyRowProps<T = any, I extends TableItem<T> = TableItem<T>> =
68
69
  onCollapsed?: (item: I | undefined, index: number) => void;
69
70
  };
70
71
  export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
72
+ ActionComponent?: React.FC;
71
73
  autoRefresh?: number;
72
74
  bodyClassName?: string;
73
75
  BodyComponent?: React.FC<TableBodyProps<T, I>>;
@@ -87,6 +89,7 @@ export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
87
89
  height?: string | number;
88
90
  highlightRow?: boolean;
89
91
  increment?: number;
92
+ itemHeight?: number | ((index: number) => number);
90
93
  LoadingComponent?: React.FC;
91
94
  LoadingRowComponent?: React.FC;
92
95
  NotFoundComponent?: React.FC<TableNotFoundProps> | null;
@@ -101,6 +104,8 @@ export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
101
104
  preload?: number;
102
105
  rowClassName?: string | ((item: I | undefined, rowIndex: number, columns: TableColumn<T, I>[]) => string);
103
106
  RowComponent?: React.FC<TableBodyRowProps<T, I>>;
107
+ refreshButtonKind?: ButtonProps['kind'];
108
+ showRefreshButton?: boolean;
104
109
  sortable?: boolean;
105
110
  stripRows?: boolean;
106
111
  tail?: boolean;