@coorpacademy/components 11.14.15-alpha2.27 → 11.14.15-alpha2.29

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
- withSystemAll: PropTypes.Requireable<boolean>;
87
+ isDraggable: PropTypes.Requireable<boolean>;
88
88
  }> | PropTypes.InferProps<{
89
89
  type: PropTypes.Requireable<string>;
90
90
  columns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAiDA;;;;;;gBAwBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAkDA;;;;;;gBAwBC"}
@@ -16,11 +16,11 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
16
16
  items,
17
17
  itemType,
18
18
  onDrop,
19
- withSystemAll
19
+ isDraggable = false
20
20
  } = content;
21
21
  const itemsView = findIndex({
22
22
  type: 'published'
23
- }, items[0]?.tags) !== -1 && itemType === 'certification' && !withSystemAll ? /*#__PURE__*/React.createElement(DraggableList, {
23
+ }, items[0]?.tags) !== -1 && itemType === 'certification' && isDraggable && items.length > 1 ? /*#__PURE__*/React.createElement(DraggableList, {
24
24
  items: items.map(item => _extends({}, item, {
25
25
  contentType: itemType
26
26
  })),
@@ -31,6 +31,7 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
31
31
  className: style.item,
32
32
  "data-name": `content-${index}`
33
33
  }, /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
34
+ order: null,
34
35
  contentType: itemType
35
36
  }))));
36
37
  return /*#__PURE__*/React.createElement("ul", {
@@ -88,7 +89,7 @@ ListItems.propTypes = process.env.NODE_ENV !== "production" ? {
88
89
  type: PropTypes.oneOf(['list']),
89
90
  itemType: PropTypes.string,
90
91
  onDrop: PropTypes.func,
91
- withSystemAll: PropTypes.bool
92
+ isDraggable: PropTypes.bool
92
93
  }), PropTypes.shape(_extends({}, ExpandibleActionableTable.propTypes, {
93
94
  type: PropTypes.oneOf(['expandible-actionable-table'])
94
95
  }))]),
@@ -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","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,GA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ACmC,MAHN;IAIdrB,MAAM,EAAEd,SAAS,CAACwC,IAJJ;IAKdzB,aAAa,EAAEf,SAAS,CAACyC;EALX,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","isDraggable","itemsView","type","tags","length","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, isDraggable = false} = content;\n const itemsView =\n findIndex({type: 'published'}, items[0]?.tags) !== -1 &&\n itemType === 'certification' &&\n isDraggable &&\n items.length > 1 ? (\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} order={null} 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 isDraggable: 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,gCAA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kBvC,SAAS,CAACqC,KAAV,CAAgBpC,QAAQ,CAACkC,SAAzB,CAAlB,CADO;IAEdlB,IAAI,EAAEjB,SAAS,CAACwC,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFQ;IAGd3B,QAAQ,EAAEb,SAAS,CAACoC,MAHN;IAIdtB,MAAM,EAAEd,SAAS,CAACyC,IAJJ;IAKd1B,WAAW,EAAEf,SAAS,CAAC0C;EALT,CAAhB,CAD2B,EAQ3B1C,SAAS,CAACqC,KAAV,cACK/B,yBAAyB,CAAC6B,SAD/B;IAEElB,IAAI,EAAEjB,SAAS,CAACwC,KAAV,CAAgB,CAAC,6BAAD,CAAhB;EAFR,GAR2B,CAApB,CAJW;EAiBpBX,KAAK,EAAE7B,SAAS,CAACoC;AAjBG,CAAtB;AAoBA,eAAeR,SAAf"}
@@ -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
- withSystemAll: PropTypes.Requireable<boolean>;
835
+ isDraggable: 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
- withSystemAll: PropTypes.Requireable<boolean>;
87
+ isDraggable: PropTypes.Requireable<boolean>;
88
88
  }> | PropTypes.InferProps<{
89
89
  type: PropTypes.Requireable<string>;
90
90
  columns: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAiDA;;;;;;gBAwBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAkDA;;;;;;gBAwBC"}
@@ -32,11 +32,11 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
32
32
  items,
33
33
  itemType,
34
34
  onDrop,
35
- withSystemAll
35
+ isDraggable = false
36
36
  } = content;
37
37
  const itemsView = (0, _findIndex.default)({
38
38
  type: 'published'
39
- }, items[0]?.tags) !== -1 && itemType === 'certification' && !withSystemAll ? /*#__PURE__*/_react.default.createElement(_draggableList.default, {
39
+ }, items[0]?.tags) !== -1 && itemType === 'certification' && isDraggable && items.length > 1 ? /*#__PURE__*/_react.default.createElement(_draggableList.default, {
40
40
  items: items.map(item => _extends({}, item, {
41
41
  contentType: itemType
42
42
  })),
@@ -47,6 +47,7 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
47
47
  className: _style.default.item,
48
48
  "data-name": `content-${index}`
49
49
  }, /*#__PURE__*/_react.default.createElement(_listItem.default, _extends({}, item, {
50
+ order: null,
50
51
  contentType: itemType
51
52
  }))));
52
53
  return /*#__PURE__*/_react.default.createElement("ul", {
@@ -104,7 +105,7 @@ ListItems.propTypes = process.env.NODE_ENV !== "production" ? {
104
105
  type: _propTypes.default.oneOf(['list']),
105
106
  itemType: _propTypes.default.string,
106
107
  onDrop: _propTypes.default.func,
107
- withSystemAll: _propTypes.default.bool
108
+ isDraggable: _propTypes.default.bool
108
109
  }), _propTypes.default.shape(_extends({}, _expandibleActionableTable.default.propTypes, {
109
110
  type: _propTypes.default.oneOf(['expandible-actionable-table'])
110
111
  }))]),
@@ -1 +1 @@
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,CAVJ;EAgBA,oBACE;IACE,SAAS,EAAE,CAACF,c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AEM,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"}
1
+ {"version":3,"file":"index.js","names":["buildListItemsView","content","ariaLabel","selectMultiple","items","itemType","onDrop","isDraggable","itemsView","findIndex","type","tags","length","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, isDraggable = false} = content;\n const itemsView =\n findIndex({type: 'published'}, items[0]?.tags) !== -1 &&\n itemType === 'certification' &&\n isDraggable &&\n items.length > 1 ? (\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} order={null} 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 isDraggable: 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,WAAW,GAAG;EAAxC,IAAiDN,OAAvD;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,IAEAE,WAFA,IAGAH,KAAK,CAACQ,MAAN,GAAe,CAHf,gBAIE,6BAAC,sBAAD;IACE,KAAK,EAAER,KAAK,CAACS,GAAN,CAAUC,IAAI,iBAASA,IAAT;MAAeC,WAAW,EAAEV;IAA5B,EAAd,CADT;IAEE,QAAQ,EAAC,WAFX;IAGE,MAAM,EAAEC;EAHV,EAJF,GAUEF,KAAK,CAACS,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,KAAK,EAAE,IAA3B;IAAiC,WAAW,EAAET;EAA9C,GADF,CADF,CAXJ;EAiBA,oBACE;IACE,SAAS,EAAE,CAACF,cAAD,GAAkBe,cAAA,CAAMC,IAAxB,GAA+BD,cAAA,CAAME,sBADlD;IAEE,cAAYlB,SAFd;IAGE,aAAW;EAHb,GAKGM,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,CAAgBE,uBAAA,CAAeL,SAA/B,CAHI;EAIpB5B,OAAO,EAAE6B,kBAAA,CAAUK,SAAV,CAAoB,CAC3BL,kBAAA,CAAUE,KAAV,CAAgB;IACd5B,KAAK,EAAE0B,kBAAA,CAAUM,OAAV,CAAkBN,kBAAA,CAAUE,KAAV,CAAgBK,iBAAA,CAASR,SAAzB,CAAlB,CADO;IAEdnB,IAAI,EAAEoB,kBAAA,CAAUQ,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFQ;IAGdjC,QAAQ,EAAEyB,kBAAA,CAAUC,MAHN;IAIdzB,MAAM,EAAEwB,kBAAA,CAAUS,IAJJ;IAKdhC,WAAW,EAAEuB,kBAAA,CAAUU;EALT,CAAhB,CAD2B,EAQ3BV,kBAAA,CAAUE,KAAV,cACKS,kCAAA,CAA0BZ,SAD/B;IAEEnB,IAAI,EAAEoB,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
- withSystemAll: PropTypes.Requireable<boolean>;
835
+ isDraggable: 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-alpha2.27+075141da7",
3
+ "version": "11.14.15-alpha2.29+6e94fee24",
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": "075141da707fa7e1cd63481e11e71c4f579403a4"
171
+ "gitHead": "6e94fee243ab6610141c6151fc0659866485b918"
172
172
  }