sit-onyx 1.2.0-dev-20251013061826 → 1.2.0-dev-20251014161744

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,34 +1,57 @@
1
- import { OnyxCalendarProps } from './types.js';
1
+ import { OnyxCalendarProps, OnyxCalendarSelectionMode, OnyxCalendarSize, OnyxCalendarValueBySelection } from './types.js';
2
2
  /**
3
3
  * @experimental
4
4
  * @deprecated This component is still under active development and its API might change in patch releases.
5
5
  */
6
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<OnyxCalendarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- "update:selectedDate": (...args: any[]) => void;
8
- }, string, import('vue').PublicProps, Readonly<OnyxCalendarProps> & Readonly<{
9
- "onUpdate:selectedDate"?: ((...args: any[]) => any) | undefined;
10
- }>, {
11
- skeleton: import('../../composables/useSkeletonState.js', { with: { "resolution-mode": "import" } }).SkeletonInjected;
12
- disabled: boolean;
13
- size: import('./types.js', { with: { "resolution-mode": "import" } }).OnyxCalendarSize;
14
- selection: import('./types.js', { with: { "resolution-mode": "import" } }).OnyxCalendarSelection;
15
- weekStartDay: import('./types.js', { with: { "resolution-mode": "import" } }).OnyxWeekDays;
16
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
17
- calendar: HTMLDivElement;
18
- }, any>, Readonly<{
19
- /**
20
- * Optional slot that is displayed below at the right of the Header.
21
- */
22
- actions?(): unknown;
23
- }> & {
24
- /**
25
- * Optional slot that is displayed below at the right of the Header.
26
- */
27
- actions?(): unknown;
28
- }>;
29
- export default _default;
30
- type __VLS_WithTemplateSlots<T, S> = T & {
31
- new (): {
32
- $slots: S;
6
+ declare const _default: <TSelection extends OnyxCalendarSelectionMode>(__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<{
7
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
8
+ readonly "onUpdate:modelValue"?: ((newDate: OnyxCalendarValueBySelection<TSelection>) => any) | undefined;
9
+ readonly "onUpdate:viewMonth"?: ((newDate: Date) => any) | undefined;
10
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:viewMonth"> & OnyxCalendarProps<TSelection> & Partial<{}>> & import('vue').PublicProps;
11
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
12
+ attrs: any;
13
+ slots: Readonly<{
14
+ /**
15
+ * Optional slot that is displayed below at the right of the Header.
16
+ */
17
+ actions?(): unknown;
18
+ /**
19
+ * Optional slot that is displayed inside each day, for custom calender content.
20
+ */
21
+ day?(props: {
22
+ /**
23
+ * Date that the slot is rendered for.
24
+ */
25
+ date: Date;
26
+ /**
27
+ * Actual size of the calendar.
28
+ */
29
+ size: Exclude<OnyxCalendarSize, "auto">;
30
+ }): unknown;
31
+ }> & {
32
+ /**
33
+ * Optional slot that is displayed below at the right of the Header.
34
+ */
35
+ actions?(): unknown;
36
+ /**
37
+ * Optional slot that is displayed inside each day, for custom calender content.
38
+ */
39
+ day?(props: {
40
+ /**
41
+ * Date that the slot is rendered for.
42
+ */
43
+ date: Date;
44
+ /**
45
+ * Actual size of the calendar.
46
+ */
47
+ size: Exclude<OnyxCalendarSize, "auto">;
48
+ }): unknown;
33
49
  };
50
+ emit: ((evt: "update:modelValue", newDate: OnyxCalendarValueBySelection<TSelection>) => void) & ((evt: "update:viewMonth", newDate: Date) => void);
51
+ }>) => import('vue').VNode & {
52
+ __ctx?: Awaited<typeof __VLS_setup>;
34
53
  };
54
+ export default _default;
55
+ type __VLS_PrettifyLocal<T> = {
56
+ [K in keyof T]: T[K];
57
+ } & {};
@@ -1,6 +1,12 @@
1
1
  import { DensityProp } from '../../composables/density.js';
2
2
  import { SkeletonInjected } from '../../composables/useSkeletonState.js';
3
- export type OnyxCalendarProps = DensityProp & {
3
+ import { Nullable } from '../../types/utils.js';
4
+ import { DateValue } from '../OnyxDatePicker/types.js';
5
+ export type OnyxCalendarProps<TSelection extends OnyxCalendarSelectionMode> = DensityProp & {
6
+ /**
7
+ * Selected Value
8
+ */
9
+ modelValue?: Nullable<OnyxCalendarValueBySelection<TSelection>>;
4
10
  /**
5
11
  * Whether the calendar is disabled. Disables all interactions and prevents date selection.
6
12
  */
@@ -19,10 +25,11 @@ export type OnyxCalendarProps = DensityProp & {
19
25
  */
20
26
  weekStartDay?: OnyxWeekDays;
21
27
  /**
22
- * The initial date to display when the calendar is first rendered.
28
+ * The month / year that is currently visible. If unset, it will be managed internally.
29
+ * Useful if you want to switch the view month programmatically.
23
30
  * @default today
24
31
  */
25
- initialDate?: Date;
32
+ viewMonth?: Nullable<DateValue>;
26
33
  /**
27
34
  * The visual size of the calendar.
28
35
  * - "big": larger layout with more spacing and bigger text
@@ -35,11 +42,20 @@ export type OnyxCalendarProps = DensityProp & {
35
42
  */
36
43
  skeleton?: SkeletonInjected;
37
44
  /**
38
- * The selection mode for dates.
39
- * TODO: support "multiple" and "range".
45
+ * Defines how dates are selected in the calendar.
46
+ * If undefined, no selection will be possible.
40
47
  */
41
- selection?: OnyxCalendarSelection;
48
+ selectionMode?: TSelection;
49
+ /**
50
+ * Whether to show week numbers in the calendar.
51
+ */
52
+ showCalendarWeeks?: boolean;
42
53
  };
43
- export type OnyxCalendarSelection = "single";
54
+ export type OnyxCalendarSelectionMode = "single" | "multiple" | "range";
44
55
  export type OnyxCalendarSize = "big" | "small" | "auto";
45
56
  export type OnyxWeekDays = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday";
57
+ export type DateRange = {
58
+ start: Date;
59
+ end: Date;
60
+ };
61
+ export type OnyxCalendarValueBySelection<TSelection extends OnyxCalendarSelectionMode> = TSelection extends "single" ? Date : TSelection extends "multiple" ? Date[] : TSelection extends "range" ? DateRange : never;
@@ -0,0 +1,33 @@
1
+ import { OnyxCalendarCellProps } from './types.js';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: Readonly<{
5
+ /**
6
+ * Optional slot for custom cell content.
7
+ */
8
+ default?(): unknown;
9
+ }> & {
10
+ /**
11
+ * Optional slot for custom cell content.
12
+ */
13
+ default?(): unknown;
14
+ };
15
+ refs: {};
16
+ rootEl: HTMLTableCellElement;
17
+ };
18
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
+ declare const __VLS_component: import('vue').DefineComponent<OnyxCalendarCellProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
20
+ hovered: () => any;
21
+ }, string, import('vue').PublicProps, Readonly<OnyxCalendarCellProps> & Readonly<{
22
+ onHovered?: (() => any) | undefined;
23
+ }>, {
24
+ is: "div" | "button";
25
+ backgroundColor: "tinted" | "blank";
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLTableCellElement>;
27
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
+ export default _default;
29
+ type __VLS_WithTemplateSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,31 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { DensityProp } from '../../composables/density.js';
3
+ import { OnyxColor } from '../../types/colors.js';
4
+ import { OnyxCalendarSize } from '../OnyxCalendar/types.js';
5
+ export type OnyxCalendarCellProps = DensityProp & {
6
+ /**
7
+ * Numeric date / day of the month.
8
+ */
9
+ date: number;
10
+ size: OnyxCalendarSize;
11
+ is?: "div" | "button";
12
+ /**
13
+ * Whether the cell is disabled and can not be interacted with.
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Whether to visually show the cell as disabled but still allow it to be interactive.
18
+ */
19
+ showAsDisabled?: boolean;
20
+ /**
21
+ * Optional highlight color.
22
+ */
23
+ color?: Extract<OnyxColor, "neutral" | "primary">;
24
+ backgroundColor?: "tinted" | "blank";
25
+ /**
26
+ * Optionally define which range selection type the cell is currently active.
27
+ */
28
+ rangeType?: CalendarCellRangeType;
29
+ buttonAttributes?: HTMLAttributes;
30
+ };
31
+ export type CalendarCellRangeType = "start" | "middle" | "end";
@@ -228,6 +228,7 @@
228
228
  },
229
229
  "calendar": {
230
230
  "todayButton": { "label": "Heute", "tooltip": "Springe zu Heute" },
231
+ "calenderWeek": "KW",
231
232
  "previousMonthButton": "Vorheriger Monat",
232
233
  "nextMonthButton": "Nächster Monat"
233
234
  }
@@ -231,6 +231,7 @@
231
231
  "label": "Today",
232
232
  "tooltip": "Jump to today"
233
233
  },
234
+ "calenderWeek": "CW",
234
235
  "previousMonthButton": "Previous month",
235
236
  "nextMonthButton": "Next month"
236
237
  }
@@ -231,6 +231,7 @@ declare const _default: {
231
231
  "label": "Today",
232
232
  "tooltip": "Jump to today"
233
233
  },
234
+ "calenderWeek": "CW",
234
235
  "previousMonthButton": "Previous month",
235
236
  "nextMonthButton": "Next month"
236
237
  }