@coorpacademy/components 10.1.5 → 10.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/button-link/style.css +1 -5
- package/es/atom/button-link/test/fixtures.js +33 -0
- package/es/atom/button-link/test/fixtures.js.map +1 -0
- package/es/atom/chips/test/fixtures.js +17 -0
- package/es/atom/chips/test/fixtures.js.map +1 -0
- package/es/atom/content-badge/test/fixtures.js +27 -0
- package/es/atom/content-badge/test/fixtures.js.map +1 -0
- package/es/atom/input-search/test/fixtures.js +19 -0
- package/es/atom/input-search/test/fixtures.js.map +1 -0
- package/es/atom/input-text/test/fixtures.js +2 -0
- package/es/atom/input-text/test/fixtures.js.map +1 -1
- package/es/atom/input-textarea/test/fixtures.js +4 -0
- package/es/atom/input-textarea/test/fixtures.js.map +1 -1
- package/es/atom/tag/test/fixtures.js +19 -0
- package/es/atom/tag/test/fixtures.js.map +1 -0
- package/es/atom/wizard-steps/test/fixtures.js +17 -0
- package/es/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/es/molecule/banner/index.js +19 -10
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/banner/style.css +10 -8
- package/es/molecule/banner/test/fixtures.js +15 -0
- package/es/molecule/banner/test/fixtures.js.map +1 -0
- package/es/molecule/brand-form-group/index.js +20 -5
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +19 -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/card/test/fixtures.js +4 -0
- package/es/molecule/card/test/fixtures.js.map +1 -1
- package/es/molecule/cm-popin/test/fixtures.js +17 -0
- package/es/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/es/molecule/feedback/test/fixtures.js +0 -2
- package/es/molecule/feedback/test/fixtures.js.map +1 -1
- package/es/molecule/vertical-tabs/test/fixtures.js +15 -0
- package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/es/molecule/wizard-summary/index.js +3 -1
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +8 -0
- package/es/molecule/wizard-summary/test/fixtures.js +21 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.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/search-and-chips-results/index.js +1 -0
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +1 -1
- package/es/organism/search-and-chips-results/test/fixtures.js +21 -0
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -0
- package/es/template/app-player/popin-end/test/fixtures.js +0 -2
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/es/variables/colors.css +2 -0
- package/lib/atom/button-link/style.css +1 -5
- package/lib/atom/button-link/test/fixtures.js +52 -0
- package/lib/atom/button-link/test/fixtures.js.map +1 -0
- package/lib/atom/chips/test/fixtures.js +28 -0
- package/lib/atom/chips/test/fixtures.js.map +1 -0
- package/lib/atom/content-badge/test/fixtures.js +43 -0
- package/lib/atom/content-badge/test/fixtures.js.map +1 -0
- package/lib/atom/input-search/test/fixtures.js +31 -0
- package/lib/atom/input-search/test/fixtures.js.map +1 -0
- package/lib/atom/input-text/test/fixtures.js +3 -0
- package/lib/atom/input-text/test/fixtures.js.map +1 -1
- package/lib/atom/input-textarea/test/fixtures.js +6 -0
- package/lib/atom/input-textarea/test/fixtures.js.map +1 -1
- package/lib/atom/tag/test/fixtures.js +31 -0
- package/lib/atom/tag/test/fixtures.js.map +1 -0
- package/lib/atom/wizard-steps/test/fixtures.js +28 -0
- package/lib/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/lib/molecule/banner/index.js +19 -10
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/banner/style.css +10 -8
- package/lib/molecule/{search → banner}/test/fixtures.js +5 -5
- package/lib/molecule/banner/test/fixtures.js.map +1 -0
- package/lib/molecule/brand-form-group/index.js +22 -5
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +19 -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/card/test/fixtures.js +6 -0
- package/lib/molecule/card/test/fixtures.js.map +1 -1
- package/lib/molecule/cm-popin/test/fixtures.js +28 -0
- package/lib/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/feedback/test/fixtures.js +0 -3
- package/lib/molecule/feedback/test/fixtures.js.map +1 -1
- package/lib/molecule/vertical-tabs/test/fixtures.js +25 -0
- package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/lib/molecule/wizard-summary/index.js +3 -1
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +8 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +34 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +31 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.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/search-and-chips-results/index.js +1 -0
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +1 -1
- package/lib/organism/search-and-chips-results/test/fixtures.js +34 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -0
- package/lib/template/app-player/popin-end/test/fixtures.js +0 -3
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/lib/variables/colors.css +2 -0
- package/package.json +2 -2
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["buildInput","field","type","buildField","index","input","style","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","SelectMultiple","Roles"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAASD,KAAf;;AAEA,UAAQC,IAAR;AACE,SAAK,cAAL;AACE,0BAAO,6BAAC,qBAAD,EAAkBD,KAAlB,CAAP;;AACF,SAAK,OAAL;AACE,0BAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,oBAAD,EAAiBA,KAAjB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,MAAL;AACE,0BAAO,6BAAC,kBAAD,EAAeA,KAAf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AEoB,mBAAUM,KAAV,CAAgB,CAAC,UAAD,CAAhB;AAFR,KA7CkB,EAiDlBN,mBAAUI,KAAV,uBACKc,mBAAUnB,SADf;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAFR,KAjDkB,EAqDlBN,mBAAUI,KAAV,uBACKe,0BAAiBpB,SADtB;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KArDkB,EAyDlBN,mBAAUI,KAAV,uBACKgB,wBAAerB,SADpB;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAzDkB,EA6DlBN,mBAAUI,KAAV,uBACKiB,gBAAOtB,SADZ;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KA7DkB,EAiElBN,mBAAUI,KAAV,uBACKkB,wBAAevB,SADpB;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KAjEkB,EAqElBN,mBAAUI,KAAV,uBACKmB,2BAAMxB,SADX;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KArEkB,EAyElBN,mBAAUI,KAAV,CAAgBc,mBAAUnB,SAA1B,CAzEkB,CAApB,CADM;AALiB,CAA3B;eAmFed,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {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 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} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <ImageUpload {...field} />;\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\n return (\n <div className={style.field} 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 }),\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 }),\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 }),\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 }),\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":["inputContainerStyle","default","style","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","SelectMultiple","Roles"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG;AAC1BC,EAAAA,OAAO,EAAEC,eAAMC,YADW;AAE1BC,EAAAA,MAAM,EAAEF,eAAMG,WAFY;AAG1BC,EAAAA,KAAK,EAAEJ,eAAMK;AAHa,CAA5B;;AAMA,MAAMC,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAASD,KAAf;;AAEA,UAAQC,IAAR;AACE,SAAK,cAAL;AACE,0BAAO,6BAAC,qBAAD,EAAkBD,KAAlB,CAAP;;AACF,SAAK,OAAL;AACE,0BAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,oBAAD,EAAiBA,KAAjB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6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AAEErB,IAAAA,IAAI,EAAEsB,mBAAUM,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KArEkB,EAyElBN,mBAAUI,KAAV,uBACKmB,2BAAMxB,SADX;AAEErB,IAAAA,IAAI,EAAEsB,mBAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAzEkB,EA6ElBN,mBAAUI,KAAV,CAAgBc,mBAAUnB,SAA1B,CA7EkB,CAApB,CADM;AALiB,CAA3B;eAuFed,c","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} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <ImageUpload {...field} />;\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"}
|
|
@@ -50,6 +50,25 @@
|
|
|
50
50
|
margin-bottom: 0;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
.fieldCoorpmanager {
|
|
54
|
+
margin: 0 0 32px 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.defaultWidth {
|
|
58
|
+
composes: fieldCoorpmanager;
|
|
59
|
+
width: 300px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mediumWidth {
|
|
63
|
+
composes: fieldCoorpmanager;
|
|
64
|
+
width: 444px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.largeWidth {
|
|
68
|
+
composes: fieldCoorpmanager;
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
53
72
|
@media desktop {
|
|
54
73
|
.groupGrid {
|
|
55
74
|
flex-direction: column;
|
|
@@ -12,6 +12,8 @@ var _analytics = _interopRequireDefault(require("./fixtures/analytics"));
|
|
|
12
12
|
|
|
13
13
|
var _animations = _interopRequireDefault(require("./fixtures/animations"));
|
|
14
14
|
|
|
15
|
+
var _cmDefault = _interopRequireDefault(require("./fixtures/cm-default"));
|
|
16
|
+
|
|
15
17
|
var _cohort = _interopRequireDefault(require("./fixtures/cohort"));
|
|
16
18
|
|
|
17
19
|
var _dashboard = _interopRequireDefault(require("./fixtures/dashboard"));
|
|
@@ -40,6 +42,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
40
42
|
});
|
|
41
43
|
(0, _ava.default)('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', _renderComponent.default, _.default, _analytics.default);
|
|
42
44
|
(0, _ava.default)('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', _renderComponent.default, _.default, _animations.default);
|
|
45
|
+
(0, _ava.default)('Molecule › MoleculeBrandFormGroup › CmDefault › should be rendered', _renderComponent.default, _.default, _cmDefault.default);
|
|
43
46
|
(0, _ava.default)('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', _renderComponent.default, _.default, _cohort.default);
|
|
44
47
|
(0, _ava.default)('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', _renderComponent.default, _.default, _dashboard.default);
|
|
45
48
|
(0, _ava.default)('Molecule › MoleculeBrandFormGroup › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["t","pass","MoleculeBrandFormGroup","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAnalytics","fixtureAnimations","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,oEAAL,EAA2EG,wBAA3E,EAAiGN,SAAjG,EAAyHO,kBAAzH;AACA,kBAAK,qEAAL,EAA4ED,wBAA5E,EAAkGN,SAAlG,EAA0HQ,mBAA1H;AACA,kBAAK,iEAAL,
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["t","pass","MoleculeBrandFormGroup","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAnalytics","fixtureAnimations","fixtureCmDefault","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,oEAAL,EAA2EG,wBAA3E,EAAiGN,SAAjG,EAAyHO,kBAAzH;AACA,kBAAK,qEAAL,EAA4ED,wBAA5E,EAAkGN,SAAlG,EAA0HQ,mBAA1H;AACA,kBAAK,oEAAL,EAA2EF,wBAA3E,EAAiGN,SAAjG,EAAyHS,kBAAzH;AACA,kBAAK,iEAAL,EAAwEH,wBAAxE,EAA8FN,SAA9F,EAAsHU,eAAtH;AACA,kBAAK,oEAAL,EAA2EJ,wBAA3E,EAAiGN,SAAjG,EAAyHW,kBAAzH;AACA,kBAAK,kEAAL,EAAyEL,wBAAzE,EAA+FN,SAA/F,EAAuHY,gBAAvH;AACA,kBAAK,sEAAL,EAA6EN,wBAA7E,EAAmGN,SAAnG,EAA2Ha,oBAA3H;AACA,kBAAK,iEAAL,EAAwEP,wBAAxE,EAA8FN,SAA9F,EAAsHc,eAAtH;AACA,kBAAK,sEAAL,EAA6ER,wBAA7E,EAAmGN,SAAnG,EAA2He,oBAA3H;AACA,kBAAK,gEAAL,EAAuET,wBAAvE,EAA6FN,SAA7F,EAAqHgB,cAArH;AACA,kBAAK,iEAAL,EAAwEV,wBAAxE,EAA8FN,SAA9F,EAAsHiB,eAAtH;AACA,kBAAK,8DAAL,EAAqEX,wBAArE,EAA2FN,SAA3F,EAAmHkB,YAAnH","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';\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);\n"],"file":"fixtures.js"}
|
|
@@ -34,6 +34,10 @@ var _podcast = _interopRequireDefault(require("./fixtures/podcast"));
|
|
|
34
34
|
|
|
35
35
|
var _scorm = _interopRequireDefault(require("./fixtures/scorm"));
|
|
36
36
|
|
|
37
|
+
var _selectableFalse = _interopRequireDefault(require("./fixtures/selectable-false"));
|
|
38
|
+
|
|
39
|
+
var _selectableTrue = _interopRequireDefault(require("./fixtures/selectable-true"));
|
|
40
|
+
|
|
37
41
|
var _video = _interopRequireDefault(require("./fixtures/video"));
|
|
38
42
|
|
|
39
43
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -57,5 +61,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
57
61
|
(0, _ava.default)('Molecule › MoleculeCard › Freerun › should be rendered', _renderComponent.default, _.default, _freerun.default);
|
|
58
62
|
(0, _ava.default)('Molecule › MoleculeCard › Podcast › should be rendered', _renderComponent.default, _.default, _podcast.default);
|
|
59
63
|
(0, _ava.default)('Molecule › MoleculeCard › Scorm › should be rendered', _renderComponent.default, _.default, _scorm.default);
|
|
64
|
+
(0, _ava.default)('Molecule › MoleculeCard › SelectableFalse › should be rendered', _renderComponent.default, _.default, _selectableFalse.default);
|
|
65
|
+
(0, _ava.default)('Molecule › MoleculeCard › SelectableTrue › should be rendered', _renderComponent.default, _.default, _selectableTrue.default);
|
|
60
66
|
(0, _ava.default)('Molecule › MoleculeCard › Video › should be rendered', _renderComponent.default, _.default, _video.default);
|
|
61
67
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["t","pass","MoleculeCard","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunA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BAAnG;AACA,kBAAK,sDAAL,EAA6DZ,wBAA7D,EAAmFN,SAAnF,EAAiGmB,cAAjG;AACA,kBAAK,sDAAL,
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["t","pass","MoleculeCard","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,uDAAL,EAA8DA,CAAC,IAAI;AACjEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAaC,SAArB,EAAgC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC9CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,iDAAgDF,GAAI,mEAA7E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,mEAAL,EAA0EG,wBAA1E,EAAgGN,SAAhG,EAA8GO,2BAA9G;AACA,kBAAK,wDAAL,EAA+DD,wBAA/D,EAAqFN,SAArF,EAAmGQ,gBAAnG;AACA,kBAAK,uDAAL,EAA8DF,wBAA9D,EAAoFN,SAApF,EAAkGS,eAAlG;AACA,kBAAK,wDAAL,EAA+DH,wBAA/D,EAAqFN,SAArF,EAAmGU,gBAAnG;AACA,kBAAK,wDAAL,EAA+DJ,wBAA/D,EAAqFN,SAArF,EAAmGW,gBAAnG;AACA,kBAAK,yDAAL,EAAgEL,wBAAhE,EAAsFN,SAAtF,EAAoGY,iBAApG;AACA,kBAAK,sDAAL,EAA6DN,wBAA7D,EAAmFN,SAAnF,EAAiGa,cAAjG;AACA,kBAAK,gEAAL,EAAuEP,wBAAvE,EAA6FN,SAA7F,EAA2Gc,wBAA3G;AACA,kBAAK,yDAAL,EAAgER,wBAAhE,EAAsFN,SAAtF,EAAoGe,iBAApG;AACA,kBAAK,mEAAL,EAA0ET,wBAA1E,EAAgGN,SAAhG,EAA8GgB,2BAA9G;AACA,kBAAK,wDAAL,EAA+DV,wBAA/D,EAAqFN,SAArF,EAAmGiB,gBAAnG;AACA,kBAAK,wDAAL,EAA+DX,wBAA/D,EAAqFN,SAArF,EAAmGkB,gBAAnG;AACA,kBAAK,sDAAL,EAA6DZ,wBAA7D,EAAmFN,SAAnF,EAAiGmB,cAAjG;AACA,kBAAK,gEAAL,EAAuEb,wBAAvE,EAA6FN,SAA7F,EAA2GoB,wBAA3G;AACA,kBAAK,+DAAL,EAAsEd,wBAAtE,EAA4FN,SAA5F,EAA0GqB,uBAA1G;AACA,kBAAK,sDAAL,EAA6Df,wBAA7D,EAAmFN,SAAnF,EAAiGsB,cAAjG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCard from '..';\nimport fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';\nimport fixtureAdaptiv from './fixtures/adaptiv';\nimport fixtureArabic from './fixtures/arabic';\nimport fixtureArticle from './fixtures/article';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureExternalContent from './fixtures/external-content';\nimport fixtureFavorite from './fixtures/favorite';\nimport fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';\nimport fixtureFreerun from './fixtures/freerun';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureSelectableFalse from './fixtures/selectable-false';\nimport fixtureSelectableTrue from './fixtures/selectable-true';\nimport fixtureVideo from './fixtures/video';\n\ntest('Molecule › MoleculeCard > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCard.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCard.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptivAndDisabled);\ntest('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);\ntest('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);\ntest('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);\ntest('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);\ntest('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);\ntest('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);\ntest('Molecule › MoleculeCard › ExternalContent › should be rendered', renderComponentMacro, MoleculeCard, fixtureExternalContent);\ntest('Molecule › MoleculeCard › Favorite › should be rendered', renderComponentMacro, MoleculeCard, fixtureFavorite);\ntest('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerunAndDisabled);\ntest('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);\ntest('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);\ntest('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);\ntest('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);\ntest('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);\ntest('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);\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 _dangerous = _interopRequireDefault(require("./fixtures/dangerous"));
|
|
12
|
+
|
|
13
|
+
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
14
|
+
|
|
15
|
+
var _warningWithClose = _interopRequireDefault(require("./fixtures/warning-with-close"));
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
(0, _ava.default)('Molecule › MoleculeCmPopin > should have valid propTypes', t => {
|
|
20
|
+
t.pass();
|
|
21
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
22
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeCmPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
(0, _ava.default)('Molecule › MoleculeCmPopin › Dangerous › should be rendered', _renderComponent.default, _.default, _dangerous.default);
|
|
26
|
+
(0, _ava.default)('Molecule › MoleculeCmPopin › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
27
|
+
(0, _ava.default)('Molecule › MoleculeCmPopin › WarningWithClose › should be rendered', _renderComponent.default, _.default, _warningWithClose.default);
|
|
28
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/cm-popin/test/fixtures.js"],"names":["t","pass","MoleculeCmPopin","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDangerous","fixtureDefault","fixtureWarningWithClose"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,0DAAL,EAAiEA,CAAC,IAAI;AACpEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAgBC,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,oDAAmDF,GAAI,mEAAhF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,6DAAL,EAAoEG,wBAApE,EAA0FN,SAA1F,EAA2GO,kBAA3G;AACA,kBAAK,2DAAL,EAAkED,wBAAlE,EAAwFN,SAAxF,EAAyGQ,gBAAzG;AACA,kBAAK,oEAAL,EAA2EF,wBAA3E,EAAiGN,SAAjG,EAAkHS,yBAAlH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCmPopin from '..';\nimport fixtureDangerous from './fixtures/dangerous';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWarningWithClose from './fixtures/warning-with-close';\n\ntest('Molecule › MoleculeCmPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCmPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCmPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCmPopin › Dangerous › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureDangerous);\ntest('Molecule › MoleculeCmPopin › Default › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureDefault);\ntest('Molecule › MoleculeCmPopin › WarningWithClose › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureWarningWithClose);\n"],"file":"fixtures.js"}
|
|
@@ -22,8 +22,6 @@ var _successWithTitleAndDescriptionAndImage = _interopRequireDefault(require("./
|
|
|
22
22
|
|
|
23
23
|
var _successWithTitleAndDescriptionAndPdf = _interopRequireDefault(require("./fixtures/success-with-title-and-description-and-pdf"));
|
|
24
24
|
|
|
25
|
-
var _successWithTitleAndDescriptionAndVideo = _interopRequireDefault(require("./fixtures/success-with-title-and-description-and-video"));
|
|
26
|
-
|
|
27
25
|
var _successWithTitleAndDescription = _interopRequireDefault(require("./fixtures/success-with-title-and-description"));
|
|
28
26
|
|
|
29
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -41,6 +39,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
41
39
|
(0, _ava.default)('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndAudio › should be rendered', _renderComponent.default, _.default, _successWithTitleAndDescriptionAndAudio.default);
|
|
42
40
|
(0, _ava.default)('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndImage › should be rendered', _renderComponent.default, _.default, _successWithTitleAndDescriptionAndImage.default);
|
|
43
41
|
(0, _ava.default)('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndPdf › should be rendered', _renderComponent.default, _.default, _successWithTitleAndDescriptionAndPdf.default);
|
|
44
|
-
(0, _ava.default)('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndVideo › should be rendered', _renderComponent.default, _.default, _successWithTitleAndDescriptionAndVideo.default);
|
|
45
42
|
(0, _ava.default)('Molecule › MoleculeFeedback › SuccessWithTitleAndDescription › should be rendered', _renderComponent.default, _.default, _successWithTitleAndDescription.default);
|
|
46
43
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/feedback/test/fixtures.js"],"names":["t","pass","MoleculeFeedback","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureFailExitNode","fixtureFailureWithTitleAndDescriptionAndVideo","fixtureSuccessExitNode","fixtureSuccessWithTitleAndDescriptionAndAudio","fixtureSuccessWithTitleAndDescriptionAndImage","fixtureSuccessWithTitleAndDescriptionAndPdf","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/feedback/test/fixtures.js"],"names":["t","pass","MoleculeFeedback","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureFailExitNode","fixtureFailureWithTitleAndDescriptionAndVideo","fixtureSuccessExitNode","fixtureSuccessWithTitleAndDescriptionAndAudio","fixtureSuccessWithTitleAndDescriptionAndImage","fixtureSuccessWithTitleAndDescriptionAndPdf","fixtureSuccessWithTitleAndDescription"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;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,4DAAL,EAAmEG,wBAAnE,EAAyFN,SAAzF,EAA2GO,gBAA3G;AACA,kBAAK,iEAAL,EAAwED,wBAAxE,EAA8FN,SAA9F,EAAgHQ,qBAAhH;AACA,kBAAK,2FAAL,EAAkGF,wBAAlG,EAAwHN,SAAxH,EAA0IS,+CAA1I;AACA,kBAAK,oEAAL,EAA2EH,wBAA3E,EAAiGN,SAAjG,EAAmHU,wBAAnH;AACA,kBAAK,2FAAL,EAAkGJ,wBAAlG,EAAwHN,SAAxH,EAA0IW,+CAA1I;AACA,kBAAK,2FAAL,EAAkGL,wBAAlG,EAAwHN,SAAxH,EAA0IY,+CAA1I;AACA,kBAAK,yFAAL,EAAgGN,wBAAhG,EAAsHN,SAAtH,EAAwIa,6CAAxI;AACA,kBAAK,mFAAL,EAA0FP,wBAA1F,EAAgHN,SAAhH,EAAkIc,uCAAlI","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeFeedback from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureFailExitNode from './fixtures/fail-exit-node';\nimport fixtureFailureWithTitleAndDescriptionAndVideo from './fixtures/failure-with-title-and-description-and-video';\nimport fixtureSuccessExitNode from './fixtures/success-exit-node';\nimport fixtureSuccessWithTitleAndDescriptionAndAudio from './fixtures/success-with-title-and-description-and-audio';\nimport fixtureSuccessWithTitleAndDescriptionAndImage from './fixtures/success-with-title-and-description-and-image';\nimport fixtureSuccessWithTitleAndDescriptionAndPdf from './fixtures/success-with-title-and-description-and-pdf';\nimport fixtureSuccessWithTitleAndDescription from './fixtures/success-with-title-and-description';\n\ntest('Molecule › MoleculeFeedback > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeFeedback.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeFeedback.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeFeedback › Default › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureDefault);\ntest('Molecule › MoleculeFeedback › FailExitNode › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureFailExitNode);\ntest('Molecule › MoleculeFeedback › FailureWithTitleAndDescriptionAndVideo › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureFailureWithTitleAndDescriptionAndVideo);\ntest('Molecule › MoleculeFeedback › SuccessExitNode › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureSuccessExitNode);\ntest('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndAudio › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureSuccessWithTitleAndDescriptionAndAudio);\ntest('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndImage › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureSuccessWithTitleAndDescriptionAndImage);\ntest('Molecule › MoleculeFeedback › SuccessWithTitleAndDescriptionAndPdf › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureSuccessWithTitleAndDescriptionAndPdf);\ntest('Molecule › MoleculeFeedback › SuccessWithTitleAndDescription › should be rendered', renderComponentMacro, MoleculeFeedback, fixtureSuccessWithTitleAndDescription);\n"],"file":"fixtures.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 _withSelectedItem = _interopRequireDefault(require("./fixtures/with-selected-item"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
(0, _ava.default)('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeVerticalTabs.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, _ava.default)('Molecule › MoleculeVerticalTabs › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
+
(0, _ava.default)('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', _renderComponent.default, _.default, _withSelectedItem.default);
|
|
25
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/vertical-tabs/test/fixtures.js"],"names":["t","pass","MoleculeVerticalTabs","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithSelectedItem"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,+DAAL,EAAsEA,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAqBC,SAA7B,EAAwC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,gEAAL,EAAuEG,wBAAvE,EAA6FN,SAA7F,EAAmHO,gBAAnH;AACA,kBAAK,yEAAL,EAAgFD,wBAAhF,EAAsGN,SAAtG,EAA4HQ,yBAA5H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeVerticalTabs from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithSelectedItem from './fixtures/with-selected-item';\n\ntest('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeVerticalTabs.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeVerticalTabs.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeVerticalTabs › Default › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureDefault);\ntest('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithSelectedItem);\n"],"file":"fixtures.js"}
|
|
@@ -140,7 +140,9 @@ const buildAction = action => {
|
|
|
140
140
|
type: icon
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
return /*#__PURE__*/_react.default.createElement("div",
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
144
|
+
className: _style.default.button
|
|
145
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonProps));
|
|
144
146
|
};
|
|
145
147
|
|
|
146
148
|
const WizardSummary = props => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["buildItemsOfSection","items","map","item","index","type","title","style","value","category","label","author","unsaved","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","buildAction","action","onClick","icon","ariaLabel","handleClick","buttonProps","position","WizardSummary","props","sectionsView","actionView","idSwitch","container","desktopSummaryTitle","checkbox","summary","tabletSummaryHeader","tabletSummaryTitle","tabletSummaryIcon","summarySections","actionZone","propTypes","PropTypes","string","arrayOf","shape","oneOfType","bool","oneOf","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAACC,MAAAA;AAAD,QAASF,IAAf;;AACA,YAAQE,IAAR;AACE,WAAK,aAAL;AACE,4BACE;AAAI,UAAA,GAAG,EAAG,GAAEF,IAAI,CAACG,KAAM,IAAGF,KAAM;AAAhC,wBACE;AAAM,UAAA,SAAS,EAAEG,eAAMD;AAAvB,WAA+BH,IAAI,CAACG,KAApC,CADF,eAEE;AAAM,UAAA,SAAS,EAAEC,eAAMC;AAAvB,WAA+BL,IAAI,CAACK,KAApC,CAFF,CADF;;AAMF,WAAK,SAAL;AAAgB;AACd,gBAAM;AAACC,YAAAA,QAAD;AAAWC,YAAAA,KAAX;AAAkBJ,YAAAA,KAAlB;AAAyBK,YAAAA,MAAzB;AAAiCC,YAAAA,OAAO,GAAG;AAA3C,cAAoDT,IAA1D;AACA,8BACE;AAAI,YAAA,SAAS,EAAEI,eAAM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 'prop-types';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowDown as ArrowDownIcon} from '@coorpacademy/nova-icons';\nimport ContentBadge from '../../atom/content-badge';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author, unsaved = false} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBadge category={category} label={label} />\n <span\n className={classnames(style.contentTitle, unsaved && style.unsaved)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default: {\n const {text, unsaved = false} = item;\n return (\n <li key={`${item.text}-${index}`}>\n <span className={classnames(style.valueSimpleText, unsaved && style.unsaved)}>\n {text}\n </span>\n </li>\n );\n }\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div key={`summary-section-${index}`} data-step={index} className={style.sectionWrapper}>\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst buildAction = action => {\n if (!action) return null;\n\n const {onClick, text, icon, 'aria-label': ariaLabel} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n const buttonProps = {\n type: 'text',\n label: text,\n 'aria-label': ariaLabel,\n 'data-name': `${icon}-button`,\n onClick: handleClick,\n icon: {\n position: 'left',\n type: icon\n }\n };\n\n return (\n <div>\n <ButtonLink {...buttonProps} />\n </div>\n );\n};\n\nconst WizardSummary = props => {\n const {title, sections, action} = props;\n const sectionsView = buildSections(sections);\n const actionView = buildAction(action);\n const idSwitch = 'open-summary-wizard';\n\n return (\n <div className={style.container}>\n <span className={style.desktopSummaryTitle}>{title}</span>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name=\"toogle\"\n title={idSwitch}\n className={style.checkbox}\n />\n <div className={style.summary}>\n <div className={style.tabletSummaryHeader}>\n <label htmlFor={idSwitch}>\n <span className={style.tabletSummaryTitle}>{title}</span>\n <ArrowDownIcon className={style.tabletSummaryIcon} />\n </label>\n </div>\n <div className={style.summarySections}>{sectionsView}</div>\n </div>\n <div className={style.actionZone}>{actionView}</div>\n </div>\n );\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string,\n unsaved: PropTypes.bool\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string,\n unsaved: PropTypes.bool\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: PropTypes.shape({\n icon: PropTypes.string,\n text: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["buildItemsOfSection","items","map","item","index","type","title","style","value","category","label","author","unsaved","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","buildAction","action","onClick","icon","ariaLabel","handleClick","buttonProps","position","button","WizardSummary","props","sectionsView","actionView","idSwitch","container","desktopSummaryTitle","checkbox","summary","tabletSummaryHeader","tabletSummaryTitle","tabletSummaryIcon","summarySections","actionZone","propTypes","PropTypes","string","arrayOf","shape","oneOfType","bool","oneOf","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAACC,MAAAA;AAAD,QAASF,IAAf;;AACA,YAAQE,IAAR;AACE,WAAK,aAAL;AACE,4BACE;AAAI,UAAA,GAAG,EAAG,GAAEF,IAAI,CAACG,KAAM,IAAGF,KAAM;AAAhC,wBACE;AAAM,UAAA,SAAS,EAAEG,eAAMD;AAAvB,WAA+BH,IAAI,CAACG,KAApC,CADF,eAEE;AAAM,UAAA,SAAS,EAAEC,eAAMC;AAAvB,WAA+BL,IAAI,CAACK,KAApC,CAFF,CADF;;AAMF,WAAK,SAAL;AAAgB;AACd,gBAAM;AAACC,YAAAA,QAAD;AAAWC,YAAAA,KAAX;AAAkBJ,YAAAA,KAAlB;AAAyBK,YAAAA,MAAzB;AAAiCC,YAAAA,OAAO,GAAG;AAA3C,cAAoDT,IAA1D;AACA,8BACE;AAAI,YAAA,SAAS,EAAEI,eAAMM,cAArB;AAAqC,YAAA,GAAG,EAAG,GAAEP,KAAM,IAAGF,KAAM;AAA5D,0BACE;AAAM,YAAA,SAAS,EAAEG,eAAMO;AAAvB,aAAwCV,KAAK,GAAG,CAAhD,CADF,eAEE;AAAK,YAAA,SAAS,EAAEG,eAAMQ;AAAtB,0BACE;AAAK,YAAA,SAAS,EAAER,eA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AAUC,MAFH;AAGd9C,MAAAA,KAAK,EAAE6C,mBAAUC;AAHH,KAAhB,CADkB,EAMlBD,mBAAUG,KAAV,CAAgB;AACdnD,MAAAA,IAAI,EAAEgD,mBAAUC,MADF;AAEdnC,MAAAA,IAAI,EAAEkC,mBAAUC,MAFF;AAGd1C,MAAAA,OAAO,EAAEyC,mBAAUK;AAHL,KAAhB,CANkB,EAWlBL,mBAAUG,KAAV,CAAgB;AACdnD,MAAAA,IAAI,EAAEgD,mBAAUC,MADF;AAEd7C,MAAAA,QAAQ,EAAE4C,mBAAUM,KAAV,CAAgB,CACxB,MADwB,EAExB,UAFwB,EAGxB,OAHwB,EAIxB,SAJwB,EAKxB,OALwB,EAMxB,OANwB,EAOxB,SAPwB,EAQxB,SARwB,CAAhB,CAFI;AAYdrD,MAAAA,KAAK,EAAE+C,mBAAUC,MAZH;AAad5C,MAAAA,KAAK,EAAE2C,mBAAUC,MAbH;AAcd3C,MAAAA,MAAM,EAAE0C,mBAAUC,MAdJ;AAed1C,MAAAA,OAAO,EAAEyC,mBAAUK;AAfL,KAAhB,CAXkB,CAApB,CADK,CAFO;AAiCdnC,IAAAA,WAAW,EAAE8B,mBAAUC;AAjCT,GAAhB,CADQ,CAFc;AAuCxBxB,EAAAA,MAAM,EAAEuB,mBAAUG,KAAV,CAAgB;AACtBxB,IAAAA,IAAI,EAAEqB,mBAAUC,MADM;AAEtBnC,IAAAA,IAAI,EAAEkC,mBAAUC,MAFM;AAGtBvB,IAAAA,OAAO,EAAEsB,mBAAUO,IAHG;AAItB,kBAAcP,mBAAUC;AAJF,GAAhB;AAvCgB,CAA1B;eA+CehB,a","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowDown as ArrowDownIcon} from '@coorpacademy/nova-icons';\nimport ContentBadge from '../../atom/content-badge';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author, unsaved = false} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBadge category={category} label={label} />\n <span\n className={classnames(style.contentTitle, unsaved && style.unsaved)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default: {\n const {text, unsaved = false} = item;\n return (\n <li key={`${item.text}-${index}`}>\n <span className={classnames(style.valueSimpleText, unsaved && style.unsaved)}>\n {text}\n </span>\n </li>\n );\n }\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div key={`summary-section-${index}`} data-step={index} className={style.sectionWrapper}>\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst buildAction = action => {\n if (!action) return null;\n\n const {onClick, text, icon, 'aria-label': ariaLabel} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n const buttonProps = {\n type: 'text',\n label: text,\n 'aria-label': ariaLabel,\n 'data-name': `${icon}-button`,\n onClick: handleClick,\n icon: {\n position: 'left',\n type: icon\n }\n };\n\n return (\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n );\n};\n\nconst WizardSummary = props => {\n const {title, sections, action} = props;\n const sectionsView = buildSections(sections);\n const actionView = buildAction(action);\n const idSwitch = 'open-summary-wizard';\n\n return (\n <div className={style.container}>\n <span className={style.desktopSummaryTitle}>{title}</span>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name=\"toogle\"\n title={idSwitch}\n className={style.checkbox}\n />\n <div className={style.summary}>\n <div className={style.tabletSummaryHeader}>\n <label htmlFor={idSwitch}>\n <span className={style.tabletSummaryTitle}>{title}</span>\n <ArrowDownIcon className={style.tabletSummaryIcon} />\n </label>\n </div>\n <div className={style.summarySections}>{sectionsView}</div>\n </div>\n <div className={style.actionZone}>{actionView}</div>\n </div>\n );\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string,\n unsaved: PropTypes.bool\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string,\n unsaved: PropTypes.bool\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: PropTypes.shape({\n icon: PropTypes.string,\n text: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 _oneSection = _interopRequireDefault(require("./fixtures/one-section"));
|
|
14
|
+
|
|
15
|
+
var _tabletClosed = _interopRequireDefault(require("./fixtures/tablet-closed"));
|
|
16
|
+
|
|
17
|
+
var _threeSections = _interopRequireDefault(require("./fixtures/three-sections"));
|
|
18
|
+
|
|
19
|
+
var _twoSections = _interopRequireDefault(require("./fixtures/two-sections"));
|
|
20
|
+
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
|
|
23
|
+
(0, _ava.default)('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {
|
|
24
|
+
t.pass();
|
|
25
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
26
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeWizardSummary.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
(0, _ava.default)('Molecule › MoleculeWizardSummary › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
30
|
+
(0, _ava.default)('Molecule › MoleculeWizardSummary › OneSection › should be rendered', _renderComponent.default, _.default, _oneSection.default);
|
|
31
|
+
(0, _ava.default)('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', _renderComponent.default, _.default, _tabletClosed.default);
|
|
32
|
+
(0, _ava.default)('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', _renderComponent.default, _.default, _threeSections.default);
|
|
33
|
+
(0, _ava.default)('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', _renderComponent.default, _.default, _twoSections.default);
|
|
34
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["t","pass","MoleculeWizardSummary","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureOneSection","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gEAAL,EAAuEA,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAsBC,SAA9B,EAAyC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,iEAAL,EAAwEG,wBAAxE,EAA8FN,SAA9F,EAAqHO,gBAArH;AACA,kBAAK,oEAAL,EAA2ED,wBAA3E,EAAiGN,SAAjG,EAAwHQ,mBAAxH;AACA,kBAAK,sEAAL,EAA6EF,wBAA7E,EAAmGN,SAAnG,EAA0HS,qBAA1H;AACA,kBAAK,uEAAL,EAA8EH,wBAA9E,EAAoGN,SAApG,EAA2HU,sBAA3H;AACA,kBAAK,qEAAL,EAA4EJ,wBAA5E,EAAkGN,SAAlG,EAAyHW,oBAAzH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeWizardSummary from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureOneSection from './fixtures/one-section';\nimport fixtureTabletClosed from './fixtures/tablet-closed';\nimport fixtureThreeSections from './fixtures/three-sections';\nimport fixtureTwoSections from './fixtures/two-sections';\n\ntest('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeWizardSummary.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeWizardSummary.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeWizardSummary › Default › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureDefault);\ntest('Molecule › MoleculeWizardSummary › OneSection › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOneSection);\ntest('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTabletClosed);\ntest('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureThreeSections);\ntest('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTwoSections);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
groups: [{
|
|
8
|
+
fields: [{
|
|
9
|
+
type: 'text',
|
|
10
|
+
title: 'Playlist name',
|
|
11
|
+
placeholder: 'Playlist name',
|
|
12
|
+
description: 'This is the tooltip text',
|
|
13
|
+
theme: 'coorpmanager',
|
|
14
|
+
hint: '15 / 30 characters',
|
|
15
|
+
value: 'Marketing expert',
|
|
16
|
+
size: 'default'
|
|
17
|
+
}, {
|
|
18
|
+
type: 'textarea',
|
|
19
|
+
title: 'Description',
|
|
20
|
+
placeholder: 'Description',
|
|
21
|
+
description: 'This is the tooltip text',
|
|
22
|
+
theme: 'coorpmanager',
|
|
23
|
+
hint: '80 / 200 characters',
|
|
24
|
+
size: 'medium',
|
|
25
|
+
value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fermentum sem ac fermentum luctus. Integer eu dui magna. Donec ut tristique dui. Vestibulum non accumsan tellus. Donec luctus erat vitae aliquet viverra. Mauris malesuada tortor quis viverra vestibulum. Nullam laoreet porta massa vitae porta.'
|
|
26
|
+
}]
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|
|
31
|
+
//# sourceMappingURL=wizard-playlists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","value","size"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEC,QAAAA,KAAK,EAAE,eAFT;AAGEC,QAAAA,WAAW,EAAE,eAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,oBANR;AAOEC,QAAAA,KAAK,EAAE,kBAPT;AAQEC,QAAAA,IAAI,EAAE;AARR,OADM,EAWN;AACEP,QAAAA,IAAI,EAAE,UADR;AAEEC,QAAAA,KAAK,EAAE,aAFT;AAGEC,QAAAA,WAAW,EAAE,aAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,qBANR;AAOEE,QAAAA,IAAI,EAAE,QAPR;AAQED,QAAAA,KAAK,EACH;AATJ,OAXM;AADV,KADM;AADH;AADM,C","sourcesContent":["export default {\n props: {\n groups: [\n {\n fields: [\n {\n type: 'text',\n title: 'Playlist name',\n placeholder: 'Playlist name',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n value: 'Marketing expert',\n size: 'default'\n },\n {\n type: 'textarea',\n title: 'Description',\n placeholder: 'Description',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '80 / 200 characters',\n size: 'medium',\n value:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fermentum sem ac fermentum luctus. Integer eu dui magna. Donec ut tristique dui. Vestibulum non accumsan tellus. Donec luctus erat vitae aliquet viverra. Mauris malesuada tortor quis viverra vestibulum. Nullam laoreet porta massa vitae porta.'\n }\n ]\n }\n ]\n }\n};\n"],"file":"wizard-playlists.js"}
|
|
@@ -28,6 +28,8 @@ var _manageusersEdit = _interopRequireDefault(require("./fixtures/manageusers-ed
|
|
|
28
28
|
|
|
29
29
|
var _sso = _interopRequireDefault(require("./fixtures/sso"));
|
|
30
30
|
|
|
31
|
+
var _wizardPlaylists = _interopRequireDefault(require("./fixtures/wizard-playlists"));
|
|
32
|
+
|
|
31
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
34
|
|
|
33
35
|
(0, _ava.default)('Organism › OrganismBrandForm > should have valid propTypes', t => {
|
|
@@ -46,4 +48,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
46
48
|
(0, _ava.default)('Organism › OrganismBrandForm › Lookandfeel › should be rendered', _renderComponent.default, _.default, _lookandfeel.default);
|
|
47
49
|
(0, _ava.default)('Organism › OrganismBrandForm › ManageusersEdit › should be rendered', _renderComponent.default, _.default, _manageusersEdit.default);
|
|
48
50
|
(0, _ava.default)('Organism › OrganismBrandForm › Sso › should be rendered', _renderComponent.default, _.default, _sso.default);
|
|
51
|
+
(0, _ava.default)('Organism › OrganismBrandForm › WizardPlaylists › should be rendered', _renderComponent.default, _.default, _wizardPlaylists.default);
|
|
49
52
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/organism/brand-form/test/fixtures.js"],"names":["t","pass","OrganismBrandForm","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAnalytics","fixtureAnimations","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureGeneralSettings","fixtureLms","fixtureLookandfeel","fixtureManageusersEdit","fixtureSso"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;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,+DAAL,EAAsEG,wBAAtE,EAA4FN,SAA5F,EAA+GO,kBAA/G;AACA,kBAAK,gEAAL,EAAuED,wBAAvE,EAA6FN,SAA7F,EAAgHQ,mBAAhH;AACA,kBAAK,4DAAL,EAAmEF,wBAAnE,EAAyFN,SAAzF,EAA4GS,eAA5G;AACA,kBAAK,+DAAL,EAAsEH,wBAAtE,EAA4FN,SAA5F,EAA+GU,kBAA/G;AACA,kBAAK,6DAAL,EAAoEJ,wBAApE,EAA0FN,SAA1F,EAA6GW,gBAA7G;AACA,kBAAK,qEAAL,EAA4EL,wBAA5E,EAAkGN,SAAlG,EAAqHY,wBAArH;AACA,kBAAK,yDAAL,EAAgEN,wBAAhE,EAAsFN,SAAtF,EAAyGa,YAAzG;AACA,kBAAK,iEAAL,EAAwEP,wBAAxE,EAA8FN,SAA9F,EAAiHc,oBAAjH;AACA,kBAAK,qEAAL,EAA4ER,wBAA5E,EAAkGN,SAAlG,EAAqHe,wBAArH;AACA,kBAAK,yDAAL,EAAgET,wBAAhE,EAAsFN,SAAtF,EAAyGgB,YAAzG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismBrandForm from '..';\nimport fixtureAnalytics from './fixtures/analytics';\nimport fixtureAnimations from './fixtures/animations';\nimport fixtureCohort from './fixtures/cohort';\nimport fixtureDashboard from './fixtures/dashboard';\nimport fixtureDefault from './fixtures/default';\nimport fixtureGeneralSettings from './fixtures/general-settings';\nimport fixtureLms from './fixtures/lms';\nimport fixtureLookandfeel from './fixtures/lookandfeel';\nimport fixtureManageusersEdit from './fixtures/manageusers-edit';\nimport fixtureSso from './fixtures/sso';\n\ntest('Organism › OrganismBrandForm > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismBrandForm.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismBrandForm.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismBrandForm › Analytics › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureAnalytics);\ntest('Organism › OrganismBrandForm › Animations › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureAnimations);\ntest('Organism › OrganismBrandForm › Cohort › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureCohort);\ntest('Organism › OrganismBrandForm › Dashboard › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureDashboard);\ntest('Organism › OrganismBrandForm › Default › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureDefault);\ntest('Organism › OrganismBrandForm › GeneralSettings › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureGeneralSettings);\ntest('Organism › OrganismBrandForm › Lms › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureLms);\ntest('Organism › OrganismBrandForm › Lookandfeel › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureLookandfeel);\ntest('Organism › OrganismBrandForm › ManageusersEdit › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureManageusersEdit);\ntest('Organism › OrganismBrandForm › Sso › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureSso);\n"],"file":"fixtures.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/brand-form/test/fixtures.js"],"names":["t","pass","OrganismBrandForm","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAnalytics","fixtureAnimations","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureGeneralSettings","fixtureLms","fixtureLookandfeel","fixtureManageusersEdit","fixtureSso","fixtureWizardPlaylists"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;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,+DAAL,EAAsEG,wBAAtE,EAA4FN,SAA5F,EAA+GO,kBAA/G;AACA,kBAAK,gEAAL,EAAuED,wBAAvE,EAA6FN,SAA7F,EAAgHQ,mBAAhH;AACA,kBAAK,4DAAL,EAAmEF,wBAAnE,EAAyFN,SAAzF,EAA4GS,eAA5G;AACA,kBAAK,+DAAL,EAAsEH,wBAAtE,EAA4FN,SAA5F,EAA+GU,kBAA/G;AACA,kBAAK,6DAAL,EAAoEJ,wBAApE,EAA0FN,SAA1F,EAA6GW,gBAA7G;AACA,kBAAK,qEAAL,EAA4EL,wBAA5E,EAAkGN,SAAlG,EAAqHY,wBAArH;AACA,kBAAK,yDAAL,EAAgEN,wBAAhE,EAAsFN,SAAtF,EAAyGa,YAAzG;AACA,kBAAK,iEAAL,EAAwEP,wBAAxE,EAA8FN,SAA9F,EAAiHc,oBAAjH;AACA,kBAAK,qEAAL,EAA4ER,wBAA5E,EAAkGN,SAAlG,EAAqHe,wBAArH;AACA,kBAAK,yDAAL,EAAgET,wBAAhE,EAAsFN,SAAtF,EAAyGgB,YAAzG;AACA,kBAAK,qEAAL,EAA4EV,wBAA5E,EAAkGN,SAAlG,EAAqHiB,wBAArH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismBrandForm from '..';\nimport fixtureAnalytics from './fixtures/analytics';\nimport fixtureAnimations from './fixtures/animations';\nimport fixtureCohort from './fixtures/cohort';\nimport fixtureDashboard from './fixtures/dashboard';\nimport fixtureDefault from './fixtures/default';\nimport fixtureGeneralSettings from './fixtures/general-settings';\nimport fixtureLms from './fixtures/lms';\nimport fixtureLookandfeel from './fixtures/lookandfeel';\nimport fixtureManageusersEdit from './fixtures/manageusers-edit';\nimport fixtureSso from './fixtures/sso';\nimport fixtureWizardPlaylists from './fixtures/wizard-playlists';\n\ntest('Organism › OrganismBrandForm > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismBrandForm.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismBrandForm.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismBrandForm › Analytics › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureAnalytics);\ntest('Organism › OrganismBrandForm › Animations › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureAnimations);\ntest('Organism › OrganismBrandForm › Cohort › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureCohort);\ntest('Organism › OrganismBrandForm › Dashboard › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureDashboard);\ntest('Organism › OrganismBrandForm › Default › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureDefault);\ntest('Organism › OrganismBrandForm › GeneralSettings › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureGeneralSettings);\ntest('Organism › OrganismBrandForm › Lms › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureLms);\ntest('Organism › OrganismBrandForm › Lookandfeel › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureLookandfeel);\ntest('Organism › OrganismBrandForm › ManageusersEdit › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureManageusersEdit);\ntest('Organism › OrganismBrandForm › Sso › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureSso);\ntest('Organism › OrganismBrandForm › WizardPlaylists › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureWizardPlaylists);\n"],"file":"fixtures.js"}
|
|
@@ -34,6 +34,7 @@ const buildResultView = (results, resultsAriaLabel, emptyMessages) => {
|
|
|
34
34
|
|
|
35
35
|
const items = results.map((result, index) => {
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
37
|
+
className: _style.default.result,
|
|
37
38
|
key: `result-${index}`
|
|
38
39
|
}, /*#__PURE__*/_react.default.createElement(_chips.default, result));
|
|
39
40
|
}, results);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/organism/search-and-chips-results/index.js"],"names":["buildResultView","results","resultsAriaLabel","emptyMessages","style","errorSection","firstErrorMessage","firstMessage","secondErrorMessage","secondMessage","items","map","result","index","SearchAndChipsResults","props","search","selectAllButton","onClick","label","disabled","ariaLabel","resultView","buttonProps","type","icon","position","container","header","button","resultContainer","propTypes","PropTypes","shape","string","func","bool","Search","arrayOf","Chips"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,eAAe,GAAG,CAACC,OAAD,EAAUC,gBAAV,EAA4BC,aAA5B,KAA8C;AACpE,MAAI,uBAAQF,OAAR,CAAJ,EAAsB;AACpB,wBACE;AAAK,MAAA,SAAS,EAAEG,eAAMC;AAAtB,oBACE;AAAM,MAAA,SAAS,EAAED,eAAME;AAAvB,OAA2CH,aAAa,CAACI,YAAzD,CADF,eAEE;AAAM,MAAA,SAAS,EAAEH,eAAMI;AAAvB,OAA4CL,aAAa,CAACM,aAA1D,CAFF,CADF;AAMD;;AAED,QAAMC,KAAK,GAAGT,OAAO,CAACU,GAAR,CAAY,CAACC,MAAD,EAASC,KAAT,KAAmB;AAC3C,wBACE;AAAI,MAAA,GAAG,EAAG,
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/search-and-chips-results/index.js"],"names":["buildResultView","results","resultsAriaLabel","emptyMessages","style","errorSection","firstErrorMessage","firstMessage","secondErrorMessage","secondMessage","items","map","result","index","SearchAndChipsResults","props","search","selectAllButton","onClick","label","disabled","ariaLabel","resultView","buttonProps","type","icon","position","container","header","button","resultContainer","propTyp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":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport Search from '../../atom/input-search';\nimport ButtonLink from '../../atom/button-link';\nimport Chips from '../../atom/chips';\nimport style from './style.css';\n\nconst buildResultView = (results, resultsAriaLabel, emptyMessages) => {\n if (isEmpty(results)) {\n return (\n <div className={style.errorSection}>\n <span className={style.firstErrorMessage}>{emptyMessages.firstMessage}</span>\n <span className={style.secondErrorMessage}>{emptyMessages.secondMessage}</span>\n </div>\n );\n }\n\n const items = results.map((result, index) => {\n return (\n <li className={style.result} key={`result-${index}`}>\n <Chips {...result} />\n </li>\n );\n }, results);\n\n return <ul aria-label={resultsAriaLabel}>{items}</ul>;\n};\n\nconst SearchAndChipsResults = props => {\n const {\n search,\n selectAllButton,\n results,\n emptyMessages,\n 'results-aria-label': resultsAriaLabel\n } = props;\n\n const {onClick, label, disabled = false, 'aria-label': ariaLabel} = selectAllButton;\n const resultView = buildResultView(results, resultsAriaLabel, emptyMessages);\n const buttonProps = {\n type: 'secondary',\n label,\n 'aria-label': ariaLabel,\n 'data-name': `select-all-button`,\n icon: {\n position: 'right',\n type: 'add'\n },\n onClick,\n disabled\n };\n\n return (\n <div className={style.container}>\n <div className={style.header}>\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n <div className={style.search}>\n <Search {...search} theme=\"coorpmanager\" />\n </div>\n </div>\n <div className={style.resultContainer}>{resultView}</div>\n </div>\n );\n};\n\nSearchAndChipsResults.propTypes = {\n selectAllButton: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n 'aria-label': PropTypes.string\n }),\n search: PropTypes.shape(Search.PropTypes),\n results: PropTypes.arrayOf(PropTypes.shape(Chips.propTypes)),\n 'results-aria-label': PropTypes.string,\n emptyMessages: PropTypes.shape({\n firstMessage: PropTypes.string,\n secondMessage: PropTypes.string\n })\n};\n\nexport default SearchAndChipsResults;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 _empty = _interopRequireDefault(require("./fixtures/empty"));
|
|
14
|
+
|
|
15
|
+
var _filtered = _interopRequireDefault(require("./fixtures/filtered"));
|
|
16
|
+
|
|
17
|
+
var _sortedSelected = _interopRequireDefault(require("./fixtures/sorted-selected"));
|
|
18
|
+
|
|
19
|
+
var _unsortedSelected = _interopRequireDefault(require("./fixtures/unsorted-selected"));
|
|
20
|
+
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
|
|
23
|
+
(0, _ava.default)('Organism › OrganismSearchAndChipsResults > should have valid propTypes', t => {
|
|
24
|
+
t.pass();
|
|
25
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
26
|
+
t.not(value, undefined, `PropType for "Organism.OrganismSearchAndChipsResults.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
(0, _ava.default)('Organism › OrganismSearchAndChipsResults › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
30
|
+
(0, _ava.default)('Organism › OrganismSearchAndChipsResults › Empty › should be rendered', _renderComponent.default, _.default, _empty.default);
|
|
31
|
+
(0, _ava.default)('Organism › OrganismSearchAndChipsResults › Filtered › should be rendered', _renderComponent.default, _.default, _filtered.default);
|
|
32
|
+
(0, _ava.default)('Organism › OrganismSearchAndChipsResults › SortedSelected › should be rendered', _renderComponent.default, _.default, _sortedSelected.default);
|
|
33
|
+
(0, _ava.default)('Organism › OrganismSearchAndChipsResults › UnsortedSelected › should be rendered', _renderComponent.default, _.default, _unsortedSelected.default);
|
|
34
|
+
//# sourceMappingURL=fixtures.js.map
|