chili-ui 0.18.1 → 0.20.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.
Files changed (41) hide show
  1. package/chili/components/MultiSelect/handlers.ts +10 -1
  2. package/chili/components/MultiSelect/index.tsx +4 -0
  3. package/chili/components/MultiSelect/types.ts +12 -3
  4. package/chili/components/NumericRange/index.tsx +3 -0
  5. package/chili/components/NumericRange/types.ts +2 -0
  6. package/chili/components/NumericTextBox/NumericTextBox.test.tsx +37 -29
  7. package/chili/components/NumericTextBox/handlers.ts +2 -2
  8. package/chili/components/NumericTextBox/helpers.ts +2 -1
  9. package/chili/components/NumericTextBox/hooks.tsx +4 -4
  10. package/chili/components/NumericTextBox/index.tsx +18 -15
  11. package/chili/components/NumericTextBox/types.ts +7 -5
  12. package/chili/index.ts +7 -0
  13. package/dist/components/MultiSelect/handlers.js +6 -1
  14. package/dist/components/MultiSelect/handlers.js.map +1 -1
  15. package/dist/components/MultiSelect/index.js +4 -1
  16. package/dist/components/MultiSelect/index.js.map +1 -1
  17. package/dist/components/MultiSelect/types.d.ts +12 -3
  18. package/dist/components/NumericRange/index.js +2 -2
  19. package/dist/components/NumericRange/index.js.map +1 -1
  20. package/dist/components/NumericRange/types.d.ts +2 -0
  21. package/dist/components/NumericTextBox/NumericTextBox.test.js +33 -29
  22. package/dist/components/NumericTextBox/NumericTextBox.test.js.map +1 -1
  23. package/dist/components/NumericTextBox/handlers.d.ts +1 -1
  24. package/dist/components/NumericTextBox/handlers.js +1 -1
  25. package/dist/components/NumericTextBox/handlers.js.map +1 -1
  26. package/dist/components/NumericTextBox/helpers.js +1 -1
  27. package/dist/components/NumericTextBox/helpers.js.map +1 -1
  28. package/dist/components/NumericTextBox/hooks.js +2 -2
  29. package/dist/components/NumericTextBox/hooks.js.map +1 -1
  30. package/dist/components/NumericTextBox/index.js +5 -5
  31. package/dist/components/NumericTextBox/index.js.map +1 -1
  32. package/dist/components/NumericTextBox/types.d.ts +7 -5
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js.map +1 -1
  35. package/docs/src/app/form-components/multi-select/Demos.tsx +1 -0
  36. package/docs/src/app/form-components/multi-select/page.tsx +6 -0
  37. package/docs/src/app/form-components/numeric-range/Demos.tsx +2 -0
  38. package/docs/src/app/form-components/numeric-range/page.tsx +13 -3
  39. package/docs/src/app/form-components/numeric-text-box/Demos.tsx +1 -0
  40. package/docs/src/app/form-components/numeric-text-box/page.tsx +6 -1
  41. package/package.json +1 -1
@@ -164,7 +164,7 @@ export const createKeyDownHandler = (props: MultiSelectProps, extraData: KeyDown
164
164
  } = props;
165
165
 
166
166
  const {
167
- filterValue, highlightedSuggestion, setHighlightedSuggestion, handleSelect, value,
167
+ filterValue, highlightedSuggestion, setHighlightedSuggestion, handleSelect, name, onEnterPress, validateCurrent, value,
168
168
  } = extraData;
169
169
 
170
170
  if (!data) return;
@@ -213,6 +213,15 @@ export const createKeyDownHandler = (props: MultiSelectProps, extraData: KeyDown
213
213
  }
214
214
 
215
215
  if (ev.key === 'Enter') {
216
+ onEnterPress?.({
217
+ ...ev,
218
+ component: {
219
+ isValid: validateCurrent(),
220
+ name,
221
+ value,
222
+ },
223
+ });
224
+
216
225
  if (!highlightedSuggestion) return;
217
226
 
218
227
  setHighlightedSuggestion(null);
@@ -63,6 +63,7 @@ export const MultiSelect = React.forwardRef((props: MultiSelectProps, ref: React
63
63
  noSuggestionsRender,
64
64
  onBlur,
65
65
  onChange,
66
+ onEnterPress,
66
67
  onFocus,
67
68
  placeholder,
68
69
  requiredMessage,
@@ -142,8 +143,11 @@ export const MultiSelect = React.forwardRef((props: MultiSelectProps, ref: React
142
143
  filterValue,
143
144
  handleSelect,
144
145
  highlightedSuggestion,
146
+ name,
147
+ onEnterPress,
145
148
  setFocused,
146
149
  setHighlightedSuggestion,
150
+ validateCurrent,
147
151
  value,
148
152
  });
149
153
 
@@ -65,6 +65,7 @@ export interface BlurEvent<T = Value> extends React.FocusEvent<HTMLInputElement>
65
65
 
66
66
  export interface EnterPressEvent<T = Value> extends React.KeyboardEvent<HTMLInputElement> {
67
67
  component: {
68
+ isValid?: boolean,
68
69
  name?: string,
69
70
  value: T[],
70
71
  },
@@ -77,7 +78,10 @@ export interface FocusEvent<T = Value> extends React.FocusEvent<HTMLInputElement
77
78
  },
78
79
  }
79
80
 
80
- export type ChangeEvent<T = Value> = MouseSelectEvent<T> | EnterSelectEvent<T> | ClearEvent<T> | ResetEvent<T>;
81
+ export type MultiSelectBlurEvent<T = Value> = BlurEvent<T>;
82
+ export type MultiSelectChangeEvent<T = Value> = MouseSelectEvent<T> | EnterSelectEvent<T> | ClearEvent<T> | ResetEvent<T>;
83
+ export type MultiSelectEnterPressEvent<T = Value> = EnterPressEvent<T>;
84
+ export type MultiSelectFocusEvent<T = Value> = FocusEvent<T>;
81
85
 
82
86
  export interface MultiSelectMessages {
83
87
  nothingFound?: React.ReactNode,
@@ -125,9 +129,11 @@ export interface MultiSelectProps<T extends MultiSelectValue | null | undefined
125
129
  /** No suggestions test customizator */
126
130
  noSuggestionsRender?: CustomRender<SuggestionListProps, Record<string, never>, NoSuggestionsProps>,
127
131
  /** Blur handler */
128
- onBlur?: (event: FocusEvent) => void,
132
+ onBlur?: (event: BlurEvent) => void,
129
133
  /** Change handler */
130
- onChange?: (event: ChangeEvent) => void,
134
+ onChange?: (event: MultiSelectChangeEvent) => void,
135
+ /** Enter press handler */
136
+ onEnterPress?: (event: EnterPressEvent) => void,
131
137
  /** Focus handler */
132
138
  onFocus?: (event: FocusEvent) => void,
133
139
  /** Placeholder */
@@ -224,8 +230,11 @@ export interface KeyDownData {
224
230
  filterValue: string,
225
231
  handleSelect: CustomEventHandler<React.MouseEvent<HTMLElement> & SuggestionTarget>,
226
232
  highlightedSuggestion: Value,
233
+ name?: string,
234
+ onEnterPress?: MultiSelectProps['onEnterPress'],
227
235
  setFocused: SetState<boolean>,
228
236
  setHighlightedSuggestion: SetState<Value>,
237
+ validateCurrent: () => boolean,
229
238
  value: MultiSelectValue,
230
239
  }
231
240
 
@@ -25,6 +25,7 @@ export const NumericRange = React.forwardRef((props: NumericRangeProps, ref?: Re
25
25
  defaultValue: defaultValueProp,
26
26
  form,
27
27
  format,
28
+ hasStepper: hasStepperProp,
28
29
  inputsRender,
29
30
  isDisabled,
30
31
  isRequired: isRequiredProp,
@@ -120,6 +121,7 @@ export const NumericRange = React.forwardRef((props: NumericRangeProps, ref?: Re
120
121
  >
121
122
  <NumericTextBox
122
123
  inputRender={Array.isArray(inputsRender) ? inputsRender[0] : undefined}
124
+ hasStepper={hasStepperProp}
123
125
  isDisabled={disabled[0]}
124
126
  isRequired={required[0]}
125
127
  max={isNil(value[1]) ? max : value[1]}
@@ -137,6 +139,7 @@ export const NumericRange = React.forwardRef((props: NumericRangeProps, ref?: Re
137
139
  <Div className={theme.delimiter}>&mdash;</Div>
138
140
  <NumericTextBox
139
141
  inputRender={Array.isArray(inputsRender) ? inputsRender[1] : undefined}
142
+ hasStepper={hasStepperProp}
140
143
  isDisabled={disabled[1]}
141
144
  isRequired={required[1]}
142
145
  max={max}
@@ -55,6 +55,8 @@ export interface NumericRangeProps {
55
55
  format?: string,
56
56
  /** Form name, is required for validation */
57
57
  form?: string,
58
+ /** Whether or not to show stepper buttons */
59
+ hasStepper?: boolean,
58
60
  /** Input fields customizators, [render, render] */
59
61
  inputsRender?: [NumericTextBoxProps['inputRender'] | null, NumericTextBoxProps['inputRender'] | null],
60
62
  /** Disabled state */
@@ -8,9 +8,17 @@ import {
8
8
  } from './index';
9
9
 
10
10
  describe('NumericTextBox SNAPSHOTS', () => {
11
+ it('should not render stepper by default', () => {
12
+ render((
13
+ <NumericTextBox />
14
+ ));
15
+
16
+ expect(document.querySelector('.chili-numeric-arrows')).toBeNull();
17
+ });
18
+
11
19
  it('should render', () => {
12
20
  const wrapper = render((
13
- <NumericTextBox />
21
+ <NumericTextBox hasStepper />
14
22
  ));
15
23
 
16
24
  expect(wrapper.container).toMatchSnapshot();
@@ -19,7 +27,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
19
27
  describe('controllable mode', () => {
20
28
  it('should render format', () => {
21
29
  const wrapper = render((
22
- <NumericTextBox format="#,## %" value={0.235813} />
30
+ <NumericTextBox hasStepper format="#,## %" value={0.235813} />
23
31
  ));
24
32
 
25
33
  expect(screen.getByRole('textbox')).toHaveValue('0,24 %');
@@ -27,7 +35,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
27
35
  expect(wrapper.container).toMatchSnapshot();
28
36
 
29
37
  wrapper.rerender((
30
- <NumericTextBox format="#,#### ₽" value={0.235813} />
38
+ <NumericTextBox hasStepper format="#,#### ₽" value={0.235813} />
31
39
  ));
32
40
 
33
41
  // todo fix precision
@@ -39,7 +47,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
39
47
  it('should render min', () => {
40
48
  // todo: починить снапшоты, они просто зависают
41
49
  const wrapper = render((
42
- <NumericTextBox min={-2} />
50
+ <NumericTextBox hasStepper min={-2} />
43
51
  ));
44
52
 
45
53
  screen.getByRole('textbox').focus();
@@ -57,7 +65,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
57
65
  expect(wrapper.container).toMatchSnapshot();
58
66
 
59
67
  wrapper.rerender((
60
- <NumericTextBox format="#,#" min={-6.2} />
68
+ <NumericTextBox hasStepper format="#,#" min={-6.2} />
61
69
  ));
62
70
 
63
71
  screen.getByRole('textbox').focus();
@@ -78,7 +86,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
78
86
  it('should render max', () => {
79
87
  // todo: починить снапшоты, они просто зависают
80
88
  const wrapper = render((
81
- <NumericTextBox format="#,#" max={7.3} />
89
+ <NumericTextBox hasStepper format="#,#" max={7.3} />
82
90
  ));
83
91
 
84
92
  screen.getByRole('textbox').focus();
@@ -96,7 +104,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
96
104
  expect(wrapper.container).toMatchSnapshot();
97
105
 
98
106
  wrapper.rerender((
99
- <NumericTextBox format="#,#" max={10.4} />
107
+ <NumericTextBox hasStepper format="#,#" max={10.4} />
100
108
  ));
101
109
 
102
110
  screen.getByRole('textbox').focus();
@@ -115,7 +123,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
115
123
  it('should render step', () => {
116
124
  // todo: починить снапшоты, они просто зависают
117
125
  const wrapper = render((
118
- <NumericTextBox min={0} step={2} />
126
+ <NumericTextBox hasStepper min={0} step={2} />
119
127
  ));
120
128
 
121
129
  screen.getByRole('textbox').focus();
@@ -131,7 +139,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
131
139
  expect(wrapper.container).toMatchSnapshot();
132
140
 
133
141
  wrapper.rerender((
134
- <NumericTextBox min={0} step={0.1} format="#,#" />
142
+ <NumericTextBox hasStepper min={0} step={0.1} format="#,#" />
135
143
  ));
136
144
 
137
145
  screen.getByRole('textbox').focus();
@@ -149,7 +157,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
149
157
 
150
158
  it('should render value', () => {
151
159
  const wrapper = render((
152
- <NumericTextBox format="#,## %" value={0.235813} />
160
+ <NumericTextBox hasStepper format="#,## %" value={0.235813} />
153
161
  ));
154
162
 
155
163
  expect(screen.getByRole('textbox')).toHaveValue('0,24 %');
@@ -157,7 +165,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
157
165
  expect(wrapper.container).toMatchSnapshot();
158
166
 
159
167
  wrapper.rerender((
160
- <NumericTextBox format="#,## %" value={0.687421} />
168
+ <NumericTextBox hasStepper format="#,## %" value={0.687421} />
161
169
  ));
162
170
 
163
171
  expect(screen.getByRole('textbox')).toHaveValue('0,69 %');
@@ -171,7 +179,7 @@ describe('NumericTextBox SNAPSHOTS', () => {
171
179
  const placeholder = 'placeholder';
172
180
 
173
181
  const wrapper = render((
174
- <NumericTextBox placeholder={placeholder} />
182
+ <NumericTextBox hasStepper placeholder={placeholder} />
175
183
  ));
176
184
 
177
185
  expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', placeholder);
@@ -186,7 +194,7 @@ describe('NumericTextBox HANDLERS', () => {
186
194
  const handleBlur = jest.fn();
187
195
 
188
196
  render((
189
- <NumericTextBox onBlur={handleBlur} />
197
+ <NumericTextBox hasStepper onBlur={handleBlur} />
190
198
  ));
191
199
 
192
200
  screen.getByRole('textbox').focus();
@@ -199,7 +207,7 @@ describe('NumericTextBox HANDLERS', () => {
199
207
  const handleChange = jest.fn();
200
208
 
201
209
  render((
202
- <NumericTextBox onChange={handleChange} />
210
+ <NumericTextBox hasStepper onChange={handleChange} />
203
211
  ));
204
212
 
205
213
  userEvent.type(screen.getByRole('textbox'), '25');
@@ -213,7 +221,7 @@ describe('NumericTextBox HANDLERS', () => {
213
221
  const handleFocus = jest.fn();
214
222
 
215
223
  render((
216
- <NumericTextBox onFocus={handleFocus} />
224
+ <NumericTextBox hasStepper onFocus={handleFocus} />
217
225
  ));
218
226
 
219
227
  screen.getByRole('textbox').focus();
@@ -225,7 +233,7 @@ describe('NumericTextBox HANDLERS', () => {
225
233
  const handleChange = jest.fn();
226
234
 
227
235
  render((
228
- <NumericTextBox name="test" onChange={handleChange} />
236
+ <NumericTextBox hasStepper name="test" onChange={handleChange} />
229
237
  ));
230
238
 
231
239
  userEvent.type(screen.getByRole('textbox'), '25');
@@ -242,7 +250,7 @@ describe('NumericTextBox HANDLERS', () => {
242
250
  const handleBlur = jest.fn();
243
251
 
244
252
  render((
245
- <NumericTextBox value={25} name="test" onBlur={handleBlur} />
253
+ <NumericTextBox hasStepper value={25} name="test" onBlur={handleBlur} />
246
254
  ));
247
255
 
248
256
  screen.getByRole('textbox').focus();
@@ -259,7 +267,7 @@ describe('NumericTextBox HANDLERS', () => {
259
267
  describe('different ways to change value', () => {
260
268
  it('should change value by clicking upper spinner', () => {
261
269
  render((
262
- <NumericTextBox defaultValue={0} />
270
+ <NumericTextBox hasStepper defaultValue={0} />
263
271
  ));
264
272
 
265
273
  expect(screen.getByRole('textbox')).toHaveValue('0');
@@ -275,7 +283,7 @@ describe('NumericTextBox HANDLERS', () => {
275
283
 
276
284
  it('should change value by clicking lower spinner', () => {
277
285
  render((
278
- <NumericTextBox defaultValue={0} />
286
+ <NumericTextBox hasStepper defaultValue={0} />
279
287
  ));
280
288
 
281
289
  expect(screen.getByRole('textbox')).toHaveValue('0');
@@ -291,7 +299,7 @@ describe('NumericTextBox HANDLERS', () => {
291
299
 
292
300
  it('should change value by input numbers', () => {
293
301
  render((
294
- <NumericTextBox defaultValue={0} />
302
+ <NumericTextBox hasStepper defaultValue={0} />
295
303
  ));
296
304
 
297
305
  expect(screen.getByRole('textbox')).toHaveValue('0');
@@ -306,7 +314,7 @@ describe('NumericTextBox HANDLERS', () => {
306
314
 
307
315
  it('should round value according to current format', () => {
308
316
  render((
309
- <NumericTextBox format="#,## %" value={0.235813} />
317
+ <NumericTextBox hasStepper format="#,## %" value={0.235813} />
310
318
  ));
311
319
 
312
320
  expect(screen.getByRole('textbox')).toHaveValue('0,24 %');
@@ -314,7 +322,7 @@ describe('NumericTextBox HANDLERS', () => {
314
322
 
315
323
  it('should change format onFocus', () => {
316
324
  render((
317
- <NumericTextBox format="#,## %" value={0.235813} />
325
+ <NumericTextBox hasStepper format="#,## %" value={0.235813} />
318
326
  ));
319
327
 
320
328
  expect(screen.getByRole('textbox')).toHaveValue('0,24 %');
@@ -326,7 +334,7 @@ describe('NumericTextBox HANDLERS', () => {
326
334
 
327
335
  it('should change format onBlur', () => {
328
336
  render((
329
- <NumericTextBox format="#,## %" value={0.235813} />
337
+ <NumericTextBox hasStepper format="#,## %" value={0.235813} />
330
338
  ));
331
339
 
332
340
  expect(screen.getByRole('textbox')).toHaveValue('0,24 %');
@@ -345,7 +353,7 @@ describe('NumericTextBox ATTRIBUTES', () => {
345
353
  describe('format', () => {
346
354
  it('should have number format', () => {
347
355
  render((
348
- <NumericTextBox format="#,##" value={0.235813} />
356
+ <NumericTextBox hasStepper format="#,##" value={0.235813} />
349
357
  ));
350
358
 
351
359
  expect(screen.getByRole('textbox')).toHaveValue('0,24');
@@ -353,7 +361,7 @@ describe('NumericTextBox ATTRIBUTES', () => {
353
361
 
354
362
  it('should have currency format', () => {
355
363
  render((
356
- <NumericTextBox format="#,## ₽" value={0.235813} />
364
+ <NumericTextBox hasStepper format="#,## ₽" value={0.235813} />
357
365
  ));
358
366
 
359
367
  expect(screen.getByRole('textbox')).toHaveValue('0,24 ₽');
@@ -361,7 +369,7 @@ describe('NumericTextBox ATTRIBUTES', () => {
361
369
 
362
370
  it('should have percent format', () => {
363
371
  render((
364
- <NumericTextBox format="#,## %" value={0.235813} />
372
+ <NumericTextBox hasStepper format="#,## %" value={0.235813} />
365
373
  ));
366
374
 
367
375
  expect(screen.getByRole('textbox')).toHaveValue('0,24 %');
@@ -369,7 +377,7 @@ describe('NumericTextBox ATTRIBUTES', () => {
369
377
 
370
378
  it('should have custom format', () => {
371
379
  render((
372
- <NumericTextBox format="#,####### tests" value={1080.235813} />
380
+ <NumericTextBox hasStepper format="#,####### tests" value={1080.235813} />
373
381
  ));
374
382
 
375
383
  expect(screen.getByRole('textbox')).toHaveValue('1 080,2358130 tests');
@@ -384,7 +392,7 @@ describe('NumericTextBox VALIDATION', () => {
384
392
  const validator = (value: string): boolean => value.toString().length >= 4;
385
393
 
386
394
  render((
387
- <NumericTextBox isRequired form="test" name="test" onBlur={handleBlur} validator={validator} invalidMessage="message" />
395
+ <NumericTextBox hasStepper isRequired form="test" name="test" onBlur={handleBlur} validator={validator} invalidMessage="message" />
388
396
  ));
389
397
 
390
398
  screen.getByRole('textbox').focus();
@@ -444,7 +452,7 @@ describe('NumericTextBox VALIDATION', () => {
444
452
  const handleBlur = jest.fn();
445
453
 
446
454
  render((
447
- <NumericTextBox isRequired form="test" name="test" onBlur={handleBlur} />
455
+ <NumericTextBox hasStepper isRequired form="test" name="test" onBlur={handleBlur} />
448
456
  ));
449
457
 
450
458
  screen.getByRole('textbox').focus();
@@ -214,7 +214,7 @@ export const createPasteHandler = (
214
214
  setUncontrolledValue(newValue);
215
215
  };
216
216
 
217
- export const createArrowButtonClick = (
217
+ export const createStepperClick = (
218
218
  value: number | null,
219
219
  onChange: CustomEventHandler<ChangeEvent> | undefined,
220
220
  onClick: React.MouseEventHandler | undefined,
@@ -228,7 +228,7 @@ export const createArrowButtonClick = (
228
228
  min?: number,
229
229
  max?: number,
230
230
  name?: string,
231
- ): NumericHandlers['handleArrowButtonClick'] => (type) => (event) => {
231
+ ): NumericHandlers['handleStepperClick'] => (type) => (event) => {
232
232
  if (isDisabled) return;
233
233
 
234
234
  const sign = (() => {
@@ -194,9 +194,9 @@ export const normalizeValue = ({
194
194
 
195
195
  export const getRestProps = (props: NumericTextBoxProps): WrapperProps => {
196
196
  const {
197
- arrowButtonsRender,
198
197
  defaultValue,
199
198
  format,
199
+ hasStepper,
200
200
  inputRender,
201
201
  className,
202
202
  max,
@@ -210,6 +210,7 @@ export const getRestProps = (props: NumericTextBoxProps): WrapperProps => {
210
210
  onFocus,
211
211
  prefixRender,
212
212
  step,
213
+ stepperRender,
213
214
  isDisabled,
214
215
  isRequired,
215
216
  isValid: isValidProp,
@@ -31,10 +31,10 @@ export const useCustomElements = (props: NumericTextBoxProps, state: NumericText
31
31
  state,
32
32
  );
33
33
 
34
- const ArrowButtons = useElement(
35
- 'ArrowButtons',
34
+ const Stepper = useElement(
35
+ 'Stepper',
36
36
  Div,
37
- props.arrowButtonsRender || numericRenders.arrowButtonsRender,
37
+ props.stepperRender || numericRenders.stepperRender,
38
38
  props,
39
39
  state,
40
40
  );
@@ -42,7 +42,7 @@ export const useCustomElements = (props: NumericTextBoxProps, state: NumericText
42
42
  return {
43
43
  Wrapper,
44
44
  Input,
45
- ArrowButtons,
45
+ Stepper,
46
46
  };
47
47
  };
48
48
 
@@ -8,7 +8,6 @@ import {
8
8
  import { Div } from '../Div';
9
9
  import { useValidation } from '../Validation';
10
10
  import {
11
- createArrowButtonClick,
12
11
  createBlurHandler,
13
12
  createChangeHandler,
14
13
  createFocusHandler,
@@ -16,6 +15,7 @@ import {
16
15
  createPasteHandler,
17
16
  createResetHandler,
18
17
  createSetValueHandler,
18
+ createStepperClick,
19
19
  } from './handlers';
20
20
  import {
21
21
  formatInputValue, formatValue, getRestProps, getValue, normalizeValue,
@@ -32,6 +32,7 @@ export const NumericTextBox = React.forwardRef((props: NumericTextBoxProps, ref:
32
32
  defaultValue = null,
33
33
  form,
34
34
  format = '#',
35
+ hasStepper = false,
35
36
  isDisabled,
36
37
  isRequired,
37
38
  max = DEFAULT_VALUES.maxValue,
@@ -98,12 +99,12 @@ export const NumericTextBox = React.forwardRef((props: NumericTextBoxProps, ref:
98
99
  const handleChange = createChangeHandler(value, onChange, setUncontrolledValue, setInputValue, format, thousandsSeparator, name);
99
100
  const handleKeyDown = createKeyDownHandler(value, onChange, onEnterPress, setUncontrolledValue, setInputValue, step, thousandsSeparator, format, name);
100
101
  const handlePaste = createPasteHandler(onChange, setUncontrolledValue, format, thousandsSeparator, name);
101
- const handleArrowButtonClick = createArrowButtonClick(value, onChange, onClick, isDisabled, setUncontrolledValue, setInputValue, validateCurrent, step, thousandsSeparator, format, min, max, name);
102
+ const handleStepperClick = createStepperClick(value, onChange, onClick, isDisabled, setUncontrolledValue, setInputValue, validateCurrent, step, thousandsSeparator, format, min, max, name);
102
103
 
103
104
  const {
104
105
  Wrapper,
105
106
  Input,
106
- ArrowButtons,
107
+ Stepper,
107
108
  } = useCustomElements(props, { value, isFocused });
108
109
 
109
110
  useSyncedValue(valueProp, isFocused, format, thousandsSeparator, setInputValue);
@@ -146,18 +147,20 @@ export const NumericTextBox = React.forwardRef((props: NumericTextBoxProps, ref:
146
147
  ref={inputRef}
147
148
  value={getComponentValue}
148
149
  />
149
- <ArrowButtons className={theme.arrowButtons} onClick={(event) => event.stopPropagation()}>
150
- <Icon
151
- icon={IconTypes.Icons.ChevronUp}
152
- className={theme.arrowUp}
153
- onClick={handleArrowButtonClick('increase')}
154
- />
155
- <Icon
156
- icon={IconTypes.Icons.ChevronDown}
157
- className={theme.arrowDown}
158
- onClick={handleArrowButtonClick('decrease')}
159
- />
160
- </ArrowButtons>
150
+ {hasStepper && (
151
+ <Stepper className={theme.arrowButtons} onClick={(event) => event.stopPropagation()}>
152
+ <Icon
153
+ icon={IconTypes.Icons.ChevronUp}
154
+ className={theme.arrowUp}
155
+ onClick={handleStepperClick('increase')}
156
+ />
157
+ <Icon
158
+ icon={IconTypes.Icons.ChevronDown}
159
+ className={theme.arrowDown}
160
+ onClick={handleStepperClick('decrease')}
161
+ />
162
+ </Stepper>
163
+ )}
161
164
  </Div>
162
165
  {
163
166
  !isFocused && !isDisabled && (
@@ -91,12 +91,12 @@ export interface FocusEvent extends React.FocusEvent<HTMLInputElement> {
91
91
  }
92
92
 
93
93
  export interface NumericTextBoxProps extends ValidationProps {
94
- /** Arrow buttons customizator */
95
- arrowButtonsRender?: CustomRender<NumericTextBoxProps, NumericTextBoxState, ArrowButtonsProps>,
96
94
  /** Default value */
97
95
  defaultValue?: number | null,
98
96
  /** Format, see: formatting.md, "#" by default */
99
97
  format?: string,
98
+ /** Whether or not to show stepper buttons */
99
+ hasStepper?: boolean,
100
100
  /** Input customizator */
101
101
  inputRender?: CustomRender<NumericTextBoxProps, NumericTextBoxState, InputProps> | null,
102
102
  /** Disabled state */
@@ -123,6 +123,8 @@ export interface NumericTextBoxProps extends ValidationProps {
123
123
  shouldTrimTrailingZeros?: boolean,
124
124
  /** Step */
125
125
  step?: number,
126
+ /** Stepper customizator */
127
+ stepperRender?: CustomRender<NumericTextBoxProps, NumericTextBoxState, StepperProps>,
126
128
  /** Theme */
127
129
  theme?: PartialGlobalDefaultTheme[typeof COMPONENTS_NAMESPACES.numericTextBox],
128
130
  /** A space by default: 1 000 000.00 */
@@ -149,14 +151,14 @@ export interface NumericHandlers {
149
151
  handleChange: CustomEventHandler<React.ChangeEvent<HTMLInputElement>>,
150
152
  handleKeyDown: CustomEventHandler<React.KeyboardEvent<HTMLInputElement>>,
151
153
  handlePaste: CustomEventHandler<React.ClipboardEvent<HTMLInputElement>>,
152
- handleArrowButtonClick: (type: 'increase' | 'decrease') => CustomEventHandler<React.MouseEvent<SVGElement>>,
154
+ handleStepperClick: (type: 'increase' | 'decrease') => CustomEventHandler<React.MouseEvent<SVGElement>>,
153
155
  }
154
156
 
155
157
  export interface WrapperProps extends React.HTMLAttributes<HTMLDivElement> {
156
158
  ref?: React.Ref<HTMLElement>,
157
159
  }
158
160
 
159
- export type ArrowButtonsProps = React.HTMLAttributes<HTMLDivElement>;
161
+ export type StepperProps = React.HTMLAttributes<HTMLDivElement>;
160
162
 
161
163
  export interface InputProps extends React.HTMLAttributes<HTMLInputElement> {
162
164
  disabled?: boolean,
@@ -169,7 +171,7 @@ export interface InputProps extends React.HTMLAttributes<HTMLInputElement> {
169
171
  export interface CustomElements {
170
172
  Wrapper: React.FC<DivProps>,
171
173
  Input: React.FC<InputProps>,
172
- ArrowButtons: React.FC<ArrowButtonsProps>,
174
+ Stepper: React.FC<StepperProps>,
173
175
  }
174
176
 
175
177
  export type NormalizeParameters = {
package/chili/index.ts CHANGED
@@ -118,6 +118,13 @@ import * as commonTypes from './commonTypes';
118
118
  import { form, getPersistedForm, setPersistedForm } from './form';
119
119
  import { Persistence } from './components/Validation/types';
120
120
 
121
+ export type {
122
+ MultiSelectBlurEvent,
123
+ MultiSelectChangeEvent,
124
+ MultiSelectEnterPressEvent,
125
+ MultiSelectFocusEvent,
126
+ } from './components/MultiSelect/types';
127
+
121
128
  export type {
122
129
  NumericRangeBlurEvent,
123
130
  NumericRangeChangeEvent,
@@ -99,7 +99,7 @@ export const createMouseDownHandler = (props, extraData) => (ev) => {
99
99
  };
100
100
  export const createKeyDownHandler = (props, extraData) => (ev) => {
101
101
  const { data, textField, filterRule, compareObjectsBy, maxTags, } = props;
102
- const { filterValue, highlightedSuggestion, setHighlightedSuggestion, handleSelect, value, } = extraData;
102
+ const { filterValue, highlightedSuggestion, setHighlightedSuggestion, handleSelect, name, onEnterPress, validateCurrent, value, } = extraData;
103
103
  if (!data)
104
104
  return;
105
105
  const filteredData = filterData({
@@ -135,6 +135,11 @@ export const createKeyDownHandler = (props, extraData) => (ev) => {
135
135
  return;
136
136
  }
137
137
  if (ev.key === 'Enter') {
138
+ onEnterPress === null || onEnterPress === void 0 ? void 0 : onEnterPress(Object.assign(Object.assign({}, ev), { component: {
139
+ isValid: validateCurrent(),
140
+ name,
141
+ value,
142
+ } }));
138
143
  if (!highlightedSuggestion)
139
144
  return;
140
145
  setHighlightedSuggestion(null);
@@ -1 +1 @@
1
- {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../chili/components/MultiSelect/handlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAa3C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAuB,EAAE,SAAoB,EAA6C,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE;IACrI,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEhC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IAExC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,MAAM,WAAW,mCACZ,EAAE,KACL,SAAS,EAAE;gBACT,IAAI;gBACJ,KAAK;aACN,GACF,CAAC;QAEF,OAAO,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;IAED,UAAU,CAAC,IAAI,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,SAAmB,EAA6C,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE;IACnI,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE/B,MAAM,EACJ,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,GACnD,G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