@coorpacademy/components 10.2.2 → 10.3.0
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/wizard-steps/index.js +1 -1
- package/es/atom/wizard-steps/index.js.map +1 -1
- package/es/atom/wizard-steps/style.css +1 -6
- package/es/molecule/banner/test/fixtures.js +8 -0
- package/es/molecule/banner/test/fixtures.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +1 -2
- package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
- package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/es/molecule/select-multiple/index.js +2 -2
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/select-multiple/style.css +33 -16
- package/es/molecule/select-multiple/test/fixtures.js +8 -0
- package/es/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/es/molecule/wizard-summary/index.js +4 -1
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +18 -8
- package/es/molecule/wizard-summary/test/fixtures/three-sections.js +2 -2
- package/es/molecule/wizard-summary/test/fixtures/three-sections.js.map +1 -1
- package/es/organism/brand-form/index.js +39 -29
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/brand-form/style.css +8 -3
- package/es/organism/{playlist-translation → content-translation}/index.js +0 -0
- package/es/organism/content-translation/index.js.map +1 -0
- package/es/organism/{playlist-translation → content-translation}/style.css +0 -0
- package/es/organism/{playlist-translation → content-translation}/test/fixtures/default.js +0 -0
- package/es/organism/content-translation/test/fixtures/default.js.map +1 -0
- package/es/organism/{playlist-translation → content-translation}/test/fixtures/delete.js +0 -0
- package/es/organism/content-translation/test/fixtures/delete.js.map +1 -0
- package/es/organism/content-translation/test/fixtures.js +15 -0
- package/es/organism/content-translation/test/fixtures.js.map +1 -0
- package/es/organism/list-item/test/fixtures.js +19 -0
- package/es/organism/list-item/test/fixtures.js.map +1 -0
- package/es/organism/list-items/test/fixtures.js +17 -0
- package/es/organism/list-items/test/fixtures.js.map +1 -0
- package/es/organism/wizard-contents/index.js +146 -0
- package/es/organism/wizard-contents/index.js.map +1 -0
- package/es/organism/wizard-contents/style.css +118 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-add-courses-create.js +40 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-add-courses-create.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-general-settings-create.js +36 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-general-settings-create.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-general-settings-edit.js +36 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-general-settings-edit.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-populations-create.js +40 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-populations-create.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-translate-edit.js +40 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-translate-edit.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures.js +21 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -0
- package/es/template/back-office/brand-update/index.js +8 -1
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +3 -15
- package/es/template/back-office/brand-update/test/fixtures/wizard-add-courses-playlist.js +21 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-add-courses-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js +21 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-form-edit-playlist.js +22 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-form-edit-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-populations-playlist.js +21 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-populations-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-translate-playlist.js +21 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-translate-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures.js +10 -2
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/atom/wizard-steps/index.js +1 -1
- package/lib/atom/wizard-steps/index.js.map +1 -1
- package/lib/atom/wizard-steps/style.css +1 -6
- package/lib/molecule/banner/test/fixtures.js +12 -0
- package/lib/molecule/banner/test/fixtures.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +1 -2
- package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/select-multiple/index.js +2 -2
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/select-multiple/style.css +33 -16
- package/lib/molecule/select-multiple/test/fixtures.js +12 -0
- package/lib/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/lib/molecule/wizard-summary/index.js +5 -3
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +18 -8
- package/lib/molecule/wizard-summary/test/fixtures/three-sections.js +2 -2
- package/lib/molecule/wizard-summary/test/fixtures/three-sections.js.map +1 -1
- package/lib/organism/brand-form/index.js +39 -29
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/brand-form/style.css +8 -3
- package/lib/organism/{playlist-translation → content-translation}/index.js +0 -0
- package/lib/organism/content-translation/index.js.map +1 -0
- package/lib/organism/{playlist-translation → content-translation}/style.css +0 -0
- package/lib/organism/{playlist-translation → content-translation}/test/fixtures/default.js +0 -0
- package/lib/organism/content-translation/test/fixtures/default.js.map +1 -0
- package/lib/organism/{playlist-translation → content-translation}/test/fixtures/delete.js +0 -0
- package/lib/organism/content-translation/test/fixtures/delete.js.map +1 -0
- package/lib/organism/content-translation/test/fixtures.js +25 -0
- package/lib/organism/content-translation/test/fixtures.js.map +1 -0
- package/lib/organism/list-item/test/fixtures.js +31 -0
- package/lib/organism/list-item/test/fixtures.js.map +1 -0
- package/lib/organism/list-items/test/fixtures.js +28 -0
- package/lib/organism/list-items/test/fixtures.js.map +1 -0
- package/lib/organism/wizard-contents/index.js +164 -0
- package/lib/organism/wizard-contents/index.js.map +1 -0
- package/lib/organism/wizard-contents/style.css +118 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-add-courses-create.js +49 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-add-courses-create.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-general-settings-create.js +45 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-general-settings-create.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-general-settings-edit.js +45 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-general-settings-edit.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-populations-create.js +49 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-populations-create.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-translate-edit.js +49 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-translate-edit.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures.js +34 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -0
- package/lib/template/back-office/brand-update/index.js +9 -1
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +3 -15
- package/lib/template/back-office/brand-update/test/fixtures/wizard-add-courses-playlist.js +31 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-add-courses-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js +31 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-form-edit-playlist.js +33 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-form-edit-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-populations-playlist.js +31 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-populations-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-translate-playlist.js +31 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-translate-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures.js +15 -3
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/package.json +2 -2
- package/es/organism/playlist-translation/index.js.map +0 -1
- package/es/organism/playlist-translation/test/fixtures/default.js.map +0 -1
- package/es/organism/playlist-translation/test/fixtures/delete.js.map +0 -1
- package/lib/organism/playlist-translation/index.js.map +0 -1
- package/lib/organism/playlist-translation/test/fixtures/default.js.map +0 -1
- package/lib/organism/playlist-translation/test/fixtures/delete.js.map +0 -1
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
@value lightBlack from colors;
|
|
13
13
|
@value cm_yellow_200 from colors;
|
|
14
14
|
@value cm_tablet from breakpoints;
|
|
15
|
+
@value desktop from breakpoints;
|
|
15
16
|
|
|
16
17
|
.container {
|
|
17
18
|
font-family: Gilroy;
|
|
18
|
-
width:
|
|
19
|
+
width: calc(100% - 74px);
|
|
19
20
|
border-radius: 7px;
|
|
20
21
|
background-color: cm_grey_50;
|
|
21
22
|
padding: 40px 37px 32px 37px;
|
|
@@ -165,16 +166,19 @@ ul {
|
|
|
165
166
|
color: cm_primary_blue;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
@media cm_tablet {
|
|
169
|
+
@media desktop, cm_tablet {
|
|
169
170
|
.container {
|
|
170
171
|
background-color: transparent;
|
|
171
|
-
width:
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 100%;
|
|
174
|
+
left: 0;
|
|
175
|
+
right: 0;
|
|
176
|
+
bottom: 0;
|
|
174
177
|
flex-direction: row;
|
|
175
178
|
align-items: flex-end;
|
|
176
|
-
padding:
|
|
177
|
-
margin:
|
|
179
|
+
padding: 0;
|
|
180
|
+
margin: 0;
|
|
181
|
+
position: relative;
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
.desktopSummaryTitle {
|
|
@@ -194,7 +198,9 @@ ul {
|
|
|
194
198
|
background-color: cm_grey_50;
|
|
195
199
|
border-radius: 7px;
|
|
196
200
|
height: 20px;
|
|
201
|
+
max-height: 20px;
|
|
197
202
|
padding: 12px 24px 12px 24px;
|
|
203
|
+
box-shadow: 0 -6px 42px -14px rgba(0, 0, 0, 0);
|
|
198
204
|
transition: all 0.5s ease;
|
|
199
205
|
}
|
|
200
206
|
|
|
@@ -228,11 +234,15 @@ ul {
|
|
|
228
234
|
|
|
229
235
|
.checkbox:checked + .summary {
|
|
230
236
|
height: 65%;
|
|
231
|
-
|
|
237
|
+
max-height: 1000px;
|
|
238
|
+
padding: 12px 24px 12px 24px;
|
|
232
239
|
box-shadow: 0 -6px 42px -14px rgba(0, 0, 0, 0.25);
|
|
233
240
|
transition: all 0.5s ease;
|
|
234
241
|
}
|
|
235
242
|
.checkbox:checked + .summary .tabletSummaryIcon {
|
|
236
243
|
transform: rotateZ(180deg);
|
|
237
244
|
}
|
|
245
|
+
.summarySections {
|
|
246
|
+
max-height: 250px;
|
|
247
|
+
}
|
|
238
248
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/wizard-summary/test/fixtures/three-sections.js"],"names":["props","title","sections","items","type","value","text","counterText","action","icon","onClick","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,uBADF;AAELC,IAAAA,QAAQ,EAAE,CACR;AACEC,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,UAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OADK,EAML;AACED,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,MAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OANK;AADT,KADQ,EAeR;AACEJ,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,EAKL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OALK,EASL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OATK;AAFT,KAfQ,EAgCR;AACEL,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,CAFT;AAQEC,MAAAA,WAAW,EAAE;AARf,KAhCQ,CAFL;AA6CLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,MADA;AAENH,MAAAA,IAAI,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/wizard-summary/test/fixtures/three-sections.js"],"names":["props","title","sections","items","type","value","text","counterText","action","icon","onClick","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,uBADF;AAELC,IAAAA,QAAQ,EAAE,CACR;AACEC,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,UAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OADK,EAML;AACED,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,MAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OANK;AADT,KADQ,EAeR;AACEJ,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,EAKL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OALK,EASL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OATK;AAFT,KAfQ,EAgCR;AACEL,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,CAFT;AAQEC,MAAAA,WAAW,EAAE;AARf,KAhCQ,CAFL;AA6CLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,MADA;AAENH,MAAAA,IAAI,EAAE,aAFA;AAGN,oBAAc,MAHR;AAINI,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,MAAZ;AAJT;AA7CH;AADM,C","sourcesContent":["export default {\n props: {\n title: 'Certification summary',\n sections: [\n {\n items: [\n {\n type: 'mainElement',\n title: 'Language',\n value: '🇬🇧 English'\n },\n {\n type: 'mainElement',\n title: 'Name',\n value: 'Marketing expert'\n }\n ]\n },\n {\n title: 'Translation',\n items: [\n {\n type: 'text',\n text: '🇫🇷 French'\n },\n {\n type: 'text',\n text: '🇪🇸 Spanish'\n },\n {\n type: 'text',\n text: '🇮🇹 Italian'\n }\n ]\n },\n {\n title: 'Populations',\n items: [\n {\n type: 'text',\n text: 'Population 2'\n }\n ],\n counterText: '1 population'\n }\n ],\n action: {\n icon: 'save',\n text: 'Save & quit',\n 'aria-label': 'Save',\n onClick: () => console.log('save')\n }\n }\n};\n"],"file":"three-sections.js"}
|
|
@@ -29,6 +29,42 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
|
+
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor) => {
|
|
33
|
+
if (!onSubmit && !onReset) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const disabledSubmit = disabled || isPending || !isModified;
|
|
38
|
+
const submitButton = onSubmit ? /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
"data-tip": tooltip.title,
|
|
40
|
+
"data-for": "submitButton",
|
|
41
|
+
className: _style.default.saveButton
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_reactTooltip.default, {
|
|
43
|
+
type: "light",
|
|
44
|
+
effect: "solid",
|
|
45
|
+
className: _style.default.toolTipContent,
|
|
46
|
+
place: tooltip.place,
|
|
47
|
+
id: "submitButton"
|
|
48
|
+
}), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
49
|
+
type: "submit",
|
|
50
|
+
disabled: disabledSubmit,
|
|
51
|
+
submitValue: submitValue
|
|
52
|
+
})) : null;
|
|
53
|
+
const cancelBackground = {
|
|
54
|
+
backgroundColor: darkColor
|
|
55
|
+
};
|
|
56
|
+
const resetButton = onReset ? /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
className: _style.default.resetButton
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
59
|
+
type: "reset",
|
|
60
|
+
submitValue: resetValue,
|
|
61
|
+
style: cancelBackground
|
|
62
|
+
})) : null;
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: _style.default.buttons
|
|
65
|
+
}, submitButton, resetButton);
|
|
66
|
+
};
|
|
67
|
+
|
|
32
68
|
function BrandForm(props, context) {
|
|
33
69
|
const {
|
|
34
70
|
groups,
|
|
@@ -57,39 +93,15 @@ function BrandForm(props, context) {
|
|
|
57
93
|
}, back.desc)) : null;
|
|
58
94
|
const brandGroups = groups.map((group, index) => {
|
|
59
95
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: _style.default.group,
|
|
60
97
|
key: index
|
|
61
98
|
}, /*#__PURE__*/_react.default.createElement(_brandFormGroup.default, group));
|
|
62
99
|
});
|
|
63
|
-
const
|
|
64
|
-
const submitButton = onSubmit ? /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
"data-tip": tooltip.title,
|
|
66
|
-
"data-for": "submitButton",
|
|
67
|
-
className: _style.default.saveButton
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement(_reactTooltip.default, {
|
|
69
|
-
type: "light",
|
|
70
|
-
effect: "solid",
|
|
71
|
-
className: _style.default.toolTipContent,
|
|
72
|
-
place: tooltip.place,
|
|
73
|
-
id: "submitButton"
|
|
74
|
-
}), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
75
|
-
type: "submit",
|
|
76
|
-
disabled: disabledSubmit,
|
|
77
|
-
submitValue: submitValue
|
|
78
|
-
})) : null;
|
|
100
|
+
const buttonSection = buildButtonSection(onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor);
|
|
79
101
|
const handleSubmit = (0, _react.useMemo)(() => e => {
|
|
80
102
|
e.preventDefault();
|
|
81
103
|
return onSubmit(e);
|
|
82
104
|
}, [onSubmit]);
|
|
83
|
-
const cancelBackground = {
|
|
84
|
-
backgroundColor: darkColor
|
|
85
|
-
};
|
|
86
|
-
const resetButton = onReset ? /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
-
className: _style.default.resetButton
|
|
88
|
-
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
89
|
-
type: "reset",
|
|
90
|
-
submitValue: resetValue,
|
|
91
|
-
style: cancelBackground
|
|
92
|
-
})) : null;
|
|
93
105
|
const handleReset = (0, _react.useMemo)(() => e => {
|
|
94
106
|
e.preventDefault();
|
|
95
107
|
return onReset(e);
|
|
@@ -97,9 +109,7 @@ function BrandForm(props, context) {
|
|
|
97
109
|
return /*#__PURE__*/_react.default.createElement("div", null, backView, /*#__PURE__*/_react.default.createElement("form", {
|
|
98
110
|
onSubmit: handleSubmit,
|
|
99
111
|
onReset: handleReset
|
|
100
|
-
}, brandGroups,
|
|
101
|
-
className: _style.default.buttons
|
|
102
|
-
}, submitButton, resetButton)));
|
|
112
|
+
}, brandGroups, buttonSection));
|
|
103
113
|
}
|
|
104
114
|
|
|
105
115
|
BrandForm.contextTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/organism/brand-form/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/brand-form/index.js"],"names":["buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","darkColor","disabledSubmit","submitButton","title","style","saveButton","toolTipContent","place","cancelBackground","backgroundColor","resetButton","buttons","BrandForm","props","context","groups","back","skin","backView","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","e","preventDefault","handleReset","contextTypes","Provider","childContextTypes","defaultProps","propTypes","PropTypes","arrayOf","shape","BrandFormGroup","isRequired","bool","func","Button","Link","children","href","string"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CACzBC,QADyB,EAEzBC,WAFyB,EAGzBC,OAHyB,EAIzBC,UAJyB,EAKzBC,OALyB,EAMzBC,QANyB,EAOzBC,UAPyB,EAQzBC,SARyB,EASzBC,SATyB,KAUtB;AACH,MAAI,CAACR,QAAD,IAAa,CAACE,OAAlB,EAA2B;AACzB,WAAO,IAAP;AACD;;AAED,QAAMO,cAAc,GAAGJ,QAAQ,IAAIE,SAAZ,IAAyB,CAACD,UAAjD;AACA,QAAMI,YAAY,GAAGV,QAAQ,gBAC3B;AAAK,gBAAUI,OAAO,CAACO,KAAvB;AAA8B,gBAAS,cAAvC;AAAsD,IAAA,SAAS,EAAEC,eAAMC;AAAvE,kBACE,6BAAC,qBAAD;AACE,IAAA,IAAI,EAAC,OADP;AAEE,IAAA,MAAM,EAAC,OAFT;AAGE,IAAA,SAAS,EAAED,eAAME,cAHnB;AAIE,IAAA,KAAK,EAAEV,OAAO,CAACW,KAJjB;AAKE,IAAA,EAAE,E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OAAV,CAAkBD,mBAAUE,KAAV,CAAgBC,wBAAeJ,SAA/B,CAAlB,EAA6DK,UADjD;AAEpB5C,EAAAA,QAAQ,EAAEwC,mBAAUK,IAFA;AAGpB5C,EAAAA,UAAU,EAAEuC,mBAAUK,IAHF;AAIpB3C,EAAAA,SAAS,EAAEsC,mBAAUK,IAJD;AAKpBlD,EAAAA,QAAQ,EAAE6C,mBAAUM,IALA;AAMpBlD,EAAAA,WAAW,EAAEmD,gBAAOR,SAAP,CAAiB3C,WANV;AAOpBC,EAAAA,OAAO,EAAE2C,mBAAUM,IAPC;AAQpBhD,EAAAA,UAAU,EAAEiD,gBAAOR,SAAP,CAAiB3C,WART;AASpBuB,EAAAA,IAAI,EAAEqB,mBAAUE,KAAV,CAAgB;AACpBjB,IAAAA,IAAI,EAAEuB,cAAKT,SAAL,CAAeU,QADD;AAEpB1B,IAAAA,IAAI,EAAEyB,cAAKT,SAAL,CAAeW;AAFD,GAAhB,CATc;AAapBnD,EAAAA,OAAO,EAAEyC,mBAAUE,KAAV,CAAgB;AACvBpC,IAAAA,KAAK,EAAEkC,mBAAUW,MADM;AAEvBzC,IAAAA,KAAK,EAAE8B,mBAAUW;AAFM,GAAhB;AAbW,CAAtB;eAmBepC,S","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowLeft as ArrowLeft} from '@coorpacademy/nova-icons';\nimport ReactTooltip from 'react-tooltip';\nimport BrandFormGroup from '../../molecule/brand-form-group';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Link from '../../atom/link';\nimport style from './style.css';\n\nconst buildButtonSection = (\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor\n) => {\n if (!onSubmit && !onReset) {\n return null;\n }\n\n const disabledSubmit = disabled || isPending || !isModified;\n const submitButton = onSubmit ? (\n <div data-tip={tooltip.title} data-for=\"submitButton\" className={style.saveButton}>\n <ReactTooltip\n type=\"light\"\n effect=\"solid\"\n className={style.toolTipContent}\n place={tooltip.place}\n id=\"submitButton\"\n />\n <Button type=\"submit\" disabled={disabledSubmit} submitValue={submitValue} />\n </div>\n ) : null;\n\n const cancelBackground = {backgroundColor: darkColor};\n\n const resetButton = onReset ? (\n <div className={style.resetButton}>\n <Button type=\"reset\" submitValue={resetValue} style={cancelBackground} />\n </div>\n ) : null;\n\n return (\n <div className={style.buttons}>\n {submitButton}\n {resetButton}\n </div>\n );\n};\n\nfunction BrandForm(props, context) {\n const {\n groups,\n disabled,\n isModified,\n isPending,\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n back,\n tooltip\n } = props;\n const {skin} = context;\n const darkColor = get('common.dark', skin);\n\n const backView = back ? (\n <p className={style.back}>\n <ArrowLeft color={darkColor} className={style.arrowBack} />\n <Link href={back.link} className={style.backDesc}>\n {back.desc}\n </Link>\n </p>\n ) : null;\n\n const brandGroups = groups.map((group, index) => {\n return (\n <div className={style.group} key={index}>\n <BrandFormGroup {...group} />\n </div>\n );\n });\n\n const buttonSection = buildButtonSection(\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor\n );\n\n const handleSubmit = useMemo(\n () => e => {\n e.preventDefault();\n return onSubmit(e);\n },\n [onSubmit]\n );\n\n const handleReset = useMemo(\n () => e => {\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n return (\n <div>\n {backView}\n <form onSubmit={handleSubmit} onReset={handleReset}>\n {brandGroups}\n {buttonSection}\n </form>\n </div>\n );\n}\n\nBrandForm.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBrandForm.defaultProps = {\n tooltip: {\n title: '',\n place: 'top'\n }\n};\n\nBrandForm.propTypes = {\n groups: PropTypes.arrayOf(PropTypes.shape(BrandFormGroup.propTypes)).isRequired,\n disabled: PropTypes.bool,\n isModified: PropTypes.bool,\n isPending: PropTypes.bool,\n onSubmit: PropTypes.func,\n submitValue: Button.propTypes.submitValue,\n onReset: PropTypes.func,\n resetValue: Button.propTypes.submitValue,\n back: PropTypes.shape({\n desc: Link.propTypes.children,\n link: Link.propTypes.href\n }),\n tooltip: PropTypes.shape({\n title: PropTypes.string,\n place: PropTypes.string\n })\n};\n\nexport default BrandForm;\n"],"file":"index.js"}
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
margin-bottom: 30px;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.group {
|
|
12
|
+
margin: 0 0 32px 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.group:last-child {
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
.arrowBack {
|
|
12
20
|
width: 15px;
|
|
13
21
|
height: 15px;
|
|
@@ -30,9 +38,6 @@
|
|
|
30
38
|
.buttons {
|
|
31
39
|
display: flex;
|
|
32
40
|
justify-content: flex-end;
|
|
33
|
-
|
|
34
|
-
/* border-top: 1px solid #E0E0E0; */
|
|
35
|
-
padding-top: 50px;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
.button {
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/content-translation/index.js"],"names":["PlayListTranslation","props","languageTabs","inputText","textArea","cta","listAriaLabel","ariaLabel","style","container","menu","horizontalSection","input","button","type","binButton","handleOnclick","position","label","propTypes","VerticalLanguageMenu","tabs","PropTypes","shape","InputText","theme","string","TextArea","func","oneOf"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAGC,KAAK,IAAI;AACnC,QAAM;AAACC,IAAAA,YAAD;AAAeC,IAAAA,SAAf;AAA0BC,IAAAA,QAA1B;AAAoCC,IAAAA,GAApC;AAAyC,uBAAmBC;AAA5D,MAA6EL,KAAnF;AAEA,QAAMM,SAAS,GAAG;AAAC,kBAA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BAAUI;AAAzD,KAHoB;AAI9BrB,EAAAA,GAAG,EAAEiB,mBAAUC,KAAV,CAAgB;AACnBL,IAAAA,KAAK,EAAEI,mBAAUI,MADE;AAEnBV,IAAAA,aAAa,EAAEM,mBAAUM,IAFN;AAGnBd,IAAAA,IAAI,EAAEQ,mBAAUO,KAAV,CAAgB,CAAC,QAAD,EAAW,KAAX,CAAhB;AAHa,GAAhB,CAJyB;AAS9B,qBAAmBP,mBAAUI;AATC,CAAhC;eAYe1B,mB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport VerticalLanguageMenu from '../../molecule/vertical-tabs';\nimport InputText from '../../atom/input-text';\nimport TextArea from '../../atom/input-textarea';\nimport Button from '../../atom/button-link';\nimport style from './style.css';\n\nconst PlayListTranslation = props => {\n const {languageTabs, inputText, textArea, cta, 'list-aria-label': listAriaLabel} = props;\n\n const ariaLabel = {'aria-label': listAriaLabel};\n return (\n <div className={style.container}>\n <VerticalLanguageMenu {...ariaLabel} className={style.menu} tabs={languageTabs} />\n <div className={style.horizontalSection}>\n <div className={style.input}>\n <InputText {...inputText} />\n </div>\n <div className={style.input}>\n <TextArea {...textArea} />\n </div>\n <div className={classNames(style.button, cta.type === 'delete' && style.binButton)}>\n <Button\n onClick={cta.handleOnclick}\n type={cta.type === 'delete' ? 'text' : 'primary'}\n icon={{type: cta.type === 'delete' ? 'bin' : 'add', position: 'left'}}\n label={cta.label}\n />\n </div>\n </div>\n </div>\n );\n};\n\nPlayListTranslation.propTypes = {\n languageTabs: VerticalLanguageMenu.propTypes.tabs,\n inputText: PropTypes.shape({...InputText.propTypes, theme: PropTypes.string}),\n textArea: PropTypes.shape({...TextArea.propTypes, theme: PropTypes.string}),\n cta: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['delete', 'add'])\n }),\n 'list-aria-label': PropTypes.string\n};\n\nexport default PlayListTranslation;\n"],"file":"index.js"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/content-translation/test/fixtures/default.js"],"names":["languageTabs","vericalMenu","props","tabs","inputText","theme","textArea","cta","label","type","handleOnClick"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAGC,0BAAYC,KAAZ,CAAkBC,IAAvC;eAEe;AACbD,EAAAA,KAAK,EAAE;AACLF,IAAAA,YADK;AAELI,IAAAA,SAAS,wBAAMA,mBAAUF,KAAhB;AAAuBG,MAAAA,KAAK,EAAE;AAA9B,MAFJ;AAGLC,IAAAA,QAAQ,wBAAMA,oBAASJ,KAAf;AAAsBG,MAAAA,KAAK,EAAE;AAA7B,MAHH;AAILE,IAAAA,GAAG,EAAE;AACHC,MAAAA,KAAK,EAAE,iBADJ;AAEHC,MAAAA,IAAI,EAAE,KAFH;AAGHC,MAAAA,aAAa,EAAE,MAAM,CAAE;AAHpB,KAJA;AASL,uBAAmB;AATd;AADM,C","sourcesContent":["import vericalMenu from '../../../../molecule/vertical-tabs/test/fixtures/with-selected-item';\nimport inputText from '../../../../atom/input-text/test/fixtures/cm-default';\nimport textArea from '../../../../atom/input-textarea/test/fixtures/cm-default';\n\nconst languageTabs = vericalMenu.props.tabs;\n\nexport default {\n props: {\n languageTabs,\n inputText: {...inputText.props, theme: 'coorpmanager'},\n textArea: {...textArea.props, theme: 'coorpmanager'},\n cta: {\n label: 'Add translation',\n type: 'add',\n handleOnClick: () => {}\n },\n 'list-aria-label': 'Languages list'\n }\n};\n"],"file":"default.js"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/content-translation/test/fixtures/delete.js"],"names":["languageTabs","vericalMenu","props","tabs","inputText","textArea","cta","label","type","handleOnClick"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAGC,0BAAYC,KAAZ,CAAkBC,IAAvC;eAEe;AACbD,EAAAA,KAAK,EAAE;AACLF,IAAAA,YADK;AAELI,IAAAA,SAAS,EAAEA,mBAAUF,KAFhB;AAGLG,IAAAA,QAAQ,EAAEA,oBAASH,KAHd;AAILI,IAAAA,GAAG,EAAE;AACHC,MAAAA,KAAK,EAAE,oBADJ;AAEHC,MAAAA,IAAI,EAAE,QAFH;AAGHC,MAAAA,aAAa,EAAE,MAAM,CAAE;AAHpB,KAJA;AASL,uBAAmB;AATd;AADM,C","sourcesContent":["import vericalMenu from '../../../../molecule/vertical-tabs/test/fixtures/with-selected-item';\nimport inputText from '../../../../atom/input-text/test/fixtures/cm-default';\nimport textArea from '../../../../atom/input-textarea/test/fixtures/cm-default';\n\nconst languageTabs = vericalMenu.props.tabs;\n\nexport default {\n props: {\n languageTabs,\n inputText: inputText.props,\n textArea: textArea.props,\n cta: {\n label: 'Delete translation',\n type: 'delete',\n handleOnClick: () => {}\n },\n 'list-aria-label': 'Languages list'\n }\n};\n"],"file":"delete.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
+
|
|
5
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
+
|
|
7
|
+
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
+
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
|
|
11
|
+
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
+
|
|
13
|
+
var _delete = _interopRequireDefault(require("./fixtures/delete"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
(0, _ava.default)('Organism › OrganismContentTranslation > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Organism.OrganismContentTranslation.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, _ava.default)('Organism › OrganismContentTranslation › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
+
(0, _ava.default)('Organism › OrganismContentTranslation › Delete › should be rendered', _renderComponent.default, _.default, _delete.default);
|
|
25
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/content-translation/test/fixtures.js"],"names":["t","pass","OrganismContentTranslation","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureDelete"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,qEAAL,EAA4EA,CAAC,IAAI;AAC/EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAA2BC,SAAnC,EAA8C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC5DL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+DAA8DF,GAAI,mEAA3F;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,sEAAL,EAA6EG,wBAA7E,EAAmGN,SAAnG,EAA+HO,gBAA/H;AACA,kBAAK,qEAAL,EAA4ED,wBAA5E,EAAkGN,SAAlG,EAA8HQ,eAA9H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismContentTranslation from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDelete from './fixtures/delete';\n\ntest('Organism › OrganismContentTranslation > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismContentTranslation.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismContentTranslation.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismContentTranslation › Default › should be rendered', renderComponentMacro, OrganismContentTranslation, fixtureDefault);\ntest('Organism › OrganismContentTranslation › Delete › should be rendered', renderComponentMacro, OrganismContentTranslation, fixtureDelete);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
+
|
|
5
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
+
|
|
7
|
+
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
+
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
|
|
11
|
+
var _archived = _interopRequireDefault(require("./fixtures/archived"));
|
|
12
|
+
|
|
13
|
+
var _draft = _interopRequireDefault(require("./fixtures/draft"));
|
|
14
|
+
|
|
15
|
+
var _published = _interopRequireDefault(require("./fixtures/published"));
|
|
16
|
+
|
|
17
|
+
var _revised = _interopRequireDefault(require("./fixtures/revised"));
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
(0, _ava.default)('Organism › OrganismListItem > should have valid propTypes', t => {
|
|
22
|
+
t.pass();
|
|
23
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
24
|
+
t.not(value, undefined, `PropType for "Organism.OrganismListItem.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
(0, _ava.default)('Organism › OrganismListItem › Archived › should be rendered', _renderComponent.default, _.default, _archived.default);
|
|
28
|
+
(0, _ava.default)('Organism › OrganismListItem › Draft › should be rendered', _renderComponent.default, _.default, _draft.default);
|
|
29
|
+
(0, _ava.default)('Organism › OrganismListItem › Published › should be rendered', _renderComponent.default, _.default, _published.default);
|
|
30
|
+
(0, _ava.default)('Organism › OrganismListItem › Revised › should be rendered', _renderComponent.default, _.default, _revised.default);
|
|
31
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/list-item/test/fixtures.js"],"names":["t","pass","OrganismListItem","propTypes","value","key","not","undefined","renderComponentMacro","fixtureArchived","fixtureDraft","fixturePublished","fixtureRevised"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,2DAAL,EAAkEA,CAAC,IAAI;AACrEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAiBC,SAAzB,EAAoC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAClDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,qDAAoDF,GAAI,mEAAjF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,6DAAL,EAAoEG,wBAApE,EAA0FN,SAA1F,EAA4GO,iBAA5G;AACA,kBAAK,0DAAL,EAAiED,wBAAjE,EAAuFN,SAAvF,EAAyGQ,cAAzG;AACA,kBAAK,8DAAL,EAAqEF,wBAArE,EAA2FN,SAA3F,EAA6GS,kBAA7G;AACA,kBAAK,4DAAL,EAAmEH,wBAAnE,EAAyFN,SAAzF,EAA2GU,gBAA3G","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismListItem from '..';\nimport fixtureArchived from './fixtures/archived';\nimport fixtureDraft from './fixtures/draft';\nimport fixturePublished from './fixtures/published';\nimport fixtureRevised from './fixtures/revised';\n\ntest('Organism › OrganismListItem > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismListItem.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismListItem.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismListItem › Archived › should be rendered', renderComponentMacro, OrganismListItem, fixtureArchived);\ntest('Organism › OrganismListItem › Draft › should be rendered', renderComponentMacro, OrganismListItem, fixtureDraft);\ntest('Organism › OrganismListItem › Published › should be rendered', renderComponentMacro, OrganismListItem, fixturePublished);\ntest('Organism › OrganismListItem › Revised › should be rendered', renderComponentMacro, OrganismListItem, fixtureRevised);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
+
|
|
5
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
+
|
|
7
|
+
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
+
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
|
|
11
|
+
var _archived = _interopRequireDefault(require("./fixtures/archived"));
|
|
12
|
+
|
|
13
|
+
var _draft = _interopRequireDefault(require("./fixtures/draft"));
|
|
14
|
+
|
|
15
|
+
var _published = _interopRequireDefault(require("./fixtures/published"));
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
(0, _ava.default)('Organism › OrganismListItems > should have valid propTypes', t => {
|
|
20
|
+
t.pass();
|
|
21
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
22
|
+
t.not(value, undefined, `PropType for "Organism.OrganismListItems.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
(0, _ava.default)('Organism › OrganismListItems › Archived › should be rendered', _renderComponent.default, _.default, _archived.default);
|
|
26
|
+
(0, _ava.default)('Organism › OrganismListItems › Draft › should be rendered', _renderComponent.default, _.default, _draft.default);
|
|
27
|
+
(0, _ava.default)('Organism › OrganismListItems › Published › should be rendered', _renderComponent.default, _.default, _published.default);
|
|
28
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/list-items/test/fixtures.js"],"names":["t","pass","OrganismListItems","propTypes","value","key","not","undefined","renderComponentMacro","fixtureArchived","fixtureDraft","fixturePublished"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,4DAAL,EAAmEA,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAkBC,SAA1B,EAAqC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACnDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,8DAAL,EAAqEG,wBAArE,EAA2FN,SAA3F,EAA8GO,iBAA9G;AACA,kBAAK,2DAAL,EAAkED,wBAAlE,EAAwFN,SAAxF,EAA2GQ,cAA3G;AACA,kBAAK,+DAAL,EAAsEF,wBAAtE,EAA4FN,SAA5F,EAA+GS,kBAA/G","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismListItems from '..';\nimport fixtureArchived from './fixtures/archived';\nimport fixtureDraft from './fixtures/draft';\nimport fixturePublished from './fixtures/published';\n\ntest('Organism › OrganismListItems > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismListItems.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismListItems.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismListItems › Archived › should be rendered', renderComponentMacro, OrganismListItems, fixtureArchived);\ntest('Organism › OrganismListItems › Draft › should be rendered', renderComponentMacro, OrganismListItems, fixtureDraft);\ntest('Organism › OrganismListItems › Published › should be rendered', renderComponentMacro, OrganismListItems, fixturePublished);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
11
|
+
|
|
12
|
+
var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
|
|
13
|
+
|
|
14
|
+
var _wizardSteps = _interopRequireDefault(require("../../atom/wizard-steps"));
|
|
15
|
+
|
|
16
|
+
var _wizardSummary = _interopRequireDefault(require("../../molecule/wizard-summary"));
|
|
17
|
+
|
|
18
|
+
var _brandForm = _interopRequireDefault(require("../brand-form"));
|
|
19
|
+
|
|
20
|
+
var _contentTranslation = _interopRequireDefault(require("../content-translation"));
|
|
21
|
+
|
|
22
|
+
var _searchAndChipsResults = _interopRequireDefault(require("../search-and-chips-results"));
|
|
23
|
+
|
|
24
|
+
var _courseSelection = _interopRequireDefault(require("../course-selection"));
|
|
25
|
+
|
|
26
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
31
|
+
|
|
32
|
+
const buildHeader = (wizardHeader, steps) => {
|
|
33
|
+
const {
|
|
34
|
+
title,
|
|
35
|
+
onClick
|
|
36
|
+
} = wizardHeader;
|
|
37
|
+
const buttonCloseIcon = {
|
|
38
|
+
size: 'small',
|
|
39
|
+
'data-name': 'close-button',
|
|
40
|
+
'aria-label': 'close button',
|
|
41
|
+
icon: 'close',
|
|
42
|
+
onClick
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
className: _style.default.header
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, buttonCloseIcon), /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
className: _style.default.headerTitle
|
|
48
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_wizardSteps.default, {
|
|
49
|
+
steps: steps
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const buildForm = content => {
|
|
54
|
+
const {
|
|
55
|
+
type
|
|
56
|
+
} = content;
|
|
57
|
+
|
|
58
|
+
switch (type) {
|
|
59
|
+
case 'form':
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_brandForm.default, content);
|
|
61
|
+
|
|
62
|
+
case 'translate':
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_contentTranslation.default, content);
|
|
64
|
+
|
|
65
|
+
case 'populations':
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_searchAndChipsResults.default, content);
|
|
67
|
+
|
|
68
|
+
case 'courses':
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_courseSelection.default, content);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const buildButton = (type, step) => {
|
|
74
|
+
const {
|
|
75
|
+
label,
|
|
76
|
+
onClick
|
|
77
|
+
} = step;
|
|
78
|
+
const buttonProps = {
|
|
79
|
+
type: type === 'next' ? 'primary' : 'secondary',
|
|
80
|
+
'aria-label': `${type} step button`,
|
|
81
|
+
'data-name': `${type}-step-button`,
|
|
82
|
+
icon: {
|
|
83
|
+
position: type === 'next' ? 'right' : 'left',
|
|
84
|
+
type: type === 'next' ? 'chevron-right' : 'chevron-left'
|
|
85
|
+
},
|
|
86
|
+
label,
|
|
87
|
+
onClick
|
|
88
|
+
};
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonProps);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const buildActionZone = (previousStep, nextStep) => {
|
|
93
|
+
const previousButton = previousStep ? buildButton('previous', previousStep) : null;
|
|
94
|
+
const nextButton = nextStep ? buildButton('next', nextStep) : null;
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: _style.default.actionZone
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
+
className: _style.default.button
|
|
99
|
+
}, previousButton), /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
+
className: _style.default.button
|
|
101
|
+
}, nextButton));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const WizardContents = props => {
|
|
105
|
+
const {
|
|
106
|
+
wizardHeader,
|
|
107
|
+
steps,
|
|
108
|
+
summary,
|
|
109
|
+
content,
|
|
110
|
+
nextStep,
|
|
111
|
+
previousStep
|
|
112
|
+
} = props;
|
|
113
|
+
const headerView = buildHeader(wizardHeader, steps);
|
|
114
|
+
const formView = buildForm(content);
|
|
115
|
+
const actionView = buildActionZone(previousStep, nextStep);
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
117
|
+
className: _style.default.container
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
+
className: _style.default.leftSection
|
|
120
|
+
}, headerView, /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: _style.default.form
|
|
122
|
+
}, formView)), /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
+
className: _style.default.rightSection
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: _style.default.stickySection
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
127
|
+
className: _style.default.summaryZone
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(_wizardSummary.default, summary)), actionView)), /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
+
className: _style.default.footer
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
131
|
+
className: _style.default.summaryFooter
|
|
132
|
+
}, /*#__PURE__*/_react.default.createElement(_wizardSummary.default, summary)), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
className: _style.default.actionFooter
|
|
134
|
+
}, actionView)));
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
138
|
+
wizardHeader: _propTypes.default.shape({
|
|
139
|
+
title: _propTypes.default.string,
|
|
140
|
+
onClick: _propTypes.default.func
|
|
141
|
+
}).isRequired,
|
|
142
|
+
steps: _wizardSteps.default.propTypes.steps,
|
|
143
|
+
summary: _propTypes.default.shape(_extends({}, _wizardSummary.default.propTypes)).isRequired,
|
|
144
|
+
content: _propTypes.default.oneOfType([_propTypes.default.shape(_extends(_extends({}, _brandForm.default.propTypes), {}, {
|
|
145
|
+
type: _propTypes.default.oneOf(['form'])
|
|
146
|
+
})), _propTypes.default.shape(_extends(_extends({}, _contentTranslation.default.propTypes), {}, {
|
|
147
|
+
type: _propTypes.default.oneOf(['translate'])
|
|
148
|
+
})), _propTypes.default.shape(_extends(_extends({}, _searchAndChipsResults.default.propTypes), {}, {
|
|
149
|
+
type: _propTypes.default.oneOf(['populations'])
|
|
150
|
+
})), _propTypes.default.shape(_extends(_extends({}, _courseSelection.default.propTypes), {}, {
|
|
151
|
+
type: _propTypes.default.oneOf(['courses'])
|
|
152
|
+
}))]),
|
|
153
|
+
previousStep: _propTypes.default.shape({
|
|
154
|
+
label: _propTypes.default.string,
|
|
155
|
+
onClick: _propTypes.default.func
|
|
156
|
+
}),
|
|
157
|
+
nextStep: _propTypes.default.shape({
|
|
158
|
+
label: _propTypes.default.string,
|
|
159
|
+
onClick: _propTypes.default.func
|
|
160
|
+
})
|
|
161
|
+
} : {};
|
|
162
|
+
var _default = WizardContents;
|
|
163
|
+
exports.default = _default;
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/wizard-contents/index.js"],"names":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","header","headerTitle","buildForm","content","type","buildButton","step","label","buttonProps","position","buildActionZone","previousStep","nextStep","previousButton","nextButton","actionZone","button","WizardContents","props","summary","headerView","formView","actionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","PropTypes","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;AAC3C,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA;AAAR,MAAmBH,YAAzB;AAEA,QAAMI,eAAe,GAAG;AACtBC,IAAAA,IAAI,EAAE,OADgB;AAEtB,iBAAa,cAFS;AAGtB,kBAAc,cAHQ;AAItBC,IAAAA,IAAI,EAAE,OAJgB;AAKtBH,IAAAA;AALsB,GAAxB;AAQA,sBACE,uDACE;AAAK,IAAA,SAAS,EAAEI,eAAMC;AAAtB,kBACE,6BAAC,2BAAD,EAAwBJ,eAAxB,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG,eAAME;AAAtB,KAAoCP,KAApC,CAFF,CADF,eAKE,6BAAC,oBAAD;AAAa,IAAA,KAAK,EAAED;AAApB,IALF,CADF;AASD,CApBD;;AAsBA,MAAMS,SAAS,GAAGC,OAAO,IAAI;AAC3B,QAAM;AAACC,IAAAA;AAAD,MAASD,OAAf;;AACA,UAAQC,IAAR;AACE,SAAK,MAAL;AACE,0BAAO,6BAAC,kBAAD,EAAeD,OAAf,CAAP;;AACF,SAAK,WAAL;AACE,0BAAO,6BAAC,2BAAD,EAAsBA,OAAtB,CAAP;;AACF,SAAK,aAAL;AACE,0BAAO,6BAA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C,KAAV,cACJK,uBAAcP,SADV,GAENK,UARsB;AASzBlC,EAAAA,OAAO,EAAE8B,mBAAUO,SAAV,CAAoB,CAC3BP,mBAAUC,KAAV,uBACKO,mBAAUT,SADf;AAEE5B,IAAAA,IAAI,EAAE6B,mBAAUS,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAFR,KAD2B,EAK3BT,mBAAUC,KAAV,uBACKS,4BAAiBX,SADtB;AAEE5B,IAAAA,IAAI,EAAE6B,mBAAUS,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAL2B,EAS3BT,mBAAUC,KAAV,uBACKU,+BAA8BZ,SADnC;AAEE5B,IAAAA,IAAI,EAAE6B,mBAAUS,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAT2B,EAa3BT,mBAAUC,KAAV,uBACKW,yBAAgBb,SADrB;AAEE5B,IAAAA,IAAI,EAAE6B,mBAAUS,KAAV,CAAgB,CAAC,SAAD,CAAhB;AAFR,KAb2B,CAApB,CATgB;AA2BzB/B,EAAAA,YAAY,EAAEsB,mBAAUC,KAAV,CAAgB;AAC5B3B,IAAAA,KAAK,EAAE0B,mBAAUE,MADW;AAE5BxC,IAAAA,OAAO,EAAEsC,mBAAUG;AAFS,GAAhB,CA3BW;AA+BzBxB,EAAAA,QAAQ,EAAEqB,mBAAUC,KAAV,CAAgB;AACxB3B,IAAAA,KAAK,EAAE0B,mBAAUE,MADO;AAExBxC,IAAAA,OAAO,EAAEsC,mBAAUG;AAFK,GAAhB;AA/Be,CAA3B;eAqCenB,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle}>{title}</div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n }\n};\n\nconst buildButton = (type, step) => {\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'next' ? 'primary' : 'secondary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button`,\n icon: {\n position: type === 'next' ? 'right' : 'left',\n type: type === 'next' ? 'chevron-right' : 'chevron-left'\n },\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep) => {\n const previousButton = previousStep ? buildButton('previous', previousStep) : null;\n const nextButton = nextStep ? buildButton('next', nextStep) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm(content);\n const actionView = buildActionZone(previousStep, nextStep);\n\n return (\n <div className={style.container}>\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.summaryZone}>\n <WizardSummary {...summary} />\n </div>\n {actionView}\n </div>\n </div>\n <div className={style.footer}>\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} />\n </div>\n <div className={style.actionFooter}>{actionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"file":"index.js"}
|