sit-onyx 1.0.0-beta.255 → 1.0.0-beta.256

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.
@@ -1,14 +1,20 @@
1
- import type { ComputedRef } from "vue";
2
1
  import "./base.scss";
2
+ import type { BaseFeatureOptions } from "./types";
3
3
  export declare const BASE_FEATURE_SYMBOL: unique symbol;
4
- export type BaseFeatureOptions = {
5
- skeleton: ComputedRef<number | boolean>;
6
- };
4
+ export declare const BASE_MUTATION_ORDER: number;
7
5
  /**
8
6
  * The Base feature includes everything that should be provided as built-in functionality of the `OnyxDataGrid` component.
9
7
  */
10
- export declare const BASE_FEATURE: ({ skeleton }: import("..").DataGridFeatureContext) => {
8
+ export declare const BASE_FEATURE: (options?: BaseFeatureOptions) => ({ skeleton }: import("..").DataGridFeatureContext) => {
11
9
  readonly name: typeof BASE_FEATURE_SYMBOL;
10
+ readonly watch: [Readonly<import("vue").Ref<number | boolean, number | boolean>>, import("vue").ComputedRef<{
11
+ is: import("../../../OnyxHeadline/types.ts").HeadlineType;
12
+ showAs?: Exclude<import("../../../OnyxHeadline/types.ts").HeadlineType, "h5" | "h6">;
13
+ hash?: string;
14
+ skeleton?: import("../../../../composables/useSkeletonState.ts").SkeletonInjected;
15
+ text: string;
16
+ rowCount?: boolean | number;
17
+ } | undefined>];
12
18
  readonly modifyColumns: {
13
19
  readonly func: (columns: readonly import("..").InternalColumnConfig<any, any>[]) => import("..").InternalColumnConfig<any, any>[] | {
14
20
  type: {
@@ -23,12 +29,12 @@ export declare const BASE_FEATURE: ({ skeleton }: import("..").DataGridFeatureCo
23
29
  }[];
24
30
  };
25
31
  readonly mutation: {
32
+ readonly order: number;
26
33
  readonly func: (rows: Readonly<any>[]) => {}[];
27
34
  };
28
35
  readonly scrollContainerAttributes: () => {
29
36
  class: string;
30
37
  };
31
- readonly watch: [Readonly<import("vue").Ref<number | boolean, number | boolean>>];
32
38
  readonly typeRenderer: {
33
39
  readonly number: Readonly<import("..").TypeRenderer<import("../../types").DataGridEntry, import("../renderer").NumberCellOptions>>;
34
40
  readonly string: Readonly<import("..").TypeRenderer<import("../../types").DataGridEntry, import("../renderer").StringCellOptions>>;
@@ -38,4 +44,9 @@ export declare const BASE_FEATURE: ({ skeleton }: import("..").DataGridFeatureCo
38
44
  readonly timestamp: Readonly<import("..").TypeRenderer<import("../../types").DataGridEntry, import("../renderer").DateCellOptions>>;
39
45
  readonly skeleton: Readonly<import("..").TypeRenderer<import("../../types").DataGridEntry, import("../renderer").StringCellOptions>>;
40
46
  };
47
+ readonly slots: {
48
+ readonly headline: (slotContent: () => import("vue").VNode[]) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
49
+ [key: string]: any;
50
+ }>[];
51
+ };
41
52
  };
@@ -0,0 +1,8 @@
1
+ import type { MaybeRef } from "vue";
2
+ import type { DataGridHeadline } from "../../types";
3
+ export type BaseFeatureOptions = {
4
+ /**
5
+ * Optional headline to show.
6
+ */
7
+ headline?: Readonly<MaybeRef<string | DataGridHeadline>>;
8
+ };
@@ -36,7 +36,7 @@ export type TypeRenderMap<TEntry extends DataGridEntry, TKey extends PropertyKey
36
36
  /**
37
37
  * ColumnConfig as it can be defined by the user.
38
38
  */
39
- export type ColumnConfig<TEntry extends DataGridEntry, TColumnGroup extends ColumnGroupConfig = Record<string, never>, TTypes extends ColumnConfigTypeOption<PropertyKey, unknown> = never> = keyof TEntry | PublicNormalizedColumnConfig<TEntry, TColumnGroup, TTypes | RenderTypesFromFeature<[typeof BASE_FEATURE]>>;
39
+ export type ColumnConfig<TEntry extends DataGridEntry, TColumnGroup extends ColumnGroupConfig = Record<string, never>, TTypes extends ColumnConfigTypeOption<PropertyKey, unknown> = never> = keyof TEntry | PublicNormalizedColumnConfig<TEntry, TColumnGroup, TTypes | RenderTypesFromFeature<[ReturnType<typeof BASE_FEATURE>]>>;
40
40
  export type DefaultSupportedTypes = "string" | "number" | DatetimeFormat;
41
41
  /**
42
42
  * Configuration for the column groupings.
@@ -132,6 +132,8 @@ export type DataGridFeatureDescription<TEntry extends DataGridEntry, TTypeRender
132
132
  * Defines the order in which the mutation is handled.
133
133
  * This can be used to control the sequence of operations when multiple mutations are applied.
134
134
  *
135
+ * The higher the order, the earlier the mutation is applied.
136
+ *
135
137
  * @default 0
136
138
  */
137
139
  order?: number;
@@ -192,7 +194,7 @@ export type DataGridFeatureOptions<TEntry extends DataGridEntry, TColumnOptions
192
194
  *
193
195
  * @default true
194
196
  */
195
- enabled?: MaybeRef<boolean>;
197
+ enabled?: MaybeRef<boolean | undefined>;
196
198
  /**
197
199
  * Options for each column. Will override default/global options of the feature.
198
200
  */
@@ -6,9 +6,10 @@ export declare const LAZY_LOADING_ROW_ID: unique symbol;
6
6
  export declare const LAZY_LOADING_TYPE_RENDERER: unique symbol;
7
7
  export declare const BUTTON_LOADING_ROW_ID: unique symbol;
8
8
  export declare const BUTTON_LOADING_TYPE_RENDERER: unique symbol;
9
+ export declare const PAGINATION_MUTATION_ORDER: number;
9
10
  export declare const usePagination: (options?: PaginationOptions) => (ctx: import("..").DataGridFeatureContext) => {
10
11
  name: symbol;
11
- watch: (Readonly<Ref<number | boolean, number | boolean>> | import("vue").ComputedRef<(column?: PropertyKey) => boolean> | Ref<PaginationState, PaginationState>)[];
12
+ watch: (import("vue").ComputedRef<(column?: PropertyKey) => boolean> | Ref<PaginationState, PaginationState> | Readonly<Ref<number | boolean, number | boolean>>)[];
12
13
  mutation: {
13
14
  order: number;
14
15
  func: (entries: Readonly<any>[]) => Readonly<any>[];
@@ -4,9 +4,9 @@ import "./selection.scss";
4
4
  import type { SelectionOptions, SelectionState } from "./types";
5
5
  export declare const SELECTION_FEATURE: unique symbol;
6
6
  export declare const SELECTION_MUTATION_ORDER = 1000;
7
- export declare const useSelection: <TEntry extends DataGridEntry>(options?: SelectionOptions) => ({ i18n }: import("..").DataGridFeatureContext) => {
7
+ export declare const useSelection: <TEntry extends DataGridEntry>(options?: SelectionOptions) => (ctx: import("..").DataGridFeatureContext) => {
8
8
  name: symbol;
9
- watch: (Readonly<Ref<boolean, boolean>> | Ref<SelectionState, SelectionState>)[];
9
+ watch: (Readonly<Ref<boolean, boolean>> | import("vue").ComputedRef<(column?: PropertyKey) => boolean> | Ref<SelectionState, SelectionState>)[];
10
10
  modifyColumns: import("../../../../utils/feature.ts").SingleOrderableMapping<import("..").InternalColumnConfig<TEntry, any>[], import("..").InternalColumnConfig<TEntry, any>[], readonly import("..").InternalColumnConfig<TEntry, any>[]>;
11
11
  mutation: {
12
12
  func: (rows: Readonly<any>[]) => Readonly<any>[];
@@ -1,4 +1,5 @@
1
1
  import { type MaybeRef, type MaybeRefOrGetter } from "vue";
2
+ import type { DataGridFeatureOptions } from "..";
2
3
  import type { DataGridEntry } from "../../types";
3
4
  export type SelectionState = {
4
5
  /**
@@ -26,15 +27,11 @@ export type SelectionState = {
26
27
  /**
27
28
  * The options of the selection feature for the OnyxDataGrid component.
28
29
  */
29
- export type SelectionOptions = {
30
+ export type SelectionOptions = Pick<DataGridFeatureOptions<DataGridEntry, object>, "enabled"> & {
30
31
  /**
31
32
  * The currently active selection.
32
33
  */
33
34
  selectionState?: MaybeRef<SelectionState>;
34
- /**
35
- * If the row selection column is shown or not.
36
- */
37
- disabled?: MaybeRefOrGetter<boolean>;
38
35
  /**
39
36
  * If `true` the selection checkbox of a row will only be shown if the row is hovered or selected.
40
37
  */
@@ -1,6 +1,7 @@
1
1
  import type { SkeletonInjected } from "src/composables/useSkeletonState";
2
2
  import type { HTMLAttributes } from "vue";
3
3
  import type { IfExtends, IfNotEmpty, MaybePick, RecordValues, UnionByKey } from "../../types";
4
+ import type { OnyxHeadlineProps } from "../OnyxHeadline/types";
4
5
  import type { OnyxTableProps } from "../OnyxTable/types";
5
6
  import type { ColumnConfig, ColumnConfigTypeOption, ColumnGroupConfig, DataGridFeature, InternalColumnConfig, TypeRenderer, TypeRenderMap } from "./features";
6
7
  import type { BASE_FEATURE } from "./features/base/base";
@@ -20,7 +21,7 @@ export type RenderTypesFromFeature<TFeatures extends DataGridFeature<any, any, a
20
21
  * @experimental The DataGrid is still working in progress and the props will change in the future.
21
22
  */
22
23
  export type OnyxDataGridProps<TEntry extends DataGridEntry, TColumnGroup extends ColumnGroupConfig, TTypeRenderer extends TypeRenderMap<TEntry>, TFeatureName extends symbol, TFeatures extends DataGridFeature<TEntry, TTypeRenderer, TFeatureName>[] = never, TTypes extends ColumnConfigTypeOption<PropertyKey, unknown> = RenderTypesFromFeature<[
23
- typeof BASE_FEATURE,
24
+ ReturnType<typeof BASE_FEATURE>,
24
25
  ...TFeatures
25
26
  ]>> = {
26
27
  /**
@@ -51,6 +52,10 @@ export type OnyxDataGridProps<TEntry extends DataGridEntry, TColumnGroup extends
51
52
  * Whether to show skeleton rows. Can be set to `true` to use a pre-defined skeleton row count or you can pass a number to define a specific count.
52
53
  */
53
54
  skeleton?: SkeletonInjected;
55
+ /**
56
+ * Headline to display above the data grid.
57
+ */
58
+ headline?: string | DataGridHeadline;
54
59
  } & Omit<OnyxTableProps, "columnGroups" | "scrollContainerAttrs">;
55
60
  /**
56
61
  * "Raw" user data for a data grid entry/row, e.g. fetched from a backend service.
@@ -80,3 +85,14 @@ export type DataGridEntryOptions = {
80
85
  }>, "label">[];
81
86
  };
82
87
  export declare const DataGridRowOptionsSymbol: unique symbol;
88
+ export type DataGridHeadline = Partial<OnyxHeadlineProps> & {
89
+ /**
90
+ * Headline text.
91
+ */
92
+ text: string;
93
+ /**
94
+ * Optional row count to display. If set to `true`, the count will be determined automatically.
95
+ * Can also be set to a custom number (useful when e.g. using async pagination).
96
+ */
97
+ rowCount?: boolean | number;
98
+ };