sit-onyx 1.0.0-beta.66 → 1.0.0-beta.68

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,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;
@@ -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,24 @@ 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
+ *
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
+ * ```
9
27
  */
10
28
  features?: TFeatures;
11
29
  /**
@@ -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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
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,8 @@
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
- export type OnyxTabsProps<TValue extends PropertyKey = PropertyKey> = DensityProp & {
4
+ import type { SkeletonProvidedProp } from "../../composables/useSkeletonState";
5
+ export type OnyxTabsProps<TValue extends PropertyKey = PropertyKey> = DensityProp & Partial<SkeletonProvidedProp> & {
5
6
  /**
6
7
  * Label of the tabs. Needed for accessibility / screen readers.
7
8
  */
@@ -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
  /**
@@ -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.