@coorpacademy/components 11.14.24-alpha.7 → 11.15.1
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/molecule/select-multiple/style.css +1 -1
- package/es/organism/brand-form/index.d.ts +0 -1
- package/es/organism/brand-form/index.d.ts.map +1 -1
- package/es/organism/brand-form/index.js +7 -17
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +0 -1
- package/es/template/back-office/brand-update/index.d.ts +0 -1
- package/lib/molecule/select-multiple/style.css +1 -1
- package/lib/organism/brand-form/index.d.ts +0 -1
- package/lib/organism/brand-form/index.d.ts.map +1 -1
- package/lib/organism/brand-form/index.js +7 -18
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +0 -1
- package/lib/template/back-office/brand-update/index.d.ts +0 -1
- package/package.json +3 -3
- package/locales/.mtslconfig.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AAiDA,kEA6EC"}
|
|
@@ -5,12 +5,11 @@ import { NovaCompositionNavigationArrowLeft as ArrowLeft } from '@coorpacademy/n
|
|
|
5
5
|
import BrandFormGroup from '../../molecule/brand-form-group';
|
|
6
6
|
import Provider from '../../atom/provider';
|
|
7
7
|
import Button from '../../atom/button';
|
|
8
|
-
import ButtonLink from '../../atom/button-link';
|
|
9
8
|
import Link from '../../atom/link';
|
|
10
9
|
import Loader from '../../atom/loader';
|
|
11
10
|
import style from './style.css';
|
|
12
11
|
|
|
13
|
-
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor
|
|
12
|
+
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor) => {
|
|
14
13
|
if (!onSubmit && !onReset) {
|
|
15
14
|
return null;
|
|
16
15
|
}
|
|
@@ -20,14 +19,7 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
|
|
|
20
19
|
"data-tip": tooltip.title,
|
|
21
20
|
"data-for": "submitButton",
|
|
22
21
|
className: style.saveButton
|
|
23
|
-
},
|
|
24
|
-
type: "primary",
|
|
25
|
-
label: submitValue,
|
|
26
|
-
disabled: disabledSubmit,
|
|
27
|
-
"data-testid": "submit-button",
|
|
28
|
-
buttonType: "submit",
|
|
29
|
-
onClick: onSubmit
|
|
30
|
-
}) : /*#__PURE__*/React.createElement(Button, {
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
31
23
|
type: "submit",
|
|
32
24
|
disabled: disabledSubmit,
|
|
33
25
|
submitValue: submitValue
|
|
@@ -47,7 +39,7 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
|
|
|
47
39
|
}, submitButton, resetButton);
|
|
48
40
|
};
|
|
49
41
|
|
|
50
|
-
|
|
42
|
+
function BrandForm(props, context) {
|
|
51
43
|
const {
|
|
52
44
|
groups,
|
|
53
45
|
disabled,
|
|
@@ -59,8 +51,7 @@ const BrandForm = (props, context) => {
|
|
|
59
51
|
resetValue,
|
|
60
52
|
back,
|
|
61
53
|
tooltip,
|
|
62
|
-
isLoading
|
|
63
|
-
theme
|
|
54
|
+
isLoading
|
|
64
55
|
} = props;
|
|
65
56
|
const {
|
|
66
57
|
skin
|
|
@@ -85,7 +76,7 @@ const BrandForm = (props, context) => {
|
|
|
85
76
|
key: index
|
|
86
77
|
}, /*#__PURE__*/React.createElement(BrandFormGroup, group));
|
|
87
78
|
});
|
|
88
|
-
const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor
|
|
79
|
+
const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor);
|
|
89
80
|
const handleSubmit = useMemo(() => e => {
|
|
90
81
|
e.preventDefault();
|
|
91
82
|
return onSubmit(e);
|
|
@@ -104,7 +95,7 @@ const BrandForm = (props, context) => {
|
|
|
104
95
|
onReset: handleReset,
|
|
105
96
|
className: style.form
|
|
106
97
|
}, brandGroups, buttonSection));
|
|
107
|
-
}
|
|
98
|
+
}
|
|
108
99
|
|
|
109
100
|
BrandForm.contextTypes = {
|
|
110
101
|
skin: Provider.childContextTypes.skin
|
|
@@ -132,8 +123,7 @@ BrandForm.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
132
123
|
title: PropTypes.string,
|
|
133
124
|
place: PropTypes.string
|
|
134
125
|
}),
|
|
135
|
-
isLoading: PropTypes.bool
|
|
136
|
-
theme: PropTypes.string
|
|
126
|
+
isLoading: PropTypes.bool
|
|
137
127
|
} : {};
|
|
138
128
|
export default BrandForm;
|
|
139
129
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaCompositionNavigationArrowLeft","ArrowLeft","BrandFormGroup","Provider","Button","
|
|
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};\n\nfunction 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 } = 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 );\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};\n\nexport default BrandForm;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,cAAP,MAA2B,iCAA3B;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CACzBC,QADyB,EAEzBC,WAFyB,EAGzBC,OAHyB,EAIzBC,UAJyB,EAKzBC,OALyB,EAMzBC,QANyB,EAOzBC,UAPyB,EAQzBC,SARyB,EASzBC,SATyB,KAUtB;EACH,IAAI,CAACR,QAAD,IAAa,CAACE,OAAlB,EAA2B;IACzB,OAAO,IAAP;EACD;;EAED,MAAMO,cAAc,GAAGJ,QAAQ,IA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,CAACiD,iBAAT,CAA2BpB;AADV,CAAzB;AAIAN,SAAS,CAAC2B,YAAV,GAAyB;EACvBxC,OAAO,EAAE;IACPO,KAAK,EAAE,EADA;IAEPkC,KAAK,EAAE;EAFA;AADc,CAAzB;AAOA5B,SAAS,CAAC6B,SAAV,2CAAsB;EACpB1B,MAAM,EAAE9B,SAAS,CAACyD,OAAV,CAAkBzD,SAAS,CAAC0D,KAAV,CAAgBvD,cAAc,CAACqD,SAA/B,CAAlB,EAA6DG,UADjD;EAEpB5C,QAAQ,EAAEf,SAAS,CAAC4D,IAFA;EAGpB5C,UAAU,EAAEhB,SAAS,CAAC4D,IAHF;EAIpB3C,SAAS,EAAEjB,SAAS,CAAC4D,IAJD;EAKpBlD,QAAQ,EAAEV,SAAS,CAAC6D,IALA;EAMpBlD,WAAW,EAAEN,MAAM,CAACmD,SAAP,CAAiB7C,WANV;EAOpBC,OAAO,EAAEZ,SAAS,CAAC6D,IAPC;EAQpBhD,UAAU,EAAER,MAAM,CAACmD,SAAP,CAAiB7C,WART;EASpBoB,IAAI,EAAE/B,SAAS,CAAC0D,KAAV,CAAgB;IACpBnB,IAAI,EAAEjC,IAAI,CAACkD,SAAL,CAAeM,QADD;IAEpBzB,IAAI,EAAE/B,IAAI,CAACkD,SAAL,CAAeO;EAFD,CAAhB,CATc;EAapBjD,OAAO,EAAEd,SAAS,CAAC0D,KAAV,CAAgB;IACvBrC,KAAK,EAAErB,SAAS,CAACgE,MADM;IAEvBT,KAAK,EAAEvD,SAAS,CAACgE;EAFM,CAAhB,CAbW;EAiBpBhC,SAAS,EAAEhC,SAAS,CAAC4D;AAjBD,CAAtB;AAoBA,eAAejC,SAAf"}
|
|
@@ -528,7 +528,6 @@ declare namespace WizardContents {
|
|
|
528
528
|
place: PropTypes.Requireable<string>;
|
|
529
529
|
}>>;
|
|
530
530
|
isLoading: PropTypes.Requireable<boolean>;
|
|
531
|
-
theme: PropTypes.Requireable<string>;
|
|
532
531
|
}> | PropTypes.InferProps<{
|
|
533
532
|
type: PropTypes.Requireable<string>;
|
|
534
533
|
languageTabs: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -613,7 +613,6 @@ declare namespace BrandUpdate {
|
|
|
613
613
|
place: PropTypes.Requireable<string>;
|
|
614
614
|
}>>;
|
|
615
615
|
isLoading: PropTypes.Requireable<boolean>;
|
|
616
|
-
theme: PropTypes.Requireable<string>;
|
|
617
616
|
}> | PropTypes.InferProps<{
|
|
618
617
|
key: PropTypes.Requireable<string>;
|
|
619
618
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AAiDA,kEA6EC"}
|
|
@@ -17,8 +17,6 @@ var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
|
17
17
|
|
|
18
18
|
var _button = _interopRequireDefault(require("../../atom/button"));
|
|
19
19
|
|
|
20
|
-
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
21
|
-
|
|
22
20
|
var _link = _interopRequireDefault(require("../../atom/link"));
|
|
23
21
|
|
|
24
22
|
var _loader = _interopRequireDefault(require("../../atom/loader"));
|
|
@@ -31,7 +29,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
29
|
|
|
32
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
31
|
|
|
34
|
-
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor
|
|
32
|
+
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor) => {
|
|
35
33
|
if (!onSubmit && !onReset) {
|
|
36
34
|
return null;
|
|
37
35
|
}
|
|
@@ -41,14 +39,7 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
|
|
|
41
39
|
"data-tip": tooltip.title,
|
|
42
40
|
"data-for": "submitButton",
|
|
43
41
|
className: _style.default.saveButton
|
|
44
|
-
},
|
|
45
|
-
type: "primary",
|
|
46
|
-
label: submitValue,
|
|
47
|
-
disabled: disabledSubmit,
|
|
48
|
-
"data-testid": "submit-button",
|
|
49
|
-
buttonType: "submit",
|
|
50
|
-
onClick: onSubmit
|
|
51
|
-
}) : /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
52
43
|
type: "submit",
|
|
53
44
|
disabled: disabledSubmit,
|
|
54
45
|
submitValue: submitValue
|
|
@@ -68,7 +59,7 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
|
|
|
68
59
|
}, submitButton, resetButton);
|
|
69
60
|
};
|
|
70
61
|
|
|
71
|
-
|
|
62
|
+
function BrandForm(props, context) {
|
|
72
63
|
const {
|
|
73
64
|
groups,
|
|
74
65
|
disabled,
|
|
@@ -80,8 +71,7 @@ const BrandForm = (props, context) => {
|
|
|
80
71
|
resetValue,
|
|
81
72
|
back,
|
|
82
73
|
tooltip,
|
|
83
|
-
isLoading
|
|
84
|
-
theme
|
|
74
|
+
isLoading
|
|
85
75
|
} = props;
|
|
86
76
|
const {
|
|
87
77
|
skin
|
|
@@ -104,7 +94,7 @@ const BrandForm = (props, context) => {
|
|
|
104
94
|
key: index
|
|
105
95
|
}, /*#__PURE__*/_react.default.createElement(_brandFormGroup.default, group));
|
|
106
96
|
});
|
|
107
|
-
const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor
|
|
97
|
+
const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor);
|
|
108
98
|
const handleSubmit = (0, _react.useMemo)(() => e => {
|
|
109
99
|
e.preventDefault();
|
|
110
100
|
return onSubmit(e);
|
|
@@ -123,7 +113,7 @@ const BrandForm = (props, context) => {
|
|
|
123
113
|
onReset: handleReset,
|
|
124
114
|
className: _style.default.form
|
|
125
115
|
}, brandGroups, buttonSection));
|
|
126
|
-
}
|
|
116
|
+
}
|
|
127
117
|
|
|
128
118
|
BrandForm.contextTypes = {
|
|
129
119
|
skin: _provider.default.childContextTypes.skin
|
|
@@ -151,8 +141,7 @@ BrandForm.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
151
141
|
title: _propTypes.default.string,
|
|
152
142
|
place: _propTypes.default.string
|
|
153
143
|
}),
|
|
154
|
-
isLoading: _propTypes.default.bool
|
|
155
|
-
theme: _propTypes.default.string
|
|
144
|
+
isLoading: _propTypes.default.bool
|
|
156
145
|
} : {};
|
|
157
146
|
var _default = BrandForm;
|
|
158
147
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","darkColor","
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","darkColor","disabledSubmit","submitButton","title","style","saveButton","cancelBackground","backgroundColor","resetButton","buttons","BrandForm","props","context","groups","back","isLoading","skin","backView","color","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","useMemo","e","preventDefault","handleReset","loaderContainer","loader","form","contextTypes","Provider","childContextTypes","defaultProps","place","propTypes","PropTypes","arrayOf","shape","BrandFormGroup","isRequired","bool","func","Button","Link","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};\n\nfunction 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 } = 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 );\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};\n\nexport default BrandForm;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CACzBC,QADyB,EAEzBC,WAFyB,EAGzBC,OAHyB,EAIzBC,UAJyB,EAKzBC,OALyB,EAMzBC,QANyB,EAOzBC,UAPyB,EAQzBC,SARyB,EASzBC,SATyB,KAUtB;EACH,IAAI,CAACR,QAAD,IAAa,CAACE,OAAlB,EAA2B;IACzB,OAAO,IAAP;EACD;;EAED,MAAMO,cAAc,GAAGJ,QAAQ,IAAIE,SAAZ,IAAyB,CAACD,UAAjD;EACA,MAAMI,YAAY,GAAGV,QAAQ,gBAC3B;IAAK,YAAUI,OAAO,CAACO,KAAvB;IAA8B,YAAS,cAAvC;IAAsD,SAAS,EAAEC,cAAA,CAAMC;EAAvE,gBACE,6BAAC,eAAD;IAAQ,IAAI,EAAC,QAAb;IAAsB,QAAQ,EAAEJ,cAAhC;IAAgD,WAAW,EAAER;EAA7D,EADF,CAD2B,GAIzB,IAJJ;EAMA,MAAMa,gBAAgB,GAAG;IAACC,eAAe,EAAEP;EAAlB,CAAzB;EAEA,MAAM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IAFA;EAGpBjD,UAAU,EAAE4C,kBAAA,CAAUK,IAHF;EAIpBhD,SAAS,EAAE2C,kBAAA,CAAUK,IAJD;EAKpBvD,QAAQ,EAAEkD,kBAAA,CAAUM,IALA;EAMpBvD,WAAW,EAAEwD,eAAA,CAAOR,SAAP,CAAiBhD,WANV;EAOpBC,OAAO,EAAEgD,kBAAA,CAAUM,IAPC;EAQpBrD,UAAU,EAAEsD,eAAA,CAAOR,SAAP,CAAiBhD,WART;EASpBqB,IAAI,EAAE4B,kBAAA,CAAUE,KAAV,CAAgB;IACpBtB,IAAI,EAAE4B,aAAA,CAAKT,SAAL,CAAeU,QADD;IAEpB/B,IAAI,EAAE8B,aAAA,CAAKT,SAAL,CAAeW;EAFD,CAAhB,CATc;EAapBxD,OAAO,EAAE8C,kBAAA,CAAUE,KAAV,CAAgB;IACvBzC,KAAK,EAAEuC,kBAAA,CAAUW,MADM;IAEvBb,KAAK,EAAEE,kBAAA,CAAUW;EAFM,CAAhB,CAbW;EAiBpBtC,SAAS,EAAE2B,kBAAA,CAAUK;AAjBD,CAAtB;eAoBerC,S"}
|
|
@@ -528,7 +528,6 @@ declare namespace WizardContents {
|
|
|
528
528
|
place: PropTypes.Requireable<string>;
|
|
529
529
|
}>>;
|
|
530
530
|
isLoading: PropTypes.Requireable<boolean>;
|
|
531
|
-
theme: PropTypes.Requireable<string>;
|
|
532
531
|
}> | PropTypes.InferProps<{
|
|
533
532
|
type: PropTypes.Requireable<string>;
|
|
534
533
|
languageTabs: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -613,7 +613,6 @@ declare namespace BrandUpdate {
|
|
|
613
613
|
place: PropTypes.Requireable<string>;
|
|
614
614
|
}>>;
|
|
615
615
|
isLoading: PropTypes.Requireable<boolean>;
|
|
616
|
-
theme: PropTypes.Requireable<string>;
|
|
617
616
|
}> | PropTypes.InferProps<{
|
|
618
617
|
key: PropTypes.Requireable<string>;
|
|
619
618
|
type: PropTypes.Requireable<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.15.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"Soualmi Djamel <djamel.soualmi@coorpacademy.com>"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@coorpacademy/nova-icons": "4.2.
|
|
59
|
+
"@coorpacademy/nova-icons": "4.2.6",
|
|
60
60
|
"@coorpacademy/react-native-animation": "1.0.3",
|
|
61
61
|
"@jwplayer/jwplayer-react": "^1.1.0",
|
|
62
62
|
"@types/react": "^17.0.50",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"last 2 versions",
|
|
169
169
|
"IE 11"
|
|
170
170
|
],
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "d792c7ca70b4c7609ade4bcf99c989bae004f073"
|
|
172
172
|
}
|
package/locales/.mtslconfig.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ignore_dirs":[]}
|