rsuite 5.77.1 → 5.78.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.
@@ -2,13 +2,15 @@ import React from 'react';
2
2
  import { PickerLocale } from '../locales';
3
3
  import { PickerHandle, PickerToggleProps } from '../internals/Picker';
4
4
  import { ItemDataType, FormControlPickerProps } from '../internals/types';
5
- import type { MultipleSelectProps } from '../SelectPicker';
5
+ import type { SelectProps } from '../SelectPicker';
6
6
  export type ValueType = (number | string)[];
7
- export interface CheckPickerProps<T = any> extends FormControlPickerProps<T[], PickerLocale, ItemDataType<T>>, MultipleSelectProps<T>, Pick<PickerToggleProps, 'label' | 'caretAs' | 'loading'> {
7
+ export interface CheckPickerProps<T = any> extends FormControlPickerProps<T[], PickerLocale, ItemDataType<T>>, Omit<SelectProps<T>, 'renderValue'>, Pick<PickerToggleProps, 'label' | 'caretAs' | 'loading'> {
8
8
  /** Top the selected option in the options */
9
9
  sticky?: boolean;
10
10
  /** A picker that can be counted */
11
11
  countable?: boolean;
12
+ /** Custom render selected items */
13
+ renderValue?: (value: T[], item: ItemDataType<T>[], selectedElement: React.ReactNode) => React.ReactNode;
12
14
  }
13
15
  export interface CheckPickerComponent {
14
16
  <T>(props: CheckPickerProps<T> & {
@@ -5,7 +5,7 @@ import type { ItemDataType, FormControlPickerProps } from '../internals/types';
5
5
  import type { InputPickerLocale } from '../locales';
6
6
  import type { SelectProps } from '../SelectPicker';
7
7
  export type ValueType = any;
8
- export interface InputPickerProps<V = ValueType> extends FormControlPickerProps<V, InputPickerLocale, InputItemDataType>, SelectProps<V>, Pick<PickerToggleProps, 'caretAs' | 'loading'> {
8
+ export interface InputPickerProps<V = ValueType> extends FormControlPickerProps<V, InputPickerLocale, InputItemDataType>, Omit<SelectProps<V>, 'renderValue'>, Pick<PickerToggleProps, 'caretAs' | 'loading'> {
9
9
  tabIndex?: number;
10
10
  /** Settings can create new options */
11
11
  creatable?: boolean;
@@ -26,6 +26,7 @@ export interface InputPickerProps<V = ValueType> extends FormControlPickerProps<
26
26
  * @param filteredData The items filtered by the searchKeyword
27
27
  */
28
28
  shouldDisplayCreateOption?: (searchKeyword: string, filteredData: InputItemDataType<V>[]) => boolean;
29
+ renderValue?: (value: V, item: ItemDataType<V>, selectedElement: React.ReactNode) => React.ReactNode;
29
30
  }
30
31
  /**
31
32
  * Single item selector with text box input.
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { PickerLocale } from '../locales';
3
- import { PickerComponent, PickerToggleProps } from '../internals/Picker';
4
- import { FormControlPickerProps, ItemDataType, DataItemValue } from '../internals/types';
3
+ import { PickerHandle, PickerToggleProps } from '../internals/Picker';
4
+ import { FormControlPickerProps, ItemDataType } from '../internals/types';
5
5
  import type { MultiCascadeTreeProps } from '../MultiCascadeTree';
6
- export interface MultiCascaderProps<T extends DataItemValue = any> extends FormControlPickerProps<T[], PickerLocale, ItemDataType<T>, T>, MultiCascadeTreeProps<T, T[], PickerLocale>, Pick<PickerToggleProps, 'loading'> {
6
+ export interface MultiCascaderProps<T = any> extends FormControlPickerProps<T[], PickerLocale, ItemDataType<T>, T>, MultiCascadeTreeProps<T, T[], PickerLocale>, Pick<PickerToggleProps, 'label' | 'caretAs' | 'loading'> {
7
7
  /**
8
8
  * A picker that can be counted
9
9
  */
@@ -62,9 +62,16 @@ export interface MultiCascaderProps<T extends DataItemValue = any> extends FormC
62
62
  */
63
63
  onClean?: (event: React.SyntheticEvent) => void;
64
64
  }
65
+ export interface MultiCascaderComponent {
66
+ <T>(props: MultiCascaderProps<T> & {
67
+ ref?: React.Ref<PickerHandle>;
68
+ }): JSX.Element | null;
69
+ displayName?: string;
70
+ propTypes?: React.WeakValidationMap<MultiCascaderProps<any>>;
71
+ }
65
72
  /**
66
73
  * The `MultiCascader` component is used to select multiple values from cascading options.
67
74
  * @see https://rsuitejs.com/components/multi-cascader/
68
75
  */
69
- declare const MultiCascader: PickerComponent<MultiCascaderProps<DataItemValue>>;
76
+ declare const MultiCascader: MultiCascaderComponent;
70
77
  export default MultiCascader;
@@ -25,9 +25,9 @@ export interface SelectProps<T> {
25
25
  /** Custom render menu group */
26
26
  renderMenuGroup?: (title: React.ReactNode, item: ItemDataType) => React.ReactNode;
27
27
  /** Custom render selected items */
28
- renderValue?: (value: T, item: ItemDataType | ItemDataType[], selectedElement: React.ReactNode) => React.ReactNode;
28
+ renderValue?: (value: T, item: ItemDataType<T>, selectedElement: React.ReactNode) => React.ReactNode;
29
29
  /** Called when the option is selected */
30
- onSelect?: (value: any, item: ItemDataType, event: React.SyntheticEvent) => void;
30
+ onSelect?: (value: any, item: ItemDataType<T>, event: React.SyntheticEvent) => void;
31
31
  /** Called after clicking the group title */
32
32
  onGroupTitleClick?: (event: React.SyntheticEvent) => void;
33
33
  /** Called when searching */
@@ -1,3 +1,3 @@
1
1
  import SelectPicker from './SelectPicker';
2
- export type { SelectProps, MultipleSelectProps, SelectPickerProps } from './SelectPicker';
2
+ export type { SelectProps, SelectPickerProps } from './SelectPicker';
3
3
  export default SelectPicker;
@@ -1,14 +1,17 @@
1
1
  import React from 'react';
2
2
  import { InputPickerProps } from '../InputPicker/InputPicker';
3
3
  import { TagOnlyProps } from '../InputPicker/InputPickerContext';
4
+ import type { ItemDataType } from '../internals/types';
4
5
  import type { PickerComponent } from '../internals/Picker/types';
5
6
  import type { CheckboxProps } from '../Checkbox';
6
- export interface TagPickerProps extends InputPickerProps, Partial<TagOnlyProps> {
7
+ export interface TagPickerProps<V = any> extends Omit<InputPickerProps<V>, 'renderValue'>, Partial<TagOnlyProps> {
7
8
  /**
8
9
  * Custom render checkbox on menu item
9
10
  * @version 5.47.0
10
11
  **/
11
12
  renderMenuItemCheckbox?: (checkboxProps: CheckboxProps) => React.ReactNode;
13
+ /** Custom render selected items */
14
+ renderValue?: (values: V[], items: ItemDataType<V>[], selectedElement: React.ReactNode) => React.ReactNode;
12
15
  }
13
16
  /**
14
17
  * `TagPicker` component enables multi-selection by tags and supports new options.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
- var _excluded = ["tagProps", "trigger", "onTagRemove", "renderMenuItemCheckbox"];
4
+ var _excluded = ["tagProps", "trigger", "onTagRemove", "renderMenuItemCheckbox", "renderValue"];
5
5
  import React, { useMemo } from 'react';
6
6
  import InputPicker from "../InputPicker/InputPicker.js";
7
7
  import { TagProvider } from "../InputPicker/InputPickerContext.js";
@@ -20,6 +20,7 @@ var TagPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
20
  trigger = _propsWithDefaults$tr === void 0 ? 'Enter' : _propsWithDefaults$tr,
21
21
  onTagRemove = propsWithDefaults.onTagRemove,
22
22
  renderMenuItemCheckbox = propsWithDefaults.renderMenuItemCheckbox,
23
+ renderValue = propsWithDefaults.renderValue,
23
24
  rest = _objectWithoutPropertiesLoose(propsWithDefaults, _excluded);
24
25
  var contextValue = useMemo(function () {
25
26
  return {
@@ -32,7 +33,9 @@ var TagPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
32
33
  }, [onTagRemove, renderMenuItemCheckbox, tagProps, trigger]);
33
34
  return /*#__PURE__*/React.createElement(TagProvider, {
34
35
  value: contextValue
35
- }, /*#__PURE__*/React.createElement(InputPicker, _extends({}, rest, {
36
+ }, /*#__PURE__*/React.createElement(InputPicker, _extends({
37
+ renderValue: renderValue
38
+ }, rest, {
36
39
  ref: ref
37
40
  })));
38
41
  });
@@ -179,7 +179,7 @@ export interface SVGIcon {
179
179
  id: string;
180
180
  }
181
181
  export interface ItemDataType<T = number | string> extends Record<string, any> {
182
- label?: string | React.ReactNode;
182
+ label?: React.ReactNode;
183
183
  value?: T;
184
184
  groupBy?: string;
185
185
  parent?: ItemDataType<T>;
@@ -25,6 +25,7 @@ export { default as frFR } from './fr_FR';
25
25
  export { default as jaJP } from './ja_JP';
26
26
  export { default as neNP } from './ne_NP';
27
27
  export { default as csCZ } from './cs_CZ';
28
+ export { default as plPL } from './pl_PL';
28
29
  type PickKeys<T> = {
29
30
  [keys in keyof T]?: T[keys];
30
31
  };
@@ -23,4 +23,5 @@ export { default as faIR } from "./fa_IR.js";
23
23
  export { default as frFR } from "./fr_FR.js";
24
24
  export { default as jaJP } from "./ja_JP.js";
25
25
  export { default as neNP } from "./ne_NP.js";
26
- export { default as csCZ } from "./cs_CZ.js";
26
+ export { default as csCZ } from "./cs_CZ.js";
27
+ export { default as plPL } from "./pl_PL.js";
@@ -0,0 +1,151 @@
1
+ declare const _default: {
2
+ code: string;
3
+ common: {
4
+ loading: string;
5
+ emptyMessage: string;
6
+ remove: string;
7
+ clear: string;
8
+ };
9
+ Plaintext: {
10
+ unfilled: string;
11
+ notSelected: string;
12
+ notUploaded: string;
13
+ };
14
+ Pagination: {
15
+ more: string;
16
+ prev: string;
17
+ next: string;
18
+ first: string;
19
+ last: string;
20
+ limit: string;
21
+ total: string;
22
+ skip: string;
23
+ };
24
+ DateTimeFormats: {
25
+ sunday: string;
26
+ monday: string;
27
+ tuesday: string;
28
+ wednesday: string;
29
+ thursday: string;
30
+ friday: string;
31
+ saturday: string;
32
+ ok: string;
33
+ today: string;
34
+ yesterday: string;
35
+ now: string;
36
+ hours: string;
37
+ minutes: string;
38
+ seconds: string;
39
+ formattedMonthPattern: string;
40
+ formattedDayPattern: string;
41
+ shortDateFormat: string;
42
+ shortTimeFormat: string;
43
+ dateLocale: any;
44
+ };
45
+ Calendar: {
46
+ sunday: string;
47
+ monday: string;
48
+ tuesday: string;
49
+ wednesday: string;
50
+ thursday: string;
51
+ friday: string;
52
+ saturday: string;
53
+ ok: string;
54
+ today: string;
55
+ yesterday: string;
56
+ now: string;
57
+ hours: string;
58
+ minutes: string;
59
+ seconds: string;
60
+ formattedMonthPattern: string;
61
+ formattedDayPattern: string;
62
+ shortDateFormat: string;
63
+ shortTimeFormat: string;
64
+ dateLocale: any;
65
+ };
66
+ DatePicker: {
67
+ sunday: string;
68
+ monday: string;
69
+ tuesday: string;
70
+ wednesday: string;
71
+ thursday: string;
72
+ friday: string;
73
+ saturday: string;
74
+ ok: string;
75
+ today: string;
76
+ yesterday: string;
77
+ now: string;
78
+ hours: string;
79
+ minutes: string;
80
+ seconds: string;
81
+ formattedMonthPattern: string;
82
+ formattedDayPattern: string;
83
+ shortDateFormat: string;
84
+ shortTimeFormat: string;
85
+ dateLocale: any;
86
+ };
87
+ DateRangePicker: {
88
+ last7Days: string;
89
+ sunday: string;
90
+ monday: string;
91
+ tuesday: string;
92
+ wednesday: string;
93
+ thursday: string;
94
+ friday: string;
95
+ saturday: string;
96
+ ok: string;
97
+ today: string;
98
+ yesterday: string;
99
+ now: string;
100
+ hours: string;
101
+ minutes: string;
102
+ seconds: string;
103
+ formattedMonthPattern: string;
104
+ formattedDayPattern: string;
105
+ shortDateFormat: string;
106
+ shortTimeFormat: string;
107
+ dateLocale: any;
108
+ };
109
+ Combobox: {
110
+ noResultsText: string;
111
+ placeholder: string;
112
+ searchPlaceholder: string;
113
+ checkAll: string;
114
+ };
115
+ InputPicker: {
116
+ newItem: string;
117
+ createOption: string;
118
+ noResultsText: string;
119
+ placeholder: string;
120
+ searchPlaceholder: string;
121
+ checkAll: string;
122
+ };
123
+ TagPicker: {
124
+ newItem: string;
125
+ createOption: string;
126
+ noResultsText: string;
127
+ placeholder: string;
128
+ searchPlaceholder: string;
129
+ checkAll: string;
130
+ };
131
+ Uploader: {
132
+ inited: string;
133
+ progress: string;
134
+ error: string;
135
+ complete: string;
136
+ emptyFile: string;
137
+ upload: string;
138
+ removeFile: string;
139
+ };
140
+ CloseButton: {
141
+ closeLabel: string;
142
+ };
143
+ Breadcrumb: {
144
+ expandText: string;
145
+ };
146
+ Toggle: {
147
+ on: string;
148
+ off: string;
149
+ };
150
+ };
151
+ export default _default;
@@ -0,0 +1,86 @@
1
+ 'use client';
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import pl from 'date-fns/locale/pl';
4
+ var DateTimeFormats = {
5
+ sunday: 'Ndz',
6
+ monday: 'Pon',
7
+ tuesday: 'Wt',
8
+ wednesday: 'Śr',
9
+ thursday: 'Czw',
10
+ friday: 'Pt',
11
+ saturday: 'Sob',
12
+ ok: 'OK',
13
+ today: 'Dzisiaj',
14
+ yesterday: 'Wczoraj',
15
+ now: 'Teraz',
16
+ hours: 'Godziny',
17
+ minutes: 'Minuty',
18
+ seconds: 'Sekundy',
19
+ formattedMonthPattern: 'MMM, yyyy',
20
+ formattedDayPattern: 'dd MMM, yyyy',
21
+ shortDateFormat: 'dd.MM.yyyy',
22
+ shortTimeFormat: 'HH:mm',
23
+ dateLocale: pl
24
+ };
25
+ var Combobox = {
26
+ noResultsText: 'Nie znaleziono',
27
+ placeholder: 'Wybierz',
28
+ searchPlaceholder: 'Szukaj',
29
+ checkAll: 'Wszystkie'
30
+ };
31
+ var CreatableComboBox = _extends({}, Combobox, {
32
+ newItem: 'Nowy item',
33
+ createOption: 'Stwórz opcję "{0}"'
34
+ });
35
+ export default {
36
+ code: 'pl-PL',
37
+ common: {
38
+ loading: 'Ładowanie...',
39
+ emptyMessage: 'Nie znaleziono',
40
+ remove: 'Usuń',
41
+ clear: 'Wyczyść'
42
+ },
43
+ Plaintext: {
44
+ unfilled: 'Nie wypełnione',
45
+ notSelected: 'Nie wybrane',
46
+ notUploaded: 'Nie wysłane'
47
+ },
48
+ Pagination: {
49
+ more: 'Więcej',
50
+ prev: 'Poprzednie',
51
+ next: 'Następne',
52
+ first: 'Pierwsze',
53
+ last: 'Ostatnie',
54
+ limit: '{0} / stron',
55
+ total: 'Wierszy: {0}',
56
+ skip: 'Omiń{0}'
57
+ },
58
+ DateTimeFormats: DateTimeFormats,
59
+ Calendar: DateTimeFormats,
60
+ DatePicker: DateTimeFormats,
61
+ DateRangePicker: _extends({}, DateTimeFormats, {
62
+ last7Days: 'Ostatnie 7 dni'
63
+ }),
64
+ Combobox: Combobox,
65
+ InputPicker: CreatableComboBox,
66
+ TagPicker: CreatableComboBox,
67
+ Uploader: {
68
+ inited: 'Początkowy',
69
+ progress: 'Wysyłanie',
70
+ error: 'Błąd',
71
+ complete: 'Ukończone',
72
+ emptyFile: 'Pusty',
73
+ upload: 'Wyślij',
74
+ removeFile: 'Usuń plik'
75
+ },
76
+ CloseButton: {
77
+ closeLabel: 'Zamknij'
78
+ },
79
+ Breadcrumb: {
80
+ expandText: 'Pokaż ścieżkę'
81
+ },
82
+ Toggle: {
83
+ on: 'Otwórz',
84
+ off: 'Zamknij'
85
+ }
86
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "rsuite/locales/pl_PL",
3
+ "private": true,
4
+ "main": "../../cjs/locales/pl_PL.js",
5
+ "module": "../../esm/locales/pl_PL.js",
6
+ "types": "../../esm/locales/pl_PL.d.ts"
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.77.1",
3
+ "version": "5.78.0",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",