0.5.21 • Published 1 year ago

universal-select v0.5.21

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

universal-Select

A univeral select is a highly funtional quick search/filter control that intergrates witht ag-grid.

Universal select provides a simple interface to create filter criteria from multiple sources.

For examples and help universal-select

To install

yarn add universal-select

npm i --save universal-select

Quick start

A simple string list

const choices: ChoiceDefinition<any>[] = [
  {
    key: "guarantorName",
    prefix: "guarantorName",
    name: "Guarantor Name",
    options: [...]
    replaceExisting: true
  }
];

<UniversalSelect
  title="Quick Filter"
  choices={choices}
/>

Properties

  • title select title and key for cache
  • choices choices to present to the user and their behaviour (see choice properties)
  • selected? selected items
  • showWithNoFilter? Show items even if user has not typed
  • cacheLookUp? should looked up items be cached
  • cacheTimeToLive? how long should items exist in the cache for in seconds
  • cacheExpiryCheck? how often should cached item expiry be checked in seconds
  • onChange? notify of change
  • disabled? control is disabled
  • noItemText? text to display if not items are found
  • typePromptText? prompt to tell user to type
  • caseSensitive? perform case sensitive matching
  • toolTipValueLimit? maxium number of items to display
  • maxAvailableChoices? maxium choices to display for all catagories
  • hideOnSelect close option list when an item is selected
  • noClearTextOnSelect? don't clear input text on selection
  • selectIfOnlyOption? select an option if it is the only option available
  • agGridApi? if supplied allows automatic filtering of ag-grid

choice properties

  • key key of the choice type
  • prefix choice prefix
  • options static choices
  • text? text getter for display text, if the - item is complex
  • value? text getter for value, if the item is complex
  • name? choice display name
  • lookUp? if item choices are vast, lookup - function
  • regExMatch? if item choices are free flowing text, regex to identifier when text is valid
  • valueGetter? function to get the item text
  • filterType? filter type "text" | "number" | "date";
  • maximumSelections? max selections, if using ag-grid is always 1
  • maxAvailableChoices? max available choices
  • search? if type is complex search text, value or both. 'text' | 'value' | 'both';
  • showSelectedValue? show select value or text
  • noSelectIfOnlyOption? override for control property - selectIfOnlyOption
  • agGridColumn? aggrid column to apply filter
  • valueConverter? used to convert text to value
  • replaceExisting? if using ag-grid replaces existing filters when a new filter is selected

Styles

Choice apperance properties

  • choiceStyle
  • choiceHoverStyle
  • choiceClassName
  • choiceHoverClassName

Selection apperance properties

  • selectionStyle
  • selectionDisabledStyle
  • selectionClassName
  • selectionDisabledClassName
  • deselectStyle
  • deselectDisabledStyle
  • deselectHoverStyle
  • deselectClassName
  • deselectDisabledClassName
  • deselectHoverClassName
  • selectionPrefixClassName
  • selectionPrefixDisabledClassName
  • selectionPrefixDisabledStyle
  • selectionPrefixStyle
  • selectionTextClassName
  • selectionTextDisabledClassName
  • selectionTextDisabledStyle
  • selectionTextStyle
  • deselectIcon?: IconType;

General apperance properties

  • selectStyle
  • selectDisabledStyle
  • className
  • disabledClassName
  • inputStyle
  • inputDisabledStyle
  • inputClassName
  • inputDisabledClassName
  • clearSelectionStyle
  • clearSelectionDisabledStyle
  • clearSelectionHoverStyle
  • clearSelectionClassName
  • clearSelectionDisabledClassName
  • clearSelectionHoverClassName
  • titleStyle
  • titleDisabledStyle
  • titleClassName
  • titleDisabledClassName
  • textDisplayClassName
  • textDisplayDisabledClassName
  • dropdownIconStyle
  • dropdownIcondisabledStyle
  • dropIconClassName
  • dropIconDisabledClassName
  • choiceListClassName
  • loadingTextClassName
  • catagoryStyle
  • catagoryClassName
  • hideDropdownIcon?: boolean;
  • dropdownIcon?: IconType;
  • clearSelectionIcon?: IconType;
  • dropdownIconColor
  • dropdownIconDisabledColor
  • hideTitle?: boolean;
  • listStyle
  • height
  • width
  • minWidth
  • maxWidth

Componenets

  • choiceComponent?: (props: ChoiceProps & ChoiceStyle) => JSX.Element;
  • selectComponent?: (props: SelectionProps & SelectionStyle) => JSX.Element;

Styles

--universalSelectBackgroundColor White --universalSelectBackgroundImage --universalSelectHighlihtedBackgroundColor lightgray --universalSelectHighlihtedBackgroundImage

--universalSelectFontColor, Black --universalSelectSelectedBackgroundColor lightgray --universalSelectSelectedBackgroundImage

--universalSelectDisabledFontColor --universalSelectDisabledBackgroundColor darkgray --universalSelectDisabledBackgroundImage

--universalSelectListWidth (fill available) --universalSelectCatagoryTitleFontWeight (bold) --universalSelectPrefixFontSize, "xx-small" --universalSelectPrefixFontWeight, "bold" --universalSelectHighlightFontColor darkgray --universalSelectDeslectIconColor --universalSelectDeslectDisableIconColor --universalSelectDeslectHighlightIconColor

--universalSelectFontWeight --universalSelectFontFamily --universalSelectFontSize; -universalSelectFontStyle

--universalSelectDropdownIconSize, large --universalSelectDropdownIconColor

--universalSelectClearSelectionIconSize, large --universalSelectClearSelectionIconColor --universalSelectClearSelectionIconHighlightColor Lightgray

--universalSelectTitleFontSize, small --universalSelectDisabledFontColor --universalSelectBorder, 2px solid Lightgray --universalSelectBackgroundColor, White --universalSelectBackgroundImage

--universalSelectCatagoryTitleFontSize, x-small --universalSelectCatagorFontColor,DarkGray --universalSelectCatagoryTitleBackgroundColor,DarkGray --universalSelectCatagoryTitleBackgroundImage

0.5.21

1 year ago

0.5.20

1 year ago

0.5.18

1 year ago

0.5.17

1 year ago

0.5.15

1 year ago

0.5.14

1 year ago

0.5.13

1 year ago

0.5.12

1 year ago

0.5.11

1 year ago

0.5.10

1 year ago

0.5.9

1 year ago

0.5.8

1 year ago

0.5.7

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.0

1 year ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.25

1 year ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago