@coorpacademy/components 11.32.24-alpha.0 → 11.32.24
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/index.d.ts +1 -0
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +4 -2
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/types.d.ts +2 -0
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +1 -0
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/circular-progress-bar/index.d.ts.map +1 -1
- package/es/atom/circular-progress-bar/index.js +2 -9
- package/es/atom/circular-progress-bar/index.js.map +1 -1
- package/es/atom/input-doublestep/index.d.ts +1 -0
- package/es/atom/input-doublestep/index.d.ts.map +1 -1
- package/es/atom/input-doublestep/index.js +38 -13
- package/es/atom/input-doublestep/index.js.map +1 -1
- package/es/atom/input-doublestep/style.css +7 -67
- package/es/atom/select/index.js +1 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +1 -0
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +8 -6
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/brand-create-form/index.d.ts.map +1 -1
- package/es/molecule/brand-create-form/index.js +9 -4
- package/es/molecule/brand-create-form/index.js.map +1 -1
- package/es/molecule/brand-download-box/index.d.ts.map +1 -1
- package/es/molecule/brand-download-box/index.js +11 -6
- package/es/molecule/brand-download-box/index.js.map +1 -1
- package/es/molecule/brand-download-box/style.css +6 -5
- package/es/molecule/brand-form-group/index.d.ts.map +1 -1
- package/es/molecule/brand-form-group/index.js +12 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +1 -1
- package/es/molecule/cm-popin/types.d.ts +3 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/discipline-associated-skills/index.js +1 -1
- package/es/molecule/discipline-associated-skills/index.js.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +1 -0
- package/es/molecule/expandible-actionable-table/index.d.ts +1 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +1 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/molecule/learning-priority-modal/index.d.ts.map +1 -1
- package/es/molecule/learning-priority-modal/index.js +8 -15
- package/es/molecule/learning-priority-modal/index.js.map +1 -1
- package/es/molecule/learning-priority-modal/style.css +0 -1
- package/es/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
- package/es/molecule/learning-priority-setup-item/index.js +1 -1
- package/es/molecule/learning-priority-setup-item/index.js.map +1 -1
- package/es/molecule/setup-section/index.d.ts.map +1 -1
- package/es/molecule/setup-section/index.js +3 -1
- package/es/molecule/setup-section/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +2 -2
- package/es/molecule/skill-picker-modal/index.js +1 -1
- package/es/molecule/skill-picker-modal/index.js.map +1 -1
- package/es/organism/brand-form/index.d.ts.map +1 -1
- package/es/organism/brand-form/index.js +24 -15
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +1 -21
- package/es/organism/brand-learning-priorities/index.d.ts.map +1 -1
- package/es/organism/brand-learning-priorities/index.js +1 -14
- package/es/organism/brand-learning-priorities/index.js.map +1 -1
- package/es/organism/brand-learning-priorities/style.css +2 -0
- package/es/organism/list-item/index.d.ts +3 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +7 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-items/index.d.ts +3 -0
- package/es/organism/setup-header/index.d.ts +4 -0
- package/es/organism/wizard-contents/index.d.ts +3 -0
- package/es/template/app-player/loading/index.d.ts +3 -0
- package/es/template/app-player/player/index.d.ts +6 -0
- package/es/template/app-player/player/slides/index.d.ts +3 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +3 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +3 -0
- package/es/template/app-review/index.d.ts +3 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +3 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +3 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +4 -0
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +4 -0
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +14 -0
- package/es/template/back-office/dashboard-preview/index.d.ts +4 -0
- package/es/template/back-office/layout/index.d.ts +4 -0
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +6 -0
- package/es/template/common/search-page/index.d.ts +3 -0
- package/es/template/external-course/index.d.ts +3 -0
- package/lib/atom/button-link/index.d.ts +1 -0
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +4 -2
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/types.d.ts +2 -0
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +1 -0
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/circular-progress-bar/index.d.ts.map +1 -1
- package/lib/atom/circular-progress-bar/index.js +1 -8
- package/lib/atom/circular-progress-bar/index.js.map +1 -1
- package/lib/atom/input-doublestep/index.d.ts +1 -0
- package/lib/atom/input-doublestep/index.d.ts.map +1 -1
- package/lib/atom/input-doublestep/index.js +39 -13
- package/lib/atom/input-doublestep/index.js.map +1 -1
- package/lib/atom/input-doublestep/style.css +7 -67
- package/lib/atom/select/index.js +1 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +1 -0
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +8 -6
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/brand-create-form/index.d.ts.map +1 -1
- package/lib/molecule/brand-create-form/index.js +9 -4
- package/lib/molecule/brand-create-form/index.js.map +1 -1
- package/lib/molecule/brand-download-box/index.d.ts.map +1 -1
- package/lib/molecule/brand-download-box/index.js +11 -6
- package/lib/molecule/brand-download-box/index.js.map +1 -1
- package/lib/molecule/brand-download-box/style.css +6 -5
- package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
- package/lib/molecule/brand-form-group/index.js +12 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +1 -1
- package/lib/molecule/cm-popin/types.d.ts +3 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/discipline-associated-skills/index.js +1 -1
- package/lib/molecule/discipline-associated-skills/index.js.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +1 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts +1 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +1 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/molecule/learning-priority-modal/index.d.ts.map +1 -1
- package/lib/molecule/learning-priority-modal/index.js +9 -14
- package/lib/molecule/learning-priority-modal/index.js.map +1 -1
- package/lib/molecule/learning-priority-modal/style.css +0 -1
- package/lib/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
- package/lib/molecule/learning-priority-setup-item/index.js +1 -1
- package/lib/molecule/learning-priority-setup-item/index.js.map +1 -1
- package/lib/molecule/setup-section/index.d.ts.map +1 -1
- package/lib/molecule/setup-section/index.js +4 -1
- package/lib/molecule/setup-section/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +2 -2
- package/lib/molecule/skill-picker-modal/index.js +1 -1
- package/lib/molecule/skill-picker-modal/index.js.map +1 -1
- package/lib/organism/brand-form/index.d.ts.map +1 -1
- package/lib/organism/brand-form/index.js +24 -15
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +1 -21
- package/lib/organism/brand-learning-priorities/index.d.ts.map +1 -1
- package/lib/organism/brand-learning-priorities/index.js +3 -15
- package/lib/organism/brand-learning-priorities/index.js.map +1 -1
- package/lib/organism/brand-learning-priorities/style.css +2 -0
- package/lib/organism/list-item/index.d.ts +3 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +7 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-items/index.d.ts +3 -0
- package/lib/organism/setup-header/index.d.ts +4 -0
- package/lib/organism/wizard-contents/index.d.ts +3 -0
- package/lib/template/app-player/loading/index.d.ts +3 -0
- package/lib/template/app-player/player/index.d.ts +6 -0
- package/lib/template/app-player/player/slides/index.d.ts +3 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +3 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +3 -0
- package/lib/template/app-review/index.d.ts +3 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +3 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +3 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +4 -0
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +4 -0
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +14 -0
- package/lib/template/back-office/dashboard-preview/index.d.ts +4 -0
- package/lib/template/back-office/layout/index.d.ts +4 -0
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +6 -0
- package/lib/template/common/search-page/index.d.ts +3 -0
- package/lib/template/external-course/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useEffect","useMemo","useState","useCallback","PropTypes","convert","BaseModal","ListItem","ButtonLink","Loader","Provider","SelectOptionPropTypes","SearchForm","searchValueIncluded","style","FilterButton","props","context","active","filter","itemTotal","onClick","skin","primarySkinColor","Content","skillFilterNumber","skillFilterNumberInActive","backgroundColor","color","buttonProps","customStyle","transition","width","content","contextTypes","childContextTypes","translate","propTypes","bool","string","number","func","LearningPriorityModal","priorities","preselected","isOpen","isLoading","filters","onCancel","onAdd","onClose","selectedPriority","setSelectedPriority","selectedPriorityType","setSelectedPriorityType","searchValue","setSearchValue","filterValue","setFilterValue","searchResults","setSearchResults","handleCancel","handleClose","handleSearch","value","priority","title","handleSearchReset","priorityList","map","isPreSelectedPriority","some","selected","priorityRef","disabled","footer","cancelButton","label","confirmButton","onConfirm","iconName","LearningPriorityContainer","loaderContainer","loader","searchWrapper","placeholder","onChange","filterWrapper","length","index","name","count","handleChange","filterButtonWrapper","priorityListWrapper","courses","type","handlePriorityClick","subtitle","arrayOf","shape","oneOf"],"sources":["../../../src/molecule/learning-priority-modal/index.js"],"sourcesContent":["import React, {useEffect, useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, assign, pick} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport BaseModal from '../base-modal';\nimport ListItem from '../../organism/list-item';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport SearchForm from '../search-form';\nimport searchValueIncluded from '../../util/search-value-included';\nimport style from './style.css';\n\nconst FilterButton = (props, context) => {\n const {active, filter, itemTotal, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const Content = useCallback(\n () => (\n <div>\n {filter}\n <span\n className={active ? style.skillFilterNumber : style.skillFilterNumberInActive}\n style={{\n backgroundColor: active ? convert(`color(${primarySkinColor} a(0.07))`) : '#EAEAEB',\n color: active ? primarySkinColor : '#515161'\n }}\n >\n {itemTotal}\n </span>\n </div>\n ),\n [filter, itemTotal, active, primarySkinColor]\n );\n\n const buttonProps = {\n customStyle: {\n backgroundColor: active ? convert(`color(${primarySkinColor} a(0.07))`) : 'transparent',\n color: active ? primarySkinColor : '#9999A8',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n onClick,\n content: <Content />,\n 'data-name': 'change-skill-focus-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n active: PropTypes.bool,\n filter: PropTypes.string,\n itemTotal: PropTypes.number,\n onClick: PropTypes.func\n};\n\nconst LearningPriorityModal = (props, context) => {\n const {priorities, preselected, isOpen, isLoading, filters, onCancel, onAdd, onClose} = props;\n const {translate} = context;\n\n const [selectedPriority, setSelectedPriority] = useState('');\n const [selectedPriorityType, setSelectedPriorityType] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const [filterValue, setFilterValue] = useState('all');\n const [searchResults, setSearchResults] = useState(priorities);\n\n const handleCancel = useCallback(() => {\n setSelectedPriority('');\n setSelectedPriorityType('');\n onCancel();\n }, [setSelectedPriority, setSelectedPriorityType, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedPriority('');\n setSelectedPriorityType('');\n onClose();\n }, [setSelectedPriority, setSelectedPriorityType, onClose]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(priorities.filter(priority => searchValueIncluded(priority.title, value)));\n },\n [priorities, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(priorities);\n }, [priorities, setSearchValue, setSearchResults]);\n\n useEffect(() => {\n setSearchResults(priorities);\n }, [priorities]);\n\n const priorityList = useMemo(() => {\n return searchResults.map(priority => {\n const isPreSelectedPriority = preselected.some(selected => selected === priority.priorityRef);\n return assign(\n {\n selected: isPreSelectedPriority,\n disabled: isPreSelectedPriority\n },\n pick(['title', 'priorityRef', 'type', 'courses'], priority)\n );\n });\n }, [searchResults, preselected]);\n\n const footer = useMemo(() => {\n return {\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel')\n },\n confirmButton: {\n onConfirm: () => {\n onAdd(selectedPriority, selectedPriorityType);\n setSelectedPriority('');\n setSelectedPriorityType('');\n onClose();\n },\n label: translate('add'),\n iconName: 'plus',\n disabled: isLoading || !selectedPriority\n }\n };\n }, [\n handleCancel,\n setSelectedPriority,\n setSelectedPriorityType,\n onAdd,\n translate,\n selectedPriority,\n selectedPriorityType,\n isLoading\n ]);\n\n if ((!isLoading && !priorities) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('learning_priority_modal_title')}\n description={translate('learning_priority_modal_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n >\n <div className={style.LearningPriorityContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_priority_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.filterWrapper}>\n {searchResults.length > 0\n ? filters.map((filter, index) => {\n const {name, value, count} = filter;\n\n function handleChange() {\n setFilterValue(value);\n handleSearchReset();\n }\n\n if (count === 0) return null;\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n active={filterValue === value}\n filter={name}\n onClick={handleChange}\n itemTotal={count}\n />\n </div>\n );\n })\n : null}\n </div>\n <div className={style.priorityListWrapper}>\n {priorityList.map(priority => {\n const {title, priorityRef, courses = null, type, selected, disabled} = priority;\n function handlePriorityClick() {\n if (selectedPriority === priorityRef) {\n setSelectedPriority('');\n setSelectedPriorityType('');\n return;\n }\n setSelectedPriority(priorityRef);\n setSelectedPriorityType(type);\n }\n\n if (filterValue !== 'all' && type !== filterValue) return null;\n\n return (\n <ListItem\n {...(courses !== null ? {subtitle: `${courses} ${translate('courses')}`} : {})}\n title={title}\n selected={selected || selectedPriority === priorityRef}\n disabled={disabled}\n onClick={handlePriorityClick}\n tags={[{label: type, type: 'default'}]}\n key={priorityRef}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nLearningPriorityModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearningPriorityModal.propTypes = {\n priorities: PropTypes.arrayOf(\n PropTypes.shape({\n priorityRef: PropTypes.string,\n title: PropTypes.string,\n courses: PropTypes.number,\n type: PropTypes.oneOf(['skill', 'playlist', 'certificate'])\n })\n ),\n preselected: PropTypes.arrayOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n ...SelectOptionPropTypes,\n count: PropTypes.number\n })\n ),\n onCancel: PropTypes.func,\n onAdd: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default LearningPriorityModal;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,OAA1B,EAAmCC,QAAnC,EAA6CC,WAA7C,QAA+D,OAA/D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,QAAP,MAAqB,0BAArB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,SAAQC,qBAAR,QAAoC,mB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BhCQ,QAAQ,EAAE5C,SAAS,CAACqC,IAlBY;EAmBhCQ,KAAK,EAAE7C,SAAS,CAACqC,IAnBe;EAoBhCS,OAAO,EAAE9C,SAAS,CAACqC;AApBa,CAAlC;AAuBA,eAAeC,qBAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useEffect","useMemo","useState","useCallback","PropTypes","convert","BaseModal","ListItem","ButtonLink","Loader","Provider","SelectOptionPropTypes","SearchForm","searchValueIncluded","COLORS","style","FilterButton","props","active","filter","itemTotal","onClick","primarySkinColor","cm_primary_blue","Content","skillFilterNumber","skillFilterNumberInActive","backgroundColor","color","buttonProps","customStyle","transition","width","content","propTypes","bool","string","number","func","LearningPriorityModal","context","priorities","preselected","isOpen","isLoading","filters","onCancel","onAdd","onClose","translate","selectedPriority","setSelectedPriority","selectedPriorityType","setSelectedPriorityType","searchValue","setSearchValue","filterValue","setFilterValue","searchResults","setSearchResults","handleCancel","handleClose","handleSearch","value","priority","title","handleSearchReset","priorityList","map","isPreSelectedPriority","some","selected","priorityRef","disabled","footer","cancelButton","label","confirmButton","onConfirm","iconName","LearningPriorityContainer","loaderContainer","loader","searchWrapper","placeholder","onChange","filterWrapper","length","index","name","count","handleChange","filterButtonWrapper","priorityListWrapper","courses","type","handlePriorityClick","subtitle","contextTypes","childContextTypes","arrayOf","shape","oneOf"],"sources":["../../../src/molecule/learning-priority-modal/index.js"],"sourcesContent":["import React, {useEffect, useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {assign, pick} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport BaseModal from '../base-modal';\nimport ListItem from '../../organism/list-item';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport SearchForm from '../search-form';\nimport searchValueIncluded from '../../util/search-value-included';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst FilterButton = props => {\n const {active, filter, itemTotal, onClick} = props;\n const primarySkinColor = COLORS.cm_primary_blue;\n\n const Content = useCallback(\n () => (\n <div>\n {filter}\n <span\n className={active ? style.skillFilterNumber : style.skillFilterNumberInActive}\n style={{\n backgroundColor: active ? convert(`color(${primarySkinColor} a(0.07))`) : '#EAEAEB',\n color: active ? primarySkinColor : '#515161'\n }}\n >\n {itemTotal}\n </span>\n </div>\n ),\n [filter, itemTotal, active, primarySkinColor]\n );\n\n const buttonProps = {\n customStyle: {\n backgroundColor: active ? convert(`color(${primarySkinColor} a(0.07))`) : 'transparent',\n color: active ? primarySkinColor : '#9999A8',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n onClick,\n content: <Content />,\n 'data-name': 'change-skill-focus-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.propTypes = {\n active: PropTypes.bool,\n filter: PropTypes.string,\n itemTotal: PropTypes.number,\n onClick: PropTypes.func\n};\n\nconst LearningPriorityModal = (props, context) => {\n const {priorities, preselected, isOpen, isLoading, filters, onCancel, onAdd, onClose} = props;\n const {translate} = context;\n\n const [selectedPriority, setSelectedPriority] = useState('');\n const [selectedPriorityType, setSelectedPriorityType] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const [filterValue, setFilterValue] = useState('all');\n const [searchResults, setSearchResults] = useState(priorities);\n\n const handleCancel = useCallback(() => {\n setSelectedPriority('');\n setSelectedPriorityType('');\n onCancel();\n }, [setSelectedPriority, setSelectedPriorityType, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedPriority('');\n setSelectedPriorityType('');\n onClose();\n }, [setSelectedPriority, setSelectedPriorityType, onClose]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(priorities.filter(priority => searchValueIncluded(priority.title, value)));\n },\n [priorities, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(priorities);\n }, [priorities, setSearchValue, setSearchResults]);\n\n useEffect(() => {\n setSearchResults(priorities);\n }, [priorities]);\n\n const priorityList = useMemo(() => {\n return searchResults.map(priority => {\n const isPreSelectedPriority = preselected.some(selected => selected === priority.priorityRef);\n return assign(\n {\n selected: isPreSelectedPriority,\n disabled: isPreSelectedPriority\n },\n pick(['title', 'priorityRef', 'type', 'courses'], priority)\n );\n });\n }, [searchResults, preselected]);\n\n const footer = useMemo(() => {\n return {\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel')\n },\n confirmButton: {\n onConfirm: () => {\n onAdd(selectedPriority, selectedPriorityType);\n setSelectedPriority('');\n setSelectedPriorityType('');\n onClose();\n },\n label: translate('add'),\n iconName: 'plus',\n disabled: isLoading || !selectedPriority,\n color: COLORS.cm_primary_blue\n }\n };\n }, [\n handleCancel,\n setSelectedPriority,\n setSelectedPriorityType,\n onAdd,\n onClose,\n translate,\n selectedPriority,\n selectedPriorityType,\n isLoading\n ]);\n\n if ((!isLoading && !priorities) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('learning_priority_modal_title')}\n description={translate('learning_priority_modal_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n >\n <div className={style.LearningPriorityContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_priority_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.filterWrapper}>\n {searchResults.length > 0\n ? filters.map((filter, index) => {\n const {name, value, count} = filter;\n\n function handleChange() {\n setFilterValue(value);\n handleSearchReset();\n }\n\n if (count === 0) return null;\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n active={filterValue === value}\n filter={name}\n onClick={handleChange}\n itemTotal={count}\n />\n </div>\n );\n })\n : null}\n </div>\n <div className={style.priorityListWrapper}>\n {priorityList.map(priority => {\n const {title, priorityRef, courses = null, type, selected, disabled} = priority;\n function handlePriorityClick() {\n if (selectedPriority === priorityRef) {\n setSelectedPriority('');\n setSelectedPriorityType('');\n return;\n }\n setSelectedPriority(priorityRef);\n setSelectedPriorityType(type);\n }\n\n if ((filterValue !== 'all' && type !== filterValue) || !type || !title) return null;\n\n return (\n <ListItem\n {...(courses !== null ? {subtitle: `${courses} ${translate('courses')}`} : {})}\n title={title}\n selected={selected || selectedPriority === priorityRef}\n selectedColor={COLORS.cm_primary_blue}\n disabled={disabled}\n onClick={handlePriorityClick}\n tags={[{label: type, type: 'default'}]}\n key={priorityRef}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nLearningPriorityModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearningPriorityModal.propTypes = {\n priorities: PropTypes.arrayOf(\n PropTypes.shape({\n priorityRef: PropTypes.string,\n title: PropTypes.string,\n courses: PropTypes.number,\n type: PropTypes.oneOf(['skill', 'playlist', 'certificate'])\n })\n ),\n preselected: PropTypes.arrayOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n ...SelectOptionPropTypes,\n count: PropTypes.number\n })\n ),\n onCancel: PropTypes.func,\n onAdd: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default LearningPriorityModal;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,OAA1B,EAAmCC,QAAnC,EAA6CC,WAA7C,QAA+D,OAA/D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,QAAP,MAAqB,0BAArB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,SAAQC,qBAAR,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C,SAAS,CAACkC,IAnBe;EAoBhCU,OAAO,EAAE5C,SAAS,CAACkC;AApBa,CAAlC;AAuBA,eAAeC,qBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-priority-setup-item/index.js"],"names":[],"mappings":";AAOA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-priority-setup-item/index.js"],"names":[],"mappings":";AAOA,kFAyDC"}
|
|
@@ -18,7 +18,7 @@ const LearningPrioritySetupItem = (props, context) => {
|
|
|
18
18
|
const {
|
|
19
19
|
translate
|
|
20
20
|
} = context;
|
|
21
|
-
const handleRemovePriority = useCallback(() => onRemove(priorityRef, type), [priorityRef, type]);
|
|
21
|
+
const handleRemovePriority = useCallback(() => onRemove(priorityRef, type), [priorityRef, type, onRemove]);
|
|
22
22
|
|
|
23
23
|
const handleTypeTranslate = itemType => {
|
|
24
24
|
switch (itemType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","Provider","Tag","ButtonLink","style","LearningPrioritySetupItem","props","context","priorityRef","id","title","courses","type","ariaLabel","onRemove","translate","handleRemovePriority","handleTypeTranslate","itemType","container","containerInfos","titleWrapper","width","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","string","number","oneOf","func"],"sources":["../../../src/molecule/learning-priority-setup-item/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst LearningPrioritySetupItem = (props, context) => {\n const {priorityRef, id, title, courses = null, type, 'aria-label': ariaLabel, onRemove} = props;\n\n const {translate} = context;\n\n const handleRemovePriority = useCallback(() => onRemove(priorityRef, type)
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","Provider","Tag","ButtonLink","style","LearningPrioritySetupItem","props","context","priorityRef","id","title","courses","type","ariaLabel","onRemove","translate","handleRemovePriority","handleTypeTranslate","itemType","container","containerInfos","titleWrapper","width","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","string","number","oneOf","func"],"sources":["../../../src/molecule/learning-priority-setup-item/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst LearningPrioritySetupItem = (props, context) => {\n const {priorityRef, id, title, courses = null, type, 'aria-label': ariaLabel, onRemove} = props;\n\n const {translate} = context;\n\n const handleRemovePriority = useCallback(\n () => onRemove(priorityRef, type),\n [priorityRef, type, onRemove]\n );\n\n const handleTypeTranslate = itemType => {\n switch (itemType) {\n case 'skill':\n return translate('skill');\n case 'playlist':\n return translate('playlist');\n case 'certificate':\n return translate('certificate');\n }\n };\n\n return (\n <div\n className={style.container}\n aria-label={ariaLabel}\n data-name={`learning-priority-setup-item-${id}`}\n >\n <div className={style.containerInfos}>\n <div className={style.titleWrapper}>\n <div className={style.title}>{title}</div>\n <div>\n <Tag label={handleTypeTranslate(type)} size={'S'} />\n </div>\n </div>\n {courses !== null ? (\n <span className={style.courses}>{`${courses} ${translate('courses')}`}</span>\n ) : null}\n </div>\n <ButtonLink\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n backgroundColor: 'transparent'\n }}\n hoverBackgroundColor=\"#EAEAEB\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'trash',\n color: '#515161',\n size: 16\n }\n }}\n onClick={handleRemovePriority}\n />\n </div>\n );\n};\n\nLearningPrioritySetupItem.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearningPrioritySetupItem.propTypes = {\n 'aria-label': PropTypes.string,\n id: PropTypes.string,\n priorityRef: PropTypes.string,\n title: PropTypes.string,\n courses: PropTypes.number,\n type: PropTypes.oneOf(['skill', 'playlist', 'certificate']),\n onRemove: PropTypes.func\n};\n\nexport default LearningPrioritySetupItem;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,yBAAyB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpD,MAAM;IAACC,WAAD;IAAcC,EAAd;IAAkBC,KAAlB;IAAyBC,OAAO,GAAG,IAAnC;IAAyCC,IAAzC;IAA+C,cAAcC,SAA7D;IAAwEC;EAAxE,IAAoFR,KAA1F;EAEA,MAAM;IAACS;EAAD,IAAcR,OAApB;EAEA,MAAMS,oBAAoB,GAAGjB,WAAW,CACtC,MAAMe,QAAQ,CAACN,WAAD,EAAcI,IAAd,CADwB,EAEtC,CAACJ,WAAD,EAAcI,IAAd,EAAoBE,QAApB,CAFsC,CAAxC;;EAKA,MAAMG,mBAAmB,GAAGC,QAAQ,IAAI;IACtC,QAAQA,QAAR;MACE,KAAK,OAAL;QACE,OAAOH,SAAS,CAAC,OAAD,CAAhB;;MACF,KAAK,UAAL;QACE,OAAOA,SAAS,CAAC,UAAD,CAAhB;;MACF,KAAK,aAAL;QACE,OAAOA,SAAS,CAAC,aAAD,CAAhB;IANJ;EAQD,CATD;;EAWA,oBACE;IACE,SAAS,EAAEX,KAAK,CAACe,SADnB;IAEE,cAAYN,SAFd;IAGE,aAAY,gCAA+BJ,EAAG;EAHhD,gBAKE;IAAK,SAAS,EAAEL,KAAK,CAACgB;EAAtB,gBACE;IAAK,SAAS,EAAEhB,KAAK,CAACiB;EAAtB,gBACE;IAAK,SAAS,EAAEjB,KAAK,CAACM;EAAtB,GAA8BA,KAA9B,CADF,eAEE,8CACE,oBAAC,GAAD;IAAK,KAAK,EAAEO,mBAAmB,CAACL,IAAD,CAA/B;IAAuC,IAAI,EAAE;EAA7C,EADF,CAFF,CADF,EAOGD,OAAO,KAAK,IAAZ,gBACC;IAAM,SAAS,EAAEP,KAAK,CAACO;EAAvB,GAAkC,GAAEA,OAAQ,IAAGI,SAAS,CAAC,SAAD,CAAY,EAApE,CADD,GAEG,IATN,CALF,eAgBE,oBAAC,UAAD;IACE,IAAI,EAAC,SADP;IAEE,WAAW,EAAE;MACXO,KAAK,EAAE,aADI;MAEXC,eAAe,EAAE;IAFN,CAFf;IAME,oBAAoB,EAAC,SANvB;IAOE,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJC,MAAM,EAAE;QACNC,IAAI,EAAE,OADA;QAENC,KAAK,EAAE,SAFD;QAGNC,IAAI,EAAE;MAHA;IAFJ,CAPR;IAeE,OAAO,EAAEZ;EAfX,EAhBF,CADF;AAoCD,CAzDD;;AA2DAX,yBAAyB,CAACwB,YAA1B,GAAyC;EACvCd,SAAS,EAAEd,QAAQ,CAAC6B,iBAAT,CAA2Bf;AADC,CAAzC;AAIAV,yBAAyB,CAAC0B,SAA1B,2CAAsC;EACpC,cAAc/B,SAAS,CAACgC,MADY;EAEpCvB,EAAE,EAAET,SAAS,CAACgC,MAFsB;EAGpCxB,WAAW,EAAER,SAAS,CAACgC,MAHa;EAIpCtB,KAAK,EAAEV,SAAS,CAACgC,MAJmB;EAKpCrB,OAAO,EAAEX,SAAS,CAACiC,MALiB;EAMpCrB,IAAI,EAAEZ,SAAS,CAACkC,KAAV,CAAgB,CAAC,OAAD,EAAU,UAAV,EAAsB,aAAtB,CAAhB,CAN8B;EAOpCpB,QAAQ,EAAEd,SAAS,CAACmC;AAPgB,CAAtC;AAUA,eAAe9B,yBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AA0CA,qEAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAhDD,mFAqBC"}
|
|
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import Provider from '../../atom/provider';
|
|
8
8
|
import InputSwitch from '../../atom/input-switch';
|
|
9
9
|
import RadioGroup from '../../atom/radio-group';
|
|
10
|
+
import { COLORS } from '../../variables/colors';
|
|
10
11
|
import style from './style.css';
|
|
11
12
|
|
|
12
13
|
const ContentTypesToggler = (props, context) => {
|
|
@@ -31,7 +32,8 @@ const ContentTypesToggler = (props, context) => {
|
|
|
31
32
|
}, /*#__PURE__*/React.createElement(RadioGroup, _extends({}, contentTypes, {
|
|
32
33
|
style: {
|
|
33
34
|
color: contentTypesColor
|
|
34
|
-
}
|
|
35
|
+
},
|
|
36
|
+
color: COLORS.cm_primary_blue
|
|
35
37
|
})));
|
|
36
38
|
};
|
|
37
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Provider","InputSwitch","RadioGroup","style","ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","contentTypeWrapper","color","contextTypes","childContextTypes","propTypes","shape","modified","bool","SetupSection","translate","title","display","wrapper","settings","label","string","isRequired","onUp","func","onDown"],"sources":["../../../src/molecule/setup-section/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport style from './style.css';\n\nconst ContentTypesToggler = (props, context) => {\n const {skin} = context;\n const {contentTypes} = props;\n\n if (!contentTypes) {\n return null;\n }\n\n const brand = get('common.brand', skin);\n const orange = get('common.orange', skin);\n const contentTypesColor = get('modified', contentTypes) ? orange : brand;\n\n return (\n <div className={style.contentTypeWrapper}>\n <RadioGroup
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Provider","InputSwitch","RadioGroup","COLORS","style","ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","contentTypeWrapper","color","cm_primary_blue","contextTypes","childContextTypes","propTypes","shape","modified","bool","SetupSection","translate","title","display","wrapper","settings","label","string","isRequired","onUp","func","onDown"],"sources":["../../../src/molecule/setup-section/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst ContentTypesToggler = (props, context) => {\n const {skin} = context;\n const {contentTypes} = props;\n\n if (!contentTypes) {\n return null;\n }\n\n const brand = get('common.brand', skin);\n const orange = get('common.orange', skin);\n const contentTypesColor = get('modified', contentTypes) ? orange : brand;\n\n return (\n <div className={style.contentTypeWrapper}>\n <RadioGroup\n {...contentTypes}\n style={{color: contentTypesColor}}\n color={COLORS.cm_primary_blue}\n />\n </div>\n );\n};\nContentTypesToggler.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentTypesToggler.propTypes = {\n contentTypes: PropTypes.shape({\n ...RadioGroup.propTypes,\n modified: PropTypes.bool\n })\n};\n\nconst SetupSection = (props, context) => {\n const {translate} = context;\n\n const {title, display, contentTypes} = props;\n\n return (\n <div className={style.wrapper}>\n <div className={style.title}>{title}</div>\n <div className={style.settings}>\n <ContentTypesToggler contentTypes={contentTypes} />\n <div className={style.label}>{translate('Show')}</div>\n <InputSwitch {...display} />\n </div>\n </div>\n );\n};\n\nSetupSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSetupSection.propTypes = {\n title: PropTypes.string.isRequired,\n onUp: PropTypes.func,\n onDown: PropTypes.func,\n display: PropTypes.shape(InputSwitch.propTypes),\n contentTypes: ContentTypesToggler.propTypes.contentTypes\n};\n\nexport default SetupSection;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAM;IAACE;EAAD,IAAiBH,KAAvB;;EAEA,IAAI,CAACG,YAAL,EAAmB;IACjB,OAAO,IAAP;EACD;;EAED,MAAMC,KAAK,GAAG,KAAI,cAAJ,EAAoBF,IAApB,CAAd;;EACA,MAAMG,MAAM,GAAG,KAAI,eAAJ,EAAqBH,IAArB,CAAf;;EACA,MAAMI,iBAAiB,GAAG,KAAI,UAAJ,EAAgBH,YAAhB,IAAgCE,MAAhC,GAAyCD,KAAnE;EAEA,oBACE;IAAK,SAAS,EAAEN,KAAK,CAACS;EAAtB,gBACE,oBAAC,UAAD,eACMJ,YADN;IAEE,KAAK,EAAE;MAACK,KAAK,EAAEF;IAAR,CAFT;IAGE,KAAK,EAAET,MAAM,CAACY;EAHhB,GADF,CADF;AASD,CArBD;;AAsBAV,mBAAmB,CAACW,YAApB,GAAmC;EACjCR,IAAI,EAAER,QAAQ,CAACiB,iBAAT,CAA2BT;AADA,CAAnC;AAIAH,mBAAmB,CAACa,SAApB,2CAAgC;EAC9BT,YAAY,EAAEV,SAAS,CAACoB,KAAV,cACTjB,UAAU,CAACgB,SADF;IAEZE,QAAQ,EAAErB,SAAS,CAACsB;EAFR;AADgB,CAAhC;;AAOA,MAAMC,YAAY,GAAG,CAAChB,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACgB;EAAD,IAAchB,OAApB;EAEA,MAAM;IAACiB,KAAD;IAAQC,OAAR;IAAiBhB;EAAjB,IAAiCH,KAAvC;EAEA,oBACE;IAAK,SAAS,EAAEF,KAAK,CAACsB;EAAtB,gBACE;IAAK,SAAS,EAAEtB,KAAK,CAACoB;EAAtB,GAA8BA,KAA9B,CADF,eAEE;IAAK,SAAS,EAAEpB,KAAK,CAACuB;EAAtB,gBACE,oBAAC,mBAAD;IAAqB,YAAY,EAAElB;EAAnC,EADF,eAEE;IAAK,SAAS,EAAEL,KAAK,CAACwB;EAAtB,GAA8BL,SAAS,CAAC,MAAD,CAAvC,CAFF,eAGE,oBAAC,WAAD,EAAiBE,OAAjB,CAHF,CAFF,CADF;AAUD,CAfD;;AAiBAH,YAAY,CAACN,YAAb,GAA4B;EAC1BO,SAAS,EAAEvB,QAAQ,CAACiB,iBAAT,CAA2BM,SADZ;EAE1Bf,IAAI,EAAER,QAAQ,CAACiB,iBAAT,CAA2BT;AAFP,CAA5B;AAKAc,YAAY,CAACJ,SAAb,2CAAyB;EACvBM,KAAK,EAAEzB,SAAS,CAAC8B,MAAV,CAAiBC,UADD;EAEvBC,IAAI,EAAEhC,SAAS,CAACiC,IAFO;EAGvBC,MAAM,EAAElC,SAAS,CAACiC,IAHK;EAIvBP,OAAO,EAAE1B,SAAS,CAACoB,KAAV,CAAgBlB,WAAW,CAACiB,SAA5B,CAJc;EAKvBT,YAAY,EAAEJ,mBAAmB,CAACa,SAApB,CAA8BT;AALrB,CAAzB;AAQA,eAAea,YAAf"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../variables/colors.css";
|
|
4
4
|
@value xtraLightGrey from colors;
|
|
5
|
-
@value
|
|
5
|
+
@value cm_primary_blue from colors;
|
|
6
6
|
@value primaryAdd1 from colors;
|
|
7
7
|
|
|
8
8
|
.wrapper {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
.title {
|
|
21
21
|
font-family: 'Gilroy';
|
|
22
22
|
font-size: 14px;
|
|
23
|
-
color:
|
|
23
|
+
color: cm_primary_blue;
|
|
24
24
|
font-weight: 700;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -41,7 +41,7 @@ const SkillPickerModal = (props, context) => {
|
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}, [skills, selectedSkillList, skillsLocales]);
|
|
44
|
-
const isError = useMemo(() => selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills, [selectedSkillList, maxSelectedSkills]);
|
|
44
|
+
const isError = useMemo(() => selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills, [selectedSkillList, maxSelectedSkills, minSelectedSkills]);
|
|
45
45
|
const footer = useMemo(() => {
|
|
46
46
|
const footerDescription = selectedSkillList.length > maxSelectedSkills ? translate('skill_focus_footer_error_description', {
|
|
47
47
|
skillNumber: selectedSkillList.length - maxSelectedSkills
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","filter","BaseModal","Chip","Loader","Provider","style","SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","handleCancel","handleClose","skillList","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","selectedSkill","contextTypes","childContextTypes","propTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip\n text={skillTitle}\n selected={focus}\n onClick={handleChipClick}\n key={index}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,QAAxB,EAAkCC,WAAlC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,E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","useMemo","useState","useCallback","PropTypes","filter","BaseModal","Chip","Loader","Provider","style","SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","handleCancel","handleClose","skillList","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","selectedSkill","contextTypes","childContextTypes","propTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills, minSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip\n text={skillTitle}\n selected={focus}\n onClick={handleChipClick}\n key={index}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,QAAxB,EAAkCC,WAAlC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJC,MADI;IAEJC,cAFI;IAGJC,aAHI;IAIJC,MAJI;IAKJC,SALI;IAMJC,iBAAiB,GAAG,CANhB;IAOJC,iBAAiB,GAAG,CAPhB;IAQJC,QARI;IASJC,SATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,iBAAD,EAAoBC,oBAApB,IAA4CxB,QAAQ,CAACa,cAAD,CAA1D;EAEA,MAAMY,YAAY,GAAGxB,WAAW,CAAC,MAAM;IACrCuB,oBAAoB,CAACX,cAAD,CAApB;IACAM,QAAQ;EACT,CAH+B,EAG7B,CAACK,oBAAD,EAAuBX,cAAvB,EAAuCM,QAAvC,CAH6B,CAAhC;EAKA,MAAMO,WAAW,GAAGzB,WAAW,CAAC,MAAM;IACpCuB,oBAAoB,CAACX,cAAD,CAApB;IACAQ,OAAO;EACR,CAH8B,EAG5B,CAACG,oBAAD,EAAuBX,cAAvB,EAAuCQ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],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AA8EA,kEAgFC"}
|
|
@@ -10,7 +10,7 @@ import Link from '../../atom/link';
|
|
|
10
10
|
import Loader from '../../atom/loader';
|
|
11
11
|
import style from './style.css';
|
|
12
12
|
|
|
13
|
-
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending,
|
|
13
|
+
const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, massiveBattleForm) => {
|
|
14
14
|
if (!onSubmit && !onReset) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
@@ -20,27 +20,36 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
|
|
|
20
20
|
"data-tip": tooltip.title,
|
|
21
21
|
"data-for": "submitButton",
|
|
22
22
|
className: massiveBattleForm ? style.massiveBattleButton : style.saveButton
|
|
23
|
-
},
|
|
23
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
24
24
|
type: "primary",
|
|
25
25
|
label: submitValue,
|
|
26
26
|
disabled: disabledSubmit,
|
|
27
27
|
"data-testid": "submit-button",
|
|
28
|
-
|
|
29
|
-
onClick: onSubmit
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
usage: "submit",
|
|
29
|
+
onClick: onSubmit,
|
|
30
|
+
icon: {
|
|
31
|
+
position: 'left',
|
|
32
|
+
faIcon: {
|
|
33
|
+
name: 'circle-check',
|
|
34
|
+
color: '#FFFFFF',
|
|
35
|
+
size: 16
|
|
36
|
+
}
|
|
37
|
+
}
|
|
34
38
|
})) : null;
|
|
35
|
-
const cancelBackground = {
|
|
36
|
-
backgroundColor: darkColor
|
|
37
|
-
};
|
|
38
39
|
const resetButton = onReset ? /*#__PURE__*/React.createElement("div", {
|
|
39
40
|
className: style.resetButton
|
|
40
|
-
}, /*#__PURE__*/React.createElement(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
42
|
+
usage: "reset",
|
|
43
|
+
label: resetValue,
|
|
44
|
+
"data-testid": "reset-button",
|
|
45
|
+
onClick: onReset,
|
|
46
|
+
icon: {
|
|
47
|
+
position: 'left',
|
|
48
|
+
faIcon: {
|
|
49
|
+
name: 'trash',
|
|
50
|
+
size: 16
|
|
51
|
+
}
|
|
52
|
+
}
|
|
44
53
|
})) : null;
|
|
45
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
55
|
className: style.buttons
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaCompositionNavigationArrowLeft","ArrowLeft","BrandFormGroup","Provider","Button","ButtonLink","Link","Loader","style","buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaCompositionNavigationArrowLeft","ArrowLeft","BrandFormGroup","Provider","Button","ButtonLink","Link","Loader","style","buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","massiveBattleForm","disabledSubmit","submitButton","title","massiveBattleButton","saveButton","position","faIcon","name","color","size","resetButton","buttons","BrandForm","props","context","groups","back","isLoading","theme","skin","darkColor","fields","type","backView","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","e","preventDefault","handleReset","loaderContainer","loader","form","contextTypes","childContextTypes","defaultProps","place","propTypes","arrayOf","shape","isRequired","bool","func","children","href","string"],"sources":["../../../src/organism/brand-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowLeft as ArrowLeft} from '@coorpacademy/nova-icons';\nimport BrandFormGroup from '../../molecule/brand-form-group';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport ButtonLink from '../../atom/button-link';\nimport Link from '../../atom/link';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildButtonSection = (\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n massiveBattleForm\n) => {\n if (!onSubmit && !onReset) {\n return null;\n }\n\n const disabledSubmit = disabled || isPending || !isModified;\n const submitButton = onSubmit ? (\n <div\n data-tip={tooltip.title}\n data-for=\"submitButton\"\n className={massiveBattleForm ? style.massiveBattleButton : style.saveButton}\n >\n <ButtonLink\n type=\"primary\"\n label={submitValue}\n disabled={disabledSubmit}\n data-testid=\"submit-button\"\n usage=\"submit\"\n onClick={onSubmit}\n icon={{\n position: 'left',\n faIcon: {\n name: 'circle-check',\n color: '#FFFFFF',\n size: 16\n }\n }}\n />\n </div>\n ) : null;\n\n const resetButton = onReset ? (\n <div className={style.resetButton}>\n <ButtonLink\n usage=\"reset\"\n label={resetValue}\n data-testid=\"reset-button\"\n onClick={onReset}\n icon={{\n position: 'left',\n faIcon: {\n name: 'trash',\n size: 16\n }\n }}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.buttons}>\n {submitButton}\n {resetButton}\n </div>\n );\n};\nconst BrandForm = (props, context) => {\n const {\n groups,\n disabled,\n isModified,\n isPending,\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n back,\n tooltip,\n isLoading,\n theme\n } = props;\n const {skin} = context;\n const darkColor = get('common.dark', skin);\n const massiveBattleForm = groups[0]?.fields?.[0]?.type === 'titleAndInput';\n const backView = back ? (\n <p className={style.back}>\n <ArrowLeft style={{color: darkColor}} className={style.arrowBack} />\n <Link href={back.link} className={style.backDesc}>\n {back.desc}\n </Link>\n </p>\n ) : null;\n\n const brandGroups = groups.map((group, index) => {\n return (\n <div className={style.group} key={index}>\n <BrandFormGroup {...group} />\n </div>\n );\n });\n\n const buttonSection = buildButtonSection(\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor,\n theme,\n massiveBattleForm\n );\n\n const handleSubmit = useMemo(\n () => e => {\n e.preventDefault();\n return onSubmit(e);\n },\n [onSubmit]\n );\n\n const handleReset = useMemo(\n () => e => {\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n return (\n <div>\n {backView}\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <form onSubmit={handleSubmit} onReset={handleReset} className={style.form}>\n {brandGroups}\n {buttonSection}\n </form>\n )}\n </div>\n );\n};\n\nBrandForm.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBrandForm.defaultProps = {\n tooltip: {\n title: '',\n place: 'top'\n }\n};\n\nBrandForm.propTypes = {\n groups: PropTypes.arrayOf(PropTypes.shape(BrandFormGroup.propTypes)).isRequired,\n disabled: PropTypes.bool,\n isModified: PropTypes.bool,\n isPending: PropTypes.bool,\n onSubmit: PropTypes.func,\n submitValue: Button.propTypes.submitValue,\n onReset: PropTypes.func,\n resetValue: Button.propTypes.submitValue,\n back: PropTypes.shape({\n desc: Link.propTypes.children,\n link: Link.propTypes.href\n }),\n tooltip: PropTypes.shape({\n title: PropTypes.string,\n place: PropTypes.string\n }),\n isLoading: PropTypes.bool,\n theme: PropTypes.string\n};\n\nexport default BrandForm;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,cAAP,MAA2B,iCAA3B;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,k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,IALA;EAMpBzD,WAAW,EAAEP,MAAM,CAAC2D,SAAP,CAAiBpD,WANV;EAOpBC,OAAO,EAAEb,SAAS,CAACqE,IAPC;EAQpBvD,UAAU,EAAET,MAAM,CAAC2D,SAAP,CAAiBpD,WART;EASpBwB,IAAI,EAAEpC,SAAS,CAACkE,KAAV,CAAgB;IACpBnB,IAAI,EAAExC,IAAI,CAACyD,SAAL,CAAeM,QADD;IAEpBzB,IAAI,EAAEtC,IAAI,CAACyD,SAAL,CAAeO;EAFD,CAAhB,CATc;EAapBxD,OAAO,EAAEf,SAAS,CAACkE,KAAV,CAAgB;IACvB5C,KAAK,EAAEtB,SAAS,CAACwE,MADM;IAEvBT,KAAK,EAAE/D,SAAS,CAACwE;EAFM,CAAhB,CAbW;EAiBpBnC,SAAS,EAAErC,SAAS,CAACoE,IAjBD;EAkBpB9B,KAAK,EAAEtC,SAAS,CAACwE;AAlBG,CAAtB;AAqBA,eAAexC,SAAf"}
|
|
@@ -2,27 +2,6 @@ export default BrandLearningPriorities;
|
|
|
2
2
|
declare function BrandLearningPriorities(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace BrandLearningPriorities {
|
|
4
4
|
namespace contextTypes {
|
|
5
|
-
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
-
common: PropTypes.Requireable<{
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
}>;
|
|
9
|
-
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
-
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
-
logo: PropTypes.Requireable<any>;
|
|
12
|
-
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
-
login: PropTypes.Requireable<any>;
|
|
14
|
-
}>>;
|
|
15
|
-
icons: PropTypes.Requireable<{
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
}>;
|
|
18
|
-
mod: PropTypes.Requireable<{
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
}>;
|
|
21
|
-
courses: PropTypes.Requireable<any[]>;
|
|
22
|
-
texts: PropTypes.Requireable<{
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
}>;
|
|
25
|
-
}>>;
|
|
26
5
|
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
6
|
}
|
|
28
7
|
namespace propTypes {
|
|
@@ -84,6 +63,7 @@ declare namespace BrandLearningPriorities {
|
|
|
84
63
|
title: PropTypes.Validator<string>;
|
|
85
64
|
subtitle: PropTypes.Requireable<string>;
|
|
86
65
|
selected: PropTypes.Requireable<boolean>;
|
|
66
|
+
selectedColor: PropTypes.Requireable<string>;
|
|
87
67
|
dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
88
68
|
label: PropTypes.Requireable<string>;
|
|
89
69
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-learning-priorities/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-learning-priorities/index.js"],"names":[],"mappings":";AAUA,gFA2FC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import _get from "lodash/fp/get";
|
|
2
|
-
|
|
3
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
2
|
|
|
5
3
|
import React, { useState, useCallback, useMemo, useEffect } from 'react';
|
|
6
4
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { convert } from 'css-color-function';
|
|
8
5
|
import Provider from '../../atom/provider';
|
|
9
6
|
import Loader from '../../atom/loader';
|
|
10
7
|
import { SelectOptionPropTypes } from '../../atom/select';
|
|
@@ -29,12 +26,8 @@ const BrandLearningPriorities = (props, context) => {
|
|
|
29
26
|
const [itemList, setItemList] = useState([...items]);
|
|
30
27
|
const [openModal, setOpenModal] = useState(false);
|
|
31
28
|
const {
|
|
32
|
-
skin,
|
|
33
29
|
translate
|
|
34
30
|
} = context;
|
|
35
|
-
|
|
36
|
-
const primarySkinColor = _get('common.primary', skin);
|
|
37
|
-
|
|
38
31
|
const selectedPriorities = useMemo(() => items.map(priority => priority.priorityRef), [items]);
|
|
39
32
|
const handleDropItem = useCallback((dragRef, dropRef) => {
|
|
40
33
|
const dragIndex = itemList.findIndex(item => item.priorityRef === dragRef);
|
|
@@ -82,14 +75,10 @@ const BrandLearningPriorities = (props, context) => {
|
|
|
82
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
83
76
|
className: style.priorityCount
|
|
84
77
|
}, `${items.length} ${translate('items')}`), /*#__PURE__*/React.createElement(ButtonLink, {
|
|
78
|
+
type: "primary",
|
|
85
79
|
customStyle: {
|
|
86
|
-
backgroundColor: primarySkinColor,
|
|
87
|
-
color: '#FFFFFF',
|
|
88
|
-
transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
|
|
89
80
|
width: 'fit-content'
|
|
90
81
|
},
|
|
91
|
-
hoverBackgroundColor: convert(`color(${primarySkinColor} a(0.07))`),
|
|
92
|
-
hoverColor: primarySkinColor,
|
|
93
82
|
onClick: handleOpenModal,
|
|
94
83
|
label: translate('add_learning_priority'),
|
|
95
84
|
"data-name": "add-learning-priority",
|
|
@@ -97,7 +86,6 @@ const BrandLearningPriorities = (props, context) => {
|
|
|
97
86
|
position: 'left',
|
|
98
87
|
faIcon: {
|
|
99
88
|
name: 'plus',
|
|
100
|
-
backgroundColor: primarySkinColor,
|
|
101
89
|
color: '#FFFFFF',
|
|
102
90
|
size: 16
|
|
103
91
|
}
|
|
@@ -110,7 +98,6 @@ const BrandLearningPriorities = (props, context) => {
|
|
|
110
98
|
};
|
|
111
99
|
|
|
112
100
|
BrandLearningPriorities.contextTypes = {
|
|
113
|
-
skin: Provider.childContextTypes.skin,
|
|
114
101
|
translate: Provider.childContextTypes.translate
|
|
115
102
|
};
|
|
116
103
|
BrandLearningPriorities.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useCallback","useMemo","useEffect","PropTypes","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useCallback","useMemo","useEffect","PropTypes","Provider","Loader","SelectOptionPropTypes","DraggableList","ButtonLink","LearningPriorityModal","style","BrandLearningPriorities","props","context","content","priorities","filters","isLoading","onAdd","items","onDrop","itemType","itemList","setItemList","openModal","setOpenModal","translate","selectedPriorities","map","priority","priorityRef","handleDropItem","dragRef","dropRef","dragIndex","findIndex","item","dropIndex","newItems","dragItem","splice","type","ref","Loading","loaderContainer","loader","handleOpenModal","handleCloseModal","container","LPtitle","LPdescription","ctaWrapper","priorityCount","length","width","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","shape","arrayOf","string","title","courses","number","count","bool","func"],"sources":["../../../src/organism/brand-learning-priorities/index.js"],"sourcesContent":["import React, {useState, useCallback, useMemo, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport DraggableList from '../../molecule/draggable-list';\nimport ButtonLink from '../../atom/button-link';\nimport LearningPriorityModal from '../../molecule/learning-priority-modal';\nimport style from './style.css';\n\nconst BrandLearningPriorities = (props, context) => {\n const {content, priorities, filters, isLoading, onAdd} = props;\n const {items, onDrop, itemType} = content;\n const [itemList, setItemList] = useState([...items]);\n const [openModal, setOpenModal] = useState(false);\n const {translate} = context;\n\n const selectedPriorities = useMemo(() => items.map(priority => priority.priorityRef), [items]);\n\n const handleDropItem = useCallback(\n (dragRef, dropRef) => {\n const dragIndex = itemList.findIndex(item => item.priorityRef === dragRef);\n const dropIndex = itemList.findIndex(item => item.priorityRef === dropRef);\n\n if (dragIndex === dropIndex) return;\n\n const newItems = [...itemList];\n const [dragItem] = newItems.splice(dragIndex, 1);\n newItems.splice(dropIndex, 0, dragItem);\n\n setItemList(newItems);\n onDrop(\n newItems.map(item => {\n return {type: item.type, ref: item.priorityRef};\n })\n );\n },\n [itemList, setItemList, onDrop]\n );\n\n const Loading = useCallback(\n () => (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ),\n []\n );\n\n useEffect(() => {\n setItemList(items);\n }, [items]);\n\n const handleOpenModal = useCallback(() => setOpenModal(true), [setOpenModal]);\n const handleCloseModal = useCallback(() => setOpenModal(false), [setOpenModal]);\n return (\n <div className={style.container}>\n <LearningPriorityModal\n isLoading={isLoading}\n isOpen={openModal}\n onCancel={handleCloseModal}\n onClose={handleCloseModal}\n onAdd={onAdd}\n priorities={priorities}\n filters={filters}\n preselected={selectedPriorities}\n />\n <div className={style.LPtitle}>{translate('learning_priorities')}</div>\n <div className={style.LPdescription}>\n {translate('learning_priorities_brand_description')}\n </div>\n\n {isLoading ? (\n <Loading />\n ) : (\n <>\n <div className={style.ctaWrapper}>\n <div className={style.priorityCount}>{`${items.length} ${translate('items')}`}</div>\n <ButtonLink\n type=\"primary\"\n customStyle={{\n width: 'fit-content'\n }}\n onClick={handleOpenModal}\n label={translate('add_learning_priority')}\n data-name=\"add-learning-priority\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'plus',\n color: '#FFFFFF',\n size: 16\n }\n }}\n />\n </div>\n <DraggableList itemType={itemType} items={itemList} onDrop={handleDropItem} />\n </>\n )}\n </div>\n );\n};\n\nBrandLearningPriorities.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nBrandLearningPriorities.propTypes = {\n content: PropTypes.shape(DraggableList.propTypes),\n priorities: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n title: PropTypes.string,\n courses: PropTypes.number,\n type: PropTypes.string\n })\n ),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n ...SelectOptionPropTypes,\n count: PropTypes.number\n })\n ),\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CAAC4D,KAAV,CAAgBxD,aAAa,CAACuD,SAA9B,CADyB;EAElC/C,UAAU,EAAEZ,SAAS,CAAC6D,OAAV,CACV7D,SAAS,CAAC4D,KAAV,CAAgB;IACdrB,GAAG,EAAEvC,SAAS,CAAC8D,MADD;IAEdC,KAAK,EAAE/D,SAAS,CAAC8D,MAFH;IAGdE,OAAO,EAAEhE,SAAS,CAACiE,MAHL;IAId3B,IAAI,EAAEtC,SAAS,CAAC8D;EAJF,CAAhB,CADU,CAFsB;EAUlCjD,OAAO,EAAEb,SAAS,CAAC6D,OAAV,CACP7D,SAAS,CAAC4D,KAAV,cACKzD,qBADL;IAEE+D,KAAK,EAAElE,SAAS,CAACiE;EAFnB,GADO,CAVyB;EAgBlCnD,SAAS,EAAEd,SAAS,CAACmE,IAhBa;EAiBlCpD,KAAK,EAAEf,SAAS,CAACoE;AAjBiB,CAApC;AAoBA,eAAe5D,uBAAf"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export default ListItem;
|
|
2
|
-
declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton, tags, title, selected, subtitle, dataColumns, order, "aria-label": ariaLabel, disabled, contentType, isBulkStyle, isOverflowHidden, onClick }: {
|
|
2
|
+
declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton, tags, title, selected, selectedColor, subtitle, dataColumns, order, "aria-label": ariaLabel, disabled, contentType, isBulkStyle, isOverflowHidden, onClick }: {
|
|
3
3
|
buttonLink: any;
|
|
4
4
|
secondButtonLink: any;
|
|
5
5
|
bulletPointMenuButton: any;
|
|
6
6
|
tags: any;
|
|
7
7
|
title: any;
|
|
8
8
|
selected: any;
|
|
9
|
+
selectedColor: any;
|
|
9
10
|
subtitle: any;
|
|
10
11
|
dataColumns: any;
|
|
11
12
|
order: any;
|
|
@@ -45,6 +46,7 @@ declare namespace ListItem {
|
|
|
45
46
|
title: PropTypes.Validator<string>;
|
|
46
47
|
subtitle: PropTypes.Requireable<string>;
|
|
47
48
|
selected: PropTypes.Requireable<boolean>;
|
|
49
|
+
selectedColor: PropTypes.Requireable<string>;
|
|
48
50
|
dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
49
51
|
label: PropTypes.Requireable<string>;
|
|
50
52
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAaA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;;8BAwGC"}
|