@coorpacademy/components 11.43.4 → 11.43.6
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/es/atom/autocomplete/index.d.ts +1 -0
- package/es/atom/autocomplete/index.d.ts.map +1 -1
- package/es/atom/autocomplete/index.js +4 -2
- package/es/atom/autocomplete/index.js.map +1 -1
- package/es/atom/button-link/index.d.ts +1 -1
- package/es/atom/button-link/types.d.ts +2 -2
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +1 -1
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/link/index.d.ts +1 -1
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +2 -1
- package/es/atom/link/index.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +1 -1
- package/es/atom/radio-with-title/types.d.ts +1 -1
- package/es/atom/title/index.d.ts +1 -1
- package/es/molecule/button-menu-action/index.d.ts +1 -1
- package/es/molecule/button-menu-action/types.d.ts +1 -1
- package/es/molecule/cm-popin/types.d.ts +9 -9
- package/es/molecule/expandible-actionable-table/index.d.ts +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +1 -1
- package/es/molecule/quick-filters/index.d.ts +1 -1
- package/es/molecule/quick-filters/types.d.ts +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -1
- package/es/molecule/title-radio-wrapper/index.d.ts +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +1 -1
- package/es/organism/assignment-audience/index.d.ts +1 -0
- package/es/organism/assignment-audience/index.d.ts.map +1 -1
- package/es/organism/assignment-audience/index.js +8 -4
- package/es/organism/assignment-audience/index.js.map +1 -1
- package/es/organism/assignment-audience/types.d.ts +2 -0
- package/es/organism/assignment-audience/types.d.ts.map +1 -1
- package/es/organism/assignment-audience/types.js +2 -1
- package/es/organism/assignment-audience/types.js.map +1 -1
- package/es/organism/assignment-edition/index.d.ts +1 -0
- package/es/organism/assignment-edition/index.d.ts.map +1 -1
- package/es/organism/assignment-edition/types.d.ts +1 -0
- package/es/organism/assignment-edition/types.d.ts.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +7 -7
- package/es/organism/content-skill-modal/types.d.ts +7 -7
- package/es/organism/icon-editor/index.d.ts +1 -1
- package/es/organism/icon-editor/types.d.ts +1 -1
- package/es/organism/list-items/index.d.ts +7 -7
- package/es/organism/rewards-form/index.d.ts +1 -1
- package/es/organism/select-opponents/index.d.ts +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -1
- package/es/organism/setup-header/index.d.ts +4 -4
- package/es/organism/title-and-input/index.d.ts +4 -3
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +4 -3
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -4
- package/es/template/app-player/loading/index.d.ts +9 -9
- package/es/template/app-player/player/index.d.ts +18 -18
- package/es/template/app-player/player/slides/index.d.ts +9 -9
- package/es/template/app-player/popin-correction/index.d.ts +11 -11
- package/es/template/app-player/popin-end/index.d.ts +10 -10
- package/es/template/app-player/popin-end/summary.d.ts +1 -1
- package/es/template/app-player/popin-header/index.d.ts +1 -1
- package/es/template/app-review/index.d.ts +9 -9
- package/es/template/app-review/player/prop-types.d.ts +9 -9
- package/es/template/app-review/prop-types.d.ts +9 -9
- package/es/template/back-office/brand-create/index.d.ts +4 -4
- package/es/template/back-office/brand-list/index.d.ts +4 -4
- package/es/template/back-office/brand-update/index.d.ts +32 -31
- package/es/template/back-office/dashboard-preview/index.d.ts +4 -4
- package/es/template/back-office/layout/index.d.ts +4 -4
- package/es/template/certification-detail/index.d.ts +9 -9
- package/es/template/common/dashboard/index.d.ts +18 -18
- package/es/template/common/search-page/index.d.ts +11 -11
- package/es/template/external-course/index.d.ts +9 -9
- package/es/template/playlist-detail/index.d.ts +9 -9
- package/lib/atom/autocomplete/index.d.ts +1 -0
- package/lib/atom/autocomplete/index.d.ts.map +1 -1
- package/lib/atom/autocomplete/index.js +4 -2
- package/lib/atom/autocomplete/index.js.map +1 -1
- package/lib/atom/button-link/index.d.ts +1 -1
- package/lib/atom/button-link/types.d.ts +2 -2
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +1 -1
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/link/index.d.ts +1 -1
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +2 -1
- package/lib/atom/link/index.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +1 -1
- package/lib/atom/radio-with-title/types.d.ts +1 -1
- package/lib/atom/title/index.d.ts +1 -1
- package/lib/molecule/button-menu-action/index.d.ts +1 -1
- package/lib/molecule/button-menu-action/types.d.ts +1 -1
- package/lib/molecule/cm-popin/types.d.ts +9 -9
- package/lib/molecule/expandible-actionable-table/index.d.ts +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +1 -1
- package/lib/molecule/quick-filters/index.d.ts +1 -1
- package/lib/molecule/quick-filters/types.d.ts +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -1
- package/lib/molecule/title-radio-wrapper/index.d.ts +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +1 -1
- package/lib/organism/assignment-audience/index.d.ts +1 -0
- package/lib/organism/assignment-audience/index.d.ts.map +1 -1
- package/lib/organism/assignment-audience/index.js +8 -4
- package/lib/organism/assignment-audience/index.js.map +1 -1
- package/lib/organism/assignment-audience/types.d.ts +2 -0
- package/lib/organism/assignment-audience/types.d.ts.map +1 -1
- package/lib/organism/assignment-audience/types.js +2 -1
- package/lib/organism/assignment-audience/types.js.map +1 -1
- package/lib/organism/assignment-edition/index.d.ts +1 -0
- package/lib/organism/assignment-edition/index.d.ts.map +1 -1
- package/lib/organism/assignment-edition/types.d.ts +1 -0
- package/lib/organism/assignment-edition/types.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +7 -7
- package/lib/organism/content-skill-modal/types.d.ts +7 -7
- package/lib/organism/icon-editor/index.d.ts +1 -1
- package/lib/organism/icon-editor/types.d.ts +1 -1
- package/lib/organism/list-items/index.d.ts +7 -7
- package/lib/organism/rewards-form/index.d.ts +1 -1
- package/lib/organism/select-opponents/index.d.ts +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -1
- package/lib/organism/setup-header/index.d.ts +4 -4
- package/lib/organism/title-and-input/index.d.ts +4 -3
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +4 -3
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -4
- package/lib/template/app-player/loading/index.d.ts +9 -9
- package/lib/template/app-player/player/index.d.ts +18 -18
- package/lib/template/app-player/player/slides/index.d.ts +9 -9
- package/lib/template/app-player/popin-correction/index.d.ts +11 -11
- package/lib/template/app-player/popin-end/index.d.ts +10 -10
- package/lib/template/app-player/popin-end/summary.d.ts +1 -1
- package/lib/template/app-player/popin-header/index.d.ts +1 -1
- package/lib/template/app-review/index.d.ts +9 -9
- package/lib/template/app-review/player/prop-types.d.ts +9 -9
- package/lib/template/app-review/prop-types.d.ts +9 -9
- package/lib/template/back-office/brand-create/index.d.ts +4 -4
- package/lib/template/back-office/brand-list/index.d.ts +4 -4
- package/lib/template/back-office/brand-update/index.d.ts +32 -31
- package/lib/template/back-office/dashboard-preview/index.d.ts +4 -4
- package/lib/template/back-office/layout/index.d.ts +4 -4
- package/lib/template/certification-detail/index.d.ts +9 -9
- package/lib/template/common/dashboard/index.d.ts +18 -18
- package/lib/template/common/search-page/index.d.ts +11 -11
- package/lib/template/external-course/index.d.ts +9 -9
- package/lib/template/playlist-detail/index.d.ts +9 -9
- package/package.json +2 -2
|
@@ -20,6 +20,7 @@ declare namespace Autocomplete {
|
|
|
20
20
|
const onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
21
|
const onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
22
|
const onSuggestionSelected: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
+
const focusInputOnSuggestionClick: PropTypes.Requireable<boolean>;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";AAmBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";AAmBA,uDA+GC"}
|
|
@@ -29,6 +29,7 @@ const Autocomplete = props => {
|
|
|
29
29
|
onClear = _noop,
|
|
30
30
|
onBlur = _noop,
|
|
31
31
|
onSuggestionSelected = _noop,
|
|
32
|
+
focusInputOnSuggestionClick = false,
|
|
32
33
|
title: propsTitle,
|
|
33
34
|
theme = 'default'
|
|
34
35
|
} = props;
|
|
@@ -93,7 +94,7 @@ const Autocomplete = props => {
|
|
|
93
94
|
getSuggestionValue: _noop,
|
|
94
95
|
renderSuggestion: renderSuggestion,
|
|
95
96
|
inputProps: inputProps,
|
|
96
|
-
focusInputOnSuggestionClick:
|
|
97
|
+
focusInputOnSuggestionClick: focusInputOnSuggestionClick,
|
|
97
98
|
onSuggestionSelected: handleSuggestionsSelected
|
|
98
99
|
}), errorIconView, errorText)), descriptionView);
|
|
99
100
|
};
|
|
@@ -115,7 +116,8 @@ Autocomplete.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
115
116
|
onFetch: PropTypes.func,
|
|
116
117
|
onClear: PropTypes.func,
|
|
117
118
|
onBlur: PropTypes.func,
|
|
118
|
-
onSuggestionSelected: PropTypes.func
|
|
119
|
+
onSuggestionSelected: PropTypes.func,
|
|
120
|
+
focusInputOnSuggestionClick: PropTypes.bool
|
|
119
121
|
} : {};
|
|
120
122
|
export default Autocomplete;
|
|
121
123
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","Autosuggest","PropTypes","classnames","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","getClassState","style","THEME_STYLE","coorpmanager","default","defaultStyle","renderSuggestion","suggestion","createElement","name","Autocomplete","props","placeholder","value","description","required","modified","error","errorMessage","suggestions","onInput","_noop","onFetch","onClear","onBlur","onSuggestionSelected","title","propsTitle","theme","mainClass","className","handleInput","e","handleBlur","selectedSuggestion","handleSuggestionsFetchRequested","handleSuggestionsClearRequested","handleSuggestionsSelected","data","inputProps","onChange","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","errorIconView","leftIcon","errorText","dangerouslySetInnerHTML","__html","_isNil","isNoTitle","_isEmpty","noValue","inputContainer","container","input","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestionHighlighted","onSuggestionsFetchRequested","onSuggestionsClearRequested","getSuggestionValue","focusInputOnSuggestionClick","propTypes","process","env","NODE_ENV","string","bool","arrayOf","shape","oneOfType","number","oneOf","_keys","func"],"sources":["../../../src/atom/autocomplete/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport Autosuggest from 'react-autosuggest';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {noop, isNil, isEmpty, keys} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst THEME_STYLE = {\n coorpmanager: style.coorpmanager,\n default: style.defaultStyle\n};\n\nconst renderSuggestion = suggestion => <span>{suggestion.name}</span>;\n\nconst Autocomplete = props => {\n const {\n placeholder = '',\n value,\n description,\n required,\n modified = false,\n error = false,\n errorMessage,\n suggestions = [],\n onInput = noop,\n onFetch = noop,\n onClear = noop,\n onBlur = noop,\n onSuggestionSelected = noop,\n title: propsTitle,\n theme = 'default'\n } = props;\n\n const mainClass = THEME_STYLE[theme];\n const title = useMemo(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);\n const className = useMemo(\n () => getClassState(style.defaultStyle, style.modified, style.error, modified, error),\n [modified, error]\n );\n\n const handleInput = useCallback(\n e => {\n onInput(e);\n },\n [onInput]\n );\n const handleBlur = useCallback(\n (e, selectedSuggestion) => onBlur(e, selectedSuggestion),\n [onBlur]\n );\n const handleSuggestionsFetchRequested = useCallback(e => onFetch(e), [onFetch]);\n const handleSuggestionsClearRequested = useCallback(e => onClear(e), [onClear]);\n const handleSuggestionsSelected = useCallback(\n (e, data) => onSuggestionSelected(data),\n [onSuggestionSelected]\n );\n\n const inputProps = {\n placeholder,\n value,\n onChange: noop,\n onBlur: handleBlur,\n onInput: handleInput,\n 'data-testid': 'autocomplete-input'\n };\n\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n\n const errorIconView =\n theme === 'coorpmanager' && error ? <ErrorIcon className={style.leftIcon} /> : null;\n\n const errorText =\n theme === 'coorpmanager' && error ? (\n <div\n className={style.errorText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: errorMessage}}\n />\n ) : null;\n return (\n <div className={classnames(mainClass, className, isNil(propsTitle) && style.isNoTitle)}>\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {title}\n {toolTipView}\n </span>\n <div className={style.inputContainer}>\n <Autosuggest\n theme={{\n container: style.container,\n input: style.input,\n suggestionsContainer: style.suggestionsContainer,\n suggestionsContainerOpen: style.suggestionsContainerOpen,\n suggestionsList: style.suggestionsList,\n suggestion: style.suggestion,\n suggestionHighlighted: style.suggestionHighlighted\n }}\n suggestions={suggestions}\n onSuggestionsFetchRequested={handleSuggestionsFetchRequested}\n onSuggestionsClearRequested={handleSuggestionsClearRequested}\n getSuggestionValue={noop}\n renderSuggestion={renderSuggestion}\n inputProps={inputProps}\n focusInputOnSuggestionClick={false}\n onSuggestionSelected={handleSuggestionsSelected}\n />\n {errorIconView}\n {errorText}\n </div>\n </label>\n {descriptionView}\n </div>\n );\n};\n\nAutocomplete.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n description: PropTypes.string,\n required: PropTypes.bool,\n modified: PropTypes.bool,\n error: PropTypes.bool,\n errorMessage: PropTypes.string,\n suggestions: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n })\n ),\n theme: PropTypes.oneOf(keys(THEME_STYLE)),\n onInput: PropTypes.func,\n onFetch: PropTypes.func,\n onClear: PropTypes.func,\n onBlur: PropTypes.func,\n onSuggestionSelected: PropTypes.func\n};\n\nexport default Autocomplete;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AACjD,OAAOC,WAAW,MAAM,mBAAmB;AAC3C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,oBAAoB,IAAIC,SAAS,EACjCC,0CAA0C,IAAIC,QAAQ,QACjD,0BAA0B;AACjC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAG;EAClBC,YAAY,EAAEF,KAAK,CAACE,YAAY;EAChCC,OAAO,EAAEH,KAAK,CAACI;AACjB,CAAC;AAED,MAAMC,gBAAgB,GAAGC,UAAU,iBAAIjB,KAAA,CAAAkB,aAAA,eAAOD,UAAU,CAACE,IAAW,CAAC;AAErE,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IACJC,WAAW,GAAG,EAAE;IAChBC,KAAK;IACL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M;EAC7BzD,KAAK,EAAEnB,SAAS,CAAC4E,MAAM;EACvBxD,WAAW,EAAEpB,SAAS,CAAC4E,MAAM;EAC7BvD,QAAQ,EAAErB,SAAS,CAAC6E,IAAI;EACxBvD,QAAQ,EAAEtB,SAAS,CAAC6E,IAAI;EACxBtD,KAAK,EAAEvB,SAAS,CAAC6E,IAAI;EACrBrD,YAAY,EAAExB,SAAS,CAAC4E,MAAM;EAC9BnD,WAAW,EAAEzB,SAAS,CAAC8E,OAAO,CAC5B9E,SAAS,CAAC+E,KAAK,CAAC;IACdhE,IAAI,EAAEf,SAAS,CAAC4E,MAAM;IACtBzD,KAAK,EAAEnB,SAAS,CAACgF,SAAS,CAAC,CAAChF,SAAS,CAAC4E,MAAM,EAAE5E,SAAS,CAACiF,MAAM,CAAC;EACjE,CAAC,CACH,CAAC;EACD/C,KAAK,EAAElC,SAAS,CAACkF,KAAK,CAACC,KAAA,CAAK3E,WAAW,CAAC,CAAC;EACzCkB,OAAO,EAAE1B,SAAS,CAACoF,IAAI;EACvBxD,OAAO,EAAE5B,SAAS,CAACoF,IAAI;EACvBvD,OAAO,EAAE7B,SAAS,CAACoF,IAAI;EACvBtD,MAAM,EAAE9B,SAAS,CAACoF,IAAI;EACtBrD,oBAAoB,EAAE/B,SAAS,CAACoF;AAClC,CAAC;AAED,eAAepE,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","Autosuggest","PropTypes","classnames","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","getClassState","style","THEME_STYLE","coorpmanager","default","defaultStyle","renderSuggestion","suggestion","createElement","name","Autocomplete","props","placeholder","value","description","required","modified","error","errorMessage","suggestions","onInput","_noop","onFetch","onClear","onBlur","onSuggestionSelected","focusInputOnSuggestionClick","title","propsTitle","theme","mainClass","className","handleInput","e","handleBlur","selectedSuggestion","handleSuggestionsFetchRequested","handleSuggestionsClearRequested","handleSuggestionsSelected","data","inputProps","onChange","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","errorIconView","leftIcon","errorText","dangerouslySetInnerHTML","__html","_isNil","isNoTitle","_isEmpty","noValue","inputContainer","container","input","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestionHighlighted","onSuggestionsFetchRequested","onSuggestionsClearRequested","getSuggestionValue","propTypes","process","env","NODE_ENV","string","bool","arrayOf","shape","oneOfType","number","oneOf","_keys","func"],"sources":["../../../src/atom/autocomplete/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport Autosuggest from 'react-autosuggest';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {noop, isNil, isEmpty, keys} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst THEME_STYLE = {\n coorpmanager: style.coorpmanager,\n default: style.defaultStyle\n};\n\nconst renderSuggestion = suggestion => <span>{suggestion.name}</span>;\n\nconst Autocomplete = props => {\n const {\n placeholder = '',\n value,\n description,\n required,\n modified = false,\n error = false,\n errorMessage,\n suggestions = [],\n onInput = noop,\n onFetch = noop,\n onClear = noop,\n onBlur = noop,\n onSuggestionSelected = noop,\n focusInputOnSuggestionClick = false,\n title: propsTitle,\n theme = 'default'\n } = props;\n\n const mainClass = THEME_STYLE[theme];\n const title = useMemo(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);\n const className = useMemo(\n () => getClassState(style.defaultStyle, style.modified, style.error, modified, error),\n [modified, error]\n );\n\n const handleInput = useCallback(\n e => {\n onInput(e);\n },\n [onInput]\n );\n const handleBlur = useCallback(\n (e, selectedSuggestion) => onBlur(e, selectedSuggestion),\n [onBlur]\n );\n const handleSuggestionsFetchRequested = useCallback(e => onFetch(e), [onFetch]);\n const handleSuggestionsClearRequested = useCallback(e => onClear(e), [onClear]);\n const handleSuggestionsSelected = useCallback(\n (e, data) => onSuggestionSelected(data),\n [onSuggestionSelected]\n );\n\n const inputProps = {\n placeholder,\n value,\n onChange: noop,\n onBlur: handleBlur,\n onInput: handleInput,\n 'data-testid': 'autocomplete-input'\n };\n\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n\n const errorIconView =\n theme === 'coorpmanager' && error ? <ErrorIcon className={style.leftIcon} /> : null;\n\n const errorText =\n theme === 'coorpmanager' && error ? (\n <div\n className={style.errorText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: errorMessage}}\n />\n ) : null;\n return (\n <div className={classnames(mainClass, className, isNil(propsTitle) && style.isNoTitle)}>\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {title}\n {toolTipView}\n </span>\n <div className={style.inputContainer}>\n <Autosuggest\n theme={{\n container: style.container,\n input: style.input,\n suggestionsContainer: style.suggestionsContainer,\n suggestionsContainerOpen: style.suggestionsContainerOpen,\n suggestionsList: style.suggestionsList,\n suggestion: style.suggestion,\n suggestionHighlighted: style.suggestionHighlighted\n }}\n suggestions={suggestions}\n onSuggestionsFetchRequested={handleSuggestionsFetchRequested}\n onSuggestionsClearRequested={handleSuggestionsClearRequested}\n getSuggestionValue={noop}\n renderSuggestion={renderSuggestion}\n inputProps={inputProps}\n focusInputOnSuggestionClick={focusInputOnSuggestionClick}\n onSuggestionSelected={handleSuggestionsSelected}\n />\n {errorIconView}\n {errorText}\n </div>\n </label>\n {descriptionView}\n </div>\n );\n};\n\nAutocomplete.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n description: PropTypes.string,\n required: PropTypes.bool,\n modified: PropTypes.bool,\n error: PropTypes.bool,\n errorMessage: PropTypes.string,\n suggestions: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n })\n ),\n theme: PropTypes.oneOf(keys(THEME_STYLE)),\n onInput: PropTypes.func,\n onFetch: PropTypes.func,\n onClear: PropTypes.func,\n onBlur: PropTypes.func,\n onSuggestionSelected: PropTypes.func,\n focusInputOnSuggestionClick: PropTypes.bool\n};\n\nexport default Autocomplete;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AACjD,OAAOC,WAAW,MAAM,mBAAmB;AAC3C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,oBAAoB,IAAIC,SAAS,EACjCC,0CAA0C,IAAIC,QAAQ,QACjD,0BAA0B;AACjC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAG;EAClBC,YAAY,EAAEF,KAAK,CAACE,YAAY;EAChCC,OAAO,EAAEH,KAAK,CAACI;AACjB,CAAC;AAED,MAAMC,gBAAgB,GAAGC,UAAU,iBAAIjB,KAAA,CAAAkB,aAAA,eAAOD,UAAU,CAACE,IAAW,CAAC;AAErE,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IACJC,WAAW,GAAG,EAAE;IAChBC,KAAK;IACLC,WAAW;IACXC,QAAQ;IACRC,QAAQ,GAAG,KAAK;IAChBC,KAAK,GAAG,KAAK;IACbC,YAAY;IACZC,WAAW,GAAG,EAAE;IAChBC,OAAO,GAAAC,KAAO;IACdC,OAAO,GAAAD,KAAO;IACdE,OAAO,GAAAF,KAAO;IACdG,MAAM,GAAAH,KAAO;IACbI,oBAAoB,GAAAJ,KAAO;IAC3BK,2BAA2B,GAAG,KAAK;IACnCC,KAAK,EAAEC,UAAU;IACjBC,KAAK,GAAG;EACV,CAAC,GAAGlB,KAAK;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,CAC5B9E,SAAS,CAAC+E,KAAK,CAAC;IACdhE,IAAI,EAAEf,SAAS,CAAC4E,MAAM;IACtBzD,KAAK,EAAEnB,SAAS,CAACgF,SAAS,CAAC,CAAChF,SAAS,CAAC4E,MAAM,EAAE5E,SAAS,CAACiF,MAAM,CAAC;EACjE,CAAC,CACH,CAAC;EACD9C,KAAK,EAAEnC,SAAS,CAACkF,KAAK,CAACC,KAAA,CAAK3E,WAAW,CAAC,CAAC;EACzCkB,OAAO,EAAE1B,SAAS,CAACoF,IAAI;EACvBxD,OAAO,EAAE5B,SAAS,CAACoF,IAAI;EACvBvD,OAAO,EAAE7B,SAAS,CAACoF,IAAI;EACvBtD,MAAM,EAAE9B,SAAS,CAACoF,IAAI;EACtBrD,oBAAoB,EAAE/B,SAAS,CAACoF,IAAI;EACpCpD,2BAA2B,EAAEhC,SAAS,CAAC6E;AACzC,CAAC;AAED,eAAe7D,YAAY","ignoreList":[]}
|
|
@@ -36,7 +36,7 @@ declare const ButtonLink: {
|
|
|
36
36
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
37
37
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
38
38
|
href: import("prop-types").Requireable<string>;
|
|
39
|
-
download: import("prop-types").Requireable<boolean
|
|
39
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
40
40
|
target: import("prop-types").Requireable<string>;
|
|
41
41
|
rel: import("prop-types").Requireable<string>;
|
|
42
42
|
}>>;
|
|
@@ -47,7 +47,7 @@ declare const propTypes: {
|
|
|
47
47
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
49
49
|
href: PropTypes.Requireable<string>;
|
|
50
|
-
download: PropTypes.Requireable<boolean
|
|
50
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
51
51
|
target: PropTypes.Requireable<string>;
|
|
52
52
|
rel: PropTypes.Requireable<string>;
|
|
53
53
|
}>>;
|
|
@@ -87,7 +87,7 @@ export declare type ButtonLinkProps = {
|
|
|
87
87
|
onKeyDown?: () => void;
|
|
88
88
|
link?: {
|
|
89
89
|
href?: string;
|
|
90
|
-
download?: boolean;
|
|
90
|
+
download?: boolean | string;
|
|
91
91
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
92
92
|
rel?: string;
|
|
93
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAC9C,OAAO,GAAG,MAAM,QAAQ,CAAC;AAUzB,eAAO,MAAM,aAAa;;;;;;;;;;CAIzB,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Bd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACnC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;IACnE,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IAC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AO,GAAG,CAAC,CAAC;CACxC,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -27,7 +27,7 @@ const propTypes = {
|
|
|
27
27
|
onClick: PropTypes.func,
|
|
28
28
|
link: PropTypes.shape({
|
|
29
29
|
href: PropTypes.string,
|
|
30
|
-
download: PropTypes.bool,
|
|
30
|
+
download: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
31
31
|
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
32
32
|
rel: PropTypes.string
|
|
33
33
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","object","iconPropTypes","position","oneOf","type","_keys","faIcon","shape","propTypes","usage","label","content","node","tooltipText","tooltipPlacement","icon","oneOfType","arrayOf","onClick","func","link","href","download","bool","target","rel","hoverBackgroundColor","hoverColor","disabled","className","contentCustomStyle","useTitle","customLabelClassName"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\nimport Tag from '../tag';\n\nconst faIconPropTypes = {\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n backgroundColor: PropTypes.string,\n size: PropTypes.number,\n customStyle: PropTypes.object\n};\n\nexport const iconPropTypes = {\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.shape(faIconPropTypes)\n};\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.oneOfType([\n PropTypes.shape(iconPropTypes),\n PropTypes.arrayOf(PropTypes.shape(iconPropTypes))\n ]),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n rel: PropTypes.string\n }),\n hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.object,\n contentCustomStyle: PropTypes.object,\n useTitle: PropTypes.bool,\n customLabelClassName: PropTypes.string\n};\n\nexport type FaIconType = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: React.CSSProperties;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIconType;\n};\n\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: PropTypes.ReactNodeLike;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType | IconType[];\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n rel?: string;\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: React.CSSProperties;\n contentCustomStyle?: React.CSSProperties;\n useTitle?: boolean;\n customLabelClassName?: string;\n tag?: React.ComponentProps<typeof Tag>;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,MAAMC,eAAe,GAAG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C,CAClD,CAAC;EACFiB,OAAO,EAAE7B,SAAS,CAAC8B,IAAI;EACvBC,IAAI,EAAE/B,SAAS,CAACkB,KAAK,CAAC;IACpBc,IAAI,EAAEhC,SAAS,CAACI,MAAM;IACtB6B,QAAQ,EAAEjC,SAAS,CAACkC,IAAI;
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","object","iconPropTypes","position","oneOf","type","_keys","faIcon","shape","propTypes","usage","label","content","node","tooltipText","tooltipPlacement","icon","oneOfType","arrayOf","onClick","func","link","href","download","bool","target","rel","hoverBackgroundColor","hoverColor","disabled","className","contentCustomStyle","useTitle","customLabelClassName"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\nimport Tag from '../tag';\n\nconst faIconPropTypes = {\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n backgroundColor: PropTypes.string,\n size: PropTypes.number,\n customStyle: PropTypes.object\n};\n\nexport const iconPropTypes = {\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.shape(faIconPropTypes)\n};\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.oneOfType([\n PropTypes.shape(iconPropTypes),\n PropTypes.arrayOf(PropTypes.shape(iconPropTypes))\n ]),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n rel: PropTypes.string\n }),\n hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.object,\n contentCustomStyle: PropTypes.object,\n useTitle: PropTypes.bool,\n customLabelClassName: PropTypes.string\n};\n\nexport type FaIconType = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: React.CSSProperties;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIconType;\n};\n\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: PropTypes.ReactNodeLike;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType | IconType[];\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean | string;\n target?: '_self' | '_blank' | '_parent' | '_top';\n rel?: string;\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: React.CSSProperties;\n contentCustomStyle?: React.CSSProperties;\n useTitle?: boolean;\n customLabelClassName?: string;\n tag?: React.ComponentProps<typeof Tag>;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,MAAMC,eAAe,GAAG;EACtBC,IAAI,EAAEH,SAAS,CAACI,MAAM,CAACC,UAAU;EACjCC,KAAK,EAAEN,SAAS,CAACI,MAAM;EACvBG,eAAe,EAAEP,SAAS,CAACI,MAAM;EACjCI,IAAI,EAAER,SAAS,CAACS,MAAM;EACtBC,WAAW,EAAEV,SAAS,CAACW;AACzB,CAAC;AAED,OAAO,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EAAElC,SAAS,CAACI,MAAM,CAAC,CAAC;IACjE+B,MAAM,EAAEnC,SAAS,CAACc,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/DsB,GAAG,EAAEpC,SAAS,CAACI;EACjB,CAAC,CAAC;EACFiC,oBAAoB,EAAErC,SAAS,CAACI,MAAM;EACtCkC,UAAU,EAAEtC,SAAS,CAACI,MAAM;EAC5BmC,QAAQ,EAAEvC,SAAS,CAACkC,IAAI;EACxBM,SAAS,EAAExC,SAAS,CAACI,MAAM;EAC3BM,WAAW,EAAEV,SAAS,CAACW,MAAM;EAC7B8B,kBAAkB,EAAEzC,SAAS,CAACW,MAAM;EACpC+B,QAAQ,EAAE1C,SAAS,CAACkC,IAAI;EACxBS,oBAAoB,EAAE3C,SAAS,CAACI;AAClC,CAAC;AAgDD,eAAee,SAAS","ignoreList":[]}
|
package/es/atom/link/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare namespace Link {
|
|
|
11
11
|
target: PropTypes.Requireable<string>;
|
|
12
12
|
hoverColor: PropTypes.Requireable<string>;
|
|
13
13
|
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
14
|
-
download: PropTypes.Requireable<boolean
|
|
14
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
15
15
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
16
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
17
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/link/index.js"],"names":[],"mappings":";AAMA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/link/index.js"],"names":[],"mappings":";AAMA,mEA4EC"}
|
package/es/atom/link/index.js
CHANGED
|
@@ -66,6 +66,7 @@ const Link = (props, legacyContext) => {
|
|
|
66
66
|
}), children) : /*#__PURE__*/React.createElement("a", _extends({}, restProps, {
|
|
67
67
|
"data-name": dataName,
|
|
68
68
|
href: disabled || !href ? undefined : createHref(href),
|
|
69
|
+
download: download,
|
|
69
70
|
onClick: disabled ? _noop : handleOnClick,
|
|
70
71
|
style: style,
|
|
71
72
|
className: className,
|
|
@@ -83,7 +84,7 @@ Link.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
83
84
|
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
84
85
|
hoverColor: PropTypes.string,
|
|
85
86
|
hoverBackgroundColor: PropTypes.string,
|
|
86
|
-
download: PropTypes.bool,
|
|
87
|
+
download: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
87
88
|
onClick: PropTypes.func,
|
|
88
89
|
onMouseEnter: PropTypes.func,
|
|
89
90
|
onMouseLeave: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","Provider","pushToHistory","Link","props","legacyContext","hovered","setHovered","history","createHref","_identity","hoverColor","hoverBackgroundColor","dataName","useButtonTag","href","onClick","_noop","style","customStyle","children","onMouseEnter","onMouseLeave","download","disabled","className","restProps","navigate","handleMouseEnter","handleMouseLeave","handleOnClick","e","backgroundColor","undefined","color","pointerEvents","createElement","_extends","type","propTypes","process","env","NODE_ENV","node","string","title","target","oneOf","bool","func","shape","contextTypes","skin","childContextTypes"],"sources":["../../../src/atom/link/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {identity, noop} from 'lodash/fp';\nimport Provider from '../provider';\nimport pushToHistory from '../../util/navigation';\n\nconst Link = (props, legacyContext) => {\n const [hovered, setHovered] = useState(false);\n const {history: {createHref = identity} = {}} = legacyContext;\n\n const {\n hoverColor,\n hoverBackgroundColor,\n 'data-name': dataName = 'link',\n useButtonTag = false,\n href,\n onClick = noop,\n style: customStyle,\n children,\n onMouseEnter = noop,\n onMouseLeave = noop,\n download,\n disabled,\n className,\n ...restProps\n } = props;\n\n const navigate = useMemo(() => pushToHistory(legacyContext)({href}), [href, legacyContext]);\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n onMouseEnter();\n }, [onMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n onMouseLeave();\n }, [onMouseLeave]);\n\n const handleOnClick = useCallback(\n e => {\n onClick(e);\n if (!download) navigate(e);\n },\n [download, navigate, onClick]\n );\n\n const style = {\n ...customStyle,\n ...(hovered && hoverBackgroundColor ? {backgroundColor: hoverBackgroundColor} : undefined),\n ...(hovered && hoverColor ? {color: hoverColor} : undefined),\n ...(href || onClick ? null : {pointerEvents: 'none'})\n };\n\n return useButtonTag ? (\n <button\n {...restProps}\n data-name={dataName}\n type=\"button\"\n onClick={disabled ? noop : handleOnClick}\n style={style}\n className={className}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {children}\n </button>\n ) : (\n <a\n {...restProps}\n data-name={dataName}\n href={disabled || !href ? undefined : createHref(href)}\n onClick={disabled ? noop : handleOnClick}\n style={style}\n className={className}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {children}\n </a>\n );\n};\n\nLink.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n href: PropTypes.string,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n title: PropTypes.string,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n hoverColor: PropTypes.string,\n hoverBackgroundColor: PropTypes.string,\n download: PropTypes.bool,\n onClick: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n useButtonTag: PropTypes.bool,\n style: PropTypes.shape({}),\n disabled: PropTypes.bool\n};\n\nLink.contextTypes = {\n skin: Provider.childContextTypes.skin,\n history: Provider.childContextTypes.history\n};\n\nexport default Link;\n"],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,OAAO,CAACe,CAAC,CAAC;IACV,IAAI,CAACR,QAAQ,EAAEI,QAAQ,CAACI,CAAC,CAAC;EAC5B,CAAC,EACD,CAACR,QAAQ,EAAEI,QAAQ,EAAEX,OAAO,CAC9B,CAAC;EAED,MAAME,KAAK,GAAG;IACZ,GAAGC,WAAW;IACd,IAAIb,OAAO,IAAIM,oBAAoB,GAAG;MAACoB,eAAe,EAAEpB;IAAoB,CAAC,GAAGqB,SAAS,CAAC;IAC1F,IAAI3B,OAAO,IAAIK,UAAU,GAAG;MAACuB,KAAK,EAAEvB;IAAU,CAAC,GAAGsB,SAAS,CAAC;IAC5D,IAAIlB,IAAI,IAAIC,OAAO,GAAG,IAAI,GAAG;MAACmB,aAAa,EAAE;IAAM,CAAC;EACtD,CAAC;EAED,OAAOrB,YAAY,gBACjBlB,KAAA,CAAAwC,aAAA,WAAAC,QAAA,KACMX,SAAS;IACb,aAAWb,QAAS;IACpByB,IAAI,EAAC,QAAQ;IACbtB,OAAO,EAAEQ,QAAQ,GAAAP,KAAA,GAAUa,aAAc;IACzCZ,KAAK,EAAEA,KAAM;IACbO,SAAS,EAAEA,SAAU;IACrBJ,YAAY,EAAEO,gBAAiB;IAC/BN,YAAY,EAAEO;EAAiB,IAE9BT,QACK,CAAC,gBAETxB,KAAA,CAAAwC,aAAA,MAAAC,QAAA,KACMX,SAAS;IACb,aAAWb,QAAS;IACpBE,IAAI,EAAES,QAAQ,IAAI,CAACT,IAAI,GAAGkB,SAAS,GAAGxB,UAAU,CAACM,IAAI,CAAE;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","Provider","pushToHistory","Link","props","legacyContext","hovered","setHovered","history","createHref","_identity","hoverColor","hoverBackgroundColor","dataName","useButtonTag","href","onClick","_noop","style","customStyle","children","onMouseEnter","onMouseLeave","download","disabled","className","restProps","navigate","handleMouseEnter","handleMouseLeave","handleOnClick","e","backgroundColor","undefined","color","pointerEvents","createElement","_extends","type","propTypes","process","env","NODE_ENV","node","string","title","target","oneOf","oneOfType","bool","func","shape","contextTypes","skin","childContextTypes"],"sources":["../../../src/atom/link/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {identity, noop} from 'lodash/fp';\nimport Provider from '../provider';\nimport pushToHistory from '../../util/navigation';\n\nconst Link = (props, legacyContext) => {\n const [hovered, setHovered] = useState(false);\n const {history: {createHref = identity} = {}} = legacyContext;\n\n const {\n hoverColor,\n hoverBackgroundColor,\n 'data-name': dataName = 'link',\n useButtonTag = false,\n href,\n onClick = noop,\n style: customStyle,\n children,\n onMouseEnter = noop,\n onMouseLeave = noop,\n download,\n disabled,\n className,\n ...restProps\n } = props;\n\n const navigate = useMemo(() => pushToHistory(legacyContext)({href}), [href, legacyContext]);\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n onMouseEnter();\n }, [onMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n onMouseLeave();\n }, [onMouseLeave]);\n\n const handleOnClick = useCallback(\n e => {\n onClick(e);\n if (!download) navigate(e);\n },\n [download, navigate, onClick]\n );\n\n const style = {\n ...customStyle,\n ...(hovered && hoverBackgroundColor ? {backgroundColor: hoverBackgroundColor} : undefined),\n ...(hovered && hoverColor ? {color: hoverColor} : undefined),\n ...(href || onClick ? null : {pointerEvents: 'none'})\n };\n\n return useButtonTag ? (\n <button\n {...restProps}\n data-name={dataName}\n type=\"button\"\n onClick={disabled ? noop : handleOnClick}\n style={style}\n className={className}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {children}\n </button>\n ) : (\n <a\n {...restProps}\n data-name={dataName}\n href={disabled || !href ? undefined : createHref(href)}\n download={download}\n onClick={disabled ? noop : handleOnClick}\n style={style}\n className={className}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {children}\n </a>\n );\n};\n\nLink.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n href: PropTypes.string,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n title: PropTypes.string,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n hoverColor: PropTypes.string,\n hoverBackgroundColor: PropTypes.string,\n download: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n onClick: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n useButtonTag: PropTypes.bool,\n style: PropTypes.shape({}),\n disabled: PropTypes.bool\n};\n\nLink.contextTypes = {\n skin: Provider.childContextTypes.skin,\n history: Provider.childContextTypes.history\n};\n\nexport default Link;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,MAAMC,IAAI,GAAGA,CAACC,KAAK,EAAEC,aAAa,KAAK;EACrC,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGR,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM;IAACS,OAAO,EAAE;MAACC,UAAU,GAAAC;IAAW,CAAC,GAAG,CAAC;EAAC,CAAC,GAAGL,aAAa;EAE7D,MAAM;IACJM,UAAU;IACVC,oBAAoB;IACpB,WAAW,EAAEC,QAAQ,GAAG,MAAM;IAC9BC,YAAY,GAAG,KAAK;IACpBC,IAAI;IACJC,OAAO,GAAAC,KAAO;IACdC,KAAK,EAAEC,WAAW;IAClBC,QAAQ;IACRC,YAAY,GAAAJ,KAAO;IACnBK,YAAY,GAAAL,KAAO;IACnBM,QAAQ;IACRC,QAAQ;IACRC,SAAS;IACT,GAAGC;EACL,CAAC,GAAGtB,KAAK;EAET,MAAMuB,QAAQ,GAAG7B,OAAO,CAAC,MAAMI,aAAa,CAACG,aAAa,CAAC,CAAC;IAACU;EAAI,CAAC,CAAC,EAAE,CA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AQ,EAAExB,SAAS,CAACiD;AACtB,CAAC;AAED9C,IAAI,CAACiD,YAAY,GAAG;EAClBC,IAAI,EAAEpD,QAAQ,CAACqD,iBAAiB,CAACD,IAAI;EACrC7C,OAAO,EAAEP,QAAQ,CAACqD,iBAAiB,CAAC9C;AACtC,CAAC;AAED,eAAeL,IAAI","ignoreList":[]}
|
|
@@ -65,7 +65,7 @@ declare const RadioWithTitle: {
|
|
|
65
65
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
66
66
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
67
67
|
href: import("prop-types").Requireable<string>;
|
|
68
|
-
download: import("prop-types").Requireable<boolean
|
|
68
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
69
69
|
target: import("prop-types").Requireable<string>;
|
|
70
70
|
rel: import("prop-types").Requireable<string>;
|
|
71
71
|
}>>;
|
|
@@ -63,7 +63,7 @@ export declare const propTypes: {
|
|
|
63
63
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
64
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
65
|
href: PropTypes.Requireable<string>;
|
|
66
|
-
download: PropTypes.Requireable<boolean
|
|
66
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
67
67
|
target: PropTypes.Requireable<string>;
|
|
68
68
|
rel: PropTypes.Requireable<string>;
|
|
69
69
|
}>>;
|
package/es/atom/title/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ declare namespace Title {
|
|
|
63
63
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
64
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
65
|
href: PropTypes.Requireable<string>;
|
|
66
|
-
download: PropTypes.Requireable<boolean
|
|
66
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
67
67
|
target: PropTypes.Requireable<string>;
|
|
68
68
|
rel: PropTypes.Requireable<string>;
|
|
69
69
|
}>>;
|
|
@@ -38,7 +38,7 @@ declare const ButtonMenuAction: {
|
|
|
38
38
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
39
39
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
40
40
|
href: import("prop-types").Requireable<string>;
|
|
41
|
-
download: import("prop-types").Requireable<boolean
|
|
41
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
42
42
|
target: import("prop-types").Requireable<string>;
|
|
43
43
|
rel: import("prop-types").Requireable<string>;
|
|
44
44
|
}>>;
|
|
@@ -37,7 +37,7 @@ declare const ButtonMenuActionPropTypes: {
|
|
|
37
37
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
38
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
39
39
|
href: PropTypes.Requireable<string>;
|
|
40
|
-
download: PropTypes.Requireable<boolean
|
|
40
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
41
41
|
target: PropTypes.Requireable<string>;
|
|
42
42
|
rel: PropTypes.Requireable<string>;
|
|
43
43
|
}>>;
|
|
@@ -72,7 +72,7 @@ declare const propTypes: {
|
|
|
72
72
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
73
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
74
74
|
href: PropTypes.Requireable<string>;
|
|
75
|
-
download: PropTypes.Requireable<boolean
|
|
75
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
76
76
|
target: PropTypes.Requireable<string>;
|
|
77
77
|
rel: PropTypes.Requireable<string>;
|
|
78
78
|
}>>;
|
|
@@ -228,7 +228,7 @@ declare const propTypes: {
|
|
|
228
228
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
229
229
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
230
230
|
href: PropTypes.Requireable<string>;
|
|
231
|
-
download: PropTypes.Requireable<boolean
|
|
231
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
232
232
|
target: PropTypes.Requireable<string>;
|
|
233
233
|
rel: PropTypes.Requireable<string>;
|
|
234
234
|
}>>;
|
|
@@ -407,7 +407,7 @@ declare const propTypes: {
|
|
|
407
407
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
408
408
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
409
409
|
href: PropTypes.Requireable<string>;
|
|
410
|
-
download: PropTypes.Requireable<boolean
|
|
410
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
411
411
|
target: PropTypes.Requireable<string>;
|
|
412
412
|
rel: PropTypes.Requireable<string>;
|
|
413
413
|
}>>;
|
|
@@ -455,7 +455,7 @@ declare const propTypes: {
|
|
|
455
455
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
456
456
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
457
457
|
href: PropTypes.Requireable<string>;
|
|
458
|
-
download: PropTypes.Requireable<boolean
|
|
458
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
459
459
|
target: PropTypes.Requireable<string>;
|
|
460
460
|
rel: PropTypes.Requireable<string>;
|
|
461
461
|
}>>;
|
|
@@ -599,7 +599,7 @@ declare const propTypes: {
|
|
|
599
599
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
600
600
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
601
601
|
href: PropTypes.Requireable<string>;
|
|
602
|
-
download: PropTypes.Requireable<boolean
|
|
602
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
603
603
|
target: PropTypes.Requireable<string>;
|
|
604
604
|
rel: PropTypes.Requireable<string>;
|
|
605
605
|
}>>;
|
|
@@ -711,7 +711,7 @@ declare const propTypes: {
|
|
|
711
711
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
712
712
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
713
713
|
href: PropTypes.Requireable<string>;
|
|
714
|
-
download: PropTypes.Requireable<boolean
|
|
714
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
715
715
|
target: PropTypes.Requireable<string>;
|
|
716
716
|
rel: PropTypes.Requireable<string>;
|
|
717
717
|
}>>;
|
|
@@ -795,7 +795,7 @@ declare const propTypes: {
|
|
|
795
795
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
796
796
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
797
797
|
href: PropTypes.Requireable<string>;
|
|
798
|
-
download: PropTypes.Requireable<boolean
|
|
798
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
799
799
|
target: PropTypes.Requireable<string>;
|
|
800
800
|
rel: PropTypes.Requireable<string>;
|
|
801
801
|
}>>;
|
|
@@ -844,7 +844,7 @@ declare const propTypes: {
|
|
|
844
844
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
845
845
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
846
846
|
href: PropTypes.Requireable<string>;
|
|
847
|
-
download: PropTypes.Requireable<boolean
|
|
847
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
848
848
|
target: PropTypes.Requireable<string>;
|
|
849
849
|
rel: PropTypes.Requireable<string>;
|
|
850
850
|
}>>;
|
|
@@ -911,7 +911,7 @@ declare const propTypes: {
|
|
|
911
911
|
target: PropTypes.Requireable<string>;
|
|
912
912
|
hoverColor: PropTypes.Requireable<string>;
|
|
913
913
|
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
914
|
-
download: PropTypes.Requireable<boolean
|
|
914
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
915
915
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
916
916
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
917
917
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -114,7 +114,7 @@ declare const ActionableExpandableTable: {
|
|
|
114
114
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
115
115
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
116
116
|
href: import("prop-types").Requireable<string>;
|
|
117
|
-
download: import("prop-types").Requireable<boolean
|
|
117
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
118
118
|
target: import("prop-types").Requireable<string>;
|
|
119
119
|
rel: import("prop-types").Requireable<string>;
|
|
120
120
|
}>>;
|
|
@@ -91,7 +91,7 @@ export declare const propTypes: {
|
|
|
91
91
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
92
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
93
93
|
href: PropTypes.Requireable<string>;
|
|
94
|
-
download: PropTypes.Requireable<boolean
|
|
94
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
95
95
|
target: PropTypes.Requireable<string>;
|
|
96
96
|
rel: PropTypes.Requireable<string>;
|
|
97
97
|
}>>;
|
|
@@ -56,7 +56,7 @@ declare const QuickFilters: {
|
|
|
56
56
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
57
57
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
58
58
|
href: import("prop-types").Requireable<string>;
|
|
59
|
-
download: import("prop-types").Requireable<boolean
|
|
59
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
60
60
|
target: import("prop-types").Requireable<string>;
|
|
61
61
|
rel: import("prop-types").Requireable<string>;
|
|
62
62
|
}>>;
|
|
@@ -77,7 +77,7 @@ export declare const propTypes: {
|
|
|
77
77
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
78
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
79
79
|
href: PropTypes.Requireable<string>;
|
|
80
|
-
download: PropTypes.Requireable<boolean
|
|
80
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
81
81
|
target: PropTypes.Requireable<string>;
|
|
82
82
|
rel: PropTypes.Requireable<string>;
|
|
83
83
|
}>>;
|
|
@@ -84,7 +84,7 @@ declare namespace TitleAndCheckBoxWrapper {
|
|
|
84
84
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
85
85
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
86
86
|
href: PropTypes.Requireable<string>;
|
|
87
|
-
download: PropTypes.Requireable<boolean
|
|
87
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
88
88
|
target: PropTypes.Requireable<string>;
|
|
89
89
|
rel: PropTypes.Requireable<string>;
|
|
90
90
|
}>>;
|
|
@@ -66,7 +66,7 @@ declare const TitleRadioWrapper: {
|
|
|
66
66
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
67
67
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
68
68
|
href: import("prop-types").Requireable<string>;
|
|
69
|
-
download: import("prop-types").Requireable<boolean
|
|
69
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
70
70
|
target: import("prop-types").Requireable<string>;
|
|
71
71
|
rel: import("prop-types").Requireable<string>;
|
|
72
72
|
}>>;
|
|
@@ -67,7 +67,7 @@ declare const propTypes: {
|
|
|
67
67
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
68
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
69
69
|
href: PropTypes.Requireable<string>;
|
|
70
|
-
download: PropTypes.Requireable<boolean
|
|
70
|
+
download: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
71
71
|
target: PropTypes.Requireable<string>;
|
|
72
72
|
rel: PropTypes.Requireable<string>;
|
|
73
73
|
}>>;
|
|
@@ -45,6 +45,7 @@ declare const AssignmentAudience: {
|
|
|
45
45
|
templateLink: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
46
46
|
label: import("prop-types").Requireable<string>;
|
|
47
47
|
href: import("prop-types").Requireable<string>;
|
|
48
|
+
download: import("prop-types").Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
48
49
|
}>>;
|
|
49
50
|
templatePreview: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
50
51
|
header: import("prop-types").Validator<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/assignment-audience/index.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAoC,EAAC,uBAAuB,EAAU,MAAM,SAAS,CAAC;AAwDtF,QAAA,MAAM,kBAAkB;iJAcnB,uBAAuB,WACjB,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/assignment-audience/index.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAoC,EAAC,uBAAuB,EAAU,MAAM,SAAS,CAAC;AAwDtF,QAAA,MAAM,kBAAkB;iJAcnB,uBAAuB,WACjB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4e1B,CAAC;AAQF,eAAe,kBAAkB,CAAC"}
|
|
@@ -130,7 +130,10 @@ const AssignmentAudience = ({
|
|
|
130
130
|
if (!sourcesDisabled) onRemoveFile?.();
|
|
131
131
|
}, [sourcesDisabled, onRemoveFile]);
|
|
132
132
|
const availableSuggestions = useMemo(() => sourcesDisabled ? [] : (suggestions || []).filter(suggestion => !selected?.some(learner => learner.id === suggestion.id)), [sourcesDisabled, suggestions, selected]);
|
|
133
|
-
const handleSearch = useCallback(
|
|
133
|
+
const handleSearch = useCallback(({
|
|
134
|
+
value: query,
|
|
135
|
+
reason
|
|
136
|
+
}) => !sourcesDisabled && reason === 'input-changed' && onSearch?.(query), [sourcesDisabled, onSearch]);
|
|
134
137
|
const handleAdd = useCallback(({
|
|
135
138
|
suggestion
|
|
136
139
|
}) => {
|
|
@@ -227,7 +230,7 @@ const AssignmentAudience = ({
|
|
|
227
230
|
label: upload.templateLink.label,
|
|
228
231
|
link: sourcesDisabled ? undefined : {
|
|
229
232
|
href: upload.templateLink.href,
|
|
230
|
-
download: true
|
|
233
|
+
download: upload.templateLink.download ?? true
|
|
231
234
|
},
|
|
232
235
|
disabled: sourcesDisabled,
|
|
233
236
|
'data-name': 'upload-template-link',
|
|
@@ -272,8 +275,9 @@ const AssignmentAudience = ({
|
|
|
272
275
|
name: `${learner.label} · ${learner.login}`,
|
|
273
276
|
value: learner.id
|
|
274
277
|
})),
|
|
275
|
-
|
|
276
|
-
onSuggestionSelected: handleAdd
|
|
278
|
+
onFetch: handleSearch,
|
|
279
|
+
onSuggestionSelected: handleAdd,
|
|
280
|
+
focusInputOnSuggestionClick: true
|
|
277
281
|
}), (selected?.length || 0) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
278
282
|
className: style.chips
|
|
279
283
|
}, selected?.map(learner => /*#__PURE__*/React.createElement(Chip, {
|