@coorpacademy/components 10.13.11 → 10.13.14
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/input-text-with-title/index.js +2 -2
- package/es/atom/input-text-with-title/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.js +4 -0
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/test/fixtures/title-and-checkbox-wrapper.js +16 -0
- package/es/molecule/brand-form-group/test/fixtures/title-and-checkbox-wrapper.js.map +1 -0
- package/es/molecule/brand-form-group/test/fixtures.js +2 -0
- package/es/molecule/brand-form-group/test/fixtures.js.map +1 -1
- package/es/molecule/course-sections/index.js +15 -8
- package/es/molecule/course-sections/index.js.map +1 -1
- package/es/molecule/course-sections/style.css +0 -4
- package/es/molecule/drag-and-drop-wrapper/index.js +1 -4
- package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -1
- package/es/molecule/drag-and-drop-wrapper/style.css +0 -4
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/without-checkbox.js +11 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/without-checkbox.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures.js +2 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures.js.map +1 -1
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +15 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/es/molecule/search/test/fixtures.js +15 -0
- package/es/molecule/search/test/fixtures.js.map +1 -0
- package/es/molecule/skill-card/index.js +87 -0
- package/es/molecule/skill-card/index.js.map +1 -0
- package/es/molecule/skill-card/style.css +60 -0
- package/es/molecule/skill-card/test/fixtures/custom-skill.js +10 -0
- package/es/molecule/skill-card/test/fixtures/custom-skill.js.map +1 -0
- package/es/molecule/skill-card/test/fixtures/default.js +15 -0
- package/es/molecule/skill-card/test/fixtures/default.js.map +1 -0
- package/es/molecule/skill-card/test/fixtures/no-aria-labels.js +12 -0
- package/es/molecule/skill-card/test/fixtures/no-aria-labels.js.map +1 -0
- package/es/molecule/skill-card/test/fixtures/short-skill-title.js +10 -0
- package/es/molecule/skill-card/test/fixtures/short-skill-title.js.map +1 -0
- package/es/molecule/skill-card/test/fixtures.js +19 -0
- package/es/molecule/skill-card/test/fixtures.js.map +1 -0
- package/es/molecule/skill-card/test/skill-card.js +90 -0
- package/es/molecule/skill-card/test/skill-card.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/index.js +41 -0
- package/es/molecule/title-and-checkbox-wrapper/index.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/style.css +6 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/default.js +11 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/default.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-checkbox.js +13 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-checkbox.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-without-title.js +11 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-without-title.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/input-text-title.js +14 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures/input-text-title.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures.js +19 -0
- package/es/molecule/title-and-checkbox-wrapper/test/fixtures.js.map +1 -0
- package/es/organism/brand-form/test/fixtures/wizard-certification.js +57 -0
- package/es/organism/brand-form/test/fixtures/wizard-certification.js.map +1 -0
- package/es/organism/brand-form/test/fixtures.js +2 -0
- package/es/organism/brand-form/test/fixtures.js.map +1 -1
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/organism/rewards-form/index.js +6 -14
- package/es/organism/rewards-form/index.js.map +1 -1
- package/es/organism/rewards-form/test/fixtures/default.js +24 -8
- package/es/organism/rewards-form/test/fixtures/default.js.map +1 -1
- package/es/organism/rewards-form/test/fixtures/one-reward.js +5 -3
- package/es/organism/rewards-form/test/fixtures/one-reward.js.map +1 -1
- package/es/organism/rewards-form/test/fixtures/two-rewards.js +10 -6
- package/es/organism/rewards-form/test/fixtures/two-rewards.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures/certification-general-settings-edit.js +37 -0
- package/es/organism/wizard-contents/test/fixtures/certification-general-settings-edit.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures.js +2 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/es/template/app-player/popin-correction/index.js +3 -3
- package/es/template/app-player/popin-correction/index.js.map +1 -1
- package/es/template/app-player/popin-correction/style.css +0 -4
- package/es/variables/colors.css +1 -0
- package/lib/atom/input-text-with-title/index.js +2 -2
- package/lib/atom/input-text-with-title/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.js +5 -0
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/test/fixtures/title-and-checkbox-wrapper.js +25 -0
- package/lib/molecule/brand-form-group/test/fixtures/title-and-checkbox-wrapper.js.map +1 -0
- package/lib/molecule/brand-form-group/test/fixtures.js +3 -0
- package/lib/molecule/brand-form-group/test/fixtures.js.map +1 -1
- package/lib/molecule/course-sections/index.js +16 -8
- package/lib/molecule/course-sections/index.js.map +1 -1
- package/lib/molecule/course-sections/style.css +0 -4
- package/lib/molecule/drag-and-drop-wrapper/index.js +1 -4
- package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -1
- package/lib/molecule/drag-and-drop-wrapper/style.css +0 -4
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/without-checkbox.js +20 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/without-checkbox.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures.js +3 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures.js.map +1 -1
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +25 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/lib/molecule/search/test/fixtures.js +25 -0
- package/lib/molecule/search/test/fixtures.js.map +1 -0
- package/lib/molecule/skill-card/index.js +105 -0
- package/lib/molecule/skill-card/index.js.map +1 -0
- package/lib/molecule/skill-card/style.css +60 -0
- package/lib/molecule/skill-card/test/fixtures/custom-skill.js +17 -0
- package/lib/molecule/skill-card/test/fixtures/custom-skill.js.map +1 -0
- package/lib/molecule/skill-card/test/fixtures/default.js +21 -0
- package/lib/molecule/skill-card/test/fixtures/default.js.map +1 -0
- package/lib/molecule/skill-card/test/fixtures/no-aria-labels.js +18 -0
- package/lib/molecule/skill-card/test/fixtures/no-aria-labels.js.map +1 -0
- package/lib/molecule/skill-card/test/fixtures/short-skill-title.js +17 -0
- package/lib/molecule/skill-card/test/fixtures/short-skill-title.js.map +1 -0
- package/lib/molecule/skill-card/test/fixtures.js +31 -0
- package/lib/molecule/skill-card/test/fixtures.js.map +1 -0
- package/lib/molecule/skill-card/test/skill-card.js +102 -0
- package/lib/molecule/skill-card/test/skill-card.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.js +56 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/style.css +6 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/default.js +20 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/default.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-checkbox.js +23 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-checkbox.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-without-title.js +20 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/drag-drop-without-title.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/input-text-title.js +23 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures/input-text-title.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures.js +31 -0
- package/lib/molecule/title-and-checkbox-wrapper/test/fixtures.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures/wizard-certification.js +66 -0
- package/lib/organism/brand-form/test/fixtures/wizard-certification.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures.js +3 -0
- package/lib/organism/brand-form/test/fixtures.js.map +1 -1
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/organism/rewards-form/index.js +6 -16
- package/lib/organism/rewards-form/index.js.map +1 -1
- package/lib/organism/rewards-form/test/fixtures/default.js +25 -8
- package/lib/organism/rewards-form/test/fixtures/default.js.map +1 -1
- package/lib/organism/rewards-form/test/fixtures/one-reward.js +5 -3
- package/lib/organism/rewards-form/test/fixtures/one-reward.js.map +1 -1
- package/lib/organism/rewards-form/test/fixtures/two-rewards.js +10 -6
- package/lib/organism/rewards-form/test/fixtures/two-rewards.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures/certification-general-settings-edit.js +46 -0
- package/lib/organism/wizard-contents/test/fixtures/certification-general-settings-edit.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures.js +3 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/lib/template/app-player/popin-correction/index.js +3 -3
- package/lib/template/app-player/popin-correction/index.js.map +1 -1
- package/lib/template/app-player/popin-correction/style.css +0 -4
- package/lib/variables/colors.css +1 -0
- package/package.json +2 -2
|
@@ -17,9 +17,9 @@ const InputTextWithTitle = props => {
|
|
|
17
17
|
className: style.container,
|
|
18
18
|
"data-name": dataName,
|
|
19
19
|
"aria-label": ariaLabel
|
|
20
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
20
|
+
}, title ? /*#__PURE__*/React.createElement("span", {
|
|
21
21
|
className: style.title
|
|
22
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
}, title) : null, /*#__PURE__*/React.createElement("div", {
|
|
23
23
|
className: inputTextClass
|
|
24
24
|
}, /*#__PURE__*/React.createElement(InputText, inputText)));
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","inputTextClass","size","smallInputText","defaultInputText","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AACA,QAAMK,cAAc,GAAGJ,SAAS,CAACK,IAAV,KAAmB,OAAnB,GAA6BR,KAAK,CAACS,cAAnC,GAAoDT,KAAK,CAACU,gBAAjF;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW,SAAtB;AAAiC,iBAAWN,QAA5C;AAAsD,kBAAYC;AAAlE,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","inputTextClass","size","smallInputText","defaultInputText","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AACA,QAAMK,cAAc,GAAGJ,SAAS,CAACK,IAAV,KAAmB,OAAnB,GAA6BR,KAAK,CAACS,cAAnC,GAAoDT,KAAK,CAACU,gBAAjF;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW,SAAtB;AAAiC,iBAAWN,QAA5C;AAAsD,kBAAYC;AAAlE,KACGF,KAAK,gBAAG;AAAM,IAAA,SAAS,EAAEJ,KAAK,CAACI;AAAvB,KAA+BA,KAA/B,CAAH,GAAkD,IAD1D,eAEE;AAAK,IAAA,SAAS,EAAEG;AAAhB,kBACE,oBAAC,SAAD,EAAeJ,SAAf,CADF,CAFF,CADF;AAQD,CAZD;;AAcAF,kBAAkB,CAACW,SAAnB,2CAA+B;AAC7BT,EAAAA,SAAS,EAAEL,SAAS,CAACe,KAAV,uBACNd,SAAS,CAACa,SADJ;AAETE,IAAAA,KAAK,EAAEhB,SAAS,CAACiB,MAFR;AAGTP,IAAAA,IAAI,EAAEV,SAAS,CAACiB;AAHP,KADkB;AAM7BX,EAAAA,KAAK,EAAEN,SAAS,CAACiB,MANY;AAO7B,gBAAcjB,SAAS,CAACiB,MAPK;AAQ7B,eAAajB,SAAS,CAACiB;AARM,CAA/B;AAUA,eAAed,kBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputText from '../input-text';\nimport style from './style.css';\n\nconst InputTextWithTitle = props => {\n const {inputText, title, 'data-name': dataName, 'aria-label': ariaLabel} = props;\n const inputTextClass = inputText.size === 'small' ? style.smallInputText : style.defaultInputText;\n\n return (\n <div className={style.container} data-name={dataName} aria-label={ariaLabel}>\n {title ? <span className={style.title}>{title}</span> : null}\n <div className={inputTextClass}>\n <InputText {...inputText} />\n </div>\n </div>\n );\n};\n\nInputTextWithTitle.propTypes = {\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string,\n size: PropTypes.string\n }),\n title: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputTextWithTitle;\n"],"file":"index.js"}
|
|
@@ -26,6 +26,7 @@ import SetupSlider from '../setup-slider';
|
|
|
26
26
|
import SetupSections from '../setup-sections';
|
|
27
27
|
import Title from '../../atom/title';
|
|
28
28
|
import Roles from '../coorp-manager-roles';
|
|
29
|
+
import TitleAndCheckBoxWrapper from '../title-and-checkbox-wrapper';
|
|
29
30
|
import style from './style.css';
|
|
30
31
|
const inputContainerStyle = {
|
|
31
32
|
default: style.defaultWidth,
|
|
@@ -98,6 +99,9 @@ const buildInput = field => {
|
|
|
98
99
|
case 'roles':
|
|
99
100
|
return /*#__PURE__*/React.createElement(Roles, field);
|
|
100
101
|
|
|
102
|
+
case 'titleAndCheckBoxWrapper':
|
|
103
|
+
return /*#__PURE__*/React.createElement(TitleAndCheckBoxWrapper, field);
|
|
104
|
+
|
|
101
105
|
default:
|
|
102
106
|
return /*#__PURE__*/React.createElement(InputText, field);
|
|
103
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["React","PropTypes","classNames","Autocomplete","Select","SelectMultiple","InputText","InputColor","InputCheckbox","InputReadonly","InputSwitch","BrandUploadBox","BrandDownloadBox","Button","InputTextarea","InputHTML","InputDoublestep","ImageUpload","SetupSlider","SetupSections","Title","Roles","style","inputContainerStyle","default","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","string","arrayOf","oneOfType","shape","oneOf"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AAC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ACK9C,gBAAgB,CAAC0C,SADtB;AAEEtB,IAAAA,IAAI,EAAE/B,SAAS,CAAC0D,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAzDkB,EA6DlB1D,SAAS,CAACyD,KAAV,uBACK/C,cAAc,CAAC2C,SADpB;AAEEtB,IAAAA,IAAI,EAAE/B,SAAS,CAAC0D,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KA7DkB,EAiElB1D,SAAS,CAACyD,KAAV,uBACK7C,MAAM,CAACyC,SADZ;AAEEtB,IAAAA,IAAI,EAAE/B,SAAS,CAAC0D,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KAjEkB,EAqElB1D,SAAS,CAACyD,KAAV,uBACKrD,cAAc,CAACiD,SADpB;AAEEtB,IAAAA,IAAI,EAAE/B,SAAS,CAAC0D,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KArEkB,EAyElB1D,SAAS,CAACyD,KAAV,uBACKrC,KAAK,CAACiC,SADX;AAEEtB,IAAAA,IAAI,EAAE/B,SAAS,CAAC0D,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAzEkB,EA6ElB1D,SAAS,CAACyD,KAAV,CAAgBpD,SAAS,CAACgD,SAA1B,CA7EkB,CAApB,CADM;AALiB,CAA3B;AAuFA,eAAed,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return (\n <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["React","PropTypes","classNames","Autocomplete","Select","SelectMultiple","InputText","InputColor","InputCheckbox","InputReadonly","InputSwitch","BrandUploadBox","BrandDownloadBox","Button","InputTextarea","InputHTML","InputDoublestep","ImageUpload","SetupSlider","SetupSections","Title","Roles","TitleAndCheckBoxWrapper","style","inputContainerStyle","default","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","imageUploadContainer","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","string","arrayOf","oneOfType","shape","oneOf"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;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AD,CAAhB;AAFR,KA7DkB,EAiElB3D,SAAS,CAAC0D,KAAV,uBACK9C,MAAM,CAAC0C,SADZ;AAEEtB,IAAAA,IAAI,EAAEhC,SAAS,CAAC2D,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KAjEkB,EAqElB3D,SAAS,CAAC0D,KAAV,uBACKtD,cAAc,CAACkD,SADpB;AAEEtB,IAAAA,IAAI,EAAEhC,SAAS,CAAC2D,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KArEkB,EAyElB3D,SAAS,CAAC0D,KAAV,uBACKtC,KAAK,CAACkC,SADX;AAEEtB,IAAAA,IAAI,EAAEhC,SAAS,CAAC2D,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAzEkB,EA6ElB3D,SAAS,CAAC0D,KAAV,CAAgBrD,SAAS,CAACiD,SAA1B,CA7EkB,CAApB,CADM;AALiB,CAA3B;AAuFA,eAAed,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport TitleAndCheckBoxWrapper from '../title-and-checkbox-wrapper';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} theme={'coorpmanager'} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return (\n <div className={style.imageUploadContainer}>\n <ImageUpload {...field} />\n </div>\n );\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n case 'titleAndCheckBoxWrapper':\n return <TitleAndCheckBoxWrapper {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import SetupSlider from '../../../title-and-checkbox-wrapper/test/fixtures/drag-drop-without-title';
|
|
4
|
+
const {
|
|
5
|
+
props
|
|
6
|
+
} = SetupSlider;
|
|
7
|
+
export default {
|
|
8
|
+
props: {
|
|
9
|
+
title: 'Title and checkbox wrapper',
|
|
10
|
+
subtitle: 'Explanation about the slider',
|
|
11
|
+
fields: [_extends(_extends({}, props), {}, {
|
|
12
|
+
type: 'titleAndCheckBoxWrapper'
|
|
13
|
+
})]
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=title-and-checkbox-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/brand-form-group/test/fixtures/title-and-checkbox-wrapper.js"],"names":["SetupSlider","props","title","subtitle","fields","type"],"mappings":";;AAAA,OAAOA,WAAP,MAAwB,2EAAxB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,WAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,4BADF;AAELC,IAAAA,QAAQ,EAAE,8BAFL;AAGLC,IAAAA,MAAM,EAAE,uBAEDH,KAFC;AAGJI,MAAAA,IAAI,EAAE;AAHF;AAHH;AADM,CAAf","sourcesContent":["import SetupSlider from '../../../title-and-checkbox-wrapper/test/fixtures/drag-drop-without-title';\n\nconst {props} = SetupSlider;\n\nexport default {\n props: {\n title: 'Title and checkbox wrapper',\n subtitle: 'Explanation about the slider',\n fields: [\n {\n ...props,\n type: 'titleAndCheckBoxWrapper'\n }\n ]\n }\n};\n"],"file":"title-and-checkbox-wrapper.js"}
|
|
@@ -14,6 +14,7 @@ import fixtureLookandfeel from './fixtures/lookandfeel';
|
|
|
14
14
|
import fixtureRoles from './fixtures/roles';
|
|
15
15
|
import fixtureSlider from './fixtures/slider';
|
|
16
16
|
import fixtureSso from './fixtures/sso';
|
|
17
|
+
import fixtureTitleAndCheckboxWrapper from './fixtures/title-and-checkbox-wrapper';
|
|
17
18
|
test('Molecule › MoleculeBrandFormGroup > should have valid propTypes', t => {
|
|
18
19
|
t.pass();
|
|
19
20
|
forEach(MoleculeBrandFormGroup.propTypes, (value, key) => {
|
|
@@ -32,4 +33,5 @@ test('Molecule › MoleculeBrandFormGroup › Lookandfeel › should be rendered
|
|
|
32
33
|
test('Molecule › MoleculeBrandFormGroup › Roles › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureRoles);
|
|
33
34
|
test('Molecule › MoleculeBrandFormGroup › Slider › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSlider);
|
|
34
35
|
test('Molecule › MoleculeBrandFormGroup › Sso › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSso);
|
|
36
|
+
test('Molecule › MoleculeBrandFormGroup › TitleAndCheckboxWrapper › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureTitleAndCheckboxWrapper);
|
|
35
37
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBrandFormGroup","fixtureAnalytics","fixtureAnimations","fixtureCmDefault","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,sBAAP,MAAmC,IAAnC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,UAAP,MAAuB,gBAAvB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBrandFormGroup","fixtureAnalytics","fixtureAnimations","fixtureCmDefault","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso","fixtureTitleAndCheckboxWrapper","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,sBAAP,MAAmC,IAAnC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;A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H,CAAJ;AACAZ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,sBAAzF,EAAiHU,YAAjH,CAAJ;AACAb,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,sBAA1F,EAAkHW,aAAlH,CAAJ;AACAd,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,sBAAvF,EAA+GY,UAA/G,CAAJ;AACAf,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,sBAA3G,EAAmIa,8BAAnI,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBrandFormGroup from '..';\nimport fixtureAnalytics from './fixtures/analytics';\nimport fixtureAnimations from './fixtures/animations';\nimport fixtureCmDefault from './fixtures/cm-default';\nimport fixtureCohort from './fixtures/cohort';\nimport fixtureDashboard from './fixtures/dashboard';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDoublefield from './fixtures/doublefield';\nimport fixtureImages from './fixtures/images';\nimport fixtureLookandfeel from './fixtures/lookandfeel';\nimport fixtureRoles from './fixtures/roles';\nimport fixtureSlider from './fixtures/slider';\nimport fixtureSso from './fixtures/sso';\nimport fixtureTitleAndCheckboxWrapper from './fixtures/title-and-checkbox-wrapper';\n\ntest('Molecule › MoleculeBrandFormGroup > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBrandFormGroup.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBrandFormGroup.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnalytics);\ntest('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnimations);\ntest('Molecule › MoleculeBrandFormGroup › CmDefault › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCmDefault);\ntest('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCohort);\ntest('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDashboard);\ntest('Molecule › MoleculeBrandFormGroup › Default › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDefault);\ntest('Molecule › MoleculeBrandFormGroup › Doublefield › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDoublefield);\ntest('Molecule › MoleculeBrandFormGroup › Images › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureImages);\ntest('Molecule › MoleculeBrandFormGroup › Lookandfeel › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureLookandfeel);\ntest('Molecule › MoleculeBrandFormGroup › Roles › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureRoles);\ntest('Molecule › MoleculeBrandFormGroup › Slider › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSlider);\ntest('Molecule › MoleculeBrandFormGroup › Sso › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSso);\ntest('Molecule › MoleculeBrandFormGroup › TitleAndCheckboxWrapper › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureTitleAndCheckboxWrapper);\n"],"file":"fixtures.js"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
import InputTextWithTitle from '../../atom/input-text-with-title';
|
|
@@ -5,6 +7,7 @@ import CourseSection from '../course-section';
|
|
|
5
7
|
import DraggableList from '../draggable-list';
|
|
6
8
|
import Loader from '../../atom/loader';
|
|
7
9
|
import Title from '../../atom/title';
|
|
10
|
+
import TitleAndCheckBoxWrapper from '../title-and-checkbox-wrapper';
|
|
8
11
|
import style from './style.css';
|
|
9
12
|
|
|
10
13
|
const Loading = () => /*#__PURE__*/React.createElement("div", {
|
|
@@ -23,15 +26,19 @@ const CourseSections = ({
|
|
|
23
26
|
inputTitle
|
|
24
27
|
}) => {
|
|
25
28
|
if (isLoading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
|
|
30
|
+
const child = _extends(_extends({}, mandatoryCoursesInput), {}, {
|
|
31
|
+
childType: 'input-text'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const sectionTitle = {
|
|
29
35
|
title: inputTitle,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
'data-name': 'mandatory-courses-input-title'
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", null, mandatoryCoursesInput && sectionTitle ? /*#__PURE__*/React.createElement(TitleAndCheckBoxWrapper, {
|
|
39
|
+
child: child,
|
|
40
|
+
sectionTitle: sectionTitle
|
|
41
|
+
}) : null, title ? /*#__PURE__*/React.createElement("div", {
|
|
35
42
|
className: style.title
|
|
36
43
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
37
44
|
title: title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","InputTextWithTitle","CourseSection","DraggableList","Loader","Title","style","Loading","loaderContainer","loader","CourseSections","sections","onDrop","isLoading","title","mandatoryCoursesInput","inputTitle","propTypes","string","arrayOf","shape","func","bool"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC,MAAD;AAAQ,EAAA,SAAS,EAAEF,KAAK,CAACG,MAAzB;AAAiC,EAAA,KAAK,EAAC;AAAvC,EADF,CADF;;AAMA,MAAMC,cAAc,GAAG,CAAC;AACtBC,EAAAA,QADsB;AAEtBC,EAAAA,MAFsB;AAGtBC,EAAAA,SAHsB;AAItBC,EAAAA,KAJsB;AAKtBC,EAAAA,qBALsB;AAMtBC,EAAAA;AANsB,CAAD,KAOjB;AACJ,MAAIH,SAAJ,EAAe,oBAAO,oBAAC,OAAD,OAAP
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","InputTextWithTitle","CourseSection","DraggableList","Loader","Title","TitleAndCheckBoxWrapper","style","Loading","loaderContainer","loader","CourseSections","sections","onDrop","isLoading","title","mandatoryCoursesInput","inputTitle","child","childType","sectionTitle","propTypes","string","arrayOf","shape","func","bool"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC,MAAD;AAAQ,EAAA,SAAS,EAAEF,KAAK,CAACG,MAAzB;AAAiC,EA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,SAAS,CAAC0B,IALI;AAMzBV,EAAAA,qBAAqB,EAAEhB,SAAS,CAACwB,KAAV,CAAgBvB,kBAAkB,CAACoB,SAAnC;AANE,CAA3B;AASA,eAAeV,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputTextWithTitle from '../../atom/input-text-with-title';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport TitleAndCheckBoxWrapper from '../title-and-checkbox-wrapper';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({\n sections,\n onDrop,\n isLoading,\n title,\n mandatoryCoursesInput,\n inputTitle\n}) => {\n if (isLoading) return <Loading />;\n\n const child = {...mandatoryCoursesInput, childType: 'input-text'};\n const sectionTitle = {title: inputTitle, 'data-name': 'mandatory-courses-input-title'};\n return (\n <div>\n {mandatoryCoursesInput && sectionTitle ? (\n <TitleAndCheckBoxWrapper child={child} sectionTitle={sectionTitle} />\n ) : null}\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n inputTitle: PropTypes.string,\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool,\n mandatoryCoursesInput: PropTypes.shape(InputTextWithTitle.propTypes)\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
|
|
@@ -11,7 +11,6 @@ import style from './style.css';
|
|
|
11
11
|
const DragAndDropWrapper = props => {
|
|
12
12
|
const {
|
|
13
13
|
list = [],
|
|
14
|
-
checkBoxTitle,
|
|
15
14
|
'data-name': dataName
|
|
16
15
|
} = props;
|
|
17
16
|
|
|
@@ -22,9 +21,7 @@ const DragAndDropWrapper = props => {
|
|
|
22
21
|
}, /*#__PURE__*/React.createElement(DragAndDrop, dragAndDropProps));
|
|
23
22
|
}, list);
|
|
24
23
|
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("
|
|
26
|
-
className: style.title
|
|
27
|
-
}, /*#__PURE__*/React.createElement(CheckboxWithTitle, checkBoxTitle)), /*#__PURE__*/React.createElement("ul", {
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("ul", {
|
|
28
25
|
className: style.group,
|
|
29
26
|
"data-name": dataName
|
|
30
27
|
}, dragAndDropList));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/drag-and-drop-wrapper/index.js"],"names":["React","PropTypes","DragAndDrop","CheckboxWithTitle","style","DragAndDropWrapper","props","list","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/drag-and-drop-wrapper/index.js"],"names":["React","PropTypes","DragAndDrop","CheckboxWithTitle","style","DragAndDropWrapper","props","list","dataName","dragAndDropList","dragAndDropProps","dragAndDrop","title","group","propTypes","arrayOf","shape","checkBoxTitle","string"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,0BAAxB;AACA,OAAOC,iBAAP,MAA8B,gCAA9B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,IAAI,GAAG,EAAR;AAAY,iBAAaC;AAAzB,MAAqCF,KAA3C;;AAEA,QAAMG,eAAe,GAAG,KAAIC,gBAAgB,IAAI;AAC9C,wBACE;AAAI,MAAA,SAAS,EAAEN,KAAK,CAACO,WAArB;AAAkC,MAAA,GAAG,EAAG,eAAcD,gBAAgB,CAACE,KAAM;AAA7E,oBACE,oBAAC,WAAD,EAAiBF,gBAAjB,CADF,CADF;AAKD,GANuB,EAMrBH,IANqB,CAAxB;;AAQA,sBACE,8CACE;AAAI,IAAA,SAAS,EAAEH,KAAK,CAACS,KAArB;AAA4B,iBAAWL;AAAvC,KACGC,eADH,CADF,CADF;AAOD,CAlBD;;AAoBAJ,kBAAkB,CAACS,SAAnB,2CAA+B;AAC7BP,EAAAA,IAAI,EAAEN,SAAS,CAACc,OAAV,CAAkBd,SAAS,CAACe,KAAV,CAAgBd,WAAW,CAACY,SAA5B,CAAlB,CADuB;AAE7BG,EAAAA,aAAa,EAAEhB,SAAS,CAACe,KAAV,cAAoBb,iBAAiB,CAACW,SAAtC,EAFc;AAG7B,eAAab,SAAS,CAACiB;AAHM,CAA/B;AAMA,eAAeb,kBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport DragAndDrop from '../../atom/drag-and-drop';\nimport CheckboxWithTitle from '../../atom/checkbox-with-title';\nimport style from './style.css';\n\nconst DragAndDropWrapper = props => {\n const {list = [], 'data-name': dataName} = props;\n\n const dragAndDropList = map(dragAndDropProps => {\n return (\n <li className={style.dragAndDrop} key={`dragAndDrop-${dragAndDropProps.title}`}>\n <DragAndDrop {...dragAndDropProps} />\n </li>\n );\n }, list);\n\n return (\n <div>\n <ul className={style.group} data-name={dataName}>\n {dragAndDropList}\n </ul>\n </div>\n );\n};\n\nDragAndDropWrapper.propTypes = {\n list: PropTypes.arrayOf(PropTypes.shape(DragAndDrop.propTypes)),\n checkBoxTitle: PropTypes.shape({...CheckboxWithTitle.propTypes}),\n 'data-name': PropTypes.string\n};\n\nexport default DragAndDropWrapper;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import firstdDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/default';
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
list: [_extends(_extends({}, firstdDragAndDrop.props), {}, {
|
|
7
|
+
title: 'Add a badge'
|
|
8
|
+
})]
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=without-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/drag-and-drop-wrapper/test/fixtures/without-checkbox.js"],"names":["firstdDragAndDrop","props","list","title"],"mappings":";;AAAA,OAAOA,iBAAP,MAA8B,sDAA9B;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,uBAAKF,iBAAiB,CAACC,KAAvB;AAA8BE,MAAAA,KAAK,EAAE;AAArC;AADD;AADM,CAAf","sourcesContent":["import firstdDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/default';\n\nexport default {\n props: {\n list: [{...firstdDragAndDrop.props, title: 'Add a badge'}]\n }\n};\n"],"file":"without-checkbox.js"}
|
|
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
|
|
|
4
4
|
import MoleculeDragAndDropWrapper from '..';
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureTwoDragAndDrops from './fixtures/two-drag-and-drops';
|
|
7
|
+
import fixtureWithoutCheckbox from './fixtures/without-checkbox';
|
|
7
8
|
test('Molecule › MoleculeDragAndDropWrapper > should have valid propTypes', t => {
|
|
8
9
|
t.pass();
|
|
9
10
|
forEach(MoleculeDragAndDropWrapper.propTypes, (value, key) => {
|
|
@@ -12,4 +13,5 @@ test('Molecule › MoleculeDragAndDropWrapper > should have valid propTypes', t
|
|
|
12
13
|
});
|
|
13
14
|
test('Molecule › MoleculeDragAndDropWrapper › Default › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureDefault);
|
|
14
15
|
test('Molecule › MoleculeDragAndDropWrapper › TwoDragAndDrops › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureTwoDragAndDrops);
|
|
16
|
+
test('Molecule › MoleculeDragAndDropWrapper › WithoutCheckbox › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureWithoutCheckbox);
|
|
15
17
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/drag-and-drop-wrapper/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDragAndDropWrapper","fixtureDefault","fixtureTwoDragAndDrops","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,0BAAP,MAAuC,IAAvC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,sBAAP,MAAmC,+BAAnC;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/drag-and-drop-wrapper/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDragAndDropWrapper","fixtureDefault","fixtureTwoDragAndDrops","fixtureWithoutCheckbox","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,0BAAP,MAAuC,IAAvC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,sBAAP,MAAmC,+BAAnC;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AAEAN,IAAI,CAAC,qEAAD,EAAwEO,CAAC,IAAI;AAC/EA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,0BAA0B,CAACM,SAA5B,EAAuC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC5DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+DAA8DF,GAAI,mEAA3F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,0BAA/F,EAA2HC,cAA3H,CAAJ;AACAJ,IAAI,CAAC,8EAAD,EAAiFE,oBAAjF,EAAuGC,0BAAvG,EAAmIE,sBAAnI,CAAJ;AACAL,IAAI,CAAC,8EAAD,EAAiFE,oBAAjF,EAAuGC,0BAAvG,EAAmIG,sBAAnI,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDragAndDropWrapper from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureTwoDragAndDrops from './fixtures/two-drag-and-drops';\nimport fixtureWithoutCheckbox from './fixtures/without-checkbox';\n\ntest('Molecule › MoleculeDragAndDropWrapper > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDragAndDropWrapper.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeDragAndDropWrapper.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeDragAndDropWrapper › Default › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureDefault);\ntest('Molecule › MoleculeDragAndDropWrapper › TwoDragAndDrops › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureTwoDragAndDrops);\ntest('Molecule › MoleculeDragAndDropWrapper › WithoutCheckbox › should be rendered', renderComponentMacro, MoleculeDragAndDropWrapper, fixtureWithoutCheckbox);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeInputTextWithTiteledCheckbox from '..';
|
|
5
|
+
import fixtureChecked from './fixtures/checked';
|
|
6
|
+
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);
|
|
14
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/input-text-with-titeled-checkbox/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeInputTextWithTiteledCheckbox","fixtureChecked","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oCAAP,MAAiD,IAAjD;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,+EAAD,EAAkFM,CAAC,IAAI;AACzFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,oCAAoC,CAACK,SAAtC,EAAiD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtEJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yEAAwEF,GAAI,mEAArG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,oCAAzG,EAA+IC,cAA/I,CAAJ;AACAJ,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,oCAA3G,EAAiJE,gBAAjJ,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeInputTextWithTiteledCheckbox from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeSearch from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureWithValue from './fixtures/with-value';
|
|
7
|
+
test('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeSearch.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);
|
|
14
|
+
test('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSearch","fixtureDefault","fixtureWithValue","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAL,IAAI,CAAC,yDAAD,EAA4DM,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,cAAnF,EAAmGC,cAAnG,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,cAArF,EAAqGE,gBAArG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useCallback, useState, useMemo } from 'react';
|
|
2
|
+
import { convert } from 'css-color-function';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon } from '@coorpacademy/nova-icons';
|
|
5
|
+
import getOr from 'lodash/fp/getOr';
|
|
6
|
+
import ButtonLink from '../../atom/button-link';
|
|
7
|
+
import style from './style.css';
|
|
8
|
+
|
|
9
|
+
const getGradientBackground = baseColor => {
|
|
10
|
+
const gradients = [convert(`color(${baseColor} lightness(30%))`), convert(`color(${baseColor} lightness(47%))`), convert(`color(${baseColor} lightness(55%))`)];
|
|
11
|
+
return `radial-gradient(62.12% 56.45% at 0% 77.29%, ${gradients[0]} 0%, ${convert(`color(${gradients[0]} a(0))`)} 100%), radial-gradient(113.85% 103.46% at 93.27% 7.88%, ${gradients[1]} 0%, ${convert(`color(${gradients[1]} a(0))`)} 100%), radial-gradient(49.66% 49.63% at 78.65% 86.26%, ${gradients[2]} 0%, ${convert(`color(${gradients[2]} a(0))`)} 100%), ${baseColor}`;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const SkillCard = (props, context) => {
|
|
15
|
+
const {
|
|
16
|
+
'aria-label': ariaLabel,
|
|
17
|
+
skillTitle,
|
|
18
|
+
skillAriaLabel,
|
|
19
|
+
buttonLabel,
|
|
20
|
+
buttonAriaLabel,
|
|
21
|
+
reviseLabel,
|
|
22
|
+
reviseAriaLabel,
|
|
23
|
+
onClick,
|
|
24
|
+
isCustom = false
|
|
25
|
+
} = props;
|
|
26
|
+
const {
|
|
27
|
+
skin
|
|
28
|
+
} = context;
|
|
29
|
+
const [hovered, setHovered] = useState(false);
|
|
30
|
+
const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);
|
|
31
|
+
const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);
|
|
32
|
+
const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);
|
|
33
|
+
const buttonProps = {
|
|
34
|
+
customStyle: {
|
|
35
|
+
backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),
|
|
36
|
+
color: hovered ? '#FFFFFF' : primarySkinColor,
|
|
37
|
+
transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
|
|
38
|
+
},
|
|
39
|
+
onClick,
|
|
40
|
+
'aria-label': buttonAriaLabel,
|
|
41
|
+
label: buttonLabel,
|
|
42
|
+
'data-name': 'skill-card-button'
|
|
43
|
+
};
|
|
44
|
+
const titleBackgroundColor = useMemo(() => isCustom ? '#128C72' : primarySkinColor, [isCustom, primarySkinColor]);
|
|
45
|
+
const titleBackground = useMemo(() => getGradientBackground(titleBackgroundColor), [titleBackgroundColor]);
|
|
46
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: style.skillCardWrapper,
|
|
48
|
+
"data-name": "skill-card-wrapper",
|
|
49
|
+
"aria-label": ariaLabel
|
|
50
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
"data-name": "skill-title",
|
|
52
|
+
className: style.skillTitle,
|
|
53
|
+
"aria-label": skillAriaLabel || skillTitle,
|
|
54
|
+
style: {
|
|
55
|
+
background: titleBackground
|
|
56
|
+
}
|
|
57
|
+
}, skillTitle), /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
"data-name": "card-content-wrapper"
|
|
59
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: style.questionReviseText,
|
|
61
|
+
"data-name": "questions-to-revise-label",
|
|
62
|
+
"aria-label": reviseAriaLabel || reviseLabel
|
|
63
|
+
}, /*#__PURE__*/React.createElement(QuestionIcon, {
|
|
64
|
+
className: style.questionReviseIcon,
|
|
65
|
+
width: 16,
|
|
66
|
+
height: 16
|
|
67
|
+
}), reviseLabel), /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: style.buttonWrapper,
|
|
69
|
+
onMouseOver: handleMouseOver,
|
|
70
|
+
onMouseLeave: handleMouseLeave,
|
|
71
|
+
"data-name": "button-wrapper"
|
|
72
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, buttonProps))));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
SkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
76
|
+
'aria-label': PropTypes.string.isRequired,
|
|
77
|
+
skillTitle: PropTypes.string,
|
|
78
|
+
skillAriaLabel: PropTypes.string,
|
|
79
|
+
buttonLabel: PropTypes.string,
|
|
80
|
+
buttonAriaLabel: PropTypes.string,
|
|
81
|
+
reviseLabel: PropTypes.string,
|
|
82
|
+
reviseAriaLabel: PropTypes.string,
|
|
83
|
+
isCustom: PropTypes.bool,
|
|
84
|
+
onClick: PropTypes.func
|
|
85
|
+
} : {};
|
|
86
|
+
export default SkillCard;
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/skill-card/index.js"],"names":["React","useCallback","useState","useMemo","convert","PropTypes","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","getOr","ButtonLink","style","getGradientBackground","baseColor","gradients","SkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","buttonLabel","buttonAriaLabel","reviseLabel","reviseAriaLabel","onClick","isCustom","skin","hovered","setHovered","primarySkinColor","handleMouseOver","handleMouseLeave","buttonProps","customStyle","backgroundColor","color","transition","label","titleBackgroundColor","titleBackground","skillCardWrapper","background","questionReviseText","questionReviseIcon","buttonWrapper","propT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F,eAWE;AAAK,iBAAU;AAAf,kBACE;AACE,IAAA,SAAS,EAAER,KAAK,CAACgC,kBADnB;AAEE,iBAAU,2BAFZ;AAGE,kBAAYnB,eAAe,IAAID;AAHjC,kBAKE,oBAAC,YAAD;AAAc,IAAA,SAAS,EAAEZ,KAAK,CAACiC,kBAA/B;AAAmD,IAAA,KAAK,EAAE,EAA1D;AAA8D,IAAA,MAAM,EAAE;AAAtE,IALF,EAMGrB,WANH,CADF,eASE;AACE,IAAA,SAAS,EAAEZ,KAAK,CAACkC,aADnB;AAEE,IAAA,WAAW,EAAEd,eAFf;AAGE,IAAA,YAAY,EAAEC,gBAHhB;AAIE,iBAAU;AAJZ,kBAME,oBAAC,UAAD,EAAgBC,WAAhB,CANF,CATF,CAXF,CADF;AAgCD,CAzED;;AA2EAlB,SAAS,CAAC+B,SAAV,2CAAsB;AACpB,gBAAcxC,SAAS,CAACyC,MAAV,CAAiBC,UADX;AAEpB7B,EAAAA,UAAU,EAAEb,SAAS,CAACyC,MAFF;AAGpB3B,EAAAA,cAAc,EAAEd,SAAS,CAACyC,MAHN;AAIpB1B,EAAAA,WAAW,EAAEf,SAAS,CAACyC,MAJH;AAKpBzB,EAAAA,eAAe,EAAEhB,SAAS,CAACyC,MALP;AAMpBxB,EAAAA,WAAW,EAAEjB,SAAS,CAACyC,MANH;AAOpBvB,EAAAA,eAAe,EAAElB,SAAS,CAACyC,MAPP;AAQpBrB,EAAAA,QAAQ,EAAEpB,SAAS,CAAC2C,IARA;AASpBxB,EAAAA,OAAO,EAAEnB,SAAS,CAAC4C;AATC,CAAtB;AAYA,eAAenC,SAAf","sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {convert} from 'css-color-function';\nimport PropTypes from 'prop-types';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst getGradientBackground = baseColor => {\n const gradients = [\n convert(`color(${baseColor} lightness(30%))`),\n convert(`color(${baseColor} lightness(47%))`),\n convert(`color(${baseColor} lightness(55%))`)\n ];\n\n return `radial-gradient(62.12% 56.45% at 0% 77.29%, ${gradients[0]} 0%, ${convert(\n `color(${gradients[0]} a(0))`\n )} 100%), radial-gradient(113.85% 103.46% at 93.27% 7.88%, ${gradients[1]} 0%, ${convert(\n `color(${gradients[1]} a(0))`\n )} 100%), radial-gradient(49.66% 49.63% at 78.65% 86.26%, ${gradients[2]} 0%, ${convert(\n `color(${gradients[2]} a(0))`\n )} 100%), ${baseColor}`;\n};\n\nconst SkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n buttonLabel,\n buttonAriaLabel,\n reviseLabel,\n reviseAriaLabel,\n onClick,\n isCustom = false\n } = props;\n const {skin} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick,\n 'aria-label': buttonAriaLabel,\n label: buttonLabel,\n 'data-name': 'skill-card-button'\n };\n\n const titleBackgroundColor = useMemo(() => (isCustom ? '#128C72' : primarySkinColor), [\n isCustom,\n primarySkinColor\n ]);\n\n const titleBackground = useMemo(() => getGradientBackground(titleBackgroundColor), [\n titleBackgroundColor\n ]);\n\n return (\n <div className={style.skillCardWrapper} data-name=\"skill-card-wrapper\" aria-label={ariaLabel}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n style={{\n background: titleBackground\n }}\n >\n {skillTitle}\n </div>\n <div data-name=\"card-content-wrapper\">\n <div\n className={style.questionReviseText}\n data-name=\"questions-to-revise-label\"\n aria-label={reviseAriaLabel || reviseLabel}\n >\n <QuestionIcon className={style.questionReviseIcon} width={16} height={16} />\n {reviseLabel}\n </div>\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-wrapper\"\n >\n <ButtonLink {...buttonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nSkillCard.propTypes = {\n 'aria-label': PropTypes.string.isRequired,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n buttonLabel: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n reviseLabel: PropTypes.string,\n reviseAriaLabel: PropTypes.string,\n isCustom: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nexport default SkillCard;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_400 from colors;
|
|
3
|
+
@value white from colors;
|
|
4
|
+
@value box_shadow_light_dark from colors;
|
|
5
|
+
@value box_shadow_medium_dark from colors;
|
|
6
|
+
|
|
7
|
+
.textBase {
|
|
8
|
+
font-family: "Gilroy";
|
|
9
|
+
font-style: normal;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.skillCardWrapper {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
max-width: 353px;
|
|
16
|
+
min-width: 245px;
|
|
17
|
+
height: 242px;
|
|
18
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
19
|
+
transition: box-shadow 0.15s ease-in-out;
|
|
20
|
+
border-radius: 8px 8px 12px 12px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.skillCardWrapper:hover {
|
|
24
|
+
box-shadow: 0px 4px 48px box_shadow_medium_dark;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.skillTitle {
|
|
28
|
+
composes: textBase;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
font-size: 20px;
|
|
31
|
+
line-height: 28px;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
height: 112px;
|
|
35
|
+
border-radius: 8px 8px 0px 0px;
|
|
36
|
+
color: white;
|
|
37
|
+
padding: 0px 24px;
|
|
38
|
+
user-select: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.questionReviseIcon {
|
|
42
|
+
padding-right : 8px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.questionReviseText {
|
|
46
|
+
composes: textBase;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items : center;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
font-size: 16px;
|
|
51
|
+
line-height: 22px;
|
|
52
|
+
color: cm_grey_400;
|
|
53
|
+
padding: 16px 24px 24px;
|
|
54
|
+
user-select: none;
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.buttonWrapper {
|
|
59
|
+
padding: 0px 24px;
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import { defaultProps } from './default';
|
|
4
|
+
export default {
|
|
5
|
+
props: _extends(_extends({}, defaultProps), {}, {
|
|
6
|
+
skillTitle: 'This is a custom skill',
|
|
7
|
+
isCustom: true
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=custom-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/skill-card/test/fixtures/custom-skill.js"],"names":["defaultProps","props","skillTitle","isCustom"],"mappings":";;AAAA,SAAQA,YAAR,QAA2B,WAA3B;AAEA,eAAe;AACbC,EAAAA,KAAK,wBAAMD,YAAN;AAAoBE,IAAAA,UAAU,EAAE,wBAAhC;AAA0DC,IAAAA,QAAQ,EAAE;AAApE;AADQ,CAAf","sourcesContent":["import {defaultProps} from './default';\n\nexport default {\n props: {...defaultProps, skillTitle: 'This is a custom skill', isCustom: true}\n};\n"],"file":"custom-skill.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const defaultProps = {
|
|
2
|
+
'aria-label': 'Skill Card',
|
|
3
|
+
skillTitle: 'Critical thinking and analysis',
|
|
4
|
+
skillAriaLabel: 'Skill aria label',
|
|
5
|
+
buttonLabel: 'Revise this skill',
|
|
6
|
+
buttonAriaLabel: 'Button aria label',
|
|
7
|
+
reviseLabel: '75 questions to revise',
|
|
8
|
+
reviseAriaLabel: 'revise aria label',
|
|
9
|
+
isCustom: undefined,
|
|
10
|
+
onClick: () => console.log('revise')
|
|
11
|
+
};
|
|
12
|
+
export default {
|
|
13
|
+
props: defaultProps
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=default.js.map
|