@coreui/react-pro 4.12.0-beta.3 → 4.12.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 (34) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/dist/components/dropdown/CDropdown.d.ts +1 -1
  4. package/dist/components/multi-select/CMultiSelect.d.ts +2 -2
  5. package/dist/components/popover/CPopover.d.ts +3 -3
  6. package/dist/components/tooltip/CTooltip.d.ts +3 -3
  7. package/dist/hooks/index.d.ts +1 -2
  8. package/dist/index.es.js +72 -120
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +71 -120
  11. package/dist/index.js.map +1 -1
  12. package/package.json +11 -11
  13. package/src/components/date-range-picker/CDateRangePicker.tsx +40 -20
  14. package/src/components/dropdown/CDropdown.tsx +1 -1
  15. package/src/components/multi-select/CMultiSelect.tsx +8 -17
  16. package/src/components/multi-select/CMultiSelectSelection.tsx +3 -1
  17. package/src/components/picker/CPicker.tsx +11 -2
  18. package/src/components/popover/CPopover.tsx +3 -3
  19. package/src/components/time-picker/CTimePicker.tsx +33 -16
  20. package/src/components/tooltip/CTooltip.tsx +3 -3
  21. package/src/hooks/index.ts +1 -2
  22. package/src/utils/getRTLPlacement.ts +1 -1
  23. package/dist/components/date-range-picker/CDateRangePicker copy.d.ts +0 -114
  24. package/dist/components/multi-select-new/CMultiSelect.d.ts +0 -133
  25. package/dist/components/multi-select-new/CMultiSelectNativeSelect.d.ts +0 -7
  26. package/dist/components/multi-select-new/CMultiSelectNew.d.ts +0 -121
  27. package/dist/components/multi-select-new/CMultiSelectOptions.d.ts +0 -16
  28. package/dist/components/multi-select-new/CMultiSelectSelection.d.ts +0 -11
  29. package/dist/components/multi-select-new/index.d.ts +0 -2
  30. package/dist/components/multi-select-new/types.d.ts +0 -15
  31. package/dist/components/multi-select-new/utils.d.ts +0 -11
  32. package/dist/components/picker/CPicker copy.d.ts +0 -82
  33. package/dist/components/picker copy/CPicker.d.ts +0 -82
  34. package/dist/components/smart-table/CSmartTableCleaner.d.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/react-pro",
3
- "version": "4.12.0-beta.3",
3
+ "version": "4.12.0",
4
4
  "description": "UI Components Library for React.js",
5
5
  "keywords": [
6
6
  "react",
@@ -40,31 +40,31 @@
40
40
  "@coreui/icons": "^3.0.1",
41
41
  "@coreui/icons-react": "^2.1.0",
42
42
  "@popperjs/core": "^2.11.8",
43
- "@rollup/plugin-commonjs": "^25.0.1",
43
+ "@rollup/plugin-commonjs": "^25.0.2",
44
44
  "@rollup/plugin-node-resolve": "^15.1.0",
45
- "@rollup/plugin-typescript": "^11.1.1",
45
+ "@rollup/plugin-typescript": "^11.1.2",
46
46
  "@testing-library/jest-dom": "^5.16.5",
47
47
  "@testing-library/react": "^14.0.0",
48
- "@types/react": "18.2.12",
49
- "@types/react-dom": "^18.2.5",
48
+ "@types/react": "18.2.14",
49
+ "@types/react-dom": "^18.2.6",
50
50
  "@types/react-transition-group": "^4.4.6",
51
51
  "classnames": "^2.3.2",
52
52
  "date-fns": "^2.30.0",
53
- "jest": "^29.5.0",
54
- "jest-environment-jsdom": "^29.5.0",
53
+ "jest": "^29.6.1",
54
+ "jest-environment-jsdom": "^29.6.1",
55
55
  "prop-types": "^15.8.1",
56
56
  "react": "^18.2.0",
57
57
  "react-device-detect": "^2.2.3",
58
58
  "react-dom": "^18.2.0",
59
59
  "react-popper": "^2.3.0",
60
60
  "react-transition-group": "^4.4.5",
61
- "rollup": "^3.25.1",
62
- "ts-jest": "^29.1.0",
63
- "tslib": "^2.5.3",
61
+ "rollup": "^3.26.2",
62
+ "ts-jest": "^29.1.1",
63
+ "tslib": "^2.6.0",
64
64
  "typescript": "^4.9.5"
65
65
  },
66
66
  "peerDependencies": {
67
- "@coreui/coreui-pro": ">=4.6.0-beta.0",
67
+ "@coreui/coreui-pro": ">=4.5.0",
68
68
  "react": ">=17",
69
69
  "react-dom": ">=17"
70
70
  }
@@ -403,13 +403,16 @@ export const CDateRangePicker = forwardRef<HTMLDivElement | HTMLLIElement, CDate
403
403
  }
404
404
 
405
405
  const InputGroup = () => (
406
- <div className="date-picker-input-group">
406
+ <div
407
+ className={classNames('input-group', 'picker-input-group', {
408
+ [`input-group-${size}`]: size,
409
+ })}
410
+ >
407
411
  <input
408
412
  autoComplete="off"
409
- className={classNames('date-picker-input', {
413
+ className={classNames('form-control date-picker-input', {
410
414
  hover: inputStartHoverValue,
411
415
  })}
412
- // delay={true}
413
416
  disabled={disabled}
414
417
  {...(id && { name: range ? `${id}-start-date` : `${id}-date` })}
415
418
  placeholder={Array.isArray(placeholder) ? placeholder[0] : placeholder}
@@ -425,14 +428,18 @@ export const CDateRangePicker = forwardRef<HTMLDivElement | HTMLLIElement, CDate
425
428
  onClick={() => setSelectEndDate(false)}
426
429
  ref={inputStartRef}
427
430
  />
428
- {range && separator !== false && <div className="date-picker-separator" />}
431
+ {range && separator !== false && (
432
+ <span className="input-group-text">
433
+ <span className="picker-input-group-icon date-picker-arrow-icon"></span>
434
+ </span>
435
+ )}
429
436
  {range && (
430
437
  <input
431
438
  autoComplete="off"
432
- className={classNames('date-picker-input', {
439
+ className={classNames('form-control date-picker-input', {
433
440
  hover: inputEndHoverValue,
434
441
  })}
435
- // delay={true}
442
+
436
443
  disabled={disabled}
437
444
  {...(id && { name: `${id}-end-date` })}
438
445
  placeholder={placeholder[1]}
@@ -449,18 +456,32 @@ export const CDateRangePicker = forwardRef<HTMLDivElement | HTMLLIElement, CDate
449
456
  ref={inputEndRef}
450
457
  />
451
458
  )}
452
- {indicator &&
453
- (typeof indicator === 'boolean' ? <div className="date-picker-indicator" /> : indicator)}
454
- {cleaner &&
455
- (_startDate || _endDate) &&
456
- (typeof cleaner === 'boolean' ? (
457
- <div className="date-picker-cleaner" onClick={(event) => handleClear(event)} />
458
- ) : (
459
- React.isValidElement(cleaner) &&
460
- React.cloneElement(cleaner as React.ReactElement<any>, {
461
- onClick: (event: React.MouseEvent<HTMLElement>) => handleClear(event),
462
- })
463
- ))}
459
+ {(indicator || cleaner) && (
460
+ <span className="input-group-text">
461
+ {indicator && (
462
+ <span className="picker-input-group-indicator">
463
+ {typeof indicator === 'boolean' ? (
464
+ <span className="picker-input-group-icon date-picker-input-icon" />
465
+ ) : (
466
+ indicator
467
+ )}
468
+ </span>
469
+ )}
470
+ {cleaner && (_startDate || _endDate) && (
471
+ <span
472
+ className="picker-input-group-cleaner"
473
+ role="button"
474
+ onClick={(event) => handleClear(event)}
475
+ >
476
+ {typeof cleaner === 'boolean' ? (
477
+ <span className="picker-input-group-icon date-picker-cleaner-icon" />
478
+ ) : (
479
+ cleaner
480
+ )}
481
+ </span>
482
+ )}
483
+ </span>
484
+ )}
464
485
  </div>
465
486
  )
466
487
 
@@ -489,10 +510,9 @@ export const CDateRangePicker = forwardRef<HTMLDivElement | HTMLLIElement, CDate
489
510
  className,
490
511
  )}
491
512
  disabled={disabled}
492
- dropdownClassNames="date-picker-dropdown"
493
513
  footer={footer || timepicker}
494
514
  footerContent={
495
- <div className="date-picker-footer">
515
+ <div className="picker-footer">
496
516
  {todayButton && (
497
517
  <CButton
498
518
  className="me-auto"
@@ -66,7 +66,7 @@ export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
66
66
  /**
67
67
  * Callback fired when the component requests to be hidden.
68
68
  *
69
- * @since 4.9.0-beta.1
69
+ * @since 4.9.0
70
70
  */
71
71
  onHide?: () => void
72
72
  /**
@@ -102,13 +102,13 @@ export interface CMultiSelectProps
102
102
  /**
103
103
  * Custom template for options.
104
104
  *
105
- * @since 4.12.0-beta.3
105
+ * @since 4.12.0
106
106
  */
107
107
  optionsTemplate?: (option: Option) => ReactNode
108
108
  /**
109
109
  * Custom template for options groups.
110
110
  *
111
- * @since 4.12.0-beta.3
111
+ * @since 4.12.0
112
112
  */
113
113
  optionsGroupsTemplate?: (option: OptionsGroup) => ReactNode
114
114
  /**
@@ -451,7 +451,9 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
451
451
  className={classNames(
452
452
  'form-multi-select',
453
453
  {
454
+ 'form-multi-select-with-cleaner': cleaner,
454
455
  [`form-multi-select-${size}`]: size,
456
+ 'form-multi-select-selection-tags': multiple && selectionType === 'tags',
455
457
  disabled,
456
458
  'is-invalid': invalid,
457
459
  'is-valid': valid,
@@ -499,24 +501,13 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
499
501
  ></input>
500
502
  )}
501
503
  </CMultiSelectSelection>
502
- <div className="form-multi-select-buttons">
503
- {!disabled && cleaner && selected.length > 0 && (
504
- <button
505
- type="button"
506
- className="form-multi-select-cleaner"
507
- onClick={() => handleDeselectAll()}
508
- ></button>
509
- )}
504
+ {!disabled && cleaner && selected.length > 0 && (
510
505
  <button
511
506
  type="button"
512
- className="form-multi-select-indicator"
513
- onClick={(event) => {
514
- event.preventDefault()
515
- event.stopPropagation()
516
- setVisible(!_visible)
517
- }}
507
+ className="form-multi-select-selection-cleaner"
508
+ onClick={() => handleDeselectAll()}
518
509
  ></button>
519
- </div>
510
+ )}
520
511
  </div>
521
512
  <div className="form-multi-select-dropdown" role="menu" ref={dropdownRef}>
522
513
  {multiple && selectAll && (
@@ -54,7 +54,9 @@ export const CMultiSelectSelection = forwardRef<HTMLSpanElement, CMultiSelectSel
54
54
  className="form-multi-select-tag-delete"
55
55
  aria-label="Close"
56
56
  onClick={() => onRemove && onRemove(option)}
57
- />
57
+ >
58
+ <span aria-hidden="true">×</span>
59
+ </button>
58
60
  )}
59
61
  </span>
60
62
  )
@@ -141,7 +141,7 @@ export const CPicker = forwardRef<HTMLDivElement | HTMLLIElement, CPickerProps>(
141
141
  default: {
142
142
  return (
143
143
  <div
144
- className={classNames(className, {
144
+ className={classNames('dropdown', 'picker', className, {
145
145
  show: _visible,
146
146
  })}
147
147
  onClick={() => !disabled && setVisible(true)}
@@ -152,7 +152,16 @@ export const CPicker = forwardRef<HTMLDivElement | HTMLLIElement, CPickerProps>(
152
152
  React.cloneElement(toggler as React.ReactElement<any>, {
153
153
  ref: togglerRef,
154
154
  })}
155
- <div className={dropdownClassNames} ref={dropdownRef}>
155
+ <div
156
+ className={classNames(
157
+ 'dropdown-menu',
158
+ {
159
+ show: _visible,
160
+ },
161
+ dropdownClassNames,
162
+ )}
163
+ ref={dropdownRef}
164
+ >
156
165
  {children}
157
166
  {footer && footerContent}
158
167
  </div>
@@ -13,7 +13,7 @@ export interface CPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'tit
13
13
  /**
14
14
  * Apply a CSS fade transition to the popover.
15
15
  *
16
- * @since 4.9.0-beta.1
16
+ * @since 4.9.0
17
17
  */
18
18
  animation?: boolean
19
19
  /**
@@ -31,13 +31,13 @@ export interface CPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'tit
31
31
  /**
32
32
  * The delay for displaying and hiding the popover (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
33
33
  *
34
- * @since 4.9.0-beta.1
34
+ * @since 4.9.0
35
35
  */
36
36
  delay?: number | { show: number; hide: number }
37
37
  /**
38
38
  * Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
39
39
  *
40
- * @since 4.9.0-beta.1
40
+ * @since 4.9.0
41
41
  */
42
42
  fallbackPlacements?: Placements | Placements[]
43
43
  /**
@@ -272,11 +272,14 @@ export const CTimePicker = forwardRef<HTMLDivElement | HTMLLIElement, CTimePicke
272
272
  }
273
273
 
274
274
  const InputGroup = () => (
275
- <div className="time-picker-input-group">
275
+ <div
276
+ className={classNames('input-group', 'picker-input-group', {
277
+ [`input-group-${size}`]: size,
278
+ })}
279
+ >
276
280
  <input
277
281
  autoComplete="off"
278
- className="time-picker-input"
279
- // delay={true}
282
+ className="form-control"
280
283
  disabled={disabled}
281
284
  onChange={(event) =>
282
285
  isValidTime(event.target.value) && setDate(convertTimeToDate(event.target.value))
@@ -286,18 +289,32 @@ export const CTimePicker = forwardRef<HTMLDivElement | HTMLLIElement, CTimePicke
286
289
  required={required}
287
290
  ref={inputRef}
288
291
  />
289
- {indicator &&
290
- (typeof indicator === 'boolean' ? <div className="time-picker-indicator" /> : indicator)}
291
- {cleaner &&
292
- date &&
293
- (typeof cleaner === 'boolean' ? (
294
- <div className="time-picker-cleaner" onClick={(event) => handleClear(event)} />
295
- ) : (
296
- React.isValidElement(cleaner) &&
297
- React.cloneElement(cleaner as React.ReactElement<any>, {
298
- onClick: (event: React.MouseEvent<HTMLElement>) => handleClear(event),
299
- })
300
- ))}
292
+ {(indicator || cleaner) && (
293
+ <span className="input-group-text">
294
+ {indicator && (
295
+ <span className="picker-input-group-indicator">
296
+ {typeof indicator === 'boolean' ? (
297
+ <span className="picker-input-group-icon time-picker-input-icon" />
298
+ ) : (
299
+ indicator
300
+ )}
301
+ </span>
302
+ )}
303
+ {cleaner && date && (
304
+ <span
305
+ className="picker-input-group-cleaner"
306
+ role="button"
307
+ onClick={(event) => handleClear(event)}
308
+ >
309
+ {typeof cleaner === 'boolean' ? (
310
+ <span className="picker-input-group-icon time-picker-cleaner-icon" />
311
+ ) : (
312
+ cleaner
313
+ )}
314
+ </span>
315
+ )}
316
+ </span>
317
+ )}
301
318
  </div>
302
319
  )
303
320
 
@@ -434,7 +451,7 @@ export const CTimePicker = forwardRef<HTMLDivElement | HTMLLIElement, CTimePicke
434
451
  dropdownClassNames="time-picker-dropdown"
435
452
  footer={footer}
436
453
  footerContent={
437
- <div className="time-picker-footer">
454
+ <div className="picker-footer">
438
455
  {cancelButton && (
439
456
  <CButton
440
457
  color={cancelButtonColor}
@@ -13,7 +13,7 @@ export interface CTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'con
13
13
  /**
14
14
  * Apply a CSS fade transition to the tooltip.
15
15
  *
16
- * @since 4.9.0-beta.1
16
+ * @since 4.9.0
17
17
  */
18
18
  animation?: boolean
19
19
  /**
@@ -27,13 +27,13 @@ export interface CTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'con
27
27
  /**
28
28
  * The delay for displaying and hiding the tooltip (in milliseconds). When a numerical value is provided, the delay applies to both the hide and show actions. The object structure for specifying the delay is as follows: delay: `{ 'show': 500, 'hide': 100 }`.
29
29
  *
30
- * @since 4.9.0-beta.1
30
+ * @since 4.9.0
31
31
  */
32
32
  delay?: number | { show: number; hide: number }
33
33
  /**
34
34
  * Specify the desired order of fallback placements by providing a list of placements as an array. The placements should be prioritized based on preference.
35
35
  *
36
- * @since 4.9.0-beta.1
36
+ * @since 4.9.0
37
37
  */
38
38
  fallbackPlacements?: Placements | Placements[]
39
39
  /**
@@ -1,6 +1,5 @@
1
- import { useColorModes } from './useColorModes'
2
1
  import { useForkedRef } from './useForkedRef'
3
2
  import { usePopper } from './usePopper'
4
3
  import { useStateWithCallback } from './useStateWithCallback'
5
4
 
6
- export { useColorModes, useForkedRef, usePopper, useStateWithCallback }
5
+ export { useForkedRef, usePopper, useStateWithCallback }
@@ -1,5 +1,5 @@
1
1
  import { Placement } from '@popperjs/core'
2
- import { isRTL } from '../utils'
2
+ import isRTL from './isRTL'
3
3
 
4
4
  const getRTLPlacement = (placement: string, element: HTMLDivElement | null): Placement => {
5
5
  switch (placement) {
@@ -1,114 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { CCalendarProps } from '../calendar/CCalendar';
3
- import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
4
- import { CPickerProps } from '../picker/CPicker';
5
- import { Colors } from '../../types';
6
- export interface CDateRangePickerProps extends Omit<CFormControlWrapperProps, 'floatingLabel'>, Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant'>, Omit<CCalendarProps, 'onCalendarCellHover' | 'onCalendarDateChange'> {
7
- /**
8
- * The number of calendars that render on desktop devices.
9
- */
10
- calendars?: number;
11
- /**
12
- * A string of all className you want applied to the component.
13
- */
14
- className?: string;
15
- /**
16
- * If true the dropdown will be immediately closed after submitting the full date.
17
- *
18
- * @since 4.8.0
19
- */
20
- closeOnSelect?: boolean;
21
- /**
22
- * Toggle visibility or set the content of the cleaner button.
23
- */
24
- cleaner?: boolean;
25
- /**
26
- * Set date format.
27
- * We use date-fns to format dates. Visit https://date-fns.org/v2.28.0/docs/format to check accepted patterns.
28
- */
29
- format?: string;
30
- /**
31
- * The id global attribute defines an identifier (ID) that must be unique in the whole document.
32
- *
33
- * The name attributes for input elements are generated based on the `id` property:
34
- * - \{id\}-start-date
35
- * - \{id\}-end-date
36
- */
37
- id?: string;
38
- /**
39
- * Toggle visibility or set the content of the input indicator.
40
- */
41
- indicator?: ReactNode | boolean;
42
- /**
43
- * Toggle the readonly state for the component.
44
- */
45
- inputReadOnly?: boolean;
46
- /**
47
- * Specifies short hints that are visible in start date and end date inputs.
48
- */
49
- placeholder?: string | string[];
50
- /**
51
- * @ignore
52
- */
53
- range?: boolean;
54
- /**
55
- * Predefined date ranges the user can select from.
56
- */
57
- ranges?: object;
58
- /**
59
- * Sets the color context of the cancel button to one of CoreUI’s themed colors.
60
- *
61
- * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
62
- */
63
- rangesButtonsColor?: Colors;
64
- /**
65
- * Size the ranges button small or large.
66
- */
67
- rangesButtonsSize?: 'sm' | 'lg';
68
- /**
69
- * Set the ranges button variant to an outlined button or a ghost button.
70
- */
71
- rangesButtonsVariant?: 'outline' | 'ghost';
72
- /**
73
- * When present, it specifies that date must be filled out before submitting the form.
74
- *
75
- * @since 4.10.0
76
- */
77
- required?: boolean;
78
- /**
79
- * Default icon or character character that separates two dates.
80
- */
81
- separator?: ReactNode | boolean;
82
- /**
83
- * Size the component small or large.
84
- */
85
- size?: 'sm' | 'lg';
86
- /**
87
- * Provide an additional time selection by adding select boxes to choose times.
88
- */
89
- timepicker?: boolean;
90
- /**
91
- * Toggle visibility or set the content of today button.
92
- *
93
- * @default 'Today'
94
- */
95
- todayButton?: boolean | ReactNode;
96
- /**
97
- * Sets the color context of the today button to one of CoreUI’s themed colors.
98
- *
99
- * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
100
- * @default 'primary'
101
- */
102
- todayButtonColor?: Colors;
103
- /**
104
- * Size the today button small or large.
105
- *
106
- * @default 'sm'
107
- */
108
- todayButtonSize?: 'sm' | 'lg';
109
- /**
110
- * Set the today button variant to an outlined button or a ghost button.
111
- */
112
- todayButtonVariant?: 'outline' | 'ghost';
113
- }
114
- export declare const CDateRangePicker: React.ForwardRefExoticComponent<CDateRangePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
@@ -1,133 +0,0 @@
1
- import React, { HTMLAttributes, ReactNode } from 'react';
2
- import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
3
- import type { Option } from './types';
4
- export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'floatingClassName' | 'floatingLabel'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
5
- /**
6
- * Allow users to create options if they are not in the list of options.
7
- *
8
- * @since 4.11.0-next.0
9
- */
10
- allowCreateOptions?: boolean;
11
- /**
12
- * A string of all className you want applied to the base component.
13
- */
14
- className?: string;
15
- /**
16
- * Enables selection cleaner element.
17
- */
18
- cleaner?: boolean;
19
- /**
20
- * Clear current search on selecting an item.
21
- *
22
- * @since 4.11.0-next.0
23
- */
24
- clearSearchOnSelect?: boolean;
25
- /**
26
- * Toggle the disabled state for the component.
27
- */
28
- disabled?: boolean;
29
- /**
30
- * The id global attribute defines an identifier (ID) that must be unique in the whole document.
31
- *
32
- * The name and id attributes for the native select element are generated based on the `id` property:
33
- * - <select id="\{id\}-multi-select" name="\{id\}-multi-select" />
34
- */
35
- id?: string;
36
- /**
37
- * When set, the options list will have a loading style: loading spinner and reduced opacity.
38
- *
39
- * @since 4.11.0-next.0
40
- */
41
- loading?: boolean;
42
- /**
43
- * It specifies that multiple options can be selected at once.
44
- */
45
- multiple?: boolean;
46
- /**
47
- * Execute a function when a user changes the selected option.
48
- */
49
- onChange?: (selected: Option[]) => void;
50
- /**
51
- * Execute a function when the filter value changed.
52
- *
53
- * @since 4.8.0
54
- */
55
- onFilterChange?: (value: string) => void;
56
- /**
57
- * List of option elements.
58
- */
59
- options: Option[];
60
- /**
61
- * Sets maxHeight of options list.
62
- */
63
- optionsMaxHeight?: number | string;
64
- /**
65
- * Sets option style.
66
- */
67
- optionsStyle?: 'checkbox' | 'text';
68
- /**
69
- * TODO:
70
- *
71
- * @since TODO: 4._.0
72
- */
73
- optionsTemplate?: (option: Option) => ReactNode;
74
- /**
75
- * TODO:
76
- *
77
- * @since TODO: 4._.0
78
- */
79
- optionsGroupsTemplate?: (option: Option) => ReactNode;
80
- /**
81
- * Specifies a short hint that is visible in the search input.
82
- */
83
- placeholder?: string;
84
- /**
85
- * @since XXXX
86
- */
87
- required?: boolean;
88
- /**
89
- * Enables search input element.
90
- */
91
- search?: boolean | 'external';
92
- /**
93
- * Sets the label for no results when filtering.
94
- */
95
- searchNoResultsLabel?: string | ReactNode;
96
- /**
97
- * Enables select all button.
98
- */
99
- selectAll?: boolean;
100
- /**
101
- * Sets the select all button label.
102
- */
103
- selectAllLabel?: string | ReactNode;
104
- /**
105
- * Sets the selection style.
106
- */
107
- selectionType?: 'counter' | 'tags' | 'text';
108
- /**
109
- * Sets the counter selection label.
110
- */
111
- selectionTypeCounterText?: string;
112
- /**
113
- * Size the component small or large.
114
- */
115
- size?: 'sm' | 'lg';
116
- /**
117
- * Enable virtual scroller for the options list.
118
- *
119
- * @since 4.8.0
120
- */
121
- virtualScroller?: boolean;
122
- /**
123
- * Toggle the visibility of multi select dropdown.
124
- */
125
- visible?: boolean;
126
- /**
127
- * Amount of visible items when virtualScroller is set to `true`.
128
- *
129
- * @since 4.8.0
130
- */
131
- visibleItems?: number;
132
- }
133
- export declare const CMultiSelectNew: React.ForwardRefExoticComponent<CMultiSelectProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,7 +0,0 @@
1
- import React, { InputHTMLAttributes } from 'react';
2
- import type { Option } from './types';
3
- export interface CMultiSelectNativeSelectProps extends Omit<InputHTMLAttributes<HTMLSelectElement>, 'options'> {
4
- options?: Option[];
5
- value?: string | number | string[];
6
- }
7
- export declare const CMultiSelectNativeSelect: React.ForwardRefExoticComponent<CMultiSelectNativeSelectProps & React.RefAttributes<HTMLSelectElement>>;