guestbell-forms 2.0.309 → 3.0.0
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/bookingCalendar/bookingCalendarControls/BookingCalendarControls.d.ts +1 -0
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.d.ts +1 -0
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.d.ts +1 -0
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.d.ts +1 -0
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.d.ts +1 -0
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.d.ts +1 -0
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.d.ts +1 -0
- package/build/components/bookingCalendar/common.d.ts +1 -0
- package/build/components/bookingCalendar/utils.d.ts +1 -0
- package/build/components/dropdown/Dropdown.d.ts +1 -1
- package/build/components/dropdown/Dropdown.js +2 -2
- package/build/components/dropdown/Dropdown.js.map +1 -1
- package/build/components/inputHeader/InputHeader.js +1 -1
- package/build/components/inputHeader/InputHeader.js.map +1 -1
- package/build/components/openingHours/utils/OpeningHoursUtil.d.ts +1 -0
- package/build/components/tags/Tags.d.ts +1 -1
- package/build/components/tags/Tags.js +2 -2
- package/build/components/tags/Tags.js.map +1 -1
- package/build/components/tags/subComponents/TagsSuggestions.d.ts +1 -1
- package/build/components/tags/subComponents/TagsSuggestions.js +10 -7
- package/build/components/tags/subComponents/TagsSuggestions.js.map +1 -1
- package/build/components/textArea/TextArea.js +3 -3
- package/build/components/textArea/TextArea.js.map +1 -1
- package/build/dist/report.html +1 -1
- package/package.json +6 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { CollapseProps } from '@material
|
2
|
+
import { CollapseProps } from '@mui/material/Collapse';
|
3
3
|
import { ThemeContextProps } from '../themeProvider/ThemeContext';
|
4
4
|
export declare type DropdownProps = React.PropsWithChildren<ThemeContextProps & {
|
5
5
|
id?: string;
|
@@ -7,13 +7,13 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var _Collapse = _interopRequireDefault(require("@material
|
10
|
+
var _Collapse = _interopRequireDefault(require("@mui/material/Collapse"));
|
11
11
|
|
12
12
|
var _withThemeContext = require("../themeProvider/withThemeContext");
|
13
13
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
15
15
|
|
16
|
-
var _ClickAwayListener = _interopRequireDefault(require("@material
|
16
|
+
var _ClickAwayListener = _interopRequireDefault(require("@mui/material/ClickAwayListener"));
|
17
17
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.js","names":["Dropdown","props","shouldHandleClick","WrapperTag","notificationCount","showArrow","inline","onClick","onShow","onHide","disabled","className","headerClassName","header","id","collapseProps","children","submenuClassName","isDropdownVisible","setIsDropdownVisible","React","useState","hideNavigation","useCallback","showNavigation","onClickAway","e","stopPropagation","preventDefault","handleClick","containerClassName","classNames","headerClassNameAll","withThemeContext"],"sources":["../../../src/lib/components/dropdown/Dropdown.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport Collapse, { CollapseProps } from '@material
|
1
|
+
{"version":3,"file":"Dropdown.js","names":["Dropdown","props","shouldHandleClick","WrapperTag","notificationCount","showArrow","inline","onClick","onShow","onHide","disabled","className","headerClassName","header","id","collapseProps","children","submenuClassName","isDropdownVisible","setIsDropdownVisible","React","useState","hideNavigation","useCallback","showNavigation","onClickAway","e","stopPropagation","preventDefault","handleClick","containerClassName","classNames","headerClassNameAll","withThemeContext"],"sources":["../../../src/lib/components/dropdown/Dropdown.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport Collapse, { CollapseProps } from '@mui/material/Collapse';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport classNames from 'classnames';\r\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\r\n\r\nexport type DropdownProps = React.PropsWithChildren<\r\n ThemeContextProps & {\r\n id?: string;\r\n header?: JSX.Element | string;\r\n className?: string;\r\n submenuClassName?: string;\r\n headerClassName?: string;\r\n notificationCount?: number;\r\n // tslint:disable-next-line:no-any\r\n WrapperTag?: keyof JSX.IntrinsicElements;\r\n shouldHandleClick?: boolean;\r\n showArrow?: boolean;\r\n onClick?: (e: React.MouseEvent, isVisible: boolean) => void;\r\n onShow?: () => void;\r\n onHide?: () => void;\r\n disabled?: boolean;\r\n inline?: boolean;\r\n collapseProps?: Partial<CollapseProps>;\r\n }\r\n>;\r\n\r\nexport interface DropdownState {\r\n isDropdownVisible: boolean;\r\n}\r\n\r\nconst Dropdown: React.FC<DropdownProps> = props => {\r\n const {\r\n shouldHandleClick = true,\r\n WrapperTag = 'div',\r\n notificationCount = 0,\r\n showArrow = true,\r\n inline = true,\r\n onClick,\r\n onShow,\r\n onHide,\r\n disabled,\r\n className,\r\n headerClassName,\r\n header,\r\n id,\r\n collapseProps,\r\n children,\r\n submenuClassName,\r\n } = props;\r\n\r\n const [isDropdownVisible, setIsDropdownVisible] = React.useState(false);\r\n\r\n const hideNavigation = React.useCallback(() => {\r\n setIsDropdownVisible(false);\r\n onHide?.();\r\n }, [onHide]);\r\n\r\n const showNavigation = React.useCallback(() => {\r\n setIsDropdownVisible(true);\r\n onShow?.();\r\n }, [onShow]);\r\n\r\n const onClickAway = React.useCallback(\r\n (e: MouseEvent) => {\r\n hideNavigation();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n },\r\n [hideNavigation]\r\n );\r\n\r\n const handleClick = React.useCallback(\r\n (e: React.MouseEvent) => {\r\n if (shouldHandleClick && !disabled) {\r\n if (!isDropdownVisible) {\r\n showNavigation();\r\n } else {\r\n hideNavigation();\r\n }\r\n onClick?.(e, isDropdownVisible);\r\n }\r\n },\r\n [isDropdownVisible, onClick]\r\n );\r\n const containerClassName = classNames(\r\n 'guestbell__dropdown',\r\n !isDropdownVisible\r\n ? 'guestbell__dropdown--closed'\r\n : 'guestbell__dropdown--opened',\r\n { ['guestbell__dropdown--disabled']: disabled },\r\n { ['guestbell__dropdown--inline']: inline },\r\n className\r\n );\r\n const headerClassNameAll = classNames([\r\n 'guestbell__dropdown-toggle',\r\n { ['guestbell__dropdown-toggle__arrow--hidden']: !showArrow },\r\n { ['guestbell__dropdown-toggle--disabled']: disabled },\r\n headerClassName,\r\n ]);\r\n return (\r\n <ClickAwayListener\r\n onClickAway={onClickAway}\r\n mouseEvent={isDropdownVisible ? 'onMouseDown' : false}\r\n touchEvent={isDropdownVisible ? 'onTouchStart' : false}\r\n >\r\n <WrapperTag id={id ?? null} className={containerClassName}>\r\n <div role=\"button\" className={headerClassNameAll} onClick={handleClick}>\r\n {header}\r\n {notificationCount > 0 && (\r\n <span className=\"guestbell__label-count\">{notificationCount}</span>\r\n )}\r\n </div>\r\n <div className={'guestbell__dropdown-menu__container'}>\r\n <Collapse {...collapseProps} in={isDropdownVisible}>\r\n <ul\r\n className={classNames(\r\n 'guestbell__dropdown-menu',\r\n submenuClassName\r\n )}\r\n >\r\n {children}\r\n </ul>\r\n </Collapse>\r\n </div>\r\n </WrapperTag>\r\n </ClickAwayListener>\r\n );\r\n};\r\n\r\nexport default withThemeContext<DropdownProps, React.FC<DropdownProps>>(\r\n Dropdown\r\n);\r\n"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,QAAiC,GAAGC,KAAK,IAAI;EACjD,MAAM;IACJC,iBAAiB,GAAG,IADhB;IAEJC,UAAU,GAAG,KAFT;IAGJC,iBAAiB,GAAG,CAHhB;IAIJC,SAAS,GAAG,IAJR;IAKJC,MAAM,GAA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GACI,6BADJ,GAEI,6BAJqB,EAKzB;IAAE,CAAC,+BAAD,GAAmCR;EAArC,CALyB,EAMzB;IAAE,CAAC,6BAAD,GAAiCJ;EAAnC,CANyB,EAOzBK,SAPyB,CAA3B;EASA,MAAMqB,kBAAkB,GAAG,IAAAD,mBAAA,EAAW,CACpC,4BADoC,EAEpC;IAAE,CAAC,2CAAD,GAA+C,CAAC1B;EAAlD,CAFoC,EAGpC;IAAE,CAAC,sCAAD,GAA0CK;EAA5C,CAHoC,EAIpCE,eAJoC,CAAX,CAA3B;EAMA,oBACE,oBAAC,0BAAD;IACE,WAAW,EAAEa,WADf;IAEE,UAAU,EAAEP,iBAAiB,GAAG,aAAH,GAAmB,KAFlD;IAGE,UAAU,EAAEA,iBAAiB,GAAG,cAAH,GAAoB;EAHnD,gBAKE,oBAAC,UAAD;IAAY,EAAE,EAAEJ,EAAE,IAAI,IAAtB;IAA4B,SAAS,EAAEgB;EAAvC,gBACE;IAAK,IAAI,EAAC,QAAV;IAAmB,SAAS,EAAEE,kBAA9B;IAAkD,OAAO,EAAEH;EAA3D,GACGhB,MADH,EAEGT,iBAAiB,GAAG,CAApB,iBACC;IAAM,SAAS,EAAC;EAAhB,GAA0CA,iBAA1C,CAHJ,CADF,eAOE;IAAK,SAAS,EAAE;EAAhB,gBACE,oBAAC,iBAAD,eAAcW,aAAd;IAA6B,EAAE,EAAEG;EAAjC,iBACE;IACE,SAAS,EAAE,IAAAa,mBAAA,EACT,0BADS,EAETd,gBAFS;EADb,GAMGD,QANH,CADF,CADF,CAPF,CALF,CADF;AA4BD,CAjGD;;eAmGe,IAAAiB,kCAAA,EACbjC,QADa,C"}
|
@@ -13,7 +13,7 @@ var _Guid = _interopRequireDefault(require("../utils/Guid"));
|
|
13
13
|
|
14
14
|
var _dropdown = require("../dropdown");
|
15
15
|
|
16
|
-
var _Collapse = _interopRequireDefault(require("@material
|
16
|
+
var _Collapse = _interopRequireDefault(require("@mui/material/Collapse"));
|
17
17
|
|
18
18
|
var _withInputHeaderContext = require("./withInputHeaderContext");
|
19
19
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InputHeader.js","names":["classNames","require","MoreIcon","PlusIcon","CollapseExpandButtonComponent","props","className","onClick","children","InputHeaderRaw","React","PureComponent","constructor","guid","toggle","e","stopsPropagation","stopPropagation","Object","keys","state","inputHeaderContext","components","forEach","key","component","componentApi","expand","collapse","collapsed","collapsedDefault","registerInputHeader","unregisterInputHeader","stateChanged","forceUpdate","bind","componentWillUnmount","ignoreContext","componentId","componentDidMount","collapsible","setState","onChange","onExpanded","onCollapsed","render","undefined","getTypeClass","showExpandAll","noBg","shouldToggleCollapseOnHeaderClick","headerClassName","toggleClick","icon","title","renderTitle","subTitle","mainButtonClick","mainButton","extraButtons","extraButtonsButtonProps","renderExtraButtons","collapseButtonsButtonProps","length","renderCollapseExpandAll","contentClassName","mountOnEnter","unmountOnExit","previousState","assign","type","arr","map","extraButton","index","allCollapsed","allExpanded","containerClick","expandAllClick","collapseAllClick","tooltip","renderTooltip","content","Tippy","default","document","body","tooltipProps","InputHeader","withThemeContext","withInputHeaderContext"],"sources":["../../../src/lib/components/inputHeader/InputHeader.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nvar classNames = require('classnames');\r\n\r\n// Misc\r\nimport * as MoreIcon from 'material-design-icons/navigation/svg/production/ic_more_vert_24px.svg';\r\nimport * as PlusIcon from 'material-design-icons/hardware/svg/production/ic_keyboard_arrow_down_24px.svg';\r\nimport { ButtonProps, Button, ButtonComponentProps } from '../button/Button';\r\nimport guid from '../utils/Guid';\r\nimport { Dropdown } from '../dropdown';\r\nimport Collapse from '@material-ui/core/Collapse';\r\nimport {\r\n OmitInputHeaderContext,\r\n InputHeaderContextProps,\r\n InputHeaderContextState,\r\n InputHeaderComponentContextState,\r\n} from '../inputHeader/InputHeaderContext';\r\nimport { withInputHeaderContext } from './withInputHeaderContext';\r\nimport { TippyProps } from '@tippy.js/react';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\n\r\nexport type InputHeaderRawProps = React.PropsWithChildren<\r\n {\r\n onExpanded?: () => void;\r\n onCollapsed?: () => void;\r\n onChange?: (collapsed: boolean) => void;\r\n className?: string;\r\n title?: string | JSX.Element;\r\n icon?: string | JSX.Element;\r\n subTitle?: string | JSX.Element;\r\n mainButton?: JSX.Element;\r\n extraButtons?: JSX.Element[];\r\n collapsible?: boolean;\r\n collapsed?: boolean;\r\n collapsedDefault?: boolean;\r\n ignoreContext?: boolean;\r\n showExpandAll?: boolean;\r\n type?: 'hero' | 'standard' | 'small';\r\n noBg?: boolean;\r\n headerClassName?: string;\r\n contentClassName?: string;\r\n extraButtonsButtonProps?: ButtonProps;\r\n collapseButtonsButtonProps?: ButtonProps;\r\n shouldToggleCollapseOnHeaderClick?: boolean;\r\n mountOnEnter?: boolean;\r\n unmountOnExit?: boolean;\r\n tooltip?: string | JSX.Element;\r\n tooltipProps?: TippyProps;\r\n stopsPropagation?: boolean;\r\n } & InputHeaderContextProps &\r\n ThemeContextProps\r\n>;\r\n\r\nexport type InputHeaderProps = OmitInputHeaderContext<InputHeaderRawProps>;\r\n\r\nexport interface InputHeaderApi {\r\n expand: () => void;\r\n collapse: () => void;\r\n toggle: () => void;\r\n}\r\n\r\nexport interface InputHeaderState {\r\n collapsed: boolean;\r\n inputHeaderContext: InputHeaderContextState;\r\n}\r\n\r\nconst CollapseExpandButtonComponent: React.SFC<ButtonComponentProps> = props => (\r\n <a className={props.className} onClick={props.onClick} href=\"#\">\r\n {props.children}\r\n </a>\r\n);\r\n\r\nexport class InputHeaderRaw\r\n extends React.PureComponent<InputHeaderRawProps, InputHeaderState>\r\n implements InputHeaderApi {\r\n public static defaultProps: InputHeaderProps = {\r\n ignoreContext: false,\r\n showExpandAll: false,\r\n collapsedDefault: true,\r\n type: 'standard',\r\n noBg: false,\r\n shouldToggleCollapseOnHeaderClick: false,\r\n stopsPropagation: true,\r\n };\r\n\r\n public componentId = guid();\r\n\r\n constructor(props: InputHeaderRawProps) {\r\n super(props);\r\n this.state = {\r\n collapsed: props.collapsedDefault,\r\n inputHeaderContext: {\r\n registerInputHeader: this.registerInputHeader,\r\n unregisterInputHeader: this.unregisterInputHeader,\r\n stateChanged: () => this.forceUpdate(),\r\n components: {},\r\n },\r\n };\r\n this.registerInputHeader = this.registerInputHeader.bind(this);\r\n this.unregisterInputHeader = this.unregisterInputHeader.bind(this);\r\n this.expand = this.expand.bind(this);\r\n this.collapse = this.collapse.bind(this);\r\n this.toggle = this.toggle.bind(this);\r\n }\r\n\r\n public componentWillUnmount() {\r\n if (!this.props.ignoreContext && this.props.inputHeaderContext) {\r\n this.props.inputHeaderContext.unregisterInputHeader(this.componentId);\r\n }\r\n }\r\n\r\n public componentDidMount() {\r\n if (!this.props.ignoreContext && this.props.inputHeaderContext) {\r\n this.props.inputHeaderContext.registerInputHeader(this.componentId, {\r\n componentId: this.componentId,\r\n componentApi: {\r\n expand: this.expand,\r\n collapse: this.collapse,\r\n toggle: this.toggle,\r\n },\r\n props: { ...{}, ...(this.props as InputHeaderProps) },\r\n state: { ...{}, ...this.state },\r\n });\r\n }\r\n }\r\n\r\n public expand() {\r\n this.props.collapsible &&\r\n this.setState({ collapsed: false }, () => {\r\n this.props.inputHeaderContext?.stateChanged?.();\r\n this.props.onChange?.(true);\r\n this.props.onExpanded?.();\r\n });\r\n }\r\n\r\n public collapse() {\r\n this.props.collapsible &&\r\n this.setState({ collapsed: true }, () => {\r\n this.props.inputHeaderContext?.stateChanged?.();\r\n this.props.onChange?.(false);\r\n this.props.onCollapsed?.();\r\n });\r\n }\r\n\r\n public toggle() {\r\n this.props.collapsible &&\r\n this.setState({ collapsed: !this.state.collapsed }, () => {\r\n this.props.inputHeaderContext?.stateChanged?.();\r\n this.props.onChange?.(this.state.collapsed);\r\n if (this.state.collapsed) {\r\n this.props.onCollapsed?.();\r\n }\r\n if (!this.state.collapsed) {\r\n this.props.onExpanded?.();\r\n }\r\n });\r\n }\r\n\r\n public render() {\r\n const collapsed =\r\n this.props.collapsed !== undefined\r\n ? !this.props.collapsed\r\n : !this.state.collapsed;\r\n return (\r\n <div\r\n className={\r\n `input__header ` +\r\n (this.props.className ? this.props.className : '') +\r\n ' ' +\r\n this.getTypeClass()\r\n }\r\n >\r\n <div\r\n className={classNames(\r\n 'input__header__top',\r\n { 'input__header__top--tall': this.props.showExpandAll },\r\n { 'input__header__top--no-bg': this.props.noBg },\r\n {\r\n 'input__header__top--clickable':\r\n this.props.collapsible &&\r\n this.props.shouldToggleCollapseOnHeaderClick,\r\n },\r\n this.props.headerClassName\r\n )}\r\n role={\r\n this.props.collapsible &&\r\n this.props.shouldToggleCollapseOnHeaderClick\r\n ? 'button'\r\n : undefined\r\n }\r\n onClick={\r\n this.props.collapsible &&\r\n this.props.shouldToggleCollapseOnHeaderClick\r\n ? this.toggleClick\r\n : undefined\r\n }\r\n >\r\n <div className={'input__header__top__header-container '}>\r\n {this.props.icon && (\r\n <div className=\"input__header__icon line-height--0\">\r\n {this.props.icon}\r\n </div>\r\n )}\r\n <div className=\"input__header__title__container\">\r\n {this.props.title && (\r\n <div className=\"input__header__title\">{this.renderTitle()}</div>\r\n )}\r\n {this.props.subTitle && (\r\n <div className=\"input__header__sub-title\">\r\n {this.props.subTitle}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n <div\r\n className=\"input__header__top__button-container\"\r\n onClick={this.mainButtonClick}\r\n >\r\n {this.props.mainButton && this.props.mainButton}\r\n {this.props.extraButtons ? (\r\n <Dropdown\r\n header={\r\n <Button\r\n blank={true}\r\n circular={true}\r\n {...this.props.extraButtonsButtonProps}\r\n >\r\n <MoreIcon />\r\n </Button>\r\n }\r\n showArrow={false}\r\n headerClassName={'line-height--0'}\r\n className={''}\r\n >\r\n {this.renderExtraButtons()}\r\n </Dropdown>\r\n ) : null}\r\n {this.props.collapsible && (\r\n <Button\r\n circular={true}\r\n blank={true}\r\n className={`input__header__collapse-button line-height--0 ${\r\n this.state.collapsed ? 'collapsed' : ''\r\n }`}\r\n {...this.props.collapseButtonsButtonProps}\r\n onClick={this.toggleClick}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n )}\r\n </div>\r\n {this.props.showExpandAll &&\r\n Object.keys(this.state.inputHeaderContext.components).length > 0 &&\r\n this.renderCollapseExpandAll()}\r\n </div>\r\n <div\r\n className={\r\n 'input__header__bottom ' +\r\n (this.props.contentClassName ? this.props.contentClassName : '')\r\n }\r\n >\r\n {this.props.collapsible ? (\r\n <Collapse\r\n //this was here for some reason but it's messing with aria\r\n //collapsedHeight={'0.0001px'}\r\n in={collapsed}\r\n mountOnEnter={this.props.mountOnEnter}\r\n unmountOnExit={this.props.unmountOnExit}\r\n aria-expanded={collapsed ? 'false' : true}\r\n >\r\n {this.props.children}\r\n </Collapse>\r\n ) : (\r\n this.props.children\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n private toggleClick = () => this.toggle();\r\n\r\n private registerInputHeader(\r\n componentId: string,\r\n component: InputHeaderComponentContextState\r\n ) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.inputHeaderContext.components\r\n );\r\n components[componentId] = component;\r\n return {\r\n inputHeaderContext: { ...previousState.inputHeaderContext, components },\r\n };\r\n });\r\n }\r\n\r\n private unregisterInputHeader(componentId: string) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.inputHeaderContext.components\r\n );\r\n delete components[componentId];\r\n return {\r\n inputHeaderContext: { ...previousState.inputHeaderContext, components },\r\n };\r\n });\r\n }\r\n\r\n private getTypeClass() {\r\n switch (this.props.type) {\r\n case 'hero':\r\n return 'input__header--hero';\r\n case 'small':\r\n return 'input__header--small';\r\n default:\r\n return '';\r\n }\r\n }\r\n\r\n private mainButtonClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n if (this.props.stopsPropagation) {\r\n e.stopPropagation();\r\n }\r\n };\r\n\r\n private renderExtraButtons() {\r\n let arr = [];\r\n if (typeof this.props.extraButtons === 'function') {\r\n arr = this.props.extraButtons;\r\n } else {\r\n arr = this.props.extraButtons;\r\n }\r\n\r\n return arr.map((extraButton, index) => <li key={index}>{extraButton}</li>);\r\n }\r\n\r\n private renderCollapseExpandAll() {\r\n let allCollapsed = true;\r\n let allExpanded = true;\r\n Object.keys(this.state.inputHeaderContext.components).forEach(key => {\r\n const component = this.state.inputHeaderContext.components[key];\r\n if (component && component.props.collapsible) {\r\n if (component.state.collapsed) {\r\n allExpanded = false;\r\n } else {\r\n allCollapsed = false;\r\n }\r\n }\r\n });\r\n return (\r\n <div\r\n className=\"input__header__expand-collapse--all\"\r\n onClick={this.containerClick}\r\n >\r\n {(allCollapsed || !allExpanded) && (\r\n <Button\r\n noRipples={true}\r\n small={true}\r\n className={allExpanded || !allCollapsed ? 'mr-2' : ''}\r\n onClick={this.expandAllClick}\r\n blank={true}\r\n Component={CollapseExpandButtonComponent}\r\n >\r\n Expand all\r\n </Button>\r\n )}\r\n {(allExpanded || !allCollapsed) && (\r\n <Button\r\n noRipples={true}\r\n small={true}\r\n onClick={this.collapseAllClick}\r\n blank={true}\r\n Component={CollapseExpandButtonComponent}\r\n >\r\n Collapse all\r\n </Button>\r\n )}\r\n </div>\r\n );\r\n }\r\n\r\n private containerClick = (e: React.MouseEvent<HTMLDivElement>) =>\r\n e.stopPropagation();\r\n\r\n private expandAllClick = () => {\r\n Object.keys(this.state.inputHeaderContext.components).forEach(key => {\r\n const component = this.state.inputHeaderContext.components[key];\r\n component.componentApi.expand();\r\n });\r\n };\r\n\r\n private collapseAllClick = () => {\r\n Object.keys(this.state.inputHeaderContext.components).forEach(key => {\r\n const component = this.state.inputHeaderContext.components[key];\r\n component.componentApi.collapse();\r\n });\r\n };\r\n\r\n private renderTitle() {\r\n if (!this.props.tooltip) {\r\n return this.props.title;\r\n }\r\n return (\r\n <React.Fragment>\r\n {this.props.title}\r\n {this.renderTooltip()}\r\n </React.Fragment>\r\n );\r\n }\r\n\r\n private renderTooltip(\r\n content: JSX.Element = <span className=\"label--help-icon\">?</span>\r\n ) {\r\n if (this.props.tooltip) {\r\n const Tippy = require('@tippy.js/react').default;\r\n\r\n return (\r\n <Tippy\r\n content={this.props.tooltip}\r\n placement=\"bottom\"\r\n animation=\"scale-subtle\"\r\n arrow={false}\r\n duration={200}\r\n delay={[75, 0]}\r\n distance={8}\r\n interactive={true}\r\n appendTo={document?.body}\r\n trigger=\"mouseenter focus\"\r\n {...this.props.tooltipProps}\r\n >\r\n <span tabIndex={0}>{content}</span>\r\n </Tippy>\r\n );\r\n }\r\n return content;\r\n }\r\n}\r\n\r\nexport const InputHeader = withThemeContext<\r\n InputHeaderRawProps,\r\n InstanceType<typeof InputHeaderRaw>\r\n>(withInputHeaderContext<InputHeaderRawProps>(InputHeaderRaw), 'inputHeader');\r\n\r\nexport default InputHeader;\r\n"],"mappings":";;;;;;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAOA;;AAEA;;;;;;;;;;;;;;;;AAjBA,IAAIA,UAAU,GAAGC,OAAO,CAAC,YAAD,CAAxB,C,CAEA;;;IACYC,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;;;IACAC,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;;;AA6DZ,MAAMC,6BAA8D,GAAGC,KAAK,iBAC1E;EAAG,SAAS,EAAEA,KAAK,CAACC,SAApB;EAA+B,OAAO,EAAED,KAAK,CAACE,OAA9C;EAAuD,IAAI,EAAC;AAA5D,GACGF,KAAK,CAACG,QADT,CADF;;AAMO,MAAMC,cAAN,SACGC,KAAK,CAACC,aADT,CAEqB;EAa1BC,WAAW,CAACP,KAAD,EAA6B;IACtC,MAAMA,KAAN;;IADsC,qCAFnB,IAAAQ,aAAA,GAEmB;;IAAA,qCAiMlB,MAAM,KAAKC,MAAL,EAjMY;;IAAA,yCA2ObC,CAAD,IAAyC;MACjE,IAAI,KAAKV,KAAL,CAAWW,gBAAf,EAAiC;QAC/BD,CAA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E,IARf;QASE,QAAQ,eAAEK,QAAF,8CAAE,UAAUC,IATtB;QAUE,OAAO,EAAC;MAVV,GAWM,KAAKjF,KAAL,CAAWkF,YAXjB,gBAaE;QAAM,QAAQ,EAAE;MAAhB,GAAoBL,OAApB,CAbF,CADF;IAiBD;;IACD,OAAOA,OAAP;EACD;;AA5WyB;;;;gBAFfzE,c,kBAGoC;EAC7C4B,aAAa,EAAE,KAD8B;EAE7CW,aAAa,EAAE,KAF8B;EAG7ClB,gBAAgB,EAAE,IAH2B;EAI7CwC,IAAI,EAAE,UAJuC;EAK7CrB,IAAI,EAAE,KALuC;EAM7CC,iCAAiC,EAAE,KANU;EAO7ClC,gBAAgB,EAAE;AAP2B,C;;AA8W1C,MAAMwE,WAAW,GAAG,IAAAC,kCAAA,EAGzB,IAAAC,8CAAA,EAA4CjF,cAA5C,CAHyB,EAGoC,aAHpC,CAApB;;eAKQ+E,W"}
|
1
|
+
{"version":3,"file":"InputHeader.js","names":["classNames","require","MoreIcon","PlusIcon","CollapseExpandButtonComponent","props","className","onClick","children","InputHeaderRaw","React","PureComponent","constructor","guid","toggle","e","stopsPropagation","stopPropagation","Object","keys","state","inputHeaderContext","components","forEach","key","component","componentApi","expand","collapse","collapsed","collapsedDefault","registerInputHeader","unregisterInputHeader","stateChanged","forceUpdate","bind","componentWillUnmount","ignoreContext","componentId","componentDidMount","collapsible","setState","onChange","onExpanded","onCollapsed","render","undefined","getTypeClass","showExpandAll","noBg","shouldToggleCollapseOnHeaderClick","headerClassName","toggleClick","icon","title","renderTitle","subTitle","mainButtonClick","mainButton","extraButtons","extraButtonsButtonProps","renderExtraButtons","collapseButtonsButtonProps","length","renderCollapseExpandAll","contentClassName","mountOnEnter","unmountOnExit","previousState","assign","type","arr","map","extraButton","index","allCollapsed","allExpanded","containerClick","expandAllClick","collapseAllClick","tooltip","renderTooltip","content","Tippy","default","document","body","tooltipProps","InputHeader","withThemeContext","withInputHeaderContext"],"sources":["../../../src/lib/components/inputHeader/InputHeader.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nvar classNames = require('classnames');\r\n\r\n// Misc\r\nimport * as MoreIcon from 'material-design-icons/navigation/svg/production/ic_more_vert_24px.svg';\r\nimport * as PlusIcon from 'material-design-icons/hardware/svg/production/ic_keyboard_arrow_down_24px.svg';\r\nimport { ButtonProps, Button, ButtonComponentProps } from '../button/Button';\r\nimport guid from '../utils/Guid';\r\nimport { Dropdown } from '../dropdown';\r\nimport Collapse from '@mui/material/Collapse';\r\nimport {\r\n OmitInputHeaderContext,\r\n InputHeaderContextProps,\r\n InputHeaderContextState,\r\n InputHeaderComponentContextState,\r\n} from '../inputHeader/InputHeaderContext';\r\nimport { withInputHeaderContext } from './withInputHeaderContext';\r\nimport { TippyProps } from '@tippy.js/react';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport { ThemeContextProps } from '../themeProvider/ThemeContext';\r\n\r\nexport type InputHeaderRawProps = React.PropsWithChildren<\r\n {\r\n onExpanded?: () => void;\r\n onCollapsed?: () => void;\r\n onChange?: (collapsed: boolean) => void;\r\n className?: string;\r\n title?: string | JSX.Element;\r\n icon?: string | JSX.Element;\r\n subTitle?: string | JSX.Element;\r\n mainButton?: JSX.Element;\r\n extraButtons?: JSX.Element[];\r\n collapsible?: boolean;\r\n collapsed?: boolean;\r\n collapsedDefault?: boolean;\r\n ignoreContext?: boolean;\r\n showExpandAll?: boolean;\r\n type?: 'hero' | 'standard' | 'small';\r\n noBg?: boolean;\r\n headerClassName?: string;\r\n contentClassName?: string;\r\n extraButtonsButtonProps?: ButtonProps;\r\n collapseButtonsButtonProps?: ButtonProps;\r\n shouldToggleCollapseOnHeaderClick?: boolean;\r\n mountOnEnter?: boolean;\r\n unmountOnExit?: boolean;\r\n tooltip?: string | JSX.Element;\r\n tooltipProps?: TippyProps;\r\n stopsPropagation?: boolean;\r\n } & InputHeaderContextProps &\r\n ThemeContextProps\r\n>;\r\n\r\nexport type InputHeaderProps = OmitInputHeaderContext<InputHeaderRawProps>;\r\n\r\nexport interface InputHeaderApi {\r\n expand: () => void;\r\n collapse: () => void;\r\n toggle: () => void;\r\n}\r\n\r\nexport interface InputHeaderState {\r\n collapsed: boolean;\r\n inputHeaderContext: InputHeaderContextState;\r\n}\r\n\r\nconst CollapseExpandButtonComponent: React.SFC<ButtonComponentProps> = props => (\r\n <a className={props.className} onClick={props.onClick} href=\"#\">\r\n {props.children}\r\n </a>\r\n);\r\n\r\nexport class InputHeaderRaw\r\n extends React.PureComponent<InputHeaderRawProps, InputHeaderState>\r\n implements InputHeaderApi {\r\n public static defaultProps: InputHeaderProps = {\r\n ignoreContext: false,\r\n showExpandAll: false,\r\n collapsedDefault: true,\r\n type: 'standard',\r\n noBg: false,\r\n shouldToggleCollapseOnHeaderClick: false,\r\n stopsPropagation: true,\r\n };\r\n\r\n public componentId = guid();\r\n\r\n constructor(props: InputHeaderRawProps) {\r\n super(props);\r\n this.state = {\r\n collapsed: props.collapsedDefault,\r\n inputHeaderContext: {\r\n registerInputHeader: this.registerInputHeader,\r\n unregisterInputHeader: this.unregisterInputHeader,\r\n stateChanged: () => this.forceUpdate(),\r\n components: {},\r\n },\r\n };\r\n this.registerInputHeader = this.registerInputHeader.bind(this);\r\n this.unregisterInputHeader = this.unregisterInputHeader.bind(this);\r\n this.expand = this.expand.bind(this);\r\n this.collapse = this.collapse.bind(this);\r\n this.toggle = this.toggle.bind(this);\r\n }\r\n\r\n public componentWillUnmount() {\r\n if (!this.props.ignoreContext && this.props.inputHeaderContext) {\r\n this.props.inputHeaderContext.unregisterInputHeader(this.componentId);\r\n }\r\n }\r\n\r\n public componentDidMount() {\r\n if (!this.props.ignoreContext && this.props.inputHeaderContext) {\r\n this.props.inputHeaderContext.registerInputHeader(this.componentId, {\r\n componentId: this.componentId,\r\n componentApi: {\r\n expand: this.expand,\r\n collapse: this.collapse,\r\n toggle: this.toggle,\r\n },\r\n props: { ...{}, ...(this.props as InputHeaderProps) },\r\n state: { ...{}, ...this.state },\r\n });\r\n }\r\n }\r\n\r\n public expand() {\r\n this.props.collapsible &&\r\n this.setState({ collapsed: false }, () => {\r\n this.props.inputHeaderContext?.stateChanged?.();\r\n this.props.onChange?.(true);\r\n this.props.onExpanded?.();\r\n });\r\n }\r\n\r\n public collapse() {\r\n this.props.collapsible &&\r\n this.setState({ collapsed: true }, () => {\r\n this.props.inputHeaderContext?.stateChanged?.();\r\n this.props.onChange?.(false);\r\n this.props.onCollapsed?.();\r\n });\r\n }\r\n\r\n public toggle() {\r\n this.props.collapsible &&\r\n this.setState({ collapsed: !this.state.collapsed }, () => {\r\n this.props.inputHeaderContext?.stateChanged?.();\r\n this.props.onChange?.(this.state.collapsed);\r\n if (this.state.collapsed) {\r\n this.props.onCollapsed?.();\r\n }\r\n if (!this.state.collapsed) {\r\n this.props.onExpanded?.();\r\n }\r\n });\r\n }\r\n\r\n public render() {\r\n const collapsed =\r\n this.props.collapsed !== undefined\r\n ? !this.props.collapsed\r\n : !this.state.collapsed;\r\n return (\r\n <div\r\n className={\r\n `input__header ` +\r\n (this.props.className ? this.props.className : '') +\r\n ' ' +\r\n this.getTypeClass()\r\n }\r\n >\r\n <div\r\n className={classNames(\r\n 'input__header__top',\r\n { 'input__header__top--tall': this.props.showExpandAll },\r\n { 'input__header__top--no-bg': this.props.noBg },\r\n {\r\n 'input__header__top--clickable':\r\n this.props.collapsible &&\r\n this.props.shouldToggleCollapseOnHeaderClick,\r\n },\r\n this.props.headerClassName\r\n )}\r\n role={\r\n this.props.collapsible &&\r\n this.props.shouldToggleCollapseOnHeaderClick\r\n ? 'button'\r\n : undefined\r\n }\r\n onClick={\r\n this.props.collapsible &&\r\n this.props.shouldToggleCollapseOnHeaderClick\r\n ? this.toggleClick\r\n : undefined\r\n }\r\n >\r\n <div className={'input__header__top__header-container '}>\r\n {this.props.icon && (\r\n <div className=\"input__header__icon line-height--0\">\r\n {this.props.icon}\r\n </div>\r\n )}\r\n <div className=\"input__header__title__container\">\r\n {this.props.title && (\r\n <div className=\"input__header__title\">{this.renderTitle()}</div>\r\n )}\r\n {this.props.subTitle && (\r\n <div className=\"input__header__sub-title\">\r\n {this.props.subTitle}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n <div\r\n className=\"input__header__top__button-container\"\r\n onClick={this.mainButtonClick}\r\n >\r\n {this.props.mainButton && this.props.mainButton}\r\n {this.props.extraButtons ? (\r\n <Dropdown\r\n header={\r\n <Button\r\n blank={true}\r\n circular={true}\r\n {...this.props.extraButtonsButtonProps}\r\n >\r\n <MoreIcon />\r\n </Button>\r\n }\r\n showArrow={false}\r\n headerClassName={'line-height--0'}\r\n className={''}\r\n >\r\n {this.renderExtraButtons()}\r\n </Dropdown>\r\n ) : null}\r\n {this.props.collapsible && (\r\n <Button\r\n circular={true}\r\n blank={true}\r\n className={`input__header__collapse-button line-height--0 ${\r\n this.state.collapsed ? 'collapsed' : ''\r\n }`}\r\n {...this.props.collapseButtonsButtonProps}\r\n onClick={this.toggleClick}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n )}\r\n </div>\r\n {this.props.showExpandAll &&\r\n Object.keys(this.state.inputHeaderContext.components).length > 0 &&\r\n this.renderCollapseExpandAll()}\r\n </div>\r\n <div\r\n className={\r\n 'input__header__bottom ' +\r\n (this.props.contentClassName ? this.props.contentClassName : '')\r\n }\r\n >\r\n {this.props.collapsible ? (\r\n <Collapse\r\n //this was here for some reason but it's messing with aria\r\n //collapsedHeight={'0.0001px'}\r\n in={collapsed}\r\n mountOnEnter={this.props.mountOnEnter}\r\n unmountOnExit={this.props.unmountOnExit}\r\n aria-expanded={collapsed ? 'false' : true}\r\n >\r\n {this.props.children}\r\n </Collapse>\r\n ) : (\r\n this.props.children\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n private toggleClick = () => this.toggle();\r\n\r\n private registerInputHeader(\r\n componentId: string,\r\n component: InputHeaderComponentContextState\r\n ) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.inputHeaderContext.components\r\n );\r\n components[componentId] = component;\r\n return {\r\n inputHeaderContext: { ...previousState.inputHeaderContext, components },\r\n };\r\n });\r\n }\r\n\r\n private unregisterInputHeader(componentId: string) {\r\n this.setState(previousState => {\r\n let components = Object.assign(\r\n {},\r\n previousState.inputHeaderContext.components\r\n );\r\n delete components[componentId];\r\n return {\r\n inputHeaderContext: { ...previousState.inputHeaderContext, components },\r\n };\r\n });\r\n }\r\n\r\n private getTypeClass() {\r\n switch (this.props.type) {\r\n case 'hero':\r\n return 'input__header--hero';\r\n case 'small':\r\n return 'input__header--small';\r\n default:\r\n return '';\r\n }\r\n }\r\n\r\n private mainButtonClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n if (this.props.stopsPropagation) {\r\n e.stopPropagation();\r\n }\r\n };\r\n\r\n private renderExtraButtons() {\r\n let arr = [];\r\n if (typeof this.props.extraButtons === 'function') {\r\n arr = this.props.extraButtons;\r\n } else {\r\n arr = this.props.extraButtons;\r\n }\r\n\r\n return arr.map((extraButton, index) => <li key={index}>{extraButton}</li>);\r\n }\r\n\r\n private renderCollapseExpandAll() {\r\n let allCollapsed = true;\r\n let allExpanded = true;\r\n Object.keys(this.state.inputHeaderContext.components).forEach(key => {\r\n const component = this.state.inputHeaderContext.components[key];\r\n if (component && component.props.collapsible) {\r\n if (component.state.collapsed) {\r\n allExpanded = false;\r\n } else {\r\n allCollapsed = false;\r\n }\r\n }\r\n });\r\n return (\r\n <div\r\n className=\"input__header__expand-collapse--all\"\r\n onClick={this.containerClick}\r\n >\r\n {(allCollapsed || !allExpanded) && (\r\n <Button\r\n noRipples={true}\r\n small={true}\r\n className={allExpanded || !allCollapsed ? 'mr-2' : ''}\r\n onClick={this.expandAllClick}\r\n blank={true}\r\n Component={CollapseExpandButtonComponent}\r\n >\r\n Expand all\r\n </Button>\r\n )}\r\n {(allExpanded || !allCollapsed) && (\r\n <Button\r\n noRipples={true}\r\n small={true}\r\n onClick={this.collapseAllClick}\r\n blank={true}\r\n Component={CollapseExpandButtonComponent}\r\n >\r\n Collapse all\r\n </Button>\r\n )}\r\n </div>\r\n );\r\n }\r\n\r\n private containerClick = (e: React.MouseEvent<HTMLDivElement>) =>\r\n e.stopPropagation();\r\n\r\n private expandAllClick = () => {\r\n Object.keys(this.state.inputHeaderContext.components).forEach(key => {\r\n const component = this.state.inputHeaderContext.components[key];\r\n component.componentApi.expand();\r\n });\r\n };\r\n\r\n private collapseAllClick = () => {\r\n Object.keys(this.state.inputHeaderContext.components).forEach(key => {\r\n const component = this.state.inputHeaderContext.components[key];\r\n component.componentApi.collapse();\r\n });\r\n };\r\n\r\n private renderTitle() {\r\n if (!this.props.tooltip) {\r\n return this.props.title;\r\n }\r\n return (\r\n <React.Fragment>\r\n {this.props.title}\r\n {this.renderTooltip()}\r\n </React.Fragment>\r\n );\r\n }\r\n\r\n private renderTooltip(\r\n content: JSX.Element = <span className=\"label--help-icon\">?</span>\r\n ) {\r\n if (this.props.tooltip) {\r\n const Tippy = require('@tippy.js/react').default;\r\n\r\n return (\r\n <Tippy\r\n content={this.props.tooltip}\r\n placement=\"bottom\"\r\n animation=\"scale-subtle\"\r\n arrow={false}\r\n duration={200}\r\n delay={[75, 0]}\r\n distance={8}\r\n interactive={true}\r\n appendTo={document?.body}\r\n trigger=\"mouseenter focus\"\r\n {...this.props.tooltipProps}\r\n >\r\n <span tabIndex={0}>{content}</span>\r\n </Tippy>\r\n );\r\n }\r\n return content;\r\n }\r\n}\r\n\r\nexport const InputHeader = withThemeContext<\r\n InputHeaderRawProps,\r\n InstanceType<typeof InputHeaderRaw>\r\n>(withInputHeaderContext<InputHeaderRawProps>(InputHeaderRaw), 'inputHeader');\r\n\r\nexport default InputHeader;\r\n"],"mappings":";;;;;;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAOA;;AAEA;;;;;;;;;;;;;;;;AAjBA,IAAIA,UAAU,GAAGC,OAAO,CAAC,YAAD,CAAxB,C,CAEA;;;IACYC,Q,YAAAA,Q;;;;;;AAAAA,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ADd,EAEG,KAAK2B,aAAL,EAFH,CADF;EAMD;;EAEOA,aAAa,GAEnB;IAAA,IADAC,OACA,oFADuB;MAAM,SAAS,EAAC;IAAhB,OACvB;;IACA,IAAI,KAAK7E,KAAL,CAAW2E,OAAf,EAAwB;MAAA;;MACtB,MAAMG,KAAK,GAAGlF,OAAO,CAAC,iBAAD,CAAP,CAA2BmF,OAAzC;;MAEA,oBACE,oBAAC,KAAD;QACE,OAAO,EAAE,KAAK/E,KAAL,CAAW2E,OADtB;QAEE,SAAS,EAAC,QAFZ;QAGE,SAAS,EAAC,cAHZ;QAIE,KAAK,EAAE,KAJT;QAKE,QAAQ,EAAE,GALZ;QAME,KAAK,EAAE,CAAC,EAAD,EAAK,CAAL,CANT;QAOE,QAAQ,EAAE,CAPZ;QAQE,WAAW,EAAE,IARf;QASE,QAAQ,eAAEK,QAAF,8CAAE,UAAUC,IATtB;QAUE,OAAO,EAAC;MAVV,GAWM,KAAKjF,KAAL,CAAWkF,YAXjB,gBAaE;QAAM,QAAQ,EAAE;MAAhB,GAAoBL,OAApB,CAbF,CADF;IAiBD;;IACD,OAAOA,OAAP;EACD;;AA5WyB;;;;gBAFfzE,c,kBAGoC;EAC7C4B,aAAa,EAAE,KAD8B;EAE7CW,aAAa,EAAE,KAF8B;EAG7ClB,gBAAgB,EAAE,IAH2B;EAI7CwC,IAAI,EAAE,UAJuC;EAK7CrB,IAAI,EAAE,KALuC;EAM7CC,iCAAiC,EAAE,KANU;EAO7ClC,gBAAgB,EAAE;AAP2B,C;;AA8W1C,MAAMwE,WAAW,GAAG,IAAAC,kCAAA,EAGzB,IAAAC,8CAAA,EAA4CjF,cAA5C,CAHyB,EAGoC,aAHpC,CAApB;;eAKQ+E,W"}
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
2
2
|
import { TextProps } from '../text/Text';
|
3
3
|
import { BaseInputProps, BaseInputState, BaseInput, ValidationError } from '../base/input/BaseInput';
|
4
4
|
import { RenderSuggestionTagProps } from './subComponents/TagsSuggestions';
|
5
|
-
import { PopperProps } from '@material
|
5
|
+
import { PopperProps } from '@mui/material/Popper/Popper';
|
6
6
|
export declare type Tag = {
|
7
7
|
id: number | string;
|
8
8
|
name: string;
|
@@ -23,9 +23,9 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
23
|
|
24
24
|
var _withThemeContext = require("../themeProvider/withThemeContext");
|
25
25
|
|
26
|
-
var _LinearProgress = _interopRequireDefault(require("@material
|
26
|
+
var _LinearProgress = _interopRequireDefault(require("@mui/material/LinearProgress"));
|
27
27
|
|
28
|
-
var _Portal = _interopRequireDefault(require("@material
|
28
|
+
var _Portal = _interopRequireDefault(require("@mui/material/Portal"));
|
29
29
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
31
|
|
@@ -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","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","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 '@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 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 = (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"],"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,GAAGC,CAAC,iBAC1D;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;EAkCAC,WAAW,CAACC,KAAD,EAAsC;IAAA;;IAC/C,MAAMA,KAAN,CAD+C;IAAA;;IAAA;;IAAA;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,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","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","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 = (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"],"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,GAAGC,CAAC,iBAC1D;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;EAkCAC,WAAW,CAACC,KAAD,EAAsC;IAAA;;IAC/C,MAAMA,KAAN,CAD+C;IAAA;;IAAA;;IAAA;;IAAA,kCAFrB,KAEqB;;IAAA,6CA4QlBC,UAAD,IAC5B,KAAKC,QAAL,CACE,OAAO;MAAED;IAAF,CAAP,CADF,EAEE,MAAM,KAAKE,YAAL,EAFR,CA7Q+C;;IAAA,iCAkR9BC,CAAD,IAAiC;MAAA;;MACjD,2CAAKJ,KAAL,EAAWK,OAAX,8FAAqBD,CAArB;;MACA,IAAI,CAAC,KAAKE,KAAL,CAAWC,kBAAhB,EAAoC;QAAA;;QAClC,8CAAKP,KAAL,EAAWQ,mBAAX;MACD;;MACD,KAAKN,QAAL,CACE,OAAO;QAAEO,aAAa,EAAE,IAAjB;QAAuBF,kBAAkB,EAAE,IAA3C;QAAiDG,OAAO,EAAE;MAA1D,CAAP,CADF,EAEE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rBe,aAAa,EAAEuG,UAAU,IACvBC,OAAO,CAACC,OAAR,CAAgB;IAAEhH,IAAI,EAAE8G,UAAR;IAAoBnJ,EAAE,EAAE,IAAIsJ,IAAJ,GAAWC,OAAX;EAAxB,CAAhB,C;EACF1B,kBAAkB,eAAE,0D;EACpBC,qBAAqB,eAAE,qE;EACvBR,4BAA4B,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;EACnBnG,oBAAoB,EAAE,I;EACtByB,2BAA2B,EAAE;;;AA4jB1B,MAAM4G,IAAI,GAAI,IAAAC,kCAAA,GACnB;AACA,IAAAC,gCAAA,EAA2BxJ,OAA3B,CAFmB,EAGnB,MAHmB,CAAd;;eAMQsJ,I"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Tag } from '..';
|
3
|
-
import { PopperProps } from '@material
|
3
|
+
import { PopperProps } from '@mui/material/Popper';
|
4
4
|
export declare type RenderSuggestionTagProps<T extends Tag = Tag> = {
|
5
5
|
tag: T;
|
6
6
|
index: number;
|
@@ -9,7 +9,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
10
10
|
var _ = require("../../..");
|
11
11
|
|
12
|
-
var _Popper = _interopRequireDefault(require("@material
|
12
|
+
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
13
13
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
15
15
|
|
@@ -21,11 +21,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
21
21
|
|
22
22
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
23
23
|
|
24
|
-
const popperModifiers = {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
};
|
24
|
+
const popperModifiers = [{
|
25
|
+
name: 'flip',
|
26
|
+
enabled: true
|
27
|
+
},,];
|
29
28
|
|
30
29
|
function DefaultSuggestionTag(_ref) {
|
31
30
|
let {
|
@@ -66,7 +65,11 @@ function Suggestions(props) {
|
|
66
65
|
const {
|
67
66
|
SuggestionTag = DefaultSuggestionTag
|
68
67
|
} = props;
|
69
|
-
return props.anchorEl && /*#__PURE__*/React.createElement(_Popper.default
|
68
|
+
return props.anchorEl && /*#__PURE__*/React.createElement(_Popper.default // https://github.com/mui/material-ui/issues/35287
|
69
|
+
, _extends({
|
70
|
+
onResize: undefined,
|
71
|
+
onResizeCapture: undefined,
|
72
|
+
nonce: undefined,
|
70
73
|
open: props.isVisible,
|
71
74
|
anchorEl: props.anchorEl,
|
72
75
|
style: popperStyle,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TagsSuggestions.js","names":["popperModifiers","
|
1
|
+
{"version":3,"file":"TagsSuggestions.js","names":["popperModifiers","name","enabled","DefaultSuggestionTag","index","tag","id","onClick","isPreselected","toString","Suggestions","props","onSelected","onSelectedFactory","React","useCallback","lastSelected","e","popperStyle","useMemo","width","anchorEl","scrollWidth","zIndex","SuggestionTag","undefined","isVisible","popperProps","classNames","className","loading","innerRef","AddNewTagComponent","LoadingComponent","isWaitingForMoreInput","WaitingForMoreInputComponent","tags","map","length","preselectedSuggestion","EmptyComponent","allowNew","SuggestionsWrapped"],"sources":["../../../../src/lib/components/tags/subComponents/TagsSuggestions.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { Tag } from '..';\r\nimport { Button } from '../../..';\r\nimport Popper, { PopperProps } from '@mui/material/Popper';\r\nimport classNames from 'classnames';\r\n\r\nexport type RenderSuggestionTagProps<T extends Tag = Tag> = {\r\n tag: T;\r\n index: number;\r\n id?: string;\r\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\r\n isPreselected: boolean;\r\n};\r\n\r\nexport type SuggestionsProps<T extends Tag = Tag> = {\r\n className?: string;\r\n innerRef: React.RefObject<HTMLDivElement>;\r\n anchorEl: HTMLElement;\r\n id?: string;\r\n preselectedSuggestion?: number;\r\n isVisible: boolean;\r\n isWaitingForMoreInput: boolean;\r\n tags: T[];\r\n onSelected: (tag: T, lastSelected: boolean) => void;\r\n value: string;\r\n loading: boolean;\r\n LoadingComponent?: string | JSX.Element;\r\n EmptyComponent?: string | JSX.Element;\r\n AddNewTagComponent?: JSX.Element;\r\n WaitingForMoreInputComponent?: string | JSX.Element;\r\n allowNew: boolean;\r\n popperProps?: Partial<PopperProps>;\r\n SuggestionTag?: React.ComponentType<RenderSuggestionTagProps<T>>;\r\n};\r\n\r\ntype InjectedProps = {};\r\n\r\nconst popperModifiers: PopperProps['modifiers'] = [\r\n {\r\n name: 'flip',\r\n enabled: true,\r\n },\r\n ,\r\n];\r\n\r\nfunction DefaultSuggestionTag<T extends Tag = Tag>({\r\n index,\r\n tag,\r\n id,\r\n onClick,\r\n isPreselected,\r\n}: RenderSuggestionTagProps<T>) {\r\n return (\r\n <li key={index}>\r\n <Button\r\n {...(id && {\r\n id: id + '-suggestion-' + index.toString(),\r\n })}\r\n className={\r\n 'w-100 tags-input__suggestion ' +\r\n (isPreselected ? 'tags-input__suggestion--preselected' : '')\r\n }\r\n onClick={onClick}\r\n dropdown={true}\r\n >\r\n {tag.name}\r\n </Button>\r\n </li>\r\n );\r\n}\r\n\r\nfunction Suggestions<T extends Tag = Tag>(\r\n props: SuggestionsProps<T> & InjectedProps\r\n) {\r\n const { onSelected } = props;\r\n const onSelectedFactory = React.useCallback(\r\n (tag: T, lastSelected: boolean) => (e: React.MouseEvent) => {\r\n onSelected(tag, lastSelected);\r\n },\r\n [onSelected]\r\n );\r\n const popperStyle = React.useMemo(\r\n () => ({ width: props.anchorEl?.scrollWidth, zIndex: 10000 }),\r\n [props.anchorEl?.scrollWidth]\r\n );\r\n\r\n const { SuggestionTag = DefaultSuggestionTag } = props;\r\n return (\r\n props.anchorEl && (\r\n <Popper\r\n // https://github.com/mui/material-ui/issues/35287\r\n onResize={undefined}\r\n onResizeCapture={undefined}\r\n nonce={undefined}\r\n open={props.isVisible}\r\n anchorEl={props.anchorEl}\r\n style={popperStyle}\r\n placement=\"bottom-start\"\r\n modifiers={popperModifiers}\r\n {...props.popperProps}\r\n >\r\n <div\r\n {...(props.id && {\r\n id: props.id,\r\n })}\r\n className={classNames('tags-input__suggestions', props.className, {\r\n 'tags-input__suggestions--loading': props.loading,\r\n })}\r\n ref={props.innerRef}\r\n >\r\n <ul>\r\n {props.AddNewTagComponent}\r\n {props.loading && props.LoadingComponent}\r\n {props.isWaitingForMoreInput &&\r\n props.WaitingForMoreInputComponent && (\r\n <li className=\"w-100 text-center p-2\">\r\n {props.WaitingForMoreInputComponent}\r\n </li>\r\n )}\r\n {!props.isWaitingForMoreInput &&\r\n props.tags.map((tag, index) => (\r\n <SuggestionTag\r\n key={tag.id}\r\n index={index}\r\n tag={tag}\r\n onClick={onSelectedFactory(tag, props.tags.length === 1)}\r\n id={props.id}\r\n isPreselected={\r\n props.preselectedSuggestion !== undefined &&\r\n props.preselectedSuggestion === index\r\n }\r\n />\r\n ))}\r\n {props.EmptyComponent &&\r\n props.tags.length === 0 &&\r\n !props.allowNew &&\r\n !props.isWaitingForMoreInput &&\r\n !props.loading && (\r\n <li className=\"w-100 text-center p-2\">\r\n {props.EmptyComponent}\r\n </li>\r\n )}\r\n </ul>\r\n </div>\r\n </Popper>\r\n )\r\n );\r\n}\r\n\r\nconst SuggestionsWrapped = Suggestions;\r\n\r\nexport default SuggestionsWrapped;\r\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;;;AAiCA,MAAMA,eAAyC,GAAG,CAChD;EACEC,IAAI,EAAE,MADR;EAEEC,OAAO,EAAE;AAFX,CADgD,GAAlD;;AAQA,SAASC,oBAAT,OAMgC;EAAA,IANmB;IACjDC,KADiD;IAEjDC,GAFiD;IAGjDC,EAHiD;IAIjDC,OAJiD;IAKjDC;EALiD,CAMnB;EAC9B,oBACE;IAAI,GAAG,EAAEJ;EAAT,gBACE,oBAAC,QAAD,eACOE,EAAE,IAAI;IACTA,EAAE,EAAEA,EAAE,GAAG,cAAL,GAAsBF,KAAK,CAACK,QAAN;EADjB,CADb;IAIE,SAAS,EACP,mCACCD,aAAa,GAAG,qCAAH,GAA2C,EADzD,CALJ;IAQE,OAAO,EAAED,OARX;IASE,QAAQ,EAAE;EATZ,IAWGF,GAAG,CAACJ,IAXP,CADF,CADF;AAiBD;;AAED,SAASS,WAAT,CACEC,KADF,EAEE;EAAA;;EACA,MAAM;IAAEC;EAAF,IAAiBD,KAAvB;EACA,MAAME,iBAAiB,GAAGC,KAAK,CAACC,WAAN,CACxB,CAACV,GAAD,EAASW,YAAT,KAAoCC,CAAD,IAAyB;IAC1DL,UAAU,CAACP,GAAD,EAAMW,YAAN,CAAV;EACD,CAHuB,EAIxB,CAACJ,UAAD,CAJwB,CAA1B;EAMA,MAAMM,WAAW,GAAGJ,KAAK,CAACK,OAAN,CAClB;IAAA;;IAAA,OAAO;MAAEC,KAAK,qBAAET,KAAK,CAACU,QAAR,oDAAE,gBAAgBC,WAAzB;MAAsCC,MAAM,EAAE;IAA9C,CAAP;EAAA,CADkB,EAElB,qBAACZ,KAAK,CAACU,QAAP,qDAAC,iBAAgBC,WAAjB,CAFkB,CAApB;EAKA,MAAM;IAAEE,aAAa,GAAGrB;EAAl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CnC;EARpC,EADF,CAVJ,EAuBGO,KAAK,CAAC6B,cAAN,IACC7B,KAAK,CAACyB,IAAN,CAAWE,MAAX,KAAsB,CADvB,IAEC,CAAC3B,KAAK,CAAC8B,QAFR,IAGC,CAAC9B,KAAK,CAACuB,qBAHR,IAIC,CAACvB,KAAK,CAACmB,OAJR,iBAKG;IAAI,SAAS,EAAC;EAAd,GACGnB,KAAK,CAAC6B,cADT,CA5BN,CATF,CAZF,CAFJ;AA4DD;;AAED,MAAME,kBAAkB,GAAGhC,WAA3B;eAEegC,kB"}
|
@@ -13,7 +13,7 @@ var _BaseInput = require("../base/input/BaseInput");
|
|
13
13
|
|
14
14
|
var _withFormContext = require("../form/withFormContext");
|
15
15
|
|
16
|
-
var _TextareaAutosize = _interopRequireDefault(require("@material
|
16
|
+
var _TextareaAutosize = _interopRequireDefault(require("@mui/material/TextareaAutosize"));
|
17
17
|
|
18
18
|
var _withThemeContext = require("../themeProvider/withThemeContext");
|
19
19
|
|
@@ -68,8 +68,8 @@ class TextAreaRaw extends _BaseInput.BaseInput {
|
|
68
68
|
onFocus: this.handleFocus,
|
69
69
|
readOnly: this.props.readOnly,
|
70
70
|
onKeyDown: this.onKeyDown,
|
71
|
-
|
72
|
-
|
71
|
+
minRows: this.props.minRows,
|
72
|
+
maxRows: this.props.maxRows,
|
73
73
|
maxLength: this.props.maxLength
|
74
74
|
})), /*#__PURE__*/React.createElement("span", {
|
75
75
|
className: "highlight"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextArea.js","names":["TextAreaRaw","BaseInput","constructor","props","e","onKeyDown","elem","inputRef","stopClickPropagation","stopPropagation","render","title","inputGroupClassName","tooltip","getValidationClass","readOnly","className","onContainerClick","containerRef","id","elemRef","placeholder","getDisabled","required","state","value","handleChange","handleBlur","handleFocus","minRows","maxRows","maxLength","renderDefaultValidation","label","renderLabel","focus","Object","assign","defaultProps","type","TextArea","withThemeContext","withFormContext"],"sources":["../../../src/lib/components/textArea/TextArea.tsx"],"sourcesContent":["// Libs\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
|
1
|
+
{"version":3,"file":"TextArea.js","names":["TextAreaRaw","BaseInput","constructor","props","e","onKeyDown","elem","inputRef","stopClickPropagation","stopPropagation","render","title","inputGroupClassName","tooltip","getValidationClass","readOnly","className","onContainerClick","containerRef","id","elemRef","placeholder","getDisabled","required","state","value","handleChange","handleBlur","handleFocus","minRows","maxRows","maxLength","renderDefaultValidation","label","renderLabel","focus","Object","assign","defaultProps","type","TextArea","withThemeContext","withFormContext"],"sources":["../../../src/lib/components/textArea/TextArea.tsx"],"sourcesContent":["// Libs\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 '@mui/material/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\r\n title={this.props.title}\r\n className={this.props.inputGroupClassName}\r\n tooltip={this.props.tooltip}\r\n >\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 minRows={this.props.minRows}\r\n maxRows={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"],"mappings":";;;;;;;AACA;;AAGA;;AACA;;AAKA;;AACA;;AACA;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>
|
6
|
-
<title>guestbell-forms [
|
6
|
+
<title>guestbell-forms [29 Jan 2023 at 12:27]</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+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1ak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6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
8
8
|
|
9
9
|
<script>
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "
|
2
|
+
"version": "3.0.0",
|
3
3
|
"description": "React forms with validation as used in GuestBell",
|
4
4
|
"keywords": [
|
5
5
|
"react",
|
@@ -24,7 +24,10 @@
|
|
24
24
|
"@babel/preset-env": "7.15.0",
|
25
25
|
"@babel/preset-react": "7.14.5",
|
26
26
|
"@babel/preset-typescript": "7.15.0",
|
27
|
-
"@
|
27
|
+
"@emotion/react": "^11.10.5",
|
28
|
+
"@emotion/styled": "^11.10.5",
|
29
|
+
"@mui/material": "^5.11.6",
|
30
|
+
"@mui/styles": "^5.11.2",
|
28
31
|
"@tippy.js/react": "3.1.1",
|
29
32
|
"@types/classnames": "^2.2.9",
|
30
33
|
"@types/lodash.debounce": "^4.0.6",
|
@@ -115,7 +118,7 @@
|
|
115
118
|
},
|
116
119
|
"homepage": "https://github.com/PeterKottas/guestbell-forms",
|
117
120
|
"peerDependencies": {
|
118
|
-
"@material
|
121
|
+
"@mui/material": "4.x",
|
119
122
|
"@tippy.js/react": "3.x",
|
120
123
|
"moment": "*",
|
121
124
|
"react": "16.x",
|