Nuts Selector
Installation
- yarn
- pnpm
- npm
yarn add @mercell/nuts-selector-react
pnpm add @mercell/nuts-selector-react
npm install --save @mercell/nuts-selector-react
The Dropdown has necessary peerDependencies, please make sure that you have them in your project
"@carbon/icons-react": "^10.49.0",
"@mercell/dropdown-react": "^2.0.3",
"@mercell/tailwind": "^6.0.1",
"classnames": "^2.3.1",
"react": "^17.0.2"
Usage
Nuts Selector component is based on the Dropdown component.
You can pass all the props allowed in Dropdown component plus special once for Nuts Selector. Component has a connection to the backend which is available here
import { NutsSelector } from '@mercell/nuts-selector-react';
Types, definitions, etc.
- Types
- Changelog
- Figma
NutsSelectorProps
interface NutsSelectorProps {
onChangeCallback: (selectedCodes: string | string[]) => void;
priorityCountryAbbr?: string;
disableTopLevelNuts?: boolean;
disableAllButNUTS3?: boolean;
selfDisableComponentIfNoValues?: boolean;
} & JSX.IntrinsicElements['div'] & Omit<DropdownProps, 'filterOption'>
Name | Type | Default | Required | Description |
---|---|---|---|---|
onChangeCallback | boolean | - | yes | Callback function where as param you receive selected value or array if you have isMulti flag set to true |
priorityCountryAbbr | string (country ISO2 or ISO3 only allowed) | - | no | Country abbr. in ISO2 or ISO3 format to filter out only nuts based on the country |
disableTopLevelNuts | boolean | - | no | Disable selection of top-level nuts |
disableAllButNUTS3 | boolean | - | no | Disable selection all but NUTS3 level |
selfDisableComponentIfNoValues | boolean | - | no | Self disabled whole field if nothing to choose |
Rest of the React-Select props | StateManagerProps | - | no | All possible properties based on the React-Select documentation, e.g. isMulti, isClearable, hideSelectedOptions, options etc. |
Change Log - @mercell/nuts-selector-react
This log was last generated on Fri, 03 Feb 2023 07:30:53 GMT and should not be manually modified.
2.0.3
Fri, 03 Feb 2023 07:30:53 GMT
Patches
- Update conversion of country iso3 code to nuts
2.0.2
Tue, 24 Jan 2023 08:47:47 GMT
Patches
- Add callback method to call when fetch of nuts is done with a result
2.0.1
Wed, 23 Nov 2022 08:30:34 GMT
Patches
- Add possibility to self disable field if no values presented, add possibility to block all selections but NUTS3 level
2.0.0
Fri, 11 Nov 2022 09:18:57 GMT
Breaking changes
- New styling approach - use only tailwind classes, add tailwind-merge library
1.0.0
Thu, 15 Sep 2022 06:07:41 GMT
Breaking changes
- Migration to Tailwind3, React 18 and ViteJS from webpack.
0.0.20
Wed, 14 Sep 2022 11:03:10 GMT
Patches
- Fix api call with abbr country info to not show the list if country name is invalid or not found
0.0.19
Thu, 14 Jul 2022 09:09:03 GMT
Patches
- Changed nuts components to use prod api
0.0.18
Thu, 30 Jun 2022 10:57:49 GMT
Patches
- Package.json refactor, add test suite, more tests soon
0.0.17
Thu, 02 Jun 2022 10:46:30 GMT
Version update only
0.0.16
Fri, 08 Apr 2022 10:19:50 GMT
Patches
- Bump dependencies
0.0.15
Wed, 30 Mar 2022 10:15:45 GMT
Patches
- New property to disable top level nuts code selection
0.0.14
Wed, 09 Mar 2022 10:29:16 GMT
Version update only
0.0.13
Mon, 28 Feb 2022 12:45:49 GMT
Patches
- Dependency update
0.0.12
Mon, 28 Feb 2022 10:55:32 GMT
Patches
- Bump typescript
0.0.11
Tue, 08 Feb 2022 12:10:03 GMT
Patches
- Fix for the clear option and onChange method
0.0.10
Thu, 03 Feb 2022 12:16:10 GMT
Patches
- Add conversion iso3 to iso2 country if necessary
0.0.9
Thu, 03 Feb 2022 11:30:43 GMT
Version update only
0.0.8
Wed, 02 Feb 2022 09:15:31 GMT
Patches
- Fix for initial value in Nuts-Selector
0.0.7
Tue, 01 Feb 2022 15:47:46 GMT
Version update only
0.0.6
Tue, 01 Feb 2022 14:56:30 GMT
Version update only
0.0.5
Tue, 01 Feb 2022 13:00:55 GMT
Patches
- Fix in nuts selector based on props which you can pass to dropdown
0.0.4
Thu, 27 Jan 2022 09:31:12 GMT
Version update only
0.0.3
Wed, 26 Jan 2022 16:19:19 GMT
Patches
- Move dependencies to peerDependencies to avoid duplication in installation process in project
- Adding the same peerDependencies to devDependencies
0.0.2
Fri, 21 Jan 2022 13:08:25 GMT
Patches
- New component based on dropdown-react
No figma in design system so far