@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CMPopin","style","SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","recommendationsView","cardsView","list","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","childContextTypes","propTypes","string","shape"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,MAAP,MAAmB,sBAAnB;AACA,OAAOC,OAAP,MAAoB,2BAApB;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;EAEA,MAAME,mBAAmB,GAAG,SAAQR,eAAR,IAA2B,IAA3B,gBAAkC,oBAAC,SAAD,EAAeA,eAAf,CAA9D;EAEA,MAAMS,SAAS,GAAG,SAAQZ,KAAK,CAACa,IAAd,iBAChB,8CACE;IAAK,SAAS,EAAEnB,KAAK,CAACoB;EAAtB,gBACE;IAAK,SAAS,EAAEpB,KAAK,CAACqB;EAAtB,GAAqCd,cAArC,CADF,eAEE,oBA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BAAiB,EAAEjB,SAAS,CAACmC,MAPR;EAQrBjB,mBAAmB,EAAElB,SAAS,CAACmC,MARV;EASrBhB,oBAAoB,EAAEnB,SAAS,CAACmC,MATX;EAUrBf,aAAa,EAAEpB,SAAS,CAACmC,MAVJ;EAWrBd,cAAc,EAAErB,SAAS,CAACoC,KAAV,CAAgB9B,OAAO,CAAC4B,SAAxB;AAXK,CAAvB;AAcA,eAAe1B,UAAf"}
|
|
@@ -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/es/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/es/util/proptypes.js
CHANGED
|
@@ -6,17 +6,18 @@ import every from 'lodash/fp/every';
|
|
|
6
6
|
import stringMatching from 'extended-proptypes/lib/validators/stringMatching';
|
|
7
7
|
import _ColorPropType from 'extended-proptypes/lib/validators/color';
|
|
8
8
|
import _HexPropType from 'extended-proptypes/lib/validators/hex';
|
|
9
|
+
import isEmpty from 'lodash/fp/isEmpty';
|
|
10
|
+
import head from 'lodash/fp/head';
|
|
9
11
|
const URL_REGEXP = /^(http(s)?:\/\/.)[-a-zA-Z0-9@:%._\\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
|
|
10
12
|
export const UrlPropType = stringMatching(URL_REGEXP);
|
|
11
13
|
const PATH_REGEXP = /^\/([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;
|
|
12
14
|
export const PathPropType = stringMatching(PATH_REGEXP);
|
|
13
15
|
export const SrcPropType = PropTypes.oneOfType([UrlPropType, PathPropType]);
|
|
14
|
-
export const
|
|
15
|
-
const
|
|
16
|
+
export const FilesPropType = (props, propName, componentName) => {
|
|
17
|
+
const validFilesTypes = ['image/jpeg', 'image/png', 'image/svg+xml', 'image/*', 'application/pdf', 'application/zip', 'text/csv'];
|
|
16
18
|
const propValue = props[propName];
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const isValid = every(type => includes(trim(type), validImageTypes), imageTypes);
|
|
19
|
+
const filesTypes = split(',', propValue);
|
|
20
|
+
const isValid = isEmpty(head(filesTypes)) || every(type => includes(trim(type), validFilesTypes), filesTypes);
|
|
20
21
|
if (isValid) return null;
|
|
21
22
|
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.`);
|
|
22
23
|
};
|
package/es/util/proptypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proptypes.js","names":["PropTypes","split","trim","includes","every","stringMatching","_ColorPropType","_HexPropType","URL_REGEXP","UrlPropType","PATH_REGEXP","PathPropType","SrcPropType","oneOfType","
|
|
1
|
+
{"version":3,"file":"proptypes.js","names":["PropTypes","split","trim","includes","every","stringMatching","_ColorPropType","_HexPropType","isEmpty","head","URL_REGEXP","UrlPropType","PATH_REGEXP","PathPropType","SrcPropType","oneOfType","FilesPropType","props","propName","componentName","validFilesTypes","propValue","filesTypes","isValid","type","Error","ColorPropType","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,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,cAAP,MAA2B,kDAA3B;AAEA,OAAOC,cAAP,MAA2B,yCAA3B;AACA,OAAOC,YAAP,MAAyB,uCAAzB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AAEA,MAAMC,UAAU,GACd,8FADF;AAEA,OAAO,MAAMC,WAAW,GAAGN,cAAc,CAACK,UAAD,CAAlC;AAEP,MAAME,WAAW,GAAG,oCAApB;AACA,OAAO,MAAMC,YAAY,GAAGR,cAAc,CAACO,WAAD,CAAnC;AAEP,OAAO,MAAME,WAAW,GAAGd,SAAS,CAACe,SAAV,CAAoB,CAACJ,WAAD,EAAcE,YAAd,CAApB,CAApB;AAEP,OAAO,MAAMG,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,GAAGrB,KAAK,CAAC,GAAD,EAAMoB,SAAN,CAAxB;EACA,MAAME,OAAO,GACXf,OAAO,CAACC,IAAI,CAACa,UAAD,CAAL,CAAP,IAA6BlB,KAAK,CAACoB,IAAI,IAAIrB,QAAQ,CAACD,IAAI,CAACsB,IAAD,CAAL,EAAaJ,eAAb,CAAjB,EAAgDE,UAAhD,CADpC;EAEA,IAAIC,OAAJ,EAAa,OAAO,IAAP;EAEb,OAAO,IAAIE,KAAJ,CACJ,uBAAsBJ,SAAU,mBAAkBF,aAAc,iGAD5D,CAAP;AAGD,CApBM;AAsBP,OAAO,MAAMO,aAAa,GAAGpB,cAAtB;AACP,OAAO,MAAMqB,WAAW,GAAGpB,YAApB"}
|
|
@@ -47,9 +47,9 @@ const getButtonContent = (icon, label) => {
|
|
|
47
47
|
className: _style.default.buttonContent
|
|
48
48
|
}, position === 'left' ? /*#__PURE__*/_react.default.createElement(Icon, {
|
|
49
49
|
className: _style.default.icon
|
|
50
|
-
}) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
50
|
+
}) : null, label ? /*#__PURE__*/_react.default.createElement("span", {
|
|
51
51
|
className: _style.default.label
|
|
52
|
-
}, label), position === 'right' ? /*#__PURE__*/_react.default.createElement(Icon, {
|
|
52
|
+
}, label) : null, position === 'right' ? /*#__PURE__*/_react.default.createElement(Icon, {
|
|
53
53
|
className: _style.default.icon
|
|
54
54
|
}) : null);
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span
|
|
1
|
+
{"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n {label ? <span className={style.label}>{label}</span> : null}\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,IAAD,EAAkBC,KAAlB,KAAqC;EAC5D,MAAM;IAACC,IAAD;IAAOC;EAAP,IAAmBH,IAAI,IAAI;IAACE,IAAI,EAAE,EAAP;IAAWC,QAAQ,EAAE;EAArB,CAAjC;EACA,MAAMC,IAAI,GAAGF,IAAI,IAAIG,kBAAA,CAAMH,IAAN,CAArB;;EAEA,IA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wBI,cAAA,CAAMsB,SAPZ,EAQlBd,IAAI,IAAIR,cAAA,CAAMQ,IARI,EASlBJ,QAAQ,IAAIJ,cAAA,CAAMI,QATA,CAApB;EAYA,MAAMmB,aAAa,GAAG,IAAAC,kBAAA,EAAY,MAAMf,OAAO,EAAzB,EAA6B,CAACA,OAAD,CAA7B,CAAtB;EAEA,MAAMgB,eAAe,GAAG,IAAAD,kBAAA,EAAYE,KAAK,IAAIhB,SAAS,CAACgB,KAAD,CAA9B,EAAuC,CAAChB,SAAD,CAAvC,CAAxB;;EAEA,IAAIF,IAAJ,EAAU;IACR,oBACE,6BAAC,aAAD,eACMA,IADN,EAEOK,QAAQ,IAAI;MACfc,KAAK,EAAEpB,SAAS,IAAIZ;IADL,CAFnB;MAKE,KAAK,EAAEiB,WALT;MAME,SAAS,EAAEG,WANb;MAOE,aAAWV,QAPb;MAQE,eAAaC,UARf;MASE,cAAYC,SAAS,IAAIZ;IAT3B,IAWGmB,WAXH,CADF;EAeD;;EAED,oBACE,oDACOD,QAAQ,IAAI;IACfc,KAAK,EAAEpB,SAAS,IAAIZ;EADL,CADnB;IAIE,IAAI,EAAC,QAJP;IAKE,cAAYY,SAAS,IAAIZ,KAL3B;IAME,aAAWU,QANb;IAOE,eAAaC,UAPf;IAQE,KAAK,EAAEM,WART;IASE,SAAS,EAAEG,WATb;IAUE,OAAO,EAAEQ,aAVX;IAWE,SAAS,EAAEE,eAXb;IAYE,QAAQ,EAAE;EAZZ,IAcGX,WAdH,CADF;AAkBD,CArED;;AAuEAZ,UAAU,CAAC0B,SAAX,2CAAuBA,cAAvB;eAEe1B,U"}
|
|
@@ -20,6 +20,7 @@ declare class DragAndDrop extends React.Component<any, any, any> {
|
|
|
20
20
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
21
21
|
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
22
22
|
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
23
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
23
24
|
};
|
|
24
25
|
constructor(props: any);
|
|
25
26
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAiBA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAiBA;IACE;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBA4MC;CACF"}
|
|
@@ -70,12 +70,19 @@ class DragAndDrop extends _react.default.Component {
|
|
|
70
70
|
errorButtonLabel = '',
|
|
71
71
|
disabled = false,
|
|
72
72
|
pdfButtonLabel,
|
|
73
|
-
pdfButtonAriaLabel
|
|
73
|
+
pdfButtonAriaLabel,
|
|
74
|
+
multiple
|
|
74
75
|
} = this.props;
|
|
75
76
|
const {
|
|
76
77
|
dragging
|
|
77
78
|
} = this.state;
|
|
78
79
|
let previewView = null;
|
|
80
|
+
const customButtonStyle = {
|
|
81
|
+
width: 'auto',
|
|
82
|
+
maxWidth: '150px',
|
|
83
|
+
padding: '12px 24px',
|
|
84
|
+
boxSizing: 'border-box'
|
|
85
|
+
};
|
|
79
86
|
|
|
80
87
|
if (previewContent && previewContent.type === 'image') {
|
|
81
88
|
previewView = /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -109,7 +116,8 @@ class DragAndDrop extends _react.default.Component {
|
|
|
109
116
|
icon: {
|
|
110
117
|
position: 'left',
|
|
111
118
|
type: 'pdf'
|
|
112
|
-
}
|
|
119
|
+
},
|
|
120
|
+
customStyle: customButtonStyle
|
|
113
121
|
}));
|
|
114
122
|
} else if (previewContent && previewContent.type === 'xlsx') {
|
|
115
123
|
previewView = /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -119,6 +127,14 @@ class DragAndDrop extends _react.default.Component {
|
|
|
119
127
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidFilesBasicFileLines, {
|
|
120
128
|
className: _style.default.iconFile
|
|
121
129
|
})));
|
|
130
|
+
} else if (previewContent && previewContent.type === 'csv') {
|
|
131
|
+
previewView = /*#__PURE__*/_react.default.createElement("div", {
|
|
132
|
+
className: _style.default.preview
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
+
className: _style.default.multiplePreview
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidFilesBasicFileLines, {
|
|
136
|
+
className: _style.default.iconFile
|
|
137
|
+
})));
|
|
122
138
|
} else if (loading) {
|
|
123
139
|
previewView = /*#__PURE__*/_react.default.createElement("div", {
|
|
124
140
|
className: _style.default.loaderWrapper
|
|
@@ -141,7 +157,7 @@ class DragAndDrop extends _react.default.Component {
|
|
|
141
157
|
previewView = /*#__PURE__*/_react.default.createElement("span", null, previewLabel);
|
|
142
158
|
}
|
|
143
159
|
|
|
144
|
-
const resetContent = previewContent && previewContent.src ? /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
const resetContent = previewContent && previewContent.src && !multiple ? /*#__PURE__*/_react.default.createElement("div", {
|
|
145
161
|
className: (0, _classnames.default)(_style.default.resetUploadWrapper, disabled && _style.default.disabled)
|
|
146
162
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
147
163
|
className: _style.default.resetSrcLabel
|
|
@@ -161,7 +177,8 @@ class DragAndDrop extends _react.default.Component {
|
|
|
161
177
|
icon: {
|
|
162
178
|
position: 'left',
|
|
163
179
|
type: 'folders'
|
|
164
|
-
}
|
|
180
|
+
},
|
|
181
|
+
customStyle: customButtonStyle
|
|
165
182
|
};
|
|
166
183
|
|
|
167
184
|
if (dragging) {
|
|
@@ -177,7 +194,7 @@ class DragAndDrop extends _react.default.Component {
|
|
|
177
194
|
};
|
|
178
195
|
|
|
179
196
|
const button = buildButton(dragging, error);
|
|
180
|
-
const previewContainer = (0, _getClassState.default)(_style.default.previewContainer, _style.default.modifiedPreviewContainer, null, modified, error);
|
|
197
|
+
const previewContainer = (0, _getClassState.default)(multiple ? _style.default.previewContainerMultiple : _style.default.previewContainer, _style.default.modifiedPreviewContainer, null, modified, error);
|
|
181
198
|
const inputWrapper = (0, _getClassState.default)(_style.default.inputWrapper, _style.default.modifiedInputWrapper, _style.default.errorInputWrapper, modified, error);
|
|
182
199
|
|
|
183
200
|
const buildContent = () => {
|
|
@@ -238,7 +255,8 @@ DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
238
255
|
buttonAriaLabel: _propTypes.default.string,
|
|
239
256
|
errorButtonLabel: _propTypes.default.string,
|
|
240
257
|
pdfButtonLabel: _propTypes.default.string,
|
|
241
|
-
pdfButtonAriaLabel: _propTypes.default.string
|
|
258
|
+
pdfButtonAriaLabel: _propTypes.default.string,
|
|
259
|
+
multiple: _propTypes.default.bool
|
|
242
260
|
} : {};
|
|
243
261
|
var _default = DragAndDrop;
|
|
244
262
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["constantNull","DragAndDrop","React","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","buttonAriaLabel","errorButtonLabel","disabled","pdfButtonLabel","pdfButtonAriaLabel","previewView","type","style","preview","src","previewPdf","previewLabelPdf","href","target","download","position","previewXlsxContainer","previewXlsx","iconFile","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","classnames","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","button","previewContainer","getClassState","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","buildContent","infosContainer","iconError","dragAndDropLabel","content","wrapper","errorMessage","propTypes","PropTypes","string","shape","bool","func"],"sources":["../../../src/atom/drag-and-drop/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon,\n NovaSolidFilesBasicFileLines as FileLinesIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Loader from '../loader';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string,\n label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n pdfButtonLabel: PropTypes.string,\n pdfButtonAriaLabel: PropTypes.string\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = '',\n buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = false,\n pdfButtonLabel,\n pdfButtonAriaLabel\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (previewContent && previewContent.type === 'pdf') {\n previewView = (\n <div className={style.previewPdf}>\n <p className={style.previewLabelPdf}>{previewLabel}</p>\n <Button\n type=\"secondary\"\n link={{href: previewContent.src, target: '_blank', download: false}}\n label={pdfButtonLabel}\n aria-label={pdfButtonAriaLabel}\n data-name=\"default-button-pdf\"\n icon={{\n position: 'left',\n type: 'pdf'\n }}\n />\n </div>\n );\n } else if (previewContent && previewContent.type === 'xlsx') {\n previewView = (\n <div className={style.previewXlsxContainer}>\n <div className={style.previewXlsx}>\n <FileLinesIcon className={style.iconFile} />\n </div>\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src ? (\n <div className={classnames(style.resetUploadWrapper, disabled && style.disabled)}>\n <div className={style.resetSrcLabel}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n ) : null}\n </div>\n ) : null;\n\n const buildButton = () => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': buttonAriaLabel,\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n }\n };\n if (dragging) {\n return null;\n } else if (error) {\n return <Button {...defaultButtonProps} label={errorButtonLabel} icon={{}} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n };\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(\n style.previewContainer,\n style.modifiedPreviewContainer,\n null,\n modified,\n error\n );\n const inputWrapper = getClassState(\n style.inputWrapper,\n style.modifiedInputWrapper,\n style.errorInputWrapper,\n modified,\n error\n );\n\n const buildContent = () => {\n if (loading) {\n return previewView;\n } else if (!isEmpty(previewContent)) {\n return (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n );\n } else {\n return (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n data-name=\"drag-and-drop-box\"\n >\n <div className={style.infosContainer}>\n {error ? (\n <FileUploadBlockedIcon className={style.iconError} />\n ) : (\n <FileUploadIcon className={style.icon} />\n )}\n {description ? <div className={style.description}>{description}</div> : null}\n {error ? null : <div className={style.dragAndDropLabel}>{'Drag & Drop here'}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n );\n }\n };\n\n const content = buildContent();\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n <div className={style.title}>{title}</div>\n {content}\n {error ? (\n <span className={classnames(style.errorMessage, disabled && style.disabled)}>\n {error}\n </span>\n ) : (\n resetContent\n )}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AAMA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,wBAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0BC,cAAA,CAAMC,SAAhC,CAA0C;EAuBxCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA,KAAKC,KAAL,GAAa;MACXC,QAAQ,EAAE;IADC,CAAb;IAIA,KAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;IACA,KAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;EACD;;EAEDD,eAAe,GAAG;IAChB,KAAKG,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDG,cAAc,GAAG;IACf,KA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sC,YAAjB,EAA+B3C,QAAQ,IAAIK,cAAA,CAAML,QAAjD;IAAjB,GACGH,KADH,CADI,GAKJyB,YARJ,CADF;EAaD;;AAxOuC;;AAApC/C,W,CACGqE,S,2CAAY;EACjBvD,KAAK,EAAEwD,kBAAA,CAAUC,MADA;EAEjBxD,WAAW,EAAEuD,kBAAA,CAAUC,MAFN;EAGjBvD,WAAW,EAAEsD,kBAAA,CAAUC,MAHN;EAIjBtD,YAAY,EAAEqD,kBAAA,CAAUC,MAJP;EAKjBrD,cAAc,EAAEoD,kBAAA,CAAUE,KAAV,CAAgB;IAC9B3C,IAAI,EAAEyC,kBAAA,CAAUC,MADc;IAE9BvC,GAAG,EAAEsC,kBAAA,CAAUC,MAFe;IAG9BpB,KAAK,EAAEmB,kBAAA,CAAUC;EAHa,CAAhB,CALC;EAUjBpD,OAAO,EAAEmD,kBAAA,CAAUG,IAVF;EAWjBrD,QAAQ,EAAEkD,kBAAA,CAAUG,IAXH;EAYjBhD,QAAQ,EAAE6C,kBAAA,CAAUG,IAZH;EAajB5D,QAAQ,EAAEyD,kBAAA,CAAUI,IAbH;EAcjBrD,OAAO,EAAEiD,kBAAA,CAAUI,IAdF;EAejBpD,KAAK,EAAEgD,kBAAA,CAAUC,MAfA;EAgBjBhD,eAAe,EAAE+C,kBAAA,CAAUC,MAhBV;EAiBjB/C,gBAAgB,EAAE8C,kBAAA,CAAUC,MAjBX;EAkBjB7C,cAAc,EAAE4C,kBAAA,CAAUC,MAlBT;EAmBjB5C,kBAAkB,EAAE2C,kBAAA,CAAUC;AAnBb,C;eA0ONvE,W"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["constantNull","DragAndDrop","React","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","buttonAriaLabel","errorButtonLabel","disabled","pdfButtonLabel","pdfButtonAriaLabel","multiple","previewView","customButtonStyle","width","maxWidth","padding","boxSizing","type","style","preview","src","previewPdf","previewLabelPdf","href","target","download","position","previewXlsxContainer","previewXlsx","iconFile","multiplePreview","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","classnames","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","customStyle","button","previewContainer","getClassState","previewContainerMultiple","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","buildContent","infosContainer","iconError","dragAndDropLabel","content","wrapper","errorMessage","propTypes","PropTypes","string","shape","bool","func"],"sources":["../../../src/atom/drag-and-drop/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon,\n NovaSolidFilesBasicFileLines as FileLinesIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Loader from '../loader';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string,\n label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n pdfButtonLabel: PropTypes.string,\n pdfButtonAriaLabel: PropTypes.string,\n multiple: PropTypes.bool\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = '',\n buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = false,\n pdfButtonLabel,\n pdfButtonAriaLabel,\n multiple\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n const customButtonStyle = {\n width: 'auto',\n maxWidth: '150px',\n padding: '12px 24px',\n boxSizing: 'border-box'\n };\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (previewContent && previewContent.type === 'pdf') {\n previewView = (\n <div className={style.previewPdf}>\n <p className={style.previewLabelPdf}>{previewLabel}</p>\n <Button\n type=\"secondary\"\n link={{href: previewContent.src, target: '_blank', download: false}}\n label={pdfButtonLabel}\n aria-label={pdfButtonAriaLabel}\n data-name=\"default-button-pdf\"\n icon={{\n position: 'left',\n type: 'pdf'\n }}\n customStyle={customButtonStyle}\n />\n </div>\n );\n } else if (previewContent && previewContent.type === 'xlsx') {\n previewView = (\n <div className={style.previewXlsxContainer}>\n <div className={style.previewXlsx}>\n <FileLinesIcon className={style.iconFile} />\n </div>\n </div>\n );\n } else if (previewContent && previewContent.type === 'csv') {\n previewView = (\n <div className={style.preview}>\n <div className={style.multiplePreview}>\n <FileLinesIcon className={style.iconFile} />\n </div>\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src && !multiple ? (\n <div className={classnames(style.resetUploadWrapper, disabled && style.disabled)}>\n <div className={style.resetSrcLabel}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n ) : null}\n </div>\n ) : null;\n\n const buildButton = () => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': buttonAriaLabel,\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n },\n customStyle: customButtonStyle\n };\n if (dragging) {\n return null;\n } else if (error) {\n return <Button {...defaultButtonProps} label={errorButtonLabel} icon={{}} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n };\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(\n multiple ? style.previewContainerMultiple : style.previewContainer,\n style.modifiedPreviewContainer,\n null,\n modified,\n error\n );\n const inputWrapper = getClassState(\n style.inputWrapper,\n style.modifiedInputWrapper,\n style.errorInputWrapper,\n modified,\n error\n );\n\n const buildContent = () => {\n if (loading) {\n return previewView;\n } else if (!isEmpty(previewContent)) {\n return (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n );\n } else {\n return (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n data-name=\"drag-and-drop-box\"\n >\n <div className={style.infosContainer}>\n {error ? (\n <FileUploadBlockedIcon className={style.iconError} />\n ) : (\n <FileUploadIcon className={style.icon} />\n )}\n {description ? <div className={style.description}>{description}</div> : null}\n {error ? null : <div className={style.dragAndDropLabel}>{'Drag & Drop here'}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n );\n }\n };\n\n const content = buildContent();\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n <div className={style.title}>{title}</div>\n {content}\n {error ? (\n <span className={classnames(style.errorMessage, disabled && style.disabled)}>\n {error}\n </span>\n ) : (\n resetContent\n )}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AAMA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,wBAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0BC,cAAA,CAAMC,SAAhC,CAA0C;EAwBxCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA,KAAKC,KAAL,GAAa;MACXC,QAAQ,EAAE;IADC,CAAb;IAIA,KAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;IACA,KAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;EACD;;EAEDD,eAAe,GAAG;IAChB,KAAKG,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDG,cAAc,GAAG;IACf,KAAKC,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDK,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG,wBAAS,WAAT,CAAd;IACA,MAAM;MACJC,QAAQ,GAAGd,YADP;MAEJe,KAFI;MAGJC,WAHI;MAIJC,WAJI;MAKJC,YAAY,GAAG,EALX;MAMJC,cANI;MAOJC,OAAO,GAAG,KAPN;MAQJC,QAAQ,GAAG,KARP;MASJC,OAAO,GAAG,IATN;MAUJC,KAAK,GAAG,EAVJ;MAWJC,eAAe,GAAG,EAXd;MAYJC,gBAAgB,GAAG,EAZf;MAaJC,QAAQ,GAAG,KAbP;MAcJC,cAdI;MAeJC,kBAfI;MAgBJC;IAhBI,IAiBF,KAAKxB,KAjBT;IAkBA,MAAM;MAACE;IAAD,IAAa,KAAKD,KAAxB;IAEA,IAAIwB,WAAW,GAAG,IAAl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A,EAAWnB,cAAA,CAAMyC,YAAjB,EAA+BpD,QAAQ,IAAIW,cAAA,CAAMX,QAAjD;IAAjB,GACGH,KADH,CADI,GAKJgC,YARJ,CADF;EAaD;;AA3PuC;;AAApCtD,W,CACG8E,S,2CAAY;EACjBhE,KAAK,EAAEiE,kBAAA,CAAUC,MADA;EAEjBjE,WAAW,EAAEgE,kBAAA,CAAUC,MAFN;EAGjBhE,WAAW,EAAE+D,kBAAA,CAAUC,MAHN;EAIjB/D,YAAY,EAAE8D,kBAAA,CAAUC,MAJP;EAKjB9D,cAAc,EAAE6D,kBAAA,CAAUE,KAAV,CAAgB;IAC9B9C,IAAI,EAAE4C,kBAAA,CAAUC,MADc;IAE9B1C,GAAG,EAAEyC,kBAAA,CAAUC,MAFe;IAG9BtB,KAAK,EAAEqB,kBAAA,CAAUC;EAHa,CAAhB,CALC;EAUjB7D,OAAO,EAAE4D,kBAAA,CAAUG,IAVF;EAWjB9D,QAAQ,EAAE2D,kBAAA,CAAUG,IAXH;EAYjBzD,QAAQ,EAAEsD,kBAAA,CAAUG,IAZH;EAajBrE,QAAQ,EAAEkE,kBAAA,CAAUI,IAbH;EAcjB9D,OAAO,EAAE0D,kBAAA,CAAUI,IAdF;EAejB7D,KAAK,EAAEyD,kBAAA,CAAUC,MAfA;EAgBjBzD,eAAe,EAAEwD,kBAAA,CAAUC,MAhBV;EAiBjBxD,gBAAgB,EAAEuD,kBAAA,CAAUC,MAjBX;EAkBjBtD,cAAc,EAAEqD,kBAAA,CAAUC,MAlBT;EAmBjBrD,kBAAkB,EAAEoD,kBAAA,CAAUC,MAnBb;EAoBjBpD,QAAQ,EAAEmD,kBAAA,CAAUG;AApBH,C;eA6PNlF,W"}
|
|
@@ -125,18 +125,18 @@ video {
|
|
|
125
125
|
flex-direction: column;
|
|
126
126
|
align-items: center;
|
|
127
127
|
justify-content: space-between;
|
|
128
|
-
padding:
|
|
128
|
+
padding: 16px;
|
|
129
129
|
overflow: hidden;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.inputWrapper:before {
|
|
133
133
|
content: "";
|
|
134
134
|
position: absolute;
|
|
135
|
-
border:
|
|
136
|
-
top: -
|
|
137
|
-
bottom: -
|
|
138
|
-
left: -
|
|
139
|
-
right: -
|
|
135
|
+
border: 7px dashed cm_grey_200;
|
|
136
|
+
top: -3px;
|
|
137
|
+
bottom: -3px;
|
|
138
|
+
left: -4px;
|
|
139
|
+
right: -4px;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.modifiedInputWrapper {
|
|
@@ -304,4 +304,19 @@ video {
|
|
|
304
304
|
height: 25%;
|
|
305
305
|
width: 25%;
|
|
306
306
|
color: cm_grey_300;
|
|
307
|
-
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.previewContainerMultiple {
|
|
310
|
+
composes: previewContainer;
|
|
311
|
+
height: 100%;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.multiplePreview {
|
|
315
|
+
background-color: cm_grey_100;
|
|
316
|
+
border-radius: 8px;
|
|
317
|
+
width: 100%;
|
|
318
|
+
height: 100%;
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default
|
|
2
|
-
declare function
|
|
1
|
+
export default InputFileDraggable;
|
|
2
|
+
declare function InputFileDraggable({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, labelLink, labelButtonLink, hrefLink, filesTypes, error, buttonAriaLabel, errorButtonLabel, pdfButtonLabel, pdfButtonAriaLabel, filesNumber, multiple, required, onClick }: {
|
|
3
3
|
title: any;
|
|
4
4
|
description: any;
|
|
5
5
|
previewLabel: any;
|
|
@@ -14,19 +14,23 @@ declare function ImageUpload({ title, description, previewLabel, previewContent,
|
|
|
14
14
|
labelLink: any;
|
|
15
15
|
labelButtonLink: any;
|
|
16
16
|
hrefLink: any;
|
|
17
|
-
|
|
17
|
+
filesTypes?: string | undefined;
|
|
18
18
|
error?: string | undefined;
|
|
19
19
|
buttonAriaLabel: any;
|
|
20
20
|
errorButtonLabel: any;
|
|
21
21
|
pdfButtonLabel: any;
|
|
22
22
|
pdfButtonAriaLabel: any;
|
|
23
|
+
filesNumber?: number | undefined;
|
|
24
|
+
multiple?: boolean | undefined;
|
|
25
|
+
required?: boolean | undefined;
|
|
26
|
+
onClick: any;
|
|
23
27
|
}): JSX.Element;
|
|
24
|
-
declare namespace
|
|
28
|
+
declare namespace InputFileDraggable {
|
|
25
29
|
const propTypes: {
|
|
26
30
|
name: PropTypes.Requireable<string>;
|
|
27
31
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
32
|
onReset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
-
|
|
33
|
+
filesTypes: (props: any, propName: any, componentName: any) => Error | null;
|
|
30
34
|
error: PropTypes.Requireable<string>;
|
|
31
35
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
32
36
|
errorButtonLabel: PropTypes.Requireable<string>;
|
|
@@ -47,6 +51,7 @@ declare namespace ImageUpload {
|
|
|
47
51
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
52
|
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
49
53
|
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
54
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
57
|
import PropTypes from "prop-types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-file-draggable/index.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;;;;;;;;gBA4GC"}
|