@coorpacademy/components 11.19.1-alpha.4 → 11.19.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/atom/button-link/index.js +2 -2
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +1 -0
- package/es/atom/drag-and-drop/index.d.ts +1 -0
- package/es/atom/drag-and-drop/index.d.ts.map +1 -1
- package/es/atom/drag-and-drop/index.js +24 -6
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +22 -7
- package/es/atom/{image-upload → input-file-draggable}/index.d.ts +10 -5
- package/es/atom/input-file-draggable/index.d.ts.map +1 -0
- package/es/atom/{image-upload → input-file-draggable}/index.js +34 -11
- package/es/atom/input-file-draggable/index.js.map +1 -0
- package/es/atom/input-file-draggable/style.css +81 -0
- package/es/atom/title/style.css +1 -1
- package/es/atom/video-upload/index.d.ts +1 -0
- package/es/molecule/brand-form-group/index.js +5 -5
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +2 -6
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +2 -2
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +27 -20
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +112 -73
- package/es/molecule/cm-popin/types.d.ts +182 -5
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +5 -3
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/drag-and-drop-wrapper/index.d.ts +2 -1
- package/es/molecule/drag-and-drop-wrapper/index.js +3 -3
- package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -1
- package/es/molecule/setup-slider/index.js +3 -3
- package/es/molecule/setup-slider/index.js.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -1
- package/es/molecule/title-radio-wrapper/index.d.ts +18 -17
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/index.js +2 -2
- package/es/molecule/title-radio-wrapper/index.js.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +20 -19
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.js +2 -2
- package/es/molecule/title-radio-wrapper/types.js.map +1 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +2 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +3 -7
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +1 -3
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/list-items/style.css +1 -4
- package/es/organism/rewards-form/index.d.ts +2 -1
- package/es/organism/select-opponents/index.d.ts +18 -17
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +18 -17
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/setup-header/style.css +3 -1
- package/es/organism/title-and-input/index.d.ts +18 -17
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +18 -17
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -1
- package/es/template/app-player/loading/index.d.ts +178 -2
- package/es/template/app-player/player/index.d.ts +356 -4
- package/es/template/app-player/player/slides/index.d.ts +178 -2
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +178 -2
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +178 -2
- package/es/template/app-review/index.d.ts +178 -2
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +178 -2
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +178 -2
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +178 -2
- package/es/template/cockpit/jw-uploader/index.d.ts +1 -0
- package/es/template/common/dashboard/index.d.ts +356 -4
- package/es/template/common/search-page/index.d.ts +178 -2
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +2 -20
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/external-course/index.d.ts +178 -2
- package/es/util/proptypes.d.ts +1 -1
- package/es/util/proptypes.d.ts.map +1 -1
- package/es/util/proptypes.js +6 -5
- package/es/util/proptypes.js.map +1 -1
- package/lib/atom/button-link/index.js +2 -2
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +1 -0
- package/lib/atom/drag-and-drop/index.d.ts +1 -0
- package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
- package/lib/atom/drag-and-drop/index.js +24 -6
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +22 -7
- package/lib/atom/{image-upload → input-file-draggable}/index.d.ts +10 -5
- package/lib/atom/input-file-draggable/index.d.ts.map +1 -0
- package/lib/atom/{image-upload → input-file-draggable}/index.js +34 -10
- package/lib/atom/input-file-draggable/index.js.map +1 -0
- package/lib/atom/input-file-draggable/style.css +81 -0
- package/lib/atom/title/style.css +1 -1
- package/lib/atom/video-upload/index.d.ts +1 -0
- package/lib/molecule/brand-form-group/index.js +5 -5
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +2 -6
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +2 -2
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +29 -19
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +112 -73
- package/lib/molecule/cm-popin/types.d.ts +182 -5
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +6 -3
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/drag-and-drop-wrapper/index.d.ts +2 -1
- package/lib/molecule/drag-and-drop-wrapper/index.js +3 -3
- package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -1
- package/lib/molecule/setup-slider/index.js +3 -3
- package/lib/molecule/setup-slider/index.js.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -1
- package/lib/molecule/title-radio-wrapper/index.d.ts +18 -17
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/index.js +2 -2
- package/lib/molecule/title-radio-wrapper/index.js.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +20 -19
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.js +2 -2
- package/lib/molecule/title-radio-wrapper/types.js.map +1 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +3 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +3 -7
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +1 -3
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/list-items/style.css +1 -4
- package/lib/organism/rewards-form/index.d.ts +2 -1
- package/lib/organism/select-opponents/index.d.ts +18 -17
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +18 -17
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/setup-header/style.css +3 -1
- package/lib/organism/title-and-input/index.d.ts +18 -17
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +18 -17
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -1
- package/lib/template/app-player/loading/index.d.ts +178 -2
- package/lib/template/app-player/player/index.d.ts +356 -4
- package/lib/template/app-player/player/slides/index.d.ts +178 -2
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +178 -2
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +178 -2
- package/lib/template/app-review/index.d.ts +178 -2
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +178 -2
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +178 -2
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +178 -2
- package/lib/template/cockpit/jw-uploader/index.d.ts +1 -0
- package/lib/template/common/dashboard/index.d.ts +356 -4
- package/lib/template/common/search-page/index.d.ts +178 -2
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +2 -24
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/external-course/index.d.ts +178 -2
- package/lib/util/proptypes.d.ts +1 -1
- package/lib/util/proptypes.d.ts.map +1 -1
- package/lib/util/proptypes.js +10 -7
- package/lib/util/proptypes.js.map +1 -1
- package/package.json +3 -3
- package/es/atom/image-upload/index.d.ts.map +0 -1
- package/es/atom/image-upload/index.js.map +0 -1
- package/es/atom/image-upload/style.css +0 -28
- package/lib/atom/image-upload/index.d.ts.map +0 -1
- package/lib/atom/image-upload/index.js.map +0 -1
- package/lib/atom/image-upload/style.css +0 -28
|
@@ -7,7 +7,7 @@ var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
|
7
7
|
|
|
8
8
|
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
9
|
|
|
10
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
|
@@ -25,10 +25,6 @@ var _cmPopin = _interopRequireDefault(require("../../../molecule/cm-popin"));
|
|
|
25
25
|
|
|
26
26
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
27
27
|
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
-
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
-
|
|
32
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
29
|
|
|
34
30
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -51,22 +47,6 @@ const SearchPage = (props, context) => {
|
|
|
51
47
|
skin
|
|
52
48
|
} = context;
|
|
53
49
|
const defaultColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
54
|
-
const nodeRef = (0, _react.useRef)(null);
|
|
55
|
-
const closePopin = (0, _react.useCallback)(e => {
|
|
56
|
-
// eslint-disable-next-line no-console
|
|
57
|
-
console.log(nodeRef);
|
|
58
|
-
|
|
59
|
-
if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {
|
|
60
|
-
// eslint-disable-next-line no-console
|
|
61
|
-
console.log('closePopin function called');
|
|
62
|
-
}
|
|
63
|
-
}, []);
|
|
64
|
-
(0, _react.useEffect)(() => {
|
|
65
|
-
document.addEventListener('click', closePopin);
|
|
66
|
-
return () => {
|
|
67
|
-
document.removeEventListener('click', closePopin);
|
|
68
|
-
};
|
|
69
|
-
}, [closePopin]);
|
|
70
50
|
const recommendationsView = (0, _isEmpty2.default)(recommendations) ? null : /*#__PURE__*/_react.default.createElement(_cardsList.default, recommendations);
|
|
71
51
|
const cardsView = (0, _isEmpty2.default)(cards.list) ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
72
52
|
className: _style.default.noresults
|
|
@@ -80,9 +60,7 @@ const SearchPage = (props, context) => {
|
|
|
80
60
|
},
|
|
81
61
|
type: "link"
|
|
82
62
|
}))), recommendationsView) : /*#__PURE__*/_react.default.createElement(_cardsGrid.default, cards);
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
-
ref: nodeRef
|
|
85
|
-
}, /*#__PURE__*/_react.default.createElement(_filters.default, _extends({}, searchFilters, {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_filters.default, _extends({}, searchFilters, {
|
|
86
64
|
moreSortAriaLabel: moreSortAriaLabel,
|
|
87
65
|
moreFilterAriaLabel: moreFilterAriaLabel,
|
|
88
66
|
filterGroupAriaLabel: filterGroupAriaLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","recommendationsView","cardsView","list","style","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","Filters","CardsGrid","Button","CardsList","CMPopin"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,KADI;IAEJC,aAFI;IAGJC,KAHI;IAIJC,cAJI;IAKJC,YALI;IAMJC,eANI;IAOJC,iBAPI;IAQJC,mBARI;IASJC,oBATI;IAUJC,aAVI;IAWJC;EAXI,IAYFZ,KAZJ;EAcA,MAAM;IAACa;EAAD,IAASZ,OAAf;EACA,MAAMa,YAAY,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;EAEA,MAAME,mBAAmB,GAAG,uBAAQR,eAAR,IAA2B,IAA3B,gBAAkC,6BAAC,kBAAD,EAAeA,eAAf,CAA9D;EAEA,MAAMS,SAAS,GAAG,uBAAQZ,KAAK,CAACa,IAAd,iBAChB,uDACE;IAAK,SAAS,EAAEC,cAAA,CAAMC;EAAtB,gBACE;IAAK,SAAS,EAAED,cAAA,CAAME;EAAtB,GAAqCf,cAArC,CADF,eAEE,6BAAC,eAAD,eACMC,YADN;IAEE,aA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,kBAAA,CAAUC,MAPR;EAQrBpB,mBAAmB,EAAEmB,kBAAA,CAAUC,MARV;EASrBnB,oBAAoB,EAAEkB,kBAAA,CAAUC,MATX;EAUrBlB,aAAa,EAAEiB,kBAAA,CAAUC,MAVJ;EAWrBjB,cAAc,EAAEgB,kBAAA,CAAUE,KAAV,CAAgBK,gBAAA,CAAQR,SAAxB;AAXK,CAAvB;eAce5B,U"}
|
|
@@ -66,6 +66,7 @@ declare namespace ExternalCourse {
|
|
|
66
66
|
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
67
67
|
descriptionText: PropTypes.Requireable<string>;
|
|
68
68
|
cookieTitle: PropTypes.Requireable<string>;
|
|
69
|
+
headerSubtitle: PropTypes.Requireable<string>;
|
|
69
70
|
descriptionBtnTxt: PropTypes.Requireable<string>;
|
|
70
71
|
listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
71
72
|
title: PropTypes.Requireable<string>;
|
|
@@ -86,10 +87,185 @@ declare namespace ExternalCourse {
|
|
|
86
87
|
}> | null | undefined)[]>;
|
|
87
88
|
items: PropTypes.Requireable<PropTypes.InferProps<{
|
|
88
89
|
type: PropTypes.Requireable<string>;
|
|
89
|
-
list: PropTypes.Requireable<PropTypes.InferProps<{
|
|
90
|
+
list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
90
91
|
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
91
92
|
loading: PropTypes.Requireable<boolean>;
|
|
92
|
-
}
|
|
93
|
+
}> | PropTypes.InferProps<{
|
|
94
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
95
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
96
|
+
type: PropTypes.Requireable<string>;
|
|
97
|
+
label: PropTypes.Requireable<string>;
|
|
98
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
99
|
+
'data-name': PropTypes.Requireable<string>;
|
|
100
|
+
'data-testid': PropTypes.Requireable<string>;
|
|
101
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
102
|
+
position: PropTypes.Requireable<string>;
|
|
103
|
+
type: PropTypes.Requireable<string>;
|
|
104
|
+
}>>;
|
|
105
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
106
|
+
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
107
|
+
href: PropTypes.Requireable<string>;
|
|
108
|
+
download: PropTypes.Requireable<boolean>;
|
|
109
|
+
target: PropTypes.Requireable<string>;
|
|
110
|
+
}>>;
|
|
111
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
112
|
+
className: PropTypes.Requireable<string>;
|
|
113
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
114
|
+
}>>;
|
|
115
|
+
selectMultiple: PropTypes.Requireable<PropTypes.InferProps<{
|
|
116
|
+
title: PropTypes.Requireable<string>;
|
|
117
|
+
placeholder: PropTypes.Requireable<string>;
|
|
118
|
+
description: PropTypes.Requireable<string>;
|
|
119
|
+
hint: PropTypes.Requireable<string>;
|
|
120
|
+
options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
121
|
+
selected: PropTypes.Validator<boolean>;
|
|
122
|
+
name: PropTypes.Validator<string>;
|
|
123
|
+
value: PropTypes.Requireable<string>;
|
|
124
|
+
}>>[]>;
|
|
125
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
126
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
127
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
128
|
+
modified: PropTypes.Requireable<boolean>;
|
|
129
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
130
|
+
error: PropTypes.Requireable<string>;
|
|
131
|
+
theme: PropTypes.Requireable<string>;
|
|
132
|
+
}>>;
|
|
133
|
+
content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
134
|
+
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
135
|
+
title: PropTypes.Validator<string>;
|
|
136
|
+
dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
137
|
+
label: PropTypes.Requireable<string>;
|
|
138
|
+
type: PropTypes.Requireable<string>;
|
|
139
|
+
className: PropTypes.Requireable<string>;
|
|
140
|
+
}> | null | undefined)[]>;
|
|
141
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
142
|
+
type: PropTypes.Requireable<string>;
|
|
143
|
+
label: PropTypes.Requireable<string>;
|
|
144
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
145
|
+
dataName: PropTypes.Requireable<string>;
|
|
146
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
147
|
+
position: PropTypes.Requireable<string>;
|
|
148
|
+
type: PropTypes.Requireable<string>;
|
|
149
|
+
}>>;
|
|
150
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
151
|
+
}>>;
|
|
152
|
+
buttonLinkIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
153
|
+
size: PropTypes.Requireable<string>;
|
|
154
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
155
|
+
'data-name': PropTypes.Requireable<string>;
|
|
156
|
+
icon: PropTypes.Requireable<string>;
|
|
157
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
158
|
+
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
159
|
+
href: PropTypes.Requireable<string>;
|
|
160
|
+
download: PropTypes.Requireable<boolean>;
|
|
161
|
+
target: PropTypes.Requireable<string>;
|
|
162
|
+
}>>;
|
|
163
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
164
|
+
className: PropTypes.Requireable<string>;
|
|
165
|
+
}>>;
|
|
166
|
+
bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
167
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
168
|
+
menuAriaLabel: PropTypes.Requireable<string>;
|
|
169
|
+
buttons: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
170
|
+
'data-name': PropTypes.Requireable<string>;
|
|
171
|
+
label: PropTypes.Requireable<string>;
|
|
172
|
+
type: PropTypes.Requireable<string>;
|
|
173
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
174
|
+
}> | null | undefined)[]>;
|
|
175
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
176
|
+
}>>;
|
|
177
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
178
|
+
label: PropTypes.Requireable<string>;
|
|
179
|
+
type: PropTypes.Requireable<string>;
|
|
180
|
+
}> | null | undefined)[]>;
|
|
181
|
+
isBulkStyle: PropTypes.Requireable<boolean>;
|
|
182
|
+
order: PropTypes.Requireable<number>;
|
|
183
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
184
|
+
contentType: PropTypes.Requireable<string>;
|
|
185
|
+
id: PropTypes.Requireable<string>;
|
|
186
|
+
}> | null | undefined)[]>;
|
|
187
|
+
type: PropTypes.Requireable<string>;
|
|
188
|
+
itemType: PropTypes.Requireable<string>;
|
|
189
|
+
onDrop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
190
|
+
isDraggable: PropTypes.Requireable<boolean>;
|
|
191
|
+
tableHeader: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
192
|
+
}> | PropTypes.InferProps<{
|
|
193
|
+
type: PropTypes.Requireable<string>;
|
|
194
|
+
columns: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
195
|
+
title: PropTypes.Validator<string>;
|
|
196
|
+
}> | null | undefined)[]>;
|
|
197
|
+
rows: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
198
|
+
fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
|
|
199
|
+
type: PropTypes.Requireable<string>;
|
|
200
|
+
current: PropTypes.Requireable<boolean>;
|
|
201
|
+
selected: PropTypes.Requireable<boolean>;
|
|
202
|
+
icon: PropTypes.Requireable<string>;
|
|
203
|
+
value: PropTypes.Requireable<string>;
|
|
204
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
205
|
+
isRowExpandible: PropTypes.Requireable<boolean>;
|
|
206
|
+
lastField: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
207
|
+
type: PropTypes.Requireable<string>;
|
|
208
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
209
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
210
|
+
menuAriaLabel: PropTypes.Requireable<string>;
|
|
211
|
+
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
212
|
+
'data-name': PropTypes.Requireable<string>;
|
|
213
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
214
|
+
label: PropTypes.Validator<string>;
|
|
215
|
+
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
216
|
+
type: PropTypes.Requireable<string>;
|
|
217
|
+
}> | null | undefined)[]>;
|
|
218
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
219
|
+
menuButtonClassName: PropTypes.Requireable<string>;
|
|
220
|
+
isBulkMenu: PropTypes.Requireable<boolean>;
|
|
221
|
+
}> | null | undefined>>;
|
|
222
|
+
}> | null | undefined)[]>;
|
|
223
|
+
stickyFirstColumn: PropTypes.Requireable<boolean>;
|
|
224
|
+
stickyLastColumn: PropTypes.Requireable<boolean>;
|
|
225
|
+
columnWidth: PropTypes.Requireable<string>;
|
|
226
|
+
ariaDescribedby: PropTypes.Requireable<string>;
|
|
227
|
+
lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
228
|
+
componentType: PropTypes.Requireable<string>;
|
|
229
|
+
type: PropTypes.Requireable<string>;
|
|
230
|
+
label: PropTypes.Requireable<string>;
|
|
231
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
232
|
+
'data-name': PropTypes.Requireable<string>;
|
|
233
|
+
'data-testid': PropTypes.Requireable<string>;
|
|
234
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
235
|
+
position: PropTypes.Requireable<string>;
|
|
236
|
+
type: PropTypes.Requireable<string>;
|
|
237
|
+
}>>;
|
|
238
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
239
|
+
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
240
|
+
href: PropTypes.Requireable<string>;
|
|
241
|
+
download: PropTypes.Requireable<boolean>;
|
|
242
|
+
target: PropTypes.Requireable<string>;
|
|
243
|
+
}>>;
|
|
244
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
245
|
+
className: PropTypes.Requireable<string>;
|
|
246
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
247
|
+
}> | PropTypes.InferProps<{
|
|
248
|
+
componentType: PropTypes.Requireable<string>;
|
|
249
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
250
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
251
|
+
menuAriaLabel: PropTypes.Requireable<string>;
|
|
252
|
+
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
253
|
+
'data-name': PropTypes.Requireable<string>;
|
|
254
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
255
|
+
label: PropTypes.Validator<string>;
|
|
256
|
+
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
257
|
+
type: PropTypes.Requireable<string>;
|
|
258
|
+
}> | null | undefined)[]>;
|
|
259
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
260
|
+
menuButtonClassName: PropTypes.Requireable<string>;
|
|
261
|
+
isBulkMenu: PropTypes.Requireable<boolean>;
|
|
262
|
+
}> | null | undefined>>;
|
|
263
|
+
isNestedTable: PropTypes.Requireable<boolean>;
|
|
264
|
+
emptyStateFirstMessage: PropTypes.Requireable<string>;
|
|
265
|
+
emptyStateSecondMessage: PropTypes.Requireable<string>;
|
|
266
|
+
}> | null | undefined>>;
|
|
267
|
+
title: PropTypes.Requireable<string>;
|
|
268
|
+
}> | null | undefined>>;
|
|
93
269
|
}>>;
|
|
94
270
|
}>>;
|
|
95
271
|
}
|
package/lib/util/proptypes.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const UrlPropType: any;
|
|
2
2
|
export const PathPropType: any;
|
|
3
3
|
export const SrcPropType: PropTypes.Requireable<any>;
|
|
4
|
-
export function
|
|
4
|
+
export function FilesPropType(props: any, propName: any, componentName: any): Error | null;
|
|
5
5
|
export const ColorPropType: any;
|
|
6
6
|
export const HexPropType: any;
|
|
7
7
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proptypes.d.ts","sourceRoot":"","sources":["../../src/util/proptypes.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proptypes.d.ts","sourceRoot":"","sources":["../../src/util/proptypes.js"],"names":[],"mappings":"AAcA,8BAAsD;AAGtD,+BAAwD;AAExD,qDAA4E;AAErE,2FAoBN;AAED,gCAA4C;AAC5C,8BAAwC"}
|
package/lib/util/proptypes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.UrlPropType = exports.SrcPropType = exports.PathPropType = exports.
|
|
4
|
+
exports.UrlPropType = exports.SrcPropType = exports.PathPropType = exports.HexPropType = exports.FilesPropType = exports.ColorPropType = void 0;
|
|
5
5
|
|
|
6
6
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
7
|
|
|
@@ -19,6 +19,10 @@ var _color = _interopRequireDefault(require("extended-proptypes/lib/validators/c
|
|
|
19
19
|
|
|
20
20
|
var _hex = _interopRequireDefault(require("extended-proptypes/lib/validators/hex"));
|
|
21
21
|
|
|
22
|
+
var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
23
|
+
|
|
24
|
+
var _head = _interopRequireDefault(require("lodash/fp/head"));
|
|
25
|
+
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
27
|
|
|
24
28
|
const URL_REGEXP = /^(http(s)?:\/\/.)[-a-zA-Z0-9@:%._\\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
|
|
@@ -32,17 +36,16 @@ const SrcPropType = _propTypes.default.oneOfType([UrlPropType, PathPropType]);
|
|
|
32
36
|
|
|
33
37
|
exports.SrcPropType = SrcPropType;
|
|
34
38
|
|
|
35
|
-
const
|
|
36
|
-
const
|
|
39
|
+
const FilesPropType = (props, propName, componentName) => {
|
|
40
|
+
const validFilesTypes = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/*', 'application/pdf', 'application/zip', 'text/csv'];
|
|
37
41
|
const propValue = props[propName];
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const isValid = (0, _every.default)(type => (0, _includes.default)((0, _trim.default)(type), validImageTypes), imageTypes);
|
|
42
|
+
const filesTypes = (0, _split.default)(',', propValue);
|
|
43
|
+
const isValid = (0, _isEmpty.default)((0, _head.default)(filesTypes)) || (0, _every.default)(type => (0, _includes.default)((0, _trim.default)(type), validFilesTypes), filesTypes);
|
|
41
44
|
if (isValid) return null;
|
|
42
45
|
return new Error(`Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`);
|
|
43
46
|
};
|
|
44
47
|
|
|
45
|
-
exports.
|
|
48
|
+
exports.FilesPropType = FilesPropType;
|
|
46
49
|
const ColorPropType = _color.default;
|
|
47
50
|
exports.ColorPropType = ColorPropType;
|
|
48
51
|
const HexPropType = _hex.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proptypes.js","names":["URL_REGEXP","UrlPropType","stringMatching","PATH_REGEXP","PathPropType","SrcPropType","PropTypes","oneOfType","
|
|
1
|
+
{"version":3,"file":"proptypes.js","names":["URL_REGEXP","UrlPropType","stringMatching","PATH_REGEXP","PathPropType","SrcPropType","PropTypes","oneOfType","FilesPropType","props","propName","componentName","validFilesTypes","propValue","filesTypes","split","isValid","isEmpty","head","every","type","includes","trim","Error","ColorPropType","_ColorPropType","HexPropType","_HexPropType"],"sources":["../../src/util/proptypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport split from 'lodash/fp/split';\nimport trim from 'lodash/fp/trim';\nimport includes from 'lodash/fp/includes';\nimport every from 'lodash/fp/every';\nimport stringMatching from 'extended-proptypes/lib/validators/stringMatching';\n\nimport _ColorPropType from 'extended-proptypes/lib/validators/color';\nimport _HexPropType from 'extended-proptypes/lib/validators/hex';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport head from 'lodash/fp/head';\n\nconst URL_REGEXP =\n /^(http(s)?:\\/\\/.)[-a-zA-Z0-9@:%._\\\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const UrlPropType = stringMatching(URL_REGEXP);\n\nconst PATH_REGEXP = /^\\/([-a-zA-Z0-9@:%_\\\\+.~#?&//=]*)$/;\nexport const PathPropType = stringMatching(PATH_REGEXP);\n\nexport const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);\n\nexport const FilesPropType = (props, propName, componentName) => {\n const validFilesTypes = [\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/*',\n 'application/pdf',\n 'application/zip',\n 'text/csv'\n ];\n\n const propValue = props[propName];\n const filesTypes = split(',', propValue);\n const isValid =\n isEmpty(head(filesTypes)) || every(type => includes(trim(type), validFilesTypes), filesTypes);\n if (isValid) return null;\n\n return new Error(\n `Invalid prop value: ${propValue}, at component: ${componentName}. Expected a valid image type: image/jpeg, image/png, image/* image/svg+xml or application/pdf.`\n );\n};\n\nexport const ColorPropType = _ColorPropType;\nexport const HexPropType = _HexPropType;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,UAAU,GACd,8FADF;AAEO,MAAMC,WAAW,GAAG,IAAAC,uBAAA,EAAeF,UAAf,CAApB;;AAEP,MAAMG,WAAW,GAAG,oCAApB;AACO,MAAMC,YAAY,GAAG,IAAAF,uBAAA,EAAeC,WAAf,CAArB;;;AAEA,MAAME,WAAW,GAAGC,kBAAA,CAAUC,SAAV,CAAoB,CAACN,WAAD,EAAcG,YAAd,CAApB,CAApB;;;;AAEA,MAAMI,aAAa,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,aAAlB,KAAoC;EAC/D,MAAMC,eAAe,GAAG,CACtB,YADsB,EAEtB,WAFsB,EAGtB,eAHsB,EAItB,SAJsB,EAKtB,iBALsB,EAMtB,iBANsB,EAOtB,UAPsB,CAAxB;EAUA,MAAMC,SAAS,GAAGJ,KAAK,CAACC,QAAD,CAAvB;EACA,MAAMI,UAAU,GAAG,IAAAC,cAAA,EAAM,GAAN,EAAWF,SAAX,CAAnB;EACA,MAAMG,OAAO,GACX,IAAAC,gBAAA,EAAQ,IAAAC,aAAA,EAAKJ,UAAL,CAAR,KAA6B,IAAAK,cAAA,EAAMC,IAAI,IAAI,IAAAC,iBAAA,EAAS,IAAAC,aAAA,EAAKF,IAAL,CAAT,EAAqBR,eAArB,CAAd,EAAqDE,UAArD,CAD/B;EAEA,IAAIE,OAAJ,EAAa,OAAO,IAAP;EAEb,OAAO,IAAIO,KAAJ,CACJ,uBAAsBV,SAAU,mBAAkBF,aAAc,iGAD5D,CAAP;AAGD,CApBM;;;AAsBA,MAAMa,aAAa,GAAGC,cAAtB;;AACA,MAAMC,WAAW,GAAGC,YAApB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.19.1
|
|
3
|
+
"version": "11.19.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.4.
|
|
59
|
+
"@coorpacademy/nova-icons": "4.4.1",
|
|
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": "1d40f5af230ef1d8b92b966561aed6da8360b7e4"
|
|
172
172
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;;;gBAiFC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","DragAndDrop","Link","ImagePropType","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","pdfButtonLabel","pdfButtonAriaLabel","handleReset","e","preventDefault","linkCustomStyle","width","color","onDragStart","onDragStop","input","templateLink","href","download","propTypes","string","func"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport Link from '../button-link';\nimport {ImagePropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n labelLink,\n labelButtonLink,\n hrefLink,\n imageTypes = 'image/*',\n error = '',\n buttonAriaLabel,\n errorButtonLabel,\n pdfButtonLabel,\n pdfButtonAriaLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const linkCustomStyle = {\n width: '40px',\n color: '#FF541F'\n };\n\n return (\n <>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n pdfButtonLabel={pdfButtonLabel}\n pdfButtonAriaLabel={pdfButtonAriaLabel}\n >\n {(onDragStart, onDragStop) => (\n <input\n type=\"file\"\n name={name}\n accept={imageTypes}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <Link\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n </>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: ImagePropType,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAAC;EACnBC,KAD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,QAAQ,EAAEpB,QANZ;IAOE,WAAW,EAAEkB,WAPf;IAQE,MAAM,EAAEC,UARV;IASE,WAAW,EAAEA;EATf,EAjBJ,CADF,EA+BGhB,SAAS,IAAIE,QAAb,gBACC;IAAK,SAAS,EAAEf,KAAK,CAAC+B;EAAtB,GACGlB,SADH,eAEE,oBAAC,IAAD;IACE,IAAI,EAAC,MADP;IAEE,WAAW,EAAEY,eAFf;IAGE,IAAI,EAAE;MAACO,IAAI,EAAEjB,QAAP;MAAiBkB,QAAQ,EAAE;IAA3B,CAHR;IAIE,KAAK,EAAEnB;EAJT,EAFF,CADD,GAUG,IAzCN,CADF;AA6CD,CAjFD;;AAmFAb,WAAW,CAACiC,SAAZ,wDACKrC,WAAW,CAACqC,SADjB;EAEEtB,IAAI,EAAEhB,SAAS,CAACuC,MAFlB;EAGEzB,QAAQ,EAAEd,SAAS,CAACwC,IAHtB;EAIEzB,OAAO,EAAEf,SAAS,CAACwC,IAJrB;EAKEpB,UAAU,EAAEjB,aALd;EAMEkB,KAAK,EAAErB,SAAS,CAACuC,MANnB;EAOEjB,eAAe,EAAEtB,SAAS,CAACuC,MAP7B;EAQEhB,gBAAgB,EAAEvB,SAAS,CAACuC,MAR9B;EASEtB,SAAS,EAAEjB,SAAS,CAACuC,MATvB;EAUEpB,QAAQ,EAAEnB,SAAS,CAACuC;AAVtB;AAaA,eAAelC,WAAf"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
@value colors: "../../variables/colors.css";
|
|
2
|
-
@value cm_grey_50 from colors;
|
|
3
|
-
|
|
4
|
-
.input {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
opacity: 0;
|
|
9
|
-
margin: auto;
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
bottom: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.templateLink {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
text-align: center;
|
|
22
|
-
margin-top: 16px;
|
|
23
|
-
background-color: cm_grey_50;
|
|
24
|
-
padding: 16px 0 16px 0;
|
|
25
|
-
border-radius: 10px;
|
|
26
|
-
font-family: "Gilroy";
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;;;gBAiFC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","pdfButtonLabel","pdfButtonAriaLabel","handleReset","useCallback","e","preventDefault","linkCustomStyle","width","color","onDragStart","onDragStop","style","input","templateLink","href","download","propTypes","DragAndDrop","PropTypes","string","func","ImagePropType"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport Link from '../button-link';\nimport {ImagePropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n labelLink,\n labelButtonLink,\n hrefLink,\n imageTypes = 'image/*',\n error = '',\n buttonAriaLabel,\n errorButtonLabel,\n pdfButtonLabel,\n pdfButtonAriaLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const linkCustomStyle = {\n width: '40px',\n color: '#FF541F'\n };\n\n return (\n <>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n pdfButtonLabel={pdfButtonLabel}\n pdfButtonAriaLabel={pdfButtonAriaLabel}\n >\n {(onDragStart, onDragStop) => (\n <input\n type=\"file\"\n name={name}\n accept={imageTypes}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <Link\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n </>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: ImagePropType,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,WAAW,GAAG,CAAC;EACnBC,KADmB;EAEnBC,WAFmB;EAGnBC,YAHmB;EAInBC,cAJmB;EAKnBC,WALmB;EAMnBC,OANmB;EAOnBC,QAPmB;EAQnBC,QAAQ,GAAG,KARQ;EASnBC,QATmB;EAUnBC,OAAO,GAAG,IAVS;EAWnBC,IAXmB;EAYnBC,SAZmB;EAanBC,eAbmB;EAcnBC,QAdmB;EAenBC,UAAU,GAAG,SAfM;EAgBnBC,KAAK,GAAG,EAhBW;EAiBnBC,eAjBmB;EAkBnBC,gBAlBmB;EAmBnBC,cAn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EAAE;IAA3B,CAHR;IAIE,KAAK,EAAErB;EAJT,EAFF,CADD,GAUG,IAzCN,CADF;AA6CD,CAjFD;;AAmFAb,WAAW,CAACmC,SAAZ,wDACKC,oBAAA,CAAYD,SADjB;EAEExB,IAAI,EAAE0B,kBAAA,CAAUC,MAFlB;EAGE7B,QAAQ,EAAE4B,kBAAA,CAAUE,IAHtB;EAIE7B,OAAO,EAAE2B,kBAAA,CAAUE,IAJrB;EAKExB,UAAU,EAAEyB,wBALd;EAMExB,KAAK,EAAEqB,kBAAA,CAAUC,MANnB;EAOErB,eAAe,EAAEoB,kBAAA,CAAUC,MAP7B;EAQEpB,gBAAgB,EAAEmB,kBAAA,CAAUC,MAR9B;EASE1B,SAAS,EAAEyB,kBAAA,CAAUC,MATvB;EAUExB,QAAQ,EAAEuB,kBAAA,CAAUC;AAVtB;eAaetC,W"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
@value colors: "../../variables/colors.css";
|
|
2
|
-
@value cm_grey_50 from colors;
|
|
3
|
-
|
|
4
|
-
.input {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
opacity: 0;
|
|
9
|
-
margin: auto;
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
bottom: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.templateLink {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
text-align: center;
|
|
22
|
-
margin-top: 16px;
|
|
23
|
-
background-color: cm_grey_50;
|
|
24
|
-
padding: 16px 0 16px 0;
|
|
25
|
-
border-radius: 10px;
|
|
26
|
-
font-family: "Gilroy";
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
}
|