@coorpacademy/components 11.14.23 → 11.14.24-alpha.11
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 +3 -1
- package/es/atom/autocomplete/index.d.ts.map +1 -1
- package/es/atom/autocomplete/index.js +55 -19
- package/es/atom/autocomplete/index.js.map +1 -1
- package/es/atom/autocomplete/style.css +223 -0
- package/es/molecule/brand-form-group/index.d.ts +3 -1
- package/es/molecule/select-multiple/index.d.ts.map +1 -1
- package/es/molecule/select-multiple/index.js +2 -1
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/select-multiple/style.css +1 -1
- package/es/organism/brand-form/index.d.ts +4 -1
- package/es/organism/brand-form/index.d.ts.map +1 -1
- package/es/organism/brand-form/index.js +17 -7
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -1
- package/es/template/back-office/brand-update/index.d.ts +4 -1
- package/lib/atom/autocomplete/index.d.ts +3 -1
- package/lib/atom/autocomplete/index.d.ts.map +1 -1
- package/lib/atom/autocomplete/index.js +58 -18
- package/lib/atom/autocomplete/index.js.map +1 -1
- package/lib/atom/autocomplete/style.css +223 -0
- package/lib/molecule/brand-form-group/index.d.ts +3 -1
- package/lib/molecule/select-multiple/index.d.ts.map +1 -1
- package/lib/molecule/select-multiple/index.js +2 -1
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/select-multiple/style.css +1 -1
- package/lib/organism/brand-form/index.d.ts +4 -1
- package/lib/organism/brand-form/index.d.ts.map +1 -1
- package/lib/organism/brand-form/index.js +18 -7
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -1
- package/lib/template/back-office/brand-update/index.d.ts +4 -1
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaCompositionNavigationArrowLeft","ArrowLeft","BrandFormGroup","Provider","Button","Link","Loader","style","buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","darkColor","disabledSubmit","submitButton","title","saveButton","cancelBackground","backgroundColor","resetButton","buttons","BrandForm","props","context","groups","back","isLoading","skin","backView","color","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","e","preventDefault","handleReset","loaderContainer","loader","form","contextTypes","childContextTypes","defaultProps","place","propTypes","arrayOf","shape","isRequired","bool","func","children","href","string"],"sources":["../../../src/organism/brand-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowLeft as ArrowLeft} from '@coorpacademy/nova-icons';\nimport BrandFormGroup from '../../molecule/brand-form-group';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Link from '../../atom/link';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildButtonSection = (\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor\n) => {\n if (!onSubmit && !onReset) {\n return null;\n }\n\n const disabledSubmit = disabled || isPending || !isModified;\n const submitButton = onSubmit ? (\n <div data-tip={tooltip.title} data-for=\"submitButton\" className={style.saveButton}>\n <Button type=\"submit\" disabled={disabledSubmit} submitValue={submitValue} />\n </div>\n ) : null;\n\n const cancelBackground = {backgroundColor: darkColor};\n\n const resetButton = onReset ? (\n <div className={style.resetButton}>\n <Button type=\"reset\" submitValue={resetValue} style={cancelBackground} />\n </div>\n ) : null;\n\n return (\n <div className={style.buttons}>\n {submitButton}\n {resetButton}\n </div>\n );\n};\
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaCompositionNavigationArrowLeft","ArrowLeft","BrandFormGroup","Provider","Button","ButtonLink","Link","Loader","style","buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","darkColor","theme","disabledSubmit","submitButton","title","saveButton","cancelBackground","backgroundColor","resetButton","buttons","BrandForm","props","context","groups","back","isLoading","skin","backView","color","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","e","preventDefault","handleReset","loaderContainer","loader","form","contextTypes","childContextTypes","defaultProps","place","propTypes","arrayOf","shape","isRequired","bool","func","children","href","string"],"sources":["../../../src/organism/brand-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowLeft as ArrowLeft} from '@coorpacademy/nova-icons';\nimport BrandFormGroup from '../../molecule/brand-form-group';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport ButtonLink from '../../atom/button-link';\nimport Link from '../../atom/link';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildButtonSection = (\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor,\n theme\n) => {\n if (!onSubmit && !onReset) {\n return null;\n }\n\n const disabledSubmit = disabled || isPending || !isModified;\n const submitButton = onSubmit ? (\n <div data-tip={tooltip.title} data-for=\"submitButton\" className={style.saveButton}>\n {theme === 'coorpmanager' ? (\n <ButtonLink\n type=\"primary\"\n label={submitValue}\n disabled={disabledSubmit}\n data-testid=\"submit-button\"\n buttonType=\"submit\"\n onClick={onSubmit}\n />\n ) : (\n <Button type=\"submit\" disabled={disabledSubmit} submitValue={submitValue} />\n )}\n </div>\n ) : null;\n\n const cancelBackground = {backgroundColor: darkColor};\n\n const resetButton = onReset ? (\n <div className={style.resetButton}>\n <Button type=\"reset\" submitValue={resetValue} style={cancelBackground} />\n </div>\n ) : null;\n\n return (\n <div className={style.buttons}>\n {submitButton}\n {resetButton}\n </div>\n );\n};\nconst BrandForm = (props, context) => {\n const {\n groups,\n disabled,\n isModified,\n isPending,\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n back,\n tooltip,\n isLoading,\n theme\n } = props;\n const {skin} = context;\n const darkColor = get('common.dark', skin);\n\n const backView = back ? (\n <p className={style.back}>\n <ArrowLeft style={{color: darkColor}} className={style.arrowBack} />\n <Link href={back.link} className={style.backDesc}>\n {back.desc}\n </Link>\n </p>\n ) : null;\n\n const brandGroups = groups.map((group, index) => {\n return (\n <div className={style.group} key={index}>\n <BrandFormGroup {...group} />\n </div>\n );\n });\n\n const buttonSection = buildButtonSection(\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor,\n theme\n );\n\n const handleSubmit = useMemo(\n () => e => {\n e.preventDefault();\n return onSubmit(e);\n },\n [onSubmit]\n );\n\n const handleReset = useMemo(\n () => e => {\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n return (\n <div>\n {backView}\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <form onSubmit={handleSubmit} onReset={handleReset} className={style.form}>\n {brandGroups}\n {buttonSection}\n </form>\n )}\n </div>\n );\n};\n\nBrandForm.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBrandForm.defaultProps = {\n tooltip: {\n title: '',\n place: 'top'\n }\n};\n\nBrandForm.propTypes = {\n groups: PropTypes.arrayOf(PropTypes.shape(BrandFormGroup.propTypes)).isRequired,\n disabled: PropTypes.bool,\n isModified: PropTypes.bool,\n isPending: PropTypes.bool,\n onSubmit: PropTypes.func,\n submitValue: Button.propTypes.submitValue,\n onReset: PropTypes.func,\n resetValue: Button.propTypes.submitValue,\n back: PropTypes.shape({\n desc: Link.propTypes.children,\n link: Link.propTypes.href\n }),\n tooltip: PropTypes.shape({\n title: PropTypes.string,\n place: PropTypes.string\n }),\n isLoading: PropTypes.bool,\n theme: PropTypes.string\n};\n\nexport default BrandForm;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7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jB,SAAS,CAAC8D,IAHF;EAIpB5C,SAAS,EAAElB,SAAS,CAAC8D,IAJD;EAKpBnD,QAAQ,EAAEX,SAAS,CAAC+D,IALA;EAMpBnD,WAAW,EAAEP,MAAM,CAACqD,SAAP,CAAiB9C,WANV;EAOpBC,OAAO,EAAEb,SAAS,CAAC+D,IAPC;EAQpBjD,UAAU,EAAET,MAAM,CAACqD,SAAP,CAAiB9C,WART;EASpBqB,IAAI,EAAEjC,SAAS,CAAC4D,KAAV,CAAgB;IACpBnB,IAAI,EAAElC,IAAI,CAACmD,SAAL,CAAeM,QADD;IAEpBzB,IAAI,EAAEhC,IAAI,CAACmD,SAAL,CAAeO;EAFD,CAAhB,CATc;EAapBlD,OAAO,EAAEf,SAAS,CAAC4D,KAAV,CAAgB;IACvBrC,KAAK,EAAEvB,SAAS,CAACkE,MADM;IAEvBT,KAAK,EAAEzD,SAAS,CAACkE;EAFM,CAAhB,CAbW;EAiBpBhC,SAAS,EAAElC,SAAS,CAAC8D,IAjBD;EAkBpB1C,KAAK,EAAEpB,SAAS,CAACkE;AAlBG,CAAtB;AAqBA,eAAerC,SAAf"}
|
|
@@ -80,11 +80,13 @@ declare namespace WizardContents {
|
|
|
80
80
|
required: PropTypes.Requireable<boolean>;
|
|
81
81
|
modified: PropTypes.Requireable<boolean>;
|
|
82
82
|
error: PropTypes.Requireable<boolean>;
|
|
83
|
+
errorMessage: PropTypes.Requireable<string>;
|
|
83
84
|
suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
84
85
|
name: PropTypes.Requireable<string>;
|
|
85
86
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
86
87
|
}> | null | undefined)[]>;
|
|
87
|
-
|
|
88
|
+
theme: PropTypes.Requireable<string>;
|
|
89
|
+
onInput: PropTypes.Requireable<(...args: any[]) => any>;
|
|
88
90
|
onFetch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
89
91
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
90
92
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -526,6 +528,7 @@ declare namespace WizardContents {
|
|
|
526
528
|
place: PropTypes.Requireable<string>;
|
|
527
529
|
}>>;
|
|
528
530
|
isLoading: PropTypes.Requireable<boolean>;
|
|
531
|
+
theme: PropTypes.Requireable<string>;
|
|
529
532
|
}> | PropTypes.InferProps<{
|
|
530
533
|
type: PropTypes.Requireable<string>;
|
|
531
534
|
languageTabs: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -165,11 +165,13 @@ declare namespace BrandUpdate {
|
|
|
165
165
|
required: PropTypes.Requireable<boolean>;
|
|
166
166
|
modified: PropTypes.Requireable<boolean>;
|
|
167
167
|
error: PropTypes.Requireable<boolean>;
|
|
168
|
+
errorMessage: PropTypes.Requireable<string>;
|
|
168
169
|
suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
169
170
|
name: PropTypes.Requireable<string>;
|
|
170
171
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
171
172
|
}> | null | undefined)[]>;
|
|
172
|
-
|
|
173
|
+
theme: PropTypes.Requireable<string>;
|
|
174
|
+
onInput: PropTypes.Requireable<(...args: any[]) => any>;
|
|
173
175
|
onFetch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
174
176
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
175
177
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -611,6 +613,7 @@ declare namespace BrandUpdate {
|
|
|
611
613
|
place: PropTypes.Requireable<string>;
|
|
612
614
|
}>>;
|
|
613
615
|
isLoading: PropTypes.Requireable<boolean>;
|
|
616
|
+
theme: PropTypes.Requireable<string>;
|
|
614
617
|
}> | PropTypes.InferProps<{
|
|
615
618
|
key: PropTypes.Requireable<string>;
|
|
616
619
|
type: PropTypes.Requireable<string>;
|
|
@@ -9,11 +9,13 @@ declare namespace Autocomplete {
|
|
|
9
9
|
const required: PropTypes.Requireable<boolean>;
|
|
10
10
|
const modified: PropTypes.Requireable<boolean>;
|
|
11
11
|
const error: PropTypes.Requireable<boolean>;
|
|
12
|
+
const errorMessage: PropTypes.Requireable<string>;
|
|
12
13
|
const suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
13
14
|
name: PropTypes.Requireable<string>;
|
|
14
15
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
15
16
|
}> | null | undefined)[]>;
|
|
16
|
-
const
|
|
17
|
+
const theme: PropTypes.Requireable<string>;
|
|
18
|
+
const onInput: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
19
|
const onFetch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
20
|
const onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
21
|
const onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";AAmBA,uDA8GC"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
+
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
7
|
+
|
|
8
|
+
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
9
|
+
|
|
6
10
|
var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
7
11
|
|
|
8
12
|
var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
@@ -15,6 +19,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
19
|
|
|
16
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
21
|
|
|
22
|
+
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
23
|
+
|
|
18
24
|
var _getClassState = _interopRequireDefault(require("../../util/get-class-state"));
|
|
19
25
|
|
|
20
26
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
@@ -25,6 +31,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
31
|
|
|
26
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
33
|
|
|
34
|
+
const THEME_STYLE = {
|
|
35
|
+
coorpmanager: _style.default.coorpmanager,
|
|
36
|
+
default: _style.default.default
|
|
37
|
+
};
|
|
38
|
+
|
|
28
39
|
const renderSuggestion = suggestion => /*#__PURE__*/_react.default.createElement("span", null, suggestion.name);
|
|
29
40
|
|
|
30
41
|
const Autocomplete = props => {
|
|
@@ -35,32 +46,61 @@ const Autocomplete = props => {
|
|
|
35
46
|
required,
|
|
36
47
|
modified = false,
|
|
37
48
|
error = false,
|
|
49
|
+
errorMessage,
|
|
38
50
|
suggestions = [],
|
|
39
|
-
|
|
51
|
+
onInput = _noop2.default,
|
|
40
52
|
onFetch = _noop2.default,
|
|
41
53
|
onClear = _noop2.default,
|
|
42
54
|
onBlur = _noop2.default,
|
|
43
55
|
onSuggestionSelected = _noop2.default,
|
|
44
|
-
title: propsTitle
|
|
56
|
+
title: propsTitle,
|
|
57
|
+
theme = 'default'
|
|
45
58
|
} = props;
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
59
|
+
const mainClass = THEME_STYLE[theme];
|
|
60
|
+
const title = (0, _react.useMemo)(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);
|
|
61
|
+
const className = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [modified, error]);
|
|
62
|
+
const handleInput = (0, _react.useCallback)(e => {
|
|
63
|
+
onInput(e);
|
|
64
|
+
}, [onInput]);
|
|
65
|
+
const handleBlur = (0, _react.useCallback)((e, selectedSuggestion) => onBlur(e, selectedSuggestion), [onBlur]);
|
|
66
|
+
const handleSuggestionsFetchRequested = (0, _react.useCallback)(e => onFetch(e), [onFetch]);
|
|
67
|
+
const handleSuggestionsClearRequested = (0, _react.useCallback)(e => onClear(e), [onClear]);
|
|
68
|
+
const handleSuggestionsSelected = (0, _react.useCallback)((e, data) => onSuggestionSelected(data), [onSuggestionSelected]);
|
|
53
69
|
const inputProps = {
|
|
54
70
|
placeholder,
|
|
55
71
|
value,
|
|
56
|
-
onChange:
|
|
57
|
-
onBlur: handleBlur
|
|
72
|
+
onChange: _noop2.default,
|
|
73
|
+
onBlur: handleBlur,
|
|
74
|
+
onInput: handleInput,
|
|
75
|
+
'data-testid': 'autocomplete-input'
|
|
58
76
|
};
|
|
77
|
+
const descriptionView = description && theme !== 'coorpmanager' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: _style.default.description
|
|
79
|
+
}, description) : null;
|
|
80
|
+
const toolTipView = description && theme === 'coorpmanager' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
+
className: _style.default.infoIconWrapper
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
|
|
83
|
+
className: _style.default.infoIcon
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: _style.default.descriptionLabel
|
|
86
|
+
}, description)) : null;
|
|
87
|
+
const errorIconView = theme === 'coorpmanager' && error ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
|
|
88
|
+
className: _style.default.leftIcon
|
|
89
|
+
}) : null;
|
|
90
|
+
const errorText = theme === 'coorpmanager' && error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
+
className: _style.default.errorText // eslint-disable-next-line react/no-danger
|
|
92
|
+
,
|
|
93
|
+
dangerouslySetInnerHTML: {
|
|
94
|
+
__html: errorMessage
|
|
95
|
+
}
|
|
96
|
+
}) : null;
|
|
59
97
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: (0, _classnames.default)(className, (0, _isNil2.default)(
|
|
98
|
+
className: (0, _classnames.default)(mainClass, className, (0, _isNil2.default)(propsTitle) && _style.default.isNoTitle)
|
|
61
99
|
}, /*#__PURE__*/_react.default.createElement("label", null, /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
-
className: _style.default.title
|
|
63
|
-
}, title), /*#__PURE__*/_react.default.createElement("div",
|
|
100
|
+
className: (0, _classnames.default)(_style.default.title, (0, _isEmpty2.default)(value) && _style.default.noValue)
|
|
101
|
+
}, title, toolTipView), /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
+
className: _style.default.inputContainer
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(_reactAutosuggest.default, {
|
|
64
104
|
theme: {
|
|
65
105
|
container: _style.default.container,
|
|
66
106
|
input: _style.default.input,
|
|
@@ -78,9 +118,7 @@ const Autocomplete = props => {
|
|
|
78
118
|
inputProps: inputProps,
|
|
79
119
|
focusInputOnSuggestionClick: false,
|
|
80
120
|
onSuggestionSelected: handleSuggestionsSelected
|
|
81
|
-
}))),
|
|
82
|
-
className: _style.default.description
|
|
83
|
-
}, description));
|
|
121
|
+
}), errorIconView, errorText)), descriptionView);
|
|
84
122
|
};
|
|
85
123
|
|
|
86
124
|
Autocomplete.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -91,11 +129,13 @@ Autocomplete.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
91
129
|
required: _propTypes.default.bool,
|
|
92
130
|
modified: _propTypes.default.bool,
|
|
93
131
|
error: _propTypes.default.bool,
|
|
132
|
+
errorMessage: _propTypes.default.string,
|
|
94
133
|
suggestions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
95
134
|
name: _propTypes.default.string,
|
|
96
135
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
97
136
|
})),
|
|
98
|
-
|
|
137
|
+
theme: _propTypes.default.oneOf((0, _keys2.default)(THEME_STYLE)),
|
|
138
|
+
onInput: _propTypes.default.func,
|
|
99
139
|
onFetch: _propTypes.default.func,
|
|
100
140
|
onClear: _propTypes.default.func,
|
|
101
141
|
onBlur: _propTypes.default.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["renderSuggestion","suggestion","name","Autocomplete","props","placeholder","value","description","required","modified","error","suggestions","
|
|
1
|
+
{"version":3,"file":"index.js","names":["THEME_STYLE","coorpmanager","style","default","renderSuggestion","suggestion","name","Autocomplete","props","placeholder","value","description","required","modified","error","errorMessage","suggestions","onInput","onFetch","onClear","onBlur","onSuggestionSelected","title","propsTitle","theme","mainClass","useMemo","className","getClassState","handleInput","useCallback","e","handleBlur","selectedSuggestion","handleSuggestionsFetchRequested","handleSuggestionsClearRequested","handleSuggestionsSelected","data","inputProps","onChange","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","errorIconView","leftIcon","errorText","__html","classnames","isNoTitle","noValue","inputContainer","container","input","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestionHighlighted","propTypes","PropTypes","string","bool","arrayOf","shape","oneOfType","number","oneOf","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.default\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.default, 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;;AACA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;;;;;;;AAEA,MAAMA,WAAW,GAAG;EAClBC,YAAY,EAAEC,cAAA,CAAMD,YADF;EAElBE,OAAO,EAAED,cAAA,CAAMC;AAFG,CAApB;;AAKA,MAAMC,gBAAgB,GAAGC,UAAU,iBAAI,2CAAOA,UAAU,CAACC,IAAlB,CAAvC;;AAEA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IACJC,WAAW,GAAG,EADV;IAEJC,KAFI;IAGJC,WAHI;IAIJC,QAJI;IAKJC,QAAQ,GAAG,KALP;IAMJC,KAAK,GAAG,KANJ;IAOJC,YAPI;IAQJC,WAAW,GAAG,EARV;IASJC,OAAO,iBATH;IAUJC,OAAO,iBAVH;IAWJC,OAAO,iBAXH;IAYJC,M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kBAAA,CAAUC,MAAX,EAAmBD,kBAAA,CAAUM,MAA7B,CAApB;EAFO,CAAhB,CADW,CATU;EAevB1C,KAAK,EAAEoC,kBAAA,CAAUO,KAAV,CAAgB,oBAAKnE,WAAL,CAAhB,CAfgB;EAgBvBiB,OAAO,EAAE2C,kBAAA,CAAUQ,IAhBI;EAiBvBlD,OAAO,EAAE0C,kBAAA,CAAUQ,IAjBI;EAkBvBjD,OAAO,EAAEyC,kBAAA,CAAUQ,IAlBI;EAmBvBhD,MAAM,EAAEwC,kBAAA,CAAUQ,IAnBK;EAoBvB/C,oBAAoB,EAAEuC,kBAAA,CAAUQ;AApBT,CAAzB;eAuBe7D,Y"}
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
@value dark from colors;
|
|
6
6
|
@value medium from colors;
|
|
7
7
|
@value white from colors;
|
|
8
|
+
@value cm_positive_100 from colors;
|
|
9
|
+
@value cm_negative_100 from colors;
|
|
10
|
+
@value cm_grey_100 from colors;
|
|
11
|
+
@value cm_grey_150 from colors;
|
|
12
|
+
@value cm_grey_400 from colors;
|
|
13
|
+
@value cm_grey_500 from colors;
|
|
14
|
+
@value cm_grey_700 from colors;
|
|
8
15
|
|
|
9
16
|
.default {
|
|
10
17
|
display: flex;
|
|
@@ -127,4 +134,220 @@
|
|
|
127
134
|
|
|
128
135
|
.suggestionHighlighted {
|
|
129
136
|
background-color: #ddd;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/******************************* coorpmanager theme ***************************************/
|
|
140
|
+
|
|
141
|
+
.coorpmanager {
|
|
142
|
+
width: 100%;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: flex-start;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
flex-wrap: nowrap;
|
|
147
|
+
position: relative;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.coorpmanager label {
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: 100%;
|
|
153
|
+
margin-right: 0;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: flex-start;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
position: relative;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.coorpmanager .title {
|
|
161
|
+
flex-grow: 0;
|
|
162
|
+
font-family: Gilroy;
|
|
163
|
+
font-size: 10px;
|
|
164
|
+
font-weight: bold;
|
|
165
|
+
font-stretch: normal;
|
|
166
|
+
font-style: normal;
|
|
167
|
+
line-height: 1.2;
|
|
168
|
+
letter-spacing: normal;
|
|
169
|
+
text-align: left;
|
|
170
|
+
z-index: 1;
|
|
171
|
+
color: cm_grey_400;
|
|
172
|
+
width: auto;
|
|
173
|
+
transition: all 0.25s linear;
|
|
174
|
+
pointer-events: none;
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-direction: row;
|
|
177
|
+
flex-wrap: nowrap;
|
|
178
|
+
position: absolute;
|
|
179
|
+
top: 7px;
|
|
180
|
+
left: 16px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.coorpmanager .title.noValue{
|
|
184
|
+
font-size: 14px;
|
|
185
|
+
font-weight: 500;
|
|
186
|
+
color: cm_grey_700;
|
|
187
|
+
top: 14px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.coorpmanager:focus-within .title.noValue {
|
|
191
|
+
font-size: 10px;
|
|
192
|
+
font-weight: bold;
|
|
193
|
+
color: cm_grey_400;
|
|
194
|
+
top: 7px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.coorpmanager .title.noValue .infoIcon {
|
|
198
|
+
height: 10px;
|
|
199
|
+
width: 10px;
|
|
200
|
+
line-height: 12px;
|
|
201
|
+
color: cm_grey_500;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.coorpmanager .inputContainer {
|
|
205
|
+
width: 100%
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.coorpmanager input {
|
|
209
|
+
width: 100%;
|
|
210
|
+
height: 44px;
|
|
211
|
+
margin: 0px;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: flex-start;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
flex-grow: 0;
|
|
216
|
+
justify-content: center;
|
|
217
|
+
background-color: cm_grey_100;
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
border: none;
|
|
220
|
+
border-radius: 7px;
|
|
221
|
+
color: cm_grey_700;
|
|
222
|
+
font-family: Gilroy;
|
|
223
|
+
font-size: 14px;
|
|
224
|
+
font-weight: 500;
|
|
225
|
+
font-stretch: normal;
|
|
226
|
+
font-style: normal;
|
|
227
|
+
line-height: 44px;
|
|
228
|
+
letter-spacing: normal;
|
|
229
|
+
outline: none;
|
|
230
|
+
padding: 19px 30px 5px 16px;
|
|
231
|
+
text-align: left;
|
|
232
|
+
transition: all 0.25s linear;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.coorpmanager .suggestionsContainerOpen {
|
|
236
|
+
width: 100%;
|
|
237
|
+
margin-left: 0;
|
|
238
|
+
border-radius: 7px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.coorpmanager:focus-within input::placeholder {
|
|
242
|
+
color: cm_grey_400;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.coorpmanager .suggestionsList {
|
|
246
|
+
border-radius: 7px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.coorpmanager .suggestionHighlighted {
|
|
250
|
+
border-radius: 5px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.coorpmanager input::placeholder {
|
|
254
|
+
color: transparent;
|
|
255
|
+
transition: color 0.25s linear;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.coorpmanager input:hover {
|
|
259
|
+
background-color: cm_grey_150;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.coorpmanager.error .leftIcon {
|
|
263
|
+
background-color: cm_negative_100;
|
|
264
|
+
color: white;
|
|
265
|
+
border-radius: 50%;
|
|
266
|
+
padding: 2px;
|
|
267
|
+
width: 10px;
|
|
268
|
+
height: 10px;
|
|
269
|
+
position: absolute;
|
|
270
|
+
right: 17px;
|
|
271
|
+
top: 14px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.coorpmanager .errorText {
|
|
275
|
+
flex-grow: 0;
|
|
276
|
+
opacity: 0.5;
|
|
277
|
+
font-family: Gilroy;
|
|
278
|
+
font-size: 10px;
|
|
279
|
+
font-weight: 500;
|
|
280
|
+
font-stretch: normal;
|
|
281
|
+
font-style: normal;
|
|
282
|
+
line-height: 1.2;
|
|
283
|
+
letter-spacing: normal;
|
|
284
|
+
text-align: left;
|
|
285
|
+
padding-top: 8px;
|
|
286
|
+
color: cm_negative_100;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.coorpmanager .infoIconWrapper {
|
|
290
|
+
overflow: visible;
|
|
291
|
+
height: 12px;
|
|
292
|
+
margin: 0px 4px;
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
pointer-events: fill;
|
|
295
|
+
position: relative;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.coorpmanager .infoIcon {
|
|
299
|
+
cursor: pointer;
|
|
300
|
+
width: 8px;
|
|
301
|
+
height: 8px;
|
|
302
|
+
line-height: 16px;
|
|
303
|
+
color: cm_grey_400;
|
|
304
|
+
transition: all 0.25s linear;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.coorpmanager .infoIconWrapper:hover .descriptionLabel {
|
|
308
|
+
visibility: visible;
|
|
309
|
+
opacity: 1;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.coorpmanager .descriptionLabel {
|
|
313
|
+
margin: 0 1px 18px 0;
|
|
314
|
+
padding: 8px 16px;
|
|
315
|
+
border-radius: 7px;
|
|
316
|
+
background-color: cm_grey_700;
|
|
317
|
+
flex-grow: 0;
|
|
318
|
+
font-family: Gilroy;
|
|
319
|
+
font-size: 14px;
|
|
320
|
+
font-weight: 500;
|
|
321
|
+
font-stretch: normal;
|
|
322
|
+
font-style: normal;
|
|
323
|
+
line-height: 1.43;
|
|
324
|
+
letter-spacing: normal;
|
|
325
|
+
text-align: center;
|
|
326
|
+
color: white;
|
|
327
|
+
padding: 8px 16px;
|
|
328
|
+
max-width: 200px;
|
|
329
|
+
position: absolute;
|
|
330
|
+
left: -24px;
|
|
331
|
+
z-index: 3;
|
|
332
|
+
bottom: 5px;
|
|
333
|
+
width: max-content;
|
|
334
|
+
visibility: hidden;
|
|
335
|
+
opacity: 0s
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.coorpmanager .descriptionLabel::after{
|
|
339
|
+
content:'';
|
|
340
|
+
border-left: 6px solid transparent;
|
|
341
|
+
border-right: 6px solid transparent;
|
|
342
|
+
border-top: 6px solid cm_grey_700;
|
|
343
|
+
position: absolute;
|
|
344
|
+
bottom: -6px;
|
|
345
|
+
left: 21px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.coorpmanager .title.noValue .descriptionLabel::after{
|
|
349
|
+
left: 22px;
|
|
350
|
+
}
|
|
351
|
+
.coorpmanager:focus-within .title.noValue .descriptionLabel::after{
|
|
352
|
+
left: 21px;
|
|
130
353
|
}
|
|
@@ -33,11 +33,13 @@ declare namespace BrandFormGroup {
|
|
|
33
33
|
required: PropTypes.Requireable<boolean>;
|
|
34
34
|
modified: PropTypes.Requireable<boolean>;
|
|
35
35
|
error: PropTypes.Requireable<boolean>;
|
|
36
|
+
errorMessage: PropTypes.Requireable<string>;
|
|
36
37
|
suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
37
38
|
name: PropTypes.Requireable<string>;
|
|
38
39
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
39
40
|
}> | null | undefined)[]>;
|
|
40
|
-
|
|
41
|
+
theme: PropTypes.Requireable<string>;
|
|
42
|
+
onInput: PropTypes.Requireable<(...args: any[]) => any>;
|
|
41
43
|
onFetch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
44
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
45
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/select-multiple/index.js"],"names":[],"mappings":"AAsBO,oEAcN;;AA2BD;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/select-multiple/index.js"],"names":[],"mappings":"AAsBO,oEAcN;;AA2BD;;;;;;;;;;;;;;;gBAqLC"}
|
|
@@ -129,8 +129,9 @@ const SelectMultiple = ({
|
|
|
129
129
|
}
|
|
130
130
|
}, []);
|
|
131
131
|
const handleChange = (0, _react.useCallback)(choice => {
|
|
132
|
-
// if multiple prop is turned on
|
|
132
|
+
console.log('--->', choice); // if multiple prop is turned on
|
|
133
133
|
// we return all selected choices
|
|
134
|
+
|
|
134
135
|
if (multiple) {
|
|
135
136
|
setChoices(choice);
|
|
136
137
|
return onChange(getChoices());
|