@coorpacademy/components 10.4.6 → 10.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/autocomplete/style.css +4 -4
- package/es/atom/button/style.css +1 -1
- package/es/atom/card-image-preview/test/fixtures.js +15 -0
- package/es/atom/card-image-preview/test/fixtures.js.map +1 -0
- package/es/atom/catalog-section/style.css +1 -1
- package/es/atom/clue/style.css +2 -2
- package/es/atom/cta/style.css +1 -1
- package/es/atom/difficulty-level/style.css +1 -1
- package/es/atom/drag-and-drop/style.css +6 -5
- package/es/atom/input-checkbox/style.css +1 -1
- package/es/atom/input-doublestep/style.css +5 -5
- package/es/atom/input-html/input-preview.css +2 -2
- package/es/atom/input-html/style.css +2 -2
- package/es/atom/input-readonly/style.css +3 -3
- package/es/atom/input-search/style.css +1 -1
- package/es/atom/input-switch/style.css +2 -2
- package/es/atom/input-text/style.css +5 -5
- package/es/atom/input-textarea/style.css +5 -5
- package/es/atom/life/style.css +1 -1
- package/es/atom/notification/style.css +1 -1
- package/es/atom/radio-group/item.css +1 -1
- package/es/atom/resource-miniature/style.css +1 -1
- package/es/atom/select/style.css +7 -7
- package/es/atom/slide/style.css +1 -1
- package/es/molecule/add-to-my-list/style.css +3 -3
- package/es/molecule/audio/style.css +1 -1
- package/es/molecule/battle-request/style.css +4 -4
- package/es/molecule/brand-card/description.css +1 -1
- package/es/molecule/brand-card/style.css +2 -2
- package/es/molecule/brand-card-create/style.css +1 -1
- package/es/molecule/brand-create-form/style.css +6 -6
- package/es/molecule/brand-download-box/style.css +2 -2
- package/es/molecule/brand-tabs/style.css +1 -1
- package/es/molecule/brand-upload-box/style.css +2 -2
- package/es/molecule/breadcrumbs/style.css +3 -3
- package/es/molecule/card/customer.css +1 -1
- package/es/molecule/card/favorite.css +1 -1
- package/es/molecule/card/notification.css +1 -1
- package/es/molecule/card/style.css +1 -1
- package/es/molecule/card/test/fixtures.js +2 -0
- package/es/molecule/card/test/fixtures.js.map +1 -1
- package/es/molecule/card-content/style.css +4 -4
- package/es/molecule/card-with-button/style.css +2 -2
- package/es/molecule/cookie-banner/style.css +2 -2
- package/es/molecule/course-section/index.js +60 -0
- package/es/molecule/course-section/index.js.map +1 -0
- package/es/molecule/course-section/style.css +65 -0
- package/es/molecule/course-section/test/fixtures/chapter.js +17 -0
- package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -0
- package/es/molecule/course-section/test/fixtures/course.js +17 -0
- package/es/molecule/course-section/test/fixtures/course.js.map +1 -0
- package/es/molecule/dashboard/cards-list/style.css +2 -2
- package/es/molecule/dashboard/news-list/style.css +2 -2
- package/es/molecule/dashboard/start-battle/style.css +4 -4
- package/es/molecule/discipline-cta/style.css +2 -2
- package/es/molecule/discipline-header/style.css +4 -4
- package/es/molecule/discipline-partners/style.css +2 -2
- package/es/molecule/drag-and-drop/common.css +1 -1
- package/es/molecule/drag-and-drop/overlay.css +1 -1
- package/es/molecule/drag-and-drop/style.css +1 -1
- package/es/molecule/drag-and-drop/upload-report.css +4 -4
- package/es/molecule/draggable/index.js +56 -0
- package/es/molecule/draggable/index.js.map +1 -0
- package/es/molecule/draggable/style.css +77 -0
- package/es/molecule/draggable/test/fixtures/default.js +12 -0
- package/es/molecule/draggable/test/fixtures/default.js.map +1 -0
- package/es/molecule/draggable/test/fixtures.js +13 -0
- package/es/molecule/draggable/test/fixtures.js.map +1 -0
- package/es/molecule/external-content-button/style.css +2 -2
- package/es/molecule/feedback/style.css +3 -3
- package/es/molecule/filters/filters-wapper.css +2 -2
- package/es/molecule/filters/style.css +2 -2
- package/es/molecule/forum/forum-comment/style.css +1 -1
- package/es/molecule/forum/forum-post/style.css +5 -5
- package/es/molecule/menu-list/style.css +1 -1
- package/es/molecule/message-popin/style.css +2 -2
- package/es/molecule/modal/style.css +2 -2
- package/es/molecule/module-card/style.css +2 -2
- package/es/molecule/news/style.css +3 -3
- package/es/molecule/notification-banner/style.css +3 -3
- package/es/molecule/pagination/style.css +1 -1
- package/es/molecule/payment-form/index.js +2 -2
- package/es/molecule/payment-form/index.js.map +1 -1
- package/es/molecule/pdf/style.css +2 -2
- package/es/molecule/popin/style.css +2 -2
- package/es/molecule/progress-bar/style.css +1 -1
- package/es/molecule/questions/free-text/style.css +1 -1
- package/es/molecule/questions/qcm/style.css +1 -1
- package/es/molecule/questions/qcm-drag/style.css +2 -2
- package/es/molecule/questions/qcm-graphic/style.css +1 -1
- package/es/molecule/questions/question-range/style.css +2 -2
- package/es/molecule/questions/template/style.css +1 -1
- package/es/molecule/resource-player/style.css +1 -1
- package/es/molecule/scope-content/style.css +6 -6
- package/es/molecule/scope-tabs/style.css +1 -1
- package/es/molecule/select-multiple/style.css +2 -2
- package/es/molecule/setup-cohort-item/style.css +1 -1
- package/es/molecule/setup-section/index.js +2 -23
- package/es/molecule/setup-section/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +3 -28
- package/es/molecule/setup-sections/index.js +3 -55
- package/es/molecule/setup-sections/index.js.map +1 -1
- package/es/molecule/setup-sections/style.css +0 -52
- package/es/molecule/setup-sections/test/on-drop.js +1 -1
- package/es/molecule/setup-sections/test/on-drop.js.map +1 -1
- package/es/molecule/share/style.css +3 -3
- package/es/molecule/ssmenu-list/style.css +1 -1
- package/es/molecule/table/style.css +5 -5
- package/es/molecule/teams-popin/style.css +2 -2
- package/es/molecule/titled-checkbox/style.css +1 -1
- package/es/molecule/video-player/jwplayer.css +1 -1
- package/es/molecule/wizard-summary/index.js +5 -5
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/organism/accordion/part/style.css +1 -1
- package/es/organism/brand-analytics/analytics-popin.css +1 -0
- package/es/organism/brand-analytics/style.css +1 -1
- package/es/organism/brand-table/style.css +2 -2
- package/es/organism/brand-upload/style.css +2 -2
- package/es/organism/discussion/style.css +1 -1
- package/es/organism/get-the-app/style.css +1 -1
- package/es/organism/hero/style.css +1 -1
- package/es/organism/mooc-footer/style.css +2 -2
- package/es/organism/mooc-header/style.css +8 -8
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/organism/popin/style.css +1 -0
- package/es/organism/sidebar/style.css +2 -2
- package/es/organism/user-preferences/style.css +1 -1
- package/es/template/activity/engine-stars.css +3 -3
- package/es/template/activity/progression-item.css +5 -4
- package/es/template/activity/stars-summary.css +2 -2
- package/es/template/activity/style.css +3 -3
- package/es/template/app-player/player/slides/footer/style.css +1 -1
- package/es/template/app-player/player/slides/header/learner.css +4 -4
- package/es/template/app-player/player/slides/header/microlearning.css +1 -1
- package/es/template/app-player/player/slides/style.css +9 -8
- package/es/template/app-player/popin-correction/style.css +3 -3
- package/es/template/app-player/popin-end/summary.css +4 -4
- package/es/template/app-player/popin-end/test/fixtures.js +2 -0
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/es/template/app-player/popin-header/style.css +5 -5
- package/es/template/back-office/dashboard-preview/dashboard-popin.css +1 -0
- package/es/template/back-office/dashboard-preview/style.css +1 -1
- package/es/template/cockpit/jw-uploader/style.css +1 -0
- package/es/template/common/authors/style.css +5 -4
- package/es/template/common/layout.css +1 -1
- package/es/template/common/search-page/style.css +2 -1
- package/es/template/external-course/style.css +1 -1
- package/es/variables/fonts.css +1 -1
- package/lib/atom/autocomplete/style.css +4 -4
- package/lib/atom/button/style.css +1 -1
- package/lib/atom/card-image-preview/test/fixtures.js +25 -0
- package/lib/atom/card-image-preview/test/fixtures.js.map +1 -0
- package/lib/atom/catalog-section/style.css +1 -1
- package/lib/atom/clue/style.css +2 -2
- package/lib/atom/cta/style.css +1 -1
- package/lib/atom/difficulty-level/style.css +1 -1
- package/lib/atom/drag-and-drop/style.css +6 -5
- package/lib/atom/input-checkbox/style.css +1 -1
- package/lib/atom/input-doublestep/style.css +5 -5
- package/lib/atom/input-html/input-preview.css +2 -2
- package/lib/atom/input-html/style.css +2 -2
- package/lib/atom/input-readonly/style.css +3 -3
- package/lib/atom/input-search/style.css +1 -1
- package/lib/atom/input-switch/style.css +2 -2
- package/lib/atom/input-text/style.css +5 -5
- package/lib/atom/input-textarea/style.css +5 -5
- package/lib/atom/life/style.css +1 -1
- package/lib/atom/notification/style.css +1 -1
- package/lib/atom/radio-group/item.css +1 -1
- package/lib/atom/resource-miniature/style.css +1 -1
- package/lib/atom/select/style.css +7 -7
- package/lib/atom/slide/style.css +1 -1
- package/lib/molecule/add-to-my-list/style.css +3 -3
- package/lib/molecule/audio/style.css +1 -1
- package/lib/molecule/battle-request/style.css +4 -4
- package/lib/molecule/brand-card/description.css +1 -1
- package/lib/molecule/brand-card/style.css +2 -2
- package/lib/molecule/brand-card-create/style.css +1 -1
- package/lib/molecule/brand-create-form/style.css +6 -6
- package/lib/molecule/brand-download-box/style.css +2 -2
- package/lib/molecule/brand-tabs/style.css +1 -1
- package/lib/molecule/brand-upload-box/style.css +2 -2
- package/lib/molecule/breadcrumbs/style.css +3 -3
- package/lib/molecule/card/customer.css +1 -1
- package/lib/molecule/card/favorite.css +1 -1
- package/lib/molecule/card/notification.css +1 -1
- package/lib/molecule/card/style.css +1 -1
- package/lib/molecule/card/test/fixtures.js +3 -0
- package/lib/molecule/card/test/fixtures.js.map +1 -1
- package/lib/molecule/card-content/style.css +4 -4
- package/lib/molecule/card-with-button/style.css +2 -2
- package/lib/molecule/cookie-banner/style.css +2 -2
- package/lib/molecule/course-section/index.js +72 -0
- package/lib/molecule/course-section/index.js.map +1 -0
- package/lib/molecule/course-section/style.css +65 -0
- package/lib/molecule/course-section/test/fixtures/chapter.js +22 -0
- package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -0
- package/lib/molecule/course-section/test/fixtures/course.js +22 -0
- package/lib/molecule/course-section/test/fixtures/course.js.map +1 -0
- package/lib/molecule/dashboard/cards-list/style.css +2 -2
- package/lib/molecule/dashboard/news-list/style.css +2 -2
- package/lib/molecule/dashboard/start-battle/style.css +4 -4
- package/lib/molecule/discipline-cta/style.css +2 -2
- package/lib/molecule/discipline-header/style.css +4 -4
- package/lib/molecule/discipline-partners/style.css +2 -2
- package/lib/molecule/drag-and-drop/common.css +1 -1
- package/lib/molecule/drag-and-drop/overlay.css +1 -1
- package/lib/molecule/drag-and-drop/style.css +1 -1
- package/lib/molecule/drag-and-drop/upload-report.css +4 -4
- package/lib/molecule/draggable/index.js +71 -0
- package/lib/molecule/draggable/index.js.map +1 -0
- package/lib/molecule/draggable/style.css +77 -0
- package/lib/molecule/draggable/test/fixtures/default.js +17 -0
- package/lib/molecule/draggable/test/fixtures/default.js.map +1 -0
- package/lib/molecule/draggable/test/fixtures.js +22 -0
- package/lib/molecule/draggable/test/fixtures.js.map +1 -0
- package/lib/molecule/external-content-button/style.css +2 -2
- package/lib/molecule/feedback/style.css +3 -3
- package/lib/molecule/filters/filters-wapper.css +2 -2
- package/lib/molecule/filters/style.css +2 -2
- package/lib/molecule/forum/forum-comment/style.css +1 -1
- package/lib/molecule/forum/forum-post/style.css +5 -5
- package/lib/molecule/menu-list/style.css +1 -1
- package/lib/molecule/message-popin/style.css +2 -2
- package/lib/molecule/modal/style.css +2 -2
- package/lib/molecule/module-card/style.css +2 -2
- package/lib/molecule/news/style.css +3 -3
- package/lib/molecule/notification-banner/style.css +3 -3
- package/lib/molecule/pagination/style.css +1 -1
- package/lib/molecule/payment-form/index.js +2 -2
- package/lib/molecule/payment-form/index.js.map +1 -1
- package/lib/molecule/pdf/style.css +2 -2
- package/lib/molecule/popin/style.css +2 -2
- package/lib/molecule/progress-bar/style.css +1 -1
- package/lib/molecule/questions/free-text/style.css +1 -1
- package/lib/molecule/questions/qcm/style.css +1 -1
- package/lib/molecule/questions/qcm-drag/style.css +2 -2
- package/lib/molecule/questions/qcm-graphic/style.css +1 -1
- package/lib/molecule/questions/question-range/style.css +2 -2
- package/lib/molecule/questions/template/style.css +1 -1
- package/lib/molecule/resource-player/style.css +1 -1
- package/lib/molecule/scope-content/style.css +6 -6
- package/lib/molecule/scope-tabs/style.css +1 -1
- package/lib/molecule/select-multiple/style.css +2 -2
- package/lib/molecule/setup-cohort-item/style.css +1 -1
- package/lib/molecule/setup-section/index.js +2 -21
- package/lib/molecule/setup-section/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +3 -28
- package/lib/molecule/setup-sections/index.js +3 -55
- package/lib/molecule/setup-sections/index.js.map +1 -1
- package/lib/molecule/setup-sections/style.css +0 -52
- package/lib/molecule/setup-sections/test/on-drop.js +1 -1
- package/lib/molecule/setup-sections/test/on-drop.js.map +1 -1
- package/lib/molecule/share/style.css +3 -3
- package/lib/molecule/ssmenu-list/style.css +1 -1
- package/lib/molecule/table/style.css +5 -5
- package/lib/molecule/teams-popin/style.css +2 -2
- package/lib/molecule/titled-checkbox/style.css +1 -1
- package/lib/molecule/video-player/jwplayer.css +1 -1
- package/lib/molecule/wizard-summary/index.js +5 -5
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/organism/accordion/part/style.css +1 -1
- package/lib/organism/brand-analytics/analytics-popin.css +1 -0
- package/lib/organism/brand-analytics/style.css +1 -1
- package/lib/organism/brand-table/style.css +2 -2
- package/lib/organism/brand-upload/style.css +2 -2
- package/lib/organism/discussion/style.css +1 -1
- package/lib/organism/get-the-app/style.css +1 -1
- package/lib/organism/hero/style.css +1 -1
- package/lib/organism/mooc-footer/style.css +2 -2
- package/lib/organism/mooc-header/style.css +8 -8
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/organism/popin/style.css +1 -0
- package/lib/organism/sidebar/style.css +2 -2
- package/lib/organism/user-preferences/style.css +1 -1
- package/lib/template/activity/engine-stars.css +3 -3
- package/lib/template/activity/progression-item.css +5 -4
- package/lib/template/activity/stars-summary.css +2 -2
- package/lib/template/activity/style.css +3 -3
- package/lib/template/app-player/player/slides/footer/style.css +1 -1
- package/lib/template/app-player/player/slides/header/learner.css +4 -4
- package/lib/template/app-player/player/slides/header/microlearning.css +1 -1
- package/lib/template/app-player/player/slides/style.css +9 -8
- package/lib/template/app-player/popin-correction/style.css +3 -3
- package/lib/template/app-player/popin-end/summary.css +4 -4
- package/lib/template/app-player/popin-end/test/fixtures.js +3 -0
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/lib/template/app-player/popin-header/style.css +5 -5
- package/lib/template/back-office/dashboard-preview/dashboard-popin.css +1 -0
- package/lib/template/back-office/dashboard-preview/style.css +1 -1
- package/lib/template/cockpit/jw-uploader/style.css +1 -0
- package/lib/template/common/authors/style.css +5 -4
- package/lib/template/common/layout.css +1 -1
- package/lib/template/common/search-page/style.css +2 -1
- package/lib/template/external-course/style.css +1 -1
- package/lib/variables/fonts.css +1 -1
- package/package.json +2 -2
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
.title {
|
|
34
34
|
display: inline-block;
|
|
35
|
-
font-family: "
|
|
35
|
+
font-family: "Gilroy";
|
|
36
36
|
font-weight: 600;
|
|
37
37
|
font-size: 20px;
|
|
38
38
|
color: dark;
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
padding: 3px 13px;
|
|
48
48
|
background: dark;
|
|
49
49
|
border-radius: 15px;
|
|
50
|
-
font-family: "
|
|
50
|
+
font-family: "Gilroy";
|
|
51
51
|
font-weight: 800;
|
|
52
52
|
font-size: 10px;
|
|
53
53
|
color: white;
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
display: inline-block;
|
|
59
59
|
vertical-align: top;
|
|
60
60
|
width: 50%;
|
|
61
|
-
font-family: "
|
|
61
|
+
font-family: "Gilroy";
|
|
62
62
|
font-size: 12px;
|
|
63
63
|
padding-right: 40px;
|
|
64
64
|
color: grey;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.coltitle {
|
|
68
|
-
font-family: "
|
|
68
|
+
font-family: "Gilroy";
|
|
69
69
|
font-weight: 800;
|
|
70
70
|
text-transform: uppercase;
|
|
71
71
|
margin-bottom: 15px;
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
.dottedlist li {
|
|
92
92
|
line-height: 26px;
|
|
93
93
|
font-size: 14px;
|
|
94
|
-
font-family: "
|
|
94
|
+
font-family: "Gilroy";
|
|
95
95
|
color: dark;
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
.roundedlist li {
|
|
107
107
|
line-height: 26px;
|
|
108
108
|
font-size: 14px;
|
|
109
|
-
font-family: "
|
|
109
|
+
font-family: "Gilroy";
|
|
110
110
|
color: dark;
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.title {
|
|
59
|
-
font-family: "
|
|
59
|
+
font-family: "Gilroy";
|
|
60
60
|
font-size: 15px;
|
|
61
61
|
text-transform: none;
|
|
62
62
|
color: dark;
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.description {
|
|
132
|
-
font-family: '
|
|
132
|
+
font-family: 'Gilroy';
|
|
133
133
|
font-weight: 500;
|
|
134
134
|
font-size: 12px;
|
|
135
135
|
color: medium;
|
|
@@ -4,7 +4,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { NovaCompositionNavigationArrowDown as ArrowDownIcon, NovaCompositionNavigationArrowTop as ArrowUpIcon } from '@coorpacademy/nova-icons';
|
|
8
7
|
import Provider from '../../atom/provider';
|
|
9
8
|
import InputSwitch from '../../atom/input-switch';
|
|
10
9
|
import RadioGroup from '../../atom/radio-group';
|
|
@@ -45,23 +44,13 @@ ContentTypesToggler.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
45
44
|
|
|
46
45
|
const SetupSection = (props, context) => {
|
|
47
46
|
const {
|
|
48
|
-
translate
|
|
49
|
-
skin
|
|
47
|
+
translate
|
|
50
48
|
} = context;
|
|
51
|
-
|
|
52
|
-
const brand = _get('common.brand', skin);
|
|
53
|
-
|
|
54
|
-
const medium = _get('common.medium', skin);
|
|
55
|
-
|
|
56
49
|
const {
|
|
57
50
|
title,
|
|
58
|
-
onUp,
|
|
59
|
-
onDown,
|
|
60
51
|
display,
|
|
61
52
|
contentTypes
|
|
62
53
|
} = props;
|
|
63
|
-
const colorUp = onDown ? brand : medium;
|
|
64
|
-
const colorDown = onUp ? brand : medium;
|
|
65
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
55
|
className: style.wrapper
|
|
67
56
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -72,17 +61,7 @@ const SetupSection = (props, context) => {
|
|
|
72
61
|
contentTypes: contentTypes
|
|
73
62
|
}), /*#__PURE__*/React.createElement("div", {
|
|
74
63
|
className: style.label
|
|
75
|
-
}, translate('Show')), /*#__PURE__*/React.createElement(InputSwitch, display)
|
|
76
|
-
className: style.arrowSection
|
|
77
|
-
}, /*#__PURE__*/React.createElement(ArrowDownIcon, {
|
|
78
|
-
color: colorUp,
|
|
79
|
-
className: onDown ? style.arrow : style.disabled,
|
|
80
|
-
onClick: onDown
|
|
81
|
-
}), /*#__PURE__*/React.createElement(ArrowUpIcon, {
|
|
82
|
-
color: colorDown,
|
|
83
|
-
className: onUp ? style.arrow : style.disabled,
|
|
84
|
-
onClick: onUp
|
|
85
|
-
}))));
|
|
64
|
+
}, translate('Show')), /*#__PURE__*/React.createElement(InputSwitch, display)));
|
|
86
65
|
};
|
|
87
66
|
|
|
88
67
|
SetupSection.contextTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-section/index.js"],"names":["React","PropTypes","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-section/index.js"],"names":["React","PropTypes","Provider","InputSwitch","RadioGroup","style","ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","contentTypeWrapper","contextTypes","childContextTypes","propTypes","shape","modified","bool","SetupSection","translate","title","display","wrapper","settings","label","string","isRequired","onUp","func","onDown"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AAC9C,QAAM;AAACC,IAAAA;AAAD,MAASD,OAAf;AACA,QAAM;AAACE,IAAAA;AAAD,MAAiBH,KAAvB;;AAEA,MAAI,CAACG,YAAL,EAAmB;AACjB,WAAO,IAAP;AACD;;AAED,QAAMC,KAAK,GAAG,KAAI,cAAJ,EAAoBF,IAApB,CAAd;;AACA,QAAMG,MAAM,GAAG,KAAI,eAAJ,EAAqBH,IAArB,CAAf;;AACA,QAAMI,iBAAiB,GAAG,KAAI,UAAJ,EAAgBH,YAAhB,IAAgCE,MAAhC,GAAyCD,KAAnE;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACS;AAAtB,kBACE,oBAAC,UAAD,eAAgBJ,YAAhB;AAA8B,IAAA,KAAK,EAAEG;AAArC,KADF,CADF;AAKD,CAjBD;;AAmBAP,mBAAmB,CAACS,YAApB,GAAmC;AACjCN,EAAAA,IAAI,EAAEP,QAAQ,CAACc,iBAAT,CAA2BP;AADA,CAAnC;AAIAH,mBAAmB,CAACW,SAApB,2CAAgC;AAC9BP,EAAAA,YAAY,EAAET,SAAS,CAACiB,KAAV,uBACTd,UAAU,CAACa,SADF;AAEZE,IAAAA,QAAQ,EAAElB,SAAS,CAACmB;AAFR;AADgB,CAAhC;;AAOA,MAAMC,YAAY,GAAG,CAACd,KAAD,EAAQC,OAAR,KAAoB;AACvC,QAAM;AAACc,IAAAA;AAAD,MAAcd,OAApB;AAEA,QAAM;AAACe,IAAAA,KAAD;AAAQC,IAAAA,OAAR;AAAiBd,IAAAA;AAAjB,MAAiCH,KAAvC;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEF,KAAK,CAACoB;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAEpB,KAAK,CAACkB;AAAtB,KAA8BA,KAA9B,CADF,eAEE;AAAK,IAAA,SAAS,EAAElB,KAAK,CAACqB;AAAtB,kBACE,oBAAC,mBAAD;AAAqB,IAAA,YAAY,EAAEhB;AAAnC,IADF,eAEE;AAAK,IAAA,SAAS,EAAEL,KAAK,CAACsB;AAAtB,KAA8BL,SAAS,CAAC,MAAD,CAAvC,CAFF,eAGE,oBAAC,WAAD,EAAiBE,OAAjB,CAHF,CAFF,CADF;AAUD,CAfD;;AAiBAH,YAAY,CAACN,YAAb,GAA4B;AAC1BO,EAAAA,SAAS,EAAEpB,QAAQ,CAACc,iBAAT,CAA2BM,SADZ;AAE1Bb,EAAAA,IAAI,EAAEP,QAAQ,CAACc,iBAAT,CAA2BP;AAFP,CAA5B;AAKAY,YAAY,CAACJ,SAAb,2CAAyB;AACvBM,EAAAA,KAAK,EAAEtB,SAAS,CAAC2B,MAAV,CAAiBC,UADD;AAEvBC,EAAAA,IAAI,EAAE7B,SAAS,CAAC8B,IAFO;AAGvBC,EAAAA,MAAM,EAAE/B,SAAS,CAAC8B,IAHK;AAIvBP,EAAAA,OAAO,EAAEvB,SAAS,CAACiB,KAAV,CAAgBf,WAAW,CAACc,SAA5B,CAJc;AAKvBP,EAAAA,YAAY,EAAEJ,mBAAmB,CAACW,SAApB,CAA8BP;AALrB,CAAzB;AAQA,eAAeW,YAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport style from './style.css';\n\nconst ContentTypesToggler = (props, context) => {\n const {skin} = context;\n const {contentTypes} = props;\n\n if (!contentTypes) {\n return null;\n }\n\n const brand = get('common.brand', skin);\n const orange = get('common.orange', skin);\n const contentTypesColor = get('modified', contentTypes) ? orange : brand;\n\n return (\n <div className={style.contentTypeWrapper}>\n <RadioGroup {...contentTypes} color={contentTypesColor} />\n </div>\n );\n};\n\nContentTypesToggler.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentTypesToggler.propTypes = {\n contentTypes: PropTypes.shape({\n ...RadioGroup.propTypes,\n modified: PropTypes.bool\n })\n};\n\nconst SetupSection = (props, context) => {\n const {translate} = context;\n\n const {title, display, contentTypes} = props;\n\n return (\n <div className={style.wrapper}>\n <div className={style.title}>{title}</div>\n <div className={style.settings}>\n <ContentTypesToggler contentTypes={contentTypes} />\n <div className={style.label}>{translate('Show')}</div>\n <InputSwitch {...display} />\n </div>\n </div>\n );\n};\n\nSetupSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSetupSection.propTypes = {\n title: PropTypes.string.isRequired,\n onUp: PropTypes.func,\n onDown: PropTypes.func,\n display: PropTypes.shape(InputSwitch.propTypes),\n contentTypes: ContentTypesToggler.propTypes.contentTypes\n};\n\nexport default SetupSection;\n"],"file":"index.js"}
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: space-between;
|
|
15
|
-
padding: 0 24px;
|
|
15
|
+
padding: 0 24px 0 48px;
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.title {
|
|
20
|
-
font-family: '
|
|
20
|
+
font-family: 'Gilroy';
|
|
21
21
|
font-size: 14px;
|
|
22
22
|
color: brand;
|
|
23
23
|
font-weight: 700;
|
|
@@ -30,39 +30,14 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.label {
|
|
33
|
-
font-family: '
|
|
33
|
+
font-family: 'Gilroy';
|
|
34
34
|
font-weight: 600;
|
|
35
35
|
font-size: 14px;
|
|
36
36
|
color: brand;
|
|
37
37
|
margin-left: 30px;
|
|
38
38
|
margin-right: 16px;
|
|
39
39
|
}
|
|
40
|
-
.arrowSection {
|
|
41
|
-
display: none
|
|
42
|
-
}
|
|
43
|
-
.arrow {
|
|
44
|
-
left: 50%;
|
|
45
|
-
top: 50%;
|
|
46
|
-
margin: 0 0 0 24px;
|
|
47
|
-
width: 30px;
|
|
48
|
-
height: 30px;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.arrow:hover path:last-child {
|
|
53
|
-
fill: primaryAdd1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.disabled {
|
|
57
|
-
composes: arrow;
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
}
|
|
60
40
|
|
|
61
41
|
.contentTypeWrapper {
|
|
62
42
|
width: 310px;
|
|
63
43
|
}
|
|
64
|
-
@media mobile {
|
|
65
|
-
.arrowSection {
|
|
66
|
-
display: block;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -2,61 +2,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useState, useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
5
|
+
import Draggable from '../draggable';
|
|
6
6
|
import SetupSection from '../setup-section';
|
|
7
7
|
import Loader from '../../atom/loader';
|
|
8
8
|
import style from './style.css';
|
|
9
9
|
|
|
10
|
-
const preventDefault = e => e.preventDefault();
|
|
11
|
-
|
|
12
|
-
const stopPropagation = e => e.stopPropagation();
|
|
13
|
-
|
|
14
|
-
const Draggable = props => {
|
|
15
|
-
const {
|
|
16
|
-
id,
|
|
17
|
-
dragging = false,
|
|
18
|
-
onDragStart,
|
|
19
|
-
onDragOver,
|
|
20
|
-
onDragLeave,
|
|
21
|
-
onDrop,
|
|
22
|
-
children
|
|
23
|
-
} = props;
|
|
24
|
-
const dragStartHandler = useCallback(e => {
|
|
25
|
-
stopPropagation(e);
|
|
26
|
-
onDragStart(id);
|
|
27
|
-
}, [id, onDragStart]);
|
|
28
|
-
const dragOverHandler = useCallback(e => {
|
|
29
|
-
preventDefault(e);
|
|
30
|
-
onDragOver(id);
|
|
31
|
-
}, [id, onDragOver]);
|
|
32
|
-
const dragLeaveHandler = useCallback(e => {
|
|
33
|
-
preventDefault(e);
|
|
34
|
-
onDragLeave(id);
|
|
35
|
-
}, [id, onDragLeave]);
|
|
36
|
-
const dropHandler = useCallback(e => {
|
|
37
|
-
preventDefault(e);
|
|
38
|
-
onDrop(id);
|
|
39
|
-
}, [id, onDrop]);
|
|
40
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: classnames(dragging ? style.dragging : null, style.section, style.draggable),
|
|
42
|
-
onDragStart: dragStartHandler,
|
|
43
|
-
onDragOver: dragOverHandler,
|
|
44
|
-
onDragLeave: dragLeaveHandler,
|
|
45
|
-
onDrop: dropHandler,
|
|
46
|
-
draggable: true
|
|
47
|
-
}, children);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
Draggable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
51
|
-
id: PropTypes.string,
|
|
52
|
-
dragging: PropTypes.bool,
|
|
53
|
-
onDragStart: PropTypes.func,
|
|
54
|
-
onDragOver: PropTypes.func,
|
|
55
|
-
onDragLeave: PropTypes.func,
|
|
56
|
-
onDrop: PropTypes.func,
|
|
57
|
-
children: PropTypes.element
|
|
58
|
-
} : {};
|
|
59
|
-
|
|
60
10
|
const Loading = () => /*#__PURE__*/React.createElement("div", {
|
|
61
11
|
className: style.loading
|
|
62
12
|
}, /*#__PURE__*/React.createElement(Loader, null));
|
|
@@ -84,7 +34,7 @@ const SetupSections = ({
|
|
|
84
34
|
setDragFrom(null);
|
|
85
35
|
}, [onDrop, setDragTo, setDragFrom, dragFrom]);
|
|
86
36
|
if (loading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
87
|
-
const sectionsView = sections.map(
|
|
37
|
+
const sectionsView = sections.map(section => /*#__PURE__*/React.createElement(Draggable, {
|
|
88
38
|
key: section.id,
|
|
89
39
|
id: section.id,
|
|
90
40
|
dragging: dragTo === section.id,
|
|
@@ -93,9 +43,7 @@ const SetupSections = ({
|
|
|
93
43
|
onDragLeave: dragLeaveHandler,
|
|
94
44
|
onDrop: dropHandler
|
|
95
45
|
}, /*#__PURE__*/React.createElement(SetupSection, _extends({}, section, {
|
|
96
|
-
key: section.id
|
|
97
|
-
onUp: index === 0 ? null : section.onUp,
|
|
98
|
-
onDown: index === sections.length - 1 ? null : section.onDown
|
|
46
|
+
key: section.id
|
|
99
47
|
}))));
|
|
100
48
|
return /*#__PURE__*/React.createElement("div", null, sectionsView);
|
|
101
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","useState","useCallback","PropTypes","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","useState","useCallback","PropTypes","Draggable","SetupSection","Loader","style","Loading","loading","SetupSections","sections","onDrop","dragTo","setDragTo","dragFrom","setDragFrom","dragStartHandler","id","dragOverHandler","dragLeaveHandler","dropHandler","sectionsView","map","section","propTypes","arrayOf","shape","bool","func"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC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OAAO,CAACN,EAFd;AAGE,IAAA,QAAQ,EAAEL,MAAM,KAAKW,OAAO,CAACN,EAH/B;AAIE,IAAA,WAAW,EAAED,gBAJf;AAKE,IAAA,UAAU,EAAEE,eALd;AAME,IAAA,WAAW,EAAEC,gBANf;AAOE,IAAA,MAAM,EAAEC;AAPV,kBASE,oBAAC,YAAD,eAAkBG,OAAlB;AAA2B,IAAA,GAAG,EAAEA,OAAO,CAACN;AAAxC,KATF,CADmB,CAArB;AAaA,sBAAO,iCAAMI,YAAN,CAAP;AACD,CApDD;;AAsDAZ,aAAa,CAACe,SAAd,2CAA0B;AACxBd,EAAAA,QAAQ,EAAER,SAAS,CAACuB,OAAV,CAAkBvB,SAAS,CAACwB,KAAV,CAAgBtB,YAAY,CAACoB,SAA7B,CAAlB,CADc;AAExBhB,EAAAA,OAAO,EAAEN,SAAS,CAACyB,IAFK;AAGxBhB,EAAAA,MAAM,EAAET,SAAS,CAAC0B;AAHM,CAA1B;AAMA,eAAenB,aAAf","sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Draggable from '../draggable';\nimport SetupSection from '../setup-section';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loading}>\n <Loader />\n </div>\n);\n\nconst SetupSections = ({sections, loading, onDrop}) => {\n const [dragTo, setDragTo] = useState(null);\n const [dragFrom, setDragFrom] = useState(null);\n\n const dragStartHandler = useCallback(\n id => {\n setDragFrom(id);\n },\n [setDragFrom]\n );\n\n const dragOverHandler = useCallback(\n id => {\n if (dragTo === id) return;\n setDragTo(id);\n },\n [dragTo, setDragTo]\n );\n\n const dragLeaveHandler = useCallback(\n id => {\n setDragTo(null);\n },\n [setDragTo]\n );\n\n const dropHandler = useCallback(\n id => {\n if (onDrop && dragFrom) onDrop(dragFrom, id);\n\n setDragTo(null);\n setDragFrom(null);\n },\n [onDrop, setDragTo, setDragFrom, dragFrom]\n );\n\n if (loading) return <Loading />;\n\n const sectionsView = sections.map(section => (\n <Draggable\n key={section.id}\n id={section.id}\n dragging={dragTo === section.id}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n >\n <SetupSection {...section} key={section.id} />\n </Draggable>\n ));\n return <div>{sectionsView}</div>;\n};\n\nSetupSections.propTypes = {\n sections: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n loading: PropTypes.bool,\n onDrop: PropTypes.func\n};\n\nexport default SetupSections;\n"],"file":"index.js"}
|
|
@@ -27,55 +27,3 @@
|
|
|
27
27
|
min-height: 60px;
|
|
28
28
|
position: relative;
|
|
29
29
|
}
|
|
30
|
-
.draggable {
|
|
31
|
-
cursor: grab;
|
|
32
|
-
position: relative;
|
|
33
|
-
background: transparent;
|
|
34
|
-
}
|
|
35
|
-
.draggable:hover{
|
|
36
|
-
background: rgba(0, 0, 0, 0.3);
|
|
37
|
-
}
|
|
38
|
-
.draggable:active{
|
|
39
|
-
background: transparent;
|
|
40
|
-
}
|
|
41
|
-
.draggable:before {
|
|
42
|
-
content: '.';
|
|
43
|
-
position: absolute;
|
|
44
|
-
left: 5px;
|
|
45
|
-
font-size: 20px;
|
|
46
|
-
line-height: 7px;
|
|
47
|
-
color: medium;
|
|
48
|
-
pointer-events: none;
|
|
49
|
-
text-shadow: 0 0 medium, 0 5px medium, 0 10px medium, 0 15px medium, 0 20px medium, 0 25px medium, 0 30px medium, 0 35px medium, 0 40px medium, 0 45px medium,
|
|
50
|
-
5px 0 medium, 5px 5px medium, 5px 10px medium, 5px 15px medium, 5px 20px medium, 5px 25px medium, 5px 30px medium, 5px 35px medium, 5px 40px medium, 5px 45px medium,
|
|
51
|
-
10px 0 medium, 10px 5px medium, 10px 10px medium, 10px 15px medium, 10px 20px medium, 10px 25px medium, 10px 30px medium, 10px 35px medium, 10px 40px medium, 10px 45px medium;
|
|
52
|
-
}
|
|
53
|
-
.dragging {
|
|
54
|
-
background: rgba(0, 0, 0, 0.1);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.dragging:after {
|
|
58
|
-
position: absolute;
|
|
59
|
-
content: "drop here";
|
|
60
|
-
left: 5px;
|
|
61
|
-
top: 5px;
|
|
62
|
-
bottom: 5px;
|
|
63
|
-
right: 5px;
|
|
64
|
-
background: color(black lightness(95%));
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
border: 1px dashed medium;
|
|
67
|
-
box-sizing: border-box;
|
|
68
|
-
display: flex;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
align-items: center;
|
|
71
|
-
color: dark;
|
|
72
|
-
font-family: 'Open Sans';
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
font-size: 14px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media mobile {
|
|
78
|
-
.draggable:before {
|
|
79
|
-
content: none;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -10,7 +10,7 @@ import Adapter from 'enzyme-adapter-react-16';
|
|
|
10
10
|
import { wrappingComponent } from '../../../test/helpers/render-component';
|
|
11
11
|
import SetupSections from '..'; // eslint-disable-next-line css-modules/no-unused-class
|
|
12
12
|
|
|
13
|
-
import style from '
|
|
13
|
+
import style from '../../draggable/style.css';
|
|
14
14
|
import fixtures from './fixtures/default';
|
|
15
15
|
browserEnv();
|
|
16
16
|
configure({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/setup-sections/test/on-drop.js"],"names":["browserEnv","test","React","mount","configure","Adapter","wrappingComponent","SetupSections","style","fixtures","adapter","t","plan","elementToDrag","props","sections","id","elementToDrop","dropHandler","dragged","dropped","is","wrapper","dragStartEvent","preventDefault","pass","dragOverEvent","dragLeaveEvent","dropEvent","find","section","at","simulate","fail"],"mappings":";;;;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,KAAR,EAAeC,SAAf,QAA+B,QAA/B;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,SAAQC,iBAAR,QAAgC,wCAAhC;AACA,OAAOC,aAAP,MAA0B,IAA1B,C,CACA;;AACA,OAAOC,KAAP,MAAkB,
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/setup-sections/test/on-drop.js"],"names":["browserEnv","test","React","mount","configure","Adapter","wrappingComponent","SetupSections","style","fixtures","adapter","t","plan","elementToDrag","props","sections","id","elementToDrop","dropHandler","dragged","dropped","is","wrapper","dragStartEvent","preventDefault","pass","dragOverEvent","dragLeaveEvent","dropEvent","find","section","at","simulate","fail"],"mappings":";;;;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,KAAR,EAAeC,SAAf,QAA+B,QAA/B;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,SAAQC,iBAAR,QAAgC,wCAAhC;AACA,OAAOC,aAAP,MAA0B,IAA1B,C,CACA;;AACA,OAAOC,KAAP,MAAkB,2BAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AAEAT,UAAU;AACVI,SAAS,CAAC;AAACM,EAAAA,OAAO,EAAE,IAAIL,OAAJ;AAAV,CAAD,CAAT;AAEAJ,IAAI,CAAC,+BAAD,EAAkCU,CAAC,IAAI;AACzCA,EAAAA,CAAC,CAACC,IAAF,CAAO,CAAP;AAEA,QAAMC,aAAa,GAAGJ,QAAQ,CAACK,KAAT,CAAeC,QAAf,CAAwB,CAAxB,EAA2BC,EAAjD;AACA,QAAMC,aAAa,GAAGR,QAAQ,CAACK,KAAT,CAAeC,QAAf,CAAwB,CAAxB,EAA2BC,EAAjD;;AAEA,QAAME,WAAW,GAAG,CAACC,OAAD,EAAUC,OAAV,KAAsB;AACxCT,IAAAA,CAAC,CAACU,EAAF,CAAKD,OAAL,EAAcH,aAAd;AACAN,IAAAA,CAAC,CAACU,EAAF,C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D,CAzBG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport {set} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport {wrappingComponent} from '../../../test/helpers/render-component';\nimport SetupSections from '..';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from '../../draggable/style.css';\nimport fixtures from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('should trigger onDrop handler', t => {\n t.plan(7);\n\n const elementToDrag = fixtures.props.sections[0].id;\n const elementToDrop = fixtures.props.sections[2].id;\n\n const dropHandler = (dragged, dropped) => {\n t.is(dropped, elementToDrop);\n t.is(dragged, elementToDrag);\n };\n\n const wrapper = mount(<SetupSections {...fixtures.props} onDrop={dropHandler} />, {\n wrappingComponent\n });\n\n const dragStartEvent = {preventDefault: () => t.pass()};\n const dragOverEvent = {preventDefault: () => t.pass()};\n const dragLeaveEvent = {preventDefault: () => t.pass()};\n const dropEvent = {preventDefault: () => t.pass()};\n\n wrapper.find(`.${style.section}`).at(0).simulate('dragStart', dragStartEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragLeave', dragLeaveEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('drop', dropEvent);\n});\n\ntest('should skip drop event if dragStart is not called', t => {\n t.plan(1);\n\n const dropHandler = (dragged, dropped) => {\n t.fail();\n };\n\n const wrapper = mount(<SetupSections {...fixtures.props} onDrop={dropHandler} />, {\n wrappingComponent\n });\n\n const dropEvent = {preventDefault: () => t.pass()};\n wrapper.find(`.${style.section}`).at(2).simulate('drop', dropEvent);\n});\n\ntest('should skip dragStart event if section id is not defined', t => {\n t.plan(0);\n\n const dropHandler = (dragged, dropped) => {\n t.fail();\n };\n\n const wrapper = mount(\n <SetupSections {...set('sections.0.id', '', fixtures.props)} onDrop={dropHandler} />,\n {\n wrappingComponent\n }\n );\n\n const dragStartEvent = {preventDefault: () => {}};\n const dragOverEvent = {preventDefault: () => {}};\n const dragLeaveEvent = {preventDefault: () => {}};\n const dropEvent = {preventDefault: () => {}};\n\n wrapper.find(`.${style.section}`).at(0).simulate('dragStart', dragStartEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(0).simulate('dragLeave', dragLeaveEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('dragOver', dragOverEvent);\n wrapper.find(`.${style.section}`).at(2).simulate('drop', dropEvent);\n});\n"],"file":"on-drop.js"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
16
|
margin: 15px 0;
|
|
17
|
-
font-family:
|
|
17
|
+
font-family: Gilroy;
|
|
18
18
|
font-weight: bold;
|
|
19
19
|
font-size: 13px;
|
|
20
20
|
overflow: inherit;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
text-transform: inherit;
|
|
29
29
|
background-color: xtraLightGrey;
|
|
30
30
|
color: dark;
|
|
31
|
-
font-family:
|
|
31
|
+
font-family: Gilroy;
|
|
32
32
|
font-weight: 600;
|
|
33
33
|
font-size: 13px;
|
|
34
34
|
text-decoration: none;
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
align-items: center;
|
|
74
74
|
color: white;
|
|
75
75
|
text-align: center;
|
|
76
|
-
font-family:
|
|
76
|
+
font-family: Gilroy;
|
|
77
77
|
font-weight: bold;
|
|
78
78
|
font-size: 13px;
|
|
79
79
|
box-shadow: 0 -1px 20px 0 rgba(0, 0, 0, 0.25);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
.table {
|
|
15
15
|
border: 1px solid light;
|
|
16
|
-
font-family: '
|
|
16
|
+
font-family: 'Gilroy';
|
|
17
17
|
border-spacing: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.noOptions label {
|
|
76
76
|
display: inline-block;
|
|
77
77
|
cursor: pointer;
|
|
78
|
-
font-family: '
|
|
78
|
+
font-family: 'Gilroy';
|
|
79
79
|
font-size: 15px;
|
|
80
80
|
font-weight: 700;
|
|
81
81
|
color: medium;
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
outline: 0;
|
|
125
125
|
padding: 0;
|
|
126
126
|
background: none;
|
|
127
|
-
font-family: '
|
|
127
|
+
font-family: 'Gilroy';
|
|
128
128
|
font-weight: 600;
|
|
129
129
|
font-size: 15px;
|
|
130
130
|
line-height: 25px;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
text-align: center;
|
|
156
156
|
width: 100%;
|
|
157
157
|
margin: 0 auto;
|
|
158
|
-
font-family: '
|
|
158
|
+
font-family: 'Gilroy';
|
|
159
159
|
color: dark;
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
border-radius: 4px;
|
|
167
167
|
overflow: scroll;
|
|
168
168
|
box-shadow: 0 0 2px 0 rgba(0,0,0,.19);
|
|
169
|
-
font-family: '
|
|
169
|
+
font-family: 'Gilroy';
|
|
170
170
|
background-color: white;
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.header {
|
|
50
|
-
font-family: '
|
|
50
|
+
font-family: 'Gilroy';
|
|
51
51
|
font-size: 24px;
|
|
52
52
|
font-weight: bold;
|
|
53
53
|
color: black;
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.content {
|
|
61
|
-
font-family: '
|
|
61
|
+
font-family: 'Gilroy';
|
|
62
62
|
font-size: 16px;
|
|
63
63
|
font-weight: normal;
|
|
64
64
|
color: black;
|
|
@@ -109,15 +109,15 @@ const buildSections = sections => {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
const BuildAction = ({
|
|
112
|
-
action
|
|
112
|
+
action,
|
|
113
|
+
side
|
|
113
114
|
}) => {
|
|
114
115
|
const {
|
|
115
116
|
onClick,
|
|
116
117
|
text,
|
|
117
118
|
disabled = false,
|
|
118
119
|
icon,
|
|
119
|
-
'aria-label': ariaLabel
|
|
120
|
-
side
|
|
120
|
+
'aria-label': ariaLabel
|
|
121
121
|
} = action;
|
|
122
122
|
const handleClick = useMemo(() => () => onClick(), [onClick]);
|
|
123
123
|
if (!action) return null;
|
|
@@ -215,10 +215,10 @@ BuildAction.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
215
215
|
icon: PropTypes.string,
|
|
216
216
|
disabled: PropTypes.bool,
|
|
217
217
|
text: PropTypes.string,
|
|
218
|
-
side: PropTypes.string,
|
|
219
218
|
onClick: PropTypes.func,
|
|
220
219
|
'aria-label': PropTypes.string
|
|
221
|
-
})
|
|
220
|
+
}),
|
|
221
|
+
side: PropTypes.string
|
|
222
222
|
} : {};
|
|
223
223
|
WizardSummary.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
224
224
|
title: PropTypes.string,
|