@xsolla/xui-date-picker 0.74.0 → 0.76.0

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.
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+
8
+ import React, { Node } from "react";
9
+ import * as locales from "date-fns/locale";
10
+ declare type CalendarLocaleType = $Keys<typeof locales>;
11
+ declare interface CalendarProps {
12
+ locale?: CalendarLocaleType;
13
+
14
+ /**
15
+ * The day to use as first day of the week, starting from 0 (Sunday) to 6 (Saturday).
16
+ */
17
+ firstDayOfWeek?: number;
18
+
19
+ /**
20
+ * The month to display in the calendar at first render.
21
+ */
22
+ initialMonth?: Date;
23
+
24
+ /**
25
+ * The month to display in the calendar.
26
+ */
27
+ month?: Date;
28
+
29
+ /**
30
+ * Select in range mode for calendar
31
+ */
32
+ selectsRange?: boolean;
33
+
34
+ /**
35
+ * The minimum selectable date
36
+ */
37
+ minDate?: Date | null;
38
+
39
+ /**
40
+ * The maximum selectable date
41
+ */
42
+ maxDate?: Date | null;
43
+
44
+ /**
45
+ * For range mode. Start date in selected period
46
+ */
47
+ startDate?: Date | null;
48
+
49
+ /**
50
+ * For range mode. End date in selected period
51
+ */
52
+ endDate?: Date | null;
53
+
54
+ /**
55
+ * The selected date
56
+ */
57
+ selectedDate?: Date | null;
58
+
59
+ /**
60
+ * Property sets the maximum height of a context menus for selecting month and year.
61
+ */
62
+ contextMenuMaxHeight?: number;
63
+
64
+ /**
65
+ * Returns custom content to display above the calendar's date picker.
66
+ */
67
+ topContent?: (datePicker: {
68
+ close: () => void,
69
+ ...
70
+ }) => Node;
71
+
72
+ /**
73
+ * Returns custom content to display beneath the calendar's date picker.
74
+ */
75
+ bottomContent?: (datePicker: {
76
+ close: () => void,
77
+ ...
78
+ }) => Node;
79
+
80
+ /**
81
+ * Test ID for testing frameworks
82
+ */
83
+ testID?: string;
84
+
85
+ /**
86
+ * Callback fired when the date changes
87
+ */
88
+ onChange?: (date: Date | [Date | null, Date | null]) => void;
89
+ }
90
+ declare type DateRangeType = [Date | null, Date | null];
91
+ declare type DatePickerProps = {
92
+ /**
93
+ * Event handler when the value of a Datepicker changes.
94
+ */
95
+ onChange?: (date: Date | DateRangeType) => void,
96
+
97
+ /**
98
+ * Placeholder text for the input
99
+ */
100
+ placeholder?: string,
101
+
102
+ /**
103
+ * Size of the input
104
+ */
105
+ size?: "xl" | "lg" | "md" | "sm" | "xs",
106
+
107
+ /**
108
+ * Whether the input is disabled
109
+ */
110
+ disabled?: boolean,
111
+
112
+ /**
113
+ * Custom background color for the input
114
+ */
115
+ backgroundColor?: string,
116
+ ...
117
+ } & $Diff<CalendarProps, { onChange: any }>;
118
+ declare var DatePicker: React.ForwardRefExoticComponent<{
119
+ ...DatePickerProps,
120
+ ...React.RefAttributes<any>,
121
+ }>;
122
+ declare var Calendar: React.ForwardRefExoticComponent<{
123
+ ...CalendarProps,
124
+ ...React.RefAttributes<any>,
125
+ }>;
126
+ declare function formatDate(
127
+ date: Date,
128
+ formatStr: string,
129
+ locale?: CalendarLocaleType
130
+ ): string;
131
+ declare function getMonthInLocale(
132
+ month: number,
133
+ locale?: CalendarLocaleType
134
+ ): string;
135
+ export type {
136
+ CalendarLocaleType,
137
+ CalendarProps,
138
+ DatePickerProps,
139
+ DateRangeType,
140
+ };
141
+ declare export { Calendar, DatePicker, formatDate, getMonthInLocale };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-date-picker",
3
- "version": "0.74.0",
3
+ "version": "0.76.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,11 +10,11 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-button": "0.74.0",
14
- "@xsolla/xui-core": "0.74.0",
15
- "@xsolla/xui-input": "0.74.0",
16
- "@xsolla/xui-primitives-core": "0.74.0",
17
- "@xsolla/xui-select": "0.74.0",
13
+ "@xsolla/xui-button": "0.76.0",
14
+ "@xsolla/xui-core": "0.76.0",
15
+ "@xsolla/xui-input": "0.76.0",
16
+ "@xsolla/xui-primitives-core": "0.76.0",
17
+ "@xsolla/xui-select": "0.76.0",
18
18
  "date-fns": "^3.0.0"
19
19
  },
20
20
  "peerDependencies": {
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+
8
+ import React, { Node } from "react";
9
+ import * as locales from "date-fns/locale";
10
+ declare type CalendarLocaleType = $Keys<typeof locales>;
11
+ declare interface CalendarProps {
12
+ locale?: CalendarLocaleType;
13
+
14
+ /**
15
+ * The day to use as first day of the week, starting from 0 (Sunday) to 6 (Saturday).
16
+ */
17
+ firstDayOfWeek?: number;
18
+
19
+ /**
20
+ * The month to display in the calendar at first render.
21
+ */
22
+ initialMonth?: Date;
23
+
24
+ /**
25
+ * The month to display in the calendar.
26
+ */
27
+ month?: Date;
28
+
29
+ /**
30
+ * Select in range mode for calendar
31
+ */
32
+ selectsRange?: boolean;
33
+
34
+ /**
35
+ * The minimum selectable date
36
+ */
37
+ minDate?: Date | null;
38
+
39
+ /**
40
+ * The maximum selectable date
41
+ */
42
+ maxDate?: Date | null;
43
+
44
+ /**
45
+ * For range mode. Start date in selected period
46
+ */
47
+ startDate?: Date | null;
48
+
49
+ /**
50
+ * For range mode. End date in selected period
51
+ */
52
+ endDate?: Date | null;
53
+
54
+ /**
55
+ * The selected date
56
+ */
57
+ selectedDate?: Date | null;
58
+
59
+ /**
60
+ * Property sets the maximum height of a context menus for selecting month and year.
61
+ */
62
+ contextMenuMaxHeight?: number;
63
+
64
+ /**
65
+ * Returns custom content to display above the calendar's date picker.
66
+ */
67
+ topContent?: (datePicker: {
68
+ close: () => void,
69
+ ...
70
+ }) => Node;
71
+
72
+ /**
73
+ * Returns custom content to display beneath the calendar's date picker.
74
+ */
75
+ bottomContent?: (datePicker: {
76
+ close: () => void,
77
+ ...
78
+ }) => Node;
79
+
80
+ /**
81
+ * Test ID for testing frameworks
82
+ */
83
+ testID?: string;
84
+
85
+ /**
86
+ * Callback fired when the date changes
87
+ */
88
+ onChange?: (date: Date | [Date | null, Date | null]) => void;
89
+ }
90
+ declare type DateRangeType = [Date | null, Date | null];
91
+ declare type DatePickerProps = {
92
+ /**
93
+ * Event handler when the value of a Datepicker changes.
94
+ */
95
+ onChange?: (date: Date | DateRangeType) => void,
96
+
97
+ /**
98
+ * Placeholder text for the input
99
+ */
100
+ placeholder?: string,
101
+
102
+ /**
103
+ * Size of the input
104
+ */
105
+ size?: "xl" | "lg" | "md" | "sm" | "xs",
106
+
107
+ /**
108
+ * Whether the input is disabled
109
+ */
110
+ disabled?: boolean,
111
+
112
+ /**
113
+ * Custom background color for the input
114
+ */
115
+ backgroundColor?: string,
116
+ ...
117
+ } & $Diff<CalendarProps, { onChange: any }>;
118
+ declare var DatePicker: React.ForwardRefExoticComponent<{
119
+ ...DatePickerProps,
120
+ ...React.RefAttributes<any>,
121
+ }>;
122
+ declare var Calendar: React.ForwardRefExoticComponent<{
123
+ ...CalendarProps,
124
+ ...React.RefAttributes<any>,
125
+ }>;
126
+ declare function formatDate(
127
+ date: Date,
128
+ formatStr: string,
129
+ locale?: CalendarLocaleType
130
+ ): string;
131
+ declare function getMonthInLocale(
132
+ month: number,
133
+ locale?: CalendarLocaleType
134
+ ): string;
135
+ export type {
136
+ CalendarLocaleType,
137
+ CalendarProps,
138
+ DatePickerProps,
139
+ DateRangeType,
140
+ };
141
+ declare export { Calendar, DatePicker, formatDate, getMonthInLocale };