@coorpacademy/components 11.18.7 → 11.18.8-alpha.12
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-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +1 -1
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +10 -0
- package/es/atom/button-menu/types.d.ts +1 -1
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +1 -1
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/empty-search-result/index.d.ts +1 -0
- package/es/atom/empty-search-result/index.d.ts.map +1 -1
- package/es/atom/empty-search-result/index.js +6 -4
- package/es/atom/empty-search-result/index.js.map +1 -1
- package/es/atom/empty-search-result/style.css +16 -1
- package/es/atom/status-item/index.d.ts +1 -0
- package/es/atom/status-item/index.d.ts.map +1 -1
- package/es/atom/status-item/index.js +3 -2
- package/es/atom/status-item/index.js.map +1 -1
- package/es/atom/status-item/style.css +15 -17
- package/es/atom/status-item/types.d.ts +2 -0
- package/es/atom/status-item/types.d.ts.map +1 -1
- package/es/atom/status-item/types.js +1 -0
- package/es/atom/status-item/types.js.map +1 -1
- package/es/atom/tag/index.js +4 -4
- package/es/atom/tag/index.js.map +1 -1
- package/es/atom/tag/style.css +11 -8
- package/es/atom/title/types.d.ts +9 -0
- package/es/atom/title/types.d.ts.map +1 -0
- package/es/atom/title/types.js +2 -0
- package/es/atom/title/types.js.map +1 -0
- package/es/molecule/banner/style.css +4 -2
- package/es/molecule/brand-tabs/index.d.ts +1 -0
- package/es/molecule/brand-tabs/index.d.ts.map +1 -1
- package/es/molecule/brand-tabs/index.js +10 -1
- package/es/molecule/brand-tabs/index.js.map +1 -1
- package/es/molecule/brand-tabs/style.css +7 -4
- package/es/molecule/bulk-progress-bar/index.d.ts.map +1 -1
- package/es/molecule/bulk-progress-bar/index.js +4 -2
- package/es/molecule/bulk-progress-bar/index.js.map +1 -1
- package/es/molecule/bulk-progress-bar/style.css +5 -0
- package/es/molecule/card/index.d.ts +53 -0
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +14 -12
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +47 -5
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +46 -9
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +32 -0
- package/es/molecule/cm-popin/types.d.ts +31 -1
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +13 -3
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +57 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +39 -5
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/prop-types.d.ts +14 -0
- package/es/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -0
- package/es/molecule/dashboard/cards-list/prop-types.js +2 -0
- package/es/molecule/dashboard/cards-list/prop-types.js.map +1 -0
- package/es/molecule/draggable-list/index.d.ts +32 -12
- package/es/molecule/expandible-actionable-table/index.d.ts +3 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/index.js +15 -2
- package/es/molecule/expandible-actionable-table/index.js.map +1 -1
- package/es/molecule/expandible-actionable-table/style.css +5 -0
- package/es/molecule/expandible-actionable-table/types.d.ts +5 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.js +3 -1
- package/es/molecule/expandible-actionable-table/types.js.map +1 -1
- package/es/molecule/review-header-steps/index.d.ts.map +1 -1
- package/es/molecule/review-header-steps/index.js +3 -4
- package/es/molecule/review-header-steps/index.js.map +1 -1
- package/es/molecule/review-header-steps/prop-types.d.ts +1 -0
- package/es/molecule/review-header-steps/prop-types.d.ts.map +1 -1
- package/es/molecule/review-header-steps/style.css +6 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +45 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.js +15 -3
- package/es/molecule/title-and-checkbox-wrapper/index.js.map +1 -1
- package/es/organism/list-item/index.d.ts +44 -13
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +72 -38
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +28 -5
- package/es/organism/list-items/index.d.ts +36 -12
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +19 -4
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/list-items/style.css +42 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +1 -0
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-header/types.d.ts +1 -0
- package/es/organism/review-header/types.d.ts.map +1 -1
- package/es/organism/rewards-form/index.d.ts +45 -0
- package/es/organism/select-opponents/index.d.ts +67 -12
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/index.js +3 -3
- package/es/organism/select-opponents/index.js.map +1 -1
- package/es/organism/select-opponents/style.css +6 -0
- package/es/organism/select-opponents/types.d.ts +75 -14
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/select-opponents/types.js +2 -2
- package/es/organism/select-opponents/types.js.map +1 -1
- package/es/organism/sidebar/index.d.ts +3 -1
- package/es/organism/sidebar/index.d.ts.map +1 -1
- package/es/organism/sidebar/index.js +9 -5
- package/es/organism/sidebar/index.js.map +1 -1
- package/es/organism/sidebar/style.css +14 -0
- package/es/organism/title-and-input/index.d.ts +84 -29
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +84 -29
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +112 -0
- package/es/organism/wizard-contents/index.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.js +37 -4
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/style.css +22 -0
- package/es/template/app-player/loading/index.d.ts +19 -1
- package/es/template/app-player/player/index.d.ts +38 -2
- package/es/template/app-player/player/slides/index.d.ts +19 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +19 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +72 -2
- package/es/template/app-player/popin-end/summary.d.ts +53 -1
- package/es/template/app-review/index.d.ts +20 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +20 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +20 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +122 -13
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +4 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +4 -4
- package/es/template/common/dashboard/index.d.ts +89 -1
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +6 -2
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/template/common/dashboard/style.css +5 -0
- package/es/template/common/search-page/index.d.ts +123 -1
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +8 -3
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/common/search-page/style.css +5 -0
- package/es/template/external-course/index.d.ts +19 -1
- package/es/template/teams-dashboard/index.d.ts +53 -1
- package/es/variables/colors.css +3 -2
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +1 -1
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +10 -0
- package/lib/atom/button-menu/types.d.ts +1 -1
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +1 -1
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/empty-search-result/index.d.ts +1 -0
- package/lib/atom/empty-search-result/index.d.ts.map +1 -1
- package/lib/atom/empty-search-result/index.js +6 -4
- package/lib/atom/empty-search-result/index.js.map +1 -1
- package/lib/atom/empty-search-result/style.css +16 -1
- package/lib/atom/status-item/index.d.ts +1 -0
- package/lib/atom/status-item/index.d.ts.map +1 -1
- package/lib/atom/status-item/index.js +3 -2
- package/lib/atom/status-item/index.js.map +1 -1
- package/lib/atom/status-item/style.css +15 -17
- package/lib/atom/status-item/types.d.ts +2 -0
- package/lib/atom/status-item/types.d.ts.map +1 -1
- package/lib/atom/status-item/types.js +1 -0
- package/lib/atom/status-item/types.js.map +1 -1
- package/lib/atom/tag/index.js +4 -4
- package/lib/atom/tag/index.js.map +1 -1
- package/lib/atom/tag/style.css +11 -8
- package/lib/atom/title/types.d.ts +9 -0
- package/lib/atom/title/types.d.ts.map +1 -0
- package/lib/atom/title/types.js +2 -0
- package/lib/atom/title/types.js.map +1 -0
- package/lib/molecule/banner/style.css +4 -2
- package/lib/molecule/brand-tabs/index.d.ts +1 -0
- package/lib/molecule/brand-tabs/index.d.ts.map +1 -1
- package/lib/molecule/brand-tabs/index.js +11 -1
- package/lib/molecule/brand-tabs/index.js.map +1 -1
- package/lib/molecule/brand-tabs/style.css +7 -4
- package/lib/molecule/bulk-progress-bar/index.d.ts.map +1 -1
- package/lib/molecule/bulk-progress-bar/index.js +4 -2
- package/lib/molecule/bulk-progress-bar/index.js.map +1 -1
- package/lib/molecule/bulk-progress-bar/style.css +5 -0
- package/lib/molecule/card/index.d.ts +53 -0
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +15 -11
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +47 -5
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +48 -8
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +32 -0
- package/lib/molecule/cm-popin/types.d.ts +31 -1
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +15 -3
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +57 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +43 -5
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/prop-types.d.ts +14 -0
- package/lib/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -0
- package/lib/molecule/dashboard/cards-list/prop-types.js +2 -0
- package/lib/molecule/dashboard/cards-list/prop-types.js.map +1 -0
- package/lib/molecule/draggable-list/index.d.ts +32 -12
- package/lib/molecule/expandible-actionable-table/index.d.ts +3 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.js +17 -2
- package/lib/molecule/expandible-actionable-table/index.js.map +1 -1
- package/lib/molecule/expandible-actionable-table/style.css +5 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts +5 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.js +3 -1
- package/lib/molecule/expandible-actionable-table/types.js.map +1 -1
- package/lib/molecule/review-header-steps/index.d.ts.map +1 -1
- package/lib/molecule/review-header-steps/index.js +3 -4
- package/lib/molecule/review-header-steps/index.js.map +1 -1
- package/lib/molecule/review-header-steps/prop-types.d.ts +1 -0
- package/lib/molecule/review-header-steps/prop-types.d.ts.map +1 -1
- package/lib/molecule/review-header-steps/style.css +6 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +45 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.js +17 -3
- package/lib/molecule/title-and-checkbox-wrapper/index.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +44 -13
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +73 -37
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +28 -5
- package/lib/organism/list-items/index.d.ts +36 -12
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +21 -4
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/list-items/style.css +42 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +1 -0
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-header/types.d.ts +1 -0
- package/lib/organism/review-header/types.d.ts.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +45 -0
- package/lib/organism/select-opponents/index.d.ts +67 -12
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/index.js +3 -3
- package/lib/organism/select-opponents/index.js.map +1 -1
- package/lib/organism/select-opponents/style.css +6 -0
- package/lib/organism/select-opponents/types.d.ts +75 -14
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.js +2 -2
- package/lib/organism/select-opponents/types.js.map +1 -1
- package/lib/organism/sidebar/index.d.ts +3 -1
- package/lib/organism/sidebar/index.d.ts.map +1 -1
- package/lib/organism/sidebar/index.js +8 -4
- package/lib/organism/sidebar/index.js.map +1 -1
- package/lib/organism/sidebar/style.css +14 -0
- package/lib/organism/title-and-input/index.d.ts +84 -29
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +84 -29
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +112 -0
- package/lib/organism/wizard-contents/index.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.js +39 -4
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +22 -0
- package/lib/template/app-player/loading/index.d.ts +19 -1
- package/lib/template/app-player/player/index.d.ts +38 -2
- package/lib/template/app-player/player/slides/index.d.ts +19 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +19 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +72 -2
- package/lib/template/app-player/popin-end/summary.d.ts +53 -1
- package/lib/template/app-review/index.d.ts +20 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +20 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +20 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +122 -13
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +4 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +4 -4
- package/lib/template/common/dashboard/index.d.ts +89 -1
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +6 -2
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/dashboard/style.css +5 -0
- package/lib/template/common/search-page/index.d.ts +123 -1
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +9 -3
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/common/search-page/style.css +5 -0
- package/lib/template/external-course/index.d.ts +19 -1
- package/lib/template/teams-dashboard/index.d.ts +53 -1
- package/lib/variables/colors.css +3 -2
- package/locales/.mtslconfig.json +1 -0
- package/locales/et/global.json +3 -3
- package/package.json +3 -3
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
@value dark from colors;
|
|
9
9
|
@value xtraLightGrey from colors;
|
|
10
10
|
@value white from colors;
|
|
11
|
+
@value cm_negative_200 from colors;
|
|
12
|
+
@value negative_100 from colors;
|
|
11
13
|
|
|
12
14
|
.default[disabled] {
|
|
13
|
-
pointer-events: none;
|
|
14
15
|
cursor: inherit;
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
.default[disabled] .imageWrapper {
|
|
166
|
-
opacity: 0.
|
|
167
|
+
opacity: 0.8;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
.lockWrapper {
|
|
@@ -186,12 +187,53 @@
|
|
|
186
187
|
bottom: 0;
|
|
187
188
|
content: '';
|
|
188
189
|
opacity: 0.4;
|
|
189
|
-
background:
|
|
190
|
+
background: linear-gradient(
|
|
191
|
+
to bottom,
|
|
192
|
+
black 50%
|
|
193
|
+
);
|
|
194
|
+
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.2);
|
|
195
|
+
z-index: 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.lockWrapper:hover {
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.lockWrapper:hover .lockIcon {
|
|
203
|
+
background-color: cm_negative_200;
|
|
204
|
+
color: white;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.lockWrapper:hover span {
|
|
208
|
+
font-weight: 600;
|
|
209
|
+
width: 150px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.lockContent {
|
|
213
|
+
display: flex;
|
|
214
|
+
gap: 8px;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
z-index: 2;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.lockContent span {
|
|
220
|
+
width: 134px;
|
|
221
|
+
height: 40px;
|
|
222
|
+
color: white;
|
|
223
|
+
text-align: center;
|
|
224
|
+
font-family: 'Gilroy';
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
line-height: 20px;
|
|
190
227
|
}
|
|
191
228
|
|
|
192
229
|
.lockIcon {
|
|
193
|
-
|
|
194
|
-
|
|
230
|
+
width: 48px;
|
|
231
|
+
min-width: 48px;
|
|
232
|
+
min-height: 48px;
|
|
233
|
+
background-color: negative_100;
|
|
234
|
+
align-self: center;
|
|
235
|
+
border-radius: 16px;
|
|
236
|
+
color: cm_negative_200;
|
|
195
237
|
}
|
|
196
238
|
|
|
197
239
|
.imageWrapper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAsBA,kDA6MC"}
|
|
@@ -15,12 +15,22 @@ var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link
|
|
|
15
15
|
|
|
16
16
|
var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
|
|
17
17
|
|
|
18
|
+
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
19
|
+
|
|
20
|
+
var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
|
|
21
|
+
|
|
18
22
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
19
23
|
|
|
20
24
|
var _types = _interopRequireDefault(require("./types"));
|
|
21
25
|
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
27
|
|
|
28
|
+
const IconType = {
|
|
29
|
+
lockedContent: /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyPadlock, {
|
|
30
|
+
className: _style.default.lockIcon
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
|
|
24
34
|
const CMPopin = props => {
|
|
25
35
|
const {
|
|
26
36
|
content,
|
|
@@ -35,7 +45,8 @@ const CMPopin = props => {
|
|
|
35
45
|
thirdButton,
|
|
36
46
|
cookieTitle,
|
|
37
47
|
descriptionBtnTxt,
|
|
38
|
-
listBtnSwicth
|
|
48
|
+
listBtnSwicth,
|
|
49
|
+
items
|
|
39
50
|
} = props;
|
|
40
51
|
const logo = {
|
|
41
52
|
AlertDiamond: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond,
|
|
@@ -50,10 +61,28 @@ const CMPopin = props => {
|
|
|
50
61
|
} : null;
|
|
51
62
|
|
|
52
63
|
const renderHeader = () => {
|
|
53
|
-
if (header)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
if (header) {
|
|
65
|
+
const {
|
|
66
|
+
title,
|
|
67
|
+
headerIcon,
|
|
68
|
+
backgroundImage
|
|
69
|
+
} = header;
|
|
70
|
+
const TopTitleIcon = IconType[headerIcon];
|
|
71
|
+
|
|
72
|
+
if (title) {
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
+
className: _style.default.headerContent
|
|
75
|
+
}, TopTitleIcon, /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
className: _style.default.headerTitle
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement(_title.default, title)));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
81
|
+
className: _style.default.headerBackground,
|
|
82
|
+
src: backgroundImage
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
57
86
|
if (mode === 'cookie') return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
87
|
className: _style.default.cookieHeader
|
|
59
88
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -115,6 +144,14 @@ const CMPopin = props => {
|
|
|
115
144
|
})(listBtnSwicth);
|
|
116
145
|
};
|
|
117
146
|
|
|
147
|
+
const renderItems = () => {
|
|
148
|
+
const {
|
|
149
|
+
type,
|
|
150
|
+
list
|
|
151
|
+
} = items;
|
|
152
|
+
return type === 'content' ? /*#__PURE__*/_react.default.createElement(_cardsGrid.default, list) : null;
|
|
153
|
+
};
|
|
154
|
+
|
|
118
155
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
119
156
|
className: mode !== 'cookie' ? _style.default.background : null,
|
|
120
157
|
style: backgroundImageStyle,
|
|
@@ -129,7 +166,7 @@ const CMPopin = props => {
|
|
|
129
166
|
"aria-label": 'close-icon',
|
|
130
167
|
size: "small",
|
|
131
168
|
icon: "close"
|
|
132
|
-
}) : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
169
|
+
}) : null), mode !== 'items' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
133
170
|
className: mode === 'cookie' || mode === 'information' ? _style.default.cookieTitleContainer : _style.default.titleContainer
|
|
134
171
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
135
172
|
className: _style.default.contentSection
|
|
@@ -148,9 +185,12 @@ const CMPopin = props => {
|
|
|
148
185
|
dangerouslySetInnerHTML: {
|
|
149
186
|
__html: descriptionText
|
|
150
187
|
}
|
|
151
|
-
}) : null), descriptionBtnTxt ? /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
+
}) : null) : null, descriptionBtnTxt ? /*#__PURE__*/_react.default.createElement("div", {
|
|
152
189
|
className: _style.default.descriptionBtn
|
|
153
|
-
}, descriptionBtnTxt) : null,
|
|
190
|
+
}, descriptionBtnTxt) : null, items ? /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
+
className: _style.default.itemsContainer,
|
|
192
|
+
"data-name": 'cm-popin-cards'
|
|
193
|
+
}, renderItems()) : null, renderBtnSwitch(), firstButton || secondButton || thirdButton ? /*#__PURE__*/_react.default.createElement("div", {
|
|
154
194
|
className: _style.default.buttonContainer
|
|
155
195
|
}, firstButton ? /*#__PURE__*/_react.default.createElement("div", {
|
|
156
196
|
className: firstButton.largeButton ? _style.default.largeButton : _style.default.button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","CheckCircle1","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","style","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACXC,YAAY,EAAZA,0DADW;IAEXC,YAAY,EAAZA,6CAFW;IAGXC,UAAU,EAAVA,mCAHW;IAIXC,YAAY,EAAZA;EAJW,CAAb;EAMA,MAAMC,aAAa,GAAGL,IAAI,CAACP,IAAD,CA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AACqD,WAAZ,GAA0BvC,cAAA,CAAMuC,WAAhC,GAA8CvC,cAAA,CAAMwC;EAApE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAEtD,WAAW,CAACuD,KADrB;IAEE,OAAO,EAAEvD,WAAW,CAACwD,aAFvB;IAGE,aAAY,gBAAexD,WAAW,CAAC+B,IAAK,EAH9C;IAIE,cAAY/B,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAAC+B,IALpB;IAME,WAAW,EAAE/B,WAAW,CAACyD;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAhFN,CALF,CADF;AA0FD,CApLD;;AAsLApE,OAAO,CAACqE,SAAR,2CAAoBA,cAApB;eAEerE,O"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["IconType","lockedContent","style","lockIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","logo","AlertDiamond","WindowUpload","MoonRocket","CheckCircle1","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","title","headerIcon","TopTitleIcon","headerContent","headerTitle","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","itemsContainer","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />\n};\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items\n } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n if (title) {\n return (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <div className={style.headerTitle}>\n <Title {...title} />\n </div>\n </div>\n );\n }\n return <img className={style.headerBackground} src={backgroundImage} />;\n }\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n const renderItems = () => {\n const {type, list} = items;\n return type === 'content' ? <CardsGrid {...list} /> : null;\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n {mode !== 'items' ? (\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {items ? (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n {renderItems()}\n </div>\n ) : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAG;EACfC,aAAa,eAAE,6BAAC,6CAAD;IAAU,SAAS,EAAEC,cAAA,CAAMC;EAA3B;AADA,CAAjB;;AAIA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC,aAbI;IAcJC;EAdI,IAeFd,KAfJ;EAgBA,MAAMe,IAAI,GAAG;IACXC,YAAY,EAAZA,0DADW;IAEXC,YAAY,EAAZA,6CAFW;IAGXC,UAAU,EAAVA,mCAHW;IAIXC,YAAY,EAAZA;EAJW,CAAb;EAMA,MAAMC,aAAa,GAAGL,IAAI,CAACR,IAAD,CAA1B;EAEA,MAAMc,oBAAoB,GAAGb,kBAAkB,GAC3C;IACEc,eAAe,EAAG,OAAMd,kBAAmB,GAD7C;IAEEe,cAAc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C,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAAC2C,IALpB;IAME,WAAW,EAAE3C,WAAW,CAACuE;EAN3B,EADF,CADU,GAWR,IAZN,EAaGtE,YAAY,gBACX;IAAK,SAAS,EAAEA,YAAY,CAACkE,WAAb,GAA2BzE,cAAA,CAAMyE,WAAjC,GAA+CzE,cAAA,CAAM0E;EAArE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAEnE,YAAY,CAACoE,KADtB;IAEE,OAAO,EAAEpE,YAAY,CAACqE,aAFxB;IAGE,aAAY,gBAAerE,YAAY,CAAC0C,IAAK,EAH/C;IAIE,cAAY1C,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAAC0C,IALrB;IAME,WAAW,EAAE1C,YAAY,CAACsE;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGhE,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAAC4D,WAAZ,GAA0BzE,cAAA,CAAMyE,WAAhC,GAA8CzE,cAAA,CAAM0E;EAApE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAE7D,WAAW,CAAC8D,KADrB;IAEE,OAAO,EAAE9D,WAAW,CAAC+D,aAFvB;IAGE,aAAY,gBAAe/D,WAAW,CAACoC,IAAK,EAH9C;IAIE,cAAYpC,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACoC,IALpB;IAME,WAAW,EAAEpC,WAAW,CAACgE;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAvFN,CALF,CADF;AAiGD,CA7MD;;AA+MA3E,OAAO,CAAC4E,SAAR,2CAAoBA,cAApB;eAEe5E,O"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
@value mobile from breakpoints;
|
|
23
23
|
@value tablet from breakpoints;
|
|
24
24
|
@value cm_grey_75 from colors;
|
|
25
|
+
@value negative_100 from colors;
|
|
25
26
|
|
|
26
27
|
.background {
|
|
27
28
|
top: 0px;
|
|
@@ -137,6 +138,30 @@
|
|
|
137
138
|
.popinHeader button {
|
|
138
139
|
position: absolute;
|
|
139
140
|
}
|
|
141
|
+
|
|
142
|
+
.headerContent {
|
|
143
|
+
display: flex;
|
|
144
|
+
width: 100%;
|
|
145
|
+
gap: 16px;
|
|
146
|
+
padding: 8px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.headerTitle {
|
|
150
|
+
width: 612px;
|
|
151
|
+
margin-bottom: 16px;
|
|
152
|
+
padding: 2px 0px 2px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.lockIcon {
|
|
156
|
+
height: 48px;
|
|
157
|
+
width: 48px;
|
|
158
|
+
background-color: negative_100;
|
|
159
|
+
border-radius: 16px;
|
|
160
|
+
min-width: 48px;
|
|
161
|
+
min-height: 48px;
|
|
162
|
+
color: cm_negative_200;
|
|
163
|
+
}
|
|
164
|
+
|
|
140
165
|
.descriptionText {
|
|
141
166
|
text-align: center;
|
|
142
167
|
font-family: Gilroy;
|
|
@@ -280,6 +305,13 @@ a {
|
|
|
280
305
|
padding: 0px 8px 0px 0px
|
|
281
306
|
}
|
|
282
307
|
|
|
308
|
+
.itemsContainer {
|
|
309
|
+
max-height: 369px;
|
|
310
|
+
overflow-y: auto;
|
|
311
|
+
width: 100%;
|
|
312
|
+
border-top: 1px solid cm_grey_100;
|
|
313
|
+
}
|
|
314
|
+
|
|
283
315
|
@media tablet {
|
|
284
316
|
.popin {
|
|
285
317
|
width: 80%;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { TitleProps } from '../../atom/title/types';
|
|
3
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
2
4
|
declare const propTypes: {
|
|
3
5
|
content: PropTypes.Requireable<string>;
|
|
4
6
|
mode: PropTypes.Requireable<string>;
|
|
5
|
-
header: PropTypes.Requireable<
|
|
7
|
+
header: PropTypes.Requireable<PropTypes.InferProps<{
|
|
8
|
+
title: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
|
+
title: PropTypes.Requireable<string>;
|
|
10
|
+
subtitle: PropTypes.Requireable<string>;
|
|
11
|
+
type: PropTypes.Requireable<string>;
|
|
12
|
+
'data-name': PropTypes.Requireable<string>;
|
|
13
|
+
titleSize: PropTypes.Requireable<string>;
|
|
14
|
+
subtitleSize: PropTypes.Requireable<string>;
|
|
15
|
+
}>>;
|
|
16
|
+
headerIcon: PropTypes.Requireable<string>;
|
|
17
|
+
backgroundImage: PropTypes.Requireable<string>;
|
|
18
|
+
}>>;
|
|
6
19
|
firstButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
20
|
label: PropTypes.Requireable<string>;
|
|
8
21
|
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -50,6 +63,18 @@ declare const propTypes: {
|
|
|
50
63
|
'data-name': PropTypes.Requireable<string>;
|
|
51
64
|
requiredSelection: PropTypes.Requireable<boolean>;
|
|
52
65
|
}> | null | undefined)[]>;
|
|
66
|
+
items: PropTypes.Requireable<PropTypes.InferProps<{
|
|
67
|
+
type: PropTypes.Requireable<string>;
|
|
68
|
+
list: PropTypes.Requireable<PropTypes.InferProps<{
|
|
69
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
70
|
+
loading: PropTypes.Requireable<boolean>;
|
|
71
|
+
}>>;
|
|
72
|
+
}>>;
|
|
73
|
+
};
|
|
74
|
+
declare type PopinHeaderProps = {
|
|
75
|
+
title: TitleProps;
|
|
76
|
+
backgroundImage: string;
|
|
77
|
+
headerIcon: string;
|
|
53
78
|
};
|
|
54
79
|
export declare type QuitPopinButton = {
|
|
55
80
|
'aria-label'?: string;
|
|
@@ -65,9 +90,14 @@ export declare type CMPopinProps = {
|
|
|
65
90
|
content: string;
|
|
66
91
|
icon: string;
|
|
67
92
|
mode: string;
|
|
93
|
+
popinHeader?: PopinHeaderProps;
|
|
68
94
|
descriptionText: string;
|
|
69
95
|
firstButton?: QuitPopinButton;
|
|
70
96
|
secondButton?: QuitPopinButton;
|
|
97
|
+
items?: {
|
|
98
|
+
type: string;
|
|
99
|
+
list: PropTypes.InferProps<typeof CardsGrid.propTypes>;
|
|
100
|
+
};
|
|
71
101
|
};
|
|
72
102
|
export default propTypes;
|
|
73
103
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cd,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACxD,CAAC;CACH,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,12 +9,20 @@ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
|
9
9
|
|
|
10
10
|
var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
|
|
11
11
|
|
|
12
|
+
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
13
|
+
|
|
14
|
+
var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
|
|
15
|
+
|
|
12
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
17
|
|
|
14
18
|
const propTypes = {
|
|
15
19
|
content: _propTypes.default.string,
|
|
16
|
-
mode: _propTypes.default.oneOf(['alert', 'information', 'cookie']),
|
|
17
|
-
header: _propTypes.default.
|
|
20
|
+
mode: _propTypes.default.oneOf(['alert', 'information', 'cookie', 'items']),
|
|
21
|
+
header: _propTypes.default.shape({
|
|
22
|
+
title: _propTypes.default.shape(_title.default.propTypes),
|
|
23
|
+
headerIcon: _propTypes.default.string,
|
|
24
|
+
backgroundImage: _propTypes.default.string
|
|
25
|
+
}),
|
|
18
26
|
firstButton: _propTypes.default.shape({
|
|
19
27
|
label: _propTypes.default.string,
|
|
20
28
|
handleOnclick: _propTypes.default.func,
|
|
@@ -45,7 +53,11 @@ const propTypes = {
|
|
|
45
53
|
descriptionText: _propTypes.default.string,
|
|
46
54
|
cookieTitle: _propTypes.default.string,
|
|
47
55
|
descriptionBtnTxt: _propTypes.default.string,
|
|
48
|
-
listBtnSwicth: _propTypes.default.arrayOf(_propTypes.default.shape(_inputSwitch.default.propTypes))
|
|
56
|
+
listBtnSwicth: _propTypes.default.arrayOf(_propTypes.default.shape(_inputSwitch.default.propTypes)),
|
|
57
|
+
items: _propTypes.default.shape({
|
|
58
|
+
type: _propTypes.default.string,
|
|
59
|
+
list: _propTypes.default.shape(_cardsGrid.default.propTypes)
|
|
60
|
+
})
|
|
49
61
|
};
|
|
50
62
|
var _default = propTypes;
|
|
51
63
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["propTypes","content","PropTypes","string","mode","oneOf","header","
|
|
1
|
+
{"version":3,"file":"types.js","names":["propTypes","content","PropTypes","string","mode","oneOf","header","shape","title","Title","headerIcon","backgroundImage","firstButton","label","handleOnclick","func","largeButton","bool","type","customStyle","Cta","secondButton","thirdButton","onClose","icon","backgroundImageUrl","descriptionText","cookieTitle","descriptionBtnTxt","listBtnSwicth","arrayOf","InputSwitch","items","list","CardsGrid"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Cta from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport {TitleProps} from '../../atom/title/types';\nimport CardsGrid from '../../organism/cards-grid';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items']),\n header: PropTypes.shape({\n title: PropTypes.shape(Title.propTypes),\n headerIcon: PropTypes.string,\n backgroundImage: PropTypes.string\n }),\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: Cta.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes)),\n items: PropTypes.shape({\n type: PropTypes.string,\n list: PropTypes.shape(CardsGrid.propTypes)\n })\n};\n\ntype PopinHeaderProps = {\n title: TitleProps;\n backgroundImage: string;\n headerIcon: string;\n};\n\nexport type QuitPopinButton = {\n 'aria-label'?: string;\n label: string;\n type: string;\n customStyle?: {\n backgroundColor?: string;\n color?: string;\n };\n handleOnclick: () => void;\n};\n\nexport type CMPopinProps = {\n content: string;\n icon: string;\n mode: string;\n popinHeader?: PopinHeaderProps;\n descriptionText: string;\n firstButton?: QuitPopinButton;\n secondButton?: QuitPopinButton;\n items?: {\n type: string;\n list: PropTypes.InferProps<typeof CardsGrid.propTypes>;\n };\n};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,OAAO,EAAEC,kBAAA,CAAUC,MADH;EAEhBC,IAAI,EAAEF,kBAAA,CAAUG,KAAV,CAAgB,CAAC,OAAD,EAAU,aAAV,EAAyB,QAAzB,EAAmC,OAAnC,CAAhB,CAFU;EAGhBC,MAAM,EAAEJ,kBAAA,CAAUK,KAAV,CAAgB;IACtBC,KAAK,EAAEN,kBAAA,CAAUK,KAAV,CAAgBE,cAAA,CAAMT,SAAtB,CADe;IAEtBU,UAAU,EAAER,kBAAA,CAAUC,M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AxBG;EAgChBI,OAAO,EAAErB,kBAAA,CAAUa,IAhCH;EAiChBS,IAAI,EAAEtB,kBAAA,CAAUC,MAjCA;EAkChBsB,kBAAkB,EAAEvB,kBAAA,CAAUC,MAlCd;EAmChBuB,eAAe,EAAExB,kBAAA,CAAUC,MAnCX;EAoChBwB,WAAW,EAAEzB,kBAAA,CAAUC,MApCP;EAqChByB,iBAAiB,EAAE1B,kBAAA,CAAUC,MArCb;EAsChB0B,aAAa,EAAE3B,kBAAA,CAAU4B,OAAV,CAAkB5B,kBAAA,CAAUK,KAAV,CAAgBwB,oBAAA,CAAY/B,SAA5B,CAAlB,CAtCC;EAuChBgC,KAAK,EAAE9B,kBAAA,CAAUK,KAAV,CAAgB;IACrBW,IAAI,EAAEhB,kBAAA,CAAUC,MADK;IAErB8B,IAAI,EAAE/B,kBAAA,CAAUK,KAAV,CAAgB2B,kBAAA,CAAUlC,SAA1B;EAFe,CAAhB;AAvCS,CAAlB;eA4EeA,S"}
|
|
@@ -1,17 +1,73 @@
|
|
|
1
1
|
export default CardsList;
|
|
2
2
|
declare class CardsList extends React.PureComponent<any, any, any> {
|
|
3
|
+
/**
|
|
4
|
+
* IMPORTANT: update prop-types.ts too, 1st a migration of tests
|
|
5
|
+
* is intended, then, a TS + functional refactor is planned.
|
|
6
|
+
*/
|
|
3
7
|
static propTypes: {
|
|
4
8
|
contentType: PropTypes.Requireable<string>;
|
|
5
9
|
dataName: PropTypes.Requireable<string>;
|
|
6
10
|
title: PropTypes.Requireable<string>;
|
|
7
11
|
showMore: PropTypes.Requireable<string>;
|
|
8
|
-
cards: PropTypes.Requireable<(PropTypes.InferProps<
|
|
12
|
+
cards: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
13
|
+
badge: PropTypes.Requireable<string>;
|
|
14
|
+
image: PropTypes.Requireable<string>;
|
|
15
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
16
|
+
adaptiv: PropTypes.Requireable<boolean>;
|
|
17
|
+
type: PropTypes.Requireable<string>;
|
|
18
|
+
title: PropTypes.Requireable<string>;
|
|
19
|
+
author: PropTypes.Requireable<string>;
|
|
20
|
+
certifiedAuthor: PropTypes.Requireable<boolean>;
|
|
21
|
+
customer: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
|
+
theme: PropTypes.Requireable<string>;
|
|
23
|
+
type: PropTypes.Requireable<string>;
|
|
24
|
+
name: PropTypes.Requireable<string>;
|
|
25
|
+
coorpOriginal: PropTypes.Validator<boolean>;
|
|
26
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
28
|
+
}>>;
|
|
29
|
+
progress: PropTypes.Requireable<number>;
|
|
30
|
+
favorite: PropTypes.Requireable<boolean>;
|
|
31
|
+
addFavoriteToolTip: PropTypes.Requireable<string>;
|
|
32
|
+
removeFavoriteToolTip: PropTypes.Requireable<string>;
|
|
33
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
+
onFavoriteClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
+
isSelected: PropTypes.Requireable<boolean>;
|
|
36
|
+
notification: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
+
message: PropTypes.Validator<string>;
|
|
38
|
+
icon: PropTypes.Validator<string>;
|
|
39
|
+
}>>;
|
|
40
|
+
badgeCategory: PropTypes.Requireable<string>;
|
|
41
|
+
badgeLabel: PropTypes.Requireable<string>;
|
|
42
|
+
theme: PropTypes.Requireable<string>;
|
|
43
|
+
disabledContent: PropTypes.Requireable<string>;
|
|
44
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
45
|
+
'background-aria-label': PropTypes.Requireable<string>;
|
|
46
|
+
'favorite-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
47
|
+
favorite: PropTypes.Requireable<string>;
|
|
48
|
+
addToFavorite: PropTypes.Requireable<string>;
|
|
49
|
+
removeFromFavorite: PropTypes.Requireable<string>;
|
|
50
|
+
}>>;
|
|
51
|
+
'selectable-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
52
|
+
select: PropTypes.Requireable<string>;
|
|
53
|
+
unSelect: PropTypes.Requireable<string>;
|
|
54
|
+
}>>;
|
|
55
|
+
'customer-aria-label': PropTypes.Requireable<string>;
|
|
56
|
+
'badge-aria-label': PropTypes.Requireable<string>;
|
|
57
|
+
'disabled-aria-label': PropTypes.Requireable<string>;
|
|
58
|
+
'card-content-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
59
|
+
author: PropTypes.Requireable<string>;
|
|
60
|
+
progression: PropTypes.Requireable<string>;
|
|
61
|
+
adaptive: PropTypes.Requireable<string>;
|
|
62
|
+
}>>;
|
|
63
|
+
}> | null | undefined)[]>;
|
|
9
64
|
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
65
|
onShowMore: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
66
|
'arrows-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
67
|
showMoreOnLeftAriaLabel: PropTypes.Requireable<string>;
|
|
13
68
|
showMoreOnRightAriaLabel: PropTypes.Requireable<string>;
|
|
14
69
|
}>>;
|
|
70
|
+
testingSizes: PropTypes.Requireable<any>;
|
|
15
71
|
};
|
|
16
72
|
static contextTypes: {
|
|
17
73
|
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAkCC;IA/BC;;;;;;;;MAQC;IAED,0DAAgE;IAsHlE,qBAiBC;IAED,qBAGC;IAED,sBAGC;IAED,0BASC;IAvJC,uEAA6D;IAyJ/D,mCAIC;IA5DD,oCAMC;IAGD,sCAIC;IA5DD,qBAGC;IAnCD,0BAMC;IAED,2BAYC;IAED,6BAOC;IASD,wCAuCC;IAGC,kBAA2B;IA6D7B,sBAkGC;CACF"}
|
|
@@ -37,10 +37,14 @@ var _novaIcons = require("@coorpacademy/nova-icons");
|
|
|
37
37
|
|
|
38
38
|
var _provider = _interopRequireDefault(require("../../../atom/provider"));
|
|
39
39
|
|
|
40
|
-
var _card =
|
|
40
|
+
var _card = _interopRequireWildcard(require("../../card"));
|
|
41
41
|
|
|
42
42
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
43
43
|
|
|
44
|
+
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); }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
44
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
49
|
|
|
46
50
|
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); }
|
|
@@ -114,6 +118,10 @@ IconView.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
114
118
|
} : {};
|
|
115
119
|
|
|
116
120
|
class CardsList extends _react.default.PureComponent {
|
|
121
|
+
/**
|
|
122
|
+
* IMPORTANT: update prop-types.ts too, 1st a migration of tests
|
|
123
|
+
* is intended, then, a TS + functional refactor is planned.
|
|
124
|
+
*/
|
|
117
125
|
constructor(props) {
|
|
118
126
|
super(props);
|
|
119
127
|
this.state = {
|
|
@@ -134,7 +142,22 @@ class CardsList extends _react.default.PureComponent {
|
|
|
134
142
|
this.updatePages = this.updatePages.bind(this);
|
|
135
143
|
this.setCardsWrapper = this.setCardsWrapper.bind(this);
|
|
136
144
|
this.getScrollWidth = this.getScrollWidth.bind(this);
|
|
137
|
-
this.handleResize = this.handleResize.bind(this);
|
|
145
|
+
this.handleResize = this.handleResize.bind(this); // for testing purposes only - no other way to test this polluted component
|
|
146
|
+
|
|
147
|
+
if (props.testingSizes) {
|
|
148
|
+
const {
|
|
149
|
+
offsetWidth,
|
|
150
|
+
scrollLeft,
|
|
151
|
+
maxPages,
|
|
152
|
+
possiblePages,
|
|
153
|
+
possiblePositions
|
|
154
|
+
} = props.testingSizes;
|
|
155
|
+
this.state.offsetWidth = offsetWidth;
|
|
156
|
+
this.state.scrollLeft = scrollLeft;
|
|
157
|
+
this.state.maxPages = maxPages;
|
|
158
|
+
this.state.possiblePages = possiblePages;
|
|
159
|
+
this.state.possiblePositions = possiblePositions;
|
|
160
|
+
}
|
|
138
161
|
}
|
|
139
162
|
|
|
140
163
|
componentDidMount() {
|
|
@@ -173,6 +196,8 @@ class CardsList extends _react.default.PureComponent {
|
|
|
173
196
|
|
|
174
197
|
this.updateState.cancel();
|
|
175
198
|
}
|
|
199
|
+
/* istanbul ignore next */
|
|
200
|
+
|
|
176
201
|
|
|
177
202
|
handleResize() {
|
|
178
203
|
const {
|
|
@@ -180,6 +205,8 @@ class CardsList extends _react.default.PureComponent {
|
|
|
180
205
|
} = this.props;
|
|
181
206
|
this.updatePaginationState(cards);
|
|
182
207
|
}
|
|
208
|
+
/* istanbul ignore next */
|
|
209
|
+
|
|
183
210
|
|
|
184
211
|
updatePaginationState(cards) {
|
|
185
212
|
const {
|
|
@@ -214,6 +241,8 @@ class CardsList extends _react.default.PureComponent {
|
|
|
214
241
|
offsetWidth: this.cardsWrapper?.offsetWidth
|
|
215
242
|
});
|
|
216
243
|
}
|
|
244
|
+
/* istanbul ignore next */
|
|
245
|
+
|
|
217
246
|
|
|
218
247
|
getScrollWidth(index) {
|
|
219
248
|
const {
|
|
@@ -222,6 +251,8 @@ class CardsList extends _react.default.PureComponent {
|
|
|
222
251
|
const card = cards[index];
|
|
223
252
|
return computeWidth(card);
|
|
224
253
|
}
|
|
254
|
+
/* istanbul ignore next */
|
|
255
|
+
|
|
225
256
|
|
|
226
257
|
handleScroll() {
|
|
227
258
|
const scrollLeft = this.cardsWrapper?.scrollLeft;
|
|
@@ -357,7 +388,11 @@ class CardsList extends _react.default.PureComponent {
|
|
|
357
388
|
}, showMoreView, leftArrowView, rightArrowView) : null;
|
|
358
389
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
359
390
|
className: _style.default.wrapper,
|
|
360
|
-
"data-name": "cardsList"
|
|
391
|
+
"data-name": "cardsList",
|
|
392
|
+
"data-max-pages": `${maxPages}` // eslint-disable-next-line react/destructuring-assignment
|
|
393
|
+
,
|
|
394
|
+
"data-actual-page": `${this.state.actualPage}`,
|
|
395
|
+
"data-scroll-left": this.cardsWrapper?.scrollLeft
|
|
361
396
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
362
397
|
className: _style.default.list
|
|
363
398
|
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -365,6 +400,7 @@ class CardsList extends _react.default.PureComponent {
|
|
|
365
400
|
className: _style.default.header
|
|
366
401
|
}, titleView, switchPagesView), /*#__PURE__*/_react.default.createElement("div", {
|
|
367
402
|
className: _style.default.cards,
|
|
403
|
+
"data-testid": "cards-view-wrapper",
|
|
368
404
|
ref: this.setCardsWrapper
|
|
369
405
|
}, cardsView))));
|
|
370
406
|
}
|
|
@@ -380,13 +416,15 @@ CardsList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
380
416
|
dataName: _propTypes.default.string,
|
|
381
417
|
title: _propTypes.default.string,
|
|
382
418
|
showMore: _propTypes.default.string,
|
|
383
|
-
cards: _propTypes.default.arrayOf(_propTypes.default.shape(_card.
|
|
419
|
+
cards: _propTypes.default.arrayOf(_propTypes.default.shape(_card.cardPropTypes)),
|
|
384
420
|
onScroll: _propTypes.default.func,
|
|
385
421
|
onShowMore: _propTypes.default.func,
|
|
386
422
|
'arrows-aria-label': _propTypes.default.shape({
|
|
387
423
|
showMoreOnLeftAriaLabel: _propTypes.default.string,
|
|
388
424
|
showMoreOnRightAriaLabel: _propTypes.default.string
|
|
389
|
-
})
|
|
425
|
+
}),
|
|
426
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
427
|
+
testingSizes: _propTypes.default.any
|
|
390
428
|
} : {};
|
|
391
429
|
var _default = CardsList;
|
|
392
430
|
exports.default = _default;
|