sit-onyx 1.0.0-beta.68 → 1.0.0-beta.69
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/OnyxDataGrid/features/all.d.ts +1 -1
- package/dist/components/OnyxDataGrid/features/index.d.ts +1 -1
- package/dist/components/OnyxDataGrid/features/sorting/TestCase.vue.d.ts +9 -0
- package/dist/components/OnyxDataGrid/features/sorting/sorting.d.ts +2 -3
- package/dist/components/OnyxDataGrid/types.d.ts +2 -17
- package/dist/components/OnyxTabs/types.d.ts +11 -0
- package/dist/components/examples/DataGrid/SortingDataGrid.vue.d.ts +21 -4
- package/dist/index.cjs +2 -2
- package/dist/index.js +214 -205
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/styles/mixins/input.scss +1 -1
- package/src/styles/mixins/list.scss +1 -1
- package/src/styles/mixins/sizes.scss +27 -0
- package/src/styles/root.scss +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./sorting/types";
|
|
2
|
-
export {
|
|
2
|
+
export { useSorting } from "./sorting/sorting";
|
|
@@ -51,7 +51,7 @@ export type DataGridFeature<TEntry extends DataGridEntry, TFeatureName extends s
|
|
|
51
51
|
* });
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
export declare function createFeature<TFeatureName extends symbol, TArgs extends unknown[]>(featureDefinition:
|
|
54
|
+
export declare function createFeature<TEntry extends DataGridEntry, TFeatureName extends symbol, TArgs extends unknown[]>(featureDefinition: (...args: TArgs) => DataGridFeature<TEntry, TFeatureName>): (...args: TArgs) => DataGridFeature<TEntry, TFeatureName>;
|
|
55
55
|
/**
|
|
56
56
|
* Uses the defined datagrid features to provide factory functions.
|
|
57
57
|
* These factories are to be used to map data and configuration to `OnyxDataGridRenderer` properties.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DataGridEntry, OnyxDataGridProps } from "../../../..";
|
|
2
|
+
import { DataGridFeatures } from "../../../..";
|
|
3
|
+
type __VLS_Props = Pick<OnyxDataGridProps, "columns" | "data">;
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
sortChange: (sortState: DataGridFeatures.SortState<DataGridEntry>) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
onSortChange?: ((sortState: DataGridFeatures.SortState<DataGridEntry>) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DataGridEntry } from "../../types";
|
|
2
|
-
import type { SortDirection, SortOptions
|
|
2
|
+
import type { SortDirection, SortOptions } from "./types";
|
|
3
3
|
export declare const nextSortDirection: (current?: SortDirection) => SortDirection;
|
|
4
|
-
export declare const nextSortState: <TEntry extends DataGridEntry>(column: keyof TEntry, current?: SortState<TEntry>) => SortState<TEntry>;
|
|
5
4
|
export declare const SORTING_FEATURE: unique symbol;
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const useSorting: <TEntry extends DataGridEntry>(options?: SortOptions<TEntry> | undefined) => import("..").DataGridFeature<TEntry, typeof SORTING_FEATURE>;
|
|
@@ -7,23 +7,8 @@ export type OnyxDataGridProps<TEntry extends DataGridEntry = DataGridEntry, TFea
|
|
|
7
7
|
/**
|
|
8
8
|
* Features that should be applied.
|
|
9
9
|
* They allow the modification of the behavior and rendering.
|
|
10
|
-
* Usually you want to use the provided features of the exported `DataGridFeature` namespace
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```vue
|
|
14
|
-
* <script setup lang="ts">
|
|
15
|
-
* import { ref, watch } from "vue";
|
|
16
|
-
* import type { DataGridEntry, OnyxDataGridProps } from "sit-onyx";
|
|
17
|
-
* import { DataGridFeatures, OnyxDataGrid } from "sit-onyx";
|
|
18
|
-
*
|
|
19
|
-
* const withSorting = DataGridFeatures.useSorting(sortOptions);
|
|
20
|
-
* </script>
|
|
21
|
-
*
|
|
22
|
-
* <template>
|
|
23
|
-
* <OnyxDataGrid :columns :data :features=[withSorting] />
|
|
24
|
-
* </template>
|
|
25
|
-
*
|
|
26
|
-
* ```
|
|
10
|
+
* Usually you want to use the provided features of the exported `DataGridFeature` namespace.
|
|
11
|
+
* Check the Storybook examples (e.g. [Sorting](/?path=/story/data-datagrid-features--sorting)) for more details on how the features are used and configured.
|
|
27
12
|
*/
|
|
28
13
|
features?: TFeatures;
|
|
29
14
|
/**
|
|
@@ -2,6 +2,7 @@ import type { createTabs } from "@sit-onyx/headless";
|
|
|
2
2
|
import type { InjectionKey, Ref } from "vue";
|
|
3
3
|
import type { DensityProp } from "../../composables/density";
|
|
4
4
|
import type { SkeletonProvidedProp } from "../../composables/useSkeletonState";
|
|
5
|
+
import type { HeadlineType } from "../OnyxHeadline/types";
|
|
5
6
|
export type OnyxTabsProps<TValue extends PropertyKey = PropertyKey> = DensityProp & Partial<SkeletonProvidedProp> & {
|
|
6
7
|
/**
|
|
7
8
|
* Label of the tabs. Needed for accessibility / screen readers.
|
|
@@ -15,6 +16,11 @@ export type OnyxTabsProps<TValue extends PropertyKey = PropertyKey> = DensityPro
|
|
|
15
16
|
* If `true`, the tabs will be stretched to the full available width.
|
|
16
17
|
*/
|
|
17
18
|
stretched?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Tab font size. Note: This only affects the visual size of the tab font and has NO effect on the semantic meaning.
|
|
21
|
+
* Size will be aligned with the corresponding `OnyxHeadline` size.
|
|
22
|
+
*/
|
|
23
|
+
size?: TabSize;
|
|
18
24
|
};
|
|
19
25
|
export type TabsInjectionKey<TValue extends PropertyKey = PropertyKey> = InjectionKey<{
|
|
20
26
|
/**
|
|
@@ -26,9 +32,14 @@ export type TabsInjectionKey<TValue extends PropertyKey = PropertyKey> = Injecti
|
|
|
26
32
|
* to maintain the correct HTML structure.
|
|
27
33
|
*/
|
|
28
34
|
panelRef: Ref<HTMLElement | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Tab size passed down from the parent so it can be set once for all tabs.
|
|
37
|
+
*/
|
|
38
|
+
size: Ref<TabSize>;
|
|
29
39
|
}>;
|
|
30
40
|
/**
|
|
31
41
|
* Injection key to provide relevant context data from the tabs parent to the
|
|
32
42
|
* individual child tab components.
|
|
33
43
|
*/
|
|
34
44
|
export declare const TABS_INJECTION_KEY: TabsInjectionKey;
|
|
45
|
+
export type TabSize = Extract<HeadlineType, "h2" | "h3" | "h4">;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import type { DataGridEntry, OnyxDataGridProps } from "../../..";
|
|
2
1
|
import { DataGridFeatures } from "../../..";
|
|
3
|
-
type
|
|
2
|
+
import type { SortOptions } from "../../OnyxDataGrid/features/sorting/types";
|
|
3
|
+
type TEntry = (typeof data)[number];
|
|
4
|
+
type __VLS_Props = SortOptions<TEntry>;
|
|
5
|
+
declare const data: {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
rank: number;
|
|
9
|
+
birthday: Date;
|
|
10
|
+
}[];
|
|
4
11
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
-
|
|
12
|
+
"update:sortState": (data: DataGridFeatures.SortState<{
|
|
13
|
+
id: number;
|
|
14
|
+
name: string;
|
|
15
|
+
rank: number;
|
|
16
|
+
birthday: Date;
|
|
17
|
+
}>) => any;
|
|
6
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
-
|
|
19
|
+
"onUpdate:sortState"?: ((data: DataGridFeatures.SortState<{
|
|
20
|
+
id: number;
|
|
21
|
+
name: string;
|
|
22
|
+
rank: number;
|
|
23
|
+
birthday: Date;
|
|
24
|
+
}>) => any) | undefined;
|
|
8
25
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
26
|
export default _default;
|