guestbell-forms 2.0.283 → 2.0.286
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.d.ts +1 -0
- package/build/components/tags/Tags.js +14 -3
- package/build/components/tags/Tags.js.map +1 -1
- package/build/components/textArea/TextArea.d.ts +1 -0
- package/build/components/textArea/TextArea.js +2 -1
- package/build/components/textArea/TextArea.js.map +1 -1
- package/build/dist/report.html +1 -1
- package/package.json +1 -1
@@ -43,6 +43,7 @@ export declare type TagsProps<T extends Tag = Tag> = {
|
|
43
43
|
minLettersToFetch?: number;
|
44
44
|
mobileVersionEnabled?: boolean;
|
45
45
|
isLoading?: boolean;
|
46
|
+
closeSuggestionsAfterCreate?: boolean;
|
46
47
|
SuggestionTag?: React.ComponentType<RenderSuggestionTagProps<T>>;
|
47
48
|
} & BaseInputProps<HTMLInputElement, TagsTranslations>;
|
48
49
|
export interface TagsState<T extends Tag = Tag> extends BaseInputState {
|
@@ -47,6 +47,10 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
47
47
|
|
48
48
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
49
49
|
|
50
|
+
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
51
|
+
|
52
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
53
|
+
|
50
54
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
51
55
|
|
52
56
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
@@ -293,6 +297,10 @@ var TagsRaw = /*#__PURE__*/function (_BaseInput) {
|
|
293
297
|
case 2:
|
294
298
|
newTag = _context2.sent;
|
295
299
|
|
300
|
+
_this.setState({
|
301
|
+
suggestionsVisible: _this.props.closeSuggestionsAfterCreate ? false : _this.state.suggestionsVisible
|
302
|
+
});
|
303
|
+
|
296
304
|
if (newTag) {
|
297
305
|
_this.props.onTagsChanged(_this.props.tags ? _this.props.tags.concat(newTag) : [newTag]);
|
298
306
|
}
|
@@ -306,7 +314,7 @@ var TagsRaw = /*#__PURE__*/function (_BaseInput) {
|
|
306
314
|
_this.handleErrors();
|
307
315
|
});
|
308
316
|
|
309
|
-
case
|
317
|
+
case 6:
|
310
318
|
case "end":
|
311
319
|
return _context2.stop();
|
312
320
|
}
|
@@ -324,7 +332,7 @@ var TagsRaw = /*#__PURE__*/function (_BaseInput) {
|
|
324
332
|
|
325
333
|
_this.setState({
|
326
334
|
value: finalValue,
|
327
|
-
suggestionsVisible: isMax ? false : _this.state.suggestionsVisible,
|
335
|
+
suggestionsVisible: isMax || _this.props.closeSuggestionsAfterCreate ? false : _this.state.suggestionsVisible,
|
328
336
|
preselectedSuggestion: undefined,
|
329
337
|
textErrors: []
|
330
338
|
}, function () {
|
@@ -501,6 +509,8 @@ var TagsRaw = /*#__PURE__*/function (_BaseInput) {
|
|
501
509
|
value: function componentWillUnmount() {
|
502
510
|
document.removeEventListener('mousedown', this.handleClickOutside);
|
503
511
|
document.removeEventListener('touchstart', this.handleClickOutside);
|
512
|
+
|
513
|
+
_get(_getPrototypeOf(TagsRaw.prototype), "componentWillUnmount", this).call(this);
|
504
514
|
}
|
505
515
|
}, {
|
506
516
|
key: "render",
|
@@ -739,7 +749,8 @@ _defineProperty(TagsRaw, "defaultProps", _objectSpread(_objectSpread({}, _BaseIn
|
|
739
749
|
addNewOnBlur: false,
|
740
750
|
translations: defaultTagsTranslations,
|
741
751
|
minLettersToFetch: 0,
|
742
|
-
mobileVersionEnabled: true
|
752
|
+
mobileVersionEnabled: true,
|
753
|
+
closeSuggestionsAfterCreate: false
|
743
754
|
}));
|
744
755
|
|
745
756
|
var Tags = (0, _withThemeContext.withThemeContext)( // tslint:disable-next-line: no-any
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/components/tags/Tags.tsx"],"names":["PlusIcon","LeftArrowIcon","defaultTagsTranslations","defaultBaseTranslations","addNew","TagButtonComponent","p","className","id","onClick","children","TagsRaw","props","textErrors","setState","handleErrors","e","onFocus","state","suggestionsVisible","onSuggestionsOpened","textIsFocused","touched","fetchExistingTags","value","showMobileVersion","mobileVersionEnabled","isMobile","setTimeout","textRef","current","focus","suggestions","key","preselectedSuggestion","undefined","length","preventDefault","stopPropagation","existingTag","existingTags","find","et","name","onTagsChanged","tags","concat","allowNew","addNewTag","onNewTagAdded","newTag","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","oldProps","validators","customValidators","required","containerRef","querySelector","contains","onSuggestionsClosed","addNewOnBlur","getSuggestions","existing","s","onSuggestionSelected","document","addEventListener","removeEventListener","translations","getTranslations","textProps","LeaveMobileButton","showInput","Boolean","readOnly","body","title","tooltip","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","BaseInput","defaultProps","disabled","newTagName","Promise","resolve","Date","getTime","text","Tags"],"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,IAAMC,uBAAuB,mCAC/BC,mCAD+B;AAElCC,EAAAA,MAAM,EAAE;AAF0B,EAA7B;;;;AAqDP,IAAMC,kBAAkD,GAAG,SAArDA,kBAAqD,CAAAC,CAAC;AAAA,sBAC1D;AAAG,IAAA,SAAS,EAAEA,CAAC,CAACC,SAAhB;AAA2B,IAAA,EAAE,EAAED,CAAC,CAACE,EAAjC;AAAqC,IAAA,OAAO,EAAEF,CAAC,CAACG;AAAhD,KACGH,CAAC,CAACI,QADL,CAD0D;AAAA,CAA5D;;IAMaC,O;;;;;AAsCX,mBAAYC,KAAZ,EAAiD;AAAA;;AAAA;;AAC/C,8BAAMA,KAAN;;AAD+C;;AAAA;;AAAA,+DAFrB,KAEqB;;AAAA,0EA0QnB,UAACC,UAAD;AAAA,aAC5B,MAAKC,QAAL,CACE;AAAA,eAAO;AAAED,UAAAA,UAAU,EAAVA;AAAF,SAAP;AAAA,OADF,EAEE;AAAA,eAAM,MAAKE,YAAL,EAAN;AAAA,OAFF,CAD4B;AAAA,KA1QmB;;AAAA,8DAgR/B,UAACC,CAAD,EAAiC;AAAA;;AACjD,kDAAKJ,KAAL,EAAWK,OAAX,8FAAqBD,CAArB;;AACA,UAAI,CAAC,MAAKE,KAAL,CAAWC,kBAAhB,EAAoC;AAAA;;AAClC,uDAAKP,K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EAAE;;;AAkjBnB,IAAMgI,IAAI,GAAI,yCACnB;AACA,sCAA2B/I,OAA3B,CAFmB,EAGnB,MAHmB,CAAd;;eAMQ+I,I","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 '@material-ui/core/Popper/Popper';\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport Portal from '@material-ui/core/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 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 };\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 }\r\n\r\n public componentWillUnmount() {\r\n document.removeEventListener('mousedown', this.handleClickOutside);\r\n document.removeEventListener('touchstart', this.handleClickOutside);\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 = (e: React.SyntheticEvent<{}>) => {\r\n this.props.onFocus?.(e);\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 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: isMax ? false : 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"],"file":"Tags.js"}
|
1
|
+
{"version":3,"sources":["../../../src/lib/components/tags/Tags.tsx"],"names":["PlusIcon","LeftArrowIcon","defaultTagsTranslations","defaultBaseTranslations","addNew","TagButtonComponent","p","className","id","onClick","children","TagsRaw","props","textErrors","setState","handleErrors","e","onFocus","state","suggestionsVisible","onSuggestionsOpened","textIsFocused","touched","fetchExistingTags","value","showMobileVersion","mobileVersionEnabled","isMobile","setTimeout","textRef","current","focus","suggestions","key","preselectedSuggestion","undefined","length","preventDefault","stopPropagation","existingTag","existingTags","find","et","name","onTagsChanged","tags","concat","allowNew","addNewTag","onNewTagAdded","newTag","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","oldProps","validators","customValidators","required","containerRef","querySelector","contains","onSuggestionsClosed","addNewOnBlur","getSuggestions","existing","s","onSuggestionSelected","document","addEventListener","removeEventListener","translations","getTranslations","textProps","LeaveMobileButton","showInput","Boolean","readOnly","body","title","tooltip","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","BaseInput","defaultProps","disabled","newTagName","Promise","resolve","Date","getTime","text","Tags"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AAGA;;AAO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AA2jB1B,IAAMwG,IAAI,GAAI,yCACnB;AACA,sCAA2BhJ,OAA3B,CAFmB,EAGnB,MAHmB,CAAd;;eAMQgJ,I","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 '@material-ui/core/Popper/Popper';\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport Portal from '@material-ui/core/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 }\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 = (e: React.SyntheticEvent<{}>) => {\r\n this.props.onFocus?.(e);\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"],"file":"Tags.js"}
|
@@ -103,7 +103,8 @@ var TextAreaRaw = /*#__PURE__*/function (_BaseInput) {
|
|
103
103
|
readOnly: this.props.readOnly,
|
104
104
|
onKeyDown: this.onKeyDown,
|
105
105
|
rows: this.props.minRows,
|
106
|
-
rowsMax: this.props.maxRows
|
106
|
+
rowsMax: this.props.maxRows,
|
107
|
+
maxLength: this.props.maxLength
|
107
108
|
})), /*#__PURE__*/React.createElement("span", {
|
108
109
|
className: "highlight"
|
109
110
|
}), /*#__PURE__*/React.createElement("span", {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/components/textArea/TextArea.tsx"],"names":["TextAreaRaw","props","e","onKeyDown","elem","inputRef","stopClickPropagation","stopPropagation","title","getValidationClass","readOnly","className","onContainerClick","containerRef","id","elemRef","placeholder","getDisabled","required","state","value","handleChange","handleBlur","handleFocus","minRows","maxRows","renderDefaultValidation","label","renderLabel","focus","BaseInput","Object","assign","defaultProps","type","TextArea"],"mappings":";;;;;;;;;AACA;;AAGA;;AACA;;AAKA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"sources":["../../../src/lib/components/textArea/TextArea.tsx"],"names":["TextAreaRaw","props","e","onKeyDown","elem","inputRef","stopClickPropagation","stopPropagation","title","getValidationClass","readOnly","className","onContainerClick","containerRef","id","elemRef","placeholder","getDisabled","required","state","value","handleChange","handleBlur","handleFocus","minRows","maxRows","maxLength","renderDefaultValidation","label","renderLabel","focus","BaseInput","Object","assign","defaultProps","type","TextArea"],"mappings":";;;;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r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport InputGroup from '../inputGroup/InputGroup';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n} from '../base/input/BaseInput';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport TextareaAutosize from '@material-ui/core/TextareaAutosize';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\n\r\nexport interface TextAreaProps extends BaseInputProps<HTMLTextAreaElement> {\r\n mask?: string;\r\n reverse?: boolean;\r\n placeholder?: string;\r\n stopClickPropagation?: boolean;\r\n inputRef?: (input: HTMLTextAreaElement) => void;\r\n readOnly?: boolean;\r\n type?: 'number' | 'text';\r\n minRows?: number;\r\n maxRows?: number;\r\n maxLength?: number;\r\n}\r\n\r\nexport interface TextAreaState extends BaseInputState {}\r\n\r\nexport class TextAreaRaw extends BaseInput<\r\n TextAreaProps,\r\n TextAreaState,\r\n HTMLTextAreaElement\r\n> {\r\n public static defaultProps = (Object.assign({}, BaseInput.defaultProps, {\r\n type: 'text',\r\n placeholder: '',\r\n stopClickPropagation: true,\r\n readOnly: false,\r\n }) as unknown) as TextAreaProps;\r\n private elem: HTMLTextAreaElement;\r\n\r\n constructor(props: TextAreaProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return (\r\n <InputGroup title={this.props.title}>\r\n <div\r\n className={`input__base textArea-input ${this.getValidationClass()} \r\n ${this.props.readOnly ? 'textArea-input--readOnly' : ''} \r\n ${this.props.className ? this.props.className : ''}`}\r\n onClick={this.onContainerClick}\r\n ref={this.containerRef}\r\n >\r\n <TextareaAutosize\r\n {...(this.props.id && {\r\n id: this.props.id,\r\n })}\r\n ref={this.elemRef}\r\n placeholder={this.props.placeholder}\r\n disabled={this.getDisabled()}\r\n required={this.props.required}\r\n className={this.state.value ? 'filled' : ''}\r\n onChange={this.handleChange}\r\n value={this.state.value}\r\n onBlur={this.handleBlur}\r\n onFocus={this.handleFocus}\r\n readOnly={this.props.readOnly}\r\n onKeyDown={this.onKeyDown}\r\n rows={this.props.minRows}\r\n rowsMax={this.props.maxRows}\r\n maxLength={this.props.maxLength}\r\n />\r\n <span className=\"highlight\" />\r\n <span className=\"bar\" />\r\n {this.renderDefaultValidation()}\r\n {this.props.label && <label>{this.renderLabel()}</label>}\r\n </div>\r\n </InputGroup>\r\n );\r\n }\r\n\r\n public focus() {\r\n this.elem && this.elem.focus();\r\n }\r\n\r\n private onKeyDown = e => this.props.onKeyDown && this.props.onKeyDown(e);\r\n\r\n private elemRef = (elem: HTMLTextAreaElement) => {\r\n this.elem = elem;\r\n this.props.inputRef && this.props.inputRef(elem);\r\n };\r\n\r\n private onContainerClick = e =>\r\n this.props.stopClickPropagation && e.stopPropagation();\r\n}\r\n\r\nexport const TextArea = withThemeContext<\r\n TextAreaProps,\r\n InstanceType<typeof TextAreaRaw>\r\n>(withFormContext<TextAreaProps>(TextAreaRaw), 'textArea');\r\n\r\nexport default TextArea;\r\n"],"file":"TextArea.js"}
|
package/build/dist/report.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset="UTF-8"/>
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
6
|
-
<title>guestbell-forms [
|
6
|
+
<title>guestbell-forms [28 Apr 2022 at 14:24]</title>
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4v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