@progress/kendo-react-listbox 10.2.0-develop.5 → 10.2.0-develop.7

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.
Files changed (3) hide show
  1. package/index.d.mts +118 -15
  2. package/index.d.ts +118 -15
  3. package/package.json +4 -4
package/index.d.mts CHANGED
@@ -64,10 +64,20 @@ export declare interface ListBoxKeyDownEvent extends BaseEvent<ListBox_2> {
64
64
  export declare interface ListBoxProps {
65
65
  /**
66
66
  * Sets a `class` of the ListBox container.
67
+ *
68
+ * @example
69
+ * ```jsx
70
+ * <ListBox className="custom-class" />
71
+ * ```
67
72
  */
68
73
  className?: string;
69
74
  /**
70
- * Sets a `id` of the ListBox container.
75
+ * Sets an `id` of the ListBox container.
76
+ *
77
+ * @example
78
+ * ```jsx
79
+ * <ListBox id="listbox-id" />
80
+ * ```
71
81
  */
72
82
  id?: string;
73
83
  /**
@@ -80,80 +90,173 @@ export declare interface ListBoxProps {
80
90
  * - null&mdash;Does not set a size `className`.
81
91
  *
82
92
  * @default `medium`
93
+ *
94
+ * @example
95
+ * ```jsx
96
+ * <ListBox size="large" />
97
+ * ```
83
98
  */
84
99
  size?: null | 'small' | 'medium' | 'large';
85
100
  /**
86
101
  * Specifies the styles which are set to the ListBox container.
102
+ *
103
+ * @example
104
+ * ```jsx
105
+ * <ListBox style={{ width: '300px' }} />
106
+ * ```
87
107
  */
88
108
  style?: React.CSSProperties;
89
109
  /**
90
- * Set the data of the ListBox.
110
+ * Sets the data of the ListBox.
111
+ *
112
+ * @example
113
+ * ```jsx
114
+ * <ListBox data={[{ text: 'Item 1' }, { text: 'Item 2' }]} />
115
+ * ```
91
116
  */
92
117
  data: Array<any>;
93
118
  /**
94
119
  * Makes the items of the ListBox draggable. The items are draggable by default.
120
+ *
121
+ * @example
122
+ * ```jsx
123
+ * <ListBox draggable={false} />
124
+ * ```
95
125
  */
96
126
  draggable?: boolean;
97
127
  /**
98
- * Set the selected field of the ListBox. Based on that value of that field, an item will be selected or not.
128
+ * Sets the selected field of the ListBox. Based on the value of this field, an item will be selected or not.
129
+ *
130
+ * @example
131
+ * ```jsx
132
+ * <ListBox selectedField="isSelected" />
133
+ * ```
99
134
  */
100
135
  selectedField?: string;
101
136
  /**
102
137
  * Sets the data item field that represents the item text. If the data contains only primitive values, do not define it.
138
+ *
139
+ * @example
140
+ * ```jsx
141
+ * <ListBox textField="name" />
142
+ * ```
103
143
  */
104
144
  textField: string;
105
145
  /**
106
- * The field that be used during form submit. Defaults to the textField if not set.
146
+ * The field that will be used during form submission. Defaults to the `textField` if not set.
147
+ *
148
+ * @example
149
+ * ```jsx
150
+ * <ListBox valueField="id" />
151
+ * ```
107
152
  */
108
153
  valueField?: string;
109
154
  /**
110
155
  * Sets the position of the toolbar of the ListBox if one is set. The ListBox may have no toolbar.
111
- * * The possible values are:
112
- * * `top`
113
- * * `bottom`
114
- * * `left`
115
- * * `right` (Default)
116
- * * `none`
156
+ *
157
+ * The possible values are:
158
+ * - `top`
159
+ * - `bottom`
160
+ * - `left`
161
+ * - `right` (Default)
162
+ * - `none`
163
+ *
164
+ * @example
165
+ * ```jsx
166
+ * <ListBox toolbarPosition="top" />
167
+ * ```
117
168
  */
118
169
  toolbarPosition?: toolbarPosition | string;
119
170
  /**
120
171
  * Renders a toolbar component next to the ListBox.
172
+ *
173
+ * @example
174
+ * ```jsx
175
+ * <ListBox toolbar={CustomToolbar} />
176
+ * ```
121
177
  */
122
178
  toolbar?: null | ComponentType<any>;
123
179
  /**
124
180
  * Defines the component that will be rendered for each item of the data collection.
181
+ *
182
+ * @example
183
+ * ```jsx
184
+ * const CustomItem = (props) => <div>{props.text}</div>;
185
+ *
186
+ * <ListBox item={CustomItem} />
187
+ * ```
125
188
  */
126
189
  item?: React.ComponentType<any>;
127
190
  /**
128
191
  * Fires when an item from the ListBox is clicked. Contains the clicked item.
192
+ *
193
+ * @example
194
+ * ```jsx
195
+ * <ListBox onItemClick={(event) => console.log(event.item)} />
196
+ * ```
129
197
  */
130
198
  onItemClick?: (event: ListBoxItemClickEvent) => void;
131
199
  /**
132
200
  * Fires when an item from the ListBox is selected. Contains the selected item.
201
+ *
202
+ * @example
203
+ * ```jsx
204
+ * <ListBox onItemSelect={(event) => console.log(event.item)} />
205
+ * ```
133
206
  */
134
207
  onItemSelect?: (event: ListBoxItemSelectEvent) => void;
135
208
  /**
136
- * Fires on keydown over the ListBox list items. It can be use to add keyboard extra keyboard navigation option.
209
+ * Fires on keydown over the ListBox list items. It can be used to add extra keyboard navigation options.
210
+ *
211
+ * @example
212
+ * ```jsx
213
+ * <ListBox onKeyDown={(event) => console.log(event.keyCode)} />
214
+ * ```
137
215
  */
138
216
  onKeyDown?: (event: ListBoxKeyDownEvent) => void;
139
217
  /**
140
- * Fires when an the user start to drag an item from the ListBox. The event contains information for the item that is being dragged.
218
+ * Fires when the user starts to drag an item from the ListBox. The event contains information about the item that is being dragged.
219
+ *
220
+ * @example
221
+ * ```jsx
222
+ * <ListBox onDragStart={(event) => console.log(event.item)} />
223
+ * ```
141
224
  */
142
225
  onDragStart?: (event: ListBoxDragEvent) => void;
143
226
  /**
144
- * Fires when an the user drags over an item from the ListBox. The event contains information for the item that is dragged over.
227
+ * Fires when the user drags over an item from the ListBox. The event contains information about the item that is dragged over.
228
+ *
229
+ * @example
230
+ * ```jsx
231
+ * <ListBox onDragOver={(event) => console.log(event.item)} />
232
+ * ```
145
233
  */
146
234
  onDragOver?: (event: ListBoxDragEvent) => void;
147
235
  /**
148
- * Fires when an the user drops an item. The event contains information for the drop target item.
236
+ * Fires when the user drops an item. The event contains information about the drop target item.
237
+ *
238
+ * @example
239
+ * ```jsx
240
+ * <ListBox onDrop={(event) => console.log(event.item)} />
241
+ * ```
149
242
  */
150
243
  onDrop?: (event: ListBoxDragEvent) => void;
151
244
  /**
152
245
  * Fires when a dragged element or text selection leaves the ListBox element.
246
+ *
247
+ * @example
248
+ * ```jsx
249
+ * <ListBox onDragLeave={(event) => console.log(event.item)} />
250
+ * ```
153
251
  */
154
252
  onDragLeave?: (event: ListBoxDragLeaveEvent) => void;
155
253
  /**
156
- * Fires when keyboard navigation action is triggered.
254
+ * Fires when a keyboard navigation action is triggered.
255
+ *
256
+ * @example
257
+ * ```jsx
258
+ * <ListBox onKeyboardNavigate={(event) => console.log(event.item)} />
259
+ * ```
157
260
  */
158
261
  onKeyboardNavigate?: (event: ListBoxItemNavigateEvent) => void;
159
262
  }
package/index.d.ts CHANGED
@@ -64,10 +64,20 @@ export declare interface ListBoxKeyDownEvent extends BaseEvent<ListBox_2> {
64
64
  export declare interface ListBoxProps {
65
65
  /**
66
66
  * Sets a `class` of the ListBox container.
67
+ *
68
+ * @example
69
+ * ```jsx
70
+ * <ListBox className="custom-class" />
71
+ * ```
67
72
  */
68
73
  className?: string;
69
74
  /**
70
- * Sets a `id` of the ListBox container.
75
+ * Sets an `id` of the ListBox container.
76
+ *
77
+ * @example
78
+ * ```jsx
79
+ * <ListBox id="listbox-id" />
80
+ * ```
71
81
  */
72
82
  id?: string;
73
83
  /**
@@ -80,80 +90,173 @@ export declare interface ListBoxProps {
80
90
  * - null&mdash;Does not set a size `className`.
81
91
  *
82
92
  * @default `medium`
93
+ *
94
+ * @example
95
+ * ```jsx
96
+ * <ListBox size="large" />
97
+ * ```
83
98
  */
84
99
  size?: null | 'small' | 'medium' | 'large';
85
100
  /**
86
101
  * Specifies the styles which are set to the ListBox container.
102
+ *
103
+ * @example
104
+ * ```jsx
105
+ * <ListBox style={{ width: '300px' }} />
106
+ * ```
87
107
  */
88
108
  style?: React.CSSProperties;
89
109
  /**
90
- * Set the data of the ListBox.
110
+ * Sets the data of the ListBox.
111
+ *
112
+ * @example
113
+ * ```jsx
114
+ * <ListBox data={[{ text: 'Item 1' }, { text: 'Item 2' }]} />
115
+ * ```
91
116
  */
92
117
  data: Array<any>;
93
118
  /**
94
119
  * Makes the items of the ListBox draggable. The items are draggable by default.
120
+ *
121
+ * @example
122
+ * ```jsx
123
+ * <ListBox draggable={false} />
124
+ * ```
95
125
  */
96
126
  draggable?: boolean;
97
127
  /**
98
- * Set the selected field of the ListBox. Based on that value of that field, an item will be selected or not.
128
+ * Sets the selected field of the ListBox. Based on the value of this field, an item will be selected or not.
129
+ *
130
+ * @example
131
+ * ```jsx
132
+ * <ListBox selectedField="isSelected" />
133
+ * ```
99
134
  */
100
135
  selectedField?: string;
101
136
  /**
102
137
  * Sets the data item field that represents the item text. If the data contains only primitive values, do not define it.
138
+ *
139
+ * @example
140
+ * ```jsx
141
+ * <ListBox textField="name" />
142
+ * ```
103
143
  */
104
144
  textField: string;
105
145
  /**
106
- * The field that be used during form submit. Defaults to the textField if not set.
146
+ * The field that will be used during form submission. Defaults to the `textField` if not set.
147
+ *
148
+ * @example
149
+ * ```jsx
150
+ * <ListBox valueField="id" />
151
+ * ```
107
152
  */
108
153
  valueField?: string;
109
154
  /**
110
155
  * Sets the position of the toolbar of the ListBox if one is set. The ListBox may have no toolbar.
111
- * * The possible values are:
112
- * * `top`
113
- * * `bottom`
114
- * * `left`
115
- * * `right` (Default)
116
- * * `none`
156
+ *
157
+ * The possible values are:
158
+ * - `top`
159
+ * - `bottom`
160
+ * - `left`
161
+ * - `right` (Default)
162
+ * - `none`
163
+ *
164
+ * @example
165
+ * ```jsx
166
+ * <ListBox toolbarPosition="top" />
167
+ * ```
117
168
  */
118
169
  toolbarPosition?: toolbarPosition | string;
119
170
  /**
120
171
  * Renders a toolbar component next to the ListBox.
172
+ *
173
+ * @example
174
+ * ```jsx
175
+ * <ListBox toolbar={CustomToolbar} />
176
+ * ```
121
177
  */
122
178
  toolbar?: null | ComponentType<any>;
123
179
  /**
124
180
  * Defines the component that will be rendered for each item of the data collection.
181
+ *
182
+ * @example
183
+ * ```jsx
184
+ * const CustomItem = (props) => <div>{props.text}</div>;
185
+ *
186
+ * <ListBox item={CustomItem} />
187
+ * ```
125
188
  */
126
189
  item?: React.ComponentType<any>;
127
190
  /**
128
191
  * Fires when an item from the ListBox is clicked. Contains the clicked item.
192
+ *
193
+ * @example
194
+ * ```jsx
195
+ * <ListBox onItemClick={(event) => console.log(event.item)} />
196
+ * ```
129
197
  */
130
198
  onItemClick?: (event: ListBoxItemClickEvent) => void;
131
199
  /**
132
200
  * Fires when an item from the ListBox is selected. Contains the selected item.
201
+ *
202
+ * @example
203
+ * ```jsx
204
+ * <ListBox onItemSelect={(event) => console.log(event.item)} />
205
+ * ```
133
206
  */
134
207
  onItemSelect?: (event: ListBoxItemSelectEvent) => void;
135
208
  /**
136
- * Fires on keydown over the ListBox list items. It can be use to add keyboard extra keyboard navigation option.
209
+ * Fires on keydown over the ListBox list items. It can be used to add extra keyboard navigation options.
210
+ *
211
+ * @example
212
+ * ```jsx
213
+ * <ListBox onKeyDown={(event) => console.log(event.keyCode)} />
214
+ * ```
137
215
  */
138
216
  onKeyDown?: (event: ListBoxKeyDownEvent) => void;
139
217
  /**
140
- * Fires when an the user start to drag an item from the ListBox. The event contains information for the item that is being dragged.
218
+ * Fires when the user starts to drag an item from the ListBox. The event contains information about the item that is being dragged.
219
+ *
220
+ * @example
221
+ * ```jsx
222
+ * <ListBox onDragStart={(event) => console.log(event.item)} />
223
+ * ```
141
224
  */
142
225
  onDragStart?: (event: ListBoxDragEvent) => void;
143
226
  /**
144
- * Fires when an the user drags over an item from the ListBox. The event contains information for the item that is dragged over.
227
+ * Fires when the user drags over an item from the ListBox. The event contains information about the item that is dragged over.
228
+ *
229
+ * @example
230
+ * ```jsx
231
+ * <ListBox onDragOver={(event) => console.log(event.item)} />
232
+ * ```
145
233
  */
146
234
  onDragOver?: (event: ListBoxDragEvent) => void;
147
235
  /**
148
- * Fires when an the user drops an item. The event contains information for the drop target item.
236
+ * Fires when the user drops an item. The event contains information about the drop target item.
237
+ *
238
+ * @example
239
+ * ```jsx
240
+ * <ListBox onDrop={(event) => console.log(event.item)} />
241
+ * ```
149
242
  */
150
243
  onDrop?: (event: ListBoxDragEvent) => void;
151
244
  /**
152
245
  * Fires when a dragged element or text selection leaves the ListBox element.
246
+ *
247
+ * @example
248
+ * ```jsx
249
+ * <ListBox onDragLeave={(event) => console.log(event.item)} />
250
+ * ```
153
251
  */
154
252
  onDragLeave?: (event: ListBoxDragLeaveEvent) => void;
155
253
  /**
156
- * Fires when keyboard navigation action is triggered.
254
+ * Fires when a keyboard navigation action is triggered.
255
+ *
256
+ * @example
257
+ * ```jsx
258
+ * <ListBox onKeyboardNavigate={(event) => console.log(event.item)} />
259
+ * ```
157
260
  */
158
261
  onKeyboardNavigate?: (event: ListBoxItemNavigateEvent) => void;
159
262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-listbox",
3
- "version": "10.2.0-develop.5",
3
+ "version": "10.2.0-develop.7",
4
4
  "description": "React ListBox enables you to display a list of items and manage the data between multiple lists. KendoReact ListBox package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,9 +26,9 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.5.1",
29
- "@progress/kendo-react-buttons": "10.2.0-develop.5",
30
- "@progress/kendo-react-common": "10.2.0-develop.5",
31
- "@progress/kendo-react-intl": "10.2.0-develop.5",
29
+ "@progress/kendo-react-buttons": "10.2.0-develop.7",
30
+ "@progress/kendo-react-common": "10.2.0-develop.7",
31
+ "@progress/kendo-react-intl": "10.2.0-develop.7",
32
32
  "@progress/kendo-svg-icons": "^4.0.0",
33
33
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
34
34
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"