guestbell-forms 3.0.16 → 3.0.18
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.
- package/build/components/tags/Tags.js +2 -2
- package/build/components/tags/Tags.js.map +1 -1
- package/build/dist/guestbell-forms.css +1 -2
- package/build/dist/guestbell-forms.css.map +1 -1
- package/build/dist/guestbell-forms.min.css +1 -1
- package/build/dist/report.html +1 -1
- package/build/scss/components/base/input/input.scss +0 -1
- package/package.json +1 -1
@@ -107,12 +107,12 @@ class TagsRaw extends _BaseInput.BaseInput {
|
|
107
107
|
(_this$props$onSuggest = (_this$props2 = this.props).onSuggestionsOpened) === null || _this$props$onSuggest === void 0 ? void 0 : _this$props$onSuggest.call(_this$props2);
|
108
108
|
}
|
109
109
|
|
110
|
+
this.fetchExistingTags(this.state.value);
|
110
111
|
this.setState(() => ({
|
111
112
|
textIsFocused: true,
|
112
113
|
suggestionsVisible: true,
|
113
114
|
touched: true
|
114
115
|
}), () => this.handleErrors());
|
115
|
-
this.fetchExistingTags(this.state.value);
|
116
116
|
const showMobileVersion = this.props.mobileVersionEnabled && this.isMobile && (this.state.textIsFocused || this.state.suggestionsVisible);
|
117
117
|
|
118
118
|
if (!showMobileVersion && this.props.mobileVersionEnabled && this.isMobile) {
|
@@ -544,7 +544,7 @@ _defineProperty(TagsRaw, "defaultProps", _objectSpread(_objectSpread({}, _BaseIn
|
|
544
544
|
className: "tags-input__suggestions__defaultLoading"
|
545
545
|
}),
|
546
546
|
suggestionsEmptyComponent: 'No existing tags...',
|
547
|
-
loadingDelayMs:
|
547
|
+
loadingDelayMs: 0,
|
548
548
|
filterExistingTags: (text, tags) => tags.filter(tag => tag.name && tag.name.toLowerCase().startsWith(text)),
|
549
549
|
maxSuggestions: 5,
|
550
550
|
addNewOnBlur: false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tags.js","names":["PlusIcon","LeftArrowIcon","defaultTagsTranslations","defaultBaseTranslations","addNew","TagButtonComponent","p","className","id","onClick","children","TagsRaw","BaseInput","constructor","props","textErrors","setState","handleErrors","onFocus","state","suggestionsVisible","onSuggestionsOpened","textIsFocused","touched","fetchExistingTags","value","showMobileVersion","mobileVersionEnabled","isMobile","setTimeout","textRef","current","focus","suggestions","e","key","preselectedSuggestion","undefined","length","preventDefault","stopPropagation","existingTag","existingTags","find","et","name","onTagsChanged","tags","concat","allowNew","addNewTag","newTag","onNewTagAdded","closeSuggestionsAfterCreate","tag","lastSelected","newTags","isMax","maxTags","finalValue","onBlur","isValid","target","textIsValid","errors","getErrors","setInvalid","setValid","onTagClick","filter","sv","fetchingExistingTags","fetchedExistingTags","React","createRef","suggestionsRef","handleClickOutside","bind","handleLeaveMobileClick","require","componentDidUpdate","oldProps","validators","customValidators","required","containerRef","querySelector","contains","onSuggestionsClosed","addNewOnBlur","getSuggestions","existing","s","onSuggestionSelected","componentDidMount","document","addEventListener","componentWillUnmount","removeEventListener","render","translations","getTranslations","textProps","LeaveMobileButton","showInput","Boolean","readOnly","body","title","tooltip","classNames","getValidationClass","placeholder","map","item","index","renderTag","readonlyEmptyPlaceholder","onKeyDown","onTextErrorsChanged","onTextChanged","showSuggestions","tagsSuggestionsClassName","isLoading","suggestionsLoadingComponent","suggestionsEmptyComponent","waitingForMoreInputComponent","minLettersToFetch","SuggestionTag","popperProps","renderDefaultValidation","label","renderLabel","valueNotAddedError","maxTagsSurpassedError","i","startsWith","timer","loadingDelayMs","then","clearTimeout","filteredTags","filterExistingTags","toLowerCase","allowSameTagMultipleTimes","some","t","slice","maxSuggestions","toString","tagRemoveClick","showChips","tagClick","defaultProps","disabled","newTagName","Promise","resolve","Date","getTime","text","Tags","withThemeContext","withFormContext"],"sources":["../../../src/lib/components/tags/Tags.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport { InputGroup } from '../inputGroup/InputGroup';\r\nimport { Text, TextProps, TextRaw } from '../text/Text';\r\nimport * as PlusIcon from 'material-design-icons/content/svg/production/ic_add_circle_outline_24px.svg';\r\nimport * as LeftArrowIcon from 'material-design-icons/navigation/svg/production/ic_arrow_back_24px.svg';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n ValidationError,\r\n defaultBaseTranslations,\r\n} from '../base/input/BaseInput';\r\nimport { Button, ButtonComponentProps } from '../button/Button';\r\nimport TagsSuggestions, {\r\n RenderSuggestionTagProps,\r\n} from './subComponents/TagsSuggestions';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport classNames from 'classnames';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { PopperProps } from '@mui/material/Popper/Popper';\r\nimport LinearProgress from '@mui/material/LinearProgress';\r\nimport Portal from '@mui/material/Portal';\r\n\r\n// Misc\r\nexport type Tag = {\r\n id: number | string;\r\n name: string;\r\n};\r\n\r\nexport const defaultTagsTranslations = {\r\n ...defaultBaseTranslations,\r\n addNew: 'Add new',\r\n};\r\n\r\nexport type TagsTranslations = Partial<typeof defaultTagsTranslations>;\r\n\r\nexport type TagsProps<T extends Tag = Tag> = {\r\n className?: string;\r\n tagsSuggestionsClassName?: string;\r\n disabled?: boolean;\r\n tags: T[];\r\n existingTags?: T[];\r\n fetchExistingTags?: (text: string) => Promise<T[]>;\r\n onTagsChanged: (newTags: T[]) => void;\r\n onNewTagAdded?: (newTagName: string) => Promise<T>;\r\n onTagClick?: (tag: T) => void;\r\n showChips?: boolean;\r\n allowNew?: boolean;\r\n addNewOnBlur?: boolean;\r\n textProps?: TextProps;\r\n readOnly?: boolean;\r\n readonlyEmptyPlaceholder?: string;\r\n maxTags?: number;\r\n valueNotAddedError?: string | JSX.Element;\r\n maxTagsSurpassedError?: string | JSX.Element;\r\n showSuggestions?: boolean;\r\n suggestionsLoadingComponent?: string | JSX.Element;\r\n suggestionsEmptyComponent?: string | JSX.Element;\r\n waitingForMoreInputComponent?: string | JSX.Element;\r\n loadingDelayMs?: number;\r\n filterExistingTags?: (text: string, existingTags: T[]) => T[];\r\n allowSameTagMultipleTimes?: boolean;\r\n maxSuggestions?: number;\r\n popperProps?: Partial<PopperProps>;\r\n minLettersToFetch?: number;\r\n mobileVersionEnabled?: boolean;\r\n isLoading?: boolean;\r\n closeSuggestionsAfterCreate?: boolean;\r\n SuggestionTag?: React.ComponentType<RenderSuggestionTagProps<T>>;\r\n} & BaseInputProps<HTMLInputElement, TagsTranslations>;\r\n\r\nexport interface TagsState<T extends Tag = Tag> extends BaseInputState {\r\n textIsFocused: boolean;\r\n textErrors: ValidationError[];\r\n textIsValid: boolean;\r\n suggestionsVisible: boolean;\r\n fetchedExistingTags: T[];\r\n fetchingExistingTags: boolean;\r\n preselectedSuggestion?: number;\r\n}\r\n\r\ntype InjectedProps = {};\r\n\r\nconst TagButtonComponent: React.FC<ButtonComponentProps> = p => (\r\n <a className={p.className} id={p.id} onClick={p.onClick}>\r\n {p.children}\r\n </a>\r\n);\r\n\r\nexport class TagsRaw<T extends Tag = Tag> extends BaseInput<\r\n TagsProps<T> & InjectedProps,\r\n TagsState<T>,\r\n HTMLInputElement,\r\n TagsTranslations\r\n> {\r\n public static defaultProps: TagsProps = {\r\n ...BaseInput.defaultProps,\r\n disabled: false,\r\n className: '',\r\n tags: [],\r\n existingTags: [],\r\n maxTags: 1000,\r\n onTagsChanged: () => undefined,\r\n onNewTagAdded: newTagName =>\r\n Promise.resolve({ name: newTagName, id: new Date().getTime() }),\r\n valueNotAddedError: <span>You forgot to add tag</span>,\r\n maxTagsSurpassedError: <span>Maximum number of tags surpassed</span>,\r\n waitingForMoreInputComponent: <span>Waiting for more input...</span>,\r\n showSuggestions: true,\r\n suggestionsLoadingComponent: (\r\n <LinearProgress className=\"tags-input__suggestions__defaultLoading\" />\r\n ),\r\n suggestionsEmptyComponent: 'No existing tags...',\r\n loadingDelayMs: 500,\r\n filterExistingTags: (text, tags) =>\r\n tags.filter(tag => tag.name && tag.name.toLowerCase().startsWith(text)),\r\n maxSuggestions: 5,\r\n addNewOnBlur: false,\r\n translations: defaultTagsTranslations,\r\n minLettersToFetch: 0,\r\n mobileVersionEnabled: true,\r\n closeSuggestionsAfterCreate: false,\r\n };\r\n\r\n private textRef: React.RefObject<TextRaw>;\r\n private suggestionsRef: React.RefObject<HTMLDivElement>;\r\n private isMobile: boolean = false;\r\n\r\n constructor(props: TagsProps<T> & InjectedProps) {\r\n super(props);\r\n this.state = {\r\n ...this.state,\r\n textErrors: [],\r\n textIsFocused: false,\r\n suggestionsVisible: false,\r\n fetchingExistingTags: false,\r\n textIsValid: false,\r\n fetchedExistingTags: [],\r\n };\r\n this.textRef = React.createRef();\r\n this.suggestionsRef = React.createRef();\r\n this.handleClickOutside = this.handleClickOutside.bind(this);\r\n this.handleLeaveMobileClick = this.handleLeaveMobileClick.bind(this);\r\n if (props.mobileVersionEnabled) {\r\n this.isMobile = require('react-device-detect')?.isMobile;\r\n }\r\n }\r\n\r\n public focus() {\r\n if (this.textRef.current) {\r\n this.textRef.current.focus();\r\n }\r\n }\r\n\r\n public componentDidUpdate(oldProps: TagsProps & InjectedProps) {\r\n if (\r\n oldProps.tags !== this.props.tags ||\r\n oldProps.validators !== this.props.validators ||\r\n oldProps.customValidators !== this.props.customValidators ||\r\n oldProps.required !== this.props.required\r\n ) {\r\n this.handleErrors(this.props.tags);\r\n }\r\n }\r\n\r\n public handleLeaveMobileClick() {\r\n this.setState({\r\n textIsFocused: false,\r\n suggestionsVisible: false,\r\n preselectedSuggestion: undefined,\r\n });\r\n }\r\n\r\n public handleClickOutside(e: MouseEvent) {\r\n if (\r\n !this.containerRef.current ||\r\n this.containerRef.current\r\n .querySelector('.tags-input__tag__wrapper')\r\n ?.contains(e.target as HTMLDivElement) ||\r\n this.containerRef.current\r\n .querySelector('.tags-input__text-input')\r\n ?.contains(e.target as HTMLDivElement) ||\r\n !this.suggestionsRef.current ||\r\n this.suggestionsRef.current.contains(e.target as HTMLDivElement)\r\n ) {\r\n return;\r\n }\r\n if (this.state.suggestionsVisible) {\r\n this.props.onSuggestionsClosed?.();\r\n }\r\n this.setState({\r\n suggestionsVisible: false,\r\n preselectedSuggestion: undefined,\r\n });\r\n if (this.props.addNewOnBlur && this.state.value) {\r\n const suggestions = this.getSuggestions();\r\n const existing = suggestions.find(s => s.name === this.state.value);\r\n if (existing) {\r\n this.onSuggestionSelected(existing, suggestions.length === 1);\r\n } else if (this.props.allowNew) {\r\n this.addNewTag();\r\n }\r\n } /* else if (this.state.value) {\r\n this.setState({ value: '' });\r\n }*/\r\n }\r\n\r\n public componentDidMount() {\r\n document.addEventListener('mousedown', this.handleClickOutside);\r\n document.addEventListener('touchstart', this.handleClickOutside);\r\n this.handleErrors(this.props.tags);\r\n }\r\n\r\n public componentWillUnmount() {\r\n document.removeEventListener('mousedown', this.handleClickOutside);\r\n document.removeEventListener('touchstart', this.handleClickOutside);\r\n super.componentWillUnmount();\r\n }\r\n\r\n public render() {\r\n const translations = this.getTranslations(defaultTagsTranslations);\r\n const textProps = this.props.textProps ? this.props.textProps : {};\r\n const suggestions = this.getSuggestions();\r\n const showMobileVersion =\r\n this.props.mobileVersionEnabled &&\r\n this.isMobile &&\r\n (this.state.textIsFocused || this.state.suggestionsVisible);\r\n const LeaveMobileButton = showMobileVersion ? (\r\n <Button\r\n className=\"tags-input__leaveMobileTagsButton line-height--0\"\r\n onClick={this.handleLeaveMobileClick}\r\n noShadow={true}\r\n unobtrusive={true}\r\n >\r\n <LeftArrowIcon />\r\n </Button>\r\n ) : (\r\n undefined\r\n );\r\n const showInput = Boolean(\r\n (!this.props.maxTags ||\r\n this.props.maxTags > (this.props.tags && this.props.tags.length)) &&\r\n !this.props.readOnly\r\n );\r\n return (\r\n <Portal container={document.body} disablePortal={!showMobileVersion}>\r\n <InputGroup title={this.props.title} tooltip={this.props.tooltip}>\r\n <div\r\n {...(this.props.id && {\r\n id: this.props.id,\r\n })}\r\n className={classNames(\r\n 'input__base tags-input',\r\n this.getValidationClass(),\r\n this.props.className,\r\n {\r\n 'tags-input--readOnly': this.props.readOnly,\r\n 'tags-input--hasPlaceholder':\r\n this.props.textProps && this.props.textProps.placeholder,\r\n 'tags-input--mobile': showMobileVersion,\r\n }\r\n )}\r\n ref={this.containerRef}\r\n >\r\n {showMobileVersion && (\r\n <div className=\"tags-input__mobileBackdrop\" />\r\n )}\r\n <div className=\"tags-input__tags__wrapper\">\r\n {!showInput && showMobileVersion && LeaveMobileButton}\r\n {this.props.tags && this.props.tags.length > 0 ? (\r\n <div className=\"tags-input__tag__wrapper\">\r\n {this.props.tags.map((item, index) =>\r\n this.renderTag(item, index)\r\n )}\r\n </div>\r\n ) : (\r\n this.props.readOnly && (\r\n <div className=\"tags-input__tag__wrapper\">\r\n <div className=\"tags-input__tag\">\r\n {this.props.readonlyEmptyPlaceholder}\r\n </div>\r\n </div>\r\n )\r\n )}\r\n </div>\r\n {showInput && (\r\n <div\r\n className={\r\n 'tags-input__tags__wrapper ' +\r\n (this.props.readOnly ? 'filled ' : '')\r\n }\r\n >\r\n <Text\r\n showClearButton={true}\r\n {...textProps}\r\n {...(this.props.id && {\r\n id: this.props.id + '-text-input',\r\n })}\r\n ref={this.textRef}\r\n required={\r\n this.props.tags.length > 0 ? false : this.props.required\r\n }\r\n className={\r\n 'tags-input__text-input ' +\r\n (textProps.className ? textProps.className : '')\r\n }\r\n onKeyDown={this.onKeyDown(suggestions)}\r\n onErrorsChanged={this.onTextErrorsChanged}\r\n onChange={this.onTextChanged}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n value={this.state.value}\r\n readOnly={this.props.readOnly}\r\n showValidation={false}\r\n ignoreContext={true}\r\n validators={this.props.validators}\r\n customValidators={this.props.customValidators}\r\n before={LeaveMobileButton}\r\n />\r\n {this.state.suggestionsVisible && this.props.showSuggestions && (\r\n <TagsSuggestions<T>\r\n {...(this.props.id && {\r\n id: this.props.id + '-text-input',\r\n })}\r\n className={classNames(this.props.tagsSuggestionsClassName)}\r\n innerRef={this.suggestionsRef}\r\n anchorEl={this.containerRef.current}\r\n allowNew={this.props.allowNew}\r\n preselectedSuggestion={this.state.preselectedSuggestion}\r\n loading={\r\n this.state.fetchingExistingTags || this.props.isLoading\r\n }\r\n LoadingComponent={this.props.suggestionsLoadingComponent}\r\n isVisible={this.state.suggestionsVisible}\r\n EmptyComponent={this.props.suggestionsEmptyComponent}\r\n WaitingForMoreInputComponent={\r\n this.props.waitingForMoreInputComponent\r\n }\r\n isWaitingForMoreInput={\r\n this.state.value.length < this.props.minLettersToFetch\r\n }\r\n tags={suggestions}\r\n onSelected={this.onSuggestionSelected}\r\n value={this.state.value}\r\n AddNewTagComponent={\r\n this.props.allowNew &&\r\n this.state.value !== '' &&\r\n (!this.props.existingTags ||\r\n !this.props.existingTags.find(\r\n e => e.name === this.state.value\r\n )) &&\r\n (!this.state.fetchedExistingTags ||\r\n !this.state.fetchedExistingTags.find(\r\n e => e.name === this.state.value\r\n )) &&\r\n this.state.textIsValid && (\r\n <Button\r\n {...(this.props.id && {\r\n id: this.props.id + '-add-new-button',\r\n })}\r\n className=\"tags-input__suggestion tags-input__add-new\"\r\n dropdown={true}\r\n onClick={this.addNewTag}\r\n >\r\n {translations.addNew} \"{this.state.value}\"\r\n </Button>\r\n )\r\n }\r\n SuggestionTag={this.props.SuggestionTag}\r\n popperProps={this.props.popperProps}\r\n />\r\n )}\r\n </div>\r\n )}\r\n {this.renderDefaultValidation()}\r\n {this.props.label && (\r\n <label\r\n className={\r\n this.state.value !== '' ||\r\n this.state.textIsFocused ||\r\n this.props.readOnly ||\r\n this.props.tags.length >= this.props.maxTags ||\r\n showMobileVersion\r\n ? 'label--focused'\r\n : ''\r\n }\r\n >\r\n {this.renderLabel()}\r\n </label>\r\n )}\r\n </div>\r\n </InputGroup>\r\n </Portal>\r\n );\r\n }\r\n\r\n private onTextErrorsChanged = (textErrors: ValidationError[]) =>\r\n this.setState(\r\n () => ({ textErrors }),\r\n () => this.handleErrors()\r\n );\r\n\r\n private onFocus = () => {\r\n this.props.onFocus?.();\r\n if (!this.state.suggestionsVisible) {\r\n this.props.onSuggestionsOpened?.();\r\n }\r\n this.setState(\r\n () => ({ textIsFocused: true, suggestionsVisible: true, touched: true }),\r\n () => this.handleErrors()\r\n );\r\n this.fetchExistingTags(this.state.value);\r\n const showMobileVersion =\r\n this.props.mobileVersionEnabled &&\r\n this.isMobile &&\r\n (this.state.textIsFocused || this.state.suggestionsVisible);\r\n if (\r\n !showMobileVersion &&\r\n this.props.mobileVersionEnabled &&\r\n this.isMobile\r\n ) {\r\n setTimeout(() => this.textRef.current?.focus(), 100);\r\n }\r\n };\r\n\r\n private onKeyDown = (suggestions: T[]) => async (e: React.KeyboardEvent) => {\r\n if (e.key === 'Tab') {\r\n this.setState({\r\n suggestionsVisible: false,\r\n preselectedSuggestion: undefined,\r\n });\r\n }\r\n if (\r\n e.key === 'Enter' &&\r\n (this.state.value !== '' ||\r\n this.state.preselectedSuggestion !== undefined) &&\r\n this.state.textErrors.length === 0\r\n ) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n const existingTag =\r\n this.props.existingTags &&\r\n this.props.existingTags.find(et => et.name === this.state.value);\r\n if (this.state.preselectedSuggestion !== undefined) {\r\n this.props.onTagsChanged(\r\n this.props.tags.concat(suggestions[this.state.preselectedSuggestion])\r\n );\r\n this.setState({ value: '', preselectedSuggestion: undefined }, () => {\r\n this.fetchExistingTags();\r\n this.handleErrors();\r\n });\r\n } else if (existingTag) {\r\n this.props.onTagsChanged(this.props.tags.concat(existingTag));\r\n this.setState({ value: '' }, () => {\r\n this.fetchExistingTags();\r\n this.handleErrors();\r\n });\r\n } else if (this.props.allowNew) {\r\n await this.addNewTag();\r\n this.handleErrors();\r\n }\r\n }\r\n if (suggestions.length > 0 && this.state.suggestionsVisible) {\r\n if (e.key === 'ArrowUp') {\r\n const preselectedSuggestion =\r\n this.state.preselectedSuggestion === undefined\r\n ? suggestions.length - 1\r\n : this.state.preselectedSuggestion === 0\r\n ? suggestions.length - 1\r\n : this.state.preselectedSuggestion - 1;\r\n this.setState({ preselectedSuggestion });\r\n } else if (e.key === 'ArrowDown') {\r\n const preselectedSuggestion =\r\n this.state.preselectedSuggestion === undefined\r\n ? 0\r\n : this.state.preselectedSuggestion === suggestions.length - 1\r\n ? 0\r\n : this.state.preselectedSuggestion + 1;\r\n this.setState({ preselectedSuggestion });\r\n } else {\r\n this.setState({ preselectedSuggestion: undefined });\r\n }\r\n }\r\n };\r\n\r\n private addNewTag = async () => {\r\n const newTag = await this.props.onNewTagAdded(this.state.value);\r\n this.setState({\r\n suggestionsVisible: this.props.closeSuggestionsAfterCreate\r\n ? false\r\n : this.state.suggestionsVisible,\r\n });\r\n if (newTag) {\r\n this.props.onTagsChanged(\r\n this.props.tags ? this.props.tags.concat(newTag) : [newTag]\r\n );\r\n }\r\n this.setState({ value: '', textErrors: [] }, () => {\r\n this.fetchExistingTags();\r\n this.handleErrors();\r\n });\r\n };\r\n\r\n private onSuggestionSelected = (tag: T, lastSelected: boolean) => {\r\n const newTags = this.props.tags.concat(tag);\r\n this.props.onTagsChanged(newTags);\r\n const isMax = newTags.length === this.props.maxTags;\r\n const finalValue =\r\n !this.props.allowNew && !isMax && !lastSelected ? this.state.value : '';\r\n this.setState(\r\n {\r\n value: finalValue,\r\n suggestionsVisible:\r\n isMax || this.props.closeSuggestionsAfterCreate\r\n ? false\r\n : this.state.suggestionsVisible,\r\n preselectedSuggestion: undefined,\r\n textErrors: [],\r\n },\r\n () => {\r\n if (\r\n !this.props.maxTags ||\r\n this.props.tags.length + 1 < this.props.maxTags\r\n ) {\r\n this.fetchExistingTags(finalValue);\r\n }\r\n this.handleErrors();\r\n }\r\n );\r\n };\r\n\r\n private onBlur = () => {\r\n this.props.onBlur?.();\r\n this.setState(\r\n {\r\n textIsFocused: false,\r\n preselectedSuggestion: undefined,\r\n },\r\n () => this.handleErrors()\r\n );\r\n };\r\n\r\n private onTextChanged = (\r\n e: React.ChangeEvent<HTMLInputElement>,\r\n isValid: boolean\r\n ) => {\r\n const value = e.target.value;\r\n this.setState(\r\n () => ({\r\n value,\r\n isValid: isValid,\r\n textIsValid: isValid,\r\n suggestionsVisible: true,\r\n }),\r\n () => this.handleErrors()\r\n );\r\n this.fetchExistingTags(e.target.value);\r\n };\r\n\r\n private handleErrors = (tags: T[] = this.props.tags) => {\r\n let errors = this.getErrors(tags);\r\n if (errors.length > 0) {\r\n this.setInvalid(errors);\r\n } else {\r\n this.setValid();\r\n }\r\n };\r\n\r\n private getErrors(tags: T[]) {\r\n let errors = [];\r\n if (tags.length < this.props.maxTags) {\r\n errors = errors.concat(this.state.textErrors);\r\n }\r\n if (this.state.value !== '' && tags.length === 0 && this.props.required) {\r\n errors = errors.concat(\r\n this.getTranslations(this.props.translations).required\r\n );\r\n }\r\n if (this.state.value && this.props.allowNew && !this.state.textIsFocused) {\r\n errors = errors.concat(this.props.valueNotAddedError);\r\n }\r\n if (this.props.maxTags < (this.props.tags && this.props.tags.length)) {\r\n errors = errors.concat(this.props.maxTagsSurpassedError);\r\n }\r\n return errors.filter(i => i);\r\n }\r\n\r\n private fetchExistingTags(startsWith: string = '') {\r\n if (\r\n this.props.fetchExistingTags &&\r\n startsWith.length >= this.props.minLettersToFetch\r\n ) {\r\n const timer = setTimeout(\r\n () => this.setState(() => ({ fetchingExistingTags: true })),\r\n this.props.loadingDelayMs\r\n );\r\n this.props.fetchExistingTags(startsWith).then(fetchedExistingTags => {\r\n clearTimeout(timer);\r\n this.setState(() => ({\r\n fetchedExistingTags,\r\n fetchingExistingTags: false,\r\n }));\r\n });\r\n }\r\n }\r\n\r\n private getSuggestions() {\r\n const existingTags: T[] = []\r\n .concat(this.props.existingTags ? this.props.existingTags : [])\r\n .concat(\r\n this.state.fetchedExistingTags ? this.state.fetchedExistingTags : []\r\n );\r\n const filteredTags = this.props.filterExistingTags(\r\n this.state.value ? this.state.value.toLowerCase() : '',\r\n existingTags\r\n );\r\n let suggestions = filteredTags\r\n .filter(\r\n tag =>\r\n this.props.allowSameTagMultipleTimes ||\r\n !this.props.tags.some(t => t.id === tag.id)\r\n )\r\n .slice(0, this.props.maxSuggestions);\r\n return suggestions;\r\n }\r\n\r\n private renderTag(tag: T, index: number) {\r\n const body = (\r\n <>\r\n {tag.name}\r\n {!this.props.readOnly && (\r\n <Button\r\n {...(this.props.id && {\r\n id: this.props.id + '-tag-' + index.toString(),\r\n })}\r\n circular={true}\r\n blank={true}\r\n onClick={this.tagRemoveClick(tag)}\r\n className=\"ml-1 transform-rotate--45 line-height--0 p-0\"\r\n Component={TagButtonComponent}\r\n preventsDefault={false}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n )}\r\n </>\r\n );\r\n const className = classNames('tags-input__tag', {\r\n 'tags-input__tag-chip': this.props.showChips,\r\n });\r\n if (this.props.onTagClick) {\r\n return (\r\n <Button\r\n onClick={this.tagClick(tag)}\r\n small={true}\r\n className={className}\r\n key={index}\r\n >\r\n {body}\r\n </Button>\r\n );\r\n }\r\n return (\r\n <div onClick={this.tagClick(tag)} className={className} key={index}>\r\n {body}\r\n </div>\r\n );\r\n }\r\n\r\n private tagClick = (tag: T) => () => {\r\n this.props.onTagClick && this.props.onTagClick(tag);\r\n };\r\n\r\n private tagRemoveClick = (tag: T) => (e: React.MouseEvent<HTMLElement>) => {\r\n e.stopPropagation();\r\n const newTags = this.props.tags.filter(sv => sv.id !== tag.id);\r\n /*if (newTags.length === 0) {\r\n setTimeout(() => this.focus(), 50);\r\n }\r\n this.setState({\r\n suggestionsVisible: false,\r\n });*/\r\n this.props.onTagsChanged && this.props.onTagsChanged(newTags);\r\n this.handleErrors(newTags);\r\n // this.fetchExistingTags();\r\n };\r\n}\r\n\r\ninterface TagsFinal {\r\n <T extends Tag = Tag>(item: TagsProps<T>): React.ReactElement;\r\n defaultProps?: Partial<TagsProps>;\r\n}\r\n\r\nexport const Tags = (withThemeContext<TagsProps, InstanceType<typeof TagsRaw>>(\r\n // tslint:disable-next-line: no-any\r\n withFormContext<TagsProps>(TagsRaw),\r\n 'tags'\r\n) as unknown) as TagsFinal;\r\n\r\nexport default Tags;\r\n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,eAAE,8D;EAC9BL,eAAe,EAAE,I;EACjBG,2BAA2B,eACzB,oBAAC,uBAAD;IAAgB,SAAS,EAAC;EAA1B,E;EAEFC,yBAAyB,EAAE,qB;EAC3Ba,cAAc,EAAE,G;EAChBI,kBAAkB,EAAE,CAACkB,IAAD,EAAOjH,IAAP,KAClBA,IAAI,CAACsB,MAAL,CAAYf,GAAG,IAAIA,GAAG,CAACT,IAAJ,IAAYS,GAAG,CAACT,IAAJ,CAASkG,WAAT,GAAuBP,UAAvB,CAAkCwB,IAAlC,CAA/B,C;EACFZ,cAAc,EAAE,C;EAChB3D,YAAY,EAAE,K;EACdW,YAAY,EAAElG,uB;EACd6H,iBAAiB,EAAE,C;EACnBpG,oBAAoB,EAAE,I;EACtB0B,2BAA2B,EAAE;;;AA4jB1B,MAAM4G,IAAI,GAAI,IAAAC,kCAAA,GACnB;AACA,IAAAC,gCAAA,EAA2BxJ,OAA3B,CAFmB,EAGnB,MAHmB,CAAd;;eAMQsJ,I"}
|
1
|
+
{"version":3,"file":"Tags.js","names":["PlusIcon","LeftArrowIcon","defaultTagsTranslations","defaultBaseTranslations","addNew","TagButtonComponent","p","className","id","onClick","children","TagsRaw","BaseInput","constructor","props","textErrors","setState","handleErrors","onFocus","state","suggestionsVisible","onSuggestionsOpened","fetchExistingTags","value","textIsFocused","touched","showMobileVersion","mobileVersionEnabled","isMobile","setTimeout","textRef","current","focus","suggestions","e","key","preselectedSuggestion","undefined","length","preventDefault","stopPropagation","existingTag","existingTags","find","et","name","onTagsChanged","tags","concat","allowNew","addNewTag","newTag","onNewTagAdded","closeSuggestionsAfterCreate","tag","lastSelected","newTags","isMax","maxTags","finalValue","onBlur","isValid","target","textIsValid","errors","getErrors","setInvalid","setValid","onTagClick","filter","sv","fetchingExistingTags","fetchedExistingTags","React","createRef","suggestionsRef","handleClickOutside","bind","handleLeaveMobileClick","require","componentDidUpdate","oldProps","validators","customValidators","required","containerRef","querySelector","contains","onSuggestionsClosed","addNewOnBlur","getSuggestions","existing","s","onSuggestionSelected","componentDidMount","document","addEventListener","componentWillUnmount","removeEventListener","render","translations","getTranslations","textProps","LeaveMobileButton","showInput","Boolean","readOnly","body","title","tooltip","classNames","getValidationClass","placeholder","map","item","index","renderTag","readonlyEmptyPlaceholder","onKeyDown","onTextErrorsChanged","onTextChanged","showSuggestions","tagsSuggestionsClassName","isLoading","suggestionsLoadingComponent","suggestionsEmptyComponent","waitingForMoreInputComponent","minLettersToFetch","SuggestionTag","popperProps","renderDefaultValidation","label","renderLabel","valueNotAddedError","maxTagsSurpassedError","i","startsWith","timer","loadingDelayMs","then","clearTimeout","filteredTags","filterExistingTags","toLowerCase","allowSameTagMultipleTimes","some","t","slice","maxSuggestions","toString","tagRemoveClick","showChips","tagClick","defaultProps","disabled","newTagName","Promise","resolve","Date","getTime","text","Tags","withThemeContext","withFormContext"],"sources":["../../../src/lib/components/tags/Tags.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport { InputGroup } from '../inputGroup/InputGroup';\r\nimport { Text, TextProps, TextRaw } from '../text/Text';\r\nimport * as PlusIcon from 'material-design-icons/content/svg/production/ic_add_circle_outline_24px.svg';\r\nimport * as LeftArrowIcon from 'material-design-icons/navigation/svg/production/ic_arrow_back_24px.svg';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n ValidationError,\r\n defaultBaseTranslations,\r\n} from '../base/input/BaseInput';\r\nimport { Button, ButtonComponentProps } from '../button/Button';\r\nimport TagsSuggestions, {\r\n RenderSuggestionTagProps,\r\n} from './subComponents/TagsSuggestions';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport classNames from 'classnames';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { PopperProps } from '@mui/material/Popper/Popper';\r\nimport LinearProgress from '@mui/material/LinearProgress';\r\nimport Portal from '@mui/material/Portal';\r\n\r\n// Misc\r\nexport type Tag = {\r\n id: number | string;\r\n name: string;\r\n};\r\n\r\nexport const defaultTagsTranslations = {\r\n ...defaultBaseTranslations,\r\n addNew: 'Add new',\r\n};\r\n\r\nexport type TagsTranslations = Partial<typeof defaultTagsTranslations>;\r\n\r\nexport type TagsProps<T extends Tag = Tag> = {\r\n className?: string;\r\n tagsSuggestionsClassName?: string;\r\n disabled?: boolean;\r\n tags: T[];\r\n existingTags?: T[];\r\n fetchExistingTags?: (text: string) => Promise<T[]>;\r\n onTagsChanged: (newTags: T[]) => void;\r\n onNewTagAdded?: (newTagName: string) => Promise<T>;\r\n onTagClick?: (tag: T) => void;\r\n showChips?: boolean;\r\n allowNew?: boolean;\r\n addNewOnBlur?: boolean;\r\n textProps?: TextProps;\r\n readOnly?: boolean;\r\n readonlyEmptyPlaceholder?: string;\r\n maxTags?: number;\r\n valueNotAddedError?: string | JSX.Element;\r\n maxTagsSurpassedError?: string | JSX.Element;\r\n showSuggestions?: boolean;\r\n suggestionsLoadingComponent?: string | JSX.Element;\r\n suggestionsEmptyComponent?: string | JSX.Element;\r\n waitingForMoreInputComponent?: string | JSX.Element;\r\n loadingDelayMs?: number;\r\n filterExistingTags?: (text: string, existingTags: T[]) => T[];\r\n allowSameTagMultipleTimes?: boolean;\r\n maxSuggestions?: number;\r\n popperProps?: Partial<PopperProps>;\r\n minLettersToFetch?: number;\r\n mobileVersionEnabled?: boolean;\r\n isLoading?: boolean;\r\n closeSuggestionsAfterCreate?: boolean;\r\n SuggestionTag?: React.ComponentType<RenderSuggestionTagProps<T>>;\r\n} & BaseInputProps<HTMLInputElement, TagsTranslations>;\r\n\r\nexport interface TagsState<T extends Tag = Tag> extends BaseInputState {\r\n textIsFocused: boolean;\r\n textErrors: ValidationError[];\r\n textIsValid: boolean;\r\n suggestionsVisible: boolean;\r\n fetchedExistingTags: T[];\r\n fetchingExistingTags: boolean;\r\n preselectedSuggestion?: number;\r\n}\r\n\r\ntype InjectedProps = {};\r\n\r\nconst TagButtonComponent: React.FC<ButtonComponentProps> = (p) => (\r\n <a className={p.className} id={p.id} onClick={p.onClick}>\r\n {p.children}\r\n </a>\r\n);\r\n\r\nexport class TagsRaw<T extends Tag = Tag> extends BaseInput<\r\n TagsProps<T> & InjectedProps,\r\n TagsState<T>,\r\n HTMLInputElement,\r\n TagsTranslations\r\n> {\r\n public static defaultProps: TagsProps = {\r\n ...BaseInput.defaultProps,\r\n disabled: false,\r\n className: '',\r\n tags: [],\r\n existingTags: [],\r\n maxTags: 1000,\r\n onTagsChanged: () => undefined,\r\n onNewTagAdded: (newTagName) =>\r\n Promise.resolve({ name: newTagName, id: new Date().getTime() }),\r\n valueNotAddedError: <span>You forgot to add tag</span>,\r\n maxTagsSurpassedError: <span>Maximum number of tags surpassed</span>,\r\n waitingForMoreInputComponent: <span>Waiting for more input...</span>,\r\n showSuggestions: true,\r\n suggestionsLoadingComponent: (\r\n <LinearProgress className=\"tags-input__suggestions__defaultLoading\" />\r\n ),\r\n suggestionsEmptyComponent: 'No existing tags...',\r\n loadingDelayMs: 0,\r\n filterExistingTags: (text, tags) =>\r\n tags.filter((tag) => tag.name && tag.name.toLowerCase().startsWith(text)),\r\n maxSuggestions: 5,\r\n addNewOnBlur: false,\r\n translations: defaultTagsTranslations,\r\n minLettersToFetch: 0,\r\n mobileVersionEnabled: true,\r\n closeSuggestionsAfterCreate: false,\r\n };\r\n\r\n private textRef: React.RefObject<TextRaw>;\r\n private suggestionsRef: React.RefObject<HTMLDivElement>;\r\n private isMobile: boolean = false;\r\n\r\n constructor(props: TagsProps<T> & InjectedProps) {\r\n super(props);\r\n this.state = {\r\n ...this.state,\r\n textErrors: [],\r\n textIsFocused: false,\r\n suggestionsVisible: false,\r\n fetchingExistingTags: false,\r\n textIsValid: false,\r\n fetchedExistingTags: [],\r\n };\r\n this.textRef = React.createRef();\r\n this.suggestionsRef = React.createRef();\r\n this.handleClickOutside = this.handleClickOutside.bind(this);\r\n this.handleLeaveMobileClick = this.handleLeaveMobileClick.bind(this);\r\n if (props.mobileVersionEnabled) {\r\n this.isMobile = require('react-device-detect')?.isMobile;\r\n }\r\n }\r\n\r\n public focus() {\r\n if (this.textRef.current) {\r\n this.textRef.current.focus();\r\n }\r\n }\r\n\r\n public componentDidUpdate(oldProps: TagsProps & InjectedProps) {\r\n if (\r\n oldProps.tags !== this.props.tags ||\r\n oldProps.validators !== this.props.validators ||\r\n oldProps.customValidators !== this.props.customValidators ||\r\n oldProps.required !== this.props.required\r\n ) {\r\n this.handleErrors(this.props.tags);\r\n }\r\n }\r\n\r\n public handleLeaveMobileClick() {\r\n this.setState({\r\n textIsFocused: false,\r\n suggestionsVisible: false,\r\n preselectedSuggestion: undefined,\r\n });\r\n }\r\n\r\n public handleClickOutside(e: MouseEvent) {\r\n if (\r\n !this.containerRef.current ||\r\n this.containerRef.current\r\n .querySelector('.tags-input__tag__wrapper')\r\n ?.contains(e.target as HTMLDivElement) ||\r\n this.containerRef.current\r\n .querySelector('.tags-input__text-input')\r\n ?.contains(e.target as HTMLDivElement) ||\r\n !this.suggestionsRef.current ||\r\n this.suggestionsRef.current.contains(e.target as HTMLDivElement)\r\n ) {\r\n return;\r\n }\r\n if (this.state.suggestionsVisible) {\r\n this.props.onSuggestionsClosed?.();\r\n }\r\n this.setState({\r\n suggestionsVisible: false,\r\n preselectedSuggestion: undefined,\r\n });\r\n if (this.props.addNewOnBlur && this.state.value) {\r\n const suggestions = this.getSuggestions();\r\n const existing = suggestions.find((s) => s.name === this.state.value);\r\n if (existing) {\r\n this.onSuggestionSelected(existing, suggestions.length === 1);\r\n } else if (this.props.allowNew) {\r\n this.addNewTag();\r\n }\r\n } /* else if (this.state.value) {\r\n this.setState({ value: '' });\r\n }*/\r\n }\r\n\r\n public componentDidMount() {\r\n document.addEventListener('mousedown', this.handleClickOutside);\r\n document.addEventListener('touchstart', this.handleClickOutside);\r\n this.handleErrors(this.props.tags);\r\n }\r\n\r\n public componentWillUnmount() {\r\n document.removeEventListener('mousedown', this.handleClickOutside);\r\n document.removeEventListener('touchstart', this.handleClickOutside);\r\n super.componentWillUnmount();\r\n }\r\n\r\n public render() {\r\n const translations = this.getTranslations(defaultTagsTranslations);\r\n const textProps = this.props.textProps ? this.props.textProps : {};\r\n const suggestions = this.getSuggestions();\r\n const showMobileVersion =\r\n this.props.mobileVersionEnabled &&\r\n this.isMobile &&\r\n (this.state.textIsFocused || this.state.suggestionsVisible);\r\n const LeaveMobileButton = showMobileVersion ? (\r\n <Button\r\n className=\"tags-input__leaveMobileTagsButton line-height--0\"\r\n onClick={this.handleLeaveMobileClick}\r\n noShadow={true}\r\n unobtrusive={true}\r\n >\r\n <LeftArrowIcon />\r\n </Button>\r\n ) : undefined;\r\n const showInput = Boolean(\r\n (!this.props.maxTags ||\r\n this.props.maxTags > (this.props.tags && this.props.tags.length)) &&\r\n !this.props.readOnly\r\n );\r\n return (\r\n <Portal container={document.body} disablePortal={!showMobileVersion}>\r\n <InputGroup title={this.props.title} tooltip={this.props.tooltip}>\r\n <div\r\n {...(this.props.id && {\r\n id: this.props.id,\r\n })}\r\n className={classNames(\r\n 'input__base tags-input',\r\n this.getValidationClass(),\r\n this.props.className,\r\n {\r\n 'tags-input--readOnly': this.props.readOnly,\r\n 'tags-input--hasPlaceholder':\r\n this.props.textProps && this.props.textProps.placeholder,\r\n 'tags-input--mobile': showMobileVersion,\r\n }\r\n )}\r\n ref={this.containerRef}\r\n >\r\n {showMobileVersion && (\r\n <div className=\"tags-input__mobileBackdrop\" />\r\n )}\r\n <div className=\"tags-input__tags__wrapper\">\r\n {!showInput && showMobileVersion && LeaveMobileButton}\r\n {this.props.tags && this.props.tags.length > 0 ? (\r\n <div className=\"tags-input__tag__wrapper\">\r\n {this.props.tags.map((item, index) =>\r\n this.renderTag(item, index)\r\n )}\r\n </div>\r\n ) : (\r\n this.props.readOnly && (\r\n <div className=\"tags-input__tag__wrapper\">\r\n <div className=\"tags-input__tag\">\r\n {this.props.readonlyEmptyPlaceholder}\r\n </div>\r\n </div>\r\n )\r\n )}\r\n </div>\r\n {showInput && (\r\n <div\r\n className={\r\n 'tags-input__tags__wrapper ' +\r\n (this.props.readOnly ? 'filled ' : '')\r\n }\r\n >\r\n <Text\r\n showClearButton={true}\r\n {...textProps}\r\n {...(this.props.id && {\r\n id: this.props.id + '-text-input',\r\n })}\r\n ref={this.textRef}\r\n required={\r\n this.props.tags.length > 0 ? false : this.props.required\r\n }\r\n className={\r\n 'tags-input__text-input ' +\r\n (textProps.className ? textProps.className : '')\r\n }\r\n onKeyDown={this.onKeyDown(suggestions)}\r\n onErrorsChanged={this.onTextErrorsChanged}\r\n onChange={this.onTextChanged}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n value={this.state.value}\r\n readOnly={this.props.readOnly}\r\n showValidation={false}\r\n ignoreContext={true}\r\n validators={this.props.validators}\r\n customValidators={this.props.customValidators}\r\n before={LeaveMobileButton}\r\n />\r\n {this.state.suggestionsVisible &&\r\n this.props.showSuggestions && (\r\n <TagsSuggestions<T>\r\n {...(this.props.id && {\r\n id: this.props.id + '-text-input',\r\n })}\r\n className={classNames(\r\n this.props.tagsSuggestionsClassName\r\n )}\r\n innerRef={this.suggestionsRef}\r\n anchorEl={this.containerRef.current}\r\n allowNew={this.props.allowNew}\r\n preselectedSuggestion={this.state.preselectedSuggestion}\r\n loading={\r\n this.state.fetchingExistingTags || this.props.isLoading\r\n }\r\n LoadingComponent={this.props.suggestionsLoadingComponent}\r\n isVisible={this.state.suggestionsVisible}\r\n EmptyComponent={this.props.suggestionsEmptyComponent}\r\n WaitingForMoreInputComponent={\r\n this.props.waitingForMoreInputComponent\r\n }\r\n isWaitingForMoreInput={\r\n this.state.value.length < this.props.minLettersToFetch\r\n }\r\n tags={suggestions}\r\n onSelected={this.onSuggestionSelected}\r\n value={this.state.value}\r\n AddNewTagComponent={\r\n this.props.allowNew &&\r\n this.state.value !== '' &&\r\n (!this.props.existingTags ||\r\n !this.props.existingTags.find(\r\n (e) => e.name === this.state.value\r\n )) &&\r\n (!this.state.fetchedExistingTags ||\r\n !this.state.fetchedExistingTags.find(\r\n (e) => e.name === this.state.value\r\n )) &&\r\n this.state.textIsValid && (\r\n <Button\r\n {...(this.props.id && {\r\n id: this.props.id + '-add-new-button',\r\n })}\r\n className=\"tags-input__suggestion tags-input__add-new\"\r\n dropdown={true}\r\n onClick={this.addNewTag}\r\n >\r\n {translations.addNew} \"{this.state.value}\"\r\n </Button>\r\n )\r\n }\r\n SuggestionTag={this.props.SuggestionTag}\r\n popperProps={this.props.popperProps}\r\n />\r\n )}\r\n </div>\r\n )}\r\n {this.renderDefaultValidation()}\r\n {this.props.label && (\r\n <label\r\n className={\r\n this.state.value !== '' ||\r\n this.state.textIsFocused ||\r\n this.props.readOnly ||\r\n this.props.tags.length >= this.props.maxTags ||\r\n showMobileVersion\r\n ? 'label--focused'\r\n : ''\r\n }\r\n >\r\n {this.renderLabel()}\r\n </label>\r\n )}\r\n </div>\r\n </InputGroup>\r\n </Portal>\r\n );\r\n }\r\n\r\n private onTextErrorsChanged = (textErrors: ValidationError[]) =>\r\n this.setState(\r\n () => ({ textErrors }),\r\n () => this.handleErrors()\r\n );\r\n\r\n private onFocus = () => {\r\n this.props.onFocus?.();\r\n if (!this.state.suggestionsVisible) {\r\n this.props.onSuggestionsOpened?.();\r\n }\r\n this.fetchExistingTags(this.state.value);\r\n this.setState(\r\n () => ({ textIsFocused: true, suggestionsVisible: true, touched: true }),\r\n () => this.handleErrors()\r\n );\r\n const showMobileVersion =\r\n this.props.mobileVersionEnabled &&\r\n this.isMobile &&\r\n (this.state.textIsFocused || this.state.suggestionsVisible);\r\n if (\r\n !showMobileVersion &&\r\n this.props.mobileVersionEnabled &&\r\n this.isMobile\r\n ) {\r\n setTimeout(() => this.textRef.current?.focus(), 100);\r\n }\r\n };\r\n\r\n private onKeyDown = (suggestions: T[]) => async (e: React.KeyboardEvent) => {\r\n if (e.key === 'Tab') {\r\n this.setState({\r\n suggestionsVisible: false,\r\n preselectedSuggestion: undefined,\r\n });\r\n }\r\n if (\r\n e.key === 'Enter' &&\r\n (this.state.value !== '' ||\r\n this.state.preselectedSuggestion !== undefined) &&\r\n this.state.textErrors.length === 0\r\n ) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n const existingTag =\r\n this.props.existingTags &&\r\n this.props.existingTags.find((et) => et.name === this.state.value);\r\n if (this.state.preselectedSuggestion !== undefined) {\r\n this.props.onTagsChanged(\r\n this.props.tags.concat(suggestions[this.state.preselectedSuggestion])\r\n );\r\n this.setState({ value: '', preselectedSuggestion: undefined }, () => {\r\n this.fetchExistingTags();\r\n this.handleErrors();\r\n });\r\n } else if (existingTag) {\r\n this.props.onTagsChanged(this.props.tags.concat(existingTag));\r\n this.setState({ value: '' }, () => {\r\n this.fetchExistingTags();\r\n this.handleErrors();\r\n });\r\n } else if (this.props.allowNew) {\r\n await this.addNewTag();\r\n this.handleErrors();\r\n }\r\n }\r\n if (suggestions.length > 0 && this.state.suggestionsVisible) {\r\n if (e.key === 'ArrowUp') {\r\n const preselectedSuggestion =\r\n this.state.preselectedSuggestion === undefined\r\n ? suggestions.length - 1\r\n : this.state.preselectedSuggestion === 0\r\n ? suggestions.length - 1\r\n : this.state.preselectedSuggestion - 1;\r\n this.setState({ preselectedSuggestion });\r\n } else if (e.key === 'ArrowDown') {\r\n const preselectedSuggestion =\r\n this.state.preselectedSuggestion === undefined\r\n ? 0\r\n : this.state.preselectedSuggestion === suggestions.length - 1\r\n ? 0\r\n : this.state.preselectedSuggestion + 1;\r\n this.setState({ preselectedSuggestion });\r\n } else {\r\n this.setState({ preselectedSuggestion: undefined });\r\n }\r\n }\r\n };\r\n\r\n private addNewTag = async () => {\r\n const newTag = await this.props.onNewTagAdded(this.state.value);\r\n this.setState({\r\n suggestionsVisible: this.props.closeSuggestionsAfterCreate\r\n ? false\r\n : this.state.suggestionsVisible,\r\n });\r\n if (newTag) {\r\n this.props.onTagsChanged(\r\n this.props.tags ? this.props.tags.concat(newTag) : [newTag]\r\n );\r\n }\r\n this.setState({ value: '', textErrors: [] }, () => {\r\n this.fetchExistingTags();\r\n this.handleErrors();\r\n });\r\n };\r\n\r\n private onSuggestionSelected = (tag: T, lastSelected: boolean) => {\r\n const newTags = this.props.tags.concat(tag);\r\n this.props.onTagsChanged(newTags);\r\n const isMax = newTags.length === this.props.maxTags;\r\n const finalValue =\r\n !this.props.allowNew && !isMax && !lastSelected ? this.state.value : '';\r\n this.setState(\r\n {\r\n value: finalValue,\r\n suggestionsVisible:\r\n isMax || this.props.closeSuggestionsAfterCreate\r\n ? false\r\n : this.state.suggestionsVisible,\r\n preselectedSuggestion: undefined,\r\n textErrors: [],\r\n },\r\n () => {\r\n if (\r\n !this.props.maxTags ||\r\n this.props.tags.length + 1 < this.props.maxTags\r\n ) {\r\n this.fetchExistingTags(finalValue);\r\n }\r\n this.handleErrors();\r\n }\r\n );\r\n };\r\n\r\n private onBlur = () => {\r\n this.props.onBlur?.();\r\n this.setState(\r\n {\r\n textIsFocused: false,\r\n preselectedSuggestion: undefined,\r\n },\r\n () => this.handleErrors()\r\n );\r\n };\r\n\r\n private onTextChanged = (\r\n e: React.ChangeEvent<HTMLInputElement>,\r\n isValid: boolean\r\n ) => {\r\n const value = e.target.value;\r\n this.setState(\r\n () => ({\r\n value,\r\n isValid: isValid,\r\n textIsValid: isValid,\r\n suggestionsVisible: true,\r\n }),\r\n () => this.handleErrors()\r\n );\r\n this.fetchExistingTags(e.target.value);\r\n };\r\n\r\n private handleErrors = (tags: T[] = this.props.tags) => {\r\n let errors = this.getErrors(tags);\r\n if (errors.length > 0) {\r\n this.setInvalid(errors);\r\n } else {\r\n this.setValid();\r\n }\r\n };\r\n\r\n private getErrors(tags: T[]) {\r\n let errors = [];\r\n if (tags.length < this.props.maxTags) {\r\n errors = errors.concat(this.state.textErrors);\r\n }\r\n if (this.state.value !== '' && tags.length === 0 && this.props.required) {\r\n errors = errors.concat(\r\n this.getTranslations(this.props.translations).required\r\n );\r\n }\r\n if (this.state.value && this.props.allowNew && !this.state.textIsFocused) {\r\n errors = errors.concat(this.props.valueNotAddedError);\r\n }\r\n if (this.props.maxTags < (this.props.tags && this.props.tags.length)) {\r\n errors = errors.concat(this.props.maxTagsSurpassedError);\r\n }\r\n return errors.filter((i) => i);\r\n }\r\n\r\n private fetchExistingTags(startsWith: string = '') {\r\n if (\r\n this.props.fetchExistingTags &&\r\n startsWith.length >= this.props.minLettersToFetch\r\n ) {\r\n const timer = setTimeout(\r\n () => this.setState(() => ({ fetchingExistingTags: true })),\r\n this.props.loadingDelayMs\r\n );\r\n this.props.fetchExistingTags(startsWith).then((fetchedExistingTags) => {\r\n clearTimeout(timer);\r\n this.setState(() => ({\r\n fetchedExistingTags,\r\n fetchingExistingTags: false,\r\n }));\r\n });\r\n }\r\n }\r\n\r\n private getSuggestions() {\r\n const existingTags: T[] = []\r\n .concat(this.props.existingTags ? this.props.existingTags : [])\r\n .concat(\r\n this.state.fetchedExistingTags ? this.state.fetchedExistingTags : []\r\n );\r\n const filteredTags = this.props.filterExistingTags(\r\n this.state.value ? this.state.value.toLowerCase() : '',\r\n existingTags\r\n );\r\n let suggestions = filteredTags\r\n .filter(\r\n (tag) =>\r\n this.props.allowSameTagMultipleTimes ||\r\n !this.props.tags.some((t) => t.id === tag.id)\r\n )\r\n .slice(0, this.props.maxSuggestions);\r\n return suggestions;\r\n }\r\n\r\n private renderTag(tag: T, index: number) {\r\n const body = (\r\n <>\r\n {tag.name}\r\n {!this.props.readOnly && (\r\n <Button\r\n {...(this.props.id && {\r\n id: this.props.id + '-tag-' + index.toString(),\r\n })}\r\n circular={true}\r\n blank={true}\r\n onClick={this.tagRemoveClick(tag)}\r\n className=\"ml-1 transform-rotate--45 line-height--0 p-0\"\r\n Component={TagButtonComponent}\r\n preventsDefault={false}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n )}\r\n </>\r\n );\r\n const className = classNames('tags-input__tag', {\r\n 'tags-input__tag-chip': this.props.showChips,\r\n });\r\n if (this.props.onTagClick) {\r\n return (\r\n <Button\r\n onClick={this.tagClick(tag)}\r\n small={true}\r\n className={className}\r\n key={index}\r\n >\r\n {body}\r\n </Button>\r\n );\r\n }\r\n return (\r\n <div onClick={this.tagClick(tag)} className={className} key={index}>\r\n {body}\r\n </div>\r\n );\r\n }\r\n\r\n private tagClick = (tag: T) => () => {\r\n this.props.onTagClick && this.props.onTagClick(tag);\r\n };\r\n\r\n private tagRemoveClick = (tag: T) => (e: React.MouseEvent<HTMLElement>) => {\r\n e.stopPropagation();\r\n const newTags = this.props.tags.filter((sv) => sv.id !== tag.id);\r\n /*if (newTags.length === 0) {\r\n setTimeout(() => this.focus(), 50);\r\n }\r\n this.setState({\r\n suggestionsVisible: false,\r\n });*/\r\n this.props.onTagsChanged && this.props.onTagsChanged(newTags);\r\n this.handleErrors(newTags);\r\n // this.fetchExistingTags();\r\n };\r\n}\r\n\r\ninterface TagsFinal {\r\n <T extends Tag = Tag>(item: TagsProps<T>): React.ReactElement;\r\n defaultProps?: Partial<TagsProps>;\r\n}\r\n\r\nexport const Tags = withThemeContext<TagsProps, InstanceType<typeof TagsRaw>>(\r\n // tslint:disable-next-line: no-any\r\n withFormContext<TagsProps>(TagsRaw),\r\n 'tags'\r\n) as unknown as TagsFinal;\r\n\r\nexport default Tags;\r\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AAGA;;AAOA;;AACA;;AAGA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;;;;;;;IAlBYA,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;;;IACAC,a,YAAAA,a;;;;;;AAAAA,a;;;;;;;AAyBL,MAAMC,uBAAuB,mCAC/BC,kCAD+B;EAElCC,MAAM,EAAE;AAF0B,EAA7B;;;;AAsDP,MAAMC,kBAAkD,GAAIC,CAAD,iBACzD;EAAG,SAAS,EAAEA,CAAC,CAACC,SAAhB;EAA2B,EAAE,EAAED,CAAC,CAACE,EAAjC;EAAqC,OAAO,EAAEF,CAAC,CAACG;AAAhD,GACGH,CAAC,CAACI,QADL,CADF;;AAMO,MAAMC,OAAN,SAA2CC,oBAA3C,CAKL;EAkC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AAM4G,IAAI,GAAG,IAAAC,kCAAA,GAClB;AACA,IAAAC,gCAAA,EAA2BxJ,OAA3B,CAFkB,EAGlB,MAHkB,CAAb;;eAMQsJ,I"}
|
@@ -827,8 +827,7 @@
|
|
827
827
|
transition: 0.5s transform ease-in-out; }
|
828
828
|
.input__base .info-text__ul .info-text__item {
|
829
829
|
white-space: nowrap;
|
830
|
-
list-style: none;
|
831
|
-
line-height: 2; }
|
830
|
+
list-style: none; }
|
832
831
|
.input__base.validation__error .info-text__ul {
|
833
832
|
transform: translateY(-20px); }
|
834
833
|
.input__base label,
|