@coorpacademy/components 11.14.15-alpha.26 → 11.14.15-alpha.27

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.
@@ -84,7 +84,7 @@ declare namespace ListItems {
84
84
  type: PropTypes.Requireable<string>;
85
85
  itemType: PropTypes.Requireable<string>;
86
86
  onDrop: PropTypes.Requireable<(...args: any[]) => any>;
87
- displayAll: PropTypes.Requireable<boolean>;
87
+ withSystemAll: PropTypes.Requireable<boolean>;
88
88
  }> | PropTypes.InferProps<{
89
89
  type: PropTypes.Requireable<string>;
90
90
  columns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -16,11 +16,11 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
16
16
  items,
17
17
  itemType,
18
18
  onDrop,
19
- displayAll
19
+ withSystemAll
20
20
  } = content;
21
21
  const itemsView = findIndex({
22
22
  type: 'published'
23
- }, items[0]?.tags) !== -1 && itemType === 'certification' && !displayAll ? /*#__PURE__*/React.createElement(DraggableList, {
23
+ }, items[0]?.tags) !== -1 && itemType === 'certification' && !withSystemAll ? /*#__PURE__*/React.createElement(DraggableList, {
24
24
  items: items.map(item => _extends({}, item, {
25
25
  contentType: itemType
26
26
  })),
@@ -88,7 +88,7 @@ ListItems.propTypes = process.env.NODE_ENV !== "production" ? {
88
88
  type: PropTypes.oneOf(['list']),
89
89
  itemType: PropTypes.string,
90
90
  onDrop: PropTypes.func,
91
- displayAll: PropTypes.bool
91
+ withSystemAll: PropTypes.bool
92
92
  }), PropTypes.shape(_extends({}, ExpandibleActionableTable.propTypes, {
93
93
  type: PropTypes.oneOf(['expandible-actionable-table'])
94
94
  }))]),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","findIndex","PropTypes","ListItem","DraggableList","Title","ButtonLink","SelectMultiple","ExpandibleActionableTable","style","buildListItemsView","content","ariaLabel","selectMultiple","items","itemType","onDrop","displayAll","itemsView","type","tags","map","item","contentType","index","id","list","listWithSelectMultiple","buildContentView","ListItems","title","buttonLink","contentView","header","actionsWrapper","buttonCreate","propTypes","string","shape","oneOfType","arrayOf","oneOf","func","bool"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport findIndex from 'lodash/fp/findIndex';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport DraggableList from '../../molecule/draggable-list';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport ExpandibleActionableTable from '../../molecule/expandible-actionable-table';\nimport style from './style.css';\n\nconst buildListItemsView = (content, ariaLabel, selectMultiple) => {\n const {items, itemType, onDrop, displayAll} = content;\n const itemsView =\n findIndex({type: 'published'}, items[0]?.tags) !== -1 &&\n itemType === 'certification' &&\n !displayAll ? (\n <DraggableList\n items={items.map(item => ({...item, contentType: itemType}))}\n itemType=\"list-item\"\n onDrop={onDrop}\n />\n ) : (\n items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} contentType={itemType} />\n </li>\n ))\n );\n return (\n <ul\n className={!selectMultiple ? style.list : style.listWithSelectMultiple}\n aria-label={ariaLabel}\n data-name={'content-list'}\n >\n {itemsView}\n </ul>\n );\n};\nconst buildContentView = (content, ariaLabel, selectMultiple) => {\n const {type} = content;\n switch (type) {\n case 'list':\n return buildListItemsView(content, ariaLabel, selectMultiple);\n case 'expandible-actionable-table':\n return <ExpandibleActionableTable {...content} />;\n }\n};\n\nconst ListItems = ({title, buttonLink, selectMultiple, content, 'aria-label': ariaLabel}) => {\n const contentView = buildContentView(content, ariaLabel, selectMultiple);\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.actionsWrapper}>\n {selectMultiple ? (\n <div className={style.selectMultiple}>\n <SelectMultiple {...selectMultiple} />\n </div>\n ) : null}\n\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n </div>\n {contentView}\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n selectMultiple: PropTypes.shape(SelectMultiple.propTypes),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n type: PropTypes.oneOf(['list']),\n itemType: PropTypes.string,\n onDrop: PropTypes.func,\n displayAll: PropTypes.bool\n }),\n PropTypes.shape({\n ...ExpandibleActionableTable.propTypes,\n type: PropTypes.oneOf(['expandible-actionable-table'])\n })\n ]),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,cAAP,MAA2B,gCAA3B;AACA,OAAOC,yBAAP,MAAsC,4CAAtC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CAACC,OAAD,EAAUC,SAAV,EAAqBC,cAArB,KAAwC;EACjE,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,MAAlB;IAA0BC;EAA1B,IAAwCN,OAA9C;EACA,MAAMO,SAAS,GACbjB,SAAS,CAAC;IAACkB,IAAI,EAAE;EAAP,CAAD,EAAsBL,KAAK,CAAC,CAAD,CAAL,EAAUM,IAAhC,CAAT,KAAmD,CAAC,CAApD,IACAL,QAAQ,KAAK,eADb,IAEA,CAACE,UAFD,gBAGE,oBAAC,aAAD;IACE,KAAK,EAAEH,KAAK,CAACO,GAAN,CAAUC,IAAI,iBAASA,IAAT;MAAeC,WAAW,EAAER;IAA5B,EAAd,CADT;IAEE,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,GACGrB,cAAc,gBACb;IAAK,SAAS,EAAEJ,KAAK,CAACI;EAAtB,gBACE,oBAAC,cAAD,EAAoBA,cAApB,CADF,CADa,GAIX,IALN,eAOE;IAAK,SAAS,EAAEJ,KAAK,CAAC0B;EAAtB,gBACE,oBAAC,UAAD,EAAgBJ,UAAhB,CADF,CAPF,CAJF,CADF,EAiBGC,WAjBH,CADF;AAqBD,CAxBD;;AA0BAH,SAAS,CAACO,SAAV,2CAAsB;EACpB,cAAclC,SAAS,CAACmC,MADJ;EAEpBN,UAAU,EAAE7B,SAAS,CAACoC,KAAV,CAAgBhC,UAAU,CAAC8B,SAA3B,CAFQ;EAGpBvB,cAAc,EAAEX,SAAS,CAACoC,KAAV,CAAgB/B,cAAc,CAAC6B,SAA/B,CAHI;EAIpBzB,OAAO,EAAET,SAAS,CAACqC,SAAV,CAAoB,CAC3BrC,SAAS,CAACoC,KAAV,CAAgB;IACdxB,KAAK,EAAEZ,SAAS,CAACsC,OAAV,CAAkBtC,SAAS,CAACoC,KAAV,CAAgBnC,QAAQ,CAACiC,SAAzB,CAAlB,CADO;IAEdjB,IAAI,EAAEjB,SAAS,CAACuC,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFQ;IAGd1B,QAAQ,EAAEb,SAAS,CAACmC,MAHN;IAIdrB,MAAM,EAAEd,SAAS,CAACwC,IAJJ;IAKdzB,UAAU,EAAEf,SAAS,CAACyC;EALR,CAAhB,CAD2B,EAQ3BzC,SAAS,CAACoC,KAAV,cACK9B,yBAAyB,CAAC4B,SAD/B;IAEEjB,IAAI,EAAEjB,SAAS,CAACuC,KAAV,CAAgB,CAAC,6BAAD,CAAhB;EAFR,GAR2B,CAApB,CAJW;EAiBpBX,KAAK,EAAE5B,SAAS,CAACmC;AAjBG,CAAtB;AAoBA,eAAeR,SAAf"}
1
+ {"version":3,"file":"index.js","names":["React","findIndex","PropTypes","ListItem","DraggableList","Title","ButtonLink","SelectMultiple","ExpandibleActionableTable","style","buildListItemsView","content","ariaLabel","selectMultiple","items","itemType","onDrop","withSystemAll","itemsView","type","tags","map","item","contentType","index","id","list","listWithSelectMultiple","buildContentView","ListItems","title","buttonLink","contentView","header","actionsWrapper","buttonCreate","propTypes","string","shape","oneOfType","arrayOf","oneOf","func","bool"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport findIndex from 'lodash/fp/findIndex';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport DraggableList from '../../molecule/draggable-list';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport ExpandibleActionableTable from '../../molecule/expandible-actionable-table';\nimport style from './style.css';\n\nconst buildListItemsView = (content, ariaLabel, selectMultiple) => {\n const {items, itemType, onDrop, withSystemAll} = content;\n const itemsView =\n findIndex({type: 'published'}, items[0]?.tags) !== -1 &&\n itemType === 'certification' &&\n !withSystemAll ? (\n <DraggableList\n items={items.map(item => ({...item, contentType: itemType}))}\n itemType=\"list-item\"\n onDrop={onDrop}\n />\n ) : (\n items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} contentType={itemType} />\n </li>\n ))\n );\n return (\n <ul\n className={!selectMultiple ? style.list : style.listWithSelectMultiple}\n aria-label={ariaLabel}\n data-name={'content-list'}\n >\n {itemsView}\n </ul>\n );\n};\nconst buildContentView = (content, ariaLabel, selectMultiple) => {\n const {type} = content;\n switch (type) {\n case 'list':\n return buildListItemsView(content, ariaLabel, selectMultiple);\n case 'expandible-actionable-table':\n return <ExpandibleActionableTable {...content} />;\n }\n};\n\nconst ListItems = ({title, buttonLink, selectMultiple, content, 'aria-label': ariaLabel}) => {\n const contentView = buildContentView(content, ariaLabel, selectMultiple);\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.actionsWrapper}>\n {selectMultiple ? (\n <div className={style.selectMultiple}>\n <SelectMultiple {...selectMultiple} />\n </div>\n ) : null}\n\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n </div>\n {contentView}\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n selectMultiple: PropTypes.shape(SelectMultiple.propTypes),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n type: PropTypes.oneOf(['list']),\n itemType: PropTypes.string,\n onDrop: PropTypes.func,\n withSystemAll: PropTypes.bool\n }),\n PropTypes.shape({\n ...ExpandibleActionableTable.propTypes,\n type: PropTypes.oneOf(['expandible-actionable-table'])\n })\n ]),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,cAAP,MAA2B,gCAA3B;AACA,OAAOC,yBAAP,MAAsC,4CAAtC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CAACC,OAAD,EAAUC,SAAV,EAAqBC,cAArB,KAAwC;EACjE,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,MAAlB;IAA0BC;EAA1B,IAA2CN,OAAjD;EACA,MAAMO,SAAS,GACbjB,SAAS,CAAC;IAACkB,IAAI,EAAE;EAAP,CAAD,EAAsBL,KAAK,CAAC,CAAD,CAAL,EAAUM,IAAhC,CAAT,KAAmD,CAAC,CAApD,IACAL,QAAQ,KAAK,eADb,IAEA,CAACE,aAFD,gBAGE,oBAAC,aAAD;IACE,KAAK,EAAEH,KAAK,CA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randUpdate {
832
832
  type: PropTypes.Requireable<string>;
833
833
  itemType: PropTypes.Requireable<string>;
834
834
  onDrop: PropTypes.Requireable<(...args: any[]) => any>;
835
- displayAll: PropTypes.Requireable<boolean>;
835
+ withSystemAll: PropTypes.Requireable<boolean>;
836
836
  }> | PropTypes.InferProps<{
837
837
  type: PropTypes.Requireable<string>;
838
838
  columns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -84,7 +84,7 @@ declare namespace ListItems {
84
84
  type: PropTypes.Requireable<string>;
85
85
  itemType: PropTypes.Requireable<string>;
86
86
  onDrop: PropTypes.Requireable<(...args: any[]) => any>;
87
- displayAll: PropTypes.Requireable<boolean>;
87
+ withSystemAll: PropTypes.Requireable<boolean>;
88
88
  }> | PropTypes.InferProps<{
89
89
  type: PropTypes.Requireable<string>;
90
90
  columns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -32,11 +32,11 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
32
32
  items,
33
33
  itemType,
34
34
  onDrop,
35
- displayAll
35
+ withSystemAll
36
36
  } = content;
37
37
  const itemsView = (0, _findIndex.default)({
38
38
  type: 'published'
39
- }, items[0]?.tags) !== -1 && itemType === 'certification' && !displayAll ? /*#__PURE__*/_react.default.createElement(_draggableList.default, {
39
+ }, items[0]?.tags) !== -1 && itemType === 'certification' && !withSystemAll ? /*#__PURE__*/_react.default.createElement(_draggableList.default, {
40
40
  items: items.map(item => _extends({}, item, {
41
41
  contentType: itemType
42
42
  })),
@@ -104,7 +104,7 @@ ListItems.propTypes = process.env.NODE_ENV !== "production" ? {
104
104
  type: _propTypes.default.oneOf(['list']),
105
105
  itemType: _propTypes.default.string,
106
106
  onDrop: _propTypes.default.func,
107
- displayAll: _propTypes.default.bool
107
+ withSystemAll: _propTypes.default.bool
108
108
  }), _propTypes.default.shape(_extends({}, _expandibleActionableTable.default.propTypes, {
109
109
  type: _propTypes.default.oneOf(['expandible-actionable-table'])
110
110
  }))]),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["buildListItemsView","content","ariaLabel","selectMultiple","items","itemType","onDrop","displayAll","itemsView","findIndex","type","tags","map","item","contentType","index","id","style","list","listWithSelectMultiple","buildContentView","ListItems","title","buttonLink","contentView","header","actionsWrapper","buttonCreate","propTypes","PropTypes","string","shape","ButtonLink","SelectMultiple","oneOfType","arrayOf","ListItem","oneOf","func","bool","ExpandibleActionableTable"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport findIndex from 'lodash/fp/findIndex';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport DraggableList from '../../molecule/draggable-list';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport ExpandibleActionableTable from '../../molecule/expandible-actionable-table';\nimport style from './style.css';\n\nconst buildListItemsView = (content, ariaLabel, selectMultiple) => {\n const {items, itemType, onDrop, displayAll} = content;\n const itemsView =\n findIndex({type: 'published'}, items[0]?.tags) !== -1 &&\n itemType === 'certification' &&\n !displayAll ? (\n <DraggableList\n items={items.map(item => ({...item, contentType: itemType}))}\n itemType=\"list-item\"\n onDrop={onDrop}\n />\n ) : (\n items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} contentType={itemType} />\n </li>\n ))\n );\n return (\n <ul\n className={!selectMultiple ? style.list : style.listWithSelectMultiple}\n aria-label={ariaLabel}\n data-name={'content-list'}\n >\n {itemsView}\n </ul>\n );\n};\nconst buildContentView = (content, ariaLabel, selectMultiple) => {\n const {type} = content;\n switch (type) {\n case 'list':\n return buildListItemsView(content, ariaLabel, selectMultiple);\n case 'expandible-actionable-table':\n return <ExpandibleActionableTable {...content} />;\n }\n};\n\nconst ListItems = ({title, buttonLink, selectMultiple, content, 'aria-label': ariaLabel}) => {\n const contentView = buildContentView(content, ariaLabel, selectMultiple);\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.actionsWrapper}>\n {selectMultiple ? (\n <div className={style.selectMultiple}>\n <SelectMultiple {...selectMultiple} />\n </div>\n ) : null}\n\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n </div>\n {contentView}\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n selectMultiple: PropTypes.shape(SelectMultiple.propTypes),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n type: PropTypes.oneOf(['list']),\n itemType: PropTypes.string,\n onDrop: PropTypes.func,\n displayAll: PropTypes.bool\n }),\n PropTypes.shape({\n ...ExpandibleActionableTable.propTypes,\n type: PropTypes.oneOf(['expandible-actionable-table'])\n })\n ]),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CAACC,OAAD,EAAUC,SAAV,EAAqBC,cAArB,KAAwC;EACjE,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,MAAlB;IAA0BC;EAA1B,IAAwCN,OAA9C;EACA,MAAMO,SAAS,GACb,IAAAC,kBAAA,EAAU;IAACC,IAAI,EAAE;EAAP,CAAV,EAA+BN,KAAK,CAAC,CAAD,CAAL,EAAUO,IAAzC,MAAmD,CAAC,CAApD,IACAN,QAAQ,KAAK,eADb,IAEA,CAACE,UAFD,gBAGE,6BAAC,sBAAD;IACE,KAAK,EAAEH,KAAK,CAACQ,GAAN,CAAUC,IAAI,iBAASA,IAAT;MAAeC,WAAW,EAAET;IAA5B,EAAd,CADT;IAEE,QAAQ,EAAC,WAFX;IAGE,MAAM,EAAEC;EAHV,EAHF,GASEF,KAAK,CAACQ,GAAN,CAAU,CAACC,IAAD,EAAOE,KA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AIX,IALN,eAOE;IAAK,SAAS,EAAEc,cAAA,CAAMU;EAAtB,gBACE,6BAAC,mBAAD,EAAgBJ,UAAhB,CADF,CAPF,CAJF,CADF,EAiBGC,WAjBH,CADF;AAqBD,CAxBD;;AA0BAH,SAAS,CAACO,SAAV,2CAAsB;EACpB,cAAcC,kBAAA,CAAUC,MADJ;EAEpBP,UAAU,EAAEM,kBAAA,CAAUE,KAAV,CAAgBC,mBAAA,CAAWJ,SAA3B,CAFQ;EAGpBzB,cAAc,EAAE0B,kBAAA,CAAUE,KAAV,CAAgBE,uBAAA,CAAeL,SAA/B,CAHI;EAIpB3B,OAAO,EAAE4B,kBAAA,CAAUK,SAAV,CAAoB,CAC3BL,kBAAA,CAAUE,KAAV,CAAgB;IACd3B,KAAK,EAAEyB,kBAAA,CAAUM,OAAV,CAAkBN,kBAAA,CAAUE,KAAV,CAAgBK,iBAAA,CAASR,SAAzB,CAAlB,CADO;IAEdlB,IAAI,EAAEmB,kBAAA,CAAUQ,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFQ;IAGdhC,QAAQ,EAAEwB,kBAAA,CAAUC,MAHN;IAIdxB,MAAM,EAAEuB,kBAAA,CAAUS,IAJJ;IAKd/B,UAAU,EAAEsB,kBAAA,CAAUU;EALR,CAAhB,CAD2B,EAQ3BV,kBAAA,CAAUE,KAAV,cACKS,kCAAA,CAA0BZ,SAD/B;IAEElB,IAAI,EAAEmB,kBAAA,CAAUQ,KAAV,CAAgB,CAAC,6BAAD,CAAhB;EAFR,GAR2B,CAApB,CAJW;EAiBpBf,KAAK,EAAEO,kBAAA,CAAUC;AAjBG,CAAtB;eAoBeT,S"}
1
+ {"version":3,"file":"index.js","names":["buildListItemsView","content","ariaLabel","selectMultiple","items","itemType","onDrop","withSystemAll","itemsView","findIndex","type","tags","map","item","contentType","index","id","style","list","listWithSelectMultiple","buildContentView","ListItems","title","buttonLink","contentView","header","actionsWrapper","buttonCreate","propTypes","PropTypes","string","shape","ButtonLink","SelectMultiple","oneOfType","arrayOf","ListItem","oneOf","func","bool","ExpandibleActionableTable"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport findIndex from 'lodash/fp/findIndex';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport DraggableList from '../../molecule/draggable-list';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport SelectMultiple from '../../molecule/select-multiple';\nimport ExpandibleActionableTable from '../../molecule/expandible-actionable-table';\nimport style from './style.css';\n\nconst buildListItemsView = (content, ariaLabel, selectMultiple) => {\n const {items, itemType, onDrop, withSystemAll} = content;\n const itemsView =\n findIndex({type: 'published'}, items[0]?.tags) !== -1 &&\n itemType === 'certification' &&\n !withSystemAll ? (\n <DraggableList\n items={items.map(item => ({...item, contentType: itemType}))}\n itemType=\"list-item\"\n onDrop={onDrop}\n />\n ) : (\n items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} contentType={itemType} />\n </li>\n ))\n );\n return (\n <ul\n className={!selectMultiple ? style.list : style.listWithSelectMultiple}\n aria-label={ariaLabel}\n data-name={'content-list'}\n >\n {itemsView}\n </ul>\n );\n};\nconst buildContentView = (content, ariaLabel, selectMultiple) => {\n const {type} = content;\n switch (type) {\n case 'list':\n return buildListItemsView(content, ariaLabel, selectMultiple);\n case 'expandible-actionable-table':\n return <ExpandibleActionableTable {...content} />;\n }\n};\n\nconst ListItems = ({title, buttonLink, selectMultiple, content, 'aria-label': ariaLabel}) => {\n const contentView = buildContentView(content, ariaLabel, selectMultiple);\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.actionsWrapper}>\n {selectMultiple ? (\n <div className={style.selectMultiple}>\n <SelectMultiple {...selectMultiple} />\n </div>\n ) : null}\n\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n </div>\n {contentView}\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n selectMultiple: PropTypes.shape(SelectMultiple.propTypes),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n type: PropTypes.oneOf(['list']),\n itemType: PropTypes.string,\n onDrop: PropTypes.func,\n withSystemAll: PropTypes.bool\n }),\n PropTypes.shape({\n ...ExpandibleActionableTable.propTypes,\n type: PropTypes.oneOf(['expandible-actionable-table'])\n })\n ]),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CAACC,OAAD,EAAUC,SAAV,EAAqBC,cAArB,KAAwC;EACjE,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,MAAlB;IAA0BC;EAA1B,IAA2CN,OAAjD;EACA,MAAMO,SAAS,GACb,IAAAC,kBAAA,EAAU;IAACC,IAAI,EAAE;EAAP,CAAV,EAA+BN,KAAK,CAAC,CAAD,CAAL,EAAUO,IAAzC,MAAmD,CAAC,CAApD,IACAN,QAAQ,KAAK,eADb,IAEA,CAACE,aAFD,gBAGE,6BAAC,sBAAD;IACE,KAAK,EAAEH,KAAK,CAACQ,GAAN,CAAUC,IAAI,iBAASA,IAAT;MAAeC,WAAW,EAAET;IAA5B,EAAd,CADT;IAEE,QAAQ,EAAC,WAFX;IAGE,MAAM,EAAEC;EAHV,EAHF,GASEF,KAAK,CAACQ,GAAN,CAAU,CAACC,IAAD,EAAOE,KAAP,kBACR;IAAI,GAAG,EAAEF,IAAI,CAACG,EAAd;IAAkB,SAAS,EAAEC,cAAA,CAAMJ,IAAnC;IAAyC,aAAY,WAAUE,KAAM;EAArE,gBACE,6BAAC,iBAAD,eAAcF,IAAd;IAAoB,WAAW,EAAER;EAAjC,GADF,CADF,CAV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cC,kBAAA,CAAUC,MADJ;EAEpBP,UAAU,EAAEM,kBAAA,CAAUE,KAAV,CAAgBC,mBAAA,CAAWJ,SAA3B,CAFQ;EAGpBzB,cAAc,EAAE0B,kBAAA,CAAUE,KAAV,CAAgBE,uBAAA,CAAeL,SAA/B,CAHI;EAIpB3B,OAAO,EAAE4B,kBAAA,CAAUK,SAAV,CAAoB,CAC3BL,kBAAA,CAAUE,KAAV,CAAgB;IACd3B,KAAK,EAAEyB,kBAAA,CAAUM,OAAV,CAAkBN,kBAAA,CAAUE,KAAV,CAAgBK,iBAAA,CAASR,SAAzB,CAAlB,CADO;IAEdlB,IAAI,EAAEmB,kBAAA,CAAUQ,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFQ;IAGdhC,QAAQ,EAAEwB,kBAAA,CAAUC,MAHN;IAIdxB,MAAM,EAAEuB,kBAAA,CAAUS,IAJJ;IAKd/B,aAAa,EAAEsB,kBAAA,CAAUU;EALX,CAAhB,CAD2B,EAQ3BV,kBAAA,CAAUE,KAAV,cACKS,kCAAA,CAA0BZ,SAD/B;IAEElB,IAAI,EAAEmB,kBAAA,CAAUQ,KAAV,CAAgB,CAAC,6BAAD,CAAhB;EAFR,GAR2B,CAApB,CAJW;EAiBpBf,KAAK,EAAEO,kBAAA,CAAUC;AAjBG,CAAtB;eAoBeT,S"}
@@ -832,7 +832,7 @@ declare namespace BrandUpdate {
832
832
  type: PropTypes.Requireable<string>;
833
833
  itemType: PropTypes.Requireable<string>;
834
834
  onDrop: PropTypes.Requireable<(...args: any[]) => any>;
835
- displayAll: PropTypes.Requireable<boolean>;
835
+ withSystemAll: PropTypes.Requireable<boolean>;
836
836
  }> | PropTypes.InferProps<{
837
837
  type: PropTypes.Requireable<string>;
838
838
  columns: PropTypes.Requireable<(PropTypes.InferProps<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.14.15-alpha.26+1469a38a3",
3
+ "version": "11.14.15-alpha.27+075141da7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -168,5 +168,5 @@
168
168
  "last 2 versions",
169
169
  "IE 11"
170
170
  ],
171
- "gitHead": "1469a38a3d54229bc0d91ffeefb28020af4ce625"
171
+ "gitHead": "075141da707fa7e1cd63481e11e71c4f579403a4"
172
172
  }