nk-o / carbon-field-react-select
Carbon Fields extension, that adds a React_Select field type.
Installs: 182
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 7
Language:JavaScript
- dev-master
- v3.1.0
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/npm_and_yarn/webpack-5.76.0
- dev-dependabot/npm_and_yarn/minimist-1.2.8
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/json5-and-babel-loader-2.2.3
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/terser-5.14.2
This package is auto-updated.
Last update: 2024-10-15 00:29:31 UTC
README
Added functionality of react-select in Carbon Fields plugin.
Install
Using Composer:
composer require nk-o/carbon-field-react-select
Usage
Default:
Field::make( 'react_select', 'alignment', 'Alignment' ) ->add_options( array( 'left' => 'Left', 'center' => 'Center', 'right' => 'Right', ) ),
Icons:
Field::make( 'react_select', 'alignment', 'Alignment' ) ->add_options( array( array( 'icon' => '<svg xmlns="http://www.w3.org/2000/svg">...</svg>', 'label' => esc_html__( 'Icon 1', '@@text_domain' ), 'value' => 'icon_1', ), array( 'icon' => '<svg xmlns="http://www.w3.org/2000/svg">...</svg>', 'label' => esc_html__( 'Icon 2', '@@text_domain' ), 'value' => 'icon_2', ), ) ) ->set_props( array( 'icons' => true, ) ),
Available Props:
Field::make( 'react_select', 'alignment', 'Alignment' ) ->add_options( array( 'left' => 'Left', 'center' => 'Center', 'right' => 'Right', ) ) ->set_props( array( 'clearable' => true, 'disabled' => false, 'autoFocus' => false, 'closeOnSelect' => true, 'ignoreAccents' => true, 'ignoreCase' => true, 'labelKey' => 'label', 'multi' => false, 'onBlurResetsInput' => true, 'onCloseResetsInput' => true, 'onSelectResetsInput' => true, 'openOnClick' => true, 'openOnFocus' => false, 'removeSelected' => true, 'pageSize' => 5, 'rtl' => false, 'scrollMenuIntoView' => true, 'searchable' => true, 'simpleValue' => false, 'tabSelectsValue' => true, 'trimFilter' => false, 'valueKey' => 'value', 'className' => '', 'icons' => false, 'placeholder' => 'Select...', 'clearAllText' => 'Clear all', 'clearValueText' => 'Clear value', 'noResultsText' => 'No results found', 'searchPromptText' => 'Type to search', ) ),
Props descriptions read here - https://github.com/JedWatson/react-select#select-props