rsuite 5.79.1 → 5.80.1
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/CHANGELOG.md +24 -0
- package/cjs/Calendar/Calendar.js +1 -2
- package/cjs/Calendar/CalendarBody.js +0 -2
- package/cjs/Calendar/CalendarContainer.js +1 -2
- package/cjs/Calendar/CalendarProvider.d.ts +1 -1
- package/cjs/Calendar/Grid/GridHeaderRow.js +1 -2
- package/cjs/Calendar/Grid/GridRow.d.ts +2 -0
- package/cjs/Calendar/Grid/GridRow.js +6 -4
- package/cjs/Calendar/hooks/useCalendar.d.ts +25 -2
- package/cjs/Calendar/hooks/useCalendar.js +36 -1
- package/cjs/CustomProvider/CustomContext.d.ts +253 -0
- package/cjs/CustomProvider/CustomContext.js +8 -0
- package/cjs/CustomProvider/CustomProvider.d.ts +1 -258
- package/cjs/CustomProvider/CustomProvider.js +2 -3
- package/cjs/CustomProvider/FormattedDate.js +2 -2
- package/cjs/CustomProvider/FormattedNumber.js +2 -2
- package/cjs/CustomProvider/index.d.ts +2 -2
- package/cjs/CustomProvider/index.js +4 -4
- package/cjs/CustomProvider/useCustom.js +2 -2
- package/cjs/DatePicker/DatePicker.js +1 -2
- package/cjs/DateRangePicker/DateRangePicker.js +1 -2
- package/cjs/DateRangePicker/utils.d.ts +1 -1
- package/cjs/DateRangePicker/utils.js +2 -1
- package/cjs/Image/hooks/useImage.js +2 -3
- package/cjs/InlineEdit/InlineEdit.js +3 -1
- package/cjs/InlineEdit/useEditState.d.ts +2 -0
- package/cjs/InlineEdit/useEditState.js +9 -1
- package/cjs/internals/Picker/propTypes.d.ts +2 -2
- package/cjs/internals/hooks/useClassNames.js +2 -2
- package/cjs/internals/hooks/useToggleCaret.d.ts +1 -1
- package/cjs/internals/utils/date/getWeekStartDates.d.ts +0 -1
- package/cjs/internals/utils/date/getWeekStartDates.js +2 -5
- package/cjs/internals/utils/date/index.d.ts +1 -0
- package/cjs/internals/utils/date/index.js +4 -1
- package/cjs/locales/nl_NL.js +2 -2
- package/cjs/useToaster/useToaster.js +2 -2
- package/dist/rsuite.js +69 -25
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Calendar/Calendar.js +1 -2
- package/esm/Calendar/CalendarBody.js +0 -2
- package/esm/Calendar/CalendarContainer.js +1 -2
- package/esm/Calendar/CalendarProvider.d.ts +1 -1
- package/esm/Calendar/Grid/GridHeaderRow.js +1 -2
- package/esm/Calendar/Grid/GridRow.d.ts +2 -0
- package/esm/Calendar/Grid/GridRow.js +6 -4
- package/esm/Calendar/hooks/useCalendar.d.ts +25 -2
- package/esm/Calendar/hooks/useCalendar.js +36 -2
- package/esm/CustomProvider/CustomContext.d.ts +253 -0
- package/esm/CustomProvider/CustomContext.js +3 -0
- package/esm/CustomProvider/CustomProvider.d.ts +1 -258
- package/esm/CustomProvider/CustomProvider.js +1 -1
- package/esm/CustomProvider/FormattedDate.js +1 -1
- package/esm/CustomProvider/FormattedNumber.js +1 -1
- package/esm/CustomProvider/index.d.ts +2 -2
- package/esm/CustomProvider/index.js +1 -1
- package/esm/CustomProvider/useCustom.js +1 -1
- package/esm/DatePicker/DatePicker.js +1 -2
- package/esm/DateRangePicker/DateRangePicker.js +1 -2
- package/esm/DateRangePicker/utils.d.ts +1 -1
- package/esm/DateRangePicker/utils.js +2 -1
- package/esm/Image/hooks/useImage.js +1 -1
- package/esm/InlineEdit/InlineEdit.js +3 -1
- package/esm/InlineEdit/useEditState.d.ts +2 -0
- package/esm/InlineEdit/useEditState.js +9 -1
- package/esm/internals/Picker/propTypes.d.ts +2 -2
- package/esm/internals/hooks/useClassNames.js +1 -1
- package/esm/internals/hooks/useToggleCaret.d.ts +1 -1
- package/esm/internals/utils/date/getWeekStartDates.d.ts +0 -1
- package/esm/internals/utils/date/getWeekStartDates.js +2 -5
- package/esm/internals/utils/date/index.d.ts +1 -0
- package/esm/internals/utils/date/index.js +1 -0
- package/esm/locales/nl_NL.js +2 -2
- package/esm/useToaster/useToaster.js +1 -1
- package/package.json +3 -3
|
@@ -1,262 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ToastContainerInstance } from '../toaster/ToastContainer';
|
|
4
|
-
import type { FormatDateOptions } from '../internals/utils/date/types';
|
|
5
|
-
import type { ReactSuiteComponents } from './types';
|
|
6
|
-
export interface CustomValue<T = Locale> {
|
|
7
|
-
/**
|
|
8
|
-
* The prefix of the component CSS class
|
|
9
|
-
*/
|
|
10
|
-
classPrefix?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The locale object that contains the language and formatting rules for the date.
|
|
13
|
-
*/
|
|
14
|
-
locale: T;
|
|
15
|
-
/**
|
|
16
|
-
* Right-to-left text direction.
|
|
17
|
-
*/
|
|
18
|
-
rtl: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Return the formatted date string in the given format. The result may vary by locale.
|
|
21
|
-
*
|
|
22
|
-
* Example:
|
|
23
|
-
*
|
|
24
|
-
* import format from 'date-fns/format';
|
|
25
|
-
* import eo from 'date-fns/locale/eo'
|
|
26
|
-
*
|
|
27
|
-
* function formatDate(date, formatStr) {
|
|
28
|
-
* return format(date, formatStr, { locale: eo });
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
formatDate: (date: Date | number, format: string, options?: FormatDateOptions) => string;
|
|
33
|
-
/**
|
|
34
|
-
* Return the date parsed from string using the given format string.
|
|
35
|
-
*
|
|
36
|
-
* Example:
|
|
37
|
-
*
|
|
38
|
-
* import parse from 'date-fns/parse';
|
|
39
|
-
* import eo from 'date-fns/locale/eo'
|
|
40
|
-
*
|
|
41
|
-
* function parseDate(date, formatStr) {
|
|
42
|
-
* return parse(date, formatStr, new Date(), { locale: eo });
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
parseDate: (dateString: string, formatString: string, referenceDate?: Date | number, options?: FormatDateOptions) => Date;
|
|
47
|
-
/**
|
|
48
|
-
* A Map of toast containers
|
|
49
|
-
*/
|
|
50
|
-
toasters?: React.MutableRefObject<Map<string, ToastContainerInstance>>;
|
|
51
|
-
/**
|
|
52
|
-
* If true, the ripple effect is disabled.
|
|
53
|
-
* Affected components include: Button, Nav.Item, Pagination.
|
|
54
|
-
*/
|
|
55
|
-
disableRipple?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface CustomProviderProps<T = Locale> extends Partial<CustomValue<T>> {
|
|
58
|
-
/**
|
|
59
|
-
* Supported themes
|
|
60
|
-
*/
|
|
61
|
-
theme?: 'light' | 'dark' | 'high-contrast';
|
|
62
|
-
/**
|
|
63
|
-
* The prefix of the icon CSS class
|
|
64
|
-
*/
|
|
65
|
-
iconClassPrefix?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Primary content
|
|
68
|
-
*/
|
|
69
|
-
children?: React.ReactNode;
|
|
70
|
-
/**
|
|
71
|
-
* Sets a container for toast rendering
|
|
72
|
-
*/
|
|
73
|
-
toastContainer?: HTMLElement | (() => HTMLElement | null) | null;
|
|
74
|
-
csp?: {
|
|
75
|
-
/**
|
|
76
|
-
* Content Security Policy nonce
|
|
77
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
|
|
78
|
-
*/
|
|
79
|
-
nonce?: string;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Disable inline styles
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
disableInlineStyles?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* components allows setting default props for specific components globally.
|
|
88
|
-
* It accepts an object where each key represents a component name (e.g., 'Button', 'Input'),
|
|
89
|
-
* and the corresponding value is an object containing the `defaultProps` object.
|
|
90
|
-
* The `defaultProps` object defines the default props for that component.
|
|
91
|
-
* These props will be automatically applied to the component unless overridden by specific props
|
|
92
|
-
* passed in an individual component instance.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```js
|
|
96
|
-
* components={{
|
|
97
|
-
* Button: { defaultProps: { appearance: 'primary', size: 'lg' } },
|
|
98
|
-
* Input: { defaultProps: { placeholder: 'Enter text', size: 'lg' } }
|
|
99
|
-
* }}
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
components?: Partial<ReactSuiteComponents>;
|
|
103
|
-
}
|
|
104
|
-
export declare const CustomContext: React.Context<CustomProviderProps<{
|
|
105
|
-
code?: string | undefined;
|
|
106
|
-
common?: {
|
|
107
|
-
loading: string;
|
|
108
|
-
emptyMessage: string;
|
|
109
|
-
remove: string;
|
|
110
|
-
clear: string;
|
|
111
|
-
} | undefined;
|
|
112
|
-
Plaintext?: {
|
|
113
|
-
unfilled: string;
|
|
114
|
-
notSelected: string;
|
|
115
|
-
notUploaded: string;
|
|
116
|
-
} | undefined;
|
|
117
|
-
Pagination?: {
|
|
118
|
-
more: string;
|
|
119
|
-
prev: string;
|
|
120
|
-
next: string;
|
|
121
|
-
first: string;
|
|
122
|
-
last: string;
|
|
123
|
-
limit: string;
|
|
124
|
-
total: string;
|
|
125
|
-
skip: string;
|
|
126
|
-
} | undefined;
|
|
127
|
-
DateTimeFormats?: {
|
|
128
|
-
sunday: string;
|
|
129
|
-
monday: string;
|
|
130
|
-
tuesday: string;
|
|
131
|
-
wednesday: string;
|
|
132
|
-
thursday: string;
|
|
133
|
-
friday: string;
|
|
134
|
-
saturday: string;
|
|
135
|
-
ok: string;
|
|
136
|
-
today: string;
|
|
137
|
-
yesterday: string;
|
|
138
|
-
now: string;
|
|
139
|
-
hours: string;
|
|
140
|
-
minutes: string;
|
|
141
|
-
seconds: string;
|
|
142
|
-
formattedMonthPattern: string;
|
|
143
|
-
formattedDayPattern: string;
|
|
144
|
-
shortDateFormat: string;
|
|
145
|
-
shortTimeFormat: string;
|
|
146
|
-
dateLocale: any;
|
|
147
|
-
} | undefined;
|
|
148
|
-
Calendar?: {
|
|
149
|
-
sunday: string;
|
|
150
|
-
monday: string;
|
|
151
|
-
tuesday: string;
|
|
152
|
-
wednesday: string;
|
|
153
|
-
thursday: string;
|
|
154
|
-
friday: string;
|
|
155
|
-
saturday: string;
|
|
156
|
-
ok: string;
|
|
157
|
-
today: string;
|
|
158
|
-
yesterday: string;
|
|
159
|
-
now: string;
|
|
160
|
-
hours: string;
|
|
161
|
-
minutes: string;
|
|
162
|
-
seconds: string;
|
|
163
|
-
formattedMonthPattern: string;
|
|
164
|
-
formattedDayPattern: string;
|
|
165
|
-
shortDateFormat: string;
|
|
166
|
-
shortTimeFormat: string;
|
|
167
|
-
dateLocale: any;
|
|
168
|
-
} | undefined;
|
|
169
|
-
DatePicker?: {
|
|
170
|
-
sunday: string;
|
|
171
|
-
monday: string;
|
|
172
|
-
tuesday: string;
|
|
173
|
-
wednesday: string;
|
|
174
|
-
thursday: string;
|
|
175
|
-
friday: string;
|
|
176
|
-
saturday: string;
|
|
177
|
-
ok: string;
|
|
178
|
-
today: string;
|
|
179
|
-
yesterday: string;
|
|
180
|
-
now: string;
|
|
181
|
-
hours: string;
|
|
182
|
-
minutes: string;
|
|
183
|
-
seconds: string;
|
|
184
|
-
formattedMonthPattern: string;
|
|
185
|
-
formattedDayPattern: string;
|
|
186
|
-
shortDateFormat: string;
|
|
187
|
-
shortTimeFormat: string;
|
|
188
|
-
dateLocale: any;
|
|
189
|
-
} | undefined;
|
|
190
|
-
DateRangePicker?: {
|
|
191
|
-
last7Days: string;
|
|
192
|
-
sunday: string;
|
|
193
|
-
monday: string;
|
|
194
|
-
tuesday: string;
|
|
195
|
-
wednesday: string;
|
|
196
|
-
thursday: string;
|
|
197
|
-
friday: string;
|
|
198
|
-
saturday: string;
|
|
199
|
-
ok: string;
|
|
200
|
-
today: string;
|
|
201
|
-
yesterday: string;
|
|
202
|
-
now: string;
|
|
203
|
-
hours: string;
|
|
204
|
-
minutes: string;
|
|
205
|
-
seconds: string;
|
|
206
|
-
formattedMonthPattern: string;
|
|
207
|
-
formattedDayPattern: string;
|
|
208
|
-
shortDateFormat: string;
|
|
209
|
-
shortTimeFormat: string;
|
|
210
|
-
dateLocale: any;
|
|
211
|
-
} | undefined;
|
|
212
|
-
Combobox?: {
|
|
213
|
-
noResultsText: string;
|
|
214
|
-
placeholder: string; /**
|
|
215
|
-
* The locale object that contains the language and formatting rules for the date.
|
|
216
|
-
*/
|
|
217
|
-
searchPlaceholder: string;
|
|
218
|
-
checkAll: string;
|
|
219
|
-
} | undefined;
|
|
220
|
-
InputPicker?: {
|
|
221
|
-
newItem: string;
|
|
222
|
-
createOption: string;
|
|
223
|
-
noResultsText: string;
|
|
224
|
-
placeholder: string; /**
|
|
225
|
-
* The locale object that contains the language and formatting rules for the date.
|
|
226
|
-
*/
|
|
227
|
-
searchPlaceholder: string;
|
|
228
|
-
checkAll: string;
|
|
229
|
-
} | undefined;
|
|
230
|
-
TagPicker?: {
|
|
231
|
-
newItem: string;
|
|
232
|
-
createOption: string;
|
|
233
|
-
noResultsText: string;
|
|
234
|
-
placeholder: string; /**
|
|
235
|
-
* The locale object that contains the language and formatting rules for the date.
|
|
236
|
-
*/
|
|
237
|
-
searchPlaceholder: string;
|
|
238
|
-
checkAll: string;
|
|
239
|
-
} | undefined;
|
|
240
|
-
Uploader?: {
|
|
241
|
-
inited: string;
|
|
242
|
-
progress: string;
|
|
243
|
-
error: string;
|
|
244
|
-
complete: string;
|
|
245
|
-
emptyFile: string;
|
|
246
|
-
upload: string;
|
|
247
|
-
removeFile: string;
|
|
248
|
-
} | undefined;
|
|
249
|
-
CloseButton?: {
|
|
250
|
-
closeLabel: string;
|
|
251
|
-
} | undefined;
|
|
252
|
-
Breadcrumb?: {
|
|
253
|
-
expandText: string;
|
|
254
|
-
} | undefined;
|
|
255
|
-
Toggle?: {
|
|
256
|
-
on: string;
|
|
257
|
-
off: string;
|
|
258
|
-
} | undefined;
|
|
259
|
-
}>>;
|
|
2
|
+
import { CustomProviderProps } from './CustomContext';
|
|
260
3
|
/**
|
|
261
4
|
* CustomProvider is used to provide global configuration, such as language, theme, etc.
|
|
262
5
|
*
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.CustomContext = void 0;
|
|
7
6
|
exports.default = CustomProvider;
|
|
8
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
@@ -12,11 +11,11 @@ var _IconProvider = _interopRequireDefault(require("@rsuite/icons/IconProvider")
|
|
|
12
11
|
var _hooks = require("../internals/hooks");
|
|
13
12
|
var _prefix = require("../internals/utils/prefix");
|
|
14
13
|
var _DOMHelper = require("../DOMHelper");
|
|
14
|
+
var _CustomContext = require("./CustomContext");
|
|
15
15
|
var _ToastContainer = _interopRequireWildcard(require("../toaster/ToastContainer"));
|
|
16
16
|
var _excluded = ["children", "classPrefix", "components", "iconClassPrefix", "theme", "toastContainer", "disableRipple", "csp", "disableInlineStyles"];
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
-
var CustomContext = exports.CustomContext = /*#__PURE__*/_react.default.createContext({});
|
|
20
19
|
var themes = ['light', 'dark', 'high-contrast'];
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -73,7 +72,7 @@ function CustomProvider(props) {
|
|
|
73
72
|
});
|
|
74
73
|
}
|
|
75
74
|
}, [classPrefix, theme]);
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(CustomContext.Provider, {
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_CustomContext.CustomContext.Provider, {
|
|
77
76
|
value: value
|
|
78
77
|
}, /*#__PURE__*/_react.default.createElement(_IconProvider.default, {
|
|
79
78
|
value: iconContext
|
|
@@ -6,11 +6,11 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.FormattedDate = FormattedDate;
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _ = require("./");
|
|
10
10
|
function FormattedDate(_ref) {
|
|
11
11
|
var date = _ref.date,
|
|
12
12
|
formatStr = _ref.formatStr;
|
|
13
|
-
var _useCustom = (0,
|
|
13
|
+
var _useCustom = (0, _.useCustom)('Calendar'),
|
|
14
14
|
formatDate = _useCustom.formatDate;
|
|
15
15
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formatDate(date, formatStr));
|
|
16
16
|
}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.FormattedNumber = FormattedNumber;
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
-
var
|
|
7
|
+
var _ = require("./");
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
9
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
function FormattedNumber(_ref) {
|
|
11
11
|
var value = _ref.value,
|
|
12
12
|
formatOptions = _ref.formatOptions;
|
|
13
|
-
var _useCustom = (0,
|
|
13
|
+
var _useCustom = (0, _.useCustom)(),
|
|
14
14
|
code = _useCustom.code;
|
|
15
15
|
var formatter = (0, _react.useMemo)(function () {
|
|
16
16
|
return new Intl.NumberFormat(code, formatOptions);
|
|
@@ -2,7 +2,7 @@ import CustomProvider from './CustomProvider';
|
|
|
2
2
|
export { FormattedDate } from './FormattedDate';
|
|
3
3
|
export { FormattedNumber } from './FormattedNumber';
|
|
4
4
|
export { useCustom } from './useCustom';
|
|
5
|
-
export { CustomContext } from './
|
|
6
|
-
export type { CustomProviderProps } from './
|
|
5
|
+
export { CustomContext } from './CustomContext';
|
|
6
|
+
export type { CustomProviderProps } from './CustomContext';
|
|
7
7
|
export type { ReactSuiteComponents } from './types';
|
|
8
8
|
export default CustomProvider;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
exports.__esModule = true;
|
|
5
6
|
exports.useCustom = exports.default = exports.FormattedNumber = exports.FormattedDate = exports.CustomContext = void 0;
|
|
6
|
-
var _CustomProvider =
|
|
7
|
-
exports.CustomContext = _CustomProvider.CustomContext;
|
|
7
|
+
var _CustomProvider = _interopRequireDefault(require("./CustomProvider"));
|
|
8
8
|
var _FormattedDate = require("./FormattedDate");
|
|
9
9
|
exports.FormattedDate = _FormattedDate.FormattedDate;
|
|
10
10
|
var _FormattedNumber = require("./FormattedNumber");
|
|
11
11
|
exports.FormattedNumber = _FormattedNumber.FormattedNumber;
|
|
12
12
|
var _useCustom = require("./useCustom");
|
|
13
13
|
exports.useCustom = _useCustom.useCustom;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
var _CustomContext = require("./CustomContext");
|
|
15
|
+
exports.CustomContext = _CustomContext.CustomContext;
|
|
16
16
|
var _default = exports.default = _CustomProvider.default;
|
|
@@ -11,7 +11,7 @@ var _react = require("react");
|
|
|
11
11
|
var _assign = _interopRequireDefault(require("lodash/assign"));
|
|
12
12
|
var _en_GB = _interopRequireDefault(require("../locales/en_GB"));
|
|
13
13
|
var _date = require("../internals/utils/date");
|
|
14
|
-
var
|
|
14
|
+
var _CustomContext = require("./CustomContext");
|
|
15
15
|
var _excluded = ["locale"];
|
|
16
16
|
function getDefaultRTL() {
|
|
17
17
|
return typeof document !== 'undefined' && (document.body.getAttribute('dir') || document.dir) === 'rtl';
|
|
@@ -31,7 +31,7 @@ function toLocaleKey(componentName) {
|
|
|
31
31
|
*/
|
|
32
32
|
function useCustom(componentName, componentProps) {
|
|
33
33
|
var _globalLocale$DateTim;
|
|
34
|
-
var _useContext = (0, _react.useContext)(
|
|
34
|
+
var _useContext = (0, _react.useContext)(_CustomContext.CustomContext),
|
|
35
35
|
_useContext$component = _useContext.components,
|
|
36
36
|
components = _useContext$component === void 0 ? {} : _useContext$component,
|
|
37
37
|
_useContext$locale = _useContext.locale,
|
|
@@ -62,8 +62,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
62
62
|
format = propsWithDefaults.format,
|
|
63
63
|
idProp = propsWithDefaults.id,
|
|
64
64
|
isoWeek = propsWithDefaults.isoWeek,
|
|
65
|
-
|
|
66
|
-
weekStart = _propsWithDefaults$we === void 0 ? 0 : _propsWithDefaults$we,
|
|
65
|
+
weekStart = propsWithDefaults.weekStart,
|
|
67
66
|
_propsWithDefaults$li = propsWithDefaults.limitEndYear,
|
|
68
67
|
limitEndYear = _propsWithDefaults$li === void 0 ? 1000 : _propsWithDefaults$li,
|
|
69
68
|
limitStartYear = propsWithDefaults.limitStartYear,
|
|
@@ -74,8 +74,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
74
74
|
idProp = propsWithDefaults.id,
|
|
75
75
|
_propsWithDefaults$is = propsWithDefaults.isoWeek,
|
|
76
76
|
isoWeek = _propsWithDefaults$is === void 0 ? false : _propsWithDefaults$is,
|
|
77
|
-
|
|
78
|
-
weekStart = _propsWithDefaults$we === void 0 ? 0 : _propsWithDefaults$we,
|
|
77
|
+
weekStart = propsWithDefaults.weekStart,
|
|
79
78
|
_propsWithDefaults$li = propsWithDefaults.limitEndYear,
|
|
80
79
|
limitEndYear = _propsWithDefaults$li === void 0 ? 1000 : _propsWithDefaults$li,
|
|
81
80
|
limitStartYear = propsWithDefaults.limitStartYear,
|
|
@@ -9,6 +9,6 @@ export declare const isSameRange: (source: DateRange | null, dest: DateRange | n
|
|
|
9
9
|
export declare const getMonthHoverRange: (date: Date) => DateRange;
|
|
10
10
|
export declare const getWeekHoverRange: (date: Date, options: {
|
|
11
11
|
isoWeek: boolean;
|
|
12
|
-
weekStart
|
|
12
|
+
weekStart?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
13
|
locale?: Locale;
|
|
14
14
|
}) => DateRange;
|
|
@@ -52,7 +52,8 @@ var getMonthHoverRange = exports.getMonthHoverRange = function getMonthHoverRang
|
|
|
52
52
|
};
|
|
53
53
|
var getWeekHoverRange = exports.getWeekHoverRange = function getWeekHoverRange(date, options) {
|
|
54
54
|
var isoWeek = options.isoWeek,
|
|
55
|
-
weekStart = options.weekStart,
|
|
55
|
+
_options$weekStart = options.weekStart,
|
|
56
|
+
weekStart = _options$weekStart === void 0 ? 0 : _options$weekStart,
|
|
56
57
|
locale = options.locale;
|
|
57
58
|
if (isoWeek) {
|
|
58
59
|
// set to the first day of this week according to ISO 8601, 12:00 am
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
exports.__esModule = true;
|
|
6
5
|
exports.useImage = void 0;
|
|
7
6
|
var _react = require("react");
|
|
8
|
-
var
|
|
7
|
+
var _hooks = require("../../internals/hooks");
|
|
9
8
|
var useImage = exports.useImage = function useImage(props) {
|
|
10
9
|
var src = props.src,
|
|
11
10
|
fallbackSrc = props.fallbackSrc,
|
|
@@ -54,7 +53,7 @@ var useImage = exports.useImage = function useImage(props) {
|
|
|
54
53
|
};
|
|
55
54
|
imageRef.current = image;
|
|
56
55
|
}, [crossOrigin, fallbackSrc, loading, sizes, src, srcSet]);
|
|
57
|
-
(0,
|
|
56
|
+
(0, _hooks.useIsomorphicLayoutEffect)(function () {
|
|
58
57
|
loadImage();
|
|
59
58
|
return function () {
|
|
60
59
|
flush();
|
|
@@ -49,6 +49,7 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
49
49
|
onChange = _useEditState.onChange,
|
|
50
50
|
onKeyDown = _useEditState.onKeyDown,
|
|
51
51
|
onClick = _useEditState.onClick,
|
|
52
|
+
onFocus = _useEditState.onFocus,
|
|
52
53
|
htmlProps = _useEditState.htmlProps;
|
|
53
54
|
var _useFocusEvent = (0, _useFocusEvent2.default)({
|
|
54
55
|
isEditing: isEditing,
|
|
@@ -75,7 +76,8 @@ var InlineEdit = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
75
76
|
disabled: disabled
|
|
76
77
|
})),
|
|
77
78
|
onClick: onClick,
|
|
78
|
-
onKeyDown: onKeyDown
|
|
79
|
+
onKeyDown: onKeyDown,
|
|
80
|
+
onFocus: onFocus
|
|
79
81
|
}, htmlProps), (0, _renderChildren.renderChildren)(children, childrenProps, target), showControls && isEditing && /*#__PURE__*/_react.default.createElement(_EditableControls.default, {
|
|
80
82
|
className: prefix('controls'),
|
|
81
83
|
onSave: onSave,
|
|
@@ -8,12 +8,14 @@ interface EditStateProps {
|
|
|
8
8
|
onCancel?: (event?: React.MouseEvent) => void;
|
|
9
9
|
onSave?: (event?: React.MouseEvent) => void;
|
|
10
10
|
onClick?: (event: React.SyntheticEvent) => void;
|
|
11
|
+
onFocus?: (event?: React.FocusEvent) => void;
|
|
11
12
|
}
|
|
12
13
|
declare const useEditState: (props: EditStateProps) => {
|
|
13
14
|
isEditing: boolean;
|
|
14
15
|
value: any;
|
|
15
16
|
onClick: (...args: any[]) => any;
|
|
16
17
|
onChange: (...args: any[]) => any;
|
|
18
|
+
onFocus: (...args: any[]) => any;
|
|
17
19
|
onCancel: (...args: any[]) => any;
|
|
18
20
|
onSave: (...args: any[]) => any;
|
|
19
21
|
onKeyDown: (...args: any[]) => any;
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _hooks = require("../internals/hooks");
|
|
10
|
-
var _excluded = ["value", "defaultValue", "disabled", "onChange", "onEdit", "onCancel", "onSave", "onClick"];
|
|
10
|
+
var _excluded = ["value", "defaultValue", "disabled", "onChange", "onEdit", "onCancel", "onSave", "onClick", "onFocus"];
|
|
11
11
|
var useEditState = function useEditState(props) {
|
|
12
12
|
var valueProp = props.value,
|
|
13
13
|
defaultValue = props.defaultValue,
|
|
@@ -17,6 +17,7 @@ var useEditState = function useEditState(props) {
|
|
|
17
17
|
onCancel = props.onCancel,
|
|
18
18
|
onSave = props.onSave,
|
|
19
19
|
onClick = props.onClick,
|
|
20
|
+
onFocus = props.onFocus,
|
|
20
21
|
htmlProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
21
22
|
var _useState = (0, _react.useState)(false),
|
|
22
23
|
isEditing = _useState[0],
|
|
@@ -38,6 +39,12 @@ var useEditState = function useEditState(props) {
|
|
|
38
39
|
setIsEditing(true);
|
|
39
40
|
setResetValue(value);
|
|
40
41
|
});
|
|
42
|
+
var handleFocus = (0, _hooks.useEventCallback)(function (event) {
|
|
43
|
+
if (disabled) return;
|
|
44
|
+
onFocus === null || onFocus === void 0 || onFocus(event);
|
|
45
|
+
setIsEditing(true);
|
|
46
|
+
setResetValue(value);
|
|
47
|
+
});
|
|
41
48
|
var handleChange = (0, _hooks.useEventCallback)(function (value, event) {
|
|
42
49
|
setValue(value);
|
|
43
50
|
onChange === null || onChange === void 0 || onChange(value, event);
|
|
@@ -75,6 +82,7 @@ var useEditState = function useEditState(props) {
|
|
|
75
82
|
value: value,
|
|
76
83
|
onClick: handleClick,
|
|
77
84
|
onChange: handleChange,
|
|
85
|
+
onFocus: handleFocus,
|
|
78
86
|
onCancel: handleCancel,
|
|
79
87
|
onSave: handleSave,
|
|
80
88
|
onKeyDown: handleKeyDown,
|
|
@@ -12,7 +12,7 @@ export declare const pickerPropTypes: {
|
|
|
12
12
|
menuClassName: PropTypes.Requireable<string>;
|
|
13
13
|
menuStyle: PropTypes.Requireable<object>;
|
|
14
14
|
placeholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
|
-
placement: PropTypes.Requireable<"
|
|
15
|
+
placement: PropTypes.Requireable<"top" | "bottom" | "right" | "left" | "bottomStart" | "bottomEnd" | "topStart" | "topEnd" | "leftStart" | "rightStart" | "leftEnd" | "rightEnd" | "auto" | "autoVertical" | "autoVerticalStart" | "autoVerticalEnd" | "autoHorizontal" | "autoHorizontalStart" | "autoHorizontalEnd">;
|
|
16
16
|
preventOverflow: PropTypes.Requireable<boolean>;
|
|
17
17
|
open: PropTypes.Requireable<boolean>;
|
|
18
18
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
@@ -51,7 +51,7 @@ export declare const listPickerPropTypes: {
|
|
|
51
51
|
menuClassName: PropTypes.Requireable<string>;
|
|
52
52
|
menuStyle: PropTypes.Requireable<object>;
|
|
53
53
|
placeholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
54
|
-
placement: PropTypes.Requireable<"
|
|
54
|
+
placement: PropTypes.Requireable<"top" | "bottom" | "right" | "left" | "bottomStart" | "bottomEnd" | "topStart" | "topEnd" | "leftStart" | "rightStart" | "leftEnd" | "rightEnd" | "auto" | "autoVertical" | "autoVerticalStart" | "autoVerticalEnd" | "autoHorizontal" | "autoHorizontalStart" | "autoHorizontalEnd">;
|
|
55
55
|
preventOverflow: PropTypes.Requireable<boolean>;
|
|
56
56
|
open: PropTypes.Requireable<boolean>;
|
|
57
57
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
@@ -8,7 +8,7 @@ exports.useClassNames = useClassNames;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _prefix = require("../utils/prefix");
|
|
11
|
-
var
|
|
11
|
+
var _CustomContext = require("../../CustomProvider/CustomContext");
|
|
12
12
|
// This is the only way I found to break circular references between ClassArray and ClassValue
|
|
13
13
|
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
14
14
|
|
|
@@ -26,7 +26,7 @@ var _CustomProvider = require("../../CustomProvider/CustomProvider");
|
|
|
26
26
|
* - rootPrefix
|
|
27
27
|
*/
|
|
28
28
|
function useClassNames(str) {
|
|
29
|
-
var _ref = (0, _react.useContext)(
|
|
29
|
+
var _ref = (0, _react.useContext)(_CustomContext.CustomContext) || {},
|
|
30
30
|
_ref$classPrefix = _ref.classPrefix,
|
|
31
31
|
classPrefix = _ref$classPrefix === void 0 ? 'rs' : _ref$classPrefix;
|
|
32
32
|
var componentName = (0, _prefix.prefix)(classPrefix, str);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TypeAttributes } from '../types';
|
|
3
|
-
export declare function useToggleCaret(placement: TypeAttributes.Placement8 | TypeAttributes.Placement): import("react").ForwardRefExoticComponent<import("@rsuite/icons/esm/Icon").IconProps & import("react").RefAttributes<SVGElement>>;
|
|
3
|
+
export declare function useToggleCaret(placement: TypeAttributes.Placement8 | TypeAttributes.Placement): import("react").ForwardRefExoticComponent<Omit<import("@rsuite/icons/esm/Icon").IconProps, "ref"> & import("react").RefAttributes<SVGElement>>;
|
|
4
4
|
export default useToggleCaret;
|
|
@@ -15,13 +15,10 @@ var _startOfWeek = _interopRequireDefault(require("date-fns/startOfWeek"));
|
|
|
15
15
|
* @returns A list of first days of weeks in a month
|
|
16
16
|
*/
|
|
17
17
|
function getWeekStartDates(firstDayOfMonth, options) {
|
|
18
|
-
var
|
|
19
|
-
weekStart = _options$weekStart === void 0 ? 0 : _options$weekStart,
|
|
20
|
-
isoWeek = options.isoWeek,
|
|
18
|
+
var weekStart = options.weekStart,
|
|
21
19
|
locale = options.locale;
|
|
22
|
-
var weekStartsOn = isoWeek ? 1 : weekStart;
|
|
23
20
|
var firstDay = (0, _startOfWeek.default)(firstDayOfMonth, {
|
|
24
|
-
weekStartsOn:
|
|
21
|
+
weekStartsOn: weekStart,
|
|
25
22
|
locale: locale
|
|
26
23
|
});
|
|
27
24
|
var days = [firstDay];
|
|
@@ -44,6 +44,7 @@ export { default as differenceInCalendarMonths } from 'date-fns/differenceInCale
|
|
|
44
44
|
export { default as isLastDayOfMonth } from 'date-fns/isLastDayOfMonth';
|
|
45
45
|
export { default as lastDayOfMonth } from 'date-fns/lastDayOfMonth';
|
|
46
46
|
export { default as startOfToday } from 'date-fns/startOfToday';
|
|
47
|
+
export { default as getISOWeek } from 'date-fns/getISOWeek';
|
|
47
48
|
export { getWeekStartDates } from './getWeekStartDates';
|
|
48
49
|
export { getWeekKeys } from './getWeekKeys';
|
|
49
50
|
export { reverseDateRangeOmitTime } from './reverseDateRangeOmitTime';
|
|
@@ -50,6 +50,7 @@ var _exportNames = {
|
|
|
50
50
|
isLastDayOfMonth: true,
|
|
51
51
|
lastDayOfMonth: true,
|
|
52
52
|
startOfToday: true,
|
|
53
|
+
getISOWeek: true,
|
|
53
54
|
getWeekStartDates: true,
|
|
54
55
|
getWeekKeys: true,
|
|
55
56
|
reverseDateRangeOmitTime: true,
|
|
@@ -61,7 +62,7 @@ var _exportNames = {
|
|
|
61
62
|
extractTimeFormat: true,
|
|
62
63
|
calendarOnlyProps: true
|
|
63
64
|
};
|
|
64
|
-
exports.useDateMode = exports.subDays = exports.startOfWeek = exports.startOfToday = exports.startOfMonth = exports.startOfISOWeek = exports.startOfDay = exports.setYear = exports.setSeconds = exports.setMonth = exports.setMinutes = exports.setHours = exports.setDate = exports.set = exports.reverseDateRangeOmitTime = exports.parseISO = exports.parse = exports.omitHideDisabledProps = exports.lastDayOfMonth = exports.isValid = exports.isSameSecond = exports.isSameMonth = exports.isSameDay = exports.isMatch = exports.isLastDayOfMonth = exports.isEqual = exports.isBefore = exports.isAfter = exports.getYear = exports.getWeekStartDates = exports.getWeekKeys = exports.getSeconds = exports.getMonth = exports.getMinutes = exports.getHours = exports.getDaysInMonth = exports.getDay = exports.getDate = exports.format = exports.extractTimeFormat = exports.endOfWeek = exports.endOfMonth = exports.endOfISOWeek = exports.endOfDay = exports.disableTime = exports.differenceInCalendarMonths = exports.copyTime = exports.compareAsc = exports.calendarOnlyProps = exports.addYears = exports.addSeconds = exports.addMonths = exports.addMinutes = exports.addHours = exports.addDays = exports.DateMode = void 0;
|
|
65
|
+
exports.useDateMode = exports.subDays = exports.startOfWeek = exports.startOfToday = exports.startOfMonth = exports.startOfISOWeek = exports.startOfDay = exports.setYear = exports.setSeconds = exports.setMonth = exports.setMinutes = exports.setHours = exports.setDate = exports.set = exports.reverseDateRangeOmitTime = exports.parseISO = exports.parse = exports.omitHideDisabledProps = exports.lastDayOfMonth = exports.isValid = exports.isSameSecond = exports.isSameMonth = exports.isSameDay = exports.isMatch = exports.isLastDayOfMonth = exports.isEqual = exports.isBefore = exports.isAfter = exports.getYear = exports.getWeekStartDates = exports.getWeekKeys = exports.getSeconds = exports.getMonth = exports.getMinutes = exports.getISOWeek = exports.getHours = exports.getDaysInMonth = exports.getDay = exports.getDate = exports.format = exports.extractTimeFormat = exports.endOfWeek = exports.endOfMonth = exports.endOfISOWeek = exports.endOfDay = exports.disableTime = exports.differenceInCalendarMonths = exports.copyTime = exports.compareAsc = exports.calendarOnlyProps = exports.addYears = exports.addSeconds = exports.addMonths = exports.addMinutes = exports.addHours = exports.addDays = exports.DateMode = void 0;
|
|
65
66
|
var _addDays = _interopRequireDefault(require("date-fns/addDays"));
|
|
66
67
|
exports.addDays = _addDays.default;
|
|
67
68
|
var _addMonths = _interopRequireDefault(require("date-fns/addMonths"));
|
|
@@ -154,6 +155,8 @@ var _lastDayOfMonth = _interopRequireDefault(require("date-fns/lastDayOfMonth"))
|
|
|
154
155
|
exports.lastDayOfMonth = _lastDayOfMonth.default;
|
|
155
156
|
var _startOfToday = _interopRequireDefault(require("date-fns/startOfToday"));
|
|
156
157
|
exports.startOfToday = _startOfToday.default;
|
|
158
|
+
var _getISOWeek = _interopRequireDefault(require("date-fns/getISOWeek"));
|
|
159
|
+
exports.getISOWeek = _getISOWeek.default;
|
|
157
160
|
var _getWeekStartDates = require("./getWeekStartDates");
|
|
158
161
|
exports.getWeekStartDates = _getWeekStartDates.getWeekStartDates;
|
|
159
162
|
var _getWeekKeys = require("./getWeekKeys");
|
package/cjs/locales/nl_NL.js
CHANGED
|
@@ -19,7 +19,7 @@ var DateTimeFormats = {
|
|
|
19
19
|
yesterday: 'Gisteren',
|
|
20
20
|
now: 'Nu',
|
|
21
21
|
hours: 'Uren',
|
|
22
|
-
minutes: '
|
|
22
|
+
minutes: 'Minuten',
|
|
23
23
|
seconds: 'Seconden',
|
|
24
24
|
formattedMonthPattern: 'MMM, yyyy',
|
|
25
25
|
formattedDayPattern: 'dd MMM, yyyy',
|
|
@@ -43,7 +43,7 @@ var _default = exports.default = {
|
|
|
43
43
|
loading: 'Laden...',
|
|
44
44
|
emptyMessage: 'Geen data gevonden',
|
|
45
45
|
remove: 'Verwijderen',
|
|
46
|
-
clear: '
|
|
46
|
+
clear: 'Wissen'
|
|
47
47
|
},
|
|
48
48
|
Plaintext: {
|
|
49
49
|
unfilled: 'Ongevuld',
|