sit-onyx 1.0.0-beta.67 → 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/OnyxDataGrid.vue.d.ts +1 -1
- 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/features/sorting/types.d.ts +2 -2
- package/dist/components/OnyxDataGrid/types.d.ts +3 -0
- package/dist/components/OnyxTab/OnyxTab.vue.d.ts +4 -1
- package/dist/components/OnyxTab/types.d.ts +9 -0
- package/dist/components/OnyxTabs/types.d.ts +13 -1
- package/dist/components/examples/DataGrid/SortingDataGrid.vue.d.ts +21 -4
- package/dist/composables/useSkeletonState.d.ts +4 -0
- package/dist/i18n/index.d.ts +9 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1456 -1432
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/src/i18n/locales/en-US.json +1 -1
- 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,5 +1,5 @@
|
|
|
1
|
-
import { type DataGridEntry, type OnyxDataGridProps } from "../..";
|
|
2
1
|
import { type DataGridFeature } from "./features";
|
|
2
|
+
import type { DataGridEntry, OnyxDataGridProps } from "./types";
|
|
3
3
|
declare const _default: <TEntry extends DataGridEntry, TFeatures extends DataGridFeature<TEntry, symbol>[] | []>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}> & OnyxDataGridProps<TEntry, TFeatures>> & import("vue").PublicProps;
|
|
5
5
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
@@ -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>;
|
|
@@ -11,7 +11,7 @@ export type Compare<T> = (a: T, b: T) => number;
|
|
|
11
11
|
* The values by which the data is currently sorted.
|
|
12
12
|
* A `undefined` column or a direction of "none" means no sorting is applied.
|
|
13
13
|
*/
|
|
14
|
-
export type SortState<TEntry extends DataGridEntry> = {
|
|
14
|
+
export type SortState<TEntry extends DataGridEntry = DataGridEntry> = {
|
|
15
15
|
/**
|
|
16
16
|
* The column which is used to sort by.
|
|
17
17
|
* `undefined` means no sorting is applied.
|
|
@@ -51,5 +51,5 @@ export type SortOptions<TEntry extends DataGridEntry> = {
|
|
|
51
51
|
/**
|
|
52
52
|
* The options for each column, including whether sorting is enabled and a custom sorting function. If undefined, sorting is enabled for all columns (default).
|
|
53
53
|
*/
|
|
54
|
-
columns?: MaybeRefOrGetter<SortColumnOptions<TEntry
|
|
54
|
+
columns?: MaybeRefOrGetter<SortColumnOptions<TEntry> | undefined>;
|
|
55
55
|
};
|
|
@@ -6,6 +6,9 @@ export type DataGridMetadata = Record<string, unknown>;
|
|
|
6
6
|
export type OnyxDataGridProps<TEntry extends DataGridEntry = DataGridEntry, TFeatures extends DataGridFeature<TEntry, symbol>[] = DataGridFeature<TEntry, symbol>[]> = {
|
|
7
7
|
/**
|
|
8
8
|
* Features that should be applied.
|
|
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
|
+
* Check the Storybook examples (e.g. [Sorting](/?path=/story/data-datagrid-features--sorting)) for more details on how the features are used and configured.
|
|
9
12
|
*/
|
|
10
13
|
features?: TFeatures;
|
|
11
14
|
/**
|
|
@@ -24,7 +24,10 @@ declare function __VLS_template(): {
|
|
|
24
24
|
rootEl: any;
|
|
25
25
|
};
|
|
26
26
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
-
declare const __VLS_component: import("vue").DefineComponent<OnyxTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxTabProps> & Readonly<{}>, {
|
|
27
|
+
declare const __VLS_component: import("vue").DefineComponent<OnyxTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxTabProps> & Readonly<{}>, {
|
|
28
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
31
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
29
32
|
export default _default;
|
|
30
33
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
2
3
|
export type OnyxTabProps = DensityProp & {
|
|
3
4
|
/**
|
|
4
5
|
* Value of the tab when its selected. Will be the `modelValue` / `v-model` of the `OnyxTabs` component.
|
|
@@ -8,4 +9,12 @@ export type OnyxTabProps = DensityProp & {
|
|
|
8
9
|
* Tab label to display. Alternatively, the `tab` slot can be used.
|
|
9
10
|
*/
|
|
10
11
|
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the tab should be disabled and prevent the user from interacting with it.
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to show a skeleton tab.
|
|
18
|
+
*/
|
|
19
|
+
skeleton?: SkeletonInjected;
|
|
11
20
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
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";
|
|
6
|
+
export type OnyxTabsProps<TValue extends PropertyKey = PropertyKey> = DensityProp & Partial<SkeletonProvidedProp> & {
|
|
5
7
|
/**
|
|
6
8
|
* Label of the tabs. Needed for accessibility / screen readers.
|
|
7
9
|
*/
|
|
@@ -14,6 +16,11 @@ export type OnyxTabsProps<TValue extends PropertyKey = PropertyKey> = DensityPro
|
|
|
14
16
|
* If `true`, the tabs will be stretched to the full available width.
|
|
15
17
|
*/
|
|
16
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;
|
|
17
24
|
};
|
|
18
25
|
export type TabsInjectionKey<TValue extends PropertyKey = PropertyKey> = InjectionKey<{
|
|
19
26
|
/**
|
|
@@ -25,9 +32,14 @@ export type TabsInjectionKey<TValue extends PropertyKey = PropertyKey> = Injecti
|
|
|
25
32
|
* to maintain the correct HTML structure.
|
|
26
33
|
*/
|
|
27
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>;
|
|
28
39
|
}>;
|
|
29
40
|
/**
|
|
30
41
|
* Injection key to provide relevant context data from the tabs parent to the
|
|
31
42
|
* individual child tab components.
|
|
32
43
|
*/
|
|
33
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;
|
|
@@ -4,6 +4,10 @@ import { type ComputedRef, type Reactive } from "vue";
|
|
|
4
4
|
* It's value is provided, so that it can be used in child components.
|
|
5
5
|
*/
|
|
6
6
|
export type SkeletonProvidedProp = {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to show all supported child components as skeleton.
|
|
9
|
+
* Can be overridden on each child component if necessary.
|
|
10
|
+
*/
|
|
7
11
|
skeleton: boolean;
|
|
8
12
|
};
|
|
9
13
|
/**
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type App, type ComputedRef, type MaybeRef } from "vue";
|
|
1
|
+
import { type App, type ComputedRef, type InjectionKey, type MaybeRef } from "vue";
|
|
2
2
|
import type { FlattenedKeysOf } from "../types/i18n";
|
|
3
3
|
import type { DeepPartial } from "../types/utils";
|
|
4
4
|
import enUS from "./locales/en-US.json";
|
|
@@ -63,6 +63,14 @@ export type TranslationFunction = (key: OnyxTranslationKey,
|
|
|
63
63
|
placeholders?: Record<string, string | number | undefined> & {
|
|
64
64
|
n?: number;
|
|
65
65
|
}) => string;
|
|
66
|
+
export declare const I18N_INJECTION_KEY: InjectionKey<ReturnType<typeof createI18n>>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new i18n instance.
|
|
69
|
+
*/
|
|
70
|
+
declare const createI18n: (options?: ProvideI18nOptions) => {
|
|
71
|
+
t: ComputedRef<TranslationFunction>;
|
|
72
|
+
locale: ComputedRef<string>;
|
|
73
|
+
};
|
|
66
74
|
/**
|
|
67
75
|
* Provides a global i18n instance that is used by onyx.
|
|
68
76
|
* Must only be called once in the `App.vue` file of a project that consumes onyx.
|